

===================== parser output ===============================

let rec compose  f g = 
   let rec composed  x = (g (f x))
   in composed
in 
   let rec dbl  x = (x + x)
   in 
      let rec inc  x = (x + 1)
      in 
         let rec dec  x = (x - 1)
         in 
            let h  = (compose inc (compose dbl dec))
            in (print_int (h 123))

===================== typing output ===============================

let rec compose  : ((int) -> int, (int) -> int) -> (int) -> int f : (int) -> int g : (int) -> int = 
   let rec composed  : (int) -> int x : int = (g (f x))
   in composed
in 
   let rec dbl  : (int) -> int x : int = (x + x)
   in 
      let rec inc  : (int) -> int x : int = (x + 1)
      in 
         let rec dec  : (int) -> int x : int = (x - 1)
         in 
            let h  : (int) -> int = (compose inc (compose dbl dec))
            in (print_int (h 123))

===================== knormal output ===============================

let compose  : ((int) -> int, (int) -> int) -> (int) -> intf : (int) -> int g : (int) -> int = 
   let composed  : (int) -> intx : int = 
      let Ti6  : int = (f x) in
      (g Ti6)
   in composed
in 
   let dbl  : (int) -> intx : int = (x + x)
   in 
      let inc  : (int) -> intx : int = 
         let Ti5  : int = 1 in
         (x + Ti5)
      in 
         let dec  : (int) -> intx : int = 
            let Ti4  : int = 1 in
            (x - Ti4)
         in 
            let h  : (int) -> int = let Tf1  : (int) -> int = (compose dbl dec) in
            (compose inc Tf1) in
            
            let Ti3  : int = let Ti2  : int = 123 in
            (h Ti2) in
            EXTERN(print_int Ti3)

===================== alpha output ===============================

let compose_7  : ((int) -> int, (int) -> int) -> (int) -> intf_8 : (int) -> int g_9 : (int) -> int = 
   let composed_22  : (int) -> intx_23 : int = 
      let Ti6_24  : int = (f_8 x_23) in
      (g_9 Ti6_24)
   in composed_22
in 
   let dbl_10  : (int) -> intx_11 : int = (x_11 + x_11)
   in 
      let inc_12  : (int) -> intx_13 : int = 
         let Ti5_21  : int = 1 in
         (x_13 + Ti5_21)
      in 
         let dec_14  : (int) -> intx_15 : int = 
            let Ti4_20  : int = 1 in
            (x_15 - Ti4_20)
         in 
            let h_16  : (int) -> int = let Tf1_19  : (int) -> int = (compose_7 dbl_10 dec_14) in
            (compose_7 inc_12 Tf1_19) in
            
            let Ti3_17  : int = let Ti2_18  : int = 123 in
            (h_16 Ti2_18) in
            EXTERN(print_int Ti3_17)

===================== simplify output ===============================

let compose_7  : ((int) -> int, (int) -> int) -> (int) -> intf_8 : (int) -> int g_9 : (int) -> int = 
   let composed_22  : (int) -> intx_23 : int = 
      let Ti6_24  : int = (f_8 x_23) in
      (g_9 Ti6_24)
   in composed_22
in 
   let dbl_10  : (int) -> intx_11 : int = (x_11 + x_11)
   in 
      let inc_12  : (int) -> intx_13 : int = 
         let Ti5_21  : int = 1 in
         (x_13 + Ti5_21)
      in 
         let dec_14  : (int) -> intx_15 : int = 
            let Ti4_20  : int = 1 in
            (x_15 - Ti4_20)
         in 
            let Tf1_19  : (int) -> int = (compose_7 dbl_10 dec_14) in
            
            let h_16  : (int) -> int = (compose_7 inc_12 Tf1_19) in
            
            let Ti2_18  : int = 123 in
            
            let Ti3_17  : int = (h_16 Ti2_18) in
            EXTERN(print_int Ti3_17)

===================== closure output ===============================
let LABEL(composed_22) [f_8 : (int) -> int, g_9 : (int) -> int] x_23 : int = 
   let Ti6_24  : int = APPLY_CLOSURE(f_8 x_23) in
   APPLY_CLOSURE(g_9 Ti6_24)
in

let LABEL(compose_7) [] f_8 : (int) -> int, g_9 : (int) -> int = 
   let closure composed_22  : (int) -> int = ( LABEL(composed_22); [f_8, g_9] )
   in composed_22
in

let LABEL(dbl_10) [] x_11 : int = (x_11 + x_11)
in

let LABEL(inc_12) [] x_13 : int = 
   let Ti5_21  : int = 1 in
   (x_13 + Ti5_21)
in

let LABEL(dec_14) [] x_15 : int = 
   let Ti4_20  : int = 1 in
   (x_15 - Ti4_20)
in

let closure dbl_10  : (int) -> int = ( LABEL(dbl_10); [] )
in 
   let closure inc_12  : (int) -> int = ( LABEL(inc_12); [] )
   in 
      let closure dec_14  : (int) -> int = ( LABEL(dec_14); [] )
      in 
         let Tf1_19  : (int) -> int = APPLY_DIRECT(LABEL(compose_7) dbl_10 dec_14) in
         
         let h_16  : (int) -> int = APPLY_DIRECT(LABEL(compose_7) inc_12 Tf1_19) in
         
         let Ti2_18  : int = 123 in
         
         let Ti3_17  : int = APPLY_CLOSURE(h_16 Ti2_18) in
         APPLY_DIRECT(LABEL(min_caml_print_int) Ti3_17)

===================== virtual  output ===============================
==== Data Segment =======
==== Function Declarations =======

LABEL(composed_22) (arg=(x_23), farg=())

LET(g_9, ld(%o5, 8), 
   LET(f_8, ld(%o5, 4), 
      LET(Ti6_24, CallClosure(f_8, args=(x_23), farg=()), 
         ANSWER(CallClosure(g_9, args=(Ti6_24), farg=())))))

LABEL(compose_7) (arg=(f_8, g_9), farg=())

LET(composed_22, mov(%i1), 
   LET(%i1, add(%i1, 16), 
      LET(l_27, set(LABEL(composed_22)), 
         LET(Tu28, st(l_27, composed_22, 0), 
            LET(Tu26, st(g_9, composed_22, 8), 
               LET(Tu25, st(f_8, composed_22, 4), 
                  ANSWER(mov(composed_22))))))))

LABEL(dbl_10) (arg=(x_11), farg=())

ANSWER(add(x_11, x_11))

LABEL(inc_12) (arg=(x_13), farg=())

LET(Ti5_21, set(1), 
   ANSWER(add(x_13, Ti5_21)))

LABEL(dec_14) (arg=(x_15), farg=())

LET(Ti4_20, set(1), 
   ANSWER(sub(x_15, Ti4_20)))
==== Expression =======

LET(dbl_10, mov(%i1), 
   LET(%i1, add(%i1, 8), 
      LET(l_33, set(LABEL(dbl_10)), 
         LET(Tu34, st(l_33, dbl_10, 0), 
            LET(inc_12, mov(%i1), 
               LET(%i1, add(%i1, 8), 
                  LET(l_31, set(LABEL(inc_12)), 
                     LET(Tu32, st(l_31, inc_12, 0), 
                        LET(dec_14, mov(%i1), 
                           LET(%i1, add(%i1, 8), 
                              LET(l_29, set(LABEL(dec_14)), 
                                 LET(Tu30, st(l_29, dec_14, 0), 
                                    LET(Tf1_19, CallDirect(LABEL(compose_7), args=(dbl_10, dec_14), farg=()), 
                                       LET(h_16, CallDirect(LABEL(compose_7), args=(inc_12, Tf1_19), farg=()), 
                                          LET(Ti2_18, set(123), 
                                             LET(Ti3_17, CallClosure(h_16, args=(Ti2_18), farg=()), 
                                                ANSWER(CallDirect(LABEL(min_caml_print_int), args=(Ti3_17), farg=()))))))))))))))))))


=====================  simm13  output ===============================
==== Data Segment =======
==== Function Declarations =======

LABEL(composed_22) (arg=(x_23), farg=())

LET(g_9, ld(%o5, 8), 
   LET(f_8, ld(%o5, 4), 
      LET(Ti6_24, CallClosure(f_8, args=(x_23), farg=()), 
         ANSWER(CallClosure(g_9, args=(Ti6_24), farg=())))))

LABEL(compose_7) (arg=(f_8, g_9), farg=())

LET(composed_22, mov(%i1), 
   LET(%i1, add(%i1, 16), 
      LET(l_27, set(LABEL(composed_22)), 
         LET(Tu28, st(l_27, composed_22, 0), 
            LET(Tu26, st(g_9, composed_22, 8), 
               LET(Tu25, st(f_8, composed_22, 4), 
                  ANSWER(mov(composed_22))))))))

LABEL(dbl_10) (arg=(x_11), farg=())

ANSWER(add(x_11, x_11))

LABEL(inc_12) (arg=(x_13), farg=())

ANSWER(add(x_13, 1))

LABEL(dec_14) (arg=(x_15), farg=())

ANSWER(sub(x_15, 1))
==== Expression =======

LET(dbl_10, mov(%i1), 
   LET(%i1, add(%i1, 8), 
      LET(l_33, set(LABEL(dbl_10)), 
         LET(Tu34, st(l_33, dbl_10, 0), 
            LET(inc_12, mov(%i1), 
               LET(%i1, add(%i1, 8), 
                  LET(l_31, set(LABEL(inc_12)), 
                     LET(Tu32, st(l_31, inc_12, 0), 
                        LET(dec_14, mov(%i1), 
                           LET(%i1, add(%i1, 8), 
                              LET(l_29, set(LABEL(dec_14)), 
                                 LET(Tu30, st(l_29, dec_14, 0), 
                                    LET(Tf1_19, CallDirect(LABEL(compose_7), args=(dbl_10, dec_14), farg=()), 
                                       LET(h_16, CallDirect(LABEL(compose_7), args=(inc_12, Tf1_19), farg=()), 
                                          LET(Ti2_18, set(123), 
                                             LET(Ti3_17, CallClosure(h_16, args=(Ti2_18), farg=()), 
                                                ANSWER(CallDirect(LABEL(min_caml_print_int), args=(Ti3_17), farg=()))))))))))))))))))


===================== RegAlloc output ===============================
==== Data Segment =======
==== Function Declarations =======

LABEL(composed_22) (arg=(%i2), farg=())

LET(%i3, ld(%o5, 8), 
   LET(%g0, save(%i3, g_9), 
      LET(%o5, ld(%o5, 4), 
         LET(%i2, CallClosure(%o5, args=(%i2), farg=()), 
            LET(%i2, mov(%i2), 
               LET(%o5, restore(g_9), 
                  ANSWER(CallClosure(%o5, args=(%i2), farg=()))))))))

LABEL(compose_7) (arg=(%i2, %i3), farg=())

LET(%i4, mov(%i1), 
   LET(%i1, add(%i1, 16), 
      LET(%i5, set(LABEL(composed_22)), 
         LET(%g0, st(%i5, %i4, 0), 
            LET(%g0, st(%i3, %i4, 8), 
               LET(%g0, st(%i2, %i4, 4), 
                  ANSWER(mov(%i4))))))))

LABEL(dbl_10) (arg=(%i2), farg=())

ANSWER(add(%i2, %i2))

LABEL(inc_12) (arg=(%i2), farg=())

ANSWER(add(%i2, 1))

LABEL(dec_14) (arg=(%i2), farg=())

ANSWER(sub(%i2, 1))
==== Expression =======

LET(%i2, mov(%i1), 
   LET(%i1, add(%i1, 8), 
      LET(%i3, set(LABEL(dbl_10)), 
         LET(%g0, st(%i3, %i2, 0), 
            LET(%i3, mov(%i1), 
               LET(%g0, save(%i3, inc_12), 
                  LET(%i1, add(%i1, 8), 
                     LET(%i4, set(LABEL(inc_12)), 
                        LET(%g0, st(%i4, %i3, 0), 
                           LET(%i3, mov(%i1), 
                              LET(%i1, add(%i1, 8), 
                                 LET(%i4, set(LABEL(dec_14)), 
                                    LET(%g0, st(%i4, %i3, 0), 
                                       LET(%i2, CallDirect(LABEL(compose_7), args=(%i2, %i3), farg=()), 
                                          LET(%i3, mov(%i2), 
                                             LET(%i2, restore(inc_12), 
                                                LET(%o5, CallDirect(LABEL(compose_7), args=(%i2, %i3), farg=()), 
                                                   LET(%i2, set(123), 
                                                      LET(%i2, CallClosure(%o5, args=(%i2), farg=()), 
                                                         ANSWER(CallDirect(LABEL(min_caml_print_int), args=(%i2), farg=())))))))))))))))))))))


===================== Emit output ===============================
.section	".rodata"
.align	8
.section	".text"
composed_22:
	ld	[%o5 + 8], %i3
	st	%i3, [%i0 + 0]
	ld	[%o5 + 4], %o5
	st	%o7, [%i0 + 4]
	ld	[%o5 + 0], %o4
	call	%o4
	add	%i0, 8, %i0	! delay slot
	sub	%i0, 8, %i0
	ld	[%i0 + 4], %o7
	ld	[%i0 + 0], %o5
	ld	[%o5 + 0], %o4
	jmp	%o4
	nop
compose_7:
	mov	%i1, %i4
	add	%i1, 16, %i1
	set	composed_22, %i5
	st	%i5, [%i4 + 0]
	st	%i3, [%i4 + 8]
	st	%i2, [%i4 + 4]
	mov	%i4, %i2
	retl
	nop
dbl_10:
	add	%i2, %i2, %i2
	retl
	nop
inc_12:
	add	%i2, 1, %i2
	retl
	nop
dec_14:
	sub	%i2, 1, %i2
	retl
	nop
.global	min_caml_start
min_caml_start:
	save	%sp, -112, %sp
	mov	%i1, %i2
	add	%i1, 8, %i1
	set	dbl_10, %i3
	st	%i3, [%i2 + 0]
	mov	%i1, %i3
	st	%i3, [%i0 + 0]
	add	%i1, 8, %i1
	set	inc_12, %i4
	st	%i4, [%i3 + 0]
	mov	%i1, %i3
	add	%i1, 8, %i1
	set	dec_14, %i4
	st	%i4, [%i3 + 0]
	st	%o7, [%i0 + 4]
	call	compose_7
	add	%i0, 8, %i0	! delay slot
	sub	%i0, 8, %i0
	ld	[%i0 + 4], %o7
	mov	%i2, %i3
	ld	[%i0 + 0], %i2
	st	%o7, [%i0 + 4]
	call	compose_7
	add	%i0, 8, %i0	! delay slot
	sub	%i0, 8, %i0
	ld	[%i0 + 4], %o7
	mov	%i2, %o5
	set	123, %i2
	st	%o7, [%i0 + 4]
	ld	[%o5 + 0], %o4
	call	%o4
	add	%i0, 8, %i0	! delay slot
	sub	%i0, 8, %i0
	ld	[%i0 + 4], %o7
	st	%o7, [%i0 + 4]
	call	min_caml_print_int
	add	%i0, 8, %i0	! delay slot
	sub	%i0, 8, %i0
	ld	[%i0 + 4], %o7
	ret
	restore
