xunge/DecIR huggingface dataset:
/* Type definitions */
struct t_gui_buffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gui_buffer_close(struct t_gui_buffer *);
scalar_t__ string_strcasecmp(char const *, char *);
int secure_buffer_input_cb(const void *pointer, void *data,
                           struct t_gui_buffer *buffer,
                           const char *input_data) {
  (void)pointer;
  (void)data;
  if (string_strcasecmp(input_data, "q") == 0) {
    gui_buffer_close(buffer);
  }
  return 0;
}


x86 assembly (clang, -O0):
<secure_buffer_input_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xebd(%rip),%rsi
call   1030 <string_strcasecmp@plt>
cmp    $0x0,%rax
jne    115b <secure_buffer_input_cb+0x3b>
mov    -0x18(%rbp),%rdi
call   1040 <gui_buffer_close@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<secure_buffer_input_cb>:
push   %rbx
mov    %rdx,%rbx
lea    0xed5(%rip),%rsi
mov    %rcx,%rdi
call   1030 <string_strcasecmp@plt>
test   %rax,%rax
jne    1140 <secure_buffer_input_cb+0x20>
mov    %rbx,%rdi
call   1040 <gui_buffer_close@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.t_gui_buffer = type { i32 }
@.str = [2 x i8] c"q\00"
define i32 @secure_buffer_input_cb(i8* %0, i8* %1, %struct.t_gui_buffer* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca %struct.t_gui_buffer*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store %struct.t_gui_buffer* %2, %struct.t_gui_buffer** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %8
%12 = call i64 @string_strcasecmp(i8* %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %4
%15 = load %struct.t_gui_buffer*, %struct.t_gui_buffer** %7
%16 = call i32 @gui_buffer_close(%struct.t_gui_buffer* %15)
br label %17
17: ; preds = %14, %4
ret i32 0
}

LLVM IR (-O2):
%struct.t_gui_buffer = type { i32 }
@.str = [2 x i8] c"q\00"
define i32 @secure_buffer_input_cb(i8* nocapture readnone %0, i8* nocapture readnone %1, %struct.t_gui_buffer* %2, i8* %3) {
%5 = tail call i64 @string_strcasecmp(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @gui_buffer_close(%struct.t_gui_buffer* %2)
br label %9
9: ; preds = %7, %4
ret i32 0
}
unsigned int endian_swap16(unsigned short x) { return (x >> 8) | (x << 8); }


x86 assembly (clang, -O0):
<endian_swap16>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0x8,%eax
movzwl -0x2(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<endian_swap16>:
mov    %edi,%eax
shr    $0x8,%eax
shl    $0x8,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @endian_swap16(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = ashr i32 %4, 8
%6 = load i16, i16* %2
%7 = zext i16 %6 to i32
%8 = shl i32 %7, 8
%9 = or i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @endian_swap16(i16 zeroext %0) {
%2 = zext i16 %0 to i32
%3 = lshr i32 %2, 8
%4 = shl nuw nsw i32 %2, 8
%5 = or i32 %3, %4
ret i32 %5
}
const char *_Locale_currency_symbol(struct _Locale_monetary *__DUMMY_PAR) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct._Locale_monetary = type opaque
define i8* @_Locale_currency_symbol(%struct._Locale_monetary* %0) {
%2 = alloca %struct._Locale_monetary*
store %struct._Locale_monetary* %0, %struct._Locale_monetary** %2
ret i8* null
}

LLVM IR (-O2):
%struct._Locale_monetary = type opaque
define noalias i8* @_Locale_currency_symbol(%struct._Locale_monetary* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
void *realloc(void *, size_t);
void *realloc2(void *memblock, size_t size) {
  return (realloc(memblock, size));
}


x86 assembly (clang, -O0):
<realloc2>:
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 <realloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<realloc2>:
jmp    1030 <realloc@plt>

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

LLVM IR (-O2):
define noalias i8* @realloc2(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
ret i8* %3
}
void ASN1_STRING_dup(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_STRING_dup() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
extern void hang_around() {
  while (1)
    sleep(1);
}


x86 assembly (clang, -O0):
<hang_around>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <hang_around+0x9>
mov    $0x1,%edi
call   1030 <sleep@plt>
jmp    1119 <hang_around+0x9>

x86 assembly (clang, -O2):
<hang_around>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1030 <sleep@plt>
jmp    1120 <hang_around+0x10>

LLVM IR (-O0):
define void @hang_around() {
br label %1
1: ; preds = %0, %1
%2 = call i32 @sleep(i32 1)
br label %1
}

LLVM IR (-O2):
define void @hang_around() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @sleep(i32 1)
br label %1
}
void foo044(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo044(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ move(int, int);
void gotoCoordinates(int x, int y) { move(y, x); }


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

x86 assembly (clang, -O2):
<gotoCoordinates>:
mov    %edi,%eax
mov    %esi,%edi
mov    %eax,%esi
jmp    1030 <move@plt>

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

LLVM IR (-O2):
define void @gotoCoordinates(i32 %0, i32 %1) {
%3 = tail call i32 @move(i32 %1, i32 %0)
ret void
}
int jac_chain_nm7_n_out(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @jac_chain_nm7_n_out() {
ret i32 2
}

LLVM IR (-O2):
define i32 @jac_chain_nm7_n_out() {
ret i32 2
}
/* Variables and functions */
int *malloc(int);
int main(void) {
  int u[20];
  int *p = malloc(sizeof(int) * 100);
  p[0] = 0;
  int *n = (int *)((long)p + (long)u);
  int *x = (int *)((long)n - (long)u);
  x[0] = 0;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x190,%edi
call   1030 <malloc@plt>
mov    %rax,-0x68(%rbp)
mov    -0x68(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x68(%rbp),%rax
lea    -0x60(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x70(%rbp)
mov    -0x70(%rbp),%rax
lea    -0x60(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x78(%rbp)
mov    -0x78(%rbp),%rax
movl   $0x0,(%rax)
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x190,%edi
call   1030 <malloc@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i32]
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32*
store i32 0, i32* %1
%6 = call i32* @malloc(i32 400)
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 0
store i32 0, i32* %8
%9 = load i32*, i32** %3
%10 = ptrtoint i32* %9 to i64
%11 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%12 = ptrtoint i32* %11 to i64
%13 = add nsw i64 %10, %12
%14 = inttoptr i64 %13 to i32*
store i32* %14, i32** %4
%15 = load i32*, i32** %4
%16 = ptrtoint i32* %15 to i64
%17 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%18 = ptrtoint i32* %17 to i64
%19 = sub nsw i64 %16, %18
%20 = inttoptr i64 %19 to i32*
store i32* %20, i32** %5
%21 = load i32*, i32** %5
%22 = getelementptr inbounds i32, i32* %21, i64 0
store i32 0, i32* %22
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @malloc(i32 400)
ret i32 0
}
/* Variables and functions */
int _partition(int *, int, int);
void _quick_sort(int *nums, int left, int right) {
  if (left >= right) {
    return;
  }
  int p = _partition(nums, left, right);
  _quick_sort(nums, 0, p - 1);
  _quick_sort(nums, p + 1, right);
}


x86 assembly (clang, -O0):
<_quick_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1143 <_quick_sort+0x23>
jmp    1178 <_quick_sort+0x58>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <_partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1040 <_quick_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <_quick_sort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_quick_sort>:
push   %rbp
push   %r14
push   %rbx
cmp    %edx,%esi
jge    1154 <_quick_sort+0x34>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <_partition@plt>
mov    %eax,%ebp
lea    -0x1(%rbp),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <_quick_sort@plt>
add    $0x1,%ebp
cmp    %r14d,%ebp
jl     1130 <_quick_sort+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @_quick_sort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @_partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @_quick_sort(i32* %0, i32 0, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
/* Variables and functions */
int compare_names(void const *, void const *);
int compare_names_desc(const void *a, const void *b) {
  return compare_names(b, a);
}


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

x86 assembly (clang, -O2):
<compare_names_desc>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <compare_names@plt>

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

LLVM IR (-O2):
define i32 @compare_names_desc(i8* %0, i8* %1) {
%3 = tail call i32 @compare_names(i8* %1, i8* %0)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ SIGUSR1;
int kill(int /*<<< orphan*/, int /*<<< orphan*/);
int __shut_it_down(pid_t dead_pid_walking) {
  return (kill(dead_pid_walking, SIGUSR1));
}


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

x86 assembly (clang, -O2):
<__shut_it_down>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <kill@plt>

LLVM IR (-O0):
@SIGUSR1 = global i32 0
define i32 @__shut_it_down(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGUSR1
%5 = call i32 @kill(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@SIGUSR1 = global i32 0
define i32 @__shut_it_down(i32 %0) {
%2 = load i32, i32* @SIGUSR1
%3 = tail call i32 @kill(i32 %0, i32 %2)
ret i32 %3
}
int test_imm_58int16_reg(short val) {
  return ((val) & (-0x58 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_58int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffffa8,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_58int16_reg>:
test   $0xffa8,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_58int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -88
%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_58int16_reg(i16 signext %0) {
%2 = and i16 %0, -88
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void rop3_32_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~S;
  stk2 = T & stk3;
  stk1 = *D & stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_32_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_32_1_0>:
or     %edx,%esi
and    %sil,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_32_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %2, %1
%6 = and i8 %4, %5
store i8 %6, i8* %0
ret void
}
void _Unwind_SetIP() {}


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

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

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

LLVM IR (-O2):
define void @_Unwind_SetIP() {
ret void
}
void g_get_user_config_dir() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ SYS_fork;
int /*<<< orphan*/ syscall(int /*<<< orphan*/);
pid_t fork(void) { return syscall(SYS_fork); }


x86 assembly (clang, -O0):
<fork>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <syscall@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fork>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@SYS_fork = global i32 0
define i32 @fork() {
%1 = load i32, i32* @SYS_fork
%2 = call i32 @syscall(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@SYS_fork = global i32 0
define i32 @fork() {
%1 = load i32, i32* @SYS_fork
%2 = tail call i32 @syscall(i32 %1)
ret i32 %2
}
/* Variables and functions */
size_t bnode_colored_value(size_t index, size_t color_bit) {
  return (((index) << 1) | (color_bit));
}


x86 assembly (clang, -O0):
<bnode_colored_value>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x1,%rax
or     -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bnode_colored_value>:
lea    (%rdi,%rdi,1),%rax
or     %rsi,%rax
ret

LLVM IR (-O0):
define i64 @bnode_colored_value(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = shl i64 %5, 1
%7 = load i64, i64* %4
%8 = or i64 %6, %7
ret i64 %8
}

LLVM IR (-O2):
define i64 @bnode_colored_value(i64 %0, i64 %1) {
%3 = shl i64 %0, 1
%4 = or i64 %3, %1
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ M_PI;
int /*<<< orphan*/ putDouble(int /*<<< orphan*/);
void IF_pi(void) { putDouble(M_PI); }


x86 assembly (clang, -O0):
<IF_pi>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <putDouble@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<IF_pi>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <putDouble@plt>

LLVM IR (-O0):
@M_PI = global i32 0
define void @IF_pi() {
%1 = load i32, i32* @M_PI
%2 = call i32 @putDouble(i32 %1)
ret void
}

LLVM IR (-O2):
@M_PI = global i32 0
define void @IF_pi() {
%1 = load i32, i32* @M_PI
%2 = tail call i32 @putDouble(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
void *nothing(void *data __attribute__((unused))) {
  printf("[thread] exit thread\n");
  pthread_exit(NULL);
}


x86 assembly (clang, -O0):
<nothing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [22 x i8] c"[thread] exit thread\0A\00"
define i8* @nothing(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @pthread_exit(i32* null)
%6 = load i8*, i8** %2
ret i8* %6
}

LLVM IR (-O2):
@str = [21 x i8] c"[thread] exit thread\00"
define noalias i8* @nothing(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @pthread_exit(i32* null)
ret i8* undef
}
void rt2x00debug_register(struct rt2x00_dev *rt2x00dev) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
%struct.rt2x00_dev = type opaque
define void @rt2x00debug_register(%struct.rt2x00_dev* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ api_async_init();
int /*<<< orphan*/ api_socket_init();
int /*<<< orphan*/ api_wait_init();
void api_init() {
  api_async_init();
  api_wait_init();
  api_socket_init();
}


x86 assembly (clang, -O0):
<api_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <api_async_init@plt>
mov    $0x0,%al
call   1040 <api_wait_init@plt>
mov    $0x0,%al
call   1030 <api_socket_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<api_init>:
push   %rax
xor    %eax,%eax
call   1050 <api_async_init@plt>
xor    %eax,%eax
call   1040 <api_wait_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <api_socket_init@plt>

LLVM IR (-O0):
define void @api_init() {
%1 = call i32 (...) @api_async_init()
%2 = call i32 (...) @api_wait_init()
%3 = call i32 (...) @api_socket_init()
ret void
}

LLVM IR (-O2):
define void @api_init() {
%1 = tail call i32 (...) @api_async_init()
%2 = tail call i32 (...) @api_wait_init()
%3 = tail call i32 (...) @api_socket_init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_189() {
  Assert_real((isqrt(189) == 13),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/stdlib/isqrt.c",
              950, ("Integer square root of 189 should be 13"));
}


x86 assembly (clang, -O0):
<t_sqrt_189>:
push   %rbp
mov    %rsp,%rbp
mov    $0xbd,%edi
call   1030 <isqrt@plt>
cmp    $0xd,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x3b6,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_189>:
push   %rax
mov    $0xbd,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xd,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x3b6,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 189 should be 13\00"
define void @t_sqrt_189() {
%1 = call i32 @isqrt(i32 189)
%2 = icmp eq i32 %1, 13
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 950, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 189 should be 13\00"
define void @t_sqrt_189() {
%1 = tail call i32 @isqrt(i32 189)
%2 = icmp eq i32 %1, 13
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 950, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void glGetFragDataLocation(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glGetFragDataLocation() {
ret void
}
double power6x(double a, double b) { return __builtin_copysign(a, b); }


x86 assembly (clang, -O0):
<power6x>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movaps 0xee1(%rip),%xmm2
pand   %xmm2,%xmm1
movaps 0xee6(%rip),%xmm2
pand   %xmm2,%xmm0
por    %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<power6x>:
andps  0xef9(%rip),%xmm1
andps  0xf02(%rip),%xmm0
orps   %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @power6x(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @llvm.copysign.f64(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @power6x(double %0, double %1) {
%3 = tail call double @llvm.copysign.f64(double %0, double %1)
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ lseek(int, int /*<<< orphan*/, int);
off_t ltell(int f) { return lseek(f, 0, 1); }


x86 assembly (clang, -O0):
<ltell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <lseek@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ltell>:
xor    %esi,%esi
mov    $0x1,%edx
jmp    1030 <lseek@plt>

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

LLVM IR (-O2):
define i32 @ltell(i32 %0) {
%2 = tail call i32 @lseek(i32 %0, i32 0, i32 1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ executeApplescriptAsync(char *, char *);
void nextSong() { executeApplescriptAsync("iTunes", "next track"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"iTunes\00"
@.str.1 = [11 x i8] c"next track\00"
define void @nextSong() {
%1 = call i32 @executeApplescriptAsync(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"iTunes\00"
@.str.1 = [11 x i8] c"next track\00"
define void @nextSong() {
%1 = tail call i32 @executeApplescriptAsync(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void output_footer(FILE *outputf) {
  fprintf(outputf, "	if (error != CSS_OK)\n"
                   "		*ctx = orig_ctx;\n"
                   "	\n"
                   "	return error;\n"
                   "}\n\n");
}


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

x86 assembly (clang, -O2):
<output_footer>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x3d,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [62 x i8] c"\09if (error != CSS_OK)\0A\09\09*ctx = orig_ctx;\0A\09\0A\09return error;\0A}\0A\0A\00"
define void @output_footer(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [62 x i8] c"\09if (error != CSS_OK)\0A\09\09*ctx = orig_ctx;\0A\09\0A\09return error;\0A}\0A\0A\00"
define void @output_footer(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i64 61, i64 1, i32* %0)
ret void
}
/* Variables and functions */
char *strdup(char *);
char *strrchr(char *, char);
char *glmDirName(char *path) {
  char *dir;
  char *s;
  dir = strdup(path);
  s = strrchr(dir, '/');
  if (s)
    s[1] = '\0';
  else
    dir[0] = '\0';
  return dir;
}


x86 assembly (clang, -O0):
<glmDirName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1163 <glmDirName+0x43>
mov    -0x18(%rbp),%rax
movb   $0x0,0x1(%rax)
jmp    116a <glmDirName+0x4a>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmDirName>:
push   %rbx
call   1040 <strdup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
movb   $0x0,(%rcx)
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @glmDirName(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = tail call i8* @strrchr(i8* dereferenceable(1) %2, i8 signext 47)
%4 = icmp eq i8* %3, null
%5 = getelementptr inbounds i8, i8* %3, i64 1
%6 = select i1 %4, i8* %2, i8* %5
store i8 0, i8* %6
ret i8* %2
}
int fun347() { return 347; }


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

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

LLVM IR (-O0):
define i32 @fun347() {
ret i32 347
}

LLVM IR (-O2):
define i32 @fun347() {
ret i32 347
}
void *round_up(void *ptr, unsigned long align, unsigned long offset) {
  unsigned long ret = (unsigned long)ptr;
  ret = ((ret + align - 1) & ~(align - 1));
  ret += offset;
  return (void *)ret;
}


x86 assembly (clang, -O0):
<round_up>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    -0x10(%rbp),%rax
sub    $0x1,%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
xor    $0xffffffffffffffff,%rcx
and    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_up>:
lea    (%rsi,%rdi,1),%rax
add    $0xffffffffffffffff,%rax
neg    %rsi
and    %rsi,%rax
add    %rdx,%rax
ret

LLVM IR (-O0):
define i8* @round_up(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = ptrtoint i8* %8 to i64
store i64 %9, i64* %7
%10 = load i64, i64* %7
%11 = load i64, i64* %5
%12 = add i64 %10, %11
%13 = sub i64 %12, 1
%14 = load i64, i64* %5
%15 = sub i64 %14, 1
%16 = xor i64 %15, -1
%17 = and i64 %13, %16
store i64 %17, i64* %7
%18 = load i64, i64* %6
%19 = load i64, i64* %7
%20 = add i64 %19, %18
store i64 %20, i64* %7
%21 = load i64, i64* %7
%22 = inttoptr i64 %21 to i8*
ret i8* %22
}

LLVM IR (-O2):
define i8* @round_up(i8* %0, i64 %1, i64 %2) {
%4 = ptrtoint i8* %0 to i64
%5 = add i64 %1, -1
%6 = add i64 %5, %4
%7 = sub i64 0, %1
%8 = and i64 %6, %7
%9 = add i64 %8, %2
%10 = inttoptr i64 %9 to i8*
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ ioctl_create_acq(int);
int /*<<< orphan*/ ioctl_create_asq(int);
int /*<<< orphan*/ printf(char *);
void test_admin(int file_desc) {
  printf("\nTEST 1.1: Create Admin CQ...\n");
  ioctl_create_acq(file_desc);
  printf("\nTEST 1.2: Create Admin SQ...\n");
  ioctl_create_asq(file_desc);
}


x86 assembly (clang, -O0):
<test_admin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1050 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <ioctl_create_acq@plt>
lea    0xec9(%rip),%rdi
call   1050 <printf@plt>
mov    -0x4(%rbp),%edi
call   1030 <ioctl_create_asq@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_admin>:
push   %rbx
mov    %edi,%ebx
lea    0xec6(%rip),%rdi
call   1040 <puts@plt>
mov    %ebx,%edi
call   1050 <ioctl_create_acq@plt>
lea    0xed1(%rip),%rdi
call   1040 <puts@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <ioctl_create_asq@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"\0ATEST 1.1: Create Admin CQ...\0A\00"
@.str.1 = [31 x i8] c"\0ATEST 1.2: Create Admin SQ...\0A\00"
define void @test_admin(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 @ioctl_create_acq(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* %2
%8 = call i32 @ioctl_create_asq(i32 %7)
ret void
}

LLVM IR (-O2):
@str = [30 x i8] c"\0ATEST 1.1: Create Admin CQ...\00"
@str.2 = [30 x i8] c"\0ATEST 1.2: Create Admin SQ...\00"
define void @test_admin(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @ioctl_create_acq(i32 %0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.2, i64 0, i64 0))
%5 = tail call i32 @ioctl_create_asq(i32 %0)
ret void
}
/* Variables and functions */
int test1();
int test2();
int main(int argc, char *argv[]) { return test1() + test2(); }


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <test1@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <test2@plt>
add    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test1()
%4 = tail call i32 (...) @test2()
%5 = add nsw i32 %4, %3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ arg_longlong2(long long, long long);
void arg_longlong1(long long i) { arg_longlong2(i, i + 1); }


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

x86 assembly (clang, -O2):
<arg_longlong1>:
lea    0x1(%rdi),%rsi
jmp    1030 <arg_longlong2@plt>

LLVM IR (-O0):
define void @arg_longlong1(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i64, i64* %2
%5 = add nsw i64 %4, 1
%6 = call i32 @arg_longlong2(i64 %3, i64 %5)
ret void
}

LLVM IR (-O2):
define void @arg_longlong1(i64 %0) {
%2 = add nsw i64 %0, 1
%3 = tail call i32 @arg_longlong2(i64 %0, i64 %2)
ret void
}
int exported(int par) { return par + 42; }


x86 assembly (clang, -O0):
<exported>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2a,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<exported>:
lea    0x2a(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @exported(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 42
ret i32 %4
}

LLVM IR (-O2):
define i32 @exported(i32 %0) {
%2 = add nsw i32 %0, 42
ret i32 %2
}
void foo574(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo574(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fesetround(int);
void set_fpu_rounding_mode(int mode) {
  int rnd_mode;
  switch (mode) {
  default:
    return;
  }
  fesetround(rnd_mode);
}


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

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

LLVM IR (-O0):
define void @set_fpu_rounding_mode(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
switch i32 %4, label %5 [
]
5: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @set_fpu_rounding_mode(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, int);
void key_copy(char *dest, const char *src) { memcpy(dest, src, 26); }


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

x86 assembly (clang, -O2):
<key_copy>:
mov    $0x1a,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @key_copy(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 @memcpy(i8* %5, i8* %6, i32 26)
ret void
}

LLVM IR (-O2):
define void @key_copy(i8* %0, i8* %1) {
%3 = tail call i32 @memcpy(i8* %0, i8* %1, i32 26)
ret void
}
/* Type definitions */
struct iommu_group {
  int dummy;
};
struct device {
  int dummy;
};

/* Variables and functions */
int ENODEV;
int iommu_group_add_device(struct iommu_group *group, struct device *dev) {
  return -ENODEV;
}


x86 assembly (clang, -O0):
<iommu_group_add_device>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    0x2ecb(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iommu_group_add_device>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
%struct.iommu_group = type { i32 }
%struct.device = type { i32 }
@ENODEV = global i32 0
define i32 @iommu_group_add_device(%struct.iommu_group* %0, %struct.device* %1) {
%3 = alloca %struct.iommu_group*
%4 = alloca %struct.device*
store %struct.iommu_group* %0, %struct.iommu_group** %3
store %struct.device* %1, %struct.device** %4
%5 = load i32, i32* @ENODEV
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
%struct.iommu_group = type { i32 }
%struct.device = type { i32 }
@ENODEV = global i32 0
define i32 @iommu_group_add_device(%struct.iommu_group* nocapture readnone %0, %struct.device* nocapture readnone %1) {
%3 = load i32, i32* @ENODEV
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ exit(int);
scalar_t__ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
double gettime(void) {
  struct timeval t;
  if (gettimeofday(&t, NULL) < 0) {
    perror("gettimeofday");
    exit(1);
  }
  return ((double)t.tv_sec + (double)t.tv_usec / 1000000);
}


x86 assembly (clang, -O0):
<gettime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cmp    $0x0,%rax
jge    1165 <gettime+0x35>
lea    0xeb2(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
cvtsi2sdq -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
movsd  0xe87(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gettime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
test   %rax,%rax
js     1164 <gettime+0x34>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
divsd  0xea5(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret
lea    0xe9d(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
@.str = [13 x i8] c"gettimeofday\00"
define double @gettime() {
%1 = alloca %struct.timeval
%2 = call i64 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @exit(i32 1)
unreachable
7: ; preds = %0
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%9 = load i64, i64* %8
%10 = sitofp i64 %9 to double
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%12 = load i64, i64* %11
%13 = sitofp i64 %12 to double
%14 = fdiv double %13, 1.000000e+06
%15 = fadd double %10, %14
ret double %15
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
@.str = [13 x i8] c"gettimeofday\00"
define double @gettime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i64 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = tail call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %0
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%10 = load i64, i64* %9
%11 = sitofp i64 %10 to double
%12 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%13 = load i64, i64* %12
%14 = sitofp i64 %13 to double
%15 = fdiv double %14, 1.000000e+06
%16 = fadd double %15, %11
ret double %16
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int strtoll(char *, char **, int /*<<< orphan*/);
uint64_t getNum(char *str, int *err) {
  uint64_t val;
  char *endptr;
  *err = 0;
  val = strtoll(str, &endptr, 0);
  if (*endptr) {
    *err = 1;
    val = -1;
  }
  return val;
}


x86 assembly (clang, -O0):
<getNum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
lea    -0x20(%rbp),%rsi
xor    %edx,%edx
call   1030 <strtoll@plt>
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     115a <getNum+0x4a>
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
movl   $0xffffffff,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getNum>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
movl   $0x0,(%rsi)
lea    0x8(%rsp),%rsi
xor    %edx,%edx
call   1030 <strtoll@plt>
mov    0x8(%rsp),%rcx
cmpb   $0x0,(%rcx)
je     113f <getNum+0x2f>
movl   $0x1,(%rbx)
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @getNum(i8* %0, i32* nocapture writeonly %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
store i32 0, i32* %1
%5 = call i32 @strtoll(i8* %0, i8** %3, i32 0)
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %10, label %9
9: ; preds = %2
store i32 1, i32* %1
br label %10
10: ; preds = %9, %2
%11 = phi i32 [ -1, %9 ], [ %5, %2 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ ctrl_by_key(int);
int execute(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/ *);
int key_command(int key) { return execute(ctrl_by_key(key), 0, NULL); }


x86 assembly (clang, -O0):
<key_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <ctrl_by_key@plt>
mov    %eax,%edi
xor    %esi,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <execute@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<key_command>:
push   %rax
call   1030 <ctrl_by_key@plt>
mov    %eax,%edi
xor    %esi,%esi
xor    %edx,%edx
pop    %rax
jmp    1040 <execute@plt>

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

LLVM IR (-O2):
define i32 @key_command(i32 %0) {
%2 = tail call i32 @ctrl_by_key(i32 %0)
%3 = tail call i32 @execute(i32 %2, i32 0, i32* null)
ret i32 %3
}
/* Variables and functions */
char serial_recv_blocking();
char cio_getc() { return serial_recv_blocking(); }


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

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

LLVM IR (-O0):
define signext i8 @cio_getc() {
%1 = call signext i8 (...) @serial_recv_blocking()
ret i8 %1
}

LLVM IR (-O2):
define signext i8 @cio_getc() {
%1 = tail call signext i8 (...) @serial_recv_blocking()
ret i8 %1
}
/* Variables and functions */
int /*<<< orphan*/ _IO(unsigned char, int);
unsigned long ioctl(int, int /*<<< orphan*/);
unsigned long get_replay_args(int fd_spec) {
  return ioctl(fd_spec, _IO('u', 9));
}


x86 assembly (clang, -O0):
<get_replay_args>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x75,%edi
mov    $0x9,%esi
call   1030 <_IO@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1040 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_replay_args>:
push   %rbx
mov    %edi,%ebx
mov    $0x75,%edi
mov    $0x9,%esi
call   1030 <_IO@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
define i64 @get_replay_args(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_IO(i8 zeroext 117, i32 9)
%5 = call i64 @ioctl(i32 %3, i32 %4)
ret i64 %5
}

LLVM IR (-O2):
define i64 @get_replay_args(i32 %0) {
%2 = tail call i32 @_IO(i8 zeroext 117, i32 9)
%3 = tail call i64 @ioctl(i32 %0, i32 %2)
ret i64 %3
}