#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 *, unsigned long);
int main() {
  const unsigned long val = 20;
  unsigned long x;
  unsigned long y;
  for (x = val;; x += val) {
    for (y = val - 1; y; y--) {
      if (x % y != 0)
        break;
    }
    if (y == 0) {
      printf("Answer = %u \n", x);
      break;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x14,-0x10(%rbp)
movq   $0x14,-0x18(%rbp)
movq   $0x13,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1173 <main+0x63>
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x20(%rbp)
cmp    $0x0,%rdx
je     115d <main+0x4d>
jmp    1173 <main+0x63>
jmp    1162 <main+0x52>
mov    -0x20(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
jmp    1137 <main+0x27>
cmpq   $0x0,-0x20(%rbp)
jne    1193 <main+0x83>
mov    -0x18(%rbp),%rsi
lea    0xe77(%rip),%rdi
call   1030 <printf@plt>
jmp    11a9 <main+0x99>
jmp    1198 <main+0x88>
mov    -0x18(%rbp),%rax
add    $0x14,%rax
mov    %rax,-0x18(%rbp)
jmp    112f <main+0x1f>
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
mov    $0x14,%eax
mov    %rax,(%rsp)
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
mov    (%rsp),%rdi
mov    %rdx,%rsi
mov    %rdi,%rax
movabs $0xaaaaaaaaaaaaaaab,%rcx
aa aa aa
mul    %rcx
mov    %rdx,%r9
mov    %rdi,%rax
movabs $0xcccccccccccccccd,%rcx
cc cc cc
mul    %rcx
mov    %rdx,%r8
mov    %rdi,%rax
movabs $0x2492492492492493,%rcx
49 92 24
mul    %rcx
mov    %rdx,%r11
mov    %rdi,%rax
movabs $0xe38e38e38e38e38f,%rcx
38 8e e3
mul    %rcx
mov    %rdx,%r10
mov    %rdi,%rax
movabs $0x2e8ba2e8ba2e8ba3,%rcx
a2 8b 2e
mul    %rcx
mov    %rdx,%r14
shr    $0x3,%r10
mov    %rdi,%rax
movabs $0x4ec4ec4ec4ec4ec5,%rcx
ec c4 4e
mul    %rcx
mov    %rdx,%r15
mov    %rdi,%rax
shr    %rax
movabs $0x4924924924924925,%rcx
92 24 49
mul    %rcx
mov    %rdx,%r13
shr    %r13
mov    %r13,%rbx
shl    $0x4,%rbx
mov    %rdi,%rax
movabs $0x8888888888888889,%rcx
88 88 88
mul    %rcx
mov    %rdx,%r12
mov    %rdi,%rax
movabs $0xf0f0f0f0f0f0f0f1,%rcx
f0 f0 f0
mul    %rcx
mov    %rdx,%rcx
shr    $0x4,%rcx
mov    %rcx,%rbp
shl    $0x4,%rbp
mov    %rdi,%rax
movabs $0xd79435e50d79435f,%rdx
35 94 d7
mul    %rdx
shr    $0x4,%rdx
lea    (%rdx,%rdx,8),%rax
lea    (%rdx,%rax,2),%rax
mov    %r10,%rdx
and    $0xfffffffffffffffe,%rdx
lea    (%rdx,%rdx,8),%rdx
neg    %rax
add    %rsi,%rax
add    $0x14,%rax
neg    %rdx
add    %rsi,%rdx
add    $0x14,%rdx
or     %rax,%rdx
lea    0x14(%rsi),%rdx
lea    0x14(%rdi),%rax
mov    %rax,(%rsp)
jne    1130 <main+0x20>
sub    %r13,%rbx
mov    %edx,%eax
and    $0xc,%eax
add    %rbp,%rcx
add    $0xffffffffffffffec,%rcx
cmp    %rsi,%rcx
jne    1130 <main+0x20>
sub    %r13,%rbx
shr    $0x3,%r12
test   %rax,%rax
jne    1130 <main+0x20>
add    $0xffffffffffffffec,%rbx
lea    (%r12,%r12,4),%rax
lea    (%rax,%rax,2),%rax
add    $0xffffffffffffffec,%rax
cmp    %rsi,%rax
jne    1130 <main+0x20>
sub    %r11,%rdi
shr    $0x2,%r15
cmp    %rsi,%rbx
jne    1130 <main+0x20>
shr    %rdi
mov    %r9,%rax
shr    $0x3,%rax
lea    (%r15,%r15,2),%rcx
lea    (%r15,%rcx,4),%rcx
add    $0xffffffffffffffec,%rcx
cmp    %rsi,%rcx
jne    1130 <main+0x20>
add    %r11,%rdi
shr    %r14
lea    (%rax,%rax,2),%rax
lea    -0x14(,%rax,4),%rax
ff
cmp    %rsi,%rax
jne    1130 <main+0x20>
shr    $0x2,%rdi
mov    %r8,%rax
shr    $0x3,%rax
lea    (%r14,%r14,4),%rcx
lea    (%r14,%rcx,2),%rcx
add    $0xffffffffffffffec,%rcx
cmp    %rsi,%rcx
jne    1130 <main+0x20>
lea    0x0(,%rdi,8),%rcx
lea    (%rax,%rax,4),%rax
add    %rax,%rax
add    $0xffffffffffffffec,%rax
cmp    %rsi,%rax
jne    1130 <main+0x20>
sub    %rdi,%rcx
mov    %edx,%eax
and    $0x4,%eax
lea    (%r10,%r10,8),%rdi
add    $0xffffffffffffffec,%rdi
cmp    %rsi,%rdi
jne    1130 <main+0x20>
add    $0xffffffffffffffec,%rcx
test   %rax,%rax
jne    1130 <main+0x20>
mov    %r9,%rax
shr    $0x2,%rax
cmp    %rsi,%rcx
jne    1130 <main+0x20>
shr    $0x2,%r8
lea    (%rax,%rax,2),%rax
add    %rax,%rax
add    $0xffffffffffffffec,%rax
cmp    %rsi,%rax
jne    1130 <main+0x20>
shr    %r9
lea    (%r8,%r8,4),%rax
add    $0xffffffffffffffec,%rax
cmp    %rsi,%rax
jne    1130 <main+0x20>
lea    (%r9,%r9,2),%rax
add    $0xffffffffffffffec,%rax
cmp    %rsi,%rax
jne    1130 <main+0x20>
lea    0xc71(%rip),%rdi
mov    %rdx,%rsi
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 = [14 x i8] c"Answer = %u \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i32 0, i32* %1
store i64 20, i64* %2
store i64 20, i64* %3
br label %5
5: ; preds = %26, %0
store i64 19, i64* %4
br label %6
6: ; preds = %16, %5
%7 = load i64, i64* %4
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %19
9: ; preds = %6
%10 = load i64, i64* %3
%11 = load i64, i64* %4
%12 = urem i64 %10, %11
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %9
br label %19
15: ; preds = %9
br label %16
16: ; preds = %15
%17 = load i64, i64* %4
%18 = add i64 %17, -1
store i64 %18, i64* %4
br label %6
19: ; preds = %14, %6
%20 = load i64, i64* %4
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %25
22: ; preds = %19
%23 = load i64, i64* %3
%24 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i64 %23)
br label %29
25: ; preds = %19
br label %26
26: ; preds = %25
%27 = load i64, i64* %3
%28 = add i64 %27, 20
store i64 %28, i64* %3
br label %5
29: ; preds = %22
ret i32 0
}

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