#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 clock();
long fannkuch(unsigned int, unsigned int *, unsigned int *, unsigned int *,
              unsigned int *);
int /*<<< orphan*/ printf(char *, long, long);
void main() {
  unsigned int n;
  long start;
  unsigned int Perm[100], Perm1[100], Zaehl[100], PermMax[100];
  long BishMax;
  start = clock();
  n = 11;
  BishMax = fannkuch(n, Perm, Perm1, Zaehl, PermMax);
  printf("%d %d\n", BishMax, clock() - start);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x660,%rsp
mov    $0x0,%al
call   1030 <clock@plt>
mov    %rax,-0x10(%rbp)
movl   $0xb,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x1a0(%rbp),%rsi
lea    -0x330(%rbp),%rdx
lea    -0x4c0(%rbp),%rcx
lea    -0x650(%rbp),%r8
call   1050 <fannkuch@plt>
mov    %rax,-0x658(%rbp)
mov    -0x658(%rbp),%rax
mov    %rax,-0x660(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
mov    -0x660(%rbp),%rsi
mov    %rax,%rdx
sub    -0x10(%rbp),%rdx
lea    0xe5e(%rip),%rdi
call   1040 <printf@plt>
add    $0x660,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x648,%rsp
xor    %eax,%eax
call   1030 <clock@plt>
mov    %rax,%r14
lea    0x4b0(%rsp),%rsi
lea    0x320(%rsp),%rdx
lea    0x190(%rsp),%rcx
mov    %rsp,%r8
mov    $0xb,%edi
call   1050 <fannkuch@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <clock@plt>
sub    %r14,%rax
lea    0xe83(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1040 <printf@plt>
add    $0x648,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%d %d\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca [100 x i32]
%4 = alloca [100 x i32]
%5 = alloca [100 x i32]
%6 = alloca [100 x i32]
%7 = alloca i64
%8 = call i64 (...) @clock()
store i64 %8, i64* %2
store i32 11, i32* %1
%9 = load i32, i32* %1
%10 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 0
%11 = getelementptr inbounds [100 x i32], [100 x i32]* %4, i64 0, i64 0
%12 = getelementptr inbounds [100 x i32], [100 x i32]* %5, i64 0, i64 0
%13 = getelementptr inbounds [100 x i32], [100 x i32]* %6, i64 0, i64 0
%14 = call i64 @fannkuch(i32 %9, i32* %10, i32* %11, i32* %12, i32* %13)
store i64 %14, i64* %7
%15 = load i64, i64* %7
%16 = call i64 (...) @clock()
%17 = load i64, i64* %2
%18 = sub nsw i64 %16, %17
%19 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 %15, i64 %18)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d %d\0A\00"
define void @main() {
%1 = alloca [100 x i32]
%2 = alloca [100 x i32]
%3 = alloca [100 x i32]
%4 = alloca [100 x i32]
%5 = bitcast [100 x i32]* %1 to i8*
%6 = bitcast [100 x i32]* %2 to i8*
%7 = bitcast [100 x i32]* %3 to i8*
%8 = bitcast [100 x i32]* %4 to i8*
%9 = tail call i64 (...) @clock()
%10 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 0
%11 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 0
%12 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 0
%13 = getelementptr inbounds [100 x i32], [100 x i32]* %4, i64 0, i64 0
%14 = call i64 @fannkuch(i32 11, i32* %10, i32* %11, i32* %12, i32* %13)
%15 = call i64 (...) @clock()
%16 = sub nsw i64 %15, %9
%17 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 %14, i64 %16)
ret void
}