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

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fopen(char const *, char const *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *);
int /*<<< orphan*/ stderr;
FILE *Fopen(const char *path, const char *mode) {
  FILE *file = fopen(path, mode);
  if (file == NULL) {
    fprintf(stderr, "Error opening file %s with mode %s.\n", path, mode);
    exit(1);
  }
  return file;
}


x86 assembly (clang, -O0):
<Fopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1183 <Fopen+0x53>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe8c(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Fopen>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <fopen@plt>
test   %rax,%rax
je     114c <Fopen+0x1c>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
lea    0xea4(%rip),%rsi
mov    %rbx,%rdx
mov    %r14,%rcx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"Error opening file %s with mode %s.\0A\00"
define i32* @Fopen(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32* @fopen(i8* %6, i8* %7)
store i32* %8, i32** %5
%9 = load i32*, i32** %5
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %17
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = load i8*, i8** %3
%14 = load i8*, i8** %4
%15 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %13, i8* %14)
%16 = call i32 @exit(i32 1)
unreachable
17: ; preds = %2
%18 = load i32*, i32** %5
ret i32* %18
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"Error opening file %s with mode %s.\0A\00"
define noalias i32* @Fopen(i8* %0, i8* %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
ret i32* %3
}
/* Variables and functions */
int getppid();
int /*<<< orphan*/ printf(char *, int);
void cmd_getppid(int argc, char *argv[]) { printf("%i\n", getppid()); }


x86 assembly (clang, -O0):
<cmd_getppid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getppid@plt>
mov    %eax,%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_getppid>:
push   %rax
xor    %eax,%eax
call   1040 <getppid@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%i\0A\00"
define void @cmd_getppid(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @getppid()
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%i\0A\00"
define void @cmd_getppid(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @getppid()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
void I2CMasterIntDisableEx(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000010))) &= ~ui32IntFlags;
}


x86 assembly (clang, -O0):
<I2CMasterIntDisableEx>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rcx
and    %rdx,%rcx
mov    %rcx,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CMasterIntDisableEx>:
mov    %rdi,-0x8(%rsp)
mov    %rsi,-0x10(%rsp)
mov    -0x10(%rsp),%rax
not    %rax
mov    -0x8(%rsp),%rcx
and    %rax,0x10(%rcx)
ret

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

LLVM IR (-O2):
define void @I2CMasterIntDisableEx(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = xor i64 %5, -1
%7 = load volatile i64, i64* %3
%8 = add i64 %7, 16
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, %6
store volatile i64 %11, i64* %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
__attribute__((__noreturn__)) void __VERIFIER_error() {
  fprintf(stderr, "__VERIFIER_error(): Called\n");
  abort();
}


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

x86 assembly (clang, -O2):
<__VERIFIER_error>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"__VERIFIER_error(): Called\0A\00"
define void @__VERIFIER_error() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"__VERIFIER_error(): Called\0A\00"
define void @__VERIFIER_error() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sig_alrm(int signo) { printf("alarm signal handle\n"); }


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

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

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

LLVM IR (-O2):
@str = [20 x i8] c"alarm signal handle\00"
define void @sig_alrm(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
typedef int /*<<< orphan*/ sem_t;

/* Variables and functions */
int /*<<< orphan*/ malloc32(int);
int /*<<< orphan*/ sem_init(int /*<<< orphan*/ *, int /*<<< orphan*/,
                            int /*<<< orphan*/);
int /*<<< orphan*/ *vaddr_to_ptr(int /*<<< orphan*/);
sem_t *OSSemCreate(uint16_t count) {
  sem_t *event = vaddr_to_ptr(malloc32(sizeof(sem_t)));
  if (!event)
    return NULL;
  sem_init(event, 0, count);
  return event;
}


x86 assembly (clang, -O0):
<OSSemCreate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    $0x4,%edi
call   1040 <malloc32@plt>
mov    %eax,%edi
call   1030 <vaddr_to_ptr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1168 <OSSemCreate+0x38>
movq   $0x0,-0x8(%rbp)
jmp    117e <OSSemCreate+0x4e>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%edx
xor    %esi,%esi
call   1050 <sem_init@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OSSemCreate>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x4,%edi
call   1040 <malloc32@plt>
mov    %eax,%edi
call   1030 <vaddr_to_ptr@plt>
mov    %rax,%rbx
test   %rax,%rax
je     115a <OSSemCreate+0x2a>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %ebp,%edx
call   1050 <sem_init@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32* @OSSemCreate(i32 %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
%5 = call i32 @malloc32(i32 4)
%6 = call i32* @vaddr_to_ptr(i32 %5)
store i32* %6, i32** %4
%7 = load i32*, i32** %4
%8 = icmp ne i32* %7, null
br i1 %8, label %10, label %9
9: ; preds = %1
store i32* null, i32** %2
br label %15
10: ; preds = %1
%11 = load i32*, i32** %4
%12 = load i32, i32* %3
%13 = call i32 @sem_init(i32* %11, i32 0, i32 %12)
%14 = load i32*, i32** %4
store i32* %14, i32** %2
br label %15
15: ; preds = %10, %9
%16 = load i32*, i32** %2
ret i32* %16
}

LLVM IR (-O2):
define i32* @OSSemCreate(i32 %0) {
%2 = tail call i32 @malloc32(i32 4)
%3 = tail call i32* @vaddr_to_ptr(i32 %2)
%4 = icmp eq i32* %3, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @sem_init(i32* %3, i32 0, i32 %0)
br label %7
7: ; preds = %1, %5
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRCORE_N16_swap(char *, int, int);
void U_WMRSETROP2_swap(char *record, int torev) {
  U_WMRCORE_N16_swap(record, 1, torev);
}


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

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

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

LLVM IR (-O2):
define void @U_WMRSETROP2_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRCORE_N16_swap(i8* %0, i32 1, i32 %1)
ret void
}
int has_cpuid(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @has_cpuid() {
ret i32 1
}

LLVM IR (-O2):
define i32 @has_cpuid() {
ret i32 1
}
/* Type definitions */
struct fb_params {
  int dummy;
};
struct fastbuf {
  int dummy;
};

/* Variables and functions */
struct fastbuf *bopen_fd_name(int, struct fb_params *, int /*<<< orphan*/ *);
struct fastbuf *bopen_fd(int fd, struct fb_params *params) {
  return bopen_fd_name(fd, params, NULL);
}


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

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

LLVM IR (-O0):
%struct.fastbuf = type { i32 }
%struct.fb_params = type { i32 }
define %struct.fastbuf* @bopen_fd(i32 %0, %struct.fb_params* %1) {
%3 = alloca i32
%4 = alloca %struct.fb_params*
store i32 %0, i32* %3
store %struct.fb_params* %1, %struct.fb_params** %4
%5 = load i32, i32* %3
%6 = load %struct.fb_params*, %struct.fb_params** %4
%7 = call %struct.fastbuf* @bopen_fd_name(i32 %5, %struct.fb_params* %6, i32* null)
ret %struct.fastbuf* %7
}

LLVM IR (-O2):
%struct.fastbuf = type { i32 }
%struct.fb_params = type { i32 }
define %struct.fastbuf* @bopen_fd(i32 %0, %struct.fb_params* %1) {
%3 = tail call %struct.fastbuf* @bopen_fd_name(i32 %0, %struct.fb_params* %1, i32* null)
ret %struct.fastbuf* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, double);
int /*<<< orphan*/ sscanf(char *, char *, double *);
double poor_mans_trunc(double x) {
  char buf[16];
  snprintf(buf, sizeof(buf), "%.6f", x);
  sscanf(buf, "%lf", &x);
  return x;
}


x86 assembly (clang, -O0):
<poor_mans_trunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
movsd  -0x8(%rbp),%xmm0
mov    $0x10,%esi
lea    0xebe(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x20(%rbp),%rdi
lea    0xeb3(%rip),%rsi
lea    -0x8(%rbp),%rdx
call   1040 <sscanf@plt>
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<poor_mans_trunc>:
push   %rbx
sub    $0x20,%rsp
movsd  %xmm0,0x8(%rsp)
lea    0xece(%rip),%rdx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x10,%esi
call   1030 <snprintf@plt>
lea    0xeba(%rip),%rsi
lea    0x8(%rsp),%rdx
mov    %rbx,%rdi
call   1040 <sscanf@plt>
movsd  0x8(%rsp),%xmm0
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%.6f\00"
@.str.1 = [4 x i8] c"%lf\00"
define double @poor_mans_trunc(double %0) {
%2 = alloca double
%3 = alloca [16 x i8]
store double %0, double* %2
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%5 = load double, double* %2
%6 = call i32 @snprintf(i8* %4, i32 16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %5)
%7 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%8 = call i32 @sscanf(i8* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%9 = load double, double* %2
ret double %9
}

LLVM IR (-O2):
@.str = [5 x i8] c"%.6f\00"
@.str.1 = [4 x i8] c"%lf\00"
define double @poor_mans_trunc(double %0) {
%2 = alloca double
%3 = alloca [16 x i8]
store double %0, double* %2
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %0)
%6 = call i32 @sscanf(i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%7 = load double, double* %2
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ CALC_appendString(char *);
void CALC_addPow() { CALC_appendString("^"); }


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"^\00"
define void @CALC_addPow() {
%1 = tail call i32 @CALC_appendString(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
int cls_cmd() {
  printf("\033[2J");
  fflush(stdout);
  return 0;
}


x86 assembly (clang, -O0):
<cls_cmd>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cls_cmd>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[2J\00"
@stdout = global i32 0
define i32 @cls_cmd() {
%1 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = call i32 @fflush(i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[2J\00"
@stdout = global i32 0
define i32 @cls_cmd() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SIOCGIFNAME;
int errno;
scalar_t__ ioctl(int, int /*<<< orphan*/, char *);
int os_get_ifname(int fd, char *namebuf) {
  if (ioctl(fd, SIOCGIFNAME, namebuf) < 0)
    return -errno;
  return 0;
}


x86 assembly (clang, -O0):
<os_get_ifname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eb7(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
call   1030 <ioctl@plt>
cmp    $0x0,%rax
jge    1151 <os_get_ifname+0x41>
xor    %eax,%eax
mov    0x2e91(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <os_get_ifname+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_get_ifname>:
push   %rax
mov    %rsi,%rdx
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
call   1030 <ioctl@plt>
mov    0x2eaf(%rip),%rcx
xor    %edx,%edx
sub    (%rcx),%edx
sar    $0x3f,%rax
and    %edx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@SIOCGIFNAME = global i32 0
@errno = global i32 0
define i32 @os_get_ifname(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
%6 = load i32, i32* %4
%7 = load i32, i32* @SIOCGIFNAME
%8 = load i8*, i8** %5
%9 = call i64 @ioctl(i32 %6, i32 %7, i8* %8)
%10 = icmp slt i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i32, i32* @errno
%13 = sub nsw i32 0, %12
store i32 %13, i32* %3
br label %15
14: ; preds = %2
store i32 0, i32* %3
br label %15
15: ; preds = %14, %11
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@SIOCGIFNAME = global i32 0
@errno = global i32 0
define i32 @os_get_ifname(i32 %0, i8* %1) {
%3 = load i32, i32* @SIOCGIFNAME
%4 = tail call i64 @ioctl(i32 %0, i32 %3, i8* %1)
%5 = icmp slt i64 %4, 0
%6 = load i32, i32* @errno
%7 = sub nsw i32 0, %6
%8 = select i1 %5, i32 %7, i32 0
ret i32 %8
}
/* Type definitions */
struct routing_table {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct routing_table *);
void pirq_free_table(struct routing_table *table) { free(table); }


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

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

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

LLVM IR (-O2):
%struct.routing_table = type { i32 }
define void @pirq_free_table(%struct.routing_table* nocapture %0) {
%2 = tail call i32 @free(%struct.routing_table* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ tokenise(char *);
int main() {
  char *foo = NULL;
  foo = "select _col1, col2, colC from test where city = \"Auckland\" ;";
  tokenise(foo);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [61 x i8] c"select _col1, col2, colC from test where city = \22Auckland\22 ;\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* null, i8** %2
store i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @tokenise(i8* %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [61 x i8] c"select _col1, col2, colC from test where city = \22Auckland\22 ;\00"
define i32 @main() {
%1 = tail call i32 @tokenise(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ remove(char *);
int /*<<< orphan*/ signal(int /*<<< orphan*/, void (*)(int));
void sigintHandler(int sig_num) {
  signal(SIGINT, sigintHandler);
  printf("\b\b\b\b\b\b");
  remove("./tmp.f90");
  remove("./a.out");
  exit(0);
}


x86 assembly (clang, -O0):
<sigintHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
mov    0x2e8d(%rip),%rsi
call   1050 <signal@plt>
lea    0xe99(%rip),%rdi
call   1040 <printf@plt>
lea    0xe94(%rip),%rdi
call   1030 <remove@plt>
lea    0xe92(%rip),%rdi
call   1030 <remove@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<sigintHandler>:
push   %rax
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
mov    0x2e97(%rip),%rsi
call   1050 <signal@plt>
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
lea    0xe9e(%rip),%rdi
call   1030 <remove@plt>
lea    0xe9c(%rip),%rdi
call   1030 <remove@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@SIGINT = global i32 0
@.str = [7 x i8] c"\08\08\08\08\08\08\00"
@.str.1 = [10 x i8] c"./tmp.f90\00"
@.str.2 = [8 x i8] c"./a.out\00"
define void @sigintHandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @SIGINT
%4 = call i32 @signal(i32 %3, void (i32)* @sigintHandler)
%5 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @remove(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @remove(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@SIGINT = global i32 0
@.str = [7 x i8] c"\08\08\08\08\08\08\00"
@.str.1 = [10 x i8] c"./tmp.f90\00"
@.str.2 = [8 x i8] c"./a.out\00"
define void @sigintHandler(i32 %0) {
%2 = load i32, i32* @SIGINT
%3 = tail call i32 @signal(i32 %2, void (i32)* @sigintHandler)
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @remove(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @remove(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%7 = tail call i32 @exit(i32 0)
unreachable
}
void XtNoticeSignal() {}


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

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

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

LLVM IR (-O2):
define void @XtNoticeSignal() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct cmsghdr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ *option_alloc(struct cmsghdr *, int, int, int);
uint8_t *inet6_option_alloc(struct cmsghdr *cmsg, int datalen, int multx,
                            int plusy) {
  return option_alloc(cmsg, datalen, multx, plusy);
}


x86 assembly (clang, -O0):
<inet6_option_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1030 <option_alloc@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.cmsghdr = type { i32 }
define i32* @inet6_option_alloc(%struct.cmsghdr* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca %struct.cmsghdr*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store %struct.cmsghdr* %0, %struct.cmsghdr** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load %struct.cmsghdr*, %struct.cmsghdr** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32* @option_alloc(%struct.cmsghdr* %9, i32 %10, i32 %11, i32 %12)
ret i32* %13
}

LLVM IR (-O2):
%struct.cmsghdr = type { i32 }
define i32* @inet6_option_alloc(%struct.cmsghdr* %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32* @option_alloc(%struct.cmsghdr* %0, i32 %1, i32 %2, i32 %3)
ret i32* %5
}
void *coll_nop_duper(const void *item, const void *xtra) { return item; }


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

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

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

LLVM IR (-O2):
define i8* @coll_nop_duper(i8* readnone returned %0, i8* nocapture readnone %1) {
ret i8* %0
}
/* Type definitions */
struct timespec {
  unsigned long long tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
unsigned long long int CurrentTime() {
  struct timespec ts;
  clock_gettime(CLOCK_MONOTONIC, &ts);
  return (long long int)ts.tv_sec * 1000000000 + ts.tv_nsec;
}


x86 assembly (clang, -O0):
<CurrentTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x3b9aca00,-0x8(%rbp),%rax
3b
add    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CurrentTime>:
sub    $0x18,%rsp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x3b9aca00,0x10(%rsp),%rax
9a 3b
add    0x8(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
@CLOCK_MONOTONIC = global i32 0
define i64 @CurrentTime() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_MONOTONIC
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%5 = load i64, i64* %4
%6 = mul nsw i64 %5, 1000000000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%8 = load i64, i64* %7
%9 = add i64 %6, %8
ret i64 %9
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
@CLOCK_MONOTONIC = global i32 0
define i64 @CurrentTime() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%6 = load i64, i64* %5
%7 = mul nsw i64 %6, 1000000000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%9 = load i64, i64* %8
%10 = add i64 %7, %9
ret i64 %10
}
/* Type definitions */
struct UPnPService {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, unsigned int);
void MSCP_ResponseSink_ContentDirectory_GetSystemUpdateID(
    struct UPnPService *Service, int ErrorCode, void *User, unsigned int Id) {
  printf("MSCP_ Invoke Response: "
         "ContentDirectory/GetSystemUpdateID[ErrorCode:%d](%u)\r\n",
         ErrorCode, Id);
}


x86 assembly (clang, -O0):
<MSCP_ResponseSink_ContentDirectory_GetSystemUpdateID>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x1c(%rbp),%edx
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.UPnPService = type { i32 }
@.str = [78 x i8] c"MSCP_ Invoke Response: ContentDirectory/GetSystemUpdateID[ErrorCode:%d](%u)\0D\0A\00"
define void @MSCP_ResponseSink_ContentDirectory_GetSystemUpdateID(%struct.UPnPService* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca %struct.UPnPService*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store %struct.UPnPService* %0, %struct.UPnPService** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = load i32, i32* %8
%11 = call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10)
ret void
}

LLVM IR (-O2):
%struct.UPnPService = type { i32 }
@.str = [78 x i8] c"MSCP_ Invoke Response: ContentDirectory/GetSystemUpdateID[ErrorCode:%d](%u)\0D\0A\00"
define void @MSCP_ResponseSink_ContentDirectory_GetSystemUpdateID(%struct.UPnPService* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i32 %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %3)
ret void
}
/* Variables and functions */
long long xor_ll(long long *, long long *);
long long intr_wrap_535(long long p1, long long p2) { return xor_ll(&p1, &p2); }


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

x86 assembly (clang, -O2):
<intr_wrap_535>:
sub    $0x18,%rsp
mov    %rdi,0x10(%rsp)
mov    %rsi,0x8(%rsp)
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <xor_ll@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i64 @intr_wrap_535(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = call i64 @xor_ll(i64* %3, i64* %4)
ret i64 %5
}
int _geq(int x, int y, void *garb) { return x >= y; }


x86 assembly (clang, -O0):
<_geq>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setge  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_geq>:
xor    %eax,%eax
cmp    %esi,%edi
setge  %al
ret

LLVM IR (-O0):
define i32 @_geq(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = icmp sge i32 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @_geq(i32 %0, i32 %1, i8* nocapture readnone %2) {
%4 = icmp sge i32 %0, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ scrypt_1024_1_1_256_sp(char const *, char *, char *);
void scrypt_1024_1_1_256(const char *input, char *output) {
  char scratchpad[131583];
  scrypt_1024_1_1_256_sp(input, output, scratchpad);
}


x86 assembly (clang, -O0):
<scrypt_1024_1_1_256>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20210,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x20210(%rbp),%rdx
call   1030 <scrypt_1024_1_1_256_sp@plt>
add    $0x20210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scrypt_1024_1_1_256>:
sub    $0x20208,%rsp
mov    %rsp,%rdx
call   1030 <scrypt_1024_1_1_256_sp@plt>
add    $0x20208,%rsp
ret

LLVM IR (-O0):
define void @scrypt_1024_1_1_256(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [131583 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = getelementptr inbounds [131583 x i8], [131583 x i8]* %5, i64 0, i64 0
%9 = call i32 @scrypt_1024_1_1_256_sp(i8* %6, i8* %7, i8* %8)
ret void
}

LLVM IR (-O2):
define void @scrypt_1024_1_1_256(i8* %0, i8* %1) {
%3 = alloca [131583 x i8]
%4 = getelementptr inbounds [131583 x i8], [131583 x i8]* %3, i64 0, i64 0
%5 = call i32 @scrypt_1024_1_1_256_sp(i8* %0, i8* %1, i8* %4)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int _Nios2_Get_ctlreg_config();
int /*<<< orphan*/ _Nios2_Set_ctlreg_config(int);
uint32_t _Nios2_MPU_Disable(void) {
  uint32_t config = _Nios2_Get_ctlreg_config();
  uint32_t config_pe = (1 << 0);
  _Nios2_Set_ctlreg_config(config & ~config_pe);
  return config;
}


x86 assembly (clang, -O0):
<_Nios2_MPU_Disable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <_Nios2_Get_ctlreg_config@plt>
mov    %eax,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
and    %eax,%edi
call   1040 <_Nios2_Set_ctlreg_config@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_Nios2_MPU_Disable>:
push   %rbx
xor    %eax,%eax
call   1030 <_Nios2_Get_ctlreg_config@plt>
mov    %eax,%ebx
mov    %eax,%edi
and    $0xfffffffe,%edi
call   1040 <_Nios2_Set_ctlreg_config@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @_Nios2_MPU_Disable() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @_Nios2_Get_ctlreg_config()
store i32 %3, i32* %1
store i32 1, i32* %2
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = xor i32 %5, -1
%7 = and i32 %4, %6
%8 = call i32 @_Nios2_Set_ctlreg_config(i32 %7)
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @_Nios2_MPU_Disable() {
%1 = tail call i32 (...) @_Nios2_Get_ctlreg_config()
%2 = and i32 %1, -2
%3 = tail call i32 @_Nios2_Set_ctlreg_config(i32 %2)
ret i32 %1
}
/* Variables and functions */
int PTHREAD_CANCEL_ASYNCHRONOUS;
int __libc_pause();
int /*<<< orphan*/ pthread_setcanceltype(int, int *);
int __attribute__((weak)) pause(void) {
  int result;
  int oldtype;
  pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &oldtype);
  result = __libc_pause();
  pthread_setcanceltype(oldtype, NULL);
  return result;
}


x86 assembly (clang, -O0):
<pause>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1040 <pthread_setcanceltype@plt>
mov    $0x0,%al
call   1030 <__libc_pause@plt>
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <pthread_setcanceltype@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pause>:
push   %rbx
sub    $0x10,%rsp
mov    0x2ebc(%rip),%rax
mov    (%rax),%edi
lea    0xc(%rsp),%rsi
call   1040 <pthread_setcanceltype@plt>
xor    %eax,%eax
call   1030 <__libc_pause@plt>
mov    %eax,%ebx
mov    0xc(%rsp),%edi
xor    %esi,%esi
call   1040 <pthread_setcanceltype@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@PTHREAD_CANCEL_ASYNCHRONOUS = global i32 0
define weak i32 @pause() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* @PTHREAD_CANCEL_ASYNCHRONOUS
%4 = call i32 @pthread_setcanceltype(i32 %3, i32* %2)
%5 = call i32 (...) @__libc_pause()
store i32 %5, i32* %1
%6 = load i32, i32* %2
%7 = call i32 @pthread_setcanceltype(i32 %6, i32* null)
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
@PTHREAD_CANCEL_ASYNCHRONOUS = global i32 0
define weak i32 @pause() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = load i32, i32* @PTHREAD_CANCEL_ASYNCHRONOUS
%4 = call i32 @pthread_setcanceltype(i32 %3, i32* %1)
%5 = call i32 (...) @__libc_pause()
%6 = load i32, i32* %1
%7 = call i32 @pthread_setcanceltype(i32 %6, i32* null)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ printf(char *);
void __VERIFIER_error_internal(int print) {
  if (print)
    printf("dpu: __VERIFIER_error called, calling abort()\n");
  abort();
}


x86 assembly (clang, -O0):
<__VERIFIER_error_internal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1141 <__VERIFIER_error_internal+0x21>
lea    0xec4(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<__VERIFIER_error_internal>:
push   %rax
test   %edi,%edi
je     1131 <__VERIFIER_error_internal+0x11>
lea    0xed4(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [47 x i8] c"dpu: __VERIFIER_error called, calling abort()\0A\00"
define void @__VERIFIER_error_internal(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 %5, label %7
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
%8 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@str = [46 x i8] c"dpu: __VERIFIER_error called, calling abort()\00"
define void @__VERIFIER_error_internal(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
%6 = tail call i32 (...) @abort()
unreachable
}
int do_201() { return 201; }


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

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

LLVM IR (-O0):
define i32 @do_201() {
ret i32 201
}

LLVM IR (-O2):
define i32 @do_201() {
ret i32 201
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf(".....  Done\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"..... Done\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"..... Done\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ initBridges();
int /*<<< orphan*/ mythread_init(int);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  srand(time(NULL));
  mythread_init(500);
  initBridges();
  while (1) {
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    $0x1f4,%edi
call   1060 <mythread_init@plt>
mov    $0x0,%al
call   1040 <initBridges@plt>
jmp    1170 <main+0x30>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    $0x1f4,%edi
call   1060 <mythread_init@plt>
xor    %eax,%eax
call   1040 <initBridges@plt>
jmp    1160 <main+0x20>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @time(i32* null)
%3 = call i32 @srand(i32 %2)
%4 = call i32 @mythread_init(i32 500)
%5 = call i32 (...) @initBridges()
br label %6
6: ; preds = %0, %6
br label %6
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 @mythread_init(i32 500)
%4 = tail call i32 (...) @initBridges()
br label %5
5: ; preds = %0, %5
br label %5
}
/* Type definitions */
struct vec4i {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ vec4i_lerp(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                              int /*<<< orphan*/ *, float);
__attribute__((always_)) struct vec4i *
psvec4i_lerp(struct vec4i *result, struct vec4i *a, struct vec4i *b, float p) {
  vec4i_lerp((int32_t *)result, (int32_t *)a, (int32_t *)b, p);
  return result;
}


x86 assembly (clang, -O0):
<psvec4i_lerp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movss  %xmm0,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
movss  -0x1c(%rbp),%xmm0
call   1030 <vec4i_lerp@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psvec4i_lerp>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec4i_lerp@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vec4i = type { i32 }
define %struct.vec4i* @psvec4i_lerp(%struct.vec4i* %0, %struct.vec4i* %1, %struct.vec4i* %2, float %3) {
%5 = alloca %struct.vec4i*
%6 = alloca %struct.vec4i*
%7 = alloca %struct.vec4i*
%8 = alloca float
store %struct.vec4i* %0, %struct.vec4i** %5
store %struct.vec4i* %1, %struct.vec4i** %6
store %struct.vec4i* %2, %struct.vec4i** %7
store float %3, float* %8
%9 = load %struct.vec4i*, %struct.vec4i** %5
%10 = bitcast %struct.vec4i* %9 to i32*
%11 = load %struct.vec4i*, %struct.vec4i** %6
%12 = bitcast %struct.vec4i* %11 to i32*
%13 = load %struct.vec4i*, %struct.vec4i** %7
%14 = bitcast %struct.vec4i* %13 to i32*
%15 = load float, float* %8
%16 = call i32 @vec4i_lerp(i32* %10, i32* %12, i32* %14, float %15)
%17 = load %struct.vec4i*, %struct.vec4i** %5
ret %struct.vec4i* %17
}

LLVM IR (-O2):
%struct.vec4i = type { i32 }
define %struct.vec4i* @psvec4i_lerp(%struct.vec4i* returned %0, %struct.vec4i* %1, %struct.vec4i* %2, float %3) {
%5 = getelementptr %struct.vec4i, %struct.vec4i* %0, i64 0, i32 0
%6 = getelementptr %struct.vec4i, %struct.vec4i* %1, i64 0, i32 0
%7 = getelementptr %struct.vec4i, %struct.vec4i* %2, i64 0, i32 0
%8 = tail call i32 @vec4i_lerp(i32* %5, i32* %6, i32* %7, float %3)
ret %struct.vec4i* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t fread(unsigned char *, int, int, int /*<<< orphan*/ *);
int get_short(FILE *fp) {
  unsigned char temp[2];
  size_t r = fread(temp, 1, 2, fp);
  if (r != 2)
    return -1;
  return (int)temp[0] << 8 | temp[1];
}


x86 assembly (clang, -O0):
<get_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x12(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <fread@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x2,-0x20(%rbp)
je     114e <get_short+0x3e>
movl   $0xffffffff,-0x4(%rbp)
jmp    115e <get_short+0x4e>
movzbl -0x12(%rbp),%eax
shl    $0x8,%eax
movzbl -0x11(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_short>:
push   %rax
mov    %rdi,%rcx
lea    0x6(%rsp),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <fread@plt>
movzwl 0x6(%rsp),%ecx
shl    $0x10,%ecx
cmp    $0x2,%rax
bswap  %ecx
mov    $0xffffffff,%eax
cmove  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @get_short(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca [2 x i8]
%5 = alloca i64
store i32* %0, i32** %3
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
%7 = load i32*, i32** %3
%8 = call i64 @fread(i8* %6, i32 1, i32 2, i32* %7)
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = icmp ne i64 %9, 2
br i1 %10, label %11, label %12
11: ; preds = %1
store i32 -1, i32* %2
br label %21
12: ; preds = %1
%13 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = shl i32 %15, 8
%17 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 1
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = or i32 %16, %19
store i32 %20, i32* %2
br label %21
21: ; preds = %12, %11
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @get_short(i32* nocapture %0) {
%2 = alloca [2 x i8]
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%4 = call i64 @fread(i8* %3, i32 1, i32 2, i32* %0)
%5 = icmp eq i64 %4, 2
%6 = load i8, i8* %3
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 8
%9 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = or i32 %8, %11
%13 = select i1 %5, i32 %12, i32 -1
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ GL_FOG;
int /*<<< orphan*/ glDisable(int /*<<< orphan*/);
int /*<<< orphan*/ glEnable(int /*<<< orphan*/);
extern void zlFog(unsigned char value) {
  if (value == 1)
    glEnable(GL_FOG);
  else
    glDisable(GL_FOG);
}


x86 assembly (clang, -O0):
<zlFog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x1,%eax
jne    114e <zlFog+0x2e>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
jmp    115c <zlFog+0x3c>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
call   1040 <glDisable@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zlFog>:
mov    %edi,%eax
mov    0x2eb7(%rip),%rcx
mov    (%rcx),%edi
cmp    $0x1,%al
jne    1134 <zlFog+0x14>
jmp    1030 <glEnable@plt>
jmp    1040 <glDisable@plt>

LLVM IR (-O0):
@GL_FOG = global i32 0
define void @zlFog(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* @GL_FOG
%8 = call i32 @glEnable(i32 %7)
br label %12
9: ; preds = %1
%10 = load i32, i32* @GL_FOG
%11 = call i32 @glDisable(i32 %10)
br label %12
12: ; preds = %9, %6
ret void
}

LLVM IR (-O2):
@GL_FOG = global i32 0
define void @zlFog(i8 zeroext %0) {
%2 = icmp eq i8 %0, 1
%3 = load i32, i32* @GL_FOG
br i1 %2, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @glEnable(i32 %3)
br label %8
6: ; preds = %1
%7 = tail call i32 @glDisable(i32 %3)
br label %8
8: ; preds = %6, %4
ret void
}
/* Variables and functions */
int getTerminalWidth();
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ system(char *);
void ConfigureCMD() {
  int width;
  width = getTerminalWidth();
  char buffer[50];
  sprintf(buffer, "resize -s 30 %d", width);
  system(buffer);
}


x86 assembly (clang, -O0):
<ConfigureCMD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    $0x0,%al
call   1030 <getTerminalWidth@plt>
mov    %eax,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xeb0(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x40(%rbp),%rdi
call   1040 <system@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ConfigureCMD>:
push   %rbx
sub    $0x40,%rsp
xor    %eax,%eax
call   1030 <getTerminalWidth@plt>
lea    0xebd(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %eax,%edx
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <system@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"resize -s 30 %d\00"
define void @ConfigureCMD() {
%1 = alloca i32
%2 = alloca [50 x i8]
%3 = call i32 (...) @getTerminalWidth()
store i32 %3, i32* %1
%4 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%5 = load i32, i32* %1
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%8 = call i32 @system(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"resize -s 30 %d\00"
define void @ConfigureCMD() {
%1 = alloca [50 x i8]
%2 = tail call i32 (...) @getTerminalWidth()
%3 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %2)
%5 = call i32 @system(i8* %3)
ret void
}