#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 */
long atol(char *);
int fftss_version(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ test(long);
int /*<<< orphan*/ testall();
int main(int argc, char **argv) {
  long i;
  if (argc == 2 && strcmp("-t", argv[1]) == 0) {
    testall();
    return 0;
  }
  if (argc == 2) {
    i = atol(argv[1]);
    if (i)
      test(i);
    else
      printf("usage:\n\ttest -t    \t\trun all tests.\n"
             "\ttest [log2(N)]\t\tbenchmark [for length N]\n");
  } else {
    int ver;
    ver = fftss_version(NULL);
    printf("FFTSS library version 2.0, update %d.\n", ver);
    for (i = 1; i <= 16; i++)
      test(i);
  }
  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)
cmpl   $0x2,-0x8(%rbp)
jne    11b1 <main+0x51>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe71(%rip),%rdi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    11b1 <main+0x51>
mov    $0x0,%al
call   1030 <testall@plt>
movl   $0x0,-0x4(%rbp)
jmp    124e <main+0xee>
cmpl   $0x2,-0x8(%rbp)
jne    11f8 <main+0x98>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1070 <atol@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     11e5 <main+0x85>
mov    -0x18(%rbp),%rdi
call   1080 <test@plt>
jmp    11f3 <main+0x93>
lea    0xe17(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1247 <main+0xe7>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <fftss_version@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xe44(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movq   $0x1,-0x18(%rbp)
cmpq   $0x10,-0x18(%rbp)
jg     1242 <main+0xe2>
mov    -0x18(%rbp),%rdi
call   1080 <test@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    121d <main+0xbd>
jmp    1247 <main+0xe7>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x2,%edi
jne    11ac <main+0x3c>
mov    %rsi,%rbx
mov    0x8(%rsi),%rsi
lea    0xe7c(%rip),%rdi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1265 <main+0xf5>
mov    0x8(%rbx),%rdi
call   1080 <atol@plt>
test   %rax,%rax
je     126e <main+0xfe>
mov    %rax,%rdi
jmp    125e <main+0xee>
xor    %edi,%edi
call   1050 <fftss_version@plt>
lea    0xe49(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x1,%edi
call   1090 <test@plt>
mov    $0x2,%edi
call   1090 <test@plt>
mov    $0x3,%edi
call   1090 <test@plt>
mov    $0x4,%edi
call   1090 <test@plt>
mov    $0x5,%edi
call   1090 <test@plt>
mov    $0x6,%edi
call   1090 <test@plt>
mov    $0x7,%edi
call   1090 <test@plt>
mov    $0x8,%edi
call   1090 <test@plt>
mov    $0x9,%edi
call   1090 <test@plt>
mov    $0xa,%edi
call   1090 <test@plt>
mov    $0xb,%edi
call   1090 <test@plt>
mov    $0xc,%edi
call   1090 <test@plt>
mov    $0xd,%edi
call   1090 <test@plt>
mov    $0xe,%edi
call   1090 <test@plt>
mov    $0xf,%edi
call   1090 <test@plt>
mov    $0x10,%edi
call   1090 <test@plt>
jmp    127a <main+0x10a>
xor    %eax,%eax
call   1040 <testall@plt>
jmp    127a <main+0x10a>
lea    0xdb5(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"-t\00"
@.str.1 = [79 x i8] c"usage:\0A\09test -t \09\09run all tests.\0A\09test [log2(N)]\09\09benchmark [for length N]\0A\00"
@.str.2 = [39 x i8] c"FFTSS library version 2.0, update %d.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 2
br i1 %9, label %10, label %18
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i64 @strcmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %10
%17 = call i32 (...) @testall()
store i32 0, i32* %3
br label %49
18: ; preds = %10, %2
%19 = load i32, i32* %4
%20 = icmp eq i32 %19, 2
br i1 %20, label %21, label %34
21: ; preds = %18
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 1
%24 = load i8*, i8** %23
%25 = call i64 @atol(i8* %24)
store i64 %25, i64* %6
%26 = load i64, i64* %6
%27 = icmp ne i64 %26, 0
br i1 %27, label %28, label %31
28: ; preds = %21
%29 = load i64, i64* %6
%30 = call i32 @test(i64 %29)
br label %33
31: ; preds = %21
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.1, i64 0, i64 0))
br label %33
33: ; preds = %31, %28
br label %48
34: ; preds = %18
%35 = call i32 @fftss_version(i32* null)
store i32 %35, i32* %7
%36 = load i32, i32* %7
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i32 %36)
store i64 1, i64* %6
br label %38
38: ; preds = %44, %34
%39 = load i64, i64* %6
%40 = icmp sle i64 %39, 16
br i1 %40, label %41, label %47
41: ; preds = %38
%42 = load i64, i64* %6
%43 = call i32 @test(i64 %42)
br label %44
44: ; preds = %41
%45 = load i64, i64* %6
%46 = add nsw i64 %45, 1
store i64 %46, i64* %6
br label %38
47: ; preds = %38
br label %48
48: ; preds = %47, %33
store i32 0, i32* %3
br label %49
49: ; preds = %48, %16
%50 = load i32, i32* %3
ret i32 %50
}

LLVM IR (-O2):
@.str = [3 x i8] c"-t\00"
@.str.2 = [39 x i8] c"FFTSS library version 2.0, update %d.\0A\00"
@str = [78 x i8] c"usage:\0A\09test -t \09\09run all tests.\0A\09test [log2(N)]\09\09benchmark [for length N]\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %19
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i64 @strcmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = tail call i32 (...) @testall()
br label %38
11: ; preds = %4
%12 = load i8*, i8** %5
%13 = tail call i64 @atol(i8* %12)
%14 = icmp eq i64 %13, 0
br i1 %14, label %17, label %15
15: ; preds = %11
%16 = tail call i32 @test(i64 %13)
br label %38
17: ; preds = %11
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @str, i64 0, i64 0))
br label %38
19: ; preds = %2
%20 = tail call i32 @fftss_version(i32* null)
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i32 %20)
%22 = tail call i32 @test(i64 1)
%23 = tail call i32 @test(i64 2)
%24 = tail call i32 @test(i64 3)
%25 = tail call i32 @test(i64 4)
%26 = tail call i32 @test(i64 5)
%27 = tail call i32 @test(i64 6)
%28 = tail call i32 @test(i64 7)
%29 = tail call i32 @test(i64 8)
%30 = tail call i32 @test(i64 9)
%31 = tail call i32 @test(i64 10)
%32 = tail call i32 @test(i64 11)
%33 = tail call i32 @test(i64 12)
%34 = tail call i32 @test(i64 13)
%35 = tail call i32 @test(i64 14)
%36 = tail call i32 @test(i64 15)
%37 = tail call i32 @test(i64 16)
br label %38
38: ; preds = %19, %17, %15, %9
ret i32 0
}