#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 argc, char *argv[]) {
  int i = 20;
  int n;
  int div;
  int test = 0;
  for (n = 20; !test; n += 20) {
    test = 1;
    for (div = 2; div <= 20; div++) {
      if ((n % div) != 0) {
        test = 0;
        continue;
      }
    }
  }
  printf("%d\n", n - 20);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x14,-0x14(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x14,-0x18(%rbp)
cmpl   $0x0,-0x20(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1151 <main+0x41>
jmp    11ab <main+0x9b>
movl   $0x1,-0x20(%rbp)
movl   $0x2,-0x1c(%rbp)
cmpl   $0x14,-0x1c(%rbp)
jg     1198 <main+0x88>
mov    -0x18(%rbp),%eax
cltd
idivl  -0x1c(%rbp)
cmp    $0x0,%edx
je     1185 <main+0x75>
movl   $0x0,-0x20(%rbp)
jmp    118a <main+0x7a>
jmp    118a <main+0x7a>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    115f <main+0x4f>
jmp    119d <main+0x8d>
mov    -0x18(%rbp),%eax
add    $0x14,%eax
mov    %eax,-0x18(%rbp)
jmp    113b <main+0x2b>
mov    -0x18(%rbp),%esi
sub    $0x14,%esi
lea    0xe48(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
movl   $0x14,(%rsp)
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %esi,%r15d
lea    0x14(%r15),%eax
mov    %eax,0x4(%rsp)
mov    (%rsp),%r13d
mov    %r13d,%ebx
mov    %rbx,%rax
mov    $0xaf286bcb,%ecx
imul   %rcx,%rax
shr    $0x20,%rax
mov    %r13d,%ecx
sub    %eax,%ecx
shr    %ecx
add    %eax,%ecx
shr    $0x4,%ecx
lea    (%rcx,%rcx,8),%eax
lea    (%rcx,%rax,2),%edx
imul   $0x38e38e39,%rbx,%rbp
mov    %rbp,%rax
shr    $0x22,%rax
add    %eax,%eax
lea    (%rax,%rax,8),%r8d
mov    %rbx,%rax
mov    $0xf0f0f0f1,%ecx
imul   %rcx,%rax
shr    $0x24,%rax
mov    %eax,%r10d
shl    $0x4,%r10d
add    %eax,%r10d
mov    %rbx,%rax
mov    $0x88888889,%ecx
imul   %rcx,%rax
shr    $0x23,%rax
lea    (%rax,%rax,4),%eax
lea    (%rax,%rax,2),%r14d
mov    %r13d,%ecx
shr    %ecx
mov    $0x92492493,%eax
imul   %rax,%rcx
shr    $0x22,%rcx
mov    %ecx,%eax
shl    $0x4,%eax
imul   $0x4ec4ec4f,%rbx,%r9
shr    $0x22,%r9
imul   $0x24924925,%rbx,%rsi
shr    $0x20,%rsi
mov    %r13d,%edi
sub    %esi,%edi
shr    %edi
add    %esi,%edi
mov    %ecx,%r11d
sub    %eax,%r11d
mov    %rbx,%r12
mov    $0xaaaaaaab,%eax
imul   %rax,%r12
add    %ecx,%r11d
mov    0x4(%rsp),%esi
mov    %esi,%eax
and    $0xc,%eax
neg    %r10d
lea    (%r15,%r10,1),%ecx
add    $0x14,%ecx
mov    %rbp,%r10
or     %eax,%ecx
mov    %r12,%rax
shr    $0x23,%rax
shl    $0x2,%eax
mov    $0xba2e8ba3,%ebp
imul   %rbp,%rbx
neg    %r14d
neg    %r8d
lea    (%r15,%r8,1),%ebp
add    $0x14,%ebp
neg    %edx
add    %r15d,%edx
add    $0x14,%edx
add    $0x14,%r13d
mov    %r13d,(%rsp)
or     %ebp,%edx
jne    1130 <main+0x20>
shr    $0x2,%edi
shr    $0x23,%rbx
shr    $0x21,%r10
lea    (%r9,%r9,2),%edx
lea    (%r9,%rdx,4),%r9d
lea    (%rax,%rax,2),%eax
neg    %eax
neg    %r9d
lea    (%r15,%r11,1),%edx
add    $0x14,%edx
lea    (%r15,%r14,1),%ebp
add    $0x14,%ebp
or     %edx,%ebp
test   %ecx,%ecx
jne    1130 <main+0x20>
mov    %r12,%rdx
shr    $0x22,%rdx
lea    0x0(,%rdi,8),%r8d
lea    (%rbx,%rbx,4),%ecx
lea    (%rbx,%rcx,2),%ebx
lea    (%r10,%r10,8),%ecx
neg    %ecx
neg    %ebx
lea    (%r15,%rax,1),%r10d
add    $0x14,%r10d
lea    (%r15,%r9,1),%eax
add    $0x14,%eax
or     %r10d,%eax
test   %ebp,%ebp
jne    1130 <main+0x20>
add    %edx,%edx
shr    $0x21,%r12
sub    %r8d,%edi
mov    %esi,%ebp
and    $0x4,%ebp
lea    (%r15,%rcx,1),%r8d
add    $0x14,%r8d
lea    (%r15,%rbx,1),%ecx
add    $0x14,%ecx
or     %r8d,%ecx
test   %eax,%eax
jne    1130 <main+0x20>
lea    (%rdx,%rdx,2),%eax
lea    (%r12,%r12,2),%edx
neg    %edx
neg    %eax
add    %r15d,%edi
add    $0x14,%edi
or     %edi,%ebp
test   %ecx,%ecx
jne    1130 <main+0x20>
lea    (%r15,%rdx,1),%ecx
add    $0x14,%ecx
add    %r15d,%eax
add    $0x14,%eax
or     %ecx,%eax
test   %ebp,%ebp
jne    1130 <main+0x20>
test   %eax,%eax
jne    1130 <main+0x20>
lea    0xce9(%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(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 20, i32* %6
store i32 0, i32* %9
store i32 20, i32* %7
br label %10
10: ; preds = %29, %2
%11 = load i32, i32* %9
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
br i1 %13, label %14, label %32
14: ; preds = %10
store i32 1, i32* %9
store i32 2, i32* %8
br label %15
15: ; preds = %25, %14
%16 = load i32, i32* %8
%17 = icmp sle i32 %16, 20
br i1 %17, label %18, label %28
18: ; preds = %15
%19 = load i32, i32* %7
%20 = load i32, i32* %8
%21 = srem i32 %19, %20
%22 = icmp ne i32 %21, 0
br i1 %22, label %23, label %24
23: ; preds = %18
store i32 0, i32* %9
br label %25
24: ; preds = %18
br label %25
25: ; preds = %24, %23
%26 = load i32, i32* %8
%27 = add nsw i32 %26, 1
store i32 %27, i32* %8
br label %15
28: ; preds = %15
br label %29
29: ; preds = %28
%30 = load i32, i32* %7
%31 = add nsw i32 %30, 20
store i32 %31, i32* %7
br label %10
32: ; preds = %10
%33 = load i32, i32* %7
%34 = sub nsw i32 %33, 20
%35 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %34)
ret i32 0
}

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