xunge/DecIR huggingface dataset:
int reverse_order(int a, int b) { return b - a; }


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

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

LLVM IR (-O0):
define i32 @reverse_order(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 = load i32, i32* %3
%7 = sub nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @reverse_order(i32 %0, i32 %1) {
%3 = sub nsw i32 %1, %0
ret i32 %3
}
long _approxSqrt(long EV_num) {
  long EV_guess;
  long EV_result;
  long EV_prev;
  EV_guess = 1;
  EV_prev = EV_guess;
  EV_result = 0;
  while ((EV_result < EV_num)) {
    EV_result = (EV_guess * EV_guess);
    EV_prev = EV_guess;
    EV_guess = (EV_guess + 1);
  }
  return EV_prev;
}


x86 assembly (clang, -O0):
<_approxSqrt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jge    1154 <_approxSqrt+0x54>
mov    -0x10(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1120 <_approxSqrt+0x20>
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_approxSqrt>:
test   %rdi,%rdi
jle    1121 <_approxSqrt+0x21>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
add    $0x1,%rax
mov    %rax,%rcx
imul   %rax,%rcx
cmp    %rdi,%rcx
jl     1110 <_approxSqrt+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i64 @_approxSqrt(i64 %0) {
%2 = icmp sgt i64 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i64 [ %6, %3 ], [ 1, %1 ]
%5 = mul nsw i64 %4, %4
%6 = add nuw nsw i64 %4, 1
%7 = icmp slt i64 %5, %0
br i1 %7, label %3, label %8
8: ; preds = %3, %1
%9 = phi i64 [ 1, %1 ], [ %4, %3 ]
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ ucnv_setDefaultName(char const *);
void __hs_ucnv_setDefaultName(const char *name) { ucnv_setDefaultName(name); }


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

x86 assembly (clang, -O2):
<__hs_ucnv_setDefaultName>:
jmp    1030 <ucnv_setDefaultName@plt>

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

LLVM IR (-O2):
define void @__hs_ucnv_setDefaultName(i8* %0) {
%2 = tail call i32 @ucnv_setDefaultName(i8* %0)
ret void
}
void gtk_im_context_set_client_window() {}


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

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

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

LLVM IR (-O2):
define void @gtk_im_context_set_client_window() {
ret void
}
int max(int a, int b) { return ((a >= b) ? a : b); }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1121 <max+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

LLVM IR (-O0):
define i32 @max(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 = icmp sge i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
bool nrfx_usbd_errata_171(void) { return (1 && true); }


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

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

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

LLVM IR (-O2):
define i32 @nrfx_usbd_errata_171() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ initRW();
int /*<<< orphan*/ initRead();
int main(int argc, char **argv) {
  initRW();
  initRead();
}


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @initRW()
%6 = call i32 (...) @initRead()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @initRW()
%4 = tail call i32 (...) @initRead()
ret i32 0
}
double zfrexp(x)
double x;
{
  double y;
  int e;
  y = frexp(x, &e);
  printf("exponent = %d, significand = ", e);
  return (y);
}


x86 assembly (clang, -O0):
<zfrexp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    -0x14(%rbp),%rdi
call   1040 <frexp@plt>
movsd  %xmm0,-0x10(%rbp)
mov    -0x14(%rbp),%esi
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zfrexp>:
sub    $0x18,%rsp
lea    0xc(%rsp),%rdi
call   1040 <frexp@plt>
movsd  %xmm0,0x10(%rsp)
mov    0xc(%rsp),%esi
lea    0xec1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [30 x i8] c"exponent = %d, significand = \00"
define double @zfrexp(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca i32
store double %0, double* %2
%5 = load double, double* %2
%6 = call double @frexp(double %5, i32* %4)
store double %6, double* %3
%7 = load i32, i32* %4
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load double, double* %3
ret double %9
}

LLVM IR (-O2):
@.str = [30 x i8] c"exponent = %d, significand = \00"
define double @zfrexp(double %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call double @frexp(double %0, i32* %2)
%5 = load i32, i32* %2
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %5)
ret double %4
}
/* Variables and functions */
int prv_test();
int symbol_table_test(void) {
  int failure = 0;
  failure |= prv_test();
  return failure;
}


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

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

LLVM IR (-O0):
define i32 @symbol_table_test() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @prv_test()
%3 = load i32, i32* %1
%4 = or i32 %3, %2
store i32 %4, i32* %1
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
define i32 @symbol_table_test() {
%1 = tail call i32 (...) @prv_test()
ret i32 %1
}
void UNDEF_Routine(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<UNDEF_Routine>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <UNDEF_Routine+0x9>
jmp    1109 <UNDEF_Routine+0x9>

x86 assembly (clang, -O2):
<UNDEF_Routine>:
jmp    1100 <UNDEF_Routine>

LLVM IR (-O0):
define void @UNDEF_Routine() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @UNDEF_Routine() {
br label %1
1: ; preds = %0, %1
br label %1
}
unsigned char GetNextNode(unsigned char currentNode, float tx1, float ty1,
                          float tz1, unsigned char *nextNodeTable) {
  float min;
  int minIndex = 0;
  if (tx1 < ty1) {
    min = tx1;
    minIndex = 0;
  } else {
    minIndex = 1;
    min = ty1;
  }
  if (tz1 < min) {
    minIndex = 2;
  }
  return nextNodeTable[(currentNode * 3) + minIndex];
}


x86 assembly (clang, -O0):
<GetNextNode>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x20(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    114d <GetNextNode+0x4d>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
jmp    115e <GetNextNode+0x5e>
movl   $0x1,-0x20(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x10(%rbp),%xmm1
movss  -0x1c(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1178 <GetNextNode+0x78>
movl   $0x2,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movzbl -0x1(%rbp),%ecx
imul   $0x3,%ecx,%ecx
add    -0x20(%rbp),%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetNextNode>:
xor    %eax,%eax
ucomiss %xmm0,%xmm1
setbe  %al
minss  %xmm1,%xmm0
ucomiss %xmm2,%xmm0
mov    $0x2,%ecx
cmovbe %rax,%rcx
mov    %edi,%eax
lea    (%rax,%rax,2),%rax
add    %rcx,%rax
mov    (%rsi,%rax,1),%al
ret

LLVM IR (-O0):
define zeroext i8 @GetNextNode(i8 zeroext %0, float %1, float %2, float %3, i8* %4) {
%6 = alloca i8
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca i8*
%11 = alloca float
%12 = alloca i32
store i8 %0, i8* %6
store float %1, float* %7
store float %2, float* %8
store float %3, float* %9
store i8* %4, i8** %10
store i32 0, i32* %12
%13 = load float, float* %7
%14 = load float, float* %8
%15 = fcmp olt float %13, %14
br i1 %15, label %16, label %18
16: ; preds = %5
%17 = load float, float* %7
store float %17, float* %11
store i32 0, i32* %12
br label %20
18: ; preds = %5
store i32 1, i32* %12
%19 = load float, float* %8
store float %19, float* %11
br label %20
20: ; preds = %18, %16
%21 = load float, float* %9
%22 = load float, float* %11
%23 = fcmp olt float %21, %22
br i1 %23, label %24, label %25
24: ; preds = %20
store i32 2, i32* %12
br label %25
25: ; preds = %24, %20
%26 = load i8*, i8** %10
%27 = load i8, i8* %6
%28 = zext i8 %27 to i32
%29 = mul nsw i32 %28, 3
%30 = load i32, i32* %12
%31 = add nsw i32 %29, %30
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i8, i8* %26, i64 %32
%34 = load i8, i8* %33
ret i8 %34
}

LLVM IR (-O2):
define zeroext i8 @GetNextNode(i8 zeroext %0, float %1, float %2, float %3, i8* nocapture %4) {
%6 = fcmp olt float %1, %2
%7 = select i1 %6, float %1, float %2
%8 = xor i1 %6, true
%9 = zext i1 %8 to i64
%10 = fcmp ogt float %7, %3
%11 = select i1 %10, i64 2, i64 %9
%12 = zext i8 %0 to i64
%13 = mul nuw nsw i64 %12, 3
%14 = add nuw nsw i64 %11, %13
%15 = getelementptr inbounds i8, i8* %4, i64 %14
%16 = load i8, i8* %15
ret i8 %16
}
void i_setup() {
  unsigned short *table_limit = (unsigned short *)0x100800;
  unsigned int *table_address = (unsigned int *)(0x100800 + 2);
  *table_limit = 256 * 8 - 1;
  *table_address = 0x100000;
  __asm__("lidt 0(,%0,)" ::"a"(0x100800));
}


x86 assembly (clang, -O0):
<i_setup>:
push   %rbp
mov    %rsp,%rbp
mov    $0x100800,%eax
mov    %rax,-0x8(%rbp)
mov    $0x100802,%eax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movw   $0x7ff,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x100000,(%rax)
mov    $0x100800,%eax
lidt   0x0(,%eax,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<i_setup>:
movw   $0x7ff,0x100800
movl   $0x100000,0x100802
mov    $0x100800,%eax
lidt   0x0(,%eax,1)
ret

LLVM IR (-O0):
define void @i_setup() {
%1 = alloca i16*
%2 = alloca i32*
store i16* inttoptr (i64 1050624 to i16*), i16** %1
store i32* inttoptr (i64 1050626 to i32*), i32** %2
%3 = load i16*, i16** %1
store i16 2047, i16* %3
%4 = load i32*, i32** %2
store i32 1048576, i32* %4
ret void
}

LLVM IR (-O2):
define void @i_setup() {
store i16 2047, i16* inttoptr (i64 1050624 to i16*)
store i32 1048576, i32* inttoptr (i64 1050626 to i32*)
tail call void asm sideeffect "lidt 0(,$0,)", "{ax},~{dirflag},~{fpsr},~{flags}"(i32 1050624)
ret void
}
/* Type definitions */
struct nmodule {
  int dummy;
};

/* Variables and functions */
int close_module(struct nmodule *);
struct nmodule *find_module_by_name(char const *);
int network_close_module(const char *name) {
  struct nmodule *nm;
  if ((nm = find_module_by_name(name)) == NULL)
    return -1;
  return close_module(nm);
}


x86 assembly (clang, -O0):
<network_close_module>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <find_module_by_name@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    114f <network_close_module+0x2f>
movl   $0xffffffff,-0x4(%rbp)
jmp    115b <network_close_module+0x3b>
mov    -0x18(%rbp),%rdi
call   1030 <close_module@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<network_close_module>:
push   %rax
call   1040 <find_module_by_name@plt>
test   %rax,%rax
je     1134 <network_close_module+0x14>
mov    %rax,%rdi
pop    %rax
jmp    1030 <close_module@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.nmodule = type { i32 }
define i32 @network_close_module(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.nmodule*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call %struct.nmodule* @find_module_by_name(i8* %5)
store %struct.nmodule* %6, %struct.nmodule** %4
%7 = icmp eq %struct.nmodule* %6, null
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 -1, i32* %2
br label %12
9: ; preds = %1
%10 = load %struct.nmodule*, %struct.nmodule** %4
%11 = call i32 @close_module(%struct.nmodule* %10)
store i32 %11, i32* %2
br label %12
12: ; preds = %9, %8
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
%struct.nmodule = type { i32 }
define i32 @network_close_module(i8* %0) {
%2 = tail call %struct.nmodule* @find_module_by_name(i8* %0)
%3 = icmp eq %struct.nmodule* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @close_module(%struct.nmodule* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ -1, %1 ]
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ u_long;

/* Variables and functions */
int tcp_connect(char *, int /*<<< orphan*/, int /*<<< orphan*/);
int open_socket(void *tsd) {
  return tcp_connect("localhost", (u_long)404038, 0);
}


x86 assembly (clang, -O0):
<open_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x62a46,%esi
xor    %edx,%edx
call   1030 <tcp_connect@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_socket>:
lea    0xee9(%rip),%rdi
mov    $0x62a46,%esi
xor    %edx,%edx
jmp    1030 <tcp_connect@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"localhost\00"
define i32 @open_socket(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @tcp_connect(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 404038, i32 0)
ret i32 %3
}

LLVM IR (-O2):
@.str = [10 x i8] c"localhost\00"
define i32 @open_socket(i8* nocapture readnone %0) {
%2 = tail call i32 @tcp_connect(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 404038, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ test(char *, char *);
void TEST_do_stmt(void) {
  test("321", "main(){int i=3; do { printf(\"%d\", i); i=i-1;} while (i);}");
  test("321", "main(){int i=3; do   printf(\"%d\", i), i=i-1;  while (i);}");
}


x86 assembly (clang, -O0):
<TEST_do_stmt>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee2(%rip),%rsi
call   1030 <test@plt>
lea    0xed2(%rip),%rdi
lea    0xf09(%rip),%rsi
call   1030 <test@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TEST_do_stmt>:
push   %rbx
lea    0xee8(%rip),%rbx
lea    0xee5(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test@plt>
lea    0xf10(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <test@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"321\00"
@.str.1 = [58 x i8] c"main(){int i=3; do { printf(\22%d\22, i); i=i-1;} while (i);}\00"
@.str.2 = [58 x i8] c"main(){int i=3; do printf(\22%d\22, i), i=i-1; while (i);}\00"
define void @TEST_do_stmt() {
%1 = call i32 @test(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"321\00"
@.str.1 = [58 x i8] c"main(){int i=3; do { printf(\22%d\22, i); i=i-1;} while (i);}\00"
@.str.2 = [58 x i8] c"main(){int i=3; do printf(\22%d\22, i), i=i-1; while (i);}\00"
define void @TEST_do_stmt() {
%1 = tail call i32 @test(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
char *strtok(char *, char *);
int check_if_stop(char *cmd) {
  char *first = strtok(cmd, " ");
  return strcmp(first, "stop") == 0;
}


x86 assembly (clang, -O0):
<check_if_stop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb7(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_if_stop>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <strtok@plt>
lea    0xece(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
@.str.1 = [5 x i8] c"stop\00"
define i32 @check_if_stop(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strtok(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
@.str.1 = [5 x i8] c"stop\00"
define i32 @check_if_stop(i8* %0) {
%2 = tail call i8* @strtok(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "usage: fork [-c cmd ] \n  		cmd: the command to "
                  "execute.\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [57 x i8] c"usage: fork [-c cmd ] \0A \09\09cmd: the command to execute.\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [57 x i8] c"usage: fork [-c cmd ] \0A \09\09cmd: the command to execute.\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
unsigned long long g(unsigned long long a) { return a | 0x1000000ull; }


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

x86 assembly (clang, -O2):
<g>:
mov    %rdi,%rax
or     $0x1000000,%rax
ret

LLVM IR (-O0):
define i64 @g(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = or i64 %3, 16777216
ret i64 %4
}

LLVM IR (-O2):
define i64 @g(i64 %0) {
%2 = or i64 %0, 16777216
ret i64 %2
}
int test_02(int x, int y) {
  if (!y)
    ++x;
  return x;
}


x86 assembly (clang, -O0):
<test_02>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <test_02+0x1d>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_02>:
mov    %edi,%eax
cmp    $0x1,%esi
adc    $0x0,%eax
ret

LLVM IR (-O0):
define i32 @test_02(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 = icmp ne i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 1
store i32 %9, i32* %3
br label %10
10: ; preds = %7, %2
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @test_02(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = zext i1 %3 to i32
%5 = add nsw i32 %4, %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ commitSepuku(int **);
int /*<<< orphan*/ dishonorFamily(int **);
int /*<<< orphan*/ restoreHonor(int **);
int main() {
  int you[9][9];
  dishonorFamily(you);
  commitSepuku(you);
  restoreHonor(you);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x150,%rsp
lea    -0x150(%rbp),%rdi
call   1050 <dishonorFamily@plt>
lea    -0x150(%rbp),%rdi
call   1030 <commitSepuku@plt>
lea    -0x150(%rbp),%rdi
call   1040 <restoreHonor@plt>
xor    %eax,%eax
add    $0x150,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x150,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <dishonorFamily@plt>
mov    %rbx,%rdi
call   1030 <commitSepuku@plt>
mov    %rbx,%rdi
call   1040 <restoreHonor@plt>
xor    %eax,%eax
add    $0x150,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [9 x [9 x i32]]
%2 = bitcast [9 x [9 x i32]]* %1 to i8*
%3 = bitcast [9 x [9 x i32]]* %1 to i32**
%4 = call i32 @dishonorFamily(i32** %3)
%5 = call i32 @commitSepuku(i32** %3)
%6 = call i32 @restoreHonor(i32** %3)
ret i32 0
}
/* Variables and functions */
int cd_reset_selector(int, int /*<<< orphan*/);
int cd_reset_selector_all() { return cd_reset_selector(0xFC, 0); }


x86 assembly (clang, -O0):
<cd_reset_selector_all>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfc,%edi
xor    %esi,%esi
call   1030 <cd_reset_selector@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cd_reset_selector_all>:
mov    $0xfc,%edi
xor    %esi,%esi
jmp    1030 <cd_reset_selector@plt>

LLVM IR (-O0):
define i32 @cd_reset_selector_all() {
%1 = call i32 @cd_reset_selector(i32 252, i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @cd_reset_selector_all() {
%1 = tail call i32 @cd_reset_selector(i32 252, i32 0)
ret i32 %1
}
void nseel_asm_sqrt(void) {
  __asm__("fabs\n"
          "fsqrt\n");
}


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

x86 assembly (clang, -O2):
<nseel_asm_sqrt>:
fabs
fsqrt
ret

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

LLVM IR (-O2):
define void @nseel_asm_sqrt() {
tail call void asm sideeffect "fabs\0Afsqrt\0A", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
void data_destroy(void *data) { return; }


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

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

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

LLVM IR (-O2):
define void @data_destroy(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mem_free(void *);
void ed25519_Verify_Finish(void *ctx) { mem_free(ctx); }


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

x86 assembly (clang, -O2):
<ed25519_Verify_Finish>:
jmp    1030 <mem_free@plt>

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

LLVM IR (-O2):
define void @ed25519_Verify_Finish(i8* %0) {
%2 = tail call i32 @mem_free(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char *LoadBlock(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ LoadWord(int /*<<< orphan*/ *);
char *LoadNewString(FILE *D) { return LoadBlock(LoadWord(D), D); }


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

x86 assembly (clang, -O2):
<LoadNewString>:
push   %rbx
mov    %rdi,%rbx
call   1030 <LoadWord@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <LoadBlock@plt>

LLVM IR (-O0):
define i8* @LoadNewString(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @LoadWord(i32* %3)
%5 = load i32*, i32** %2
%6 = call i8* @LoadBlock(i32 %4, i32* %5)
ret i8* %6
}

LLVM IR (-O2):
define i8* @LoadNewString(i32* %0) {
%2 = tail call i32 @LoadWord(i32* %0)
%3 = tail call i8* @LoadBlock(i32 %2, i32* %0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *argv0) { fprintf(stderr, "usage: %s PAGECOUNT\n", argv0); }


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"usage: %s PAGECOUNT\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"usage: %s PAGECOUNT\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
uint64_t setBit_fun_uint64_t(uint64_t x, uint32_t i) { return x | 1 << i; }


x86 assembly (clang, -O0):
<setBit_fun_uint64_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @setBit_fun_uint64_t(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 = shl i32 1, %6
%8 = or i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @setBit_fun_uint64_t(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = or i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ emulate_vdu(int);
void emulate_newline(void) {
  emulate_vdu(0xD);
  emulate_vdu(0xA);
}


x86 assembly (clang, -O0):
<emulate_newline>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd,%edi
call   1030 <emulate_vdu@plt>
mov    $0xa,%edi
call   1030 <emulate_vdu@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<emulate_newline>:
push   %rax
mov    $0xd,%edi
call   1030 <emulate_vdu@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <emulate_vdu@plt>

LLVM IR (-O0):
define void @emulate_newline() {
%1 = call i32 @emulate_vdu(i32 13)
%2 = call i32 @emulate_vdu(i32 10)
ret void
}

LLVM IR (-O2):
define void @emulate_newline() {
%1 = tail call i32 @emulate_vdu(i32 13)
%2 = tail call i32 @emulate_vdu(i32 10)
ret void
}
void FilterDestroy(void *arg) {}


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

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

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

LLVM IR (-O2):
define void @FilterDestroy(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *checked_malloc(size_t size) {
  void *ptr = malloc(size);
  if (ptr == NULL) {
    fprintf(stderr, "memory allocation failed\n");
    exit(1);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<checked_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1173 <checked_malloc+0x43>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checked_malloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <checked_malloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"memory allocation failed\0A\00"
define i8* @checked_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"memory allocation failed\0A\00"
define noalias i8* @checked_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret i8* %2
}
int lenlist(char **list) {
  int len = 0;
  if (!list)
    return 0;
  while (list[len])
    len++;
  return len;
}


x86 assembly (clang, -O0):
<lenlist>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1126 <lenlist+0x26>
movl   $0x0,-0x4(%rbp)
jmp    1152 <lenlist+0x52>
jmp    112b <lenlist+0x2b>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     114c <lenlist+0x4c>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112b <lenlist+0x2b>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lenlist>:
test   %rdi,%rdi
je     111e <lenlist+0x1e>
mov    $0xffffffff,%eax
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
cmpq   $0x0,(%rdi)
lea    0x8(%rdi),%rdi
jne    1110 <lenlist+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @lenlist(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %8, %3 ], [ 0, %1 ]
%5 = getelementptr inbounds i8*, i8** %0, i64 %4
%6 = load i8*, i8** %5
%7 = icmp eq i8* %6, null
%8 = add nuw i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = trunc i64 %4 to i32
br label %11
11: ; preds = %9, %1
%12 = phi i32 [ 0, %1 ], [ %10, %9 ]
ret i32 %12
}
unsigned short unsignedshort_ignoring_unsignedshort(unsigned short x,
                                                    unsigned short y) {
  return x;
}


x86 assembly (clang, -O0):
<unsignedshort_ignoring_unsignedshort>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define zeroext i16 @unsignedshort_ignoring_unsignedshort(i16 returned zeroext %0, i16 zeroext %1) {
ret i16 %0
}
const char *ssfix(const char *s) { return s ? s : ""; }


x86 assembly (clang, -O0):
<ssfix>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1120 <ssfix+0x20>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1130 <ssfix+0x30>
lea    0xed9(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1130 <ssfix+0x30>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssfix>:
test   %rdi,%rdi
lea    0xef6(%rip),%rax
cmovne %rdi,%rax
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @ssfix(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i8*, i8** %2
br label %8
7: ; preds = %1
br label %8
8: ; preds = %7, %5
%9 = phi i8* [ %6, %5 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %7 ]
ret i8* %9
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @ssfix(i8* readnone %0) {
%2 = icmp eq i8* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %0
ret i8* %3
}
void *tsk_obj_dtor(void *self) { return self; }


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

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

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

LLVM IR (-O2):
define i8* @tsk_obj_dtor(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
void *calloc(size_t, size_t);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void *xcalloc(size_t nelem, size_t n) {
  void *p;
  p = calloc(nelem, n);
  if (!p) {
    fprintf(stderr, "Memory is too low\n");
    exit(EXIT_FAILURE);
  }
  return p;
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    117f <xcalloc+0x4f>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
lea    0xe94(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e60(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %rax
call   1030 <calloc@plt>
test   %rax,%rax
je     113d <xcalloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"Memory is too low\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @xcalloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %16, label %11
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%14 = load i32, i32* @EXIT_FAILURE
%15 = call i32 @exit(i32 %14)
unreachable
16: ; preds = %2
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"Memory is too low\0A\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @xcalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int getword(int);
int inlist(int link, int word) {
  while (link != 0) {
    if (word == getword(link + 0))
      return (1);
    link = getword(link + 2);
  }
  return (0);
}


x86 assembly (clang, -O0):
<inlist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1165 <inlist+0x55>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
add    $0x0,%edi
call   1030 <getword@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jne    1152 <inlist+0x42>
movl   $0x1,-0x4(%rbp)
jmp    116c <inlist+0x5c>
mov    -0x8(%rbp),%edi
add    $0x2,%edi
call   1030 <getword@plt>
mov    %eax,-0x8(%rbp)
jmp    111e <inlist+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inlist>:
push   %rbp
push   %r14
push   %rbx
xor    %r14d,%r14d
test   %edi,%edi
je     1143 <inlist+0x33>
mov    %esi,%ebp
mov    %edi,%ebx
nop
mov    %ebx,%edi
call   1030 <getword@plt>
cmp    %ebp,%eax
je     113d <inlist+0x2d>
add    $0x2,%ebx
mov    %ebx,%edi
call   1030 <getword@plt>
mov    %eax,%ebx
test   %eax,%eax
jne    1120 <inlist+0x10>
jmp    1143 <inlist+0x33>
mov    $0x1,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @inlist(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %8
%5 = phi i32 [ %10, %8 ], [ %0, %2 ]
%6 = tail call i32 @getword(i32 %5)
%7 = icmp eq i32 %6, %1
br i1 %7, label %12, label %8
8: ; preds = %4
%9 = add nsw i32 %5, 2
%10 = tail call i32 @getword(i32 %9)
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %8, %2
%13 = phi i32 [ 0, %2 ], [ 0, %8 ], [ 1, %4 ]
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ RSA;

/* Variables and functions */
int RSA_check_key_ex(int /*<<< orphan*/ const *, int /*<<< orphan*/ *);
int RSA_check_key(const RSA *key) { return RSA_check_key_ex(key, NULL); }


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

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

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

LLVM IR (-O2):
define i32 @RSA_check_key(i32* %0) {
%2 = tail call i32 @RSA_check_key_ex(i32* %0, i32* null)
ret i32 %2
}
void gtk_dialog_set_alternative_button_order_from_array() {}


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

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

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

LLVM IR (-O2):
define void @gtk_dialog_set_alternative_button_order_from_array() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_ptr_param_array(int /*<<< orphan*/);
void FN_set_ptr_param_array_get_null_bad() { set_ptr_param_array(0); }


x86 assembly (clang, -O0):
<FN_set_ptr_param_array_get_null_bad>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <set_ptr_param_array@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<FN_set_ptr_param_array_get_null_bad>:
xor    %edi,%edi
jmp    1030 <set_ptr_param_array@plt>

LLVM IR (-O0):
define void @FN_set_ptr_param_array_get_null_bad() {
%1 = call i32 @set_ptr_param_array(i32 0)
ret void
}

LLVM IR (-O2):
define void @FN_set_ptr_param_array_get_null_bad() {
%1 = tail call i32 @set_ptr_param_array(i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ z_stream;
typedef int /*<<< orphan*/ Bytef;

/* Variables and functions */
int deflateSetDictionary(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                         unsigned int);
int streaming_commons_deflate_set_dictionary(z_stream *stream,
                                             const char *dictionary,
                                             unsigned int dictLength) {
  return deflateSetDictionary(stream, (const Bytef *)dictionary, dictLength);
}


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

x86 assembly (clang, -O2):
<streaming_commons_deflate_set_dictionary>:
jmp    1030 <deflateSetDictionary@plt>

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

LLVM IR (-O2):
define i32 @streaming_commons_deflate_set_dictionary(i32* %0, i8* %1, i32 %2) {
%4 = bitcast i8* %1 to i32*
%5 = tail call i32 @deflateSetDictionary(i32* %0, i32* %4, i32 %2)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ addrange(char, int);
void addranges_D(void) {
  addrange(0, '0' - 1);
  addrange('9' + 1, 0xFFFF);
}


x86 assembly (clang, -O0):
<addranges_D>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x2f,%esi
call   1030 <addrange@plt>
mov    $0x3a,%edi
mov    $0xffff,%esi
call   1030 <addrange@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<addranges_D>:
push   %rax
xor    %edi,%edi
mov    $0x2f,%esi
call   1030 <addrange@plt>
mov    $0x3a,%edi
mov    $0xffff,%esi
pop    %rax
jmp    1030 <addrange@plt>

LLVM IR (-O0):
define void @addranges_D() {
%1 = call i32 @addrange(i8 signext 0, i32 47)
%2 = call i32 @addrange(i8 signext 58, i32 65535)
ret void
}

LLVM IR (-O2):
define void @addranges_D() {
%1 = tail call i32 @addrange(i8 signext 0, i32 47)
%2 = tail call i32 @addrange(i8 signext 58, i32 65535)
ret void
}
int mycompar(const void *a, const void *b) {
  int *x = (int *)a;
  int *y = (int *)b;
  if (*x > *y)
    return 1;
  return *x == *y ? 0 : -1;
}


x86 assembly (clang, -O0):
<mycompar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jle    113a <mycompar+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    1155 <mycompar+0x55>
mov    -0x20(%rbp),%rax
mov    (%rax),%edx
mov    -0x28(%rbp),%rax
mov    (%rax),%esi
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mycompar>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
xor    %edx,%edx
cmp    %ecx,%eax
setne  %dl
neg    %edx
cmp    %ecx,%eax
mov    $0x1,%eax
cmovle %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @mycompar(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp sgt i32 %5, %6
%8 = icmp ne i32 %5, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}