#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) {
  int result = 0;
  int counter = 2;
  while (!result) {
    int possible_result_bool = 1;
    int inner_counter = 20;
    while (possible_result_bool && inner_counter > 0) {
      if (counter % inner_counter != 0) {
        possible_result_bool = 0;
        break;
      }
      inner_counter--;
    }
    if (possible_result_bool) {
      result = counter;
    }
    counter++;
  }
  printf("Result = %d\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1143 <main+0x33>
jmp    11c2 <main+0xb2>
movl   $0x1,-0x10(%rbp)
movl   $0x14,-0x14(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x10(%rbp)
mov    %al,-0x15(%rbp)
je     116a <main+0x5a>
cmpl   $0x0,-0x14(%rbp)
setg   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    117a <main+0x6a>
jmp    11a4 <main+0x94>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x14(%rbp)
cmp    $0x0,%edx
je     1196 <main+0x86>
movl   $0x0,-0x10(%rbp)
jmp    11a4 <main+0x94>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1151 <main+0x41>
cmpl   $0x0,-0x10(%rbp)
je     11b4 <main+0xa4>
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <main+0x1d>
mov    -0x8(%rbp),%esi
lea    0xe34(%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   $0x2,0x4(%rsp)
mov    $0x1,%esi
nopl   0x0(%rax,%rax,1)
mov    0x4(%rsp),%eax
mov    %eax,%r8d
mov    %esi,%r12d
mov    %eax,%ebp
mov    %rbp,%r14
mov    $0xcccccccd,%eax
imul   %rax,%r14
imul   $0x38e38e39,%rbp,%r10
mov    %r8d,%edi
shr    %edi
mov    $0x92492493,%eax
imul   %rax,%rdi
mov    %rbp,%rax
mov    $0xf0f0f0f1,%ecx
imul   %rcx,%rax
shr    $0x24,%rax
mov    %eax,%ecx
shl    $0x4,%ecx
add    %eax,%ecx
mov    %r10,%rax
shr    $0x22,%rax
add    %eax,%eax
lea    (%rax,%rax,8),%edx
mov    %rbp,%rax
mov    $0xaf286bcb,%esi
imul   %rsi,%rax
shr    $0x20,%rax
mov    %r8d,%esi
sub    %eax,%esi
shr    %esi
add    %eax,%esi
shr    $0x4,%esi
lea    (%rsi,%rsi,8),%eax
lea    (%rsi,%rax,2),%eax
mov    %r14,%rsi
shr    $0x24,%rsi
shl    $0x2,%esi
lea    (%rsi,%rsi,4),%esi
neg    %esi
add    %r12d,%esi
add    $0x1,%esi
neg    %eax
add    %r12d,%eax
add    $0x1,%eax
neg    %edx
or     %esi,%eax
lea    0x1(%r12),%esi
lea    0x1(%r8),%eax
mov    %eax,0x4(%rsp)
jne    1130 <main+0x20>
shr    $0x22,%rdi
mov    %rbp,%rbx
mov    $0x88888889,%eax
imul   %rax,%rbx
neg    %ecx
lea    (%r12,%rdx,1),%eax
add    $0x2,%eax
cmp    $0x1,%eax
jne    1130 <main+0x20>
mov    %edi,%eax
shl    $0x4,%eax
shr    $0x23,%rbx
mov    %esi,%edx
and    $0xf,%edx
add    %r12d,%ecx
add    $0x2,%ecx
cmp    $0x1,%ecx
jne    1130 <main+0x20>
mov    %rbp,%r13
mov    $0xaaaaaaab,%ecx
imul   %rcx,%r13
imul   $0x4ec4ec4f,%rbp,%r11
mov    %edi,%r15d
sub    %eax,%r15d
lea    (%rbx,%rbx,4),%eax
lea    (%rax,%rax,2),%eax
neg    %eax
test   %edx,%edx
jne    1130 <main+0x20>
imul   $0x24924925,%rbp,%r9
mov    %r13,%rdx
shr    $0x23,%rdx
shr    $0x22,%r11
add    %r15d,%edi
add    %r12d,%eax
add    $0x2,%eax
cmp    $0x1,%eax
jne    1130 <main+0x20>
shr    $0x20,%r9
mov    $0xba2e8ba3,%eax
imul   %rax,%rbp
shl    $0x2,%edx
lea    (%r11,%r11,2),%eax
lea    (%r11,%rax,4),%ebx
neg    %ebx
lea    (%r12,%rdi,1),%eax
add    $0x2,%eax
cmp    $0x1,%eax
jne    1130 <main+0x20>
sub    %r9d,%r8d
mov    %r14,%rdi
shr    $0x23,%rdi
shr    $0x23,%rbp
lea    (%rdx,%rdx,2),%edx
neg    %edx
lea    (%r12,%rbx,1),%eax
add    $0x2,%eax
cmp    $0x1,%eax
jne    1130 <main+0x20>
shr    %r8d
add    %edi,%edi
lea    0x0(%rbp,%rbp,4),%eax
lea    0x0(%rbp,%rax,2),%ebp
neg    %ebp
lea    (%r12,%rdx,1),%eax
add    $0x2,%eax
cmp    $0x1,%eax
jne    1130 <main+0x20>
add    %r9d,%r8d
shr    $0x21,%r10
lea    (%rdi,%rdi,4),%edx
neg    %edx
lea    (%r12,%rbp,1),%eax
add    $0x2,%eax
cmp    $0x1,%eax
jne    1130 <main+0x20>
shr    $0x2,%r8d
lea    (%r10,%r10,8),%eax
neg    %eax
add    %r12d,%edx
add    $0x2,%edx
cmp    $0x1,%edx
jne    1130 <main+0x20>
mov    %r13,%rdx
shr    $0x22,%rdx
lea    0x0(,%r8,8),%ebp
mov    %esi,%edi
and    $0x7,%edi
add    %r12d,%eax
add    $0x2,%eax
cmp    $0x1,%eax
jne    1130 <main+0x20>
add    %edx,%edx
sub    %ebp,%r8d
test   %edi,%edi
jne    1130 <main+0x20>
shr    $0x22,%r14
lea    (%rdx,%rdx,2),%eax
neg    %eax
lea    (%r12,%r8,1),%edx
add    $0x2,%edx
cmp    $0x1,%edx
jne    1130 <main+0x20>
lea    (%r14,%r14,4),%edx
neg    %edx
add    %r12d,%eax
add    $0x2,%eax
cmp    $0x1,%eax
jne    1130 <main+0x20>
shr    $0x21,%r13
mov    %esi,%eax
and    $0x3,%eax
add    %r12d,%edx
add    $0x2,%edx
cmp    $0x1,%edx
jne    1130 <main+0x20>
lea    0x0(%r13,%r13,2),%ecx
neg    %ecx
test   %eax,%eax
jne    1130 <main+0x20>
mov    %esi,%eax
and    $0x1,%eax
add    %r12d,%ecx
add    $0x2,%ecx
cmp    $0x1,%ecx
jne    1130 <main+0x20>
test   %eax,%eax
jne    1130 <main+0x20>
lea    0xc55(%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 = [13 x i8] c"Result = %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 0, i32* %2
store i32 2, i32* %3
br label %6
6: ; preds = %33, %0
%7 = load i32, i32* %2
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
br i1 %9, label %10, label %36
10: ; preds = %6
store i32 1, i32* %4
store i32 20, i32* %5
br label %11
11: ; preds = %25, %10
%12 = load i32, i32* %4
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load i32, i32* %5
%16 = icmp sgt i32 %15, 0
br label %17
17: ; preds = %14, %11
%18 = phi i1 [ false, %11 ], [ %16, %14 ]
br i1 %18, label %19, label %28
19: ; preds = %17
%20 = load i32, i32* %3
%21 = load i32, i32* %5
%22 = srem i32 %20, %21
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %25
24: ; preds = %19
store i32 0, i32* %4
br label %28
25: ; preds = %19
%26 = load i32, i32* %5
%27 = add nsw i32 %26, -1
store i32 %27, i32* %5
br label %11
28: ; preds = %24, %17
%29 = load i32, i32* %4
%30 = icmp ne i32 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %28
%32 = load i32, i32* %3
store i32 %32, i32* %2
br label %33
33: ; preds = %31, %28
%34 = load i32, i32* %3
%35 = add nsw i32 %34, 1
store i32 %35, i32* %3
br label %6
36: ; preds = %6
%37 = load i32, i32* %2
%38 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %37)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Result = %d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 2, %0 ], [ %58, %1 ]
%3 = urem i32 %2, 20
%4 = urem i32 %2, 19
%5 = or i32 %3, %4
%6 = icmp eq i32 %5, 0
%7 = urem i32 %2, 18
%8 = icmp eq i32 %7, 0
%9 = select i1 %6, i1 %8, i1 false
%10 = urem i32 %2, 17
%11 = icmp eq i32 %10, 0
%12 = select i1 %9, i1 %11, i1 false
%13 = and i32 %2, 15
%14 = icmp eq i32 %13, 0
%15 = select i1 %12, i1 %14, i1 false
%16 = urem i32 %2, 15
%17 = icmp eq i32 %16, 0
%18 = select i1 %15, i1 %17, i1 false
%19 = urem i32 %2, 14
%20 = icmp eq i32 %19, 0
%21 = select i1 %18, i1 %20, i1 false
%22 = urem i32 %2, 13
%23 = icmp eq i32 %22, 0
%24 = select i1 %21, i1 %23, i1 false
%25 = urem i32 %2, 12
%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, 10
%32 = icmp eq i32 %31, 0
%33 = select i1 %30, i1 %32, i1 false
%34 = urem i32 %2, 9
%35 = icmp eq i32 %34, 0
%36 = select i1 %33, i1 %35, i1 false
%37 = and i32 %2, 7
%38 = icmp eq i32 %37, 0
%39 = select i1 %36, i1 %38, i1 false
%40 = urem i32 %2, 7
%41 = icmp eq i32 %40, 0
%42 = select i1 %39, i1 %41, i1 false
%43 = urem i32 %2, 6
%44 = icmp eq i32 %43, 0
%45 = select i1 %42, i1 %44, i1 false
%46 = urem i32 %2, 5
%47 = icmp eq i32 %46, 0
%48 = select i1 %45, i1 %47, i1 false
%49 = and i32 %2, 3
%50 = icmp eq i32 %49, 0
%51 = select i1 %48, i1 %50, i1 false
%52 = urem i32 %2, 3
%53 = icmp eq i32 %52, 0
%54 = select i1 %51, i1 %53, i1 false
%55 = and i32 %2, 1
%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 ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}