xunge/DecIR huggingface dataset:
/* Type definitions */
struct trb_table {
  int dummy;
};

/* Variables and functions */
void **trb_probe(struct trb_table *, void *);
void *trb_replace(struct trb_table *table, void *item) {
  void **p = trb_probe(table, item);
  if (p == NULL || *p == item)
    return NULL;
  else {
    void *r = *p;
    *p = item;
    return r;
  }
}


x86 assembly (clang, -O0):
<trb_replace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <trb_probe@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     114d <trb_replace+0x3d>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
cmp    -0x18(%rbp),%rax
jne    115a <trb_replace+0x4a>
movq   $0x0,-0x8(%rbp)
jmp    1178 <trb_replace+0x68>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trb_replace>:
push   %rbx
mov    %rsi,%rbx
call   1030 <trb_probe@plt>
test   %rax,%rax
je     112e <trb_replace+0x1e>
mov    %rax,%rcx
mov    (%rax),%rax
cmp    %rbx,%rax
je     112e <trb_replace+0x1e>
mov    %rbx,(%rcx)
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.trb_table = type { i32 }
define i8* @trb_replace(%struct.trb_table* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca %struct.trb_table*
%5 = alloca i8*
%6 = alloca i8**
%7 = alloca i8*
store %struct.trb_table* %0, %struct.trb_table** %4
store i8* %1, i8** %5
%8 = load %struct.trb_table*, %struct.trb_table** %4
%9 = load i8*, i8** %5
%10 = call i8** @trb_probe(%struct.trb_table* %8, i8* %9)
store i8** %10, i8*** %6
%11 = load i8**, i8*** %6
%12 = icmp eq i8** %11, null
br i1 %12, label %18, label %13
13: ; preds = %2
%14 = load i8**, i8*** %6
%15 = load i8*, i8** %14
%16 = load i8*, i8** %5
%17 = icmp eq i8* %15, %16
br i1 %17, label %18, label %19
18: ; preds = %13, %2
store i8* null, i8** %3
br label %25
19: ; preds = %13
%20 = load i8**, i8*** %6
%21 = load i8*, i8** %20
store i8* %21, i8** %7
%22 = load i8*, i8** %5
%23 = load i8**, i8*** %6
store i8* %22, i8** %23
%24 = load i8*, i8** %7
store i8* %24, i8** %3
br label %25
25: ; preds = %19, %18
%26 = load i8*, i8** %3
ret i8* %26
}

LLVM IR (-O2):
%struct.trb_table = type { i32 }
define i8* @trb_replace(%struct.trb_table* %0, i8* %1) {
%3 = tail call i8** @trb_probe(%struct.trb_table* %0, i8* %1)
%4 = icmp eq i8** %3, null
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, %1
br i1 %7, label %9, label %8
8: ; preds = %5
store i8* %1, i8** %3
br label %9
9: ; preds = %2, %5, %8
%10 = phi i8* [ %6, %8 ], [ null, %5 ], [ null, %2 ]
ret i8* %10
}
int verificaRg(int rg) {
  if (rg < 0)
    return 0;
  return 1;
}


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

x86 assembly (clang, -O2):
<verificaRg>:
mov    %edi,%eax
not    %eax
shr    $0x1f,%eax
ret

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

LLVM IR (-O2):
define i32 @verificaRg(i32 %0) {
%2 = xor i32 %0, -1
%3 = lshr i32 %2, 31
ret i32 %3
}
/* Variables and functions */
double tanh(double);
double tanh_lin(double x) { return tanh(x) + 1.0 * x; }


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

x86 assembly (clang, -O2):
<tanh_lin>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <tanh@plt>
addsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @tanh_lin(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @tanh(double %3)
%5 = load double, double* %2
%6 = call double @llvm.fmuladd.f64(double 1.000000e+00, double %5, double %4)
ret double %6
}

LLVM IR (-O2):
define double @tanh_lin(double %0) {
%2 = tail call double @tanh(double %0)
%3 = fadd double %2, %0
ret double %3
}
/* Type definitions */
typedef scalar_t__ wchar_t;

/* Variables and functions */
size_t wcslen(const wchar_t *s) {
  size_t i;
  for (i = 0; s[i]; ++i)
    ;
  return i;
}


x86 assembly (clang, -O0):
<wcslen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1139 <wcslen+0x39>
jmp    1128 <wcslen+0x28>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <wcslen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcslen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpq   $0x0,0x8(%rdi,%rax,8)
lea    0x1(%rax),%rax
jne    1110 <wcslen+0x10>
ret

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

LLVM IR (-O2):
define i64 @wcslen(i64* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i64, i64* %0, i64 %3
%5 = load i64, i64* %4
%6 = icmp eq i64 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
void arch_main(void) {}


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

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

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

LLVM IR (-O2):
define void @arch_main() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ halt();
int /*<<< orphan*/ printf(char *, unsigned int, unsigned int);
void __attribute__((cdecl)) irq_nmi(unsigned cs, unsigned ip) {
  printf("irq_"
         "nmi"
         "!%x:%x",
         cs, ip);
  halt();
}


x86 assembly (clang, -O0):
<irq_nmi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <halt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irq_nmi>:
push   %rax
mov    %esi,%edx
mov    %edi,%esi
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <halt@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"irq_nmi!%x:%x\00"
define void @irq_nmi(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 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = call i32 (...) @halt()
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"irq_nmi!%x:%x\00"
define void @irq_nmi(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%4 = tail call i32 (...) @halt()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int Object_attack(void *self, int damage) {
  printf("You can't attack that.\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"You can't attack that.\0A\00"
define i32 @Object_attack(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [23 x i8] c"You can't attack that.\00"
define i32 @Object_attack(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
unsigned int sad_mx_n_simd(unsigned char const *, int, unsigned char const *,
                           int, unsigned int, int, int);
unsigned int vp8_sad8x16_simd(const unsigned char *src_ptr, int src_stride,
                              const unsigned char *ref_ptr, int ref_stride,
                              unsigned int max_sad) {
  return sad_mx_n_simd(src_ptr, src_stride, ref_ptr, ref_stride, max_sad, 8,
                       16);
}


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

x86 assembly (clang, -O2):
<vp8_sad8x16_simd>:
push   %rax
movl   $0x10,(%rsp)
mov    $0x8,%r9d
call   1030 <sad_mx_n_simd@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @vp8_sad8x16_simd(i8* %0, i32 %1, i8* %2, i32 %3, i32 %4) {
%6 = tail call i32 @sad_mx_n_simd(i8* %0, i32 %1, i8* %2, i32 %3, i32 %4, i32 8, i32 16)
ret i32 %6
}
int busca(int x, int n, int v[]) {
  for (int k = n - 1; k >= 0; --k)
    if (v[k] == x)
      return k;
  return -1;
}


x86 assembly (clang, -O0):
<busca>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jl     1153 <busca+0x53>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x8(%rbp),%eax
jne    1140 <busca+0x40>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115a <busca+0x5a>
jmp    1145 <busca+0x45>
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    1117 <busca+0x17>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<busca>:
mov    %esi,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
test   %eax,%eax
jle    1120 <busca+0x20>
add    $0xffffffffffffffff,%rax
mov    %eax,%ecx
cmp    %edi,(%rdx,%rcx,4)
jne    1110 <busca+0x10>
ret
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @busca(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
%9 = load i32, i32* %6
%10 = sub nsw i32 %9, 1
store i32 %10, i32* %8
br label %11
11: ; preds = %25, %3
%12 = load i32, i32* %8
%13 = icmp sge i32 %12, 0
br i1 %13, label %14, label %28
14: ; preds = %11
%15 = load i32*, i32** %7
%16 = load i32, i32* %8
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
%19 = load i32, i32* %18
%20 = load i32, i32* %5
%21 = icmp eq i32 %19, %20
br i1 %21, label %22, label %24
22: ; preds = %14
%23 = load i32, i32* %8
store i32 %23, i32* %4
br label %29
24: ; preds = %14
br label %25
25: ; preds = %24
%26 = load i32, i32* %8
%27 = add nsw i32 %26, -1
store i32 %27, i32* %8
br label %11
28: ; preds = %11
store i32 -1, i32* %4
br label %29
29: ; preds = %28, %22
%30 = load i32, i32* %4
ret i32 %30
}

LLVM IR (-O2):
define i32 @busca(i32 %0, i32 %1, i32* nocapture %2) {
%4 = zext i32 %1 to i64
br label %5
5: ; preds = %10, %3
%6 = phi i64 [ %7, %10 ], [ %4, %3 ]
%7 = add nsw i64 %6, -1
%8 = trunc i64 %6 to i32
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %17
10: ; preds = %5
%11 = and i64 %7, 4294967295
%12 = getelementptr inbounds i32, i32* %2, i64 %11
%13 = load i32, i32* %12
%14 = icmp eq i32 %13, %0
br i1 %14, label %15, label %5
15: ; preds = %10
%16 = trunc i64 %7 to i32
br label %17
17: ; preds = %5, %15
%18 = phi i32 [ %16, %15 ], [ -1, %5 ]
ret i32 %18
}
int HelpItem12(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem12() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ HdlcTranslateC__SerialFrameComm__resetReceive();
void SerialP__SerialFrameComm__resetReceive(void) {
  HdlcTranslateC__SerialFrameComm__resetReceive();
}


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

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

LLVM IR (-O0):
define void @SerialP__SerialFrameComm__resetReceive() {
%1 = call i32 (...) @HdlcTranslateC__SerialFrameComm__resetReceive()
ret void
}

LLVM IR (-O2):
define void @SerialP__SerialFrameComm__resetReceive() {
%1 = tail call i32 (...) @HdlcTranslateC__SerialFrameComm__resetReceive()
ret void
}
long double test_rintl(long double x) { return __builtin_rintl(x); }


x86 assembly (clang, -O0):
<test_rintl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <rintl@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_rintl>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
fstpt  (%rsp)
call   1030 <rintl@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @test_rintl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call x86_fp80 @llvm.rint.f80(x86_fp80 %3)
ret x86_fp80 %4
}

LLVM IR (-O2):
define x86_fp80 @test_rintl(x86_fp80 %0) {
%2 = tail call x86_fp80 @llvm.rint.f80(x86_fp80 %0)
ret x86_fp80 %2
}
/* Variables and functions */
float sqrtf(float);
float _sqrt(float a) { return sqrtf(a); }


x86 assembly (clang, -O0):
<_sqrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sqrtf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_sqrt>:
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     111d <_sqrt+0xd>
sqrtss %xmm0,%xmm0
ret
jmp    1030 <sqrtf@plt>

LLVM IR (-O0):
define float @_sqrt(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @sqrtf(float %3)
ret float %4
}

LLVM IR (-O2):
define float @_sqrt(float %0) {
%2 = tail call float @sqrtf(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ getColor(char *);
int /*<<< orphan*/ print(char *);
int /*<<< orphan*/ setColor(char);
void printColor(char *str, char color) {
  char bColor;
  getColor(&bColor);
  setColor(color);
  print(str);
  setColor(bColor);
}


x86 assembly (clang, -O0):
<printColor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
lea    -0xa(%rbp),%rdi
call   1030 <getColor@plt>
movsbl -0x9(%rbp),%edi
call   1050 <setColor@plt>
mov    -0x8(%rbp),%rdi
call   1040 <print@plt>
movsbl -0xa(%rbp),%edi
call   1050 <setColor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printColor>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
lea    0x7(%rsp),%rdi
call   1030 <getColor@plt>
mov    %ebx,%edi
call   1050 <setColor@plt>
mov    %r14,%rdi
call   1040 <print@plt>
movsbl 0x7(%rsp),%edi
call   1050 <setColor@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @printColor(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%6 = call i32 @getColor(i8* %5)
%7 = load i8, i8* %4
%8 = call i32 @setColor(i8 signext %7)
%9 = load i8*, i8** %3
%10 = call i32 @print(i8* %9)
%11 = load i8, i8* %5
%12 = call i32 @setColor(i8 signext %11)
ret void
}

LLVM IR (-O2):
define void @printColor(i8* %0, i8 signext %1) {
%3 = alloca i8
%4 = call i32 @getColor(i8* %3)
%5 = call i32 @setColor(i8 signext %1)
%6 = call i32 @print(i8* %0)
%7 = load i8, i8* %3
%8 = call i32 @setColor(i8 signext %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put_to_mem(char const);
void flush_string_to_mem_storage(const char *string) {
  while (*string != 0) {
    put_to_mem(*string);
    string++;
  }
  put_to_mem(0);
}


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

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

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

LLVM IR (-O2):
define void @flush_string_to_mem_storage(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @put_to_mem(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = tail call i32 @put_to_mem(i8 signext 0)
ret void
}
int main(int argc, char *argv[]) {
  typedef struct {
    char *spointer1;
  } structure;
  structure **pointer1 = 0;
  pointer1 = (structure **)malloc(4 * sizeof(structure *));
  pointer1[1] = (structure *)malloc(sizeof(structure));
  pointer1[1]->spointer1 = (char *)malloc(64);
  free(pointer1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    $0x20,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    $0x8,%edi
call   1040 <malloc@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    $0x40,%edi
call   1040 <malloc@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.structure = type { i8* }
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.structure**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store %struct.structure** null, %struct.structure*** %6
%7 = call i8* @malloc(i64 32)
%8 = bitcast i8* %7 to %struct.structure**
store %struct.structure** %8, %struct.structure*** %6
%9 = call i8* @malloc(i64 8)
%10 = bitcast i8* %9 to %struct.structure*
%11 = load %struct.structure**, %struct.structure*** %6
%12 = getelementptr inbounds %struct.structure*, %struct.structure** %11, i64 1
store %struct.structure* %10, %struct.structure** %12
%13 = call i8* @malloc(i64 64)
%14 = load %struct.structure**, %struct.structure*** %6
%15 = getelementptr inbounds %struct.structure*, %struct.structure** %14, i64 1
%16 = load %struct.structure*, %struct.structure** %15
%17 = getelementptr inbounds %struct.structure, %struct.structure* %16, i32 0, i32 0
store i8* %13, i8** %17
%18 = load %struct.structure**, %struct.structure*** %6
%19 = bitcast %struct.structure** %18 to i8*
ret i32 0
}

LLVM IR (-O2):
%struct.structure = type { i8* }
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ parse_body_revision(unsigned char const *);
__attribute__((visibility("hidden"))) void
tux_hw_parse_body_revision(const unsigned char *frame) {
  parse_body_revision(frame);
}


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

x86 assembly (clang, -O2):
<tux_hw_parse_body_revision>:
jmp    1030 <parse_body_revision@plt>

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

LLVM IR (-O2):
define hidden void @tux_hw_parse_body_revision(i8* %0) {
%2 = tail call i32 @parse_body_revision(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(unsigned int);
void wait(unsigned ms) { usleep(ms * 1000); }


x86 assembly (clang, -O0):
<wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0x3e8,-0x4(%rbp),%edi
call   1030 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @wait(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul i32 %3, 1000
%5 = call i32 @usleep(i32 %4)
ret void
}

LLVM IR (-O2):
define void @wait(i32 %0) {
%2 = mul i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
/* Variables and functions */
int GetIntSetting(char *, int);
int DiscardFirstKeypress() {
  return GetIntSetting("XSECURELOCK_DISCARD_FIRST_KEYPRESS",
                       !GetIntSetting("XSECURELOCK_WANT_FIRST_KEYPRESS", 0));
}


x86 assembly (clang, -O0):
<DiscardFirstKeypress>:
push   %rbp
mov    %rsp,%rbp
lea    0xf08(%rip),%rdi
xor    %esi,%esi
call   1030 <GetIntSetting@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%esi
lea    0xeca(%rip),%rdi
call   1030 <GetIntSetting@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DiscardFirstKeypress>:
push   %rax
lea    0xf0b(%rip),%rdi
xor    %esi,%esi
call   1030 <GetIntSetting@plt>
xor    %esi,%esi
test   %eax,%eax
sete   %sil
lea    0xed2(%rip),%rdi
pop    %rax
jmp    1030 <GetIntSetting@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"XSECURELOCK_DISCARD_FIRST_KEYPRESS\00"
@.str.1 = [32 x i8] c"XSECURELOCK_WANT_FIRST_KEYPRESS\00"
define i32 @DiscardFirstKeypress() {
%1 = call i32 @GetIntSetting(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 0)
%2 = icmp ne i32 %1, 0
%3 = xor i1 %2, true
%4 = zext i1 %3 to i32
%5 = call i32 @GetIntSetting(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@.str = [35 x i8] c"XSECURELOCK_DISCARD_FIRST_KEYPRESS\00"
@.str.1 = [32 x i8] c"XSECURELOCK_WANT_FIRST_KEYPRESS\00"
define i32 @DiscardFirstKeypress() {
%1 = tail call i32 @GetIntSetting(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 0)
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @GetIntSetting(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 %4
}
void ff_hevc_put_hevc_uni_epel_h64_10_avx2() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_epel_h64_10_avx2() {
ret void
}
void compute_coupling_ac_el_cuda_(long *Mesh_pointer, int *iphasef,
                                  int *num_coupling_ac_el_facesf) {}


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

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

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

LLVM IR (-O2):
define void @compute_coupling_ac_el_cuda_(i64* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ write(int, char *, int);
void hearbeat_thread(void *args) {
  int fd = *((int *)args);
  printf("hearbeat thread start\n");
  while (1) {
    write(fd, "$", 1);
    sleep(50);
  }
  printf("hearbeat terminated\n");
}


x86 assembly (clang, -O0):
<hearbeat_thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
lea    0xeb4(%rip),%rdi
call   1040 <printf@plt>
mov    -0xc(%rbp),%edi
lea    0xebc(%rip),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    $0x32,%edi
call   1050 <sleep@plt>
jmp    1151 <hearbeat_thread+0x21>

x86 assembly (clang, -O2):
<hearbeat_thread>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%ebx
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb7(%rip),%r14
nopl   0x0(%rax)
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x32,%edi
call   1050 <sleep@plt>
jmp    1150 <hearbeat_thread+0x20>

LLVM IR (-O0):
@.str = [23 x i8] c"hearbeat thread start\0A\00"
@.str.1 = [2 x i8] c"$\00"
define void @hearbeat_thread(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
store i32 %6, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %1, %8
%9 = load i32, i32* %3
%10 = call i32 @write(i32 %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
%11 = call i32 @sleep(i32 50)
br label %8
}

LLVM IR (-O2):
@.str.1 = [2 x i8] c"$\00"
@str = [22 x i8] c"hearbeat thread start\00"
define void @hearbeat_thread(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
br label %5
5: ; preds = %5, %1
%6 = tail call i32 @write(i32 %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
%7 = tail call i32 @sleep(i32 50)
br label %5
}
void java_lang_Object_initNativeLayer__() {}


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

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

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

LLVM IR (-O2):
define void @java_lang_Object_initNativeLayer__() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_mem(char *, void *, int, char *, char, char *);
void println_dec(char *leader, void *mem, int len, char sep) {
  print_mem(leader, mem, len, "%d", sep, "\n");
}


x86 assembly (clang, -O0):
<println_dec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %al,-0x15(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    0xec6(%rip),%rcx
lea    0xec2(%rip),%r9
movsbl -0x15(%rbp),%r8d
call   1030 <print_mem@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<println_dec>:
mov    %ecx,%r8d
lea    0xee6(%rip),%rcx
lea    0xee2(%rip),%r9
jmp    1030 <print_mem@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @println_dec(i8* %0, i8* %1, i32 %2, i8 signext %3) {
%5 = tail call i32 @print_mem(i8* %0, i8* %1, i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int test_imm_B9uint8_mem(unsigned char *val) {
  return ((*val) & (0xB9 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_B9uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -71
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int do_exchange(char *cname, int argc, char *argv[]) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @do_exchange(i8* nocapture readnone %0, i32 %1, i8** nocapture readnone %2) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutexattr_t;

/* Variables and functions */
int pthread_mutexattr_setpshared(int /*<<< orphan*/ *, int);
int my_pthread_mutexattr_setpshared(pthread_mutexattr_t *__attr, int pshared) {
  return pthread_mutexattr_setpshared(__attr, pshared);
}


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

x86 assembly (clang, -O2):
<my_pthread_mutexattr_setpshared>:
jmp    1030 <pthread_mutexattr_setpshared@plt>

LLVM IR (-O0):
define i32 @my_pthread_mutexattr_setpshared(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 @pthread_mutexattr_setpshared(i32* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @my_pthread_mutexattr_setpshared(i32* %0, i32 %1) {
%3 = tail call i32 @pthread_mutexattr_setpshared(i32* %0, i32 %1)
ret i32 %3
}
yywrap() { return (1); }


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

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

LLVM IR (-O0):
define i32 @yywrap() {
ret i32 1
}

LLVM IR (-O2):
define i32 @yywrap() {
ret i32 1
}
/* Variables and functions */
int add(int /*<<< orphan*/, int);
int main(void) { return add(0, 10); }


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

x86 assembly (clang, -O2):
<main>:
xor    %edi,%edi
mov    $0xa,%esi
jmp    1030 <add@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @add(i32 0, i32 10)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ merge_sort(int *, int /*<<< orphan*/, int);
int /*<<< orphan*/ print_array(int *, int);
int /*<<< orphan*/ printf(char *);
void main() {
  int a[] = {100, 99, 98, 97, 96, 95};
  print_array(a, 6);
  printf("\n Array contents after sorting ...");
  merge_sort(a, 0, 5);
  print_array(a, 6);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xec1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xebe(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xebb(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x6,%esi
call   1030 <print_array@plt>
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x5,%edx
call   1050 <merge_sort@plt>
lea    -0x20(%rbp),%rdi
mov    $0x6,%esi
call   1030 <print_array@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
mov    0xed4(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xeb8(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x6,%esi
call   1030 <print_array@plt>
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x5,%edx
call   1050 <merge_sort@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
call   1030 <print_array@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.a = [6 x i32] [i32 100, i32 99, i32 98, i32 97, i32 96, i32 95]
@.str = [35 x i8] c"\0A Array contents after sorting ...\00"
define void @main() {
%1 = alloca [6 x i32]
%2 = bitcast [6 x i32]* %1 to i8*
%3 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%4 = call i32 @print_array(i32* %3, i32 6)
%5 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%7 = call i32 @merge_sort(i32* %6, i32 0, i32 5)
%8 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%9 = call i32 @print_array(i32* %8, i32 6)
ret void
}

LLVM IR (-O2):
@__const.main.a = [6 x i32] [i32 100, i32 99, i32 98, i32 97, i32 96, i32 95]
@.str = [35 x i8] c"\0A Array contents after sorting ...\00"
define void @main() {
%1 = alloca [6 x i32]
%2 = bitcast [6 x i32]* %1 to i8*
%3 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%4 = call i32 @print_array(i32* %3, i32 6)
%5 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @merge_sort(i32* %3, i32 0, i32 5)
%7 = call i32 @print_array(i32* %3, i32 6)
ret void
}
void reverse(char a[], int start, int end) {
  while (start < end) {
    char temp;
    temp = a[start];
    a[start] = a[end];
    a[end] = temp;
    start++;
    end--;
  }
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1163 <reverse+0x63>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x11(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    110e <reverse+0xe>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
cmp    %edx,%esi
jge    1131 <reverse+0x31>
movslq %esi,%rax
movslq %edx,%rcx
add    $0x1,%rax
xchg   %ax,%ax
movzbl -0x1(%rdi,%rax,1),%esi
movzbl (%rdi,%rcx,1),%edx
mov    %dl,-0x1(%rdi,%rax,1)
mov    %sil,(%rdi,%rcx,1)
add    $0xffffffffffffffff,%rcx
lea    0x1(%rax),%rdx
cmp    %rcx,%rax
mov    %rdx,%rax
jl     1110 <reverse+0x10>
ret

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

LLVM IR (-O2):
define void @reverse(i8* nocapture %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %18
5: ; preds = %3
%6 = sext i32 %1 to i64
%7 = sext i32 %2 to i64
br label %8
8: ; preds = %5, %8
%9 = phi i64 [ %7, %5 ], [ %16, %8 ]
%10 = phi i64 [ %6, %5 ], [ %15, %8 ]
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = getelementptr inbounds i8, i8* %0, i64 %9
%14 = load i8, i8* %13
store i8 %14, i8* %11
store i8 %12, i8* %13
%15 = add nsw i64 %10, 1
%16 = add nsw i64 %9, -1
%17 = icmp slt i64 %15, %16
br i1 %17, label %8, label %18
18: ; preds = %8, %3
ret void
}
/* Variables and functions */
unsigned char *sn_io_addr(unsigned long);
int /*<<< orphan*/ sn_mmiob();
void __sn_outb(unsigned char val, unsigned long port) {
  volatile unsigned char *addr;
  if ((addr = sn_io_addr(port))) {
    *addr = val;
    sn_mmiob();
  }
}


x86 assembly (clang, -O0):
<__sn_outb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <sn_io_addr@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1159 <__sn_outb+0x39>
mov    -0x1(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    $0x0,%al
call   1040 <sn_mmiob@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__sn_outb>:
push   %rbx
mov    %edi,%ebx
mov    %rsi,%rdi
call   1030 <sn_io_addr@plt>
test   %rax,%rax
je     113a <__sn_outb+0x1a>
mov    %bl,(%rax)
xor    %eax,%eax
pop    %rbx
jmp    1040 <sn_mmiob@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @__sn_outb(i8 zeroext %0, i64 %1) {
%3 = tail call i8* @sn_io_addr(i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
store volatile i8 %0, i8* %3
%6 = tail call i32 (...) @sn_mmiob()
br label %7
7: ; preds = %5, %2
ret void
}
int ld_bun_mr1(long double *a1, long double a2) {
  return (__builtin_isunordered(*a1, a2));
}


x86 assembly (clang, -O0):
<ld_bun_mr1>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
mov    %rdi,-0x8(%rbp)
fstpt  -0x20(%rbp)
mov    -0x8(%rbp),%rax
fldt   (%rax)
fldt   -0x20(%rbp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setp   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_bun_mr1>:
fldt   0x8(%rsp)
fldt   (%rdi)
xor    %eax,%eax
fucomip %st(1),%st
fstp   %st(0)
setp   %al
ret

LLVM IR (-O0):
define i32 @ld_bun_mr1(x86_fp80* %0, x86_fp80 %1) {
%3 = alloca x86_fp80*
%4 = alloca x86_fp80
store x86_fp80* %0, x86_fp80** %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80*, x86_fp80** %3
%6 = load x86_fp80, x86_fp80* %5
%7 = load x86_fp80, x86_fp80* %4
%8 = fcmp uno x86_fp80 %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @ld_bun_mr1(x86_fp80* nocapture %0, x86_fp80 %1) {
%3 = load x86_fp80, x86_fp80* %0
%4 = fcmp uno x86_fp80 %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
int isShuzi(char a) {
  if ((a <= '9' && a >= '0') || a == '.')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isShuzi>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1124 <isShuzi+0x24>
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jge    1131 <isShuzi+0x31>
movsbl -0x5(%rbp),%eax
cmp    $0x2e,%eax
jne    113d <isShuzi+0x3d>
movl   $0x1,-0x4(%rbp)
jmp    1144 <isShuzi+0x44>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isShuzi>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%al
setb   %al
cmp    $0x2e,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isShuzi(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sle i32 %5, 57
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sge i32 %9, 48
br i1 %10, label %15, label %11
11: ; preds = %7, %1
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 46
br i1 %14, label %15, label %16
15: ; preds = %11, %7
store i32 1, i32* %2
br label %17
16: ; preds = %11
store i32 0, i32* %2
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @isShuzi(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = icmp eq i8 %0, 46
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ foo(void *);
char icharand(char x, char y) {
  x &= 24;
  if (!x)
    foo((void *)0);
  return x;
}


x86 assembly (clang, -O0):
<icharand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
and    $0x18,%eax
mov    %al,-0x1(%rbp)
cmpb   $0x0,-0x1(%rbp)
jne    1141 <icharand+0x31>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <foo@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<icharand>:
push   %rbx
mov    %edi,%ebx
and    $0x18,%bl
jne    111f <icharand+0xf>
xor    %edi,%edi
call   1030 <foo@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define signext i8 @icharand(i8 signext %0, i8 signext %1) {
%3 = and i8 %0, 24
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @foo(i8* null)
br label %7
7: ; preds = %5, %2
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ sans_log(int /*<<< orphan*/, char *, char const *,
                            int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void sans_err(const char *msg) {
  sans_log(stderr, "%s: %s", msg, strerror(errno));
}


x86 assembly (clang, -O0):
<sans_err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    %eax,%ecx
lea    0xea2(%rip),%rsi
call   1030 <sans_log@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sans_err>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eb3(%rip),%rax
mov    (%rax),%ebp
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
lea    0xebc(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %eax,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <sans_log@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [7 x i8] c"%s: %s\00"
@errno = global i32 0
define void @sans_err(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = load i32, i32* @errno
%6 = call i32 @strerror(i32 %5)
%7 = call i32 @sans_log(i32 %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %4, i32 %6)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [7 x i8] c"%s: %s\00"
@errno = global i32 0
define void @sans_err(i8* %0) {
%2 = load i32, i32* @stderr
%3 = load i32, i32* @errno
%4 = tail call i32 @strerror(i32 %3)
%5 = tail call i32 @sans_log(i32 %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LedsP__Leds__led1Toggle();
void OscilloscopeC__Leds__led1Toggle(void) { LedsP__Leds__led1Toggle(); }


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

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

LLVM IR (-O0):
define void @OscilloscopeC__Leds__led1Toggle() {
%1 = call i32 (...) @LedsP__Leds__led1Toggle()
ret void
}

LLVM IR (-O2):
define void @OscilloscopeC__Leds__led1Toggle() {
%1 = tail call i32 (...) @LedsP__Leds__led1Toggle()
ret void
}
/* Variables and functions */
int f498(int /*<<< orphan*/);
int main() { return f498(0); }


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

x86 assembly (clang, -O2):
<main>:
xor    %edi,%edi
jmp    1030 <f498@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f498(i32 0)
ret i32 %1
}