#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 primes[8] = {2, 3, 5, 7, 11, 13, 17, 19};
  int result = 1, i, max, max_old;
  for (i = 0; i < 8; i++) {
    max = max_old = 1;
    while ((max *= primes[i]) < 20)
      max_old = max;
    result *= max_old;
  }
  printf("Smallest divisible number: %d\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xed3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xed0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xecd(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x1,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
cmpl   $0x8,-0x38(%rbp)
jge    11b3 <main+0xa3>
movl   $0x1,-0x40(%rbp)
movl   $0x1,-0x3c(%rbp)
movslq -0x38(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%eax
imul   -0x3c(%rbp),%eax
mov    %eax,-0x3c(%rbp)
cmp    $0x14,%eax
jge    119b <main+0x8b>
mov    -0x3c(%rbp),%eax
mov    %eax,-0x40(%rbp)
jmp    1178 <main+0x68>
mov    -0x40(%rbp),%eax
imul   -0x34(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1160 <main+0x50>
mov    -0x34(%rbp),%esi
lea    0xe63(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0xde021f0,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [31 x i8] c"Smallest divisible number: %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 232792560)
ret i32 0
}