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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x9d8,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0x2,-0xc(%rbp)
cmpl   $0x15,-0xc(%rbp)
jge    116f <main+0x5f>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
je     115c <main+0x4c>
movl   $0x0,-0x10(%rbp)
jmp    1161 <main+0x51>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113b <main+0x2b>
cmpl   $0x0,-0x10(%rbp)
je     117e <main+0x6e>
jmp    118c <main+0x7c>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
mov    -0x8(%rbp),%esi
lea    0xe6a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    $0x9d8,%r14d
movl   $0x9d7,0xc(%rsp)
nopl   0x0(%rax)
mov    0xc(%rsp),%eax
mov    %eax,%r9d
mov    %r14d,%edx
mov    %rdx,%r11
mov    $0xcccccccd,%eax
imul   %rax,%r11
mov    %r11,%rax
shr    $0x24,%rax
shl    $0x2,%eax
lea    (%rax,%rax,4),%eax
mov    %rax,0x20(%rsp)
mov    %rdx,%rax
mov    $0xaf286bcb,%ecx
imul   %rcx,%rax
shr    $0x20,%rax
mov    %r14d,%ecx
sub    %eax,%ecx
shr    %ecx
add    %eax,%ecx
shr    $0x4,%ecx
lea    (%rcx,%rcx,8),%eax
mov    %r14d,%ebx
lea    (%rcx,%rax,2),%r14d
imul   $0x38e38e39,%rdx,%rax
mov    %rax,%rcx
mov    %rax,0x18(%rsp)
shr    $0x22,%rax
add    %eax,%eax
lea    (%rax,%rax,8),%ecx
mov    %rdx,%rax
mov    $0xf0f0f0f1,%esi
imul   %rsi,%rax
shr    $0x24,%rax
mov    %eax,%esi
shl    $0x4,%esi
add    %eax,%esi
mov    %rdx,%rax
mov    $0x88888889,%edi
imul   %rdi,%rax
shr    $0x23,%rax
lea    (%rax,%rax,4),%eax
lea    (%rax,%rax,2),%r13d
mov    %ebx,%r8d
shr    %r8d
mov    $0x92492493,%eax
imul   %rax,%r8
shr    $0x22,%r8
mov    %r8d,%eax
shl    $0x4,%eax
imul   $0x4ec4ec4f,%rdx,%r12
shr    $0x22,%r12
mov    %rdx,%r10
mov    $0xaaaaaaab,%edi
imul   %rdi,%r10
mov    %r10,%rdi
mov    %r10,0x10(%rsp)
shr    $0x23,%r10
mov    %r8d,%r15d
sub    %eax,%r15d
imul   $0x24924925,%rdx,%rdi
mov    $0xba2e8ba3,%eax
imul   %rax,%rdx
shr    $0x20,%rdi
neg    %esi
add    %r9d,%esi
add    $0x1,%esi
neg    %ecx
lea    (%r9,%rcx,1),%eax
add    $0x1,%eax
or     %esi,%eax
mov    %ebx,%ebp
sub    %edi,%ebp
shr    %ebp
neg    %r13d
lea    0x1(%r9),%esi
mov    %esi,0xc(%rsp)
and    $0xf,%esi
neg    %r14d
lea    (%r9,%r14,1),%ecx
add    $0x1,%ecx
mov    %ebx,%r14d
mov    0x20(%rsp),%rbx
neg    %ebx
add    %r9d,%ebx
add    $0x1,%ebx
add    $0x1,%r14d
or     %ecx,%ebx
jne    1130 <main+0x20>
add    %edi,%ebp
mov    %r11,%rcx
shr    $0x23,%rcx
shl    $0x2,%r10d
shr    $0x23,%rdx
lea    (%r12,%r12,2),%edi
lea    (%r12,%rdi,4),%edi
neg    %edi
add    %r15d,%r8d
lea    (%r9,%r13,1),%ebx
add    $0x1,%ebx
or     %ebx,%esi
test   %eax,%eax
jne    1130 <main+0x20>
shr    $0x2,%ebp
add    %ecx,%ecx
shrq   $0x21,0x18(%rsp)
lea    (%r10,%r10,2),%r10d
lea    (%rdx,%rdx,4),%ebx
lea    (%rdx,%rbx,2),%ebx
neg    %ebx
neg    %r10d
lea    (%r9,%rdi,1),%edx
add    $0x1,%edx
lea    (%r9,%r8,1),%edi
add    $0x1,%edi
or     %edx,%edi
test   %esi,%esi
jne    1130 <main+0x20>
mov    0x10(%rsp),%rdx
shr    $0x22,%rdx
lea    0x0(,%rbp,8),%r8d
lea    (%rcx,%rcx,4),%ecx
mov    0x18(%rsp),%rax
lea    (%rax,%rax,8),%esi
neg    %esi
neg    %ecx
lea    (%r9,%rbx,1),%eax
add    $0x1,%eax
lea    (%r9,%r10,1),%ebx
add    $0x1,%ebx
or     %eax,%ebx
test   %edi,%edi
jne    1130 <main+0x20>
add    %edx,%edx
shr    $0x22,%r11
sub    %r8d,%ebp
mov    0xc(%rsp),%eax
and    $0x7,%eax
lea    (%r9,%rsi,1),%edi
add    $0x1,%edi
lea    (%r9,%rcx,1),%esi
add    $0x1,%esi
or     %edi,%esi
test   %ebx,%ebx
jne    1130 <main+0x20>
shrq   $0x21,0x10(%rsp)
lea    (%rdx,%rdx,2),%ecx
lea    (%r11,%r11,4),%edi
neg    %edi
neg    %ecx
lea    (%r9,%rbp,1),%edx
add    $0x1,%edx
or     %edx,%eax
test   %esi,%esi
jne    1130 <main+0x20>
mov    0x10(%rsp),%rdx
lea    (%rdx,%rdx,2),%esi
neg    %esi
mov    0xc(%rsp),%edx
and    $0x3,%edx
add    %r9d,%edi
add    $0x1,%edi
add    %r9d,%ecx
add    $0x1,%ecx
or     %edi,%ecx
test   %eax,%eax
jne    1130 <main+0x20>
lea    (%r9,%rsi,1),%eax
add    $0x1,%eax
or     %eax,%edx
test   %ecx,%ecx
jne    1130 <main+0x20>
mov    0xc(%rsp),%eax
and    $0x1,%eax
test   %edx,%edx
jne    1130 <main+0x20>
test   %eax,%eax
jne    1130 <main+0x20>
lea    0xc60(%rip),%rdi
mov    0xc(%rsp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 2520, i32* %2
store i32 0, i32* %4
br label %5
5: ; preds = %0, %23
store i32 1, i32* %4
store i32 2, i32* %3
br label %6
6: ; preds = %16, %5
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 21
br i1 %8, label %9, label %19
9: ; preds = %6
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = srem i32 %10, %11
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %9
store i32 0, i32* %4
br label %15
15: ; preds = %14, %9
br label %16
16: ; preds = %15
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %6
19: ; preds = %6
%20 = load i32, i32* %4
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %19
br label %26
23: ; preds = %19
%24 = load i32, i32* %2
%25 = add nsw i32 %24, 1
store i32 %25, i32* %2
br label %5
26: ; preds = %22
%27 = load i32, i32* %2
%28 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %27)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 2520, %0 ], [ %50, %1 ]
%3 = and i32 %2, 1
%4 = urem i32 %2, 3
%5 = and i32 %2, 3
%6 = or i32 %5, %4
%7 = icmp ne i32 %6, 0
%8 = urem i32 %2, 5
%9 = urem i32 %2, 6
%10 = or i32 %9, %8
%11 = icmp ne i32 %10, 0
%12 = urem i32 %2, 7
%13 = and i32 %2, 7
%14 = or i32 %13, %12
%15 = icmp ne i32 %14, 0
%16 = urem i32 %2, 9
%17 = urem i32 %2, 10
%18 = or i32 %17, %16
%19 = icmp ne i32 %18, 0
%20 = urem i32 %2, 11
%21 = urem i32 %2, 12
%22 = or i32 %21, %20
%23 = icmp ne i32 %22, 0
%24 = urem i32 %2, 13
%25 = urem i32 %2, 14
%26 = or i32 %25, %24
%27 = icmp ne i32 %26, 0
%28 = urem i32 %2, 15
%29 = and i32 %2, 15
%30 = or i32 %29, %28
%31 = icmp ne i32 %30, 0
%32 = urem i32 %2, 17
%33 = urem i32 %2, 18
%34 = or i32 %33, %32
%35 = icmp ne i32 %34, 0
%36 = urem i32 %2, 19
%37 = urem i32 %2, 20
%38 = or i32 %37, %36
%39 = icmp ne i32 %38, 0
%40 = select i1 %39, i1 true, i1 %35
%41 = select i1 %40, i1 true, i1 %31
%42 = select i1 %41, i1 true, i1 %27
%43 = select i1 %42, i1 true, i1 %23
%44 = select i1 %43, i1 true, i1 %19
%45 = select i1 %44, i1 true, i1 %15
%46 = select i1 %45, i1 true, i1 %11
%47 = select i1 %46, i1 true, i1 %7
%48 = icmp ne i32 %3, 0
%49 = select i1 %47, i1 true, i1 %48
%50 = add nuw nsw i32 %2, 1
br i1 %49, label %1, label %51
51: ; preds = %1
%52 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}