xunge/DecIR huggingface dataset:
int can_seek(void *id) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @can_seek(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int recv(int, char *, int, int /*<<< orphan*/);
void waitRsp(int fd, char *buf, int len) {
  int ret;
  ret = recv(fd, buf, len - 1, 0);
  if (ret < 0) {
    perror("receiving response");
    exit(1);
  }
  buf[ret] = '\0';
}


x86 assembly (clang, -O0):
<waitRsp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    1179 <waitRsp+0x49>
lea    0xe96(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<waitRsp>:
push   %rbx
mov    %rsi,%rbx
add    $0xffffffff,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
test   %eax,%eax
js     114a <waitRsp+0x1a>
mov    %eax,%eax
movb   $0x0,(%rbx,%rax,1)
pop    %rbx
ret
lea    0xeaf(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [19 x i8] c"receiving response\00"
define void @waitRsp(i32 %0, i8* %1, i32 %2) {
%4 = add nsw i32 %2, -1
%5 = tail call i32 @recv(i32 %0, i8* %1, i32 %4, i32 0)
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = tail call i32 @perror(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %3
%11 = zext i32 %5 to i64
%12 = getelementptr inbounds i8, i8* %1, i64 %11
store i8 0, i8* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ intercambio(int, int);
int /*<<< orphan*/ printf(char *, int, int);
main() {
  int a = 20, b = 30;
  intercambio(a, b);
  printf("a vale %d y b vale %d\n", a, b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x14,-0x4(%rbp)
movl   $0x1e,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <intercambio@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeb2(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x14,%edi
mov    $0x1e,%esi
call   1030 <intercambio@plt>
lea    0xec9(%rip),%rdi
mov    $0x14,%esi
mov    $0x1e,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"a vale %d y b vale %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 20, i32* %1
store i32 30, i32* %2
%3 = load i32, i32* %1
%4 = load i32, i32* %2
%5 = call i32 @intercambio(i32 %3, i32 %4)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"a vale %d y b vale %d\0A\00"
define i32 @main() {
%1 = tail call i32 @intercambio(i32 20, i32 30)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 20, i32 30)
ret i32 0
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int connect(int, struct sockaddr const *, int /*<<< orphan*/);
__attribute__((weak)) int
__real_connect(int fd, const struct sockaddr *serv_addr, socklen_t addrlen) {
  return connect(fd, serv_addr, addrlen);
}


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

x86 assembly (clang, -O2):
<__real_connect>:
jmp    1030 <connect@plt>

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define weak i32 @__real_connect(i32 %0, %struct.sockaddr* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.sockaddr*
%6 = alloca i32
store i32 %0, i32* %4
store %struct.sockaddr* %1, %struct.sockaddr** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load %struct.sockaddr*, %struct.sockaddr** %5
%9 = load i32, i32* %6
%10 = call i32 @connect(i32 %7, %struct.sockaddr* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define weak i32 @__real_connect(i32 %0, %struct.sockaddr* %1, i32 %2) {
%4 = tail call i32 @connect(i32 %0, %struct.sockaddr* %1, i32 %2)
ret i32 %4
}
char *copy(str)
register char *str;
{
  register char *p = malloc(strlen(str) + 1);
  strcpy(p, str);
  return (p);
}


x86 assembly (clang, -O0):
<copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @copy(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add i64 %5, 1
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i8* @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @copy(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i8* @strcpy(i8* dereferenceable(1) %4, i8* dereferenceable(1) %0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ Proc0();
main() {
  Proc0();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <Proc0@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @Proc0()
ret i32 0
}
void POMP2_Init() {}


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

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

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

LLVM IR (-O2):
define void @POMP2_Init() {
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int state;
};
struct TYPE_4__ {
  TYPE_1__ xcolormap;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xcolormap_state(void *_p, int _v) {
  ((XEvent *)_p)->xcolormap.state = (int)_v;
}


x86 assembly (clang, -O0):
<set_XEvent_xcolormap_state>:
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_XEvent_xcolormap_state>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
define void @set_XEvent_xcolormap_state(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_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xcolormap_state(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
scalar_t__ jdns_alloc(int);
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char const *, int);
unsigned char *jdns_copy_array(const unsigned char *src, int size) {
  unsigned char *out;
  if (size <= 0)
    return 0;
  out = (unsigned char *)jdns_alloc(size);
  memcpy(out, src, size);
  return out;
}


x86 assembly (clang, -O0):
<jdns_copy_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jg     1146 <jdns_copy_array+0x26>
movq   $0x0,-0x8(%rbp)
jmp    116a <jdns_copy_array+0x4a>
mov    -0x14(%rbp),%edi
call   1040 <jdns_alloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jdns_copy_array>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    1146 <jdns_copy_array+0x26>
mov    %esi,%ebp
mov    %rdi,%r14
mov    %esi,%edi
call   1040 <jdns_alloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1030 <memcpy@plt>
jmp    1148 <jdns_copy_array+0x28>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @jdns_copy_array(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
%7 = load i32, i32* %5
%8 = icmp sle i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %2
store i8* null, i8** %3
br label %19
10: ; preds = %2
%11 = load i32, i32* %5
%12 = call i64 @jdns_alloc(i32 %11)
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %6
%14 = load i8*, i8** %6
%15 = load i8*, i8** %4
%16 = load i32, i32* %5
%17 = call i32 @memcpy(i8* %14, i8* %15, i32 %16)
%18 = load i8*, i8** %6
store i8* %18, i8** %3
br label %19
19: ; preds = %10, %9
%20 = load i8*, i8** %3
ret i8* %20
}

LLVM IR (-O2):
define i8* @jdns_copy_array(i8* %0, i32 %1) {
%3 = icmp slt i32 %1, 1
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = tail call i64 @jdns_alloc(i32 %1)
%6 = inttoptr i64 %5 to i8*
%7 = tail call i32 @memcpy(i8* %6, i8* %0, i32 %1)
br label %8
8: ; preds = %2, %4
%9 = phi i8* [ %6, %4 ], [ null, %2 ]
ret i8* %9
}
void pc_dump(int level) {}


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

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

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

LLVM IR (-O2):
define void @pc_dump(i32 %0) {
ret void
}
int vde_chain_nm5_work(int *sz_arg, int *sz_res, int *sz_iw, int *sz_w) {
  if (sz_arg)
    *sz_arg = 4;
  if (sz_res)
    *sz_res = 3;
  if (sz_iw)
    *sz_iw = 0;
  if (sz_w)
    *sz_w = 59;
  return 0;
}


x86 assembly (clang, -O0):
<vde_chain_nm5_work>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1129 <vde_chain_nm5_work+0x29>
mov    -0x8(%rbp),%rax
movl   $0x4,(%rax)
cmpq   $0x0,-0x10(%rbp)
je     113e <vde_chain_nm5_work+0x3e>
mov    -0x10(%rbp),%rax
movl   $0x3,(%rax)
cmpq   $0x0,-0x18(%rbp)
je     1153 <vde_chain_nm5_work+0x53>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
cmpq   $0x0,-0x20(%rbp)
je     1168 <vde_chain_nm5_work+0x68>
mov    -0x20(%rbp),%rax
movl   $0x3b,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vde_chain_nm5_work>:
test   %rdi,%rdi
je     110b <vde_chain_nm5_work+0xb>
movl   $0x4,(%rdi)
test   %rsi,%rsi
je     1116 <vde_chain_nm5_work+0x16>
movl   $0x3,(%rsi)
test   %rdx,%rdx
je     1121 <vde_chain_nm5_work+0x21>
movl   $0x0,(%rdx)
test   %rcx,%rcx
je     112c <vde_chain_nm5_work+0x2c>
movl   $0x3b,(%rcx)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @vde_chain_nm5_work(i32* writeonly %0, i32* writeonly %1, i32* writeonly %2, i32* writeonly %3) {
%5 = icmp eq i32* %0, null
br i1 %5, label %7, label %6
6: ; preds = %4
store i32 4, i32* %0
br label %7
7: ; preds = %6, %4
%8 = icmp eq i32* %1, null
br i1 %8, label %10, label %9
9: ; preds = %7
store i32 3, i32* %1
br label %10
10: ; preds = %9, %7
%11 = icmp eq i32* %2, null
br i1 %11, label %13, label %12
12: ; preds = %10
store i32 0, i32* %2
br label %13
13: ; preds = %12, %10
%14 = icmp eq i32* %3, null
br i1 %14, label %16, label %15
15: ; preds = %13
store i32 59, i32* %3
br label %16
16: ; preds = %15, %13
ret i32 0
}
/* Variables and functions */
int f();
int f2() { return f(); }


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

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

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

LLVM IR (-O2):
define i32 @f2() {
%1 = tail call i32 (...) @f()
ret i32 %1
}
/* Type definitions */
struct cyclicping_cfg {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ print_histogram_data(struct cyclicping_cfg *);
int /*<<< orphan*/ print_histogram_header(struct cyclicping_cfg *, int,
                                          char **);
void print_histogram(struct cyclicping_cfg *cfg, int argc, char *argv[]) {
  print_histogram_header(cfg, argc, argv);
  print_histogram_data(cfg);
}


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

x86 assembly (clang, -O2):
<print_histogram>:
push   %rbx
mov    %rdi,%rbx
call   1030 <print_histogram_header@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <print_histogram_data@plt>

LLVM IR (-O0):
%struct.cyclicping_cfg = type { i32 }
define void @print_histogram(%struct.cyclicping_cfg* %0, i32 %1, i8** %2) {
%4 = alloca %struct.cyclicping_cfg*
%5 = alloca i32
%6 = alloca i8**
store %struct.cyclicping_cfg* %0, %struct.cyclicping_cfg** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%7 = load %struct.cyclicping_cfg*, %struct.cyclicping_cfg** %4
%8 = load i32, i32* %5
%9 = load i8**, i8*** %6
%10 = call i32 @print_histogram_header(%struct.cyclicping_cfg* %7, i32 %8, i8** %9)
%11 = load %struct.cyclicping_cfg*, %struct.cyclicping_cfg** %4
%12 = call i32 @print_histogram_data(%struct.cyclicping_cfg* %11)
ret void
}

LLVM IR (-O2):
%struct.cyclicping_cfg = type { i32 }
define void @print_histogram(%struct.cyclicping_cfg* %0, i32 %1, i8** %2) {
%4 = tail call i32 @print_histogram_header(%struct.cyclicping_cfg* %0, i32 %1, i8** %2)
%5 = tail call i32 @print_histogram_data(%struct.cyclicping_cfg* %0)
ret void
}
void gdk_draw_indexed_image() {}


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

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

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

LLVM IR (-O2):
define void @gdk_draw_indexed_image() {
ret void
}
unsigned int _mpylhu(unsigned int src1, unsigned int src2) {
  return (unsigned short)src1 * (unsigned short)(src2 >> 16);
}


x86 assembly (clang, -O0):
<_mpylhu>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
movzwl %ax,%eax
mov    -0x8(%rbp),%ecx
shr    $0x10,%ecx
movzwl %cx,%ecx
imul   %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mpylhu>:
movzwl %di,%eax
shr    $0x10,%esi
imul   %esi,%eax
ret

LLVM IR (-O0):
define i32 @_mpylhu(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 = trunc i32 %5 to i16
%7 = zext i16 %6 to i32
%8 = load i32, i32* %4
%9 = lshr i32 %8, 16
%10 = trunc i32 %9 to i16
%11 = zext i16 %10 to i32
%12 = mul nsw i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @_mpylhu(i32 %0, i32 %1) {
%3 = and i32 %0, 65535
%4 = lshr i32 %1, 16
%5 = mul nuw nsw i32 %4, %3
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *const, char *);
void clean(const char *restrict const fileName) {
  FILE *fp;
  fp = fopen(fileName, "w");
  if (fp)
    fclose(fp);
}


x86 assembly (clang, -O0):
<clean>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1154 <clean+0x34>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clean>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     113b <clean+0x1b>
mov    %rax,%rdi
pop    %rax
jmp    1030 <fclose@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [2 x i8] c"w\00"
define void @clean(i8* noalias %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = icmp ne i32* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32*, i32** %3
%10 = call i32 @fclose(i32* %9)
br label %11
11: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
define void @clean(i8* noalias nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
unsigned int f10(unsigned int);
unsigned int f11(unsigned int a) { return f10(f10(a)); }


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

x86 assembly (clang, -O2):
<f11>:
push   %rax
call   1030 <f10@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <f10@plt>

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

LLVM IR (-O2):
define i32 @f11(i32 %0) {
%2 = tail call i32 @f10(i32 %0)
%3 = tail call i32 @f10(i32 %2)
ret i32 %3
}
void ls_costN_nm9_incref(void) {}


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

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

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

LLVM IR (-O2):
define void @ls_costN_nm9_incref() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert_int_equal(int, int /*<<< orphan*/);
int /*<<< orphan*/ b_east_lever(int, int);
void b_east_lever_test(void **state) {
  assert_int_equal(0x0000000400000000ul,
                   b_east_lever(0x0000000008000000ul, 0x0000000C00000000ul));
}


x86 assembly (clang, -O0):
<b_east_lever_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x8000000,%edi
xor    %esi,%esi
call   1030 <b_east_lever@plt>
mov    %eax,%esi
xor    %edi,%edi
call   1040 <assert_int_equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_east_lever_test>:
push   %rax
mov    $0x8000000,%edi
xor    %esi,%esi
call   1030 <b_east_lever@plt>
xor    %edi,%edi
mov    %eax,%esi
pop    %rax
jmp    1040 <assert_int_equal@plt>

LLVM IR (-O0):
define void @b_east_lever_test(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @b_east_lever(i32 134217728, i32 0)
%4 = call i32 @assert_int_equal(i32 0, i32 %3)
ret void
}

LLVM IR (-O2):
define void @b_east_lever_test(i8** nocapture readnone %0) {
%2 = tail call i32 @b_east_lever(i32 134217728, i32 0)
%3 = tail call i32 @assert_int_equal(i32 0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ utils_get_line(char const *, char *, size_t);
void ui_prompt(const char *prompt, char *command, size_t command_size) {
  utils_get_line(prompt, command, command_size);
}


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

x86 assembly (clang, -O2):
<ui_prompt>:
jmp    1030 <utils_get_line@plt>

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

LLVM IR (-O2):
define void @ui_prompt(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @utils_get_line(i8* %0, i8* %1, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printer_get_temperature();
int M105_f(char *s) {
  printer_get_temperature();
  return 1;
}


x86 assembly (clang, -O0):
<M105_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <printer_get_temperature@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M105_f>:
push   %rax
xor    %eax,%eax
call   1030 <printer_get_temperature@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @M105_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @printer_get_temperature()
ret i32 1
}

LLVM IR (-O2):
define i32 @M105_f(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @printer_get_temperature()
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_CIPHER;

/* Variables and functions */
int /*<<< orphan*/ const *EVP_des_cfb64();
const EVP_CIPHER *EVP_des_cfb(void) { return EVP_des_cfb64(); }


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

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

LLVM IR (-O0):
define i32* @EVP_des_cfb() {
%1 = call i32* (...) @EVP_des_cfb64()
ret i32* %1
}

LLVM IR (-O2):
define i32* @EVP_des_cfb() {
%1 = tail call i32* (...) @EVP_des_cfb64()
ret i32* %1
}
int f(const int *x) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @f(i32* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
__attribute__((section(".secure"))) int secure_main(int argc, char *argv[]) {
  printf("This was crypted!\n");
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<secure_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<secure_main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"This was crypted!\0A\00"
define i32 @secure_main(i32 %0, i8** %1) section ".secure" {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@str = [18 x i8] c"This was crypted!\00"
define i32 @secure_main(i32 %0, i8** nocapture readnone %1) section ".secure" {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @getchar()
ret i32 0
}
int copyLSB(int x) { return ((x << 31) >> 31); }


x86 assembly (clang, -O0):
<copyLSB>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1f,%eax
sar    $0x1f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<copyLSB>:
mov    %edi,%eax
and    $0x1,%eax
neg    %eax
ret

LLVM IR (-O0):
define i32 @copyLSB(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 31
%5 = ashr i32 %4, 31
ret i32 %5
}

LLVM IR (-O2):
define i32 @copyLSB(i32 %0) {
%2 = and i32 %0, 1
%3 = sub nsw i32 0, %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ clear_io_bit(int, int);
void TOSH_CLR_RFM_RXD_PIN() { clear_io_bit(0x37, 2); }


x86 assembly (clang, -O0):
<TOSH_CLR_RFM_RXD_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0x37,%edi
mov    $0x2,%esi
call   1030 <clear_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_CLR_RFM_RXD_PIN>:
mov    $0x37,%edi
mov    $0x2,%esi
jmp    1030 <clear_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_CLR_RFM_RXD_PIN() {
%1 = call i32 @clear_io_bit(i32 55, i32 2)
ret void
}

LLVM IR (-O2):
define void @TOSH_CLR_RFM_RXD_PIN() {
%1 = tail call i32 @clear_io_bit(i32 55, i32 2)
ret void
}
signed short read16(unsigned long reg1) {
  unsigned long *reg;
  signed short val;
  reg = reg1;
  val = (short)*(reg);
  return val;
}


x86 assembly (clang, -O0):
<read16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %ax,-0x12(%rbp)
movswl -0x12(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read16>:
movzwl (%rdi),%eax
ret

LLVM IR (-O0):
define signext i16 @read16(i64 %0) {
%2 = alloca i64
%3 = alloca i64*
%4 = alloca i16
store i64 %0, i64* %2
%5 = load i64, i64* %2
%6 = inttoptr i64 %5 to i64*
store i64* %6, i64** %3
%7 = load i64*, i64** %3
%8 = load i64, i64* %7
%9 = trunc i64 %8 to i16
store i16 %9, i16* %4
%10 = load i16, i16* %4
ret i16 %10
}

LLVM IR (-O2):
define signext i16 @read16(i64 %0) {
%2 = inttoptr i64 %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i16
ret i16 %4
}
/* Variables and functions */
int /*<<< orphan*/ appendCODE(int /*<<< orphan*/);
int /*<<< orphan*/ makeCODEireturn(int /*<<< orphan*/ *);
void code_ireturn() { appendCODE(makeCODEireturn(NULL)); }


x86 assembly (clang, -O0):
<code_ireturn>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <makeCODEireturn@plt>
mov    %eax,%edi
call   1030 <appendCODE@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<code_ireturn>:
push   %rax
xor    %edi,%edi
call   1040 <makeCODEireturn@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <appendCODE@plt>

LLVM IR (-O0):
define void @code_ireturn() {
%1 = call i32 @makeCODEireturn(i32* null)
%2 = call i32 @appendCODE(i32 %1)
ret void
}

LLVM IR (-O2):
define void @code_ireturn() {
%1 = tail call i32 @makeCODEireturn(i32* null)
%2 = tail call i32 @appendCODE(i32 %1)
ret void
}
int wpa_key_mgmt_wpa_psk(int akm) {
  return !!(akm & ((1 << (1)) | (1 << (6)) | (1 << (8)) | (1 << (10))));
}


x86 assembly (clang, -O0):
<wpa_key_mgmt_wpa_psk>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x542,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wpa_key_mgmt_wpa_psk>:
xor    %eax,%eax
test   $0x542,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @wpa_key_mgmt_wpa_psk(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 1346
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = xor i1 %6, true
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @wpa_key_mgmt_wpa_psk(i32 %0) {
%2 = and i32 %0, 1346
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int wint_t;

/* Variables and functions */
int /*<<< orphan*/ toupper(char);
wint_t towupper(wint_t c) {
  if (c > 0xff) {
    return c;
  }
  return (wint_t)toupper((char)c);
}


x86 assembly (clang, -O0):
<towupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0xff,-0x8(%rbp)
jle    1133 <towupper+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <towupper+0x31>
mov    -0x8(%rbp),%eax
movsbl %al,%edi
call   1030 <toupper@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<towupper>:
cmp    $0xff,%edi
jle    111b <towupper+0xb>
mov    %edi,%eax
ret
movsbl %dil,%edi
jmp    1030 <toupper@plt>

LLVM IR (-O0):
define i32 @towupper(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 255
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i32, i32* %3
store i32 %7, i32* %2
br label %12
8: ; preds = %1
%9 = load i32, i32* %3
%10 = trunc i32 %9 to i8
%11 = call i32 @toupper(i8 signext %10)
store i32 %11, i32* %2
br label %12
12: ; preds = %8, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @towupper(i32 %0) {
%2 = icmp sgt i32 %0, 255
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = trunc i32 %0 to i8
%5 = tail call i32 @toupper(i8 signext %4)
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ %0, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_4368() {
  Assert_real((isqrt(4368) == 66),
              "/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",
              1360, ("Integer square root of 4368 should be 66"));
}


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

x86 assembly (clang, -O2):
<t_sqrt_4368>:
push   %rax
mov    $0x1110,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x42,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x550,%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 = [41 x i8] c"Integer square root of 4368 should be 66\00"
define void @t_sqrt_4368() {
%1 = call i32 @isqrt(i32 4368)
%2 = icmp eq i32 %1, 66
%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 1360, i8* getelementptr inbounds ([41 x i8], [41 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 = [41 x i8] c"Integer square root of 4368 should be 66\00"
define void @t_sqrt_4368() {
%1 = tail call i32 @isqrt(i32 4368)
%2 = icmp eq i32 %1, 66
%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 1360, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int partition(int *, int, int);
void sort_quick_recursion(int a[], int start, int end) {
  if (start < end) {
    int mid = partition(a, start, end);
    sort_quick_recursion(a, start, mid - 1);
    sort_quick_recursion(a, mid + 1, end);
  }
}


x86 assembly (clang, -O0):
<sort_quick_recursion>:
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
jge    1174 <sort_quick_recursion+0x54>
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    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <sort_quick_recursion@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <sort_quick_recursion@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sort_quick_recursion>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <sort_quick_recursion+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <sort_quick_recursion@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <sort_quick_recursion+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @sort_quick_recursion(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 slt i32 %8, %9
br i1 %10, label %11, label %24
11: ; preds = %3
%12 = load i32*, i32** %4
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = call i32 @partition(i32* %12, i32 %13, i32 %14)
store i32 %15, i32* %7
%16 = load i32*, i32** %4
%17 = load i32, i32* %5
%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 = %11, %3
ret void
}

LLVM IR (-O2):
define void @sort_quick_recursion(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 @sort_quick_recursion(i32* %0, i32 %6, 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 /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ fwrite(char const *, int, size_t, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void itex2MML_default_write(const char *buffer, size_t length) {
  if (buffer) {
    if (length)
      fwrite(buffer, 1, length, stdout);
    else
      fputs(buffer, stdout);
  }
}


x86 assembly (clang, -O0):
<itex2MML_default_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     117d <itex2MML_default_write+0x5d>
cmpq   $0x0,-0x10(%rbp)
je     1166 <itex2MML_default_write+0x46>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    0x2e8b(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%esi
call   1040 <fwrite@plt>
jmp    1178 <itex2MML_default_write+0x58>
mov    -0x8(%rbp),%rdi
mov    0x2e6f(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
jmp    117d <itex2MML_default_write+0x5d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<itex2MML_default_write>:
test   %rdi,%rdi
je     1140 <itex2MML_default_write+0x20>
mov    %rsi,%rdx
mov    0x2eb1(%rip),%rax
mov    (%rax),%ecx
test   %rsi,%rsi
je     1141 <itex2MML_default_write+0x21>
mov    $0x1,%esi
jmp    1040 <fwrite@plt>
ret
mov    %ecx,%esi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @itex2MML_default_write(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 = icmp ne i8* %5, null
br i1 %6, label %7, label %20
7: ; preds = %2
%8 = load i64, i64* %4
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %7
%11 = load i8*, i8** %3
%12 = load i64, i64* %4
%13 = load i32, i32* @stdout
%14 = call i32 @fwrite(i8* %11, i32 1, i64 %12, i32 %13)
br label %19
15: ; preds = %7
%16 = load i8*, i8** %3
%17 = load i32, i32* @stdout
%18 = call i32 @fputs(i8* %16, i32 %17)
br label %19
19: ; preds = %15, %10
br label %20
20: ; preds = %19, %2
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @itex2MML_default_write(i8* %0, i64 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %11, label %4
4: ; preds = %2
%5 = icmp eq i64 %1, 0
%6 = load i32, i32* @stdout
br i1 %5, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @fwrite(i8* %0, i32 1, i64 %1, i32 %6)
br label %11
9: ; preds = %4
%10 = tail call i32 @fputs(i8* %0, i32 %6)
br label %11
11: ; preds = %7, %9, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
__attribute__((visibility("default"))) void Sleef_free(void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<Sleef_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @Sleef_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
double sin(double);
double sindeg(double x) { return sin(x * 3.141592 / 180.0); }


x86 assembly (clang, -O0):
<sindeg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xee3(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xece(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <sin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sindeg>:
mulsd  0xee8(%rip),%xmm0
divsd  0xee8(%rip),%xmm0
jmp    1030 <sin@plt>

LLVM IR (-O0):
define double @sindeg(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 0x400921FAFC8B007A
%5 = fdiv double %4, 1.800000e+02
%6 = call double @sin(double %5)
ret double %6
}

LLVM IR (-O2):
define double @sindeg(double %0) {
%2 = fmul double %0, 0x400921FAFC8B007A
%3 = fdiv double %2, 1.800000e+02
%4 = tail call double @sin(double %3)
ret double %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int, int, int);
void hsw_debug_wm_pipe(char *result, int len, int reg, uint32_t val,
                       uint32_t devid) {
  uint32_t primary, sprite, cursor;
  primary = (val >> 16) & 0x7F;
  sprite = (val >> 8) & 0x7F;
  cursor = val & 0x3F;
  snprintf(result, len, "primary %d, sprite %d, pipe %d", primary, sprite,
           cursor);
}


x86 assembly (clang, -O0):
<hsw_debug_wm_pipe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x14(%rbp),%eax
sar    $0x10,%eax
and    $0x7f,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
sar    $0x8,%eax
and    $0x7f,%eax
mov    %eax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
and    $0x3f,%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
mov    -0x24(%rbp),%r9d
lea    0xe9d(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hsw_debug_wm_pipe>:
mov    %ecx,%r9d
shr    $0x10,%ecx
and    $0x7f,%ecx
mov    %r9d,%r8d
shr    $0x8,%r8d
and    $0x7f,%r8d
and    $0x3f,%r9d
lea    0xed1(%rip),%rdx
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"primary %d, sprite %d, pipe %d\00"
define void @hsw_debug_wm_pipe(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%14 = load i32, i32* %9
%15 = ashr i32 %14, 16
%16 = and i32 %15, 127
store i32 %16, i32* %11
%17 = load i32, i32* %9
%18 = ashr i32 %17, 8
%19 = and i32 %18, 127
store i32 %19, i32* %12
%20 = load i32, i32* %9
%21 = and i32 %20, 63
store i32 %21, i32* %13
%22 = load i8*, i8** %6
%23 = load i32, i32* %7
%24 = load i32, i32* %11
%25 = load i32, i32* %12
%26 = load i32, i32* %13
%27 = call i32 @snprintf(i8* %22, i32 %23, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %24, i32 %25, i32 %26)
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"primary %d, sprite %d, pipe %d\00"
define void @hsw_debug_wm_pipe(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = lshr i32 %3, 16
%7 = and i32 %6, 127
%8 = lshr i32 %3, 8
%9 = and i32 %8, 127
%10 = and i32 %3, 63
%11 = tail call i32 @snprintf(i8* %0, i32 %1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %9, i32 %10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bootloader_enter_dfu();
int comm_cb_dfu(char *buf, int len) {
  (void)buf;
  (void)len;
  bootloader_enter_dfu();
  return 1;
}


x86 assembly (clang, -O0):
<comm_cb_dfu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <bootloader_enter_dfu@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<comm_cb_dfu>:
push   %rax
xor    %eax,%eax
call   1030 <bootloader_enter_dfu@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @comm_cb_dfu(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 (...) @bootloader_enter_dfu()
ret i32 1
}
int update_speed(unsigned int target_distance, unsigned int current_distance,
                 float gain) {
  float epsilon = gain * (-target_distance + current_distance);
  return (int)(epsilon);
}


x86 assembly (clang, -O0):
<update_speed>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%eax
sub    %ecx,%eax
cvtsi2ss %rax,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
cvttss2si -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_speed>:
sub    %edi,%esi
cvtsi2ss %rsi,%xmm1
mulss  %xmm0,%xmm1
cvttss2si %xmm1,%eax
ret

LLVM IR (-O0):
define i32 @update_speed(i32 %0, i32 %1, float %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca float
%7 = alloca float
store i32 %0, i32* %4
store i32 %1, i32* %5
store float %2, float* %6
%8 = load float, float* %6
%9 = load i32, i32* %4
%10 = sub i32 0, %9
%11 = load i32, i32* %5
%12 = add i32 %10, %11
%13 = uitofp i32 %12 to float
%14 = fmul float %8, %13
store float %14, float* %7
%15 = load float, float* %7
%16 = fptosi float %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @update_speed(i32 %0, i32 %1, float %2) {
%4 = sub i32 %1, %0
%5 = uitofp i32 %4 to float
%6 = fmul float %5, %2
%7 = fptosi float %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int open(char *, int /*<<< orphan*/);
int beaglelogic_open(void) { return open("/dev/beaglelogic", O_RDONLY); }


x86 assembly (clang, -O0):
<beaglelogic_open>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <open@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<beaglelogic_open>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <open@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"/dev/beaglelogic\00"
@O_RDONLY = global i32 0
define i32 @beaglelogic_open() {
%1 = load i32, i32* @O_RDONLY
%2 = call i32 @open(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@.str = [17 x i8] c"/dev/beaglelogic\00"
@O_RDONLY = global i32 0
define i32 @beaglelogic_open() {
%1 = load i32, i32* @O_RDONLY
%2 = tail call i32 @open(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %2
}
/* Variables and functions */
scalar_t__ get_first_call();
int /*<<< orphan*/ get_index();
int /*<<< orphan*/ get_semaphore();
int /*<<< orphan*/ set_first_call(int /*<<< orphan*/);
void get_state() {
  if (get_first_call()) {
    get_index();
    get_semaphore();
    set_first_call(0);
  }
}


x86 assembly (clang, -O0):
<get_state>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <get_first_call@plt>
cmp    $0x0,%rax
je     116a <get_state+0x2a>
mov    $0x0,%al
call   1040 <get_index@plt>
mov    $0x0,%al
call   1030 <get_semaphore@plt>
xor    %edi,%edi
call   1050 <set_first_call@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_state>:
push   %rax
xor    %eax,%eax
call   1060 <get_first_call@plt>
test   %rax,%rax
je     1163 <get_state+0x23>
xor    %eax,%eax
call   1040 <get_index@plt>
xor    %eax,%eax
call   1030 <get_semaphore@plt>
xor    %edi,%edi
pop    %rax
jmp    1050 <set_first_call@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @get_state() {
%1 = call i64 (...) @get_first_call()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = call i32 (...) @get_index()
%5 = call i32 (...) @get_semaphore()
%6 = call i32 @set_first_call(i32 0)
br label %7
7: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
define void @get_state() {
%1 = tail call i64 (...) @get_first_call()
%2 = icmp eq i64 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = tail call i32 (...) @get_index()
%5 = tail call i32 (...) @get_semaphore()
%6 = tail call i32 @set_first_call(i32 0)
br label %7
7: ; preds = %3, %0
ret void
}