xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int64_t bot_timestamp_useconds(int64_t v) { return v % 1000000; }


x86 assembly (clang, -O0):
<bot_timestamp_useconds>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xf4240,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bot_timestamp_useconds>:
movslq %edi,%rax
imul   $0x431bde83,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x32,%rcx
add    %edx,%ecx
imul   $0xf4240,%ecx,%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @bot_timestamp_useconds(i32 %0) {
%2 = srem i32 %0, 1000000
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x14() {
  Assert_real((isxdigit(20) == 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_isxdigit.c",
              105, ("isxdigit should be 0 for 0x14"));
}


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

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

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

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x14\00"
define void @t_isxdigit_0x14() {
%1 = tail call i64 @isxdigit(i32 20)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 105, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void destroy_filebuffer(char *buf) { free(buf); }


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

x86 assembly (clang, -O2):
<destroy_filebuffer>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @destroy_filebuffer(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int hashSearch(char *, char *);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char const *argv[]) {
  char *src = "helodfasfdfa";
  char *ptn = "dfa";
  printf("%d\n", hashSearch(src, ptn));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xec1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <hashSearch@plt>
mov    %eax,%esi
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xeda(%rip),%rsi
call   1030 <hashSearch@plt>
lea    0xed2(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"helodfasfdfa\00"
@.str.1 = [4 x i8] c"dfa\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @hashSearch(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %3)
ret i32 0
}
void RTPathUserHome(void) {}


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

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

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

LLVM IR (-O2):
define void @RTPathUserHome() {
ret void
}
int shr_round0(int val, int n) {
  int offset;
  offset = (1 << (n - 1)) - 1;
  if (val >= 0) {
    val = (val + offset) >> n;
  } else {
    val = -val;
    val = (val + offset) >> n;
    val = -val;
  }
  return val;
}


x86 assembly (clang, -O0):
<shr_round0>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     113a <shr_round0+0x3a>
mov    -0x4(%rbp),%eax
add    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <shr_round0+0x58>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<shr_round0>:
lea    -0x1(%rsi),%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
test   %edi,%edi
js     1117 <shr_round0+0x17>
add    %edi,%eax
mov    %esi,%ecx
sar    %cl,%eax
ret
sub    %edi,%eax
mov    %esi,%ecx
sar    %cl,%eax
neg    %eax
ret

LLVM IR (-O0):
define i32 @shr_round0(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = sub nsw i32 %6, 1
%8 = shl i32 1, %7
%9 = sub nsw i32 %8, 1
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = icmp sge i32 %10, 0
br i1 %11, label %12, label %18
12: ; preds = %2
%13 = load i32, i32* %3
%14 = load i32, i32* %5
%15 = add nsw i32 %13, %14
%16 = load i32, i32* %4
%17 = ashr i32 %15, %16
store i32 %17, i32* %3
br label %28
18: ; preds = %2
%19 = load i32, i32* %3
%20 = sub nsw i32 0, %19
store i32 %20, i32* %3
%21 = load i32, i32* %3
%22 = load i32, i32* %5
%23 = add nsw i32 %21, %22
%24 = load i32, i32* %4
%25 = ashr i32 %23, %24
store i32 %25, i32* %3
%26 = load i32, i32* %3
%27 = sub nsw i32 0, %26
store i32 %27, i32* %3
br label %28
28: ; preds = %18, %12
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
define i32 @shr_round0(i32 %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = shl nsw i32 -1, %3
%5 = xor i32 %4, -1
%6 = icmp sgt i32 %0, -1
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = add nsw i32 %5, %0
%9 = ashr i32 %8, %1
br label %14
10: ; preds = %2
%11 = sub i32 %5, %0
%12 = ashr i32 %11, %1
%13 = sub nsw i32 0, %12
br label %14
14: ; preds = %10, %7
%15 = phi i32 [ %9, %7 ], [ %13, %10 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int lower_one_mask(int);
int main(int argc, char *argv[]) {
  assert(lower_one_mask(6) == 0x3F);
  assert(lower_one_mask(17) == 0x1FFFF);
  assert(lower_one_mask(32) == 0xFFFFFFFF);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x6,%edi
call   1030 <lower_one_mask@plt>
cmp    $0x3f,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x11,%edi
call   1030 <lower_one_mask@plt>
cmp    $0x1ffff,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x20,%edi
call   1030 <lower_one_mask@plt>
cmp    $0xffffffff,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x6,%edi
call   1030 <lower_one_mask@plt>
xor    %edi,%edi
cmp    $0x3f,%eax
sete   %dil
call   1040 <assert@plt>
mov    $0x11,%edi
call   1030 <lower_one_mask@plt>
xor    %edi,%edi
cmp    $0x1ffff,%eax
sete   %dil
call   1040 <assert@plt>
mov    $0x20,%edi
call   1030 <lower_one_mask@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @lower_one_mask(i32 6)
%7 = icmp eq i32 %6, 63
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = call i32 @lower_one_mask(i32 17)
%11 = icmp eq i32 %10, 131071
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = call i32 @lower_one_mask(i32 32)
%15 = icmp eq i32 %14, -1
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @lower_one_mask(i32 6)
%4 = icmp eq i32 %3, 63
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = tail call i32 @lower_one_mask(i32 17)
%8 = icmp eq i32 %7, 131071
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
%11 = tail call i32 @lower_one_mask(i32 32)
%12 = icmp eq i32 %11, -1
%13 = zext i1 %12 to i32
%14 = tail call i32 @assert(i32 %13)
ret i32 0
}
/* Variables and functions */
int close(int);
int bt_audio_service_close(int sk) { return close(sk); }


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

x86 assembly (clang, -O2):
<bt_audio_service_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @bt_audio_service_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void hello() { printf("Hello, "); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"Hello, \00"
define void @hello() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned int _loll(long long src) { return (unsigned int)src; }


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

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

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

LLVM IR (-O2):
define i32 @_loll(i64 %0) {
%2 = trunc i64 %0 to i32
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ remove(char *);
void verboseRemove(char *filename, int options) {
  remove(filename);
  if (options & 4) {
    printf("removed '%s'\n", filename);
  }
}


x86 assembly (clang, -O0):
<verboseRemove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <remove@plt>
mov    -0xc(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     1157 <verboseRemove+0x37>
mov    -0x8(%rbp),%rsi
lea    0xeae(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<verboseRemove>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <remove@plt>
test   $0x4,%bpl
jne    113a <verboseRemove+0x1a>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xebf(%rip),%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str = [14 x i8] c"removed '%s'\0A\00"
define void @verboseRemove(i8* %0, i32 %1) {
%3 = tail call i32 @remove(i8* %0)
%4 = and i32 %1, 4
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %8
8: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int main(void) {
  char os[20] = {0};
  os[10] = 'U';
  printf("%c\n", os[21]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1040 <memset@plt>
movb   $0x55,-0x16(%rbp)
lea    0xeb6(%rip),%rdi
movsbl -0xb(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
store i32 0, i32* %1
%3 = bitcast [20 x i8]* %2 to i8*
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 10
store i8 85, i8* %4
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 21
%6 = load i8, i8* %5
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext poison)
ret i32 0
}
/* Variables and functions */
double cos(double);
double log(double);
double rand_uniform_2();
double sqrt(double);
double rand_normal(void) {
  double a = rand_uniform_2();
  double b = rand_uniform_2();
  return sqrt(-2.0 * log(a)) * cos(2.0 * 3.14159265358979323846 * b);
}


x86 assembly (clang, -O0):
<rand_normal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1030 <rand_uniform_2@plt>
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand_uniform_2@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1050 <log@plt>
movaps %xmm0,%xmm1
movsd  0xe93(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1060 <sqrt@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  0xe75(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
call   1040 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_normal>:
sub    $0x18,%rsp
xor    %eax,%eax
call   1030 <rand_uniform_2@plt>
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <rand_uniform_2@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1050 <log@plt>
mulsd  0xe8f(%rip),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1181 <rand_normal+0x41>
sqrtsd %xmm0,%xmm0
jmp    1186 <rand_normal+0x46>
call   1060 <sqrt@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
mulsd  0xe6e(%rip),%xmm0
call   1040 <cos@plt>
mulsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @rand_normal() {
%1 = alloca double
%2 = alloca double
%3 = call double (...) @rand_uniform_2()
store double %3, double* %1
%4 = call double (...) @rand_uniform_2()
store double %4, double* %2
%5 = load double, double* %1
%6 = call double @log(double %5)
%7 = fmul double -2.000000e+00, %6
%8 = call double @sqrt(double %7)
%9 = load double, double* %2
%10 = fmul double 0x401921FB54442D18, %9
%11 = call double @cos(double %10)
%12 = fmul double %8, %11
ret double %12
}

LLVM IR (-O2):
define double @rand_normal() {
%1 = tail call double (...) @rand_uniform_2()
%2 = tail call double (...) @rand_uniform_2()
%3 = tail call double @log(double %1)
%4 = fmul double %3, -2.000000e+00
%5 = tail call double @sqrt(double %4)
%6 = fmul double %2, 0x401921FB54442D18
%7 = tail call double @cos(double %6)
%8 = fmul double %5, %7
ret double %8
}
/* Variables and functions */
scalar_t__ isdigit(char const);
bool isstrdigit(const char *s) {
  while (isdigit(*s))
    ++s;
  return *s == '\0';
}


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

x86 assembly (clang, -O2):
<isstrdigit>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl (%rbx),%edi
call   1030 <isdigit@plt>
add    $0x1,%rbx
test   %rax,%rax
jne    1120 <isstrdigit+0x10>
xor    %eax,%eax
cmpb   $0x0,-0x1(%rbx)
sete   %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @isstrdigit(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @isdigit(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = load i8, i8* %3
%10 = icmp eq i8 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}
void output_id() {
  *(char *)0x100000208 = *(char *)0x100000120;
  return;
}


x86 assembly (clang, -O0):
<output_id>:
push   %rbp
mov    %rsp,%rbp
movabs $0x100000120,%rax
mov    (%rax),%cl
movabs $0x100000208,%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_id>:
movabs $0x100000120,%rax
mov    (%rax),%cl
mov    %cl,0xe8(%rax)
ret

LLVM IR (-O0):
define void @output_id() {
%1 = load i8, i8* inttoptr (i64 4294967584 to i8*)
store i8 %1, i8* inttoptr (i64 4294967816 to i8*)
ret void
}

LLVM IR (-O2):
define void @output_id() {
%1 = load i8, i8* inttoptr (i64 4294967584 to i8*)
store i8 %1, i8* inttoptr (i64 4294967816 to i8*)
ret void
}
/* Variables and functions */
int add(int, int);
int /*<<< orphan*/ param_ptr(int *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sum(int, int, int, int, int, int);
int main() {
  int n = 0;
  printf("add(3,5) = %d\n", add(3, 5));
  param_ptr(&n);
  printf("n = %d\n", n);
  sum(5, 1, 2, 3, 4, 5);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x3,%edi
mov    $0x5,%esi
call   1030 <add@plt>
mov    %eax,%esi
lea    0xe92(%rip),%rdi
call   1040 <printf@plt>
lea    -0x8(%rbp),%rdi
call   1050 <param_ptr@plt>
mov    -0x8(%rbp),%esi
lea    0xe89(%rip),%rdi
call   1040 <printf@plt>
mov    $0x5,%r9d
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x4,%r8d
mov    %r9d,%edi
call   1060 <sum@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
mov    $0x3,%edi
mov    $0x5,%esi
call   1030 <add@plt>
lea    0xea1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
lea    0x4(%rsp),%rdi
call   1050 <param_ptr@plt>
mov    0x4(%rsp),%esi
lea    0xe94(%rip),%rdi
call   1040 <printf@plt>
mov    $0x5,%edi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x4,%r8d
mov    $0x5,%r9d
call   1060 <sum@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"add(3,5) = %d\0A\00"
@.str.1 = [8 x i8] c"n = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 @add(i32 3, i32 5)
%4 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @param_ptr(i32* %2)
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = call i32 @sum(i32 5, i32 1, i32 2, i32 3, i32 4, i32 5)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"add(3,5) = %d\0A\00"
@.str.1 = [8 x i8] c"n = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 @add(i32 3, i32 5)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @param_ptr(i32* %1)
%6 = load i32, i32* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = call i32 @sum(i32 5, i32 1, i32 2, i32 3, i32 4, i32 5)
ret i32 0
}
void *mymalloc(x)
long x;
{
  void *mem;
  mem = (void *)malloc(x);
  if (!mem)
    memerror();
  else
    return (void *)mem;
}


x86 assembly (clang, -O0):
<mymalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1150 <mymalloc+0x30>
mov    $0x0,%al
call   1030 <memerror@plt>
jmp    1158 <mymalloc+0x38>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mymalloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <mymalloc+0x15>
xor    %eax,%eax
call   1030 <memerror@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @mymalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @memerror()
br label %6
6: ; preds = %1, %4
ret i8* %2
}
void foo216() {}


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

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

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

LLVM IR (-O2):
define void @foo216() {
ret void
}
/* Variables and functions */
scalar_t__ isalpha(char);
int isSymbolBeg(char c) { return isalpha(c) || c == '_'; }


x86 assembly (clang, -O0):
<isSymbolBeg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isalpha@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    1146 <isSymbolBeg+0x36>
movsbl -0x1(%rbp),%eax
cmp    $0x5f,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isSymbolBeg>:
push   %rbx
mov    %edi,%ebx
call   1030 <isalpha@plt>
test   %rax,%rax
setne  %al
cmp    $0x5f,%bl
sete   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isSymbolBeg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isalpha(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 95
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isSymbolBeg(i8 signext %0) {
%2 = tail call i64 @isalpha(i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = icmp eq i8 %0, 95
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
_Bool Char__EQ_(char a, char b) { return a == b; }


x86 assembly (clang, -O0):
<Char__EQ_>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Char__EQ_>:
cmp    %sil,%dil
sete   %al
ret

LLVM IR (-O0):
define zeroext i1 @Char__EQ_(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %6, %8
ret i1 %9
}

LLVM IR (-O2):
define zeroext i1 @Char__EQ_(i8 signext %0, i8 signext %1) {
%3 = icmp eq i8 %0, %1
ret i1 %3
}
unsigned short m2u16(unsigned short *src) {
  unsigned char *low = ((unsigned char *)src) + 1;
  unsigned char *high = (unsigned char *)src;
  return (((unsigned short)(*high)) << 8) + (unsigned short)(*low);
}


x86 assembly (clang, -O0):
<m2u16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
movzwl %ax,%eax
shl    $0x8,%eax
mov    -0x10(%rbp),%rcx
movzbl (%rcx),%ecx
movzwl %cx,%ecx
add    %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<m2u16>:
movzwl (%rdi),%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define zeroext i16 @m2u16(i16* %0) {
%2 = alloca i16*
%3 = alloca i8*
%4 = alloca i8*
store i16* %0, i16** %2
%5 = load i16*, i16** %2
%6 = bitcast i16* %5 to i8*
%7 = getelementptr inbounds i8, i8* %6, i64 1
store i8* %7, i8** %3
%8 = load i16*, i16** %2
%9 = bitcast i16* %8 to i8*
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = zext i8 %11 to i16
%13 = zext i16 %12 to i32
%14 = shl i32 %13, 8
%15 = load i8*, i8** %3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i16
%18 = zext i16 %17 to i32
%19 = add nsw i32 %14, %18
%20 = trunc i32 %19 to i16
ret i16 %20
}

LLVM IR (-O2):
define zeroext i16 @m2u16(i16* nocapture %0) {
%2 = bitcast i16* %0 to i8*
%3 = getelementptr inbounds i8, i8* %2, i64 1
%4 = load i8, i8* %2
%5 = zext i8 %4 to i16
%6 = shl nuw i16 %5, 8
%7 = load i8, i8* %3
%8 = zext i8 %7 to i16
%9 = or i16 %6, %8
ret i16 %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int read(int, unsigned char *, int);
unsigned char *sensor_data(int file, unsigned char buf[10]) {
  if (read(file, buf, 4) != 4) {
    printf("Unable to read from slave\n");
    exit(1);
  }
  return buf;
}


x86 assembly (clang, -O0):
<sensor_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1040 <read@plt>
cmp    $0x4,%eax
je     116f <sensor_data+0x3f>
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sensor_data>:
push   %rbx
mov    %rsi,%rbx
mov    $0x4,%edx
call   1040 <read@plt>
cmp    $0x4,%eax
jne    1148 <sensor_data+0x18>
mov    %rbx,%rax
pop    %rbx
ret
lea    0xeb1(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Unable to read from slave\0A\00"
define i8* @sensor_data(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = call i32 @read(i32 %5, i8* %6, i32 4)
%8 = icmp ne i32 %7, 4
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %2
%13 = load i8*, i8** %4
ret i8* %13
}

LLVM IR (-O2):
@str = [26 x i8] c"Unable to read from slave\00"
define i8* @sensor_data(i32 %0, i8* returned %1) {
%3 = tail call i32 @read(i32 %0, i8* %1, i32 4)
%4 = icmp eq i32 %3, 4
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
pr_header() {
  printf("#include \"as_parser.h\"\n");
  printf("#line 1 \"as.c\"\n");
}


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"#include \22as_parser.h\22\0A\00"
@.str.1 = [16 x i8] c"#line 1 \22as.c\22\0A\00"
define i32 @pr_header() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@str = [23 x i8] c"#include \22as_parser.h\22\00"
@str.2 = [15 x i8] c"#line 1 \22as.c\22\00"
define i32 @pr_header() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.2, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ angular_tower(double, double, double, double, int, double);
void round_tower(double x, double y, double r, double h, int flying) {
  angular_tower(x, y, r, h, flying, 5.0);
}


x86 assembly (clang, -O0):
<round_tower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
mov    %edi,-0x24(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
mov    -0x24(%rbp),%edi
movsd  0xeb2(%rip),%xmm4
call   1030 <angular_tower@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_tower>:
movsd  0xee8(%rip),%xmm4
jmp    1030 <angular_tower@plt>

LLVM IR (-O0):
define void @round_tower(double %0, double %1, double %2, double %3, i32 %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca i32
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store i32 %4, i32* %10
%11 = load double, double* %6
%12 = load double, double* %7
%13 = load double, double* %8
%14 = load double, double* %9
%15 = load i32, i32* %10
%16 = call i32 @angular_tower(double %11, double %12, double %13, double %14, i32 %15, double 5.000000e+00)
ret void
}

LLVM IR (-O2):
define void @round_tower(double %0, double %1, double %2, double %3, i32 %4) {
%6 = tail call i32 @angular_tower(double %0, double %1, double %2, double %3, i32 %4, double 5.000000e+00)
ret void
}
/* Variables and functions */
scalar_t__ access(char const *, int);
int OTF_fileExists(const char *filename) {
  if (0 == access(filename, 00)) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<OTF_fileExists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <access@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    1141 <OTF_fileExists+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1148 <OTF_fileExists+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @OTF_fileExists(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @access(i8* %4, i32 0)
%6 = icmp eq i64 0, %5
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 @OTF_fileExists(i8* nocapture %0) {
%2 = tail call i64 @access(i8* %0, i32 0)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
int stringIsNull(char *str) {
  int ret = 0;
  if (str[0] == '\0')
    ret = 1;
  return ret;
}


x86 assembly (clang, -O0):
<stringIsNull>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1126 <stringIsNull+0x26>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringIsNull>:
xor    %eax,%eax
cmpb   $0x0,(%rdi)
sete   %al
ret

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

LLVM IR (-O2):
define i32 @stringIsNull(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ load_plugins(int);
int /*<<< orphan*/ load_preferences();
void decoder_init(int debug_info) {
  load_plugins(debug_info);
  load_preferences();
}


x86 assembly (clang, -O0):
<decoder_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <load_plugins@plt>
mov    $0x0,%al
call   1030 <load_preferences@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @decoder_init(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @load_plugins(i32 %3)
%5 = call i32 (...) @load_preferences()
ret void
}

LLVM IR (-O2):
define void @decoder_init(i32 %0) {
%2 = tail call i32 @load_plugins(i32 %0)
%3 = tail call i32 (...) @load_preferences()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x47() {
  Assert_real((isbdigit(71) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isbdigit.c",
              360, ("isbdigit should be 0 for G"));
}


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

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

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

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for G\00"
define void @t_isbdigit_0x47() {
%1 = tail call i64 @isbdigit(i32 71)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 360, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
double exp(double);
OD(double OD) {
  double q9, a;
  if (OD == 140) {
    return 47;
  }
  a = (OD + (-106)) * (OD + (-106));
  q9 = 100.8 * exp(a / -3745);
  return q9;
}


x86 assembly (clang, -O0):
<OD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1146 <OD+0x36>
jp     1146 <OD+0x36>
movl   $0x2f,-0x4(%rbp)
jmp    119b <OD+0x8b>
movsd  0xeca(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  0xebd(%rip),%xmm1
addsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xe9a(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  0xe7e(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
cvttsd2si -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OD>:
push   %rax
mov    $0x2f,%eax
ucomisd 0xee2(%rip),%xmm0
jne    1124 <OD+0x14>
jp     1124 <OD+0x14>
pop    %rcx
ret
addsd  0xedc(%rip),%xmm0
mulsd  %xmm0,%xmm0
divsd  0xed8(%rip),%xmm0
call   1030 <exp@plt>
mulsd  0xed3(%rip),%xmm0
cvttsd2si %xmm0,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @OD(double %0) {
%2 = alloca i32
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
%6 = load double, double* %3
%7 = fcmp oeq double %6, 1.400000e+02
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 47, i32* %2
br label %21
9: ; preds = %1
%10 = load double, double* %3
%11 = fadd double %10, -1.060000e+02
%12 = load double, double* %3
%13 = fadd double %12, -1.060000e+02
%14 = fmul double %11, %13
store double %14, double* %5
%15 = load double, double* %5
%16 = fdiv double %15, -3.745000e+03
%17 = call double @exp(double %16)
%18 = fmul double 1.008000e+02, %17
store double %18, double* %4
%19 = load double, double* %4
%20 = fptosi double %19 to i32
store i32 %20, i32* %2
br label %21
21: ; preds = %9, %8
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @OD(double %0) {
%2 = fcmp oeq double %0, 1.400000e+02
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = fadd double %0, -1.060000e+02
%5 = fmul double %4, %4
%6 = fdiv double %5, -3.745000e+03
%7 = tail call double @exp(double %6)
%8 = fmul double %7, 1.008000e+02
%9 = fptosi double %8 to i32
br label %10
10: ; preds = %1, %3
%11 = phi i32 [ %9, %3 ], [ 47, %1 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void udp_usage(void) {
  printf("  udp - Use a UDP connection\n");
  printf("    udp[:port]          UDP server\n");
  printf("    udp:serverip[:port] UDP client\n");
}


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

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

LLVM IR (-O0):
@.str = [30 x i8] c" udp - Use a UDP connection\0A\00"
@.str.1 = [36 x i8] c" udp[:port] UDP server\0A\00"
@.str.2 = [36 x i8] c" udp:serverip[:port] UDP client\0A\00"
define void @udp_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [29 x i8] c" udp - Use a UDP connection\00"
@str.3 = [35 x i8] c" udp[:port] UDP server\00"
@str.4 = [35 x i8] c" udp:serverip[:port] UDP client\00"
define void @udp_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.4, i64 0, i64 0))
ret void
}
void test_no_formatting_ok(void) {
  char *str = format_str("No formatting");
  do {
    seatest_assert_string_equal("No formatting", str, __FUNCTION__, 12);
  } while (0);
  free(str);
}


x86 assembly (clang, -O0):
<test_no_formatting_ok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1040 <format_str@plt>
cltq
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xea9(%rip),%rdi
lea    0xeb0(%rip),%rdx
mov    $0xc,%ecx
mov    $0x0,%al
call   1050 <seatest_assert_string_equal@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_no_formatting_ok>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <format_str@plt>
movslq %eax,%rbx
lea    0xebf(%rip),%rdx
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0xc,%ecx
xor    %eax,%eax
call   1050 <seatest_assert_string_equal@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"No formatting\00"
@__FUNCTION__.test_no_formatting_ok = [22 x i8] c"test_no_formatting_ok\00"
define void @test_no_formatting_ok() {
%1 = alloca i8*
%2 = call i32 (i8*, ...) bitcast (i32 (...)* @format_str to i32 (i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %1
br label %5
5: ; preds = %0
%6 = load i8*, i8** %1
%7 = call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_string_equal to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %6, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @__FUNCTION__.test_no_formatting_ok, i64 0, i64 0), i32 12)
br label %8
8: ; preds = %5
%9 = load i8*, i8** %1
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"No formatting\00"
@__FUNCTION__.test_no_formatting_ok = [22 x i8] c"test_no_formatting_ok\00"
define void @test_no_formatting_ok() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @format_str to i32 (i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = sext i32 %1 to i64
%3 = inttoptr i64 %2 to i8*
%4 = tail call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_string_equal to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %3, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @__FUNCTION__.test_no_formatting_ok, i64 0, i64 0), i32 12)
tail call void @free(i8* %3)
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t option_decrement(int v) {
  if (v <= 5)
    return 1;
  else if (v <= 115)
    return 5;
  else if (v <= 1000)
    return 59;
  else
    return 1000;
}


x86 assembly (clang, -O0):
<option_decrement>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jg     111d <option_decrement+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    1153 <option_decrement+0x53>
cmpl   $0x73,-0x8(%rbp)
jg     1133 <option_decrement+0x33>
movl   $0x5,-0x4(%rbp)
jmp    1153 <option_decrement+0x53>
cmpl   $0x3e8,-0x8(%rbp)
jg     114c <option_decrement+0x4c>
movl   $0x3b,-0x4(%rbp)
jmp    1153 <option_decrement+0x53>
movl   $0x3e8,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<option_decrement>:
mov    $0x1,%eax
cmp    $0x6,%edi
jl     1127 <option_decrement+0x27>
mov    $0x5,%eax
cmp    $0x74,%edi
jb     1127 <option_decrement+0x27>
cmp    $0x3e9,%edi
mov    $0x3e8,%ecx
mov    $0x3b,%eax
cmovae %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @option_decrement(i32 %0) {
%2 = icmp slt i32 %0, 6
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = icmp ult i32 %0, 116
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = icmp ugt i32 %0, 1000
%7 = select i1 %6, i32 1000, i32 59
br label %8
8: ; preds = %5, %3, %1
%9 = phi i32 [ 1, %1 ], [ 5, %3 ], [ %7, %5 ]
ret i32 %9
}
int test_imm_CDuint8_reg(unsigned char val) {
  return ((val) & (0xCD << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_CDuint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xcd,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_CDuint8_reg>:
test   $0xcd,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_CDuint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 205
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_CDuint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -51
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void TSB_Always_High(int chan) {}


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

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

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

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