xunge/DecIR huggingface dataset:
unsigned xrop3_86_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = T | S;
  stk1 = D ^ stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_86_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_86_0_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
or     %ecx,%eax
xor    $0xff,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_86_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %7
%23 = load i32, i32* %6
%24 = or i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %5
%26 = load i32, i32* %9
%27 = xor i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
ret i32 %28
}

LLVM IR (-O2):
define i32 @xrop3_86_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = or i32 %6, %4
%8 = xor i32 %7, 255
ret i32 %8
}
/* Variables and functions */
int foo3(int);
int bar3(int x) {
  return foo3(x) + foo3(x) + foo3(x) + foo3(x) + foo3(x) + foo3(x);
}


x86 assembly (clang, -O0):
<bar3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <foo3@plt>
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <foo3@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <foo3@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <foo3@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <foo3@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <foo3@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar3>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edi,%r15d
call   1030 <foo3@plt>
mov    %eax,%r14d
mov    %r15d,%edi
call   1030 <foo3@plt>
mov    %eax,%ebp
add    %r14d,%ebp
mov    %r15d,%edi
call   1030 <foo3@plt>
mov    %eax,%ebx
add    %ebp,%ebx
mov    %r15d,%edi
call   1030 <foo3@plt>
mov    %eax,%ebp
add    %ebx,%ebp
mov    %r15d,%edi
call   1030 <foo3@plt>
mov    %eax,%ebx
add    %ebp,%ebx
mov    %r15d,%edi
call   1030 <foo3@plt>
add    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @bar3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @foo3(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @foo3(i32 %5)
%7 = add nsw i32 %4, %6
%8 = load i32, i32* %2
%9 = call i32 @foo3(i32 %8)
%10 = add nsw i32 %7, %9
%11 = load i32, i32* %2
%12 = call i32 @foo3(i32 %11)
%13 = add nsw i32 %10, %12
%14 = load i32, i32* %2
%15 = call i32 @foo3(i32 %14)
%16 = add nsw i32 %13, %15
%17 = load i32, i32* %2
%18 = call i32 @foo3(i32 %17)
%19 = add nsw i32 %16, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @bar3(i32 %0) {
%2 = tail call i32 @foo3(i32 %0)
%3 = tail call i32 @foo3(i32 %0)
%4 = add nsw i32 %3, %2
%5 = tail call i32 @foo3(i32 %0)
%6 = add nsw i32 %4, %5
%7 = tail call i32 @foo3(i32 %0)
%8 = add nsw i32 %6, %7
%9 = tail call i32 @foo3(i32 %0)
%10 = add nsw i32 %8, %9
%11 = tail call i32 @foo3(i32 %0)
%12 = add nsw i32 %10, %11
ret i32 %12
}
/* Variables and functions */
double exp(double);
double exp_pdf(double lambda, double x) {
  return (lambda * exp(-(lambda * x)));
}


x86 assembly (clang, -O0):
<exp_pdf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exp_pdf>:
sub    $0x18,%rsp
movapd %xmm0,%xmm2
movapd %xmm0,(%rsp)
movapd 0xedb(%rip),%xmm0
xorpd  %xmm2,%xmm0
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
mulsd  (%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @exp_pdf(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* %3
%7 = load double, double* %4
%8 = fmul double %6, %7
%9 = fneg double %8
%10 = call double @exp(double %9)
%11 = fmul double %5, %10
ret double %11
}

LLVM IR (-O2):
define double @exp_pdf(double %0, double %1) {
%3 = fneg double %0
%4 = fmul double %3, %1
%5 = tail call double @exp(double %4)
%6 = fmul double %5, %0
ret double %6
}
void mos_destroy_thread(void) { ; }


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

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

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

LLVM IR (-O2):
define void @mos_destroy_thread() {
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ chatServer();
int main(int argc, char **argv) {
  chatServer();
  return EXIT_SUCCESS;
}


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

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

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
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 (...) @chatServer()
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @chatServer()
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
char *gdb_read_registers() {}


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

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

LLVM IR (-O0):
define i8* @gdb_read_registers() {
%1 = alloca i8*
%2 = load i8*, i8** %1
ret i8* %2
}

LLVM IR (-O2):
define noalias i8* @gdb_read_registers() {
ret i8* undef
}
int Modulo(int Dividend, int Divisor) {
  int Remainder;
  Remainder = Dividend % Divisor;
  return Remainder;
}


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

x86 assembly (clang, -O2):
<Modulo>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @Modulo(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = srem i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @Modulo(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
ret i32 %3
}
int test_imm_6Cuint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x6C << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_6Cuint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 108
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
void I2SIntDisable(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ;
  (*((volatile unsigned long *)(0x40021000 + 0x00000070))) &= ~ui32IntFlags;
}


x86 assembly (clang, -O0):
<I2SIntDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
xor    $0xffffffffffffffff,%rax
mov    $0x40021070,%ecx
mov    (%rcx),%rcx
and    %rax,%rcx
mov    $0x40021070,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2SIntDisable>:
mov    %rdi,-0x8(%rsp)
mov    %rsi,-0x10(%rsp)
mov    -0x10(%rsp),%rax
not    %rax
and    %rax,0x40021070
40
ret

LLVM IR (-O0):
define void @I2SIntDisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = xor i64 %5, -1
%7 = load volatile i64, i64* inttoptr (i64 1073877104 to i64*)
%8 = and i64 %7, %6
store volatile i64 %8, i64* inttoptr (i64 1073877104 to i64*)
ret void
}

LLVM IR (-O2):
define void @I2SIntDisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = xor i64 %5, -1
%7 = load volatile i64, i64* inttoptr (i64 1073877104 to i64*)
%8 = and i64 %7, %6
store volatile i64 %8, i64* inttoptr (i64 1073877104 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ testHeap();
int /*<<< orphan*/ testHeap2D();
int main() {
  testHeap();
  testHeap2D();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @testHeap()
%2 = tail call i32 (...) @testHeap2D()
ret i32 0
}
void foo146(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo146(i32 %0) {
ret void
}
long math__Int__bin_or(long self, long p0) {
  long var;
  long var1;
  var1 = (self | p0);
  var = var1;
  goto RET_LABEL;
RET_LABEL:;
  return var;
}


x86 assembly (clang, -O0):
<math__Int__bin_or>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
or     -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<math__Int__bin_or>:
mov    %rdi,%rax
or     %rsi,%rax
ret

LLVM IR (-O0):
define i64 @math__Int__bin_or(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%7 = load i64, i64* %3
%8 = load i64, i64* %4
%9 = or i64 %7, %8
store i64 %9, i64* %6
%10 = load i64, i64* %6
store i64 %10, i64* %5
br label %11
11: ; preds = %2
%12 = load i64, i64* %5
ret i64 %12
}

LLVM IR (-O2):
define i64 @math__Int__bin_or(i64 %0, i64 %1) {
%3 = or i64 %1, %0
ret i64 %3
}
int mapping_has() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @mapping_has() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int romanToInt(char *);
int main() {
  printf("%d\n", romanToInt("MMXVI"));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1040 <romanToInt@plt>
mov    %eax,%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [6 x i8] c"MMXVI\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @romanToInt(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [6 x i8] c"MMXVI\00"
define i32 @main() {
%1 = tail call i32 @romanToInt(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void INT_Excep_MTU1_TCIV1(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_MTU1_TCIV1() {
ret void
}
const char *world() { return "world"; }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"world\00"
define i8* @world() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"world\00"
define i8* @world() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
uint16_t downcast_u16(uint64_t x) {
  uint16_t y = (uint16_t)x;
  printf("%d\n", y);
  return y;
}


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

x86 assembly (clang, -O2):
<downcast_u16>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @downcast_u16(i32 returned %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ test();
int real_main() {
  test();
  return 0;
}


x86 assembly (clang, -O0):
<real_main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <test@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @real_main() {
%1 = call i32 (...) @test()
ret i32 0
}

LLVM IR (-O2):
define i32 @real_main() {
%1 = tail call i32 (...) @test()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ logMessage(int, char *, char *, int);
int watchDir(int, char *);
void watchSubtree(int inotifyFd, char *path) {
  int cnt;
  cnt = watchDir(inotifyFd, path);
  logMessage(1, "    watchSubtree: %s: %d entries added\n", path, cnt);
}


x86 assembly (clang, -O0):
<watchSubtree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <watchDir@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x1,%edi
lea    0xeaf(%rip),%rsi
call   1030 <logMessage@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<watchSubtree>:
push   %rbx
mov    %rsi,%rbx
call   1040 <watchDir@plt>
lea    0xed0(%rip),%rsi
mov    $0x1,%edi
mov    %rbx,%rdx
mov    %eax,%ecx
pop    %rbx
jmp    1030 <logMessage@plt>

LLVM IR (-O0):
@.str = [40 x i8] c" watchSubtree: %s: %d entries added\0A\00"
define void @watchSubtree(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %3
%7 = load i8*, i8** %4
%8 = call i32 @watchDir(i32 %6, i8* %7)
store i32 %8, i32* %5
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = call i32 @logMessage(i32 1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %9, i32 %10)
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c" watchSubtree: %s: %d entries added\0A\00"
define void @watchSubtree(i32 %0, i8* %1) {
%3 = tail call i32 @watchDir(i32 %0, i8* %1)
%4 = tail call i32 @logMessage(i32 1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_cmpord_ss(int /*<<< orphan*/, int /*<<< orphan*/);
__m128 test_mm_cmpord_ss(__m128 __a, __m128 __b) {
  return _mm_cmpord_ss(__a, __b);
}


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

x86 assembly (clang, -O2):
<test_mm_cmpord_ss>:
jmp    1030 <_mm_cmpord_ss@plt>

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

LLVM IR (-O2):
define i32 @test_mm_cmpord_ss(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cmpord_ss(i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ write_named_array_f64(int /*<<< orphan*/ *, char *,
                                         double const *, unsigned int const);
void write_data_as_json_f64(FILE *f, const double *y, const unsigned int len) {
  fprintf(f, "{");
  write_named_array_f64(f, "expected", y, len);
  fprintf(f, "}");
}


x86 assembly (clang, -O0):
<write_data_as_json_f64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec2(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    0xead(%rip),%rsi
call   1040 <write_named_array_f64@plt>
mov    -0x8(%rbp),%rdi
lea    0xea6(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_data_as_json_f64>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
mov    $0x7b,%edi
mov    %rbp,%rsi
call   1030 <fputc@plt>
lea    0xebf(%rip),%rsi
mov    %rbp,%rdi
mov    %rbx,%rdx
mov    %r14d,%ecx
call   1040 <write_named_array_f64@plt>
mov    $0x7d,%edi
mov    %rbp,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <fputc@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"{\00"
@.str.1 = [9 x i8] c"expected\00"
@.str.2 = [2 x i8] c"}\00"
define void @write_data_as_json_f64(i32* %0, double* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca double*
%6 = alloca i32
store i32* %0, i32** %4
store double* %1, double** %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = load i32*, i32** %4
%10 = load double*, double** %5
%11 = load i32, i32* %6
%12 = call i32 @write_named_array_f64(i32* %9, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), double* %10, i32 %11)
%13 = load i32*, i32** %4
%14 = call i32 @fprintf(i32* %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [9 x i8] c"expected\00"
define void @write_data_as_json_f64(i32* %0, double* %1, i32 %2) {
%4 = tail call i32 @fputc(i32 123, i32* %0)
%5 = tail call i32 @write_named_array_f64(i32* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), double* %1, i32 %2)
%6 = tail call i32 @fputc(i32 125, i32* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int getpeereid(int sock, uid_t *euid, gid_t *egid) { return -1; }


x86 assembly (clang, -O0):
<getpeereid>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @getpeereid(i32 %0, i32* nocapture readnone %1, i32* nocapture readnone %2) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ SIG_IGN;
scalar_t__ __SIGRTMIN;
int /*<<< orphan*/ signal(scalar_t__, int /*<<< orphan*/);
void linux_init_signals() { signal(__SIGRTMIN + 1, SIG_IGN); }


x86 assembly (clang, -O0):
<linux_init_signals>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%rdi
add    $0x1,%rdi
mov    0x2eb7(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<linux_init_signals>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%rdi
add    $0x1,%rdi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
jmp    1030 <signal@plt>

LLVM IR (-O0):
@__SIGRTMIN = global i64 0
@SIG_IGN = global i32 0
define void @linux_init_signals() {
%1 = load i64, i64* @__SIGRTMIN
%2 = add nsw i64 %1, 1
%3 = load i32, i32* @SIG_IGN
%4 = call i32 @signal(i64 %2, i32 %3)
ret void
}

LLVM IR (-O2):
@__SIGRTMIN = global i64 0
@SIG_IGN = global i32 0
define void @linux_init_signals() {
%1 = load i64, i64* @__SIGRTMIN
%2 = add nsw i64 %1, 1
%3 = load i32, i32* @SIG_IGN
%4 = tail call i32 @signal(i64 %2, i32 %3)
ret void
}
/* Variables and functions */
int EOF;
int getchar();
void clear_stdin(void) {
  int c;
  while ((c = getchar()) != '\n' && c != EOF)
    ;
}


x86 assembly (clang, -O0):
<clear_stdin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,%ecx
mov    %ecx,-0x4(%rbp)
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x5(%rbp)
je     1144 <clear_stdin+0x34>
mov    -0x4(%rbp),%eax
mov    0x2eac(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    1154 <clear_stdin+0x44>
jmp    1159 <clear_stdin+0x49>
jmp    1118 <clear_stdin+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_stdin>:
push   %rbx
mov    0x2ed0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%eax
je     1130 <clear_stdin+0x20>
cmp    (%rbx),%eax
jne    1120 <clear_stdin+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define void @clear_stdin() {
%1 = alloca i32
br label %2
2: ; preds = %11, %0
%3 = call i32 (...) @getchar()
store i32 %3, i32* %1
%4 = icmp ne i32 %3, 10
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* %1
%7 = load i32, i32* @EOF
%8 = icmp ne i32 %6, %7
br label %9
9: ; preds = %5, %2
%10 = phi i1 [ false, %2 ], [ %8, %5 ]
br i1 %10, label %11, label %12
11: ; preds = %9
br label %2
12: ; preds = %9
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
define void @clear_stdin() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @getchar()
%3 = icmp ne i32 %2, 10
%4 = load i32, i32* @EOF
%5 = icmp ne i32 %2, %4
%6 = select i1 %3, i1 %5, i1 false
br i1 %6, label %1, label %7
7: ; preds = %1
ret void
}
int mask_lsb(int x, int y) { return (x & 0xFF) | (y & ~0xFF); }


x86 assembly (clang, -O0):
<mask_lsb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    -0x8(%rbp),%ecx
and    $0xffffff00,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mask_lsb>:
movzbl %dil,%eax
and    $0xffffff00,%esi
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @mask_lsb(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = and i32 %5, 255
%7 = load i32, i32* %4
%8 = and i32 %7, -256
%9 = or i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @mask_lsb(i32 %0, i32 %1) {
%3 = and i32 %0, 255
%4 = and i32 %1, -256
%5 = or i32 %4, %3
ret i32 %5
}
void GoogleHotwordDspReset(void) {}


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

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

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

LLVM IR (-O2):
define void @GoogleHotwordDspReset() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int32_t;

/* Variables and functions */
int /*<<< orphan*/ mrand48();
u_int32_t magic() { return (u_int32_t)mrand48(); }


x86 assembly (clang, -O0):
<magic>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <mrand48@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<magic>:
xor    %eax,%eax
jmp    1030 <mrand48@plt>

LLVM IR (-O0):
define i32 @magic() {
%1 = call i32 (...) @mrand48()
ret i32 %1
}

LLVM IR (-O2):
define i32 @magic() {
%1 = tail call i32 (...) @mrand48()
ret i32 %1
}
double bits_to_mul(const int bits) { return (double)((1ULL << bits) - 1); }


x86 assembly (clang, -O0):
<bits_to_mul>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%cl
mov    $0x1,%eax
shl    %cl,%rax
add    $0xffffffffffffffff,%rax
movq   %rax,%xmm0
movaps 0xede(%rip),%xmm1
punpckldq %xmm1,%xmm0
movapd 0xee2(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<bits_to_mul>:
mov    %edi,%ecx
mov    $0xffffffffffffffff,%rax
shl    %cl,%rax
not    %rax
movq   %rax,%xmm1
punpckldq 0xee4(%rip),%xmm1
subpd  0xeec(%rip),%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @bits_to_mul(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = shl i64 1, %4
%6 = sub i64 %5, 1
%7 = uitofp i64 %6 to double
ret double %7
}

LLVM IR (-O2):
define double @bits_to_mul(i32 %0) {
%2 = zext i32 %0 to i64
%3 = shl nsw i64 -1, %2
%4 = xor i64 %3, -1
%5 = uitofp i64 %4 to double
ret double %5
}
unsigned char *add_zero_padding(unsigned char *pkt_buf, unsigned char *ptr) {
  while ((ptr - pkt_buf) % 4 != 0) {
    *ptr++ = 0;
  }
  return ptr;
}


x86 assembly (clang, -O0):
<add_zero_padding>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    $0x4,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
je     1142 <add_zero_padding+0x42>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x0,(%rax)
jmp    110c <add_zero_padding+0xc>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_zero_padding>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %r14d,%eax
sub    %ebx,%eax
test   $0x3,%al
je     1142 <add_zero_padding+0x32>
mov    %r14d,%eax
not    %eax
add    %eax,%ebx
and    $0x3,%ebx
lea    0x1(%rbx),%rdx
mov    %r14,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
add    %rbx,%r14
add    $0x1,%r14
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @add_zero_padding(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %13, %2
%6 = load i8*, i8** %4
%7 = load i8*, i8** %3
%8 = ptrtoint i8* %6 to i64
%9 = ptrtoint i8* %7 to i64
%10 = sub i64 %8, %9
%11 = srem i64 %10, 4
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %5
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %4
store i8 0, i8* %14
br label %5
16: ; preds = %5
%17 = load i8*, i8** %4
ret i8* %17
}

LLVM IR (-O2):
define i8* @add_zero_padding(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = ptrtoint i8* %1 to i64
%5 = sub i64 %4, %3
%6 = and i64 %5, 3
%7 = icmp eq i64 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %2
%9 = xor i64 %4, -1
%10 = add i64 %9, %3
%11 = and i64 %10, 3
%12 = add nuw nsw i64 %11, 1
%13 = getelementptr i8, i8* %1, i64 %12
br label %14
14: ; preds = %8, %2
%15 = phi i8* [ %1, %2 ], [ %13, %8 ]
ret i8* %15
}
/* Variables and functions */
int /*<<< orphan*/ OveroSyncStatsHandle();
int /*<<< orphan*/ UAVObjLogging(int /*<<< orphan*/);
void OveroSyncStatsLogging() { UAVObjLogging(OveroSyncStatsHandle()); }


x86 assembly (clang, -O0):
<OveroSyncStatsLogging>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <OveroSyncStatsHandle@plt>
mov    %eax,%edi
call   1030 <UAVObjLogging@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<OveroSyncStatsLogging>:
push   %rax
xor    %eax,%eax
call   1040 <OveroSyncStatsHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <UAVObjLogging@plt>

LLVM IR (-O0):
define void @OveroSyncStatsLogging() {
%1 = call i32 (...) @OveroSyncStatsHandle()
%2 = call i32 @UAVObjLogging(i32 %1)
ret void
}

LLVM IR (-O2):
define void @OveroSyncStatsLogging() {
%1 = tail call i32 (...) @OveroSyncStatsHandle()
%2 = tail call i32 @UAVObjLogging(i32 %1)
ret void
}
void dsb(void) {}


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

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

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

LLVM IR (-O2):
define void @dsb() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ die(char *, size_t);
void *realloc(void *, size_t);
void *kl_realloc(void *ptr, size_t size) {
  ptr = realloc(ptr, size);
  if (!ptr) {
    die("Out of memory! (Tried to realloc %u)", size);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<kl_realloc>:
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 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    115c <kl_realloc+0x3c>
mov    -0x10(%rbp),%rsi
lea    0xea9(%rip),%rdi
call   1040 <die@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kl_realloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1030 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <kl_realloc+0x23>
lea    0xec5(%rip),%rdi
mov    %r14,%rsi
call   1040 <die@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [37 x i8] c"Out of memory! (Tried to realloc %u)\00"
define i8* @kl_realloc(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 i8* @realloc(i8* %5, i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = icmp ne i8* %8, null
br i1 %9, label %13, label %10
10: ; preds = %2
%11 = load i64, i64* %4
%12 = call i32 @die(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i64 %11)
br label %13
13: ; preds = %10, %2
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@.str = [37 x i8] c"Out of memory! (Tried to realloc %u)\00"
define noalias i8* @kl_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @die(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i64 %1)
br label %7
7: ; preds = %5, %2
ret i8* %3
}
void remove_newline(char **head) {
again:
  if (**head == '\n') {
    *head = *head + 1;
    goto again;
  }
}


x86 assembly (clang, -O0):
<remove_newline>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1132 <remove_newline+0x32>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
jmp    1108 <remove_newline+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_newline>:
mov    (%rdi),%rax
cmpb   $0xa,(%rax)
jne    111c <remove_newline+0x1c>
add    $0x1,%rax
nopl   0x0(%rax)
mov    %rax,(%rdi)
cmpb   $0xa,(%rax)
lea    0x1(%rax),%rax
je     1110 <remove_newline+0x10>
ret

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

LLVM IR (-O2):
define void @remove_newline(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 10
br i1 %4, label %5, label %10
5: ; preds = %1, %5
%6 = phi i8* [ %7, %5 ], [ %2, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
store i8* %7, i8** %0
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 10
br i1 %9, label %5, label %10
10: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bfalgo(char *, int, int, int, int, int, int, int);
void or2(int x, int y, int z) {
  bfalgo("$[-]$[$+$-]$[[-]$+$]", z, x, y, x, y, z, y);
}


x86 assembly (clang, -O0):
<or2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%r8d
mov    -0x8(%rbp),%r9d
mov    -0xc(%rbp),%r10d
mov    -0x8(%rbp),%eax
lea    0xec0(%rip),%rdi
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <bfalgo@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<or2>:
push   %rax
mov    %edx,%eax
mov    %esi,%ecx
mov    %edi,%edx
lea    0xee2(%rip),%rdi
mov    %eax,%esi
mov    %edx,%r8d
mov    %ecx,%r9d
push   %rcx
push   %rax
call   1030 <bfalgo@plt>
add    $0x10,%rsp
pop    %rax
ret

LLVM IR (-O0):
@.str = [21 x i8] c"$[-]$[$+$-]$[[-]$+$]\00"
define void @or2(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = load i32, i32* %5
%14 = call i32 @bfalgo(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8, i32 %9, i32 %10, i32 %11, i32 %12, i32 %13)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"$[-]$[$+$-]$[[-]$+$]\00"
define void @or2(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @bfalgo(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %0, i32 %1, i32 %0, i32 %1, i32 %2, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_char;

/* Variables and functions */
int /*<<< orphan*/ isdigit(int /*<<< orphan*/);
int isnumberstr(const char *string) {
  while (*string) {
    if (!isdigit((u_char)(*string++)))
      return (0);
  }
  return (1);
}


x86 assembly (clang, -O0):
<isnumberstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115a <isnumberstr+0x4a>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    1155 <isnumberstr+0x45>
movl   $0x0,-0x4(%rbp)
jmp    1161 <isnumberstr+0x51>
jmp    111c <isnumberstr+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isnumberstr>:
movsbl (%rdi),%eax
test   %eax,%eax
je     1116 <isnumberstr+0x16>
add    $0x1,%rdi
add    $0xffffffd0,%eax
cmp    $0xa,%eax
jb     1100 <isnumberstr>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @isnumberstr(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
%8 = sext i8 %4 to i32
%9 = add nsw i32 %8, -48
%10 = icmp ult i32 %9, 10
br i1 %10, label %2, label %11
11: ; preds = %2, %6
%12 = phi i32 [ 0, %6 ], [ 1, %2 ]
ret i32 %12
}
int test_imm_EBuint8_reg(unsigned char val) {
  return ((val) & (0xEB << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_EBuint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xeb,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_EBuint8_reg>:
test   $0xeb,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_EBuint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -21
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ indent();
int /*<<< orphan*/ stdout;
void CL(const char *s) {
  indent();
  fputs(s, stdout);
}


x86 assembly (clang, -O0):
<CL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <indent@plt>
mov    -0x8(%rbp),%rdi
mov    0x2ea2(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CL>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <indent@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @CL(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @indent()
%4 = load i8*, i8** %2
%5 = load i32, i32* @stdout
%6 = call i32 @fputs(i8* %4, i32 %5)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @CL(i8* %0) {
%2 = tail call i32 (...) @indent()
%3 = load i32, i32* @stdout
%4 = tail call i32 @fputs(i8* %0, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isodigit(int);
void t_isodigit_0x35() {
  Assert_real((isodigit(53)),
              "/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_isodigit.c",
              270, ("isodigit should be 1 for 5"));
}


x86 assembly (clang, -O0):
<t_isodigit_0x35>:
push   %rbp
mov    %rsp,%rbp
mov    $0x35,%edi
call   1040 <isodigit@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x10e,%edx
lea    0xf66(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isodigit_0x35>:
push   %rax
mov    $0x35,%edi
call   1040 <isodigit@plt>
lea    0xece(%rip),%rsi
lea    0xf70(%rip),%rcx
mov    %eax,%edi
mov    $0x10e,%edx
pop    %rax
jmp    1030 <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_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 1 for 5\00"
define void @t_isodigit_0x35() {
%1 = call i32 @isodigit(i32 53)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 270, i8* getelementptr inbounds ([27 x i8], [27 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_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 1 for 5\00"
define void @t_isodigit_0x35() {
%1 = tail call i32 @isodigit(i32 53)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 270, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
void *mbuff_alloc_at(char const *, int, int /*<<< orphan*/ *);
void *mbuff_alloc(const char *name, int size) {
  return mbuff_alloc_at(name, size, NULL);
}


x86 assembly (clang, -O0):
<mbuff_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <mbuff_alloc_at@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mbuff_alloc>:
xor    %edx,%edx
jmp    1030 <mbuff_alloc_at@plt>

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

LLVM IR (-O2):
define i8* @mbuff_alloc(i8* %0, i32 %1) {
%3 = tail call i8* @mbuff_alloc_at(i8* %0, i32 %1, i32* null)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("hello world!\n");
  return 1;
}


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"hello world!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
char *gmk_alloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
__attribute__((always_)) char *bool_to_str(bool res) {
  char *str;
  if (res) {
    str = gmk_alloc(sizeof("true") - 1);
    strcpy(str, "true");
    return str;
  }
  str = gmk_alloc(sizeof("false") - 1);
  strcpy(str, "false");
  return str;
}


x86 assembly (clang, -O0):
<bool_to_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1160 <bool_to_str+0x40>
mov    $0x4,%edi
call   1040 <gmk_alloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xeb2(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1186 <bool_to_str+0x66>
mov    $0x5,%edi
call   1040 <gmk_alloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xe8c(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bool_to_str>:
push   %rbx
test   %edi,%edi
je     113b <bool_to_str+0x1b>
mov    $0x4,%edi
call   1040 <gmk_alloc@plt>
mov    %rax,%rbx
lea    0xec7(%rip),%rsi
jmp    114f <bool_to_str+0x2f>
mov    $0x5,%edi
call   1040 <gmk_alloc@plt>
mov    %rax,%rbx
lea    0xeb6(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"true\00"
@.str.1 = [6 x i8] c"false\00"
define i8* @bool_to_str(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = call i8* @gmk_alloc(i32 4)
store i8* %8, i8** %4
%9 = load i8*, i8** %4
%10 = call i32 @strcpy(i8* %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%11 = load i8*, i8** %4
store i8* %11, i8** %2
br label %17
12: ; preds = %1
%13 = call i8* @gmk_alloc(i32 5)
store i8* %13, i8** %4
%14 = load i8*, i8** %4
%15 = call i32 @strcpy(i8* %14, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%16 = load i8*, i8** %4
store i8* %16, i8** %2
br label %17
17: ; preds = %12, %7
%18 = load i8*, i8** %2
ret i8* %18
}

LLVM IR (-O2):
@.str = [5 x i8] c"true\00"
@.str.1 = [6 x i8] c"false\00"
define i8* @bool_to_str(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i8* @gmk_alloc(i32 4)
%5 = tail call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %9
6: ; preds = %1
%7 = tail call i8* @gmk_alloc(i32 5)
%8 = tail call i32 @strcpy(i8* %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %6, %3
%10 = phi i8* [ %4, %3 ], [ %7, %6 ]
ret i8* %10
}