;==============================================================
; 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,  44
         ; Let x_8 = 
         ; Integer 17
         MOV   EAX,  17
         MOV   [EBP-4],  EAX
         ; Make closure f_9
         PUSH  8
         CALL  min_caml_malloc
         ADD   ESP,  4
         MOV   [EBP-8],  EAX
         MOV   EDI,  EAX
         MOV   [EDI],  f_9
         MOV   EAX,  [EBP-4]
         MOV   [EDI+4],  EAX
         ; Let Ti1_19 = 
         ; Integer 21
         MOV   EAX,  21
         MOV   [EBP-12],  EAX
         ; Let first_11 = 
         ; Apply closure f_9
         PUSH  ESI
         MOV   ESI,  [EBP-8]
         MOV   EAX, [ESI]
         PUSH  dword ptr [EBP-12]
         CALL  EAX
         ADD   ESP,  4
         POP   ESI
         MOV   [EBP-16],  EAX
         ; Let Ti2_18 = 
         ; Integer 88
         MOV   EAX,  88
         MOV   [EBP-20],  EAX
         ; Let second_12 = 
         ; Apply closure f_9
         PUSH  ESI
         MOV   ESI,  [EBP-8]
         MOV   EAX, [ESI]
         PUSH  dword ptr [EBP-20]
         CALL  EAX
         ADD   ESP,  4
         POP   ESI
         MOV   [EBP-24],  EAX
         ; Let Ti3_17 = 
         ; Integer 99
         MOV   EAX,  99
         MOV   [EBP-28],  EAX
         ; Let Ti4_14 = 
         ; Apply closure first_11
         PUSH  ESI
         MOV   ESI,  [EBP-16]
         MOV   EAX, [ESI]
         PUSH  dword ptr [EBP-28]
         CALL  EAX
         ADD   ESP,  4
         POP   ESI
         MOV   [EBP-32],  EAX
         ; Let Ti5_16 = 
         ; Integer 44
         MOV   EAX,  44
         MOV   [EBP-36],  EAX
         ; Let Ti6_15 = 
         ; Apply closure second_12
         PUSH  ESI
         MOV   ESI,  [EBP-24]
         MOV   EAX, [ESI]
         PUSH  dword ptr [EBP-36]
         CALL  EAX
         ADD   ESP,  4
         POP   ESI
         MOV   [EBP-40],  EAX
         ; Let result_13 = 
         ; Add Ti4_14 + Ti6_15
         MOV   EAX,  [EBP-32]
         ADD   EAX,  [EBP-40]
         MOV   [EBP-44],  EAX
         ; Apply direct min_caml_print_int
         PUSH  dword ptr [EBP-44]
         CALL  min_caml_print_int
         ADD   ESP,  4
         MOV   ESP,  EBP
         POP   EBP
         PUSH  0
         CALL  ExitProcess

;==============================================================
; Function g_20:

g_20 proc
         PUSH  EBP
         MOV   EBP,  ESP
         SUB   ESP,  4
         ; Let Ti7_22 = 
         ; Add x_8 + y_10
         MOV   EAX,  [ESI+4]
         ADD   EAX,  [ESI+8]
         MOV   [EBP-4],  EAX
         ; Add Ti7_22 + z_21
         MOV   EAX,  [EBP-4]
         ADD   EAX,  [EBP+8]
         MOV   ESP,  EBP
         POP   EBP
         RET
g_20 endp

;==============================================================
; Function f_9:

f_9 proc
         PUSH  EBP
         MOV   EBP,  ESP
         SUB   ESP,  4
         ; Make closure g_20
         PUSH  12
         CALL  min_caml_malloc
         ADD   ESP,  4
         MOV   [EBP-4],  EAX
         MOV   EDI,  EAX
         MOV   [EDI],  g_20
         MOV   EAX,  [ESI+4]
         MOV   [EDI+4],  EAX
         MOV   EAX,  [EBP+8]
         MOV   [EDI+8],  EAX
         ; Var g_20
         MOV   EAX,  [EBP-4]
         MOV   ESP,  EBP
         POP   EBP
         RET
f_9 endp

;==============================================================
; need to copy min_caml_intel.asm from min-caml directory to output directoty
include min_caml_intel.asm

END start

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

