#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*/ multiply(int *, int, int *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int n;
  scanf("%d", &n);
  int a[200];
  a[0] = 1;
  int i = 1;
  int len = 1;
  for (i = 2; i <= n; i++) {
    multiply(a, i, &len);
  }
  for (i = len - 1; i >= 0; i--)
    printf("%d", a[i]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x340,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
movl   $0x1,-0x330(%rbp)
movl   $0x1,-0x334(%rbp)
movl   $0x1,-0x338(%rbp)
movl   $0x2,-0x334(%rbp)
mov    -0x334(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11b6 <main+0x86>
lea    -0x330(%rbp),%rdi
mov    -0x334(%rbp),%esi
lea    -0x338(%rbp),%rdx
call   1030 <multiply@plt>
mov    -0x334(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x334(%rbp)
jmp    117a <main+0x4a>
mov    -0x338(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x334(%rbp)
cmpl   $0x0,-0x334(%rbp)
jl     1200 <main+0xd0>
movslq -0x334(%rbp),%rax
mov    -0x330(%rbp,%rax,4),%esi
lea    0xe19(%rip),%rdi
call   1040 <printf@plt>
mov    -0x334(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x334(%rbp)
jmp    11c5 <main+0x95>
mov    -0x4(%rbp),%eax
add    $0x340,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x330,%rsp
lea    0xebd(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
movl   $0x1,0x10(%rsp)
movl   $0x1,0x8(%rsp)
mov    $0x1,%eax
cmpl   $0x2,0xc(%rsp)
jl     119e <main+0x6e>
mov    $0x1,%ebx
lea    0x10(%rsp),%r14
lea    0x8(%rsp),%r15
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
mov    %r15,%rdx
call   1030 <multiply@plt>
cmp    0xc(%rsp),%ebx
jl     1180 <main+0x50>
mov    0x8(%rsp),%eax
test   %eax,%eax
jle    11c9 <main+0x99>
mov    %eax,%ebx
add    $0x1,%rbx
lea    0xe55(%rip),%r14
nopl   0x0(%rax,%rax,1)
lea    -0x2(%rbx),%eax
mov    0x10(%rsp,%rax,4),%esi
mov    %r14,%rdi
call   1040 <printf@plt>
add    $0xffffffffffffffff,%rbx
cmp    $0x1,%rbx
ja     11b0 <main+0x80>
xor    %eax,%eax
add    $0x330,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [200 x i32]
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = bitcast [200 x i32]* %2 to i8*
%7 = getelementptr inbounds [200 x i32], [200 x i32]* %2, i64 0, i64 0
store i32 1, i32* %7
%8 = bitcast i32* %3 to i8*
store i32 1, i32* %3
%9 = load i32, i32* %1
%10 = icmp slt i32 %9, 2
br i1 %10, label %20, label %11
11: ; preds = %0, %11
%12 = phi i32 [ %14, %11 ], [ 2, %0 ]
%13 = call i32 @multiply(i32* %7, i32 %12, i32* %3)
%14 = add nuw nsw i32 %12, 1
%15 = load i32, i32* %1
%16 = icmp slt i32 %12, %15
br i1 %16, label %11, label %17
17: ; preds = %11
%18 = load i32, i32* %3
%19 = icmp sgt i32 %18, 0
br i1 %19, label %20, label %31
20: ; preds = %0, %17
%21 = phi i32 [ %18, %17 ], [ 1, %0 ]
%22 = zext i32 %21 to i64
br label %23
23: ; preds = %20, %23
%24 = phi i64 [ %22, %20 ], [ %25, %23 ]
%25 = add nsw i64 %24, -1
%26 = and i64 %25, 4294967295
%27 = getelementptr inbounds [200 x i32], [200 x i32]* %2, i64 0, i64 %26
%28 = load i32, i32* %27
%29 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %28)
%30 = icmp ugt i64 %24, 1
br i1 %30, label %23, label %31
31: ; preds = %23, %17
ret i32 0
}