xunge/DecIR huggingface dataset:
void uninit(int immed) {}


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

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

LLVM IR (-O0):
define void @uninit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @uninit(i32 %0) {
ret void
}
double very_smart_add(double a, double b) {
  while (b >= 1.0) {
    a += 1.0;
    b -= 1.0;
  }
  a += b;
  return a;
}


x86 assembly (clang, -O0):
<very_smart_add>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xee5(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1152 <very_smart_add+0x52>
movsd  0xed3(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xebc(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    110e <very_smart_add+0xe>
movsd  -0x10(%rbp),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<very_smart_add>:
ucomisd 0xef8(%rip),%xmm1
jb     112e <very_smart_add+0x2e>
movsd  0xeee(%rip),%xmm2
movsd  0xeee(%rip),%xmm3
nopw   0x0(%rax,%rax,1)
addsd  %xmm2,%xmm0
addsd  %xmm3,%xmm1
ucomisd %xmm2,%xmm1
jae    1120 <very_smart_add+0x20>
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @very_smart_add(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
br label %5
5: ; preds = %8, %2
%6 = load double, double* %4
%7 = fcmp oge double %6, 1.000000e+00
br i1 %7, label %8, label %13
8: ; preds = %5
%9 = load double, double* %3
%10 = fadd double %9, 1.000000e+00
store double %10, double* %3
%11 = load double, double* %4
%12 = fsub double %11, 1.000000e+00
store double %12, double* %4
br label %5
13: ; preds = %5
%14 = load double, double* %4
%15 = load double, double* %3
%16 = fadd double %15, %14
store double %16, double* %3
%17 = load double, double* %3
ret double %17
}

LLVM IR (-O2):
define double @very_smart_add(double %0, double %1) {
%3 = fcmp ult double %1, 1.000000e+00
br i1 %3, label %10, label %4
4: ; preds = %2, %4
%5 = phi double [ %8, %4 ], [ %1, %2 ]
%6 = phi double [ %7, %4 ], [ %0, %2 ]
%7 = fadd double %6, 1.000000e+00
%8 = fadd double %5, -1.000000e+00
%9 = fcmp ult double %8, 1.000000e+00
br i1 %9, label %10, label %4
10: ; preds = %4, %2
%11 = phi double [ %0, %2 ], [ %7, %4 ]
%12 = phi double [ %1, %2 ], [ %8, %4 ]
%13 = fadd double %11, %12
ret double %13
}
void use(void *p __attribute__((unused))) {}


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

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

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

LLVM IR (-O2):
define void @use(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ box(int /*<<< orphan*/ *, int /*<<< orphan*/,
                       int /*<<< orphan*/);
int find_center_start(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ mvwprintw(int /*<<< orphan*/ *, int /*<<< orphan*/, int,
                             char *);
int /*<<< orphan*/ strlen(char *);
void write_title_window(WINDOW *master) {
  int x;
  box(master, 0, 0);
  x = find_center_start(master, strlen("}-= TreeTop =-{"));
  mvwprintw(master, 0, x, "}-= TreeTop =-{");
}


x86 assembly (clang, -O0):
<write_title_window>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1050 <box@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    0xe98(%rip),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1040 <find_center_start@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
xor    %esi,%esi
lea    0xe75(%rip),%rcx
call   1060 <mvwprintw@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_title_window>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %esi,%esi
xor    %edx,%edx
call   1050 <box@plt>
lea    0xea9(%rip),%r14
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <find_center_start@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %eax,%edx
mov    %r14,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1060 <mvwprintw@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"}-= TreeTop =-{\00"
define void @write_title_window(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @box(i32* %4, i32 0, i32 0)
%6 = load i32*, i32** %2
%7 = call i32 @strlen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @find_center_start(i32* %6, i32 %7)
store i32 %8, i32* %3
%9 = load i32*, i32** %2
%10 = load i32, i32* %3
%11 = call i32 @mvwprintw(i32* %9, i32 0, i32 %10, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"}-= TreeTop =-{\00"
define void @write_title_window(i32* %0) {
%2 = tail call i32 @box(i32* %0, i32 0, i32 0)
%3 = tail call i32 @strlen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @find_center_start(i32* %0, i32 %3)
%5 = tail call i32 @mvwprintw(i32* %0, i32 0, i32 %4, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ insertion_sort_rec_helper(int *, int, int /*<<< orphan*/);
void insertion_sort_rec(int *arr, int n) {
  insertion_sort_rec_helper(arr, n, 0);
}


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

x86 assembly (clang, -O2):
<insertion_sort_rec>:
xor    %edx,%edx
jmp    1030 <insertion_sort_rec_helper@plt>

LLVM IR (-O0):
define void @insertion_sort_rec(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 = call i32 @insertion_sort_rec_helper(i32* %5, i32 %6, i32 0)
ret void
}

LLVM IR (-O2):
define void @insertion_sort_rec(i32* %0, i32 %1) {
%3 = tail call i32 @insertion_sort_rec_helper(i32* %0, i32 %1, i32 0)
ret void
}
/* Variables and functions */
int strlen(char *);
char *pdc_file_strip_ext(char *pathname) {
  char *scan = pathname + strlen(pathname);
  while (pathname <= --scan) {
    if (*scan == '.') {
      *scan = 0;
      break;
    }
  }
  return pathname;
}


x86 assembly (clang, -O0):
<pdc_file_strip_ext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
cmp    %rcx,%rax
ja     1177 <pdc_file_strip_ext+0x67>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    1172 <pdc_file_strip_ext+0x62>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
jmp    1177 <pdc_file_strip_ext+0x67>
jmp    113d <pdc_file_strip_ext+0x2d>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pdc_file_strip_ext>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
add    %rbx,%rax
add    $0xffffffffffffffff,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmp    %rbx,%rax
jb     1145 <pdc_file_strip_ext+0x35>
lea    -0x1(%rax),%rcx
cmpb   $0x2e,(%rax)
mov    %rcx,%rax
jne    1130 <pdc_file_strip_ext+0x20>
movb   $0x0,0x1(%rcx)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @pdc_file_strip_ext(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %4, i64 %7
store i8* %8, i8** %3
br label %9
9: ; preds = %21, %1
%10 = load i8*, i8** %2
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i32 -1
store i8* %12, i8** %3
%13 = icmp ule i8* %10, %12
br i1 %13, label %14, label %22
14: ; preds = %9
%15 = load i8*, i8** %3
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 46
br i1 %18, label %19, label %21
19: ; preds = %14
%20 = load i8*, i8** %3
store i8 0, i8* %20
br label %22
21: ; preds = %14
br label %9
22: ; preds = %19, %9
%23 = load i8*, i8** %2
ret i8* %23
}

LLVM IR (-O2):
define i8* @pdc_file_strip_ext(i8* returned %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
br label %5
5: ; preds = %9, %1
%6 = phi i8* [ %4, %1 ], [ %7, %9 ]
%7 = getelementptr inbounds i8, i8* %6, i64 -1
%8 = icmp ult i8* %7, %0
br i1 %8, label %13, label %9
9: ; preds = %5
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 46
br i1 %11, label %12, label %5
12: ; preds = %9
store i8 0, i8* %7
br label %13
13: ; preds = %5, %12
ret i8* %0
}
int ismacro(int c) {
  return ((c >= '0' && c <= '9') || (c >= 'a' && c <= 'z') ||
          (c >= 'A' && c <= 'Z'));
}


x86 assembly (clang, -O0):
<ismacro>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x30,-0x4(%rbp)
jl     1120 <ismacro+0x20>
mov    $0x1,%al
cmpl   $0x39,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1158 <ismacro+0x58>
cmpl   $0x61,-0x4(%rbp)
jl     1139 <ismacro+0x39>
mov    $0x1,%al
cmpl   $0x7a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1158 <ismacro+0x58>
xor    %eax,%eax
cmpl   $0x41,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1152 <ismacro+0x52>
cmpl   $0x5a,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ismacro>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
setb   %al
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
cmp    $0x1a,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @ismacro(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 48
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57
br i1 %7, label %22, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 97
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 122
br i1 %13, label %22, label %14
14: ; preds = %11, %8
%15 = load i32, i32* %2
%16 = icmp sge i32 %15, 65
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp sle i32 %18, 90
br label %20
20: ; preds = %17, %14
%21 = phi i1 [ false, %14 ], [ %19, %17 ]
br label %22
22: ; preds = %20, %11, %5
%23 = phi i1 [ true, %11 ], [ true, %5 ], [ %21, %20 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @ismacro(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = and i32 %0, -33
%5 = add i32 %4, -65
%6 = icmp ult i32 %5, 26
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Type definitions */
typedef scalar_t__ time_t;

/* Variables and functions */
scalar_t__ time(int /*<<< orphan*/ *);
int gf_gettime(time_t *secs, long *usecs) {
  time_t t = time(NULL);
  *secs = t;
  *usecs = 0;
  if (t == ((time_t)-1))
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<gf_gettime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1030 <time@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
movq   $0x0,(%rax)
cmpq   $0xffffffffffffffff,-0x20(%rbp)
jne    115a <gf_gettime+0x4a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1161 <gf_gettime+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gf_gettime>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
call   1030 <time@plt>
mov    %rax,(%rbx)
movq   $0x0,(%r14)
xor    %ecx,%ecx
cmp    $0xffffffffffffffff,%rax
sete   %cl
neg    %ecx
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @gf_gettime(i64* nocapture writeonly %0, i64* nocapture writeonly %1) {
%3 = tail call i64 @time(i32* null)
store i64 %3, i64* %0
store i64 0, i64* %1
%4 = icmp eq i64 %3, -1
%5 = sext i1 %4 to i32
ret i32 %5
}
void mpp_sum_double(int count, double *data) {}


x86 assembly (clang, -O0):
<mpp_sum_double>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @mpp_sum_double(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca double*
store i32 %0, i32* %3
store double* %1, double** %4
ret void
}

LLVM IR (-O2):
define void @mpp_sum_double(i32 %0, double* nocapture %1) {
ret void
}
long double longdouble_ignoring_signedlonglongint(long double x,
                                                  signed long long int y) {
  return x;
}


x86 assembly (clang, -O0):
<longdouble_ignoring_signedlonglongint>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    %rdi,-0x18(%rbp)
fldt   -0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<longdouble_ignoring_signedlonglongint>:
fldt   0x8(%rsp)
ret

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

LLVM IR (-O2):
define x86_fp80 @longdouble_ignoring_signedlonglongint(x86_fp80 returned %0, i64 %1) {
ret x86_fp80 %0
}
/* Variables and functions */
scalar_t__ strchr(char *, char);
scalar_t__ strstr(char *, char *);
int is_range(char *str) {
  if (strstr(str, "..") || strchr(str, ','))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <strstr@plt>
cmp    $0x0,%rax
jne    115e <is_range+0x3e>
mov    -0x10(%rbp),%rdi
mov    $0x2c,%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
je     116a <is_range+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1171 <is_range+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_range>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
call   1040 <strstr@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     113f <is_range+0x1f>
pop    %rbx
ret
mov    %rbx,%rdi
mov    $0x2c,%esi
call   1030 <strchr@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"..\00"
define i32 @is_range(i8* %0) {
%2 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @strchr(i8* %0, i8 signext 44)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Type definitions */
struct nlmsghdr {
  int dummy;
};
struct ifaddrmsg {
  int ifa_flags;
};

/* Variables and functions */
int IFA_F_TENTATIVE;
struct ifaddrmsg *NLMSG_DATA(struct nlmsghdr *);
int net_netlink_address_tentative(struct nlmsghdr *current_header) {
  struct ifaddrmsg *msg = NLMSG_DATA(current_header);
  int has_flags = 0;
  return !has_flags && (msg->ifa_flags & IFA_F_TENTATIVE);
}


x86 assembly (clang, -O0):
<net_netlink_address_tentative>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <NLMSG_DATA@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x14(%rbp)
mov    %al,-0x15(%rbp)
jne    1157 <net_netlink_address_tentative+0x47>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    0x2eac(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<net_netlink_address_tentative>:
push   %rax
call   1030 <NLMSG_DATA@plt>
mov    0x2edb(%rip),%rcx
mov    (%rcx),%edx
xor    %ecx,%ecx
test   %edx,(%rax)
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.nlmsghdr = type { i32 }
%struct.ifaddrmsg = type { i32 }
@IFA_F_TENTATIVE = global i32 0
define i32 @net_netlink_address_tentative(%struct.nlmsghdr* %0) {
%2 = alloca %struct.nlmsghdr*
%3 = alloca %struct.ifaddrmsg*
%4 = alloca i32
store %struct.nlmsghdr* %0, %struct.nlmsghdr** %2
%5 = load %struct.nlmsghdr*, %struct.nlmsghdr** %2
%6 = call %struct.ifaddrmsg* @NLMSG_DATA(%struct.nlmsghdr* %5)
store %struct.ifaddrmsg* %6, %struct.ifaddrmsg** %3
store i32 0, i32* %4
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %16, label %9
9: ; preds = %1
%10 = load %struct.ifaddrmsg*, %struct.ifaddrmsg** %3
%11 = getelementptr inbounds %struct.ifaddrmsg, %struct.ifaddrmsg* %10, i32 0, i32 0
%12 = load i32, i32* %11
%13 = load i32, i32* @IFA_F_TENTATIVE
%14 = and i32 %12, %13
%15 = icmp ne i32 %14, 0
br label %16
16: ; preds = %9, %1
%17 = phi i1 [ false, %1 ], [ %15, %9 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
%struct.nlmsghdr = type { i32 }
%struct.ifaddrmsg = type { i32 }
@IFA_F_TENTATIVE = global i32 0
define i32 @net_netlink_address_tentative(%struct.nlmsghdr* %0) {
%2 = tail call %struct.ifaddrmsg* @NLMSG_DATA(%struct.nlmsghdr* %0)
%3 = getelementptr inbounds %struct.ifaddrmsg, %struct.ifaddrmsg* %2, i64 0, i32 0
%4 = load i32, i32* %3
%5 = load i32, i32* @IFA_F_TENTATIVE
%6 = and i32 %5, %4
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}
int srcLongAt(int idx) { return (*((int *)(idx))); }


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

x86 assembly (clang, -O2):
<srcLongAt>:
movslq %edi,%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
define i32 @srcLongAt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @srcLongAt(i32 %0) {
%2 = sext i32 %0 to i64
%3 = inttoptr i64 %2 to i32*
%4 = load i32, i32* %3
ret i32 %4
}
int f() { return 123456; }


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

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

LLVM IR (-O0):
define i32 @f() {
ret i32 123456
}

LLVM IR (-O2):
define i32 @f() {
ret i32 123456
}
long __syscall3(long n, long a1, long a2, long a3) {
  long __ret;
  __asm("int $0x95"
        : "=a"(__ret)
        : "a"(n), "b"(a1), "c"(a2), "d"(a3)
        : "memory");
  return __ret;
}


x86 assembly (clang, -O0):
<__syscall3>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rbx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%rdx
int    $0x95
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<__syscall3>:
push   %rbx
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rbx
mov    %rdi,%rax
mov    %r8,%rdx
int    $0x95
pop    %rbx
ret

LLVM IR (-O0):
define i64 @__syscall3(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%10 = load i64, i64* %5
%11 = load i64, i64* %6
%12 = load i64, i64* %7
%13 = load i64, i64* %8
%14 = call i64 asm "int $$0x95", "={ax},{ax},{bx},{cx},{dx},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %10, i64 %11, i64 %12, i64 %13)
store i64 %14, i64* %9
%15 = load i64, i64* %9
ret i64 %15
}

LLVM IR (-O2):
define i64 @__syscall3(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = tail call i64 asm "int $$0x95", "={ax},{ax},{bx},{cx},{dx},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1, i64 %2, i64 %3)
ret i64 %5
}
/* Type definitions */
typedef unsigned int hash;

/* Variables and functions */
unsigned int rehash_token(unsigned int, unsigned char);
unsigned int hash_token(unsigned char *data, int len) {
  unsigned int hash = 2166136261U;
  int i;
  for (i = 0; i < len; i++)
    hash = rehash_token(hash, data[i]);
  return ((hash) & (((1 << 18) - 1)));
}


x86 assembly (clang, -O0):
<hash_token>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x811c9dc5,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115e <hash_token+0x4e>
mov    -0x10(%rbp),%edi
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movzbl (%rax,%rcx,1),%esi
call   1030 <rehash_token@plt>
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <hash_token+0x1d>
mov    -0x10(%rbp),%eax
and    $0x3ffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_token>:
test   %esi,%esi
jle    1150 <hash_token+0x40>
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
mov    %esi,%r15d
mov    $0x811c9dc5,%eax
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
movzbl (%r14,%rbx,1),%esi
mov    %eax,%edi
call   1030 <rehash_token@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <hash_token+0x20>
and    $0x3ffff,%eax
pop    %rbx
pop    %r14
pop    %r15
ret
mov    $0x9dc5,%eax
ret

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

LLVM IR (-O2):
define i32 @hash_token(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %16
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = phi i32 [ -2128831035, %4 ], [ %11, %6 ]
%9 = getelementptr inbounds i8, i8* %0, i64 %7
%10 = load i8, i8* %9
%11 = tail call i32 @rehash_token(i32 %8, i8 zeroext %10)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6
%15 = and i32 %11, 262143
br label %16
16: ; preds = %14, %2
%17 = phi i32 [ 40389, %2 ], [ %15, %14 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ term_attrset(int, int);
int /*<<< orphan*/ term_clrtoeol();
scalar_t__ term_height();
int /*<<< orphan*/ term_move(scalar_t__, int /*<<< orphan*/);
int /*<<< orphan*/ term_refresh();
void term_tidy(void) {
  term_move(term_height() - 1, 0);
  term_clrtoeol();
  term_attrset(1, 0x000);
  term_refresh();
}


x86 assembly (clang, -O0):
<term_tidy>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1070 <term_height@plt>
mov    %rax,%rdi
sub    $0x1,%rdi
xor    %esi,%esi
call   1030 <term_move@plt>
mov    $0x0,%al
call   1040 <term_clrtoeol@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1060 <term_attrset@plt>
mov    $0x0,%al
call   1050 <term_refresh@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<term_tidy>:
push   %rax
xor    %eax,%eax
call   1070 <term_height@plt>
lea    -0x1(%rax),%rdi
xor    %esi,%esi
call   1030 <term_move@plt>
xor    %eax,%eax
call   1040 <term_clrtoeol@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1060 <term_attrset@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <term_refresh@plt>

LLVM IR (-O0):
define void @term_tidy() {
%1 = call i64 (...) @term_height()
%2 = sub nsw i64 %1, 1
%3 = call i32 @term_move(i64 %2, i32 0)
%4 = call i32 (...) @term_clrtoeol()
%5 = call i32 @term_attrset(i32 1, i32 0)
%6 = call i32 (...) @term_refresh()
ret void
}

LLVM IR (-O2):
define void @term_tidy() {
%1 = tail call i64 (...) @term_height()
%2 = add nsw i64 %1, -1
%3 = tail call i32 @term_move(i64 %2, i32 0)
%4 = tail call i32 (...) @term_clrtoeol()
%5 = tail call i32 @term_attrset(i32 1, i32 0)
%6 = tail call i32 (...) @term_refresh()
ret void
}
void XkbGetKeyModifierMap() {}


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

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

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

LLVM IR (-O2):
define void @XkbGetKeyModifierMap() {
ret void
}
unsigned int mag_checksum(const char *const buf) {
  int csum = 0;
  const char *p;
  for (p = buf; *p; p++) {
    csum ^= *p;
  }
  return csum;
}


x86 assembly (clang, -O0):
<mag_checksum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1142 <mag_checksum+0x42>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1117 <mag_checksum+0x17>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mag_checksum>:
mov    (%rdi),%cl
test   %cl,%cl
je     1121 <mag_checksum+0x21>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
xor    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <mag_checksum+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @mag_checksum(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i8* [ %10, %4 ], [ %0, %1 ]
%7 = phi i32 [ %9, %4 ], [ 0, %1 ]
%8 = sext i8 %5 to i32
%9 = xor i32 %7, %8
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
%14 = phi i32 [ 0, %1 ], [ %9, %4 ]
ret i32 %14
}
char *prependRoot(char *pathname) { return pathname; }


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

x86 assembly (clang, -O2):
<prependRoot>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @prependRoot(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("pull it\n");
  return (0);
}


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

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

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

LLVM IR (-O2):
@str = [8 x i8] c"pull it\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int isonum_721(char *p) { return ((p[0] & 0xff) | ((p[1] & 0xff) << 8)); }


x86 assembly (clang, -O0):
<isonum_721>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
and    $0xff,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isonum_721>:
movzwl (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @isonum_721(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ SA1Absolute(int);
int /*<<< orphan*/ TSB16(int /*<<< orphan*/, int);
void Op0CM0(void) { TSB16(SA1Absolute(3), 0xFFFF); }


x86 assembly (clang, -O0):
<Op0CM0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1030 <SA1Absolute@plt>
mov    %eax,%edi
mov    $0xffff,%esi
call   1040 <TSB16@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op0CM0>:
push   %rax
mov    $0x3,%edi
call   1030 <SA1Absolute@plt>
mov    %eax,%edi
mov    $0xffff,%esi
pop    %rax
jmp    1040 <TSB16@plt>

LLVM IR (-O0):
define void @Op0CM0() {
%1 = call i32 @SA1Absolute(i32 3)
%2 = call i32 @TSB16(i32 %1, i32 65535)
ret void
}

LLVM IR (-O2):
define void @Op0CM0() {
%1 = tail call i32 @SA1Absolute(i32 3)
%2 = tail call i32 @TSB16(i32 %1, i32 65535)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MS_SYNC;
int msync(void *, size_t, int /*<<< orphan*/);
int memzone_sync(void *addr, size_t len) { return (msync(addr, len, MS_SYNC)); }


x86 assembly (clang, -O0):
<memzone_sync>:
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    0x2eb1(%rip),%rax
mov    (%rax),%edx
call   1030 <msync@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memzone_sync>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edx
jmp    1030 <msync@plt>

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

LLVM IR (-O2):
@MS_SYNC = global i32 0
define i32 @memzone_sync(i8* %0, i64 %1) {
%3 = load i32, i32* @MS_SYNC
%4 = tail call i32 @msync(i8* %0, i64 %1, i32 %3)
ret i32 %4
}
/* Variables and functions */
int ds1621_write_value(int, int, int);
int swap16(int);
int ds1621_set_TL(int dev_fd, float temp) {
  int reg;
  int rc;
  reg = (int)temp;
  reg = swap16(reg);
  rc = ds1621_write_value(dev_fd, 0xA2, reg);
  return (rc);
}


x86 assembly (clang, -O0):
<ds1621_set_TL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
cvttss2si -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <swap16@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    $0xa2,%esi
call   1040 <ds1621_write_value@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ds1621_set_TL>:
push   %rbx
mov    %edi,%ebx
cvttss2si %xmm0,%edi
call   1030 <swap16@plt>
mov    %ebx,%edi
mov    $0xa2,%esi
mov    %eax,%edx
pop    %rbx
jmp    1040 <ds1621_write_value@plt>

LLVM IR (-O0):
define i32 @ds1621_set_TL(i32 %0, float %1) {
%3 = alloca i32
%4 = alloca float
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store float %1, float* %4
%7 = load float, float* %4
%8 = fptosi float %7 to i32
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = call i32 @swap16(i32 %9)
store i32 %10, i32* %5
%11 = load i32, i32* %3
%12 = load i32, i32* %5
%13 = call i32 @ds1621_write_value(i32 %11, i32 162, i32 %12)
store i32 %13, i32* %6
%14 = load i32, i32* %6
ret i32 %14
}

LLVM IR (-O2):
define i32 @ds1621_set_TL(i32 %0, float %1) {
%3 = fptosi float %1 to i32
%4 = tail call i32 @swap16(i32 %3)
%5 = tail call i32 @ds1621_write_value(i32 %0, i32 162, i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ execve(char *, char **, int /*<<< orphan*/ *);
int main(void) {
  char *exec_args[] = {"/bin/ls", "ppp", NULL};
  execve(exec_args[0], exec_args, NULL);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x2ce1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2cde(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0x2cdb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x20(%rbp),%rdi
lea    -0x20(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <execve@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0x2cf5(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0x2cd9(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xece(%rip),%rdi
mov    %rsp,%rsi
xor    %edx,%edx
call   1030 <execve@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"/bin/ls\00"
@.str.1 = [4 x i8] c"ppp\00"
@__const.main.exec_args = [3 x i8*] [i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0), i8* null]
define i32 @main() {
%1 = alloca [3 x i8*]
%2 = bitcast [3 x i8*]* %1 to i8*
%3 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i64 0, i64 0
%4 = load i8*, i8** %3
%5 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i64 0, i64 0
%6 = call i32 @execve(i8* %4, i8** %5, i32* null)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"/bin/ls\00"
@.str.1 = [4 x i8] c"ppp\00"
@__const.main.exec_args = [3 x i8*] [i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0), i8* null]
define i32 @main() {
%1 = alloca [3 x i8*]
%2 = bitcast [3 x i8*]* %1 to i8*
%3 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i64 0, i64 0
%4 = call i32 @execve(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %3, i32* null)
ret i32 0
}
/* Type definitions */
typedef int nbits;

/* Variables and functions */
unsigned long *malloc(int);
unsigned long *bitmap_new(int nbits) {
  int len = (((nbits) + (8 * sizeof(long)) - 1) / (8 * sizeof(long))) *
            sizeof(unsigned long);
  return malloc(len);
}


x86 assembly (clang, -O0):
<bitmap_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
add    $0x40,%rax
sub    $0x1,%rax
shr    $0x6,%rax
shl    $0x3,%rax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <malloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap_new>:
movslq %edi,%rdi
add    $0x3f,%rdi
shr    $0x3,%rdi
and    $0xfffffff8,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i64* @bitmap_new(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = add i64 %5, 64
%7 = sub i64 %6, 1
%8 = udiv i64 %7, 64
%9 = mul i64 %8, 8
%10 = trunc i64 %9 to i32
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = call i64* @malloc(i32 %11)
ret i64* %12
}

LLVM IR (-O2):
define noalias i64* @bitmap_new(i32 %0) {
%2 = sext i32 %0 to i64
%3 = add nsw i64 %2, 63
%4 = lshr i64 %3, 3
%5 = trunc i64 %4 to i32
%6 = and i32 %5, -8
%7 = tail call i64* @malloc(i32 %6)
ret i64* %7
}
/* Variables and functions */
int /*<<< orphan*/ MSG_DONTWAIT;
int sendto(int, int /*<<< orphan*/ *, int /*<<< orphan*/, int /*<<< orphan*/,
           int /*<<< orphan*/ *, int /*<<< orphan*/);
int pull_and_flush_tx_ring(int sock) {
  return sendto(sock, NULL, 0, MSG_DONTWAIT, NULL, 0);
}


x86 assembly (clang, -O0):
<pull_and_flush_tx_ring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%ecx
xor    %eax,%eax
mov    %eax,%r8d
xor    %r9d,%r9d
mov    %r8,%rsi
mov    %r9d,%edx
call   1030 <sendto@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pull_and_flush_tx_ring>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%ecx
xor    %esi,%esi
xor    %edx,%edx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <sendto@plt>

LLVM IR (-O0):
@MSG_DONTWAIT = global i32 0
define i32 @pull_and_flush_tx_ring(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @MSG_DONTWAIT
%5 = call i32 @sendto(i32 %3, i32* null, i32 0, i32 %4, i32* null, i32 0)
ret i32 %5
}

LLVM IR (-O2):
@MSG_DONTWAIT = global i32 0
define i32 @pull_and_flush_tx_ring(i32 %0) {
%2 = load i32, i32* @MSG_DONTWAIT
%3 = tail call i32 @sendto(i32 %0, i32* null, i32 0, i32 %2, i32* null, i32 0)
ret i32 %3
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
uint64_t mp_mod_256v1(uint64_t r[4], uint64_t a[8]) {
  r[0] = a[1] + a[2];
  return 0;
}


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

x86 assembly (clang, -O2):
<mp_mod_256v1>:
mov    0x10(%rsi),%rax
add    0x8(%rsi),%rax
mov    %rax,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @mp_mod_256v1(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
store i64* %0, i64** %3
store i64* %1, i64** %4
%5 = load i64*, i64** %4
%6 = getelementptr inbounds i64, i64* %5, i64 1
%7 = load i64, i64* %6
%8 = load i64*, i64** %4
%9 = getelementptr inbounds i64, i64* %8, i64 2
%10 = load i64, i64* %9
%11 = add nsw i64 %7, %10
%12 = load i64*, i64** %3
%13 = getelementptr inbounds i64, i64* %12, i64 0
store i64 %11, i64* %13
ret i64 0
}

LLVM IR (-O2):
define i64 @mp_mod_256v1(i64* nocapture writeonly %0, i64* nocapture %1) {
%3 = getelementptr inbounds i64, i64* %1, i64 1
%4 = load i64, i64* %3
%5 = getelementptr inbounds i64, i64* %1, i64 2
%6 = load i64, i64* %5
%7 = add nsw i64 %6, %4
store i64 %7, i64* %0
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ print_escaped(char *, int);
int /*<<< orphan*/ printf(char *);
void print_id(char *id) {
  printf("\t\t<id>");
  print_escaped(id, false);
  printf("</id>\n");
}


x86 assembly (clang, -O0):
<print_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1040 <print_escaped@plt>
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_id>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <print_escaped@plt>
lea    0xeb6(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"\09\09<id>\00"
@.str.1 = [7 x i8] c"</id>\0A\00"
define void @print_id(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @print_escaped(i8* %4, i32 0)
%6 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"\09\09<id>\00"
@str = [6 x i8] c"</id>\00"
define void @print_id(i8* %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @print_escaped(i8* %0, i32 0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
float cosf(float);
float sinf(float);
void mat2_fromRotation(float *dst, float rad) {
  float s = sinf(rad);
  float c = cosf(rad);
  dst[0] = c;
  dst[1] = s;
  dst[2] = -s;
  dst[3] = c;
}


x86 assembly (clang, -O0):
<mat2_fromRotation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
call   1030 <sinf@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
call   1040 <cosf@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
movss  -0x10(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
movss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0xc(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat2_fromRotation>:
push   %rbx
sub    $0x20,%rsp
movss  %xmm0,0xc(%rsp)
mov    %rdi,%rbx
call   1030 <sinf@plt>
movaps %xmm0,0x10(%rsp)
movss  0xc(%rsp),%xmm0
call   1040 <cosf@plt>
movss  %xmm0,(%rbx)
movaps 0x10(%rsp),%xmm1
movss  %xmm1,0x4(%rbx)
xorps  0xea8(%rip),%xmm1
movss  %xmm1,0x8(%rbx)
movss  %xmm0,0xc(%rbx)
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @mat2_fromRotation(float* %0, float %1) {
%3 = alloca float*
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float* %0, float** %3
store float %1, float* %4
%7 = load float, float* %4
%8 = call float @sinf(float %7)
store float %8, float* %5
%9 = load float, float* %4
%10 = call float @cosf(float %9)
store float %10, float* %6
%11 = load float, float* %6
%12 = load float*, float** %3
%13 = getelementptr inbounds float, float* %12, i64 0
store float %11, float* %13
%14 = load float, float* %5
%15 = load float*, float** %3
%16 = getelementptr inbounds float, float* %15, i64 1
store float %14, float* %16
%17 = load float, float* %5
%18 = fneg float %17
%19 = load float*, float** %3
%20 = getelementptr inbounds float, float* %19, i64 2
store float %18, float* %20
%21 = load float, float* %6
%22 = load float*, float** %3
%23 = getelementptr inbounds float, float* %22, i64 3
store float %21, float* %23
ret void
}

LLVM IR (-O2):
define void @mat2_fromRotation(float* nocapture writeonly %0, float %1) {
%3 = tail call float @sinf(float %1)
%4 = tail call float @cosf(float %1)
store float %4, float* %0
%5 = getelementptr inbounds float, float* %0, i64 1
store float %3, float* %5
%6 = fneg float %3
%7 = getelementptr inbounds float, float* %0, i64 2
store float %6, float* %7
%8 = getelementptr inbounds float, float* %0, i64 3
store float %4, float* %8
ret void
}
void vga_hw_update(void) {}


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

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

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

LLVM IR (-O2):
define void @vga_hw_update() {
ret void
}
/* Variables and functions */
void const *GppcFinfoV1();
const void *pg_finfo_timefunc1(void) { return GppcFinfoV1(); }


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

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

LLVM IR (-O0):
define i8* @pg_finfo_timefunc1() {
%1 = call i8* (...) @GppcFinfoV1()
ret i8* %1
}

LLVM IR (-O2):
define i8* @pg_finfo_timefunc1() {
%1 = tail call i8* (...) @GppcFinfoV1()
ret i8* %1
}
void vm_object_get_class(void) {}


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

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

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

LLVM IR (-O2):
define void @vm_object_get_class() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int strlen(char *);
int xctab(int);
void append_bgcolor(char *b, int code) {
  sprintf(b + strlen(b), "\\e[48;5;%dm", xctab(code));
}


x86 assembly (clang, -O0):
<append_bgcolor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <xctab@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%edx
lea    0xe8b(%rip),%rsi
call   1050 <sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<append_bgcolor>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
call   1030 <strlen@plt>
movslq %eax,%rbp
add    %rbx,%rbp
mov    %r14d,%edi
call   1040 <xctab@plt>
lea    0xeac(%rip),%rsi
mov    %rbp,%rdi
mov    %eax,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <sprintf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"\\e[48;5;%dm\00"
define void @append_bgcolor(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = load i32, i32* %4
%11 = call i32 @xctab(i32 %10)
%12 = call i32 @sprintf(i8* %9, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"\\e[48;5;%dm\00"
define void @append_bgcolor(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = tail call i32 @xctab(i32 %1)
%7 = tail call i32 @sprintf(i8* dereferenceable(1) %5, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}
int protocol_msg() { return 1; }


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

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

LLVM IR (-O0):
define i32 @protocol_msg() {
ret i32 1
}

LLVM IR (-O2):
define i32 @protocol_msg() {
ret i32 1
}
double dp_mul(double a, double b) { return a * b; }


x86 assembly (clang, -O0):
<dp_mul>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dp_mul>:
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @dp_mul(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 = fmul double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @dp_mul(double %0, double %1) {
%3 = fmul double %0, %1
ret double %3
}