xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned int strtoul(char *, char **, int);
unsigned int checknumber(char *string) {
  char *p;
  unsigned int num;
  num = strtoul(string, &p, 10);
  if (*p != 0)
    return (0);
  return (num);
}


x86 assembly (clang, -O0):
<checknumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtoul@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114d <checknumber+0x3d>
movl   $0x0,-0x4(%rbp)
jmp    1153 <checknumber+0x43>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checknumber>:
push   %rax
mov    %rsp,%rsi
mov    $0xa,%edx
call   1030 <strtoul@plt>
mov    (%rsp),%rcx
xor    %edx,%edx
cmpb   $0x0,(%rcx)
cmovne %edx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @checknumber(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i32 @strtoul(i8* %0, i8** %2, i32 10)
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = select i1 %7, i32 %4, i32 0
ret i32 %8
}
float s(unsigned long long k) {
  float x;
  x = (float)k;
  return x;
}


x86 assembly (clang, -O0):

:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
shr    %rdx
mov    %eax,%ecx
and    $0x1,%ecx
or     %rdx,%rcx
cvtsi2ss %rcx,%xmm0
addss  %xmm0,%xmm0
cvtsi2ss %rax,%xmm1
movss  %xmm1,-0x14(%rbp)
test   %rax,%rax
movss  %xmm0,-0x10(%rbp)
js     1145 <s+0x45>
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):

:
test   %rdi,%rdi
js     110b <s+0xb>
cvtsi2ss %rdi,%xmm0
ret
mov    %rdi,%rax
shr    %rax
and    $0x1,%edi
or     %rax,%rdi
cvtsi2ss %rdi,%xmm0
addss  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @s(i64 %0) {
%2 = alloca i64
%3 = alloca float
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = uitofp i64 %4 to float
store float %5, float* %3
%6 = load float, float* %3
ret float %6
}

LLVM IR (-O2):
define float @s(i64 %0) {
%2 = uitofp i64 %0 to float
ret float %2
}
void HardFault_Handler(void) { fault_info(__FUNCTION__, sizeof(__FUNCTION__)); }


x86 assembly (clang, -O0):
<HardFault_Handler>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x12,%esi
mov    $0x0,%al
call   1030 <fault_info@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HardFault_Handler>:
lea    0xee9(%rip),%rdi
mov    $0x12,%esi
xor    %eax,%eax
jmp    1030 <fault_info@plt>

LLVM IR (-O0):
@__FUNCTION__.HardFault_Handler = [18 x i8] c"HardFault_Handler\00"
define void @HardFault_Handler() {
%1 = call i32 (i8*, i64, ...) bitcast (i32 (...)* @fault_info to i32 (i8*, i64, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__FUNCTION__.HardFault_Handler, i64 0, i64 0), i64 18)
ret void
}

LLVM IR (-O2):
@__FUNCTION__.HardFault_Handler = [18 x i8] c"HardFault_Handler\00"
define void @HardFault_Handler() {
%1 = tail call i32 (i8*, i64, ...) bitcast (i32 (...)* @fault_info to i32 (i8*, i64, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__FUNCTION__.HardFault_Handler, i64 0, i64 0), i64 18)
ret void
}
__attribute__((always_, unused)) void ips_mb() {
  asm volatile("mfence" : : : "memory");
}


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

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

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

LLVM IR (-O2):
define void @ips_mb() {
tail call void asm sideeffect "mfence", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
void f(int x) {
  if (x) {
  };
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1116 <f+0x16>
jmp    1116 <f+0x16>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @f(i32 %0) {
ret void
}
void REMR3EmulateInstruction(void) {}


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

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

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

LLVM IR (-O2):
define void @REMR3EmulateInstruction() {
ret void
}
double CodonOmegaDFunc_Trad(int i, int j, int gencode, double omega) {
  return 1.;
}


x86 assembly (clang, -O0):
<CodonOmegaDFunc_Trad>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  0xee6(%rip),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @CodonOmegaDFunc_Trad(i32 %0, i32 %1, i32 %2, double %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca double
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store double %3, double* %8
ret double 1.000000e+00
}

LLVM IR (-O2):
define double @CodonOmegaDFunc_Trad(i32 %0, i32 %1, i32 %2, double %3) {
ret double 1.000000e+00
}
int x(double i) { return (i - 2.0) > i; }


x86 assembly (clang, -O0):
<x>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
subsd  %xmm1,%xmm0
ucomisd -0x8(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<x>:
movsd  0xef8(%rip),%xmm1
addsd  %xmm0,%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
ret

LLVM IR (-O0):
define i32 @x(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double %3, 2.000000e+00
%5 = load double, double* %2
%6 = fcmp ogt double %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @x(double %0) {
%2 = fadd double %0, -2.000000e+00
%3 = fcmp ogt double %2, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
int double_cmp(double x1, double x2) {
  if (x1 < x2) {
    return -1;
  } else if (x1 > x2) {
    return +1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<double_cmp>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    112e <double_cmp+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1151 <double_cmp+0x51>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    114a <double_cmp+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1151 <double_cmp+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_cmp>:
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @double_cmp(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = fcmp ogt double %0, %1
%5 = zext i1 %4 to i32
%6 = select i1 %3, i32 -1, i32 %5
ret i32 %6
}
void __printEvent(const char *msg) {}


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

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

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

LLVM IR (-O2):
define void @__printEvent(i8* nocapture %0) {
ret void
}
void int32_to_hex(int data, unsigned char datahex[4]) {
  union _int32hex {
    int data;
    unsigned char datahex[4];
  } int32hex;
  int32hex.data = data;
  datahex[0] = int32hex.datahex[0];
  datahex[1] = int32hex.datahex[1];
  datahex[2] = int32hex.datahex[2];
  datahex[3] = int32hex.datahex[3];
}


x86 assembly (clang, -O0):
<int32_to_hex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x17(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x16(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x15(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<int32_to_hex>:
mov    %edi,(%rsi)
ret

LLVM IR (-O0):
%union._int32hex = type { i32 }
define void @int32_to_hex(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca %union._int32hex
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %3
%7 = bitcast %union._int32hex* %5 to i32*
store i32 %6, i32* %7
%8 = bitcast %union._int32hex* %5 to [4 x i8]*
%9 = getelementptr inbounds [4 x i8], [4 x i8]* %8, i64 0, i64 0
%10 = load i8, i8* %9
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i64 0
store i8 %10, i8* %12
%13 = bitcast %union._int32hex* %5 to [4 x i8]*
%14 = getelementptr inbounds [4 x i8], [4 x i8]* %13, i64 0, i64 1
%15 = load i8, i8* %14
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i64 1
store i8 %15, i8* %17
%18 = bitcast %union._int32hex* %5 to [4 x i8]*
%19 = getelementptr inbounds [4 x i8], [4 x i8]* %18, i64 0, i64 2
%20 = load i8, i8* %19
%21 = load i8*, i8** %4
%22 = getelementptr inbounds i8, i8* %21, i64 2
store i8 %20, i8* %22
%23 = bitcast %union._int32hex* %5 to [4 x i8]*
%24 = getelementptr inbounds [4 x i8], [4 x i8]* %23, i64 0, i64 3
%25 = load i8, i8* %24
%26 = load i8*, i8** %4
%27 = getelementptr inbounds i8, i8* %26, i64 3
store i8 %25, i8* %27
ret void
}

LLVM IR (-O2):
define void @int32_to_hex(i32 %0, i8* nocapture writeonly %1) {
%3 = trunc i32 %0 to i8
%4 = lshr i32 %0, 8
%5 = trunc i32 %4 to i8
%6 = lshr i32 %0, 16
%7 = trunc i32 %6 to i8
%8 = lshr i32 %0, 24
%9 = trunc i32 %8 to i8
store i8 %3, i8* %1
%10 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %5, i8* %10
%11 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %7, i8* %11
%12 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %9, i8* %12
ret void
}
int Minimum(int a, int b, int c) {
  return a > b ? a : b > c ? a > b ? a : b : c;
}


x86 assembly (clang, -O0):
<Minimum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1124 <Minimum+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1164 <Minimum+0x64>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1158 <Minimum+0x58>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1147 <Minimum+0x47>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    114d <Minimum+0x4d>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    115e <Minimum+0x5e>
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Minimum>:
mov    %edx,%eax
cmp    %edx,%esi
cmovg  %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @Minimum(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* %4
%8 = load i32, i32* %5
%9 = icmp sgt i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load i32, i32* %4
br label %30
12: ; preds = %3
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = icmp sgt i32 %13, %14
br i1 %15, label %16, label %26
16: ; preds = %12
%17 = load i32, i32* %4
%18 = load i32, i32* %5
%19 = icmp sgt i32 %17, %18
br i1 %19, label %20, label %22
20: ; preds = %16
%21 = load i32, i32* %4
br label %24
22: ; preds = %16
%23 = load i32, i32* %5
br label %24
24: ; preds = %22, %20
%25 = phi i32 [ %21, %20 ], [ %23, %22 ]
br label %28
26: ; preds = %12
%27 = load i32, i32* %6
br label %28
28: ; preds = %26, %24
%29 = phi i32 [ %25, %24 ], [ %27, %26 ]
br label %30
30: ; preds = %28, %10
%31 = phi i32 [ %11, %10 ], [ %29, %28 ]
ret i32 %31
}

LLVM IR (-O2):
define i32 @Minimum(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, %1
%5 = icmp sgt i32 %1, %2
%6 = select i1 %5, i32 %1, i32 %2
%7 = select i1 %4, i32 %0, i32 %6
ret i32 %7
}
int test_imm_E9int32_mem(int *val) {
  return ((*val) & (0xE9 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_E9int32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 233
%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_E9int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 233
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct clad_test {
  int dummy;
};

/* Variables and functions */
struct clad_test *clad_test_assert(struct clad_test *, int, char *, long, long,
                                   char const *);
struct clad_test *clad_test_longeq(struct clad_test *test, long i1, long i2,
                                   const char *explain) {
  return clad_test_assert(test, i1 == i2,
                          "Integers should be equal: %ld %ld; %s ", i1, i2,
                          explain);
}


x86 assembly (clang, -O0):
<clad_test_longeq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%esi
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
lea    0xeb1(%rip),%rdx
call   1030 <clad_test_assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clad_test_longeq>:
mov    %rcx,%r9
mov    %rdx,%r8
mov    %rsi,%rcx
xor    %esi,%esi
cmp    %rdx,%rcx
sete   %sil
lea    0xed7(%rip),%rdx
jmp    1030 <clad_test_assert@plt>

LLVM IR (-O0):
%struct.clad_test = type { i32 }
@.str = [39 x i8] c"Integers should be equal: %ld %ld; %s \00"
define %struct.clad_test* @clad_test_longeq(%struct.clad_test* %0, i64 %1, i64 %2, i8* %3) {
%5 = alloca %struct.clad_test*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i8*
store %struct.clad_test* %0, %struct.clad_test** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i8* %3, i8** %8
%9 = load %struct.clad_test*, %struct.clad_test** %5
%10 = load i64, i64* %6
%11 = load i64, i64* %7
%12 = icmp eq i64 %10, %11
%13 = zext i1 %12 to i32
%14 = load i64, i64* %6
%15 = load i64, i64* %7
%16 = load i8*, i8** %8
%17 = call %struct.clad_test* @clad_test_assert(%struct.clad_test* %9, i32 %13, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i64 %14, i64 %15, i8* %16)
ret %struct.clad_test* %17
}

LLVM IR (-O2):
%struct.clad_test = type { i32 }
@.str = [39 x i8] c"Integers should be equal: %ld %ld; %s \00"
define %struct.clad_test* @clad_test_longeq(%struct.clad_test* %0, i64 %1, i64 %2, i8* %3) {
%5 = icmp eq i64 %1, %2
%6 = zext i1 %5 to i32
%7 = tail call %struct.clad_test* @clad_test_assert(%struct.clad_test* %0, i32 %6, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i64 %1, i64 %2, i8* %3)
ret %struct.clad_test* %7
}
void mdp4_overlay2_done_wfd(struct mdp_dma_data *dma) {}


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

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

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

LLVM IR (-O2):
%struct.mdp_dma_data = type opaque
define void @mdp4_overlay2_done_wfd(%struct.mdp_dma_data* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  long v = 0x04030201;
  if (*((unsigned char *)(&v)) == 0x04)
    printf("L_BIG_ENDIAN\n");
  else
    printf("L_LITTLE_ENDIAN\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x4030201,-0x10(%rbp)
04
movzbl -0x10(%rbp),%eax
cmp    $0x4,%eax
jne    1145 <main+0x35>
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
jmp    1151 <main+0x41>
lea    0xec2(%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 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"L_BIG_ENDIAN\0A\00"
@.str.1 = [17 x i8] c"L_LITTLE_ENDIAN\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
store i64 67305985, i64* %2
%3 = bitcast i64* %2 to i8*
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp eq i32 %5, 4
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
ret i32 0
}

LLVM IR (-O2):
@str = [16 x i8] c"L_LITTLE_ENDIAN\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int stringLength(const char *string) {
  const char *cptr = string;
  while (*cptr)
    ++cptr;
  return cptr - string;
}


x86 assembly (clang, -O0):
<stringLength>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     112e <stringLength+0x2e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <stringLength+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringLength>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <stringLength+0x10>
ret

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

LLVM IR (-O2):
define i32 @stringLength(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void http_charset_convert_free(char *data) {
  if (data)
    free(data);
}


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

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

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

LLVM IR (-O2):
define void @http_charset_convert_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ native_function();
int main(int argc, char **argv) { native_function(); }


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @native_function()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ mqd_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int mq_receive(int /*<<< orphan*/, char *, int, int /*<<< orphan*/ *);
void receive(mqd_t mq, char *msg) {
  if (mq_receive(mq, msg, 8192, NULL) == -1) {
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<receive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x2000,%edx
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <mq_receive@plt>
cmp    $0xffffffff,%eax
jne    115b <receive+0x3b>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<receive>:
push   %rax
mov    $0x2000,%edx
xor    %ecx,%ecx
call   1030 <mq_receive@plt>
cmp    $0xffffffff,%eax
je     1134 <receive+0x14>
pop    %rax
ret
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @receive(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = call i32 @mq_receive(i32 %5, i8* %6, i32 8192, i32* null)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i32, i32* @EXIT_FAILURE
%11 = call i32 @exit(i32 %10)
unreachable
12: ; preds = %2
ret void
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @receive(i32 %0, i8* %1) {
%3 = tail call i32 @mq_receive(i32 %0, i8* %1, i32 8192, i32* null)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %2
ret void
}
/* Type definitions */
typedef int __m128i;

/* Variables and functions */
__m128i Ch(__m128i b, __m128i c, __m128i d) { return (b & c) ^ (~b & d); }


x86 assembly (clang, -O0):
<Ch>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
xor    $0xffffffff,%ecx
and    -0xc(%rbp),%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Ch>:
mov    %esi,%eax
xor    %edx,%eax
and    %edi,%eax
xor    %edx,%eax
ret

LLVM IR (-O0):
define i32 @Ch(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* %4
%8 = load i32, i32* %5
%9 = and i32 %7, %8
%10 = load i32, i32* %4
%11 = xor i32 %10, -1
%12 = load i32, i32* %6
%13 = and i32 %11, %12
%14 = xor i32 %9, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @Ch(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %1, %0
%5 = xor i32 %0, -1
%6 = and i32 %5, %2
%7 = or i32 %6, %4
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ cm_print_error(char *, unsigned long const,
                                  unsigned long const);
int values_equal_display_error(const unsigned long int left,
                               const unsigned long int right) {
  const int equal = left == right;
  if (!equal) {
    cm_print_error("%#lx"
                   " != "
                   "%#lx"
                   "\n",
                   left, right);
  }
  return equal;
}


x86 assembly (clang, -O0):
<values_equal_display_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1151 <values_equal_display_error+0x41>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xeb4(%rip),%rdi
call   1030 <cm_print_error@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<values_equal_display_error>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
cmp    %rsi,%rdi
je     1131 <values_equal_display_error+0x21>
lea    0xeda(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <cm_print_error@plt>
xor    %eax,%eax
cmp    %r14,%rbx
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"%#lx != %#lx\0A\00"
define i32 @values_equal_display_error(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, %1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @cm_print_error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i64 %0, i64 %1)
br label %6
6: ; preds = %4, %2
%7 = zext i1 %3 to i32
ret i32 %7
}
/* Type definitions */
struct ini_config {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct ini_config *);
int /*<<< orphan*/ ini_config_clean(struct ini_config *);
void ini_config_free(struct ini_config *conf) {
  if (NULL == conf) {
    return;
  }
  ini_config_clean(conf);
  free(conf);
}


x86 assembly (clang, -O0):
<ini_config_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
jne    113d <ini_config_free+0x1d>
jmp    114f <ini_config_free+0x2f>
mov    -0x8(%rbp),%rdi
call   1040 <ini_config_clean@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ini_config_free>:
test   %rdi,%rdi
je     1137 <ini_config_free+0x17>
push   %rbx
mov    %rdi,%rbx
call   1040 <ini_config_clean@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
%struct.ini_config = type { i32 }
define void @ini_config_free(%struct.ini_config* %0) {
%2 = icmp eq %struct.ini_config* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @ini_config_clean(%struct.ini_config* %0)
%5 = tail call i32 @free(%struct.ini_config* %0)
br label %6
6: ; preds = %1, %3
ret void
}
int test_imm_44int32_reg(int val) { return ((val) & (0x44 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_44int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x44,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_44int32_reg(i32 %0) {
%2 = and i32 %0, 68
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void NoPatternInit(struct PatternGen_Params *P, struct PatternGen_Settings *S,
                   struct PatternGen_Target *T) {}


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

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

LLVM IR (-O0):
%struct.PatternGen_Params = type opaque
%struct.PatternGen_Settings = type opaque
%struct.PatternGen_Target = type opaque
define void @NoPatternInit(%struct.PatternGen_Params* %0, %struct.PatternGen_Settings* %1, %struct.PatternGen_Target* %2) {
%4 = alloca %struct.PatternGen_Params*
%5 = alloca %struct.PatternGen_Settings*
%6 = alloca %struct.PatternGen_Target*
store %struct.PatternGen_Params* %0, %struct.PatternGen_Params** %4
store %struct.PatternGen_Settings* %1, %struct.PatternGen_Settings** %5
store %struct.PatternGen_Target* %2, %struct.PatternGen_Target** %6
ret void
}

LLVM IR (-O2):
%struct.PatternGen_Params = type opaque
%struct.PatternGen_Settings = type opaque
%struct.PatternGen_Target = type opaque
define void @NoPatternInit(%struct.PatternGen_Params* nocapture %0, %struct.PatternGen_Settings* nocapture %1, %struct.PatternGen_Target* nocapture %2) {
ret void
}
void _Read_sleb(void) {}


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

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

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

LLVM IR (-O2):
define void @_Read_sleb() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void assemblePath(char *out, char *path, char *fileName) {
  strcpy(out, path);
  strcat(out, "/");
  strcat(out, fileName);
}


x86 assembly (clang, -O0):
<assemblePath>:
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
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rdi
lea    0xeb4(%rip),%rsi
call   1040 <strcat@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assemblePath>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
call   1030 <strcpy@plt>
lea    0xeca(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <strcat@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
define void @assemblePath(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @strcpy(i8* %0, i8* %1)
%5 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @strcat(i8* %0, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcat(char *, char *);
void Padded(char *to_encryted, int i, int k) {
  while (i % k != 0) {
    strcat(to_encryted, "A");
    i++;
  }
  printf(" The Documnet was padded. %s\n", to_encryted);
}


x86 assembly (clang, -O0):
<Padded>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
cmp    $0x0,%edx
je     1160 <Padded+0x40>
mov    -0x8(%rbp),%rdi
lea    0xeb3(%rip),%rsi
call   1040 <strcat@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1132 <Padded+0x12>
mov    -0x8(%rbp),%rsi
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Padded>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rdi,%r14
mov    %esi,%eax
cltd
idiv   %ebp
test   %edx,%edx
je     1167 <Padded+0x47>
mov    %esi,%ebx
add    $0x1,%ebx
lea    0xebf(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <strcat@plt>
mov    %ebx,%eax
cltd
idiv   %ebp
add    $0x1,%ebx
test   %edx,%edx
jne    1150 <Padded+0x30>
lea    0xe94(%rip),%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"A\00"
@.str.1 = [30 x i8] c" The Documnet was padded. %s\0A\00"
define void @Padded(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
br label %7
7: ; preds = %12, %3
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = srem i32 %8, %9
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %7
%13 = load i8*, i8** %4
%14 = call i32 @strcat(i8* %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%15 = load i32, i32* %5
%16 = add nsw i32 %15, 1
store i32 %16, i32* %5
br label %7
17: ; preds = %7
%18 = load i8*, i8** %4
%19 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* %18)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"A\00"
@.str.1 = [30 x i8] c" The Documnet was padded. %s\0A\00"
define void @Padded(i8* %0, i32 %1, i32 %2) {
%4 = srem i32 %1, %2
%5 = icmp eq i32 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %3, %6
%7 = phi i32 [ %9, %6 ], [ %1, %3 ]
%8 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = add nsw i32 %7, 1
%10 = srem i32 %9, %2
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %6
12: ; preds = %6, %3
%13 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
int convert_char_int(char let) { return (let - 'A'); }


x86 assembly (clang, -O0):
<convert_char_int>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x41,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @convert_char_int(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sub nsw i32 %4, 65
ret i32 %5
}

LLVM IR (-O2):
define i32 @convert_char_int(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -65
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void str() {
  char *str[5];
  char *ptr1, *ptr2;
  str[0] = "this is 1";
  str[1] = "this is 2";
  ptr1 = str[0];
  ptr2 = str[1];
  puts(ptr1);
  puts(++ptr1);
  puts(ptr2);
}


x86 assembly (clang, -O0):
<str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    0xee0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x38(%rbp),%rdi
call   1030 <puts@plt>
mov    -0x38(%rbp),%rdi
add    $0x1,%rdi
mov    %rdi,-0x38(%rbp)
call   1030 <puts@plt>
mov    -0x40(%rbp),%rdi
call   1030 <puts@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xedd(%rip),%rdi
call   1030 <puts@plt>
lea    0xeda(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"this is 1\00"
@.str.1 = [10 x i8] c"this is 2\00"
define void @str() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 1))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void create_initials(void) {}


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

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

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

LLVM IR (-O2):
define void @create_initials() {
ret void
}
int nl_dump_ext_ack_done(const struct nlmsghdr *nlh, int error) { return 0; }


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

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

LLVM IR (-O0):
%struct.nlmsghdr = type opaque
define i32 @nl_dump_ext_ack_done(%struct.nlmsghdr* %0, i32 %1) {
%3 = alloca %struct.nlmsghdr*
%4 = alloca i32
store %struct.nlmsghdr* %0, %struct.nlmsghdr** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
%struct.nlmsghdr = type opaque
define i32 @nl_dump_ext_ack_done(%struct.nlmsghdr* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _test_2(int *, int, int, int, int, int);
void soru_2(int dizi[], int N) {
  int ilk = -1;
  int bastan_ucuncu = -1;
  int son = -1;
  int sondan_ikinci = -1;
  _test_2(dizi, N, ilk, bastan_ucuncu, son, sondan_ikinci);
}


x86 assembly (clang, -O0):
<soru_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0xffffffff,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
movl   $0xffffffff,-0x18(%rbp)
movl   $0xffffffff,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x1c(%rbp),%r9d
call   1030 <_test_2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<soru_2>:
mov    $0xffffffff,%edx
mov    $0xffffffff,%ecx
mov    $0xffffffff,%r8d
mov    $0xffffffff,%r9d
jmp    1030 <_test_2@plt>

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

LLVM IR (-O2):
define void @soru_2(i32* %0, i32 %1) {
%3 = tail call i32 @_test_2(i32* %0, i32 %1, i32 -1, i32 -1, i32 -1, i32 -1)
ret void
}
void foo(double src) {
  double dst;
  asm("mov %1, %0" : "=r"(dst) : "r"(src));
  printf("%lf\n", dst);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
mov    %rax,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xec0(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movq   %xmm0,%rax
mov    %rax,%rax
movq   %rax,%xmm0
lea    0xedc(%rip),%rdi
mov    $0x1,%al
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%lf\0A\00"
define void @foo(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double asm "mov $1, $0", "=r,r,~{dirflag},~{fpsr},~{flags}"(double %4)
store double %5, double* %3
%6 = load double, double* %3
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %6)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%lf\0A\00"
define void @foo(double %0) {
%2 = tail call double asm "mov $1, $0", "=r,r,~{dirflag},~{fpsr},~{flags}"(double %0)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %2)
ret void
}
void blankREPORTinit(void *info, int membertotal, int clustertotal,
                     int singletontotal) {
  return;
}


x86 assembly (clang, -O0):
<blankREPORTinit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @blankREPORTinit(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
define void @blankREPORTinit(i8* nocapture %0, i32 %1, i32 %2, i32 %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
void *threadFunc(void *arg) {
  long int tid = (long int)arg;
  printf("Spawned thread(%li)\n", tid);
  return NULL;
}


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

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

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

LLVM IR (-O2):
@.str = [21 x i8] c"Spawned thread(%li)\0A\00"
define noalias i8* @threadFunc(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i64 %2)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void exit_fun(void) { printf("\n ---- Destructor ---- \n"); }


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

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

LLVM IR (-O0):
@.str = [25 x i8] c"\0A ---- Destructor ---- \0A\00"
define void @exit_fun() {
%1 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [24 x i8] c"\0A ---- Destructor ---- \00"
define void @exit_fun() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Error(char *, char *, int);
int /*<<< orphan*/ exit(int);
void memory_error_and_abort(char *fname) {
  Error("malloc() Failed*Abort",
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/AaronDP/ytree_adbshell/refs/heads/master/"
        "jni/xmalloc.c",
        37);
  exit(2);
}


x86 assembly (clang, -O0):
<memory_error_and_abort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
lea    0xedc(%rip),%rsi
mov    $0x25,%edx
call   1030 <Error@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<memory_error_and_abort>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xee7(%rip),%rsi
mov    $0x25,%edx
call   1030 <Error@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"malloc() Failed*Abort\00"
@.str.1 = [145 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AaronDP/ytree_adbshell/refs/heads/master/jni/xmalloc.c\00"
define void @memory_error_and_abort(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @Error(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str.1, i64 0, i64 0), i32 37)
%4 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@.str = [22 x i8] c"malloc() Failed*Abort\00"
@.str.1 = [145 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AaronDP/ytree_adbshell/refs/heads/master/jni/xmalloc.c\00"
define void @memory_error_and_abort(i8* nocapture readnone %0) {
%2 = tail call i32 @Error(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str.1, i64 0, i64 0), i32 37)
%3 = tail call i32 @exit(i32 2)
unreachable
}