

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

let rec ack  x y = 
   if (x <= 0)
   then (y + 1)
   else 
      if (y <= 0)
      then (ack (x - 1) 1)
      else (ack (x - 1) (ack x (y - 1)))
in (print_int (ack 3 10))

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

let rec ack  : (int, int) -> int x : int y : int = 
   if (x <= 0)
   then (y + 1)
   else 
      if (y <= 0)
      then (ack (x - 1) 1)
      else (ack (x - 1) (ack x (y - 1)))
in (print_int (ack 3 10))

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

let ack  : (int, int) -> intx : int y : int = 
   let Ti4  : int = 0 in
   
   if x <= Ti4 
   then 
      let Ti5  : int = 1 in
      (y + Ti5)
   else 
      let Ti6  : int = 0 in
      
      if y <= Ti6 
      then 
         let Ti8  : int = let Ti7  : int = 1 in
         (x - Ti7) in
         
         let Ti9  : int = 1 in
         (ack Ti8 Ti9)
      else 
         let Ti11  : int = let Ti10  : int = 1 in
         (x - Ti10) in
         
         let Ti14  : int = let Ti13  : int = let Ti12  : int = 1 in
         (y - Ti12) in
         (ack x Ti13) in
         (ack Ti11 Ti14)
in 
   let Ti3  : int = let Ti1  : int = 3 in
   
   let Ti2  : int = 10 in
   (ack Ti1 Ti2) in
   EXTERN(print_int Ti3)

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

let ack_15  : (int, int) -> intx_16 : int y_17 : int = 
   let Ti4_21  : int = 0 in
   
   if x_16 <= Ti4_21 
   then 
      let Ti5_31  : int = 1 in
      (y_17 + Ti5_31)
   else 
      let Ti6_22  : int = 0 in
      
      if y_17 <= Ti6_22 
      then 
         let Ti8_28  : int = let Ti7_30  : int = 1 in
         (x_16 - Ti7_30) in
         
         let Ti9_29  : int = 1 in
         (ack_15 Ti8_28 Ti9_29)
      else 
         let Ti11_23  : int = let Ti10_27  : int = 1 in
         (x_16 - Ti10_27) in
         
         let Ti14_24  : int = let Ti13_25  : int = let Ti12_26  : int = 1 in
         (y_17 - Ti12_26) in
         (ack_15 x_16 Ti13_25) in
         (ack_15 Ti11_23 Ti14_24)
in 
   let Ti3_18  : int = let Ti1_19  : int = 3 in
   
   let Ti2_20  : int = 10 in
   (ack_15 Ti1_19 Ti2_20) in
   EXTERN(print_int Ti3_18)

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

let ack_15  : (int, int) -> intx_16 : int y_17 : int = 
   let Ti4_21  : int = 0 in
   
   if x_16 <= Ti4_21 
   then 
      let Ti5_31  : int = 1 in
      (y_17 + Ti5_31)
   else 
      let Ti6_22  : int = 0 in
      
      if y_17 <= Ti6_22 
      then 
         let Ti7_30  : int = 1 in
         
         let Ti8_28  : int = (x_16 - Ti7_30) in
         
         let Ti9_29  : int = 1 in
         (ack_15 Ti8_28 Ti9_29)
      else 
         let Ti10_27  : int = 1 in
         
         let Ti11_23  : int = (x_16 - Ti10_27) in
         
         let Ti12_26  : int = 1 in
         
         let Ti13_25  : int = (y_17 - Ti12_26) in
         
         let Ti14_24  : int = (ack_15 x_16 Ti13_25) in
         (ack_15 Ti11_23 Ti14_24)
in 
   let Ti1_19  : int = 3 in
   
   let Ti2_20  : int = 10 in
   
   let Ti3_18  : int = (ack_15 Ti1_19 Ti2_20) in
   EXTERN(print_int Ti3_18)

===================== closure output ===============================
let LABEL(ack_15) [] x_16 : int, y_17 : int = 
   let Ti4_21  : int = 0 in
   
   if x_16 <= Ti4_21 
   then 
      let Ti5_31  : int = 1 in
      (y_17 + Ti5_31)
   else 
      let Ti6_22  : int = 0 in
      
      if y_17 <= Ti6_22 
      then 
         let Ti7_30  : int = 1 in
         
         let Ti8_28  : int = (x_16 - Ti7_30) in
         
         let Ti9_29  : int = 1 in
         APPLY_DIRECT(LABEL(ack_15) Ti8_28 Ti9_29)
      else 
         let Ti10_27  : int = 1 in
         
         let Ti11_23  : int = (x_16 - Ti10_27) in
         
         let Ti12_26  : int = 1 in
         
         let Ti13_25  : int = (y_17 - Ti12_26) in
         
         let Ti14_24  : int = APPLY_DIRECT(LABEL(ack_15) x_16 Ti13_25) in
         APPLY_DIRECT(LABEL(ack_15) Ti11_23 Ti14_24)
in

let Ti1_19  : int = 3 in

let Ti2_20  : int = 10 in

let Ti3_18  : int = APPLY_DIRECT(LABEL(ack_15) Ti1_19 Ti2_20) in
APPLY_DIRECT(LABEL(min_caml_print_int) Ti3_18)

===================== Intel asm ===============================
;==============================================================
; Intel Asm
;==============================================================
         .486
         .model flat, stdcall
         option casemap :none
         include \masm32\include\windows.inc
         include \masm32\include\masm32.inc
         include \masm32\include\kernel32.inc
         include \masm32\macros\macros.asm

         includelib \masm32\lib\masm32.lib
         includelib \masm32\lib\kernel32.lib

;==============================================================
         .data
Txt db ?, 0

;==============================================================
; Entry point:
         .code
start:
         FINIT
         PUSH  EBP
         MOV   EBP,  ESP
         SUB   ESP,  12
         ; Let Ti1_19 = 
         ; Integer 3
         MOV   EAX,  3
         MOV   [EBP-4],  EAX
         ; Let Ti2_20 = 
         ; Integer 10
         MOV   EAX,  10
         MOV   [EBP-8],  EAX
         ; Let Ti3_18 = 
         ; Apply direct ack_15
         PUSH  dword ptr [EBP-8]
         PUSH  dword ptr [EBP-4]
         CALL  ack_15
         ADD   ESP,  8
         MOV   [EBP-12],  EAX
         ; Apply direct min_caml_print_int
         PUSH  dword ptr [EBP-12]
         CALL  min_caml_print_int
         ADD   ESP,  4
         MOV   ESP,  EBP
         POP   EBP
         PUSH  0
         CALL  ExitProcess

;==============================================================
; Function ack_15:

ack_15 proc
         PUSH  EBP
         MOV   EBP,  ESP
         SUB   ESP,  44
         ; Let Ti4_21 = 
         ; Integer 0
         MOV   EAX,  0
         MOV   [EBP-4],  EAX
         ; If x_16 <= Ti4_21
         MOV   EAX,  [EBP+8]
         CMP   EAX,  [EBP-4]
         JG    else_34
         ; Let Ti5_31 = 
         ; Integer 1
         MOV   EAX,  1
         MOV   [EBP-8],  EAX
         ; Add y_17 + Ti5_31
         MOV   EAX,  [EBP+12]
         ADD   EAX,  [EBP-8]
         MOV   ESP,  EBP
         POP   EBP
         RET
else_34:
         ; Let Ti6_22 = 
         ; Integer 0
         MOV   EAX,  0
         MOV   [EBP-12],  EAX
         ; If y_17 <= Ti6_22
         MOV   EAX,  [EBP+12]
         CMP   EAX,  [EBP-12]
         JG    else_35
         ; Let Ti7_30 = 
         ; Integer 1
         MOV   EAX,  1
         MOV   [EBP-16],  EAX
         ; Let Ti8_28 = 
         ; Sub x_16 - Ti7_30
         MOV   EAX,  [EBP+8]
         SUB   EAX,  [EBP-16]
         MOV   [EBP-20],  EAX
         ; Let Ti9_29 = 
         ; Integer 1
         MOV   EAX,  1
         MOV   [EBP-24],  EAX
         ; Apply direct ack_15
         PUSH  dword ptr [EBP-24]
         PUSH  dword ptr [EBP-20]
         CALL  ack_15
         ADD   ESP,  8
         MOV   ESP,  EBP
         POP   EBP
         RET
else_35:
         ; Let Ti10_27 = 
         ; Integer 1
         MOV   EAX,  1
         MOV   [EBP-28],  EAX
         ; Let Ti11_23 = 
         ; Sub x_16 - Ti10_27
         MOV   EAX,  [EBP+8]
         SUB   EAX,  [EBP-28]
         MOV   [EBP-32],  EAX
         ; Let Ti12_26 = 
         ; Integer 1
         MOV   EAX,  1
         MOV   [EBP-36],  EAX
         ; Let Ti13_25 = 
         ; Sub y_17 - Ti12_26
         MOV   EAX,  [EBP+12]
         SUB   EAX,  [EBP-36]
         MOV   [EBP-40],  EAX
         ; Let Ti14_24 = 
         ; Apply direct ack_15
         PUSH  dword ptr [EBP-40]
         PUSH  dword ptr [EBP+8]
         CALL  ack_15
         ADD   ESP,  8
         MOV   [EBP-44],  EAX
         ; Apply direct ack_15
         PUSH  dword ptr [EBP-44]
         PUSH  dword ptr [EBP-32]
         CALL  ack_15
         ADD   ESP,  8
         MOV   ESP,  EBP
         POP   EBP
         RET
ack_15 endp

;==============================================================
include min_caml_intel.asm

END start

;==============================================================

