xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned long cfs_time_add(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ cfs_time_current();
int /*<<< orphan*/ cfs_time_seconds(int);
unsigned long cfs_time_shift(int seconds) {
  return cfs_time_add(cfs_time_current(), cfs_time_seconds(seconds));
}


x86 assembly (clang, -O0):
<cfs_time_shift>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <cfs_time_current@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <cfs_time_seconds@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1050 <cfs_time_add@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cfs_time_shift>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <cfs_time_current@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <cfs_time_seconds@plt>
mov    %ebp,%edi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <cfs_time_add@plt>

LLVM IR (-O0):
define i64 @cfs_time_shift(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @cfs_time_current()
%4 = load i32, i32* %2
%5 = call i32 @cfs_time_seconds(i32 %4)
%6 = call i64 @cfs_time_add(i32 %3, i32 %5)
ret i64 %6
}

LLVM IR (-O2):
define i64 @cfs_time_shift(i32 %0) {
%2 = tail call i32 (...) @cfs_time_current()
%3 = tail call i32 @cfs_time_seconds(i32 %0)
%4 = tail call i64 @cfs_time_add(i32 %2, i32 %3)
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef void const *b;
typedef void *a;

/* Variables and functions */
int /*<<< orphan*/ cpy5(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int cpy8(void *, void const *);
void cpy13(void *a, const void *b) {
  cpy8(a, b), cpy5((uint8_t *)a + 8, (uint8_t *)b + 8);
}


x86 assembly (clang, -O0):
<cpy13>:
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 <cpy8@plt>
mov    -0x8(%rbp),%rdi
add    $0x20,%rdi
mov    -0x10(%rbp),%rsi
add    $0x20,%rsi
call   1040 <cpy5@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpy13>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <cpy8@plt>
add    $0x20,%rbx
add    $0x20,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <cpy5@plt>

LLVM IR (-O0):
define void @cpy13(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 i32 @cpy8(i8* %5, i8* %6)
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to i32*
%10 = getelementptr inbounds i32, i32* %9, i64 8
%11 = load i8*, i8** %4
%12 = bitcast i8* %11 to i32*
%13 = getelementptr inbounds i32, i32* %12, i64 8
%14 = call i32 @cpy5(i32* %10, i32* %13)
ret void
}

LLVM IR (-O2):
define void @cpy13(i8* %0, i8* %1) {
%3 = tail call i32 @cpy8(i8* %0, i8* %1)
%4 = getelementptr inbounds i8, i8* %0, i64 32
%5 = bitcast i8* %4 to i32*
%6 = getelementptr inbounds i8, i8* %1, i64 32
%7 = bitcast i8* %6 to i32*
%8 = tail call i32 @cpy5(i32* %5, i32* %7)
ret void
}
/* Variables and functions */
void putc(unsigned char ch) {
  while (!((*(volatile unsigned char *)0x50000010) & (1 << 2)))
    ;
  (*(volatile unsigned char *)0x50000020) = ch;
}


x86 assembly (clang, -O0):
<putc>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x50000010,%eax
mov    (%rax),%al
movzbl %al,%eax
and    $0x4,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    112c <putc+0x2c>
jmp    1131 <putc+0x31>
jmp    110a <putc+0xa>
mov    -0x1(%rbp),%cl
mov    $0x50000020,%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<putc>:
testb  $0x4,0x50000010
04
je     1100 <putc>
mov    %dil,0x50000020
50
ret

LLVM IR (-O0):
define void @putc(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
br label %3
3: ; preds = %9, %1
%4 = load volatile i8, i8* inttoptr (i64 1342177296 to i8*)
%5 = zext i8 %4 to i32
%6 = and i32 %5, 4
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
br i1 %8, label %9, label %10
9: ; preds = %3
br label %3
10: ; preds = %3
%11 = load i8, i8* %2
store volatile i8 %11, i8* inttoptr (i64 1342177312 to i8*)
ret void
}

LLVM IR (-O2):
define void @putc(i8 zeroext %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i8, i8* inttoptr (i64 1342177296 to i8*)
%4 = and i8 %3, 4
%5 = icmp eq i8 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
store volatile i8 %0, i8* inttoptr (i64 1342177312 to i8*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void subfile() { printf("subdir file\n"); }


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"subdir file\00"
define void @subfile() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ eFree(void *);
void deleteChar(void *c) { eFree(c); }


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

x86 assembly (clang, -O2):
<deleteChar>:
jmp    1030 <eFree@plt>

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

LLVM IR (-O2):
define void @deleteChar(i8* %0) {
%2 = tail call i32 @eFree(i8* %0)
ret void
}
unsigned xrop3_91_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 | D;
  stk3 = ~stk3;
  stk2 = T | stk3;
  stk1 = D ^ stk2;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_91_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
or     -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%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_91_1_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
lea    (%rcx,%rdi,1),%eax
mov    %esi,%edx
shl    $0x8,%edx
or     %esi,%edx
xor    $0xffffff00,%ecx
or     %edx,%ecx
xor    $0xff,%ecx
not    %eax
and    %ecx,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_91_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* %5
%25 = or i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %10
%27 = xor i32 %26, -1
store i32 %27, i32* %10
%28 = load i32, i32* %7
%29 = load i32, i32* %10
%30 = or i32 %28, %29
store i32 %30, i32* %9
%31 = load i32, i32* %5
%32 = load i32, i32* %9
%33 = xor i32 %31, %32
store i32 %33, i32* %8
%34 = load i32, i32* %8
%35 = load i32, i32* %6
%36 = xor i32 %35, -1
%37 = and i32 %34, %36
%38 = load i32, i32* %5
%39 = load i32, i32* %6
%40 = and i32 %38, %39
%41 = or i32 %37, %40
ret i32 %41
}

LLVM IR (-O2):
define i32 @xrop3_91_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 = mul nuw nsw i32 %6, 257
%8 = xor i32 %4, -256
%9 = or i32 %7, %8
%10 = xor i32 %9, 255
%11 = xor i32 %5, -1
%12 = and i32 %10, %11
%13 = or i32 %12, %3
ret i32 %13
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
uint64_t ROL64_11(uint64_t x) {
  __asm__("rolq $11, %0" : "=r"(x) : "0"(x));
  return x;
}


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

x86 assembly (clang, -O2):
<ROL64_11>:
mov    %rdi,%rax
rol    $0xb,%rax
ret

LLVM IR (-O0):
define i8* @ROL64_11(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* asm "rolq $$11, $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
define i8* @ROL64_11(i8* readnone %0) {
%2 = tail call i8* asm "rolq $$11, $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
/* Type definitions */
typedef char *uint16_t;

/* Variables and functions */
uint16_t inw(uint16_t port) {
  uint16_t tmp;
  __asm__ __volatile__("in %%dx, %%ax" : "=a"(tmp) : "d"(port));
  return tmp;
}


x86 assembly (clang, -O0):
<inw>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
in     (%dx),%ax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inw>:
mov    %rdi,%rdx
in     (%dx),%ax
ret

LLVM IR (-O0):
define i8* @inw(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* asm sideeffect "in %dx, %ax", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
define i8* @inw(i8* %0) {
%2 = tail call i8* asm sideeffect "in %dx, %ax", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
void rte_wmb(void) { __sync_synchronize(); }


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

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

LLVM IR (-O0):
define void @rte_wmb() {
fence seq_cst
ret void
}

LLVM IR (-O2):
define void @rte_wmb() {
fence seq_cst
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ FN_double_lock_bad(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_mutex_init(int /*<<< orphan*/ *, int /*<<< orphan*/);
void double_lock_bad2() {
  pthread_mutex_t m;
  pthread_mutex_init(&m, 0);
  FN_double_lock_bad(&m);
}


x86 assembly (clang, -O0):
<double_lock_bad2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
xor    %esi,%esi
call   1040 <pthread_mutex_init@plt>
lea    -0x4(%rbp),%rdi
call   1030 <FN_double_lock_bad@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_lock_bad2>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <pthread_mutex_init@plt>
mov    %rbx,%rdi
call   1030 <FN_double_lock_bad@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @double_lock_bad2() {
%1 = alloca i32
%2 = call i32 @pthread_mutex_init(i32* %1, i32 0)
%3 = call i32 @FN_double_lock_bad(i32* %1)
ret void
}

LLVM IR (-O2):
define void @double_lock_bad2() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @pthread_mutex_init(i32* %1, i32 0)
%4 = call i32 @FN_double_lock_bad(i32* %1)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ default_char;
};
typedef TYPE_1__ XFontStruct;

/* Variables and functions */
unsigned get_XFontStruct_default_char(void *_p) {
  return (unsigned)((XFontStruct *)_p)->default_char;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define i32 @get_XFontStruct_default_char(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @get_XFontStruct_default_char(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
int cairo_code_draw_casDLabel_get_width() { return 7; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_casDLabel_get_width() {
ret i32 7
}

LLVM IR (-O2):
define i32 @cairo_code_draw_casDLabel_get_width() {
ret i32 7
}
/* Variables and functions */
int mem_read32(unsigned char *);
int get_document_offset_begin(unsigned char *signature_header_vals) {
  return mem_read32(signature_header_vals + (4 * 4));
}


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

x86 assembly (clang, -O2):
<get_document_offset_begin>:
add    $0x10,%rdi
jmp    1030 <mem_read32@plt>

LLVM IR (-O0):
define i32 @get_document_offset_begin(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 16
%5 = call i32 @mem_read32(i8* %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @get_document_offset_begin(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 16
%3 = tail call i32 @mem_read32(i8* %2)
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t be32(uint32_t x) {
  return ((x & 0x000000ff) << 24) | ((x & 0x0000FF00) << 8) |
         ((x & 0x00FF0000) >> 8) | ((x & 0xFF000000) >> 24);
}


x86 assembly (clang, -O0):
<be32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
shl    $0x18,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff0000,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff000000,%ecx
shr    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @be32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = shl i32 %4, 24
%6 = load i32, i32* %2
%7 = and i32 %6, 65280
%8 = shl i32 %7, 8
%9 = or i32 %5, %8
%10 = load i32, i32* %2
%11 = and i32 %10, 16711680
%12 = ashr i32 %11, 8
%13 = or i32 %9, %12
%14 = load i32, i32* %2
%15 = and i32 %14, -16777216
%16 = lshr i32 %15, 24
%17 = or i32 %13, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @be32(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int);
void add(void **list, void *item, int position, int max_n) {
  if (position < (max_n - 1)) {
    list[position] = item;
  } else {
    printf("add reached maximum items (%d)\n", max_n);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x18(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    115c <add+0x3c>
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
jmp    1175 <add+0x55>
mov    -0x18(%rbp),%esi
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add>:
push   %rax
lea    -0x1(%rcx),%eax
cmp    %edx,%eax
jle    1131 <add+0x11>
movslq %edx,%rax
mov    %rsi,(%rdi,%rax,8)
pop    %rax
ret
lea    0xec8(%rip),%rdi
mov    %ecx,%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"add reached maximum items (%d)\0A\00"
define void @add(i8** %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8** %0, i8*** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %7
%10 = load i32, i32* %8
%11 = sub nsw i32 %10, 1
%12 = icmp slt i32 %9, %11
br i1 %12, label %13, label %19
13: ; preds = %4
%14 = load i8*, i8** %6
%15 = load i8**, i8*** %5
%16 = load i32, i32* %7
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8*, i8** %15, i64 %17
store i8* %14, i8** %18
br label %23
19: ; preds = %4
%20 = load i32, i32* %8
%21 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %20)
%22 = call i32 @exit(i32 1)
unreachable
23: ; preds = %13
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"add reached maximum items (%d)\0A\00"
define void @add(i8** nocapture writeonly %0, i8* %1, i32 %2, i32 %3) {
%5 = add nsw i32 %3, -1
%6 = icmp sgt i32 %5, %2
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = sext i32 %2 to i64
%9 = getelementptr inbounds i8*, i8** %0, i64 %8
store i8* %1, i8** %9
ret void
10: ; preds = %4
%11 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %3)
%12 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct iio_context {
  int dummy;
};

/* Variables and functions */
struct iio_context *iio_create_local_context();
struct iio_context *iio_create_default_context(void) {
  return iio_create_local_context();
}


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

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

LLVM IR (-O0):
%struct.iio_context = type { i32 }
define %struct.iio_context* @iio_create_default_context() {
%1 = call %struct.iio_context* (...) @iio_create_local_context()
ret %struct.iio_context* %1
}

LLVM IR (-O2):
%struct.iio_context = type { i32 }
define %struct.iio_context* @iio_create_default_context() {
%1 = tail call %struct.iio_context* (...) @iio_create_local_context()
ret %struct.iio_context* %1
}
void set_creation_args(a) long *a;
{}


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

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

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

LLVM IR (-O2):
define void @set_creation_args(i64* nocapture %0) {
ret void
}
int test_imm_05uint32_mem(unsigned int *val) {
  return ((*val) & (0x05 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_05uint32_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, 5
%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_05uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 5
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void cli() { asm volatile("cli"); }


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

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

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

LLVM IR (-O2):
define void @cli() {
tail call void asm sideeffect "cli", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
struct vec2 {
  int dummy;
};

/* Variables and functions */
float vec2_angle(float *);
__attribute__((always_)) float psvec2_angle(struct vec2 *a) {
  return vec2_angle((float *)a);
}


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

x86 assembly (clang, -O2):
<psvec2_angle>:
jmp    1030 <vec2_angle@plt>

LLVM IR (-O0):
%struct.vec2 = type { i32 }
define float @psvec2_angle(%struct.vec2* %0) {
%2 = alloca %struct.vec2*
store %struct.vec2* %0, %struct.vec2** %2
%3 = load %struct.vec2*, %struct.vec2** %2
%4 = bitcast %struct.vec2* %3 to float*
%5 = call float @vec2_angle(float* %4)
ret float %5
}

LLVM IR (-O2):
%struct.vec2 = type { i32 }
define float @psvec2_angle(%struct.vec2* %0) {
%2 = bitcast %struct.vec2* %0 to float*
%3 = tail call float @vec2_angle(float* %2)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ timer_start();
int timer_stop();
int timer_restart(void) {
  int elapsed = timer_stop();
  timer_start();
  return elapsed;
}


x86 assembly (clang, -O0):
<timer_restart>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <timer_stop@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <timer_start@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_restart>:
push   %rbx
xor    %eax,%eax
call   1030 <timer_stop@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <timer_start@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @timer_restart() {
%1 = alloca i32
%2 = call i32 (...) @timer_stop()
store i32 %2, i32* %1
%3 = call i32 (...) @timer_start()
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @timer_restart() {
%1 = tail call i32 (...) @timer_stop()
%2 = tail call i32 (...) @timer_start()
ret i32 %1
}
int double_compare(const void *a, const void *b) {
  double A = *((double *)a);
  double B = *((double *)b);
  if (A > B)
    return 1;
  else if (A < B)
    return -1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<double_compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jbe    1142 <double_compare+0x42>
movl   $0x1,-0x4(%rbp)
jmp    1169 <double_compare+0x69>
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1162 <double_compare+0x62>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <double_compare+0x69>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_compare>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
seta   %cl
neg    %ecx
ucomisd %xmm1,%xmm0
mov    $0x1,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @double_compare(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca double
%7 = alloca double
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to double*
%10 = load double, double* %9
store double %10, double* %6
%11 = load i8*, i8** %5
%12 = bitcast i8* %11 to double*
%13 = load double, double* %12
store double %13, double* %7
%14 = load double, double* %6
%15 = load double, double* %7
%16 = fcmp ogt double %14, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 1, i32* %3
br label %24
18: ; preds = %2
%19 = load double, double* %6
%20 = load double, double* %7
%21 = fcmp olt double %19, %20
br i1 %21, label %22, label %23
22: ; preds = %18
store i32 -1, i32* %3
br label %24
23: ; preds = %18
store i32 0, i32* %3
br label %24
24: ; preds = %23, %22, %17
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @double_compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp ogt double %4, %6
%8 = fcmp olt double %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
/* Type definitions */
struct lnch_ctxt {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fork();
int /*<<< orphan*/ lnch_feature_child_exec(struct lnch_ctxt const *const);
void lnch_feature_child_key_spawn(struct lnch_ctxt const *const p_ctxt) {
  if (!fork()) {
    lnch_feature_child_exec(p_ctxt);
  }
}


x86 assembly (clang, -O0):
<lnch_feature_child_key_spawn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <fork@plt>
cmp    $0x0,%eax
jne    1145 <lnch_feature_child_key_spawn+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <lnch_feature_child_exec@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lnch_feature_child_key_spawn>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <fork@plt>
test   %eax,%eax
je     1131 <lnch_feature_child_key_spawn+0x11>
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <lnch_feature_child_exec@plt>

LLVM IR (-O0):
%struct.lnch_ctxt = type { i32 }
define void @lnch_feature_child_key_spawn(%struct.lnch_ctxt* %0) {
%2 = alloca %struct.lnch_ctxt*
store %struct.lnch_ctxt* %0, %struct.lnch_ctxt** %2
%3 = call i32 (...) @fork()
%4 = icmp ne i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load %struct.lnch_ctxt*, %struct.lnch_ctxt** %2
%7 = call i32 @lnch_feature_child_exec(%struct.lnch_ctxt* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
%struct.lnch_ctxt = type { i32 }
define void @lnch_feature_child_key_spawn(%struct.lnch_ctxt* %0) {
%2 = tail call i32 (...) @fork()
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @lnch_feature_child_exec(%struct.lnch_ctxt* %0)
br label %6
6: ; preds = %4, %1
ret void
}
int f1(void) {
  int a = 128;
  return (a & 0x80) ? 0x80 : 0;
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
movl   $0x80,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x80,%edx
xor    %eax,%eax
mov    $0x80,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f1() {
%1 = alloca i32
store i32 128, i32* %1
%2 = load i32, i32* %1
%3 = and i32 %2, 128
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 128, i32 0
ret i32 %6
}

LLVM IR (-O2):
define i32 @f1() {
ret i32 128
}
/* Variables and functions */
int main_mbox(int, char **);
int main(int argc, char **argv) { return main_mbox(argc, argv); }


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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <main_mbox@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <main_mbox@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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @main_mbox(i32 %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @main_mbox(i32 %0, i8** %1)
ret i32 %3
}
int returns_zero() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @returns_zero() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ bjk_simple_abort(void (*)(), int);
void bjk_software_exception_handler() {
  bjk_simple_abort(bjk_software_exception_handler, 1);
}


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

x86 assembly (clang, -O2):
<bjk_software_exception_handler>:
mov    0x2ec9(%rip),%rdi
mov    $0x1,%esi
jmp    1030 <bjk_simple_abort@plt>

LLVM IR (-O0):
define void @bjk_software_exception_handler() {
%1 = call i32 @bjk_simple_abort(void (...)* bitcast (void ()* @bjk_software_exception_handler to void (...)*), i32 1)
ret void
}

LLVM IR (-O2):
define void @bjk_software_exception_handler() {
%1 = tail call i32 @bjk_simple_abort(void (...)* bitcast (void ()* @bjk_software_exception_handler to void (...)*), i32 1)
ret void
}
/* Variables and functions */
unsigned long strlen(char const *);
unsigned long CString_strlen(const char *str) { return strlen(str); }


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

x86 assembly (clang, -O2):
<CString_strlen>:
jmp    1030 <strlen@plt>

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

LLVM IR (-O2):
define i64 @CString_strlen(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
ret i64 %2
}
int regex_subst(void) {
  const void *subst = "";
  return (*(int (*)(int))subst)(0);
}


x86 assembly (clang, -O0):
<regex_subst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xef1(%rip),%rax
mov    %rax,-0x8(%rbp)
xor    %edi,%edi
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<regex_subst>:
xor    %edi,%edi
jmp    2000 <_fini+0xef8>

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

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @regex_subst() {
%1 = tail call i32 bitcast ([1 x i8]* @.str to i32 (i32)*)(i32 0)
ret i32 %1
}
int main() {
#pragma omp target update to(v)
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printTopLines(char value1, char value2, char value3) {
  printf("  |%c                   |   |%c                   |   |%c            "
         "       |\n",
         value1, value2, value3);
  printf("  |                    |   |                    |   |                "
         "    |\n");
  printf("  |                    |   |                    |   |                "
         "    |\n");
}


x86 assembly (clang, -O0):
<printTopLines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movsbl -0x1(%rbp),%esi
movsbl -0x2(%rbp),%edx
movsbl -0x3(%rbp),%ecx
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf05(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printTopLines>:
push   %rbx
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
lea    0xed2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf13(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [79 x i8] c" |%c | |%c | |%c |\0A\00"
@.str.1 = [76 x i8] c" | | | | | |\0A\00"
define void @printTopLines(i8 signext %0, i8 signext %1, i8 signext %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 = sext i8 %7 to i32
%9 = load i8, i8* %5
%10 = sext i8 %9 to i32
%11 = load i8, i8* %6
%12 = sext i8 %11 to i32
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %10, i32 %12)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.1, i64 0, i64 0))
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [79 x i8] c" |%c | |%c | |%c |\0A\00"
@str.2 = [75 x i8] c" | | | | | |\00"
define void @printTopLines(i8 signext %0, i8 signext %1, i8 signext %2) {
%4 = sext i8 %0 to i32
%5 = sext i8 %1 to i32
%6 = sext i8 %2 to i32
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5, i32 %6)
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @str.2, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @str.2, i64 0, i64 0))
ret void
}
int op_ne(int a, int b) { return a != b; }


x86 assembly (clang, -O0):
<op_ne>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_ne>:
xor    %eax,%eax
cmp    %esi,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @op_ne(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 ne i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @op_ne(i32 %0, i32 %1) {
%3 = icmp ne i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int fork();
int /*<<< orphan*/ pi_reboot_blocking(int);
void pi_reboot(int delay) {
  int pid = fork();
  if (pid == 0) {
    pi_reboot_blocking(delay);
  }
}


x86 assembly (clang, -O0):
<pi_reboot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <fork@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1147 <pi_reboot+0x27>
mov    -0x4(%rbp),%edi
call   1030 <pi_reboot_blocking@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pi_reboot>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <fork@plt>
test   %eax,%eax
je     1130 <pi_reboot+0x10>
pop    %rbx
ret
mov    %ebx,%edi
pop    %rbx
jmp    1030 <pi_reboot_blocking@plt>

LLVM IR (-O0):
define void @pi_reboot(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @fork()
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = call i32 @pi_reboot_blocking(i32 %8)
br label %10
10: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
define void @pi_reboot(i32 %0) {
%2 = tail call i32 (...) @fork()
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @pi_reboot_blocking(i32 %0)
br label %6
6: ; preds = %4, %1
ret void
}
int main(void) {
  auto int t;
  int z;
  auto int v;
  if (1 == 1) {
    auto int j;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fork();
int process_create(pid_t *pid_new, void (*routine)(void)) {
  pid_t pid;
  switch (pid = fork()) {
  case -1: {
    return errno;
    break;
  }
  case 0: {
    routine();
    exit(0);
    break;
  }
  default: {
    *pid_new = pid;
    break;
  }
  }
  return 0;
}


x86 assembly (clang, -O0):
<process_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
xor    %eax,%eax
call   1040 <fork@plt>
mov    %eax,-0x1c(%rbp)
mov    %eax,%ecx
mov    %ecx,-0x20(%rbp)
sub    $0xffffffff,%eax
je     115d <process_create+0x3d>
jmp    114d <process_create+0x2d>
mov    -0x20(%rbp),%eax
test   %eax,%eax
je     116e <process_create+0x4e>
jmp    1178 <process_create+0x58>
mov    0x2e7c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1188 <process_create+0x68>
call   *-0x18(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>
mov    -0x1c(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_create>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <fork@plt>
cmp    $0xffffffff,%eax
je     1140 <process_create+0x20>
test   %eax,%eax
je     1151 <process_create+0x31>
mov    %eax,(%rbx)
xor    %eax,%eax
jmp    1149 <process_create+0x29>
mov    0x2e99(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
call   *%r14
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@errno = global i32 0
define i32 @process_create(i32* %0, void ()* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca void ()*
%6 = alloca i32
store i32* %0, i32** %4
store void ()* %1, void ()** %5
%7 = call i32 (...) @fork()
store i32 %7, i32* %6
switch i32 %7, label %13 [
i32 -1, label %8
i32 0, label %10
]
8: ; preds = %2
%9 = load i32, i32* @errno
store i32 %9, i32* %3
br label %17
10: ; preds = %2
%11 = load void ()*, void ()** %5
%12 = call i32 @exit(i32 0)
unreachable
13: ; preds = %2
%14 = load i32, i32* %6
%15 = load i32*, i32** %4
store i32 %14, i32* %15
br label %16
16: ; preds = %13
store i32 0, i32* %3
br label %17
17: ; preds = %16, %8
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @process_create(i32* nocapture writeonly %0, void ()* nocapture %1) {
%3 = tail call i32 (...) @fork()
switch i32 %3, label %8 [
i32 -1, label %4
i32 0, label %6
]
4: ; preds = %2
%5 = load i32, i32* @errno
br label %9
6: ; preds = %2
tail call void %1()
%7 = tail call i32 @exit(i32 0)
unreachable
8: ; preds = %2
store i32 %3, i32* %0
br label %9
9: ; preds = %8, %4
%10 = phi i32 [ 0, %8 ], [ %5, %4 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int kill(int /*<<< orphan*/, int);
int sendsig(pid_t pid, int sig) { return kill(pid, sig); }


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

x86 assembly (clang, -O2):
<sendsig>:
jmp    1030 <kill@plt>

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

LLVM IR (-O2):
define i32 @sendsig(i32 %0, i32 %1) {
%3 = tail call i32 @kill(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int celcon_copy_start_standard_solution_to_container(int k, int i) {
  int fail;
  double *c;
  fail = _ada_use_c2phc4c(597, &k, &i, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<celcon_copy_start_standard_solution_to_container>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x18(%rbp),%rcx
mov    $0x255,%edi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<celcon_copy_start_standard_solution_to_container>:
push   %rax
mov    %edi,0x4(%rsp)
mov    %esi,(%rsp)
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
mov    $0x255,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @celcon_copy_start_standard_solution_to_container(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @_ada_use_c2phc4c(i32 597, i32* %3, i32* %4, double* undef, i32 0)
ret i32 %5
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ puts(char *);
void *xcalloc(size_t nelem, size_t elsize) {
  void *p = calloc(nelem, elsize);
  if (!p) {
    puts("Failed: "
         "xrealloc");
    exit(-1);
  }
  return p;
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1172 <xcalloc+0x42>
lea    0xe9d(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %rax
call   1040 <calloc@plt>
test   %rax,%rax
je     113d <xcalloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [17 x i8] c"Failed: xrealloc\00"
define noalias i8* @xcalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 -1)
unreachable
8: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
__attribute__((hotpatch(1, 2))) void hp1(void) { printf("hello, world!\n"); }


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"hello, world!\00"
define void @hp1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
void dd_pbl_ios_localytics_session_start(const char *key) {}


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

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

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

LLVM IR (-O2):
define void @dd_pbl_ios_localytics_session_start(i8* nocapture %0) {
ret void
}
/* Type definitions */
struct stat {
  long st_size;
};

/* Variables and functions */
scalar_t__ stat(char *, struct stat *);
long do_stat(char *fname) {
  struct stat sbuf;
  if (stat(fname, &sbuf) < 0) {
    return -1;
  }
  return sbuf.st_size;
}


x86 assembly (clang, -O0):
<do_stat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
jge    1140 <do_stat+0x30>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    1148 <do_stat+0x38>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_stat>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
mov    $0xffffffffffffffff,%rax
test   %rcx,%rcx
js     112c <do_stat+0x1c>
mov    (%rsp),%rax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i64 }
define i64 @do_stat(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%6 = load i64, i64* %5
%7 = icmp sgt i64 %4, -1
%8 = select i1 %7, i64 %6, i64 -1
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ porting_dbg(char *, int);
int expand_fdset(int amax) {
  porting_dbg("FD_SETSIZE = %d", 32);
  return 32;
}


x86 assembly (clang, -O0):
<expand_fdset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
mov    $0x20,%esi
call   1030 <porting_dbg@plt>
mov    $0x20,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expand_fdset>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x20,%esi
call   1030 <porting_dbg@plt>
mov    $0x20,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"FD_SETSIZE = %d\00"
define i32 @expand_fdset(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @porting_dbg(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 32)
ret i32 32
}

LLVM IR (-O2):
@.str = [16 x i8] c"FD_SETSIZE = %d\00"
define i32 @expand_fdset(i32 %0) {
%2 = tail call i32 @porting_dbg(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 32)
ret i32 32
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void virtual_mcu_GlobalInterrupts_enable__E() {
  printf("GlobalInterrupts enable\n");
}


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

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

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

LLVM IR (-O2):
@str = [24 x i8] c"GlobalInterrupts enable\00"
define void @virtual_mcu_GlobalInterrupts_enable__E() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
ret void
}