#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 argc, char **argv) {
  int n = 20;
  while (1) {
    int good = 1;
    for (int d = 1; good && (d <= 20); d++) {
      if (n % d)
        good = 0;
    }
    if (good) {
      printf("smallest multiple is: %d\n", n);
      return 1;
    }
    n++;
  }
}


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   $0x14,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x18(%rbp)
mov    %al,-0x1d(%rbp)
je     1154 <main+0x44>
cmpl   $0x14,-0x1c(%rbp)
setle  %al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%al
test   $0x1,%al
jne    1164 <main+0x54>
jmp    118e <main+0x7e>
mov    -0x14(%rbp),%eax
cltd
idivl  -0x1c(%rbp)
cmp    $0x0,%edx
je     117b <main+0x6b>
movl   $0x0,-0x18(%rbp)
jmp    1180 <main+0x70>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    113b <main+0x2b>
cmpl   $0x0,-0x18(%rbp)
je     11b2 <main+0xa2>
mov    -0x14(%rbp),%esi
lea    0xe5e(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>

x86 assembly (clang, -O2):
<main>:
mov    $0x14,%eax
jmp    1127 <main+0x17>
nopw   0x0(%rax,%rax,1)
lea    0x1(%rsi),%eax
test   %edx,%edx
je     1146 <main+0x36>
mov    %eax,%esi
mov    $0x1,%ecx
xchg   %ax,%ax
mov    %esi,%eax
xor    %edx,%edx
div    %ecx
test   %edx,%edx
jne    1120 <main+0x10>
lea    0x1(%rcx),%eax
cmp    $0x14,%ecx
mov    %eax,%ecx
jb     1130 <main+0x20>
jmp    1120 <main+0x10>
push   %rax
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [26 x i8] c"smallest multiple is: %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %5, %2
%4 = phi i32 [ 20, %2 ], [ %6, %5 ]
br label %7
5: ; preds = %7
%6 = add nuw nsw i32 %4, 1
br i1 %10, label %14, label %3
7: ; preds = %3, %7
%8 = phi i32 [ 1, %3 ], [ %11, %7 ]
%9 = urem i32 %4, %8
%10 = icmp eq i32 %9, 0
%11 = add nuw nsw i32 %8, 1
%12 = icmp ult i32 %8, 20
%13 = and i1 %10, %12
br i1 %13, label %7, label %5
14: ; preds = %5
%15 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 1
}