xunge/DecIR huggingface dataset:
void grace_adjust_for_negative_y_max(double *world_min_y, double *world_max_y) {
  if (*world_min_y > *world_max_y) {
    double tmp = *world_min_y;
    *world_min_y = *world_max_y;
    *world_max_y = tmp;
  }
}


x86 assembly (clang, -O0):
<grace_adjust_for_negative_y_max>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
ucomisd (%rax),%xmm0
jbe    114c <grace_adjust_for_negative_y_max+0x4c>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x18(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<grace_adjust_for_negative_y_max>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
ucomisd %xmm1,%xmm0
jbe    1116 <grace_adjust_for_negative_y_max+0x16>
movsd  %xmm1,(%rdi)
movsd  %xmm0,(%rsi)
ret

LLVM IR (-O0):
define void @grace_adjust_for_negative_y_max(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%6 = load double*, double** %3
%7 = load double, double* %6
%8 = load double*, double** %4
%9 = load double, double* %8
%10 = fcmp ogt double %7, %9
br i1 %10, label %11, label %19
11: ; preds = %2
%12 = load double*, double** %3
%13 = load double, double* %12
store double %13, double* %5
%14 = load double*, double** %4
%15 = load double, double* %14
%16 = load double*, double** %3
store double %15, double* %16
%17 = load double, double* %5
%18 = load double*, double** %4
store double %17, double* %18
br label %19
19: ; preds = %11, %2
ret void
}

LLVM IR (-O2):
define void @grace_adjust_for_negative_y_max(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = fcmp ogt double %3, %4
br i1 %5, label %6, label %7
6: ; preds = %2
store double %4, double* %0
store double %3, double* %1
br label %7
7: ; preds = %6, %2
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ blue_mask;
};
typedef TYPE_1__ XVisualInfo;

/* Variables and functions */
unsigned long get_XVisualInfo_blue_mask(void *_p) {
  return (unsigned long)((XVisualInfo *)_p)->blue_mask;
}


x86 assembly (clang, -O0):
<get_XVisualInfo_blue_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_XVisualInfo_blue_mask>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XVisualInfo_blue_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_XVisualInfo_blue_mask(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
void *ls1c_spi_get_base(unsigned char SPIx) {
  void *base = NULL;
  switch (SPIx) {
  case (0):
    base = (void *)(0xbfe80000);
    break;
  case (1):
    base = (void *)(0xbfec0000);
    break;
  default:
    base = NULL;
    break;
  }
  return base;
}


x86 assembly (clang, -O0):
<ls1c_spi_get_base>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movq   $0x0,-0x10(%rbp)
movzbl -0x1(%rbp),%eax
mov    %eax,-0x14(%rbp)
test   %eax,%eax
je     1137 <ls1c_spi_get_base+0x37>
jmp    1126 <ls1c_spi_get_base+0x26>
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
je     1145 <ls1c_spi_get_base+0x45>
jmp    1153 <ls1c_spi_get_base+0x53>
mov    $0xbfe80000,%eax
mov    %rax,-0x10(%rbp)
jmp    115b <ls1c_spi_get_base+0x5b>
mov    $0xbfec0000,%eax
mov    %rax,-0x10(%rbp)
jmp    115b <ls1c_spi_get_base+0x5b>
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls1c_spi_get_base>:
mov    $0xbfe80000,%eax
test   %edi,%edi
je     1118 <ls1c_spi_get_base+0x18>
cmp    $0x1,%dil
jne    1116 <ls1c_spi_get_base+0x16>
add    $0x40000,%rax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @ls1c_spi_get_base(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8*
store i8 %0, i8* %2
store i8* null, i8** %3
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
switch i32 %5, label %8 [
i32 0, label %6
i32 1, label %7
]
6: ; preds = %1
store i8* inttoptr (i64 3219652608 to i8*), i8** %3
br label %9
7: ; preds = %1
store i8* inttoptr (i64 3219914752 to i8*), i8** %3
br label %9
8: ; preds = %1
store i8* null, i8** %3
br label %9
9: ; preds = %8, %7, %6
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
define i8* @ls1c_spi_get_base(i8 zeroext %0) {
switch i8 %0, label %3 [
i8 0, label %4
i8 1, label %2
]
2: ; preds = %1
br label %4
3: ; preds = %1
br label %4
4: ; preds = %1, %3, %2
%5 = phi i8* [ null, %3 ], [ inttoptr (i64 3219914752 to i8*), %2 ], [ inttoptr (i64 3219652608 to i8*), %1 ]
ret i8* %5
}
/* Variables and functions */
scalar_t__ SQLITE_OK;
scalar_t__ sqlite3_shutdown();
int db_sqlite3_uninit(void) { return !(sqlite3_shutdown() == SQLITE_OK); }


x86 assembly (clang, -O0):
<db_sqlite3_uninit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <sqlite3_shutdown@plt>
mov    0x2ec6(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<db_sqlite3_uninit>:
push   %rax
xor    %eax,%eax
call   1030 <sqlite3_shutdown@plt>
mov    0x2ec9(%rip),%rdx
xor    %ecx,%ecx
cmp    (%rdx),%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@SQLITE_OK = global i64 0
define i32 @db_sqlite3_uninit() {
%1 = call i64 (...) @sqlite3_shutdown()
%2 = load i64, i64* @SQLITE_OK
%3 = icmp eq i64 %1, %2
%4 = xor i1 %3, true
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
@SQLITE_OK = global i64 0
define i32 @db_sqlite3_uninit() {
%1 = tail call i64 (...) @sqlite3_shutdown()
%2 = load i64, i64* @SQLITE_OK
%3 = icmp ne i64 %1, %2
%4 = zext i1 %3 to i32
ret i32 %4
}
void fiq_handler(void) {}


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

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

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

LLVM IR (-O2):
define void @fiq_handler() {
ret void
}
unsigned long insert_nsi(insn, value, errmsg)
unsigned long insn;
long value;
const char **errmsg;
{ return insn | ((-value) & 0xffff); }


x86 assembly (clang, -O0):
<insert_nsi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
sub    -0x10(%rbp),%rcx
and    $0xffff,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<insert_nsi>:
neg    %esi
movzwl %si,%eax
or     %rdi,%rax
ret

LLVM IR (-O0):
define i64 @insert_nsi(i64 %0, i64 %1, i8** %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8**
store i64 %0, i64* %4
store i64 %1, i64* %5
store i8** %2, i8*** %6
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = sub nsw i64 0, %8
%10 = and i64 %9, 65535
%11 = or i64 %7, %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @insert_nsi(i64 %0, i64 %1, i8** nocapture readnone %2) {
%4 = sub nsw i64 0, %1
%5 = and i64 %4, 65535
%6 = or i64 %5, %0
ret i64 %6
}
void cmp_ai_soul_update_panic(void) {}


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

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

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

LLVM IR (-O2):
define void @cmp_ai_soul_update_panic() {
ret void
}
int string_sort_rev(const void *a, const void *b) {
  const char ca = *(char *)a, cb = *(char *)b;
  return ca > cb;
}


x86 assembly (clang, -O0):
<string_sort_rev>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x12(%rbp)
movsbl -0x11(%rbp),%eax
movsbl -0x12(%rbp),%ecx
cmp    %ecx,%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_sort_rev>:
mov    (%rdi),%cl
xor    %eax,%eax
cmp    (%rsi),%cl
setg   %al
ret

LLVM IR (-O0):
define i32 @string_sort_rev(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
store i8 %8, i8* %5
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
store i8 %10, i8* %6
%11 = load i8, i8* %5
%12 = sext i8 %11 to i32
%13 = load i8, i8* %6
%14 = sext i8 %13 to i32
%15 = icmp sgt i32 %12, %14
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @string_sort_rev(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp sgt i8 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ sieve(int *, int);
int main() {
  int a[100];
  sieve(a, 100);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x1a0(%rbp),%rdi
mov    $0x64,%esi
call   1030 <sieve@plt>
xor    %eax,%eax
add    $0x1a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x198,%rsp
mov    %rsp,%rdi
mov    $0x64,%esi
call   1030 <sieve@plt>
xor    %eax,%eax
add    $0x198,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i32]
store i32 0, i32* %1
%3 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 0
%4 = call i32 @sieve(i32* %3, i32 100)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [100 x i32]
%2 = bitcast [100 x i32]* %1 to i8*
%3 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 0
%4 = call i32 @sieve(i32* %3, i32 100)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
void uart_write_int(uint16_t v) { (void)v; }


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

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

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

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

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ display;
};
struct TYPE_4__ {
  TYPE_1__ xerror;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void *get_XEvent_xerror_display(void *_p) {
  return (void *)((XEvent *)_p)->xerror.display;
}


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

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

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

LLVM IR (-O2):
define i8* @get_XEvent_xerror_display(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Variables and functions */
int uriFilenameToUriStringA(char const *, char *, int /*<<< orphan*/);
int uriWindowsFilenameToUriStringA(const char *filename, char *uriString) {
  return uriFilenameToUriStringA(filename, uriString, 0);
}


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

x86 assembly (clang, -O2):
<uriWindowsFilenameToUriStringA>:
xor    %edx,%edx
jmp    1030 <uriFilenameToUriStringA@plt>

LLVM IR (-O0):
define i32 @uriWindowsFilenameToUriStringA(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 i32 @uriFilenameToUriStringA(i8* %5, i8* %6, i32 0)
ret i32 %7
}

LLVM IR (-O2):
define i32 @uriWindowsFilenameToUriStringA(i8* %0, i8* %1) {
%3 = tail call i32 @uriFilenameToUriStringA(i8* %0, i8* %1, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ AT_FDCWD;
int INLINE_SYSCALL(int /*<<< orphan*/, int, int /*<<< orphan*/, char const *,
                   int /*<<< orphan*/, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ linkat;
int __link(const char *from, const char *to) {
  return INLINE_SYSCALL(linkat, 5, AT_FDCWD, from, AT_FDCWD, to, 0);
}


x86 assembly (clang, -O0):
<__link>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
mov    0x2ea0(%rip),%rax
mov    (%rax),%edx
mov    -0x8(%rbp),%rcx
mov    0x2e93(%rip),%rax
mov    (%rax),%r8d
mov    -0x10(%rbp),%r9
mov    $0x5,%esi
xor    %eax,%eax
movl   $0x0,(%rsp)
call   1030 <INLINE_SYSCALL@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__link>:
push   %rax
mov    %rsi,%r9
mov    %rdi,%rcx
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    0x2ea9(%rip),%rax
mov    (%rax),%edx
movl   $0x0,(%rsp)
mov    $0x5,%esi
mov    %edx,%r8d
call   1030 <INLINE_SYSCALL@plt>
pop    %rcx
ret

LLVM IR (-O0):
@linkat = global i32 0
@AT_FDCWD = global i32 0
define i32 @__link(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @linkat
%6 = load i32, i32* @AT_FDCWD
%7 = load i8*, i8** %3
%8 = load i32, i32* @AT_FDCWD
%9 = load i8*, i8** %4
%10 = call i32 @INLINE_SYSCALL(i32 %5, i32 5, i32 %6, i8* %7, i32 %8, i8* %9, i32 0)
ret i32 %10
}

LLVM IR (-O2):
@linkat = global i32 0
@AT_FDCWD = global i32 0
define i32 @__link(i8* %0, i8* %1) {
%3 = load i32, i32* @linkat
%4 = load i32, i32* @AT_FDCWD
%5 = tail call i32 @INLINE_SYSCALL(i32 %3, i32 5, i32 %4, i8* %0, i32 %4, i8* %1, i32 0)
ret i32 %5
}
long double longdouble_ignoring_signedlongint(long double x,
                                              signed long int y) {
  return x;
}


x86 assembly (clang, -O0):
<longdouble_ignoring_signedlongint>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    %rdi,-0x18(%rbp)
fldt   -0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<longdouble_ignoring_signedlongint>:
fldt   0x8(%rsp)
ret

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

LLVM IR (-O2):
define x86_fp80 @longdouble_ignoring_signedlongint(x86_fp80 returned %0, i64 %1) {
ret x86_fp80 %0
}
/* Variables and functions */
char *cslob_errstring(int);
int /*<<< orphan*/ printf(char *, char *);
void cslob_printerror(int error) {
  printf("cslob error: %s\n", cslob_errstring(error));
}


x86 assembly (clang, -O0):
<cslob_printerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <cslob_errstring@plt>
mov    %rax,%rsi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cslob_printerror>:
push   %rax
call   1040 <cslob_errstring@plt>
lea    0xed3(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"cslob error: %s\0A\00"
define void @cslob_printerror(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i8* @cslob_errstring(i32 %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"cslob error: %s\0A\00"
define void @cslob_printerror(i32 %0) {
%2 = tail call i8* @cslob_errstring(i32 %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}
/* Variables and functions */
bool nrf53_errata_62(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf53_errata_62() {
ret i32 0
}
/* Variables and functions */
unsigned short crcAdd(unsigned short, unsigned char);
unsigned short crc16Calculate(unsigned char *data, int length) {
  unsigned short crc;
  int index;
  crc = 0;
  for (index = 0; index < length; index++) {
    crc = crcAdd(crc, data[index]);
  }
  return (crc);
}


x86 assembly (clang, -O0):
<crc16Calculate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movw   $0x0,-0xe(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1162 <crc16Calculate+0x52>
mov    -0xe(%rbp),%dx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movzwl %dx,%edi
movzbl (%rax,%rcx,1),%esi
call   1030 <crcAdd@plt>
mov    %ax,-0xe(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112c <crc16Calculate+0x1c>
movzwl -0xe(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc16Calculate>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1148 <crc16Calculate+0x38>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%r14,%rbx,1),%esi
movzwl %ax,%edi
call   1030 <crcAdd@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <crc16Calculate+0x20>
jmp    114a <crc16Calculate+0x3a>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define zeroext i16 @crc16Calculate(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = phi i16 [ 0, %4 ], [ %11, %6 ]
%9 = getelementptr inbounds i8, i8* %0, i64 %7
%10 = load i8, i8* %9
%11 = tail call zeroext i16 @crcAdd(i16 zeroext %8, i8 zeroext %10)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
%15 = phi i16 [ 0, %2 ], [ %11, %6 ]
ret i16 %15
}
/* Type definitions */
typedef uintptr_t volatile uint32_t;

/* Variables and functions */
uint32_t mmio32_read(uintptr_t base, uint32_t reg) {
  return *(volatile uintptr_t *)(base + reg);
}


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

x86 assembly (clang, -O2):
<mmio32_read>:
mov    %rsi,-0x8(%rsp)
mov    -0x8(%rsp),%rax
mov    (%rax,%rdi,1),%rax
ret

LLVM IR (-O0):
define i64 @mmio32_read(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load volatile i64, i64* %4
%7 = add i64 %5, %6
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @mmio32_read(i64 %0, i64 %1) {
%3 = alloca i64
store volatile i64 %1, i64* %3
%4 = load volatile i64, i64* %3
%5 = add i64 %4, %0
%6 = inttoptr i64 %5 to i64*
%7 = load volatile i64, i64* %6
ret i64 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ text;

/* Variables and functions */
scalar_t__ roadmap_message_format(char *, int, char *);
const char *get_dist_to_destination(void) {
  static char text[256];
  if (roadmap_message_format(text, sizeof(text), "%D (%W)|%D"))
    return &text[0];
  return "";
}


x86 assembly (clang, -O0):
<get_dist_to_destination>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0x2f21(%rip),%rdi
mov    $0x100,%esi
lea    0xed5(%rip),%rdx
call   1030 <roadmap_message_format@plt>
cmp    $0x0,%rax
je     114a <get_dist_to_destination+0x3a>
lea    0x2eff(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1155 <get_dist_to_destination+0x45>
lea    0xeb9(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_dist_to_destination>:
push   %rbx
lea    0x2f28(%rip),%rbx
lea    0xee1(%rip),%rdx
mov    %rbx,%rdi
mov    $0x100,%esi
call   1030 <roadmap_message_format@plt>
test   %rax,%rax
lea    0xed4(%rip),%rax
cmovne %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@get_dist_to_destination.text = internal global [256 x i8] zeroinitializer
@.str = [11 x i8] c"%D (%W)|%D\00"
@.str.1 = [1 x i8] zeroinitializer
define i8* @get_dist_to_destination() {
%1 = alloca i8*
%2 = call i64 @roadmap_message_format(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @get_dist_to_destination.text, i64 0, i64 0), i32 256, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i8* getelementptr inbounds ([256 x i8], [256 x i8]* @get_dist_to_destination.text, i64 0, i64 0), i8** %1
br label %6
5: ; preds = %0
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8** %1
br label %6
6: ; preds = %5, %4
%7 = load i8*, i8** %1
ret i8* %7
}

LLVM IR (-O2):
@get_dist_to_destination.text = internal global [256 x i8] zeroinitializer
@.str = [11 x i8] c"%D (%W)|%D\00"
@.str.1 = [1 x i8] zeroinitializer
define i8* @get_dist_to_destination() {
%1 = tail call i64 @roadmap_message_format(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @get_dist_to_destination.text, i64 0, i64 0), i32 256, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([256 x i8], [256 x i8]* @get_dist_to_destination.text, i64 0, i64 0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, int);
void *sqlite3_malloc(int);
void *fts3MallocZero(int nByte) {
  void *pRet = sqlite3_malloc(nByte);
  if (pRet)
    memset(pRet, 0, nByte);
  return pRet;
}


x86 assembly (clang, -O0):
<fts3MallocZero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <sqlite3_malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1150 <fts3MallocZero+0x30>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fts3MallocZero>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1040 <sqlite3_malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     113e <fts3MallocZero+0x1e>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %ebp,%edx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @fts3MallocZero(i32 %0) {
%2 = tail call i8* @sqlite3_malloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @memset(i8* %2, i32 0, i32 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "usage: driver /path/to/interests /path/to/data\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [48 x i8] c"usage: driver /path/to/interests /path/to/data\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [48 x i8] c"usage: driver /path/to/interests /path/to/data\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double sqrt(int);
double bDeltaForParallelLine(double d, double m) { return d * sqrt(1 + m * m); }


x86 assembly (clang, -O0):
<bDeltaForParallelLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xebe(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bDeltaForParallelLine>:
push   %rax
movsd  %xmm0,(%rsp)
mulsd  %xmm1,%xmm1
addsd  0xede(%rip),%xmm1
cvttsd2si %xmm1,%edi
call   1030 <sqrt@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @bDeltaForParallelLine(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = load double, double* %4
%8 = call double @llvm.fmuladd.f64(double %6, double %7, double 1.000000e+00)
%9 = fptosi double %8 to i32
%10 = call double @sqrt(i32 %9)
%11 = fmul double %5, %10
ret double %11
}

LLVM IR (-O2):
define double @bDeltaForParallelLine(double %0, double %1) {
%3 = tail call double @llvm.fmuladd.f64(double %1, double %1, double 1.000000e+00)
%4 = fptosi double %3 to i32
%5 = tail call double @sqrt(i32 %4)
%6 = fmul double %5, %0
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  int x = 1;
  int y = 2;
  printf("x = %d, y = %d\n", x, y);
  {
    int tmp;
    tmp = x;
    x = y;
    y = tmp;
  };
  printf("x = %d, y = %d\n", x, y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [16 x i8] c"x = %d, y = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 1, i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 2, i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printOkay() { printf("Okay\n"); }


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

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

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

LLVM IR (-O2):
@str = [5 x i8] c"Okay\00"
define void @printOkay() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret void
}
int pinc(int a, int *x) {
  *x++;
  return 0;
}


x86 assembly (clang, -O0):
<pinc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @pinc(i32 %0, i32* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int a_ctz_64(unsigned long);
int a_ctz_l(unsigned long x) { return a_ctz_64(x); }


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

x86 assembly (clang, -O2):
<a_ctz_l>:
jmp    1030 <a_ctz_64@plt>

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

LLVM IR (-O2):
define i32 @a_ctz_l(i64 %0) {
%2 = tail call i32 @a_ctz_64(i64 %0)
ret i32 %2
}
/* Variables and functions */
char *my_strndup(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
char *my_strdup(const char *str) { return (my_strndup(str, strlen(str))); }


x86 assembly (clang, -O0):
<my_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <my_strndup@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strdup>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <my_strndup@plt>

LLVM IR (-O0):
define i8* @my_strdup(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i8* @my_strndup(i8* %3, i32 %5)
ret i8* %6
}

LLVM IR (-O2):
define i8* @my_strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i8* @my_strndup(i8* %0, i32 %2)
ret i8* %3
}
void token_stream_dump(struct TokenStream *ts) {}


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

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

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

LLVM IR (-O2):
%struct.TokenStream = type opaque
define void @token_stream_dump(%struct.TokenStream* nocapture %0) {
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;
typedef int volatile int8_t;

/* Variables and functions */
uint8_t GPIO_check_event(uint8_t pin) {
  ;
  int8_t chk1 = pin - 32;
  if (chk1 < 0)
    return (*((volatile uint32_t *)(0x00200040))) >> pin;
  else
    return (*((volatile uint32_t *)(0x00200044))) >> chk1;
}


x86 assembly (clang, -O0):
<GPIO_check_event>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    $0x0,%eax
jge    1130 <GPIO_check_event+0x30>
mov    $0x200040,%eax
mov    (%rax),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    %eax,-0x4(%rbp)
jmp    113f <GPIO_check_event+0x3f>
mov    $0x200044,%eax
mov    (%rax),%eax
mov    -0xc(%rbp),%ecx
sar    %cl,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIO_check_event>:
lea    -0x20(%rdi),%eax
mov    %eax,-0x4(%rsp)
cmpl   $0x0,-0x4(%rsp)
js     111c <GPIO_check_event+0x1c>
mov    0x200044,%eax
mov    -0x4(%rsp),%ecx
sar    %cl,%eax
ret
mov    0x200040,%eax
mov    %edi,%ecx
sar    %cl,%eax
ret

LLVM IR (-O0):
define i32 @GPIO_check_event(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = sub nsw i32 %5, 32
store volatile i32 %6, i32* %4
%7 = load volatile i32, i32* %4
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load volatile i32, i32* inttoptr (i64 2097216 to i32*)
%11 = load i32, i32* %3
%12 = ashr i32 %10, %11
store i32 %12, i32* %2
br label %17
13: ; preds = %1
%14 = load volatile i32, i32* inttoptr (i64 2097220 to i32*)
%15 = load volatile i32, i32* %4
%16 = ashr i32 %14, %15
store i32 %16, i32* %2
br label %17
17: ; preds = %13, %9
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @GPIO_check_event(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = add nsw i32 %0, -32
store volatile i32 %4, i32* %2
%5 = load volatile i32, i32* %2
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load volatile i32, i32* inttoptr (i64 2097216 to i32*)
%9 = ashr i32 %8, %0
br label %14
10: ; preds = %1
%11 = load volatile i32, i32* inttoptr (i64 2097220 to i32*)
%12 = load volatile i32, i32* %2
%13 = ashr i32 %11, %12
br label %14
14: ; preds = %10, %7
%15 = phi i32 [ %9, %7 ], [ %13, %10 ]
ret i32 %15
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int SIGALRM;
int sigaddset(int /*<<< orphan*/ *, int);
void test(void) {
  sigset_t signal_set;
  int signal_number;
  int result;
  signal_number = SIGALRM;
  result = sigaddset(&signal_set, signal_number);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    -0x4(%rbp),%rdi
call   1030 <sigaddset@plt>
mov    %eax,-0xc(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdi
call   1030 <sigaddset@plt>
pop    %rax
ret

LLVM IR (-O0):
@SIGALRM = global i32 0
define void @test() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = load i32, i32* @SIGALRM
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @sigaddset(i32* %1, i32 %5)
store i32 %6, i32* %3
ret void
}

LLVM IR (-O2):
@SIGALRM = global i32 0
define void @test() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = load i32, i32* @SIGALRM
%4 = call i32 @sigaddset(i32* %1, i32 %3)
ret void
}
unsigned gameboy4x_generic_output_fmts(unsigned input_fmts) {
  return input_fmts;
}


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

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

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

LLVM IR (-O2):
define i32 @gameboy4x_generic_output_fmts(i32 returned %0) {
ret i32 %0
}
int mkalpha(int i) {
  switch (i) {
  case 0xf:
    return 1;
  case 0:
    return 0;
  default:
    return (0xf - i) << 4;
  }
}


x86 assembly (clang, -O0):
<mkalpha>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     1137 <mkalpha+0x37>
jmp    111a <mkalpha+0x1a>
mov    -0xc(%rbp),%eax
sub    $0xf,%eax
jne    1143 <mkalpha+0x43>
jmp    112b <mkalpha+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    1151 <mkalpha+0x51>
movl   $0x0,-0x4(%rbp)
jmp    1151 <mkalpha+0x51>
mov    $0xf,%eax
sub    -0x8(%rbp),%eax
shl    $0x4,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkalpha>:
cmp    $0xf,%edi
je     110c <mkalpha+0xc>
test   %edi,%edi
jne    1112 <mkalpha+0x12>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret
shl    $0x4,%edi
mov    $0xf0,%eax
sub    %edi,%eax
ret

LLVM IR (-O0):
define i32 @mkalpha(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 15, label %5
i32 0, label %6
]
5: ; preds = %1
store i32 1, i32* %2
br label %11
6: ; preds = %1
store i32 0, i32* %2
br label %11
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sub nsw i32 15, %8
%10 = shl i32 %9, 4
store i32 %10, i32* %2
br label %11
11: ; preds = %7, %6, %5
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @mkalpha(i32 %0) {
switch i32 %0, label %3 [
i32 15, label %6
i32 0, label %2
]
2: ; preds = %1
br label %6
3: ; preds = %1
%4 = mul i32 %0, -16
%5 = add i32 %4, 240
br label %6
6: ; preds = %1, %3, %2
%7 = phi i32 [ %5, %3 ], [ 0, %2 ], [ 1, %1 ]
ret i32 %7
}
void I422ToARGB4444Row_NEON() {}


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

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

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

LLVM IR (-O2):
define void @I422ToARGB4444Row_NEON() {
ret void
}
int main(void) {
  asm volatile("movl $1, %ebx\n"
               "movl $1, %eax\n"
               "int $0x80\n");
  for (;;)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%ebx
mov    $0x1,%eax
int    $0x80
jmp    1117 <main+0x17>

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%ebx
mov    $0x1,%eax
int    $0x80
nopl   0x0(%rax)
jmp    1110 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %2, %0
br label %2
}

LLVM IR (-O2):
define i32 @main() {
tail call void asm sideeffect "movl $$1, %ebx\0Amovl $$1, %eax\0Aint $$0x80\0A", "~{dirflag},~{fpsr},~{flags}"()
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printPoints() { printf(" ......... "); }


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c" ......... \00"
define void @printPoints() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *, int, char const *);
int /*<<< orphan*/ stderr;
void assertion(const char *expr, const char *file, int line, const char *fn) {
  fprintf(stderr, "Assertion \"%s\" failed, file %s, line %d, function %s\n",
          expr, file, line, fn);
  abort();
}


x86 assembly (clang, -O0):
<assertion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
mov    -0x20(%rbp),%r9
lea    0xea9(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<assertion>:
push   %rax
mov    %rcx,%r9
mov    %edx,%r8d
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
lea    0xec3(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [54 x i8] c"Assertion \22%s\22 failed, file %s, line %d, function %s\0A\00"
define void @assertion(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %5
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i8*, i8** %8
%14 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %11, i32 %12, i8* %13)
%15 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [54 x i8] c"Assertion \22%s\22 failed, file %s, line %d, function %s\0A\00"
define void @assertion(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i32 %2, i8* %3)
%7 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ Swi_MLoad(int, int /*<<< orphan*/, int /*<<< orphan*/,
                             int /*<<< orphan*/);
void Swi_LedBlink(void) { Swi_MLoad(130, 0, 0, 0); }


x86 assembly (clang, -O0):
<Swi_LedBlink>:
push   %rbp
mov    %rsp,%rbp
mov    $0x82,%edi
xor    %ecx,%ecx
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <Swi_MLoad@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Swi_LedBlink>:
mov    $0x82,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <Swi_MLoad@plt>

LLVM IR (-O0):
define void @Swi_LedBlink() {
%1 = call i32 @Swi_MLoad(i32 130, i32 0, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @Swi_LedBlink() {
%1 = tail call i32 @Swi_MLoad(i32 130, i32 0, i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ d(int, int);
int main() { d(1, 1); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%esi
mov    %esi,%edi
call   1030 <d@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @d(i32 1, i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @d(i32 1, i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ move(int, int);
int /*<<< orphan*/ printw(char *);
void printbottombettingbox() {
  move(17, 42);
  printw("|x = toggle information box|");
  move(17 + 1, 42);
  printw("|i = list instructions     |");
  move(17 + 2, 42);
  printw("*--------------------------*");
}


x86 assembly (clang, -O0):
<printbottombettingbox>:
push   %rbp
mov    %rsp,%rbp
mov    $0x11,%edi
mov    $0x2a,%esi
call   1040 <move@plt>
lea    0xec6(%rip),%rdi
call   1030 <printw@plt>
mov    $0x12,%edi
mov    $0x2a,%esi
call   1040 <move@plt>
lea    0xec8(%rip),%rdi
call   1030 <printw@plt>
mov    $0x13,%edi
mov    $0x2a,%esi
call   1040 <move@plt>
lea    0xeca(%rip),%rdi
call   1030 <printw@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<printbottombettingbox>:
push   %rax
mov    $0x11,%edi
mov    $0x2a,%esi
call   1040 <move@plt>
lea    0xec9(%rip),%rdi
call   1030 <printw@plt>
mov    $0x12,%edi
mov    $0x2a,%esi
call   1040 <move@plt>
lea    0xecb(%rip),%rdi
call   1030 <printw@plt>
mov    $0x13,%edi
mov    $0x2a,%esi
call   1040 <move@plt>
lea    0xecd(%rip),%rdi
pop    %rax
jmp    1030 <printw@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"|x = toggle information box|\00"
@.str.1 = [29 x i8] c"|i = list instructions |\00"
@.str.2 = [29 x i8] c"*--------------------------*\00"
define void @printbottombettingbox() {
%1 = call i32 @move(i32 17, i32 42)
%2 = call i32 @printw(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @move(i32 18, i32 42)
%4 = call i32 @printw(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @move(i32 19, i32 42)
%6 = call i32 @printw(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"|x = toggle information box|\00"
@.str.1 = [29 x i8] c"|i = list instructions |\00"
@.str.2 = [29 x i8] c"*--------------------------*\00"
define void @printbottombettingbox() {
%1 = tail call i32 @move(i32 17, i32 42)
%2 = tail call i32 @printw(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @move(i32 18, i32 42)
%4 = tail call i32 @printw(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @move(i32 19, i32 42)
%6 = tail call i32 @printw(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gui_cleanup();
int /*<<< orphan*/ gui_run();
void main(void) {
  gui_run();
  gui_cleanup();
}


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

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

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @gui_run()
%2 = call i32 (...) @gui_cleanup()
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @gui_run()
%2 = tail call i32 (...) @gui_cleanup()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error_handler(char const *);
void opk_error(const char *reason) { error_handler(reason); }


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

x86 assembly (clang, -O2):
<opk_error>:
jmp    1030 <error_handler@plt>

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

LLVM IR (-O2):
define void @opk_error(i8* %0) {
%2 = tail call i32 @error_handler(i8* %0)
ret void
}
void VERBOSE_PRINT(char *fmt, ...) {}


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

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

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

LLVM IR (-O2):
define void @VERBOSE_PRINT(i8* nocapture %0, ...) {
ret void
}
void IN_Commands(void) {}


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

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

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

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