#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);
int main() {
  char found = 0;
  int res = 20;
  while (!found) {
    int i;
    for (i = 20; i > 1; i--) {
      if (res % i != 0)
        break;
    }
    if (i == 1)
      found = 1;
    else
      res++;
  }
  printf("Smallest multiple of 1..%d is %d\n", 20, res);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x0,-0x5(%rbp)
movl   $0x14,-0xc(%rbp)
cmpb   $0x0,-0x5(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1140 <main+0x30>
jmp    119a <main+0x8a>
movl   $0x14,-0x10(%rbp)
cmpl   $0x1,-0x10(%rbp)
jle    1179 <main+0x69>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
cmp    $0x0,%edx
je     1166 <main+0x56>
jmp    1179 <main+0x69>
jmp    116b <main+0x5b>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1147 <main+0x37>
cmpl   $0x1,-0x10(%rbp)
jne    118c <main+0x7c>
movb   $0x1,-0x5(%rbp)
jmp    1195 <main+0x85>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112a <main+0x1a>
mov    -0xc(%rbp),%edx
lea    0xe5c(%rip),%rdi
mov    $0x14,%esi
call   1030 <printf@plt>
xor    %eax,%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
movl   $0x14,0x4(%rsp)
mov    $0x13,%edx
nopl   0x0(%rax,%rax,1)
mov    0x4(%rsp),%eax
mov    %eax,%r8d
mov    %edx,%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),%esi
mov    %rbp,%rax
mov    $0xaf286bcb,%edx
imul   %rdx,%rax
shr    $0x20,%rax
mov    %r8d,%edx
sub    %eax,%edx
shr    %edx
add    %eax,%edx
shr    $0x4,%edx
lea    (%rdx,%rdx,8),%eax
lea    (%rdx,%rax,2),%eax
mov    %r14,%rdx
shr    $0x24,%rdx
shl    $0x2,%edx
lea    (%rdx,%rdx,4),%edx
neg    %edx
add    %r12d,%edx
add    $0x1,%edx
neg    %eax
add    %r12d,%eax
add    $0x1,%eax
neg    %esi
or     %edx,%eax
lea    0x1(%r12),%edx
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,%rsi,1),%eax
add    $0x14,%eax
cmp    $0x13,%eax
jne    1130 <main+0x20>
mov    %edi,%eax
shl    $0x4,%eax
shr    $0x23,%rbx
mov    %edx,%esi
and    $0xf,%esi
add    %r12d,%ecx
add    $0x14,%ecx
cmp    $0x13,%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   %esi,%esi
jne    1130 <main+0x20>
imul   $0x24924925,%rbp,%r9
mov    %r13,%rsi
shr    $0x23,%rsi
shr    $0x22,%r11
add    %r15d,%edi
add    %r12d,%eax
add    $0x14,%eax
cmp    $0x13,%eax
jne    1130 <main+0x20>
shr    $0x20,%r9
mov    $0xba2e8ba3,%eax
imul   %rax,%rbp
shl    $0x2,%esi
lea    (%r11,%r11,2),%eax
lea    (%r11,%rax,4),%ebx
neg    %ebx
lea    (%r12,%rdi,1),%eax
add    $0x14,%eax
cmp    $0x13,%eax
jne    1130 <main+0x20>
sub    %r9d,%r8d
mov    %r14,%rdi
shr    $0x23,%rdi
shr    $0x23,%rbp
lea    (%rsi,%rsi,2),%esi
neg    %esi
lea    (%r12,%rbx,1),%eax
add    $0x14,%eax
cmp    $0x13,%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,%rsi,1),%eax
add    $0x14,%eax
cmp    $0x13,%eax
jne    1130 <main+0x20>
add    %r9d,%r8d
shr    $0x21,%r10
lea    (%rdi,%rdi,4),%esi
neg    %esi
lea    (%r12,%rbp,1),%eax
add    $0x14,%eax
cmp    $0x13,%eax
jne    1130 <main+0x20>
shr    $0x2,%r8d
lea    (%r10,%r10,8),%eax
neg    %eax
add    %r12d,%esi
add    $0x14,%esi
cmp    $0x13,%esi
jne    1130 <main+0x20>
mov    %r13,%rsi
shr    $0x22,%rsi
lea    0x0(,%r8,8),%ebp
mov    %edx,%edi
and    $0x7,%edi
add    %r12d,%eax
add    $0x14,%eax
cmp    $0x13,%eax
jne    1130 <main+0x20>
add    %esi,%esi
sub    %ebp,%r8d
test   %edi,%edi
jne    1130 <main+0x20>
shr    $0x22,%r14
lea    (%rsi,%rsi,2),%eax
neg    %eax
lea    (%r12,%r8,1),%esi
add    $0x14,%esi
cmp    $0x13,%esi
jne    1130 <main+0x20>
lea    (%r14,%r14,4),%esi
neg    %esi
add    %r12d,%eax
add    $0x14,%eax
cmp    $0x13,%eax
jne    1130 <main+0x20>
shr    $0x21,%r13
mov    %edx,%eax
and    $0x3,%eax
add    %r12d,%esi
add    $0x14,%esi
cmp    $0x13,%esi
jne    1130 <main+0x20>
lea    0x0(%r13,%r13,2),%ecx
neg    %ecx
test   %eax,%eax
jne    1130 <main+0x20>
mov    %edx,%eax
and    $0x1,%eax
add    %r12d,%ecx
add    $0x14,%ecx
cmp    $0x13,%ecx
jne    1130 <main+0x20>
test   %eax,%eax
jne    1130 <main+0x20>
lea    0xc55(%rip),%rdi
mov    $0x14,%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 = [34 x i8] c"Smallest multiple of 1..%d is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i8 0, i8* %2
store i32 20, i32* %3
br label %5
5: ; preds = %30, %0
%6 = load i8, i8* %2
%7 = icmp ne i8 %6, 0
%8 = xor i1 %7, true
br i1 %8, label %9, label %31
9: ; preds = %5
store i32 20, i32* %4
br label %10
10: ; preds = %20, %9
%11 = load i32, i32* %4
%12 = icmp sgt i32 %11, 1
br i1 %12, label %13, label %23
13: ; preds = %10
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = srem i32 %14, %15
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %13
br label %23
19: ; preds = %13
br label %20
20: ; preds = %19
%21 = load i32, i32* %4
%22 = add nsw i32 %21, -1
store i32 %22, i32* %4
br label %10
23: ; preds = %18, %10
%24 = load i32, i32* %4
%25 = icmp eq i32 %24, 1
br i1 %25, label %26, label %27
26: ; preds = %23
store i8 1, i8* %2
br label %30
27: ; preds = %23
%28 = load i32, i32* %3
%29 = add nsw i32 %28, 1
store i32 %29, i32* %3
br label %30
30: ; preds = %27, %26
br label %5
31: ; preds = %5
%32 = load i32, i32* %3
%33 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 20, i32 %32)
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"Smallest multiple of 1..%d is %d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 20, %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 ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 20, i32 %2)
ret i32 0
}