xunge/DecIR huggingface dataset:
/* Variables and functions */
char *addrToString(unsigned int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, unsigned int *);
int main(int argc, char **argv) {
  unsigned int addr;
  scanf("%u", &addr);
  printf("%s", addrToString(addr));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x14(%rbp),%edi
call   1040 <addrToString@plt>
mov    %rax,%rsi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <addrToString@plt>
lea    0xeb1(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%u\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %5)
%7 = load i32, i32* %5
%8 = call i8* @addrToString(i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%u\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = load i32, i32* %3
%7 = call i8* @addrToString(i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret i32 0
}
int test_imm_44int64_lowword_reg(long long val) {
  return ((val) & (0x44 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_44int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 68
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, void const *, int);
void tcpmsg_add_raw_data(char **buf, const void *data, int data_len) {
  memcpy(*buf, data, data_len);
  *buf += data_len;
}


x86 assembly (clang, -O0):
<tcpmsg_add_raw_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
movslq %edx,%rdx
add    %rdx,%rcx
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcpmsg_add_raw_data>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <memcpy@plt>
movslq %ebp,%rax
add    %rax,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @tcpmsg_add_raw_data(i8** %0, i8* %1, i32 %2) {
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i32
store i8** %0, i8*** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8**, i8*** %4
%8 = load i8*, i8** %7
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @memcpy(i8* %8, i8* %9, i32 %10)
%12 = load i32, i32* %6
%13 = load i8**, i8*** %4
%14 = load i8*, i8** %13
%15 = sext i32 %12 to i64
%16 = getelementptr inbounds i8, i8* %14, i64 %15
store i8* %16, i8** %13
ret void
}

LLVM IR (-O2):
define void @tcpmsg_add_raw_data(i8** nocapture %0, i8* %1, i32 %2) {
%4 = load i8*, i8** %0
%5 = tail call i32 @memcpy(i8* %4, i8* %1, i32 %2)
%6 = load i8*, i8** %0
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i8, i8* %6, i64 %7
store i8* %8, i8** %0
ret void
}
void l1_dataA_jump(void) {
  int (*foo)(void);
  foo = (void *)((0xFF800000));
  (*foo)();
}


x86 assembly (clang, -O0):
<l1_dataA_jump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xff800000,%eax
mov    %rax,-0x8(%rbp)
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<l1_dataA_jump>:
mov    $0xff800000,%eax
jmp    *%rax

LLVM IR (-O0):
define void @l1_dataA_jump() {
%1 = alloca i32 ()*
store i32 ()* inttoptr (i64 4286578688 to i32 ()*), i32 ()** %1
%2 = load i32 ()*, i32 ()** %1
%3 = call i32 %2()
ret void
}

LLVM IR (-O2):
define void @l1_dataA_jump() {
%1 = tail call i32 inttoptr (i64 4286578688 to i32 ()*)()
ret void
}
int vrt_node_get_upnode_id(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @vrt_node_get_upnode_id() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Mali_SetBase(int *);
int /*<<< orphan*/ RunMaliTest_sim2_t760_part0();
int /*<<< orphan*/ RunMaliTest_sim2_t760_part1();
int /*<<< orphan*/ RunMaliTest_sim2_t760_part2();
int /*<<< orphan*/ RunMaliTest_sim2_t760_part3();
int RunMaliTest_sim2_t760(int *base) {
  Mali_SetBase(base);
  RunMaliTest_sim2_t760_part0();
  RunMaliTest_sim2_t760_part1();
  RunMaliTest_sim2_t760_part2();
  RunMaliTest_sim2_t760_part3();
  return 0;
}


x86 assembly (clang, -O0):
<RunMaliTest_sim2_t760>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1070 <Mali_SetBase@plt>
mov    $0x0,%al
call   1030 <RunMaliTest_sim2_t760_part0@plt>
mov    $0x0,%al
call   1050 <RunMaliTest_sim2_t760_part1@plt>
mov    $0x0,%al
call   1040 <RunMaliTest_sim2_t760_part2@plt>
mov    $0x0,%al
call   1060 <RunMaliTest_sim2_t760_part3@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RunMaliTest_sim2_t760>:
push   %rax
call   1070 <Mali_SetBase@plt>
xor    %eax,%eax
call   1030 <RunMaliTest_sim2_t760_part0@plt>
xor    %eax,%eax
call   1050 <RunMaliTest_sim2_t760_part1@plt>
xor    %eax,%eax
call   1040 <RunMaliTest_sim2_t760_part2@plt>
xor    %eax,%eax
call   1060 <RunMaliTest_sim2_t760_part3@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @RunMaliTest_sim2_t760(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @Mali_SetBase(i32* %3)
%5 = call i32 (...) @RunMaliTest_sim2_t760_part0()
%6 = call i32 (...) @RunMaliTest_sim2_t760_part1()
%7 = call i32 (...) @RunMaliTest_sim2_t760_part2()
%8 = call i32 (...) @RunMaliTest_sim2_t760_part3()
ret i32 0
}

LLVM IR (-O2):
define i32 @RunMaliTest_sim2_t760(i32* %0) {
%2 = tail call i32 @Mali_SetBase(i32* %0)
%3 = tail call i32 (...) @RunMaliTest_sim2_t760_part0()
%4 = tail call i32 (...) @RunMaliTest_sim2_t760_part1()
%5 = tail call i32 (...) @RunMaliTest_sim2_t760_part2()
%6 = tail call i32 (...) @RunMaliTest_sim2_t760_part3()
ret i32 0
}
/* Variables and functions */
int majorityElement(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int arr[] = {1, 4, 5, 1, 8, 5, 5, 5, 5, 5};
  printf("The majority element of the array is %d\n", majorityElement(arr, 10));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1050 <majorityElement@plt>
mov    %eax,%esi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0xa,%esi
call   1040 <majorityElement@plt>
lea    0xecd(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.arr = [10 x i32] [i32 1, i32 4, i32 5, i32 1, i32 8, i32 5, i32 5, i32 5, i32 5, i32 5]
@.str = [41 x i8] c"The majority element of the array is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
store i32 0, i32* %1
%3 = bitcast [10 x i32]* %2 to i8*
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%5 = call i32 @majorityElement(i32* %4, i32 10)
%6 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [10 x i32] [i32 1, i32 4, i32 5, i32 1, i32 8, i32 5, i32 5, i32 5, i32 5, i32 5]
@.str = [41 x i8] c"The majority element of the array is %d\0A\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @majorityElement(i32* %3, i32 10)
%5 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void segfault_handler(int signal) {
  printf("ERROR: caught a segmentation fault: most likely the system refused "
         "to allocate the RAM you or lang requested.\n");
  printf("exiting now.\n");
  exit(1);
}


x86 assembly (clang, -O0):
<segfault_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
lea    0xf31(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<segfault_handler>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf3a(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [111 x i8] c"ERROR: caught a segmentation fault: most likely the system refused to allocate the RAM you or lang requested.\0A\00"
@.str.1 = [14 x i8] c"exiting now.\0A\00"
define void @segfault_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([111 x i8], [111 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [110 x i8] c"ERROR: caught a segmentation fault: most likely the system refused to allocate the RAM you or lang requested.\00"
@str.2 = [13 x i8] c"exiting now.\00"
define void @segfault_handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([110 x i8], [110 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.2, i64 0, i64 0))
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) unsigned
sd_bus_track_count(void *track) {
  return -EINVAL;
}


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

x86 assembly (clang, -O2):
<sd_bus_track_count>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_track_count(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_track_count(i8* nocapture readnone %0) {
%2 = load i32, i32* @EINVAL
%3 = sub nsw i32 0, %2
ret i32 %3
}
dolhello() {}


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

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

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

LLVM IR (-O2):
define i32 @dolhello() {
ret i32 undef
}
/* Variables and functions */
int add_sub(char **);
int eval_expr(char *str) { return (add_sub(&str)); }


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

x86 assembly (clang, -O2):
<eval_expr>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdi
call   1030 <add_sub@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @eval_expr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @add_sub(i8** %2)
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;
typedef int uint64_t;

/* Variables and functions */
uint64_t load_7(const uint8_t *in) {
  uint64_t result;
  result = in[0];
  result |= ((uint64_t)in[1]) << 8;
  result |= ((uint64_t)in[2]) << 16;
  result |= ((uint64_t)in[3]) << 24;
  result |= ((uint64_t)in[4]) << 32;
  result |= ((uint64_t)in[5]) << 40;
  result |= ((uint64_t)in[6]) << 48;
  return result;
}


x86 assembly (clang, -O0):
<load_7>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
shl    $0x8,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
shl    $0x10,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%eax
shl    $0x18,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%eax
mov    $0x20,%ecx
shl    %cl,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%eax
mov    $0x28,%ecx
shl    %cl,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%eax
mov    $0x30,%ecx
shl    %cl,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @load_7(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 0
%6 = load i32, i32* %5
store i32 %6, i32* %3
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
%10 = shl i32 %9, 8
%11 = load i32, i32* %3
%12 = or i32 %11, %10
store i32 %12, i32* %3
%13 = load i32*, i32** %2
%14 = getelementptr inbounds i32, i32* %13, i64 2
%15 = load i32, i32* %14
%16 = shl i32 %15, 16
%17 = load i32, i32* %3
%18 = or i32 %17, %16
store i32 %18, i32* %3
%19 = load i32*, i32** %2
%20 = getelementptr inbounds i32, i32* %19, i64 3
%21 = load i32, i32* %20
%22 = shl i32 %21, 24
%23 = load i32, i32* %3
%24 = or i32 %23, %22
store i32 %24, i32* %3
%25 = load i32*, i32** %2
%26 = getelementptr inbounds i32, i32* %25, i64 4
%27 = load i32, i32* %26
%28 = shl i32 %27, 32
%29 = load i32, i32* %3
%30 = or i32 %29, %28
store i32 %30, i32* %3
%31 = load i32*, i32** %2
%32 = getelementptr inbounds i32, i32* %31, i64 5
%33 = load i32, i32* %32
%34 = shl i32 %33, 40
%35 = load i32, i32* %3
%36 = or i32 %35, %34
store i32 %36, i32* %3
%37 = load i32*, i32** %2
%38 = getelementptr inbounds i32, i32* %37, i64 6
%39 = load i32, i32* %38
%40 = shl i32 %39, 48
%41 = load i32, i32* %3
%42 = or i32 %41, %40
store i32 %42, i32* %3
%43 = load i32, i32* %3
ret i32 %43
}

LLVM IR (-O2):
define i32 @load_7(i32* nocapture readnone %0) {
ret i32 poison
}
int hash(char *key, int table_size) {
  unsigned int hash_val = 0;
  while ((unsigned int)*key != 0)
    hash_val += (unsigned int)key++;
  return hash_val % table_size;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     113c <hash+0x3c>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <hash+0x12>
mov    -0x10(%rbp),%eax
xor    %edx,%edx
divl   -0xc(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
cmpb   $0x0,(%rdi)
je     1120 <hash+0x20>
lea    0x1(%rdi),%rcx
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
add    %edi,%eax
add    $0x1,%edi
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <hash+0x10>
jmp    1122 <hash+0x22>
xor    %eax,%eax
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %11, %5 ], [ 0, %2 ]
%7 = phi i8* [ %8, %5 ], [ %0, %2 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = ptrtoint i8* %7 to i64
%10 = trunc i64 %9 to i32
%11 = add i32 %6, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %2
%15 = phi i32 [ 0, %2 ], [ %11, %5 ]
%16 = urem i32 %15, %1
ret i32 %16
}
int test_imm_0Aint32_reg(int val) { return ((val) & (0x0A << 0)) ? -20 : -40; }


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

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

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

LLVM IR (-O2):
define i32 @test_imm_0Aint32_reg(i32 %0) {
%2 = and i32 %0, 10
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int fun266() { return 266; }


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

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

LLVM IR (-O0):
define i32 @fun266() {
ret i32 266
}

LLVM IR (-O2):
define i32 @fun266() {
ret i32 266
}
/* Type definitions */
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __list_del_entry(struct list_head *);
int /*<<< orphan*/ clist_add_tail(struct list_head *, struct list_head *);
void clist_move_tail(struct list_head *list, struct list_head *head) {
  __list_del_entry(list);
  clist_add_tail(list, head);
}


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

x86 assembly (clang, -O2):
<clist_move_tail>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <__list_del_entry@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <clist_add_tail@plt>

LLVM IR (-O0):
%struct.list_head = type { i32 }
define void @clist_move_tail(%struct.list_head* %0, %struct.list_head* %1) {
%3 = alloca %struct.list_head*
%4 = alloca %struct.list_head*
store %struct.list_head* %0, %struct.list_head** %3
store %struct.list_head* %1, %struct.list_head** %4
%5 = load %struct.list_head*, %struct.list_head** %3
%6 = call i32 @__list_del_entry(%struct.list_head* %5)
%7 = load %struct.list_head*, %struct.list_head** %3
%8 = load %struct.list_head*, %struct.list_head** %4
%9 = call i32 @clist_add_tail(%struct.list_head* %7, %struct.list_head* %8)
ret void
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
define void @clist_move_tail(%struct.list_head* %0, %struct.list_head* %1) {
%3 = tail call i32 @__list_del_entry(%struct.list_head* %0)
%4 = tail call i32 @clist_add_tail(%struct.list_head* %0, %struct.list_head* %1)
ret void
}
int setpgid(int pid, int pgrp) {}


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

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

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

LLVM IR (-O2):
define i32 @setpgid(i32 %0, i32 %1) {
ret i32 undef
}
/* Variables and functions */
unsigned long getMemHigh();
unsigned long getMemLow();
int /*<<< orphan*/ printf(char *, unsigned long, unsigned long);
int /*<<< orphan*/ setSASmemrange(unsigned long, unsigned long);
void setmemrange(unsigned long low, unsigned long high) {
  unsigned long ak, bk;
  setSASmemrange(low, high);
  ak = getMemLow();
  bk = getMemHigh();
  printf("getMemLow()=%lu, getMemHigh()=%lu\n", ak, bk);
}


x86 assembly (clang, -O0):
<setmemrange>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <setSASmemrange@plt>
mov    $0x0,%al
call   1060 <getMemLow@plt>
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1040 <getMemHigh@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setmemrange>:
push   %rbx
call   1050 <setSASmemrange@plt>
xor    %eax,%eax
call   1060 <getMemLow@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1040 <getMemHigh@plt>
lea    0xea2(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"getMemLow()=%lu, getMemHigh()=%lu\0A\00"
define void @setmemrange(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%7 = load i64, i64* %3
%8 = load i64, i64* %4
%9 = call i32 @setSASmemrange(i64 %7, i64 %8)
%10 = call i64 (...) @getMemLow()
store i64 %10, i64* %5
%11 = call i64 (...) @getMemHigh()
store i64 %11, i64* %6
%12 = load i64, i64* %5
%13 = load i64, i64* %6
%14 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i64 %12, i64 %13)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"getMemLow()=%lu, getMemHigh()=%lu\0A\00"
define void @setmemrange(i64 %0, i64 %1) {
%3 = tail call i32 @setSASmemrange(i64 %0, i64 %1)
%4 = tail call i64 (...) @getMemLow()
%5 = tail call i64 (...) @getMemHigh()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i64 %4, i64 %5)
ret void
}
int ecriture(char *nom_de_fichier) {}


x86 assembly (clang, -O0):
<ecriture>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ecriture(i8* nocapture readnone %0) {
ret i32 undef
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t rgb_to_y(int r, int g, int b) {
  int y = ((9798 * r + 19235 * g + 3736 * b) >> 15);
  return y > 255 ? 255 : y < 0 ? 0 : y;
}


x86 assembly (clang, -O0):
<rgb_to_y>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
imul   $0x2646,-0x4(%rbp),%eax
imul   $0x4b23,-0x8(%rbp),%ecx
add    %ecx,%eax
imul   $0xe98,-0xc(%rbp),%ecx
add    %ecx,%eax
sar    $0xf,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0xff,-0x10(%rbp)
jle    1146 <rgb_to_y+0x46>
mov    $0xff,%eax
mov    %eax,-0x14(%rbp)
jmp    1166 <rgb_to_y+0x66>
cmpl   $0x0,-0x10(%rbp)
jge    115a <rgb_to_y+0x5a>
xor    %eax,%eax
mov    %eax,-0x18(%rbp)
jmp    1160 <rgb_to_y+0x60>
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgb_to_y>:
imul   $0x2646,%edi,%eax
imul   $0x4b23,%esi,%ecx
add    %eax,%ecx
imul   $0xe98,%edx,%edx
add    %ecx,%edx
xor    %eax,%eax
sar    $0xf,%edx
cmovs  %eax,%edx
cmp    $0xff,%edx
mov    $0xff,%eax
cmovb  %edx,%eax
ret

LLVM IR (-O0):
define i32 @rgb_to_y(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = mul nsw i32 9798, %8
%10 = load i32, i32* %5
%11 = mul nsw i32 19235, %10
%12 = add nsw i32 %9, %11
%13 = load i32, i32* %6
%14 = mul nsw i32 3736, %13
%15 = add nsw i32 %12, %14
%16 = ashr i32 %15, 15
store i32 %16, i32* %7
%17 = load i32, i32* %7
%18 = icmp sgt i32 %17, 255
br i1 %18, label %19, label %20
19: ; preds = %3
br label %28
20: ; preds = %3
%21 = load i32, i32* %7
%22 = icmp slt i32 %21, 0
br i1 %22, label %23, label %24
23: ; preds = %20
br label %26
24: ; preds = %20
%25 = load i32, i32* %7
br label %26
26: ; preds = %24, %23
%27 = phi i32 [ 0, %23 ], [ %25, %24 ]
br label %28
28: ; preds = %26, %19
%29 = phi i32 [ 255, %19 ], [ %27, %26 ]
ret i32 %29
}

LLVM IR (-O2):
define i32 @rgb_to_y(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %0, 9798
%5 = mul nsw i32 %1, 19235
%6 = add nsw i32 %5, %4
%7 = mul nsw i32 %2, 3736
%8 = add nsw i32 %6, %7
%9 = ashr i32 %8, 15
%10 = icmp sgt i32 %9, 0
%11 = select i1 %10, i32 %9, i32 0
%12 = icmp ult i32 %11, 255
%13 = select i1 %12, i32 %11, i32 255
ret i32 %13
}
/* Variables and functions */
scalar_t__ tolower(int);
char *strlower(char *str) {
  int i = 0;
  while (str[i]) {
    str[i] = (char)tolower((int)str[i]);
    i++;
  }
  return str;
}


x86 assembly (clang, -O0):
<strlower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1161 <strlower+0x51>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <tolower@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <strlower+0x13>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlower>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     1146 <strlower+0x36>
lea    0x1(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <strlower+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strlower(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %11, %4 ], [ 0, %1 ]
%6 = phi i8 [ %13, %4 ], [ %2, %1 ]
%7 = phi i8* [ %12, %4 ], [ %0, %1 ]
%8 = sext i8 %6 to i32
%9 = tail call i64 @tolower(i32 %8)
%10 = trunc i64 %9 to i8
store i8 %10, i8* %7
%11 = add nuw i64 %5, 1
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
ret i8* %0
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ ungetc(char, int /*<<< orphan*/);
int main() {
  for (int i = 0; i < 26; i++) {
    ungetc('a' + i, stdin);
    putchar(getchar());
  }
  putchar('\n');
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x1a,-0x8(%rbp)
jge    1184 <main+0x54>
mov    -0x8(%rbp),%eax
add    $0x61,%eax
mov    0x2e8b(%rip),%rcx
mov    (%rcx),%esi
movsbl %al,%edi
call   1050 <ungetc@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
movsbl %al,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1146 <main+0x16>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0xffffffe6,%ebx
mov    0x2ea8(%rip),%r14
lea    0x7b(%rbx),%eax
mov    (%r14),%esi
movsbl %al,%edi
call   1050 <ungetc@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
movsbl %al,%edi
call   1030 <putchar@plt>
inc    %ebx
jne    1140 <main+0x10>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stdin = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %14, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 26
br i1 %5, label %6, label %17
6: ; preds = %3
%7 = load i32, i32* %2
%8 = add nsw i32 97, %7
%9 = trunc i32 %8 to i8
%10 = load i32, i32* @stdin
%11 = call i32 @ungetc(i8 signext %9, i32 %10)
%12 = call signext i8 (...) @getchar()
%13 = call i32 @putchar(i8 signext %12)
br label %14
14: ; preds = %6
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 1
store i32 %16, i32* %2
br label %3
17: ; preds = %3
%18 = call i32 @putchar(i8 signext 10)
%19 = load i32, i32* %1
ret i32 %19
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @main() {
br label %3
1: ; preds = %3
%2 = tail call i32 @putchar(i8 signext 10)
ret i32 0
3: ; preds = %0, %3
%4 = phi i32 [ 0, %0 ], [ %11, %3 ]
%5 = trunc i32 %4 to i8
%6 = add nuw nsw i8 %5, 97
%7 = load i32, i32* @stdin
%8 = tail call i32 @ungetc(i8 signext %6, i32 %7)
%9 = tail call signext i8 (...) @getchar()
%10 = tail call i32 @putchar(i8 signext %9)
%11 = add nuw nsw i32 %4, 1
%12 = icmp eq i32 %11, 26
br i1 %12, label %1, label %3
}
void ai1_finalize() {}


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

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

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

LLVM IR (-O2):
define void @ai1_finalize() {
ret void
}
/* Variables and functions */
size_t frag_svc_write(void *dst, size_t size, size_t nmemb, void *fh) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i64 @frag_svc_write(i8* nocapture readnone %0, i64 %1, i64 %2, i8* nocapture readnone %3) {
ret i64 0
}
/* Type definitions */
struct RBTREE_TYPENAME {
  int dummy;
};
struct RBTREE_NODE {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ delete_case2(struct RBTREE_TYPENAME *, struct RBTREE_NODE *,
                                struct RBTREE_NODE *);
void delete_case1(struct RBTREE_TYPENAME *target, struct RBTREE_NODE *P,
                  struct RBTREE_NODE *N) {
  if (P != NULL)
    delete_case2(target, P, N);
}


x86 assembly (clang, -O0):
<delete_case1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1140 <delete_case1+0x30>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <delete_case2@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.RBTREE_TYPENAME = type { i32 }
%struct.RBTREE_NODE = type { i32 }
define void @delete_case1(%struct.RBTREE_TYPENAME* %0, %struct.RBTREE_NODE* %1, %struct.RBTREE_NODE* %2) {
%4 = alloca %struct.RBTREE_TYPENAME*
%5 = alloca %struct.RBTREE_NODE*
%6 = alloca %struct.RBTREE_NODE*
store %struct.RBTREE_TYPENAME* %0, %struct.RBTREE_TYPENAME** %4
store %struct.RBTREE_NODE* %1, %struct.RBTREE_NODE** %5
store %struct.RBTREE_NODE* %2, %struct.RBTREE_NODE** %6
%7 = load %struct.RBTREE_NODE*, %struct.RBTREE_NODE** %5
%8 = icmp ne %struct.RBTREE_NODE* %7, null
br i1 %8, label %9, label %14
9: ; preds = %3
%10 = load %struct.RBTREE_TYPENAME*, %struct.RBTREE_TYPENAME** %4
%11 = load %struct.RBTREE_NODE*, %struct.RBTREE_NODE** %5
%12 = load %struct.RBTREE_NODE*, %struct.RBTREE_NODE** %6
%13 = call i32 @delete_case2(%struct.RBTREE_TYPENAME* %10, %struct.RBTREE_NODE* %11, %struct.RBTREE_NODE* %12)
br label %14
14: ; preds = %9, %3
ret void
}

LLVM IR (-O2):
%struct.RBTREE_TYPENAME = type { i32 }
%struct.RBTREE_NODE = type { i32 }
define void @delete_case1(%struct.RBTREE_TYPENAME* %0, %struct.RBTREE_NODE* %1, %struct.RBTREE_NODE* %2) {
%4 = icmp eq %struct.RBTREE_NODE* %1, null
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @delete_case2(%struct.RBTREE_TYPENAME* %0, %struct.RBTREE_NODE* %1, %struct.RBTREE_NODE* %2)
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error_exit(char *, char *);
int open(char *, int);
int open_file(char *path, int mode) {
  int fd = open(path, mode);
  if (fd == -1)
    error_exit("Open_file(%s) failed", path);
  return fd;
}


x86 assembly (clang, -O0):
<open_file>:
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   1040 <open@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0xffffffff,-0x10(%rbp)
jne    1158 <open_file+0x38>
mov    -0x8(%rbp),%rsi
lea    0xead(%rip),%rdi
call   1030 <error_exit@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_file>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <open@plt>
mov    %eax,%ebp
cmp    $0xffffffff,%eax
jne    1141 <open_file+0x21>
lea    0xec7(%rip),%rdi
mov    %rbx,%rsi
call   1030 <error_exit@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Open_file(%s) failed\00"
define i32 @open_file(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @open(i8* %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = call i32 @error_exit(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %12)
br label %14
14: ; preds = %11, %2
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
@.str = [21 x i8] c"Open_file(%s) failed\00"
define i32 @open_file(i8* %0, i32 %1) {
%3 = tail call i32 @open(i8* %0, i32 %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @error_exit(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %7
7: ; preds = %5, %2
ret i32 %3
}
int clk_status(struct clk *c) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.clk = type opaque
define i32 @clk_status(%struct.clk* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
struct EmuGlobal {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ lemu_core_global_free(struct EmuGlobal *);
void lemu_global_free(struct EmuGlobal *G) { lemu_core_global_free(G); }


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

x86 assembly (clang, -O2):
<lemu_global_free>:
jmp    1030 <lemu_core_global_free@plt>

LLVM IR (-O0):
%struct.EmuGlobal = type { i32 }
define void @lemu_global_free(%struct.EmuGlobal* %0) {
%2 = alloca %struct.EmuGlobal*
store %struct.EmuGlobal* %0, %struct.EmuGlobal** %2
%3 = load %struct.EmuGlobal*, %struct.EmuGlobal** %2
%4 = call i32 @lemu_core_global_free(%struct.EmuGlobal* %3)
ret void
}

LLVM IR (-O2):
%struct.EmuGlobal = type { i32 }
define void @lemu_global_free(%struct.EmuGlobal* %0) {
%2 = tail call i32 @lemu_core_global_free(%struct.EmuGlobal* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(unsigned char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ strcpy(char *, char *);
void init_header(unsigned char *dskhead, int extended) {
  memset(dskhead, 0, 256);
  if (extended)
    strcpy((char *)dskhead, "EXTENDED CPC DSK File\r\nDisk-Info\r\nLIBDSK "
                            "1.5.5");
  else
    strcpy((char *)dskhead, "MV - CPCEMU Disk-File\r\nDisk-Info\r\nLIBDSK "
                            "1.5.5");
}


x86 assembly (clang, -O0):
<init_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1040 <memset@plt>
cmpl   $0x0,-0xc(%rbp)
je     115e <init_header+0x3e>
mov    -0x8(%rbp),%rdi
lea    0xeac(%rip),%rsi
call   1030 <strcpy@plt>
jmp    116e <init_header+0x4e>
mov    -0x8(%rbp),%rdi
lea    0xec6(%rip),%rsi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_header>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %esi,%esi
mov    $0x100,%edx
call   1040 <memset@plt>
test   %ebp,%ebp
lea    0xef2(%rip),%rax
lea    0xebc(%rip),%rsi
cmove  %rax,%rsi
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
@.str = [47 x i8] c"EXTENDED CPC DSK File\0D\0ADisk-Info\0D\0ALIBDSK 1.5.5\00"
@.str.1 = [47 x i8] c"MV - CPCEMU Disk-File\0D\0ADisk-Info\0D\0ALIBDSK 1.5.5\00"
define void @init_header(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = call i32 @memset(i8* %5, i32 0, i32 256)
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = call i32 @strcpy(i8* %10, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
br label %15
12: ; preds = %2
%13 = load i8*, i8** %3
%14 = call i32 @strcpy(i8* %13, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
br label %15
15: ; preds = %12, %9
ret void
}

LLVM IR (-O2):
@.str = [47 x i8] c"EXTENDED CPC DSK File\0D\0ADisk-Info\0D\0ALIBDSK 1.5.5\00"
@.str.1 = [47 x i8] c"MV - CPCEMU Disk-File\0D\0ADisk-Info\0D\0ALIBDSK 1.5.5\00"
define void @init_header(i8* %0, i32 %1) {
%3 = tail call i32 @memset(i8* %0, i32 0, i32 256)
%4 = icmp eq i32 %1, 0
%5 = select i1 %4, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0)
%6 = tail call i32 @strcpy(i8* %0, i8* %5)
ret void
}
void rop3_54_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D | T;
  stk1 = S ^ stk2;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_54_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xa(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_54_0_1>:
mov    (%rdi),%r8b
mov    %r8d,%ecx
or     %dl,%cl
xor    %sil,%cl
mov    %edx,%eax
not    %al
or     %sil,%al
and    %cl,%al
not    %sil
and    %dl,%sil
and    %r8b,%sil
or     %al,%sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_54_0_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i8, i8* %6
%13 = zext i8 %12 to i32
%14 = or i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %5
%17 = zext i8 %16 to i32
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = xor i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %7
%22 = load i8, i8* %7
%23 = zext i8 %22 to i32
%24 = load i8, i8* %5
%25 = zext i8 %24 to i32
%26 = and i32 %23, %25
%27 = load i8, i8* %7
%28 = zext i8 %27 to i32
%29 = load i8, i8* %6
%30 = zext i8 %29 to i32
%31 = xor i32 %30, -1
%32 = and i32 %28, %31
%33 = or i32 %26, %32
%34 = load i8, i8* %6
%35 = zext i8 %34 to i32
%36 = load i8, i8* %5
%37 = zext i8 %36 to i32
%38 = xor i32 %37, -1
%39 = and i32 %35, %38
%40 = load i8*, i8** %4
%41 = load i8, i8* %40
%42 = zext i8 %41 to i32
%43 = and i32 %39, %42
%44 = or i32 %33, %43
%45 = trunc i32 %44 to i8
%46 = load i8*, i8** %4
store i8 %45, i8* %46
ret void
}

LLVM IR (-O2):
define void @rop3_54_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %4, %2
%6 = xor i8 %5, %1
%7 = xor i8 %2, -1
%8 = or i8 %7, %1
%9 = and i8 %6, %8
%10 = xor i8 %1, -1
%11 = and i8 %10, %2
%12 = and i8 %11, %4
%13 = or i8 %9, %12
store i8 %13, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ return_struct_f2();
int /*<<< orphan*/ take_struct_f2(int /*<<< orphan*/);
void test_struct_f2() { take_struct_f2(return_struct_f2()); }


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

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

LLVM IR (-O0):
define void @test_struct_f2() {
%1 = call i32 (...) @return_struct_f2()
%2 = call i32 @take_struct_f2(i32 %1)
ret void
}

LLVM IR (-O2):
define void @test_struct_f2() {
%1 = tail call i32 (...) @return_struct_f2()
%2 = tail call i32 @take_struct_f2(i32 %1)
ret void
}
float INT_TO_REAL(short var) {
  float newvar = (float)var;
  return newvar;
}


x86 assembly (clang, -O0):
<INT_TO_REAL>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<INT_TO_REAL>:
cvtsi2ss %edi,%xmm0
ret

LLVM IR (-O0):
define float @INT_TO_REAL(i16 signext %0) {
%2 = alloca i16
%3 = alloca float
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = sitofp i16 %4 to float
store float %5, float* %3
%6 = load float, float* %3
ret float %6
}

LLVM IR (-O2):
define float @INT_TO_REAL(i16 signext %0) {
%2 = sitofp i16 %0 to float
ret float %2
}
/* Variables and functions */
void *realloc(void *, size_t);
void *xcrealloc(void *ptr, size_t size) {
  void *mem;
  mem = realloc(ptr, size);
  return (mem);
}


x86 assembly (clang, -O0):
<xcrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcrealloc>:
jmp    1030 <realloc@plt>

LLVM IR (-O0):
define i8* @xcrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
ret i8* %9
}

LLVM IR (-O2):
define noalias i8* @xcrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
ret i8* %3
}
const char *dd_pbl_ios_fb_user_name() { return ""; }


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

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @dd_pbl_ios_fb_user_name() {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @dd_pbl_ios_fb_user_name() {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void show_usage(const char *program_name) {
  fprintf(stderr, "Usage: %s <network_interface> <EtherType>\n", program_name);
}


x86 assembly (clang, -O0):
<show_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [43 x i8] c"Usage: %s <network_interface> <EtherType>\0A\00"
define void @show_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [43 x i8] c"Usage: %s <network_interface> <EtherType>\0A\00"
define void @show_usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}