xunge/DecIR huggingface dataset:
/* Type definitions */
struct stat {
  scalar_t__ st_size;
};

/* Variables and functions */
scalar_t__ stat(char const *, struct stat *);
extern int isempty(const char *fn) {
  struct stat buf;
  return (stat(fn, &buf) ? 0 : buf.st_size == 0);
}


x86 assembly (clang, -O0):
<isempty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
je     113d <isempty+0x2d>
xor    %eax,%eax
mov    %eax,-0x14(%rbp)
jmp    114d <isempty+0x3d>
cmpq   $0x0,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isempty>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
xor    %ecx,%ecx
or     (%rsp),%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i64 }
define i32 @isempty(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @stat(i8* %4, %struct.stat* %3)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
br label %13
8: ; preds = %1
%9 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%10 = load i64, i64* %9
%11 = icmp eq i64 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %8, %7
%14 = phi i32 [ 0, %7 ], [ %12, %8 ]
ret i32 %14
}

LLVM IR (-O2):
%struct.stat = type { i64 }
define i32 @isempty(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i64, i64* %6
%8 = icmp eq i64 %7, 0
%9 = select i1 %5, i1 %8, i1 false
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
bool leapyear(int year) {
  year -= 100;
  return (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0));
}


x86 assembly (clang, -O0):
<leapyear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x64,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    113d <leapyear+0x3d>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x5(%rbp)
jne    1151 <leapyear+0x51>
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<leapyear>:
lea    -0x64(%rdi),%ecx
test   $0x3,%dil
jne    1135 <leapyear+0x35>
movslq %ecx,%rax
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rax
add    %edx,%eax
imul   $0x64,%eax,%eax
neg    %eax
lea    (%rdi,%rax,1),%edx
add    $0xffffff9c,%edx
mov    $0x1,%eax
test   %edx,%edx
je     1135 <leapyear+0x35>
ret
imul   $0xc28f5c29,%ecx,%ecx
add    $0x51eb850,%ecx
ror    $0x4,%ecx
xor    %eax,%eax
cmp    $0xa3d70b,%ecx
setb   %al
ret

LLVM IR (-O0):
define i32 @leapyear(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 100
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = srem i32 %5, 4
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* %2
%10 = srem i32 %9, 100
%11 = icmp ne i32 %10, 0
br i1 %11, label %16, label %12
12: ; preds = %8, %1
%13 = load i32, i32* %2
%14 = srem i32 %13, 400
%15 = icmp eq i32 %14, 0
br label %16
16: ; preds = %12, %8
%17 = phi i1 [ true, %8 ], [ %15, %12 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @leapyear(i32 %0) {
%2 = add nsw i32 %0, -100
%3 = and i32 %0, 3
%4 = icmp ne i32 %3, 0
%5 = srem i32 %2, 100
%6 = icmp eq i32 %5, 0
%7 = select i1 %4, i1 true, i1 %6
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = srem i32 %2, 400
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %1, %8
%13 = phi i32 [ %11, %8 ], [ 1, %1 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage(char *argv0) { printf("Usage: %s [-u] [+format]\n", argv0); }


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Usage: %s [-u] [+format]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"Usage: %s [-u] [+format]\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exor(char const *, int, char *, int);
int tiszta_lehet(char *, int);
int exor_tores(const char kulcs[], int kulcs_meret, char titkos[],
               int titkos_meret) {
  exor(kulcs, kulcs_meret, titkos, titkos_meret);
  return tiszta_lehet(titkos, titkos_meret);
}


x86 assembly (clang, -O0):
<exor_tores>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1040 <exor@plt>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1030 <tiszta_lehet@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exor_tores>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebp
mov    %rdx,%rbx
call   1040 <exor@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <tiszta_lehet@plt>

LLVM IR (-O0):
define i32 @exor_tores(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i32 @exor(i8* %9, i32 %10, i8* %11, i32 %12)
%14 = load i8*, i8** %7
%15 = load i32, i32* %8
%16 = call i32 @tiszta_lehet(i8* %14, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @exor_tores(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @exor(i8* %0, i32 %1, i8* %2, i32 %3)
%6 = tail call i32 @tiszta_lehet(i8* %2, i32 %3)
ret i32 %6
}
void g_arith_hypot_f(void *s, void *d, void *o) {}


x86 assembly (clang, -O0):
<g_arith_hypot_f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @g_arith_hypot_f(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
define void @g_arith_hypot_f(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
ret void
}
unsigned xrop3_78_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = S ^ T;
  stk2 = D | stk3;
  stk1 = T ^ stk2;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_78_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_78_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
lea    (%rsi,%rcx,1),%edx
xor    %eax,%ecx
or     %edi,%eax
or     $0xff,%ecx
xor    %edx,%ecx
not    %eax
and    %ecx,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_78_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %6
%24 = load i32, i32* %7
%25 = xor i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %5
%27 = load i32, i32* %10
%28 = or i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %7
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = load i32, i32* %6
%34 = xor i32 %33, -1
%35 = and i32 %32, %34
%36 = load i32, i32* %5
%37 = load i32, i32* %6
%38 = and i32 %36, %37
%39 = or i32 %35, %38
ret i32 %39
}

LLVM IR (-O2):
define i32 @xrop3_78_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = or i32 %4, %3
%6 = zext i8 %1 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %6
%9 = xor i32 %7, %4
%10 = or i32 %9, 255
%11 = xor i32 %10, %8
%12 = xor i32 %5, -1
%13 = and i32 %11, %12
%14 = or i32 %13, %3
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void row_write(int table_handle, char *row, int row_size) {
  write(table_handle, row, row_size);
}


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

x86 assembly (clang, -O2):
<row_write>:
jmp    1030 <write@plt>

LLVM IR (-O0):
define void @row_write(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 = load i32, i32* %6
%10 = call i32 @write(i32 %7, i8* %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @row_write(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
ret void
}
int signed_anti_range(int min, int max) {
  extern int random_signed_value(void);
  int val = random_signed_value();
  if (min <= val && val <= max)
    val = min - 1;
  return val;
}


x86 assembly (clang, -O0):
<signed_anti_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
call   1030 <random_signed_value@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1147 <signed_anti_range+0x37>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1147 <signed_anti_range+0x37>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<signed_anti_range>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
call   1030 <random_signed_value@plt>
lea    -0x1(%rbx),%ecx
cmp    %ebp,%eax
cmovg  %eax,%ecx
cmp    %ebx,%eax
cmovge %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @signed_anti_range(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = call i32 @random_signed_value()
store i32 %6, i32* %5
%7 = load i32, i32* %3
%8 = load i32, i32* %5
%9 = icmp sle i32 %7, %8
br i1 %9, label %10, label %17
10: ; preds = %2
%11 = load i32, i32* %5
%12 = load i32, i32* %4
%13 = icmp sle i32 %11, %12
br i1 %13, label %14, label %17
14: ; preds = %10
%15 = load i32, i32* %3
%16 = sub nsw i32 %15, 1
store i32 %16, i32* %5
br label %17
17: ; preds = %14, %10, %2
%18 = load i32, i32* %5
ret i32 %18
}

LLVM IR (-O2):
define i32 @signed_anti_range(i32 %0, i32 %1) {
%3 = tail call i32 @random_signed_value()
%4 = icmp slt i32 %3, %0
%5 = icmp sgt i32 %3, %1
%6 = or i1 %4, %5
%7 = add nsw i32 %0, -1
%8 = select i1 %6, i32 %3, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ memcmp(void const *, void const *, size_t);
bool cutils_cdar_DynamicArray_unsigned_int_compare(const void *p1,
                                                   const void *p2, size_t s) {
  return !memcmp(p1, p2, s);
}


x86 assembly (clang, -O0):
<cutils_cdar_DynamicArray_unsigned_int_compare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cutils_cdar_DynamicArray_unsigned_int_compare>:
push   %rax
call   1030 <bcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @cutils_cdar_DynamicArray_unsigned_int_compare(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @memcmp(i8* %7, i8* %8, i64 %9)
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @cutils_cdar_DynamicArray_unsigned_int_compare(i8* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @bcmp(i8* %0, i8* %1, i64 %2)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
__attribute__((always_)) void *sk_atomic_cas(void **addr, void *before,
                                             void *after) {
  return __sync_val_compare_and_swap(addr, before, after);
}


x86 assembly (clang, -O0):
<sk_atomic_cas>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rdx
lock cmpxchg %rdx,(%rcx)
sete   %cl
pop    %rbp
ret

x86 assembly (clang, -O2):
<sk_atomic_cas>:
mov    %rsi,%rax
lock cmpxchg %rdx,(%rdi)
ret

LLVM IR (-O0):
define i8* @sk_atomic_cas(i8** %0, i8* %1, i8* %2) {
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i8*
store i8** %0, i8*** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8**, i8*** %4
%8 = bitcast i8** %7 to i64*
%9 = load i8*, i8** %5
%10 = ptrtoint i8* %9 to i64
%11 = load i8*, i8** %6
%12 = ptrtoint i8* %11 to i64
%13 = cmpxchg i64* %8, i64 %10, i64 %12 seq_cst seq_cst
%14 = extractvalue { i64, i1 } %13, 0
%15 = inttoptr i64 %14 to i8*
ret i8* %15
}

LLVM IR (-O2):
define i8* @sk_atomic_cas(i8** nocapture %0, i8* %1, i8* %2) {
%4 = bitcast i8** %0 to i64*
%5 = ptrtoint i8* %1 to i64
%6 = ptrtoint i8* %2 to i64
%7 = cmpxchg i64* %4, i64 %5, i64 %6 seq_cst seq_cst
%8 = extractvalue { i64, i1 } %7, 0
%9 = inttoptr i64 %8 to i8*
ret i8* %9
}
/* Variables and functions */
int bar(int);
int foo(int);
int main() { return bar(5) + foo(23); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x5,%edi
call   1030 <bar@plt>
mov    %eax,-0x8(%rbp)
mov    $0x17,%edi
call   1040 <foo@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x5,%edi
call   1030 <bar@plt>
mov    %eax,%ebx
mov    $0x17,%edi
call   1040 <foo@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @bar(i32 5)
%3 = call i32 @foo(i32 23)
%4 = add nsw i32 %2, %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @bar(i32 5)
%2 = tail call i32 @foo(i32 23)
%3 = add nsw i32 %2, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_usage(void) {
  fprintf(stderr,
          "jalfind <FILE> <ADDRESS> [ADDRESS...]\n"
          "\n"
          "jalfind v"
          "0.1"
          ": search for MIPS JAL, LUI/ADDIU, and direct references in a file\n"
          "\n"
          "Arguments:\n"
          " FILE       input ROM file\n"
          " ADDRESS    address to find references to (assumes hex)\n");
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [213 x i8] c"jalfind <FILE> <ADDRESS> [ADDRESS...]\0A\0Ajalfind v0.1: search for MIPS JAL, LUI/ADDIU, and direct references in a file\0A\0AArguments:\0A FILE input ROM file\0A ADDRESS address to find references to (assumes hex)\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([213 x i8], [213 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [213 x i8] c"jalfind <FILE> <ADDRESS> [ADDRESS...]\0A\0Ajalfind v0.1: search for MIPS JAL, LUI/ADDIU, and direct references in a file\0A\0AArguments:\0A FILE input ROM file\0A ADDRESS address to find references to (assumes hex)\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([213 x i8], [213 x i8]* @.str, i64 0, i64 0))
ret void
}
void __attribute__((constructor)) mylib1_init(void) {
  printf("Init function %s\n", __FUNCTION__);
}


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

x86 assembly (clang, -O2):
<mylib1_init>:
lea    0xee9(%rip),%rdi
lea    0xef4(%rip),%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Init function %s\0A\00"
@__FUNCTION__.mylib1_init = [12 x i8] c"mylib1_init\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @mylib1_init, i8* null }]
define void @mylib1_init() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__FUNCTION__.mylib1_init, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"Init function %s\0A\00"
@__FUNCTION__.mylib1_init = [12 x i8] c"mylib1_init\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @mylib1_init, i8* null }]
define void @mylib1_init() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__FUNCTION__.mylib1_init, i64 0, i64 0))
ret void
}
unsigned xrop3_111_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D ^ S;
  stk2 = ~stk2;
  stk1 = T & stk2;
  stk1 = ~stk1;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_111_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_111_0_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
xor    $0xffffff00,%eax
and    %ecx,%eax
not    %eax
ret

LLVM IR (-O0):
define i32 @xrop3_111_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %6
%24 = xor i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %9
%26 = xor i32 %25, -1
store i32 %26, i32* %9
%27 = load i32, i32* %7
%28 = load i32, i32* %9
%29 = and i32 %27, %28
store i32 %29, i32* %8
%30 = load i32, i32* %8
%31 = xor i32 %30, -1
store i32 %31, i32* %8
%32 = load i32, i32* %8
ret i32 %32
}

LLVM IR (-O2):
define i32 @xrop3_111_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %4, -256
%8 = and i32 %6, %7
%9 = xor i32 %8, -1
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int /*<<< orphan*/ ntohs(int /*<<< orphan*/);
int16_t minipack_unpack_int16(void *ptr, size_t *sz) {
  *sz = 3;
  return ntohs(*((int16_t *)(ptr + 1)));
}


x86 assembly (clang, -O0):
<minipack_unpack_int16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movq   $0x3,(%rax)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%edi
call   1030 <ntohs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<minipack_unpack_int16>:
movq   $0x3,(%rsi)
mov    0x1(%rdi),%edi
jmp    1030 <ntohs@plt>

LLVM IR (-O0):
define i32 @minipack_unpack_int16(i8* %0, i64* %1) {
%3 = alloca i8*
%4 = alloca i64*
store i8* %0, i8** %3
store i64* %1, i64** %4
%5 = load i64*, i64** %4
store i64 3, i64* %5
%6 = load i8*, i8** %3
%7 = getelementptr i8, i8* %6, i64 1
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
%10 = call i32 @ntohs(i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @minipack_unpack_int16(i8* nocapture %0, i64* nocapture writeonly %1) {
store i64 3, i64* %1
%3 = getelementptr i8, i8* %0, i64 1
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = tail call i32 @ntohs(i32 %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ digitalWrite(int, int /*<<< orphan*/);
int /*<<< orphan*/ pinMode(int, int);
int /*<<< orphan*/ pioInit();
int main() {
  pioInit();
  pinMode(22, 1);
  digitalWrite(22, 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <pioInit@plt>
mov    $0x16,%edi
mov    $0x1,%esi
call   1050 <pinMode@plt>
mov    $0x16,%edi
xor    %esi,%esi
call   1030 <digitalWrite@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <pioInit@plt>
mov    $0x16,%edi
mov    $0x1,%esi
call   1050 <pinMode@plt>
mov    $0x16,%edi
xor    %esi,%esi
call   1030 <digitalWrite@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @pioInit()
%2 = call i32 @pinMode(i32 22, i32 1)
%3 = call i32 @digitalWrite(i32 22, i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @pioInit()
%2 = tail call i32 @pinMode(i32 22, i32 1)
%3 = tail call i32 @digitalWrite(i32 22, i32 0)
ret i32 0
}
double pathconN_nm10_sign(double x) { return x < 0 ? -1 : x > 0 ? 1 : x; }


x86 assembly (clang, -O0):
<pathconN_nm10_sign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1129 <pathconN_nm10_sign+0x29>
movsd  0xee9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1161 <pathconN_nm10_sign+0x61>
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    114d <pathconN_nm10_sign+0x4d>
movsd  0xebd(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1157 <pathconN_nm10_sign+0x57>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathconN_nm10_sign>:
xorpd  %xmm1,%xmm1
xorpd  %xmm2,%xmm2
cmpltsd %xmm0,%xmm2
movsd  0xeeb(%rip),%xmm3
andpd  %xmm2,%xmm3
andnpd %xmm0,%xmm2
orpd   %xmm3,%xmm2
cmpltsd %xmm1,%xmm0
movapd %xmm0,%xmm1
andnpd %xmm2,%xmm1
movsd  0xed2(%rip),%xmm2
andpd  %xmm2,%xmm0
orpd   %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @pathconN_nm10_sign(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %6
5: ; preds = %1
br label %14
6: ; preds = %1
%7 = load double, double* %2
%8 = fcmp ogt double %7, 0.000000e+00
br i1 %8, label %9, label %10
9: ; preds = %6
br label %12
10: ; preds = %6
%11 = load double, double* %2
br label %12
12: ; preds = %10, %9
%13 = phi double [ 1.000000e+00, %9 ], [ %11, %10 ]
br label %14
14: ; preds = %12, %5
%15 = phi double [ -1.000000e+00, %5 ], [ %13, %12 ]
ret double %15
}

LLVM IR (-O2):
define double @pathconN_nm10_sign(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fcmp ogt double %0, 0.000000e+00
%4 = select i1 %3, double 1.000000e+00, double %0
%5 = select i1 %2, double -1.000000e+00, double %4
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void ctrl_c_handler() {
  printf("\nIs-server ġie maqtul.\n");
  exit(0);
}


x86 assembly (clang, -O0):
<ctrl_c_handler>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<ctrl_c_handler>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"\0AIs-server \C4\A1ie maqtul.\0A\00"
define void @ctrl_c_handler() {
%1 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [24 x i8] c"\0AIs-server \C4\A1ie maqtul.\00"
define void @ctrl_c_handler() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
unsigned xrop3_169_0_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = T | S;
  stk1 = D ^ stk2;
  stk1 = ~stk1;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


x86 assembly (clang, -O0):
<xrop3_169_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_169_0_1>:
mov    %edi,%eax
shl    $0x8,%eax
lea    (%rax,%rdi,1),%r8d
mov    %esi,%edx
shl    $0x8,%edx
or     %esi,%edx
mov    %edx,%ecx
or     %r8d,%ecx
xor    $0xffffff00,%ecx
xor    %r8d,%eax
not    %edx
and    %ecx,%edx
not    %edi
and    %esi,%edi
or     %edi,%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_169_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %7
%23 = load i32, i32* %6
%24 = or i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %5
%26 = load i32, i32* %9
%27 = xor i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = xor i32 %28, -1
store i32 %29, i32* %8
%30 = load i32, i32* %8
%31 = load i32, i32* %6
%32 = and i32 %30, %31
%33 = load i32, i32* %8
%34 = load i32, i32* %7
%35 = xor i32 %34, -1
%36 = and i32 %33, %35
%37 = or i32 %32, %36
%38 = load i32, i32* %7
%39 = load i32, i32* %6
%40 = xor i32 %39, -1
%41 = and i32 %38, %40
%42 = load i32, i32* %5
%43 = and i32 %41, %42
%44 = or i32 %37, %43
ret i32 %44
}

LLVM IR (-O2):
define i32 @xrop3_169_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = or i32 %4, %3
%6 = zext i8 %1 to i32
%7 = mul nuw nsw i32 %6, 257
%8 = or i32 %7, %5
%9 = xor i32 %8, -256
%10 = xor i32 %5, %4
%11 = xor i32 %7, -1
%12 = and i32 %9, %11
%13 = xor i32 %3, -1
%14 = and i32 %13, %6
%15 = or i32 %14, %10
%16 = or i32 %15, %12
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void module1_hello() { printf("module1_hello()\n"); }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ q_sort(struct alignment *, int /*<<< orphan*/, int);
void quickSort(struct alignment *aln, int array_size) {
  q_sort(aln, 0, array_size - 1);
}


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

x86 assembly (clang, -O2):
<quickSort>:
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <q_sort@plt>

LLVM IR (-O0):
%struct.alignment = type { i32 }
define void @quickSort(%struct.alignment* %0, i32 %1) {
%3 = alloca %struct.alignment*
%4 = alloca i32
store %struct.alignment* %0, %struct.alignment** %3
store i32 %1, i32* %4
%5 = load %struct.alignment*, %struct.alignment** %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %6, 1
%8 = call i32 @q_sort(%struct.alignment* %5, i32 0, i32 %7)
ret void
}

LLVM IR (-O2):
%struct.alignment = type { i32 }
define void @quickSort(%struct.alignment* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i32 @q_sort(%struct.alignment* %0, i32 0, i32 %3)
ret void
}
/* Variables and functions */
int log_open_console();
int log_open(void) { return log_open_console(); }


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

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

LLVM IR (-O0):
define i32 @log_open() {
%1 = call i32 (...) @log_open_console()
ret i32 %1
}

LLVM IR (-O2):
define i32 @log_open() {
%1 = tail call i32 (...) @log_open_console()
ret i32 %1
}
/* Variables and functions */
size_t strbuf_len(char **buf) {
  size_t len, i;
  len = 0;
  for (i = 0; buf[i] != NULL; ++i)
    ++len;
  return len;
}


x86 assembly (clang, -O0):
<strbuf_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1148 <strbuf_len+0x48>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1118 <strbuf_len+0x18>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strbuf_len>:
cmpq   $0x0,(%rdi)
je     1120 <strbuf_len+0x20>
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rax
cmpq   $0x0,0x8(%rdi,%rcx,8)
mov    %rax,%rcx
jne    1110 <strbuf_len+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @strbuf_len(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %10, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %6, %4 ], [ 0, %1 ]
%6 = add i64 %5, 1
%7 = getelementptr inbounds i8*, i8** %0, i64 %6
%8 = load i8*, i8** %7
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %4
10: ; preds = %4, %1
%11 = phi i64 [ 0, %1 ], [ %6, %4 ]
ret i64 %11
}
/* Variables and functions */
__attribute__((weak)) void rgblight_step_reverse(void) {}


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

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

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

LLVM IR (-O2):
define weak void @rgblight_step_reverse() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ execve(char *, char **, int /*<<< orphan*/);
int main() {
  char *a[] = {"/bin/ls", "-aR", "/", 0};
  execve(*a, a, 0);
}


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"/bin/ls\00"
@.str.1 = [4 x i8] c"-aR\00"
@.str.2 = [2 x i8] c"/\00"
@__const.main.a = [4 x i8*] [i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i32 0, i32 0), i8* null]
define i32 @main() {
%1 = alloca [4 x i8*]
%2 = bitcast [4 x i8*]* %1 to i8*
%3 = getelementptr inbounds [4 x i8*], [4 x i8*]* %1, i64 0, i64 0
%4 = call i32 @execve(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %3, i32 0)
ret i32 0
}
/* Variables and functions */
int recv(int const, char *, int, int /*<<< orphan*/);
int read_socket(char *buf, int len, const int sockfd) {
  return recv(sockfd, buf, len, 0);
}


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

x86 assembly (clang, -O2):
<read_socket>:
mov    %edx,%eax
mov    %esi,%edx
mov    %rdi,%rsi
mov    %eax,%edi
xor    %ecx,%ecx
jmp    1030 <recv@plt>

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

LLVM IR (-O2):
define i32 @read_socket(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @recv(i32 %2, i8* %0, i32 %1, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ postMessage(int /*<<< orphan*/, int, int /*<<< orphan*/);
void clearScreen() { postMessage(0, 3, 0); }


x86 assembly (clang, -O0):
<clearScreen>:
push   %rbp
mov    %rsp,%rbp
xor    %edx,%edx
mov    $0x3,%esi
mov    %edx,%edi
call   1030 <postMessage@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearScreen>:
xor    %edi,%edi
mov    $0x3,%esi
xor    %edx,%edx
jmp    1030 <postMessage@plt>

LLVM IR (-O0):
define void @clearScreen() {
%1 = call i32 @postMessage(i32 0, i32 3, i32 0)
ret void
}

LLVM IR (-O2):
define void @clearScreen() {
%1 = tail call i32 @postMessage(i32 0, i32 3, i32 0)
ret void
}
long double test_sinl(long double x) { return __builtin_sinl(x); }


x86 assembly (clang, -O0):
<test_sinl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <sinl@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_sinl>:
jmp    1030 <sinl@plt>

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

LLVM IR (-O2):
define x86_fp80 @test_sinl(x86_fp80 %0) {
%2 = tail call x86_fp80 @sinl(x86_fp80 %0)
ret x86_fp80 %2
}
void genlwr() {}


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

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

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

LLVM IR (-O2):
define void @genlwr() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ConvertOverToFrac(char **);
int /*<<< orphan*/ ConvertString(char *);
int EquationNeedsFields(char *);
int /*<<< orphan*/ FinishRtfEquation(int, int);
int /*<<< orphan*/ PrepareRtfEquation(int, int);
void WriteEquationAsRTF(int code, char **eq) {
  int EQ_Needed;
  EQ_Needed = EquationNeedsFields(*eq);
  PrepareRtfEquation(code, EQ_Needed);
  ConvertOverToFrac(eq);
  ConvertString(*eq);
  FinishRtfEquation(code, EQ_Needed);
}


x86 assembly (clang, -O0):
<WriteEquationAsRTF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <EquationNeedsFields@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1030 <PrepareRtfEquation@plt>
mov    -0x10(%rbp),%rdi
call   1070 <ConvertOverToFrac@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1050 <ConvertString@plt>
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1060 <FinishRtfEquation@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteEquationAsRTF>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%r14d
mov    (%rsi),%rdi
call   1040 <EquationNeedsFields@plt>
mov    %eax,%ebp
mov    %r14d,%edi
mov    %eax,%esi
call   1030 <PrepareRtfEquation@plt>
mov    %rbx,%rdi
call   1070 <ConvertOverToFrac@plt>
mov    (%rbx),%rdi
call   1050 <ConvertString@plt>
mov    %r14d,%edi
mov    %ebp,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1060 <FinishRtfEquation@plt>

LLVM IR (-O0):
define void @WriteEquationAsRTF(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = load i8**, i8*** %4
%7 = load i8*, i8** %6
%8 = call i32 @EquationNeedsFields(i8* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %3
%10 = load i32, i32* %5
%11 = call i32 @PrepareRtfEquation(i32 %9, i32 %10)
%12 = load i8**, i8*** %4
%13 = call i32 @ConvertOverToFrac(i8** %12)
%14 = load i8**, i8*** %4
%15 = load i8*, i8** %14
%16 = call i32 @ConvertString(i8* %15)
%17 = load i32, i32* %3
%18 = load i32, i32* %5
%19 = call i32 @FinishRtfEquation(i32 %17, i32 %18)
ret void
}

LLVM IR (-O2):
define void @WriteEquationAsRTF(i32 %0, i8** %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @EquationNeedsFields(i8* %3)
%5 = tail call i32 @PrepareRtfEquation(i32 %0, i32 %4)
%6 = tail call i32 @ConvertOverToFrac(i8** %1)
%7 = load i8*, i8** %1
%8 = tail call i32 @ConvertString(i8* %7)
%9 = tail call i32 @FinishRtfEquation(i32 %0, i32 %4)
ret void
}
void c_pomp_task_end_(struct ompregdescr *r) { (void)0; }


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

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

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

LLVM IR (-O2):
%struct.ompregdescr = type opaque
define void @c_pomp_task_end_(%struct.ompregdescr* nocapture %0) {
ret void
}
/* Type definitions */
struct data {
  int dummy;
};

/* Variables and functions */
unsigned int eat1(char *p, char *s,
                  unsigned int (*c)(char *, char *, struct data *,
                                    unsigned int),
                  struct data *d, unsigned int o) {
  return c(p, s + (o ? 1 : 0), d, o);
}


x86 assembly (clang, -O0):
<eat1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x24(%rbp),%r8d
xor    %ecx,%ecx
mov    $0x1,%edx
cmp    $0x0,%r8d
cmovne %edx,%ecx
movslq %ecx,%rcx
add    %rcx,%rsi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
call   *%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eat1>:
mov    %rdx,%rax
cmp    $0x1,%r8d
sbb    $0xffffffffffffffff,%rsi
mov    %rcx,%rdx
mov    %r8d,%ecx
jmp    *%rax

LLVM IR (-O0):
%struct.data = type { i32 }
define i32 @eat1(i8* %0, i8* %1, i32 (i8*, i8*, %struct.data*, i32)* %2, %struct.data* %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32 (i8*, i8*, %struct.data*, i32)*
%9 = alloca %struct.data*
%10 = alloca i32
store i8* %0, i8** %6
store i8* %1, i8** %7
store i32 (i8*, i8*, %struct.data*, i32)* %2, i32 (i8*, i8*, %struct.data*, i32)** %8
store %struct.data* %3, %struct.data** %9
store i32 %4, i32* %10
%11 = load i32 (i8*, i8*, %struct.data*, i32)*, i32 (i8*, i8*, %struct.data*, i32)** %8
%12 = load i8*, i8** %6
%13 = load i8*, i8** %7
%14 = load i32, i32* %10
%15 = icmp ne i32 %14, 0
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 1, i32 0
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %13, i64 %18
%20 = load %struct.data*, %struct.data** %9
%21 = load i32, i32* %10
%22 = call i32 %11(i8* %12, i8* %19, %struct.data* %20, i32 %21)
ret i32 %22
}

LLVM IR (-O2):
%struct.data = type { i32 }
define i32 @eat1(i8* %0, i8* %1, i32 (i8*, i8*, %struct.data*, i32)* nocapture %2, %struct.data* %3, i32 %4) {
%6 = icmp ne i32 %4, 0
%7 = zext i1 %6 to i64
%8 = getelementptr inbounds i8, i8* %1, i64 %7
%9 = tail call i32 %2(i8* %0, i8* %8, %struct.data* %3, i32 %4)
ret i32 %9
}
/* Variables and functions */
int isblank(int);
bool invalidFunctionArgBool_isblank(bool b, int c) {
  (void)isblank(b);
  return isblank(c != 0);
}


x86 assembly (clang, -O0):
<invalidFunctionArgBool_isblank>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <isblank@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<invalidFunctionArgBool_isblank>:
xor    %edi,%edi
test   %esi,%esi
setne  %dil
jmp    1030 <isblank@plt>

LLVM IR (-O0):
define i32 @invalidFunctionArgBool_isblank(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 = call i32 @isblank(i32 %5)
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i32
%10 = call i32 @isblank(i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @invalidFunctionArgBool_isblank(i32 %0, i32 %1) {
%3 = icmp ne i32 %1, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @isblank(i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ link_error1();
void test4(int x, int y) {
  if ((x == y) || (x != y)) {
  } else
    link_error1();
}


x86 assembly (clang, -O0):
<test4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     1136 <test4+0x26>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     113b <test4+0x2b>
jmp    1142 <test4+0x32>
mov    $0x0,%al
call   1030 <link_error1@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test4(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 eq i32 %5, %6
br i1 %7, label %12, label %8
8: ; preds = %2
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = icmp ne i32 %9, %10
br i1 %11, label %12, label %13
12: ; preds = %8, %2
br label %15
13: ; preds = %8
%14 = call i32 (...) @link_error1()
br label %15
15: ; preds = %13, %12
ret void
}

LLVM IR (-O2):
define void @test4(i32 %0, i32 %1) {
ret void
}