#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(void) {
  const int d_max = 20;
  for (int n = 1;; ++n) {
    for (int d = 1; d <= d_max; ++d) {
      if (n % d != 0) {
        break;
      } else if (d == d_max) {
        printf("%d\n", n);
        return 0;
      }
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x14,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
cmpl   $0x14,-0x10(%rbp)
jg     118c <main+0x7c>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
cmp    $0x0,%edx
je     1153 <main+0x43>
jmp    118c <main+0x7c>
cmpl   $0x14,-0x10(%rbp)
jne    1174 <main+0x64>
mov    -0xc(%rbp),%esi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret
jmp    1179 <main+0x69>
jmp    117e <main+0x6e>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1134 <main+0x24>
jmp    1191 <main+0x81>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <main+0x1d>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    $0x1,%r13d
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r13d,%r8d
mov    %esi,%r12d
mov    %r13d,%eax
mov    %rax,%r11
mov    $0xcccccccd,%ecx
imul   %rcx,%r11
lea    0x1(%r12),%esi
mov    %rax,%r15
mov    $0xaaaaaaab,%ecx
imul   %rcx,%r15
imul   $0x24924925,%rax,%rcx
shr    $0x20,%rcx
mov    %r13d,%edx
sub    %ecx,%edx
mov    %r15,%rbp
shr    $0x21,%rbp
lea    0x0(%rbp,%rbp,2),%ebp
mov    %esi,%ebx
and    $0x1,%ebx
neg    %ebp
lea    (%r12,%rbp,1),%edi
add    $0x1,%edi
mov    %esi,%ebp
and    $0x3,%ebp
lea    0x1(%r8),%r13d
or     %ebx,%edi
jne    1130 <main+0x20>
shr    %edx
mov    %r11,%rbx
shr    $0x22,%rbx
test   %ebp,%ebp
jne    1130 <main+0x20>
add    %ecx,%edx
mov    %r15,%rcx
shr    $0x22,%rcx
lea    (%rbx,%rbx,4),%edi
add    $0xffffffff,%edi
cmp    %r12d,%edi
jne    1130 <main+0x20>
shr    $0x2,%edx
lea    (%rcx,%rcx,2),%ecx
add    %ecx,%ecx
add    $0xffffffff,%ecx
cmp    %r12d,%ecx
jne    1130 <main+0x20>
imul   $0x38e38e39,%rax,%r14
mov    %edx,%ecx
not    %ecx
lea    (%rcx,%rdx,8),%edx
mov    %esi,%ecx
and    $0x7,%ecx
cmp    %r12d,%edx
jne    1130 <main+0x20>
mov    %r8d,%edx
shr    %edx
mov    %r14,%rbp
shr    $0x21,%rbp
test   %ecx,%ecx
jne    1130 <main+0x20>
mov    $0x92492493,%ecx
imul   %rcx,%rdx
mov    %rax,%rbx
mov    $0xba2e8ba3,%ecx
imul   %rcx,%rbx
mov    %r11,%rcx
shr    $0x23,%rcx
lea    -0x1(%rbp,%rbp,8),%edi
cmp    %r12d,%edi
jne    1130 <main+0x20>
shr    $0x22,%rdx
shr    $0x23,%rbx
lea    (%rcx,%rcx,4),%ecx
add    %ecx,%ecx
add    $0xffffffff,%ecx
cmp    %r12d,%ecx
jne    1130 <main+0x20>
mov    %edx,%r10d
shl    $0x4,%r10d
imul   $0x4ec4ec4f,%rax,%r9
shr    $0x23,%r15
lea    (%rbx,%rbx,4),%ecx
lea    (%rbx,%rcx,2),%ecx
add    $0xffffffff,%ecx
cmp    %r12d,%ecx
jne    1130 <main+0x20>
sub    %edx,%r10d
shr    $0x22,%r9
lea    (%r15,%r15,2),%ecx
lea    -0x1(,%rcx,4),%ecx
cmp    %r12d,%ecx
jne    1130 <main+0x20>
mov    %rax,%rbp
mov    $0xaf286bcb,%ecx
imul   %rcx,%rbp
mov    %rax,%rbx
mov    $0x88888889,%ecx
imul   %rcx,%rbx
not    %edx
add    %r10d,%edx
lea    (%r9,%r9,2),%ecx
lea    (%r9,%rcx,4),%ecx
add    $0xffffffff,%ecx
cmp    %r12d,%ecx
jne    1130 <main+0x20>
shr    $0x20,%rbp
mov    $0xf0f0f0f1,%ecx
imul   %rcx,%rax
shr    $0x23,%rbx
cmp    %r12d,%edx
jne    1130 <main+0x20>
sub    %ebp,%r8d
shr    $0x24,%rax
lea    (%rbx,%rbx,4),%ecx
lea    (%rcx,%rcx,2),%ecx
add    $0xffffffff,%ecx
mov    %esi,%edx
and    $0xf,%edx
cmp    %r12d,%ecx
jne    1130 <main+0x20>
shr    %r8d
mov    %eax,%ecx
shl    $0x4,%ecx
test   %edx,%edx
jne    1130 <main+0x20>
add    %ebp,%r8d
shr    $0x22,%r14
add    %ecx,%eax
add    $0xffffffff,%eax
cmp    %r12d,%eax
jne    1130 <main+0x20>
shr    $0x4,%r8d
lea    (%r14,%r14,8),%eax
add    %eax,%eax
add    $0xffffffff,%eax
cmp    %r12d,%eax
jne    1130 <main+0x20>
shr    $0x24,%r11
lea    (%r8,%r8,8),%eax
lea    (%r8,%rax,2),%eax
add    $0xffffffff,%eax
cmp    %r12d,%eax
jne    1130 <main+0x20>
lea    (%r11,%r11,4),%eax
lea    -0x1(,%rax,4),%eax
cmp    %r12d,%eax
jne    1130 <main+0x20>
lea    0xcb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%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 20, i32* %2
store i32 1, i32* %3
br label %5
5: ; preds = %27, %0
store i32 1, i32* %4
br label %6
6: ; preds = %23, %5
%7 = load i32, i32* %4
%8 = icmp sle i32 %7, 20
br i1 %8, label %9, label %26
9: ; preds = %6
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = srem i32 %10, %11
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %9
br label %26
15: ; preds = %9
%16 = load i32, i32* %4
%17 = icmp eq i32 %16, 20
br i1 %17, label %18, label %21
18: ; preds = %15
%19 = load i32, i32* %3
%20 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %19)
ret i32 0
21: ; preds = %15
br label %22
22: ; preds = %21
br label %23
23: ; preds = %22
%24 = load i32, i32* %4
%25 = add nsw i32 %24, 1
store i32 %25, i32* %4
br label %6
26: ; preds = %14, %6
br label %27
27: ; preds = %26
%28 = load i32, i32* %3
%29 = add nsw i32 %28, 1
store i32 %29, i32* %3
br label %5
}

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 ], [ %58, %1 ]
%3 = and i32 %2, 1
%4 = urem i32 %2, 3
%5 = or i32 %3, %4
%6 = icmp eq i32 %5, 0
%7 = and i32 %2, 3
%8 = icmp eq i32 %7, 0
%9 = select i1 %6, i1 %8, i1 false
%10 = urem i32 %2, 5
%11 = icmp eq i32 %10, 0
%12 = select i1 %9, i1 %11, i1 false
%13 = urem i32 %2, 6
%14 = icmp eq i32 %13, 0
%15 = select i1 %12, i1 %14, i1 false
%16 = urem i32 %2, 7
%17 = icmp eq i32 %16, 0
%18 = select i1 %15, i1 %17, i1 false
%19 = and i32 %2, 7
%20 = icmp eq i32 %19, 0
%21 = select i1 %18, i1 %20, i1 false
%22 = urem i32 %2, 9
%23 = icmp eq i32 %22, 0
%24 = select i1 %21, i1 %23, i1 false
%25 = urem i32 %2, 10
%26 = icmp eq i32 %25, 0
%27 = select i1 %24, i1 %26, i1 false
%28 = urem i32 %2, 11
%29 = icmp eq i32 %28, 0
%30 = select i1 %27, i1 %29, i1 false
%31 = urem i32 %2, 12
%32 = icmp eq i32 %31, 0
%33 = select i1 %30, i1 %32, i1 false
%34 = urem i32 %2, 13
%35 = icmp eq i32 %34, 0
%36 = select i1 %33, i1 %35, i1 false
%37 = urem i32 %2, 14
%38 = icmp eq i32 %37, 0
%39 = select i1 %36, i1 %38, i1 false
%40 = urem i32 %2, 15
%41 = icmp eq i32 %40, 0
%42 = select i1 %39, i1 %41, i1 false
%43 = and i32 %2, 15
%44 = icmp eq i32 %43, 0
%45 = select i1 %42, i1 %44, i1 false
%46 = urem i32 %2, 17
%47 = icmp eq i32 %46, 0
%48 = select i1 %45, i1 %47, i1 false
%49 = urem i32 %2, 18
%50 = icmp eq i32 %49, 0
%51 = select i1 %48, i1 %50, i1 false
%52 = urem i32 %2, 19
%53 = icmp eq i32 %52, 0
%54 = select i1 %51, i1 %53, i1 false
%55 = urem i32 %2, 20
%56 = icmp eq i32 %55, 0
%57 = select i1 %54, i1 %56, i1 false
%58 = add nuw nsw i32 %2, 1
br i1 %57, label %59, label %1
59: ; preds = %1
%60 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}