xunge/DecIR huggingface dataset:
int v_arcs_is_done(struct graph_arc *_e0, struct graph_vertex *_l0) {
  return (struct _graph_arc_list_entry *)(_e0) ==
         (struct _graph_arc_list_entry *)(_l0);
}


x86 assembly (clang, -O0):
<v_arcs_is_done>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<v_arcs_is_done>:
xor    %eax,%eax
cmp    %rdi,%rsi
sete   %al
ret

LLVM IR (-O0):
%struct.graph_arc = type opaque
%struct.graph_vertex = type opaque
%struct._graph_arc_list_entry = type opaque
define i32 @v_arcs_is_done(%struct.graph_arc* %0, %struct.graph_vertex* %1) {
%3 = alloca %struct.graph_arc*
%4 = alloca %struct.graph_vertex*
store %struct.graph_arc* %0, %struct.graph_arc** %3
store %struct.graph_vertex* %1, %struct.graph_vertex** %4
%5 = load %struct.graph_arc*, %struct.graph_arc** %3
%6 = bitcast %struct.graph_arc* %5 to %struct._graph_arc_list_entry*
%7 = load %struct.graph_vertex*, %struct.graph_vertex** %4
%8 = bitcast %struct.graph_vertex* %7 to %struct._graph_arc_list_entry*
%9 = icmp eq %struct._graph_arc_list_entry* %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
%struct.graph_arc = type opaque
%struct.graph_vertex = type opaque
define i32 @v_arcs_is_done(%struct.graph_arc* readnone %0, %struct.graph_vertex* readnone %1) {
%3 = bitcast %struct.graph_vertex* %1 to %struct.graph_arc*
%4 = icmp eq %struct.graph_arc* %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
char *strrchr(char *, char);
char *get_element_from_path(char *path_complete) {
  return strrchr(path_complete, '/') + 1;
}


x86 assembly (clang, -O0):
<get_element_from_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
add    $0x1,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_element_from_path>:
push   %rax
mov    $0x2f,%esi
call   1030 <strrchr@plt>
add    $0x1,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @get_element_from_path(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @strrchr(i8* %3, i8 signext 47)
%5 = getelementptr inbounds i8, i8* %4, i64 1
ret i8* %5
}

LLVM IR (-O2):
define i8* @get_element_from_path(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = getelementptr inbounds i8, i8* %2, i64 1
ret i8* %3
}
unsigned int bi_reverse(unsigned int code, int len) {
  unsigned int res = 0;
  do {
    res |= code & 1;
    code >>= 1, res <<= 1;
  } while (--len > 0);
  return res >> 1;
}


x86 assembly (clang, -O0):
<bi_reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jg     1111 <bi_reverse+0x11>
mov    -0xc(%rbp),%eax
shr    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bi_reverse>:
add    $0x1,%esi
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %edi,%eax
and    $0x1,%eax
or     %ecx,%eax
shr    %edi
lea    (%rax,%rax,1),%ecx
add    $0xffffffff,%esi
cmp    $0x1,%esi
jg     1110 <bi_reverse+0x10>
and    $0x7fffffff,%eax
ret

LLVM IR (-O0):
define i32 @bi_reverse(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 = %15, %2
%7 = load i32, i32* %3
%8 = and i32 %7, 1
%9 = load i32, i32* %5
%10 = or i32 %9, %8
store i32 %10, i32* %5
%11 = load i32, i32* %3
%12 = lshr i32 %11, 1
store i32 %12, i32* %3
%13 = load i32, i32* %5
%14 = shl i32 %13, 1
store i32 %14, i32* %5
br label %15
15: ; preds = %6
%16 = load i32, i32* %4
%17 = add nsw i32 %16, -1
store i32 %17, i32* %4
%18 = icmp sgt i32 %17, 0
br i1 %18, label %6, label %19
19: ; preds = %15
%20 = load i32, i32* %5
%21 = lshr i32 %20, 1
ret i32 %21
}

LLVM IR (-O2):
define i32 @bi_reverse(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ %0, %2 ], [ %9, %3 ]
%5 = phi i32 [ %1, %2 ], [ %11, %3 ]
%6 = phi i32 [ 0, %2 ], [ %10, %3 ]
%7 = and i32 %4, 1
%8 = or i32 %6, %7
%9 = lshr i32 %4, 1
%10 = shl i32 %8, 1
%11 = add nsw i32 %5, -1
%12 = icmp sgt i32 %5, 1
br i1 %12, label %3, label %13
13: ; preds = %3
%14 = and i32 %8, 2147483647
ret i32 %14
}
int main2() {
  char buf[100000];
  char *cp = buf;
  void (*func)() = buf;
  *cp++ = 0x90;
  *cp++ = 0xc3;
  *cp++ = 0x00;
  *cp++ = 0x00;
  func();
  printf("hello world\n");
}


x86 assembly (clang, -O0):
<main2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x186c0,%rsp
lea    -0x186b0(%rbp),%rax
mov    %rax,-0x186b8(%rbp)
lea    -0x186b0(%rbp),%rax
mov    %rax,-0x186c0(%rbp)
mov    -0x186b8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x186b8(%rbp)
movb   $0x90,(%rax)
mov    -0x186b8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x186b8(%rbp)
movb   $0xc3,(%rax)
mov    -0x186b8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x186b8(%rbp)
movb   $0x0,(%rax)
mov    -0x186b8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x186b8(%rbp)
movb   $0x0,(%rax)
mov    $0x0,%al
call   *-0x186c0(%rbp)
lea    0xe5a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x186c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main2>:
sub    $0x186a8,%rsp
mov    %rsp,%rcx
xor    %eax,%eax
call   *%rcx
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
add    $0x186a8,%rsp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"hello world\0A\00"
define i32 @main2() {
%1 = alloca i32
%2 = alloca [100000 x i8]
%3 = alloca i8*
%4 = alloca void (...)*
%5 = getelementptr inbounds [100000 x i8], [100000 x i8]* %2, i64 0, i64 0
store i8* %5, i8** %3
%6 = getelementptr inbounds [100000 x i8], [100000 x i8]* %2, i64 0, i64 0
%7 = bitcast i8* %6 to void (...)*
store void (...)* %7, void (...)** %4
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %3
store i8 -112, i8* %8
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %3
store i8 -61, i8* %10
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %3
store i8 0, i8* %12
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %3
store i8 0, i8* %14
%16 = load void (...)*, void (...)** %4
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
@str = [12 x i8] c"hello world\00"
define i32 @main2() {
%1 = alloca [100000 x i8]
%2 = getelementptr inbounds [100000 x i8], [100000 x i8]* %1, i64 0, i64 0
%3 = bitcast [100000 x i8]* %1 to void (...)*
%4 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
double sqrt(float);
double dist(float x, float y, float z) { return sqrt(x * x + y * y + z * z); }


x86 assembly (clang, -O0):
<dist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x4(%rbp),%xmm2
movss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
movss  -0xc(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dist>:
mulss  %xmm1,%xmm1
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
mulss  %xmm2,%xmm2
addss  %xmm2,%xmm0
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @dist(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %4
%9 = load float, float* %5
%10 = load float, float* %5
%11 = fmul float %9, %10
%12 = call float @llvm.fmuladd.f32(float %7, float %8, float %11)
%13 = load float, float* %6
%14 = load float, float* %6
%15 = call float @llvm.fmuladd.f32(float %13, float %14, float %12)
%16 = call double @sqrt(float %15)
ret double %16
}

LLVM IR (-O2):
define double @dist(float %0, float %1, float %2) {
%4 = fmul float %1, %1
%5 = tail call float @llvm.fmuladd.f32(float %0, float %0, float %4)
%6 = tail call float @llvm.fmuladd.f32(float %2, float %2, float %5)
%7 = tail call double @sqrt(float %6)
ret double %7
}
int base64_est_decode_size_bytes(int base64_size_bytes) {
  int length;
  length = (base64_size_bytes * 3 + 3) / 4;
  return length;
}


x86 assembly (clang, -O0):
<base64_est_decode_size_bytes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x3,-0x4(%rbp),%eax
add    $0x3,%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base64_est_decode_size_bytes>:
lea    (%rdi,%rdi,2),%ecx
add    $0x3,%ecx
lea    (%rdi,%rdi,2),%eax
add    $0x6,%eax
test   %ecx,%ecx
cmovns %ecx,%eax
sar    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @base64_est_decode_size_bytes(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 %4, 3
%6 = add nsw i32 %5, 3
%7 = sdiv i32 %6, 4
store i32 %7, i32* %3
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @base64_est_decode_size_bytes(i32 %0) {
%2 = mul nsw i32 %0, 3
%3 = add nsw i32 %2, 3
%4 = sdiv i32 %3, 4
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ glVertex4f(float, float, float, int);
void glVertex3f(float x, float y, float z) { glVertex4f(x, y, z, 1); }


x86 assembly (clang, -O0):
<glVertex3f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
mov    $0x1,%edi
call   1030 <glVertex4f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glVertex3f>:
mov    $0x1,%edi
jmp    1030 <glVertex4f@plt>

LLVM IR (-O0):
define void @glVertex3f(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = load float, float* %6
%10 = call i32 @glVertex4f(float %7, float %8, float %9, i32 1)
ret void
}

LLVM IR (-O2):
define void @glVertex3f(float %0, float %1, float %2) {
%4 = tail call i32 @glVertex4f(float %0, float %1, float %2, i32 1)
ret void
}
void pad_shutdown(void) {
  (*(volatile unsigned char *)(0x20100000 + 0x79)) = 0;
  (*(volatile unsigned char *)(0x20100000 + 0x7f)) = 0;
  (*(volatile unsigned char *)(0x20100000 + 0x7d)) = 0;
}


x86 assembly (clang, -O0):
<pad_shutdown>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20100079,%eax
movb   $0x0,(%rax)
mov    $0x2010007f,%eax
movb   $0x0,(%rax)
mov    $0x2010007d,%eax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<pad_shutdown>:
movb   $0x0,0x20100079
movb   $0x0,0x2010007f
movb   $0x0,0x2010007d
ret

LLVM IR (-O0):
define void @pad_shutdown() {
store volatile i8 0, i8* inttoptr (i64 537919609 to i8*)
store volatile i8 0, i8* inttoptr (i64 537919615 to i8*)
store volatile i8 0, i8* inttoptr (i64 537919613 to i8*)
ret void
}

LLVM IR (-O2):
define void @pad_shutdown() {
store volatile i8 0, i8* inttoptr (i64 537919609 to i8*)
store volatile i8 0, i8* inttoptr (i64 537919615 to i8*)
store volatile i8 0, i8* inttoptr (i64 537919613 to i8*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ wait(int);
int main(void) {
  unsigned long i = 0;
  (*(volatile unsigned long *)0xA0000050) =
      (1 << (4 * 2)) | (1 << (5 * 2)) | (1 << (6 * 2));
  while (1) {
    wait(30000);
    (*(volatile unsigned long *)0xA0000054) = (~(i << 4));
    if (++i == 8)
      i = 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    $0xa0000050,%eax
movq   $0x1500,(%rax)
mov    $0x7530,%edi
call   1030 <wait@plt>
mov    -0x10(%rbp),%rcx
shl    $0x4,%rcx
xor    $0xffffffffffffffff,%rcx
mov    $0xa0000054,%eax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
cmp    $0x8,%rax
jne    116f <main+0x5f>
movq   $0x0,-0x10(%rbp)
jmp    1133 <main+0x23>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0xa0000050,%r14d
movq   $0x1500,(%r14)
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x7530,%edi
call   1030 <wait@plt>
mov    %rbx,%rax
shl    $0x4,%rax
not    %rax
mov    %rax,0x4(%r14)
add    $0x1,%rbx
cmp    $0x8,%rbx
mov    $0x0,%eax
cmove  %rax,%rbx
jmp    1130 <main+0x20>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
store i64 0, i64* %2
store volatile i64 5376, i64* inttoptr (i64 2684354640 to i64*)
br label %3
3: ; preds = %0, %12
%4 = call i32 @wait(i32 30000)
%5 = load i64, i64* %2
%6 = shl i64 %5, 4
%7 = xor i64 %6, -1
store volatile i64 %7, i64* inttoptr (i64 2684354644 to i64*)
%8 = load i64, i64* %2
%9 = add i64 %8, 1
store i64 %9, i64* %2
%10 = icmp eq i64 %9, 8
br i1 %10, label %11, label %12
11: ; preds = %3
store i64 0, i64* %2
br label %12
12: ; preds = %11, %3
br label %3
}

LLVM IR (-O2):
define i32 @main() {
store volatile i64 5376, i64* inttoptr (i64 2684354640 to i64*)
br label %1
1: ; preds = %1, %0
%2 = phi i64 [ 0, %0 ], [ %8, %1 ]
%3 = tail call i32 @wait(i32 30000)
%4 = shl i64 %2, 4
%5 = xor i64 %4, -1
store volatile i64 %5, i64* inttoptr (i64 2684354644 to i64*)
%6 = add i64 %2, 1
%7 = icmp eq i64 %6, 8
%8 = select i1 %7, i64 0, i64 %6
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_18() {
  Assert_real((isqrt(18) == 4),
              "/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/stdlib/isqrt.c",
              95, ("Integer square root of 18 should be 4"));
}


x86 assembly (clang, -O0):
<t_sqrt_18>:
push   %rbp
mov    %rsp,%rbp
mov    $0x12,%edi
call   1030 <isqrt@plt>
cmp    $0x4,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x5f,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_18>:
push   %rax
mov    $0x12,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x4,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x5f,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 18 should be 4\00"
define void @t_sqrt_18() {
%1 = call i32 @isqrt(i32 18)
%2 = icmp eq i32 %1, 4
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 95, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 18 should be 4\00"
define void @t_sqrt_18() {
%1 = tail call i32 @isqrt(i32 18)
%2 = icmp eq i32 %1, 4
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 95, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int test_imm_D1uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0xD1 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_D1uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 13697024
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ _strlen(char const *);
int /*<<< orphan*/ write(int, char const *, int /*<<< orphan*/);
ssize_t __write2(const char *s) { write(2, s, _strlen(s)); }


x86 assembly (clang, -O0):
<__write2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <_strlen@plt>
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
mov    $0x2,%edi
call   1030 <write@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__write2>:
push   %rbx
mov    %rdi,%rbx
call   1040 <_strlen@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <write@plt>

LLVM IR (-O0):
define i32 @__write2(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @_strlen(i8* %5)
%7 = call i32 @write(i32 2, i8* %4, i32 %6)
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @__write2(i8* %0) {
%2 = tail call i32 @_strlen(i8* %0)
%3 = tail call i32 @write(i32 2, i8* %0, i32 %2)
ret i32 undef
}
_Bool SignalingGreaterEqual(double f1, double f2) { return f1 >= f2; }


x86 assembly (clang, -O0):
<SignalingGreaterEqual>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SignalingGreaterEqual>:
ucomisd %xmm1,%xmm0
setae  %al
ret

LLVM IR (-O0):
define zeroext i1 @SignalingGreaterEqual(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 oge double %5, %6
ret i1 %7
}

LLVM IR (-O2):
define zeroext i1 @SignalingGreaterEqual(double %0, double %1) {
%3 = fcmp oge double %0, %1
ret i1 %3
}
/* Variables and functions */
int syscall(int, int);
int inotify_init1(int flags) { return syscall(360, flags); }


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

x86 assembly (clang, -O2):
<inotify_init1>:
mov    %edi,%esi
mov    $0x168,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @inotify_init1(i32 %0) {
%2 = tail call i32 @syscall(i32 360, i32 %0)
ret i32 %2
}
/* Variables and functions */
void _initialize_tui_out(void) {}


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

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

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

LLVM IR (-O2):
define void @_initialize_tui_out() {
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int equal_string(void *s1, void *s2) {
  char *string1 = (char *)s1;
  char *string2 = (char *)s2;
  if (strcmp(string1, string2) == 0) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<equal_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1153 <equal_string+0x43>
movl   $0x1,-0x4(%rbp)
jmp    115a <equal_string+0x4a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<equal_string>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @equal_string(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
store i8* %8, i8** %6
%9 = load i8*, i8** %5
store i8* %9, i8** %7
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = call i64 @strcmp(i8* %10, i8* %11)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %2
store i32 1, i32* %3
br label %16
15: ; preds = %2
store i32 0, i32* %3
br label %16
16: ; preds = %15, %14
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @equal_string(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
void stub1(unsigned long);
void testClosureULrV(void (*closure)(unsigned long), unsigned long a1) {
  if (closure != NULL)
    (*closure)(a1);
}


x86 assembly (clang, -O0):
<testClosureULrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1125 <testClosureULrV+0x25>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureULrV>:
test   %rdi,%rdi
je     110d <testClosureULrV+0xd>
mov    %rdi,%rax
mov    %rsi,%rdi
jmp    *%rax
ret

LLVM IR (-O0):
define void @testClosureULrV(void (i64)* %0, i64 %1) {
%3 = alloca void (i64)*
%4 = alloca i64
store void (i64)* %0, void (i64)** %3
store i64 %1, i64* %4
%5 = load void (i64)*, void (i64)** %3
%6 = icmp ne void (i64)* %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load void (i64)*, void (i64)** %3
%9 = load i64, i64* %4
br label %10
10: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
define void @testClosureULrV(void (i64)* %0, i64 %1) {
%3 = icmp eq void (i64)* %0, null
br i1 %3, label %5, label %4
4: ; preds = %2
tail call void %0(i64 %1)
br label %5
5: ; preds = %4, %2
ret void
}
int fun778() { return 778; }


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

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

LLVM IR (-O0):
define i32 @fun778() {
ret i32 778
}

LLVM IR (-O2):
define i32 @fun778() {
ret i32 778
}
/* Variables and functions */
int close(int);
int /*<<< orphan*/ perror(char *);
int xclosex(int fd) {
  int status = close(fd);
  if (status < 0)
    perror("xclosex");
  return status;
}


x86 assembly (clang, -O0):
<xclosex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    114c <xclosex+0x2c>
lea    0xeb9(%rip),%rdi
call   1040 <perror@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xclosex>:
push   %rbx
call   1030 <close@plt>
mov    %eax,%ebx
test   %eax,%eax
js     1130 <xclosex+0x10>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xec9(%rip),%rdi
call   1040 <perror@plt>
jmp    112c <xclosex+0xc>

LLVM IR (-O0):
@.str = [8 x i8] c"xclosex\00"
define i32 @xclosex(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @close(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
@.str = [8 x i8] c"xclosex\00"
define i32 @xclosex(i32 %0) {
%2 = tail call i32 @close(i32 %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i32 %2
}
int color_offset_f2(int x, int y) {
  return (((y << 10) - (((x << 10) * 20) / 19) - (14 << 10)) >> 10);
}


x86 assembly (clang, -O0):
<color_offset_f2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0xa,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xa,%eax
imul   $0x14,%eax,%eax
mov    $0x13,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
sub    $0x3800,%eax
sar    $0xa,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<color_offset_f2>:
shl    $0xa,%esi
shl    $0xc,%edi
lea    (%rdi,%rdi,4),%eax
cltq
imul   $0xffffffff9435e50d,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x23,%rax
add    %ecx,%eax
add    %esi,%eax
add    $0xffffc800,%eax
sar    $0xa,%eax
ret

LLVM IR (-O0):
define i32 @color_offset_f2(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 = shl i32 %5, 10
%7 = load i32, i32* %3
%8 = shl i32 %7, 10
%9 = mul nsw i32 %8, 20
%10 = sdiv i32 %9, 19
%11 = sub nsw i32 %6, %10
%12 = sub nsw i32 %11, 14336
%13 = ashr i32 %12, 10
ret i32 %13
}

LLVM IR (-O2):
define i32 @color_offset_f2(i32 %0, i32 %1) {
%3 = shl i32 %1, 10
%4 = mul i32 %0, 20480
%5 = sdiv i32 %4, -19
%6 = add i32 %3, -14336
%7 = add i32 %6, %5
%8 = ashr i32 %7, 10
ret i32 %8
}
/* Variables and functions */
int handle_heat_common(int, int, char *, int);
int handle_cool(int devfd, int nodeid, char *arg) {
  return handle_heat_common(devfd, nodeid, arg, 2);
}


x86 assembly (clang, -O0):
<handle_cool>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    $0x2,%ecx
call   1030 <handle_heat_common@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_cool>:
mov    $0x2,%ecx
jmp    1030 <handle_heat_common@plt>

LLVM IR (-O0):
define i32 @handle_cool(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = call i32 @handle_heat_common(i32 %7, i32 %8, i8* %9, i32 2)
ret i32 %10
}

LLVM IR (-O2):
define i32 @handle_cool(i32 %0, i32 %1, i8* %2) {
%4 = tail call i32 @handle_heat_common(i32 %0, i32 %1, i8* %2, i32 2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ bar();
void baz(char *p) {
  if (!p)
    return;
  p -= 6;
  if (!p)
    bar();
}


x86 assembly (clang, -O0):
<baz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <baz+0x1c>
jmp    114a <baz+0x3a>
mov    -0x8(%rbp),%rax
add    $0xfffffffffffffffa,%rax
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    114a <baz+0x3a>
mov    $0x0,%al
call   1030 <bar@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @baz(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %6, label %5
5: ; preds = %1
br label %13
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 -6
store i8* %8, i8** %2
%9 = load i8*, i8** %2
%10 = icmp ne i8* %9, null
br i1 %10, label %13, label %11
11: ; preds = %6
%12 = call i32 (...) @bar()
br label %13
13: ; preds = %5, %11, %6
ret void
}

LLVM IR (-O2):
define void @baz(i8* nocapture %0) {
ret void
}
int rep_dlclose(void *handle) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @rep_dlclose(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0x8f() {
  Assert_real((isgraph(143) == 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",
              720, ("isgraph should be 0 for 0x8f"));
}


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

x86 assembly (clang, -O2):
<t_isgraph_0x8f>:
push   %rax
mov    $0x8f,%edi
call   1040 <isgraph@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2d0,%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 0x8f\00"
define void @t_isgraph_0x8f() {
%1 = call i64 @isgraph(i32 143)
%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 720, 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 0x8f\00"
define void @t_isgraph_0x8f() {
%1 = tail call i64 @isgraph(i32 143)
%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 720, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mytimer_set_timer(int, void (*)(int));
int /*<<< orphan*/ switchThreads();
void handler(int signal) {
  mytimer_set_timer(1000, handler);
  switchThreads();
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x3e8,%edi
mov    0x2eb1(%rip),%rsi
call   1030 <mytimer_set_timer@plt>
mov    $0x0,%al
call   1040 <switchThreads@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler>:
push   %rax
mov    0x2ec0(%rip),%rsi
mov    $0x3e8,%edi
call   1030 <mytimer_set_timer@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <switchThreads@plt>

LLVM IR (-O0):
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @mytimer_set_timer(i32 1000, void (i32)* @handler)
%4 = call i32 (...) @switchThreads()
ret void
}

LLVM IR (-O2):
define void @handler(i32 %0) {
%2 = tail call i32 @mytimer_set_timer(i32 1000, void (i32)* @handler)
%3 = tail call i32 (...) @switchThreads()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ munmap(void *, size_t);
int /*<<< orphan*/ perror(char *);
void gt_xmunmap(void *addr, size_t len) {
  if (munmap(addr, len)) {
    perror("cannot munmap");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<gt_xmunmap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <munmap@plt>
cmp    $0x0,%rax
je     1171 <gt_xmunmap+0x41>
lea    0xea2(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gt_xmunmap>:
push   %rax
call   1030 <munmap@plt>
test   %rax,%rax
jne    113d <gt_xmunmap+0xd>
pop    %rax
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"cannot munmap\00"
@EXIT_FAILURE = global i32 0
define void @gt_xmunmap(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i64 @munmap(i8* %5, i64 %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"cannot munmap\00"
@EXIT_FAILURE = global i32 0
define void @gt_xmunmap(i8* %0, i64 %1) {
%3 = tail call i64 @munmap(i8* %0, i64 %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
ret void
}
int BinIONormalizeByteOrder(int byte_order) {
  if (byte_order == 'H') {
    byte_order = 'L';
  } else if (byte_order == 'N') {
    byte_order = 'B';
  }
  return byte_order;
}


x86 assembly (clang, -O0):
<BinIONormalizeByteOrder>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x48,-0x4(%rbp)
jne    111d <BinIONormalizeByteOrder+0x1d>
movl   $0x4c,-0x4(%rbp)
jmp    1133 <BinIONormalizeByteOrder+0x33>
cmpl   $0x4e,-0x4(%rbp)
jne    112e <BinIONormalizeByteOrder+0x2e>
movl   $0x42,-0x4(%rbp)
jmp    1133 <BinIONormalizeByteOrder+0x33>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BinIONormalizeByteOrder>:
cmp    $0x4e,%edi
mov    $0x42,%ecx
cmovne %edi,%ecx
cmp    $0x48,%edi
mov    $0x4c,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @BinIONormalizeByteOrder(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 72
br i1 %4, label %5, label %6
5: ; preds = %1
store i32 76, i32* %2
br label %11
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 78
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 66, i32* %2
br label %10
10: ; preds = %9, %6
br label %11
11: ; preds = %10, %5
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @BinIONormalizeByteOrder(i32 %0) {
%2 = icmp eq i32 %0, 72
%3 = icmp eq i32 %0, 78
%4 = select i1 %3, i32 66, i32 %0
%5 = select i1 %2, i32 76, i32 %4
ret i32 %5
}
double nmea_dop2meters(double dop) { return (dop * (5)); }


x86 assembly (clang, -O0):
<nmea_dop2meters>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<nmea_dop2meters>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @nmea_dop2meters(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 5.000000e+00
ret double %4
}

LLVM IR (-O2):
define double @nmea_dop2meters(double %0) {
%2 = fmul double %0, 5.000000e+00
ret double %2
}
/* Type definitions */
typedef int /*<<< orphan*/ ucontext_t;

/* Variables and functions */
int getcontext(int /*<<< orphan*/ *);
int setcontext(int /*<<< orphan*/ const *);
int swapcontext(ucontext_t *o, const ucontext_t *n) {
  volatile int once = 0;
  if (getcontext(o) == -1)
    return -1;
  if (!once) {
    ++once;
    return setcontext(n);
  }
  return 0;
}


x86 assembly (clang, -O0):
<swapcontext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <getcontext@plt>
cmp    $0xffffffff,%eax
jne    1155 <swapcontext+0x35>
movl   $0xffffffff,-0x4(%rbp)
jmp    1182 <swapcontext+0x62>
mov    -0x1c(%rbp),%eax
cmp    $0x0,%eax
jne    117b <swapcontext+0x5b>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <setcontext@plt>
mov    %eax,-0x4(%rbp)
jmp    1182 <swapcontext+0x62>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swapcontext>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
movl   $0x0,0xc(%rsp)
call   1040 <getcontext@plt>
cmp    $0xffffffff,%eax
je     1152 <swapcontext+0x32>
xor    %eax,%eax
cmpl   $0x0,0xc(%rsp)
jne    1157 <swapcontext+0x37>
addl   $0x1,0xc(%rsp)
mov    %rbx,%rdi
call   1030 <setcontext@plt>
jmp    1157 <swapcontext+0x37>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @swapcontext(i32* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store volatile i32 0, i32* %6
%7 = load i32*, i32** %4
%8 = call i32 @getcontext(i32* %7)
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 -1, i32* %3
br label %20
11: ; preds = %2
%12 = load volatile i32, i32* %6
%13 = icmp ne i32 %12, 0
br i1 %13, label %19, label %14
14: ; preds = %11
%15 = load volatile i32, i32* %6
%16 = add nsw i32 %15, 1
store volatile i32 %16, i32* %6
%17 = load i32*, i32** %5
%18 = call i32 @setcontext(i32* %17)
store i32 %18, i32* %3
br label %20
19: ; preds = %11
store i32 0, i32* %3
br label %20
20: ; preds = %19, %14, %10
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @swapcontext(i32* %0, i32* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store volatile i32 0, i32* %3
%5 = call i32 @getcontext(i32* %0)
%6 = icmp eq i32 %5, -1
br i1 %6, label %14, label %7
7: ; preds = %2
%8 = load volatile i32, i32* %3
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %7
%11 = load volatile i32, i32* %3
%12 = add nsw i32 %11, 1
store volatile i32 %12, i32* %3
%13 = call i32 @setcontext(i32* %1)
br label %14
14: ; preds = %7, %2, %10
%15 = phi i32 [ %13, %10 ], [ -1, %2 ], [ 0, %7 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ test_queueint_basic();
int /*<<< orphan*/ test_queueint_large();
int /*<<< orphan*/ test_queueint_large_crossover();
int /*<<< orphan*/ tests_show_summary();
int main(void) {
  test_queueint_basic();
  test_queueint_large();
  test_queueint_large_crossover();
  tests_show_summary();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <test_queueint_basic@plt>
mov    $0x0,%al
call   1060 <test_queueint_large@plt>
mov    $0x0,%al
call   1050 <test_queueint_large_crossover@plt>
mov    $0x0,%al
call   1030 <tests_show_summary@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test_queueint_basic@plt>
xor    %eax,%eax
call   1060 <test_queueint_large@plt>
xor    %eax,%eax
call   1050 <test_queueint_large_crossover@plt>
xor    %eax,%eax
call   1030 <tests_show_summary@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_queueint_basic()
%3 = call i32 (...) @test_queueint_large()
%4 = call i32 (...) @test_queueint_large_crossover()
%5 = call i32 (...) @tests_show_summary()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_queueint_basic()
%2 = tail call i32 (...) @test_queueint_large()
%3 = tail call i32 (...) @test_queueint_large_crossover()
%4 = tail call i32 (...) @tests_show_summary()
ret i32 0
}
int find_any_index(char string[], char stop[]) { return (-1); }


x86 assembly (clang, -O0):
<find_any_index>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @find_any_index(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 -1
}
long double time_velocityMetres(long double V, long double M) { return V / M; }


x86 assembly (clang, -O0):
<time_velocityMetres>:
push   %rbp
mov    %rsp,%rbp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
fdivrp %st,%st(1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_velocityMetres>:
fldt   0x18(%rsp)
fldt   0x8(%rsp)
fdivp  %st,%st(1)
ret

LLVM IR (-O0):
define x86_fp80 @time_velocityMetres(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %4
%7 = fdiv x86_fp80 %5, %6
ret x86_fp80 %7
}

LLVM IR (-O2):
define x86_fp80 @time_velocityMetres(x86_fp80 %0, x86_fp80 %1) {
%3 = fdiv x86_fp80 %0, %1
ret x86_fp80 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("Hello LF!\n"); }


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

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

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

LLVM IR (-O2):
@str = [10 x i8] c"Hello LF!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ entab(char *, int);
int getline(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  int len;
  char line[1000];
  while ((len = getline(line, 1000)) > 0) {
    entab(line, len);
    printf("%s", line);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1040 <getline@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1186 <main+0x56>
lea    -0x3f0(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1050 <entab@plt>
lea    -0x3f0(%rbp),%rsi
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
jmp    1142 <main+0x12>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x3e8,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1040 <getline@plt>
test   %eax,%eax
jle    1186 <main+0x56>
mov    %rsp,%rbx
lea    0xeab(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <entab@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1040 <getline@plt>
test   %eax,%eax
jg     1160 <main+0x30>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @getline(i8* %2, i32 1000)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %0, %5
%6 = phi i32 [ %9, %5 ], [ %3, %0 ]
%7 = call i32 @entab(i8* %2, i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%9 = call i32 @getline(i8* %2, i32 1000)
%10 = icmp sgt i32 %9, 0
br i1 %10, label %5, label %11
11: ; preds = %5, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ rt_InitInfAndNaN(unsigned int);
void rpy2quat_initialize(void) { rt_InitInfAndNaN(8U); }


x86 assembly (clang, -O0):
<rpy2quat_initialize>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8,%edi
call   1030 <rt_InitInfAndNaN@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpy2quat_initialize>:
mov    $0x8,%edi
jmp    1030 <rt_InitInfAndNaN@plt>

LLVM IR (-O0):
define void @rpy2quat_initialize() {
%1 = call i32 @rt_InitInfAndNaN(i32 8)
ret void
}

LLVM IR (-O2):
define void @rpy2quat_initialize() {
%1 = tail call i32 @rt_InitInfAndNaN(i32 8)
ret void
}
int testFunc(int i) {
  ++i;
  return ++i;
}


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

x86 assembly (clang, -O2):
<testFunc>:
lea    0x2(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @testFunc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
store i32 %6, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @testFunc(i32 %0) {
%2 = add nsw i32 %0, 2
ret i32 %2
}
int execvp(const char *file, char *const argv[]) {}


x86 assembly (clang, -O0):
<execvp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @execvp(i8* nocapture readnone %0, i8** nocapture readnone %1) {
ret i32 undef
}
/* Variables and functions */
int matExtractMatrix(char const *, int *, int *, double *);
int matGetDim(const char *s, int *d1, int *d2) {
  double res[16];
  return matExtractMatrix(s, d1, d2, res);
}


x86 assembly (clang, -O0):
<matGetDim>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    -0xa0(%rbp),%rcx
call   1030 <matExtractMatrix@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matGetDim>:
sub    $0x88,%rsp
mov    %rsp,%rcx
call   1030 <matExtractMatrix@plt>
add    $0x88,%rsp
ret

LLVM IR (-O0):
define i32 @matGetDim(i8* %0, i32* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca [16 x double]
store i8* %0, i8** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%8 = load i8*, i8** %4
%9 = load i32*, i32** %5
%10 = load i32*, i32** %6
%11 = getelementptr inbounds [16 x double], [16 x double]* %7, i64 0, i64 0
%12 = call i32 @matExtractMatrix(i8* %8, i32* %9, i32* %10, double* %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @matGetDim(i8* %0, i32* %1, i32* %2) {
%4 = alloca [16 x double]
%5 = bitcast [16 x double]* %4 to i8*
%6 = getelementptr inbounds [16 x double], [16 x double]* %4, i64 0, i64 0
%7 = call i32 @matExtractMatrix(i8* %0, i32* %1, i32* %2, double* %6)
ret i32 %7
}
int execute_shmdt() { return 0; }


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

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

LLVM IR (-O0):
define i32 @execute_shmdt() {
ret i32 0
}

LLVM IR (-O2):
define i32 @execute_shmdt() {
ret i32 0
}