// fak

    .method fak
    .args   2                       // ( int n )
    .define n = 1
    .define OBJREF = 42
    .locals 2                       // int r, int i;
    .define r = 2
    .define i = 3        

   bipush 1   
   istore r			    // ( r = 1 )
   bipush 1
   istore i                         // ( i = 1 )    

while:
   iload i
   iload n
   isub                             // ( i - n )
   iflt do			    // if ( i < n ) 
   goto end_while		    

do:
  bipush OBJREF
  iload i
  bipush 1
  iadd				   // ( i + 1 )
  iload r
  invokevirtual imul		   // ( r * ( i + 1 ) )
  istore r
  bipush 1
  iload i
  iadd
  istore i			   // ( i++ )
  goto while   

end_while:
  iload r
  ireturn



// Integer multiplication.

.method imul
.args   3                       // ( int x, int y )
.define x = 1
.define y = 2                    
.locals 2                       // int p, int sign;
.define p = 3
.define sign = 4	

	bipush 1		
	istore sign		// sign = 1
	iload x
	IFLT if1		// ( x < 0 )
	goto end_if1		
if1:	
	bipush 0
	iload x
	isub
	istore x		// x = -x
	bipush 0
	istore sign		// sign = 0
	
end_if1:
        bipush 0
        istore p                // p = 0;

while:                          // while        
        iload x
	ifeq end_while		// ( x == 0 ) 
	iload x
        iflt  end_while         //    ( x > 0 )
                                // {
        iload x
        bipush 1
        isub
        istore x                //    x = x - 1;
        iload p
        iload y
        iadd
        istore p                //    p = p + y;
        goto while              // }
end_while:

	iload sign
	IFEQ if2		// ( sign == 0 )
	goto end_if2

if2:
	bipush 0
	iload p
	isub
	istore p		// ( p = -p )

end_if2:
        iload  p
        ireturn                 // return p;

.method main
.args	1
.define OBJREF = 44
  
        bipush OBJREF
	bipush 4
        invokevirtual fak      
        ireturn                 // return fak(4);