xunge/DecIR huggingface dataset:
/* Type definitions */
typedef scalar_t__ wchar_t;

/* Variables and functions */
wchar_t *wcschr(const wchar_t *s, int charwanted) {
  register wchar_t c;
  while ((c = *s++) != (wchar_t)charwanted)
    if (c == 0)
      return NULL;
  return ((wchar_t *)--s);
}


x86 assembly (clang, -O0):
<wcschr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
movslq -0x14(%rbp),%rcx
cmp    %rcx,%rax
je     114b <wcschr+0x4b>
cmpq   $0x0,-0x20(%rbp)
jne    1146 <wcschr+0x46>
movq   $0x0,-0x8(%rbp)
jmp    115b <wcschr+0x5b>
jmp    110b <wcschr+0xb>
mov    -0x10(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x10(%rbp)
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcschr>:
mov    %rdi,%rax
movslq %esi,%rcx
cs nopw 0x0(%rax,%rax,1)
mov    (%rax),%rdx
cmp    %rcx,%rdx
je     1123 <wcschr+0x23>
add    $0x8,%rax
test   %rdx,%rdx
jne    1110 <wcschr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64* @wcschr(i64* %0, i32 %1) {
%3 = sext i32 %1 to i64
br label %4
4: ; preds = %8, %2
%5 = phi i64* [ %0, %2 ], [ %9, %8 ]
%6 = load i64, i64* %5
%7 = icmp eq i64 %6, %3
br i1 %7, label %11, label %8
8: ; preds = %4
%9 = getelementptr inbounds i64, i64* %5, i64 1
%10 = icmp eq i64 %6, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %8
%12 = phi i64* [ null, %8 ], [ %5, %4 ]
ret i64* %12
}
/* Variables and functions */
scalar_t__ RTCMgetbits(unsigned char *, int, int);
double RTCMgetbitu(unsigned char *, int, int);
double RTCMgetbits_38(unsigned char *buff, int pos) {
  return (double)RTCMgetbits(buff, pos, 32) * 64.0 +
         RTCMgetbitu(buff, pos + 32, 6);
}


x86 assembly (clang, -O0):
<RTCMgetbits_38>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x20,%edx
call   1040 <RTCMgetbits@plt>
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
add    $0x20,%esi
mov    $0x6,%edx
call   1030 <RTCMgetbitu@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  0xe92(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RTCMgetbits_38>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    $0x20,%edx
call   1040 <RTCMgetbits@plt>
cvtsi2sd %rax,%xmm0
movsd  %xmm0,(%rsp)
add    $0x20,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x6,%edx
call   1030 <RTCMgetbitu@plt>
movsd  (%rsp),%xmm1
mulsd  0xea4(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define double @RTCMgetbits_38(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 i32, i32* %4
%7 = call i64 @RTCMgetbits(i8* %5, i32 %6, i32 32)
%8 = sitofp i64 %7 to double
%9 = load i8*, i8** %3
%10 = load i32, i32* %4
%11 = add nsw i32 %10, 32
%12 = call double @RTCMgetbitu(i8* %9, i32 %11, i32 6)
%13 = call double @llvm.fmuladd.f64(double %8, double 6.400000e+01, double %12)
ret double %13
}

LLVM IR (-O2):
define double @RTCMgetbits_38(i8* %0, i32 %1) {
%3 = tail call i64 @RTCMgetbits(i8* %0, i32 %1, i32 32)
%4 = sitofp i64 %3 to double
%5 = add nsw i32 %1, 32
%6 = tail call double @RTCMgetbitu(i8* %0, i32 %5, i32 6)
%7 = tail call double @llvm.fmuladd.f64(double %4, double 6.400000e+01, double %6)
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ task_a(int, int, int ****);
int main() {
  int size = 1, size2 = 1;
  int tt[3][5][5][5];
#pragma css start
  task_a(size, size2, tt);
#pragma css finish
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x5f0,%rsp
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    -0x5f0(%rbp),%rdx
call   1030 <task_a@plt>
xor    %eax,%eax
add    $0x5f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x5e8,%rsp
mov    %rsp,%rdx
mov    $0x1,%edi
mov    $0x1,%esi
call   1030 <task_a@plt>
xor    %eax,%eax
add    $0x5e8,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [3 x [5 x [5 x [5 x i32]]]]
store i32 1, i32* %1
store i32 1, i32* %2
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = getelementptr inbounds [3 x [5 x [5 x [5 x i32]]]], [3 x [5 x [5 x [5 x i32]]]]* %3, i64 0, i64 0
%7 = bitcast [5 x [5 x [5 x i32]]]* %6 to i32****
%8 = call i32 @task_a(i32 %4, i32 %5, i32**** %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [3 x [5 x [5 x [5 x i32]]]]
%2 = bitcast [3 x [5 x [5 x [5 x i32]]]]* %1 to i8*
%3 = bitcast [3 x [5 x [5 x [5 x i32]]]]* %1 to i32****
%4 = call i32 @task_a(i32 1, i32 1, i32**** %3)
ret i32 0
}
int test20(int x) {
  return x && 4;
  return x && sizeof(int) == 4;
  return x && (signed char)1;
}


x86 assembly (clang, -O0):
<test20>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1120 <test20+0x20>
mov    $0x1,%al
mov    %al,-0x5(%rbp)
jmp    1120 <test20+0x20>
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test20>:
xor    %eax,%eax
test   %edi,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @test20(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %6
6: ; preds = %5, %1
%7 = phi i1 [ false, %1 ], [ true, %5 ]
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @test20(i32 %0) {
%2 = icmp ne i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int varfunc() {
  int var = 0;
  static int static_var = 0;
  printf("\40:var equal %d\n", var);
  printf("\40:static var equal %d\n", static_var);
  printf("\n");
  var++;
  static_var++;
}


x86 assembly (clang, -O0):
<varfunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2ef6(%rip),%esi
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    0x2ecb(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ec2(%rip)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<varfunc>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2efd(%rip),%esi
lea    0xed2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
addl   $0x1,0x2ede(%rip)
pop    %rcx
ret

LLVM IR (-O0):
@varfunc.static_var = internal global i32 0
@.str = [16 x i8] c" :var equal %d\0A\00"
@.str.1 = [23 x i8] c" :static var equal %d\0A\00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @varfunc() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @varfunc.static_var
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
store i32 %9, i32* %2
%10 = load i32, i32* @varfunc.static_var
%11 = add nsw i32 %10, 1
store i32 %11, i32* @varfunc.static_var
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@varfunc.static_var = internal unnamed_addr global i32 0
@.str = [16 x i8] c" :var equal %d\0A\00"
@.str.1 = [23 x i8] c" :static var equal %d\0A\00"
define i32 @varfunc() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = load i32, i32* @varfunc.static_var
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = tail call i32 @putchar(i32 10)
%5 = load i32, i32* @varfunc.static_var
%6 = add nsw i32 %5, 1
store i32 %6, i32* @varfunc.static_var
ret i32 undef
}
/* Variables and functions */
short add_short(short, short);
short wack_short(register short u, register short v) {
  register short l = u, r = v;
  l = add_short(l, r);
  return l + r;
}


x86 assembly (clang, -O0):
<wack_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x2(%rbp),%ax
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%ax
mov    %ax,-0x8(%rbp)
mov    -0x6(%rbp),%ax
movswl %ax,%edi
movswl -0x8(%rbp),%esi
call   1030 <add_short@plt>
mov    %ax,-0x6(%rbp)
movswl -0x6(%rbp),%eax
movswl -0x8(%rbp),%ecx
add    %ecx,%eax
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wack_short>:
push   %rbx
mov    %esi,%ebx
call   1030 <add_short@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i16 @wack_short(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
%5 = alloca i16
%6 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%7 = load i16, i16* %3
store i16 %7, i16* %5
%8 = load i16, i16* %4
store i16 %8, i16* %6
%9 = load i16, i16* %5
%10 = load i16, i16* %6
%11 = call signext i16 @add_short(i16 signext %9, i16 signext %10)
store i16 %11, i16* %5
%12 = load i16, i16* %5
%13 = sext i16 %12 to i32
%14 = load i16, i16* %6
%15 = sext i16 %14 to i32
%16 = add nsw i32 %13, %15
%17 = trunc i32 %16 to i16
ret i16 %17
}

LLVM IR (-O2):
define signext i16 @wack_short(i16 signext %0, i16 signext %1) {
%3 = tail call signext i16 @add_short(i16 signext %0, i16 signext %1)
%4 = add i16 %3, %1
ret i16 %4
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
int /*<<< orphan*/ mu_final();
void __attribute__((noreturn)) mu_exit(void) { _exit(mu_final()); }


x86 assembly (clang, -O0):
<mu_exit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <mu_final@plt>
mov    %eax,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<mu_exit>:
push   %rax
xor    %eax,%eax
call   1040 <mu_final@plt>
mov    %eax,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define void @mu_exit() {
%1 = call i32 (...) @mu_final()
%2 = call i32 @_exit(i32 %1)
unreachable
}

LLVM IR (-O2):
define void @mu_exit() {
%1 = tail call i32 (...) @mu_final()
%2 = tail call i32 @_exit(i32 %1)
unreachable
}
int __ev_prog_finish() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @__ev_prog_finish() {
ret i32 0
}
long s4q(long a, long b) { return a * 4 + b; }


x86 assembly (clang, -O0):
<s4q>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x2,%rax
add    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<s4q>:
lea    (%rsi,%rdi,4),%rax
ret

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

LLVM IR (-O2):
define i64 @s4q(i64 %0, i64 %1) {
%3 = shl nsw i64 %0, 2
%4 = add nsw i64 %3, %1
ret i64 %4
}
int compare(const void *left, const void *right) {
  long cmp = *(char **)left - *(char **)right;
  return (cmp < 0 ? -1 : 1);
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rcx
sub    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdx
mov    $0x1,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%rdx
cmovl  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
mov    (%rdi),%rax
xor    %ecx,%ecx
cmp    (%rsi),%rax
setns  %cl
lea    (%rcx,%rcx,1),%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @compare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i8**
%8 = load i8*, i8** %7
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i8**
%11 = load i8*, i8** %10
%12 = ptrtoint i8* %8 to i64
%13 = ptrtoint i8* %11 to i64
%14 = sub i64 %12, %13
store i64 %14, i64* %5
%15 = load i64, i64* %5
%16 = icmp slt i64 %15, 0
%17 = zext i1 %16 to i64
%18 = select i1 %16, i32 -1, i32 1
ret i32 %18
}

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = ptrtoint i8* %4 to i64
%8 = ptrtoint i8* %6 to i64
%9 = sub i64 %7, %8
%10 = icmp slt i64 %9, 0
%11 = select i1 %10, i32 -1, i32 1
ret i32 %11
}
int isValid(char *s) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @isValid(i8* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ key_expiration_time4(char *);
int /*<<< orphan*/ printf(char *);
extern void key_expiration_time(int len) {
  printf("\t");
  key_expiration_time4("Time");
}


x86 assembly (clang, -O0):
<key_expiration_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1040 <printf@plt>
lea    0xec4(%rip),%rdi
call   1030 <key_expiration_time4@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<key_expiration_time>:
push   %rax
mov    $0x9,%edi
call   1030 <putchar@plt>
lea    0xece(%rip),%rdi
pop    %rax
jmp    1040 <key_expiration_time4@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\09\00"
@.str.1 = [5 x i8] c"Time\00"
define void @key_expiration_time(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @key_expiration_time4(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [5 x i8] c"Time\00"
define void @key_expiration_time(i32 %0) {
%2 = tail call i32 @putchar(i32 9)
%3 = tail call i32 @key_expiration_time4(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void kdb_init(int level) {}


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

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

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

LLVM IR (-O2):
define void @kdb_init(i32 %0) {
ret void
}
/* Type definitions */
struct wl_subsurface {
  int dummy;
};
struct wl_proxy {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_set_user_data(struct wl_proxy *, void *);
void wl_subsurface_set_user_data(struct wl_subsurface *wl_subsurface,
                                 void *user_data) {
  wl_proxy_set_user_data((struct wl_proxy *)wl_subsurface, user_data);
}


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

x86 assembly (clang, -O2):
<wl_subsurface_set_user_data>:
jmp    1030 <wl_proxy_set_user_data@plt>

LLVM IR (-O0):
%struct.wl_subsurface = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_subsurface_set_user_data(%struct.wl_subsurface* %0, i8* %1) {
%3 = alloca %struct.wl_subsurface*
%4 = alloca i8*
store %struct.wl_subsurface* %0, %struct.wl_subsurface** %3
store i8* %1, i8** %4
%5 = load %struct.wl_subsurface*, %struct.wl_subsurface** %3
%6 = bitcast %struct.wl_subsurface* %5 to %struct.wl_proxy*
%7 = load i8*, i8** %4
%8 = call i32 @wl_proxy_set_user_data(%struct.wl_proxy* %6, i8* %7)
ret void
}

LLVM IR (-O2):
%struct.wl_subsurface = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_subsurface_set_user_data(%struct.wl_subsurface* %0, i8* %1) {
%3 = bitcast %struct.wl_subsurface* %0 to %struct.wl_proxy*
%4 = tail call i32 @wl_proxy_set_user_data(%struct.wl_proxy* %3, i8* %1)
ret void
}
/* Variables and functions */
scalar_t__ is_amicable(unsigned int);
int /*<<< orphan*/ printf(char *, unsigned int);
int main(void) {
  unsigned int sum = 0;
  unsigned int i;
  for (i = 1; i < 10000; i++) {
    if (is_amicable(i)) {
      sum += i;
    }
  }
  printf("%u\n", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x2710,-0xc(%rbp)
jae    1178 <main+0x58>
mov    -0xc(%rbp),%edi
call   1030 <is_amicable@plt>
cmp    $0x0,%rax
je     1165 <main+0x45>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    116a <main+0x4a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113d <main+0x1d>
mov    -0x8(%rbp),%esi
lea    0xe7e(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %ebx,%ebx
mov    $0x1,%ebp
jmp    113d <main+0x1d>
nopl   0x0(%rax)
add    %ecx,%ebx
add    $0x1,%ebp
cmp    $0x2710,%ebp
je     1152 <main+0x32>
mov    %ebp,%edi
call   1030 <is_amicable@plt>
mov    $0x0,%ecx
test   %rax,%rax
je     1130 <main+0x10>
mov    %ebp,%ecx
jmp    1130 <main+0x10>
lea    0xea7(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%u\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 1, %0 ], [ %8, %1 ]
%3 = phi i32 [ 0, %0 ], [ %7, %1 ]
%4 = tail call i64 @is_amicable(i32 %2)
%5 = icmp eq i64 %4, 0
%6 = select i1 %5, i32 0, i32 %2
%7 = add i32 %6, %3
%8 = add nuw nsw i32 %2, 1
%9 = icmp eq i32 %8, 10000
br i1 %9, label %10, label %1
10: ; preds = %1
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}
int isabspath(const char *p) {
  if (p[0] == '/')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isabspath>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1124 <isabspath+0x24>
movl   $0x1,-0x4(%rbp)
jmp    112b <isabspath+0x2b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isabspath>:
xor    %eax,%eax
cmpb   $0x2f,(%rdi)
sete   %al
ret

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

LLVM IR (-O2):
define i32 @isabspath(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 47
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int err_syntax20_parse();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("yyparse() = %d\n", err_syntax20_parse());
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <err_syntax20_parse@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [16 x i8] c"yyparse() = %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @err_syntax20_parse()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ DMA1_DriverIRQHandler();
__attribute__((weak, section(".after_vectors"))) void DMA1_IRQHandler(void) {
  DMA1_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @DMA1_IRQHandler() section ".after_vectors" {
%1 = call i32 (...) @DMA1_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @DMA1_IRQHandler() section ".after_vectors" {
%1 = tail call i32 (...) @DMA1_DriverIRQHandler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ read(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ write(int, char *, int);
void func() {
  char name[0x50];
  read(0, name, 0x100);
  write(1, name, 0x100);
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x50(%rbp),%rsi
xor    %edi,%edi
mov    $0x100,%edx
call   1040 <read@plt>
lea    -0x50(%rbp),%rsi
mov    $0x1,%edi
mov    $0x100,%edx
call   1030 <write@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
push   %rbx
sub    $0x50,%rsp
mov    %rsp,%rbx
xor    %edi,%edi
mov    %rbx,%rsi
mov    $0x100,%edx
call   1040 <read@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x100,%edx
call   1030 <write@plt>
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @func() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = call i32 @read(i32 0, i8* %2, i32 256)
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%5 = call i32 @write(i32 1, i8* %4, i32 256)
ret void
}

LLVM IR (-O2):
define void @func() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = call i32 @read(i32 0, i8* %2, i32 256)
%4 = call i32 @write(i32 1, i8* %2, i32 256)
ret void
}
int onlyspace(char *s) {
  while (*s) {
    if (*s != ' ' && *s != '\t' && *s != '\n')
      return 0;
    s++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<onlyspace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1162 <onlyspace+0x62>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     1151 <onlyspace+0x51>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
je     1151 <onlyspace+0x51>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     1151 <onlyspace+0x51>
movl   $0x0,-0x4(%rbp)
jmp    1169 <onlyspace+0x69>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1108 <onlyspace+0x8>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<onlyspace>:
jmp    1114 <onlyspace+0x14>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%rdi
movzbl (%rdi),%eax
lea    -0x9(%rax),%ecx
cmp    $0x2,%cl
jb     1110 <onlyspace+0x10>
cmp    $0x20,%al
je     1110 <onlyspace+0x10>
test   %al,%al
jne    112d <onlyspace+0x2d>
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @onlyspace(i8* nocapture %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 0, label %8
i8 32, label %5
i8 9, label %5
i8 10, label %5
]
5: ; preds = %2, %2, %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
br label %8
8: ; preds = %2, %7
%9 = phi i32 [ 0, %7 ], [ 1, %2 ]
ret i32 %9
}
void main() {
  char s[] = "azxxxzy";
  ;
}


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

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

LLVM IR (-O0):
@__const.main.s = [8 x i8] c"azxxxzy\00"
define void @main() {
%1 = alloca [8 x i8]
%2 = bitcast [8 x i8]* %1 to i8*
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
void push(int i, int *stack) {
  stack[0] = stack[0] + 1;
  stack[stack[0]] = i;
}


x86 assembly (clang, -O0):
<push>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq (%rcx),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<push>:
movslq (%rsi),%rax
lea    0x1(%rax),%rcx
mov    %ecx,(%rsi)
mov    %edi,0x4(%rsi,%rax,4)
ret

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

LLVM IR (-O2):
define void @push(i32 %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = add nsw i32 %3, 1
store i32 %4, i32* %1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %1, i64 %5
store i32 %0, i32* %6
ret void
}
/* Variables and functions */
void *realloc(void *, size_t);
void *bi_realloc(void *p, size_t n) { return realloc(p, n); }


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

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

LLVM IR (-O0):
define i8* @bi_realloc(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 = call i8* @realloc(i8* %5, i64 %6)
ret i8* %7
}

LLVM IR (-O2):
define noalias i8* @bi_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
ret i8* %3
}
int fun126() { return 126; }


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

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

LLVM IR (-O0):
define i32 @fun126() {
ret i32 126
}

LLVM IR (-O2):
define i32 @fun126() {
ret i32 126
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void *offset(const void *const addr, const int bytes) {
  assert(((addr)) && "Unexpected null pointer.");
  ;
  return (void *)(((char *)addr) + bytes);
}


x86 assembly (clang, -O0):
<offset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
je     1139 <offset+0x29>
mov    $0x1,%al
mov    %al,-0xd(%rbp)
jmp    1139 <offset+0x29>
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<offset>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
movslq %ebp,%rax
add    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Unexpected null pointer.\00"
define i8* @offset(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 = icmp ne i8* %5, null
br i1 %6, label %7, label %8
7: ; preds = %2
br label %8
8: ; preds = %7, %2
%9 = phi i1 [ false, %2 ], [ true, %7 ]
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i8*, i8** %3
%13 = load i32, i32* %4
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
ret i8* %15
}

LLVM IR (-O2):
define i8* @offset(i8* readnone %0, i32 %1) {
%3 = icmp ne i8* %0, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
ret i8* %7
}
/* Variables and functions */
void *malloc(size_t);
void *VdsMalloc(size_t size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<VdsMalloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @VdsMalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Type definitions */
struct FileInfo {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct FileInfo *);
void ReleaseFileInfo(struct FileInfo *fi) { free(fi); }


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

x86 assembly (clang, -O2):
<ReleaseFileInfo>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.FileInfo = type { i32 }
define void @ReleaseFileInfo(%struct.FileInfo* nocapture %0) {
%2 = tail call i32 @free(%struct.FileInfo* %0)
ret void
}
/* Variables and functions */
int ntohs(unsigned short);
int select_packet(void *workspace, unsigned char *packet, int id1, int id2,
                  int id3, int id4) {
  int pkid;
  pkid = ntohs(*(unsigned short *)(packet + 2));
  if (pkid == id1) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<select_packet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
mov    -0x18(%rbp),%rax
movzwl 0x2(%rax),%edi
call   1030 <ntohs@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jne    1156 <select_packet+0x46>
movl   $0x1,-0x4(%rbp)
jmp    115d <select_packet+0x4d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<select_packet>:
push   %rbx
mov    %edx,%ebx
movzwl 0x2(%rsi),%edi
call   1030 <ntohs@plt>
xor    %ecx,%ecx
cmp    %ebx,%eax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @select_packet(i8* nocapture readnone %0, i8* nocapture %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = getelementptr inbounds i8, i8* %1, i64 2
%8 = bitcast i8* %7 to i16*
%9 = load i16, i16* %8
%10 = tail call i32 @ntohs(i16 zeroext %9)
%11 = icmp eq i32 %10, %2
%12 = zext i1 %11 to i32
ret i32 %12
}
__attribute__((always_)) unsigned int readl(const volatile void *addr) {
  unsigned int ret;
  asm volatile("mov"
               "l"
               " %1,%0"
               : "=r"(ret)
               : "m"(*(volatile unsigned int *)addr)
               : "memory");
  return ret;
}


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

x86 assembly (clang, -O2):
<readl>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @readl(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
%6 = call i32 asm sideeffect "movl $1,$0", "=r,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @readl(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 asm sideeffect "movl $1,$0", "=r,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %2)
ret i32 %3
}
/* Type definitions */
struct cli_def {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cli_error(struct cli_def *, char *);
int cli_int_buildmode_execute_cback(struct cli_def *cli, const char *command,
                                    char *argv[], int argc) {
  int rc = -12;
  if (argc > 0) {
    cli_error(cli, "Extra arguments on command line, command ignored.");
    rc = -1;
  }
  return rc;
}


x86 assembly (clang, -O0):
<cli_int_buildmode_execute_cback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movl   $0xfffffff4,-0x20(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jle    114f <cli_int_buildmode_execute_cback+0x3f>
mov    -0x8(%rbp),%rdi
lea    0xebd(%rip),%rsi
call   1030 <cli_error@plt>
movl   $0xffffffff,-0x20(%rbp)
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cli_int_buildmode_execute_cback>:
test   %ecx,%ecx
jle    112b <cli_int_buildmode_execute_cback+0x1b>
push   %rax
lea    0xee4(%rip),%rsi
call   1030 <cli_error@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
ret
mov    $0xfffffff4,%eax
ret

LLVM IR (-O0):
%struct.cli_def = type { i32 }
@.str = [50 x i8] c"Extra arguments on command line, command ignored.\00"
define i32 @cli_int_buildmode_execute_cback(%struct.cli_def* %0, i8* %1, i8** %2, i32 %3) {
%5 = alloca %struct.cli_def*
%6 = alloca i8*
%7 = alloca i8**
%8 = alloca i32
%9 = alloca i32
store %struct.cli_def* %0, %struct.cli_def** %5
store i8* %1, i8** %6
store i8** %2, i8*** %7
store i32 %3, i32* %8
store i32 -12, i32* %9
%10 = load i32, i32* %8
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %4
%13 = load %struct.cli_def*, %struct.cli_def** %5
%14 = call i32 @cli_error(%struct.cli_def* %13, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %9
br label %15
15: ; preds = %12, %4
%16 = load i32, i32* %9
ret i32 %16
}

LLVM IR (-O2):
%struct.cli_def = type { i32 }
@.str = [50 x i8] c"Extra arguments on command line, command ignored.\00"
define i32 @cli_int_buildmode_execute_cback(%struct.cli_def* %0, i8* nocapture readnone %1, i8** nocapture readnone %2, i32 %3) {
%5 = icmp sgt i32 %3, 0
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 @cli_error(%struct.cli_def* %0, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ -1, %6 ], [ -12, %4 ]
ret i32 %9
}
void dec_rt_prio(struct rt_rq *rt_rq, int prio) {}


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

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

LLVM IR (-O0):
%struct.rt_rq = type opaque
define void @dec_rt_prio(%struct.rt_rq* %0, i32 %1) {
%3 = alloca %struct.rt_rq*
%4 = alloca i32
store %struct.rt_rq* %0, %struct.rt_rq** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.rt_rq = type opaque
define void @dec_rt_prio(%struct.rt_rq* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int cgi_getnentrybool(char const *, int, int /*<<< orphan*/);
int cgi_getentrybool(const char *field_name, int def) {
  return cgi_getnentrybool(field_name, def, 0);
}


x86 assembly (clang, -O0):
<cgi_getentrybool>:
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 <cgi_getnentrybool@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @cgi_getentrybool(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 i32, i32* %4
%7 = call i32 @cgi_getnentrybool(i8* %5, i32 %6, i32 0)
ret i32 %7
}

LLVM IR (-O2):
define i32 @cgi_getentrybool(i8* %0, i32 %1) {
%3 = tail call i32 @cgi_getnentrybool(i8* %0, i32 %1, i32 0)
ret i32 %3
}
/* Variables and functions */
int atoi(char *);
char *strrchr(char *, char);
int get_coco_image_id(char *filename) {
  char *p = strrchr(filename, '_');
  return atoi(p + 1);
}


x86 assembly (clang, -O0):
<get_coco_image_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x5f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1040 <atoi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_coco_image_id>:
push   %rax
mov    $0x5f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rdi
pop    %rax
jmp    1040 <atoi@plt>

LLVM IR (-O0):
define i32 @get_coco_image_id(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 95)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = call i32 @atoi(i8* %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @get_coco_image_id(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 95)
%3 = getelementptr inbounds i8, i8* %2, i64 1
%4 = tail call i32 @atoi(i8* %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ getcwd(char *, int);
void Q_getwd(char *out) { getcwd(out, 1024); }


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

x86 assembly (clang, -O2):
<Q_getwd>:
mov    $0x400,%esi
jmp    1030 <getcwd@plt>

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

LLVM IR (-O2):
define void @Q_getwd(i8* %0) {
%2 = tail call i32 @getcwd(i8* %0, i32 1024)
ret void
}
/* Variables and functions */
double dnrm2_(int *, double *, int *);
double dnrm2(int n, double *x, int incx) { return dnrm2_(&n, x, &incx); }


x86 assembly (clang, -O0):
<dnrm2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rsi
lea    -0x4(%rbp),%rdi
lea    -0x14(%rbp),%rdx
call   1030 <dnrm2_@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dnrm2>:
push   %rax
mov    %edi,0x4(%rsp)
mov    %edx,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rdx
call   1030 <dnrm2_@plt>
pop    %rax
ret

LLVM IR (-O0):
define double @dnrm2(i32 %0, double* %1, i32 %2) {
%4 = alloca i32
%5 = alloca double*
%6 = alloca i32
store i32 %0, i32* %4
store double* %1, double** %5
store i32 %2, i32* %6
%7 = load double*, double** %5
%8 = call double @dnrm2_(i32* %4, double* %7, i32* %6)
ret double %8
}

LLVM IR (-O2):
define double @dnrm2(i32 %0, double* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %2, i32* %5
%6 = call double @dnrm2_(i32* %4, double* %1, i32* %5)
ret double %6
}
int nn_pub_events(struct nn_sockbase *self) { return 2; }


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

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

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

LLVM IR (-O2):
%struct.nn_sockbase = type opaque
define i32 @nn_pub_events(%struct.nn_sockbase* nocapture readnone %0) {
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ pA(char *);
int /*<<< orphan*/ write_mem(char const *, char *);
void push_stack(const char *regname_data) {
  write_mem(regname_data, "stack_head");
  pA("stack_head++;");
}


x86 assembly (clang, -O0):
<push_stack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <write_mem@plt>
lea    0xec8(%rip),%rdi
call   1030 <pA@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<push_stack>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <write_mem@plt>
lea    0xed7(%rip),%rdi
pop    %rax
jmp    1030 <pA@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"stack_head\00"
@.str.1 = [14 x i8] c"stack_head++;\00"
define void @push_stack(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @write_mem(i8* %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @pA(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"stack_head\00"
@.str.1 = [14 x i8] c"stack_head++;\00"
define void @push_stack(i8* %0) {
%2 = tail call i32 @write_mem(i8* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @pA(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void iso_reset() {}


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

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

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

LLVM IR (-O2):
define void @iso_reset() {
ret void
}
/* Variables and functions */
float exp(float);
void FExp(float *vec, int n) {
  int x;
  for (x = 0; x < n; x++)
    vec[x] = exp(vec[x]);
}


x86 assembly (clang, -O0):
<FExp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115f <FExp+0x4f>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
call   1030 <exp@plt>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <FExp+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FExp>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    114a <FExp+0x3a>
mov    %rdi,%r15
mov    %esi,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movss  (%r15,%rbx,4),%xmm0
call   1030 <exp@plt>
movss  %xmm0,(%r15,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1130 <FExp+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @FExp(float* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds float, float* %0, i64 %7
%9 = load float, float* %8
%10 = tail call float @exp(float %9)
store float %10, float* %8
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
void *bar(char const *);
void *__attribute__((malloc, no)) foo(const char *p) { return bar(p); }


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

x86 assembly (clang, -O2):
<foo>:
jmp    1030 <bar@plt>

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

LLVM IR (-O2):
define noalias i8* @foo(i8* %0) {
%2 = tail call i8* @bar(i8* %0)
ret i8* %2
}
void gendadd() {}


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

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

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

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