#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 n = 20;
  while (1) {
    n += 20;
    int i = 20;
    for (i = 20; i > 1; i--) {
      if (n % i != 0)
        break;
    }
    if (i == 1)
      goto end;
  }
end:
  printf("The smallest number divisible by 1 - 20 is %d\n", n);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x14,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x14,%eax
mov    %eax,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
movl   $0x14,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jle    116f <main+0x5f>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
je     115c <main+0x4c>
jmp    116f <main+0x5f>
jmp    1161 <main+0x51>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    113d <main+0x2d>
cmpl   $0x1,-0xc(%rbp)
jne    117e <main+0x6e>
jmp    1183 <main+0x73>
jmp    1126 <main+0x16>
mov    -0x8(%rbp),%esi
lea    0xe73(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%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,%r12d
mov    $0x28,%r13d
nopw   0x0(%rax,%rax,1)
mov    %r12d,%r15d
mov    %r13d,%r8d
mov    %r13d,%edi
lea    0x14(%r15),%r12d
imul   $0x38e38e39,%rdi,%r10
mov    %r13d,%ebx
shr    %ebx
mov    $0x92492493,%eax
imul   %rax,%rbx
mov    %rdi,%rax
mov    $0xf0f0f0f1,%ecx
imul   %rcx,%rax
shr    $0x24,%rax
mov    %eax,%ebp
shl    $0x4,%ebp
add    %eax,%ebp
mov    %r10,%rax
shr    $0x22,%rax
add    %eax,%eax
lea    (%rax,%rax,8),%ecx
mov    %rdi,%rax
mov    $0xaf286bcb,%edx
imul   %rdx,%rax
shr    $0x20,%rax
mov    %r13d,%edx
sub    %eax,%edx
shr    %edx
add    %eax,%edx
shr    $0x4,%edx
lea    (%rdx,%rdx,8),%eax
lea    (%rdx,%rax,2),%eax
mov    %r12,%r14
mov    $0xcccccccd,%edx
imul   %rdx,%r14
mov    %r14,%rdx
shr    $0x24,%rdx
shl    $0x2,%edx
lea    (%rdx,%rdx,4),%edx
neg    %edx
add    %r15d,%edx
add    $0x14,%edx
neg    %eax
add    %r15d,%eax
add    $0x14,%eax
neg    %ecx
or     %edx,%eax
lea    0x14(%r8),%r13d
jne    1130 <main+0x20>
shr    $0x22,%rbx
mov    %rdi,%rax
mov    $0x88888889,%edx
imul   %rdx,%rax
neg    %ebp
add    %r15d,%ecx
add    $0x28,%ecx
cmp    $0x14,%ecx
jne    1130 <main+0x20>
mov    %ebx,%edx
shl    $0x4,%edx
shr    $0x23,%rax
mov    %r12d,%ecx
and    $0xc,%ecx
lea    (%r15,%rbp,1),%esi
add    $0x28,%esi
cmp    $0x14,%esi
jne    1130 <main+0x20>
mov    %rdi,%rbp
mov    $0xaaaaaaab,%esi
imul   %rsi,%rbp
imul   $0x4ec4ec4f,%rdi,%r11
mov    %ebx,%esi
sub    %edx,%esi
lea    (%rax,%rax,4),%eax
lea    (%rax,%rax,2),%eax
neg    %eax
test   %ecx,%ecx
jne    1130 <main+0x20>
imul   $0x24924925,%rdi,%r9
mov    %rbp,%rcx
shr    $0x23,%rcx
shr    $0x22,%r11
add    %esi,%ebx
add    %r15d,%eax
add    $0x28,%eax
cmp    $0x14,%eax
jne    1130 <main+0x20>
shr    $0x20,%r9
mov    $0xba2e8ba3,%eax
imul   %rax,%rdi
shl    $0x2,%ecx
lea    (%r11,%r11,2),%eax
lea    (%r11,%rax,4),%esi
neg    %esi
lea    (%r15,%rbx,1),%eax
add    $0x28,%eax
cmp    $0x14,%eax
jne    1130 <main+0x20>
sub    %r9d,%r8d
mov    %r14,%rax
shr    $0x23,%rax
shr    $0x23,%rdi
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
lea    (%r15,%rsi,1),%edx
add    $0x28,%edx
cmp    $0x14,%edx
jne    1130 <main+0x20>
shr    %r8d
add    %eax,%eax
lea    (%rdi,%rdi,4),%edx
lea    (%rdi,%rdx,2),%esi
neg    %esi
add    %r15d,%ecx
add    $0x28,%ecx
cmp    $0x14,%ecx
jne    1130 <main+0x20>
add    %r9d,%r8d
shr    $0x21,%r10
lea    (%rax,%rax,4),%eax
neg    %eax
lea    (%r15,%rsi,1),%ecx
add    $0x28,%ecx
cmp    $0x14,%ecx
jne    1130 <main+0x20>
shr    $0x2,%r8d
lea    (%r10,%r10,8),%ecx
neg    %ecx
add    %r15d,%eax
add    $0x14,%eax
test   %eax,%eax
jne    1130 <main+0x20>
mov    %rbp,%rax
shr    $0x22,%rax
lea    0x0(,%r8,8),%esi
mov    %r12d,%edx
and    $0x4,%edx
add    %r15d,%ecx
add    $0x28,%ecx
cmp    $0x14,%ecx
jne    1130 <main+0x20>
add    %eax,%eax
sub    %esi,%r8d
test   %edx,%edx
jne    1130 <main+0x20>
shr    $0x22,%r14
lea    (%rax,%rax,2),%eax
neg    %eax
lea    (%r15,%r8,1),%ecx
add    $0x28,%ecx
cmp    $0x14,%ecx
jne    1130 <main+0x20>
shr    $0x21,%rbp
lea    (%r14,%r14,4),%ecx
neg    %ecx
add    %r15d,%eax
add    $0x28,%eax
cmp    $0x14,%eax
jne    1130 <main+0x20>
lea    0x0(%rbp,%rbp,2),%eax
neg    %eax
add    %r15d,%ecx
add    $0x14,%ecx
test   %ecx,%ecx
jne    1130 <main+0x20>
add    %r15d,%eax
add    $0x28,%eax
cmp    $0x14,%eax
jne    1130 <main+0x20>
lea    0xc7e(%rip),%rdi
mov    %r12d,%esi
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 = [47 x i8] c"The smallest number divisible by 1 - 20 is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 20, i32* %2
br label %4
4: ; preds = %0, %24
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 20
store i32 %6, i32* %2
store i32 20, i32* %3
store i32 20, i32* %3
br label %7
7: ; preds = %17, %4
%8 = load i32, i32* %3
%9 = icmp sgt i32 %8, 1
br i1 %9, label %10, label %20
10: ; preds = %7
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = srem i32 %11, %12
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %10
br label %20
16: ; preds = %10
br label %17
17: ; preds = %16
%18 = load i32, i32* %3
%19 = add nsw i32 %18, -1
store i32 %19, i32* %3
br label %7
20: ; preds = %15, %7
%21 = load i32, i32* %3
%22 = icmp eq i32 %21, 1
br i1 %22, label %23, label %24
23: ; preds = %20
br label %25
24: ; preds = %20
br label %4
25: ; preds = %23
%26 = load i32, i32* %2
%27 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 %26)
%28 = load i32, i32* %1
ret i32 %28
}

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