;==============================================================
; 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,  24
         ; Make closure f_6
         PUSH  4
         CALL  min_caml_malloc
         ADD   ESP,  4
         MOV   [EBP-4],  EAX
         MOV   EDI,  EAX
         MOV   [EDI],  f_6
         ; Make closure g_8
         PUSH  8
         CALL  min_caml_malloc
         ADD   ESP,  4
         MOV   [EBP-8],  EAX
         MOV   EDI,  EAX
         MOV   [EDI],  g_8
         MOV   EAX,  [EBP-4]
         MOV   [EDI+4],  EAX
         ; Let Ti1_13 = 
         ; Integer 456
         MOV   EAX,  456
         MOV   [EBP-12],  EAX
         ; Let Tf2_11 = 
         ; Apply closure g_8
         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 Ti3_12 = 
         ; Integer 789
         MOV   EAX,  789
         MOV   [EBP-20],  EAX
         ; Let Ti4_10 = 
         ; Apply closure Tf2_11
         PUSH  ESI
         MOV   ESI,  [EBP-16]
         MOV   EAX, [ESI]
         PUSH  dword ptr [EBP-20]
         CALL  EAX
         ADD   ESP,  4
         POP   ESI
         MOV   [EBP-24],  EAX
         ; Apply direct min_caml_print_int
         PUSH  dword ptr [EBP-24]
         CALL  min_caml_print_int
         ADD   ESP,  4
         MOV   ESP,  EBP
         POP   EBP
         PUSH  0
         CALL  ExitProcess

;==============================================================
; Function f_6:

f_6 proc
         PUSH  EBP
         MOV   EBP,  ESP
         SUB   ESP,  4
         ; Let Ti5_14 = 
         ; Integer 123
         MOV   EAX,  123
         MOV   [EBP-4],  EAX
         ; Add x_7 + Ti5_14
         MOV   EAX,  [EBP+8]
         ADD   EAX,  [EBP-4]
         MOV   ESP,  EBP
         POP   EBP
         RET
f_6 endp

;==============================================================
; Function g_8:

g_8 proc
         PUSH  EBP
         MOV   EBP,  ESP
         SUB   ESP,  0
         ; Var f_6
         MOV   EAX,  [ESI+4]
         MOV   ESP,  EBP
         POP   EBP
         RET
g_8 endp

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

END start

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

