xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ toupper(char);
void CMUTIL_MapToUpper(char *in) {
  while (*in) {
    *in = (char)toupper(*in);
    in++;
  }
}


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

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

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

LLVM IR (-O2):
define void @CMUTIL_MapToUpper(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = tail call i64 @toupper(i8 signext %5)
%8 = trunc i64 %7 to i8
store i8 %8, i8* %6
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ CONF;

/* Variables and functions */
int /*<<< orphan*/ OPENSSL_free(int /*<<< orphan*/ *);
scalar_t__ def_destroy_data(int /*<<< orphan*/ *);
int def_destroy(CONF *conf) {
  if (def_destroy_data(conf)) {
    OPENSSL_free(conf);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<def_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <def_destroy_data@plt>
cmp    $0x0,%rax
je     1154 <def_destroy+0x34>
mov    -0x10(%rbp),%rdi
call   1030 <OPENSSL_free@plt>
movl   $0x1,-0x4(%rbp)
jmp    115b <def_destroy+0x3b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<def_destroy>:
push   %rbx
mov    %rdi,%rbx
call   1040 <def_destroy_data@plt>
test   %rax,%rax
je     113d <def_destroy+0x1d>
mov    %rbx,%rdi
call   1030 <OPENSSL_free@plt>
mov    $0x1,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @def_destroy(i32* %0) {
%2 = tail call i64 @def_destroy_data(i32* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @OPENSSL_free(i32* %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
void __main(int argc, char **argv) {}


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

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

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

LLVM IR (-O2):
define void @__main(i32 %0, i8** nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clear_io_bit(int, int);
void TOSH_CLR_ONE_WIRE_PIN() { clear_io_bit(0x70, 5); }


x86 assembly (clang, -O0):
<TOSH_CLR_ONE_WIRE_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0x70,%edi
mov    $0x5,%esi
call   1030 <clear_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_CLR_ONE_WIRE_PIN>:
mov    $0x70,%edi
mov    $0x5,%esi
jmp    1030 <clear_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_CLR_ONE_WIRE_PIN() {
%1 = call i32 @clear_io_bit(i32 112, i32 5)
ret void
}

LLVM IR (-O2):
define void @TOSH_CLR_ONE_WIRE_PIN() {
%1 = tail call i32 @clear_io_bit(i32 112, i32 5)
ret void
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memcpy(void *, void *, size_t);
void *realloc(void *ptr, size_t size) {
  size_t *oldsz = ptr - sizeof(size_t);
  void *dst = malloc(size);
  memcpy(dst, ptr, *oldsz);
  return dst;
}


x86 assembly (clang, -O0):
<realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    (%rax),%rdx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<realloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    -0x8(%r14),%rdx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <memcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64*
%6 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%7 = load i8*, i8** %3
%8 = getelementptr i8, i8* %7, i64 -8
%9 = bitcast i8* %8 to i64*
store i64* %9, i64** %5
%10 = load i64, i64* %4
%11 = call i8* @malloc(i64 %10)
store i8* %11, i8** %6
%12 = load i8*, i8** %6
%13 = load i8*, i8** %3
%14 = load i64*, i64** %5
%15 = load i64, i64* %14
%16 = call i32 @memcpy(i8* %12, i8* %13, i64 %15)
%17 = load i8*, i8** %6
ret i8* %17
}

LLVM IR (-O2):
define i8* @realloc(i8* %0, i64 %1) {
%3 = getelementptr i8, i8* %0, i64 -8
%4 = bitcast i8* %3 to i64*
%5 = tail call i8* @malloc(i64 %1)
%6 = load i64, i64* %4
%7 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %6)
ret i8* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/ *);
int /*<<< orphan*/ putc(int /*<<< orphan*/, int /*<<< orphan*/ *);
void WriteName(FILE *fp, const char *name) {
  fputs(name, fp);
  putc(0, fp);
}


x86 assembly (clang, -O0):
<WriteName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rsi
xor    %edi,%edi
call   1040 <putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteName>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %rbx,%rsi
call   1030 <fputs@plt>
xor    %edi,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <putc@plt>

LLVM IR (-O0):
define void @WriteName(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i32*, i32** %3
%7 = call i32 @fputs(i8* %5, i32* %6)
%8 = load i32*, i32** %3
%9 = call i32 @putc(i32 0, i32* %8)
ret void
}

LLVM IR (-O2):
define void @WriteName(i32* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @fputs(i8* %1, i32* %0)
%4 = tail call i32 @putc(i32 0, i32* %0)
ret void
}
void sigwinch_handler(int sig) {}


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

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

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

LLVM IR (-O2):
define void @sigwinch_handler(i32 %0) {
ret void
}
int rte_xen_dom0_supported(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @rte_xen_dom0_supported() {
ret i32 0
}
/* Variables and functions */
int cfg_processor_get_hex_int_attr(void *, char *);
int cfg_io_get_gpio_ies_addr(void *port) {
  return cfg_processor_get_hex_int_attr(port, "ies");
}


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

x86 assembly (clang, -O2):
<cfg_io_get_gpio_ies_addr>:
lea    0xee9(%rip),%rsi
jmp    1030 <cfg_processor_get_hex_int_attr@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"ies\00"
define i32 @cfg_io_get_gpio_ies_addr(i8* %0) {
%2 = tail call i32 @cfg_processor_get_hex_int_attr(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ dgetri_(int *, double *, int *, int *, double *, int *,
                           int *);
int aa_cla_dgetri(int n, double *A, int lda, int *ipiv, double *work,
                  int lwork) {
  int info = 0;
  dgetri_(&n, A, &lda, ipiv, work, &lwork, &info);
  return info;
}


x86 assembly (clang, -O0):
<aa_cla_dgetri>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
lea    -0x4(%rbp),%rdi
lea    -0x14(%rbp),%rdx
lea    -0x2c(%rbp),%r9
lea    -0x30(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <dgetri_@plt>
mov    -0x30(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aa_cla_dgetri>:
sub    $0x18,%rsp
mov    %edi,0x14(%rsp)
mov    %edx,0x10(%rsp)
mov    %r9d,0xc(%rsp)
movl   $0x0,0x8(%rsp)
lea    0x8(%rsp),%rax
mov    %rax,(%rsp)
lea    0x14(%rsp),%rdi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%r9
call   1030 <dgetri_@plt>
mov    0x8(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @aa_cla_dgetri(i32 %0, double* %1, i32 %2, i32* %3, double* %4, i32 %5) {
%7 = alloca i32
%8 = alloca double*
%9 = alloca i32
%10 = alloca i32*
%11 = alloca double*
%12 = alloca i32
%13 = alloca i32
store i32 %0, i32* %7
store double* %1, double** %8
store i32 %2, i32* %9
store i32* %3, i32** %10
store double* %4, double** %11
store i32 %5, i32* %12
store i32 0, i32* %13
%14 = load double*, double** %8
%15 = load i32*, i32** %10
%16 = load double*, double** %11
%17 = call i32 @dgetri_(i32* %7, double* %14, i32* %9, i32* %15, double* %16, i32* %12, i32* %13)
%18 = load i32, i32* %13
ret i32 %18
}

LLVM IR (-O2):
define i32 @aa_cla_dgetri(i32 %0, double* %1, i32 %2, i32* %3, double* %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %7
store i32 %2, i32* %8
store i32 %5, i32* %9
%11 = bitcast i32* %10 to i8*
store i32 0, i32* %10
%12 = call i32 @dgetri_(i32* %7, double* %1, i32* %8, i32* %3, double* %4, i32* %9, i32* %10)
%13 = load i32, i32* %10
ret i32 %13
}
void serial_purge() {}


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

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

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

LLVM IR (-O2):
define void @serial_purge() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DATA_INPUT(char *, char *);
void data_set_sram_char(char *val, const char *data_param) {
  DATA_INPUT("%"
             "c",
             val);
}


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define void @data_set_sram_char(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 = call i32 @DATA_INPUT(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @data_set_sram_char(i8* %0, i8* nocapture readnone %1) {
%3 = tail call i32 @DATA_INPUT(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x9c() {
  Assert_real((isupper(156) == 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_isupper.c",
              785, ("isupper should be 0 for 0x9c"));
}


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

x86 assembly (clang, -O2):
<t_isupper_0x9c>:
push   %rax
mov    $0x9c,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x311,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x9c\00"
define void @t_isupper_0x9c() {
%1 = call i64 @isupper(i32 156)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 785, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x9c\00"
define void @t_isupper_0x9c() {
%1 = tail call i64 @isupper(i32 156)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 785, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int call_stdcall_fun(int(__attribute__((stdcall)) * f)(int, int, int)) {
  int a = 42;
  f(1, 2, 3);
  return a;
}


x86 assembly (clang, -O0):
<call_stdcall_fun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x2a,-0xc(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   *-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_stdcall_fun>:
push   %rax
mov    %rdi,%rax
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   *%rax
mov    $0x2a,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @call_stdcall_fun(i32 (i32, i32, i32)* nocapture %0) {
%2 = tail call i32 %0(i32 1, i32 2, i32 3)
ret i32 42
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "usage: Bonnie [-d scratch-dir] [-s size-in-Mb] [-html] [-m "
                  "machine-label]\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [75 x i8] c"usage: Bonnie [-d scratch-dir] [-s size-in-Mb] [-html] [-m machine-label]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [75 x i8] c"usage: Bonnie [-d scratch-dir] [-s size-in-Mb] [-html] [-m machine-label]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct evbuffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ evbuffer_add_printf(struct evbuffer *, char *);
int get(struct evbuffer *ret_buf) {
  evbuffer_add_printf(ret_buf, "Executing ROOT exploit ...\n");
  return 0;
}


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

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

LLVM IR (-O0):
%struct.evbuffer = type { i32 }
@.str = [28 x i8] c"Executing ROOT exploit ...\0A\00"
define i32 @get(%struct.evbuffer* %0) {
%2 = alloca %struct.evbuffer*
store %struct.evbuffer* %0, %struct.evbuffer** %2
%3 = load %struct.evbuffer*, %struct.evbuffer** %2
%4 = call i32 @evbuffer_add_printf(%struct.evbuffer* %3, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
%struct.evbuffer = type { i32 }
@.str = [28 x i8] c"Executing ROOT exploit ...\0A\00"
define i32 @get(%struct.evbuffer* %0) {
%2 = tail call i32 @evbuffer_add_printf(%struct.evbuffer* %0, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ const *);
struct tm *my_mktime_localtime_r(const time_t *t, struct tm *tp) {
  struct tm *l = localtime(t);
  if (!l)
    return 0;
  *tp = *l;
  return tp;
}


x86 assembly (clang, -O0):
<my_mktime_localtime_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1145 <my_mktime_localtime_r+0x35>
movq   $0x0,-0x8(%rbp)
jmp    1159 <my_mktime_localtime_r+0x49>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rcx),%ecx
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_mktime_localtime_r>:
push   %rbx
mov    %rsi,%rbx
call   1030 <localtime@plt>
test   %rax,%rax
je     1124 <my_mktime_localtime_r+0x14>
mov    (%rax),%eax
mov    %eax,(%rbx)
jmp    1126 <my_mktime_localtime_r+0x16>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.tm = type { i32 }
define %struct.tm* @my_mktime_localtime_r(i32* %0, %struct.tm* writeonly %1) {
%3 = tail call %struct.tm* @localtime(i32* %0)
%4 = icmp eq %struct.tm* %3, null
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = getelementptr %struct.tm, %struct.tm* %3, i64 0, i32 0
%7 = getelementptr %struct.tm, %struct.tm* %1, i64 0, i32 0
%8 = load i32, i32* %6
store i32 %8, i32* %7
br label %9
9: ; preds = %2, %5
%10 = phi %struct.tm* [ %1, %5 ], [ null, %2 ]
ret %struct.tm* %10
}
/* Variables and functions */
int bm_strnupcmp(char const *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
int bm_strupcmp(const char *hay, const char *needle) {
  return bm_strnupcmp(hay, needle, strlen(hay));
}


x86 assembly (clang, -O0):
<bm_strupcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <bm_strnupcmp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bm_strupcmp>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <bm_strnupcmp@plt>

LLVM IR (-O0):
define i32 @bm_strupcmp(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 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @bm_strnupcmp(i8* %5, i8* %6, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @bm_strupcmp(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @bm_strnupcmp(i8* %0, i8* %1, i32 %3)
ret i32 %4
}
c_alter(ptr, val) char *ptr;
int val;
{ *ptr = val; }


x86 assembly (clang, -O0):
<c_alter>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_alter>:
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define i32 @c_alter(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = trunc i32 %6 to i8
%8 = load i8*, i8** %4
store i8 %7, i8* %8
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @c_alter(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
store i8 %3, i8* %0
ret i32 undef
}
extern void *aug_tasptr(void *volatile *ptr, void *val) {
  return __sync_lock_test_and_set(ptr, val);
}


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

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

LLVM IR (-O0):
define i8* @aug_tasptr(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 = bitcast i8** %5 to i64*
%7 = load i8*, i8** %4
%8 = ptrtoint i8* %7 to i64
%9 = atomicrmw xchg i64* %6, i64 %8 seq_cst
%10 = inttoptr i64 %9 to i8*
ret i8* %10
}

LLVM IR (-O2):
define i8* @aug_tasptr(i8** nocapture %0, i8* %1) {
%3 = bitcast i8** %0 to i64*
%4 = ptrtoint i8* %1 to i64
%5 = atomicrmw xchg i64* %3, i64 %4 seq_cst
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}
int input_map_a3(char c) {
  if (c == 'f')
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<input_map_a3>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x66,%eax
jne    1123 <input_map_a3+0x23>
movl   $0x1,-0x4(%rbp)
jmp    112a <input_map_a3+0x2a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<input_map_a3>:
xor    %eax,%eax
cmp    $0x66,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @input_map_a3(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 102
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @input_map_a3(i8 signext %0) {
%2 = icmp eq i8 %0, 102
%3 = zext i1 %2 to i32
ret i32 %3
}
int checkPin(int pin) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @checkPin(i32 %0) {
ret i32 1
}
void glutPostRedisplay() {}


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

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

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

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

/* Variables and functions */
int log(double);
double convertKlnTemp(uint8_t temp) {
  return (double)1 / ((double)1 / (25 + 273.15) +
                      log((double)temp * 1000 / (256 - temp) / 2200) / 3987) -
         273.15;
}


x86 assembly (clang, -O0):
<convertKlnTemp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xef8(%rip),%xmm1
mulsd  %xmm1,%xmm0
mov    $0x100,%eax
sub    -0x4(%rbp),%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
movsd  0xed4(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <log@plt>
mov    $0xf93,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
movsd  0xeaf(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xe9b(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  0xe87(%rip),%xmm1
subsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convertKlnTemp>:
push   %rax
cvtsi2sd %edi,%xmm0
mulsd  0xee3(%rip),%xmm0
mov    $0x100,%eax
sub    %edi,%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
divsd  0xed4(%rip),%xmm0
call   1030 <log@plt>
cltq
imul   $0xffffffff837fd6e9,%rax,%rcx
shr    $0x20,%rcx
add    %ecx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0xb,%eax
add    %ecx,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
addsd  0xeaf(%rip),%xmm1
movsd  0xeaf(%rip),%xmm0
divsd  %xmm1,%xmm0
addsd  0xeab(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @convertKlnTemp(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = fmul double %4, 1.000000e+03
%6 = load i32, i32* %2
%7 = sub nsw i32 256, %6
%8 = sitofp i32 %7 to double
%9 = fdiv double %5, %8
%10 = fdiv double %9, 2.200000e+03
%11 = call i32 @log(double %10)
%12 = sdiv i32 %11, 3987
%13 = sitofp i32 %12 to double
%14 = fadd double 0x3F6B79E1DCB5DB83, %13
%15 = fdiv double 1.000000e+00, %14
%16 = fsub double %15, 2.731500e+02
ret double %16
}

LLVM IR (-O2):
define double @convertKlnTemp(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fmul double %2, 1.000000e+03
%4 = sub nsw i32 256, %0
%5 = sitofp i32 %4 to double
%6 = fdiv double %3, %5
%7 = fdiv double %6, 2.200000e+03
%8 = tail call i32 @log(double %7)
%9 = sdiv i32 %8, 3987
%10 = sitofp i32 %9 to double
%11 = fadd double %10, 0x3F6B79E1DCB5DB83
%12 = fdiv double 1.000000e+00, %11
%13 = fadd double %12, -2.731500e+02
ret double %13
}
/* Variables and functions */
int /*<<< orphan*/ printautocase(char);
void printcharV2(char c) {
  if (c == 0x25)
    c = 0xd;
  else if (c == 0x5f)
    c = 0x20;
  printautocase(c);
}


x86 assembly (clang, -O0):
<printcharV2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x25,%eax
jne    1134 <printcharV2+0x24>
movb   $0xd,-0x1(%rbp)
jmp    114a <printcharV2+0x3a>
movsbl -0x1(%rbp),%eax
cmp    $0x5f,%eax
jne    1145 <printcharV2+0x35>
movb   $0x20,-0x1(%rbp)
jmp    114a <printcharV2+0x3a>
movsbl -0x1(%rbp),%edi
call   1030 <printautocase@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printcharV2>:
cmp    $0x5f,%dil
mov    $0x20,%ecx
mov    %edi,%eax
cmove  %ecx,%eax
cmp    $0x25,%dil
mov    $0xd,%ecx
cmove  %ecx,%eax
mov    %eax,%edi
jmp    1030 <printautocase@plt>

LLVM IR (-O0):
define void @printcharV2(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 37
br i1 %5, label %6, label %7
6: ; preds = %1
store i8 13, i8* %2
br label %13
7: ; preds = %1
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 95
br i1 %10, label %11, label %12
11: ; preds = %7
store i8 32, i8* %2
br label %12
12: ; preds = %11, %7
br label %13
13: ; preds = %12, %6
%14 = load i8, i8* %2
%15 = call i32 @printautocase(i8 signext %14)
ret void
}

LLVM IR (-O2):
define void @printcharV2(i8 signext %0) {
%2 = icmp eq i8 %0, 37
%3 = icmp eq i8 %0, 95
%4 = select i1 %3, i8 32, i8 %0
%5 = select i1 %2, i8 13, i8 %4
%6 = tail call i32 @printautocase(i8 signext %5)
ret void
}
unsigned long findEndOfLine(char *str, unsigned long startInd) {
  unsigned long curInd = startInd;
  while (str[curInd] != '\n')
    curInd++;
  return curInd;
}


x86 assembly (clang, -O0):
<findEndOfLine>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
je     113a <findEndOfLine+0x3a>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <findEndOfLine+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<findEndOfLine>:
mov    %rsi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0xa,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <findEndOfLine+0x10>
ret

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

LLVM IR (-O2):
define i64 @findEndOfLine(i8* nocapture %0, i64 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %1, %2 ], [ %8, %3 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 10
%8 = add i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ DirectIndexedXE0(int);
int /*<<< orphan*/ ROR16(int /*<<< orphan*/, int);
void Op76E0M0(void) { ROR16(DirectIndexedXE0(3), 0xFFFF); }


x86 assembly (clang, -O0):
<Op76E0M0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1040 <DirectIndexedXE0@plt>
mov    %eax,%edi
mov    $0xffff,%esi
call   1030 <ROR16@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op76E0M0>:
push   %rax
mov    $0x3,%edi
call   1040 <DirectIndexedXE0@plt>
mov    %eax,%edi
mov    $0xffff,%esi
pop    %rax
jmp    1030 <ROR16@plt>

LLVM IR (-O0):
define void @Op76E0M0() {
%1 = call i32 @DirectIndexedXE0(i32 3)
%2 = call i32 @ROR16(i32 %1, i32 65535)
ret void
}

LLVM IR (-O2):
define void @Op76E0M0() {
%1 = tail call i32 @DirectIndexedXE0(i32 3)
%2 = tail call i32 @ROR16(i32 %1, i32 65535)
ret void
}
/* Variables and functions */
long double logl(scalar_t__);
scalar_t__ sqrtl(long double);
long double acoshl(long double x) { return logl(x + sqrtl(x * x - 1)); }


x86 assembly (clang, -O0):
<acoshl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fld    %st(0)
fstpt  -0x30(%rbp)
fmul   %st,%st(0)
fld1
fchs
faddp  %st,%st(1)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <sqrtl@plt>
fldt   -0x30(%rbp)
mov    %rax,-0x20(%rbp)
fildll -0x20(%rbp)
faddp  %st,%st(1)
fnstcw -0x22(%rbp)
movzwl -0x22(%rbp),%eax
or     $0xc00,%eax
mov    %ax,-0x24(%rbp)
fldcw  -0x24(%rbp)
fistpll -0x18(%rbp)
fldcw  -0x22(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <logl@plt>
fld    %st(0)
fstp   %st(0)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acoshl>:
sub    $0x38,%rsp
fldt   0x40(%rsp)
fld    %st(0)
fstpt  0x2c(%rsp)
fmul   %st,%st(0)
fld1
fchs
faddp  %st,%st(1)
fstpt  (%rsp)
call   1040 <sqrtl@plt>
mov    %rax,0x18(%rsp)
fildll 0x18(%rsp)
fldt   0x2c(%rsp)
faddp  %st,%st(1)
fnstcw 0x14(%rsp)
movzwl 0x14(%rsp),%eax
or     $0xc00,%eax
mov    %ax,0x16(%rsp)
fldcw  0x16(%rsp)
fistpll 0x20(%rsp)
fldcw  0x14(%rsp)
mov    0x20(%rsp),%rdi
add    $0x38,%rsp
jmp    1030 <logl@plt>

LLVM IR (-O0):
define x86_fp80 @acoshl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = load x86_fp80, x86_fp80* %2
%5 = load x86_fp80, x86_fp80* %2
%6 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %4, x86_fp80 %5, x86_fp80 0xKBFFF8000000000000000)
%7 = call i64 @sqrtl(x86_fp80 %6)
%8 = sitofp i64 %7 to x86_fp80
%9 = fadd x86_fp80 %3, %8
%10 = fptosi x86_fp80 %9 to i64
%11 = call x86_fp80 @logl(i64 %10)
ret x86_fp80 %11
}

LLVM IR (-O2):
define x86_fp80 @acoshl(x86_fp80 %0) {
%2 = tail call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %0, x86_fp80 %0, x86_fp80 0xKBFFF8000000000000000)
%3 = tail call i64 @sqrtl(x86_fp80 %2)
%4 = sitofp i64 %3 to x86_fp80
%5 = fadd x86_fp80 %4, %0
%6 = fptosi x86_fp80 %5 to i64
%7 = tail call x86_fp80 @logl(i64 %6)
ret x86_fp80 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() {
  int arr[] = {10, 20, 36, 72, 45, 36};
  int *j, *k;
  j = &arr[4];
  k = (arr + 4);
  if (j == k)
    printf("The two pointers point to the same location");
  else
    printf("The two pointers do not point to the same location");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed4(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x20(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x28(%rbp)
lea    -0x20(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x30(%rbp),%rax
jne    1177 <main+0x67>
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
jmp    1183 <main+0x73>
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.arr = [6 x i32] [i32 10, i32 20, i32 36, i32 72, i32 45, i32 36]
@.str = [44 x i8] c"The two pointers point to the same location\00"
@.str.1 = [51 x i8] c"The two pointers do not point to the same location\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i32]
%3 = alloca i32*
%4 = alloca i32*
store i32 0, i32* %1
%5 = bitcast [6 x i32]* %2 to i8*
%6 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 4
store i32* %6, i32** %3
%7 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%8 = getelementptr inbounds i32, i32* %7, i64 4
store i32* %8, i32** %4
%9 = load i32*, i32** %3
%10 = load i32*, i32** %4
%11 = icmp eq i32* %9, %10
br i1 %11, label %12, label %14
12: ; preds = %0
%13 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
br label %16
14: ; preds = %0
%15 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
br label %16
16: ; preds = %14, %12
ret i32 0
}

LLVM IR (-O2):
@.str = [44 x i8] c"The two pointers point to the same location\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ strtol(char *, char **, int);
bool parseInt(char *word, int base, uint8_t *value) {
  char *failed;
  *value = strtol(word, &failed, base);
  return (word != failed);
}


x86 assembly (clang, -O0):
<parseInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    -0x20(%rbp),%rsi
call   1030 <strtol@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
cmp    -0x20(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseInt>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %esi,%edx
mov    %rdi,%rbx
mov    %rsp,%rsi
call   1030 <strtol@plt>
mov    %eax,(%r14)
xor    %eax,%eax
cmp    %rbx,(%rsp)
setne  %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @parseInt(i8* %0, i32 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = call i32 @strtol(i8* %8, i8** %7, i32 %9)
%11 = load i32*, i32** %6
store i32 %10, i32* %11
%12 = load i8*, i8** %4
%13 = load i8*, i8** %7
%14 = icmp ne i8* %12, %13
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @parseInt(i8* %0, i32 %1, i32* nocapture writeonly %2) {
%4 = alloca i8*
%5 = bitcast i8** %4 to i8*
%6 = call i32 @strtol(i8* %0, i8** %4, i32 %1)
store i32 %6, i32* %2
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, %0
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *name) {
  fprintf(stderr,
          "Usage: %s [-n nm] [-m make] libs...\n"
          "nm   -- The command used to run nm on reactos objects\n"
          "make -- The command used to build reactos\n\n"
          "libs are import libraries (.a files) typically from\n"
          "dk/lib/nkm and dk/lib/w32\n",
          name);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [212 x i8] c"Usage: %s [-n nm] [-m make] libs...\0Anm -- The command used to run nm on reactos objects\0Amake -- The command used to build reactos\0A\0Alibs are import libraries (.a files) typically from\0Adk/lib/nkm and dk/lib/w32\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([212 x i8], [212 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [212 x i8] c"Usage: %s [-n nm] [-m make] libs...\0Anm -- The command used to run nm on reactos objects\0Amake -- The command used to build reactos\0A\0Alibs are import libraries (.a files) typically from\0Adk/lib/nkm and dk/lib/w32\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([212 x i8], [212 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void RTAvlGCPhysRemoveBestFit(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlGCPhysRemoveBestFit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pin_unexport(int);
void unexport_P8() {
  pin_unexport(44);
  pin_unexport(46);
}


x86 assembly (clang, -O0):
<unexport_P8>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2c,%edi
call   1030 <pin_unexport@plt>
mov    $0x2e,%edi
call   1030 <pin_unexport@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<unexport_P8>:
push   %rax
mov    $0x2c,%edi
call   1030 <pin_unexport@plt>
mov    $0x2e,%edi
pop    %rax
jmp    1030 <pin_unexport@plt>

LLVM IR (-O0):
define void @unexport_P8() {
%1 = call i32 @pin_unexport(i32 44)
%2 = call i32 @pin_unexport(i32 46)
ret void
}

LLVM IR (-O2):
define void @unexport_P8() {
%1 = tail call i32 @pin_unexport(i32 44)
%2 = tail call i32 @pin_unexport(i32 46)
ret void
}
int x29_process_syn(struct mypacket *packet) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.mypacket = type opaque
define i32 @x29_process_syn(%struct.mypacket* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/);
int getRandIntToMax(int max) {
  srand(time(0));
  return rand() % max;
}


x86 assembly (clang, -O0):
<getRandIntToMax>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    $0x0,%al
call   1050 <rand@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRandIntToMax>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @getRandIntToMax(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @time(i32 0)
%4 = call i32 @srand(i32 %3)
%5 = call i32 (...) @rand()
%6 = load i32, i32* %2
%7 = srem i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @getRandIntToMax(i32 %0) {
%2 = tail call i32 @time(i32 0)
%3 = tail call i32 @srand(i32 %2)
%4 = tail call i32 (...) @rand()
%5 = srem i32 %4, %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() { printf("I'am a C programmer\n"); }


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"I'am a C programmer\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [20 x i8] c"I'am a C programmer\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void XPutBackEvent() {}


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

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

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

LLVM IR (-O2):
define void @XPutBackEvent() {
ret void
}
int main(void) {
  int a = 0;
  for (; a != 0; a++) {
    switch (a) {
    case 0:
      continue;
    default:
      break;
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1149 <main+0x49>
mov    -0x8(%rbp),%eax
test   %eax,%eax
jne    1131 <main+0x31>
jmp    112c <main+0x2c>
jmp    113b <main+0x3b>
jmp    1136 <main+0x36>
jmp    113b <main+0x3b>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_thread_free_nojoin() {
  printf("NOT IMPLEMENTED:"
         "pa_thread_free_nojoin"
         "\n");
}


x86 assembly (clang, -O0):
<pa_thread_free_nojoin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [39 x i8] c"NOT IMPLEMENTED:pa_thread_free_nojoin\0A\00"
define i32 @pa_thread_free_nojoin() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [38 x i8] c"NOT IMPLEMENTED:pa_thread_free_nojoin\00"
define i32 @pa_thread_free_nojoin() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ detail;
};
typedef TYPE_1__ XFocusInEvent;

/* Variables and functions */
int get_XFocusInEvent_detail(void *_p) {
  return (int)((XFocusInEvent *)_p)->detail;
}


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

x86 assembly (clang, -O2):
<get_XFocusInEvent_detail>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XFocusInEvent_detail(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
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XFocusInEvent_detail(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}