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

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/, int /*<<< orphan*/,
                          int /*<<< orphan*/, int /*<<< orphan*/);
int hunk_consumer(int64_t a1, int64_t a2, int64_t b1, int64_t b2, void *priv) {
  printf("@@ -%ld,%ld +%ld,%ld @@\n", a1, a2, b1, b2);
}


x86 assembly (clang, -O0):
<hunk_consumer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hunk_consumer>:
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
lea    0xee0(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [25 x i8] c"@@ -%ld,%ld +%ld,%ld @@\0A\00"
define i32 @hunk_consumer(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture readnone %4) {
%6 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2, i32 %3)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *progname) {
  fprintf(stderr, "usage: %s [-a] [-h] [-k kfile] [-l lb] pmcraw.out binary\n",
          progname);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [58 x i8] c"usage: %s [-a] [-h] [-k kfile] [-l lb] pmcraw.out binary\0A\00"
@EXIT_SUCCESS = global i32 0
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 ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_SUCCESS
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [58 x i8] c"usage: %s [-a] [-h] [-k kfile] [-l lb] pmcraw.out binary\0A\00"
@EXIT_SUCCESS = global i32 0
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_SUCCESS
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int getDisabledCountLeft();
int getDisabledCountRight();
int getDisabledCount() {
  return getDisabledCountLeft() + getDisabledCountRight();
}


x86 assembly (clang, -O0):
<getDisabledCount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getDisabledCountLeft@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getDisabledCountRight@plt>
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getDisabledCount>:
push   %rbx
xor    %eax,%eax
call   1030 <getDisabledCountLeft@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <getDisabledCountRight@plt>
add    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @getDisabledCount() {
%1 = tail call i32 (...) @getDisabledCountLeft()
%2 = tail call i32 (...) @getDisabledCountRight()
%3 = add nsw i32 %2, %1
ret i32 %3
}
/* Variables and functions */
double strtox(char const *, char **, int);
double strtod(const char *restrict s, char **restrict p) {
  return strtox(s, p, 1);
}


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

x86 assembly (clang, -O2):
<strtod>:
mov    $0x1,%edx
jmp    1030 <strtox@plt>

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

LLVM IR (-O2):
define double @strtod(i8* noalias %0, i8** noalias %1) {
%3 = tail call double @strtox(i8* %0, i8** %1, i32 1)
ret double %3
}
/* Variables and functions */
int u8islowerlatini(int /*<<< orphan*/);
int /*<<< orphan*/ u8tointcc(char const *);
int u8islowerlatincc(const char *c) { return u8islowerlatini(u8tointcc(c)); }


x86 assembly (clang, -O0):
<u8islowerlatincc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <u8tointcc@plt>
mov    %eax,%edi
call   1040 <u8islowerlatini@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u8islowerlatincc>:
push   %rax
call   1030 <u8tointcc@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <u8islowerlatini@plt>

LLVM IR (-O0):
define i32 @u8islowerlatincc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @u8tointcc(i8* %3)
%5 = call i32 @u8islowerlatini(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @u8islowerlatincc(i8* %0) {
%2 = tail call i32 @u8tointcc(i8* %0)
%3 = tail call i32 @u8islowerlatini(i32 %2)
ret i32 %3
}
void intake(int power, int time) {}


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

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

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

LLVM IR (-O2):
define void @intake(i32 %0, i32 %1) {
ret void
}
void av_audio_fifo_peek_at() {}


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

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

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

LLVM IR (-O2):
define void @av_audio_fifo_peek_at() {
ret void
}
int mdc(int x, int y) {
  int resto = x % y;
  if (resto == 0) {
    return y;
  } else
    return mdc(y, resto);
}


x86 assembly (clang, -O0):
<mdc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    113d <mdc+0x2d>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114b <mdc+0x3b>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <mdc@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mdc>:
mov    %esi,%edx
mov    %edi,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <mdc+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @mdc(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ %0, %2 ], [ %5, %3 ]
%5 = phi i32 [ %1, %2 ], [ %6, %3 ]
%6 = srem i32 %4, %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3
ret i32 %5
}
/* Type definitions */
struct attrset {
  int dummy;
};

/* Variables and functions */
char *attr_get_str(struct attrset *, char const *, int);
char *attr_find(struct attrset *set, const char *key) {
  return attr_get_str(set, key, -1);
}


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

x86 assembly (clang, -O2):
<attr_find>:
mov    $0xffffffff,%edx
jmp    1030 <attr_get_str@plt>

LLVM IR (-O0):
%struct.attrset = type { i32 }
define i8* @attr_find(%struct.attrset* %0, i8* %1) {
%3 = alloca %struct.attrset*
%4 = alloca i8*
store %struct.attrset* %0, %struct.attrset** %3
store i8* %1, i8** %4
%5 = load %struct.attrset*, %struct.attrset** %3
%6 = load i8*, i8** %4
%7 = call i8* @attr_get_str(%struct.attrset* %5, i8* %6, i32 -1)
ret i8* %7
}

LLVM IR (-O2):
%struct.attrset = type { i32 }
define i8* @attr_find(%struct.attrset* %0, i8* %1) {
%3 = tail call i8* @attr_get_str(%struct.attrset* %0, i8* %1, i32 -1)
ret i8* %3
}
void gtk_menu_tool_button_new() {}


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

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

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

LLVM IR (-O2):
define void @gtk_menu_tool_button_new() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ malloc(size_t);
void *not_null_or_die(int /*<<< orphan*/);
void *malloc_or_die(size_t size) { return not_null_or_die(malloc(size)); }


x86 assembly (clang, -O0):
<malloc_or_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %eax,%edi
call   1040 <not_null_or_die@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_or_die>:
push   %rax
call   1030 <malloc@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <not_null_or_die@plt>

LLVM IR (-O0):
define i8* @malloc_or_die(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @malloc(i64 %3)
%5 = call i8* @not_null_or_die(i32 %4)
ret i8* %5
}

LLVM IR (-O2):
define i8* @malloc_or_die(i64 %0) {
%2 = tail call i32 @malloc(i64 %0)
%3 = tail call i8* @not_null_or_die(i32 %2)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ execvp(char *, char **);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
int main(int argc, char **argv) {
  (void)argc;
  execvp("/usr/lib/ruby/1.8/rlisp.rb", argv);
  fprintf(stderr, "Cannot execute RLisp at %s: %s\n",
          "/usr/lib/ruby/1.8/rlisp.rb", strerror(errno));
  return 1;
}


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)
mov    -0x10(%rbp),%rsi
lea    0xeaf(%rip),%rdi
call   1040 <execvp@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    0x2e6f(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x14(%rbp),%edi
mov    %rax,%rcx
lea    0xe9e(%rip),%rsi
lea    0xe7c(%rip),%rdx
call   1030 <fprintf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xec6(%rip),%rbx
mov    %rbx,%rdi
call   1040 <execvp@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%ebp
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xebb(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1030 <fprintf@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [27 x i8] c"/usr/lib/ruby/1.8/rlisp.rb\00"
@stderr = global i32 0
@.str.1 = [32 x i8] c"Cannot execute RLisp at %s: %s\0A\00"
@errno = global i32 0
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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @execvp(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8** %7)
%9 = load i32, i32* @stderr
%10 = load i32, i32* @errno
%11 = call i8* @strerror(i32 %10)
%12 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %11)
ret i32 1
}

LLVM IR (-O2):
@.str = [27 x i8] c"/usr/lib/ruby/1.8/rlisp.rb\00"
@stderr = global i32 0
@.str.1 = [32 x i8] c"Cannot execute RLisp at %s: %s\0A\00"
@errno = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @execvp(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8** %1)
%4 = load i32, i32* @stderr
%5 = load i32, i32* @errno
%6 = tail call i8* @strerror(i32 %5)
%7 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
long atol(char *);
int /*<<< orphan*/ is_valid_date(long);
int /*<<< orphan*/ sprintf(char *, char *, int, int, int);
long date_to_long(int y, int m, int d) {
  char tmp[32];
  sprintf(tmp, "%04d%02d%02d", y, m, d);
  long l = atol(tmp);
  assert(is_valid_date(l));
  return l;
}


x86 assembly (clang, -O0):
<date_to_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%r8d
lea    0xe9a(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0x30(%rbp),%rdi
call   1050 <atol@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
call   1030 <is_valid_date@plt>
mov    %eax,%edi
call   1040 <assert@plt>
mov    -0x38(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<date_to_long>:
push   %rbx
sub    $0x20,%rsp
mov    %edx,%r8d
mov    %esi,%ecx
mov    %edi,%edx
lea    0xead(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1060 <sprintf@plt>
mov    %rbx,%rdi
call   1050 <atol@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <is_valid_date@plt>
mov    %eax,%edi
call   1040 <assert@plt>
mov    %rbx,%rax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"%04d%02d%02d\00"
define i64 @date_to_long(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [32 x i8]
%8 = alloca i64
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = call i32 @sprintf(i8* %9, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11, i32 %12)
%14 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%15 = call i64 @atol(i8* %14)
store i64 %15, i64* %8
%16 = load i64, i64* %8
%17 = call i32 @is_valid_date(i64 %16)
%18 = call i32 @assert(i32 %17)
%19 = load i64, i64* %8
ret i64 %19
}

LLVM IR (-O2):
@.str = [13 x i8] c"%04d%02d%02d\00"
define i64 @date_to_long(i32 %0, i32 %1, i32 %2) {
%4 = alloca [32 x i8]
%5 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 0
%6 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2)
%7 = call i64 @atol(i8* %5)
%8 = tail call i32 @is_valid_date(i64 %7)
%9 = tail call i32 @assert(i32 %8)
ret i64 %7
}
/* Variables and functions */
double exp(int);
double heaviside_approx(double x) { return (1.0 / (1.0 + exp(-200 * x))); }


x86 assembly (clang, -O0):
<heaviside_approx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xee3(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <exp@plt>
movsd  0xec5(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xeb9(%rip),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<heaviside_approx>:
push   %rax
mulsd  0xee7(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <exp@plt>
movsd  0xede(%rip),%xmm1
addsd  %xmm1,%xmm0
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @heaviside_approx(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double -2.000000e+02, %3
%5 = fptosi double %4 to i32
%6 = call double @exp(i32 %5)
%7 = fadd double 1.000000e+00, %6
%8 = fdiv double 1.000000e+00, %7
ret double %8
}

LLVM IR (-O2):
define double @heaviside_approx(double %0) {
%2 = fmul double %0, -2.000000e+02
%3 = fptosi double %2 to i32
%4 = tail call double @exp(i32 %3)
%5 = fadd double %4, 1.000000e+00
%6 = fdiv double 1.000000e+00, %5
ret double %6
}
int test_imm_7Fuint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x7F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_7Fuint64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0x7f,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_7Fuint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 127
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ M_TRIM_THRESHOLD;
int mallopt(int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("M_TRIM_THRESHOLD %d\n", mallopt(M_TRIM_THRESHOLD, 1024));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
mov    $0x400,%esi
call   1030 <mallopt@plt>
mov    %eax,%esi
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
mov    $0x400,%esi
call   1030 <mallopt@plt>
lea    0xec5(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [21 x i8] c"M_TRIM_THRESHOLD %d\0A\00"
@M_TRIM_THRESHOLD = global i32 0
define i32 @main() {
%1 = load i32, i32* @M_TRIM_THRESHOLD
%2 = tail call i32 @mallopt(i32 %1, i32 1024)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
int config_CARDREADER_INTERNAL_AZBOX(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @config_CARDREADER_INTERNAL_AZBOX() {
ret i32 0
}
short test_58_2(short *mem) { return __atomic_xor_fetch(mem + 4, 1, 4); }


x86 assembly (clang, -O0):
<test_58_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x18(%rbp)
movw   $0x1,-0xa(%rbp)
mov    -0xa(%rbp),%cx
mov    %cx,-0x10(%rbp)
mov    0x8(%rax),%ax
mov    %ax,-0xe(%rbp)
mov    -0xe(%rbp),%ax
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%dx
mov    %dx,%si
mov    %ax,%dx
mov    %edx,-0x24(%rbp)
xor    %esi,%edx
mov    %edx,-0x20(%rbp)
lock cmpxchg %dx,(%rcx)
sete   %cl
mov    %ax,-0x1a(%rbp)
test   $0x1,%cl
mov    %ax,-0xe(%rbp)
jne    1165 <test_58_2+0x65>
jmp    112d <test_58_2+0x2d>
mov    -0x10(%rbp),%cx
mov    -0x1a(%rbp),%ax
xor    %cx,%ax
mov    %ax,-0xc(%rbp)
movswl -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_58_2>:
movzwl 0x8(%rdi),%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %eax,%ecx
xor    $0x1,%ecx
lock cmpxchg %cx,0x8(%rdi)
jne    1110 <test_58_2+0x10>
xor    $0x1,%eax
ret

LLVM IR (-O0):
define signext i16 @test_58_2(i16* %0) {
%2 = alloca i16*
%3 = alloca i16
%4 = alloca i16
store i16* %0, i16** %2
%5 = load i16*, i16** %2
%6 = getelementptr inbounds i16, i16* %5, i64 4
store i16 1, i16* %3
%7 = load i16, i16* %3
%8 = atomicrmw xor i16* %6, i16 %7 acq_rel
%9 = xor i16 %8, %7
store i16 %9, i16* %4
%10 = load i16, i16* %4
ret i16 %10
}

LLVM IR (-O2):
define signext i16 @test_58_2(i16* nocapture %0) {
%2 = getelementptr inbounds i16, i16* %0, i64 4
%3 = atomicrmw xor i16* %2, i16 1 acq_rel
%4 = xor i16 %3, 1
ret i16 %4
}
/* Variables and functions */
size_t __strnlen(char const *, size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
int /*<<< orphan*/ strlen(char *);
char *strncat(char *s1, const char *s2, size_t n) {
  char *s = s1;
  s1 += strlen(s1);
  size_t ss = __strnlen(s2, n);
  s1[ss] = '\0';
  memcpy(s1, s2, ss);
  return s;
}


x86 assembly (clang, -O0):
<strncat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <__strnlen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x28(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncat>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
call   1030 <strlen@plt>
movslq %eax,%rbx
add    %r12,%rbx
mov    %r15,%rdi
mov    %r14,%rsi
call   1050 <__strnlen@plt>
movb   $0x0,(%rax,%rbx,1)
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %rax,%rdx
call   1040 <memcpy@plt>
mov    %r12,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @strncat(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%9 = load i8*, i8** %4
store i8* %9, i8** %7
%10 = load i8*, i8** %4
%11 = call i32 @strlen(i8* %10)
%12 = load i8*, i8** %4
%13 = sext i32 %11 to i64
%14 = getelementptr inbounds i8, i8* %12, i64 %13
store i8* %14, i8** %4
%15 = load i8*, i8** %5
%16 = load i64, i64* %6
%17 = call i64 @__strnlen(i8* %15, i64 %16)
store i64 %17, i64* %8
%18 = load i8*, i8** %4
%19 = load i64, i64* %8
%20 = getelementptr inbounds i8, i8* %18, i64 %19
store i8 0, i8* %20
%21 = load i8*, i8** %4
%22 = load i8*, i8** %5
%23 = load i64, i64* %8
%24 = call i32 @memcpy(i8* %21, i8* %22, i64 %23)
%25 = load i8*, i8** %7
ret i8* %25
}

LLVM IR (-O2):
define i8* @strncat(i8* returned %0, i8* %1, i64 %2) {
%4 = tail call i32 @strlen(i8* %0)
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = tail call i64 @__strnlen(i8* %1, i64 %2)
%8 = getelementptr inbounds i8, i8* %6, i64 %7
store i8 0, i8* %8
%9 = tail call i32 @memcpy(i8* %6, i8* %1, i64 %7)
ret i8* %0
}
/* Variables and functions */
float atof(char *);
char *get_option_value(int, char **, char *);
char *set_float_option_value(int argc, char **argv, char *option_id,
                             float *optvariable) {
  char *chval = get_option_value(argc, argv, option_id);
  if (chval != NULL)
    *optvariable = atof(chval);
  return chval;
}


x86 assembly (clang, -O0):
<set_float_option_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <get_option_value@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1167 <set_float_option_value+0x47>
mov    -0x28(%rbp),%rdi
call   1030 <atof@plt>
mov    -0x20(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_float_option_value>:
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
call   1040 <get_option_value@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1141 <set_float_option_value+0x21>
mov    %rbx,%rdi
call   1030 <atof@plt>
movss  %xmm0,(%r14)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @set_float_option_value(i32 %0, i8** %1, i8* %2, float* nocapture writeonly %3) {
%5 = tail call i8* @get_option_value(i32 %0, i8** %1, i8* %2)
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call float @atof(i8* %5)
store float %8, float* %3
br label %9
9: ; preds = %7, %4
ret i8* %5
}
/* Variables and functions */
int is_first_in_group_EvntGrp(size_t __tag) { return (__tag == (865)) ? 1 : 0; }


x86 assembly (clang, -O0):
<is_first_in_group_EvntGrp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x361,%rdx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_first_in_group_EvntGrp>:
xor    %eax,%eax
cmp    $0x361,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @is_first_in_group_EvntGrp(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 865
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 1, i32 0
ret i32 %6
}

LLVM IR (-O2):
define i32 @is_first_in_group_EvntGrp(i64 %0) {
%2 = icmp eq i64 %0, 865
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(void) {
  int soDodgyMang;
  int m8illhavuno;
  scanf("%d %d", &soDodgyMang, &m8illhavuno);
  printf("%d", soDodgyMang + m8illhavuno);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
add    -0xc(%rbp),%esi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    (%rsp),%esi
add    0x4(%rsp),%esi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, %6
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_condattr_t;

/* Variables and functions */
int /*<<< orphan*/ gptp(char *, int);
void g_pthread_condattr_t() {
  gptp("pthread_condattr_t", sizeof(pthread_condattr_t));
}


x86 assembly (clang, -O0):
<g_pthread_condattr_t>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x4,%esi
call   1030 <gptp@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_pthread_condattr_t>:
lea    0xee9(%rip),%rdi
mov    $0x4,%esi
jmp    1030 <gptp@plt>

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

LLVM IR (-O2):
@.str = [19 x i8] c"pthread_condattr_t\00"
define void @g_pthread_condattr_t() {
%1 = tail call i32 @gptp(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, int /*<<< orphan*/, int);
void ft_putstr(char const *s) {
  if (s)
    while (*s)
      write(1, s++, 1);
}


x86 assembly (clang, -O0):
<ft_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1160 <ft_putstr+0x50>
jmp    112c <ft_putstr+0x1c>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     115b <ft_putstr+0x4b>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    %eax,%esi
mov    $0x1,%edx
mov    %edx,%edi
call   1030 <write@plt>
jmp    112c <ft_putstr+0x1c>
jmp    1160 <ft_putstr+0x50>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     114e <ft_putstr+0x3e>
mov    %rdi,%rbx
cmpb   $0x0,(%rdi)
je     114e <ft_putstr+0x3e>
lea    0x1(%rbx),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x1,%edi
mov    %ebx,%esi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0x1,%ebx
cmpb   $0x0,(%r14)
lea    0x1(%r14),%r14
jne    1130 <ft_putstr+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @ft_putstr(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %3, %6
%7 = phi i8* [ %8, %6 ], [ %0, %3 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = ptrtoint i8* %7 to i64
%10 = trunc i64 %9 to i32
%11 = tail call i32 @write(i32 1, i32 %10, i32 1)
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %6
14: ; preds = %6, %3, %1
ret void
}
/* Variables and functions */
float tanf(float);
float cbuiltin_tanf(float x) { return tanf(x); }


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

x86 assembly (clang, -O2):
<cbuiltin_tanf>:
jmp    1030 <tanf@plt>

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

LLVM IR (-O2):
define float @cbuiltin_tanf(float %0) {
%2 = tail call float @tanf(float %0)
ret float %2
}
float fabsf_c(float x) {
  union {
    int i;
    float f;
  } xx;
  xx.f = x;
  xx.i = xx.i & 0x7FFFFFFF;
  return xx.f;
}


x86 assembly (clang, -O0):
<fabsf_c>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x7fffffff,%eax
mov    %eax,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fabsf_c>:
andps  0xef9(%rip),%xmm0
ret

LLVM IR (-O0):
%union.anon = type { i32 }
define float @fabsf_c(float %0) {
%2 = alloca float
%3 = alloca %union.anon
store float %0, float* %2
%4 = load float, float* %2
%5 = bitcast %union.anon* %3 to float*
store float %4, float* %5
%6 = bitcast %union.anon* %3 to i32*
%7 = load i32, i32* %6
%8 = and i32 %7, 2147483647
%9 = bitcast %union.anon* %3 to i32*
store i32 %8, i32* %9
%10 = bitcast %union.anon* %3 to float*
%11 = load float, float* %10
ret float %11
}

LLVM IR (-O2):
define float @fabsf_c(float %0) {
%2 = bitcast float %0 to i32
%3 = and i32 %2, 2147483647
%4 = bitcast i32 %3 to float
ret float %4
}
int stringlen(char *c) {
  int l = 0;
  while (*(c++))
    l++;
  return l;
}


x86 assembly (clang, -O0):
<stringlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1135 <stringlen+0x35>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <stringlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringlen>:
cmpb   $0x0,(%rdi)
je     111c <stringlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <stringlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @stringlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ init_subrs_1();
int /*<<< orphan*/ init_subrs_a();
void init_subrs(void) {
  init_subrs_1();
  init_subrs_a();
}


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

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

LLVM IR (-O0):
define void @init_subrs() {
%1 = call i32 (...) @init_subrs_1()
%2 = call i32 (...) @init_subrs_a()
ret void
}

LLVM IR (-O2):
define void @init_subrs() {
%1 = tail call i32 (...) @init_subrs_1()
%2 = tail call i32 (...) @init_subrs_a()
ret void
}
/* Variables and functions */
int rand();
int GetRandomNumber(int lower, int higher) {
  if (lower > higher) {
    int temp = lower;
    lower = higher;
    higher = temp;
  }
  int diff = (higher + 1) - lower;
  return (rand() % diff + lower);
}


x86 assembly (clang, -O0):
<GetRandomNumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    113c <GetRandomNumber+0x2c>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0x10(%rbp)
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetRandomNumber>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
cmp    %esi,%edi
mov    %esi,%ebp
cmovg  %edi,%ebp
cmovg  %esi,%ebx
sub    %ebx,%ebp
add    $0x1,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebp
add    %edx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @GetRandomNumber(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = icmp sgt i32 %7, %8
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i32, i32* %3
store i32 %11, i32* %5
%12 = load i32, i32* %4
store i32 %12, i32* %3
%13 = load i32, i32* %5
store i32 %13, i32* %4
br label %14
14: ; preds = %10, %2
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 1
%17 = load i32, i32* %3
%18 = sub nsw i32 %16, %17
store i32 %18, i32* %6
%19 = call i32 (...) @rand()
%20 = load i32, i32* %6
%21 = srem i32 %19, %20
%22 = load i32, i32* %3
%23 = add nsw i32 %21, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @GetRandomNumber(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
%5 = select i1 %3, i32 %1, i32 %0
%6 = add nsw i32 %4, 1
%7 = sub i32 %6, %5
%8 = tail call i32 (...) @rand()
%9 = srem i32 %8, %7
%10 = add nsw i32 %9, %5
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ pq_upheap(int, int *);
void pq_insert(int item, int *items, int *_size) {
  int size = *_size;
  items[size] = item;
  pq_upheap(size, items);
  *_size = size + 1;
}


x86 assembly (clang, -O0):
<pq_insert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x1c(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <pq_upheap@plt>
mov    -0x1c(%rbp),%ecx
add    $0x1,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pq_insert>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
movslq (%rdx),%rbx
mov    %edi,(%rsi,%rbx,4)
mov    %ebx,%edi
call   1030 <pq_upheap@plt>
lea    0x1(%rbx),%eax
mov    %eax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @pq_insert(i32 %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%8 = load i32*, i32** %6
%9 = load i32, i32* %8
store i32 %9, i32* %7
%10 = load i32, i32* %4
%11 = load i32*, i32** %5
%12 = load i32, i32* %7
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
store i32 %10, i32* %14
%15 = load i32, i32* %7
%16 = load i32*, i32** %5
%17 = call i32 @pq_upheap(i32 %15, i32* %16)
%18 = load i32, i32* %7
%19 = add nsw i32 %18, 1
%20 = load i32*, i32** %6
store i32 %19, i32* %20
ret void
}

LLVM IR (-O2):
define void @pq_insert(i32 %0, i32* %1, i32* nocapture %2) {
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %1, i64 %5
store i32 %0, i32* %6
%7 = tail call i32 @pq_upheap(i32 %4, i32* %1)
%8 = add nsw i32 %4, 1
store i32 %8, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int fork();
int /*<<< orphan*/ perror(char *);
void stub1();
int call_in_child(void (*function)(void)) {
  int pid = fork();
  if (pid < 0) {
    perror("fork");
    return 0;
  }
  if (pid == 0) {
    (*function)();
    exit(0);
  }
  return 1;
}


x86 assembly (clang, -O0):
<call_in_child>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <fork@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1168 <call_in_child+0x38>
lea    0xea9(%rip),%rdi
call   1030 <perror@plt>
movl   $0x0,-0x4(%rbp)
jmp    1183 <call_in_child+0x53>
cmpl   $0x0,-0x14(%rbp)
jne    117c <call_in_child+0x4c>
call   *-0x10(%rbp)
xor    %edi,%edi
call   1040 <exit@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_in_child>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <fork@plt>
test   %eax,%eax
js     1155 <call_in_child+0x25>
mov    $0x1,%ebx
je     1163 <call_in_child+0x33>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xea4(%rip),%rdi
call   1030 <perror@plt>
jmp    114b <call_in_child+0x1b>
call   *%r14
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"fork\00"
define i32 @call_in_child(void ()* %0) {
%2 = alloca i32
%3 = alloca void ()*
%4 = alloca i32
store void ()* %0, void ()** %3
%5 = call i32 (...) @fork()
store i32 %5, i32* %4
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
br label %17
10: ; preds = %1
%11 = load i32, i32* %4
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load void ()*, void ()** %3
%15 = call i32 @exit(i32 0)
unreachable
16: ; preds = %10
store i32 1, i32* %2
br label %17
17: ; preds = %16, %8
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@.str = [5 x i8] c"fork\00"
define i32 @call_in_child(void ()* nocapture %0) {
%2 = tail call i32 (...) @fork()
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %10
6: ; preds = %1
%7 = icmp eq i32 %2, 0
br i1 %7, label %8, label %10
8: ; preds = %6
tail call void %0()
%9 = tail call i32 @exit(i32 0)
unreachable
10: ; preds = %6, %4
%11 = phi i32 [ 0, %4 ], [ 1, %6 ]
ret i32 %11
}
/* Variables and functions */
bool nrf52_errata_31(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_31() {
ret i32 0
}
/* Variables and functions */
scalar_t__ isalnum(int);
bool is_c_type_char(int ch) { return isalnum(ch) || ch == '_'; }


x86 assembly (clang, -O0):
<is_c_type_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    113f <is_c_type_char+0x2f>
cmpl   $0x5f,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @is_c_type_char(i32 %0) {
%2 = tail call i64 @isalnum(i32 %0)
%3 = icmp ne i64 %2, 0
%4 = icmp eq i32 %0, 95
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
int get_p02_bat_cap_byhw(void) {
  int bat_cap = -1;
  if (bat_cap < 0) {
    pr_err("[BAT]error!! in %s(), read bat capacity error\n", __FUNCTION__);
  }
  return bat_cap;
}


x86 assembly (clang, -O0):
<get_p02_bat_cap_byhw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xffffffff,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    113e <get_p02_bat_cap_byhw+0x2e>
lea    0xed0(%rip),%rdi
lea    0xef8(%rip),%rsi
mov    $0x0,%al
call   1030 <pr_err@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_p02_bat_cap_byhw>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xf10(%rip),%rsi
xor    %eax,%eax
call   1030 <pr_err@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"[BAT]error!! in %s(), read bat capacity error\0A\00"
@__FUNCTION__.get_p02_bat_cap_byhw = [21 x i8] c"get_p02_bat_cap_byhw\00"
define i32 @get_p02_bat_cap_byhw() {
%1 = alloca i32
store i32 -1, i32* %1
%2 = load i32, i32* %1
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @pr_err to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__FUNCTION__.get_p02_bat_cap_byhw, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
@.str = [47 x i8] c"[BAT]error!! in %s(), read bat capacity error\0A\00"
@__FUNCTION__.get_p02_bat_cap_byhw = [21 x i8] c"get_p02_bat_cap_byhw\00"
define i32 @get_p02_bat_cap_byhw() {
%1 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @pr_err to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__FUNCTION__.get_p02_bat_cap_byhw, i64 0, i64 0))
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void erase() { printf("\033c"); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"\1Bc\00"
define void @erase() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int fuzix_isprint(int c) { return ((uint8_t)c >= 32) && ((uint8_t)c <= 126); }


x86 assembly (clang, -O0):
<fuzix_isprint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <fuzix_isprint+0x20>
cmpl   $0x7e,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fuzix_isprint>:
add    $0xffffffe0,%edi
xor    %eax,%eax
cmp    $0x5f,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @fuzix_isprint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 32
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 126
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @fuzix_isprint(i32 %0) {
%2 = add i32 %0, -32
%3 = icmp ult i32 %2, 95
%4 = zext i1 %3 to i32
ret i32 %4
}