;==============================================================
; 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_11 = 
         ; Integer 21600
         MOV   EAX,  21600
         MOV   [EBP-4],  EAX
         ; Let Ti2_12 = 
         ; Integer 337500
         MOV   EAX,  337500
         MOV   [EBP-8],  EAX
         ; Let Ti3_10 = 
         ; Apply direct gcd_7
         PUSH  dword ptr [EBP-8]
         PUSH  dword ptr [EBP-4]
         CALL  gcd_7
         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 gcd_7:

gcd_7 proc
         PUSH  EBP
         MOV   EBP,  ESP
         SUB   ESP,  12
         ; Let Ti4_13 = 
         ; Integer 0
         MOV   EAX,  0
         MOV   [EBP-4],  EAX
         ; If m_8 == Ti4_13
         MOV   EAX,  [EBP+8]
         CMP   EAX,  [EBP-4]
         JNE   else_16
         ; Var n_9
         MOV   EAX,  [EBP+12]
         MOV   ESP,  EBP
         POP   EBP
         RET
else_16:
         ; If m_8 <= n_9
         MOV   EAX,  [EBP+8]
         CMP   EAX,  [EBP+12]
         JG    else_17
         ; Let Ti5_15 = 
         ; Sub n_9 - m_8
         MOV   EAX,  [EBP+12]
         SUB   EAX,  [EBP+8]
         MOV   [EBP-8],  EAX
         ; Apply direct gcd_7
         PUSH  dword ptr [EBP-8]
         PUSH  dword ptr [EBP+8]
         CALL  gcd_7
         ADD   ESP,  8
         MOV   ESP,  EBP
         POP   EBP
         RET
else_17:
         ; Let Ti6_14 = 
         ; Sub m_8 - n_9
         MOV   EAX,  [EBP+8]
         SUB   EAX,  [EBP+12]
         MOV   [EBP-12],  EAX
         ; Apply direct gcd_7
         PUSH  dword ptr [EBP-12]
         PUSH  dword ptr [EBP+12]
         CALL  gcd_7
         ADD   ESP,  8
         MOV   ESP,  EBP
         POP   EBP
         RET
gcd_7 endp

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

END start

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

