xunge/DecIR huggingface dataset:
/* Variables and functions */
char funcA(int);
int main() {
  signed char tmp = 0;
  tmp = funcA(-1);
  tmp = 0;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call signext i8 @funcA(i32 -1)
ret i32 0
}
/* Type definitions */
struct mallinfo {
  int arena;
  int uordblks;
  int fordblks;
};

/* Variables and functions */
struct mallinfo mallinfo();
int /*<<< orphan*/ printf(char *, int, int, int);
void pmem() {
  struct mallinfo m;
  m = mallinfo();
  printf("\nMemory information: total system space:%d  alloc:%d  free:%d",
         m.arena, m.uordblks, m.fordblks);
}


x86 assembly (clang, -O0):
<pmem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
xor    %eax,%eax
call   1040 <mallinfo@plt>
mov    %edx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmem>:
push   %rax
xor    %eax,%eax
call   1040 <mallinfo@plt>
mov    %edx,%ecx
mov    %rax,%rdx
shr    $0x20,%rdx
lea    0xec8(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.mallinfo = type { i32, i32, i32 }
@.str = [62 x i8] c"\0AMemory information: total system space:%d alloc:%d free:%d\00"
define void @pmem() {
%1 = alloca %struct.mallinfo
%2 = alloca %struct.mallinfo
%3 = alloca { i64, i32 }
%4 = call { i64, i32 } (...) @mallinfo()
store { i64, i32 } %4, { i64, i32 }* %3
%5 = bitcast %struct.mallinfo* %2 to i8*
%6 = bitcast { i64, i32 }* %3 to i8*
%7 = bitcast %struct.mallinfo* %1 to i8*
%8 = bitcast %struct.mallinfo* %2 to i8*
%9 = getelementptr inbounds %struct.mallinfo, %struct.mallinfo* %1, i32 0, i32 0
%10 = load i32, i32* %9
%11 = getelementptr inbounds %struct.mallinfo, %struct.mallinfo* %1, i32 0, i32 1
%12 = load i32, i32* %11
%13 = getelementptr inbounds %struct.mallinfo, %struct.mallinfo* %1, i32 0, i32 2
%14 = load i32, i32* %13
%15 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %12, i32 %14)
ret void
}

LLVM IR (-O2):
@.str = [62 x i8] c"\0AMemory information: total system space:%d alloc:%d free:%d\00"
define void @pmem() {
%1 = tail call { i64, i32 } (...) @mallinfo()
%2 = extractvalue { i64, i32 } %1, 0
%3 = extractvalue { i64, i32 } %1, 1
%4 = trunc i64 %2 to i32
%5 = lshr i64 %2, 32
%6 = trunc i64 %5 to i32
%7 = tail call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %6, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ wdog_status(int *);
int wdog_is_enabled(void) {
  int status = 0;
  wdog_status(&status);
  return status;
}


x86 assembly (clang, -O0):
<wdog_is_enabled>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <wdog_status@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wdog_is_enabled>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <wdog_status@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @wdog_is_enabled() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @wdog_status(i32* %1)
%4 = load i32, i32* %1
ret i32 %4
}
int entrypoint() {
  char x[10];
  x[10] = 4;
  return 0;
}


x86 assembly (clang, -O0):
<entrypoint>:
push   %rbp
mov    %rsp,%rbp
movb   $0x4,0x0(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @entrypoint() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 10
store i8 4, i8* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @entrypoint() {
ret i32 0
}
/* Variables and functions */
int get_int();
int /*<<< orphan*/ print_binary(int);
int /*<<< orphan*/ print_decimal(int);
int /*<<< orphan*/ print_hexadecimal(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int num = get_int();
  printf("Got number %d\n", num);
  print_decimal(num);
  print_hexadecimal(num);
  print_binary(num);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1070 <get_int@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
call   1050 <print_decimal@plt>
mov    -0x8(%rbp),%edi
call   1040 <print_hexadecimal@plt>
mov    -0x8(%rbp),%edi
call   1060 <print_binary@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1070 <get_int@plt>
mov    %eax,%ebx
lea    0xe9f(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %ebx,%edi
call   1050 <print_decimal@plt>
mov    %ebx,%edi
call   1040 <print_hexadecimal@plt>
mov    %ebx,%edi
call   1060 <print_binary@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Got number %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @get_int()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %2
%7 = call i32 @print_decimal(i32 %6)
%8 = load i32, i32* %2
%9 = call i32 @print_hexadecimal(i32 %8)
%10 = load i32, i32* %2
%11 = call i32 @print_binary(i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Got number %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @get_int()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @print_decimal(i32 %1)
%4 = tail call i32 @print_hexadecimal(i32 %1)
%5 = tail call i32 @print_binary(i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ isspace(char const);
unsigned getCommandEndPos(const char *cmd) {
  assert(NULL != cmd);
  unsigned ret = 0;
  while (!isspace(cmd[ret]))
    ret++;
  return ret;
}


x86 assembly (clang, -O0):
<getCommandEndPos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movsbl (%rax,%rcx,1),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    116b <getCommandEndPos+0x4b>
jmp    1179 <getCommandEndPos+0x59>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1146 <getCommandEndPos+0x26>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCommandEndPos>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %edi,%edi
test   %r14,%r14
setne  %dil
call   1040 <assert@plt>
mov    $0xffffffff,%ebx
nopw   0x0(%rax,%rax,1)
add    $0x1,%ebx
movsbl (%r14,%rbx,1),%edi
call   1030 <isspace@plt>
test   %eax,%eax
je     1140 <getCommandEndPos+0x20>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @getCommandEndPos(i8* %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
br label %5
5: ; preds = %5, %1
%6 = phi i32 [ 0, %1 ], [ %12, %5 ]
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call i32 @isspace(i8 signext %9)
%11 = icmp eq i32 %10, 0
%12 = add i32 %6, 1
br i1 %11, label %5, label %13
13: ; preds = %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0xc6() {
  Assert_real((isxdigit(198) == 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_isxdigit.c",
              995, ("isxdigit should be 0 for 0xc6"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0xc6>:
push   %rax
mov    $0xc6,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x3e3,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xc6\00"
define void @t_isxdigit_0xc6() {
%1 = call i64 @isxdigit(i32 198)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 995, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xc6\00"
define void @t_isxdigit_0xc6() {
%1 = tail call i64 @isxdigit(i32 198)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 995, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int Add(int x, int y, int *sum) { sum = x + y; }


x86 assembly (clang, -O0):
<Add>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @Add(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = add nsw i32 %8, %9
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
store i32* %12, i32** %7
%13 = load i32, i32* %4
ret i32 %13
}

LLVM IR (-O2):
define i32 @Add(i32 %0, i32 %1, i32* nocapture readnone %2) {
ret i32 undef
}
void TXC1_interrupt_event(void) {}


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

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

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

LLVM IR (-O2):
define void @TXC1_interrupt_event() {
ret void
}
int add(int i) { return i + 1; }


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

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

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

LLVM IR (-O2):
define i32 @add(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
scalar_t__ basis_calloc(size_t, int);
double *basis_dvector_alloc(long n) {
  double *v;
  v = (double *)basis_calloc((size_t)(n + 1), sizeof(double));
  return v;
}


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

x86 assembly (clang, -O2):
<basis_dvector_alloc>:
add    $0x1,%rdi
mov    $0x8,%esi
jmp    1030 <basis_calloc@plt>

LLVM IR (-O0):
define double* @basis_dvector_alloc(i64 %0) {
%2 = alloca i64
%3 = alloca double*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = add nsw i64 %4, 1
%6 = call i64 @basis_calloc(i64 %5, i32 8)
%7 = inttoptr i64 %6 to double*
store double* %7, double** %3
%8 = load double*, double** %3
ret double* %8
}

LLVM IR (-O2):
define double* @basis_dvector_alloc(i64 %0) {
%2 = add nsw i64 %0, 1
%3 = tail call i64 @basis_calloc(i64 %2, i32 8)
%4 = inttoptr i64 %3 to double*
ret double* %4
}
float max_star1(float delta1, float delta2) {
  if (delta1 > delta2)
    return (delta1);
  else
    return (delta2);
}


x86 assembly (clang, -O0):
<max_star1>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    112c <max_star1+0x2c>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1136 <max_star1+0x36>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_star1>:
maxss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @max_star1(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ terminit(int /*<<< orphan*/);
int /*<<< orphan*/ termrst();
char getch() {
  char ch;
  terminit(0);
  ch = getchar();
  termrst();
  return ch;
}


x86 assembly (clang, -O0):
<getch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1050 <terminit@plt>
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1040 <termrst@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getch>:
push   %rbx
xor    %edi,%edi
call   1050 <terminit@plt>
xor    %eax,%eax
call   1030 <getchar@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <termrst@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @getch() {
%1 = alloca i8
%2 = call i32 @terminit(i32 0)
%3 = call signext i8 (...) @getchar()
store i8 %3, i8* %1
%4 = call i32 (...) @termrst()
%5 = load i8, i8* %1
ret i8 %5
}

LLVM IR (-O2):
define signext i8 @getch() {
%1 = tail call i32 @terminit(i32 0)
%2 = tail call signext i8 (...) @getchar()
%3 = tail call i32 (...) @termrst()
ret i8 %2
}
unsigned short le16_to_cpu(unsigned short x) {
  return (((x & 0x00ff) << 8) | ((x & 0xff00) >> 8));
}


x86 assembly (clang, -O0):
<le16_to_cpu>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
and    $0xff,%eax
shl    $0x8,%eax
movzwl -0x2(%rbp),%ecx
and    $0xff00,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<le16_to_cpu>:
mov    %edi,%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define zeroext i16 @le16_to_cpu(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 255
%6 = shl i32 %5, 8
%7 = load i16, i16* %2
%8 = zext i16 %7 to i32
%9 = and i32 %8, 65280
%10 = ashr i32 %9, 8
%11 = or i32 %6, %10
%12 = trunc i32 %11 to i16
ret i16 %12
}

LLVM IR (-O2):
define zeroext i16 @le16_to_cpu(i16 zeroext %0) {
%2 = tail call i16 @llvm.bswap.i16(i16 %0)
ret i16 %2
}
/* Variables and functions */
int /*<<< orphan*/ getpid();
int kill(int /*<<< orphan*/, int);
int raise(int signum) { return kill(getpid(), signum); }


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

x86 assembly (clang, -O2):
<raise>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <kill@plt>

LLVM IR (-O0):
define i32 @raise(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @getpid()
%4 = load i32, i32* %2
%5 = call i32 @kill(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @raise(i32 %0) {
%2 = tail call i32 (...) @getpid()
%3 = tail call i32 @kill(i32 %2, i32 %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("Hello World");
  printf("\n Lets make a change..!");
  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    0xed3(%rip),%rdi
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"Hello World\00"
@.str.1 = [24 x i8] c"\0A Lets make a change..!\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 ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hello World\00"
@.str.1 = [24 x i8] c"\0A Lets make a change..!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void jrx_internal_error(const char *msg) {
  fprintf(stderr, "jitre internal error: %s", msg);
  abort();
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"jitre internal error: %s\00"
define void @jrx_internal_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"jitre internal error: %s\00"
define void @jrx_internal_error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @abort()
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ PKCS7_RECIP_INFO;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
scalar_t__ ASN1_item_d2i(int /*<<< orphan*/ **, unsigned char const **, long,
                         int /*<<< orphan*/ *);
int /*<<< orphan*/ PKCS7_RECIP_INFO_it;
PKCS7_RECIP_INFO *d2i_PKCS7_RECIP_INFO(PKCS7_RECIP_INFO **a,
                                       const unsigned char **in, long len) {
  return (PKCS7_RECIP_INFO *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
                                           &PKCS7_RECIP_INFO_it);
}


x86 assembly (clang, -O0):
<d2i_PKCS7_RECIP_INFO>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%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
mov    0x2eb1(%rip),%rcx
call   1030 <ASN1_item_d2i@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2i_PKCS7_RECIP_INFO>:
mov    0x2ed1(%rip),%rcx
jmp    1030 <ASN1_item_d2i@plt>

LLVM IR (-O0):
@PKCS7_RECIP_INFO_it = global i32 0
define i32* @d2i_PKCS7_RECIP_INFO(i32** %0, i8** %1, i64 %2) {
%4 = alloca i32**
%5 = alloca i8**
%6 = alloca i64
store i32** %0, i32*** %4
store i8** %1, i8*** %5
store i64 %2, i64* %6
%7 = load i32**, i32*** %4
%8 = load i8**, i8*** %5
%9 = load i64, i64* %6
%10 = call i64 @ASN1_item_d2i(i32** %7, i8** %8, i64 %9, i32* @PKCS7_RECIP_INFO_it)
%11 = inttoptr i64 %10 to i32*
ret i32* %11
}

LLVM IR (-O2):
@PKCS7_RECIP_INFO_it = global i32 0
define i32* @d2i_PKCS7_RECIP_INFO(i32** %0, i8** %1, i64 %2) {
%4 = tail call i64 @ASN1_item_d2i(i32** %0, i8** %1, i64 %2, i32* @PKCS7_RECIP_INFO_it)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
/* Variables and functions */
char *dvi_process_run(const char *arg) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @dvi_process_run(i8* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0xcd() {
  Assert_real((isspace(205) == 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_isspace.c",
              1030, ("isspace should be 0 for 0xcd"));
}


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

x86 assembly (clang, -O2):
<t_isspace_0xcd>:
push   %rax
mov    $0xcd,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x406,%edx
pop    %rax
jmp    1040 <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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0xcd\00"
define void @t_isspace_0xcd() {
%1 = call i64 @isspace(i32 205)
%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 1030, 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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0xcd\00"
define void @t_isspace_0xcd() {
%1 = tail call i64 @isspace(i32 205)
%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 1030, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(void) {
  int a, b;
  double S;
  scanf("%d %d", &a, &b);
  S = a * b / 3.305785;
  printf("%f\n", S);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xeaa(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee0(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    (%rsp),%eax
imul   0x4(%rsp),%eax
cvtsi2sd %eax,%xmm0
divsd  0xeb7(%rip),%xmm0
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = mul nsw i32 %6, %7
%9 = sitofp i32 %8 to double
%10 = fdiv double %9, 0x400A723F67F4DBE0
store double %10, double* %4
%11 = load double, double* %4
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = mul nsw i32 %7, %6
%9 = sitofp i32 %8 to double
%10 = fdiv double %9, 0x400A723F67F4DBE0
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fileTest(char *);
int /*<<< orphan*/ setupStockNodes();
int /*<<< orphan*/ simpleTest();
int main(void) {
  setupStockNodes();
  simpleTest();
  fileTest("C:\\wc\\words_alpha.txt");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <setupStockNodes@plt>
mov    $0x0,%al
call   1040 <simpleTest@plt>
lea    0xeb7(%rip),%rdi
call   1050 <fileTest@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <setupStockNodes@plt>
xor    %eax,%eax
call   1040 <simpleTest@plt>
lea    0xeba(%rip),%rdi
call   1050 <fileTest@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"C:\\wc\\words_alpha.txt\00"
define i32 @main() {
%1 = call i32 (...) @setupStockNodes()
%2 = call i32 (...) @simpleTest()
%3 = call i32 @fileTest(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"C:\\wc\\words_alpha.txt\00"
define i32 @main() {
%1 = tail call i32 (...) @setupStockNodes()
%2 = tail call i32 (...) @simpleTest()
%3 = tail call i32 @fileTest(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
void *stdc_5909E3C4(void *, int, size_t);
void *memset(void *str, int c, size_t n) { return stdc_5909E3C4(str, c, n); }


x86 assembly (clang, -O0):
<memset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <stdc_5909E3C4@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memset>:
jmp    1030 <stdc_5909E3C4@plt>

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

LLVM IR (-O2):
define i8* @memset(i8* %0, i32 %1, i64 %2) {
%4 = tail call i8* @stdc_5909E3C4(i8* %0, i32 %1, i64 %2)
ret i8* %4
}
float fastsqrt(float x) {
  float z = x;
  int val_int = *(int *)&z;
  val_int = (1 << 29) + (val_int >> 1) - (1 << 22);
  z = *(float *)&val_int;
  z -= z / 2 - x / (2 * z);
  return z;
}


x86 assembly (clang, -O0):
<fastsqrt>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x1,%eax
add    $0x20000000,%eax
sub    $0x400000,%eax
mov    %eax,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm1
movss  0xebd(%rip),%xmm0
divss  %xmm0,%xmm1
movss  -0x4(%rbp),%xmm0
movss  0xeac(%rip),%xmm2
mulss  -0x8(%rbp),%xmm2
divss  %xmm2,%xmm0
subss  %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fastsqrt>:
movd   %xmm0,%eax
sar    %eax
add    $0x1fc00000,%eax
movd   %eax,%xmm1
movss  0xee9(%rip),%xmm2
mulss  %xmm1,%xmm2
movaps %xmm1,%xmm3
addss  %xmm1,%xmm3
divss  %xmm3,%xmm0
subss  %xmm0,%xmm2
subss  %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @fastsqrt(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca i32
store float %0, float* %2
%5 = load float, float* %2
store float %5, float* %3
%6 = bitcast float* %3 to i32*
%7 = load i32, i32* %6
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = ashr i32 %8, 1
%10 = add nsw i32 536870912, %9
%11 = sub nsw i32 %10, 4194304
store i32 %11, i32* %4
%12 = bitcast i32* %4 to float*
%13 = load float, float* %12
store float %13, float* %3
%14 = load float, float* %3
%15 = fdiv float %14, 2.000000e+00
%16 = load float, float* %2
%17 = load float, float* %3
%18 = fmul float 2.000000e+00, %17
%19 = fdiv float %16, %18
%20 = fsub float %15, %19
%21 = load float, float* %3
%22 = fsub float %21, %20
store float %22, float* %3
%23 = load float, float* %3
ret float %23
}

LLVM IR (-O2):
define float @fastsqrt(float %0) {
%2 = bitcast float %0 to i32
%3 = ashr i32 %2, 1
%4 = add nsw i32 %3, 532676608
%5 = bitcast i32 %4 to float
%6 = fmul float %5, 5.000000e-01
%7 = fmul float %5, 2.000000e+00
%8 = fdiv float %0, %7
%9 = fsub float %6, %8
%10 = fsub float %5, %9
ret float %10
}
/* Variables and functions */
int /*<<< orphan*/ assert_int_equal(int, int /*<<< orphan*/);
int /*<<< orphan*/ b_any_lever(int, int);
void b_any_lever_test(void **state) {
  assert_int_equal(0x0000000C00000000ul,
                   b_any_lever(0x000000000C000000ul, 0x0000000C00000000ul));
}


x86 assembly (clang, -O0):
<b_any_lever_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xc000000,%edi
xor    %esi,%esi
call   1030 <b_any_lever@plt>
mov    %eax,%esi
xor    %edi,%edi
call   1040 <assert_int_equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_any_lever_test>:
push   %rax
mov    $0xc000000,%edi
xor    %esi,%esi
call   1030 <b_any_lever@plt>
xor    %edi,%edi
mov    %eax,%esi
pop    %rax
jmp    1040 <assert_int_equal@plt>

LLVM IR (-O0):
define void @b_any_lever_test(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @b_any_lever(i32 201326592, i32 0)
%4 = call i32 @assert_int_equal(i32 0, i32 %3)
ret void
}

LLVM IR (-O2):
define void @b_any_lever_test(i8** nocapture readnone %0) {
%2 = tail call i32 @b_any_lever(i32 201326592, i32 0)
%3 = tail call i32 @assert_int_equal(i32 0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int chdir(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void dirs_chdir(char *path) {
  int err;
  if (!path)
    path = ".";
  if ((err = chdir(path)) == -1) {
    perror("chdir");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<dirs_chdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1152 <dirs_chdir+0x22>
lea    0xeb2(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <chdir@plt>
mov    %eax,-0xc(%rbp)
cmp    $0xffffffff,%eax
jne    1181 <dirs_chdir+0x51>
lea    0xe94(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e66(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dirs_chdir>:
push   %rax
test   %rdi,%rdi
lea    0xec5(%rip),%rax
cmove  %rax,%rdi
call   1030 <chdir@plt>
cmp    $0xffffffff,%eax
je     114b <dirs_chdir+0x1b>
pop    %rax
ret
lea    0xeb0(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
@.str.1 = [6 x i8] c"chdir\00"
@EXIT_FAILURE = global i32 0
define void @dirs_chdir(i8* %0) {
%2 = icmp eq i8* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* %0
%4 = tail call i32 @chdir(i8* %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %1
ret void
}
int Media_FrameStep(int amount) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @Media_FrameStep(i32 %0) {
ret i32 1
}
/* Type definitions */
struct Cyc_Pratt_Graph {
  int dummy;
};
struct Cyc_List_List {
  int dummy;
};

/* Variables and functions */
struct Cyc_Pratt_Graph *Cyc_Pratt_empty_graph();
int Cyc_Relations_consist_relations(struct Cyc_Pratt_Graph *,
                                    struct Cyc_List_List *);
int Cyc_Relations_consistent_relations(struct Cyc_List_List *rlns) {
  struct Cyc_Pratt_Graph *G = Cyc_Pratt_empty_graph();
  return Cyc_Relations_consist_relations(G, rlns);
}


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

x86 assembly (clang, -O2):
<Cyc_Relations_consistent_relations>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <Cyc_Pratt_empty_graph@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <Cyc_Relations_consist_relations@plt>

LLVM IR (-O0):
%struct.Cyc_List_List = type { i32 }
%struct.Cyc_Pratt_Graph = type { i32 }
define i32 @Cyc_Relations_consistent_relations(%struct.Cyc_List_List* %0) {
%2 = alloca %struct.Cyc_List_List*
%3 = alloca %struct.Cyc_Pratt_Graph*
store %struct.Cyc_List_List* %0, %struct.Cyc_List_List** %2
%4 = call %struct.Cyc_Pratt_Graph* (...) @Cyc_Pratt_empty_graph()
store %struct.Cyc_Pratt_Graph* %4, %struct.Cyc_Pratt_Graph** %3
%5 = load %struct.Cyc_Pratt_Graph*, %struct.Cyc_Pratt_Graph** %3
%6 = load %struct.Cyc_List_List*, %struct.Cyc_List_List** %2
%7 = call i32 @Cyc_Relations_consist_relations(%struct.Cyc_Pratt_Graph* %5, %struct.Cyc_List_List* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.Cyc_List_List = type { i32 }
%struct.Cyc_Pratt_Graph = type { i32 }
define i32 @Cyc_Relations_consistent_relations(%struct.Cyc_List_List* %0) {
%2 = tail call %struct.Cyc_Pratt_Graph* (...) @Cyc_Pratt_empty_graph()
%3 = tail call i32 @Cyc_Relations_consist_relations(%struct.Cyc_Pratt_Graph* %2, %struct.Cyc_List_List* %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ os_sleep(double);
void lovrTimerSleep(double seconds) { os_sleep(seconds); }


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

x86 assembly (clang, -O2):
<lovrTimerSleep>:
jmp    1030 <os_sleep@plt>

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

LLVM IR (-O2):
define void @lovrTimerSleep(double %0) {
%2 = tail call i32 @os_sleep(double %0)
ret void
}
int gnu_getopt(argc, argv, optstring)
int argc;
char *const *argv;
const char *optstring;
{
  return _getopt_internal(argc, argv, optstring, (const struct option *)0,
                          (int *)0, 0);
}


x86 assembly (clang, -O0):
<gnu_getopt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%r8d
xor    %r9d,%r9d
mov    %r8,%rcx
mov    $0x0,%al
call   1030 <_getopt_internal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gnu_getopt>:
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
xor    %eax,%eax
jmp    1030 <_getopt_internal@plt>

LLVM IR (-O0):
%struct.option = type opaque
define i32 @gnu_getopt(i32 %0, i8** %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = load i8*, i8** %6
%10 = call i32 (i32, i8**, i8*, %struct.option*, i32*, i32, ...) bitcast (i32 (...)* @_getopt_internal to i32 (i32, i8**, i8*, %struct.option*, i32*, i32, ...)*)(i32 %7, i8** %8, i8* %9, %struct.option* null, i32* null, i32 0)
ret i32 %10
}

LLVM IR (-O2):
%struct.option = type opaque
define i32 @gnu_getopt(i32 %0, i8** %1, i8* %2) {
%4 = tail call i32 (i32, i8**, i8*, %struct.option*, i32*, i32, ...) bitcast (i32 (...)* @_getopt_internal to i32 (i32, i8**, i8*, %struct.option*, i32*, i32, ...)*)(i32 %0, i8** %1, i8* %2, %struct.option* null, i32* null, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void die(int n) { exit(0); }


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @die(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @die(i32 %0) {
%2 = tail call i32 @exit(i32 0)
unreachable
}
unsigned gl_get_char_width(void) { return 12; }


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

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

LLVM IR (-O0):
define i32 @gl_get_char_width() {
ret i32 12
}

LLVM IR (-O2):
define i32 @gl_get_char_width() {
ret i32 12
}
unsigned int ssb_mips_irq(struct ssb_device *dev) { return 0; }


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

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

LLVM IR (-O0):
%struct.ssb_device = type opaque
define i32 @ssb_mips_irq(%struct.ssb_device* %0) {
%2 = alloca %struct.ssb_device*
store %struct.ssb_device* %0, %struct.ssb_device** %2
ret i32 0
}

LLVM IR (-O2):
%struct.ssb_device = type opaque
define i32 @ssb_mips_irq(%struct.ssb_device* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ kconsole_putc(char const);
void kconsole_puts(const char *str) {
  while ((*str) != 0) {
    kconsole_putc(*str);
    str++;
  }
  kconsole_putc('\n');
}


x86 assembly (clang, -O0):
<kconsole_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1149 <kconsole_puts+0x39>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <kconsole_putc@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <kconsole_puts+0xc>
mov    $0xa,%edi
call   1030 <kconsole_putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kconsole_puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <kconsole_puts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <kconsole_putc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <kconsole_puts+0x10>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <kconsole_putc@plt>

LLVM IR (-O0):
define void @kconsole_puts(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %8, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = call i32 @kconsole_putc(i8 signext %10)
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %2
br label %3
14: ; preds = %3
%15 = call i32 @kconsole_putc(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @kconsole_puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @kconsole_putc(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = tail call i32 @kconsole_putc(i8 signext 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ link_error();
unsigned baz(unsigned i) {
  i = i & 15;
  if (i == 0)
    return 0;
  i = 1000 - i;
  i >>= 1;
  i <<= 1;
  if (i == 0)
    link_error();
  return i;
}


x86 assembly (clang, -O0):
<baz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xf,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    113a <baz+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    116e <baz+0x5e>
mov    $0x3e8,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1168 <baz+0x58>
mov    $0x0,%al
call   1030 <link_error@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<baz>:
and    $0xf,%edi
mov    $0x3e8,%eax
sub    %edi,%eax
and    $0xfffffffe,%eax
test   %edi,%edi
cmove  %edi,%eax
ret

LLVM IR (-O0):
define i32 @baz(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = and i32 %4, 15
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %22
9: ; preds = %1
%10 = load i32, i32* %3
%11 = sub i32 1000, %10
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = lshr i32 %12, 1
store i32 %13, i32* %3
%14 = load i32, i32* %3
%15 = shl i32 %14, 1
store i32 %15, i32* %3
%16 = load i32, i32* %3
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %9
%19 = call i32 (...) @link_error()
br label %20
20: ; preds = %18, %9
%21 = load i32, i32* %3
store i32 %21, i32* %2
br label %22
22: ; preds = %20, %8
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @baz(i32 %0) {
%2 = and i32 %0, 15
%3 = icmp eq i32 %2, 0
%4 = sub nuw nsw i32 1000, %2
%5 = and i32 %4, 1022
%6 = select i1 %3, i32 0, i32 %5
ret i32 %6
}
short test_50_2(short *mem) { return __atomic_fetch_and(mem + 4, 1, 4); }


x86 assembly (clang, -O0):
<test_50_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x18(%rbp)
movw   $0x1,-0xa(%rbp)
mov    -0xa(%rbp),%cx
mov    %cx,-0x10(%rbp)
mov    0x8(%rax),%ax
mov    %ax,-0xe(%rbp)
mov    -0xe(%rbp),%ax
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%dx
mov    %dx,%si
mov    %ax,%dx
mov    %edx,-0x24(%rbp)
and    %esi,%edx
mov    %edx,-0x20(%rbp)
lock cmpxchg %dx,(%rcx)
sete   %cl
mov    %ax,-0x1a(%rbp)
test   $0x1,%cl
mov    %ax,-0xe(%rbp)
jne    1165 <test_50_2+0x65>
jmp    112d <test_50_2+0x2d>
mov    -0x1a(%rbp),%ax
mov    %ax,-0xc(%rbp)
movswl -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_50_2>:
movzwl 0x8(%rdi),%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %eax,%ecx
and    $0x1,%ecx
lock cmpxchg %cx,0x8(%rdi)
jne    1110 <test_50_2+0x10>
ret

LLVM IR (-O0):
define signext i16 @test_50_2(i16* %0) {
%2 = alloca i16*
%3 = alloca i16
%4 = alloca i16
store i16* %0, i16** %2
%5 = load i16*, i16** %2
%6 = getelementptr inbounds i16, i16* %5, i64 4
store i16 1, i16* %3
%7 = load i16, i16* %3
%8 = atomicrmw and i16* %6, i16 %7 acq_rel
store i16 %8, i16* %4
%9 = load i16, i16* %4
ret i16 %9
}

LLVM IR (-O2):
define signext i16 @test_50_2(i16* nocapture %0) {
%2 = getelementptr inbounds i16, i16* %0, i64 4
%3 = atomicrmw and i16* %2, i16 1 acq_rel
ret i16 %3
}
void dev_print(struct block_dev_desc_t *dev_desc) {}


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

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

LLVM IR (-O0):
%struct.block_dev_desc_t = type opaque
define void @dev_print(%struct.block_dev_desc_t* %0) {
%2 = alloca %struct.block_dev_desc_t*
store %struct.block_dev_desc_t* %0, %struct.block_dev_desc_t** %2
ret void
}

LLVM IR (-O2):
%struct.block_dev_desc_t = type opaque
define void @dev_print(%struct.block_dev_desc_t* nocapture %0) {
ret void
}
int isFive(int a) {
  if (a == 5)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<isFive>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jne    111d <isFive+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    1124 <isFive+0x24>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isFive>:
xor    %eax,%eax
cmp    $0x5,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @isFive(i32 %0) {
%2 = icmp eq i32 %0, 5
%3 = zext i1 %2 to i32
ret i32 %3
}