xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void greetz(char *buf) {
  char name[8] = {
      0,
  };
  strcpy(name, buf);
  printf("Hello %s\n", name);
}


x86 assembly (clang, -O0):
<greetz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1050 <memset@plt>
lea    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x10(%rbp),%rsi
lea    0xe9c(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<greetz>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rsi
movq   $0x0,0x8(%rsp)
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xebb(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Hello %s\0A\00"
define void @greetz(i8* %0) {
%2 = alloca i8*
%3 = alloca [8 x i8]
store i8* %0, i8** %2
%4 = bitcast [8 x i8]* %3 to i8*
%5 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%6 = load i8*, i8** %2
%7 = call i32 @strcpy(i8* %5, i8* %6)
%8 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"Hello %s\0A\00"
define void @greetz(i8* %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
store i64 0, i64* %2
%4 = call i32 @strcpy(i8* %3, i8* %0)
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
void integral_cast() {
  int a;
  int b = ((char)a) + 2;
}


x86 assembly (clang, -O0):
<integral_cast>:
push   %rbp
mov    %rsp,%rbp
mov    -0x4(%rbp),%eax
movsbl %al,%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @integral_cast() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* %1
%4 = trunc i32 %3 to i8
%5 = sext i8 %4 to i32
%6 = add nsw i32 %5, 2
store i32 %6, i32* %2
ret void
}

LLVM IR (-O2):
define void @integral_cast() {
ret void
}
unsigned roundup(unsigned n) {
  n--;
  n |= n >> 1;
  n |= n >> 2;
  n |= n >> 4;
  n |= n >> 8;
  n |= n >> 16;
  n++;
  return n;
}


x86 assembly (clang, -O0):
<roundup>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x2,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x4,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<roundup>:
lea    -0x1(%rdi),%eax
mov    %eax,%ecx
shr    %ecx
or     %eax,%ecx
mov    %ecx,%eax
shr    $0x2,%eax
or     %ecx,%eax
mov    %eax,%ecx
shr    $0x4,%ecx
or     %eax,%ecx
mov    %ecx,%edx
shr    $0x8,%edx
or     %ecx,%edx
mov    %edx,%eax
shr    $0x10,%eax
or     %edx,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @roundup(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, -1
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = lshr i32 %5, 1
%7 = load i32, i32* %2
%8 = or i32 %7, %6
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = lshr i32 %9, 2
%11 = load i32, i32* %2
%12 = or i32 %11, %10
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = lshr i32 %13, 4
%15 = load i32, i32* %2
%16 = or i32 %15, %14
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = lshr i32 %17, 8
%19 = load i32, i32* %2
%20 = or i32 %19, %18
store i32 %20, i32* %2
%21 = load i32, i32* %2
%22 = lshr i32 %21, 16
%23 = load i32, i32* %2
%24 = or i32 %23, %22
store i32 %24, i32* %2
%25 = load i32, i32* %2
%26 = add i32 %25, 1
store i32 %26, i32* %2
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @roundup(i32 %0) {
%2 = add i32 %0, -1
%3 = lshr i32 %2, 1
%4 = or i32 %3, %2
%5 = lshr i32 %4, 2
%6 = or i32 %5, %4
%7 = lshr i32 %6, 4
%8 = or i32 %7, %6
%9 = lshr i32 %8, 8
%10 = or i32 %9, %8
%11 = lshr i32 %10, 16
%12 = or i32 %11, %10
%13 = add i32 %12, 1
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ MIPS_SET_BIT(int, int);
void xburst_cgm_gate_gpvlc() { MIPS_SET_BIT((0xB0000000 + 0x28), 7); }


x86 assembly (clang, -O0):
<xburst_cgm_gate_gpvlc>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb0000028,%edi
mov    $0x7,%esi
call   1030 <MIPS_SET_BIT@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<xburst_cgm_gate_gpvlc>:
mov    $0xb0000028,%edi
mov    $0x7,%esi
jmp    1030 <MIPS_SET_BIT@plt>

LLVM IR (-O0):
define void @xburst_cgm_gate_gpvlc() {
%1 = call i32 @MIPS_SET_BIT(i32 -1342177240, i32 7)
ret void
}

LLVM IR (-O2):
define void @xburst_cgm_gate_gpvlc() {
%1 = tail call i32 @MIPS_SET_BIT(i32 -1342177240, i32 7)
ret void
}
void ARGB1555ToARGBRow_C() {}


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

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

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

LLVM IR (-O2):
define void @ARGB1555ToARGBRow_C() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lgen2(char *, int, int);
void cgcase(int v, int l) { lgen2(".quad\t%d,%c%d", v, l); }


x86 assembly (clang, -O0):
<cgcase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xed5(%rip),%rdi
call   1030 <lgen2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgcase>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
jmp    1030 <lgen2@plt>

LLVM IR (-O0):
@.str = [14 x i8] c".quad\09%d,%c%d\00"
define void @cgcase(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 @lgen2(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c".quad\09%d,%c%d\00"
define void @cgcase(i32 %0, i32 %1) {
%3 = tail call i32 @lgen2(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret void
}
int feq(float x, float y) {
  if (x == y)
    return 13;
  else
    return 140;
}


x86 assembly (clang, -O0):
<feq>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jne    112f <feq+0x2f>
jp     112f <feq+0x2f>
movl   $0xd,-0x4(%rbp)
jmp    1136 <feq+0x36>
movl   $0x8c,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<feq>:
ucomiss %xmm1,%xmm0
setnp  %al
sete   %cl
test   %al,%cl
mov    $0xd,%ecx
mov    $0x8c,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @feq(float %0, float %1) {
%3 = alloca i32
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = load float, float* %5
%8 = fcmp oeq float %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 13, i32* %3
br label %11
10: ; preds = %2
store i32 140, i32* %3
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @feq(float %0, float %1) {
%3 = fcmp oeq float %0, %1
%4 = select i1 %3, i32 13, i32 140
ret i32 %4
}
void TextDisplaySetTitle(const char *str) {}


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

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

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

LLVM IR (-O2):
define void @TextDisplaySetTitle(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void crash(int signal) { exit(255); }


x86 assembly (clang, -O0):
<crash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xff,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<crash>:
push   %rax
mov    $0xff,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @crash(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @exit(i32 255)
unreachable
}

LLVM IR (-O2):
define void @crash(i32 %0) {
%2 = tail call i32 @exit(i32 255)
unreachable
}
int setVlan(struct ifreq *ifr) {
  int ret = 0;
  return ret;
}


x86 assembly (clang, -O0):
<setVlan>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ifreq = type opaque
define i32 @setVlan(%struct.ifreq* %0) {
%2 = alloca %struct.ifreq*
%3 = alloca i32
store %struct.ifreq* %0, %struct.ifreq** %2
store i32 0, i32* %3
%4 = load i32, i32* %3
ret i32 %4
}

LLVM IR (-O2):
%struct.ifreq = type opaque
define i32 @setVlan(%struct.ifreq* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
char *ut_string_lstrip(int /*<<< orphan*/);
int /*<<< orphan*/ ut_string_rstrip(char *);
char *ut_string_strip(char *str) {
  return ut_string_lstrip(ut_string_rstrip(str));
}


x86 assembly (clang, -O0):
<ut_string_strip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ut_string_rstrip@plt>
mov    %eax,%edi
call   1040 <ut_string_lstrip@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ut_string_strip>:
push   %rax
call   1030 <ut_string_rstrip@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <ut_string_lstrip@plt>

LLVM IR (-O0):
define i8* @ut_string_strip(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @ut_string_rstrip(i8* %3)
%5 = call i8* @ut_string_lstrip(i32 %4)
ret i8* %5
}

LLVM IR (-O2):
define i8* @ut_string_strip(i8* %0) {
%2 = tail call i32 @ut_string_rstrip(i8* %0)
%3 = tail call i8* @ut_string_lstrip(i32 %2)
ret i8* %3
}
int do_415() { return 415; }


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

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

LLVM IR (-O0):
define i32 @do_415() {
ret i32 415
}

LLVM IR (-O2):
define i32 @do_415() {
ret i32 415
}
/* Variables and functions */
int /*<<< orphan*/ reverse(int *, int /*<<< orphan*/, int);
int *revR(int *array, int n) {
  reverse(array, 0, n - 1);
  return array;
}


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

x86 assembly (clang, -O2):
<revR>:
push   %rbx
mov    %rdi,%rbx
lea    -0x1(%rsi),%edx
xor    %esi,%esi
call   1030 <reverse@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32* @revR(i32* returned %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i32 @reverse(i32* %0, i32 0, i32 %3)
ret i32* %0
}
void func() {
  int m;
  int tab[m];
  __int128 j;
  for (; j; j++) {
    tab[j] = 0;
    tab[j + 1] = 0;
  }
  foo();
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x38(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x18(%rbp)
mov    -0x30(%rbp),%rax
mov    -0x28(%rbp),%rcx
or     %rcx,%rax
je     1189 <func+0x79>
jmp    1155 <func+0x45>
mov    -0x38(%rbp),%rax
mov    -0x30(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x30(%rbp),%rcx
add    $0x1,%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x28(%rbp),%rax
addq   $0x1,-0x30(%rbp)
adc    $0x0,%rax
mov    %rax,-0x28(%rbp)
jmp    113f <func+0x2f>
mov    $0x0,%al
call   1030 <foo@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @func() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i128
%5 = load i32, i32* %1
%6 = zext i32 %5 to i64
%7 = call i8* @llvm.stacksave()
store i8* %7, i8** %2
%8 = alloca i32, i64 %6
store i64 %6, i64* %3
br label %9
9: ; preds = %20, %0
%10 = load i128, i128* %4
%11 = icmp ne i128 %10, 0
br i1 %11, label %12, label %23
12: ; preds = %9
%13 = load i128, i128* %4
%14 = trunc i128 %13 to i64
%15 = getelementptr inbounds i32, i32* %8, i64 %14
store i32 0, i32* %15
%16 = load i128, i128* %4
%17 = add nsw i128 %16, 1
%18 = trunc i128 %17 to i64
%19 = getelementptr inbounds i32, i32* %8, i64 %18
store i32 0, i32* %19
br label %20
20: ; preds = %12
%21 = load i128, i128* %4
%22 = add nsw i128 %21, 1
store i128 %22, i128* %4
br label %9
23: ; preds = %9
%24 = call i32 (...) @foo()
%25 = load i8*, i8** %2
ret void
}

LLVM IR (-O2):
define void @func() {
%1 = tail call i32 (...) @foo()
ret void
}
int main() {
  int p = 10, r = 3, t = 2;
  byaj(p, r, t);
  printf("%f", byaj);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    $0x0,%al
call   1040 <byaj@plt>
lea    0xebc(%rip),%rdi
mov    0x2e9d(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
mov    $0x3,%esi
mov    $0x2,%edx
xor    %eax,%eax
call   1040 <byaj@plt>
mov    0x2eba(%rip),%rsi
lea    0xecb(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define i32 @main() {
%1 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @byaj to i32 (i32, i32, i32, ...)*)(i32 10, i32 3, i32 2)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 (...)* @byaj)
ret i32 0
}
/* Type definitions */
struct ccnl_prefix_s {
  int dummy;
};

/* Variables and functions */
int ccnl_ccntlv_prependChunkInterestWithHdr(struct ccnl_prefix_s *, int *,
                                            unsigned char *);
int ccnl_ccntlv_prependInterestWithHdr(struct ccnl_prefix_s *name, int *offset,
                                       unsigned char *buf) {
  return ccnl_ccntlv_prependChunkInterestWithHdr(name, offset, buf);
}


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

x86 assembly (clang, -O2):
<ccnl_ccntlv_prependInterestWithHdr>:
jmp    1030 <ccnl_ccntlv_prependChunkInterestWithHdr@plt>

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

LLVM IR (-O2):
%struct.ccnl_prefix_s = type { i32 }
define i32 @ccnl_ccntlv_prependInterestWithHdr(%struct.ccnl_prefix_s* %0, i32* %1, i8* %2) {
%4 = tail call i32 @ccnl_ccntlv_prependChunkInterestWithHdr(%struct.ccnl_prefix_s* %0, i32* %1, i8* %2)
ret i32 %4
}
int C_Utils_compare_longlong_ptr(const long long *item1,
                                 const long long *item2) {
  long long i1 = *item1;
  long long i2 = *item2;
  if (i1 == i2)
    return 0;
  return i1 < i2 ? -1 : 1;
}


x86 assembly (clang, -O0):
<C_Utils_compare_longlong_ptr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jne    113c <C_Utils_compare_longlong_ptr+0x3c>
movl   $0x0,-0x4(%rbp)
jmp    1157 <C_Utils_compare_longlong_ptr+0x57>
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rsi
mov    $0x1,%eax
mov    $0xffffffff,%ecx
cmp    %rsi,%rdx
cmovl  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<C_Utils_compare_longlong_ptr>:
mov    (%rdi),%rax
xor    %ecx,%ecx
xor    %edx,%edx
cmp    (%rsi),%rax
setge  %dl
lea    -0x1(%rdx,%rdx,1),%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @C_Utils_compare_longlong_ptr(i64* nocapture %0, i64* nocapture %1) {
%3 = load i64, i64* %0
%4 = load i64, i64* %1
%5 = icmp eq i64 %3, %4
%6 = icmp slt i64 %3, %4
%7 = select i1 %6, i32 -1, i32 1
%8 = select i1 %5, i32 0, i32 %7
ret i32 %8
}
int bit_count(unsigned long long b) {
  register unsigned long long c = b - ((b >> 1) & 0x7777777777777777ULL) -
                                  ((b >> 2) & 0x3333333333333333ULL) -
                                  ((b >> 3) & 0x1111111111111111ULL);
  c = ((c + (c >> 4)) & 0x0F0F0F0F0F0F0F0FULL) * 0x0101010101010101ULL;
  return (int)(c >> 56);
}


x86 assembly (clang, -O0):
<bit_count>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
shr    $0x1,%rcx
movabs $0x7777777777777777,%rdx
77 77 77
and    %rdx,%rcx
sub    %rcx,%rax
mov    -0x8(%rbp),%rcx
shr    $0x2,%rcx
movabs $0x3333333333333333,%rdx
33 33 33
and    %rdx,%rcx
sub    %rcx,%rax
mov    -0x8(%rbp),%rcx
shr    $0x3,%rcx
movabs $0x1111111111111111,%rdx
11 11 11
and    %rdx,%rcx
sub    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x10(%rbp),%rcx
shr    $0x4,%rcx
add    %rcx,%rax
movabs $0xf0f0f0f0f0f0f0f,%rcx
0f 0f 0f
and    %rcx,%rax
movabs $0x101010101010101,%rcx
01 01 01
imul   %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x38,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_count>:
mov    %rdi,%rax
shr    %rax
movabs $0x7777777777777777,%rcx
77 77 77
and    %rax,%rcx
mov    %rdi,%rax
shr    $0x2,%rax
movabs $0x3333333333333333,%rdx
33 33 33
and    %rax,%rdx
add    %rcx,%rdx
mov    %rdi,%rax
shr    $0x3,%rax
movabs $0x1111111111111111,%rcx
11 11 11
and    %rax,%rcx
add    %rdx,%rcx
sub    %rcx,%rdi
mov    %rdi,%rax
shr    $0x4,%rax
add    %rdi,%rax
movabs $0xf0f0f0f0f0f0f0f,%rcx
0f 0f 0f
and    %rax,%rcx
movabs $0x101010101010101,%rax
01 01 01
imul   %rcx,%rax
shr    $0x38,%rax
ret

LLVM IR (-O0):
define i32 @bit_count(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = load i64, i64* %2
%6 = lshr i64 %5, 1
%7 = and i64 %6, 8608480567731124087
%8 = sub i64 %4, %7
%9 = load i64, i64* %2
%10 = lshr i64 %9, 2
%11 = and i64 %10, 3689348814741910323
%12 = sub i64 %8, %11
%13 = load i64, i64* %2
%14 = lshr i64 %13, 3
%15 = and i64 %14, 1229782938247303441
%16 = sub i64 %12, %15
store i64 %16, i64* %3
%17 = load i64, i64* %3
%18 = load i64, i64* %3
%19 = lshr i64 %18, 4
%20 = add i64 %17, %19
%21 = and i64 %20, 1085102592571150095
%22 = mul i64 %21, 72340172838076673
store i64 %22, i64* %3
%23 = load i64, i64* %3
%24 = lshr i64 %23, 56
%25 = trunc i64 %24 to i32
ret i32 %25
}

LLVM IR (-O2):
define i32 @bit_count(i64 %0) {
%2 = lshr i64 %0, 1
%3 = and i64 %2, 8608480567731124087
%4 = lshr i64 %0, 2
%5 = and i64 %4, 3689348814741910323
%6 = lshr i64 %0, 3
%7 = and i64 %6, 1229782938247303441
%8 = add nuw i64 %5, %3
%9 = add nuw i64 %8, %7
%10 = sub i64 %0, %9
%11 = lshr i64 %10, 4
%12 = add i64 %11, %10
%13 = and i64 %12, 1085102592571150095
%14 = mul i64 %13, 72340172838076673
%15 = lshr i64 %14, 56
%16 = trunc i64 %15 to i32
ret i32 %16
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ baaz(int);
scalar_t__ bar();
int /*<<< orphan*/ foo();
int main() {
  int32_t index;
  foo();
  index = 512;
  if (bar())
    index = 256;
  baaz(index);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <foo@plt>
movl   $0x200,-0x8(%rbp)
mov    $0x0,%al
call   1030 <bar@plt>
cmp    $0x0,%rax
je     1165 <main+0x35>
movl   $0x100,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <baaz@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <foo@plt>
xor    %eax,%eax
call   1030 <bar@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
shl    $0x8,%edi
add    $0x100,%edi
call   1050 <baaz@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = tail call i64 (...) @bar()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 512, i32 256
%5 = tail call i32 @baaz(i32 %4)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t u4_28_from_float(float f) {
  static const float scale = (float)(1 << 28);
  static const float limpos = 0xffffffffUL / scale;
  if (f <= 0.) {
    return 0;
  } else if (f >= limpos) {
    return 0xffffffff;
  }
  return f * scale + 0.5;
}


x86 assembly (clang, -O0):
<u4_28_from_float>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jb     112b <u4_28_from_float+0x2b>
movl   $0x0,-0x4(%rbp)
jmp    1176 <u4_28_from_float+0x76>
movss  -0x8(%rbp),%xmm0
movss  0xec8(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     114d <u4_28_from_float+0x4d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1176 <u4_28_from_float+0x76>
jmp    1152 <u4_28_from_float+0x52>
movss  0xeaa(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe9d(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<u4_28_from_float>:
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
jae    1130 <u4_28_from_float+0x30>
mov    $0xffffffff,%eax
ucomiss 0xeea(%rip),%xmm0
jae    1130 <u4_28_from_float+0x30>
mulss  0xee4(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xedc(%rip),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
@u4_28_from_float.scale = internal constant float 0x41B0000000000000
@u4_28_from_float.limpos = internal constant float 1.600000e+01
define i32 @u4_28_from_float(float %0) {
%2 = alloca i32
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fpext float %4 to double
%6 = fcmp ole double %5, 0.000000e+00
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %19
8: ; preds = %1
%9 = load float, float* %3
%10 = fcmp oge float %9, 1.600000e+01
br i1 %10, label %11, label %12
11: ; preds = %8
store i32 -1, i32* %2
br label %19
12: ; preds = %8
br label %13
13: ; preds = %12
%14 = load float, float* %3
%15 = fmul float %14, 0x41B0000000000000
%16 = fpext float %15 to double
%17 = fadd double %16, 5.000000e-01
%18 = fptosi double %17 to i32
store i32 %18, i32* %2
br label %19
19: ; preds = %13, %11, %7
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @u4_28_from_float(float %0) {
%2 = fcmp ugt float %0, 0.000000e+00
br i1 %2, label %3, label %10
3: ; preds = %1
%4 = fcmp ult float %0, 1.600000e+01
br i1 %4, label %5, label %10
5: ; preds = %3
%6 = fmul float %0, 0x41B0000000000000
%7 = fpext float %6 to double
%8 = fadd double %7, 5.000000e-01
%9 = fptosi double %8 to i32
br label %10
10: ; preds = %3, %1, %5
%11 = phi i32 [ %9, %5 ], [ 0, %1 ], [ -1, %3 ]
ret i32 %11
}
/* Variables and functions */
int strlen(char *);
void chop_newline(char *buf) {
  int len = strlen(buf);
  if (buf[len - 1] == '\n')
    buf[len - 1] = '\0';
}


x86 assembly (clang, -O0):
<chop_newline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    1153 <chop_newline+0x43>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chop_newline>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
cmpb   $0xa,-0x1(%rax,%rbx,1)
jne    1127 <chop_newline+0x17>
movb   $0x0,-0x1(%rbx,%rax,1)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @chop_newline(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 10
br i1 %7, label %8, label %9
8: ; preds = %1
store i8 0, i8* %5
br label %9
9: ; preds = %8, %1
ret void
}
int test_imm_ACint64_highword_reg(long long val) {
  return ((val >> 32) & (0xAC << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_ACint64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x20,%rdx
and    $0xac,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_ACint64_highword_reg>:
movabs $0xac00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_ACint64_highword_reg(i64 %0) {
%2 = and i64 %0, 738734374912
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void iwl_rfkill_set_hw_state(struct iwl_priv *priv) {}


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

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

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

LLVM IR (-O2):
%struct.iwl_priv = type opaque
define void @iwl_rfkill_set_hw_state(%struct.iwl_priv* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ msg;

/* Variables and functions */
int /*<<< orphan*/ my_exit(int);
int my_write(int, char *, int);
void _start(void) {
  char msg[] = "hello\n";
  my_exit(my_write(1, msg, sizeof(msg)) != sizeof(msg));
}


x86 assembly (clang, -O0):
<_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0x7(%rbp)
mov    0xecc(%rip),%ax
mov    %ax,-0x3(%rbp)
mov    0xec4(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x7(%rbp),%rsi
mov    $0x1,%edi
mov    $0x7,%edx
call   1040 <my_write@plt>
cltq
cmp    $0x7,%rax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <my_exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_start>:
push   %rax
movl   $0xa6f6c,0x3(%rsp)
movl   $0x6c6c6568,(%rsp)
mov    %rsp,%rsi
mov    $0x1,%edi
mov    $0x7,%edx
call   1040 <my_write@plt>
xor    %edi,%edi
cmp    $0x7,%eax
setne  %dil
call   1030 <my_exit@plt>
pop    %rax
ret

LLVM IR (-O0):
@__const._start.msg = [7 x i8] c"hello\0A\00"
define void @_start() {
%1 = alloca [7 x i8]
%2 = bitcast [7 x i8]* %1 to i8*
%3 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%4 = call i32 @my_write(i32 1, i8* %3, i32 7)
%5 = sext i32 %4 to i64
%6 = icmp ne i64 %5, 7
%7 = zext i1 %6 to i32
%8 = call i32 @my_exit(i32 %7)
ret void
}

LLVM IR (-O2):
@__const._start.msg = [7 x i8] c"hello\0A\00"
define void @_start() {
%1 = alloca [7 x i8]
%2 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%3 = call i32 @my_write(i32 1, i8* %2, i32 7)
%4 = icmp ne i32 %3, 7
%5 = zext i1 %4 to i32
%6 = call i32 @my_exit(i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ say(char *, int);
void talk(void) { say("Nicely stocked bookshelf.", 1); }


x86 assembly (clang, -O0):
<talk>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1,%esi
call   1030 <say@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<talk>:
lea    0xee9(%rip),%rdi
mov    $0x1,%esi
jmp    1030 <say@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Nicely stocked bookshelf.\00"
define void @talk() {
%1 = call i32 @say(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"Nicely stocked bookshelf.\00"
define void @talk() {
%1 = tail call i32 @say(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_signal_new() {
  printf("NOT IMPLEMENTED:"
         "pa_signal_new"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [31 x i8] c"NOT IMPLEMENTED:pa_signal_new\0A\00"
define i32 @pa_signal_new() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [30 x i8] c"NOT IMPLEMENTED:pa_signal_new\00"
define i32 @pa_signal_new() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
struct fuse_opt {
  int dummy;
};

/* Variables and functions */
scalar_t__ find_opt(struct fuse_opt const *, char const *, size_t *);
int fuse_opt_match(const struct fuse_opt *opts, const char *opt) {
  size_t dummy;
  return find_opt(opts, opt, &dummy) ? 1 : 0;
}


x86 assembly (clang, -O0):
<fuse_opt_match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1030 <find_opt@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fuse_opt_match>:
push   %rax
mov    %rsp,%rdx
call   1030 <find_opt@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.fuse_opt = type { i32 }
define i32 @fuse_opt_match(%struct.fuse_opt* %0, i8* %1) {
%3 = alloca %struct.fuse_opt*
%4 = alloca i8*
%5 = alloca i64
store %struct.fuse_opt* %0, %struct.fuse_opt** %3
store i8* %1, i8** %4
%6 = load %struct.fuse_opt*, %struct.fuse_opt** %3
%7 = load i8*, i8** %4
%8 = call i64 @find_opt(%struct.fuse_opt* %6, i8* %7, i64* %5)
%9 = icmp ne i64 %8, 0
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 1, i32 0
ret i32 %11
}

LLVM IR (-O2):
%struct.fuse_opt = type { i32 }
define i32 @fuse_opt_match(%struct.fuse_opt* %0, i8* %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = call i64 @find_opt(%struct.fuse_opt* %0, i8* %1, i64* %3)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ safe_close_pair(int *);
void close_pairp(int (*p)[2]) { safe_close_pair(*p); }


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

x86 assembly (clang, -O2):
<close_pairp>:
jmp    1030 <safe_close_pair@plt>

LLVM IR (-O0):
define void @close_pairp([2 x i32]* %0) {
%2 = alloca [2 x i32]*
store [2 x i32]* %0, [2 x i32]** %2
%3 = load [2 x i32]*, [2 x i32]** %2
%4 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%5 = call i32 @safe_close_pair(i32* %4)
ret void
}

LLVM IR (-O2):
define void @close_pairp([2 x i32]* %0) {
%2 = getelementptr inbounds [2 x i32], [2 x i32]* %0, i64 0, i64 0
%3 = tail call i32 @safe_close_pair(i32* %2)
ret void
}
int do_511() { return 511; }


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

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

LLVM IR (-O0):
define i32 @do_511() {
ret i32 511
}

LLVM IR (-O2):
define i32 @do_511() {
ret i32 511
}
unsigned short ip_compute_csum(unsigned char *buff, int len) {
  return ~do_csum(buff, len, 0);
}


x86 assembly (clang, -O0):
<ip_compute_csum>:
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
mov    $0x0,%al
call   1030 <do_csum@plt>
xor    $0xffffffff,%eax
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ip_compute_csum>:
push   %rax
xor    %edx,%edx
xor    %eax,%eax
call   1030 <do_csum@plt>
not    %eax
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i16 @ip_compute_csum(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 (i8*, i32, i32, ...) bitcast (i32 (...)* @do_csum to i32 (i8*, i32, i32, ...)*)(i8* %5, i32 %6, i32 0)
%8 = xor i32 %7, -1
%9 = trunc i32 %8 to i16
ret i16 %9
}

LLVM IR (-O2):
define zeroext i16 @ip_compute_csum(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @do_csum to i32 (i8*, i32, i32, ...)*)(i8* %0, i32 %1, i32 0)
%4 = trunc i32 %3 to i16
%5 = xor i16 %4, -1
ret i16 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void build_usage(int code) {
  fprintf(stderr,
          "Builds and starts managing a VM with honeycomb.\n"
          "\n"
          "Usage: %s build [-c config]\n"
          "\n"
          "	-c: Full path to the configuration file\n"
          "\n",
          "hc");
  exit(code);
}


x86 assembly (clang, -O0):
<build_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
lea    0xf37(%rip),%rdx
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<build_usage>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
lea    0xf3f(%rip),%rdx
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [121 x i8] c"Builds and starts managing a VM with honeycomb.\0A\0AUsage: %s build [-c config]\0A\0A\09-c: Full path to the configuration file\0A\0A\00"
@.str.1 = [3 x i8] c"hc\00"
define void @build_usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([121 x i8], [121 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* %2
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [121 x i8] c"Builds and starts managing a VM with honeycomb.\0A\0AUsage: %s build [-c config]\0A\0A\09-c: Full path to the configuration file\0A\0A\00"
@.str.1 = [3 x i8] c"hc\00"
define void @build_usage(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([121 x i8], [121 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @exit(i32 %0)
unreachable
}
void __fiq(void) { return; }


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

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

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

LLVM IR (-O2):
define void @__fiq() {
ret void
}
int test_imm_4Eint8_reg(signed char val) {
  return ((val) & (-0x4E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_4Eint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffffb2,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_4Eint8_reg(i8 signext %0) {
%2 = and i8 %0, -78
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ curve25519_crypto_scalarmult_base(unsigned char *,
                                                     unsigned char *);
int /*<<< orphan*/ randombytes(unsigned char *, int);
int curve25519_dh_keypair(unsigned char *pk, unsigned char *sk) {
  randombytes(sk, 32);
  curve25519_crypto_scalarmult_base(pk, sk);
  return 0;
}


x86 assembly (clang, -O0):
<curve25519_dh_keypair>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x20,%esi
call   1030 <randombytes@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <curve25519_crypto_scalarmult_base@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<curve25519_dh_keypair>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
mov    $0x20,%esi
call   1030 <randombytes@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <curve25519_crypto_scalarmult_base@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @curve25519_dh_keypair(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @randombytes(i8* %5, i32 32)
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 @curve25519_crypto_scalarmult_base(i8* %7, i8* %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @curve25519_dh_keypair(i8* %0, i8* %1) {
%3 = tail call i32 @randombytes(i8* %1, i32 32)
%4 = tail call i32 @curve25519_crypto_scalarmult_base(i8* %0, i8* %1)
ret i32 0
}
/* Variables and functions */
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int getrand() {
  srand(time(NULL));
  return rand() % 20 + 20;
}


x86 assembly (clang, -O0):
<getrand>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    $0x0,%al
call   1050 <rand@plt>
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x14,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getrand>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
add    %ecx,%eax
add    $0x14,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @getrand() {
%1 = call i32 @time(i32* null)
%2 = call i32 @srand(i32 %1)
%3 = call i32 (...) @rand()
%4 = srem i32 %3, 20
%5 = add nsw i32 %4, 20
ret i32 %5
}

LLVM IR (-O2):
define i32 @getrand() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 (...) @rand()
%4 = srem i32 %3, 20
%5 = add nsw i32 %4, 20
ret i32 %5
}
int prod_multiple_numbers(int a, int b) { return a * b; }


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

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

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

LLVM IR (-O2):
define i32 @prod_multiple_numbers(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
double hypot(double, double);
double Distance(double x1, double y1, double x2, double y2) {
  return hypot(x1 - x2, y1 - y2);
}


x86 assembly (clang, -O0):
<Distance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
subsd  -0x20(%rbp),%xmm1
call   1030 <hypot@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Distance>:
subsd  %xmm2,%xmm0
subsd  %xmm3,%xmm1
jmp    1030 <hypot@plt>

LLVM IR (-O0):
define double @Distance(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %7
%11 = fsub double %9, %10
%12 = load double, double* %6
%13 = load double, double* %8
%14 = fsub double %12, %13
%15 = call double @hypot(double %11, double %14)
ret double %15
}

LLVM IR (-O2):
define double @Distance(double %0, double %1, double %2, double %3) {
%5 = fsub double %0, %2
%6 = fsub double %1, %3
%7 = tail call double @hypot(double %5, double %6)
ret double %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
int ftell(int /*<<< orphan*/ *);
int get_filesize(char *filename) {
  FILE *f = fopen(filename, "r");
  fseek(f, 0, SEEK_END);
  return ftell(f);
}


x86 assembly (clang, -O0):
<get_filesize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2e8d(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    -0x10(%rbp),%rdi
call   1030 <ftell@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_filesize>:
push   %rbx
lea    0xec8(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
mov    0x2ea1(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <ftell@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@SEEK_END = global i32 0
define i32 @get_filesize(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = load i32, i32* @SEEK_END
%8 = call i32 @fseek(i32* %6, i32 0, i32 %7)
%9 = load i32*, i32** %3
%10 = call i32 @ftell(i32* %9)
ret i32 %10
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@SEEK_END = global i32 0
define i32 @get_filesize(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @SEEK_END
%4 = tail call i32 @fseek(i32* %2, i32 0, i32 %3)
%5 = tail call i32 @ftell(i32* %2)
ret i32 %5
}
/* Variables and functions */
int __aeabi_uidivmod(unsigned int, unsigned int);
int __aeabi_uidiv(unsigned int a, unsigned int b) {
  return __aeabi_uidivmod(a, b);
}


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

x86 assembly (clang, -O2):
<__aeabi_uidiv>:
jmp    1030 <__aeabi_uidivmod@plt>

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

LLVM IR (-O2):
define i32 @__aeabi_uidiv(i32 %0, i32 %1) {
%3 = tail call i32 @__aeabi_uidivmod(i32 %0, i32 %1)
ret i32 %3
}