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

/* Variables and functions */
int /*<<< orphan*/ FD_CLR(int, int /*<<< orphan*/ *);
void _d_gnu_fd_clr(int n, fd_set *p) { FD_CLR(n, p); }


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

x86 assembly (clang, -O2):
<_d_gnu_fd_clr>:
jmp    1030 <FD_CLR@plt>

LLVM IR (-O0):
define void @_d_gnu_fd_clr(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32, i32* %3
%6 = load i32*, i32** %4
%7 = call i32 @FD_CLR(i32 %5, i32* %6)
ret void
}

LLVM IR (-O2):
define void @_d_gnu_fd_clr(i32 %0, i32* %1) {
%3 = tail call i32 @FD_CLR(i32 %0, i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_enable_interrupts();
void INTERRUPT_GlobalEnable(void) { __builtin_enable_interrupts(); }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, size_t, char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlcat_rarch__(char *, char const *, size_t);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void fill_dated_filename(char *out_filename, const char *ext, size_t size) {
  time_t cur_time;
  time(&cur_time);
  strftime(out_filename, size, "RetroArch-%m%d-%H%M%S.", localtime(&cur_time));
  strlcat_rarch__(out_filename, ext, size);
}


x86 assembly (clang, -O0):
<fill_dated_filename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x1c(%rbp),%rdi
call   1040 <time@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x1c(%rbp),%rdi
call   1030 <localtime@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    %eax,%ecx
lea    0xe79(%rip),%rdx
call   1060 <strftime@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1050 <strlcat_rarch__@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_dated_filename>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0x4(%rsp),%r12
mov    %r12,%rdi
call   1040 <time@plt>
mov    %r12,%rdi
call   1030 <localtime@plt>
lea    0xe93(%rip),%rdx
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %eax,%ecx
call   1060 <strftime@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1050 <strlcat_rarch__@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [23 x i8] c"RetroArch-%m%d-%H%M%S.\00"
define void @fill_dated_filename(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = call i32 @time(i32* %7)
%9 = load i8*, i8** %4
%10 = load i64, i64* %6
%11 = call i32 @localtime(i32* %7)
%12 = call i32 @strftime(i8* %9, i64 %10, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load i8*, i8** %4
%14 = load i8*, i8** %5
%15 = load i64, i64* %6
%16 = call i32 @strlcat_rarch__(i8* %13, i8* %14, i64 %15)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"RetroArch-%m%d-%H%M%S.\00"
define void @fill_dated_filename(i8* %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = call i32 @time(i32* %4)
%7 = call i32 @localtime(i32* %4)
%8 = call i32 @strftime(i8* %0, i64 %2, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 @strlcat_rarch__(i8* %0, i8* %1, i64 %2)
ret void
}
/* Type definitions */
struct rlimit {
  size_t rlim_cur;
};

/* Variables and functions */
int /*<<< orphan*/ RLIMIT_STACK;
int /*<<< orphan*/ getrlimit(int /*<<< orphan*/, struct rlimit *);
size_t arch_stack_cur(void) {
  struct rlimit limit;
  getrlimit(RLIMIT_STACK, &limit);
  return limit.rlim_cur;
}


x86 assembly (clang, -O0):
<arch_stack_cur>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <getrlimit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arch_stack_cur>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <getrlimit@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.rlimit = type { i64 }
@RLIMIT_STACK = global i32 0
define i64 @arch_stack_cur() {
%1 = alloca %struct.rlimit
%2 = load i32, i32* @RLIMIT_STACK
%3 = call i32 @getrlimit(i32 %2, %struct.rlimit* %1)
%4 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %1, i32 0, i32 0
%5 = load i64, i64* %4
ret i64 %5
}

LLVM IR (-O2):
%struct.rlimit = type { i64 }
@RLIMIT_STACK = global i32 0
define i64 @arch_stack_cur() {
%1 = alloca %struct.rlimit
%2 = bitcast %struct.rlimit* %1 to i8*
%3 = load i32, i32* @RLIMIT_STACK
%4 = call i32 @getrlimit(i32 %3, %struct.rlimit* %1)
%5 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %1, i64 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ function(char *, int);
int /*<<< orphan*/ printf(char *);
int main(void) {
  char s[] = "\x31\x32\x33\x34"
             "\x35\x36\x37\x38"
             "\x73\x84\x04\x08";
  function(s, 0xf);
  printf("back in main\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0xd(%rbp)
mov    0xecf(%rip),%eax
mov    %eax,-0x5(%rbp)
mov    0xeca(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0xd(%rbp),%rdi
mov    $0xf,%esi
call   1040 <function@plt>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x8048473383736,%rax
mov    %rax,0xd(%rsp)
movabs $0x3837363534333231,%rax
36 37 38
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
mov    $0xf,%esi
call   1040 <function@plt>
lea    0xeb5(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.s = [13 x i8] c"12345678s\84\04\08\00"
@.str = [14 x i8] c"back in main\0A\00"
define i32 @main() {
%1 = alloca [13 x i8]
%2 = bitcast [13 x i8]* %1 to i8*
%3 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%4 = call i32 @function(i8* %3, i32 15)
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [13 x i8] c"12345678s\84\04\08\00"
@str = [13 x i8] c"back in main\00"
define i32 @main() {
%1 = alloca [13 x i8]
%2 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%3 = call i32 @function(i8* %2, i32 15)
%4 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void GP_break10(void) {}


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

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

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

LLVM IR (-O2):
define void @GP_break10() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ strerr_warn(char *, int /*<<< orphan*/, int /*<<< orphan*/,
                               int /*<<< orphan*/, int /*<<< orphan*/,
                               int /*<<< orphan*/, int /*<<< orphan*/);
void usage(void) {
  strerr_warn(("tcpserver: usage: tcpserver [ -1UXpPhHrRoOdDqQv ] [ -c limit ] "
               "[ -x rules.cdb ] [ -B banner ] [ -g gid ] [ -u uid ] [ -b "
               "backlog ] [ -l localname ] [ -t timeout ] host port program"),
              0, 0, 0, 0, 0, (0));
  _exit(100);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
xor    %r9d,%r9d
mov    %r9d,%esi
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x0,(%rsp)
call   1040 <strerr_warn@plt>
mov    $0x64,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
movl   $0x0,(%rsp)
lea    0xed1(%rip),%rdi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1040 <strerr_warn@plt>
mov    $0x64,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@.str = [181 x i8] c"tcpserver: usage: tcpserver [ -1UXpPhHrRoOdDqQv ] [ -c limit ] [ -x rules.cdb ] [ -B banner ] [ -g gid ] [ -u uid ] [ -b backlog ] [ -l localname ] [ -t timeout ] host port program\00"
define void @usage() {
%1 = call i32 @strerr_warn(i8* getelementptr inbounds ([181 x i8], [181 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
%2 = call i32 @_exit(i32 100)
unreachable
}

LLVM IR (-O2):
@.str = [181 x i8] c"tcpserver: usage: tcpserver [ -1UXpPhHrRoOdDqQv ] [ -c limit ] [ -x rules.cdb ] [ -B banner ] [ -g gid ] [ -u uid ] [ -b backlog ] [ -l localname ] [ -t timeout ] host port program\00"
define void @usage() {
%1 = tail call i32 @strerr_warn(i8* getelementptr inbounds ([181 x i8], [181 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
%2 = tail call i32 @_exit(i32 100)
unreachable
}
/* Variables and functions */
int errno;
int /*<<< orphan*/ free(char *);
char *get_shm_name(char const *);
int unlink(char *);
int shm_unlink(const char *name) {
  char *shm_name = get_shm_name(name);
  int ret, old_errno;
  if (shm_name == NULL)
    return -1;
  ret = unlink(shm_name);
  old_errno = errno;
  free(shm_name);
  errno = old_errno;
  return ret;
}


x86 assembly (clang, -O0):
<shm_unlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <get_shm_name@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1160 <shm_unlink+0x30>
movl   $0xffffffff,-0x4(%rbp)
jmp    1193 <shm_unlink+0x63>
mov    -0x18(%rbp),%rdi
call   1040 <unlink@plt>
mov    %eax,-0x1c(%rbp)
mov    0x2e6d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%ecx
mov    0x2e55(%rip),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shm_unlink>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
call   1050 <get_shm_name@plt>
test   %rax,%rax
je     1169 <shm_unlink+0x39>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <unlink@plt>
mov    %eax,%r15d
mov    0x2e8a(%rip),%r14
mov    (%r14),%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,(%r14)
mov    %r15d,%eax
jmp    116e <shm_unlink+0x3e>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@errno = global i32 0
define i32 @shm_unlink(i8* %0) {
%2 = tail call i8* @get_shm_name(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @unlink(i8* %2)
%6 = load i32, i32* @errno
%7 = tail call i32 @free(i8* %2)
store i32 %6, i32* @errno
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %5, %4 ], [ -1, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void test(int i) { printf("in test(%d)\n", i); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"in test(%d)\0A\00"
define void @test(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"in test(%d)\0A\00"
define void @test(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
void av_bsf_init() {}


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

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

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

LLVM IR (-O2):
define void @av_bsf_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
int /*<<< orphan*/ printf(char *);
int main() {
  foo(0x8000fffe);
  printf("All ok\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x8000fffe,%edi
call   1040 <foo@plt>
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [7 x i8] c"All ok\00"
define i32 @main() {
%1 = tail call i32 @foo(i32 -2147418114)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void GB_AINV_f_FP32(float *z, const float *x) { (*z) = -(*x); }


x86 assembly (clang, -O0):
<GB_AINV_f_FP32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GB_AINV_f_FP32>:
movss  (%rsi),%xmm0
xorps  0xef5(%rip),%xmm0
movss  %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @GB_AINV_f_FP32(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %4
%6 = load float, float* %5
%7 = fneg float %6
%8 = load float*, float** %3
store float %7, float* %8
ret void
}

LLVM IR (-O2):
define void @GB_AINV_f_FP32(float* nocapture writeonly %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = fneg float %3
store float %4, float* %0
ret void
}
int do_416() { return 416; }


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

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

LLVM IR (-O0):
define i32 @do_416() {
ret i32 416
}

LLVM IR (-O2):
define i32 @do_416() {
ret i32 416
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int baz3(int i) {
  if (!i)
    abort();
  return 1;
}


x86 assembly (clang, -O0):
<baz3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    112c <baz3+0x1c>
mov    $0x0,%al
call   1030 <abort@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<baz3>:
test   %edi,%edi
je     111a <baz3+0xa>
mov    $0x1,%eax
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @baz3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1
ret i32 1
}

LLVM IR (-O2):
define i32 @baz3(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
ret i32 1
}
void XProtocolVersion() {}


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

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

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

LLVM IR (-O2):
define void @XProtocolVersion() {
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int scanf(char *, int *);
int main() {
  int var;
  var = scanf("%d", &var);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <scanf@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea7(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <scanf@plt>
mov    0x2eb7(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void whine(int sig) { printf("caught signal %d\n", sig); }


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"caught signal %d\0A\00"
define void @whine(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"caught signal %d\0A\00"
define void @whine(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
int qsort_cmp_QUEUE_INT(const void *x, const void *y) {
  if (*((int *)x) < *((int *)y))
    return (-1);
  else
    return (*((int *)x) > *((int *)y));
}


x86 assembly (clang, -O0):
<qsort_cmp_QUEUE_INT>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jge    112a <qsort_cmp_QUEUE_INT+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1141 <qsort_cmp_QUEUE_INT+0x41>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<qsort_cmp_QUEUE_INT>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @qsort_cmp_QUEUE_INT(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i32*
%8 = load i32, i32* %7
%9 = load i8*, i8** %5
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %10
%12 = icmp slt i32 %8, %11
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 -1, i32* %3
br label %23
14: ; preds = %2
%15 = load i8*, i8** %4
%16 = bitcast i8* %15 to i32*
%17 = load i32, i32* %16
%18 = load i8*, i8** %5
%19 = bitcast i8* %18 to i32*
%20 = load i32, i32* %19
%21 = icmp sgt i32 %17, %20
%22 = zext i1 %21 to i32
store i32 %22, i32* %3
br label %23
23: ; preds = %14, %13
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @qsort_cmp_QUEUE_INT(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp slt i32 %4, %6
%8 = icmp sgt i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t lsri0(uint32_t x) { return x >> 0; }


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

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

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

LLVM IR (-O2):
define i32 @lsri0(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ LCD_SET_A0();
int /*<<< orphan*/ Send1(unsigned char);
void LCD_X_Write01(unsigned char Data) {
  ;
  LCD_SET_A0();
  Send1(Data);
  ;
}


x86 assembly (clang, -O0):
<LCD_X_Write01>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1040 <LCD_SET_A0@plt>
movzbl -0x1(%rbp),%edi
call   1030 <Send1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCD_X_Write01>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <LCD_SET_A0@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <Send1@plt>

LLVM IR (-O0):
define void @LCD_X_Write01(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 (...) @LCD_SET_A0()
%4 = load i8, i8* %2
%5 = call i32 @Send1(i8 zeroext %4)
ret void
}

LLVM IR (-O2):
define void @LCD_X_Write01(i8 zeroext %0) {
%2 = tail call i32 (...) @LCD_SET_A0()
%3 = tail call i32 @Send1(i8 zeroext %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ Bool;

/* Variables and functions */
void limit_subproc_memory(int address_space_limit, Bool verbose_p) {}


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

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

LLVM IR (-O0):
define void @limit_subproc_memory(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 @limit_subproc_memory(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ show_file(char *);
void show_plugins(void) { show_file("available_tracers"); }


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

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

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

LLVM IR (-O2):
@.str = [18 x i8] c"available_tracers\00"
define void @show_plugins() {
%1 = tail call i32 @show_file(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}
void int_char(int i, unsigned char *p) {
  int sign = 0;
  if (i < 0) {
    sign = 128;
    i = -i;
  }
  p[0] = ((i >> 24) & 127) | sign;
  p[1] = (i >> 16) & 255;
  p[2] = (i >> 8) & 255;
  p[3] = (i)&255;
  return;
}


x86 assembly (clang, -O0):
<int_char>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    112b <int_char+0x2b>
movl   $0x80,-0x14(%rbp)
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x18,%eax
and    $0x7f,%eax
or     -0x14(%rbp),%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_char>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
shr    $0x18,%edi
and    $0xffffff80,%edi
mov    %eax,%ecx
shr    $0x18,%ecx
or     %edi,%ecx
mov    %cl,(%rsi)
mov    %eax,%ecx
shr    $0x10,%ecx
mov    %cl,0x1(%rsi)
mov    %ah,0x2(%rsi)
mov    %al,0x3(%rsi)
ret

LLVM IR (-O0):
define void @int_char(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
store i32 0, i32* %5
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
store i32 128, i32* %5
%9 = load i32, i32* %3
%10 = sub nsw i32 0, %9
store i32 %10, i32* %3
br label %11
11: ; preds = %8, %2
%12 = load i32, i32* %3
%13 = ashr i32 %12, 24
%14 = and i32 %13, 127
%15 = load i32, i32* %5
%16 = or i32 %14, %15
%17 = trunc i32 %16 to i8
%18 = load i8*, i8** %4
%19 = getelementptr inbounds i8, i8* %18, i64 0
store i8 %17, i8* %19
%20 = load i32, i32* %3
%21 = ashr i32 %20, 16
%22 = and i32 %21, 255
%23 = trunc i32 %22 to i8
%24 = load i8*, i8** %4
%25 = getelementptr inbounds i8, i8* %24, i64 1
store i8 %23, i8* %25
%26 = load i32, i32* %3
%27 = ashr i32 %26, 8
%28 = and i32 %27, 255
%29 = trunc i32 %28 to i8
%30 = load i8*, i8** %4
%31 = getelementptr inbounds i8, i8* %30, i64 2
store i8 %29, i8* %31
%32 = load i32, i32* %3
%33 = and i32 %32, 255
%34 = trunc i32 %33 to i8
%35 = load i8*, i8** %4
%36 = getelementptr inbounds i8, i8* %35, i64 3
store i8 %34, i8* %36
ret void
}

LLVM IR (-O2):
define void @int_char(i32 %0, i8* nocapture writeonly %1) {
%3 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%4 = lshr i32 %0, 24
%5 = and i32 %4, 128
%6 = lshr i32 %3, 24
%7 = or i32 %6, %5
%8 = trunc i32 %7 to i8
store i8 %8, i8* %1
%9 = lshr i32 %3, 16
%10 = trunc i32 %9 to i8
%11 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %10, i8* %11
%12 = lshr i32 %3, 8
%13 = trunc i32 %12 to i8
%14 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %13, i8* %14
%15 = trunc i32 %3 to i8
%16 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %15, i8* %16
ret void
}
int getPrecedence(char opt) {
  switch (opt) {
  case '^':
    return 3;
    break;
  case '*':
  case '/':
    return 2;
    break;
  case '+':
  case '-':
    return 1;
    break;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<getPrecedence>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x2a,%eax
je     116f <getPrecedence+0x6f>
jmp    111f <getPrecedence+0x1f>
mov    -0xc(%rbp),%eax
sub    $0x2b,%eax
je     117b <getPrecedence+0x7b>
jmp    1130 <getPrecedence+0x30>
mov    -0xc(%rbp),%eax
sub    $0x2d,%eax
je     117b <getPrecedence+0x7b>
jmp    1141 <getPrecedence+0x41>
mov    -0xc(%rbp),%eax
sub    $0x2f,%eax
je     116f <getPrecedence+0x6f>
jmp    1152 <getPrecedence+0x52>
mov    -0xc(%rbp),%eax
sub    $0x5e,%eax
jne    1187 <getPrecedence+0x87>
jmp    1163 <getPrecedence+0x63>
movl   $0x3,-0x4(%rbp)
jmp    118e <getPrecedence+0x8e>
movl   $0x2,-0x4(%rbp)
jmp    118e <getPrecedence+0x8e>
movl   $0x1,-0x4(%rbp)
jmp    118e <getPrecedence+0x8e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getPrecedence>:
lea    -0x2a(%rdi),%eax
cmp    $0x5,%eax
ja     1125 <getPrecedence+0x25>
lea    0xef1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x2,%eax
ret
mov    $0x1,%eax
jmp    112f <getPrecedence+0x2f>
mov    $0x3,%eax
cmp    $0x5e,%edi
jne    1130 <getPrecedence+0x30>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @getPrecedence(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %9 [
i32 94, label %6
i32 42, label %7
i32 47, label %7
i32 43, label %8
i32 45, label %8
]
6: ; preds = %1
store i32 3, i32* %2
br label %10
7: ; preds = %1, %1
store i32 2, i32* %2
br label %10
8: ; preds = %1, %1
store i32 1, i32* %2
br label %10
9: ; preds = %1
store i32 0, i32* %2
br label %10
10: ; preds = %9, %8, %7, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @getPrecedence(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %5 [
i32 94, label %6
i32 42, label %3
i32 47, label %3
i32 43, label %4
i32 45, label %4
]
3: ; preds = %1, %1
br label %6
4: ; preds = %1, %1
br label %6
5: ; preds = %1
br label %6
6: ; preds = %1, %5, %4, %3
%7 = phi i32 [ 0, %5 ], [ 1, %4 ], [ 2, %3 ], [ 3, %1 ]
ret i32 %7
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int write_target_solutions(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(17, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<write_target_solutions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x11,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_target_solutions>:
mov    $0x11,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc@plt>

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

LLVM IR (-O2):
define i32 @write_target_solutions() {
%1 = tail call i32 @_ada_use_c2phc(i32 17, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
int op_len(const char *re) {
  return re[0] == '\\' && re[1] == 'x' ? 4 : re[0] == '\\' ? 2 : 1;
}


x86 assembly (clang, -O0):
<op_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
jne    1136 <op_len+0x36>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x78,%eax
jne    1136 <op_len+0x36>
mov    $0x4,%eax
mov    %eax,-0xc(%rbp)
jmp    1150 <op_len+0x50>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
mov    $0x1,%eax
mov    $0x2,%ecx
cmp    $0x5c,%edx
cmove  %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_len>:
mov    $0x1,%ecx
cmpb   $0x5c,(%rdi)
jne    111a <op_len+0x1a>
mov    $0x2,%ecx
mov    $0x4,%eax
cmpb   $0x78,0x1(%rdi)
je     111c <op_len+0x1c>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @op_len(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 92
br i1 %7, label %8, label %15
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 120
br i1 %13, label %14, label %15
14: ; preds = %8
br label %23
15: ; preds = %8, %1
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i64 0
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 92
%21 = zext i1 %20 to i64
%22 = select i1 %20, i32 2, i32 1
br label %23
23: ; preds = %15, %14
%24 = phi i32 [ 4, %14 ], [ %22, %15 ]
ret i32 %24
}

LLVM IR (-O2):
define i32 @op_len(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 92
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 120
br i1 %7, label %10, label %8
8: ; preds = %4, %1
%9 = phi i32 [ 2, %4 ], [ 1, %1 ]
br label %10
10: ; preds = %4, %8
%11 = phi i32 [ %9, %8 ], [ 4, %4 ]
ret i32 %11
}
signed int sext16(p) signed short *p;
{ return *p; }


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

x86 assembly (clang, -O2):
<sext16>:
movswl (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @sext16(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @sext16(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = sext i16 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ errClear(int *);
void err_clear_(int *const STATUS) {
  int status;
  errClear(&status);
  *STATUS = status;
}


x86 assembly (clang, -O0):
<err_clear_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <errClear@plt>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<err_clear_>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xc(%rsp),%rdi
call   1030 <errClear@plt>
mov    0xc(%rsp),%eax
mov    %eax,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define void @err_clear_(i32* nocapture writeonly %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @errClear(i32* %2)
%5 = load i32, i32* %2
store i32 %5, i32* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ size_put(size_t const, int /*<<< orphan*/ *);
void std_size_str(const void *restrict self, const char *restrict format,
                  FILE *restrict stream) {
  (void)format;
  if (self)
    size_put(*(const size_t *)self, stream);
}


x86 assembly (clang, -O0):
<std_size_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113f <std_size_str+0x2f>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <size_put@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<std_size_str>:
test   %rdi,%rdi
je     1120 <std_size_str+0x10>
mov    (%rdi),%rdi
mov    %rdx,%rsi
jmp    1030 <size_put@plt>
ret

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

LLVM IR (-O2):
define void @std_size_str(i8* noalias %0, i8* noalias nocapture readnone %1, i32* noalias %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %9, label %5
5: ; preds = %3
%6 = bitcast i8* %0 to i64*
%7 = load i64, i64* %6
%8 = tail call i32 @size_put(i64 %7, i32* %2)
br label %9
9: ; preds = %5, %3
ret void
}
int f0(void) {}


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

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

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

LLVM IR (-O2):
define i32 @f0() {
ret i32 undef
}
/* Type definitions */
struct yaffs_obj {
  int dummy;
};

/* Variables and functions */
struct yaffs_obj *yaffsfs_HandleToObject(int);
struct yaffs_obj *yaffs_get_obj_from_fd(int handle) {
  return yaffsfs_HandleToObject(handle);
}


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

x86 assembly (clang, -O2):
<yaffs_get_obj_from_fd>:
jmp    1030 <yaffsfs_HandleToObject@plt>

LLVM IR (-O0):
%struct.yaffs_obj = type { i32 }
define %struct.yaffs_obj* @yaffs_get_obj_from_fd(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call %struct.yaffs_obj* @yaffsfs_HandleToObject(i32 %3)
ret %struct.yaffs_obj* %4
}

LLVM IR (-O2):
%struct.yaffs_obj = type { i32 }
define %struct.yaffs_obj* @yaffs_get_obj_from_fd(i32 %0) {
%2 = tail call %struct.yaffs_obj* @yaffsfs_HandleToObject(i32 %0)
ret %struct.yaffs_obj* %2
}
const char *strna(const char *s) { return s ?: "n/a"; }


x86 assembly (clang, -O0):
<strna>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1127 <strna+0x27>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1137 <strna+0x37>
lea    0xed2(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1137 <strna+0x37>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strna>:
test   %rdi,%rdi
lea    0xef6(%rip),%rax
cmovne %rdi,%rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"n/a\00"
define i8* @strna(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 %6
5: ; preds = %1
br label %7
6: ; preds = %1
br label %7
7: ; preds = %6, %5
%8 = phi i8* [ %3, %5 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), %6 ]
ret i8* %8
}

LLVM IR (-O2):
@.str = [4 x i8] c"n/a\00"
define i8* @strna(i8* readnone %0) {
%2 = icmp eq i8* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0
ret i8* %3
}
/* Variables and functions */
bool _zf_test_bool(const bool v) { return v; }


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

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

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

LLVM IR (-O2):
define i32 @_zf_test_bool(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ pause();
int main(void) {
  char *addr = malloc(4096 * 100);
  pause();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <pause@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* @malloc(i32 409600)
store i8* %3, i8** %2
%4 = call i32 (...) @pause()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @pause()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int dup(int oldfd) {
  _exit(-1);
  return -1;
}


x86 assembly (clang, -O0):
<dup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xffffffff,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<dup>:
push   %rax
mov    $0xffffffff,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define i32 @dup(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_exit(i32 -1)
unreachable
}

LLVM IR (-O2):
define i32 @dup(i32 %0) {
%2 = tail call i32 @_exit(i32 -1)
unreachable
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ read_args(int, char **);
int /*<<< orphan*/ read_jobs();
int /*<<< orphan*/ start_scheduler();
int main(int argc, char *argv[]) {
  read_args(argc, argv);
  read_jobs();
  start_scheduler();
  return EXIT_SUCCESS;
}


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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <read_args@plt>
mov    $0x0,%al
call   1040 <read_jobs@plt>
mov    $0x0,%al
call   1030 <start_scheduler@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1050 <read_args@plt>
xor    %eax,%eax
call   1040 <read_jobs@plt>
xor    %eax,%eax
call   1030 <start_scheduler@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = 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 @read_args(i32 %6, i8** %7)
%9 = call i32 (...) @read_jobs()
%10 = call i32 (...) @start_scheduler()
%11 = load i32, i32* @EXIT_SUCCESS
ret i32 %11
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @read_args(i32 %0, i8** %1)
%4 = tail call i32 (...) @read_jobs()
%5 = tail call i32 (...) @start_scheduler()
%6 = load i32, i32* @EXIT_SUCCESS
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ setFmSnrRssi(unsigned short, unsigned short);
int /*<<< orphan*/ si475xFMRX_initialize();
void si47xxFMRX_initialize(int rssi, int snr) {
  setFmSnrRssi((unsigned short)rssi, (unsigned short)snr);
  si475xFMRX_initialize();
}


x86 assembly (clang, -O0):
<si47xxFMRX_initialize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %ax,%cx
mov    -0x8(%rbp),%eax
movzwl %cx,%edi
movzwl %ax,%esi
call   1040 <setFmSnrRssi@plt>
mov    $0x0,%al
call   1030 <si475xFMRX_initialize@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<si47xxFMRX_initialize>:
push   %rax
movzwl %di,%edi
movzwl %si,%esi
call   1040 <setFmSnrRssi@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <si475xFMRX_initialize@plt>

LLVM IR (-O0):
define void @si47xxFMRX_initialize(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = trunc i32 %5 to i16
%7 = load i32, i32* %4
%8 = trunc i32 %7 to i16
%9 = call i32 @setFmSnrRssi(i16 zeroext %6, i16 zeroext %8)
%10 = call i32 (...) @si475xFMRX_initialize()
ret void
}

LLVM IR (-O2):
define void @si47xxFMRX_initialize(i32 %0, i32 %1) {
%3 = trunc i32 %0 to i16
%4 = trunc i32 %1 to i16
%5 = tail call i32 @setFmSnrRssi(i16 zeroext %3, i16 zeroext %4)
%6 = tail call i32 (...) @si475xFMRX_initialize()
ret void
}
const char *metisAbout_LongNotice(void) {
  return "Copyright (c) 2017 Cisco and/or its affiliates.\nLicensed under the "
         "Apache License, Version 2.0 (the \"License\");\nyou may not use this "
         "file except in compliance with the License.\nYou may obtain a copy "
         "of the License at:\n\n    "
         "http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by "
         "applicable law or agreed to in writing, software\ndistributed under "
         "the License is distributed on an \"AS IS\" BASIS,\nWITHOUT "
         "WARRANTIES OR CONDITIONS OF ANY KIND, either express or "
         "implied.\nSee the License for the specific language governing "
         "permissions and\nlimitations under the License.\n";
}


x86 assembly (clang, -O0):
<metisAbout_LongNotice>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<metisAbout_LongNotice>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [574 x i8] c"Copyright (c) 2017 Cisco and/or its affiliates.\0ALicensed under the Apache License, Version 2.0 (the \22License\22);\0Ayou may not use this file except in compliance with the License.\0AYou may obtain a copy of the License at:\0A\0A http://www.apache.org/licenses/LICENSE-2.0\0A\0AUnless required by applicable law or agreed to in writing, software\0Adistributed under the License is distributed on an \22AS IS\22 BASIS,\0AWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\0ASee the License for the specific language governing permissions and\0Alimitations under the License.\0A\00"
define i8* @metisAbout_LongNotice() {
ret i8* getelementptr inbounds ([574 x i8], [574 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [574 x i8] c"Copyright (c) 2017 Cisco and/or its affiliates.\0ALicensed under the Apache License, Version 2.0 (the \22License\22);\0Ayou may not use this file except in compliance with the License.\0AYou may obtain a copy of the License at:\0A\0A http://www.apache.org/licenses/LICENSE-2.0\0A\0AUnless required by applicable law or agreed to in writing, software\0Adistributed under the License is distributed on an \22AS IS\22 BASIS,\0AWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\0ASee the License for the specific language governing permissions and\0Alimitations under the License.\0A\00"
define i8* @metisAbout_LongNotice() {
ret i8* getelementptr inbounds ([574 x i8], [574 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ pass_doubles(double);
void call_doubles(double a, double b) { pass_doubles(b); }


x86 assembly (clang, -O0):
<call_doubles>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <pass_doubles@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_doubles>:
movaps %xmm1,%xmm0
jmp    1030 <pass_doubles@plt>

LLVM IR (-O0):
define void @call_doubles(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = call i32 @pass_doubles(double %5)
ret void
}

LLVM IR (-O2):
define void @call_doubles(double %0, double %1) {
%3 = tail call i32 @pass_doubles(double %1)
ret void
}
/* Variables and functions */
double __dacosd(double);
double intr_wrap_005(double p1) { return __dacosd(p1); }


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

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

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

LLVM IR (-O2):
define double @intr_wrap_005(double %0) {
%2 = tail call double @__dacosd(double %0)
ret double %2
}
void TestIndirectCall(void) {
  extern void (*IndirectCallTarget)(void);
  IndirectCallTarget();
}


x86 assembly (clang, -O0):
<TestIndirectCall>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
call   *(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<TestIndirectCall>:
mov    0x2ee1(%rip),%rax
jmp    *(%rax)

LLVM IR (-O0):
@IndirectCallTarget = external global void ()*
define void @TestIndirectCall() {
%1 = load void ()*, void ()** @IndirectCallTarget
ret void
}

LLVM IR (-O2):
@IndirectCallTarget = external global void ()*
define void @TestIndirectCall() {
%1 = load void ()*, void ()** @IndirectCallTarget
tail call void %1()
ret void
}
__attribute__((weak)) int
arch_load_dynsymtab_noplt(struct symtab *dsymtab, struct uftrace_elf_data *elf,
                          unsigned long offset, unsigned long flags) {
  return 0;
}


x86 assembly (clang, -O0):
<arch_load_dynsymtab_noplt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.symtab = type opaque
%struct.uftrace_elf_data = type opaque
define weak i32 @arch_load_dynsymtab_noplt(%struct.symtab* %0, %struct.uftrace_elf_data* %1, i64 %2, i64 %3) {
%5 = alloca %struct.symtab*
%6 = alloca %struct.uftrace_elf_data*
%7 = alloca i64
%8 = alloca i64
store %struct.symtab* %0, %struct.symtab** %5
store %struct.uftrace_elf_data* %1, %struct.uftrace_elf_data** %6
store i64 %2, i64* %7
store i64 %3, i64* %8
ret i32 0
}

LLVM IR (-O2):
%struct.symtab = type opaque
%struct.uftrace_elf_data = type opaque
define weak i32 @arch_load_dynsymtab_noplt(%struct.symtab* %0, %struct.uftrace_elf_data* %1, i64 %2, i64 %3) {
ret i32 0
}