#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
unsigned long lcm(unsigned long, unsigned short);
int /*<<< orphan*/ printf(char *, unsigned long);
int main(void) {
  unsigned long ans = 1;
  unsigned short int i = 1, MAX = 20;
  for (i = 1; i <= MAX; i++) {
    ans = lcm(ans, i);
  }
  printf("%i", ans);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x1,-0x10(%rbp)
movw   $0x1,-0x12(%rbp)
movw   $0x14,-0x14(%rbp)
movw   $0x1,-0x12(%rbp)
movzwl -0x12(%rbp),%eax
movzwl -0x14(%rbp),%ecx
cmp    %ecx,%eax
jg     117b <main+0x5b>
mov    -0x10(%rbp),%rdi
movzwl -0x12(%rbp),%esi
call   1040 <lcm@plt>
mov    %rax,-0x10(%rbp)
mov    -0x12(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x12(%rbp)
jmp    1149 <main+0x29>
mov    -0x10(%rbp),%rsi
lea    0xe7a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x1,%esi
call   1040 <lcm@plt>
mov    %rax,%rdi
mov    $0x2,%esi
call   1040 <lcm@plt>
mov    %rax,%rdi
mov    $0x3,%esi
call   1040 <lcm@plt>
mov    %rax,%rdi
mov    $0x4,%esi
call   1040 <lcm@plt>
mov    %rax,%rdi
mov    $0x5,%esi
call   1040 <lcm@plt>
mov    %rax,%rdi
mov    $0x6,%esi
call   1040 <lcm@plt>
mov    %rax,%rdi
mov    $0x7,%esi
call   1040 <lcm@plt>
mov    %rax,%rdi
mov    $0x8,%esi
call   1040 <lcm@plt>
mov    %rax,%rdi
mov    $0x9,%esi
call   1040 <lcm@plt>
mov    %rax,%rdi
mov    $0xa,%esi
call   1040 <lcm@plt>
mov    %rax,%rdi
mov    $0xb,%esi
call   1040 <lcm@plt>
mov    %rax,%rdi
mov    $0xc,%esi
call   1040 <lcm@plt>
mov    %rax,%rdi
mov    $0xd,%esi
call   1040 <lcm@plt>
mov    %rax,%rdi
mov    $0xe,%esi
call   1040 <lcm@plt>
mov    %rax,%rdi
mov    $0xf,%esi
call   1040 <lcm@plt>
mov    %rax,%rdi
mov    $0x10,%esi
call   1040 <lcm@plt>
mov    %rax,%rdi
mov    $0x11,%esi
call   1040 <lcm@plt>
mov    %rax,%rdi
mov    $0x12,%esi
call   1040 <lcm@plt>
mov    %rax,%rdi
mov    $0x13,%esi
call   1040 <lcm@plt>
mov    %rax,%rdi
mov    $0x14,%esi
call   1040 <lcm@plt>
lea    0xdd2(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%i\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i16
%4 = alloca i16
store i32 0, i32* %1
store i64 1, i64* %2
store i16 1, i16* %3
store i16 20, i16* %4
store i16 1, i16* %3
br label %5
5: ; preds = %15, %0
%6 = load i16, i16* %3
%7 = zext i16 %6 to i32
%8 = load i16, i16* %4
%9 = zext i16 %8 to i32
%10 = icmp sle i32 %7, %9
br i1 %10, label %11, label %18
11: ; preds = %5
%12 = load i64, i64* %2
%13 = load i16, i16* %3
%14 = call i64 @lcm(i64 %12, i16 zeroext %13)
store i64 %14, i64* %2
br label %15
15: ; preds = %11
%16 = load i16, i16* %3
%17 = add i16 %16, 1
store i16 %17, i16* %3
br label %5
18: ; preds = %5
%19 = load i64, i64* %2
%20 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 %19)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
define i32 @main() {
%1 = tail call i64 @lcm(i64 1, i16 zeroext 1)
%2 = tail call i64 @lcm(i64 %1, i16 zeroext 2)
%3 = tail call i64 @lcm(i64 %2, i16 zeroext 3)
%4 = tail call i64 @lcm(i64 %3, i16 zeroext 4)
%5 = tail call i64 @lcm(i64 %4, i16 zeroext 5)
%6 = tail call i64 @lcm(i64 %5, i16 zeroext 6)
%7 = tail call i64 @lcm(i64 %6, i16 zeroext 7)
%8 = tail call i64 @lcm(i64 %7, i16 zeroext 8)
%9 = tail call i64 @lcm(i64 %8, i16 zeroext 9)
%10 = tail call i64 @lcm(i64 %9, i16 zeroext 10)
%11 = tail call i64 @lcm(i64 %10, i16 zeroext 11)
%12 = tail call i64 @lcm(i64 %11, i16 zeroext 12)
%13 = tail call i64 @lcm(i64 %12, i16 zeroext 13)
%14 = tail call i64 @lcm(i64 %13, i16 zeroext 14)
%15 = tail call i64 @lcm(i64 %14, i16 zeroext 15)
%16 = tail call i64 @lcm(i64 %15, i16 zeroext 16)
%17 = tail call i64 @lcm(i64 %16, i16 zeroext 17)
%18 = tail call i64 @lcm(i64 %17, i16 zeroext 18)
%19 = tail call i64 @lcm(i64 %18, i16 zeroext 19)
%20 = tail call i64 @lcm(i64 %19, i16 zeroext 20)
%21 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 %20)
ret i32 0
}