# JAVA class translation 'COS_JavaTest'
       # Thu Jun 30 17:00:06 EDT 2005
       # Produced by Fritzifier, based on JasminVisitor
       # Using BCEL library to read Java bytecode
       # Here is the original code:
       # public class COS_JavaTest {
       #     private int q = 0;
       #     public int add(int x, int y) {
       #         return x+y;
       #     }
       #     public int sub(int x, int y) {
       #         return x-y;
       #     }
       #     public int mult(int x, int y) {
       #         return x*y;
       #     }
       #     public int addmult(int x, int y, int z) {
       #         return add(x,mult(y,z));
       #     }
       #     public void set(int x) {
       #         q = x;
       #     }
       #     public int get() {
       #         return q;
       #     }
       #     public int fact(int x) {
       #         return (x>0)?(x*fact(sub(x,1))):1;
       #     }
       # }
       
[hear] (class COS_JavaTest ()
          (field super-ref (make-cell 0))
          (method new (set! (super-ref) ((java lang Object) / this)))
          (method super (? x / (get! / super-ref) / x))
          (method unknown (? x / self super / x))
          (field q ((int) new))
          (method <init>-V
            (lambda () /
             let ((vars / cell new / make-hash / vector
                           (pair 0 (self)))
                  (stack / cell new / vector)) /
             state-machine (vars) (stack) / ? jvm / ? x / cond
                ((= (x) 0) (jvm aload 0))
                ((= (x) 1) (jvm invokespecial <init>-V 0 0))
                ((= (x) 2) (jvm aload 0))
                ((= (x) 3) (jvm iconst 0))
                ((= (x) 4) (jvm putfield q (int)))
                ((= (x) 5) (jvm return))
                (jvm return))
          )
          (method <init> (self <init>-V))
          (method add-I-I-I
            (lambda (arg0 arg1) /
             let ((vars / cell new / make-hash / vector
                           (pair 0 (self)) (pair 1 (arg0)) (pair 2 (arg1)))
                  (stack / cell new / vector)) /
             state-machine (vars) (stack) / ? jvm / ? x / cond
                ((= (x) 0) (jvm iload 1))
                ((= (x) 1) (jvm iload 2))
                ((= (x) 2) (jvm iadd))
                ((= (x) 3) (jvm ireturn))
                (jvm return))
          )
          (method add (self add-I-I-I))
          (method sub-I-I-I
            (lambda (arg0 arg1) /
             let ((vars / cell new / make-hash / vector
                           (pair 0 (self)) (pair 1 (arg0)) (pair 2 (arg1)))
                  (stack / cell new / vector)) /
             state-machine (vars) (stack) / ? jvm / ? x / cond
                ((= (x) 0) (jvm iload 1))
                ((= (x) 1) (jvm iload 2))
                ((= (x) 2) (jvm isub))
                ((= (x) 3) (jvm ireturn))
                (jvm return))
          )
          (method sub (self sub-I-I-I))
          (method mult-I-I-I
            (lambda (arg0 arg1) /
             let ((vars / cell new / make-hash / vector
                           (pair 0 (self)) (pair 1 (arg0)) (pair 2 (arg1)))
                  (stack / cell new / vector)) /
             state-machine (vars) (stack) / ? jvm / ? x / cond
                ((= (x) 0) (jvm iload 1))
                ((= (x) 1) (jvm iload 2))
                ((= (x) 2) (jvm imul))
                ((= (x) 3) (jvm ireturn))
                (jvm return))
          )
          (method mult (self mult-I-I-I))
          (method addmult-I-I-I-I
            (lambda (arg0 arg1 arg2) /
             let ((vars / cell new / make-hash / vector
                           (pair 0 (self)) (pair 1 (arg0)) (pair 2 (arg1)) (pair 3 (arg2)))
                  (stack / cell new / vector)) /
             state-machine (vars) (stack) / ? jvm / ? x / cond
                ((= (x) 0) (jvm aload 0))
                ((= (x) 1) (jvm iload 1))
                ((= (x) 2) (jvm aload 0))
                ((= (x) 3) (jvm iload 2))
                ((= (x) 4) (jvm iload 3))
                ((= (x) 5) (jvm invokevirtual mult-I-I-I 2 1))
                ((= (x) 6) (jvm invokevirtual add-I-I-I 2 1))
                ((= (x) 7) (jvm ireturn))
                (jvm return))
          )
          (method addmult (self addmult-I-I-I-I))
          (method set-I-V
            (lambda (arg0) /
             let ((vars / cell new / make-hash / vector
                           (pair 0 (self)) (pair 1 (arg0)))
                  (stack / cell new / vector)) /
             state-machine (vars) (stack) / ? jvm / ? x / cond
                ((= (x) 0) (jvm aload 0))
                ((= (x) 1) (jvm iload 1))
                ((= (x) 2) (jvm putfield q (int)))
                ((= (x) 3) (jvm return))
                (jvm return))
          )
          (method set (self set-I-V))
          (method get-I
            (lambda () /
             let ((vars / cell new / make-hash / vector
                           (pair 0 (self)))
                  (stack / cell new / vector)) /
             state-machine (vars) (stack) / ? jvm / ? x / cond
                ((= (x) 0) (jvm aload 0))
                ((= (x) 1) (jvm getfield q (int)))
                ((= (x) 2) (jvm ireturn))
                (jvm return))
          )
          (method get (self get-I))
          (method fact-I-I
            (lambda (arg0) /
             let ((vars / cell new / make-hash / vector
                           (pair 0 (self)) (pair 1 (arg0)))
                  (stack / cell new / vector)) /
             state-machine (vars) (stack) / ? jvm / ? x / cond
                ((= (x) 0) (jvm iload 1))
                ((= (x) 1) (jvm ifle 11))
                ((= (x) 2) (jvm iload 1))
                ((= (x) 3) (jvm aload 0))
                ((= (x) 4) (jvm aload 0))
                ((= (x) 5) (jvm iload 1))
                ((= (x) 6) (jvm iconst 1))
                ((= (x) 7) (jvm invokevirtual sub-I-I-I 2 1))
                ((= (x) 8) (jvm invokevirtual fact-I-I 1 1))
                ((= (x) 9) (jvm imul))
                ((= (x) 10) (jvm goto 12))
                ((= (x) 11) (jvm iconst 1))
                ((= (x) 12) (jvm ireturn))
                (jvm return))
          )
          (method fact (self fact-I-I))
        );