xunge/DecIR huggingface dataset:
/* Variables and functions */
int f1();
int f3(void) { return f1() + 3; }


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <f1@plt>
add    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
push   %rax
xor    %eax,%eax
call   1030 <f1@plt>
add    $0x3,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @f3() {
%1 = call i32 (...) @f1()
%2 = add nsw i32 %1, 3
ret i32 %2
}

LLVM IR (-O2):
define i32 @f3() {
%1 = tail call i32 (...) @f1()
%2 = add nsw i32 %1, 3
ret i32 %2
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ntohl(int const);
uint32_t get_unaligned_u32(const uint32_t *p_) {
  const uint8_t *p = (const uint8_t *)p_;
  return ntohl((p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3]);
}


x86 assembly (clang, -O0):
<get_unaligned_u32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
shl    $0x18,%edi
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
shl    $0x10,%eax
or     %eax,%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%eax
shl    $0x8,%eax
or     %eax,%edi
mov    -0x10(%rbp),%rax
or     0xc(%rax),%edi
call   1030 <ntohl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_unaligned_u32>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x8(%rdi),%eax
shl    $0x8,%eax
or     %ecx,%eax
or     0xc(%rdi),%eax
mov    %eax,%edi
jmp    1030 <ntohl@plt>

LLVM IR (-O0):
define i32 @get_unaligned_u32(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
store i32* %0, i32** %2
%4 = load i32*, i32** %2
store i32* %4, i32** %3
%5 = load i32*, i32** %3
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = shl i32 %7, 24
%9 = load i32*, i32** %3
%10 = getelementptr inbounds i32, i32* %9, i64 1
%11 = load i32, i32* %10
%12 = shl i32 %11, 16
%13 = or i32 %8, %12
%14 = load i32*, i32** %3
%15 = getelementptr inbounds i32, i32* %14, i64 2
%16 = load i32, i32* %15
%17 = shl i32 %16, 8
%18 = or i32 %13, %17
%19 = load i32*, i32** %3
%20 = getelementptr inbounds i32, i32* %19, i64 3
%21 = load i32, i32* %20
%22 = or i32 %18, %21
%23 = call i32 @ntohl(i32 %22)
ret i32 %23
}

LLVM IR (-O2):
define i32 @get_unaligned_u32(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 24
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = shl i32 %5, 16
%7 = or i32 %6, %3
%8 = getelementptr inbounds i32, i32* %0, i64 2
%9 = load i32, i32* %8
%10 = shl i32 %9, 8
%11 = or i32 %7, %10
%12 = getelementptr inbounds i32, i32* %0, i64 3
%13 = load i32, i32* %12
%14 = or i32 %11, %13
%15 = tail call i32 @ntohl(i32 %14)
ret i32 %15
}
/* Type definitions */
struct wl_proxy {
  int dummy;
};
struct wl_buffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_destroy(struct wl_proxy *);
int /*<<< orphan*/ wl_proxy_marshal(struct wl_proxy *, int /*<<< orphan*/);
void wl_buffer_destroy(struct wl_buffer *wl_buffer) {
  wl_proxy_marshal((struct wl_proxy *)wl_buffer, 0);
  wl_proxy_destroy((struct wl_proxy *)wl_buffer);
}


x86 assembly (clang, -O0):
<wl_buffer_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1040 <wl_proxy_marshal@plt>
mov    -0x8(%rbp),%rdi
call   1030 <wl_proxy_destroy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wl_buffer_destroy>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
call   1040 <wl_proxy_marshal@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <wl_proxy_destroy@plt>

LLVM IR (-O0):
%struct.wl_buffer = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_buffer_destroy(%struct.wl_buffer* %0) {
%2 = alloca %struct.wl_buffer*
store %struct.wl_buffer* %0, %struct.wl_buffer** %2
%3 = load %struct.wl_buffer*, %struct.wl_buffer** %2
%4 = bitcast %struct.wl_buffer* %3 to %struct.wl_proxy*
%5 = call i32 @wl_proxy_marshal(%struct.wl_proxy* %4, i32 0)
%6 = load %struct.wl_buffer*, %struct.wl_buffer** %2
%7 = bitcast %struct.wl_buffer* %6 to %struct.wl_proxy*
%8 = call i32 @wl_proxy_destroy(%struct.wl_proxy* %7)
ret void
}

LLVM IR (-O2):
%struct.wl_buffer = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_buffer_destroy(%struct.wl_buffer* %0) {
%2 = bitcast %struct.wl_buffer* %0 to %struct.wl_proxy*
%3 = tail call i32 @wl_proxy_marshal(%struct.wl_proxy* %2, i32 0)
%4 = tail call i32 @wl_proxy_destroy(%struct.wl_proxy* %2)
ret void
}
void gdk_display_set_pointer_hooks() {}


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

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

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

LLVM IR (-O2):
define void @gdk_display_set_pointer_hooks() {
ret void
}
/* Type definitions */
struct tms {
  int dummy;
};
typedef int clock_t;

/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ errno;
clock_t _times(struct tms *buf) {
  errno = EINVAL;
  return -1;
}


x86 assembly (clang, -O0):
<_times>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ec9(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec8(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.tms = type { i32 }
@EINVAL = global i32 0
@errno = global i32 0
define i32 @_times(%struct.tms* %0) {
%2 = alloca %struct.tms*
store %struct.tms* %0, %struct.tms** %2
%3 = load i32, i32* @EINVAL
store i32 %3, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
%struct.tms = type { i32 }
@EINVAL = global i32 0
@errno = global i32 0
define i32 @_times(%struct.tms* nocapture readnone %0) {
%2 = load i32, i32* @EINVAL
store i32 %2, i32* @errno
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int16_t;
typedef int /*<<< orphan*/ u_char;

/* Variables and functions */
int /*<<< orphan*/ ns_get16(int /*<<< orphan*/ const *);
u_int16_t _getshort(const u_char *src) { return (ns_get16(src)); }


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

x86 assembly (clang, -O2):
<_getshort>:
jmp    1030 <ns_get16@plt>

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

LLVM IR (-O2):
define i32 @_getshort(i32* %0) {
%2 = tail call i32 @ns_get16(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, long, long, char *);
scalar_t__ getpid();
scalar_t__ gettid_sys();
int /*<<< orphan*/ stderr;
void whoami(char *msg) {
  fprintf(stderr, "pid %ld Thread %ld %s\n", (long)getpid(), (long)gettid_sys(),
          msg);
  fflush(stderr);
}


x86 assembly (clang, -O0):
<whoami>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e8d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <gettid_sys@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    %rax,%rcx
mov    -0x8(%rbp),%r8
lea    0xe81(%rip),%rsi
call   1050 <fprintf@plt>
mov    0x2e55(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<whoami>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    0x2e8f(%rip),%r15
mov    (%r15),%ebp
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1040 <gettid_sys@plt>
lea    0xe94(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
mov    %r14,%r8
call   1050 <fprintf@plt>
mov    (%r15),%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1060 <fflush@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"pid %ld Thread %ld %s\0A\00"
define void @whoami(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i64 (...) @getpid()
%5 = call i64 (...) @gettid_sys()
%6 = load i8*, i8** %2
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i64 %4, i64 %5, i8* %6)
%8 = load i32, i32* @stderr
%9 = call i32 @fflush(i32 %8)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"pid %ld Thread %ld %s\0A\00"
define void @whoami(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i64 (...) @getpid()
%4 = tail call i64 (...) @gettid_sys()
%5 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i64 %3, i64 %4, i8* %0)
%6 = load i32, i32* @stderr
%7 = tail call i32 @fflush(i32 %6)
ret void
}
/* Variables and functions */
scalar_t__ is_mch_420(int);
scalar_t__ is_mch_422(int);
int get_uv_ds_ratio_h(int fmt) {
  if (is_mch_422(fmt)) {
    return 1;
  } else if (is_mch_420(fmt)) {
    return 2;
  }
  return 0;
}


x86 assembly (clang, -O0):
<get_uv_ds_ratio_h>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <is_mch_422@plt>
cmp    $0x0,%rax
je     1149 <get_uv_ds_ratio_h+0x29>
movl   $0x1,-0x4(%rbp)
jmp    1173 <get_uv_ds_ratio_h+0x53>
mov    -0x8(%rbp),%edi
call   1040 <is_mch_420@plt>
cmp    $0x0,%rax
je     1167 <get_uv_ds_ratio_h+0x47>
movl   $0x2,-0x4(%rbp)
jmp    1173 <get_uv_ds_ratio_h+0x53>
jmp    116c <get_uv_ds_ratio_h+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_uv_ds_ratio_h>:
push   %rbx
mov    %edi,%ebx
call   1030 <is_mch_422@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <get_uv_ds_ratio_h+0x17>
pop    %rbx
ret
mov    %ebx,%edi
call   1040 <is_mch_420@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @get_uv_ds_ratio_h(i32 %0) {
%2 = tail call i64 @is_mch_422(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @is_mch_420(i32 %0)
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i32 0, i32 2
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ play_hangman(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char storedstring[7];
  printf("Enter a word (up to 6 letters): ");
  scanf("%6s", storedstring);
  printf("\n");
  printf("Welcome to H A N G M A N\n");
  play_hangman(storedstring);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    -0xb(%rbp),%rsi
lea    0xecb(%rip),%rdi
call   1040 <scanf@plt>
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
lea    -0xb(%rbp),%rdi
call   1050 <play_hangman@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xea4(%rip),%rdi
call   1050 <printf@plt>
lea    0xeb9(%rip),%rdi
lea    0x9(%rsp),%rbx
mov    %rbx,%rsi
call   1060 <scanf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe9f(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1070 <play_hangman@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Enter a word (up to 6 letters): \00"
@.str.1 = [4 x i8] c"%6s\00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [26 x i8] c"Welcome to H A N G M A N\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [7 x i8]
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
%8 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%9 = call i32 @play_hangman(i8* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"Enter a word (up to 6 letters): \00"
@.str.1 = [4 x i8] c"%6s\00"
@str = [25 x i8] c"Welcome to H A N G M A N\00"
define i32 @main() {
%1 = alloca [7 x i8]
%2 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i32 @putchar(i32 10)
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%7 = call i32 @play_hangman(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double, double);
double sqrt(double);
void higolangmath(double q) { printf("sqrt(%f) = %f\n", q, sqrt(q)); }


x86 assembly (clang, -O0):
<higolangmath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<higolangmath>:
movapd %xmm0,%xmm2
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm2
jb     1134 <higolangmath+0x14>
sqrtsd %xmm2,%xmm1
jmp    1150 <higolangmath+0x30>
push   %rax
movapd %xmm2,%xmm0
movsd  %xmm2,(%rsp)
call   1040 <sqrt@plt>
movsd  (%rsp),%xmm2
movapd %xmm0,%xmm1
add    $0x8,%rsp
lea    0xea9(%rip),%rdi
movapd %xmm2,%xmm0
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"sqrt(%f) = %f\0A\00"
define void @higolangmath(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = call double @sqrt(double %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), double %3, double %5)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"sqrt(%f) = %f\0A\00"
define void @higolangmath(double %0) {
%2 = tail call double @sqrt(double %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), double %0, double %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wint_t;
typedef int /*<<< orphan*/ wctrans_t;
typedef int /*<<< orphan*/ locale_t;

/* Variables and functions */
int /*<<< orphan*/ towctrans(int /*<<< orphan*/, int /*<<< orphan*/);
wint_t towctrans_l(wint_t c, wctrans_t t, locale_t l) {
  return towctrans(c, t);
}


x86 assembly (clang, -O0):
<towctrans_l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <towctrans@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<towctrans_l>:
jmp    1030 <towctrans@plt>

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

LLVM IR (-O2):
define i32 @towctrans_l(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @towctrans(i32 %0, i32 %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ SIGALRM;
int /*<<< orphan*/ sig_default(int /*<<< orphan*/);
extern void sig_alarm_default(void) { sig_default(SIGALRM); }


x86 assembly (clang, -O0):
<sig_alarm_default>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <sig_default@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_alarm_default>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <sig_default@plt>

LLVM IR (-O0):
@SIGALRM = global i32 0
define void @sig_alarm_default() {
%1 = load i32, i32* @SIGALRM
%2 = call i32 @sig_default(i32 %1)
ret void
}

LLVM IR (-O2):
@SIGALRM = global i32 0
define void @sig_alarm_default() {
%1 = load i32, i32* @SIGALRM
%2 = tail call i32 @sig_default(i32 %1)
ret void
}
void init_spi(void) {}


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

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

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

LLVM IR (-O2):
define void @init_spi() {
ret void
}
float hpmDegreesToRadians(float deg) { return deg * 0.0174532925; }


x86 assembly (clang, -O0):
<hpmDegreesToRadians>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee6(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<hpmDegreesToRadians>:
cvtss2sd %xmm0,%xmm0
mulsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @hpmDegreesToRadians(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fmul double %4, 0x3F91DF46A1FAE711
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @hpmDegreesToRadians(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 0x3F91DF46A1FAE711
%4 = fptrunc double %3 to float
ret float %4
}
void rcu_irq_enter_irqson(void) {}


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

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

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

LLVM IR (-O2):
define void @rcu_irq_enter_irqson() {
ret void
}
int f(int a, double b) {
  int i, j;
  i = a;
  return b + i;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x14(%rbp),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
cvtsi2sd %edi,%xmm1
addsd  %xmm0,%xmm1
cvttsd2si %xmm1,%eax
ret

LLVM IR (-O0):
define i32 @f(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store double %1, double* %4
%7 = load i32, i32* %3
store i32 %7, i32* %5
%8 = load double, double* %4
%9 = load i32, i32* %5
%10 = sitofp i32 %9 to double
%11 = fadd double %8, %10
%12 = fptosi double %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @f(i32 %0, double %1) {
%3 = sitofp i32 %0 to double
%4 = fadd double %3, %1
%5 = fptosi double %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
int main() {
  write(1, "ok\n", 3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
lea    0xed5(%rip),%rsi
mov    $0x3,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x1,%edi
mov    $0x3,%edx
call   1030 <write@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"ok\0A\00"
define i32 @main() {
%1 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
ret i32 0
}
int do_799() { return 799; }


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

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

LLVM IR (-O0):
define i32 @do_799() {
ret i32 799
}

LLVM IR (-O2):
define i32 @do_799() {
ret i32 799
}
/* Type definitions */
typedef void sl_node;

/* Variables and functions */
void *sl_pop(void **);
void *sl_push(void *, void *);
void *sl_reverse(void *root) {
  struct sl_node *revlist, *p;
  revlist = NULL;
  while ((p = sl_pop(&root)))
    revlist = sl_push(revlist, p);
  return revlist;
}


x86 assembly (clang, -O0):
<sl_reverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <sl_pop@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1161 <sl_reverse+0x41>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <sl_push@plt>
mov    %rax,-0x10(%rbp)
jmp    1134 <sl_reverse+0x14>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sl_reverse>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdi
call   1040 <sl_pop@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     115b <sl_reverse+0x3b>
mov    %rsp,%r14
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <sl_push@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1040 <sl_pop@plt>
test   %rax,%rax
jne    1140 <sl_reverse+0x20>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.sl_node = type opaque
define i8* @sl_reverse(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.sl_node*
%4 = alloca %struct.sl_node*
store i8* %0, i8** %2
store %struct.sl_node* null, %struct.sl_node** %3
br label %5
5: ; preds = %9, %1
%6 = call i8* @sl_pop(i8** %2)
%7 = bitcast i8* %6 to %struct.sl_node*
store %struct.sl_node* %7, %struct.sl_node** %4
%8 = icmp ne %struct.sl_node* %7, null
br i1 %8, label %9, label %16
9: ; preds = %5
%10 = load %struct.sl_node*, %struct.sl_node** %3
%11 = bitcast %struct.sl_node* %10 to i8*
%12 = load %struct.sl_node*, %struct.sl_node** %4
%13 = bitcast %struct.sl_node* %12 to i8*
%14 = call i8* @sl_push(i8* %11, i8* %13)
%15 = bitcast i8* %14 to %struct.sl_node*
store %struct.sl_node* %15, %struct.sl_node** %3
br label %5
16: ; preds = %5
%17 = load %struct.sl_node*, %struct.sl_node** %3
%18 = bitcast %struct.sl_node* %17 to i8*
ret i8* %18
}

LLVM IR (-O2):
%struct.sl_node = type opaque
define i8* @sl_reverse(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i8* @sl_pop(i8** %2)
%4 = icmp eq i8* %3, null
br i1 %4, label %11, label %5
5: ; preds = %1, %5
%6 = phi i8* [ %9, %5 ], [ %3, %1 ]
%7 = phi i8* [ %8, %5 ], [ null, %1 ]
%8 = call i8* @sl_push(i8* %7, i8* %6)
%9 = call i8* @sl_pop(i8** %2)
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %5
11: ; preds = %5, %1
%12 = phi i8* [ null, %1 ], [ %8, %5 ]
ret i8* %12
}
int yy_flex_strlen(const char *s) {
  register int n;
  for (n = 0; s[n]; ++n)
    ;
  return n;
}


x86 assembly (clang, -O0):
<yy_flex_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1134 <yy_flex_strlen+0x34>
jmp    1126 <yy_flex_strlen+0x26>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <yy_flex_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<yy_flex_strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <yy_flex_strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @yy_flex_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
bool WatchdogRunning(void) {
  return (
      ((*((volatile unsigned long *)(0x40080000 + 0x00000008))) & 0x00000001)
          ? true
          : false);
}


x86 assembly (clang, -O0):
<WatchdogRunning>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40080008,%eax
mov    (%rax),%rdx
and    $0x1,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<WatchdogRunning>:
mov    0x40080008,%rax
40
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @WatchdogRunning() {
%1 = load volatile i64, i64* inttoptr (i64 1074266120 to i64*)
%2 = and i64 %1, 1
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 1, i32 0
ret i32 %5
}

LLVM IR (-O2):
define i32 @WatchdogRunning() {
%1 = load volatile i64, i64* inttoptr (i64 1074266120 to i64*)
%2 = trunc i64 %1 to i32
%3 = and i32 %2, 1
ret i32 %3
}
int klucz(int n) { return -n; }


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

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

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

LLVM IR (-O2):
define i32 @klucz(i32 %0) {
%2 = sub nsw i32 0, %0
ret i32 %2
}
int Y(int R, int G, int B) { return 66 * R + 129 * G + 25 * B; }


x86 assembly (clang, -O0):
<Y>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
imul   $0x42,-0x4(%rbp),%eax
imul   $0x81,-0x8(%rbp),%ecx
add    %ecx,%eax
imul   $0x19,-0xc(%rbp),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Y>:
mov    %edi,%eax
shl    $0x6,%eax
lea    (%rax,%rdi,2),%eax
mov    %esi,%ecx
shl    $0x7,%ecx
add    %esi,%ecx
add    %eax,%ecx
lea    (%rdx,%rdx,4),%eax
lea    (%rax,%rax,4),%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @Y(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = mul nsw i32 66, %7
%9 = load i32, i32* %5
%10 = mul nsw i32 129, %9
%11 = add nsw i32 %8, %10
%12 = load i32, i32* %6
%13 = mul nsw i32 25, %12
%14 = add nsw i32 %11, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @Y(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %0, 66
%5 = mul nsw i32 %1, 129
%6 = add nsw i32 %5, %4
%7 = mul nsw i32 %2, 25
%8 = add nsw i32 %6, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ GPIOLED0Toggle();
void Task1Running(void) { GPIOLED0Toggle(); }


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

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

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

LLVM IR (-O2):
define void @Task1Running() {
%1 = tail call i32 (...) @GPIOLED0Toggle()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ XEDataObject;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
void free_XEDataObject(void *_p) {
  if (_p == NULL)
    abort();
  free((XEDataObject *)_p);
}


x86 assembly (clang, -O0):
<free_XEDataObject>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113e <free_XEDataObject+0x1e>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_XEDataObject>:
test   %rdi,%rdi
je     112a <free_XEDataObject+0xa>
jmp    1030 <free@plt>
push   %rax
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
define void @free_XEDataObject(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to i32*
%10 = call i32 @free(i32* %9)
ret void
}

LLVM IR (-O2):
define void @free_XEDataObject(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
%6 = bitcast i8* %0 to i32*
%7 = tail call i32 @free(i32* %6)
ret void
}
void TimerLoadSet(unsigned long ulBase, unsigned long ulTimer,
                  unsigned long ulValue) {
  ;

  ;
  if (ulTimer & 0x000000ff) {
    (*((volatile unsigned long *)(ulBase + 0x00000028))) = ulValue;
  }
  if (ulTimer & 0x0000ff00) {
    (*((volatile unsigned long *)(ulBase + 0x0000002C))) = ulValue;
  }
}


x86 assembly (clang, -O0):
<TimerLoadSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
and    $0xff,%rax
cmp    $0x0,%rax
je     1130 <TimerLoadSet+0x30>
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x28(%rax)
mov    -0x10(%rbp),%rax
and    $0xff00,%rax
cmp    $0x0,%rax
je     1150 <TimerLoadSet+0x50>
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x2c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerLoadSet>:
test   %sil,%sil
je     1109 <TimerLoadSet+0x9>
mov    %rdx,0x28(%rdi)
test   $0xff00,%esi
je     1115 <TimerLoadSet+0x15>
mov    %rdx,0x2c(%rdi)
ret

LLVM IR (-O0):
define void @TimerLoadSet(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %5
%8 = and i64 %7, 255
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %3
%11 = load i64, i64* %6
%12 = load i64, i64* %4
%13 = add i64 %12, 40
%14 = inttoptr i64 %13 to i64*
store volatile i64 %11, i64* %14
br label %15
15: ; preds = %10, %3
%16 = load i64, i64* %5
%17 = and i64 %16, 65280
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %24
19: ; preds = %15
%20 = load i64, i64* %6
%21 = load i64, i64* %4
%22 = add i64 %21, 44
%23 = inttoptr i64 %22 to i64*
store volatile i64 %20, i64* %23
br label %24
24: ; preds = %19, %15
ret void
}

LLVM IR (-O2):
define void @TimerLoadSet(i64 %0, i64 %1, i64 %2) {
%4 = and i64 %1, 255
%5 = icmp eq i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = add i64 %0, 40
%8 = inttoptr i64 %7 to i64*
store volatile i64 %2, i64* %8
br label %9
9: ; preds = %6, %3
%10 = and i64 %1, 65280
%11 = icmp eq i64 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %9
%13 = add i64 %0, 44
%14 = inttoptr i64 %13 to i64*
store volatile i64 %2, i64* %14
br label %15
15: ; preds = %12, %9
ret void
}
/* Variables and functions */
char *strcat(char *, char const *);
char *STRCAT(char *_Dest, const char *_Source) {
  return strcat(_Dest, _Source);
}


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

x86 assembly (clang, -O2):
<STRCAT>:
jmp    1030 <strcat@plt>

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

LLVM IR (-O2):
define i8* @STRCAT(i8* returned %0, i8* nocapture %1) {
%3 = tail call i8* @strcat(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i8* %0
}
void c_fun() {}


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

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

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

LLVM IR (-O2):
define void @c_fun() {
ret void
}
/* Variables and functions */
double powf(double, int);
float midiNoteFreq(int note) { return 440.0 * powf(2.0, (note - 69.0) / 12.0); }


x86 assembly (clang, -O0):
<midiNoteFreq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xef0(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xedc(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
movsd  0xec4(%rip),%xmm0
call   1030 <powf@plt>
movaps %xmm0,%xmm1
movsd  0xeac(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<midiNoteFreq>:
push   %rax
cvtsi2sd %edi,%xmm0
addsd  0xee3(%rip),%xmm0
divsd  0xee3(%rip),%xmm0
cvttsd2si %xmm0,%edi
movsd  0xedf(%rip),%xmm0
call   1030 <powf@plt>
mulsd  0xeda(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @midiNoteFreq(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = fsub double %4, 6.900000e+01
%6 = fdiv double %5, 1.200000e+01
%7 = fptosi double %6 to i32
%8 = call double @powf(double 2.000000e+00, i32 %7)
%9 = fmul double 4.400000e+02, %8
%10 = fptrunc double %9 to float
ret float %10
}

LLVM IR (-O2):
define float @midiNoteFreq(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fadd double %2, -6.900000e+01
%4 = fdiv double %3, 1.200000e+01
%5 = fptosi double %4 to i32
%6 = tail call double @powf(double 2.000000e+00, i32 %5)
%7 = fmul double %6, 4.400000e+02
%8 = fptrunc double %7 to float
ret float %8
}
/* Variables and functions */
int /*<<< orphan*/ __ESBMC_assume(char *);
char *malloc(int);
int /*<<< orphan*/ really(char *);
int main(void) {
  char *p = malloc(10);
  __ESBMC_assume(p);
  really(p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <__ESBMC_assume@plt>
mov    -0x10(%rbp),%rdi
call   1040 <really@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xa,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <__ESBMC_assume@plt>
mov    %rbx,%rdi
call   1040 <really@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* @malloc(i32 10)
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @__ESBMC_assume(i8* %4)
%6 = load i8*, i8** %2
%7 = call i32 @really(i8* %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call dereferenceable_or_null(10) i8* @malloc(i32 10)
%2 = tail call i32 @__ESBMC_assume(i8* %1)
%3 = tail call i32 @really(i8* %1)
ret i32 0
}
int bq24192_get_battery_health(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @bq24192_get_battery_health() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *, int);
void bitmap_pc_name(int num, char *dir, char *out) {
  if (num == 0)
    num = 30;
  sprintf(out, "%s%d.pic", dir, num);
}


x86 assembly (clang, -O0):
<bitmap_pc_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1134 <bitmap_pc_name+0x24>
movl   $0x1e,-0x4(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x4(%rbp),%ecx
lea    0xeba(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap_pc_name>:
mov    %rdx,%rax
mov    %rsi,%rdx
test   %edi,%edi
mov    $0x1e,%ecx
cmovne %edi,%ecx
lea    0xed9(%rip),%rsi
mov    %rax,%rdi
jmp    1030 <sprintf@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c"%s%d.pic\00"
define void @bitmap_pc_name(i32 %0, i8* %1, i8* nocapture writeonly %2) {
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i32 30, i32 %0
%6 = tail call i32 @sprintf(i8* dereferenceable(1) %2, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0xb3() {
  Assert_real((isbdigit(179) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isbdigit.c",
              900, ("isbdigit should be 0 for 0xb3"));
}


x86 assembly (clang, -O0):
<t_isbdigit_0xb3>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb3,%edi
call   1040 <isbdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x384,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isbdigit_0xb3>:
push   %rax
mov    $0xb3,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x384,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xb3\00"
define void @t_isbdigit_0xb3() {
%1 = call i64 @isbdigit(i32 179)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 900, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xb3\00"
define void @t_isbdigit_0xb3() {
%1 = tail call i64 @isbdigit(i32 179)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 900, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
void SHA2IntDisable(uint32_t intFlags) {

  ;
  (*((volatile unsigned long *)(0x40024000 + 0x00000784))) &= ~intFlags;
}


x86 assembly (clang, -O0):
<SHA2IntDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
xor    $0xffffffffffffffff,%rax
mov    $0x40024784,%ecx
mov    (%rcx),%rcx
and    %rax,%rcx
mov    $0x40024784,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHA2IntDisable>:
mov    %rdi,-0x8(%rsp)
mov    -0x8(%rsp),%rax
not    %rax
and    %rax,0x40024784
40
ret

LLVM IR (-O0):
define void @SHA2IntDisable(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = xor i64 %3, -1
%5 = load volatile i64, i64* inttoptr (i64 1073891204 to i64*)
%6 = and i64 %5, %4
store volatile i64 %6, i64* inttoptr (i64 1073891204 to i64*)
ret void
}

LLVM IR (-O2):
define void @SHA2IntDisable(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = xor i64 %3, -1
%5 = load volatile i64, i64* inttoptr (i64 1073891204 to i64*)
%6 = and i64 %5, %4
store volatile i64 %6, i64* inttoptr (i64 1073891204 to i64*)
ret void
}
char *strcpy(char *dest, const char *src) {
  char *retval = dest;
  while (*src)
    *dest++ = *src++;
  return retval;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1148 <strcpy+0x48>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    1114 <strcpy+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
test   %cl,%cl
je     1120 <strcpy+0x20>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
mov    %cl,(%rax,%rdx,1)
movzbl 0x1(%rsi,%rdx,1),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %0, %2 ]
%8 = phi i8* [ %9, %5 ], [ %1, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %6, i8* %7
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret i8* %0
}
/* Variables and functions */
int _tfsadd(char *, char *, char *, unsigned char *, int);
int /*<<< orphan*/ monLock();
int /*<<< orphan*/ monUnlock();
int mon_tfsadd(char *name, char *info, char *flags, unsigned char *src,
               int size) {
  int ret;
  monLock();
  ret = _tfsadd(name, info, flags, src, size);
  monUnlock();
  return (ret);
}


x86 assembly (clang, -O0):
<mon_tfsadd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    $0x0,%al
call   1040 <monLock@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
call   1030 <_tfsadd@plt>
mov    %eax,-0x28(%rbp)
mov    $0x0,%al
call   1050 <monUnlock@plt>
mov    -0x28(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mon_tfsadd>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8d,%r14d
mov    %rcx,%r15
mov    %rdx,%r12
mov    %rsi,%rbx
mov    %rdi,%rbp
xor    %eax,%eax
call   1040 <monLock@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r12,%rdx
mov    %r15,%rcx
mov    %r14d,%r8d
call   1030 <_tfsadd@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <monUnlock@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @mon_tfsadd(i8* %0, i8* %1, i8* %2, i8* %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%12 = call i32 (...) @monLock()
%13 = load i8*, i8** %6
%14 = load i8*, i8** %7
%15 = load i8*, i8** %8
%16 = load i8*, i8** %9
%17 = load i32, i32* %10
%18 = call i32 @_tfsadd(i8* %13, i8* %14, i8* %15, i8* %16, i32 %17)
store i32 %18, i32* %11
%19 = call i32 (...) @monUnlock()
%20 = load i32, i32* %11
ret i32 %20
}

LLVM IR (-O2):
define i32 @mon_tfsadd(i8* %0, i8* %1, i8* %2, i8* %3, i32 %4) {
%6 = tail call i32 (...) @monLock()
%7 = tail call i32 @_tfsadd(i8* %0, i8* %1, i8* %2, i8* %3, i32 %4)
%8 = tail call i32 (...) @monUnlock()
ret i32 %7
}
/* Variables and functions */
scalar_t__ isBlank(char);
char *skipBlank(char *p) {
  while (isBlank(*p))
    ++p;
  return p;
}


x86 assembly (clang, -O0):
<skipBlank>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isBlank@plt>
cmp    $0x0,%rax
je     1143 <skipBlank+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <skipBlank+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipBlank>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isBlank@plt>
test   %rax,%rax
jne    1120 <skipBlank+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @skipBlank(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @isBlank(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void my_print_vector(void *val) {
  int *i = (int *)val;
  printf("%d ", *i);
}


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

x86 assembly (clang, -O2):
<my_print_vector>:
mov    (%rdi),%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
define void @my_print_vector(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @my_print_vector(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
int cio_read(int);
int /*<<< orphan*/ cio_skip(int);
void j2k_read_plm() {
  int len;
  len = cio_read(2);

  cio_skip(len - 2);
}


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

x86 assembly (clang, -O2):
<j2k_read_plm>:
push   %rax
mov    $0x2,%edi
call   1040 <cio_read@plt>
lea    -0x2(%rax),%edi
pop    %rax
jmp    1030 <cio_skip@plt>

LLVM IR (-O0):
define void @j2k_read_plm() {
%1 = alloca i32
%2 = call i32 @cio_read(i32 2)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = sub nsw i32 %3, 2
%5 = call i32 @cio_skip(i32 %4)
ret void
}

LLVM IR (-O2):
define void @j2k_read_plm() {
%1 = tail call i32 @cio_read(i32 2)
%2 = add nsw i32 %1, -2
%3 = tail call i32 @cio_skip(i32 %2)
ret void
}