#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 EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int number = 40, i;
  while (1) {
    for (i = 2; i <= 20; i++) {
      if (number % i != 0) {
        break;
      }
    }
    if (i == 21) {
      break;
    }
    number += 20;
  }
  printf("Solution: %d.\n", number);
  return EXIT_SUCCESS;
}


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   $0x28,-0x14(%rbp)
movl   $0x2,-0x18(%rbp)
cmpl   $0x14,-0x18(%rbp)
jg     1166 <main+0x56>
mov    -0x14(%rbp),%eax
cltd
idivl  -0x18(%rbp)
cmp    $0x0,%edx
je     1153 <main+0x43>
jmp    1166 <main+0x56>
jmp    1158 <main+0x48>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1134 <main+0x24>
cmpl   $0x15,-0x18(%rbp)
jne    1175 <main+0x65>
jmp    1183 <main+0x73>
mov    -0x14(%rbp),%eax
add    $0x14,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
mov    -0x14(%rbp),%esi
lea    0xe73(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e47(%rip),%rax
mov    (%rax),%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
mov    $0x28,%r12d
mov    $0x14,%esi
cs nopw 0x0(%rax,%rax,1)
mov    %r12d,%r15d
mov    %esi,%r14d
mov    %r12d,%r9d
imul   $0x38e38e39,%r9,%r13
lea    0x14(%r14),%esi
mov    %r9,%rcx
mov    $0xaaaaaaab,%eax
imul   %rax,%rcx
imul   $0x24924925,%r9,%rax
shr    $0x20,%rax
mov    %r12d,%ebp
sub    %eax,%ebp
shr    %ebp
add    %eax,%ebp
shr    $0x2,%ebp
lea    0x0(,%rbp,8),%eax
mov    %rcx,%rdx
shr    $0x22,%rdx
add    %edx,%edx
lea    (%rdx,%rdx,2),%edx
mov    %rcx,%rdi
shr    $0x21,%rdi
lea    (%rdi,%rdi,2),%edi
neg    %edi
add    %r14d,%edi
add    $0x14,%edi
neg    %edx
add    %r14d,%edx
add    $0x14,%edx
sub    %eax,%ebp
lea    0x14(%r15),%r12d
or     %edi,%edx
jne    1130 <main+0x20>
mov    %r15d,%edi
shr    %edi
mov    %r9,%rbx
mov    $0xba2e8ba3,%eax
imul   %rax,%rbx
mov    %r13,%rax
shr    $0x21,%rax
mov    %esi,%edx
and    $0x4,%edx
add    %r14d,%ebp
add    $0x28,%ebp
cmp    $0x14,%ebp
jne    1130 <main+0x20>
mov    $0x92492493,%ebp
imul   %rbp,%rdi
shr    $0x23,%rcx
shr    $0x23,%rbx
lea    (%rax,%rax,8),%ebp
neg    %ebp
test   %edx,%edx
jne    1130 <main+0x20>
shr    $0x22,%rdi
imul   $0x4ec4ec4f,%r9,%r8
shl    $0x2,%ecx
lea    (%rbx,%rbx,4),%eax
lea    (%rbx,%rax,2),%eax
neg    %eax
lea    (%r14,%rbp,1),%edx
add    $0x28,%edx
cmp    $0x14,%edx
jne    1130 <main+0x20>
mov    %edi,%r11d
shl    $0x4,%r11d
shr    $0x22,%r8
lea    (%rcx,%rcx,2),%ebx
neg    %ebx
add    %r14d,%eax
add    $0x28,%eax
cmp    $0x14,%eax
jne    1130 <main+0x20>
mov    %r9,%rbp
mov    $0xaf286bcb,%eax
imul   %rax,%rbp
mov    %r9,%rcx
mov    $0xf0f0f0f1,%eax
imul   %rax,%rcx
mov    $0x88888889,%eax
imul   %rax,%r9
mov    %edi,%r10d
sub    %r11d,%r10d
lea    (%r8,%r8,2),%eax
lea    (%r8,%rax,4),%eax
neg    %eax
lea    (%r14,%rbx,1),%edx
add    $0x28,%edx
cmp    $0x14,%edx
jne    1130 <main+0x20>
shr    $0x20,%rbp
shr    $0x24,%rcx
shr    $0x23,%r9
add    %r10d,%edi
add    %r14d,%eax
add    $0x28,%eax
cmp    $0x14,%eax
jne    1130 <main+0x20>
sub    %ebp,%r15d
mov    %ecx,%edx
shl    $0x4,%edx
lea    (%r9,%r9,4),%eax
lea    (%rax,%rax,2),%eax
neg    %eax
add    %r14d,%edi
add    $0x28,%edi
cmp    $0x14,%edi
jne    1130 <main+0x20>
shr    %r15d
shr    $0x22,%r13
add    %edx,%ecx
mov    %esi,%edx
and    $0xc,%edx
add    %r14d,%eax
add    $0x28,%eax
cmp    $0x14,%eax
jne    1130 <main+0x20>
add    %ebp,%r15d
add    %r13d,%r13d
neg    %ecx
test   %edx,%edx
jne    1130 <main+0x20>
shr    $0x4,%r15d
lea    0x0(%r13,%r13,8),%eax
neg    %eax
add    %r14d,%ecx
add    $0x28,%ecx
cmp    $0x14,%ecx
jne    1130 <main+0x20>
lea    (%r15,%r15,8),%ecx
lea    (%r15,%rcx,2),%ecx
neg    %ecx
add    %r14d,%eax
add    $0x28,%eax
cmp    $0x14,%eax
jne    1130 <main+0x20>
lea    (%r14,%rcx,1),%eax
add    $0x28,%eax
cmp    $0x14,%eax
jne    1130 <main+0x20>
lea    0xcdd(%rip),%rdi
call   1030 <printf@plt>
mov    0x2cb1(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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