xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
scalar_t__ read(int /*<<< orphan*/, int *, int);
int getchr(void) {
  uint8_t c;
  if (read(0, &c, 1) == 0)
    exit(1);
  return c;
}


x86 assembly (clang, -O0):
<getchr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
lea    -0x4(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
cmp    $0x0,%rax
jne    114c <getchr+0x2c>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getchr>:
push   %rax
lea    0x4(%rsp),%rsi
xor    %edi,%edi
mov    $0x1,%edx
call   1030 <read@plt>
test   %rax,%rax
je     113d <getchr+0x1d>
mov    0x4(%rsp),%eax
pop    %rcx
ret
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @getchr() {
%1 = alloca i32
%2 = call i64 @read(i32 0, i32* %1, i32 1)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @exit(i32 1)
unreachable
6: ; preds = %0
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @getchr() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i64 @read(i32 0, i32* %1, i32 1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %0
%8 = load i32, i32* %1
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ write(char *, char *, char *);
void function_auname(char *auname) { write("csv-task.csv", "%s,", auname); }


x86 assembly (clang, -O0):
<function_auname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xed9(%rip),%rdi
lea    0xedf(%rip),%rsi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<function_auname>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xeec(%rip),%rsi
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"csv-task.csv\00"
@.str.1 = [4 x i8] c"%s,\00"
define void @function_auname(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @write(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"csv-task.csv\00"
@.str.1 = [4 x i8] c"%s,\00"
define void @function_auname(i8* %0) {
%2 = tail call i32 @write(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
char *str_trim_end_inplace(char *, char const *);
char *xstrdup(char const *);
char *str_trim_end(const char *str, const char *set) {
  char *copy = xstrdup(str);
  return str_trim_end_inplace(copy, set);
}


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

x86 assembly (clang, -O2):
<str_trim_end>:
push   %rbx
mov    %rsi,%rbx
call   1030 <xstrdup@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <str_trim_end_inplace@plt>

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

LLVM IR (-O2):
define i8* @str_trim_end(i8* %0, i8* %1) {
%3 = tail call i8* @xstrdup(i8* %0)
%4 = tail call i8* @str_trim_end_inplace(i8* %3, i8* %1)
ret i8* %4
}
void XWarpPointer() {}


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

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

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

LLVM IR (-O2):
define void @XWarpPointer() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FALSE;
int /*<<< orphan*/ open_copyinfo(int /*<<< orphan*/, char const *,
                                 unsigned long long);
void open_recvinfo(const char *name, unsigned long long size) {
  open_copyinfo(FALSE, name, size);
}


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

x86 assembly (clang, -O2):
<open_recvinfo>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
jmp    1030 <open_copyinfo@plt>

LLVM IR (-O0):
@FALSE = global i32 0
define void @open_recvinfo(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i32, i32* @FALSE
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i32 @open_copyinfo(i32 %5, i8* %6, i64 %7)
ret void
}

LLVM IR (-O2):
@FALSE = global i32 0
define void @open_recvinfo(i8* %0, i64 %1) {
%3 = load i32, i32* @FALSE
%4 = tail call i32 @open_copyinfo(i32 %3, i8* %0, i64 %1)
ret void
}
/* Type definitions */
struct user_desc {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __NR_modify_ldt;
int syscall(int /*<<< orphan*/, int, struct user_desc *, unsigned long);
int __modify_ldt(int func, struct user_desc *user_desc, unsigned long bc) {
  return syscall(__NR_modify_ldt, func, user_desc, bc);
}


x86 assembly (clang, -O0):
<__modify_ldt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__modify_ldt>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.user_desc = type { i32 }
@__NR_modify_ldt = global i32 0
define i32 @__modify_ldt(i32 %0, %struct.user_desc* %1, i64 %2) {
%4 = alloca i32
%5 = alloca %struct.user_desc*
%6 = alloca i64
store i32 %0, i32* %4
store %struct.user_desc* %1, %struct.user_desc** %5
store i64 %2, i64* %6
%7 = load i32, i32* @__NR_modify_ldt
%8 = load i32, i32* %4
%9 = load %struct.user_desc*, %struct.user_desc** %5
%10 = load i64, i64* %6
%11 = call i32 @syscall(i32 %7, i32 %8, %struct.user_desc* %9, i64 %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.user_desc = type { i32 }
@__NR_modify_ldt = global i32 0
define i32 @__modify_ldt(i32 %0, %struct.user_desc* %1, i64 %2) {
%4 = load i32, i32* @__NR_modify_ldt
%5 = tail call i32 @syscall(i32 %4, i32 %0, %struct.user_desc* %1, i64 %2)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ print_str(char *);
int /*<<< orphan*/ syscall();
void task2_func(void) {
  print_str("task2: Created!\n");
  print_str("task2: Now, return to kernel mode\n");
  syscall();
  while (1) {
    print_str("task2: Running...\n");
    delay(1000);
  }
}


x86 assembly (clang, -O0):
<task2_func>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1040 <print_str@plt>
lea    0xeca(%rip),%rdi
call   1040 <print_str@plt>
mov    $0x0,%al
call   1050 <syscall@plt>
lea    0xeda(%rip),%rdi
call   1040 <print_str@plt>
mov    $0x3e8,%edi
call   1030 <delay@plt>
jmp    1153 <task2_func+0x23>

x86 assembly (clang, -O2):
<task2_func>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1040 <print_str@plt>
lea    0xecd(%rip),%rdi
call   1040 <print_str@plt>
xor    %eax,%eax
call   1050 <syscall@plt>
lea    0xedd(%rip),%rbx
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1040 <print_str@plt>
mov    $0x3e8,%edi
call   1030 <delay@plt>
jmp    1160 <task2_func+0x30>

LLVM IR (-O0):
@.str = [17 x i8] c"task2: Created!\0A\00"
@.str.1 = [35 x i8] c"task2: Now, return to kernel mode\0A\00"
@.str.2 = [19 x i8] c"task2: Running...\0A\00"
define void @task2_func() {
%1 = call i32 @print_str(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @print_str(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (...) @syscall()
br label %4
4: ; preds = %0, %4
%5 = call i32 @print_str(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @delay(i32 1000)
br label %4
}

LLVM IR (-O2):
@.str = [17 x i8] c"task2: Created!\0A\00"
@.str.1 = [35 x i8] c"task2: Now, return to kernel mode\0A\00"
@.str.2 = [19 x i8] c"task2: Running...\0A\00"
define void @task2_func() {
%1 = tail call i32 @print_str(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @print_str(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (...) @syscall()
br label %4
4: ; preds = %0, %4
%5 = tail call i32 @print_str(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @delay(i32 1000)
br label %4
}
/* Variables and functions */
int rand();
int yuiRand(void) { return rand(); }


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

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

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

LLVM IR (-O2):
define i32 @yuiRand() {
%1 = tail call i32 (...) @rand()
ret i32 %1
}
void glGetPointerv(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glGetPointerv() {
ret void
}
void vInitMyPWM(void) {}


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

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

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

LLVM IR (-O2):
define void @vInitMyPWM() {
ret void
}
int f2(float __x) {
  union {
    float __f;
    unsigned int __u;
  } __u;
  return (int)(__u.__u >> 31);
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x1f,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.anon = type { float }
define i32 @f2(float %0) {
%2 = alloca float
%3 = alloca %union.anon
store float %0, float* %2
%4 = bitcast %union.anon* %3 to i32*
%5 = load i32, i32* %4
%6 = lshr i32 %5, 31
ret i32 %6
}

LLVM IR (-O2):
define i32 @f2(float %0) {
ret i32 0
}
int tlv_len(unsigned char *outp) {
  int byte1 = *outp & 1;
  int byte2 = *(outp + 1);
  return byte1 << 8 | byte2;
}


x86 assembly (clang, -O0):
<tlv_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
and    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
or     -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tlv_len>:
movzbl (%rdi),%eax
and    $0x1,%eax
movzbl 0x1(%rdi),%ecx
shl    $0x8,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @tlv_len(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = and i32 %7, 1
store i32 %8, i32* %3
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
store i32 %12, i32* %4
%13 = load i32, i32* %3
%14 = shl i32 %13, 8
%15 = load i32, i32* %4
%16 = or i32 %14, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @tlv_len(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 1
%4 = zext i8 %3 to i32
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %4, 8
%9 = or i32 %8, %7
ret i32 %9
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
int tlv_get_length(int *);
void tlv_append_empty(uint8_t *p_tlv) {
  uint16_t i_length = tlv_get_length(p_tlv);
  p_tlv[4 + i_length] = 0 >> 8;
  p_tlv[4 + i_length + 1] = 0 & 0xff;
}


x86 assembly (clang, -O0):
<tlv_append_empty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <tlv_get_length@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x4,%ecx
movslq %ecx,%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x4,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movl   $0x0,(%rax,%rcx,4)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tlv_append_empty>:
push   %rbx
mov    %rdi,%rbx
call   1030 <tlv_get_length@plt>
cltq
movq   $0x0,0x10(%rbx,%rax,4)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @tlv_append_empty(i32* %0) {
%2 = tail call i32 @tlv_get_length(i32* %0)
%3 = add nsw i32 %2, 4
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
store i32 0, i32* %5
%6 = add nsw i32 %2, 5
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
store i32 0, i32* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0xba() {
  Assert_real((ispunct(186) == 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_ispunct.c",
              935, ("ispunct should be 0 for 0xba"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0xba>:
push   %rax
mov    $0xba,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3a7,%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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xba\00"
define void @t_ispunct_0xba() {
%1 = call i64 @ispunct(i32 186)
%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 935, i8* getelementptr inbounds ([29 x i8], [29 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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xba\00"
define void @t_ispunct_0xba() {
%1 = tail call i64 @ispunct(i32 186)
%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 935, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int CalculateLine(int width, int bitdepth) {
  return ((width * bitdepth) + 7) / 8;
}


x86 assembly (clang, -O0):
<CalculateLine>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
add    $0x7,%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<CalculateLine>:
imul   %esi,%edi
lea    0x7(%rdi),%ecx
lea    0xe(%rdi),%eax
test   %ecx,%ecx
cmovns %ecx,%eax
sar    $0x3,%eax
ret

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

LLVM IR (-O2):
define i32 @CalculateLine(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = add nsw i32 %3, 7
%5 = sdiv i32 %4, 8
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ DoXmm();
int /*<<< orphan*/ ZeroXmms();
int main() {
  ZeroXmms();
  DoXmm();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @ZeroXmms()
%2 = tail call i32 (...) @DoXmm()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rec_inc(int to_inc, int nr_of_incs) {
  int res;
  printf("nr_of_incs %d\n", nr_of_incs);
  if (nr_of_incs == 0) {
    return to_inc;
  } else {
    res = rec_inc(to_inc + 1, nr_of_incs - 1);
    return res;
  }
}


x86 assembly (clang, -O0):
<rec_inc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x0,-0xc(%rbp)
jne    1152 <rec_inc+0x32>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116c <rec_inc+0x4c>
mov    -0x8(%rbp),%edi
add    $0x1,%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1040 <rec_inc@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rec_inc>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r15d
mov    %edi,%r14d
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
test   %r15d,%r15d
je     1155 <rec_inc+0x45>
lea    -0x1(%r15),%ebp
lea    0xec7(%rip),%rbx
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
add    $0xffffffff,%ebp
jb     1140 <rec_inc+0x30>
add    %r14d,%r15d
mov    %r15d,%r14d
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"nr_of_incs %d\0A\00"
define i32 @rec_inc(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %5
%8 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = load i32, i32* %4
store i32 %12, i32* %3
br label %20
13: ; preds = %2
%14 = load i32, i32* %4
%15 = add nsw i32 %14, 1
%16 = load i32, i32* %5
%17 = sub nsw i32 %16, 1
%18 = call i32 @rec_inc(i32 %15, i32 %17)
store i32 %18, i32* %6
%19 = load i32, i32* %6
store i32 %19, i32* %3
br label %20
20: ; preds = %13, %11
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
@.str = [15 x i8] c"nr_of_incs %d\0A\00"
define i32 @rec_inc(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1)
%4 = icmp eq i32 %1, 0
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %7, %5 ], [ %1, %2 ]
%7 = add nsw i32 %6, -1
%8 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = icmp eq i32 %7, 0
br i1 %9, label %10, label %5
10: ; preds = %5
%11 = add i32 %1, %0
br label %12
12: ; preds = %10, %2
%13 = phi i32 [ %0, %2 ], [ %11, %10 ]
ret i32 %13
}
int execute_pwritev() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_pwritev() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ write(int, unsigned char *, int);
void willEcho(int f) {
  unsigned char e[3] = {255, 251, 1};
  write(f, e, 3);
}


x86 assembly (clang, -O0):
<willEcho>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0xede(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xed6(%rip),%al
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x7(%rbp),%rsi
mov    $0x3,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<willEcho>:
push   %rax
movb   $0x1,0x6(%rsp)
movw   $0xfbff,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x3,%edx
call   1030 <write@plt>
pop    %rax
ret

LLVM IR (-O0):
@__const.willEcho.e = [3 x i8] c"\FF\FB\01"
define void @willEcho(i32 %0) {
%2 = alloca i32
%3 = alloca [3 x i8]
store i32 %0, i32* %2
%4 = bitcast [3 x i8]* %3 to i8*
%5 = load i32, i32* %2
%6 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%7 = call i32 @write(i32 %5, i8* %6, i32 3)
ret void
}

LLVM IR (-O2):
@__const.willEcho.e = [3 x i8] c"\FF\FB\01"
define void @willEcho(i32 %0) {
%2 = alloca [3 x i8]
%3 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%4 = call i32 @write(i32 %0, i8* %3, i32 3)
ret void
}
/* Type definitions */
struct icmp6_hdr {
  int /*<<< orphan*/ icmp6_seq;
};
typedef int /*<<< orphan*/ __u8;

/* Variables and functions */
int ntohs(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
void pr_echo_reply(__u8 *_icmph, int cc) {
  struct icmp6_hdr *icmph = (struct icmp6_hdr *)_icmph;
  printf(" icmp_seq=%u", ntohs(icmph->icmp6_seq));
}


x86 assembly (clang, -O0):
<pr_echo_reply>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
call   1040 <ntohs@plt>
mov    %eax,%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pr_echo_reply>:
push   %rax
mov    (%rdi),%edi
call   1040 <ntohs@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.icmp6_hdr = type { i32 }
@.str = [13 x i8] c" icmp_seq=%u\00"
define void @pr_echo_reply(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca %struct.icmp6_hdr*
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32*, i32** %3
%7 = bitcast i32* %6 to %struct.icmp6_hdr*
store %struct.icmp6_hdr* %7, %struct.icmp6_hdr** %5
%8 = load %struct.icmp6_hdr*, %struct.icmp6_hdr** %5
%9 = getelementptr inbounds %struct.icmp6_hdr, %struct.icmp6_hdr* %8, i32 0, i32 0
%10 = load i32, i32* %9
%11 = call i32 @ntohs(i32 %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c" icmp_seq=%u\00"
define void @pr_echo_reply(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = tail call i32 @ntohs(i32 %3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
void __mp_checkheap(char *s, char *t, unsigned long u) {}


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

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

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

LLVM IR (-O2):
define void @__mp_checkheap(i8* nocapture %0, i8* nocapture %1, i64 %2) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void print_header(FILE *stream) { fprintf(stream, "SA;SM;N\n"); }


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

x86 assembly (clang, -O2):
<print_header>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"SA;SM;N\0A\00"
define void @print_header(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"SA;SM;N\0A\00"
define void @print_header(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 8, i64 1, i32* %0)
ret void
}
/* Variables and functions */
int binExp(int, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(void) {
  int base = 0, power = 0;
  scanf("%d %d", &base, &power);
  printf("%d\n", binExp(base, power));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xeac(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <binExp@plt>
mov    %eax,%esi
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
movl   $0x0,(%rsp)
lea    0xeb9(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1040 <binExp@plt>
lea    0xe9f(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @binExp(i32 %6, i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
int strcmp(const char *s1, const char *s2) {
  while (*s1 && *s1 == *s2) {
    ++s1;
    ++s2;
  }
  return *((unsigned char *)s1) - *((unsigned char *)s2);
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1137 <strcmp+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1147 <strcmp+0x47>
jmp    1164 <strcmp+0x64>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <strcmp+0xc>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movzbl (%rcx),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
mov    (%rdi),%al
test   %al,%al
je     1123 <strcmp+0x23>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
cmp    (%rsi),%al
jne    1125 <strcmp+0x25>
add    $0x1,%rsi
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <strcmp+0x10>
xor    %eax,%eax
movzbl %al,%eax
movzbl (%rsi),%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %11
%6 = phi i8 [ %14, %11 ], [ %3, %2 ]
%7 = phi i8* [ %13, %11 ], [ %1, %2 ]
%8 = phi i8* [ %12, %11 ], [ %0, %2 ]
%9 = load i8, i8* %7
%10 = icmp eq i8 %6, %9
br i1 %10, label %11, label %16
11: ; preds = %5
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = load i8, i8* %12
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %11, %2
%17 = phi i8* [ %1, %2 ], [ %13, %11 ], [ %7, %5 ]
%18 = phi i8 [ 0, %2 ], [ 0, %11 ], [ %6, %5 ]
%19 = zext i8 %18 to i32
%20 = load i8, i8* %17
%21 = zext i8 %20 to i32
%22 = sub nsw i32 %19, %21
ret i32 %22
}
int snd_info_card_free(struct snd_card *card) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.snd_card = type opaque
define i32 @snd_info_card_free(%struct.snd_card* nocapture readnone %0) {
ret i32 0
}
void ff_hevc_put_hevc_qpel_h12_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_qpel_h12_12_sse4() {
ret void
}
/* Variables and functions */
long long abidi(int, long long);
int main(void) {
  long long a = 1;
  a = abidi(10, a);
  if (a != 2)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    $0xa,%edi
call   1030 <abidi@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x2,-0x10(%rbp)
je     1150 <main+0x40>
movl   $0x1,-0x4(%rbp)
jmp    1157 <main+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%esi
mov    $0xa,%edi
call   1030 <abidi@plt>
xor    %ecx,%ecx
cmp    $0x2,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @abidi(i32 10, i64 1)
%2 = icmp ne i64 %1, 2
%3 = zext i1 %2 to i32
ret i32 %3
}
float foo04(float a, float b, float c) { return (a * b - c); }


x86 assembly (clang, -O0):
<foo04>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm2
movss  -0xc(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo04>:
mulss  %xmm1,%xmm0
subss  %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @foo04(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = load float, float* %6
%10 = fneg float %9
%11 = call float @llvm.fmuladd.f32(float %7, float %8, float %10)
ret float %11
}

LLVM IR (-O2):
define float @foo04(float %0, float %1, float %2) {
%4 = fneg float %2
%5 = tail call float @llvm.fmuladd.f32(float %0, float %1, float %4)
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ QSort2(int *, int /*<<< orphan*/, int);
void QuickSort2(int a[], int n) { QSort2(a, 0, n - 1); }


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

x86 assembly (clang, -O2):
<QuickSort2>:
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <QSort2@plt>

LLVM IR (-O0):
define void @QuickSort2(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %6, 1
%8 = call i32 @QSort2(i32* %5, i32 0, i32 %7)
ret void
}

LLVM IR (-O2):
define void @QuickSort2(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i32 @QSort2(i32* %0, i32 0, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int strlen(char const *);
int write(int, char const *, int);
int serialport_write(int fd, const char *str) {
  int len = strlen(str);
  int n = write(fd, str, len);
  if (n != len) {
    perror("serialport_write: couldn't write whole string\n");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<serialport_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
je     1181 <serialport_write+0x51>
lea    0xe90(%rip),%rdi
call   1050 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1188 <serialport_write+0x58>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serialport_write>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%r14d
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %eax,%ebp
mov    %r14d,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ebp,%ecx
jne    115e <serialport_write+0x2e>
pop    %rbx
pop    %r14
pop    %rbp
ret
lea    0xe9b(%rip),%rdi
call   1050 <perror@plt>
mov    $0xffffffff,%eax
jmp    1159 <serialport_write+0x29>

LLVM IR (-O0):
@.str = [47 x i8] c"serialport_write: couldn't write whole string\0A\00"
define i32 @serialport_write(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
%8 = load i8*, i8** %5
%9 = call i32 @strlen(i8* %8)
store i32 %9, i32* %6
%10 = load i32, i32* %4
%11 = load i8*, i8** %5
%12 = load i32, i32* %6
%13 = call i32 @write(i32 %10, i8* %11, i32 %12)
store i32 %13, i32* %7
%14 = load i32, i32* %7
%15 = load i32, i32* %6
%16 = icmp ne i32 %14, %15
br i1 %16, label %17, label %19
17: ; preds = %2
%18 = call i32 @perror(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %20
19: ; preds = %2
store i32 0, i32* %3
br label %20
20: ; preds = %19, %17
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
@.str = [47 x i8] c"serialport_write: couldn't write whole string\0A\00"
define i32 @serialport_write(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %3)
%5 = icmp eq i32 %4, %3
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @perror(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ -1, %6 ], [ 0, %2 ]
ret i32 %9
}
void MPI_Wait() {}


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

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

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

LLVM IR (-O2):
define void @MPI_Wait() {
ret void
}
void p2p_init() {}


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

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

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

LLVM IR (-O2):
define void @p2p_init() {
ret void
}
/* Variables and functions */
int snprintf(char *, int, char *, unsigned long);
int STR_SYMBOL_RATE(char *p, int n, unsigned long rate) {
  if (rate == 0)
    return 0;
  return snprintf(p, n, "rate:%ld ", rate);
}


x86 assembly (clang, -O0):
<STR_SYMBOL_RATE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    113a <STR_SYMBOL_RATE+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    1154 <STR_SYMBOL_RATE+0x44>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rcx
lea    0xeb4(%rip),%rdx
call   1030 <snprintf@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<STR_SYMBOL_RATE>:
test   %rdx,%rdx
je     1124 <STR_SYMBOL_RATE+0x14>
mov    %rdx,%rcx
lea    0xee1(%rip),%rdx
jmp    1030 <snprintf@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"rate:%ld \00"
define i32 @STR_SYMBOL_RATE(i8* %0, i32 %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @snprintf(i8* %0, i32 %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64 %2)
br label %7
7: ; preds = %3, %5
%8 = phi i32 [ %6, %5 ], [ 0, %3 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int scanf(char *, int *, int *);
int main() {
  int a, b;
  while (scanf("%d%d", &a, &b) == 2) {
    printf("%d\n", a + b);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
cmp    $0x2,%eax
jne    1163 <main+0x43>
mov    -0x8(%rbp),%esi
add    -0xc(%rbp),%esi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xed1(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
cmp    $0x2,%eax
jne    1182 <main+0x62>
lea    0xebd(%rip),%r14
lea    0xeb1(%rip),%r15
lea    0x4(%rsp),%r12
mov    %rsp,%rbx
nopw   0x0(%rax,%rax,1)
mov    (%rsp),%esi
add    0x4(%rsp),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1040 <scanf@plt>
cmp    $0x2,%eax
je     1160 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = icmp eq i32 %5, 2
br i1 %6, label %7, label %14
7: ; preds = %0, %7
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = add nsw i32 %9, %8
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%13 = icmp eq i32 %12, 2
br i1 %13, label %7, label %14
14: ; preds = %7, %0
ret i32 0
}
/* Type definitions */
struct parsed_opr {
  int dummy;
};
struct parsed_op {
  int dummy;
};

/* Variables and functions */
char *out_opr_float(char *, size_t, struct parsed_op *, struct parsed_opr *,
                    int /*<<< orphan*/, int);
char *out_dst_opr_float(char *buf, size_t buf_size, struct parsed_op *po,
                        struct parsed_opr *popr, int need_float_stack) {
  return out_opr_float(buf, buf_size, po, popr, 0, need_float_stack);
}


x86 assembly (clang, -O0):
<out_dst_opr_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r9d
xor    %r8d,%r8d
call   1030 <out_opr_float@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<out_dst_opr_float>:
mov    %r8d,%r9d
xor    %r8d,%r8d
jmp    1030 <out_opr_float@plt>

LLVM IR (-O0):
%struct.parsed_op = type { i32 }
%struct.parsed_opr = type { i32 }
define i8* @out_dst_opr_float(i8* %0, i64 %1, %struct.parsed_op* %2, %struct.parsed_opr* %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i64
%8 = alloca %struct.parsed_op*
%9 = alloca %struct.parsed_opr*
%10 = alloca i32
store i8* %0, i8** %6
store i64 %1, i64* %7
store %struct.parsed_op* %2, %struct.parsed_op** %8
store %struct.parsed_opr* %3, %struct.parsed_opr** %9
store i32 %4, i32* %10
%11 = load i8*, i8** %6
%12 = load i64, i64* %7
%13 = load %struct.parsed_op*, %struct.parsed_op** %8
%14 = load %struct.parsed_opr*, %struct.parsed_opr** %9
%15 = load i32, i32* %10
%16 = call i8* @out_opr_float(i8* %11, i64 %12, %struct.parsed_op* %13, %struct.parsed_opr* %14, i32 0, i32 %15)
ret i8* %16
}

LLVM IR (-O2):
%struct.parsed_op = type { i32 }
%struct.parsed_opr = type { i32 }
define i8* @out_dst_opr_float(i8* %0, i64 %1, %struct.parsed_op* %2, %struct.parsed_opr* %3, i32 %4) {
%6 = tail call i8* @out_opr_float(i8* %0, i64 %1, %struct.parsed_op* %2, %struct.parsed_opr* %3, i32 0, i32 %4)
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ mmuReset();
void mmuInit(void) { mmuReset(); }


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

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

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

LLVM IR (-O2):
define void @mmuInit() {
%1 = tail call i32 (...) @mmuReset()
ret void
}
/* Variables and functions */
int tuner_i2c_write(void *, unsigned char, int, unsigned char *, int);
int fc8080_write(void *handle, unsigned char addr, unsigned char data) {
  int res;
  unsigned char tmp;
  tmp = data;
  res = tuner_i2c_write(handle, addr, 1, &tmp, 1);
  return res;
}


x86 assembly (clang, -O0):
<fc8080_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%r8d
lea    -0x11(%rbp),%rcx
movzbl -0x9(%rbp),%esi
mov    %r8d,%edx
call   1030 <tuner_i2c_write@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fc8080_write>:
push   %rax
mov    %dl,0x7(%rsp)
lea    0x7(%rsp),%rcx
mov    $0x1,%edx
mov    $0x1,%r8d
call   1030 <tuner_i2c_write@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @fc8080_write(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i32
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8, i8* %6
store i8 %9, i8* %8
%10 = load i8*, i8** %4
%11 = load i8, i8* %5
%12 = call i32 @tuner_i2c_write(i8* %10, i8 zeroext %11, i32 1, i8* %8, i32 1)
store i32 %12, i32* %7
%13 = load i32, i32* %7
ret i32 %13
}

LLVM IR (-O2):
define i32 @fc8080_write(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8
store i8 %2, i8* %4
%5 = call i32 @tuner_i2c_write(i8* %0, i8 zeroext %1, i32 1, i8* %4, i32 1)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ _fwalk(int /*<<< orphan*/);
int /*<<< orphan*/ fclose;
void _cleanup(void) { (void)_fwalk(fclose); }


x86 assembly (clang, -O0):
<_cleanup>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <_fwalk@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_cleanup>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <_fwalk@plt>

LLVM IR (-O0):
@fclose = global i32 0
define void @_cleanup() {
%1 = load i32, i32* @fclose
%2 = call i32 @_fwalk(i32 %1)
ret void
}

LLVM IR (-O2):
@fclose = global i32 0
define void @_cleanup() {
%1 = load i32, i32* @fclose
%2 = tail call i32 @_fwalk(i32 %1)
ret void
}
int symbol_exit(struct kvm *kvm) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.kvm = type opaque
define i32 @symbol_exit(%struct.kvm* nocapture readnone %0) {
ret i32 0
}
int test_imm_46int16_reg(short val) {
  return ((val) & (0x46 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_46int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0x46,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_46int16_reg(i16 signext %0) {
%2 = and i16 %0, 70
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}