#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 */
unsigned long CSPL_Special_factorial(unsigned long);
int /*<<< orphan*/ printf(char *);
int main(void) {
  {
    unsigned long ans[10] = {1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880};
    unsigned long val, i;
    printf("Testing: CSPL_Special_factorial()\n");
    for (i = 0; i < 10; i++) {
      val = CSPL_Special_factorial(i);
      {
        if (val != ans[i])
          return (1);
      };
    }
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x50,%edx
call   1050 <memcpy@plt>
lea    0xef5(%rip),%rdi
call   1040 <printf@plt>
movq   $0x0,-0x70(%rbp)
cmpq   $0xa,-0x70(%rbp)
jae    11b5 <main+0x85>
mov    -0x70(%rbp),%rdi
call   1030 <CSPL_Special_factorial@plt>
mov    %rax,-0x68(%rbp)
mov    -0x68(%rbp),%rax
mov    -0x70(%rbp),%rcx
cmp    -0x60(%rbp,%rcx,8),%rax
je     119f <main+0x6f>
movl   $0x1,-0x4(%rbp)
jmp    11bc <main+0x8c>
jmp    11a4 <main+0x74>
mov    -0x70(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x70(%rbp)
jmp    1168 <main+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <CSPL_Special_factorial@plt>
mov    $0x1,%ebx
cmp    $0x1,%rax
jne    11e2 <main+0xc2>
mov    $0x1,%edi
call   1040 <CSPL_Special_factorial@plt>
cmp    $0x1,%rax
jne    11e2 <main+0xc2>
mov    $0x2,%edi
call   1040 <CSPL_Special_factorial@plt>
cmp    $0x2,%rax
jne    11e2 <main+0xc2>
mov    $0x3,%edi
call   1040 <CSPL_Special_factorial@plt>
cmp    $0x6,%rax
jne    11e2 <main+0xc2>
mov    $0x4,%edi
call   1040 <CSPL_Special_factorial@plt>
cmp    $0x18,%rax
jne    11e2 <main+0xc2>
mov    $0x5,%edi
call   1040 <CSPL_Special_factorial@plt>
cmp    $0x78,%rax
jne    11e2 <main+0xc2>
mov    $0x6,%edi
call   1040 <CSPL_Special_factorial@plt>
cmp    $0x2d0,%rax
jne    11e2 <main+0xc2>
mov    $0x7,%edi
call   1040 <CSPL_Special_factorial@plt>
cmp    $0x13b0,%rax
jne    11e2 <main+0xc2>
mov    $0x8,%edi
call   1040 <CSPL_Special_factorial@plt>
cmp    $0x9d80,%rax
jne    11e2 <main+0xc2>
mov    $0x9,%edi
call   1040 <CSPL_Special_factorial@plt>
xor    %ebx,%ebx
cmp    $0x58980,%rax
setne  %bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.ans = [10 x i64] [i64 1, i64 1, i64 2, i64 6, i64 24, i64 120, i64 720, i64 5040, i64 40320, i64 362880]
@.str = [35 x i8] c"Testing: CSPL_Special_factorial()\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i64]
%3 = alloca i64
%4 = alloca i64
store i32 0, i32* %1
%5 = bitcast [10 x i64]* %2 to i8*
%6 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
store i64 0, i64* %4
br label %7
7: ; preds = %20, %0
%8 = load i64, i64* %4
%9 = icmp ult i64 %8, 10
br i1 %9, label %10, label %23
10: ; preds = %7
%11 = load i64, i64* %4
%12 = call i64 @CSPL_Special_factorial(i64 %11)
store i64 %12, i64* %3
%13 = load i64, i64* %3
%14 = load i64, i64* %4
%15 = getelementptr inbounds [10 x i64], [10 x i64]* %2, i64 0, i64 %14
%16 = load i64, i64* %15
%17 = icmp ne i64 %13, %16
br i1 %17, label %18, label %19
18: ; preds = %10
store i32 1, i32* %1
br label %24
19: ; preds = %10
br label %20
20: ; preds = %19
%21 = load i64, i64* %4
%22 = add i64 %21, 1
store i64 %22, i64* %4
br label %7
23: ; preds = %7
store i32 0, i32* %1
br label %24
24: ; preds = %23, %18
%25 = load i32, i32* %1
ret i32 %25
}

LLVM IR (-O2):
@str = [34 x i8] c"Testing: CSPL_Special_factorial()\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%2 = tail call i64 @CSPL_Special_factorial(i64 0)
%3 = icmp eq i64 %2, 1
br i1 %3, label %4, label %32
4: ; preds = %0
%5 = tail call i64 @CSPL_Special_factorial(i64 1)
%6 = icmp eq i64 %5, 1
br i1 %6, label %7, label %32
7: ; preds = %4
%8 = tail call i64 @CSPL_Special_factorial(i64 2)
%9 = icmp eq i64 %8, 2
br i1 %9, label %10, label %32
10: ; preds = %7
%11 = tail call i64 @CSPL_Special_factorial(i64 3)
%12 = icmp eq i64 %11, 6
br i1 %12, label %13, label %32
13: ; preds = %10
%14 = tail call i64 @CSPL_Special_factorial(i64 4)
%15 = icmp eq i64 %14, 24
br i1 %15, label %16, label %32
16: ; preds = %13
%17 = tail call i64 @CSPL_Special_factorial(i64 5)
%18 = icmp eq i64 %17, 120
br i1 %18, label %19, label %32
19: ; preds = %16
%20 = tail call i64 @CSPL_Special_factorial(i64 6)
%21 = icmp eq i64 %20, 720
br i1 %21, label %22, label %32
22: ; preds = %19
%23 = tail call i64 @CSPL_Special_factorial(i64 7)
%24 = icmp eq i64 %23, 5040
br i1 %24, label %25, label %32
25: ; preds = %22
%26 = tail call i64 @CSPL_Special_factorial(i64 8)
%27 = icmp eq i64 %26, 40320
br i1 %27, label %28, label %32
28: ; preds = %25
%29 = tail call i64 @CSPL_Special_factorial(i64 9)
%30 = icmp ne i64 %29, 362880
%31 = zext i1 %30 to i32
br label %32
32: ; preds = %28, %25, %22, %19, %16, %13, %10, %7, %4, %0
%33 = phi i32 [ 1, %0 ], [ 1, %4 ], [ 1, %7 ], [ 1, %10 ], [ 1, %13 ], [ 1, %16 ], [ 1, %19 ], [ 1, %22 ], [ 1, %25 ], [ %31, %28 ]
ret i32 %33
}