xunge/DecIR huggingface dataset:
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ global_auto_repeat;
};
typedef TYPE_1__ XKeyboardState;

/* Variables and functions */
int get_XKeyboardState_global_auto_repeat(void *_p) {
  return (int)((XKeyboardState *)_p)->global_auto_repeat;
}


x86 assembly (clang, -O0):
<get_XKeyboardState_global_auto_repeat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_XKeyboardState_global_auto_repeat>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XKeyboardState_global_auto_repeat(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XKeyboardState_global_auto_repeat(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
bool fspath_mkdir(const char path[]) { return false; }


x86 assembly (clang, -O0):
<fspath_mkdir>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fspath_mkdir>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @fspath_mkdir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i32 0
}

LLVM IR (-O2):
define i32 @fspath_mkdir(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ run_boolean_comparison_tests();
int /*<<< orphan*/ run_boolean_compound_tests();
int /*<<< orphan*/ run_boolean_logical_tests();
int /*<<< orphan*/ run_boolean_not_tests();
int /*<<< orphan*/ test_user_functions_and_variables();
int main(void) {
  run_boolean_not_tests();
  run_boolean_comparison_tests();
  run_boolean_logical_tests();
  run_boolean_compound_tests();
  test_user_functions_and_variables();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <run_boolean_not_tests@plt>
mov    $0x0,%al
call   1030 <run_boolean_comparison_tests@plt>
mov    $0x0,%al
call   1060 <run_boolean_logical_tests@plt>
mov    $0x0,%al
call   1070 <run_boolean_compound_tests@plt>
mov    $0x0,%al
call   1040 <test_user_functions_and_variables@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <run_boolean_not_tests@plt>
xor    %eax,%eax
call   1030 <run_boolean_comparison_tests@plt>
xor    %eax,%eax
call   1060 <run_boolean_logical_tests@plt>
xor    %eax,%eax
call   1070 <run_boolean_compound_tests@plt>
xor    %eax,%eax
call   1040 <test_user_functions_and_variables@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @run_boolean_not_tests()
%3 = call i32 (...) @run_boolean_comparison_tests()
%4 = call i32 (...) @run_boolean_logical_tests()
%5 = call i32 (...) @run_boolean_compound_tests()
%6 = call i32 (...) @test_user_functions_and_variables()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @run_boolean_not_tests()
%2 = tail call i32 (...) @run_boolean_comparison_tests()
%3 = tail call i32 (...) @run_boolean_logical_tests()
%4 = tail call i32 (...) @run_boolean_compound_tests()
%5 = tail call i32 (...) @test_user_functions_and_variables()
ret i32 0
}
const char *dlerror() { return "loadable modules not supported"; }


x86 assembly (clang, -O0):
<dlerror>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dlerror>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [31 x i8] c"loadable modules not supported\00"
define i8* @dlerror() {
ret i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [31 x i8] c"loadable modules not supported\00"
define i8* @dlerror() {
ret i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void error(char *msg) { printf("error: %s\n", msg); }


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"error: %s\0A\00"
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"error: %s\0A\00"
define void @error(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_memblock_acquire() {
  printf("NOT IMPLEMENTED:"
         "pa_memblock_acquire"
         "\n");
}


x86 assembly (clang, -O0):
<pa_memblock_acquire>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pa_memblock_acquire>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"NOT IMPLEMENTED:pa_memblock_acquire\0A\00"
define i32 @pa_memblock_acquire() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [36 x i8] c"NOT IMPLEMENTED:pa_memblock_acquire\00"
define i32 @pa_memblock_acquire() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int cont;
  for (cont = 0; cont < 5000; cont += 2) {
    printf("\n%d", cont);
  }
  printf("\nEste num = %d", cont);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x1388,-0x8(%rbp)
jge    1150 <main+0x40>
mov    -0x8(%rbp),%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x8(%rbp),%esi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0xfffffffe,%ebx
lea    0xee0(%rip),%r14
add    $0x2,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
cmp    $0x1386,%ebx
jb     1120 <main+0x10>
lea    0xec8(%rip),%rdi
mov    $0x1388,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"\0A%d\00"
@.str.1 = [15 x i8] c"\0AEste num = %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %9, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 5000
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %6
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 2
store i32 %11, i32* %2
br label %3
12: ; preds = %3
%13 = load i32, i32* %2
%14 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"\0A%d\00"
@.str.1 = [15 x i8] c"\0AEste num = %d\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = add nuw nsw i32 %2, 2
%5 = icmp ult i32 %2, 4998
br i1 %5, label %1, label %6
6: ; preds = %1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 5000)
ret i32 0
}
void init_timers() { int i; }


x86 assembly (clang, -O0):
<init_timers>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_timers>:
ret

LLVM IR (-O0):
define void @init_timers() {
%1 = alloca i32
ret void
}

LLVM IR (-O2):
define void @init_timers() {
ret void
}
double dbl_max2(double a, double b) { return (a > b) ? a : b; }


x86 assembly (clang, -O0):
<dbl_max2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    112d <dbl_max2+0x2d>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1137 <dbl_max2+0x37>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dbl_max2>:
maxsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @dbl_max2(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp ogt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %3
br label %12
10: ; preds = %2
%11 = load double, double* %4
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @dbl_max2(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Variables and functions */
int right_child(int);
char *test_right_child() {
  do {
    if (!(right_child(0) == 2))
      return "right child of 0 is 2";
  } while (0);
  do {
    if (!(right_child(1) == 4))
      return "right child of 1 is 4";
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<test_right_child>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1030 <right_child@plt>
cmp    $0x2,%eax
je     1138 <test_right_child+0x28>
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1172 <test_right_child+0x62>
jmp    113d <test_right_child+0x2d>
jmp    1142 <test_right_child+0x32>
mov    $0x1,%edi
call   1030 <right_child@plt>
cmp    $0x4,%eax
je     1165 <test_right_child+0x55>
lea    0xeba(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1172 <test_right_child+0x62>
jmp    116a <test_right_child+0x5a>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_right_child>:
push   %rax
xor    %edi,%edi
call   1030 <right_child@plt>
cmp    $0x2,%eax
jne    113b <test_right_child+0x2b>
mov    $0x1,%edi
call   1030 <right_child@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x4,%ecx
lea    0xee1(%rip),%rcx
cmovne %rcx,%rax
pop    %rcx
ret
lea    0xebe(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"right child of 0 is 2\00"
@.str.1 = [22 x i8] c"right child of 1 is 4\00"
define i8* @test_right_child() {
%1 = alloca i8*
br label %2
2: ; preds = %0
%3 = call i32 @right_child(i32 0)
%4 = icmp eq i32 %3, 2
br i1 %4, label %6, label %5
5: ; preds = %2
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8** %1
br label %14
6: ; preds = %2
br label %7
7: ; preds = %6
br label %8
8: ; preds = %7
%9 = call i32 @right_child(i32 1)
%10 = icmp eq i32 %9, 4
br i1 %10, label %12, label %11
11: ; preds = %8
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8** %1
br label %14
12: ; preds = %8
br label %13
13: ; preds = %12
store i8* null, i8** %1
br label %14
14: ; preds = %13, %11, %5
%15 = load i8*, i8** %1
ret i8* %15
}

LLVM IR (-O2):
@.str = [22 x i8] c"right child of 0 is 2\00"
@.str.1 = [22 x i8] c"right child of 1 is 4\00"
define i8* @test_right_child() {
%1 = tail call i32 @right_child(i32 0)
%2 = icmp eq i32 %1, 2
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i32 @right_child(i32 1)
%5 = icmp eq i32 %4, 4
%6 = select i1 %5, i8* null, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0)
br label %7
7: ; preds = %3, %0
%8 = phi i8* [ getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), %0 ], [ %6, %3 ]
ret i8* %8
}
/* Type definitions */
struct FILE_T {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ stacktrace2(unsigned int, struct FILE_T *, unsigned int *);
void stacktrace(unsigned int max_frames, struct FILE_T *f) {
  unsigned int *ebp = &max_frames - 2;
  stacktrace2(max_frames, f, ebp);
}


x86 assembly (clang, -O0):
<stacktrace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x4(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <stacktrace2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stacktrace>:
push   %rax
mov    %edi,0x4(%rsp)
lea    -0x4(%rsp),%rdx
call   1030 <stacktrace2@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.FILE_T = type { i32 }
define void @stacktrace(i32 %0, %struct.FILE_T* %1) {
%3 = alloca i32
%4 = alloca %struct.FILE_T*
%5 = alloca i32*
store i32 %0, i32* %3
store %struct.FILE_T* %1, %struct.FILE_T** %4
%6 = getelementptr inbounds i32, i32* %3, i64 -2
store i32* %6, i32** %5
%7 = load i32, i32* %3
%8 = load %struct.FILE_T*, %struct.FILE_T** %4
%9 = load i32*, i32** %5
%10 = call i32 @stacktrace2(i32 %7, %struct.FILE_T* %8, i32* %9)
ret void
}

LLVM IR (-O2):
%struct.FILE_T = type { i32 }
define void @stacktrace(i32 %0, %struct.FILE_T* %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = getelementptr inbounds i32, i32* %3, i64 -2
%5 = call i32 @stacktrace2(i32 %0, %struct.FILE_T* %1, i32* %4)
ret void
}
int ft_strclen(char const *s, int c) {
  int i;
  i = 0;
  while (s[i] && s[i] != (char)c)
    i++;
  return (i);
}


x86 assembly (clang, -O0):
<ft_strclen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1146 <ft_strclen+0x46>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0xc(%rbp),%ecx
movsbl %cl,%ecx
cmp    %ecx,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1156 <ft_strclen+0x56>
jmp    1164 <ft_strclen+0x64>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <ft_strclen+0x12>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strclen>:
mov    (%rdi),%dl
test   %dl,%dl
je     1125 <ft_strclen+0x25>
movsbl %sil,%ecx
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %dl,%edx
cmp    %edx,%ecx
je     1124 <ft_strclen+0x24>
movzbl 0x1(%rdi,%rax,1),%edx
add    $0x1,%rax
test   %dl,%dl
jne    1110 <ft_strclen+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @ft_strclen(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %27, %2
%7 = load i8*, i8** %3
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %25
14: ; preds = %6
%15 = load i8*, i8** %3
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = load i32, i32* %4
%22 = trunc i32 %21 to i8
%23 = sext i8 %22 to i32
%24 = icmp ne i32 %20, %23
br label %25
25: ; preds = %14, %6
%26 = phi i1 [ false, %6 ], [ %24, %14 ]
br i1 %26, label %27, label %30
27: ; preds = %25
%28 = load i32, i32* %5
%29 = add nsw i32 %28, 1
store i32 %29, i32* %5
br label %6
30: ; preds = %25
%31 = load i32, i32* %5
ret i32 %31
}

LLVM IR (-O2):
define i32 @ft_strclen(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %22, label %5
5: ; preds = %2
%6 = shl i32 %1, 24
%7 = ashr exact i32 %6, 24
br label %8
8: ; preds = %5, %14
%9 = phi i64 [ 0, %5 ], [ %15, %14 ]
%10 = phi i8 [ %3, %5 ], [ %18, %14 ]
%11 = phi i32 [ 0, %5 ], [ %16, %14 ]
%12 = sext i8 %10 to i32
%13 = icmp eq i32 %7, %12
br i1 %13, label %20, label %14
14: ; preds = %8
%15 = add nuw i64 %9, 1
%16 = add nuw nsw i32 %11, 1
%17 = getelementptr inbounds i8, i8* %0, i64 %15
%18 = load i8, i8* %17
%19 = icmp eq i8 %18, 0
br i1 %19, label %22, label %8
20: ; preds = %8
%21 = trunc i64 %9 to i32
br label %22
22: ; preds = %14, %20, %2
%23 = phi i32 [ 0, %2 ], [ %21, %20 ], [ %16, %14 ]
ret i32 %23
}
/* Type definitions */
typedef int /*<<< orphan*/ GLenum;
typedef int /*<<< orphan*/ GLdouble;

/* Variables and functions */
int /*<<< orphan*/ glGetDoublev(int /*<<< orphan*/, int /*<<< orphan*/ *);
void GetDoublev(GLenum pname, GLdouble *params) { glGetDoublev(pname, params); }


x86 assembly (clang, -O0):
<GetDoublev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <glGetDoublev@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetDoublev>:
jmp    1030 <glGetDoublev@plt>

LLVM IR (-O0):
define void @GetDoublev(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32, i32* %3
%6 = load i32*, i32** %4
%7 = call i32 @glGetDoublev(i32 %5, i32* %6)
ret void
}

LLVM IR (-O2):
define void @GetDoublev(i32 %0, i32* %1) {
%3 = tail call i32 @glGetDoublev(i32 %0, i32* %1)
ret void
}
void viewport_copy_out(int term, char *s) {}


x86 assembly (clang, -O0):
<viewport_copy_out>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<viewport_copy_out>:
ret

LLVM IR (-O0):
define void @viewport_copy_out(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @viewport_copy_out(i32 %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
scalar_t__ isspace(char const);
int delete_blanks(const char **exp_string) {
  while (isspace(**exp_string) != 0)
    (*exp_string)++;
  if (**exp_string == '\0')
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<delete_blanks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1148 <delete_blanks+0x38>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    111c <delete_blanks+0xc>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1167 <delete_blanks+0x57>
movl   $0x1,-0x4(%rbp)
jmp    116e <delete_blanks+0x5e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delete_blanks>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rax
movsbl (%rax),%edi
nopw   0x0(%rax,%rax,1)
call   1030 <isspace@plt>
test   %rax,%rax
je     113a <delete_blanks+0x2a>
mov    (%rbx),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rbx)
movsbl 0x1(%rax),%edi
jmp    1120 <delete_blanks+0x10>
mov    (%rbx),%rcx
xor    %eax,%eax
cmpb   $0x0,(%rcx)
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @delete_blanks(i8** %0) {
%2 = alloca i32
%3 = alloca i8**
store i8** %0, i8*** %3
br label %4
4: ; preds = %10, %1
%5 = load i8**, i8*** %3
%6 = load i8*, i8** %5
%7 = load i8, i8* %6
%8 = call i64 @isspace(i8 signext %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %4
%11 = load i8**, i8*** %3
%12 = load i8*, i8** %11
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %11
br label %4
14: ; preds = %4
%15 = load i8**, i8*** %3
%16 = load i8*, i8** %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %14
store i32 1, i32* %2
br label %22
21: ; preds = %14
store i32 0, i32* %2
br label %22
22: ; preds = %21, %20
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @delete_blanks(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = tail call i64 @isspace(i8 signext %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %1, %6
%7 = load i8*, i8** %0
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8* %8, i8** %0
%9 = load i8, i8* %8
%10 = tail call i64 @isspace(i8 signext %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %6
12: ; preds = %6, %1
%13 = load i8*, i8** %0
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
%16 = zext i1 %15 to i32
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ graphics_zoom(int, int);
int /*<<< orphan*/ redraw();
void disp_zoom(int sx, int sy) {
  graphics_zoom(sx, sy);
  redraw();
}


x86 assembly (clang, -O0):
<disp_zoom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <graphics_zoom@plt>
mov    $0x0,%al
call   1030 <redraw@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<disp_zoom>:
push   %rax
call   1040 <graphics_zoom@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <redraw@plt>

LLVM IR (-O0):
define void @disp_zoom(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @graphics_zoom(i32 %5, i32 %6)
%8 = call i32 (...) @redraw()
ret void
}

LLVM IR (-O2):
define void @disp_zoom(i32 %0, i32 %1) {
%3 = tail call i32 @graphics_zoom(i32 %0, i32 %1)
%4 = tail call i32 (...) @redraw()
ret void
}
void __attribute__((section(".text.3"))) frame3(void) {
  asm("frame3_label: .globl frame3_label");
}


x86 assembly (clang, -O0):
<frame3>:
push   %rbp
mov    %rsp,%rbp

x86 assembly (clang, -O2):
<frame3>:
ret

LLVM IR (-O0):
define void @frame3() section ".text.3" {
ret void
}

LLVM IR (-O2):
define void @frame3() section ".text.3" {
tail call void asm sideeffect "frame3_label: .globl frame3_label", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
void RotateUV180() {}


x86 assembly (clang, -O0):
<RotateUV180>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RotateUV180>:
ret

LLVM IR (-O0):
define void @RotateUV180() {
ret void
}

LLVM IR (-O2):
define void @RotateUV180() {
ret void
}
void irreducible_nest2(char *a, int b, char *z) {
  if (b) {
    goto L0;
  }
  while (*a) {
    a++;
  L0:
    while (*z) {
      *z++;
    }
  }
}


x86 assembly (clang, -O0):
<irreducible_nest2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     111e <irreducible_nest2+0x1e>
jmp    113c <irreducible_nest2+0x3c>
jmp    1123 <irreducible_nest2+0x23>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1164 <irreducible_nest2+0x64>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1141 <irreducible_nest2+0x41>
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     115f <irreducible_nest2+0x5f>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1141 <irreducible_nest2+0x41>
jmp    1123 <irreducible_nest2+0x23>
pop    %rbp
ret

x86 assembly (clang, -O2):
<irreducible_nest2>:
test   %esi,%esi
jne    110d <irreducible_nest2+0xd>
cmpb   $0x0,(%rdi)
je     112c <irreducible_nest2+0x2c>
add    $0x1,%rdi
add    $0xffffffffffffffff,%rdx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdx)
lea    0x1(%rdx),%rdx
jne    1120 <irreducible_nest2+0x20>
jmp    1104 <irreducible_nest2+0x4>
ret

LLVM IR (-O0):
define void @irreducible_nest2(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %3
br label %18
10: ; preds = %3
br label %11
11: ; preds = %27, %10
%12 = load i8*, i8** %4
%13 = load i8, i8* %12
%14 = icmp ne i8 %13, 0
br i1 %14, label %15, label %28
15: ; preds = %11
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %4
br label %18
18: ; preds = %15, %9
br label %19
19: ; preds = %23, %18
%20 = load i8*, i8** %6
%21 = load i8, i8* %20
%22 = icmp ne i8 %21, 0
br i1 %22, label %23, label %27
23: ; preds = %19
%24 = load i8*, i8** %6
%25 = getelementptr inbounds i8, i8* %24, i32 1
store i8* %25, i8** %6
%26 = load i8, i8* %24
br label %19
27: ; preds = %19
br label %11
28: ; preds = %11
ret void
}

LLVM IR (-O2):
define void @irreducible_nest2(i8* nocapture %0, i32 %1, i8* nocapture %2) {
%4 = icmp eq i32 %1, 0
br i1 %4, label %5, label %12
5: ; preds = %15, %3
%6 = phi i8* [ %0, %3 ], [ %13, %15 ]
%7 = phi i8* [ %2, %3 ], [ %16, %15 ]
%8 = load i8, i8* %6
%9 = icmp eq i8 %8, 0
br i1 %9, label %20, label %10
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %6, i64 1
br label %12
12: ; preds = %3, %10
%13 = phi i8* [ %0, %3 ], [ %11, %10 ]
%14 = phi i8* [ %2, %3 ], [ %7, %10 ]
br label %15
15: ; preds = %15, %12
%16 = phi i8* [ %14, %12 ], [ %19, %15 ]
%17 = load i8, i8* %16
%18 = icmp eq i8 %17, 0
%19 = getelementptr inbounds i8, i8* %16, i64 1
br i1 %18, label %5, label %15
20: ; preds = %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void printArr(int *arr, int n) {
  for (int i = 0; i < n; i++) {
    printf("Arr element %d is %d\n", i, arr[i]);
  }
}


x86 assembly (clang, -O0):
<printArr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115a <printArr+0x4a>
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printArr+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArr>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1147 <printArr+0x37>
mov    %rdi,%r14
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%edx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <printArr+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Arr element %d is %d\0A\00"
define void @printArr(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %18, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %21
10: ; preds = %6
%11 = load i32, i32* %5
%12 = load i32*, i32** %3
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
%16 = load i32, i32* %15
%17 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %16)
br label %18
18: ; preds = %10
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %6
21: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"Arr element %d is %d\0A\00"
define void @printArr(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %13, %7 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = trunc i64 %8 to i32
%12 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %10)
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int send(int, char *, unsigned int, int /*<<< orphan*/);
int send_lots(int sockfd, char *data, unsigned int length) {
  int c;
  if (send(sockfd, data, length, 0) == -1) {
    printf("Error sending to client\n");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<send_lots>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
call   1030 <send@plt>
cmp    $0xffffffff,%eax
jne    1164 <send_lots+0x44>
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    116b <send_lots+0x4b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_lots>:
push   %rbx
xor    %ebx,%ebx
xor    %ecx,%ecx
call   1040 <send@plt>
cmp    $0xffffffff,%eax
jne    1140 <send_lots+0x20>
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Error sending to client\0A\00"
define i32 @send_lots(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = call i32 @send(i32 %9, i8* %10, i32 %11, i32 0)
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %16
14: ; preds = %3
%15 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %4
br label %17
16: ; preds = %3
store i32 0, i32* %4
br label %17
17: ; preds = %16, %14
%18 = load i32, i32* %4
ret i32 %18
}

LLVM IR (-O2):
@str = [24 x i8] c"Error sending to client\00"
define i32 @send_lots(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @send(i32 %0, i8* %1, i32 %2, i32 0)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ -1, %6 ], [ 0, %3 ]
ret i32 %9
}
/* Variables and functions */
float cos(int);
float sin(float);
float FYX(float x, float y) {
  return ((sin(2 * x) + cos(2 * x)) / sin(x)) * (x * x + y * y);
}


x86 assembly (clang, -O0):
<FYX>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  0xec6(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
call   1030 <sin@plt>
movss  %xmm0,-0x10(%rbp)
movss  0xeaf(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
cvttss2si %xmm0,%edi
call   1040 <cos@plt>
movaps %xmm0,%xmm1
movss  -0x10(%rbp),%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
divss  %xmm1,%xmm0
movss  -0x4(%rbp),%xmm1
movss  -0x4(%rbp),%xmm3
movss  -0x8(%rbp),%xmm2
mulss  -0x8(%rbp),%xmm2
mulss  %xmm3,%xmm1
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FYX>:
sub    $0x18,%rsp
movss  %xmm1,0x14(%rsp)
movss  %xmm0,0xc(%rsp)
addss  %xmm0,%xmm0
movss  %xmm0,0x10(%rsp)
call   1030 <sin@plt>
movss  %xmm0,0x8(%rsp)
cvttss2si 0x10(%rsp),%edi
call   1040 <cos@plt>
addss  0x8(%rsp),%xmm0
movss  %xmm0,0x8(%rsp)
movss  0xc(%rsp),%xmm0
call   1030 <sin@plt>
movss  0x8(%rsp),%xmm2
divss  %xmm0,%xmm2
movss  0x14(%rsp),%xmm1
mulss  %xmm1,%xmm1
movss  0xc(%rsp),%xmm0
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
mulss  %xmm2,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @FYX(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = fmul float 2.000000e+00, %5
%7 = call float @sin(float %6)
%8 = load float, float* %3
%9 = fmul float 2.000000e+00, %8
%10 = fptosi float %9 to i32
%11 = call float @cos(i32 %10)
%12 = fadd float %7, %11
%13 = load float, float* %3
%14 = call float @sin(float %13)
%15 = fdiv float %12, %14
%16 = load float, float* %3
%17 = load float, float* %3
%18 = load float, float* %4
%19 = load float, float* %4
%20 = fmul float %18, %19
%21 = call float @llvm.fmuladd.f32(float %16, float %17, float %20)
%22 = fmul float %15, %21
ret float %22
}

LLVM IR (-O2):
define float @FYX(float %0, float %1) {
%3 = fmul float %0, 2.000000e+00
%4 = tail call float @sin(float %3)
%5 = fptosi float %3 to i32
%6 = tail call float @cos(i32 %5)
%7 = fadd float %4, %6
%8 = tail call float @sin(float %0)
%9 = fdiv float %7, %8
%10 = fmul float %1, %1
%11 = tail call float @llvm.fmuladd.f32(float %0, float %0, float %10)
%12 = fmul float %11, %9
ret float %12
}
/* Type definitions */
struct fpz_env {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct fpz_env *);
void fpz_destroy_env(struct fpz_env *env) {
  if (env)
    free(env);
}


x86 assembly (clang, -O0):
<fpz_destroy_env>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <fpz_destroy_env+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fpz_destroy_env>:
test   %rdi,%rdi
je     111a <fpz_destroy_env+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
%struct.fpz_env = type { i32 }
define void @fpz_destroy_env(%struct.fpz_env* %0) {
%2 = alloca %struct.fpz_env*
store %struct.fpz_env* %0, %struct.fpz_env** %2
%3 = load %struct.fpz_env*, %struct.fpz_env** %2
%4 = icmp ne %struct.fpz_env* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load %struct.fpz_env*, %struct.fpz_env** %2
%7 = call i32 @free(%struct.fpz_env* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
%struct.fpz_env = type { i32 }
define void @fpz_destroy_env(%struct.fpz_env* %0) {
%2 = icmp eq %struct.fpz_env* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.fpz_env* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
double foo();
main() {
  if (foo() != 1.0)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <foo@plt>
movsd  0xeb2(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1163 <main+0x33>
jp     1163 <main+0x33>
jmp    116a <main+0x3a>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <foo@plt>
ucomisd 0xec0(%rip),%xmm0
jne    1144 <main+0x14>
jnp    114b <main+0x1b>
xor    %eax,%eax
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call double (...) @foo()
%3 = fcmp une double %2, 1.000000e+00
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call double (...) @foo()
%2 = fcmp une double %1, 1.000000e+00
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ mem_free(void *);
void plt_2d_line_free_aux(void *ptr) { mem_free(ptr); }


x86 assembly (clang, -O0):
<plt_2d_line_free_aux>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <mem_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plt_2d_line_free_aux>:
jmp    1030 <mem_free@plt>

LLVM IR (-O0):
define void @plt_2d_line_free_aux(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @mem_free(i8* %3)
ret void
}

LLVM IR (-O2):
define void @plt_2d_line_free_aux(i8* %0) {
%2 = tail call i32 @mem_free(i8* %0)
ret void
}
void avpriv_ac3_parse_header() {}


x86 assembly (clang, -O0):
<avpriv_ac3_parse_header>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<avpriv_ac3_parse_header>:
ret

LLVM IR (-O0):
define void @avpriv_ac3_parse_header() {
ret void
}

LLVM IR (-O2):
define void @avpriv_ac3_parse_header() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *argv0) {
  fprintf(stderr, "Usage: %s test_no\n\n", argv0);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"Usage: %s test_no\0A\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"Usage: %s test_no\0A\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ makedb();
int main(int argc, char **argv) {
  makedb();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <makedb@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <makedb@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @makedb()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @makedb()
ret i32 0
}
/* Type definitions */
struct task_struct {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cap_task_reparent_to_init(struct task_struct *);
void security_task_reparent_to_init(struct task_struct *p) {
  cap_task_reparent_to_init(p);
}


x86 assembly (clang, -O0):
<security_task_reparent_to_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <cap_task_reparent_to_init@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<security_task_reparent_to_init>:
jmp    1030 <cap_task_reparent_to_init@plt>

LLVM IR (-O0):
%struct.task_struct = type { i32 }
define void @security_task_reparent_to_init(%struct.task_struct* %0) {
%2 = alloca %struct.task_struct*
store %struct.task_struct* %0, %struct.task_struct** %2
%3 = load %struct.task_struct*, %struct.task_struct** %2
%4 = call i32 @cap_task_reparent_to_init(%struct.task_struct* %3)
ret void
}

LLVM IR (-O2):
%struct.task_struct = type { i32 }
define void @security_task_reparent_to_init(%struct.task_struct* %0) {
%2 = tail call i32 @cap_task_reparent_to_init(%struct.task_struct* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
int main(void) {
  printf("sizeof(char) = %u\n", (unsigned)sizeof(char));
  printf("sizeof(short) = %u\n", (unsigned)sizeof(short));
  printf("sizeof(int) = %u\n", (unsigned)sizeof(int));
  printf("sizeof(long) = %u\n", (unsigned)sizeof(long));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xee0(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xeea(%rip),%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
lea    0xeed(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xeee(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"sizeof(char) = %u\0A\00"
@.str.1 = [20 x i8] c"sizeof(short) = %u\0A\00"
@.str.2 = [18 x i8] c"sizeof(int) = %u\0A\00"
@.str.3 = [19 x i8] c"sizeof(long) = %u\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 1)
%3 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 2)
%4 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 4)
%5 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32 8)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"sizeof(char) = %u\0A\00"
@.str.1 = [20 x i8] c"sizeof(short) = %u\0A\00"
@.str.2 = [18 x i8] c"sizeof(int) = %u\0A\00"
@.str.3 = [19 x i8] c"sizeof(long) = %u\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 2)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 4)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32 8)
ret i32 0
}
int glib_utf8_charlen(const char *c) {
  int ret = 0;
  char first = *c;
  if (first & 0x80) {
    do {
      first <<= 1;
      ret++;
    } while (first & 0x80);
  } else {
    ret = 1;
  }
  return ret;
}


x86 assembly (clang, -O0):
<glib_utf8_charlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0xd(%rbp)
movsbl -0xd(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     1159 <glib_utf8_charlen+0x59>
jmp    112f <glib_utf8_charlen+0x2f>
movsbl -0xd(%rbp),%eax
shl    $0x1,%eax
mov    %al,-0xd(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
movsbl -0xd(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
jne    112f <glib_utf8_charlen+0x2f>
jmp    1160 <glib_utf8_charlen+0x60>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<glib_utf8_charlen>:
mov    (%rdi),%cl
mov    $0x1,%eax
test   %cl,%cl
jns    1119 <glib_utf8_charlen+0x19>
xor    %eax,%eax
nopl   (%rax)
add    %cl,%cl
add    $0x1,%eax
test   %cl,%cl
js     1110 <glib_utf8_charlen+0x10>
ret

LLVM IR (-O0):
define i32 @glib_utf8_charlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8
store i8* %0, i8** %2
store i32 0, i32* %3
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
store i8 %6, i8* %4
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = and i32 %8, 128
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %25
11: ; preds = %1
br label %12
12: ; preds = %19, %11
%13 = load i8, i8* %4
%14 = sext i8 %13 to i32
%15 = shl i32 %14, 1
%16 = trunc i32 %15 to i8
store i8 %16, i8* %4
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %19
19: ; preds = %12
%20 = load i8, i8* %4
%21 = sext i8 %20 to i32
%22 = and i32 %21, 128
%23 = icmp ne i32 %22, 0
br i1 %23, label %12, label %24
24: ; preds = %19
br label %26
25: ; preds = %1
store i32 1, i32* %3
br label %26
26: ; preds = %25, %24
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @glib_utf8_charlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp sgt i8 %2, -1
br i1 %3, label %10, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8 [ %7, %4 ], [ %2, %1 ]
%7 = shl i8 %6, 1
%8 = add nuw nsw i32 %5, 1
%9 = icmp sgt i8 %7, -1
br i1 %9, label %10, label %4
10: ; preds = %4, %1
%11 = phi i32 [ 1, %1 ], [ %8, %4 ]
ret i32 %11
}
void SPI_MasterInit(void) {}


x86 assembly (clang, -O0):
<SPI_MasterInit>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SPI_MasterInit>:
ret

LLVM IR (-O0):
define void @SPI_MasterInit() {
ret void
}

LLVM IR (-O2):
define void @SPI_MasterInit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int (*)());
int main() { printf("hello %p\n", main); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    0x2ec6(%rip),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    0x2ec9(%rip),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"hello %p\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 (...)* bitcast (i32 ()* @main to i32 (...)*))
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"hello %p\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 (...)* bitcast (i32 ()* @main to i32 (...)*))
ret i32 0
}
/* Variables and functions */
int close(int);
int close_serial_device(int device_file) { return close(device_file); }


x86 assembly (clang, -O0):
<close_serial_device>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_serial_device>:
jmp    1030 <close@plt>

LLVM IR (-O0):
define i32 @close_serial_device(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @close(i32 %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @close_serial_device(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ singTheSong(int);
int main(int argc, const char *argv[]) {
  singTheSong(99);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x63,%edi
call   1030 <singTheSong@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x63,%edi
call   1030 <singTheSong@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @singTheSong(i32 99)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @singTheSong(i32 99)
ret i32 0
}