xunge/DecIR huggingface dataset:
int do_338() { return 338; }


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

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

LLVM IR (-O0):
define i32 @do_338() {
ret i32 338
}

LLVM IR (-O2):
define i32 @do_338() {
ret i32 338
}
void glutTabletButtonFunc(void (*func)(int button, int state, int x, int y)) {}


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

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

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

LLVM IR (-O2):
define void @glutTabletButtonFunc(void (i32, i32, i32, i32)* nocapture %0) {
ret void
}
int num_records() { return 1; }


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

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

LLVM IR (-O0):
define i32 @num_records() {
ret i32 1
}

LLVM IR (-O2):
define i32 @num_records() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ self_def_undo_width(int);
void self_def_undo_length(int length) {
  for (; length > 0; length--) {
    printf("\033[31;1m+\033[0m");
    self_def_undo_width(2);
  }
  printf("\033[31;1m+\033[0m");
  putchar('\n');
}


x86 assembly (clang, -O0):
<self_def_undo_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1169 <self_def_undo_length+0x39>
lea    0xeb4(%rip),%rdi
call   1050 <printf@plt>
mov    $0x2,%edi
call   1040 <self_def_undo_width@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    113b <self_def_undo_length+0xb>
lea    0xe90(%rip),%rdi
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<self_def_undo_length>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    116a <self_def_undo_length+0x3a>
mov    %edi,%ebx
add    $0x1,%ebx
lea    0xebc(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
call   1050 <printf@plt>
mov    $0x2,%edi
call   1040 <self_def_undo_width@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1150 <self_def_undo_length+0x20>
lea    0xe8f(%rip),%rdi
call   1050 <printf@plt>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"\1B[31;1m+\1B[0m\00"
define void @self_def_undo_length(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %9, %1
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @self_def_undo_width(i32 2)
br label %9
9: ; preds = %6
%10 = load i32, i32* %2
%11 = add nsw i32 %10, -1
store i32 %11, i32* %2
br label %3
12: ; preds = %3
%13 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"\1B[31;1m+\1B[0m\00"
define void @self_def_undo_length(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ %0, %1 ]
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @self_def_undo_width(i32 2)
%7 = add nsw i32 %4, -1
%8 = icmp ugt i32 %4, 1
br i1 %8, label %3, label %9
9: ; preds = %3, %1
%10 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%11 = tail call i32 @putchar(i8 signext 10)
ret void
}
void SIGCHLDHandler(int TheSignal) {}


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

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

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

LLVM IR (-O2):
define void @SIGCHLDHandler(i32 %0) {
ret void
}
/* Variables and functions */
unsigned int echo_int_3_marshal_outputs__camkes_ret_fn_427(unsigned int, int *);
unsigned int echo_int_3_marshal_outputs(int *_camkes_return_431) {
  unsigned int _camkes_length_432 = 0;
  _camkes_length_432 = echo_int_3_marshal_outputs__camkes_ret_fn_427(
      _camkes_length_432, _camkes_return_431);
  if (_camkes_length_432 == 0xffffffffU) {
    return 0xffffffffU;
  }
  (void)0;
  return _camkes_length_432;
}


x86 assembly (clang, -O0):
<echo_int_3_marshal_outputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <echo_int_3_marshal_outputs__camkes_ret_fn_427@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    1148 <echo_int_3_marshal_outputs+0x38>
movl   $0xffffffff,-0x4(%rbp)
jmp    114e <echo_int_3_marshal_outputs+0x3e>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<echo_int_3_marshal_outputs>:
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <echo_int_3_marshal_outputs__camkes_ret_fn_427@plt>

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

LLVM IR (-O2):
define i32 @echo_int_3_marshal_outputs(i32* %0) {
%2 = tail call i32 @echo_int_3_marshal_outputs__camkes_ret_fn_427(i32 0, i32* %0)
ret i32 %2
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ do_not_propagate_mask;
};
typedef TYPE_1__ XSetWindowAttributes;

/* Variables and functions */
long get_XSetWindowAttributes_do_not_propagate_mask(void *_p) {
  return (long)((XSetWindowAttributes *)_p)->do_not_propagate_mask;
}


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

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

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

LLVM IR (-O2):
define i64 @get_XSetWindowAttributes_do_not_propagate_mask(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ tapByteHex(int);
int /*<<< orphan*/ tapString(char const *);
int main() {
  const char *s = "HELLO WORLD";
  tapString(s);
  printf(" 0xab = ");
  tapByteHex(0xab);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <tapString@plt>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    $0xab,%edi
call   1050 <tapByteHex@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <tapString@plt>
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
mov    $0xab,%edi
call   1050 <tapByteHex@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"HELLO WORLD\00"
@.str.1 = [9 x i8] c" 0xab = \00"
define i32 @main() {
%1 = alloca i8*
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
%3 = call i32 @tapString(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @tapByteHex(i32 171)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"HELLO WORLD\00"
@.str.1 = [9 x i8] c" 0xab = \00"
define i32 @main() {
%1 = tail call i32 @tapString(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @tapByteHex(i32 171)
ret i32 0
}
char *corta_string(char *apuntador) {
  if ((*apuntador) != '\0')
    apuntador = apuntador + 1;
  else
    apuntador = "Ha ocurrido un error, la cadena está vacía";
  return apuntador;
}


x86 assembly (clang, -O0):
<corta_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1129 <corta_string+0x29>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1134 <corta_string+0x34>
lea    0xed0(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<corta_string>:
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rcx
lea    0xef2(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [45 x i8] c"Ha ocurrido un error, la cadena est\C3\A1 vac\C3\ADa\00"
define i8* @corta_string(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
store i8* %9, i8** %2
br label %11
10: ; preds = %1
store i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8** %2
br label %11
11: ; preds = %10, %7
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
@.str = [45 x i8] c"Ha ocurrido un error, la cadena est\C3\A1 vac\C3\ADa\00"
define i8* @corta_string(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = select i1 %3, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %4
ret i8* %5
}
int hfile_always_local(const char *fname) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @hfile_always_local(i8* nocapture readnone %0) {
ret i32 0
}
void readfunct(void *x) {}


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

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

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

LLVM IR (-O2):
define void @readfunct(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_machine_get_class(const char *machine, char **class) {
  return -EINVAL;
}


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

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

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_machine_get_class(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** %1, i8*** %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_machine_get_class(i8* nocapture readnone %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
int btrfs_test_extent_buffer_operations(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @btrfs_test_extent_buffer_operations() {
ret i32 0
}

LLVM IR (-O2):
define i32 @btrfs_test_extent_buffer_operations() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test_strncmp(char *, char *, size_t, char *, char *, char *);
void test_expectn(char *expected, char *got, size_t len) {
  test_strncmp(expected, got, len, "expected: '%s', got: '%s'", expected, got);
}


x86 assembly (clang, -O0):
<test_expectn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%r8
mov    -0x10(%rbp),%r9
lea    0xec1(%rip),%rcx
call   1030 <test_strncmp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_expectn>:
lea    0xee9(%rip),%rcx
mov    %rdi,%r8
mov    %rsi,%r9
jmp    1030 <test_strncmp@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"expected: '%s', got: '%s'\00"
define void @test_expectn(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = load i8*, i8** %4
%11 = load i8*, i8** %5
%12 = call i32 @test_strncmp(i8* %7, i8* %8, i64 %9, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %11)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"expected: '%s', got: '%s'\00"
define void @test_expectn(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @test_strncmp(i8* %0, i8* %1, i64 %2, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
/* Variables and functions */
unsigned long __VERIFIER_nondet_ulong();
int /*<<< orphan*/ assert_context_process();
unsigned long copy_to_user(void *to, void const *from, unsigned long n) {
  unsigned long tmp;
  {
    {
      assert_context_process();
      tmp = __VERIFIER_nondet_ulong();
    }
    return (tmp);
  }
}


x86 assembly (clang, -O0):
<copy_to_user>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1040 <assert_context_process@plt>
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_ulong@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @copy_to_user(i8* nocapture readnone %0, i8* nocapture readnone %1, i64 %2) {
%4 = tail call i32 (...) @assert_context_process()
%5 = tail call i64 (...) @__VERIFIER_nondet_ulong()
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ config_timerwd(int);
int /*<<< orphan*/ enable_reg_irq();
int /*<<< orphan*/ mbus_write_message32(int, int);
int /*<<< orphan*/ set_wakeup_timer(int, int /*<<< orphan*/, int);
int main() {
  mbus_write_message32(0xAA, 0x11111111);
  set_wakeup_timer(100, 0, 1);
  enable_reg_irq();
  mbus_write_message32(0xAA, 0x22222222);
  config_timerwd(100000);
  while (1)
    ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xaa,%edi
mov    $0x11111111,%esi
call   1040 <mbus_write_message32@plt>
mov    $0x64,%edi
xor    %esi,%esi
mov    $0x1,%edx
call   1060 <set_wakeup_timer@plt>
mov    $0x0,%al
call   1030 <enable_reg_irq@plt>
mov    $0xaa,%edi
mov    $0x22222222,%esi
call   1040 <mbus_write_message32@plt>
mov    $0x186a0,%edi
call   1050 <config_timerwd@plt>
jmp    118f <main+0x4f>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xaa,%edi
mov    $0x11111111,%esi
call   1040 <mbus_write_message32@plt>
mov    $0x64,%edi
xor    %esi,%esi
mov    $0x1,%edx
call   1060 <set_wakeup_timer@plt>
xor    %eax,%eax
call   1030 <enable_reg_irq@plt>
mov    $0xaa,%edi
mov    $0x22222222,%esi
call   1040 <mbus_write_message32@plt>
mov    $0x186a0,%edi
call   1050 <config_timerwd@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
jmp    1190 <main+0x50>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @mbus_write_message32(i32 170, i32 286331153)
%3 = call i32 @set_wakeup_timer(i32 100, i32 0, i32 1)
%4 = call i32 (...) @enable_reg_irq()
%5 = call i32 @mbus_write_message32(i32 170, i32 572662306)
%6 = call i32 @config_timerwd(i32 100000)
br label %7
7: ; preds = %0, %7
br label %7
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @mbus_write_message32(i32 170, i32 286331153)
%2 = tail call i32 @set_wakeup_timer(i32 100, i32 0, i32 1)
%3 = tail call i32 (...) @enable_reg_irq()
%4 = tail call i32 @mbus_write_message32(i32 170, i32 572662306)
%5 = tail call i32 @config_timerwd(i32 100000)
br label %6
6: ; preds = %0, %6
br label %6
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int solcon_clear_multprec_solutions(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(457, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<solcon_clear_multprec_solutions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1c9,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solcon_clear_multprec_solutions>:
mov    $0x1c9,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @solcon_clear_multprec_solutions() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 457, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @solcon_clear_multprec_solutions() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 457, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
void gdk_net_wm_supports() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, double,
                           char *);
void fprintf_realnum(FILE *s, char *m1, double x, char *m2) {
  fprintf(s, "%s = %g%s", m1, x, m2);
}


x86 assembly (clang, -O0):
<fprintf_realnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
movsd  -0x18(%rbp),%xmm0
mov    -0x20(%rbp),%rcx
lea    0xebf(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fprintf_realnum>:
mov    %rdx,%rcx
mov    %rsi,%rdx
lea    0xee3(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"%s = %g%s\00"
define void @fprintf_realnum(i32* nocapture %0, i8* %1, double %2, i8* %3) {
%5 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %1, double %2, i8* %3)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint8_t timer_expired(uint32_t *timer) { return timer[0x01C / 4] & 1; }


x86 assembly (clang, -O0):
<timer_expired>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1c(%rax),%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_expired>:
mov    0x1c(%rdi),%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @timer_expired(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 7
%5 = load i32, i32* %4
%6 = and i32 %5, 1
ret i32 %6
}

LLVM IR (-O2):
define i32 @timer_expired(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 7
%3 = load i32, i32* %2
%4 = and i32 %3, 1
ret i32 %4
}
/* Type definitions */
struct iam_leaf {
  int dummy;
};

/* Variables and functions */
scalar_t__ lentry_count_get(struct iam_leaf *);
int iam_lfix_leaf_empty(struct iam_leaf *leaf) {
  return lentry_count_get(leaf) == 0;
}


x86 assembly (clang, -O0):
<iam_lfix_leaf_empty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <lentry_count_get@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iam_lfix_leaf_empty>:
push   %rax
call   1030 <lentry_count_get@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.iam_leaf = type { i32 }
define i32 @iam_lfix_leaf_empty(%struct.iam_leaf* %0) {
%2 = alloca %struct.iam_leaf*
store %struct.iam_leaf* %0, %struct.iam_leaf** %2
%3 = load %struct.iam_leaf*, %struct.iam_leaf** %2
%4 = call i64 @lentry_count_get(%struct.iam_leaf* %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
%struct.iam_leaf = type { i32 }
define i32 @iam_lfix_leaf_empty(%struct.iam_leaf* %0) {
%2 = tail call i64 @lentry_count_get(%struct.iam_leaf* %0)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void watchdog_unbind(int num_sock, int base_fd) {
  int i;
  for (i = 0; i < num_sock; ++i, ++base_fd) {
    close(base_fd);
  }
}


x86 assembly (clang, -O0):
<watchdog_unbind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1150 <watchdog_unbind+0x40>
mov    -0x8(%rbp),%edi
call   1030 <close@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1125 <watchdog_unbind+0x15>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<watchdog_unbind>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
jle    112f <watchdog_unbind+0x1f>
mov    %esi,%ebx
mov    %edi,%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <close@plt>
add    $0x1,%ebx
add    $0xffffffff,%ebp
jne    1120 <watchdog_unbind+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @watchdog_unbind(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %11
4: ; preds = %2, %4
%5 = phi i32 [ %8, %4 ], [ 0, %2 ]
%6 = phi i32 [ %9, %4 ], [ %1, %2 ]
%7 = tail call i32 @close(i32 %6)
%8 = add nuw nsw i32 %5, 1
%9 = add nsw i32 %6, 1
%10 = icmp eq i32 %8, %0
br i1 %10, label %11, label %4
11: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void libpthread_fini(void) { printf("libpthread_fini\n"); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"libpthread_fini\0A\00"
define void @libpthread_fini() {
%1 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [16 x i8] c"libpthread_fini\00"
define void @libpthread_fini() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int tn_free(void **d) {
  if (!d) {
    return 0;
  }
  if (*d) {
    free(*d);
  }
  return 1;
}


x86 assembly (clang, -O0):
<tn_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <tn_free+0x23>
movl   $0x0,-0x4(%rbp)
jmp    1154 <tn_free+0x44>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     114d <tn_free+0x3d>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tn_free>:
push   %rbx
test   %rdi,%rdi
je     112a <tn_free+0x1a>
mov    (%rdi),%rdi
mov    $0x1,%ebx
test   %rdi,%rdi
je     112c <tn_free+0x1c>
call   1030 <free@plt>
jmp    112c <tn_free+0x1c>
xor    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @tn_free(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @free(i8* %4)
br label %8
8: ; preds = %3, %6, %1
%9 = phi i32 [ 0, %1 ], [ 1, %6 ], [ 1, %3 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  char buffer[16];
  printf("You win this game if you are able to do something other than "
         "reaching the end of this function.'\n");
  gets(buffer);
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rdi
call   1040 <gets@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [98 x i8] c"You win this game if you are able to do something other than reaching the end of this function.'\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [16 x i8]
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = call i32 @printf(i8* getelementptr inbounds ([98 x i8], [98 x i8]* @.str, i64 0, i64 0))
%7 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%8 = call i32 @gets(i8* %7)
ret i32 0
}

LLVM IR (-O2):
@str = [97 x i8] c"You win this game if you are able to do something other than reaching the end of this function.'\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [16 x i8]
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([97 x i8], [97 x i8]* @str, i64 0, i64 0))
%6 = call i32 @gets(i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help(void) {
  printf("Usage: \n");
  printf("\t loopcheck -i DEVNAME -r RETRY -s PKT_SIZE\n");
  printf("\t Warning:  512 >= PKT_SIZE >= 64\n");
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
call   1030 <printf@plt>
lea    0xf03(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee4(%rip),%rdi
call   1030 <puts@plt>
lea    0xf04(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"Usage: \0A\00"
@.str.1 = [45 x i8] c"\09 loopcheck -i DEVNAME -r RETRY -s PKT_SIZE\0A\00"
@.str.2 = [35 x i8] c"\09 Warning: 512 >= PKT_SIZE >= 64\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [8 x i8] c"Usage: \00"
@str.3 = [44 x i8] c"\09 loopcheck -i DEVNAME -r RETRY -s PKT_SIZE\00"
@str.4 = [34 x i8] c"\09 Warning: 512 >= PKT_SIZE >= 64\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.4, i64 0, i64 0))
ret void
}
int audio_set_rate(struct audio_info_struct *ai) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.audio_info_struct = type opaque
define i32 @audio_set_rate(%struct.audio_info_struct* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
bool read_defect_data_12_is_plist_valid(uint8_t *data) {
  return data[1] & 0x10;
}


x86 assembly (clang, -O0):
<read_defect_data_12_is_plist_valid>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
and    $0x10,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_defect_data_12_is_plist_valid>:
mov    0x4(%rdi),%eax
and    $0x10,%eax
ret

LLVM IR (-O0):
define i32 @read_defect_data_12_is_plist_valid(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 1
%5 = load i32, i32* %4
%6 = and i32 %5, 16
ret i32 %6
}

LLVM IR (-O2):
define i32 @read_defect_data_12_is_plist_valid(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
%4 = and i32 %3, 16
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ guild_flush_expcache();
int guild_payexp_timer(int tid, unsigned int tick, int id, void *data) {
  guild_flush_expcache();
  return 0;
}


x86 assembly (clang, -O0):
<guild_payexp_timer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    $0x0,%al
call   1030 <guild_flush_expcache@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @guild_payexp_timer(i32 %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = call i32 (...) @guild_flush_expcache()
ret i32 0
}

LLVM IR (-O2):
define i32 @guild_payexp_timer(i32 %0, i32 %1, i32 %2, i8* nocapture readnone %3) {
%5 = tail call i32 (...) @guild_flush_expcache()
ret i32 0
}
char const *_Locale_ctype_name(const void *__DUMMY_PAR1, char *__DUMMY_PAR) {
  return 0;
}


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

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

LLVM IR (-O0):
define i8* @_Locale_ctype_name(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @_Locale_ctype_name(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* null
}
void __sti_mwait(unsigned long eax, unsigned long ecx) {
  trace_hardirqs_on();
  asm volatile("sti; .byte 0x0f, 0x01, 0xc9;" ::"a"(eax), "c"(ecx));
}


x86 assembly (clang, -O0):
<__sti_mwait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <trace_hardirqs_on@plt>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sti
mwait  %eax,%ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__sti_mwait>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <trace_hardirqs_on@plt>
mov    %rbx,%rax
mov    %r14,%rcx
sti
mwait  %eax,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @__sti_mwait(i64 %0, i64 %1) {
%3 = tail call i32 (...) @trace_hardirqs_on()
tail call void asm sideeffect "sti; .byte 0x0f, 0x01, 0xc9;", "{ax},{cx},~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1)
ret void
}
unsigned char decToBcd(unsigned char val) {
  return ((val / 10 * 16) + (val % 10));
}


x86 assembly (clang, -O0):
<decToBcd>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
shl    $0x4,%eax
mov    %eax,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%eax
add    %edx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decToBcd>:
mov    %edi,%eax
imul   $0xcd,%edi,%ecx
shr    $0xb,%ecx
mov    %ecx,%edx
shl    $0x4,%dl
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %cl,%al
or     %dl,%al
ret

LLVM IR (-O0):
define zeroext i8 @decToBcd(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = sdiv i32 %4, 10
%6 = mul nsw i32 %5, 16
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = srem i32 %8, 10
%10 = add nsw i32 %6, %9
%11 = trunc i32 %10 to i8
ret i8 %11
}

LLVM IR (-O2):
define zeroext i8 @decToBcd(i8 zeroext %0) {
%2 = udiv i8 %0, 10
%3 = shl i8 %2, 4
%4 = urem i8 %0, 10
%5 = or i8 %3, %4
ret i8 %5
}
void addon_init() {}


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

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

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

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

/* Variables and functions */
int bin_to_hex4(int);
uint8_t bin_to_hex8(uint8_t num) {
  return bin_to_hex4(num >> 4) | bin_to_hex4(num);
}


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

x86 assembly (clang, -O2):
<bin_to_hex8>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
sar    $0x4,%edi
call   1030 <bin_to_hex4@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <bin_to_hex4@plt>
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @bin_to_hex8(i32 %0) {
%2 = ashr i32 %0, 4
%3 = tail call i32 @bin_to_hex4(i32 %2)
%4 = tail call i32 @bin_to_hex4(i32 %0)
%5 = or i32 %4, %3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ pushNumber(int /*<<< orphan*/);
int /*<<< orphan*/ updatebob();
void basUpdateBob() { pushNumber(updatebob()); }


x86 assembly (clang, -O0):
<basUpdateBob>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <updatebob@plt>
mov    %eax,%edi
call   1040 <pushNumber@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @basUpdateBob() {
%1 = call i32 (...) @updatebob()
%2 = call i32 @pushNumber(i32 %1)
ret void
}

LLVM IR (-O2):
define void @basUpdateBob() {
%1 = tail call i32 (...) @updatebob()
%2 = tail call i32 @pushNumber(i32 %1)
ret void
}
int findDoubleCorner(char *playground) {
  if (((playground[0] == 'x') && (playground[8] == 'x')) ||
      ((playground[2] == 'x') && (playground[6] == 'x')))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<findDoubleCorner>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x78,%eax
jne    1129 <findDoubleCorner+0x29>
mov    -0x10(%rbp),%rax
movsbl 0x8(%rax),%eax
cmp    $0x78,%eax
je     114b <findDoubleCorner+0x4b>
mov    -0x10(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x78,%eax
jne    1157 <findDoubleCorner+0x57>
mov    -0x10(%rbp),%rax
movsbl 0x6(%rax),%eax
cmp    $0x78,%eax
jne    1157 <findDoubleCorner+0x57>
movl   $0x1,-0x4(%rbp)
jmp    115e <findDoubleCorner+0x5e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<findDoubleCorner>:
cmpb   $0x78,(%rdi)
jne    1110 <findDoubleCorner+0x10>
mov    $0x1,%eax
cmpb   $0x78,0x8(%rdi)
je     1123 <findDoubleCorner+0x23>
cmpb   $0x78,0x2(%rdi)
jne    1121 <findDoubleCorner+0x21>
mov    $0x1,%eax
cmpb   $0x78,0x6(%rdi)
je     1123 <findDoubleCorner+0x23>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @findDoubleCorner(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 120
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 8
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 120
br i1 %7, label %17, label %8
8: ; preds = %4, %1
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 120
br i1 %11, label %12, label %16
12: ; preds = %8
%13 = getelementptr inbounds i8, i8* %0, i64 6
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 120
br i1 %15, label %17, label %16
16: ; preds = %12, %8
br label %17
17: ; preds = %4, %12, %16
%18 = phi i32 [ 0, %16 ], [ 1, %12 ], [ 1, %4 ]
ret i32 %18
}
/* Variables and functions */
int EXIT_SUCCESS;
double eval(char *);
int /*<<< orphan*/ printf(char *, char *, double);
int main(void) {
  char expression[] = "2*(2+3)*(2-3)/5";
  printf("%s = %g\n", expression, eval(expression));
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x20(%rbp),%rdi
call   1040 <eval@plt>
mov    -0x28(%rbp),%rsi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e73(%rip),%rax
mov    (%rax),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movaps 0xed4(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <eval@plt>
lea    0xece(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.expression = [16 x i8] c"2*(2+3)*(2-3)/5\00"
@.str = [9 x i8] c"%s = %g\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [16 x i8]
store i32 0, i32* %1
%3 = bitcast [16 x i8]* %2 to i8*
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%6 = call double @eval(i8* %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %4, double %6)
%8 = load i32, i32* @EXIT_SUCCESS
ret i32 %8
}

LLVM IR (-O2):
@__const.main.expression = [16 x i8] c"2*(2+3)*(2-3)/5\00"
@.str = [9 x i8] c"%s = %g\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = call double @eval(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %2, double %3)
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
/* Variables and functions */
scalar_t__ strcmp(scalar_t__, char *);
scalar_t__ strrchr(char const *, char);
char *get_mime_type_from_filename(const char *filename) {
  return (strcmp(strrchr(filename, '.') + 1, "png") == 0) ? "image/png"
                                                          : "image/jpeg";
}


x86 assembly (clang, -O0):
<get_mime_type_from_filename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %rax,%rdi
add    $0x1,%rdi
lea    0xebe(%rip),%rsi
call   1040 <strcmp@plt>
mov    %rax,%rdx
lea    0xeb3(%rip),%rax
lea    0xea2(%rip),%rcx
cmp    $0x0,%rdx
cmove  %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_mime_type_from_filename>:
push   %rax
mov    $0x2e,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rdi
lea    0xed0(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
lea    0xebb(%rip),%rcx
lea    0xebe(%rip),%rax
cmove  %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"png\00"
@.str.1 = [10 x i8] c"image/png\00"
@.str.2 = [11 x i8] c"image/jpeg\00"
define i8* @get_mime_type_from_filename(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strrchr(i8* %3, i8 signext 46)
%5 = add nsw i64 %4, 1
%6 = call i64 @strcmp(i64 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0)
ret i8* %9
}

LLVM IR (-O2):
@.str = [4 x i8] c"png\00"
@.str.1 = [10 x i8] c"image/png\00"
@.str.2 = [11 x i8] c"image/jpeg\00"
define i8* @get_mime_type_from_filename(i8* %0) {
%2 = tail call i64 @strrchr(i8* %0, i8 signext 46)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @strcmp(i64 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
%6 = select i1 %5, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0)
ret i8* %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
struct exif_tag {
  int dummy;
};

/* Variables and functions */
char *exif_tag_name_r(int /*<<< orphan*/, struct exif_tag *);
int /*<<< orphan*/ exif_tags_array_init(struct exif_tag **);
char *exif_tag_name(uint16_t tag) {
  static struct exif_tag *exif_tags = NULL;
  if (exif_tags == NULL) {
    exif_tags_array_init(&exif_tags);
  }
  return exif_tag_name_r(tag, exif_tags);
}


x86 assembly (clang, -O0):
<exif_tag_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpq   $0x0,0x2f05(%rip)
jne    1145 <exif_tag_name+0x25>
lea    0x2ef8(%rip),%rdi
call   1030 <exif_tags_array_init@plt>
mov    -0x4(%rbp),%edi
mov    0x2ee9(%rip),%rsi
call   1040 <exif_tag_name_r@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exif_tag_name>:
push   %rbx
mov    %edi,%ebx
mov    0x2f0e(%rip),%rsi
test   %rsi,%rsi
jne    1142 <exif_tag_name+0x22>
lea    0x2f02(%rip),%rdi
call   1030 <exif_tags_array_init@plt>
mov    0x2ef6(%rip),%rsi
mov    %ebx,%edi
pop    %rbx
jmp    1040 <exif_tag_name_r@plt>

LLVM IR (-O0):
%struct.exif_tag = type { i32 }
@exif_tag_name.exif_tags = internal global %struct.exif_tag* null
define i8* @exif_tag_name(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load %struct.exif_tag*, %struct.exif_tag** @exif_tag_name.exif_tags
%4 = icmp eq %struct.exif_tag* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @exif_tags_array_init(%struct.exif_tag** @exif_tag_name.exif_tags)
br label %7
7: ; preds = %5, %1
%8 = load i32, i32* %2
%9 = load %struct.exif_tag*, %struct.exif_tag** @exif_tag_name.exif_tags
%10 = call i8* @exif_tag_name_r(i32 %8, %struct.exif_tag* %9)
ret i8* %10
}

LLVM IR (-O2):
%struct.exif_tag = type { i32 }
@exif_tag_name.exif_tags = internal global %struct.exif_tag* null
define i8* @exif_tag_name(i32 %0) {
%2 = load %struct.exif_tag*, %struct.exif_tag** @exif_tag_name.exif_tags
%3 = icmp eq %struct.exif_tag* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @exif_tags_array_init(%struct.exif_tag** @exif_tag_name.exif_tags)
%6 = load %struct.exif_tag*, %struct.exif_tag** @exif_tag_name.exif_tags
br label %7
7: ; preds = %4, %1
%8 = phi %struct.exif_tag* [ %6, %4 ], [ %2, %1 ]
%9 = tail call i8* @exif_tag_name_r(i32 %0, %struct.exif_tag* %8)
ret i8* %9
}
/* Variables and functions */
void __aos_mdelay(int);
void aos_mdelay(int msecs) { return __aos_mdelay(msecs); }


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

x86 assembly (clang, -O2):
<aos_mdelay>:
jmp    1030 <__aos_mdelay@plt>

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

LLVM IR (-O2):
define void @aos_mdelay(i32 %0) {
tail call void @__aos_mdelay(i32 %0)
ret void
}