xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  int num = 1;
  switch (num) {
  case 1:
    printf("Num one hit.\n");
  case 2:
    printf("Num two hit.\n");
  case 3:
    printf("Num three hit.\n");
  default:
    printf("Default hit.\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     115c <main+0x4c>
jmp    113a <main+0x2a>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     1168 <main+0x58>
jmp    114b <main+0x3b>
mov    -0xc(%rbp),%eax
sub    $0x3,%eax
je     1174 <main+0x64>
jmp    1180 <main+0x70>
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
lea    0xea5(%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>
lea    0xee9(%rip),%rdi
call   1030 <puts@plt>
lea    0xeea(%rip),%rdi
call   1030 <puts@plt>
lea    0xeed(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Num one hit.\0A\00"
@.str.1 = [14 x i8] c"Num two hit.\0A\00"
@.str.2 = [16 x i8] c"Num three hit.\0A\00"
@.str.3 = [14 x i8] c"Default hit.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %10 [
i32 1, label %4
i32 2, label %6
i32 3, label %8
]
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %0, %4
%7 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %0, %6
%9 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
br label %10
10: ; preds = %0, %8
%11 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
br label %12
12: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Num one hit.\00"
@str.4 = [13 x i8] c"Num two hit.\00"
@str.5 = [15 x i8] c"Num three hit.\00"
@str.6 = [13 x i8] c"Default hit.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.6, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ XML();
int /*<<< orphan*/ init(char *);
int main(int argc, char *argv[]) {
  init("<people><name>ccc</name><tel>313534</tel> at kinmen</people>");
  XML();
}


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

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

LLVM IR (-O0):
@.str = [61 x i8] c"<people><name>ccc</name><tel>313534</tel> at kinmen</people>\00"
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 @init(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (...) @XML()
ret i32 0
}

LLVM IR (-O2):
@.str = [61 x i8] c"<people><name>ccc</name><tel>313534</tel> at kinmen</people>\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @init(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @XML()
ret i32 0
}
const char *jac_chain_nm7_name_in(int i) {
  switch (i) {
  case 0:
    return "i0";
  case 1:
    return "i1";
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<jac_chain_nm7_name_in>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     112b <jac_chain_nm7_name_in+0x2b>
jmp    111a <jac_chain_nm7_name_in+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     113b <jac_chain_nm7_name_in+0x3b>
jmp    114b <jac_chain_nm7_name_in+0x4b>
lea    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <jac_chain_nm7_name_in+0x53>
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <jac_chain_nm7_name_in+0x53>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jac_chain_nm7_name_in>:
xor    %ecx,%ecx
cmp    $0x1,%edi
lea    0xef7(%rip),%rax
cmove  %rax,%rcx
test   %edi,%edi
lea    0xee7(%rip),%rax
cmovne %rcx,%rax
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"i0\00"
@.str.1 = [3 x i8] c"i1\00"
define i8* @jac_chain_nm7_name_in(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* null
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
void FUNC_symtab(void) {}


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

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

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

LLVM IR (-O2):
define void @FUNC_symtab() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ menu();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("\nWelcome!");
  printf("\nWhat you want to do?");
  menu();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
lea    0xed3(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <menu@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [10 x i8] c"\0AWelcome!\00"
@.str.1 = [22 x i8] c"\0AWhat you want to do?\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (...) @menu()
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"\0AWelcome!\00"
@.str.1 = [22 x i8] c"\0AWhat you want to do?\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (...) @menu()
ret i32 0
}
void ext3_xattr_put_super(struct super_block *sb) {}


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

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

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

LLVM IR (-O2):
%struct.super_block = type opaque
define void @ext3_xattr_put_super(%struct.super_block* nocapture %0) {
ret void
}
void cvmx_wqe_set_grp(struct cvmx_wqe *work, int grp) {}


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

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

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

LLVM IR (-O2):
%struct.cvmx_wqe = type opaque
define void @cvmx_wqe_set_grp(%struct.cvmx_wqe* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int X();
int A() { return X(); }


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

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

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

LLVM IR (-O2):
define i32 @A() {
%1 = tail call i32 (...) @X()
ret i32 %1
}
imm0imm1(r0, r1, x0, x1, p0, p1) unsigned int r0, r1;
unsigned int *p0, *p1;
{
  if (22 <= 33)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<imm0imm1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @imm0imm1(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32*
%12 = alloca i32*
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32* %4, i32** %11
store i32* %5, i32** %12
ret i32 1
}

LLVM IR (-O2):
define i32 @imm0imm1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture readnone %5) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void f1(void) { puts("calling f1()"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"calling f1()\00"
define void @f1() {
%1 = call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"calling f1()\00"
define void @f1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
bool is_stopkey(int c) { return c == '.' || c == '/' || c == '[' || c == ' '; }


x86 assembly (clang, -O0):
<is_stopkey>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x2e,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113e <is_stopkey+0x3e>
mov    $0x1,%al
cmpl   $0x2f,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113e <is_stopkey+0x3e>
mov    $0x1,%al
cmpl   $0x5b,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113e <is_stopkey+0x3e>
cmpl   $0x20,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_stopkey>:
lea    -0x2e(%rdi),%ecx
cmp    $0x2d,%ecx
ja     111e <is_stopkey+0x1e>
mov    $0x1,%eax
movabs $0x200000000003,%rdx
bt     %rcx,%rdx
jae    111e <is_stopkey+0x1e>
ret
xor    %eax,%eax
cmp    $0x20,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @is_stopkey(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 46
br i1 %4, label %14, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 47
br i1 %7, label %14, label %8
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 91
br i1 %10, label %14, label %11
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 32
br label %14
14: ; preds = %11, %8, %5, %1
%15 = phi i1 [ true, %8 ], [ true, %5 ], [ true, %1 ], [ %13, %11 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @is_stopkey(i32 %0) {
switch i32 %0, label %2 [
i32 91, label %5
i32 47, label %5
i32 46, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, 32
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
size_t plus_linear_min(int);
void plus_linear_min_Good() {
  int a[20];
  a[plus_linear_min(9)] = 1;
}


x86 assembly (clang, -O0):
<plus_linear_min_Good>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    $0x9,%edi
call   1030 <plus_linear_min@plt>
movl   $0x1,-0x50(%rbp,%rax,4)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plus_linear_min_Good>:
mov    $0x9,%edi
jmp    1030 <plus_linear_min@plt>

LLVM IR (-O0):
define void @plus_linear_min_Good() {
%1 = alloca [20 x i32]
%2 = call i64 @plus_linear_min(i32 9)
%3 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 %2
store i32 1, i32* %3
ret void
}

LLVM IR (-O2):
define void @plus_linear_min_Good() {
%1 = tail call i64 @plus_linear_min(i32 9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Msp430GpioC__12__GeneralIO__set();
void SensirionSht11LogicP__0__DATA__set(void) {
  Msp430GpioC__12__GeneralIO__set();
}


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

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

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

LLVM IR (-O2):
define void @SensirionSht11LogicP__0__DATA__set() {
%1 = tail call i32 (...) @Msp430GpioC__12__GeneralIO__set()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printHelp(char *);
int main(int argc, char **argv) {
  int realargc = argc - 1;
  if (!realargc) {
    printHelp(argv[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)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1145 <main+0x35>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <printHelp@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x1,%edi
jne    1122 <main+0x12>
push   %rax
mov    (%rsi),%rdi
call   1030 <printHelp@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @printHelp(i8* %5)
br label %7
7: ; preds = %4, %2
ret i32 0
}
/* Type definitions */
struct nlmsghdr {
  int nlmsg_len;
};

/* Variables and functions */
int NLMSG_HDRLEN;
int nlmsg_len(const struct nlmsghdr *nlh) {
  return nlh->nlmsg_len - NLMSG_HDRLEN;
}


x86 assembly (clang, -O0):
<nlmsg_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    0x2edb(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nlmsg_len>:
mov    (%rdi),%eax
mov    0x2ee7(%rip),%rcx
sub    (%rcx),%eax
ret

LLVM IR (-O0):
%struct.nlmsghdr = type { i32 }
@NLMSG_HDRLEN = global i32 0
define i32 @nlmsg_len(%struct.nlmsghdr* %0) {
%2 = alloca %struct.nlmsghdr*
store %struct.nlmsghdr* %0, %struct.nlmsghdr** %2
%3 = load %struct.nlmsghdr*, %struct.nlmsghdr** %2
%4 = getelementptr inbounds %struct.nlmsghdr, %struct.nlmsghdr* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = load i32, i32* @NLMSG_HDRLEN
%7 = sub nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
%struct.nlmsghdr = type { i32 }
@NLMSG_HDRLEN = global i32 0
define i32 @nlmsg_len(%struct.nlmsghdr* nocapture %0) {
%2 = getelementptr inbounds %struct.nlmsghdr, %struct.nlmsghdr* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = load i32, i32* @NLMSG_HDRLEN
%5 = sub nsw i32 %3, %4
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ ptrdiff_t;

/* Variables and functions */
ptrdiff_t make_checksum(void *ptr, size_t size) {
  (void)size;
  return *((ptrdiff_t *)ptr);
}


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

x86 assembly (clang, -O2):
<make_checksum>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @make_checksum(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
%8 = load i32, i32* %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @make_checksum(i8* nocapture %0, i64 %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ show_allocs_dupe_blocks_list();
int /*<<< orphan*/ show_allocs_dupe_extents();
int /*<<< orphan*/ show_allocs_extent();
int /*<<< orphan*/ show_allocs_file_block();
int /*<<< orphan*/ show_allocs_filerec();
int /*<<< orphan*/ show_allocs_filerec_token();
void print_mem_stats(void) {
  printf("Duperemove memory usage statistics:\n");
  show_allocs_file_block();
  show_allocs_dupe_blocks_list();
  show_allocs_dupe_extents();
  show_allocs_extent();
  show_allocs_filerec();
  show_allocs_filerec_token();
}


x86 assembly (clang, -O0):
<print_mem_stats>:
push   %rbp
mov    %rsp,%rbp
lea    0xe85(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1070 <show_allocs_file_block@plt>
mov    $0x0,%al
call   1060 <show_allocs_dupe_blocks_list@plt>
mov    $0x0,%al
call   1080 <show_allocs_dupe_extents@plt>
mov    $0x0,%al
call   1030 <show_allocs_extent@plt>
mov    $0x0,%al
call   1040 <show_allocs_filerec@plt>
mov    $0x0,%al
call   1090 <show_allocs_filerec_token@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_mem_stats>:
push   %rax
lea    0xe88(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1070 <show_allocs_file_block@plt>
xor    %eax,%eax
call   1060 <show_allocs_dupe_blocks_list@plt>
xor    %eax,%eax
call   1080 <show_allocs_dupe_extents@plt>
xor    %eax,%eax
call   1040 <show_allocs_extent@plt>
xor    %eax,%eax
call   1050 <show_allocs_filerec@plt>
xor    %eax,%eax
pop    %rcx
jmp    1090 <show_allocs_filerec_token@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"Duperemove memory usage statistics:\0A\00"
define void @print_mem_stats() {
%1 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @show_allocs_file_block()
%3 = call i32 (...) @show_allocs_dupe_blocks_list()
%4 = call i32 (...) @show_allocs_dupe_extents()
%5 = call i32 (...) @show_allocs_extent()
%6 = call i32 (...) @show_allocs_filerec()
%7 = call i32 (...) @show_allocs_filerec_token()
ret void
}

LLVM IR (-O2):
@str = [36 x i8] c"Duperemove memory usage statistics:\00"
define void @print_mem_stats() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @show_allocs_file_block()
%3 = tail call i32 (...) @show_allocs_dupe_blocks_list()
%4 = tail call i32 (...) @show_allocs_dupe_extents()
%5 = tail call i32 (...) @show_allocs_extent()
%6 = tail call i32 (...) @show_allocs_filerec()
%7 = tail call i32 (...) @show_allocs_filerec_token()
ret void
}
/* Type definitions */
struct input_event {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ write(int, struct input_event *, int);
void write_event(int fd, struct input_event ev) {
  write(fd, &ev, sizeof(struct input_event));
}


x86 assembly (clang, -O0):
<write_event>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %esi,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_event>:
push   %rax
mov    %esi,(%rsp)
mov    %rsp,%rsi
mov    $0x4,%edx
call   1030 <write@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.input_event = type { i32 }
define void @write_event(i32 %0, i32 %1) {
%3 = alloca %struct.input_event
%4 = alloca i32
%5 = getelementptr inbounds %struct.input_event, %struct.input_event* %3, i32 0, i32 0
store i32 %1, i32* %5
store i32 %0, i32* %4
%6 = load i32, i32* %4
%7 = call i32 @write(i32 %6, %struct.input_event* %3, i32 4)
ret void
}

LLVM IR (-O2):
%struct.input_event = type { i32 }
define void @write_event(i32 %0, i32 %1) {
%3 = alloca %struct.input_event
%4 = getelementptr inbounds %struct.input_event, %struct.input_event* %3, i64 0, i32 0
store i32 %1, i32* %4
%5 = call i32 @write(i32 %0, %struct.input_event* %3, i32 4)
ret void
}
unsigned replace_byte(unsigned def_num, int byte_pos, char new_byte) {
  int shift = byte_pos << 3;
  unsigned mask = 0xFF << shift;
  return (def_num & ~mask) | (new_byte << shift);
}


x86 assembly (clang, -O0):
<replace_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x3,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%ecx
mov    $0xff,%eax
shl    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x14(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movsbl -0x9(%rbp),%edx
mov    -0x10(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<replace_byte>:
lea    0x0(,%rsi,8),%ecx
mov    $0xff,%eax
shl    %cl,%eax
not    %eax
and    %edi,%eax
shl    %cl,%edx
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @replace_byte(i32 %0, i32 %1, i8 signext %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8 %2, i8* %6
%9 = load i32, i32* %5
%10 = shl i32 %9, 3
store i32 %10, i32* %7
%11 = load i32, i32* %7
%12 = shl i32 255, %11
store i32 %12, i32* %8
%13 = load i32, i32* %4
%14 = load i32, i32* %8
%15 = xor i32 %14, -1
%16 = and i32 %13, %15
%17 = load i8, i8* %6
%18 = sext i8 %17 to i32
%19 = load i32, i32* %7
%20 = shl i32 %18, %19
%21 = or i32 %16, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @replace_byte(i32 %0, i32 %1, i8 signext %2) {
%4 = shl i32 %1, 3
%5 = shl i32 255, %4
%6 = xor i32 %5, -1
%7 = and i32 %6, %0
%8 = sext i8 %2 to i32
%9 = shl i32 %8, %4
%10 = or i32 %7, %9
ret i32 %10
}
/* Variables and functions */
scalar_t__ isalpha(char);
int toupper(char);
int LetterIndex(char ch) {
  if (isalpha(ch)) {
    return (toupper(ch) - 'A');
  } else {
    return (-1);
  }
}


x86 assembly (clang, -O0):
<LetterIndex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1040 <isalpha@plt>
cmp    $0x0,%rax
je     1155 <LetterIndex+0x35>
movsbl -0x5(%rbp),%edi
call   1030 <toupper@plt>
sub    $0x41,%eax
mov    %eax,-0x4(%rbp)
jmp    115c <LetterIndex+0x3c>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LetterIndex>:
push   %rbx
mov    %edi,%ebx
call   1040 <isalpha@plt>
test   %rax,%rax
je     113a <LetterIndex+0x1a>
movsbl %bl,%edi
call   1030 <toupper@plt>
add    $0xffffffbf,%eax
pop    %rbx
ret
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @LetterIndex(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = call i64 @isalpha(i8 signext %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8, i8* %3
%9 = call i32 @toupper(i8 signext %8)
%10 = sub nsw i32 %9, 65
store i32 %10, i32* %2
br label %12
11: ; preds = %1
store i32 -1, i32* %2
br label %12
12: ; preds = %11, %7
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @LetterIndex(i8 signext %0) {
%2 = tail call i64 @isalpha(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @toupper(i8 signext %0)
%6 = add nsw i32 %5, -65
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %6, %4 ], [ -1, %1 ]
ret i32 %8
}
void flush(void *addr) { asm volatile("clflush  (%0)" ::"r"(addr)); }


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

x86 assembly (clang, -O2):
<flush>:
clflush (%rdi)
ret

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

LLVM IR (-O2):
define void @flush(i8* %0) {
tail call void asm sideeffect "clflush ($0)", "r,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret void
}
int dollarsFromCents(int cents) { return cents / 100; }


x86 assembly (clang, -O0):
<dollarsFromCents>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<dollarsFromCents>:
movslq %edi,%rax
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @dollarsFromCents(i32 %0) {
%2 = sdiv i32 %0, 100
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x74() {
  Assert_real((iscntrl(116) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_iscntrl.c",
              585, ("iscntrl should be 0 for t"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0x74>:
push   %rax
mov    $0x74,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x249,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for t\00"
define void @t_iscntrl_0x74() {
%1 = call i64 @iscntrl(i32 116)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 585, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for t\00"
define void @t_iscntrl_0x74() {
%1 = tail call i64 @iscntrl(i32 116)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 585, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
scalar_t__ calloc(int, int);
int /*<<< orphan*/ free(int *);
int main() {
  uint8_t *mem = (uint8_t *)calloc(3, sizeof(uint8_t));
  mem[0] = 0;
  mem[1] = 128;
  mem[2] = 255;
  free(mem);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3,%edi
mov    $0x4,%esi
call   1040 <calloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x80,0x4(%rax)
mov    -0x10(%rbp),%rax
movl   $0xff,0x8(%rax)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
mov    $0x4,%esi
call   1040 <calloc@plt>
movabs $0x8000000000,%rcx
mov    %rcx,(%rax)
movl   $0xff,0x8(%rax)
mov    %rax,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i64 @calloc(i32 3, i32 4)
%4 = inttoptr i64 %3 to i32*
store i32* %4, i32** %2
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 0
store i32 0, i32* %6
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
store i32 128, i32* %8
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 2
store i32 255, i32* %10
%11 = load i32*, i32** %2
%12 = call i32 @free(i32* %11)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @calloc(i32 3, i32 4)
%2 = inttoptr i64 %1 to i32*
store i32 0, i32* %2
%3 = getelementptr inbounds i32, i32* %2, i64 1
store i32 128, i32* %3
%4 = getelementptr inbounds i32, i32* %2, i64 2
store i32 255, i32* %4
%5 = tail call i32 @free(i32* %2)
ret i32 0
}
void NoPinC__0__GeneralIO__makeOutput(void) {}


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

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

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

LLVM IR (-O2):
define void @NoPinC__0__GeneralIO__makeOutput() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ buf_ntohl(void *, int);
int recv(int, void *, int, int /*<<< orphan*/);
int idrnet_recv_buf(int sockfd, void *buf, int len) {
  int recv_res = recv(sockfd, buf, len, 0);
  if (recv_res != -1) {
    buf_ntohl(buf, len);
  }
  return recv_res;
}


x86 assembly (clang, -O0):
<idrnet_recv_buf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0xffffffff,-0x18(%rbp)
je     115c <idrnet_recv_buf+0x3c>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <buf_ntohl@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<idrnet_recv_buf>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %eax,%ebp
cmp    $0xffffffff,%eax
je     1143 <idrnet_recv_buf+0x23>
mov    %rbx,%rdi
mov    %r14d,%esi
call   1040 <buf_ntohl@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @idrnet_recv_buf(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @recv(i32 %0, i8* %1, i32 %2, i32 0)
%5 = icmp eq i32 %4, -1
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @buf_ntohl(i8* %1, i32 %2)
br label %8
8: ; preds = %6, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ vc40_reset();
void vc40_analyse() { vc40_reset(); }


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

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

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

LLVM IR (-O2):
define void @vc40_analyse() {
%1 = tail call i32 (...) @vc40_reset()
ret void
}
void put_long_le(char *cp, long lval) {
  *cp++ = lval & 0xff;
  *cp++ = (lval >> 8) & 0xff;
  *cp++ = (lval >> 16) & 0xff;
  *cp++ = (lval >> 24) & 0xff;
}


x86 assembly (clang, -O0):
<put_long_le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
sar    $0x8,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
sar    $0x10,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
sar    $0x18,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_long_le>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @put_long_le(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = and i64 %5, 255
%7 = trunc i64 %6 to i8
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %3
store i8 %7, i8* %8
%10 = load i64, i64* %4
%11 = ashr i64 %10, 8
%12 = and i64 %11, 255
%13 = trunc i64 %12 to i8
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %3
store i8 %13, i8* %14
%16 = load i64, i64* %4
%17 = ashr i64 %16, 16
%18 = and i64 %17, 255
%19 = trunc i64 %18 to i8
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %3
store i8 %19, i8* %20
%22 = load i64, i64* %4
%23 = ashr i64 %22, 24
%24 = and i64 %23, 255
%25 = trunc i64 %24 to i8
%26 = load i8*, i8** %3
%27 = getelementptr inbounds i8, i8* %26, i32 1
store i8* %27, i8** %3
store i8 %25, i8* %26
ret void
}

LLVM IR (-O2):
define void @put_long_le(i8* nocapture writeonly %0, i64 %1) {
%3 = trunc i64 %1 to i8
%4 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %3, i8* %0
%5 = lshr i64 %1, 8
%6 = trunc i64 %5 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %6, i8* %4
%8 = lshr i64 %1, 16
%9 = trunc i64 %8 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %9, i8* %7
%11 = lshr i64 %1, 24
%12 = trunc i64 %11 to i8
store i8 %12, i8* %10
ret void
}
/* Variables and functions */
int /*<<< orphan*/ string(char *);
void oid_0001(void) { string("Firmware version"); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"Firmware version\00"
define void @oid_0001() {
%1 = call i32 @string(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"Firmware version\00"
define void @oid_0001() {
%1 = tail call i32 @string(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("ok\n"); }


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

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

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

LLVM IR (-O2):
@str = [3 x i8] c"ok\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main() {
  puts("Hello World!");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <puts@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 = [13 x i8] c"Hello World!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello World!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
unsigned int QRinput_decodeECIfromByteArray(unsigned char *);
int QRinput_estimateBitsModeECI(unsigned char *data) {
  unsigned int ecinum;
  ecinum = QRinput_decodeECIfromByteArray(data);
  if (ecinum < 128) {
    return 4 + 8;
  } else if (ecinum < 16384) {
    return 4 + 16;
  } else {
    return 4 + 24;
  }
}


x86 assembly (clang, -O0):
<QRinput_estimateBitsModeECI>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <QRinput_decodeECIfromByteArray@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x80,-0x14(%rbp)
jae    1141 <QRinput_estimateBitsModeECI+0x31>
movl   $0xc,-0x4(%rbp)
jmp    1161 <QRinput_estimateBitsModeECI+0x51>
cmpl   $0x4000,-0x14(%rbp)
jae    115a <QRinput_estimateBitsModeECI+0x4a>
movl   $0x14,-0x4(%rbp)
jmp    1161 <QRinput_estimateBitsModeECI+0x51>
movl   $0x1c,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<QRinput_estimateBitsModeECI>:
push   %rax
call   1030 <QRinput_decodeECIfromByteArray@plt>
xor    %ecx,%ecx
cmp    $0x4000,%eax
setae  %cl
cmp    $0x80,%eax
lea    0x14(,%rcx,8),%ecx
mov    $0xc,%eax
cmovae %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @QRinput_estimateBitsModeECI(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @QRinput_decodeECIfromByteArray(i8* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp ult i32 %7, 128
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 12, i32* %2
br label %15
10: ; preds = %1
%11 = load i32, i32* %4
%12 = icmp ult i32 %11, 16384
br i1 %12, label %13, label %14
13: ; preds = %10
store i32 20, i32* %2
br label %15
14: ; preds = %10
store i32 28, i32* %2
br label %15
15: ; preds = %14, %13, %9
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @QRinput_estimateBitsModeECI(i8* %0) {
%2 = tail call i32 @QRinput_decodeECIfromByteArray(i8* %0)
%3 = icmp ult i32 %2, 128
%4 = icmp ult i32 %2, 16384
%5 = select i1 %4, i32 20, i32 28
%6 = select i1 %3, i32 12, i32 %5
ret i32 %6
}
int comp(const void *e1, const void *e2) {
  if (*(long long *)e1 > *(long long *)e2)
    return 1;
  if (*(long long *)e1 < *(long long *)e2)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<comp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%rax
jle    112c <comp+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1153 <comp+0x53>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%rax
jge    114c <comp+0x4c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1153 <comp+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<comp>:
mov    (%rdi),%rax
mov    (%rsi),%rcx
xor    %edx,%edx
cmp    %rcx,%rax
setl   %dl
neg    %edx
cmp    %rcx,%rax
mov    $0x1,%eax
cmovle %edx,%eax
ret

LLVM IR (-O0):
define i32 @comp(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i64*
%8 = load i64, i64* %7
%9 = load i8*, i8** %5
%10 = bitcast i8* %9 to i64*
%11 = load i64, i64* %10
%12 = icmp sgt i64 %8, %11
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 1, i32* %3
br label %24
14: ; preds = %2
%15 = load i8*, i8** %4
%16 = bitcast i8* %15 to i64*
%17 = load i64, i64* %16
%18 = load i8*, i8** %5
%19 = bitcast i8* %18 to i64*
%20 = load i64, i64* %19
%21 = icmp slt i64 %17, %20
br i1 %21, label %22, label %23
22: ; preds = %14
store i32 -1, i32* %3
br label %24
23: ; preds = %14
store i32 0, i32* %3
br label %24
24: ; preds = %23, %22, %13
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @comp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp sgt i64 %4, %6
%8 = icmp slt i64 %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
/* Variables and functions */
float fabs(float);
float Clamp(float f_x, float f_a, float f_b) {
  const float f_x1 = fabs(f_x - f_a);
  const float f_x2 = fabs(f_x - f_b);
  f_x = f_x1 + f_a + f_b;
  f_x -= f_x2;
  f_x *= 0.5;
  return f_x;
}


x86 assembly (clang, -O0):
<Clamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
call   1030 <fabs@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
call   1030 <fabs@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x10(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x14(%rbp),%xmm1
movss  -0x4(%rbp),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe79(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Clamp>:
movaps %xmm0,%xmm3
subss  %xmm1,%xmm3
movaps 0xef2(%rip),%xmm4
andps  %xmm4,%xmm3
subss  %xmm2,%xmm0
andps  %xmm4,%xmm0
addss  %xmm1,%xmm3
addss  %xmm2,%xmm3
subss  %xmm0,%xmm3
mulss  0xee4(%rip),%xmm3
movaps %xmm3,%xmm0
ret

LLVM IR (-O0):
define float @Clamp(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%9 = load float, float* %4
%10 = load float, float* %5
%11 = fsub float %9, %10
%12 = call float @fabs(float %11)
store float %12, float* %7
%13 = load float, float* %4
%14 = load float, float* %6
%15 = fsub float %13, %14
%16 = call float @fabs(float %15)
store float %16, float* %8
%17 = load float, float* %7
%18 = load float, float* %5
%19 = fadd float %17, %18
%20 = load float, float* %6
%21 = fadd float %19, %20
store float %21, float* %4
%22 = load float, float* %8
%23 = load float, float* %4
%24 = fsub float %23, %22
store float %24, float* %4
%25 = load float, float* %4
%26 = fpext float %25 to double
%27 = fmul double %26, 5.000000e-01
%28 = fptrunc double %27 to float
store float %28, float* %4
%29 = load float, float* %4
ret float %29
}

LLVM IR (-O2):
define float @Clamp(float %0, float %1, float %2) {
%4 = fsub float %0, %1
%5 = tail call float @llvm.fabs.f32(float %4)
%6 = fsub float %0, %2
%7 = tail call float @llvm.fabs.f32(float %6)
%8 = fadd float %5, %1
%9 = fadd float %8, %2
%10 = fsub float %9, %7
%11 = fmul float %10, 5.000000e-01
ret float %11
}
/* Variables and functions */
int /*<<< orphan*/ print_int(int);
int /*<<< orphan*/ print_string(char *);
void main(void) {
  int x;
  x = 999999999;
  print_string("Should get 999999999\n");
  print_int(x);
  print_string("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x3b9ac9ff,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <print_string@plt>
mov    -0x4(%rbp),%edi
call   1040 <print_int@plt>
lea    0xeca(%rip),%rdi
call   1030 <print_string@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <print_string@plt>
mov    $0x3b9ac9ff,%edi
call   1040 <print_int@plt>
lea    0xed6(%rip),%rdi
pop    %rax
jmp    1030 <print_string@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Should get 999999999\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @main() {
%1 = alloca i32
store i32 999999999, i32* %1
%2 = call i32 @print_string(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
%4 = call i32 @print_int(i32 %3)
%5 = call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"Should get 999999999\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @main() {
%1 = tail call i32 @print_string(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @print_int(i32 999999999)
%3 = tail call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void ff_hevc_put_hevc_uni_w_qpel_v8_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_qpel_v8_12_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int foo(int a, int b, int c, int d, int e) {
  if (a != 1 || b != 2 || c != 3 || d != 4 || e != 5)
    abort();
  return b + c;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    115a <foo+0x4a>
cmpl   $0x2,-0x8(%rbp)
jne    115a <foo+0x4a>
cmpl   $0x3,-0xc(%rbp)
jne    115a <foo+0x4a>
cmpl   $0x4,-0x10(%rbp)
jne    115a <foo+0x4a>
cmpl   $0x5,-0x14(%rbp)
je     1161 <foo+0x51>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
cmp    $0x1,%edi
jne    1130 <foo+0x20>
cmp    $0x2,%esi
jne    1130 <foo+0x20>
cmp    $0x3,%edx
jne    1130 <foo+0x20>
cmp    $0x4,%ecx
jne    1130 <foo+0x20>
cmp    $0x5,%r8d
jne    1130 <foo+0x20>
mov    $0x5,%eax
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @foo(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = icmp ne i32 %11, 1
br i1 %12, label %25, label %13
13: ; preds = %5
%14 = load i32, i32* %7
%15 = icmp ne i32 %14, 2
br i1 %15, label %25, label %16
16: ; preds = %13
%17 = load i32, i32* %8
%18 = icmp ne i32 %17, 3
br i1 %18, label %25, label %19
19: ; preds = %16
%20 = load i32, i32* %9
%21 = icmp ne i32 %20, 4
br i1 %21, label %25, label %22
22: ; preds = %19
%23 = load i32, i32* %10
%24 = icmp ne i32 %23, 5
br i1 %24, label %25, label %27
25: ; preds = %22, %19, %16, %13, %5
%26 = call i32 (...) @abort()
unreachable
27: ; preds = %22
%28 = load i32, i32* %7
%29 = load i32, i32* %8
%30 = add nsw i32 %28, %29
ret i32 %30
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = icmp ne i32 %0, 1
%7 = icmp ne i32 %1, 2
%8 = or i1 %6, %7
%9 = icmp ne i32 %2, 3
%10 = or i1 %8, %9
%11 = icmp ne i32 %3, 4
%12 = or i1 %10, %11
%13 = icmp ne i32 %4, 5
%14 = or i1 %12, %13
br i1 %14, label %15, label %17
15: ; preds = %5
%16 = tail call i32 (...) @abort()
unreachable
17: ; preds = %5
ret i32 5
}