xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned int *, char *, int);
unsigned int ntohl(unsigned int);
unsigned int unpack_int(char **cur) {
  unsigned int v;
  memcpy(&v, *cur, sizeof(unsigned int));
  (*cur) += sizeof(unsigned int);
  return ntohl(v);
}


x86 assembly (clang, -O0):
<unpack_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x4,%rcx
mov    %rcx,(%rax)
mov    -0xc(%rbp),%edi
call   1040 <ntohl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unpack_int>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    (%rdi),%rsi
lea    0xc(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
addq   $0x4,(%rbx)
mov    0xc(%rsp),%edi
call   1040 <ntohl@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @unpack_int(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
%6 = call i32 @memcpy(i32* %3, i8* %5, i32 4)
%7 = load i8**, i8*** %2
%8 = load i8*, i8** %7
%9 = getelementptr inbounds i8, i8* %8, i64 4
store i8* %9, i8** %7
%10 = load i32, i32* %3
%11 = call i32 @ntohl(i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @unpack_int(i8** nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i8*, i8** %0
%5 = call i32 @memcpy(i32* %2, i8* %4, i32 4)
%6 = load i8*, i8** %0
%7 = getelementptr inbounds i8, i8* %6, i64 4
store i8* %7, i8** %0
%8 = load i32, i32* %2
%9 = call i32 @ntohl(i32 %8)
ret i32 %9
}
int ft_str_is_uppercase(char *str) {
  int i;
  int result;
  i = 0;
  result = 1;
  while (str[i]) {
    if (str[i] < 'A' || str[i] > 'Z')
      result = 0;
    i++;
  }
  return (result);
}


x86 assembly (clang, -O0):
<ft_str_is_uppercase>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1167 <ft_str_is_uppercase+0x67>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x41,%eax
jl     1152 <ft_str_is_uppercase+0x52>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5a,%eax
jle    1159 <ft_str_is_uppercase+0x59>
movl   $0x0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <ft_str_is_uppercase+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_str_is_uppercase>:
mov    (%rdi),%cl
test   %cl,%cl
je     1135 <ft_str_is_uppercase+0x35>
add    $0x1,%rdi
mov    $0x1,%eax
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0xa5,%cl
cmp    $0xe6,%cl
cmovb  %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1120 <ft_str_is_uppercase+0x20>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_str_is_uppercase(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %11, %4 ], [ 0, %1 ]
%6 = phi i8 [ %13, %4 ], [ %2, %1 ]
%7 = phi i32 [ %10, %4 ], [ 1, %1 ]
%8 = add i8 %6, -91
%9 = icmp ult i8 %8, -26
%10 = select i1 %9, i32 0, i32 %7
%11 = add nuw nsw i64 %5, 1
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i32 [ 1, %1 ], [ %10, %4 ]
ret i32 %16
}
/* Type definitions */
typedef int /*<<< orphan*/ UI;

/* Variables and functions */
int /*<<< orphan*/ UIT_PROMPT;
int general_allocate_string(int /*<<< orphan*/ *, char const *,
                            int /*<<< orphan*/, int /*<<< orphan*/, int, char *,
                            int, int, int /*<<< orphan*/ *);
int UI_add_input_string(UI *ui, const char *prompt, int flags, char *result_buf,
                        int minsize, int maxsize) {
  return general_allocate_string(ui, prompt, 0, UIT_PROMPT, flags, result_buf,
                                 minsize, maxsize, NULL);
}


x86 assembly (clang, -O0):
<UI_add_input_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2eaa(%rip),%rax
mov    (%rax),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x20(%rbp),%r9
mov    -0x24(%rbp),%r10d
mov    -0x28(%rbp),%eax
xor    %edx,%edx
xor    %r11d,%r11d
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
movq   $0x0,0x10(%rsp)
call   1030 <general_allocate_string@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UI_add_input_string>:
push   %rax
mov    %r9d,%eax
mov    %r8d,%r10d
mov    %rcx,%r9
mov    %edx,%r8d
mov    0x2ec4(%rip),%rcx
mov    (%rcx),%ecx
sub    $0x8,%rsp
xor    %edx,%edx
push   $0x0
push   %rax
push   %r10
call   1030 <general_allocate_string@plt>
add    $0x20,%rsp
pop    %rcx
ret

LLVM IR (-O0):
@UIT_PROMPT = global i32 0
define i32 @UI_add_input_string(i32* %0, i8* %1, i32 %2, i8* %3, i32 %4, i32 %5) {
%7 = alloca i32*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
store i32* %0, i32** %7
store i8* %1, i8** %8
store i32 %2, i32* %9
store i8* %3, i8** %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i32*, i32** %7
%14 = load i8*, i8** %8
%15 = load i32, i32* @UIT_PROMPT
%16 = load i32, i32* %9
%17 = load i8*, i8** %10
%18 = load i32, i32* %11
%19 = load i32, i32* %12
%20 = call i32 @general_allocate_string(i32* %13, i8* %14, i32 0, i32 %15, i32 %16, i8* %17, i32 %18, i32 %19, i32* null)
ret i32 %20
}

LLVM IR (-O2):
@UIT_PROMPT = global i32 0
define i32 @UI_add_input_string(i32* %0, i8* %1, i32 %2, i8* %3, i32 %4, i32 %5) {
%7 = load i32, i32* @UIT_PROMPT
%8 = tail call i32 @general_allocate_string(i32* %0, i8* %1, i32 0, i32 %7, i32 %2, i8* %3, i32 %4, i32 %5, i32* null)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ closelog();
void debug_log_close(void) { closelog(); }


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

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

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

LLVM IR (-O2):
define void @debug_log_close() {
%1 = tail call i32 (...) @closelog()
ret void
}
/* Type definitions */
typedef size_t uint32_t;
typedef int int32_t;

/* Variables and functions */
void cast_signed_to_unsigned_Bad() {
  char arr[10];
  int32_t x = -1;
  uint32_t y = (uint32_t)x;
  if (y > 0) {
    arr[y] = 0;
  }
}


x86 assembly (clang, -O0):
<cast_signed_to_unsigned_Bad>:
push   %rbp
mov    %rsp,%rbp
movl   $0xffffffff,-0x10(%rbp)
movslq -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jbe    1127 <cast_signed_to_unsigned_Bad+0x27>
mov    -0x18(%rbp),%rax
movb   $0x0,-0xa(%rbp,%rax,1)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @cast_signed_to_unsigned_Bad() {
%1 = alloca [10 x i8]
%2 = alloca i32
%3 = alloca i64
store i32 -1, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = icmp ugt i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %0
%9 = load i64, i64* %3
%10 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 %9
store i8 0, i8* %10
br label %11
11: ; preds = %8, %0
ret void
}

LLVM IR (-O2):
define void @cast_signed_to_unsigned_Bad() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ spoiler_out_n_chars(int, char);
void spoiler_blanklines(int n) { spoiler_out_n_chars(n, '\n'); }


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

x86 assembly (clang, -O2):
<spoiler_blanklines>:
mov    $0xa,%esi
jmp    1030 <spoiler_out_n_chars@plt>

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

LLVM IR (-O2):
define void @spoiler_blanklines(i32 %0) {
%2 = tail call i32 @spoiler_out_n_chars(i32 %0, i8 signext 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gen_Xgraph(int /*<<< orphan*/, int);
void IF_ytXgraph(void) { gen_Xgraph(0, 1); }


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

x86 assembly (clang, -O2):
<IF_ytXgraph>:
xor    %edi,%edi
mov    $0x1,%esi
jmp    1030 <gen_Xgraph@plt>

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

LLVM IR (-O2):
define void @IF_ytXgraph() {
%1 = tail call i32 @gen_Xgraph(i32 0, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ check_arg(int, char const **);
int /*<<< orphan*/ do_file(char const *, char const *const *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(int argc, const char *argv[]) {
  const char *const *paramlist = (const char *const *)&argv[2];
  const char *filename = (const char *)argv[1];
  check_arg(argc, argv);
  do_file(filename, paramlist);
  exit(EXIT_SUCCESS);
}


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    -0x10(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <check_arg@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <do_file@plt>
mov    0x2e62(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0x10(%rsi),%r14
mov    0x8(%rsi),%rbx
call   1040 <check_arg@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <do_file@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8**
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 2
store i8** %9, i8*** %6
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
store i8* %12, i8** %7
%13 = load i32, i32* %4
%14 = load i8**, i8*** %5
%15 = call i32 @check_arg(i32 %13, i8** %14)
%16 = load i8*, i8** %7
%17 = load i8**, i8*** %6
%18 = call i32 @do_file(i8* %16, i8** %17)
%19 = load i32, i32* @EXIT_SUCCESS
%20 = call i32 @exit(i32 %19)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 2
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = tail call i32 @check_arg(i32 %0, i8** %1)
%7 = tail call i32 @do_file(i8* %5, i8** %3)
%8 = load i32, i32* @EXIT_SUCCESS
%9 = tail call i32 @exit(i32 %8)
unreachable
}
/* Type definitions */
typedef scalar_t__ uint16_t;

/* Variables and functions */
uint16_t zig_subw_u16(uint16_t lhs, uint16_t rhs, uint16_t max) {
  if (lhs < rhs) {
    return max - rhs - lhs + 1;
  } else {
    return lhs - rhs;
  }
}


x86 assembly (clang, -O0):
<zig_subw_u16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    1137 <zig_subw_u16+0x37>
mov    -0x20(%rbp),%rax
sub    -0x18(%rbp),%rax
sub    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1143 <zig_subw_u16+0x43>
mov    -0x10(%rbp),%rax
sub    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zig_subw_u16>:
sub    %rdi,%rdx
sub    %rsi,%rdx
lea    0x1(%rdx),%rax
sub    %rsi,%rdi
cmovge %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @zig_subw_u16(i64 %0, i64 %1, i64 %2) {
%4 = icmp slt i64 %0, %1
%5 = add i64 %0, %1
%6 = sub i64 1, %5
%7 = add i64 %6, %2
%8 = sub nsw i64 %0, %1
%9 = select i1 %4, i64 %7, i64 %8
ret i64 %9
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int stack_mode;
};
typedef TYPE_1__ XWindowChanges;

/* Variables and functions */
void set_XWindowChanges_stack_mode(void *_p, int _v) {
  ((XWindowChanges *)_p)->stack_mode = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XWindowChanges_stack_mode>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XWindowChanges_stack_mode(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t rotl32(const uint32_t x, const int b) {
  return (x << b) | (x >> (32 - b));
}


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

x86 assembly (clang, -O2):
<rotl32>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
sar    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rotl32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 32, %9
%11 = ashr i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rotl32(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub nsw i32 32, %1
%5 = ashr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_client_conf_free() {
  printf("NOT IMPLEMENTED:"
         "pa_client_conf_free"
         "\n");
}


x86 assembly (clang, -O0):
<pa_client_conf_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [37 x i8] c"NOT IMPLEMENTED:pa_client_conf_free\0A\00"
define i32 @pa_client_conf_free() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [36 x i8] c"NOT IMPLEMENTED:pa_client_conf_free\00"
define i32 @pa_client_conf_free() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
OP(dd, ed) {
  illegal_1();
  op_ed();
}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_1@plt>
mov    $0x0,%al
call   1040 <op_ed@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP>:
push   %rax
xor    %eax,%eax
call   1030 <illegal_1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <op_ed@plt>

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_ed()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ EAGAIN;
int /*<<< orphan*/ errno;
int _fork(void) {
  errno = EAGAIN;
  return -1;
}


x86 assembly (clang, -O0):
<_fork>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%ecx
mov    0x2ecc(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_fork>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EAGAIN = global i32 0
@errno = global i32 0
define i32 @_fork() {
%1 = load i32, i32* @EAGAIN
store i32 %1, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EAGAIN = global i32 0
@errno = global i32 0
define i32 @_fork() {
%1 = load i32, i32* @EAGAIN
store i32 %1, i32* @errno
ret i32 -1
}
/* Variables and functions */
int O_CREAT;
int O_EXCL;
int O_TRUNC;
int O_WRONLY;
int open(char const *, int, int);
int open_excl(const char *filename) {
  return open(filename, O_WRONLY | 0 | O_TRUNC | O_CREAT | O_EXCL, 0600);
}


x86 assembly (clang, -O0):
<open_excl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
or     $0x0,%esi
mov    0x2ebd(%rip),%rax
or     (%rax),%esi
mov    0x2ebc(%rip),%rax
or     (%rax),%esi
mov    0x2e8b(%rip),%rax
or     (%rax),%esi
mov    $0x180,%edx
call   1030 <open@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_excl>:
mov    0x2ea9(%rip),%rax
mov    0x2ed2(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2ecf(%rip),%rax
or     (%rax),%esi
mov    0x2e9e(%rip),%rax
or     (%rax),%esi
mov    $0x180,%edx
jmp    1030 <open@plt>

LLVM IR (-O0):
@O_WRONLY = global i32 0
@O_TRUNC = global i32 0
@O_CREAT = global i32 0
@O_EXCL = global i32 0
define i32 @open_excl(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @O_WRONLY
%5 = or i32 %4, 0
%6 = load i32, i32* @O_TRUNC
%7 = or i32 %5, %6
%8 = load i32, i32* @O_CREAT
%9 = or i32 %7, %8
%10 = load i32, i32* @O_EXCL
%11 = or i32 %9, %10
%12 = call i32 @open(i8* %3, i32 %11, i32 384)
ret i32 %12
}

LLVM IR (-O2):
@O_WRONLY = global i32 0
@O_TRUNC = global i32 0
@O_CREAT = global i32 0
@O_EXCL = global i32 0
define i32 @open_excl(i8* nocapture %0) {
%2 = load i32, i32* @O_WRONLY
%3 = load i32, i32* @O_TRUNC
%4 = or i32 %3, %2
%5 = load i32, i32* @O_CREAT
%6 = or i32 %4, %5
%7 = load i32, i32* @O_EXCL
%8 = or i32 %6, %7
%9 = tail call i32 @open(i8* %0, i32 %8, i32 384)
ret i32 %9
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ TIOCSPGRP;
int ioctl(int, int /*<<< orphan*/, int *);
int tcsetpgrp(int fd, pid_t pgrp) {
  int s;
  s = pgrp;
  return (ioctl(fd, TIOCSPGRP, &s));
}


x86 assembly (clang, -O0):
<tcsetpgrp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb2(%rip),%rax
mov    (%rax),%esi
lea    -0xc(%rbp),%rdx
call   1030 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcsetpgrp>:
push   %rax
mov    %esi,0x4(%rsp)
mov    0x2ec4(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdx
call   1030 <ioctl@plt>
pop    %rcx
ret

LLVM IR (-O0):
@TIOCSPGRP = global i32 0
define i32 @tcsetpgrp(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
store i32 %6, i32* %5
%7 = load i32, i32* %3
%8 = load i32, i32* @TIOCSPGRP
%9 = call i32 @ioctl(i32 %7, i32 %8, i32* %5)
ret i32 %9
}

LLVM IR (-O2):
@TIOCSPGRP = global i32 0
define i32 @tcsetpgrp(i32 %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 %1, i32* %3
%5 = load i32, i32* @TIOCSPGRP
%6 = call i32 @ioctl(i32 %0, i32 %5, i32* %3)
ret i32 %6
}
char *strcat(char *s1, const char *s2) {
  char *t;
  t = s1;
  while (*s1 != '\0')
    ++s1;
  while ((*s1++ = *s2++) != '\0')
    ;
  return t;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1135 <strcat+0x35>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <strcat+0x14>
jmp    113a <strcat+0x3a>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     116d <strcat+0x6d>
jmp    113a <strcat+0x3a>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <strcat+0x10>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rdx,1),%edi
mov    %dil,-0x1(%rcx,%rdx,1)
add    $0x1,%rdx
test   %dil,%dil
jne    1120 <strcat+0x20>
ret

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

LLVM IR (-O2):
define i8* @strcat(i8* returned %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %11, %8 ], [ %1, %3 ]
%10 = phi i8* [ %13, %8 ], [ %4, %3 ]
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = load i8, i8* %9
%13 = getelementptr inbounds i8, i8* %10, i64 1
store i8 %12, i8* %10
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ fail(char *);
void *malloc(int);
void *xmalloc(int size) {
  void *mem = malloc(size);
  if (mem == NULL)
    fail("Out of memory");
  return mem;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114e <xmalloc+0x2e>
lea    0xeb7(%rip),%rdi
call   1030 <fail@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <xmalloc+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <fail@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Out of memory\00"
define i8* @xmalloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @fail(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [14 x i8] c"Out of memory\00"
define noalias i8* @xmalloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @fail(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_14626() {
  Assert_real((isqrt(14626) == 120),
              "/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",
              1590, ("Integer square root of 14626 should be 120"));
}


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

x86 assembly (clang, -O2):
<t_sqrt_14626>:
push   %rax
mov    $0x3922,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x78,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x636,%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 = [43 x i8] c"Integer square root of 14626 should be 120\00"
define void @t_sqrt_14626() {
%1 = call i32 @isqrt(i32 14626)
%2 = icmp eq i32 %1, 120
%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 1590, i8* getelementptr inbounds ([43 x i8], [43 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 = [43 x i8] c"Integer square root of 14626 should be 120\00"
define void @t_sqrt_14626() {
%1 = tail call i32 @isqrt(i32 14626)
%2 = icmp eq i32 %1, 120
%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 1590, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gpio_set_value(int, int);
void module_speaker_play(void) { gpio_set_value(23, 1); }


x86 assembly (clang, -O0):
<module_speaker_play>:
push   %rbp
mov    %rsp,%rbp
mov    $0x17,%edi
mov    $0x1,%esi
call   1030 <gpio_set_value@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<module_speaker_play>:
mov    $0x17,%edi
mov    $0x1,%esi
jmp    1030 <gpio_set_value@plt>

LLVM IR (-O0):
define void @module_speaker_play() {
%1 = call i32 @gpio_set_value(i32 23, i32 1)
ret void
}

LLVM IR (-O2):
define void @module_speaker_play() {
%1 = tail call i32 @gpio_set_value(i32 23, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ *strchr(char *, char);
int char_is_white(char ch) { return strchr(" \t\n\v\f\r\240\000", ch) != NULL; }


x86 assembly (clang, -O0):
<char_is_white>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_is_white>:
push   %rax
mov    %edi,%esi
lea    0xee6(%rip),%rdi
call   1030 <strchr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c" \09\0A\0B\0C\0D\A0\00\00"
define i32 @char_is_white(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32* @strchr(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8 signext %3)
%5 = icmp ne i32* %4, null
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [9 x i8] c" \09\0A\0B\0C\0D\A0\00\00"
define i32 @char_is_white(i8 signext %0) {
%2 = tail call i32* @strchr(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8 signext %0)
%3 = icmp ne i32* %2, null
%4 = zext i1 %3 to i32
ret i32 %4
}
void av_opt_find2() {}


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

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

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

LLVM IR (-O2):
define void @av_opt_find2() {
ret void
}
__float128 calc2(__float128 num) {
  __float128 num2 = ((num) - (power_of_two(60 - 1)));
  __float128 ret;
  ret = calc3(num2);
  return ret;
}


x86 assembly (clang, -O0):
<calc2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movaps %xmm0,-0x10(%rbp)
movaps -0x10(%rbp),%xmm0
movaps %xmm0,-0x40(%rbp)
xor    %eax,%eax
mov    $0x3b,%edi
call   1040 <power_of_two@plt>
mov    %eax,%edi
call   24c0 <__floatsitf>
movaps %xmm0,%xmm1
movaps -0x40(%rbp),%xmm0
call   1180 <__subtf3>
movaps %xmm0,-0x20(%rbp)
movaps -0x20(%rbp),%xmm0
mov    $0x1,%al
call   1030 <calc3@plt>
mov    %eax,%edi
call   24c0 <__floatsitf>
movaps %xmm0,-0x30(%rbp)
movaps -0x30(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret
nopw   0x0(%rax,%rax,1)

x86 assembly (clang, -O2):
<calc2>:
sub    $0x18,%rsp
movaps %xmm0,(%rsp)
mov    $0x3b,%edi
xor    %eax,%eax
call   1040 <power_of_two@plt>
mov    %eax,%edi
call   24a0 <__floatsitf>
movaps %xmm0,%xmm1
movaps (%rsp),%xmm0
call   1160 <__subtf3>
mov    $0x1,%al
call   1030 <calc3@plt>
mov    %eax,%edi
call   24a0 <__floatsitf>
add    $0x18,%rsp
ret
nopw   0x0(%rax,%rax,1)

LLVM IR (-O0):
define fp128 @calc2(fp128 %0) {
%2 = alloca fp128
%3 = alloca fp128
%4 = alloca fp128
store fp128 %0, fp128* %2
%5 = load fp128, fp128* %2
%6 = call i32 (i32, ...) bitcast (i32 (...)* @power_of_two to i32 (i32, ...)*)(i32 59)
%7 = sitofp i32 %6 to fp128
%8 = fsub fp128 %5, %7
store fp128 %8, fp128* %3
%9 = load fp128, fp128* %3
%10 = call i32 (fp128, ...) bitcast (i32 (...)* @calc3 to i32 (fp128, ...)*)(fp128 %9)
%11 = sitofp i32 %10 to fp128
store fp128 %11, fp128* %4
%12 = load fp128, fp128* %4
ret fp128 %12
}

LLVM IR (-O2):
define fp128 @calc2(fp128 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @power_of_two to i32 (i32, ...)*)(i32 59)
%3 = sitofp i32 %2 to fp128
%4 = fsub fp128 %0, %3
%5 = tail call i32 (fp128, ...) bitcast (i32 (...)* @calc3 to i32 (fp128, ...)*)(fp128 %4)
%6 = sitofp i32 %5 to fp128
ret fp128 %6
}
/* Type definitions */
struct timespec {
  int tv_nsec;
  scalar_t__ tv_sec;
};
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
int64_t get_realtime() {
  int64_t real_time;
  struct timespec tp;
  clock_gettime(CLOCK_REALTIME, &tp);
  real_time = (int64_t)tp.tv_sec * 1000000 + tp.tv_nsec / 1000;
  return real_time;
}


x86 assembly (clang, -O0):
<get_realtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    -0x18(%rbp),%rsi
call   1030 <clock_gettime@plt>
mov    -0x10(%rbp),%rax
imul   $0xf4240,%eax,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_realtime>:
sub    $0x18,%rsp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
imul   $0xf4240,0x10(%rsp),%ecx
movslq 0x8(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
add    %ecx,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
@CLOCK_REALTIME = global i32 0
define i32 @get_realtime() {
%1 = alloca i32
%2 = alloca %struct.timespec
%3 = load i32, i32* @CLOCK_REALTIME
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %2)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 1
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = mul nsw i32 %7, 1000000
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 0
%10 = load i32, i32* %9
%11 = sdiv i32 %10, 1000
%12 = add nsw i32 %8, %11
store i32 %12, i32* %1
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
@CLOCK_REALTIME = global i32 0
define i32 @get_realtime() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_REALTIME
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = mul nsw i32 %7, 1000000
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%10 = load i32, i32* %9
%11 = sdiv i32 %10, 1000
%12 = add nsw i32 %8, %11
ret i32 %12
}
int get_biggest_knife(int mountain, int climber) {
  int c;
  for (c = climber; c <= mountain; c = c * 10 + climber)
    ;
  return c / 10;
}


x86 assembly (clang, -O0):
<get_biggest_knife>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1130 <get_biggest_knife+0x30>
jmp    1121 <get_biggest_knife+0x21>
imul   $0xa,-0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1110 <get_biggest_knife+0x10>
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_biggest_knife>:
cmp    %edi,%esi
jle    1108 <get_biggest_knife+0x8>
mov    %esi,%eax
jmp    111a <get_biggest_knife+0x1a>
mov    %esi,%eax
nopw   0x0(%rax,%rax,1)
lea    (%rax,%rax,4),%eax
lea    (%rsi,%rax,2),%eax
cmp    %edi,%eax
jle    1110 <get_biggest_knife+0x10>
cltq
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @get_biggest_knife(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, %0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = mul nsw i32 %5, 10
%7 = add nsw i32 %6, %1
%8 = icmp sgt i32 %7, %0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %1, %2 ], [ %7, %4 ]
%11 = sdiv i32 %10, 10
ret i32 %11
}
/* Variables and functions */
int price_lz(int, int, int);
int price_replen(int);
int price_replz_minus_lz(int offset, int length, int used) {
  int res = 2 + price_replen(length + 2 - 1);
  return res - price_lz(offset, length, used);
}


x86 assembly (clang, -O0):
<price_replz_minus_lz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%edi
add    $0x2,%edi
sub    $0x1,%edi
call   1030 <price_replen@plt>
add    $0x2,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1040 <price_lz@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
sub    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<price_replz_minus_lz>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%ebx
mov    %edi,%r15d
lea    0x1(%rbx),%edi
call   1030 <price_replen@plt>
mov    %eax,%ebp
mov    %r15d,%edi
mov    %ebx,%esi
mov    %r14d,%edx
call   1040 <price_lz@plt>
sub    %eax,%ebp
add    $0x2,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @price_replz_minus_lz(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 = add nsw i32 %8, 2
%10 = sub nsw i32 %9, 1
%11 = call i32 @price_replen(i32 %10)
%12 = add nsw i32 2, %11
store i32 %12, i32* %7
%13 = load i32, i32* %7
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = load i32, i32* %6
%17 = call i32 @price_lz(i32 %14, i32 %15, i32 %16)
%18 = sub nsw i32 %13, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @price_replz_minus_lz(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, 1
%5 = tail call i32 @price_replen(i32 %4)
%6 = add nsw i32 %5, 2
%7 = tail call i32 @price_lz(i32 %0, i32 %1, i32 %2)
%8 = sub i32 %6, %7
ret i32 %8
}
void demo_classifier(char *datacfg, char *cfgfile, char *weightfile,
                     int cam_index, const char *filename) {}


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

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

LLVM IR (-O0):
define void @demo_classifier(i8* %0, i8* %1, i8* %2, i32 %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i8* %4, i8** %10
ret void
}

LLVM IR (-O2):
define void @demo_classifier(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2, i32 %3, i8* nocapture %4) {
ret void
}
/* Variables and functions */
void *calloc(int, int);
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ memcpy(void *, void *, int);
void swap(void *p1, void *p2, int size) {
  void *tmp = calloc(sizeof(char), size);
  memcpy(tmp, p1, size);
  memcpy(p1, p2, size);
  memcpy(p2, tmp, size);
  free(tmp);
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%esi
mov    $0x1,%edi
call   1040 <calloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1050 <memcpy@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1050 <memcpy@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1050 <memcpy@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rsi,%r14
mov    %rdi,%r15
mov    $0x1,%edi
mov    %edx,%esi
call   1040 <calloc@plt>
mov    %rax,%r12
mov    %rax,%rdi
mov    %r15,%rsi
mov    %ebx,%edx
call   1050 <memcpy@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1050 <memcpy@plt>
mov    %r14,%rdi
mov    %r12,%rsi
mov    %ebx,%edx
call   1050 <memcpy@plt>
mov    %r12,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @swap(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = call i8* @calloc(i32 1, i32 %8)
store i8* %9, i8** %7
%10 = load i8*, i8** %7
%11 = load i8*, i8** %4
%12 = load i32, i32* %6
%13 = call i32 @memcpy(i8* %10, i8* %11, i32 %12)
%14 = load i8*, i8** %4
%15 = load i8*, i8** %5
%16 = load i32, i32* %6
%17 = call i32 @memcpy(i8* %14, i8* %15, i32 %16)
%18 = load i8*, i8** %5
%19 = load i8*, i8** %7
%20 = load i32, i32* %6
%21 = call i32 @memcpy(i8* %18, i8* %19, i32 %20)
%22 = load i8*, i8** %7
%23 = call i32 @free(i8* %22)
ret void
}

LLVM IR (-O2):
define void @swap(i8* %0, i8* %1, i32 %2) {
%4 = tail call i8* @calloc(i32 1, i32 %2)
%5 = tail call i32 @memcpy(i8* %4, i8* %0, i32 %2)
%6 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %2)
%7 = tail call i32 @memcpy(i8* %1, i8* %4, i32 %2)
%8 = tail call i32 @free(i8* %4)
ret void
}
/* Variables and functions */
float __infer_nondet_float();
float nextafterf(float x, float y) { return __infer_nondet_float(); }


x86 assembly (clang, -O0):
<nextafterf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_float@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define float @nextafterf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = call float (...) @__infer_nondet_float()
ret float %5
}

LLVM IR (-O2):
define float @nextafterf(float %0, float %1) {
%3 = tail call float (...) @__infer_nondet_float()
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ assert(void *);
unsigned char *least_significant_byte(void *p_memory) {
  assert(p_memory);
  unsigned char *p_least_significant = NULL;
  p_least_significant = (unsigned char *)p_memory;
  return p_least_significant;
}


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

x86 assembly (clang, -O2):
<least_significant_byte>:
push   %rbx
mov    %rdi,%rbx
call   1030 <assert@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @least_significant_byte(i8* returned %0) {
%2 = tail call i32 @assert(i8* %0)
ret i8* %0
}
int cast_long_int(long int x) { return (int)x; }


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

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

LLVM IR (-O0):
define i32 @cast_long_int(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @cast_long_int(i64 %0) {
%2 = trunc i64 %0 to i32
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printNewline(int);
int /*<<< orphan*/ printint(int);
void addRemoveParameter() {
  printint(1);
  printNewline(1);
}


x86 assembly (clang, -O0):
<addRemoveParameter>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <printint@plt>
mov    $0x1,%edi
call   1040 <printNewline@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<addRemoveParameter>:
push   %rax
mov    $0x1,%edi
call   1030 <printint@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <printNewline@plt>

LLVM IR (-O0):
define void @addRemoveParameter() {
%1 = call i32 @printint(i32 1)
%2 = call i32 @printNewline(i32 1)
ret void
}

LLVM IR (-O2):
define void @addRemoveParameter() {
%1 = tail call i32 @printint(i32 1)
%2 = tail call i32 @printNewline(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ signal(int /*<<< orphan*/, void (*)(int));
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, int);
void handle_sigint(int sig) {
  write(STDOUT_FILENO, "\n", 1);
  write(STDOUT_FILENO, " COMMAND-> ", 11);
  signal(SIGINT, handle_sigint);
}


x86 assembly (clang, -O0):
<handle_sigint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
lea    0xead(%rip),%rsi
mov    $0xb,%edx
call   1030 <write@plt>
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
mov    0x2e59(%rip),%rsi
call   1040 <signal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_sigint>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    (%rbx),%edi
lea    0xebe(%rip),%rsi
mov    $0xb,%edx
call   1030 <write@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
mov    0x2e6a(%rip),%rsi
pop    %rbx
jmp    1040 <signal@plt>

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
@.str = [2 x i8] c"\0A\00"
@.str.1 = [12 x i8] c" COMMAND-> \00"
@SIGINT = global i32 0
define void @handle_sigint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @STDOUT_FILENO
%4 = call i32 @write(i32 %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%5 = load i32, i32* @STDOUT_FILENO
%6 = call i32 @write(i32 %5, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 11)
%7 = load i32, i32* @SIGINT
%8 = call i32 @signal(i32 %7, void (i32)* @handle_sigint)
ret void
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
@.str = [2 x i8] c"\0A\00"
@.str.1 = [12 x i8] c" COMMAND-> \00"
@SIGINT = global i32 0
define void @handle_sigint(i32 %0) {
%2 = load i32, i32* @STDOUT_FILENO
%3 = tail call i32 @write(i32 %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = load i32, i32* @STDOUT_FILENO
%5 = tail call i32 @write(i32 %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 11)
%6 = load i32, i32* @SIGINT
%7 = tail call i32 @signal(i32 %6, void (i32)* @handle_sigint)
ret void
}