xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
void largeAdjustmentLE(unsigned a) {
  char *b = ((void *)0);
  if (a + 2 <= 1)
    b = malloc(1);
  if (a < (0x7fffffff * 2U + 1U) - 1)
    return;
  else if (a == (0x7fffffff * 2U + 1U) - 1 || a == (0x7fffffff * 2U + 1U))
    free(b);
  return;
}


x86 assembly (clang, -O0):
<largeAdjustmentLE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2,%eax
cmp    $0x1,%eax
ja     1150 <largeAdjustmentLE+0x30>
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpl   $0xfffffffe,-0x4(%rbp)
jae    115f <largeAdjustmentLE+0x3f>
jmp    1186 <largeAdjustmentLE+0x66>
cmpl   $0xfffffffe,-0x4(%rbp)
je     1173 <largeAdjustmentLE+0x53>
cmpl   $0xffffffff,-0x4(%rbp)
jne    117c <largeAdjustmentLE+0x5c>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
jmp    1181 <largeAdjustmentLE+0x61>
jmp    1186 <largeAdjustmentLE+0x66>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<largeAdjustmentLE>:
cmp    $0xfffffffe,%edi
jb     1139 <largeAdjustmentLE+0x19>
push   %rax
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @largeAdjustmentLE(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
store i8* null, i8** %3
%4 = load i32, i32* %2
%5 = add i32 %4, 2
%6 = icmp ule i32 %5, 1
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i8* @malloc(i32 1)
store i8* %8, i8** %3
br label %9
9: ; preds = %7, %1
%10 = load i32, i32* %2
%11 = icmp ult i32 %10, -2
br i1 %11, label %12, label %13
12: ; preds = %9
br label %24
13: ; preds = %9
%14 = load i32, i32* %2
%15 = icmp eq i32 %14, -2
br i1 %15, label %19, label %16
16: ; preds = %13
%17 = load i32, i32* %2
%18 = icmp eq i32 %17, -1
br i1 %18, label %19, label %22
19: ; preds = %16, %13
%20 = load i8*, i8** %3
%21 = call i32 @free(i8* %20)
br label %22
22: ; preds = %19, %16
br label %23
23: ; preds = %22
br label %24
24: ; preds = %23, %12
ret void
}

LLVM IR (-O2):
define void @largeAdjustmentLE(i32 %0) {
%2 = icmp ugt i32 %0, -3
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call dereferenceable_or_null(1) i8* @malloc(i32 1)
%5 = tail call i32 @free(i8* %4)
br label %6
6: ; preds = %1, %3
ret void
}
int op_cmpl(int a) { return ~a; }


x86 assembly (clang, -O0):
<op_cmpl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @op_cmpl(i32 %0) {
%2 = xor i32 %0, -1
ret i32 %2
}
/* Variables and functions */
scalar_t__ pow(float, double);
float sqrt(scalar_t__);
float triangle(float x, float y) {
  return (sqrt(pow(x, 2.0) + pow(y, 2.0)) + x + y);
}


x86 assembly (clang, -O0):
<triangle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movsd  0xec1(%rip),%xmm1
call   1030 <pow@plt>
mov    %rax,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
movsd  0xeab(%rip),%xmm1
call   1030 <pow@plt>
mov    -0x10(%rbp),%rdi
add    %rax,%rdi
call   1040 <sqrt@plt>
addss  -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<triangle>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm1,0x8(%rsp)
movss  %xmm0,0xc(%rsp)
movsd  0xec7(%rip),%xmm1
call   1030 <pow@plt>
mov    %rax,%rbx
movss  0x8(%rsp),%xmm0
movsd  0xeb1(%rip),%xmm1
call   1030 <pow@plt>
add    %rax,%rbx
mov    %rbx,%rdi
call   1040 <sqrt@plt>
addss  0xc(%rsp),%xmm0
addss  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define float @triangle(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = call i64 @pow(float %5, double 2.000000e+00)
%7 = load float, float* %4
%8 = call i64 @pow(float %7, double 2.000000e+00)
%9 = add nsw i64 %6, %8
%10 = call float @sqrt(i64 %9)
%11 = load float, float* %3
%12 = fadd float %10, %11
%13 = load float, float* %4
%14 = fadd float %12, %13
ret float %14
}

LLVM IR (-O2):
define float @triangle(float %0, float %1) {
%3 = tail call i64 @pow(float %0, double 2.000000e+00)
%4 = tail call i64 @pow(float %1, double 2.000000e+00)
%5 = add nsw i64 %4, %3
%6 = tail call float @sqrt(i64 %5)
%7 = fadd float %6, %0
%8 = fadd float %7, %1
ret float %8
}
/* Type definitions */
struct completion {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ au_delayed_kfree(struct completion *);
void au_wkq_comp_free(struct completion *comp) { au_delayed_kfree(comp); }


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

x86 assembly (clang, -O2):
<au_wkq_comp_free>:
jmp    1030 <au_delayed_kfree@plt>

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

LLVM IR (-O2):
%struct.completion = type { i32 }
define void @au_wkq_comp_free(%struct.completion* %0) {
%2 = tail call i32 @au_delayed_kfree(%struct.completion* %0)
ret void
}
/* Variables and functions */
int arm_setup(int);
int /*<<< orphan*/ soc_setup_n_go(int);
int byoos_setup(void) {
  int retval;
  *((unsigned long *)(0x021F0040)) = '%';
  *((unsigned long *)(0x021F0040)) = '\n';
  *((unsigned long *)(0x021F0040)) = '\r';
  retval = arm_setup(3);
  soc_setup_n_go(3);
  return retval;
}


x86 assembly (clang, -O0):
<byoos_setup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x21f0040,%eax
movq   $0x25,(%rax)
mov    $0x21f0040,%eax
movq   $0xa,(%rax)
mov    $0x21f0040,%eax
movq   $0xd,(%rax)
mov    $0x3,%edi
call   1040 <arm_setup@plt>
mov    %eax,-0x4(%rbp)
mov    $0x3,%edi
call   1030 <soc_setup_n_go@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<byoos_setup>:
push   %rbx
movq   $0xd,0x21f0040
mov    $0x3,%edi
call   1040 <arm_setup@plt>
mov    %eax,%ebx
mov    $0x3,%edi
call   1030 <soc_setup_n_go@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @byoos_setup() {
%1 = alloca i32
store i64 37, i64* inttoptr (i64 35586112 to i64*)
store i64 10, i64* inttoptr (i64 35586112 to i64*)
store i64 13, i64* inttoptr (i64 35586112 to i64*)
%2 = call i32 @arm_setup(i32 3)
store i32 %2, i32* %1
%3 = call i32 @soc_setup_n_go(i32 3)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @byoos_setup() {
store i64 13, i64* inttoptr (i64 35586112 to i64*)
%1 = tail call i32 @arm_setup(i32 3)
%2 = tail call i32 @soc_setup_n_go(i32 3)
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int builtin_success(int line, int argc, char **argv, time_t stoptime) {
  return 1;
}


x86 assembly (clang, -O0):
<builtin_success>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @builtin_success(i32 %0, i32 %1, i8** %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8** %2, i8*** %7
store i32 %3, i32* %8
ret i32 1
}

LLVM IR (-O2):
define i32 @builtin_success(i32 %0, i32 %1, i8** nocapture readnone %2, i32 %3) {
ret i32 1
}
int compare_ints(const void *pa, const void *pb) {
  const int *a = pa;
  const int *b = pb;
  if (*a > *b)
    return 1;
  else if (*a < *b)
    return -1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<compare_ints>:
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 <compare_ints+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    115f <compare_ints+0x5f>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jge    1158 <compare_ints+0x58>
movl   $0xffffffff,-0x4(%rbp)
jmp    115f <compare_ints+0x5f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @compare_ints(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 slt i32 %20, %22
br i1 %23, label %24, label %25
24: ; preds = %18
store i32 -1, i32* %3
br label %26
25: ; preds = %18
store i32 0, i32* %3
br label %26
26: ; preds = %25, %24, %17
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @compare_ints(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 slt i32 %5, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ StrDump(char *);
void PreCDump() { StrDump("\nC: "); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"\0AC: \00"
define void @PreCDump() {
%1 = call i32 @StrDump(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\0AC: \00"
define void @PreCDump() {
%1 = tail call i32 @StrDump(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
void crc16ccitt_init(unsigned short *uCcitt16) { *uCcitt16 = 0xFFFF; }


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

x86 assembly (clang, -O2):
<crc16ccitt_init>:
movw   $0xffff,(%rdi)
ret

LLVM IR (-O0):
define void @crc16ccitt_init(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
store i16 -1, i16* %3
ret void
}

LLVM IR (-O2):
define void @crc16ccitt_init(i16* nocapture writeonly %0) {
store i16 -1, i16* %0
ret void
}
void abcdefgh5ijklmnopqrstuvwxzy() {}


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

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

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

LLVM IR (-O2):
define void @abcdefgh5ijklmnopqrstuvwxzy() {
ret void
}
long long rev(long long n) {
  long long reverse = 0;
  while (n != 0) {
    reverse = (reverse * 10) + (n % 10);
    n = n / 10;
  }
  return reverse;
}


x86 assembly (clang, -O0):
<rev>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1154 <rev+0x54>
imul   $0xa,-0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    -0x18(%rbp),%rax
add    %rdx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
jmp    1110 <rev+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rev>:
test   %rdi,%rdi
je     1158 <rev+0x58>
mov    %rdi,%rcx
xor    %eax,%eax
movabs $0x6666666666666667,%r8
66 66 66
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    (%rax,%rax,4),%rsi
mov    %rcx,%rax
imul   %r8
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x2,%rdx
add    %rax,%rdx
lea    (%rdx,%rdx,1),%rax
lea    (%rax,%rax,4),%rax
mov    %rcx,%rdi
sub    %rax,%rdi
lea    (%rdi,%rsi,2),%rax
add    $0x9,%rcx
cmp    $0x12,%rcx
mov    %rdx,%rcx
ja     1120 <rev+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @rev(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %8, %3 ], [ 0, %1 ]
%5 = phi i64 [ %9, %3 ], [ %0, %1 ]
%6 = mul nsw i64 %4, 10
%7 = srem i64 %5, 10
%8 = add nsw i64 %6, %7
%9 = sdiv i64 %5, 10
%10 = add i64 %5, 9
%11 = icmp ult i64 %10, 19
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i64 [ 0, %1 ], [ %8, %3 ]
ret i64 %13
}
int fun717() { return 717; }


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

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

LLVM IR (-O0):
define i32 @fun717() {
ret i32 717
}

LLVM IR (-O2):
define i32 @fun717() {
ret i32 717
}
void clear(int *ary, int size) {
  int ix;
  for (ix = 0; ix < size; ix++)
    ary[ix] = -1;
}


x86 assembly (clang, -O0):
<clear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113b <clear+0x3b>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movl   $0xffffffff,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <clear+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear>:
test   %esi,%esi
jle    1129 <clear+0x19>
push   %rax
mov    %esi,%edx
shl    $0x2,%rdx
mov    $0xff,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @clear(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast i32* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %2
ret void
}
int x42_process_request(struct mypacket *packet) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.mypacket = type opaque
define i32 @x42_process_request(%struct.mypacket* nocapture readnone %0) {
ret i32 0
}
int aaa_f2(int a, int b) { return a + a * b - b / a; }


x86 assembly (clang, -O0):
<aaa_f2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0x4(%rbp)
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<aaa_f2>:
mov    %esi,%eax
mov    %esi,%ecx
imul   %edi,%ecx
add    %edi,%ecx
cltd
idiv   %edi
sub    %eax,%ecx
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @aaa_f2(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* %3
%7 = load i32, i32* %4
%8 = mul nsw i32 %6, %7
%9 = add nsw i32 %5, %8
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = sdiv i32 %10, %11
%13 = sub nsw i32 %9, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @aaa_f2(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = add nsw i32 %3, %0
%5 = sdiv i32 %1, %0
%6 = sub i32 %4, %5
ret i32 %6
}
/* Variables and functions */
scalar_t__ memcmp(unsigned char const *, unsigned char const *, int);
int crypto_verify_32(const unsigned char *x, const unsigned char *y) {
  return memcmp(x, y, 32) == 0 ? 0 : -1;
}


x86 assembly (clang, -O0):
<crypto_verify_32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x20,%edx
call   1030 <memcmp@plt>
mov    %rax,%rdx
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypto_verify_32>:
push   %rax
mov    $0x20,%edx
call   1030 <memcmp@plt>
neg    %rax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @crypto_verify_32(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i64 @memcmp(i8* %5, i8* %6, i32 32)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 0, i32 -1
ret i32 %10
}

LLVM IR (-O2):
define i32 @crypto_verify_32(i8* %0, i8* %1) {
%3 = tail call i64 @memcmp(i8* %0, i8* %1, i32 32)
%4 = icmp ne i64 %3, 0
%5 = sext i1 %4 to i32
ret i32 %5
}
void CMUTIL_CallStackClear() {}


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

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

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

LLVM IR (-O2):
define void @CMUTIL_CallStackClear() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGHUP;
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ SIGPIPE;
int /*<<< orphan*/ SIGTERM;
int /*<<< orphan*/ signal(int /*<<< orphan*/, void (*)(int));
int catch_signals(void (*handler)(int)) {
  signal(SIGTERM, handler);
  signal(SIGHUP, handler);
  signal(SIGINT, handler);
  signal(SIGPIPE, handler);
  return 1;
}


x86 assembly (clang, -O0):
<catch_signals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <signal@plt>
mov    0x2ebb(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <signal@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <signal@plt>
mov    0x2e6f(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <signal@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<catch_signals>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
call   1030 <signal@plt>
mov    0x2ec4(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
call   1030 <signal@plt>
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
call   1030 <signal@plt>
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
call   1030 <signal@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@SIGTERM = global i32 0
@SIGHUP = global i32 0
@SIGINT = global i32 0
@SIGPIPE = global i32 0
define i32 @catch_signals(void (i32)* %0) {
%2 = alloca void (i32)*
store void (i32)* %0, void (i32)** %2
%3 = load i32, i32* @SIGTERM
%4 = load void (i32)*, void (i32)** %2
%5 = call i32 @signal(i32 %3, void (i32)* %4)
%6 = load i32, i32* @SIGHUP
%7 = load void (i32)*, void (i32)** %2
%8 = call i32 @signal(i32 %6, void (i32)* %7)
%9 = load i32, i32* @SIGINT
%10 = load void (i32)*, void (i32)** %2
%11 = call i32 @signal(i32 %9, void (i32)* %10)
%12 = load i32, i32* @SIGPIPE
%13 = load void (i32)*, void (i32)** %2
%14 = call i32 @signal(i32 %12, void (i32)* %13)
ret i32 1
}

LLVM IR (-O2):
@SIGTERM = global i32 0
@SIGHUP = global i32 0
@SIGINT = global i32 0
@SIGPIPE = global i32 0
define i32 @catch_signals(void (i32)* %0) {
%2 = load i32, i32* @SIGTERM
%3 = tail call i32 @signal(i32 %2, void (i32)* %0)
%4 = load i32, i32* @SIGHUP
%5 = tail call i32 @signal(i32 %4, void (i32)* %0)
%6 = load i32, i32* @SIGINT
%7 = tail call i32 @signal(i32 %6, void (i32)* %0)
%8 = load i32, i32* @SIGPIPE
%9 = tail call i32 @signal(i32 %8, void (i32)* %0)
ret i32 1
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t dhara_r32(const uint8_t *data) {
  return ((uint32_t)data[0]) | (((uint32_t)data[1]) << 8) |
         (((uint32_t)data[2]) << 16) | (((uint32_t)data[3]) << 24);
}


x86 assembly (clang, -O0):
<dhara_r32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%rcx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x10(%rcx),%rcx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x18(%rcx),%rcx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dhara_r32>:
mov    0x8(%rdi),%ecx
mov    0x10(%rdi),%edx
shl    $0x8,%ecx
or     (%rdi),%ecx
shl    $0x10,%edx
mov    0x18(%rdi),%eax
shl    $0x18,%eax
or     %edx,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @dhara_r32(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = getelementptr inbounds i64, i64* %3, i64 0
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = load i64*, i64** %2
%8 = getelementptr inbounds i64, i64* %7, i64 1
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = shl i32 %10, 8
%12 = or i32 %6, %11
%13 = load i64*, i64** %2
%14 = getelementptr inbounds i64, i64* %13, i64 2
%15 = load i64, i64* %14
%16 = trunc i64 %15 to i32
%17 = shl i32 %16, 16
%18 = or i32 %12, %17
%19 = load i64*, i64** %2
%20 = getelementptr inbounds i64, i64* %19, i64 3
%21 = load i64, i64* %20
%22 = trunc i64 %21 to i32
%23 = shl i32 %22, 24
%24 = or i32 %18, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @dhara_r32(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = trunc i64 %2 to i32
%4 = getelementptr inbounds i64, i64* %0, i64 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = shl i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i64, i64* %0, i64 2
%10 = load i64, i64* %9
%11 = trunc i64 %10 to i32
%12 = shl i32 %11, 16
%13 = or i32 %8, %12
%14 = getelementptr inbounds i64, i64* %0, i64 3
%15 = load i64, i64* %14
%16 = trunc i64 %15 to i32
%17 = shl i32 %16, 24
%18 = or i32 %13, %17
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ test_assign();
int /*<<< orphan*/ test_builtin();
int /*<<< orphan*/ test_call();
int /*<<< orphan*/ test_cast();
int /*<<< orphan*/ test_init();
int /*<<< orphan*/ test_return();
int main(void) {
  test_assign();
  test_init();
  test_cast();
  test_call();
  test_return();
  test_builtin();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1070 <test_assign@plt>
mov    $0x0,%al
call   1030 <test_init@plt>
mov    $0x0,%al
call   1040 <test_cast@plt>
mov    $0x0,%al
call   1080 <test_call@plt>
mov    $0x0,%al
call   1060 <test_return@plt>
mov    $0x0,%al
call   1050 <test_builtin@plt>
xor    %edi,%edi
call   1090 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <test_assign@plt>
xor    %eax,%eax
call   1030 <test_init@plt>
xor    %eax,%eax
call   1040 <test_cast@plt>
xor    %eax,%eax
call   1080 <test_call@plt>
xor    %eax,%eax
call   1060 <test_return@plt>
xor    %eax,%eax
call   1050 <test_builtin@plt>
xor    %edi,%edi
call   1090 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_assign()
%3 = call i32 (...) @test_init()
%4 = call i32 (...) @test_cast()
%5 = call i32 (...) @test_call()
%6 = call i32 (...) @test_return()
%7 = call i32 (...) @test_builtin()
%8 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_assign()
%2 = tail call i32 (...) @test_init()
%3 = tail call i32 (...) @test_cast()
%4 = tail call i32 (...) @test_call()
%5 = tail call i32 (...) @test_return()
%6 = tail call i32 (...) @test_builtin()
%7 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ AF_INET6;
int inet_pton(int /*<<< orphan*/, char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ *strstr(char *, char *);
int ipv6_str_to_buf(char *str, uint8_t *buf) {
  if (strstr(str, ":") == NULL) {
    return 0;
  }
  return inet_pton(AF_INET6, str, buf) == 1;
}


x86 assembly (clang, -O0):
<ipv6_str_to_buf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec5(%rip),%rsi
call   1040 <strstr@plt>
cmp    $0x0,%rax
jne    1156 <ipv6_str_to_buf+0x36>
movl   $0x0,-0x4(%rbp)
jmp    117a <ipv6_str_to_buf+0x5a>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <inet_pton@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipv6_str_to_buf>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x3a,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1159 <ipv6_str_to_buf+0x39>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <inet_pton@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
sete   %al
jmp    115b <ipv6_str_to_buf+0x3b>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [2 x i8] c":\00"
@AF_INET6 = global i32 0
define i32 @ipv6_str_to_buf(i8* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %4
store i32* %1, i32** %5
%6 = load i8*, i8** %4
%7 = call i32* @strstr(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i32* %7, null
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 0, i32* %3
br label %17
10: ; preds = %2
%11 = load i32, i32* @AF_INET6
%12 = load i8*, i8** %4
%13 = load i32*, i32** %5
%14 = call i32 @inet_pton(i32 %11, i8* %12, i32* %13)
%15 = icmp eq i32 %14, 1
%16 = zext i1 %15 to i32
store i32 %16, i32* %3
br label %17
17: ; preds = %10, %9
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@AF_INET6 = global i32 0
define i32 @ipv6_str_to_buf(i8* %0, i32* %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 58)
%4 = icmp eq i8* %3, null
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = load i32, i32* @AF_INET6
%7 = tail call i32 @inet_pton(i32 %6, i8* %0, i32* %1)
%8 = icmp eq i32 %7, 1
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %2, %5
%11 = phi i32 [ %9, %5 ], [ 0, %2 ]
ret i32 %11
}
int iio_device_unregister_trigger_consumer(struct iio_dev *dev_info) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.iio_dev = type opaque
define i32 @iio_device_unregister_trigger_consumer(%struct.iio_dev* nocapture readnone %0) {
ret i32 0
}
int msg_getsrc(const char *msg) { return 10 * (msg[2] - '0') + msg[3] - '0'; }


x86 assembly (clang, -O0):
<msg_getsrc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x2(%rax),%eax
sub    $0x30,%eax
imul   $0xa,%eax,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x3(%rcx),%ecx
add    %ecx,%eax
sub    $0x30,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<msg_getsrc>:
movsbl 0x2(%rdi),%eax
lea    (%rax,%rax,4),%eax
movsbl 0x3(%rdi),%ecx
lea    (%rcx,%rax,2),%eax
add    $0xfffffdf0,%eax
ret

LLVM IR (-O0):
define i32 @msg_getsrc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = sub nsw i32 %6, 48
%8 = mul nsw i32 10, %7
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 3
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = add nsw i32 %8, %12
%14 = sub nsw i32 %13, 48
ret i32 %14
}

LLVM IR (-O2):
define i32 @msg_getsrc(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = mul nsw i32 %4, 10
%6 = getelementptr inbounds i8, i8* %0, i64 3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = add nsw i32 %5, -528
%10 = add nsw i32 %9, %8
ret i32 %10
}
/* Variables and functions */
double __nv_tgamma(double);
double tgamma(double __a) { return __nv_tgamma(__a); }


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

x86 assembly (clang, -O2):
<tgamma>:
jmp    1030 <__nv_tgamma@plt>

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

LLVM IR (-O2):
define double @tgamma(double %0) {
%2 = tail call double @__nv_tgamma(double %0)
ret double %2
}
/* Type definitions */
struct pico_mqtt_serializer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ add_2_byte_stream(struct pico_mqtt_serializer *, int);
int create_stream(struct pico_mqtt_serializer *, int);
int serialize_disconnect(struct pico_mqtt_serializer *serializer) {
  do {
  } while (0);
  if (create_stream(serializer, 2) == -1) {
    do {
    } while (0);
    return -1;
  }
  add_2_byte_stream(serializer, 0xE000);
  return 0;
}


x86 assembly (clang, -O0):
<serialize_disconnect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
jmp    1131 <serialize_disconnect+0x11>
mov    -0x10(%rbp),%rdi
mov    $0x2,%esi
call   1030 <create_stream@plt>
cmp    $0xffffffff,%eax
jne    115e <serialize_disconnect+0x3e>
jmp    114d <serialize_disconnect+0x2d>
jmp    1152 <serialize_disconnect+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    1173 <serialize_disconnect+0x53>
mov    -0x10(%rbp),%rdi
mov    $0xe000,%esi
call   1040 <add_2_byte_stream@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serialize_disconnect>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2,%esi
call   1030 <create_stream@plt>
cmp    $0xffffffff,%eax
je     1144 <serialize_disconnect+0x24>
mov    %rbx,%rdi
mov    $0xe000,%esi
call   1040 <add_2_byte_stream@plt>
xor    %eax,%eax
pop    %rbx
ret
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.pico_mqtt_serializer = type { i32 }
define i32 @serialize_disconnect(%struct.pico_mqtt_serializer* %0) {
%2 = alloca i32
%3 = alloca %struct.pico_mqtt_serializer*
store %struct.pico_mqtt_serializer* %0, %struct.pico_mqtt_serializer** %3
br label %4
4: ; preds = %1
br label %5
5: ; preds = %4
%6 = load %struct.pico_mqtt_serializer*, %struct.pico_mqtt_serializer** %3
%7 = call i32 @create_stream(%struct.pico_mqtt_serializer* %6, i32 2)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %12
9: ; preds = %5
br label %10
10: ; preds = %9
br label %11
11: ; preds = %10
store i32 -1, i32* %2
br label %15
12: ; preds = %5
%13 = load %struct.pico_mqtt_serializer*, %struct.pico_mqtt_serializer** %3
%14 = call i32 @add_2_byte_stream(%struct.pico_mqtt_serializer* %13, i32 57344)
store i32 0, i32* %2
br label %15
15: ; preds = %12, %11
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
%struct.pico_mqtt_serializer = type { i32 }
define i32 @serialize_disconnect(%struct.pico_mqtt_serializer* %0) {
%2 = tail call i32 @create_stream(%struct.pico_mqtt_serializer* %0, i32 2)
%3 = icmp eq i32 %2, -1
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @add_2_byte_stream(%struct.pico_mqtt_serializer* %0, i32 57344)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 0, %4 ], [ -1, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void instractions(void) {
  printf("Enter your choice: \n"
         "1 to insert an element to the list.\n"
         "2 to delete an element from the list\n"
         "3 to exit\n");
}


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

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

LLVM IR (-O0):
@.str = [104 x i8] c"Enter your choice: \0A1 to insert an element to the list.\0A2 to delete an element from the list\0A3 to exit\0A\00"
define void @instractions() {
%1 = call i32 @printf(i8* getelementptr inbounds ([104 x i8], [104 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [103 x i8] c"Enter your choice: \0A1 to insert an element to the list.\0A2 to delete an element from the list\0A3 to exit\00"
define void @instractions() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([103 x i8], [103 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ func_a();
void func_b() { func_a(); }


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

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

LLVM IR (-O0):
define void @func_b() {
%1 = call i32 (...) @func_a()
ret void
}

LLVM IR (-O2):
define void @func_b() {
%1 = tail call i32 (...) @func_a()
ret void
}
const char *I_NoAppServicesLobbyGetUserNameAt(int idx) { return ""; }


x86 assembly (clang, -O0):
<I_NoAppServicesLobbyGetUserNameAt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    0xef2(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @I_NoAppServicesLobbyGetUserNameAt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @I_NoAppServicesLobbyGetUserNameAt(i32 %0) {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int test();
int main(int argc, char *argv[]) { return test(); }


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test()
ret i32 %3
}
const char *get_usage(void) {
  return "disnes usage:\n"
         "\t--banks        | -b <list of banks to disassemble>\n"
         "\t--bank-size    | -s <size (in bytes) of one bank (default: "
         "0x4000)>\n"
         "\t--bank-addr    | -a <starting address of output bank>\n"
         "\t--no-branches  | -q <do not print branches>\n"
         "\t--version      | -v <version>\n"
         "\t--help         | -h <aide>\n";
}


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

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

LLVM IR (-O0):
@.str = [295 x i8] c"disnes usage:\0A\09--banks | -b <list of banks to disassemble>\0A\09--bank-size | -s <size (in bytes) of one bank (default: 0x4000)>\0A\09--bank-addr | -a <starting address of output bank>\0A\09--no-branches | -q <do not print branches>\0A\09--version | -v <version>\0A\09--help | -h <aide>\0A\00"
define i8* @get_usage() {
ret i8* getelementptr inbounds ([295 x i8], [295 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [295 x i8] c"disnes usage:\0A\09--banks | -b <list of banks to disassemble>\0A\09--bank-size | -s <size (in bytes) of one bank (default: 0x4000)>\0A\09--bank-addr | -a <starting address of output bank>\0A\09--no-branches | -q <do not print branches>\0A\09--version | -v <version>\0A\09--help | -h <aide>\0A\00"
define i8* @get_usage() {
ret i8* getelementptr inbounds ([295 x i8], [295 x i8]* @.str, i64 0, i64 0)
}
void ARGBSubtractRow_NEON() {}


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

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

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

LLVM IR (-O2):
define void @ARGBSubtractRow_NEON() {
ret void
}
char *strchr(const char *string, int c) {
  while (*string) {
    if (*string == c)
      return (char *)string;
    string++;
  }
  return (char *)0;
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1146 <strchr+0x46>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    1135 <strchr+0x35>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114e <strchr+0x4e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110b <strchr+0xb>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    (%rdi),%cl
test   %cl,%cl
je     1123 <strchr+0x23>
mov    %rdi,%rax
nopl   0x0(%rax)
movsbl %cl,%ecx
cmp    %esi,%ecx
je     1125 <strchr+0x25>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %10
%6 = phi i8 [ %12, %10 ], [ %3, %2 ]
%7 = phi i8* [ %11, %10 ], [ %0, %2 ]
%8 = sext i8 %6 to i32
%9 = icmp eq i32 %8, %1
br i1 %9, label %14, label %10
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %10, %2
%15 = phi i8* [ null, %2 ], [ null, %10 ], [ %7, %5 ]
ret i8* %15
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int write_dobldobl_target_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(232, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<write_dobldobl_target_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0xe8,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_dobldobl_target_system>:
mov    $0xe8,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc@plt>

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

LLVM IR (-O2):
define i32 @write_dobldobl_target_system() {
%1 = tail call i32 @_ada_use_c2phc(i32 232, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
int test_imm_19int32_mem(int *val) {
  return ((*val) & (0x19 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_19int32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 25
%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_19int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 25
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct bufferevent {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _bufferevent_incref_and_lock(struct bufferevent *);
void bufferevent_lock(struct bufferevent *bev) {
  _bufferevent_incref_and_lock(bev);
}


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

x86 assembly (clang, -O2):
<bufferevent_lock>:
jmp    1030 <_bufferevent_incref_and_lock@plt>

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

LLVM IR (-O2):
%struct.bufferevent = type { i32 }
define void @bufferevent_lock(%struct.bufferevent* %0) {
%2 = tail call i32 @_bufferevent_incref_and_lock(%struct.bufferevent* %0)
ret void
}
void HandleButton(int x, int y, int button, int bDown) {}


x86 assembly (clang, -O0):
<HandleButton>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @HandleButton(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
define void @HandleButton(i32 %0, i32 %1, i32 %2, i32 %3) {
ret void
}
/* Variables and functions */
void *dlsym(void *, char const *);
void *lily_library_get(void *source, const char *name) {
  return dlsym(source, name);
}


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

x86 assembly (clang, -O2):
<lily_library_get>:
jmp    1030 <dlsym@plt>

LLVM IR (-O0):
define i8* @lily_library_get(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i8* @dlsym(i8* %5, i8* %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @lily_library_get(i8* %0, i8* %1) {
%3 = tail call i8* @dlsym(i8* %0, i8* %1)
ret i8* %3
}
void nop(int unused) { (void)unused; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void RNDResponseSink_AVTransport_Stop(struct UPnPService *Service,
                                      int ErrorCode, void *User) {
  printf("RND Invoke Response: AVTransport/Stop[ErrorCode:%d]()\r\n",
         ErrorCode);
}


x86 assembly (clang, -O0):
<RNDResponseSink_AVTransport_Stop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%esi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.UPnPService = type { i32 }
@.str = [56 x i8] c"RND Invoke Response: AVTransport/Stop[ErrorCode:%d]()\0D\0A\00"
define void @RNDResponseSink_AVTransport_Stop(%struct.UPnPService* %0, i32 %1, i8* %2) {
%4 = alloca %struct.UPnPService*
%5 = alloca i32
%6 = alloca i8*
store %struct.UPnPService* %0, %struct.UPnPService** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
%8 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
%struct.UPnPService = type { i32 }
@.str = [56 x i8] c"RND Invoke Response: AVTransport/Stop[ErrorCode:%d]()\0D\0A\00"
define void @RNDResponseSink_AVTransport_Stop(%struct.UPnPService* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ expand(char *, char *);
int /*<<< orphan*/ puts(char *);
int main() {
  char dest[100];
  expand("a-b-c-f0-9ABC145def0-3-6", dest);
  puts(dest);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xec6(%rip),%rdi
call   1040 <expand@plt>
lea    -0x70(%rbp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
lea    0xed4(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <expand@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"a-b-c-f0-9ABC145def0-3-6\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%4 = call i32 @expand(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%6 = call i32 @puts(i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"a-b-c-f0-9ABC145def0-3-6\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @expand(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @puts(i8* %2)
ret i32 0
}