#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 */
long lcm(long, long);
int /*<<< orphan*/ printf(char *, long);
int main() {
  long i, n = 1;
  for (i = 1; i < 21; i++)
    n = lcm(n, i);
  printf("%d\n", n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x1,-0x18(%rbp)
movq   $0x1,-0x10(%rbp)
cmpq   $0x15,-0x10(%rbp)
jge    116c <main+0x4c>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <lcm@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    113f <main+0x1f>
mov    -0x18(%rbp),%rsi
lea    0xe89(%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    $0x2,%esi
mov    %rax,%rdi
call   1040 <lcm@plt>
mov    $0x3,%esi
mov    %rax,%rdi
call   1040 <lcm@plt>
mov    $0x4,%esi
mov    %rax,%rdi
call   1040 <lcm@plt>
mov    $0x5,%esi
mov    %rax,%rdi
call   1040 <lcm@plt>
mov    $0x6,%esi
mov    %rax,%rdi
call   1040 <lcm@plt>
mov    $0x7,%esi
mov    %rax,%rdi
call   1040 <lcm@plt>
mov    $0x8,%esi
mov    %rax,%rdi
call   1040 <lcm@plt>
mov    $0x9,%esi
mov    %rax,%rdi
call   1040 <lcm@plt>
mov    $0xa,%esi
mov    %rax,%rdi
call   1040 <lcm@plt>
mov    $0xb,%esi
mov    %rax,%rdi
call   1040 <lcm@plt>
mov    $0xc,%esi
mov    %rax,%rdi
call   1040 <lcm@plt>
mov    $0xd,%esi
mov    %rax,%rdi
call   1040 <lcm@plt>
mov    $0xe,%esi
mov    %rax,%rdi
call   1040 <lcm@plt>
mov    $0xf,%esi
mov    %rax,%rdi
call   1040 <lcm@plt>
mov    $0x10,%esi
mov    %rax,%rdi
call   1040 <lcm@plt>
mov    $0x11,%esi
mov    %rax,%rdi
call   1040 <lcm@plt>
mov    $0x12,%esi
mov    %rax,%rdi
call   1040 <lcm@plt>
mov    $0x13,%esi
mov    %rax,%rdi
call   1040 <lcm@plt>
mov    $0x14,%esi
mov    %rax,%rdi
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 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
store i32 0, i32* %1
store i64 1, i64* %3
store i64 1, i64* %2
br label %4
4: ; preds = %11, %0
%5 = load i64, i64* %2
%6 = icmp slt i64 %5, 21
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = load i64, i64* %3
%9 = load i64, i64* %2
%10 = call i64 @lcm(i64 %8, i64 %9)
store i64 %10, i64* %3
br label %11
11: ; preds = %7
%12 = load i64, i64* %2
%13 = add nsw i64 %12, 1
store i64 %13, i64* %2
br label %4
14: ; preds = %4
%15 = load i64, i64* %3
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %15)
ret i32 0
}

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