#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 a, b, c;
  for (a = 1;; a++) {
    bool c = 1;
    for (b = 2; b <= 20; b++) {
      if (a % b != 0) {
        c = 0;
      }
    }
    if (c) {
      printf("%d\n", a);
      break;
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0x14(%rbp)
movl   $0x2,-0xc(%rbp)
cmpl   $0x14,-0xc(%rbp)
jg     1168 <main+0x58>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
je     1155 <main+0x45>
movl   $0x0,-0x14(%rbp)
jmp    115a <main+0x4a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1134 <main+0x24>
cmpl   $0x0,-0x14(%rbp)
je     1186 <main+0x76>
mov    -0x8(%rbp),%esi
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
jmp    1199 <main+0x89>
jmp    118b <main+0x7b>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x20,%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    $0x1,%r14d
movl   $0x0,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
%5 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
br label %6
6: ; preds = %27, %0
store i32 1, i32* %5
store i32 2, i32* %3
br label %7
7: ; preds = %17, %6
%8 = load i32, i32* %3
%9 = icmp sle i32 %8, 20
br i1 %9, label %10, label %20
10: ; preds = %7
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = srem i32 %11, %12
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %10
store i32 0, i32* %5
br label %16
16: ; preds = %15, %10
br label %17
17: ; preds = %16
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %7
20: ; preds = %7
%21 = load i32, i32* %5
%22 = icmp ne i32 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %20
%24 = load i32, i32* %2
%25 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %24)
br label %30
26: ; preds = %20
br label %27
27: ; preds = %26
%28 = load i32, i32* %2
%29 = add nsw i32 %28, 1
store i32 %29, i32* %2
br label %6
30: ; preds = %23
%31 = load i32, i32* %1
ret i32 %31
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 1, %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
}