xunge/DecIR huggingface dataset:
void ff_hevc_put_hevc_uni_qpel_h24_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_qpel_h24_8_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ add_to_env_list(char const *, char const *);
int /*<<< orphan*/ setenv(char const *, char const *, int);
void set_env(const char *var, const char *val) {
  setenv(var, val, 1);
  add_to_env_list(var, val);
}


x86 assembly (clang, -O0):
<set_env>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1040 <setenv@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <add_to_env_list@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_env>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x1,%edx
call   1040 <setenv@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <add_to_env_list@plt>

LLVM IR (-O0):
define void @set_env(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @setenv(i8* %5, i8* %6, i32 1)
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = call i32 @add_to_env_list(i8* %8, i8* %9)
ret void
}

LLVM IR (-O2):
define void @set_env(i8* %0, i8* %1) {
%3 = tail call i32 @setenv(i8* %0, i8* %1, i32 1)
%4 = tail call i32 @add_to_env_list(i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(void) {
  int a, b;
  scanf("%d  %d", &a, &b);
  printf("%d\n", a + b);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    (%rsp),%esi
add    0x4(%rsp),%esi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 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 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = add nsw i32 %4, %5
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 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 ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, %6
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
char *strchr(char *, char);
void remove_newline(char *str) {
  char *newline = strchr(str, '\n');
  if (newline != NULL) {
    *newline = '\0';
  }
}


x86 assembly (clang, -O0):
<remove_newline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1140 <remove_newline+0x30>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_newline>:
push   %rax
mov    $0xa,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1123 <remove_newline+0x13>
movb   $0x0,(%rax)
pop    %rax
ret

LLVM IR (-O0):
define void @remove_newline(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strchr(i8* %4, i8 signext 10)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i8*, i8** %3
store i8 0, i8* %9
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @remove_newline(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 10)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
store i8 0, i8* %2
br label %5
5: ; preds = %4, %1
ret void
}
void foo1b() {}


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

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

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

LLVM IR (-O2):
define void @foo1b() {
ret void
}
unsigned addval_219(unsigned x) { return x + 2421715793U; }


x86 assembly (clang, -O0):
<addval_219>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x90587351,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<addval_219>:
lea    -0x6fa78caf(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @addval_219(i32 %0) {
%2 = add i32 %0, -1873251503
ret i32 %2
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
scalar_t__ INT8_MAX;
scalar_t__ INT8_MIN;
scalar_t__ __stdfix_sat_hr(scalar_t__);
int32_t __stdfix_smul_hr(int32_t x, int32_t y) {
  if (x == INT8_MIN && y == INT8_MIN)
    return (INT8_MAX);
  return ((int32_t)__stdfix_sat_hr(((int32_t)x * (int32_t)y) >> 7));
}


x86 assembly (clang, -O0):
<__stdfix_smul_hr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2ebd(%rip),%rcx
cmp    (%rcx),%rax
jne    115b <__stdfix_smul_hr+0x4b>
mov    -0x18(%rbp),%rax
mov    0x2ea9(%rip),%rcx
cmp    (%rcx),%rax
jne    115b <__stdfix_smul_hr+0x4b>
mov    0x2e89(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1171 <__stdfix_smul_hr+0x61>
mov    -0x10(%rbp),%rdi
imul   -0x18(%rbp),%rdi
sar    $0x7,%rdi
call   1030 <__stdfix_sat_hr@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__stdfix_smul_hr>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%rax
cmp    %rdi,%rax
jne    112f <__stdfix_smul_hr+0x1f>
cmp    %rsi,%rax
jne    112f <__stdfix_smul_hr+0x1f>
mov    0x2ead(%rip),%rax
mov    (%rax),%rax
ret
imul   %rdi,%rsi
sar    $0x7,%rsi
mov    %rsi,%rdi
jmp    1030 <__stdfix_sat_hr@plt>

LLVM IR (-O0):
@INT8_MIN = global i64 0
@INT8_MAX = global i64 0
define i64 @__stdfix_smul_hr(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %4
%7 = load i64, i64* @INT8_MIN
%8 = icmp eq i64 %6, %7
br i1 %8, label %9, label %15
9: ; preds = %2
%10 = load i64, i64* %5
%11 = load i64, i64* @INT8_MIN
%12 = icmp eq i64 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = load i64, i64* @INT8_MAX
store i64 %14, i64* %3
br label %21
15: ; preds = %9, %2
%16 = load i64, i64* %4
%17 = load i64, i64* %5
%18 = mul nsw i64 %16, %17
%19 = ashr i64 %18, 7
%20 = call i64 @__stdfix_sat_hr(i64 %19)
store i64 %20, i64* %3
br label %21
21: ; preds = %15, %13
%22 = load i64, i64* %3
ret i64 %22
}

LLVM IR (-O2):
@INT8_MIN = global i64 0
@INT8_MAX = global i64 0
define i64 @__stdfix_smul_hr(i64 %0, i64 %1) {
%3 = load i64, i64* @INT8_MIN
%4 = icmp eq i64 %3, %0
%5 = icmp eq i64 %3, %1
%6 = and i1 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = load i64, i64* @INT8_MAX
br label %13
9: ; preds = %2
%10 = mul nsw i64 %1, %0
%11 = ashr i64 %10, 7
%12 = tail call i64 @__stdfix_sat_hr(i64 %11)
br label %13
13: ; preds = %9, %7
%14 = phi i64 [ %8, %7 ], [ %12, %9 ]
ret i64 %14
}
/* Variables and functions */
int /*<<< orphan*/ output(char *, int);
int /*<<< orphan*/ sscanf(char const *, char *, int *);
void printCPUxIdleInfo(const char *cmd) {
  int id;
  sscanf(cmd + 7, "%d", &id);
  output("CPU %d Idle Load\t0\t100\t%%\n", id + 1);
}


x86 assembly (clang, -O0):
<printCPUxIdleInfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x7,%rdi
lea    0xec5(%rip),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <sscanf@plt>
mov    -0xc(%rbp),%esi
add    $0x1,%esi
lea    0xeb2(%rip),%rdi
call   1030 <output@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printCPUxIdleInfo>:
push   %rax
add    $0x7,%rdi
lea    0xed4(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1040 <sscanf@plt>
mov    0x4(%rsp),%esi
add    $0x1,%esi
lea    0xebf(%rip),%rdi
call   1030 <output@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [27 x i8] c"CPU %d Idle Load\090\09100\09%%\0A\00"
define void @printCPUxIdleInfo(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 7
%6 = call i32 @sscanf(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 1
%9 = call i32 @output(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [27 x i8] c"CPU %d Idle Load\090\09100\09%%\0A\00"
define void @printCPUxIdleInfo(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = getelementptr inbounds i8, i8* %0, i64 7
%5 = call i32 @sscanf(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 1
%8 = call i32 @output(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f3();
int main() {
  f3();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f3()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int scanf(char *, char *);
char *strdup(char *);
char *read_line() {
  char buffer[100];
  int scanf_result = scanf(" %99[^\n]", buffer);
  if (scanf_result < 1)
    abort();
  char *result = strdup(buffer);
  if (result == 0)
    abort();
  return result;
}


x86 assembly (clang, -O0):
<read_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
lea    -0x70(%rbp),%rsi
lea    0xeba(%rip),%rdi
call   1040 <scanf@plt>
mov    %eax,-0x74(%rbp)
cmpl   $0x1,-0x74(%rbp)
jge    115f <read_line+0x2f>
mov    $0x0,%al
call   1030 <abort@plt>
lea    -0x70(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x80(%rbp)
cmpq   $0x0,-0x80(%rbp)
jne    117e <read_line+0x4e>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x80(%rbp),%rax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_line>:
sub    $0x68,%rsp
lea    0xec5(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
test   %eax,%eax
jle    1159 <read_line+0x29>
mov    %rsp,%rdi
call   1050 <strdup@plt>
test   %rax,%rax
je     1159 <read_line+0x29>
add    $0x68,%rsp
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [9 x i8] c" %99[^\0A]\00"
define i8* @read_line() {
%1 = alloca [100 x i8]
%2 = alloca i32
%3 = alloca i8*
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %4)
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %0
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%12 = call i8* @strdup(i8* %11)
store i8* %12, i8** %3
%13 = load i8*, i8** %3
%14 = icmp eq i8* %13, null
br i1 %14, label %15, label %17
15: ; preds = %10
%16 = call i32 (...) @abort()
unreachable
17: ; preds = %10
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
@.str = [9 x i8] c" %99[^\0A]\00"
define noalias i8* @read_line() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = icmp slt i32 %3, 1
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %0
%8 = call i8* @strdup(i8* %2)
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 (...) @abort()
unreachable
12: ; preds = %7
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ rgb_to_xyz_floats(float *, float *);
int rgb2xyz(float *y, float *x, int n) {
  assert(n == 3);
  rgb_to_xyz_floats(y, x);
  return 3;
}


x86 assembly (clang, -O0):
<rgb2xyz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x3,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <rgb_to_xyz_floats@plt>
mov    $0x3,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgb2xyz>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
cmp    $0x3,%edx
sete   %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <rgb_to_xyz_floats@plt>
mov    $0x3,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @rgb2xyz(float* %0, float* %1, i32 %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca i32
store float* %0, float** %4
store float* %1, float** %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 3
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load float*, float** %4
%12 = load float*, float** %5
%13 = call i32 @rgb_to_xyz_floats(float* %11, float* %12)
ret i32 3
}

LLVM IR (-O2):
define i32 @rgb2xyz(float* %0, float* %1, i32 %2) {
%4 = icmp eq i32 %2, 3
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = tail call i32 @rgb_to_xyz_floats(float* %0, float* %1)
ret i32 3
}
/* Type definitions */
struct lwes_hash {
  int dummy;
};

/* Variables and functions */
struct lwes_hash *lwes_hash_create_with_bins(int);
struct lwes_hash *lwes_hash_create(void) {
  return lwes_hash_create_with_bins(100);
}


x86 assembly (clang, -O0):
<lwes_hash_create>:
push   %rbp
mov    %rsp,%rbp
mov    $0x64,%edi
call   1030 <lwes_hash_create_with_bins@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lwes_hash_create>:
mov    $0x64,%edi
jmp    1030 <lwes_hash_create_with_bins@plt>

LLVM IR (-O0):
%struct.lwes_hash = type { i32 }
define %struct.lwes_hash* @lwes_hash_create() {
%1 = call %struct.lwes_hash* @lwes_hash_create_with_bins(i32 100)
ret %struct.lwes_hash* %1
}

LLVM IR (-O2):
%struct.lwes_hash = type { i32 }
define %struct.lwes_hash* @lwes_hash_create() {
%1 = tail call %struct.lwes_hash* @lwes_hash_create_with_bins(i32 100)
ret %struct.lwes_hash* %1
}
/* Variables and functions */
char *getpwd(char *);
char *getPassword(void) { return getpwd("Enter password:"); }


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"Enter password:\00"
define i8* @getPassword() {
%1 = call i8* @getpwd(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [16 x i8] c"Enter password:\00"
define i8* @getPassword() {
%1 = tail call i8* @getpwd(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
void *Regcomp(const char *pat, int flag) { return 0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @Regcomp(i8* nocapture readnone %0, i32 %1) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void do_help() { printf("Usage : minizip [-o] file.zip [files_to_add]\n\n"); }


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

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

LLVM IR (-O0):
@.str = [47 x i8] c"Usage : minizip [-o] file.zip [files_to_add]\0A\0A\00"
define void @do_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [46 x i8] c"Usage : minizip [-o] file.zip [files_to_add]\0A\00"
define void @do_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str, i64 0, i64 0))
ret void
}
int xseek(void *fd, long offset, int whence) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @xseek(i8* nocapture readnone %0, i64 %1, i32 %2) {
ret i32 0
}
void STC_Datapath16_v1_00_Start() { return; }


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @STC_Datapath16_v1_00_Start() {
ret void
}
int CheckEndianess(void) {
  union EndianCheck {
    char b[sizeof(int)];
    int i;
  } ec;
  ec.i = 8;
  return (ec.b[0] == 0);
}


x86 assembly (clang, -O0):
<CheckEndianess>:
push   %rbp
mov    %rsp,%rbp
movl   $0x8,-0x8(%rbp)
movsbl -0x8(%rbp),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.EndianCheck = type { i32 }
define i32 @CheckEndianess() {
%1 = alloca %union.EndianCheck
%2 = bitcast %union.EndianCheck* %1 to i32*
store i32 8, i32* %2
%3 = bitcast %union.EndianCheck* %1 to [4 x i8]*
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @CheckEndianess() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int const);
void func_1a(int const *i) {
  printf("func_1a : %d >> ", *i);
  {
    int const *bkup = i;
    int x = 20;
    int const *y = &x;
    i = y;
    printf("%d\n", *i);
    i = bkup;
  }
}


x86 assembly (clang, -O0):
<func_1a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x14,-0x14(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_1a>:
push   %rax
mov    (%rdi),%esi
lea    0xee6(%rip),%rdi
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
mov    $0x14,%esi
pop    %rax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [17 x i8] c"func_1a : %d >> \00"
@.str.1 = [4 x i8] c"%d\0A\00"
define void @func_1a(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 20)
ret void
}
/* Variables and functions */
char *errno;
int /*<<< orphan*/ printf(char *, char const *, char *);
void perror(const char *msg) { printf("%s: error %s\n", msg, errno); }


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

x86 assembly (clang, -O2):
<perror>:
mov    %rdi,%rsi
mov    0x2ec6(%rip),%rax
mov    (%rax),%rdx
lea    0xedc(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"%s: error %s\0A\00"
@errno = global i8* null
define void @perror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** @errno
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"%s: error %s\0A\00"
@errno = global i8* null
define void @perror(i8* %0) {
%2 = load i8*, i8** @errno
%3 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %2)
ret void
}
/* Variables and functions */
float volatile USHRT_MAX;
int /*<<< orphan*/ abort();
int main() {
  volatile unsigned short s = USHRT_MAX;
  volatile float f = s;
  if (f != USHRT_MAX) {
    abort();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
cvttss2si (%rax),%eax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
mov    0x2ea8(%rip),%rax
movss  (%rax),%xmm1
ucomiss %xmm1,%xmm0
jne    1158 <main+0x48>
jp     1158 <main+0x48>
jmp    115f <main+0x4f>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ed0(%rip),%rax
cvttss2si (%rax),%ecx
mov    %cx,0x2(%rsp)
movzwl 0x2(%rsp),%ecx
cvtsi2ss %ecx,%xmm0
movss  %xmm0,0x4(%rsp)
movss  0x4(%rsp),%xmm0
ucomiss (%rax),%xmm0
jne    1141 <main+0x31>
jp     1141 <main+0x31>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@USHRT_MAX = global float 0.000000e+00
define i32 @main() {
%1 = alloca i16
%2 = alloca float
%3 = load volatile float, float* @USHRT_MAX
%4 = fptoui float %3 to i16
store volatile i16 %4, i16* %1
%5 = load volatile i16, i16* %1
%6 = uitofp i16 %5 to float
store volatile float %6, float* %2
%7 = load volatile float, float* %2
%8 = load volatile float, float* @USHRT_MAX
%9 = fcmp une float %7, %8
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 (...) @abort()
unreachable
12: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
@USHRT_MAX = global float 0.000000e+00
define i32 @main() {
%1 = alloca i16
%2 = alloca float
%3 = bitcast i16* %1 to i8*
%4 = load volatile float, float* @USHRT_MAX
%5 = fptoui float %4 to i16
store volatile i16 %5, i16* %1
%6 = bitcast float* %2 to i8*
%7 = load volatile i16, i16* %1
%8 = uitofp i16 %7 to float
store volatile float %8, float* %2
%9 = load volatile float, float* %2
%10 = load volatile float, float* @USHRT_MAX
%11 = fcmp une float %9, %10
br i1 %11, label %12, label %14
12: ; preds = %0
%13 = tail call i32 (...) @abort()
unreachable
14: ; preds = %0
ret i32 0
}
/* Variables and functions */
double log(double);
double Entropy_h(double p) {
  double result = p > 0 ? (-p * log(p)) : 0;
  return result;
}


x86 assembly (clang, -O0):
<Entropy_h>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1170 <Entropy_h+0x60>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    117d <Entropy_h+0x6d>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    117d <Entropy_h+0x6d>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Entropy_h>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1141 <Entropy_h+0x31>
sub    $0x18,%rsp
movapd 0xeda(%rip),%xmm1
xorpd  %xmm0,%xmm1
movapd %xmm1,(%rsp)
call   1030 <log@plt>
movapd %xmm0,%xmm1
mulsd  (%rsp),%xmm1
add    $0x18,%rsp
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @Entropy_h(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fcmp ogt double %4, 0.000000e+00
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load double, double* %2
%8 = fneg double %7
%9 = load double, double* %2
%10 = call double @log(double %9)
%11 = fmul double %8, %10
br label %13
12: ; preds = %1
br label %13
13: ; preds = %12, %6
%14 = phi double [ %11, %6 ], [ 0.000000e+00, %12 ]
store double %14, double* %3
%15 = load double, double* %3
ret double %15
}

LLVM IR (-O2):
define double @Entropy_h(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = fneg double %0
%5 = tail call double @log(double %0)
%6 = fmul double %5, %4
br label %7
7: ; preds = %1, %3
%8 = phi double [ %6, %3 ], [ 0.000000e+00, %1 ]
ret double %8
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ mbstate_t;

/* Variables and functions */
int /*<<< orphan*/ __chk_fail();
scalar_t__ __glibc_unlikely(int);
size_t __mbsrtowcs(int /*<<< orphan*/ *, char const **, size_t,
                   int /*<<< orphan*/ *);
size_t __mbsrtowcs_chk(wchar_t *dst, const char **src, size_t len,
                       mbstate_t *ps, size_t dstlen) {
  if (__glibc_unlikely(dstlen < len))
    __chk_fail();
  return __mbsrtowcs(dst, src, len, ps);
}


x86 assembly (clang, -O0):
<__mbsrtowcs_chk>:
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    %r8,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x18(%rbp),%rax
setb   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <__glibc_unlikely@plt>
cmp    $0x0,%rax
je     1172 <__mbsrtowcs_chk+0x42>
mov    $0x0,%al
call   1040 <__chk_fail@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <__mbsrtowcs@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__mbsrtowcs_chk>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%rbx
mov    %rsi,%r15
mov    %rdi,%r12
xor    %edi,%edi
cmp    %rdx,%r8
setb   %dil
call   1050 <__glibc_unlikely@plt>
test   %rax,%rax
je     115e <__mbsrtowcs_chk+0x2e>
xor    %eax,%eax
call   1040 <__chk_fail@plt>
mov    %r12,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
mov    %r14,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <__mbsrtowcs@plt>

LLVM IR (-O0):
define i64 @__mbsrtowcs_chk(i32* %0, i8** %1, i64 %2, i32* %3, i64 %4) {
%6 = alloca i32*
%7 = alloca i8**
%8 = alloca i64
%9 = alloca i32*
%10 = alloca i64
store i32* %0, i32** %6
store i8** %1, i8*** %7
store i64 %2, i64* %8
store i32* %3, i32** %9
store i64 %4, i64* %10
%11 = load i64, i64* %10
%12 = load i64, i64* %8
%13 = icmp ult i64 %11, %12
%14 = zext i1 %13 to i32
%15 = call i64 @__glibc_unlikely(i32 %14)
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %5
%18 = call i32 (...) @__chk_fail()
br label %19
19: ; preds = %17, %5
%20 = load i32*, i32** %6
%21 = load i8**, i8*** %7
%22 = load i64, i64* %8
%23 = load i32*, i32** %9
%24 = call i64 @__mbsrtowcs(i32* %20, i8** %21, i64 %22, i32* %23)
ret i64 %24
}

LLVM IR (-O2):
define i64 @__mbsrtowcs_chk(i32* %0, i8** %1, i64 %2, i32* %3, i64 %4) {
%6 = icmp ult i64 %4, %2
%7 = zext i1 %6 to i32
%8 = tail call i64 @__glibc_unlikely(i32 %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %5
%11 = tail call i32 (...) @__chk_fail()
br label %12
12: ; preds = %10, %5
%13 = tail call i64 @__mbsrtowcs(i32* %0, i8** %1, i64 %2, i32* %3)
ret i64 %13
}
/* Variables and functions */
int yaffs_open_reldir(int /*<<< orphan*/, char const *, int, int);
int yaffs_open(const char *path, int oflag, int mode) {
  return yaffs_open_reldir((0), path, oflag, mode);
}


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

x86 assembly (clang, -O2):
<yaffs_open>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <yaffs_open_reldir@plt>

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

LLVM IR (-O2):
define i32 @yaffs_open(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @yaffs_open_reldir(i32 0, i8* %0, i32 %1, i32 %2)
ret i32 %4
}
unsigned char reversebit(unsigned char data) {
  unsigned char retdata = 0;
  int c = 0;
  for (c = 0; c < 8; c++) {
    if ((data & (1 << c)) == 0) {
    } else {
      retdata = retdata | (0x80 >> c);
    }
  }
  return retdata;
}


x86 assembly (clang, -O0):
<reversebit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0x0,-0x2(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jge    116e <reversebit+0x6e>
movzbl -0x1(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
jne    1146 <reversebit+0x46>
jmp    115b <reversebit+0x5b>
movzbl -0x2(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x80,%edx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    %al,-0x2(%rbp)
jmp    1160 <reversebit+0x60>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    111c <reversebit+0x1c>
movzbl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reversebit>:
rol    $0x4,%dil
mov    %edi,%eax
and    $0x33,%al
shl    $0x2,%al
shr    $0x2,%dil
and    $0x33,%dil
or     %dil,%al
mov    %eax,%ecx
and    $0x55,%cl
add    %cl,%cl
shr    %al
and    $0x55,%al
or     %cl,%al
ret

LLVM IR (-O0):
define zeroext i8 @reversebit(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %2
store i8 0, i8* %3
store i32 0, i32* %4
store i32 0, i32* %4
br label %5
5: ; preds = %24, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 8
br i1 %7, label %8, label %27
8: ; preds = %5
%9 = load i8, i8* %2
%10 = zext i8 %9 to i32
%11 = load i32, i32* %4
%12 = shl i32 1, %11
%13 = and i32 %10, %12
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %8
br label %23
16: ; preds = %8
%17 = load i8, i8* %3
%18 = zext i8 %17 to i32
%19 = load i32, i32* %4
%20 = ashr i32 128, %19
%21 = or i32 %18, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %3
br label %23
23: ; preds = %16, %15
br label %24
24: ; preds = %23
%25 = load i32, i32* %4
%26 = add nsw i32 %25, 1
store i32 %26, i32* %4
br label %5
27: ; preds = %5
%28 = load i8, i8* %3
ret i8 %28
}

LLVM IR (-O2):
define zeroext i8 @reversebit(i8 zeroext %0) {
%2 = call i8 @llvm.bitreverse.i8(i8 %0)
ret i8 %2
}
int d_gt_rr2(double a1, double a2) { return !(((a1) > (a2))); }


x86 assembly (clang, -O0):
<d_gt_rr2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
seta   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_gt_rr2>:
xor    %eax,%eax
ucomisd %xmm1,%xmm0
setbe  %al
ret

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

LLVM IR (-O2):
define i32 @d_gt_rr2(double %0, double %1) {
%3 = fcmp ule double %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
void printAllUsers() {}


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

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

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

LLVM IR (-O2):
define void @printAllUsers() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ pthread_cancel(int /*<<< orphan*/);
int /*<<< orphan*/ pthread_join(int /*<<< orphan*/, int /*<<< orphan*/ *);
void likeScrollBarStop(pthread_t **threadScroll) {
  if (*threadScroll != NULL) {
    pthread_cancel(**threadScroll);
    pthread_join(**threadScroll, NULL);
    free(*threadScroll);
  }
  printf("\r");
}


x86 assembly (clang, -O0):
<likeScrollBarStop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1186 <likeScrollBarStop+0x46>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%edi
call   1060 <pthread_cancel@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <pthread_join@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
lea    0xe73(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<likeScrollBarStop>:
push   %rbx
mov    (%rdi),%rax
test   %rax,%rax
je     1167 <likeScrollBarStop+0x27>
mov    %rdi,%rbx
mov    (%rax),%edi
call   1060 <pthread_cancel@plt>
mov    (%rbx),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1050 <pthread_join@plt>
mov    (%rbx),%rdi
call   1030 <free@plt>
mov    $0xd,%edi
pop    %rbx
jmp    1040 <putchar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0D\00"
define void @likeScrollBarStop(i32** %0) {
%2 = alloca i32**
store i32** %0, i32*** %2
%3 = load i32**, i32*** %2
%4 = load i32*, i32** %3
%5 = icmp ne i32* %4, null
br i1 %5, label %6, label %18
6: ; preds = %1
%7 = load i32**, i32*** %2
%8 = load i32*, i32** %7
%9 = load i32, i32* %8
%10 = call i32 @pthread_cancel(i32 %9)
%11 = load i32**, i32*** %2
%12 = load i32*, i32** %11
%13 = load i32, i32* %12
%14 = call i32 @pthread_join(i32 %13, i32* null)
%15 = load i32**, i32*** %2
%16 = load i32*, i32** %15
%17 = call i32 @free(i32* %16)
br label %18
18: ; preds = %6, %1
%19 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @likeScrollBarStop(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = icmp eq i32* %2, null
br i1 %3, label %12, label %4
4: ; preds = %1
%5 = load i32, i32* %2
%6 = tail call i32 @pthread_cancel(i32 %5)
%7 = load i32*, i32** %0
%8 = load i32, i32* %7
%9 = tail call i32 @pthread_join(i32 %8, i32* null)
%10 = load i32*, i32** %0
%11 = tail call i32 @free(i32* %10)
br label %12
12: ; preds = %4, %1
%13 = tail call i32 @putchar(i32 13)
ret void
}
const char *ccnxControlAPIAbout_MiniNotice(void) {
  return "Copyright (c) 2017 Cisco and/or its affiliates.\n";
}


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

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

LLVM IR (-O0):
@.str = [49 x i8] c"Copyright (c) 2017 Cisco and/or its affiliates.\0A\00"
define i8* @ccnxControlAPIAbout_MiniNotice() {
ret i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [49 x i8] c"Copyright (c) 2017 Cisco and/or its affiliates.\0A\00"
define i8* @ccnxControlAPIAbout_MiniNotice() {
ret i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0)
}
int test_imm_F4uint8_mem(unsigned char *val) {
  return ((*val) & (0xF4 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_F4uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -12
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int mem_cgroup_get_reclaim_priority(struct mem_cgroup *mem) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.mem_cgroup = type opaque
define i32 @mem_cgroup_get_reclaim_priority(%struct.mem_cgroup* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ hash_uint64_basis(int /*<<< orphan*/ const,
                                     int /*<<< orphan*/);
uint32_t hash_uint64(const uint64_t x) { return hash_uint64_basis(x, 0); }


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

x86 assembly (clang, -O2):
<hash_uint64>:
xor    %esi,%esi
jmp    1030 <hash_uint64_basis@plt>

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

LLVM IR (-O2):
define i32 @hash_uint64(i32 %0) {
%2 = tail call i32 @hash_uint64_basis(i32 %0, i32 0)
ret i32 %2
}
signed int f19(signed int v_foo) {
  signed int v_shr = v_foo >> 28;
  signed int v_and = v_shr & 30;
  return v_and;
}


x86 assembly (clang, -O0):
<f19>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1c,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1e,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f19>:
mov    %edi,%eax
sar    $0x1c,%eax
and    $0x1e,%eax
ret

LLVM IR (-O0):
define i32 @f19(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = ashr i32 %5, 28
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = and i32 %7, 30
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
define i32 @f19(i32 %0) {
%2 = ashr i32 %0, 28
%3 = and i32 %2, 30
ret i32 %3
}
unsigned int digits(const int i) {
  int i_copy = i;
  unsigned int count = 1;
  if (i_copy < 0) {
    i_copy = -i_copy;
  }
  while ((i_copy /= 10) > 0) {
    count++;
  }
  return count;
}


x86 assembly (clang, -O0):
<digits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1126 <digits+0x26>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    112b <digits+0x2b>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1150 <digits+0x50>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112b <digits+0x2b>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<digits>:
mov    %edi,%ecx
neg    %ecx
cmovs  %edi,%ecx
mov    $0x1,%eax
cmp    $0xa,%ecx
jb     1134 <digits+0x34>
mov    $0x1,%eax
mov    $0xcccccccd,%edx
nopl   0x0(%rax,%rax,1)
mov    %ecx,%esi
imul   %rdx,%rsi
shr    $0x23,%rsi
add    $0x1,%eax
cmp    $0x63,%ecx
mov    %esi,%ecx
ja     1120 <digits+0x20>
ret

LLVM IR (-O0):
define i32 @digits(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
store i32 %5, i32* %3
store i32 1, i32* %4
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32, i32* %3
%10 = sub nsw i32 0, %9
store i32 %10, i32* %3
br label %11
11: ; preds = %8, %1
br label %12
12: ; preds = %16, %11
%13 = load i32, i32* %3
%14 = sdiv i32 %13, 10
store i32 %14, i32* %3
%15 = icmp sgt i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %12
%17 = load i32, i32* %4
%18 = add i32 %17, 1
store i32 %18, i32* %4
br label %12
19: ; preds = %12
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
define i32 @digits(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%3 = icmp ugt i32 %2, 9
br i1 %3, label %4, label %10
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 1, %1 ]
%6 = phi i32 [ %7, %4 ], [ %2, %1 ]
%7 = udiv i32 %6, 10
%8 = add i32 %5, 1
%9 = icmp ugt i32 %6, 99
br i1 %9, label %4, label %10
10: ; preds = %4, %1
%11 = phi i32 [ 1, %1 ], [ %8, %4 ]
ret i32 %11
}
void glRenderbufferStorageMultisample(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glRenderbufferStorageMultisample() {
ret void
}
/* Type definitions */
struct timezone {
  int dummy;
};
struct timeval {
  long double tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, struct timezone *);
long double get_time() {
  struct timeval t;
  struct timezone tzp;
  gettimeofday(&t, &tzp);
  return t.tv_sec + t.tv_usec * 1e-6;
}


x86 assembly (clang, -O0):
<get_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x20(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1030 <gettimeofday@plt>
fldt   -0x20(%rbp)
cvtsi2sdl -0x10(%rbp),%xmm0
movsd  0xecb(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
fldl   -0x30(%rbp)
faddp  %st,%st(1)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time>:
sub    $0x38,%rsp
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <gettimeofday@plt>
cvtsi2sdl 0x20(%rsp),%xmm0
mulsd  0xecf(%rip),%xmm0
fldt   0x10(%rsp)
movsd  %xmm0,(%rsp)
faddl  (%rsp)
add    $0x38,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { x86_fp80, i32, [12 x i8] }
%struct.timezone = type { i32 }
define x86_fp80 @get_time() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%5 = load x86_fp80, x86_fp80* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = sitofp i32 %7 to double
%9 = fmul double %8, 0x3EB0C6F7A0B5ED8D
%10 = fpext double %9 to x86_fp80
%11 = fadd x86_fp80 %5, %10
ret x86_fp80 %11
}

LLVM IR (-O2):
%struct.timeval = type { x86_fp80, i32, [12 x i8] }
%struct.timezone = type { i32 }
define x86_fp80 @get_time() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = bitcast %struct.timeval* %1 to i8*
%4 = bitcast %struct.timezone* %2 to i8*
%5 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%7 = load x86_fp80, x86_fp80* %6
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%9 = load i32, i32* %8
%10 = sitofp i32 %9 to double
%11 = fmul double %10, 0x3EB0C6F7A0B5ED8D
%12 = fpext double %11 to x86_fp80
%13 = fadd x86_fp80 %7, %12
ret x86_fp80 %13
}
/* Variables and functions */
int /*<<< orphan*/ getlocalip();
int /*<<< orphan*/ pushString(int /*<<< orphan*/);
void basGetLocalIp() { pushString(getlocalip()); }


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

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

LLVM IR (-O0):
define void @basGetLocalIp() {
%1 = call i32 (...) @getlocalip()
%2 = call i32 @pushString(i32 %1)
ret void
}

LLVM IR (-O2):
define void @basGetLocalIp() {
%1 = tail call i32 (...) @getlocalip()
%2 = tail call i32 @pushString(i32 %1)
ret void
}
void ble_rsp_connection_get_rssi(
    const struct ble_msg_connection_get_rssi_rsp_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.ble_msg_connection_get_rssi_rsp_t = type opaque
define void @ble_rsp_connection_get_rssi(%struct.ble_msg_connection_get_rssi_rsp_t* nocapture %0) {
ret void
}