#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 */
scalar_t__ isdiv(long long);
int /*<<< orphan*/ printf(char *, long long);
int main(int argc, char **argv) {
  int n;
  long long val = 1;
  for (n = 2; n <= 20; n++)
    val *= n;
  for (n = 2; n <= 20; n++)
    while (isdiv(val / n))
      val /= n;
  printf("%lld\n", val);
  return 0;
}


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)
movq   $0x1,-0x20(%rbp)
movl   $0x2,-0x14(%rbp)
cmpl   $0x14,-0x14(%rbp)
jg     116a <main+0x4a>
movslq -0x14(%rbp),%rax
imul   -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1145 <main+0x25>
movl   $0x2,-0x14(%rbp)
cmpl   $0x14,-0x14(%rbp)
jg     11c8 <main+0xa8>
jmp    1180 <main+0x60>
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
cqto
idiv   %rcx
mov    %rax,%rdi
call   1040 <isdiv@plt>
cmp    $0x0,%rax
je     11b5 <main+0x95>
movslq -0x14(%rbp),%rcx
mov    -0x20(%rbp),%rax
cqto
idiv   %rcx
mov    %rax,-0x20(%rbp)
jmp    1180 <main+0x60>
jmp    11ba <main+0x9a>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1171 <main+0x51>
mov    -0x20(%rbp),%rsi
lea    0xe2d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
movabs $0x21c3677c82b40000,%r14
67 c3 21
mov    $0x2,%r15d
jmp    114a <main+0x2a>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r15
cmp    $0x15,%r15
je     1183 <main+0x63>
mov    %r14,%rbx
jmp    1168 <main+0x48>
nop
mov    %r14,%rax
cqto
idiv   %r15
mov    %rax,%rbx
mov    %rbx,%rdi
call   1040 <isdiv@plt>
test   %rax,%rax
je     1140 <main+0x20>
mov    %rbx,%r14
mov    %rbx,%rax
or     %r15,%rax
shr    $0x20,%rax
jne    1150 <main+0x30>
mov    %r14d,%eax
xor    %edx,%edx
div    %r15d
mov    %eax,%ebx
jmp    115b <main+0x3b>
lea    0xe76(%rip),%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

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