xunge/DecIR huggingface dataset:
/* Variables and functions */
int getchar();
int /*<<< orphan*/ putchar(int);
void inquote(int c) {
  int d;
  putchar(c);
  while ((d = getchar()) != c)
    if (d == '\\')
      getchar();
}


x86 assembly (clang, -O0):
<inquote>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <putchar@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
cmp    -0x4(%rbp),%eax
je     115c <inquote+0x3c>
cmpl   $0x5c,-0x8(%rbp)
jne    1157 <inquote+0x37>
mov    $0x0,%al
call   1040 <getchar@plt>
jmp    1133 <inquote+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inquote>:
push   %rbx
mov    %edi,%ebx
call   1030 <putchar@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    %ebx,%eax
je     1149 <inquote+0x29>
cmp    $0x5c,%eax
jne    1130 <inquote+0x10>
xor    %eax,%eax
call   1040 <getchar@plt>
jmp    1130 <inquote+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @inquote(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @putchar(i32 %4)
br label %6
6: ; preds = %15, %1
%7 = call i32 (...) @getchar()
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = icmp ne i32 %7, %8
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = load i32, i32* %3
%12 = icmp eq i32 %11, 92
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = call i32 (...) @getchar()
br label %15
15: ; preds = %13, %10
br label %6
16: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @inquote(i32 %0) {
%2 = tail call i32 @putchar(i32 %0)
%3 = tail call i32 (...) @getchar()
%4 = icmp eq i32 %3, %0
br i1 %4, label %13, label %5
5: ; preds = %1, %10
%6 = phi i32 [ %11, %10 ], [ %3, %1 ]
%7 = icmp eq i32 %6, 92
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 (...) @getchar()
br label %10
10: ; preds = %8, %5
%11 = tail call i32 (...) @getchar()
%12 = icmp eq i32 %11, %0
br i1 %12, label %13, label %5
13: ; preds = %10, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ anotherFunction6(int);
scalar_t__ malloc(int);
void function_with_leak6() {
  char *x = (char *)malloc(12);
  anotherFunction6(3);
}


x86 assembly (clang, -O0):
<function_with_leak6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xc,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    $0x3,%edi
call   1040 <anotherFunction6@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<function_with_leak6>:
push   %rax
mov    $0xc,%edi
call   1030 <malloc@plt>
mov    $0x3,%edi
pop    %rax
jmp    1040 <anotherFunction6@plt>

LLVM IR (-O0):
define void @function_with_leak6() {
%1 = alloca i8*
%2 = call i64 @malloc(i32 12)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %1
%4 = call i32 @anotherFunction6(i32 3)
ret void
}

LLVM IR (-O2):
define void @function_with_leak6() {
%1 = tail call i64 @malloc(i32 12)
%2 = tail call i32 @anotherFunction6(i32 3)
ret void
}
int power(int num, int exp) {
  if (exp == 0)
    return (1);
  else if (exp == 1)
    return (num);
  int result = power(num, exp / 2);
  result *= result;
  if (exp % 2 == 1)
    result *= num;
  return (result);
}


x86 assembly (clang, -O0):
<power>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1134 <power+0x24>
movl   $0x1,-0x4(%rbp)
jmp    1194 <power+0x84>
cmpl   $0x1,-0xc(%rbp)
jne    1149 <power+0x39>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1194 <power+0x84>
jmp    114e <power+0x3e>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
call   1030 <power@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    118e <power+0x7e>
mov    -0x8(%rbp),%eax
imul   -0x10(%rbp),%eax
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):
<power>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
je     1151 <power+0x41>
mov    %esi,%ebp
mov    %edi,%r14d
cmp    $0x1,%esi
je     1157 <power+0x47>
mov    %ebp,%ebx
shr    $0x1f,%ebx
add    %ebp,%ebx
mov    %ebx,%esi
sar    %esi
mov    %r14d,%edi
call   1030 <power@plt>
and    $0xfffffffe,%ebx
sub    %ebx,%ebp
cmp    $0x1,%ebp
mov    $0x1,%ecx
cmove  %r14d,%ecx
imul   %eax,%eax
imul   %ecx,%eax
mov    %eax,%r14d
jmp    1157 <power+0x47>
mov    $0x1,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @power(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 = icmp eq i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 1, i32* %3
br label %33
10: ; preds = %2
%11 = load i32, i32* %5
%12 = icmp eq i32 %11, 1
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = load i32, i32* %4
store i32 %14, i32* %3
br label %33
15: ; preds = %10
br label %16
16: ; preds = %15
%17 = load i32, i32* %4
%18 = load i32, i32* %5
%19 = sdiv i32 %18, 2
%20 = call i32 @power(i32 %17, i32 %19)
store i32 %20, i32* %6
%21 = load i32, i32* %6
%22 = load i32, i32* %6
%23 = mul nsw i32 %22, %21
store i32 %23, i32* %6
%24 = load i32, i32* %5
%25 = srem i32 %24, 2
%26 = icmp eq i32 %25, 1
br i1 %26, label %27, label %31
27: ; preds = %16
%28 = load i32, i32* %4
%29 = load i32, i32* %6
%30 = mul nsw i32 %29, %28
store i32 %30, i32* %6
br label %31
31: ; preds = %27, %16
%32 = load i32, i32* %6
store i32 %32, i32* %3
br label %33
33: ; preds = %31, %13, %9
%34 = load i32, i32* %3
ret i32 %34
}

LLVM IR (-O2):
define i32 @power(i32 %0, i32 %1) {
switch i32 %1, label %6 [
i32 0, label %4
i32 1, label %3
]
3: ; preds = %2
br label %4
4: ; preds = %3, %2, %6
%5 = phi i32 [ %13, %6 ], [ %0, %3 ], [ 1, %2 ]
ret i32 %5
6: ; preds = %2
%7 = sdiv i32 %1, 2
%8 = tail call i32 @power(i32 %0, i32 %7)
%9 = srem i32 %1, 2
%10 = icmp eq i32 %9, 1
%11 = select i1 %10, i32 %0, i32 1
%12 = mul i32 %8, %11
%13 = mul i32 %12, %8
br label %4
}
void *stat() {}


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

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

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

LLVM IR (-O2):
define noalias i8* @stat() {
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ getpagesize();
int /*<<< orphan*/ munmap(int *, int /*<<< orphan*/);
void FreeMmap(int *mmap) { munmap(mmap, getpagesize()); }


x86 assembly (clang, -O0):
<FreeMmap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getpagesize@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1030 <munmap@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FreeMmap>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <getpagesize@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <munmap@plt>

LLVM IR (-O0):
define void @FreeMmap(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 (...) @getpagesize()
%5 = call i32 @munmap(i32* %3, i32 %4)
ret void
}

LLVM IR (-O2):
define void @FreeMmap(i32* %0) {
%2 = tail call i32 (...) @getpagesize()
%3 = tail call i32 @munmap(i32* %0, i32 %2)
ret void
}
float SCE_Math_Clampf(float a, float min, float max) {
  if (a < min)
    return min;
  else if (a > max)
    return max;
  else
    return a;
}


x86 assembly (clang, -O0):
<SCE_Math_Clampf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1135 <SCE_Math_Clampf+0x35>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    115d <SCE_Math_Clampf+0x5d>
movss  -0x8(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    1153 <SCE_Math_Clampf+0x53>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    115d <SCE_Math_Clampf+0x5d>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<SCE_Math_Clampf>:
minss  %xmm0,%xmm2
cmpltss %xmm1,%xmm0
movaps %xmm0,%xmm3
andnps %xmm2,%xmm3
andps  %xmm1,%xmm0
orps   %xmm3,%xmm0
ret

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

LLVM IR (-O2):
define float @SCE_Math_Clampf(float %0, float %1, float %2) {
%4 = fcmp olt float %0, %1
%5 = fcmp ogt float %0, %2
%6 = select i1 %5, float %2, float %0
%7 = select i1 %4, float %1, float %6
ret float %7
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_event_source_get_child_pid(void *s, pid_t *pid) {
  return -EINVAL;
}


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

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

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

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_event_source_get_child_pid(i8* nocapture readnone %0, i32* nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void EXTI9_5_IRQHandler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @EXTI9_5_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @EXTI9_5_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
int int_ops_xor(int l, int r) { return l ^ r; }


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

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

LLVM IR (-O0):
define i32 @int_ops_xor(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 = xor i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @int_ops_xor(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int string_NativeString_NativeString_file_exists_0(char *f) {
  FILE *hdl = fopen(f, "r");
  if (hdl != NULL) {
    fclose(hdl);
  }
  return hdl != NULL;
}


x86 assembly (clang, -O0):
<string_NativeString_NativeString_file_exists_0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1154 <string_NativeString_NativeString_file_exists_0+0x34>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_NativeString_NativeString_file_exists_0>:
push   %rbx
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
je     113d <string_NativeString_NativeString_file_exists_0+0x1d>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
test   %rbx,%rbx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
define i32 @string_NativeString_NativeString_file_exists_0(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = icmp ne i32* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32*, i32** %3
%10 = call i32 @fclose(i32* %9)
br label %11
11: ; preds = %8, %1
%12 = load i32*, i32** %3
%13 = icmp ne i32* %12, null
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @string_NativeString_NativeString_file_exists_0(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i32* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %4, %1
%7 = zext i1 %3 to i32
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ close(int);
int open_oom_adj();
scalar_t__ read(int, char *, int);
int get_oom_adj(void) {
  int val = 0;
  int fd = open_oom_adj();
  if (fd >= 0) {
    char buf[64];
    if (read(fd, buf, sizeof(buf)) > 0)
      val = atoi(buf);
    close(fd);
  }
  return val;
}


x86 assembly (clang, -O0):
<get_oom_adj>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <open_oom_adj@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1192 <get_oom_adj+0x52>
mov    -0x8(%rbp),%edi
lea    -0x50(%rbp),%rsi
mov    $0x40,%edx
call   1040 <read@plt>
cmp    $0x0,%rax
jle    118a <get_oom_adj+0x4a>
lea    -0x50(%rbp),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <close@plt>
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_oom_adj>:
push   %rbp
push   %rbx
sub    $0x48,%rsp
xor    %ebp,%ebp
xor    %eax,%eax
call   1050 <open_oom_adj@plt>
test   %eax,%eax
js     117e <get_oom_adj+0x3e>
mov    %eax,%ebx
mov    %rsp,%rsi
mov    %eax,%edi
mov    $0x40,%edx
call   1040 <read@plt>
test   %rax,%rax
jle    1175 <get_oom_adj+0x35>
mov    %rsp,%rdi
call   1060 <atoi@plt>
mov    %eax,%ebp
jmp    1177 <get_oom_adj+0x37>
xor    %ebp,%ebp
mov    %ebx,%edi
call   1030 <close@plt>
mov    %ebp,%eax
add    $0x48,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @get_oom_adj() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [64 x i8]
store i32 0, i32* %1
%4 = call i32 (...) @open_oom_adj()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp sge i32 %5, 0
br i1 %6, label %7, label %18
7: ; preds = %0
%8 = load i32, i32* %2
%9 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%10 = call i64 @read(i32 %8, i8* %9, i32 64)
%11 = icmp sgt i64 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %7
%13 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%14 = call i32 @atoi(i8* %13)
store i32 %14, i32* %1
br label %15
15: ; preds = %12, %7
%16 = load i32, i32* %2
%17 = call i32 @close(i32 %16)
br label %18
18: ; preds = %15, %0
%19 = load i32, i32* %1
ret i32 %19
}

LLVM IR (-O2):
define i32 @get_oom_adj() {
%1 = alloca [64 x i8]
%2 = tail call i32 (...) @open_oom_adj()
%3 = icmp sgt i32 %2, -1
br i1 %3, label %4, label %13
4: ; preds = %0
%5 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%6 = call i64 @read(i32 %2, i8* %5, i32 64)
%7 = icmp sgt i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = call i32 @atoi(i8* %5)
br label %10
10: ; preds = %8, %4
%11 = phi i32 [ %9, %8 ], [ 0, %4 ]
%12 = tail call i32 @close(i32 %2)
br label %13
13: ; preds = %10, %0
%14 = phi i32 [ %11, %10 ], [ 0, %0 ]
ret i32 %14
}
int nack_remove(char *buffer) {
  if (buffer[0] != 4)
    return -1;
  return buffer[3];
}


x86 assembly (clang, -O0):
<nack_remove>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x4,%eax
je     1124 <nack_remove+0x24>
movl   $0xffffffff,-0x4(%rbp)
jmp    112f <nack_remove+0x2f>
mov    -0x10(%rbp),%rax
movsbl 0x3(%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nack_remove>:
mov    $0xffffffff,%eax
cmpb   $0x4,(%rdi)
jne    110e <nack_remove+0xe>
movsbl 0x3(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @nack_remove(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 4
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 3
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ -1, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ mib_set(scalar_t__, void *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ startRip();
int setRipCapability(unsigned char enabled) {
  if (!mib_set(0 + 27, (void *)&enabled)) {
    printf("Set RIP error!");
    return -1;
  }
  startRip();
  return 0;
}


x86 assembly (clang, -O0):
<setRipCapability>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    $0x1b,%edi
lea    -0x5(%rbp),%rsi
call   1030 <mib_set@plt>
cmp    $0x0,%eax
jne    116d <setRipCapability+0x3d>
lea    0xea4(%rip),%rdi
call   1050 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    117b <setRipCapability+0x4b>
mov    $0x0,%al
call   1040 <startRip@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setRipCapability>:
push   %rbx
sub    $0x10,%rsp
mov    %dil,0xf(%rsp)
lea    0xf(%rsp),%rsi
mov    $0x1b,%edi
call   1030 <mib_set@plt>
test   %eax,%eax
je     1158 <setRipCapability+0x28>
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <startRip@plt>
jmp    1169 <setRipCapability+0x39>
lea    0xea1(%rip),%rdi
call   1050 <printf@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Set RIP error!\00"
define i32 @setRipCapability(i8 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = call i32 @mib_set(i64 27, i8* %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %2
br label %10
8: ; preds = %1
%9 = call i32 (...) @startRip()
store i32 0, i32* %2
br label %10
10: ; preds = %8, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@.str = [15 x i8] c"Set RIP error!\00"
define i32 @setRipCapability(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @mib_set(i64 27, i8* %2)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %9
7: ; preds = %1
%8 = call i32 (...) @startRip()
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ 0, %7 ], [ -1, %5 ]
ret i32 %10
}
void fc4a(x) const short x;
{}


x86 assembly (clang, -O0):
<fc4a>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @fc4a(i32 %0) {
%2 = alloca i16
%3 = trunc i32 %0 to i16
store i16 %3, i16* %2
ret void
}

LLVM IR (-O2):
define void @fc4a(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int i, t[5];
  t[4] = 0;
  for (i = 3; i >= 0; i--)
    t[i] = t[4] * i;
  printf("%d", t[0]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x3,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1154 <main+0x44>
mov    -0x10(%rbp),%ecx
imul   -0x8(%rbp),%ecx
movslq -0x8(%rbp),%rax
mov    %ecx,-0x20(%rbp,%rax,4)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
mov    -0x20(%rbp),%esi
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    0xee8(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}
/* Variables and functions */
size_t hash(const char *key, size_t seed, size_t table_size) {
  size_t h;
  char c;
  h = seed;
  while ((c = *key++)) {
    h += c;
    h = (h << 7) ^ h;
  }
  return h % table_size;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x21(%rbp)
cmp    $0x0,%al
je     1156 <hash+0x56>
movsbq -0x21(%rbp),%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
shl    $0x7,%rax
xor    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1118 <hash+0x18>
mov    -0x20(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
mov    %rdx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    %rdx,%rcx
mov    %rsi,%rax
mov    (%rdi),%dl
test   %dl,%dl
je     112c <hash+0x2c>
add    $0x1,%rdi
movsbq %dl,%rdx
add    %rax,%rdx
mov    %rdx,%rax
shl    $0x7,%rax
xor    %rdx,%rax
movzbl (%rdi),%edx
add    $0x1,%rdi
test   %dl,%dl
jne    1110 <hash+0x10>
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
je     1141 <hash+0x41>
xor    %edx,%edx
div    %rcx
mov    %rdx,%rax
ret
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i64 @hash(i8* nocapture %0, i64 %1, i64 %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %17, label %6
6: ; preds = %3, %6
%7 = phi i8 [ %15, %6 ], [ %4, %3 ]
%8 = phi i8* [ %10, %6 ], [ %0, %3 ]
%9 = phi i64 [ %14, %6 ], [ %1, %3 ]
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = sext i8 %7 to i64
%12 = add i64 %9, %11
%13 = shl i64 %12, 7
%14 = xor i64 %13, %12
%15 = load i8, i8* %10
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %6
17: ; preds = %6, %3
%18 = phi i64 [ %1, %3 ], [ %14, %6 ]
%19 = urem i64 %18, %2
ret i64 %19
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float, float);
float celsiusFromFahrenheit(float fahr) {
  float cel = (fahr - 32.0) * 5.0 / 9.0;
  printf("%f Fahrenheit is %f Celsius\n", fahr, cel);
  return cel;
}


x86 assembly (clang, -O0):
<celsiusFromFahrenheit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee2(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xece(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeba(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<celsiusFromFahrenheit>:
push   %rax
cvtss2sd %xmm0,%xmm1
addsd  0xee3(%rip),%xmm1
mulsd  0xee3(%rip),%xmm1
divsd  0xee3(%rip),%xmm1
cvtsd2ss %xmm1,%xmm1
movss  %xmm1,0x4(%rsp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
movss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [29 x i8] c"%f Fahrenheit is %f Celsius\0A\00"
define float @celsiusFromFahrenheit(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fpext float %4 to double
%6 = fsub double %5, 3.200000e+01
%7 = fmul double %6, 5.000000e+00
%8 = fdiv double %7, 9.000000e+00
%9 = fptrunc double %8 to float
store float %9, float* %3
%10 = load float, float* %2
%11 = load float, float* %3
%12 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), float %10, float %11)
%13 = load float, float* %3
ret float %13
}

LLVM IR (-O2):
@.str = [29 x i8] c"%f Fahrenheit is %f Celsius\0A\00"
define float @celsiusFromFahrenheit(float %0) {
%2 = fpext float %0 to double
%3 = fadd double %2, -3.200000e+01
%4 = fmul double %3, 5.000000e+00
%5 = fdiv double %4, 9.000000e+00
%6 = fptrunc double %5 to float
%7 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), float %0, float %6)
ret float %6
}
int fn8(int a, int b) {
  int tem1 = b ^ a;
  int tem2 = b | a;
  return tem1 ^ tem2;
}


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

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

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

LLVM IR (-O2):
define i32 @fn8(i32 %0, i32 %1) {
%3 = and i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ WARN_ON_ONCE(int);
unsigned int SCD_QUEUE_RDPTR(unsigned int chnl) {
  if (chnl < 20)
    return ((0x00000) + 0xa02c00) + 0x68 + chnl * 4;
  WARN_ON_ONCE(chnl >= 32);
  return ((0x00000) + 0xa02c00) + 0x2B4 + (chnl - 20) * 4;
}


x86 assembly (clang, -O0):
<SCD_QUEUE_RDPTR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x14,-0x8(%rbp)
jae    1138 <SCD_QUEUE_RDPTR+0x28>
mov    -0x8(%rbp),%eax
shl    $0x2,%eax
add    $0xa02c68,%eax
mov    %eax,-0x4(%rbp)
jmp    115a <SCD_QUEUE_RDPTR+0x4a>
cmpl   $0x20,-0x8(%rbp)
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <WARN_ON_ONCE@plt>
mov    -0x8(%rbp),%eax
sub    $0x14,%eax
shl    $0x2,%eax
add    $0xa02eb4,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SCD_QUEUE_RDPTR>:
push   %rbx
mov    %edi,%ebx
mov    $0xa02c68,%eax
cmp    $0x14,%edi
jb     1130 <SCD_QUEUE_RDPTR+0x20>
xor    %edi,%edi
cmp    $0x20,%ebx
setae  %dil
call   1030 <WARN_ON_ONCE@plt>
mov    $0xa02e64,%eax
lea    (%rax,%rbx,4),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @SCD_QUEUE_RDPTR(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ult i32 %4, 20
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = mul i32 %7, 4
%9 = add i32 10497128, %8
store i32 %9, i32* %2
br label %19
10: ; preds = %1
%11 = load i32, i32* %3
%12 = icmp uge i32 %11, 32
%13 = zext i1 %12 to i32
%14 = call i32 @WARN_ON_ONCE(i32 %13)
%15 = load i32, i32* %3
%16 = sub i32 %15, 20
%17 = mul i32 %16, 4
%18 = add i32 10497716, %17
store i32 %18, i32* %2
br label %19
19: ; preds = %10, %6
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @SCD_QUEUE_RDPTR(i32 %0) {
%2 = icmp ult i32 %0, 20
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = icmp ugt i32 %0, 31
%5 = zext i1 %4 to i32
%6 = tail call i32 @WARN_ON_ONCE(i32 %5)
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ 10497636, %3 ], [ 10497128, %1 ]
%9 = shl i32 %0, 2
%10 = add i32 %9, %8
ret i32 %10
}
void gtk_window_set_default_icon_from_file() {}


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

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

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

LLVM IR (-O2):
define void @gtk_window_set_default_icon_from_file() {
ret void
}
/* Variables and functions */
unsigned char *__ia64_mk_io_addr(unsigned long);
int /*<<< orphan*/ ia64_mfa();
void ___ia64_outb(unsigned char val, unsigned long port) {
  volatile unsigned char *addr = __ia64_mk_io_addr(port);
  *addr = val;
  ia64_mfa();
}


x86 assembly (clang, -O0):
<___ia64_outb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <__ia64_mk_io_addr@plt>
mov    %rax,-0x18(%rbp)
mov    -0x1(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    $0x0,%al
call   1040 <ia64_mfa@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<___ia64_outb>:
push   %rbx
mov    %edi,%ebx
mov    %rsi,%rdi
call   1030 <__ia64_mk_io_addr@plt>
mov    %bl,(%rax)
xor    %eax,%eax
pop    %rbx
jmp    1040 <ia64_mfa@plt>

LLVM IR (-O0):
define void @___ia64_outb(i8 zeroext %0, i64 %1) {
%3 = alloca i8
%4 = alloca i64
%5 = alloca i8*
store i8 %0, i8* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = call i8* @__ia64_mk_io_addr(i64 %6)
store i8* %7, i8** %5
%8 = load i8, i8* %3
%9 = load i8*, i8** %5
store volatile i8 %8, i8* %9
%10 = call i32 (...) @ia64_mfa()
ret void
}

LLVM IR (-O2):
define void @___ia64_outb(i8 zeroext %0, i64 %1) {
%3 = tail call i8* @__ia64_mk_io_addr(i64 %1)
store volatile i8 %0, i8* %3
%4 = tail call i32 (...) @ia64_mfa()
ret void
}
int kiLoadQuestionare(int fd, char rw) { return 1; }


x86 assembly (clang, -O0):
<kiLoadQuestionare>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @kiLoadQuestionare(i32 %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
store i8 %1, i8* %4
ret i32 1
}

LLVM IR (-O2):
define i32 @kiLoadQuestionare(i32 %0, i8 signext %1) {
ret i32 1
}
/* Type definitions */
struct mcuio_packet {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mcuio_packet_type(struct mcuio_packet *);
int /*<<< orphan*/ mcuio_type_is_read(int /*<<< orphan*/);
int mcuio_packet_is_write(struct mcuio_packet *p) {
  return !mcuio_type_is_read(mcuio_packet_type(p));
}


x86 assembly (clang, -O0):
<mcuio_packet_is_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <mcuio_packet_type@plt>
mov    %eax,%edi
call   1030 <mcuio_type_is_read@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mcuio_packet_is_write>:
push   %rax
call   1040 <mcuio_packet_type@plt>
mov    %eax,%edi
call   1030 <mcuio_type_is_read@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.mcuio_packet = type { i32 }
define i32 @mcuio_packet_is_write(%struct.mcuio_packet* %0) {
%2 = alloca %struct.mcuio_packet*
store %struct.mcuio_packet* %0, %struct.mcuio_packet** %2
%3 = load %struct.mcuio_packet*, %struct.mcuio_packet** %2
%4 = call i32 @mcuio_packet_type(%struct.mcuio_packet* %3)
%5 = call i32 @mcuio_type_is_read(i32 %4)
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
%struct.mcuio_packet = type { i32 }
define i32 @mcuio_packet_is_write(%struct.mcuio_packet* %0) {
%2 = tail call i32 @mcuio_packet_type(%struct.mcuio_packet* %0)
%3 = tail call i32 @mcuio_type_is_read(i32 %2)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *);
void error_exit(const char *message) {
  printf("%s\n", message);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<error_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error_exit>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@EXIT_FAILURE = global i32 0
define void @error_exit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@EXIT_FAILURE = global i32 0
define void @error_exit(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ lseek(int, int /*<<< orphan*/, int /*<<< orphan*/);
size_t fdsize(int fd) {
  off_t seek;
  seek = lseek(fd, 0, SEEK_END);
  lseek(fd, 0, SEEK_SET);
  return (size_t)seek;
}


x86 assembly (clang, -O0):
<fdsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1030 <lseek@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e9d(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1030 <lseek@plt>
movslq -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdsize>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2ecc(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1030 <lseek@plt>
mov    %eax,%ebp
mov    0x2eaa(%rip),%rax
mov    (%rax),%edx
mov    %ebx,%edi
xor    %esi,%esi
call   1030 <lseek@plt>
movslq %ebp,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i64 @fdsize(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @SEEK_END
%6 = call i32 @lseek(i32 %4, i32 0, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = load i32, i32* @SEEK_SET
%9 = call i32 @lseek(i32 %7, i32 0, i32 %8)
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
ret i64 %11
}

LLVM IR (-O2):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i64 @fdsize(i32 %0) {
%2 = load i32, i32* @SEEK_END
%3 = tail call i32 @lseek(i32 %0, i32 0, i32 %2)
%4 = load i32, i32* @SEEK_SET
%5 = tail call i32 @lseek(i32 %0, i32 0, i32 %4)
%6 = sext i32 %3 to i64
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ assert_int_equal(int, int /*<<< orphan*/);
int /*<<< orphan*/ w_single_push_targets(int, int);
void w_single_push_targets_test(void **state) {
  assert_int_equal(
      0x0000001022810000ul,
      w_single_push_targets(0x000000001422C100ul, 0x0000001222810000ul));
}


x86 assembly (clang, -O0):
<w_single_push_targets_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1422c100,%edi
mov    $0x22810000,%esi
call   1040 <w_single_push_targets@plt>
mov    %eax,%esi
mov    $0x22810000,%edi
call   1030 <assert_int_equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<w_single_push_targets_test>:
push   %rax
mov    $0x1422c100,%edi
mov    $0x22810000,%esi
call   1040 <w_single_push_targets@plt>
mov    $0x22810000,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <assert_int_equal@plt>

LLVM IR (-O0):
define void @w_single_push_targets_test(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @w_single_push_targets(i32 337821952, i32 578879488)
%4 = call i32 @assert_int_equal(i32 578879488, i32 %3)
ret void
}

LLVM IR (-O2):
define void @w_single_push_targets_test(i8** nocapture readnone %0) {
%2 = tail call i32 @w_single_push_targets(i32 337821952, i32 578879488)
%3 = tail call i32 @assert_int_equal(i32 578879488, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ not_prune_multiple4(int *);
void call_not_prune_multiple4_Bad_FN() {
  int m[2] = {0, 10};
  not_prune_multiple4(m);
}


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

x86 assembly (clang, -O2):
<call_not_prune_multiple4_Bad_FN>:
push   %rax
movabs $0xa00000000,%rax
mov    %rax,(%rsp)
mov    %rsp,%rdi
call   1030 <not_prune_multiple4@plt>
pop    %rax
ret

LLVM IR (-O0):
@__const.call_not_prune_multiple4_Bad_FN.m = [2 x i32] [i32 0, i32 10]
define void @call_not_prune_multiple4_Bad_FN() {
%1 = alloca [2 x i32]
%2 = bitcast [2 x i32]* %1 to i8*
%3 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%4 = call i32 @not_prune_multiple4(i32* %3)
ret void
}

LLVM IR (-O2):
define void @call_not_prune_multiple4_Bad_FN() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
store i64 42949672960, i64* %1
%3 = bitcast i64* %1 to i32*
%4 = call i32 @not_prune_multiple4(i32* %3)
ret void
}
/* Variables and functions */
int func_three(int);
int func_two(int x) { return func_three(x + 2); }


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

x86 assembly (clang, -O2):
<func_two>:
add    $0x2,%edi
jmp    1030 <func_three@plt>

LLVM IR (-O0):
define i32 @func_two(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 2
%5 = call i32 @func_three(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @func_two(i32 %0) {
%2 = add nsw i32 %0, 2
%3 = tail call i32 @func_three(i32 %2)
ret i32 %3
}
void free_cseq(struct cseq_body *cb) {
  sys_free((cb),
           "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/chiforbogdan/opensips/refs/heads/master/"
           "parser/parse_cseq.c",
           __FUNCTION__, 100);
}


x86 assembly (clang, -O0):
<free_cseq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
lea    0xf68(%rip),%rdx
mov    $0x64,%ecx
mov    $0x0,%al
call   1030 <sys_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_cseq>:
lea    0xee9(%rip),%rsi
lea    0xf78(%rip),%rdx
mov    $0x64,%ecx
xor    %eax,%eax
jmp    1030 <sys_free@plt>

LLVM IR (-O0):
%struct.cseq_body = type opaque
@.str = [150 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/chiforbogdan/opensips/refs/heads/master/parser/parse_cseq.c\00"
@__FUNCTION__.free_cseq = [10 x i8] c"free_cseq\00"
define void @free_cseq(%struct.cseq_body* %0) {
%2 = alloca %struct.cseq_body*
store %struct.cseq_body* %0, %struct.cseq_body** %2
%3 = load %struct.cseq_body*, %struct.cseq_body** %2
%4 = call i32 (%struct.cseq_body*, i8*, i8*, i32, ...) bitcast (i32 (...)* @sys_free to i32 (%struct.cseq_body*, i8*, i8*, i32, ...)*)(%struct.cseq_body* %3, i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__FUNCTION__.free_cseq, i64 0, i64 0), i32 100)
ret void
}

LLVM IR (-O2):
%struct.cseq_body = type opaque
@.str = [150 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/chiforbogdan/opensips/refs/heads/master/parser/parse_cseq.c\00"
@__FUNCTION__.free_cseq = [10 x i8] c"free_cseq\00"
define void @free_cseq(%struct.cseq_body* %0) {
%2 = tail call i32 (%struct.cseq_body*, i8*, i8*, i32, ...) bitcast (i32 (...)* @sys_free to i32 (%struct.cseq_body*, i8*, i8*, i32, ...)*)(%struct.cseq_body* %0, i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__FUNCTION__.free_cseq, i64 0, i64 0), i32 100)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_cvtpi16_ps(int /*<<< orphan*/);
int /*<<< orphan*/ _mm_setzero_si64();
int /*<<< orphan*/ _mm_unpacklo_pi8(int /*<<< orphan*/, int /*<<< orphan*/);
__m128 __attribute__((__always___, __nodebug__)) _mm_cvtpu8_ps(__m64 a) {
  __m64 b;
  b = _mm_setzero_si64();
  b = _mm_unpacklo_pi8(a, b);
  return _mm_cvtpi16_ps(b);
}


x86 assembly (clang, -O0):
<_mm_cvtpu8_ps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <_mm_setzero_si64@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <_mm_unpacklo_pi8@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <_mm_cvtpi16_ps@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mm_cvtpu8_ps>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <_mm_setzero_si64@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1030 <_mm_unpacklo_pi8@plt>
mov    %eax,%edi
pop    %rbx
jmp    1050 <_mm_cvtpi16_ps@plt>

LLVM IR (-O0):
define i32 @_mm_cvtpu8_ps(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @_mm_setzero_si64()
store i32 %4, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = call i32 @_mm_unpacklo_pi8(i32 %5, i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = call i32 @_mm_cvtpi16_ps(i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @_mm_cvtpu8_ps(i32 %0) {
%2 = tail call i32 (...) @_mm_setzero_si64()
%3 = tail call i32 @_mm_unpacklo_pi8(i32 %0, i32 %2)
%4 = tail call i32 @_mm_cvtpi16_ps(i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ _pfatal(int /*<<< orphan*/ *, int /*<<< orphan*/, char *);
void *realloc(void *, size_t);
void *xrealloc(void *p, size_t sz) {
  void *ret;
  ret = realloc(p, sz);
  if (!ret)
    _pfatal(NULL, 0, "xrealloc");
  ;
  return ret;
}


x86 assembly (clang, -O0):
<xrealloc>:
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)
cmpq   $0x0,-0x18(%rbp)
jne    115e <xrealloc+0x3e>
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
lea    0xea7(%rip),%rdx
call   1040 <_pfatal@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rbx
call   1030 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113e <xrealloc+0x1e>
lea    0xecb(%rip),%rdx
xor    %edi,%edi
xor    %esi,%esi
call   1040 <_pfatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"xrealloc\00"
define i8* @xrealloc(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
%10 = icmp ne i8* %9, null
br i1 %10, label %13, label %11
11: ; preds = %2
%12 = call i32 @_pfatal(i32* null, i32 0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %2
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
@.str = [9 x i8] c"xrealloc\00"
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @_pfatal(i32* null, i32 0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
float _surand();
float uRand(float low, float high) { return (low + (high - low) * _surand()); }


x86 assembly (clang, -O0):
<uRand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    $0x0,%al
call   1030 <_surand@plt>
movss  -0x10(%rbp),%xmm1
movaps %xmm0,%xmm2
movss  -0xc(%rbp),%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uRand>:
push   %rax
movss  %xmm0,0x4(%rsp)
subss  %xmm0,%xmm1
movss  %xmm1,(%rsp)
xor    %eax,%eax
call   1030 <_surand@plt>
mulss  (%rsp),%xmm0
addss  0x4(%rsp),%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
define float @uRand(float %0, float %1) {
%3 = fsub float %1, %0
%4 = tail call float (...) @_surand()
%5 = tail call float @llvm.fmuladd.f32(float %3, float %4, float %0)
ret float %5
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int signed_high_prod(int x, int y) {
  int64_t mul = (int64_t)x * y;
  return mul >> 32;
}


x86 assembly (clang, -O0):
<signed_high_prod>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @signed_high_prod(i32 %0, i32 %1) {
ret i32 poison
}