xunge/DecIR huggingface dataset:
int div_int(int num1, int num2) { return num1 / num2; }


x86 assembly (clang, -O0):
<div_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<div_int>:
mov    %edi,%eax
cltd
idiv   %esi
ret

LLVM IR (-O0):
define i32 @div_int(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 = sdiv i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @div_int(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
ret i32 %3
}
/* Type definitions */
struct wl_proxy {
  int dummy;
};
struct wl_data_device_manager {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_set_user_data(struct wl_proxy *, void *);
void wl_data_device_manager_set_user_data(
    struct wl_data_device_manager *wl_data_device_manager, void *user_data) {
  wl_proxy_set_user_data((struct wl_proxy *)wl_data_device_manager, user_data);
}


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

x86 assembly (clang, -O2):
<wl_data_device_manager_set_user_data>:
jmp    1030 <wl_proxy_set_user_data@plt>

LLVM IR (-O0):
%struct.wl_data_device_manager = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_data_device_manager_set_user_data(%struct.wl_data_device_manager* %0, i8* %1) {
%3 = alloca %struct.wl_data_device_manager*
%4 = alloca i8*
store %struct.wl_data_device_manager* %0, %struct.wl_data_device_manager** %3
store i8* %1, i8** %4
%5 = load %struct.wl_data_device_manager*, %struct.wl_data_device_manager** %3
%6 = bitcast %struct.wl_data_device_manager* %5 to %struct.wl_proxy*
%7 = load i8*, i8** %4
%8 = call i32 @wl_proxy_set_user_data(%struct.wl_proxy* %6, i8* %7)
ret void
}

LLVM IR (-O2):
%struct.wl_data_device_manager = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_data_device_manager_set_user_data(%struct.wl_data_device_manager* %0, i8* %1) {
%3 = bitcast %struct.wl_data_device_manager* %0 to %struct.wl_proxy*
%4 = tail call i32 @wl_proxy_set_user_data(%struct.wl_proxy* %3, i8* %1)
ret void
}
void cbor_null_byte_string_start_callback(void *_ctx) {}


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

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

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

LLVM IR (-O2):
define void @cbor_null_byte_string_start_callback(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CL_Disconnect(void *);
void SCR_FinishCinematic(void) { CL_Disconnect(((void *)0)); }


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

x86 assembly (clang, -O2):
<SCR_FinishCinematic>:
xor    %edi,%edi
jmp    1030 <CL_Disconnect@plt>

LLVM IR (-O0):
define void @SCR_FinishCinematic() {
%1 = call i32 @CL_Disconnect(i8* null)
ret void
}

LLVM IR (-O2):
define void @SCR_FinishCinematic() {
%1 = tail call i32 @CL_Disconnect(i8* null)
ret void
}
void qcF(const char *x) {
  char *y;
  y = x;
}


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

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

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

LLVM IR (-O2):
define void @qcF(i8* nocapture %0) {
ret void
}
void test38_Test0_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @test38_Test0_targetInit__I() {
ret void
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, int);
int f_pid(void) {
  printf("shell pid: %d\n", getpid());
  return ((1));
}


x86 assembly (clang, -O0):
<f_pid>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_pid>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"shell pid: %d\0A\00"
define i32 @f_pid() {
%1 = call i32 (...) @getpid()
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}

LLVM IR (-O2):
@.str = [15 x i8] c"shell pid: %d\0A\00"
define i32 @f_pid() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}
/* Variables and functions */
size_t buffer_roundup(size_t size) {
  size--;
  size |= size >> 1;
  size |= size >> 2;
  size |= size >> 4;
  size |= size >> 8;
  size |= size >> 16;
  size |= size >> 32;
  size++;
  return size;
}


x86 assembly (clang, -O0):
<buffer_roundup>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x2,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x4,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x8,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x10,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x20,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<buffer_roundup>:
lea    -0x1(%rdi),%rax
mov    %rax,%rcx
shr    %rcx
or     %rax,%rcx
mov    %rcx,%rax
shr    $0x2,%rax
or     %rcx,%rax
mov    %rax,%rcx
shr    $0x4,%rcx
or     %rax,%rcx
mov    %rcx,%rax
shr    $0x8,%rax
or     %rcx,%rax
mov    %rax,%rcx
shr    $0x10,%rcx
or     %rax,%rcx
mov    %rcx,%rax
shr    $0x20,%rax
or     %rcx,%rax
add    $0x1,%rax
ret

LLVM IR (-O0):
define i64 @buffer_roundup(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, -1
store i64 %4, i64* %2
%5 = load i64, i64* %2
%6 = lshr i64 %5, 1
%7 = load i64, i64* %2
%8 = or i64 %7, %6
store i64 %8, i64* %2
%9 = load i64, i64* %2
%10 = lshr i64 %9, 2
%11 = load i64, i64* %2
%12 = or i64 %11, %10
store i64 %12, i64* %2
%13 = load i64, i64* %2
%14 = lshr i64 %13, 4
%15 = load i64, i64* %2
%16 = or i64 %15, %14
store i64 %16, i64* %2
%17 = load i64, i64* %2
%18 = lshr i64 %17, 8
%19 = load i64, i64* %2
%20 = or i64 %19, %18
store i64 %20, i64* %2
%21 = load i64, i64* %2
%22 = lshr i64 %21, 16
%23 = load i64, i64* %2
%24 = or i64 %23, %22
store i64 %24, i64* %2
%25 = load i64, i64* %2
%26 = lshr i64 %25, 32
%27 = load i64, i64* %2
%28 = or i64 %27, %26
store i64 %28, i64* %2
%29 = load i64, i64* %2
%30 = add i64 %29, 1
store i64 %30, i64* %2
%31 = load i64, i64* %2
ret i64 %31
}

LLVM IR (-O2):
define i64 @buffer_roundup(i64 %0) {
%2 = add i64 %0, -1
%3 = lshr i64 %2, 1
%4 = or i64 %3, %2
%5 = lshr i64 %4, 2
%6 = or i64 %5, %4
%7 = lshr i64 %6, 4
%8 = or i64 %7, %6
%9 = lshr i64 %8, 8
%10 = or i64 %9, %8
%11 = lshr i64 %10, 16
%12 = or i64 %11, %10
%13 = lshr i64 %12, 32
%14 = or i64 %13, %12
%15 = add i64 %14, 1
ret i64 %15
}
int for1BLim(int x) {
  if (__builtin_expect((x > 7), 1))
    return x - 8;
  else
    return x;
}


x86 assembly (clang, -O0):
<for1BLim>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x7,-0x8(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%eax
cltq
cmp    $0x0,%rax
je     112d <for1BLim+0x2d>
mov    -0x8(%rbp),%eax
sub    $0x8,%eax
mov    %eax,-0x4(%rbp)
jmp    1133 <for1BLim+0x33>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<for1BLim>:
mov    %edi,%eax
cmp    $0x7,%edi
jle    110a <for1BLim+0xa>
add    $0xfffffff8,%eax
ret

LLVM IR (-O0):
define i32 @for1BLim(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 7
%6 = zext i1 %5 to i32
%7 = sext i32 %6 to i64
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 8
store i32 %11, i32* %2
br label %14
12: ; preds = %1
%13 = load i32, i32* %3
store i32 %13, i32* %2
br label %14
14: ; preds = %12, %9
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @for1BLim(i32 %0) {
%2 = icmp sgt i32 %0, 7
%3 = add nsw i32 %0, -8
%4 = select i1 %2, i32 %3, i32 %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ setup_daemon(int /*<<< orphan*/, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  setup_daemon(0, 0);
  printf("test ... \n");
  for (;;)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %esi,%esi
mov    %esi,%edi
call   1040 <setup_daemon@plt>
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
jmp    114b <main+0x2b>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1040 <setup_daemon@plt>
lea    0xecf(%rip),%rdi
call   1030 <puts@plt>
cs nopw 0x0(%rax,%rax,1)
jmp    1140 <main+0x20>

LLVM IR (-O0):
@.str = [11 x i8] c"test ... \0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @setup_daemon(i32 0, i32 0)
%7 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %8, %2
br label %8
}

LLVM IR (-O2):
@str = [10 x i8] c"test ... \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @setup_daemon(i32 0, i32 0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
br label %5
5: ; preds = %5, %2
br label %5
}
/* Variables and functions */
int /*<<< orphan*/ g(unsigned long);
void h(void) { g((long unsigned int)(void *)0); }


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

x86 assembly (clang, -O2):
<h>:
xor    %edi,%edi
jmp    1030 <g@plt>

LLVM IR (-O0):
define void @h() {
%1 = call i32 @g(i64 0)
ret void
}

LLVM IR (-O2):
define void @h() {
%1 = tail call i32 @g(i64 0)
ret void
}
void display_init() { return; }


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

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

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

LLVM IR (-O2):
define void @display_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ notify_pvcall(char *);
int pvLockMemory(void *pMem, long dwSize) {
  notify_pvcall("f");
  return (0);
}


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

x86 assembly (clang, -O2):
<pvLockMemory>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <notify_pvcall@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"f\00"
define i32 @pvLockMemory(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"f\00"
define i32 @pvLockMemory(i8* nocapture readnone %0, i64 %1) {
%3 = tail call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
unsigned int Divide(unsigned int dividend, unsigned divider) {
  int i = 0;
  while (dividend >= divider) {
    dividend -= divider;
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<Divide>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jb     1136 <Divide+0x36>
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <Divide+0x11>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Divide>:
xor    %eax,%eax
cmp    %esi,%edi
jb     1119 <Divide+0x19>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
sub    %esi,%edi
add    $0x1,%eax
cmp    %esi,%edi
jae    1110 <Divide+0x10>
ret

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

LLVM IR (-O2):
define i32 @Divide(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, %1
br i1 %3, label %10, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %8, %4 ], [ 0, %2 ]
%6 = phi i32 [ %7, %4 ], [ %0, %2 ]
%7 = sub i32 %6, %1
%8 = add nuw nsw i32 %5, 1
%9 = icmp ult i32 %7, %1
br i1 %9, label %10, label %4
10: ; preds = %4, %2
%11 = phi i32 [ 0, %2 ], [ %8, %4 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ test_boo_block_comment();
int /*<<< orphan*/ test_boo_comment();
int /*<<< orphan*/ test_boo_comment_entities();
int /*<<< orphan*/ test_boo_doc_comments();
int /*<<< orphan*/ test_boo_nested_block_comment();
int /*<<< orphan*/ test_boo_strings();
void all_boo_tests() {
  test_boo_comment();
  test_boo_block_comment();
  test_boo_nested_block_comment();
  test_boo_doc_comments();
  test_boo_strings();
  test_boo_comment_entities();
}


x86 assembly (clang, -O0):
<all_boo_tests>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <test_boo_comment@plt>
mov    $0x0,%al
call   1070 <test_boo_block_comment@plt>
mov    $0x0,%al
call   1040 <test_boo_nested_block_comment@plt>
mov    $0x0,%al
call   1080 <test_boo_doc_comments@plt>
mov    $0x0,%al
call   1060 <test_boo_strings@plt>
mov    $0x0,%al
call   1030 <test_boo_comment_entities@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<all_boo_tests>:
push   %rax
xor    %eax,%eax
call   1050 <test_boo_comment@plt>
xor    %eax,%eax
call   1070 <test_boo_block_comment@plt>
xor    %eax,%eax
call   1040 <test_boo_nested_block_comment@plt>
xor    %eax,%eax
call   1080 <test_boo_doc_comments@plt>
xor    %eax,%eax
call   1060 <test_boo_strings@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <test_boo_comment_entities@plt>

LLVM IR (-O0):
define void @all_boo_tests() {
%1 = call i32 (...) @test_boo_comment()
%2 = call i32 (...) @test_boo_block_comment()
%3 = call i32 (...) @test_boo_nested_block_comment()
%4 = call i32 (...) @test_boo_doc_comments()
%5 = call i32 (...) @test_boo_strings()
%6 = call i32 (...) @test_boo_comment_entities()
ret void
}

LLVM IR (-O2):
define void @all_boo_tests() {
%1 = tail call i32 (...) @test_boo_comment()
%2 = tail call i32 (...) @test_boo_block_comment()
%3 = tail call i32 (...) @test_boo_nested_block_comment()
%4 = tail call i32 (...) @test_boo_doc_comments()
%5 = tail call i32 (...) @test_boo_strings()
%6 = tail call i32 (...) @test_boo_comment_entities()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ irc_mode(char *, char *, char *);
char *strtok(char *, char *);
void child_mode(char *p) {
  char *chan, *mode, *param;
  chan = strtok(p, " ");
  mode = strtok(NULL, " ");
  param = strtok(NULL, "");
  irc_mode(chan, mode, param);
}


x86 assembly (clang, -O0):
<child_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xeb5(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xea2(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <irc_mode@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<child_mode>:
push   %r15
push   %r14
push   %rbx
lea    0xed4(%rip),%r14
mov    %r14,%rsi
call   1040 <strtok@plt>
mov    %rax,%r15
xor    %edi,%edi
mov    %r14,%rsi
call   1040 <strtok@plt>
mov    %rax,%rbx
lea    0xeb6(%rip),%rsi
xor    %edi,%edi
call   1040 <strtok@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <irc_mode@plt>

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
@.str.1 = [1 x i8] zeroinitializer
define void @child_mode(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = call i8* @strtok(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %7, i8** %3
%8 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %8, i8** %4
%9 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
store i8* %9, i8** %5
%10 = load i8*, i8** %3
%11 = load i8*, i8** %4
%12 = load i8*, i8** %5
%13 = call i32 @irc_mode(i8* %10, i8* %11, i8* %12)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
@.str.1 = [1 x i8] zeroinitializer
define void @child_mode(i8* %0) {
%2 = tail call i8* @strtok(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @irc_mode(i8* %2, i8* %3, i8* %4)
ret void
}
/* Variables and functions */
int exp_a(int);
int exp_c(int x) {
  int shift_right = x >> ((sizeof(int) - 1) << 3);
  return exp_a(shift_right);
}


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

x86 assembly (clang, -O2):
<exp_c>:
sar    $0x18,%edi
jmp    1030 <exp_a@plt>

LLVM IR (-O0):
define i32 @exp_c(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 24
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @exp_a(i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @exp_c(i32 %0) {
%2 = ashr i32 %0, 24
%3 = tail call i32 @exp_a(i32 %2)
ret i32 %3
}
void curl_multi_remove_handle() {}


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

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

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

LLVM IR (-O2):
define void @curl_multi_remove_handle() {
ret void
}
/* Variables and functions */
double modf(double, double *);
int dst_dayofweek(double datetime) {
  double dt;
  long day;
  datetime = modf(datetime + 0.5 / (86400000.0), &dt);
  day = (long)dt;
  return (day % 7) + 1;
}


x86 assembly (clang, -O0):
<dst_dayofweek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
lea    -0x10(%rbp),%rdi
call   1030 <modf@plt>
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    $0x7,%ecx
cqto
idiv   %rcx
add    $0x1,%rdx
mov    %edx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dst_dayofweek>:
push   %rax
addsd  0xee7(%rip),%xmm0
mov    %rsp,%rdi
call   1030 <modf@plt>
cvttsd2si (%rsp),%rcx
movabs $0x4924924924924925,%rdx
92 24 49
mov    %rcx,%rax
imul   %rdx
mov    %rdx,%rax
shr    $0x3f,%rax
shr    %rdx
add    %eax,%edx
lea    0x0(,%rdx,8),%eax
sub    %eax,%edx
lea    (%rcx,%rdx,1),%eax
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @dst_dayofweek(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca i64
store double %0, double* %2
%5 = load double, double* %2
%6 = fadd double %5, 0x3E38DAEA1D7F4CF7
%7 = call double @modf(double %6, double* %3)
store double %7, double* %2
%8 = load double, double* %3
%9 = fptosi double %8 to i64
store i64 %9, i64* %4
%10 = load i64, i64* %4
%11 = srem i64 %10, 7
%12 = add nsw i64 %11, 1
%13 = trunc i64 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @dst_dayofweek(double %0) {
%2 = alloca double
%3 = bitcast double* %2 to i8*
%4 = fadd double %0, 0x3E38DAEA1D7F4CF7
%5 = call double @modf(double %4, double* %2)
%6 = load double, double* %2
%7 = fptosi double %6 to i64
%8 = srem i64 %7, 7
%9 = trunc i64 %8 to i32
%10 = add nsw i32 %9, 1
ret i32 %10
}
/* Variables and functions */
int iter(int /*<<< orphan*/, int, int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ of_int(int /*<<< orphan*/);
int inside(int x, int y) { return iter(0, x, y, of_int(0), of_int(0)); }


x86 assembly (clang, -O0):
<inside>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
xor    %edi,%edi
call   1030 <of_int@plt>
mov    %eax,-0xc(%rbp)
xor    %edi,%edi
call   1030 <of_int@plt>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    %eax,%r8d
xor    %edi,%edi
call   1040 <iter@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inside>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebp
xor    %edi,%edi
call   1030 <of_int@plt>
mov    %eax,%ebx
xor    %edi,%edi
call   1030 <of_int@plt>
xor    %edi,%edi
mov    %ebp,%esi
mov    %r14d,%edx
mov    %ebx,%ecx
mov    %eax,%r8d
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <iter@plt>

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

LLVM IR (-O2):
define i32 @inside(i32 %0, i32 %1) {
%3 = tail call i32 @of_int(i32 0)
%4 = tail call i32 @of_int(i32 0)
%5 = tail call i32 @iter(i32 0, i32 %0, i32 %1, i32 %3, i32 %4)
ret i32 %5
}
void debugpins_radio_set() {}


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

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

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

LLVM IR (-O2):
define void @debugpins_radio_set() {
ret void
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ outOfMemory();
void *safe_malloc(size_t size) {
  void *result = malloc(size);
  if (result == NULL)
    outOfMemory();
  return result;
}


x86 assembly (clang, -O0):
<safe_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114b <safe_malloc+0x2b>
mov    $0x0,%al
call   1040 <outOfMemory@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_malloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <safe_malloc+0x15>
xor    %eax,%eax
call   1040 <outOfMemory@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @safe_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %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 (...) @outOfMemory()
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define noalias i8* @safe_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @outOfMemory()
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int redislite_page_string_incr_by_key_string(void *, char *, size_t, long long,
                                             long long *);
int redislite_page_string_decr_by_key_string(void *_cs, char *key_name,
                                             size_t key_length, long long decr,
                                             long long *new_value) {
  return redislite_page_string_incr_by_key_string(_cs, key_name, key_length,
                                                  -decr, new_value);
}


x86 assembly (clang, -O0):
<redislite_page_string_decr_by_key_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%ecx
sub    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <redislite_page_string_incr_by_key_string@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<redislite_page_string_decr_by_key_string>:
neg    %rcx
jmp    1030 <redislite_page_string_incr_by_key_string@plt>

LLVM IR (-O0):
define i32 @redislite_page_string_decr_by_key_string(i8* %0, i8* %1, i64 %2, i64 %3, i64* %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i64* %4, i64** %10
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = load i64, i64* %8
%14 = load i64, i64* %9
%15 = sub nsw i64 0, %14
%16 = load i64*, i64** %10
%17 = call i32 @redislite_page_string_incr_by_key_string(i8* %11, i8* %12, i64 %13, i64 %15, i64* %16)
ret i32 %17
}

LLVM IR (-O2):
define i32 @redislite_page_string_decr_by_key_string(i8* %0, i8* %1, i64 %2, i64 %3, i64* %4) {
%6 = sub nsw i64 0, %3
%7 = tail call i32 @redislite_page_string_incr_by_key_string(i8* %0, i8* %1, i64 %2, i64 %6, i64* %4)
ret i32 %7
}
/* Variables and functions */
int O_CREAT;
int O_WRONLY;
int open(char const *, int, int);
int abrirLock(const char *nombre) {
  return open(nombre, O_CREAT | O_WRONLY, 0777);
}


x86 assembly (clang, -O0):
<abrirLock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
mov    0x2ea0(%rip),%rax
or     (%rax),%esi
mov    $0x1ff,%edx
call   1030 <open@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<abrirLock>:
mov    0x2ee1(%rip),%rax
mov    0x2eb2(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    $0x1ff,%edx
jmp    1030 <open@plt>

LLVM IR (-O0):
@O_CREAT = global i32 0
@O_WRONLY = global i32 0
define i32 @abrirLock(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @O_CREAT
%5 = load i32, i32* @O_WRONLY
%6 = or i32 %4, %5
%7 = call i32 @open(i8* %3, i32 %6, i32 511)
ret i32 %7
}

LLVM IR (-O2):
@O_CREAT = global i32 0
@O_WRONLY = global i32 0
define i32 @abrirLock(i8* nocapture %0) {
%2 = load i32, i32* @O_CREAT
%3 = load i32, i32* @O_WRONLY
%4 = or i32 %3, %2
%5 = tail call i32 @open(i8* %0, i32 %4, i32 511)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void displayArrayInt(int myarray[], int length) {
  for (int i = 0; i < length; i++) {
    printf("\nmyarray[%d]: %d", i, myarray[i]);
  }
}


x86 assembly (clang, -O0):
<displayArrayInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115a <displayArrayInt+0x4a>
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <displayArrayInt+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<displayArrayInt>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1147 <displayArrayInt+0x37>
mov    %rdi,%r14
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%edx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <displayArrayInt+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [17 x i8] c"\0Amyarray[%d]: %d\00"
define void @displayArrayInt(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %13, %7 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = trunc i64 %8 to i32
%12 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %10)
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %7
}
/* Variables and functions */
int yas_bma222_read_reg_byte(int);
int /*<<< orphan*/ yas_bma222_write_reg_byte(int, int);
int yas_bma222_power_down(void) {
  yas_bma222_write_reg_byte(
      0x17, ((yas_bma222_read_reg_byte(0x17) & ~0x10) | ((0) << 4)));
  yas_bma222_write_reg_byte(
      0x11, ((yas_bma222_read_reg_byte(0x11) & ~0xc0) | ((2) << 6)));
  return (0);
}


x86 assembly (clang, -O0):
<yas_bma222_power_down>:
push   %rbp
mov    %rsp,%rbp
mov    $0x17,%edi
call   1040 <yas_bma222_read_reg_byte@plt>
mov    %eax,%esi
and    $0xffffffef,%esi
or     $0x0,%esi
mov    $0x17,%edi
call   1030 <yas_bma222_write_reg_byte@plt>
mov    $0x11,%edi
call   1040 <yas_bma222_read_reg_byte@plt>
mov    %eax,%esi
and    $0xffffff3f,%esi
or     $0x80,%esi
mov    $0x11,%edi
call   1030 <yas_bma222_write_reg_byte@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<yas_bma222_power_down>:
push   %rax
mov    $0x17,%edi
call   1040 <yas_bma222_read_reg_byte@plt>
and    $0xffffffef,%eax
mov    $0x17,%edi
mov    %eax,%esi
call   1030 <yas_bma222_write_reg_byte@plt>
mov    $0x11,%edi
call   1040 <yas_bma222_read_reg_byte@plt>
and    $0xffffff3f,%eax
lea    0x80(%rax),%esi
mov    $0x11,%edi
call   1030 <yas_bma222_write_reg_byte@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @yas_bma222_power_down() {
%1 = call i32 @yas_bma222_read_reg_byte(i32 23)
%2 = and i32 %1, -17
%3 = or i32 %2, 0
%4 = call i32 @yas_bma222_write_reg_byte(i32 23, i32 %3)
%5 = call i32 @yas_bma222_read_reg_byte(i32 17)
%6 = and i32 %5, -193
%7 = or i32 %6, 128
%8 = call i32 @yas_bma222_write_reg_byte(i32 17, i32 %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @yas_bma222_power_down() {
%1 = tail call i32 @yas_bma222_read_reg_byte(i32 23)
%2 = and i32 %1, -17
%3 = tail call i32 @yas_bma222_write_reg_byte(i32 23, i32 %2)
%4 = tail call i32 @yas_bma222_read_reg_byte(i32 17)
%5 = and i32 %4, -193
%6 = or i32 %5, 128
%7 = tail call i32 @yas_bma222_write_reg_byte(i32 17, i32 %6)
ret i32 0
}
unsigned long int unsignedlongint_ignoring_signedlong(unsigned long int x,
                                                      signed long y) {
  return x;
}


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

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

LLVM IR (-O0):
define i64 @unsignedlongint_ignoring_signedlong(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @unsignedlongint_ignoring_signedlong(i64 returned %0, i64 %1) {
ret i64 %0
}
/* Type definitions */
struct dlist_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ dlist_init_head(struct dlist_head *);
int /*<<< orphan*/ dlist_replace(struct dlist_head *, struct dlist_head *);
void dlist_replace_init(struct dlist_head *old_node,
                        struct dlist_head *new_node) {
  dlist_replace(old_node, new_node);
  dlist_init_head(old_node);
}


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

x86 assembly (clang, -O2):
<dlist_replace_init>:
push   %rbx
mov    %rdi,%rbx
call   1040 <dlist_replace@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <dlist_init_head@plt>

LLVM IR (-O0):
%struct.dlist_head = type { i32 }
define void @dlist_replace_init(%struct.dlist_head* %0, %struct.dlist_head* %1) {
%3 = alloca %struct.dlist_head*
%4 = alloca %struct.dlist_head*
store %struct.dlist_head* %0, %struct.dlist_head** %3
store %struct.dlist_head* %1, %struct.dlist_head** %4
%5 = load %struct.dlist_head*, %struct.dlist_head** %3
%6 = load %struct.dlist_head*, %struct.dlist_head** %4
%7 = call i32 @dlist_replace(%struct.dlist_head* %5, %struct.dlist_head* %6)
%8 = load %struct.dlist_head*, %struct.dlist_head** %3
%9 = call i32 @dlist_init_head(%struct.dlist_head* %8)
ret void
}

LLVM IR (-O2):
%struct.dlist_head = type { i32 }
define void @dlist_replace_init(%struct.dlist_head* %0, %struct.dlist_head* %1) {
%3 = tail call i32 @dlist_replace(%struct.dlist_head* %0, %struct.dlist_head* %1)
%4 = tail call i32 @dlist_init_head(%struct.dlist_head* %0)
ret void
}
/* Variables and functions */
int tun_getFile();
int tcp_getTunTap() { return (tun_getFile()); }


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

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

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

LLVM IR (-O2):
define i32 @tcp_getTunTap() {
%1 = tail call i32 (...) @tun_getFile()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int try(int);
main() {
  int i;
  for (i = 1; i <= 6; i++) {
    if (try(i) != i)
      abort();
  }
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x6,-0x8(%rbp)
jg     117b <main+0x4b>
mov    -0x8(%rbp),%edi
call   1040 <try@plt>
cmp    -0x8(%rbp),%eax
je     1168 <main+0x38>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    116d <main+0x3d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1146 <main+0x16>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1040 <try@plt>
cmp    $0x1,%eax
jne    1192 <main+0x62>
mov    $0x2,%edi
call   1040 <try@plt>
cmp    $0x2,%eax
jne    1192 <main+0x62>
mov    $0x3,%edi
call   1040 <try@plt>
cmp    $0x3,%eax
jne    1192 <main+0x62>
mov    $0x4,%edi
call   1040 <try@plt>
cmp    $0x4,%eax
jne    1192 <main+0x62>
mov    $0x5,%edi
call   1040 <try@plt>
cmp    $0x5,%eax
jne    1192 <main+0x62>
mov    $0x6,%edi
call   1040 <try@plt>
cmp    $0x6,%eax
jne    1192 <main+0x62>
xor    %edi,%edi
call   1050 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
br label %3
3: ; preds = %14, %0
%4 = load i32, i32* %2
%5 = icmp sle i32 %4, 6
br i1 %5, label %6, label %17
6: ; preds = %3
%7 = load i32, i32* %2
%8 = call i32 @try(i32 %7)
%9 = load i32, i32* %2
%10 = icmp ne i32 %8, %9
br i1 %10, label %11, label %13
11: ; preds = %6
%12 = call i32 (...) @abort()
unreachable
13: ; preds = %6
br label %14
14: ; preds = %13
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 1
store i32 %16, i32* %2
br label %3
17: ; preds = %3
%18 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @try(i32 1)
%2 = icmp eq i32 %1, 1
br i1 %2, label %3, label %20
3: ; preds = %0
%4 = tail call i32 @try(i32 2)
%5 = icmp eq i32 %4, 2
br i1 %5, label %6, label %20
6: ; preds = %3
%7 = tail call i32 @try(i32 3)
%8 = icmp eq i32 %7, 3
br i1 %8, label %9, label %20
9: ; preds = %6
%10 = tail call i32 @try(i32 4)
%11 = icmp eq i32 %10, 4
br i1 %11, label %12, label %20
12: ; preds = %9
%13 = tail call i32 @try(i32 5)
%14 = icmp eq i32 %13, 5
br i1 %14, label %15, label %20
15: ; preds = %12
%16 = tail call i32 @try(i32 6)
%17 = icmp eq i32 %16, 6
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = tail call i32 @exit(i32 0)
unreachable
20: ; preds = %15, %12, %9, %6, %3, %0
%21 = tail call i32 (...) @abort()
unreachable
}
int main(void) {
  asm("main_label: .globl main_label");
  foo();
  asm("main_label2: .globl main_label2");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)

x86 assembly (clang, -O2):
<main>:
push   %rax

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

LLVM IR (-O2):
define i32 @main() {
tail call void asm sideeffect "main_label: .globl main_label", "~{dirflag},~{fpsr},~{flags}"()
%1 = tail call i32 (...) @foo()
tail call void asm sideeffect "main_label2: .globl main_label2", "~{dirflag},~{fpsr},~{flags}"()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int list_help() {
  printf("Command list:\n");
  printf("  /adduser (Add new user.)\n");
  printf("  /listuser (List all user in chat.)\n");
  printf("  /help (Show this message.)\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<list_help>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeea(%rip),%rdi
call   1030 <puts@plt>
lea    0xef9(%rip),%rdi
call   1030 <puts@plt>
lea    0xf12(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Command list:\0A\00"
@.str.1 = [28 x i8] c" /adduser (Add new user.)\0A\00"
@.str.2 = [38 x i8] c" /listuser (List all user in chat.)\0A\00"
@.str.3 = [30 x i8] c" /help (Show this message.)\0A\00"
define i32 @list_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"Command list:\00"
@str.4 = [27 x i8] c" /adduser (Add new user.)\00"
@str.5 = [37 x i8] c" /listuser (List all user in chat.)\00"
@str.6 = [29 x i8] c" /help (Show this message.)\00"
define i32 @list_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.6, i64 0, i64 0))
ret i32 0
}
int smbd_send(struct TCP_Server_Info *server, int num_rqst,
              struct smb_rqst *rqst) {
  return -1;
}


x86 assembly (clang, -O0):
<smbd_send>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.TCP_Server_Info = type opaque
%struct.smb_rqst = type opaque
define i32 @smbd_send(%struct.TCP_Server_Info* %0, i32 %1, %struct.smb_rqst* %2) {
%4 = alloca %struct.TCP_Server_Info*
%5 = alloca i32
%6 = alloca %struct.smb_rqst*
store %struct.TCP_Server_Info* %0, %struct.TCP_Server_Info** %4
store i32 %1, i32* %5
store %struct.smb_rqst* %2, %struct.smb_rqst** %6
ret i32 -1
}

LLVM IR (-O2):
%struct.TCP_Server_Info = type opaque
%struct.smb_rqst = type opaque
define i32 @smbd_send(%struct.TCP_Server_Info* nocapture readnone %0, i32 %1, %struct.smb_rqst* nocapture readnone %2) {
ret i32 -1
}
int main() {
  char *a;
  char *b;
  const char *x = 0 ? (char *)a : (const char *)b;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
struct opctx {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ outputf(struct opctx *, char *, char *);
int output_tool_preface(struct opctx *outc) {
  outputf(outc, "%s",
          "/* Generated by nsgenbind\n"
          " *\n"
          " * nsgenbind is published under the MIT Licence.\n"
          " * nsgenbind is similar to a compiler is a purely transformative "
          "tool which\n"
          " * explicitly makes no copyright claim on this generated output\n"
          " */\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<output_tool_preface>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0xee4(%rip),%rdx
call   1030 <outputf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.opctx = type { i32 }
@.str = [3 x i8] c"%s\00"
@.str.1 = [223 x i8] c"/* Generated by nsgenbind\0A *\0A * nsgenbind is published under the MIT Licence.\0A * nsgenbind is similar to a compiler is a purely transformative tool which\0A * explicitly makes no copyright claim on this generated output\0A */\0A\00"
define i32 @output_tool_preface(%struct.opctx* %0) {
%2 = alloca %struct.opctx*
store %struct.opctx* %0, %struct.opctx** %2
%3 = load %struct.opctx*, %struct.opctx** %2
%4 = call i32 @outputf(%struct.opctx* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([223 x i8], [223 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
%struct.opctx = type { i32 }
@.str = [3 x i8] c"%s\00"
@.str.1 = [223 x i8] c"/* Generated by nsgenbind\0A *\0A * nsgenbind is published under the MIT Licence.\0A * nsgenbind is similar to a compiler is a purely transformative tool which\0A * explicitly makes no copyright claim on this generated output\0A */\0A\00"
define i32 @output_tool_preface(%struct.opctx* %0) {
%2 = tail call i32 @outputf(%struct.opctx* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([223 x i8], [223 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
double sqrt(double);
double module_libc_sqrt(double x) { return sqrt(x); }


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

x86 assembly (clang, -O2):
<module_libc_sqrt>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     111f <module_libc_sqrt+0xf>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

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

LLVM IR (-O2):
define double @module_libc_sqrt(double %0) {
%2 = tail call double @sqrt(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, char *);
char *subString(char *, int, int);
int main() {
  char *sub = subString("I love C !", 2, 4);
  printf("%s", sub);
  free(sub);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x2,%esi
mov    $0x4,%edx
call   1050 <subString@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xea7(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
mov    $0x2,%esi
mov    $0x4,%edx
call   1050 <subString@plt>
mov    %rax,%rbx
lea    0xeba(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"I love C !\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* @subString(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 2, i32 4)
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"I love C !\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = tail call i8* @subString(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 2, i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%3 = tail call i32 @free(i8* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void abort(void) { exit(1); }


x86 assembly (clang, -O0):
<abort>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<abort>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @abort() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @abort() {
%1 = tail call i32 @exit(i32 1)
unreachable
}