xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ say_hi_a();
int /*<<< orphan*/ say_hi_b();
int main(int argc, char **argv) {
  printf("Hi\n");
  say_hi_a();
  say_hi_b();
  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)
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <say_hi_a@plt>
mov    $0x0,%al
call   1050 <say_hi_b@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <say_hi_a@plt>
xor    %eax,%eax
call   1050 <say_hi_b@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"Hi\0A\00"
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 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @say_hi_a()
%8 = call i32 (...) @say_hi_b()
ret i32 0
}

LLVM IR (-O2):
@str = [3 x i8] c"Hi\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @say_hi_a()
%5 = tail call i32 (...) @say_hi_b()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0xbb() {
  Assert_real((isgraph(187) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isgraph.c",
              940, ("isgraph should be 0 for 0xbb"));
}


x86 assembly (clang, -O0):
<t_isgraph_0xbb>:
push   %rbp
mov    %rsp,%rbp
mov    $0xbb,%edi
call   1040 <isgraph@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x3ac,%edx
lea    0xf5b(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isgraph_0xbb>:
push   %rax
mov    $0xbb,%edi
call   1040 <isgraph@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3ac,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xbb\00"
define void @t_isgraph_0xbb() {
%1 = call i64 @isgraph(i32 187)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 940, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xbb\00"
define void @t_isgraph_0xbb() {
%1 = tail call i64 @isgraph(i32 187)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 940, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int round_sample(int *sum) {
  int sum1;
  sum1 = (*sum) >> (14 + 15 - 15);
  *sum &= (1 << (14 + 15 - 15)) - 1;
  if (sum1 < (-32768))
    sum1 = (-32768);
  else if (sum1 > (32767))
    sum1 = (32767);
  return sum1;
}


x86 assembly (clang, -O0):
<round_sample>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
sar    $0xe,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
and    $0x3fff,%ecx
mov    %ecx,(%rax)
cmpl   $0xffff8000,-0xc(%rbp)
jge    113b <round_sample+0x3b>
movl   $0xffff8000,-0xc(%rbp)
jmp    1154 <round_sample+0x54>
cmpl   $0x7fff,-0xc(%rbp)
jle    114f <round_sample+0x4f>
movl   $0x7fff,-0xc(%rbp)
jmp    1154 <round_sample+0x54>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_sample>:
mov    (%rdi),%eax
mov    %eax,%ecx
sar    $0xe,%ecx
mov    %eax,%edx
and    $0x3fff,%edx
mov    %edx,(%rdi)
cmp    $0x7fff,%ecx
mov    $0x7fff,%edx
cmovl  %ecx,%edx
cmp    $0xe0000000,%eax
mov    $0xffff8000,%eax
cmovge %edx,%eax
ret

LLVM IR (-O0):
define i32 @round_sample(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
%6 = ashr i32 %5, 14
store i32 %6, i32* %3
%7 = load i32*, i32** %2
%8 = load i32, i32* %7
%9 = and i32 %8, 16383
store i32 %9, i32* %7
%10 = load i32, i32* %3
%11 = icmp slt i32 %10, -32768
br i1 %11, label %12, label %13
12: ; preds = %1
store i32 -32768, i32* %3
br label %18
13: ; preds = %1
%14 = load i32, i32* %3
%15 = icmp sgt i32 %14, 32767
br i1 %15, label %16, label %17
16: ; preds = %13
store i32 32767, i32* %3
br label %17
17: ; preds = %16, %13
br label %18
18: ; preds = %17, %12
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @round_sample(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = ashr i32 %2, 14
%4 = and i32 %2, 16383
store i32 %4, i32* %0
%5 = icmp slt i32 %2, -536870912
%6 = icmp slt i32 %3, 32767
%7 = select i1 %6, i32 %3, i32 32767
%8 = select i1 %5, i32 -32768, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int sum_digs_fact(int);
int main() {
  int i;
  int sum = 0;
  for (i = 3; i < 2500000; i++)
    if (i == sum_digs_fact(i))
      sum += i;
  printf("%d\n", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x3,-0x8(%rbp)
cmpl   $0x2625a0,-0x8(%rbp)
jge    1181 <main+0x61>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <sum_digs_fact@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jne    116e <main+0x4e>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1173 <main+0x53>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <main+0x1d>
mov    -0xc(%rbp),%esi
lea    0xe75(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x3,%ebp
xor    %ebx,%ebx
jmp    113d <main+0x1d>
nopl   0x0(%rax)
add    %ecx,%ebx
add    $0x1,%ebp
cmp    $0x2625a0,%ebp
je     114e <main+0x2e>
mov    %ebp,%edi
call   1040 <sum_digs_fact@plt>
mov    %ebp,%ecx
cmp    %eax,%ebp
je     1130 <main+0x10>
xor    %ecx,%ecx
jmp    1130 <main+0x10>
lea    0xeab(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %7, %1 ]
%3 = phi i32 [ 3, %0 ], [ %8, %1 ]
%4 = tail call i32 @sum_digs_fact(i32 %3)
%5 = icmp eq i32 %3, %4
%6 = select i1 %5, i32 %3, i32 0
%7 = add nuw nsw i32 %6, %2
%8 = add nuw nsw i32 %3, 1
%9 = icmp eq i32 %8, 2500000
br i1 %9, label %10, label %1
10: ; preds = %1
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}
void free_data_block(unsigned long id) { return; }


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

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

LLVM IR (-O0):
define void @free_data_block(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
ret void
}

LLVM IR (-O2):
define void @free_data_block(i64 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int stbi__bitreverse16(int);
int stbi__bit_reverse(int v, int bits) {
  assert(bits <= 16);
  return stbi__bitreverse16(v) >> (16 - bits);
}


x86 assembly (clang, -O0):
<stbi__bit_reverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x10,-0x8(%rbp)
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x4(%rbp),%edi
call   1030 <stbi__bitreverse16@plt>
mov    $0x10,%ecx
sub    -0x8(%rbp),%ecx
sar    %cl,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stbi__bit_reverse>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
cmp    $0x11,%esi
setl   %dil
call   1040 <assert@plt>
mov    %ebp,%edi
call   1030 <stbi__bitreverse16@plt>
mov    $0x10,%cl
sub    %bl,%cl
sar    %cl,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @stbi__bit_reverse(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp sle i32 %5, 16
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i32, i32* %3
%10 = call i32 @stbi__bitreverse16(i32 %9)
%11 = load i32, i32* %4
%12 = sub nsw i32 16, %11
%13 = ashr i32 %10, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @stbi__bit_reverse(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 17
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 @stbi__bitreverse16(i32 %0)
%7 = sub nsw i32 16, %1
%8 = ashr i32 %6, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ find_min_max(int *, int *, int *);
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  int min, max;
  int A[] = {1, 3, 5, 7, 98, 3, 3, 12, 3, 54};
  find_min_max(A, &min, &max);
  printf("min = %d, max = %d\n", min, max);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1050 <find_min_max@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x30(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1040 <find_min_max@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.A = [10 x i32] [i32 1, i32 3, i32 5, i32 7, i32 98, i32 3, i32 3, i32 12, i32 3, i32 54]
@.str = [20 x i8] c"min = %d, max = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [10 x i32]
%4 = bitcast [10 x i32]* %3 to i8*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
%6 = call i32 @find_min_max(i32* %5, i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.A = [10 x i32] [i32 1, i32 3, i32 5, i32 7, i32 98, i32 3, i32 3, i32 12, i32 3, i32 54]
@.str = [20 x i8] c"min = %d, max = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [10 x i32]
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast [10 x i32]* %3 to i8*
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
%8 = call i32 @find_min_max(i32* %7, i32* %1, i32* %2)
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void screen_ssd1306_set_startcolumn(uint8_t column) {}


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

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

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

LLVM IR (-O2):
define void @screen_ssd1306_set_startcolumn(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int main(void) {
  int n[1];
  n[0] = 3;
#pragma omp target
  {
    int m = n[0];
    switch (m & 3) {
    case 0:
      m = 4;
      break;
    case 1:
      m = 3;
      break;
    case 2:
      m = 2;
      break;
    default:
      m = 1;
      break;
    }
    n[0] = m;
  }
  if (n[0] != 1)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x3,%eax
mov    %eax,-0x10(%rbp)
je     1162 <main+0x52>
jmp    1140 <main+0x30>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     116e <main+0x5e>
jmp    1151 <main+0x41>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     117a <main+0x6a>
jmp    1186 <main+0x76>
movl   $0x4,-0xc(%rbp)
jmp    118d <main+0x7d>
movl   $0x3,-0xc(%rbp)
jmp    118d <main+0x7d>
movl   $0x2,-0xc(%rbp)
jmp    118d <main+0x7d>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     11a4 <main+0x94>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [1 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
store i32 3, i32* %4
%5 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
%6 = load i32, i32* %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = and i32 %7, 3
switch i32 %8, label %12 [
i32 0, label %9
i32 1, label %10
i32 2, label %11
]
9: ; preds = %0
store i32 4, i32* %3
br label %13
10: ; preds = %0
store i32 3, i32* %3
br label %13
11: ; preds = %0
store i32 2, i32* %3
br label %13
12: ; preds = %0
store i32 1, i32* %3
br label %13
13: ; preds = %12, %11, %10, %9
%14 = load i32, i32* %3
%15 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
store i32 %14, i32* %15
%16 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
%17 = load i32, i32* %16
%18 = icmp ne i32 %17, 1
br i1 %18, label %19, label %21
19: ; preds = %13
%20 = call i32 (...) @abort()
unreachable
21: ; preds = %13
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ mat4f_mult_vec4f_new(float *, float const *, float *);
void mat4f_mult_vec4f(float vector[4], const float matrix[16]) {
  mat4f_mult_vec4f_new(vector, matrix, vector);
}


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

x86 assembly (clang, -O2):
<mat4f_mult_vec4f>:
mov    %rdi,%rdx
jmp    1030 <mat4f_mult_vec4f_new@plt>

LLVM IR (-O0):
define void @mat4f_mult_vec4f(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 = load float*, float** %4
%7 = load float*, float** %3
%8 = call i32 @mat4f_mult_vec4f_new(float* %5, float* %6, float* %7)
ret void
}

LLVM IR (-O2):
define void @mat4f_mult_vec4f(float* %0, float* %1) {
%3 = tail call i32 @mat4f_mult_vec4f_new(float* %0, float* %1, float* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ qsort_r(void *, size_t, size_t,
                           int (*)(void const *, void const *, void *), void *);
void qsort_s(void *base, size_t nmemb, size_t size,
             int (*cmp)(const void *, const void *, void *), void *arg) {
  qsort_r(base, nmemb, size, cmp, arg);
}


x86 assembly (clang, -O0):
<qsort_s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <qsort_r@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qsort_s>:
jmp    1030 <qsort_r@plt>

LLVM IR (-O0):
define void @qsort_s(i8* %0, i64 %1, i64 %2, i32 (i8*, i8*, i8*)* %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i32 (i8*, i8*, i8*)*
%10 = alloca i8*
store i8* %0, i8** %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i32 (i8*, i8*, i8*)* %3, i32 (i8*, i8*, i8*)** %9
store i8* %4, i8** %10
%11 = load i8*, i8** %6
%12 = load i64, i64* %7
%13 = load i64, i64* %8
%14 = load i32 (i8*, i8*, i8*)*, i32 (i8*, i8*, i8*)** %9
%15 = load i8*, i8** %10
%16 = call i32 @qsort_r(i8* %11, i64 %12, i64 %13, i32 (i8*, i8*, i8*)* %14, i8* %15)
ret void
}

LLVM IR (-O2):
define void @qsort_s(i8* %0, i64 %1, i64 %2, i32 (i8*, i8*, i8*)* %3, i8* %4) {
%6 = tail call i32 @qsort_r(i8* %0, i64 %1, i64 %2, i32 (i8*, i8*, i8*)* %3, i8* %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ hton64(int /*<<< orphan*/);
void h64_to_bytes(char *bytes, uint64_t value) {
  value = hton64(value);
  *(uint64_t *)bytes = value;
}


x86 assembly (clang, -O0):
<h64_to_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <hton64@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h64_to_bytes>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <hton64@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @h64_to_bytes(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @hton64(i32 %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to i32*
store i32 %7, i32* %9
ret void
}

LLVM IR (-O2):
define void @h64_to_bytes(i8* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @hton64(i32 %1)
%4 = bitcast i8* %0 to i32*
store i32 %3, i32* %4
ret void
}
/* Variables and functions */
char *calloc(int, int);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
char *rdz_strdup(char *s) {
  int l = strlen(s);
  char *r = calloc(l + 1, sizeof(char));
  strcpy(r, s);
  return r;
}


x86 assembly (clang, -O0):
<rdz_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
add    $0x1,%edi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdz_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @rdz_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 1
%9 = call i8* @calloc(i32 %8, i32 1)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = load i8*, i8** %2
%12 = call i32 @strcpy(i8* %10, i8* %11)
%13 = load i8*, i8** %4
ret i8* %13
}

LLVM IR (-O2):
define i8* @rdz_strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i8* @calloc(i32 %3, i32 1)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ serial_write(char *, int);
void create_write_byte(char byte) { serial_write(&byte, 1); }


x86 assembly (clang, -O0):
<create_write_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    -0x1(%rbp),%rdi
mov    $0x1,%esi
call   1030 <serial_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_write_byte>:
push   %rax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rdi
mov    $0x1,%esi
call   1030 <serial_write@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @create_write_byte(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @serial_write(i8* %2, i32 1)
ret void
}

LLVM IR (-O2):
define void @create_write_byte(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @serial_write(i8* %2, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int my_array(int numbers[]) {
  int j, sum = 0;
  for (j = 0; j < 5; j++) {
    sum += numbers[j];
  }
  printf("\nSum is %d\n\n", sum);
  int average = sum / 5;
  return (average);
}


x86 assembly (clang, -O0):
<my_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    1153 <my_array+0x43>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112a <my_array+0x1a>
mov    -0x10(%rbp),%esi
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_array>:
push   %rbx
movdqu 0x4(%rdi),%xmm0
pshufd $0xee,%xmm0,%xmm1
paddd  %xmm0,%xmm1
pshufd $0x55,%xmm1,%xmm0
paddd  %xmm1,%xmm0
movd   %xmm0,%ebx
add    (%rdi),%ebx
lea    0xecb(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
movslq %ebx,%rax
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x21,%rax
add    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"\0ASum is %d\0A\0A\00"
define i32 @my_array(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = bitcast i32* %3 to <4 x i32>*
%5 = load <4 x i32>, <4 x i32>* %4
%6 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %5)
%7 = add nsw i32 %6, %2
%8 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = sdiv i32 %7, 5
ret i32 %9
}
void keySpPressed(int key, int x, int y) {}


x86 assembly (clang, -O0):
<keySpPressed>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @keySpPressed(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
define void @keySpPressed(i32 %0, i32 %1, i32 %2) {
ret void
}
struct s3c24x0_spi *s3c24x0_get_base_spi(void) {
  return (struct s3c24x0_spi *)0x15900000;
}


x86 assembly (clang, -O0):
<s3c24x0_get_base_spi>:
push   %rbp
mov    %rsp,%rbp
mov    $0x15900000,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<s3c24x0_get_base_spi>:
mov    $0x15900000,%eax
ret

LLVM IR (-O0):
%struct.s3c24x0_spi = type opaque
define %struct.s3c24x0_spi* @s3c24x0_get_base_spi() {
ret %struct.s3c24x0_spi* inttoptr (i64 361758720 to %struct.s3c24x0_spi*)
}

LLVM IR (-O2):
%struct.s3c24x0_spi = type opaque
define %struct.s3c24x0_spi* @s3c24x0_get_base_spi() {
ret %struct.s3c24x0_spi* inttoptr (i64 361758720 to %struct.s3c24x0_spi*)
}
unsigned int reversebits(unsigned int x) {
  unsigned int y;
  y = 0x55555555;
  x = ((x >> 1) & y) | ((x & y) << 1);
  y = 0x33333333;
  x = ((x >> 2) & y) | ((x & y) << 2);
  y = 0x0f0f0f0f;
  x = ((x >> 4) & y) | ((x & y) << 4);
  y = 0x00ff00ff;
  x = ((x >> 8) & y) | ((x & y) << 8);
  return (x >> 16) | (x << 16);
}


x86 assembly (clang, -O0):
<reversebits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x55555555,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
and    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
and    -0x8(%rbp),%ecx
shl    $0x1,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
movl   $0x33333333,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x2,%eax
and    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
and    -0x8(%rbp),%ecx
shl    $0x2,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
movl   $0xf0f0f0f,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x4,%eax
and    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
and    -0x8(%rbp),%ecx
shl    $0x4,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
movl   $0xff00ff,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
and    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
and    -0x8(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
mov    -0x4(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reversebits>:
bswap  %edi
mov    %edi,%eax
and    $0xf0f0f0f,%eax
shl    $0x4,%eax
shr    $0x4,%edi
and    $0xf0f0f0f,%edi
or     %eax,%edi
mov    %edi,%eax
and    $0x33333333,%eax
shr    $0x2,%edi
and    $0x33333333,%edi
lea    (%rdi,%rax,4),%eax
mov    %eax,%ecx
and    $0x55555555,%ecx
shr    %eax
and    $0x55555555,%eax
lea    (%rax,%rcx,2),%eax
ret

LLVM IR (-O0):
define i32 @reversebits(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1431655765, i32* %3
%4 = load i32, i32* %2
%5 = lshr i32 %4, 1
%6 = load i32, i32* %3
%7 = and i32 %5, %6
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = and i32 %8, %9
%11 = shl i32 %10, 1
%12 = or i32 %7, %11
store i32 %12, i32* %2
store i32 858993459, i32* %3
%13 = load i32, i32* %2
%14 = lshr i32 %13, 2
%15 = load i32, i32* %3
%16 = and i32 %14, %15
%17 = load i32, i32* %2
%18 = load i32, i32* %3
%19 = and i32 %17, %18
%20 = shl i32 %19, 2
%21 = or i32 %16, %20
store i32 %21, i32* %2
store i32 252645135, i32* %3
%22 = load i32, i32* %2
%23 = lshr i32 %22, 4
%24 = load i32, i32* %3
%25 = and i32 %23, %24
%26 = load i32, i32* %2
%27 = load i32, i32* %3
%28 = and i32 %26, %27
%29 = shl i32 %28, 4
%30 = or i32 %25, %29
store i32 %30, i32* %2
store i32 16711935, i32* %3
%31 = load i32, i32* %2
%32 = lshr i32 %31, 8
%33 = load i32, i32* %3
%34 = and i32 %32, %33
%35 = load i32, i32* %2
%36 = load i32, i32* %3
%37 = and i32 %35, %36
%38 = shl i32 %37, 8
%39 = or i32 %34, %38
store i32 %39, i32* %2
%40 = load i32, i32* %2
%41 = lshr i32 %40, 16
%42 = load i32, i32* %2
%43 = shl i32 %42, 16
%44 = or i32 %41, %43
ret i32 %44
}

LLVM IR (-O2):
define i32 @reversebits(i32 %0) {
%2 = tail call i32 @llvm.bitreverse.i32(i32 %0)
ret i32 %2
}
int a_ctz_l(unsigned long x) { return __builtin_ctzl(x); }


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

x86 assembly (clang, -O2):
<a_ctz_l>:
bsf    %rdi,%rax
ret

LLVM IR (-O0):
define i32 @a_ctz_l(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @llvm.cttz.i64(i64 %3, i1 true)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @a_ctz_l(i64 %0) {
%2 = tail call i64 @llvm.cttz.i64(i64 %0, i1 true)
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
int INT_MAX;
long INT_MIN;
int /*<<< orphan*/ assert(int);
long strtol(char *, int /*<<< orphan*/ *, int);
int intfromstr(char str[]) {
  long long_integer = strtol(str, NULL, 10);
  assert(INT_MIN >= long_integer <= INT_MAX);
  return (int)long_integer;
}


x86 assembly (clang, -O0):
<intfromstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %rax,-0x10(%rbp)
mov    0x2e97(%rip),%rax
mov    (%rax),%rax
cmp    -0x10(%rbp),%rax
setge  %al
and    $0x1,%al
movzbl %al,%eax
mov    0x2e89(%rip),%rcx
cmp    (%rcx),%eax
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intfromstr>:
push   %rbx
xor    %esi,%esi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %rax,%rbx
mov    0x2ea9(%rip),%rax
xor    %ecx,%ecx
cmp    %rbx,(%rax)
setge  %cl
mov    0x2ea2(%rip),%rax
xor    %edi,%edi
cmp    %ecx,(%rax)
setge  %dil
call   1030 <assert@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@INT_MIN = global i64 0
@INT_MAX = global i32 0
define i32 @intfromstr(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strtol(i8* %4, i32* null, i32 10)
store i64 %5, i64* %3
%6 = load i64, i64* @INT_MIN
%7 = load i64, i64* %3
%8 = icmp sge i64 %6, %7
%9 = zext i1 %8 to i32
%10 = load i32, i32* @INT_MAX
%11 = icmp sle i32 %9, %10
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i64, i64* %3
%15 = trunc i64 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
@INT_MIN = global i64 0
@INT_MAX = global i32 0
define i32 @intfromstr(i8* nocapture %0) {
%2 = tail call i64 @strtol(i8* nocapture %0, i32* null, i32 10)
%3 = load i64, i64* @INT_MIN
%4 = icmp sge i64 %3, %2
%5 = zext i1 %4 to i32
%6 = load i32, i32* @INT_MAX
%7 = icmp sge i32 %6, %5
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
%10 = trunc i64 %2 to i32
ret i32 %10
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void h265hvcc_array_set_completeness(uint8_t *p) { p[0] |= 0x80; }


x86 assembly (clang, -O0):
<h265hvcc_array_set_completeness>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
or     $0x80,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<h265hvcc_array_set_completeness>:
orb    $0x80,(%rdi)
ret

LLVM IR (-O0):
define void @h265hvcc_array_set_completeness(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = or i32 %5, 128
store i32 %6, i32* %4
ret void
}

LLVM IR (-O2):
define void @h265hvcc_array_set_completeness(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = or i32 %2, 128
store i32 %3, i32* %0
ret void
}
/* Type definitions */
struct Screen {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ screen_close_current_buffer(struct Screen *);
void cb_close_buffer(struct Screen *scrn) { screen_close_current_buffer(scrn); }


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

x86 assembly (clang, -O2):
<cb_close_buffer>:
jmp    1030 <screen_close_current_buffer@plt>

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

LLVM IR (-O2):
%struct.Screen = type { i32 }
define void @cb_close_buffer(%struct.Screen* %0) {
%2 = tail call i32 @screen_close_current_buffer(%struct.Screen* %0)
ret void
}
/* Type definitions */
struct field {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __print_bin(struct field const *, char *, int);
void print_bin(const struct field *field) { __print_bin(field, "", false); }


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

x86 assembly (clang, -O2):
<print_bin>:
lea    0xee9(%rip),%rsi
xor    %edx,%edx
jmp    1030 <__print_bin@plt>

LLVM IR (-O0):
%struct.field = type { i32 }
@.str = [1 x i8] zeroinitializer
define void @print_bin(%struct.field* %0) {
%2 = alloca %struct.field*
store %struct.field* %0, %struct.field** %2
%3 = load %struct.field*, %struct.field** %2
%4 = call i32 @__print_bin(%struct.field* %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
%struct.field = type { i32 }
@.str = [1 x i8] zeroinitializer
define void @print_bin(%struct.field* %0) {
%2 = tail call i32 @__print_bin(%struct.field* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 0)
ret void
}
void writeOut(char *msg) {}


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

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

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

LLVM IR (-O2):
define void @writeOut(i8* nocapture %0) {
ret void
}
int isrange(char *s) {
  while (*s) {
    if ((*s < '0' || *s > '9') && *s != '-' && *s != ',')
      return 0;
    s++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<isrange>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1172 <isrange+0x72>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jl     1135 <isrange+0x35>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
jle    1161 <isrange+0x61>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
je     1161 <isrange+0x61>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2c,%eax
je     1161 <isrange+0x61>
movl   $0x0,-0x4(%rbp)
jmp    1179 <isrange+0x79>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1108 <isrange+0x8>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isrange>:
mov    (%rdi),%cl
mov    $0x1,%eax
test   %cl,%cl
je     113d <isrange+0x3d>
add    $0x1,%rdi
jmp    112b <isrange+0x2b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
je     113d <isrange+0x3d>
lea    -0x30(%rcx),%edx
cmp    $0xa,%dl
jb     1120 <isrange+0x20>
and    $0xfe,%cl
cmp    $0x2c,%cl
je     1120 <isrange+0x20>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isrange(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
br label %4
4: ; preds = %29, %1
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %32
8: ; preds = %4
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp slt i32 %11, 48
br i1 %12, label %18, label %13
13: ; preds = %8
%14 = load i8*, i8** %3
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp sgt i32 %16, 57
br i1 %17, label %18, label %29
18: ; preds = %13, %8
%19 = load i8*, i8** %3
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp ne i32 %21, 45
br i1 %22, label %23, label %29
23: ; preds = %18
%24 = load i8*, i8** %3
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = icmp ne i32 %26, 44
br i1 %27, label %28, label %29
28: ; preds = %23
store i32 0, i32* %2
br label %33
29: ; preds = %23, %18, %13
%30 = load i8*, i8** %3
%31 = getelementptr inbounds i8, i8* %30, i32 1
store i8* %31, i8** %3
br label %4
32: ; preds = %4
store i32 1, i32* %2
br label %33
33: ; preds = %32, %28
%34 = load i32, i32* %2
ret i32 %34
}

LLVM IR (-O2):
define i32 @isrange(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %7
4: ; preds = %7
%5 = load i8, i8* %15
%6 = icmp eq i8 %5, 0
br i1 %6, label %16, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %15, %4 ], [ %0, %1 ]
%10 = add i8 %8, -48
%11 = icmp ult i8 %10, 10
%12 = and i8 %8, -2
%13 = icmp eq i8 %12, 44
%14 = or i1 %11, %13
%15 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %14, label %4, label %16
16: ; preds = %4, %7, %1
%17 = phi i32 [ 1, %1 ], [ 0, %7 ], [ 1, %4 ]
ret i32 %17
}
int test_imm_25int64_lowword_mem(long long *val) {
  return ((*val) & (0x25 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_25int64_lowword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
and    $0x25,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_25int64_lowword_mem>:
testb  $0x25,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_25int64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 37
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_25int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 37
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int atomicDecrement(int volatile *var) {
  int ov;
  __asm__ __volatile__("lock; xaddl %0, %1"
                       : "=r"(ov), "=m"(*var)
                       : "0"(-1), "m"(*var)
                       : "cc");
  return ov + 1;
}


x86 assembly (clang, -O0):
<atomicDecrement>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x8(%rbp),%rdx
mov    $0xffffffff,%eax
lock xadd %eax,(%rcx)
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atomicDecrement>:
mov    $0xffffffff,%eax
lock xadd %eax,(%rdi)
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @atomicDecrement(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32*, i32** %2
%6 = call i32 asm sideeffect "lock; xaddl $0, $1", "=r,=*m,0,*m,~{cc},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %4, i32 -1, i32* elementtype(i32) %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 1
ret i32 %8
}

LLVM IR (-O2):
define i32 @atomicDecrement(i32* %0) {
%2 = tail call i32 asm sideeffect "lock; xaddl $0, $1", "=r,=*m,0,*m,~{cc},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %0, i32 -1, i32* elementtype(i32) %0)
%3 = add nsw i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ safefree(void *);
void aes_free_context(void *handle) { safefree(handle); }


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

x86 assembly (clang, -O2):
<aes_free_context>:
jmp    1030 <safefree@plt>

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

LLVM IR (-O2):
define void @aes_free_context(i8* %0) {
%2 = tail call i32 @safefree(i8* %0)
ret void
}
int test_imm_B4uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0xB4 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B4uint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x10,%rdx
and    $0xb4,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_B4uint64_midword_reg>:
test   $0xb40000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_B4uint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 16
%5 = and i64 %4, 180
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_B4uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 11796480
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int _isatty(fd)
int fd;
{ return (1); }


x86 assembly (clang, -O0):
<_isatty>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_isatty>:
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @_isatty(i32 %0) {
ret i32 1
}
int isspace(int c) {
  return (int)(c == (int)' ' || ((unsigned)c - (unsigned)'\t') < 5U);
}


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1125 <isspace+0x25>
mov    -0x4(%rbp),%eax
sub    $0x9,%eax
cmp    $0x5,%eax
setb   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
cmp    $0x20,%edi
sete   %al
add    $0xfffffff7,%edi
cmp    $0x5,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isspace(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 32
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub i32 %6, 9
%8 = icmp ult i32 %7, 5
br label %9
9: ; preds = %5, %1
%10 = phi i1 [ true, %1 ], [ %8, %5 ]
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
%2 = icmp eq i32 %0, 32
%3 = add i32 %0, -9
%4 = icmp ult i32 %3, 5
%5 = or i1 %2, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ camcguard2l(float *, int, int, int, int, int);
void camcguard2l_(float *amu, int *nx, int *ny, int *nxe, int *nye, int *ndim) {
  camcguard2l(amu, *nx, *ny, *nxe, *nye, *ndim);
  return;
}


x86 assembly (clang, -O0):
<camcguard2l_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
mov    -0x28(%rbp),%rax
mov    (%rax),%r8d
mov    -0x30(%rbp),%rax
mov    (%rax),%r9d
call   1030 <camcguard2l@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<camcguard2l_>:
mov    (%rsi),%esi
mov    (%rdx),%edx
mov    (%rcx),%ecx
mov    (%r8),%r8d
mov    (%r9),%r9d
jmp    1030 <camcguard2l@plt>

LLVM IR (-O0):
define void @camcguard2l_(float* %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5) {
%7 = alloca float*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
store float* %0, float** %7
store i32* %1, i32** %8
store i32* %2, i32** %9
store i32* %3, i32** %10
store i32* %4, i32** %11
store i32* %5, i32** %12
%13 = load float*, float** %7
%14 = load i32*, i32** %8
%15 = load i32, i32* %14
%16 = load i32*, i32** %9
%17 = load i32, i32* %16
%18 = load i32*, i32** %10
%19 = load i32, i32* %18
%20 = load i32*, i32** %11
%21 = load i32, i32* %20
%22 = load i32*, i32** %12
%23 = load i32, i32* %22
%24 = call i32 @camcguard2l(float* %13, i32 %15, i32 %17, i32 %19, i32 %21, i32 %23)
ret void
}

LLVM IR (-O2):
define void @camcguard2l_(float* %0, i32* nocapture %1, i32* nocapture %2, i32* nocapture %3, i32* nocapture %4, i32* nocapture %5) {
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = tail call i32 @camcguard2l(float* %0, i32 %7, i32 %8, i32 %9, i32 %10, i32 %11)
ret void
}
void sngl001s(x, y) int *x, *y;
{
#pragma omp parallel default(shared)
  {
    work(x);
#pragma omp barrier
#pragma omp single
    {
      output(x);
      input(y);
    }
    work(y);
  }
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <work@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1050 <output@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <input@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1040 <work@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <work@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <output@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <input@plt>
mov    %r14,%rdi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <work@plt>

LLVM IR (-O0):
define void @sngl001s(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 = call i32 (i32*, ...) bitcast (i32 (...)* @work to i32 (i32*, ...)*)(i32* %5)
%7 = load i32*, i32** %3
%8 = call i32 (i32*, ...) bitcast (i32 (...)* @output to i32 (i32*, ...)*)(i32* %7)
%9 = load i32*, i32** %4
%10 = call i32 (i32*, ...) bitcast (i32 (...)* @input to i32 (i32*, ...)*)(i32* %9)
%11 = load i32*, i32** %4
%12 = call i32 (i32*, ...) bitcast (i32 (...)* @work to i32 (i32*, ...)*)(i32* %11)
ret void
}

LLVM IR (-O2):
define void @sngl001s(i32* %0, i32* %1) {
%3 = tail call i32 (i32*, ...) bitcast (i32 (...)* @work to i32 (i32*, ...)*)(i32* %0)
%4 = tail call i32 (i32*, ...) bitcast (i32 (...)* @output to i32 (i32*, ...)*)(i32* %0)
%5 = tail call i32 (i32*, ...) bitcast (i32 (...)* @input to i32 (i32*, ...)*)(i32* %1)
%6 = tail call i32 (i32*, ...) bitcast (i32 (...)* @work to i32 (i32*, ...)*)(i32* %1)
ret void
}
int fun1368() { return 1368; }


x86 assembly (clang, -O0):
<fun1368>:
push   %rbp
mov    %rsp,%rbp
mov    $0x558,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun1368>:
mov    $0x558,%eax
ret

LLVM IR (-O0):
define i32 @fun1368() {
ret i32 1368
}

LLVM IR (-O2):
define i32 @fun1368() {
ret i32 1368
}