xunge/DecIR huggingface dataset:
void g_DUMMY_popup_messagebox(int win_id, char *title, char *message,
                              int wait) {
  win_id = win_id;
  title = title;
  message = message;
  wait = wait;
}


x86 assembly (clang, -O0):
<g_DUMMY_popup_messagebox>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @g_DUMMY_popup_messagebox(i32 %0, i8* nocapture %1, i8* nocapture %2, i32 %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ grecs_free(void *);
void listel_dispose(void *el) { grecs_free(el); }


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

x86 assembly (clang, -O2):
<listel_dispose>:
jmp    1030 <grecs_free@plt>

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

LLVM IR (-O2):
define void @listel_dispose(i8* %0) {
%2 = tail call i32 @grecs_free(i8* %0)
ret void
}
void usevar(void *var) {}


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

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

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

LLVM IR (-O2):
define void @usevar(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int abs(int);
int triangle(int x, int y) { return abs(x) <= y; }


x86 assembly (clang, -O0):
<triangle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <abs@plt>
cmp    -0x8(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<triangle>:
mov    %edi,%ecx
neg    %ecx
cmovs  %edi,%ecx
xor    %eax,%eax
cmp    %esi,%ecx
setle  %al
ret

LLVM IR (-O0):
define i32 @triangle(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 = call i32 @abs(i32 %5)
%7 = load i32, i32* %4
%8 = icmp sle i32 %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @triangle(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%4 = icmp sle i32 %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ _fail_eno(int);
int _ensure(int line, int rc) {
  if (rc < 0)
    _fail_eno(line);
  return rc;
}


x86 assembly (clang, -O0):
<_ensure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1130 <_ensure+0x20>
mov    -0x4(%rbp),%edi
call   1030 <_fail_eno@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ensure>:
push   %rbx
mov    %esi,%ebx
test   %esi,%esi
jns    111c <_ensure+0xc>
call   1030 <_fail_eno@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @_ensure(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %3
%9 = call i32 @_fail_eno(i32 %8)
br label %10
10: ; preds = %7, %2
%11 = load i32, i32* %4
ret i32 %11
}

LLVM IR (-O2):
define i32 @_ensure(i32 %0, i32 returned %1) {
%3 = icmp slt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @_fail_eno(i32 %0)
br label %6
6: ; preds = %4, %2
ret i32 %1
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long parent;
};
typedef TYPE_1__ XConfigureRequestEvent;

/* Variables and functions */
void set_XConfigureRequestEvent_parent(void *_p, unsigned long _v) {
  ((XConfigureRequestEvent *)_p)->parent = (unsigned long)_v;
}


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

x86 assembly (clang, -O2):
<set_XConfigureRequestEvent_parent>:
mov    %rsi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XConfigureRequestEvent_parent(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
unsigned char jz_readb(unsigned int address) {
  return *((volatile unsigned char *)address);
}


x86 assembly (clang, -O0):
<jz_readb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    (%rax),%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jz_readb>:
mov    %edi,%eax
mov    (%rax),%al
ret

LLVM IR (-O0):
define zeroext i8 @jz_readb(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
%6 = load volatile i8, i8* %5
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @jz_readb(i32 %0) {
%2 = zext i32 %0 to i64
%3 = inttoptr i64 %2 to i8*
%4 = load volatile i8, i8* %3
ret i8 %4
}
/* Variables and functions */
char *column(char *, int, char *);
int column_count(char *);
char *column_last(char *destination, char *source) {
  int count;
  count = column_count(source);
  if (!count)
    return (char *)0;
  return column(destination, count - 1, source);
}


x86 assembly (clang, -O0):
<column_last>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <column_count@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    1153 <column_last+0x33>
movq   $0x0,-0x8(%rbp)
jmp    116a <column_last+0x4a>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
sub    $0x1,%esi
mov    -0x18(%rbp),%rdx
call   1040 <column@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<column_last>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <column_count@plt>
test   %eax,%eax
je     114d <column_last+0x2d>
add    $0xffffffff,%eax
mov    %r14,%rdi
mov    %eax,%esi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <column@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @column_last(i8* %0, i8* %1) {
%3 = tail call i32 @column_count(i8* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = add nsw i32 %3, -1
%7 = tail call i8* @column(i8* %0, i32 %6, i8* %1)
br label %8
8: ; preds = %2, %5
%9 = phi i8* [ %7, %5 ], [ null, %2 ]
ret i8* %9
}
/* Variables and functions */
float expf(int);
int logf(float);
float sqrtf(float num) { return expf(logf(num) / 2); }


x86 assembly (clang, -O0):
<sqrtf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <logf@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <expf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqrtf>:
push   %rax
call   1030 <logf@plt>
mov    %eax,%edi
shr    $0x1f,%edi
add    %eax,%edi
sar    %edi
pop    %rax
jmp    1040 <expf@plt>

LLVM IR (-O0):
define float @sqrtf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i32 @logf(float %3)
%5 = sdiv i32 %4, 2
%6 = call float @expf(i32 %5)
ret float %6
}

LLVM IR (-O2):
define float @sqrtf(float %0) {
%2 = tail call i32 @logf(float %0)
%3 = sdiv i32 %2, 2
%4 = tail call float @expf(i32 %3)
ret float %4
}
/* Variables and functions */
bool divides(int n, int m) {
  if (n == 0) {
    return false;
  }
  if (m == 0) {
    return true;
  }
  return (m % n) == 0;
}


x86 assembly (clang, -O0):
<divides>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1120 <divides+0x20>
movl   $0x0,-0x4(%rbp)
jmp    114b <divides+0x4b>
cmpl   $0x0,-0xc(%rbp)
jne    1136 <divides+0x36>
movl   $0x1,-0x4(%rbp)
jmp    114b <divides+0x4b>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<divides>:
test   %edi,%edi
je     1115 <divides+0x15>
test   %esi,%esi
je     1118 <divides+0x18>
mov    %esi,%eax
cltd
idiv   %edi
xor    %eax,%eax
test   %edx,%edx
sete   %al
ret
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @divides(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 0, i32* %3
br label %19
9: ; preds = %2
%10 = load i32, i32* %5
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %9
store i32 1, i32* %3
br label %19
13: ; preds = %9
%14 = load i32, i32* %5
%15 = load i32, i32* %4
%16 = srem i32 %14, %15
%17 = icmp eq i32 %16, 0
%18 = zext i1 %17 to i32
store i32 %18, i32* %3
br label %19
19: ; preds = %13, %12, %8
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @divides(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = icmp eq i32 %1, 0
br i1 %5, label %10, label %6
6: ; preds = %4
%7 = srem i32 %1, %0
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %4, %2, %6
%11 = phi i32 [ %9, %6 ], [ 0, %2 ], [ 1, %4 ]
ret i32 %11
}
/* Type definitions */
struct usernewkey_args_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/
usernewkey_cmdline_parser_release(struct usernewkey_args_info *);
void usernewkey_cmdline_parser_free(struct usernewkey_args_info *args_info) {
  usernewkey_cmdline_parser_release(args_info);
}


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

x86 assembly (clang, -O2):
<usernewkey_cmdline_parser_free>:
jmp    1030 <usernewkey_cmdline_parser_release@plt>

LLVM IR (-O0):
%struct.usernewkey_args_info = type { i32 }
define void @usernewkey_cmdline_parser_free(%struct.usernewkey_args_info* %0) {
%2 = alloca %struct.usernewkey_args_info*
store %struct.usernewkey_args_info* %0, %struct.usernewkey_args_info** %2
%3 = load %struct.usernewkey_args_info*, %struct.usernewkey_args_info** %2
%4 = call i32 @usernewkey_cmdline_parser_release(%struct.usernewkey_args_info* %3)
ret void
}

LLVM IR (-O2):
%struct.usernewkey_args_info = type { i32 }
define void @usernewkey_cmdline_parser_free(%struct.usernewkey_args_info* %0) {
%2 = tail call i32 @usernewkey_cmdline_parser_release(%struct.usernewkey_args_info* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int16_t gffi_get_int_16_swapped(int8_t *location, int offset) {
  int8_t buf[2];
  buf[1] = location[offset];
  buf[0] = location[offset + 1];
  return *(int16_t *)buf;
}


x86 assembly (clang, -O0):
<gffi_get_int_16_swapped>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gffi_get_int_16_swapped>:
movslq %esi,%rax
mov    0x4(%rdi,%rax,4),%eax
ret

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

LLVM IR (-O2):
define i32 @gffi_get_int_16_swapped(i32* nocapture %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
ret i32 %6
}
/* Variables and functions */
char tolower(char);
void lowercase_string(char *buffer) {
  while (*buffer) {
    *buffer = tolower(*buffer);
    buffer++;
  }
}


x86 assembly (clang, -O0):
<lowercase_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <lowercase_string+0x3e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <lowercase_string+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lowercase_string>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1136 <lowercase_string+0x26>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <lowercase_string+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @lowercase_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @tolower(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
void network_hook(void) {}


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

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

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

LLVM IR (-O2):
define void @network_hook() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
__attribute__((always_)) uint32_t __UXTAB16(uint32_t x, uint32_t y) {
  return ((uint32_t)(((((y << 24) >> 24) + ((x << 16) >> 16)) & 0x0000FFFF) |
                     ((((y << 8) >> 8) + ((x >> 16) << 16)) & 0xFFFF0000)));
}


x86 assembly (clang, -O0):
<__UXTAB16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x18,%eax
sar    $0x18,%eax
mov    -0x4(%rbp),%ecx
shl    $0x10,%ecx
sar    $0x10,%ecx
add    %ecx,%eax
and    $0xffff,%eax
mov    -0x8(%rbp),%ecx
shl    $0x8,%ecx
sar    $0x8,%ecx
mov    -0x4(%rbp),%edx
sar    $0x10,%edx
shl    $0x10,%edx
add    %edx,%ecx
and    $0xffff0000,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__UXTAB16>:
movsbl %sil,%eax
add    %edi,%eax
movzwl %ax,%ecx
shl    $0x8,%esi
sar    $0x8,%esi
and    $0xffff0000,%edi
lea    (%rdi,%rsi,1),%eax
and    $0xffff0000,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @__UXTAB16(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 %5, 24
%7 = ashr i32 %6, 24
%8 = load i32, i32* %3
%9 = shl i32 %8, 16
%10 = ashr i32 %9, 16
%11 = add nsw i32 %7, %10
%12 = and i32 %11, 65535
%13 = load i32, i32* %4
%14 = shl i32 %13, 8
%15 = ashr i32 %14, 8
%16 = load i32, i32* %3
%17 = ashr i32 %16, 16
%18 = shl i32 %17, 16
%19 = add nsw i32 %15, %18
%20 = and i32 %19, -65536
%21 = or i32 %12, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @__UXTAB16(i32 %0, i32 %1) {
%3 = shl i32 %1, 24
%4 = ashr exact i32 %3, 24
%5 = add i32 %4, %0
%6 = and i32 %5, 65535
%7 = shl i32 %1, 8
%8 = ashr exact i32 %7, 8
%9 = and i32 %0, -65536
%10 = add nsw i32 %8, %9
%11 = and i32 %10, -65536
%12 = or i32 %6, %11
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(
      stderr, "%s\n",
      "usage: bdes [-abdp] [-F N] [-f N] [-k key] [-m N] [-o N] [-v vector]");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
lea    0xec9(%rip),%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
lea    0xecc(%rip),%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [69 x i8] c"usage: bdes [-abdp] [-F N] [-f N] [-k key] [-m N] [-o N] [-v vector]\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [69 x i8] c"usage: bdes [-abdp] [-F N] [-f N] [-k key] [-m N] [-o N] [-v vector]\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
void THREAD_POOL_TERM_SIG(void *data) { data = data; }


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

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

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

LLVM IR (-O2):
define void @THREAD_POOL_TERM_SIG(i8* nocapture %0) {
ret void
}
/* Variables and functions */
float expf(float);
float filter_gauss(float k, float r, float w) {
  return expf(-0.5f * (k * k) / (r * r));
}


x86 assembly (clang, -O0):
<filter_gauss>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
movss  0xec7(%rip),%xmm0
mulss  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
call   1030 <expf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filter_gauss>:
mulss  %xmm0,%xmm0
mulss  0xee4(%rip),%xmm0
mulss  %xmm1,%xmm1
divss  %xmm1,%xmm0
jmp    1030 <expf@plt>

LLVM IR (-O0):
define float @filter_gauss(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %4
%9 = fmul float %7, %8
%10 = fmul float -5.000000e-01, %9
%11 = load float, float* %5
%12 = load float, float* %5
%13 = fmul float %11, %12
%14 = fdiv float %10, %13
%15 = call float @expf(float %14)
ret float %15
}

LLVM IR (-O2):
define float @filter_gauss(float %0, float %1, float %2) {
%4 = fmul float %0, %0
%5 = fmul float %4, -5.000000e-01
%6 = fmul float %1, %1
%7 = fdiv float %5, %6
%8 = tail call float @expf(float %7)
ret float %8
}
ttolSlow(s, millisec) char *s;
int millisec;
{
  for (; *s; s++) {
    ttoc(*s);
    msleep(millisec);
  }
}


x86 assembly (clang, -O0):
<ttolSlow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1165 <ttolSlow+0x45>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
mov    $0x0,%al
call   1030 <ttoc@plt>
mov    -0x14(%rbp),%edi
mov    $0x0,%al
call   1040 <msleep@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    112f <ttolSlow+0xf>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ttolSlow>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     115e <ttolSlow+0x3e>
mov    %esi,%ebp
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl %al,%edi
xor    %eax,%eax
call   1030 <ttoc@plt>
mov    %ebp,%edi
xor    %eax,%eax
call   1040 <msleep@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1140 <ttolSlow+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @ttolSlow(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %12, %5 ], [ %3, %2 ]
%7 = phi i8* [ %11, %5 ], [ %0, %2 ]
%8 = sext i8 %6 to i32
%9 = tail call i32 (i32, ...) bitcast (i32 (...)* @ttoc to i32 (i32, ...)*)(i32 %8)
%10 = tail call i32 (i32, ...) bitcast (i32 (...)* @msleep to i32 (i32, ...)*)(i32 %1)
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %2
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int strlen(char *);
int /*<<< orphan*/ uCharToHex(unsigned char *, unsigned char *, int);
int int_to_hex(int num, unsigned char *hex_len) {
  unsigned char char_len[4] = {'\0'};
  sprintf((char *)char_len, "%04x", num);
  uCharToHex(char_len, hex_len, 4);
  return (strlen((char *)(hex_len)));
}


x86 assembly (clang, -O0):
<int_to_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x14(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
lea    -0x14(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xe93(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0x14(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1050 <uCharToHex@plt>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_to_hex>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%edx
movl   $0x0,0x4(%rsp)
lea    0xeb8(%rip),%rsi
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1050 <sprintf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x4,%edx
call   1040 <uCharToHex@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%04x\00"
define i32 @int_to_hex(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca [4 x i8]
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = bitcast [4 x i8]* %5 to i8*
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%11 = load i8*, i8** %4
%12 = call i32 @uCharToHex(i8* %10, i8* %11, i32 4)
%13 = load i8*, i8** %4
%14 = call i32 @strlen(i8* %13)
ret i32 %14
}

LLVM IR (-O2):
@.str = [5 x i8] c"%04x\00"
define i32 @int_to_hex(i32 %0, i8* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %0)
%6 = call i32 @uCharToHex(i8* %4, i8* %1, i32 4)
%7 = call i32 @strlen(i8* %1)
ret i32 %7
}
void Hal_hook_wr_sgncenum(void) {}


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

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

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

LLVM IR (-O2):
define void @Hal_hook_wr_sgncenum() {
ret void
}
void Injector3ISR() {}


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

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

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

LLVM IR (-O2):
define void @Injector3ISR() {
ret void
}
void destroy_2darr(char **arr, int nrows, int ncols) {
  for (int i = 0; i < nrows; i++)
    free(arr[i]);
  free(arr);
  return;
}


x86 assembly (clang, -O0):
<destroy_2darr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1154 <destroy_2darr+0x44>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <destroy_2darr+0x19>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<destroy_2darr>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <destroy_2darr+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <destroy_2darr+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @destroy_2darr(i8** nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %9
7: ; preds = %9, %3
%8 = bitcast i8** %0 to i8*
tail call void @free(i8* %8)
ret void
9: ; preds = %5, %9
%10 = phi i64 [ 0, %5 ], [ %13, %9 ]
%11 = getelementptr inbounds i8*, i8** %0, i64 %10
%12 = load i8*, i8** %11
tail call void @free(i8* %12)
%13 = add nuw nsw i64 %10, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %7, label %9
}
void hugo_setbackcolor(int c) {}


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

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

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

LLVM IR (-O2):
define void @hugo_setbackcolor(i32 %0) {
ret void
}
void steal_helmet(struct battle_char *origin, struct battle_char *target) {}


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

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

LLVM IR (-O0):
%struct.battle_char = type opaque
define void @steal_helmet(%struct.battle_char* %0, %struct.battle_char* %1) {
%3 = alloca %struct.battle_char*
%4 = alloca %struct.battle_char*
store %struct.battle_char* %0, %struct.battle_char** %3
store %struct.battle_char* %1, %struct.battle_char** %4
ret void
}

LLVM IR (-O2):
%struct.battle_char = type opaque
define void @steal_helmet(%struct.battle_char* nocapture %0, %struct.battle_char* nocapture %1) {
ret void
}
int f1(int a) {
  int b;
  if (a) {
    int a = 1;
    return (a + b);
  }
  return (a);
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1126 <f1+0x26>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    112c <f1+0x2c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f1(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
store i32 1, i32* %5
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = add nsw i32 %9, %10
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, %8
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @f1(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *, int);
void con(char *name, int type, void *arg) {
  printf("conflicting name detected %s for type %d\n", name, type);
  exit(1);
}


x86 assembly (clang, -O0):
<con>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<con>:
push   %rax
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"conflicting name detected %s for type %d\0A\00"
define void @con(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %8)
%10 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [42 x i8] c"conflicting name detected %s for type %d\0A\00"
define void @con(i8* %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
int /*<<< orphan*/ *status_get_file_ptr(char *);
void status_set_tracking(const char *path) {
  FILE *fp = NULL;
  fp = status_get_file_ptr("a");
  if (fp == NULL)
    return;
  fprintf(fp, "%s\n", path);
  fclose(fp);
}


x86 assembly (clang, -O0):
<status_set_tracking>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
lea    0xeb5(%rip),%rdi
call   1050 <status_get_file_ptr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1164 <status_set_tracking+0x34>
jmp    1181 <status_set_tracking+0x51>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe8f(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<status_set_tracking>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xec2(%rip),%rdi
call   1050 <status_get_file_ptr@plt>
test   %rax,%rax
je     116c <status_set_tracking+0x3c>
mov    %rax,%rbx
lea    0xeb0(%rip),%rsi
mov    %rax,%rdi
mov    %r14,%rdx
call   1040 <fprintf@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fclose@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [2 x i8] c"a\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @status_set_tracking(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
store i32* null, i32** %3
%4 = call i32* @status_get_file_ptr(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %4, i32** %3
%5 = load i32*, i32** %3
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %8
7: ; preds = %1
br label %14
8: ; preds = %1
%9 = load i32*, i32** %3
%10 = load i8*, i8** %2
%11 = call i32 @fprintf(i32* %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %10)
%12 = load i32*, i32** %3
%13 = call i32 @fclose(i32* %12)
br label %14
14: ; preds = %8, %7
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"a\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @status_set_tracking(i8* %0) {
%2 = tail call i32* @status_get_file_ptr(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @fprintf(i32* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%6 = tail call i32 @fclose(i32* %2)
br label %7
7: ; preds = %1, %4
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct timespec {
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
int /*<<< orphan*/ syscall(int, int /*<<< orphan*/, struct timespec *);
__attribute__((visibility("default"))) time_t time(time_t *t) {
  struct timespec ts;
  syscall(228, CLOCK_REALTIME, &ts);
  if (t) {
    *t = ts.tv_sec;
  }
  return ts.tv_sec;
}


x86 assembly (clang, -O0):
<time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
mov    $0xe4,%edi
lea    -0x10(%rbp),%rdx
call   1030 <syscall@plt>
cmpq   $0x0,-0x8(%rbp)
je     1147 <time+0x37>
mov    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
lea    0x8(%rsp),%rdx
mov    $0xe4,%edi
call   1030 <syscall@plt>
mov    0x8(%rsp),%eax
test   %rbx,%rbx
je     113b <time+0x2b>
mov    %eax,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@CLOCK_REALTIME = global i32 0
define i32 @time(i32* %0) {
%2 = alloca i32*
%3 = alloca %struct.timespec
store i32* %0, i32** %2
%4 = load i32, i32* @CLOCK_REALTIME
%5 = call i32 @syscall(i32 228, i32 %4, %struct.timespec* %3)
%6 = load i32*, i32** %2
%7 = icmp ne i32* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%10 = load i32, i32* %9
%11 = load i32*, i32** %2
store i32 %10, i32* %11
br label %12
12: ; preds = %8, %1
%13 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%14 = load i32, i32* %13
ret i32 %14
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@CLOCK_REALTIME = global i32 0
define i32 @time(i32* writeonly %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = load i32, i32* @CLOCK_REALTIME
%5 = call i32 @syscall(i32 228, i32 %4, %struct.timespec* %2)
%6 = icmp eq i32* %0, null
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
%8 = load i32, i32* %7
br i1 %6, label %10, label %9
9: ; preds = %1
store i32 %8, i32* %0
br label %10
10: ; preds = %1, %9
ret i32 %8
}
/* Type definitions */
struct section_list_link {
  int dummy;
};
struct genlist_link {
  int dummy;
};

/* Variables and functions */
scalar_t__ genlist_link_prev(struct genlist_link const *);
struct section_list_link *
section_list_link_prev(const struct section_list_link *plink) {
  return ((struct section_list_link *)genlist_link_prev(
      (const struct genlist_link *)plink));
}


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

x86 assembly (clang, -O2):
<section_list_link_prev>:
jmp    1030 <genlist_link_prev@plt>

LLVM IR (-O0):
%struct.section_list_link = type { i32 }
%struct.genlist_link = type { i32 }
define %struct.section_list_link* @section_list_link_prev(%struct.section_list_link* %0) {
%2 = alloca %struct.section_list_link*
store %struct.section_list_link* %0, %struct.section_list_link** %2
%3 = load %struct.section_list_link*, %struct.section_list_link** %2
%4 = bitcast %struct.section_list_link* %3 to %struct.genlist_link*
%5 = call i64 @genlist_link_prev(%struct.genlist_link* %4)
%6 = inttoptr i64 %5 to %struct.section_list_link*
ret %struct.section_list_link* %6
}

LLVM IR (-O2):
%struct.section_list_link = type { i32 }
%struct.genlist_link = type { i32 }
define %struct.section_list_link* @section_list_link_prev(%struct.section_list_link* %0) {
%2 = bitcast %struct.section_list_link* %0 to %struct.genlist_link*
%3 = tail call i64 @genlist_link_prev(%struct.genlist_link* %2)
%4 = inttoptr i64 %3 to %struct.section_list_link*
ret %struct.section_list_link* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int main(int argc, char **argv) {
  double y = 5;
  double x = 9 / y;
  printf("%f\n", x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  0xeda(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xec5(%rip),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
movsd  0xee0(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store double 5.000000e+00, double* %6
%8 = load double, double* %6
%9 = fdiv double 9.000000e+00, %8
store double %9, double* %7
%10 = load double, double* %7
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double 1.800000e+00)
ret i32 0
}
void remove(void) {}


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

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

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

LLVM IR (-O2):
define void @remove() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ core7_print(char *, char *, char *, char const *);
void U_EMRSETBRUSHORGEX_print(const char *contents) {
  core7_print("U_EMRSETBRUSHORGEX", "ptlOrigin:", "", contents);
}


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

x86 assembly (clang, -O2):
<U_EMRSETBRUSHORGEX_print>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
lea    0xef2(%rip),%rsi
lea    0xef5(%rip),%rdx
jmp    1030 <core7_print@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"U_EMRSETBRUSHORGEX\00"
@.str.1 = [11 x i8] c"ptlOrigin:\00"
@.str.2 = [1 x i8] zeroinitializer
define void @U_EMRSETBRUSHORGEX_print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @core7_print(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"U_EMRSETBRUSHORGEX\00"
@.str.1 = [11 x i8] c"ptlOrigin:\00"
@.str.2 = [1 x i8] zeroinitializer
define void @U_EMRSETBRUSHORGEX_print(i8* %0) {
%2 = tail call i32 @core7_print(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void cmd1(char *cmd) { printf("cmd1 executed with cmd line %s\n", cmd); }


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

x86 assembly (clang, -O2):
<cmd1>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"cmd1 executed with cmd line %s\0A\00"
define void @cmd1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"cmd1 executed with cmd line %s\0A\00"
define void @cmd1(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_help(char *name) {
  printf("Usage:\n");
  printf("%s <pdump file>\n", name);
}


x86 assembly (clang, -O0):
<print_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_help>:
push   %rbx
mov    %rdi,%rbx
lea    0xee6(%rip),%rdi
call   1030 <puts@plt>
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Usage:\0A\00"
@.str.1 = [17 x i8] c"%s <pdump file>\0A\00"
define void @print_help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@.str.1 = [17 x i8] c"%s <pdump file>\0A\00"
@str = [7 x i8] c"Usage:\00"
define void @print_help(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
void *a17(int);
void *a16(int x) { return (((x >> 16) & 1) ? a17(x) : a17(x)); }


x86 assembly (clang, -O0):
<a16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     113e <a16+0x2e>
mov    -0x4(%rbp),%edi
call   1030 <a17@plt>
mov    %rax,-0x10(%rbp)
jmp    114a <a16+0x3a>
mov    -0x4(%rbp),%edi
call   1030 <a17@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a16>:
jmp    1030 <a17@plt>

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

LLVM IR (-O2):
define i8* @a16(i32 %0) {
%2 = tail call i8* @a17(i32 %0)
ret i8* %2
}
int main() {
  int x;
  (x = 0) + (x = 1);
  return 1 / x;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ usleep(unsigned int);
void delay_ms(unsigned int msec) { usleep(msec * 1000); }


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

x86 assembly (clang, -O2):
<delay_ms>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @delay_ms(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul i32 %3, 1000
%5 = call i32 @usleep(i32 %4)
ret void
}

LLVM IR (-O2):
define void @delay_ms(i32 %0) {
%2 = mul i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lo_dmmu_en();
void dmmu_enable(void) { lo_dmmu_en(); }


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

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

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

LLVM IR (-O2):
define void @dmmu_enable() {
%1 = tail call i32 (...) @lo_dmmu_en()
ret void
}