#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*/ absolute(int *, int /*<<< orphan*/);
int countValue(int *, int /*<<< orphan*/, int);
int isPermutation(int *, int /*<<< orphan*/);
int isSorted(int *, int /*<<< orphan*/);
int max(int *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int i;
  int a[0] = {};
  int b[5] = {-1, 0, 0, 0, 1};
  int c[5] = {-10, 9, -8, 7, -6};
  printf("max(a, 5) = %d\n", max(a, 0));
  printf("countValue (a, 5, 1) = %d\n", countValue(a, 0, 1));
  printf("countValue (a, 5, 0) = %d\n", countValue(a, 0, 0));
  printf("isSorted (a, 5) = %d\n", isSorted(a, 0));
  printf("isPermutation (a, 5) = %d\n", isPermutation(a, 0));
  absolute(a, 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xe8a(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xe87(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xe85(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xe8b(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xe88(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xe86(%rip),%eax
mov    %eax,-0x30(%rbp)
lea    -0xc(%rbp),%rdi
xor    %esi,%esi
call   1040 <max@plt>
mov    %eax,%esi
lea    0xe73(%rip),%rdi
call   1030 <printf@plt>
lea    -0xc(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1070 <countValue@plt>
mov    %eax,%esi
lea    0xe65(%rip),%rdi
call   1030 <printf@plt>
lea    -0xc(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1070 <countValue@plt>
mov    %eax,%esi
lea    0xe65(%rip),%rdi
call   1030 <printf@plt>
lea    -0xc(%rbp),%rdi
xor    %esi,%esi
call   1080 <isSorted@plt>
mov    %eax,%esi
lea    0xe67(%rip),%rdi
call   1030 <printf@plt>
lea    -0xc(%rbp),%rdi
xor    %esi,%esi
call   1060 <isPermutation@plt>
mov    %eax,%esi
lea    0xe64(%rip),%rdi
call   1030 <printf@plt>
lea    -0xc(%rbp),%rdi
xor    %esi,%esi
call   1050 <absolute@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <max@plt>
lea    0xe85(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1070 <countValue@plt>
lea    0xe78(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1070 <countValue@plt>
lea    0xe79(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1080 <isSorted@plt>
lea    0xe7c(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1060 <isPermutation@plt>
lea    0xe7a(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <absolute@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.b = [5 x i32] [i32 -1, i32 0, i32 0, i32 0, i32 1]
@__const.main.c = [5 x i32] [i32 -10, i32 9, i32 -8, i32 7, i32 -6]
@.str = [16 x i8] c"max(a, 5) = %d\0A\00"
@.str.1 = [27 x i8] c"countValue (a, 5, 1) = %d\0A\00"
@.str.2 = [27 x i8] c"countValue (a, 5, 0) = %d\0A\00"
@.str.3 = [22 x i8] c"isSorted (a, 5) = %d\0A\00"
@.str.4 = [27 x i8] c"isPermutation (a, 5) = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [0 x i32]
%4 = alloca [5 x i32]
%5 = alloca [5 x i32]
store i32 0, i32* %1
%6 = bitcast [0 x i32]* %3 to i8*
%7 = bitcast [5 x i32]* %4 to i8*
%8 = bitcast [5 x i32]* %5 to i8*
%9 = getelementptr inbounds [0 x i32], [0 x i32]* %3, i64 0, i64 0
%10 = call i32 @max(i32* %9, i32 0)
%11 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = getelementptr inbounds [0 x i32], [0 x i32]* %3, i64 0, i64 0
%13 = call i32 @countValue(i32* %12, i32 0, i32 1)
%14 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %13)
%15 = getelementptr inbounds [0 x i32], [0 x i32]* %3, i64 0, i64 0
%16 = call i32 @countValue(i32* %15, i32 0, i32 0)
%17 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %16)
%18 = getelementptr inbounds [0 x i32], [0 x i32]* %3, i64 0, i64 0
%19 = call i32 @isSorted(i32* %18, i32 0)
%20 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i32 %19)
%21 = getelementptr inbounds [0 x i32], [0 x i32]* %3, i64 0, i64 0
%22 = call i32 @isPermutation(i32* %21, i32 0)
%23 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i32 %22)
%24 = getelementptr inbounds [0 x i32], [0 x i32]* %3, i64 0, i64 0
%25 = call i32 @absolute(i32* %24, i32 0)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"max(a, 5) = %d\0A\00"
@.str.1 = [27 x i8] c"countValue (a, 5, 1) = %d\0A\00"
@.str.2 = [27 x i8] c"countValue (a, 5, 0) = %d\0A\00"
@.str.3 = [22 x i8] c"isSorted (a, 5) = %d\0A\00"
@.str.4 = [27 x i8] c"isPermutation (a, 5) = %d\0A\00"
define i32 @main() {
%1 = alloca [0 x i32]
%2 = bitcast [0 x i32]* %1 to i8*
%3 = getelementptr inbounds [0 x i32], [0 x i32]* %1, i64 0, i64 0
%4 = call i32 @max(i32* %3, i32 0)
%5 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @countValue(i32* %3, i32 0, i32 1)
%7 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = call i32 @countValue(i32* %3, i32 0, i32 0)
%9 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %8)
%10 = call i32 @isSorted(i32* %3, i32 0)
%11 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i32 %10)
%12 = call i32 @isPermutation(i32* %3, i32 0)
%13 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i32 %12)
%14 = call i32 @absolute(i32* %3, i32 0)
ret i32 0
}