xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ vec4d_scalarDiv_new(double *, double const *, double const);
void vec4d_homogenize_new(double dest[4], const double src[4]) {
  vec4d_scalarDiv_new(dest, src, src[3]);
}


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

x86 assembly (clang, -O2):
<vec4d_homogenize_new>:
movsd  0x18(%rsi),%xmm0
jmp    1030 <vec4d_scalarDiv_new@plt>

LLVM IR (-O0):
define void @vec4d_homogenize_new(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = load double*, double** %4
%7 = load double*, double** %4
%8 = getelementptr inbounds double, double* %7, i64 3
%9 = load double, double* %8
%10 = call i32 @vec4d_scalarDiv_new(double* %5, double* %6, double %9)
ret void
}

LLVM IR (-O2):
define void @vec4d_homogenize_new(double* %0, double* %1) {
%3 = getelementptr inbounds double, double* %1, i64 3
%4 = load double, double* %3
%5 = tail call i32 @vec4d_scalarDiv_new(double* %0, double* %1, double %4)
ret void
}
int dt2tsi(date, time)
double date;
double time;
{ return ((int)(dt2ts(date, time) - 946684800.0)); }


x86 assembly (clang, -O0):
<dt2tsi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mov    $0x2,%al
call   1030 <dt2ts@plt>
cvtsi2sd %eax,%xmm0
movsd  0xec1(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dt2tsi>:
push   %rax
mov    $0x2,%al
call   1030 <dt2ts@plt>
add    $0xc792bc80,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @dt2tsi(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call i32 (double, double, ...) bitcast (i32 (...)* @dt2ts to i32 (double, double, ...)*)(double %5, double %6)
%8 = sitofp i32 %7 to double
%9 = fsub double %8, 0x41CC36A1C0000000
%10 = fptosi double %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @dt2tsi(double %0, double %1) {
%3 = tail call i32 (double, double, ...) bitcast (i32 (...)* @dt2ts to i32 (double, double, ...)*)(double %0, double %1)
%4 = add i32 %3, -946684800
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_atol() {
  printf("NOT IMPLEMENTED:"
         "pa_atol"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [24 x i8] c"NOT IMPLEMENTED:pa_atol\00"
define i32 @pa_atol() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int32_t;

/* Variables and functions */
int FUTEX_WAKE;
int /*<<< orphan*/ SYS_futex;
int syscall(int /*<<< orphan*/, int /*<<< orphan*/ *, int, int,
            int /*<<< orphan*/ *, int /*<<< orphan*/ *, int /*<<< orphan*/);
int futex_wake(u_int32_t *uaddr, int nr_wake, int opflags) {
  return syscall(SYS_futex, uaddr, FUTEX_WAKE | opflags, nr_wake, NULL, NULL,
                 0);
}


x86 assembly (clang, -O0):
<futex_wake>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    0x2eb7(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    0x2e9a(%rip),%rax
mov    (%rax),%edx
or     -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
xor    %eax,%eax
mov    %eax,%r9d
xor    %eax,%eax
mov    %r9,%r8
movl   $0x0,(%rsp)
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<futex_wake>:
push   %rax
mov    %esi,%ecx
mov    %rdi,%rsi
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
mov    0x2eaa(%rip),%rax
or     (%rax),%edx
movl   $0x0,(%rsp)
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
@SYS_futex = global i32 0
@FUTEX_WAKE = global i32 0
define i32 @futex_wake(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* @SYS_futex
%8 = load i32*, i32** %4
%9 = load i32, i32* @FUTEX_WAKE
%10 = load i32, i32* %6
%11 = or i32 %9, %10
%12 = load i32, i32* %5
%13 = call i32 @syscall(i32 %7, i32* %8, i32 %11, i32 %12, i32* null, i32* null, i32 0)
ret i32 %13
}

LLVM IR (-O2):
@SYS_futex = global i32 0
@FUTEX_WAKE = global i32 0
define i32 @futex_wake(i32* %0, i32 %1, i32 %2) {
%4 = load i32, i32* @SYS_futex
%5 = load i32, i32* @FUTEX_WAKE
%6 = or i32 %5, %2
%7 = tail call i32 @syscall(i32 %4, i32* %0, i32 %6, i32 %1, i32* null, i32* null, i32 0)
ret i32 %7
}
/* Type definitions */
struct havege_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ havege_random(struct havege_state *, char *, int);
void r_int(struct havege_state *state, int *i) {
  char *temp = (void *)i;
  if (havege_random(state, temp, sizeof(int)) != 0)
    abort();
}


x86 assembly (clang, -O0):
<r_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x4,%edx
call   1040 <havege_random@plt>
cmp    $0x0,%rax
je     115b <r_int+0x3b>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<r_int>:
push   %rax
mov    $0x4,%edx
call   1040 <havege_random@plt>
test   %rax,%rax
jne    1132 <r_int+0x12>
pop    %rax
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
%struct.havege_state = type { i32 }
define void @r_int(%struct.havege_state* %0, i32* %1) {
%3 = alloca %struct.havege_state*
%4 = alloca i32*
%5 = alloca i8*
store %struct.havege_state* %0, %struct.havege_state** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %4
%7 = bitcast i32* %6 to i8*
store i8* %7, i8** %5
%8 = load %struct.havege_state*, %struct.havege_state** %3
%9 = load i8*, i8** %5
%10 = call i64 @havege_random(%struct.havege_state* %8, i8* %9, i32 4)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 (...) @abort()
unreachable
14: ; preds = %2
ret void
}

LLVM IR (-O2):
%struct.havege_state = type { i32 }
define void @r_int(%struct.havege_state* %0, i32* %1) {
%3 = bitcast i32* %1 to i8*
%4 = tail call i64 @havege_random(%struct.havege_state* %0, i8* %3, i32 4)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %2
ret void
}
/* Variables and functions */
int _getchar();
int wait_for_kb() {
  int c;
  for (;;) {
    c = _getchar();
    if ((c == '\r') || (c == '\n') || (c == ' ')) {
      return c;
    }
  }
}


x86 assembly (clang, -O0):
<wait_for_kb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <_getchar@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xd,-0x4(%rbp)
je     1140 <wait_for_kb+0x30>
cmpl   $0xa,-0x4(%rbp)
je     1140 <wait_for_kb+0x30>
cmpl   $0x20,-0x4(%rbp)
jne    1149 <wait_for_kb+0x39>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret
jmp    1118 <wait_for_kb+0x8>

x86 assembly (clang, -O2):
<wait_for_kb>:
push   %rbx
movabs $0x100002400,%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <_getchar@plt>
cmp    $0x20,%eax
ja     1120 <wait_for_kb+0x10>
mov    %eax,%ecx
bt     %rcx,%rbx
jae    1120 <wait_for_kb+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define i32 @wait_for_kb() {
%1 = alloca i32
br label %2
2: ; preds = %14, %0
%3 = call i32 (...) @_getchar()
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 13
br i1 %5, label %12, label %6
6: ; preds = %2
%7 = load i32, i32* %1
%8 = icmp eq i32 %7, 10
br i1 %8, label %12, label %9
9: ; preds = %6
%10 = load i32, i32* %1
%11 = icmp eq i32 %10, 32
br i1 %11, label %12, label %14
12: ; preds = %9, %6, %2
%13 = load i32, i32* %1
ret i32 %13
14: ; preds = %9
br label %2
}

LLVM IR (-O2):
define i32 @wait_for_kb() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @_getchar()
switch i32 %2, label %1 [
i32 32, label %3
i32 13, label %3
i32 10, label %3
]
3: ; preds = %1, %1, %1
ret i32 %2
}
void SSMR3PutS64(void) {}


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

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

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

LLVM IR (-O2):
define void @SSMR3PutS64() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void likwid_markerThreadInit(void) {
  fprintf(stderr, "WARNING: dummy likwid_markerThreadInit() called\n");
}


x86 assembly (clang, -O0):
<likwid_markerThreadInit>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<likwid_markerThreadInit>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [49 x i8] c"WARNING: dummy likwid_markerThreadInit() called\0A\00"
define void @likwid_markerThreadInit() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [49 x i8] c"WARNING: dummy likwid_markerThreadInit() called\0A\00"
define void @likwid_markerThreadInit() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
ret void
}
extern void gui_ksys_free(void *mem) {
  __asm__ __volatile__("int $0x40" : : "a"(68), "b"(13), "c"(mem) : "memory");
}


x86 assembly (clang, -O0):
<gui_ksys_free>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    $0x44,%eax
mov    $0xd,%ebx
int    $0x40
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<gui_ksys_free>:
push   %rbx
mov    %rdi,%rcx
mov    $0x44,%eax
mov    $0xd,%ebx
int    $0x40
pop    %rbx
ret

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

LLVM IR (-O2):
define void @gui_ksys_free(i8* %0) {
tail call void asm sideeffect "int $$0x40", "{ax},{bx},{cx},~{memory},~{dirflag},~{fpsr},~{flags}"(i32 68, i32 13, i8* %0)
ret void
}
/* Type definitions */
struct sembuf {
  int sem_op;
  int sem_num;
  scalar_t__ sem_flg;
};

/* Variables and functions */
int /*<<< orphan*/ semop(int, struct sembuf *, int);
void V(int semid, int semaphore) {
  struct sembuf vsembuf;
  vsembuf.sem_op = 1;
  vsembuf.sem_flg = 0;
  vsembuf.sem_num = semaphore;
  semop(semid, &vsembuf, 1);
  return;
}


x86 assembly (clang, -O0):
<V>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x1,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x18(%rbp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<V>:
sub    $0x18,%rsp
movl   $0x1,0x8(%rsp)
movq   $0x0,0x10(%rsp)
mov    %esi,0xc(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sembuf = type { i32, i32, i64 }
define void @V(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.sembuf
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %5, i32 0, i32 0
store i32 1, i32* %6
%7 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %5, i32 0, i32 2
store i64 0, i64* %7
%8 = load i32, i32* %4
%9 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %5, i32 0, i32 1
store i32 %8, i32* %9
%10 = load i32, i32* %3
%11 = call i32 @semop(i32 %10, %struct.sembuf* %5, i32 1)
ret void
}

LLVM IR (-O2):
%struct.sembuf = type { i32, i32, i64 }
define void @V(i32 %0, i32 %1) {
%3 = alloca %struct.sembuf
%4 = bitcast %struct.sembuf* %3 to i8*
%5 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i64 0, i32 0
store i32 1, i32* %5
%6 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i64 0, i32 2
store i64 0, i64* %6
%7 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i64 0, i32 1
store i32 %1, i32* %7
%8 = call i32 @semop(i32 %0, %struct.sembuf* %3, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
char *strsignal(int);
void interrupt_handler(int sig) {
  printf("%s caught, exiting.\n", strsignal(sig));
  exit(0);
}


x86 assembly (clang, -O0):
<interrupt_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <strsignal@plt>
mov    %rax,%rsi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<interrupt_handler>:
push   %rax
call   1040 <strsignal@plt>
lea    0xec3(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"%s caught, exiting.\0A\00"
define void @interrupt_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i8* @strsignal(i32 %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [21 x i8] c"%s caught, exiting.\0A\00"
define void @interrupt_handler(i32 %0) {
%2 = tail call i8* @strsignal(i32 %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int main(int argc, char **argv) {
  (void)argc;
  (void)argv;
  exit(17);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x11,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x11,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @exit(i32 17)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @exit(i32 17)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ move(int, int /*<<< orphan*/);
int /*<<< orphan*/ mvaddstr(int, int, char *);
int /*<<< orphan*/ stdscr;
int strlen(char *);
int /*<<< orphan*/ wclrtoeol(int /*<<< orphan*/);
void write_title(char *title) {
  move(4, 0);
  wclrtoeol(stdscr);
  if (0 != title)
    mvaddstr(4, (80 - strlen(title)) / 2, title);
}


x86 assembly (clang, -O0):
<write_title>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x4,%edi
xor    %esi,%esi
call   1060 <move@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
call   1030 <wclrtoeol@plt>
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
je     119c <write_title+0x5c>
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    $0x50,%eax
sub    %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
mov    -0x8(%rbp),%rdx
mov    $0x4,%edi
call   1050 <mvaddstr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_title>:
push   %rbx
mov    %rdi,%rbx
mov    $0x4,%edi
xor    %esi,%esi
call   1060 <move@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1030 <wclrtoeol@plt>
test   %rbx,%rbx
je     1189 <write_title+0x49>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    $0x50,%ecx
sub    %eax,%ecx
mov    %ecx,%esi
shr    $0x1f,%esi
add    %ecx,%esi
sar    %esi
mov    $0x4,%edi
mov    %rbx,%rdx
pop    %rbx
jmp    1050 <mvaddstr@plt>
pop    %rbx
ret

LLVM IR (-O0):
@stdscr = global i32 0
define void @write_title(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @move(i32 4, i32 0)
%4 = load i32, i32* @stdscr
%5 = call i32 @wclrtoeol(i32 %4)
%6 = load i8*, i8** %2
%7 = icmp ne i8* null, %6
br i1 %7, label %8, label %15
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i32 @strlen(i8* %9)
%11 = sub nsw i32 80, %10
%12 = sdiv i32 %11, 2
%13 = load i8*, i8** %2
%14 = call i32 @mvaddstr(i32 4, i32 %12, i8* %13)
br label %15
15: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
@stdscr = global i32 0
define void @write_title(i8* %0) {
%2 = tail call i32 @move(i32 4, i32 0)
%3 = load i32, i32* @stdscr
%4 = tail call i32 @wclrtoeol(i32 %3)
%5 = icmp eq i8* %0, null
br i1 %5, label %11, label %6
6: ; preds = %1
%7 = tail call i32 @strlen(i8* %0)
%8 = sub nsw i32 80, %7
%9 = sdiv i32 %8, 2
%10 = tail call i32 @mvaddstr(i32 4, i32 %9, i8* %0)
br label %11
11: ; preds = %6, %1
ret void
}
__attribute__((always_)) void memcpy_fromio(void *dst, const volatile void *src,
                                            int count) {
  __memcpy(dst, (void *)src, count);
}


x86 assembly (clang, -O0):
<memcpy_fromio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x0,%al
call   1030 <__memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @memcpy_fromio(i8* %0, i8* %1, i32 %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** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @__memcpy to i32 (i8*, i8*, i32, ...)*)(i8* %7, i8* %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @memcpy_fromio(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @__memcpy to i32 (i8*, i8*, i32, ...)*)(i8* %0, i8* %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_csi(char *, int);
int /*<<< orphan*/ padding(int);
int decdc(int pn) {
  do_csi("%d'~", pn);
  padding(10 * pn);
  return 1;
}


x86 assembly (clang, -O0):
<decdc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <do_csi@plt>
imul   $0xa,-0x4(%rbp),%edi
call   1040 <padding@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decdc>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
mov    %ebx,%esi
call   1030 <do_csi@plt>
add    %ebx,%ebx
lea    (%rbx,%rbx,4),%edi
call   1040 <padding@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%d'~\00"
define i32 @decdc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @do_csi(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %2
%6 = mul nsw i32 10, %5
%7 = call i32 @padding(i32 %6)
ret i32 1
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d'~\00"
define i32 @decdc(i32 %0) {
%2 = tail call i32 @do_csi(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = mul nsw i32 %0, 10
%4 = tail call i32 @padding(i32 %3)
ret i32 1
}
float call_f(float (*func)(float), float arg) { return func(arg); }


x86 assembly (clang, -O0):
<call_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movss  -0xc(%rbp),%xmm0
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_f>:
jmp    *%rdi

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

LLVM IR (-O2):
define float @call_f(float (float)* nocapture %0, float %1) {
%3 = tail call float %0(float %1)
ret float %3
}
int test_imm_85uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x85 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_85uint64_midword_reg>:
test   $0x850000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_85uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 8716288
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ check_vect();
int /*<<< orphan*/ main1(int, int);
int main(void) {
  check_vect();
  main1(100, 100);
  main1(0, 15);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <check_vect@plt>
mov    $0x64,%edi
mov    $0x64,%esi
call   1040 <main1@plt>
xor    %edi,%edi
mov    $0xf,%esi
call   1040 <main1@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @check_vect()
%3 = call i32 @main1(i32 100, i32 100)
%4 = call i32 @main1(i32 0, i32 15)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @check_vect()
%2 = tail call i32 @main1(i32 100, i32 100)
%3 = tail call i32 @main1(i32 0, i32 15)
ret i32 0
}
void glUniformMatrix3x2fv(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glUniformMatrix3x2fv() {
ret void
}
int myatoi(char *p) {
  int vysledek = 0;
  while (*p != '\0') {
    vysledek = (vysledek * 10) + (*p) - '0';
    p++;
  }
  return vysledek;
}


x86 assembly (clang, -O0):
<myatoi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1143 <myatoi+0x43>
imul   $0xa,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
add    %ecx,%eax
sub    $0x30,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <myatoi+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<myatoi>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <myatoi+0x28>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
lea    (%rax,%rax,4),%eax
lea    (%rcx,%rax,2),%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <myatoi+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @myatoi(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %13, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %12, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = mul nsw i32 %6, 10
%10 = add i32 %9, -48
%11 = add i32 %10, %8
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %16
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int col_from_rgb(uint8_t red, uint8_t green, uint8_t blue) {
  return red << 16 | green << 8 | blue;
}


x86 assembly (clang, -O0):
<col_from_rgb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x10,%eax
mov    -0x8(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
or     -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<col_from_rgb>:
mov    %esi,%eax
shl    $0x10,%edi
shl    $0x8,%eax
or     %edi,%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @col_from_rgb(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = shl i32 %7, 16
%9 = load i32, i32* %5
%10 = shl i32 %9, 8
%11 = or i32 %8, %10
%12 = load i32, i32* %6
%13 = or i32 %11, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @col_from_rgb(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %0, 16
%5 = shl i32 %1, 8
%6 = or i32 %5, %4
%7 = or i32 %6, %2
ret i32 %7
}
void keyb_report_driver_all(char *s, unsigned size) { *s = 0; }


x86 assembly (clang, -O0):
<keyb_report_driver_all>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<keyb_report_driver_all>:
movb   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @keyb_report_driver_all(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
store i8 0, i8* %5
ret void
}

LLVM IR (-O2):
define void @keyb_report_driver_all(i8* nocapture writeonly %0, i32 %1) {
store i8 0, i8* %0
ret void
}
/* Variables and functions */
int strcmp(char const *, char const *);
int cmp_str(const void *x, const void *y) {
  return strcmp((const char *)x, (const char *)y);
}


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

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

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

LLVM IR (-O2):
define i32 @cmp_str(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Type definitions */
typedef int u_int;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int read_u16b(int /*<<< orphan*/ *);
int read_s16b(FILE *fp) {
  u_int t = read_u16b(fp);
  if (t >= 0x8000)
    t |= ~0xffff;
  return (int)t;
}


x86 assembly (clang, -O0):
<read_s16b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <read_u16b@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x8000,-0xc(%rbp)
jl     1140 <read_s16b+0x30>
mov    -0xc(%rbp),%eax
or     $0xffff0000,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_s16b>:
push   %rax
call   1030 <read_u16b@plt>
mov    %eax,%ecx
or     $0xffff0000,%ecx
cmp    $0x8000,%eax
cmovge %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @read_s16b(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @read_u16b(i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp sge i32 %6, 32768
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32, i32* %3
%10 = or i32 %9, -65536
store i32 %10, i32* %3
br label %11
11: ; preds = %8, %1
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @read_s16b(i32* %0) {
%2 = tail call i32 @read_u16b(i32* %0)
%3 = icmp sgt i32 %2, 32767
%4 = or i32 %2, -65536
%5 = select i1 %3, i32 %4, i32 %2
ret i32 %5
}
/* Type definitions */
struct vec3i {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ vec3i_snap(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                              int /*<<< orphan*/ *);
__attribute__((always_)) struct vec3i *
psvec3i_snap(struct vec3i *result, struct vec3i *a, struct vec3i *b) {
  vec3i_snap((int32_t *)result, (int32_t *)a, (int32_t *)b);
  return result;
}


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

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

LLVM IR (-O0):
%struct.vec3i = type { i32 }
define %struct.vec3i* @psvec3i_snap(%struct.vec3i* %0, %struct.vec3i* %1, %struct.vec3i* %2) {
%4 = alloca %struct.vec3i*
%5 = alloca %struct.vec3i*
%6 = alloca %struct.vec3i*
store %struct.vec3i* %0, %struct.vec3i** %4
store %struct.vec3i* %1, %struct.vec3i** %5
store %struct.vec3i* %2, %struct.vec3i** %6
%7 = load %struct.vec3i*, %struct.vec3i** %4
%8 = bitcast %struct.vec3i* %7 to i32*
%9 = load %struct.vec3i*, %struct.vec3i** %5
%10 = bitcast %struct.vec3i* %9 to i32*
%11 = load %struct.vec3i*, %struct.vec3i** %6
%12 = bitcast %struct.vec3i* %11 to i32*
%13 = call i32 @vec3i_snap(i32* %8, i32* %10, i32* %12)
%14 = load %struct.vec3i*, %struct.vec3i** %4
ret %struct.vec3i* %14
}

LLVM IR (-O2):
%struct.vec3i = type { i32 }
define %struct.vec3i* @psvec3i_snap(%struct.vec3i* returned %0, %struct.vec3i* %1, %struct.vec3i* %2) {
%4 = getelementptr %struct.vec3i, %struct.vec3i* %0, i64 0, i32 0
%5 = getelementptr %struct.vec3i, %struct.vec3i* %1, i64 0, i32 0
%6 = getelementptr %struct.vec3i, %struct.vec3i* %2, i64 0, i32 0
%7 = tail call i32 @vec3i_snap(i32* %4, i32* %5, i32* %6)
ret %struct.vec3i* %0
}
void UPDATE_NPXC(int reg) {}


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

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

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

LLVM IR (-O2):
define void @UPDATE_NPXC(i32 %0) {
ret void
}
/* Type definitions */
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ list_add(struct list_head *, struct list_head *);
int /*<<< orphan*/ list_del(struct list_head *);
void list_move(struct list_head *node, struct list_head *head) {
  list_del(node);
  list_add(node, head);
}


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

x86 assembly (clang, -O2):
<list_move>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <list_del@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <list_add@plt>

LLVM IR (-O0):
%struct.list_head = type { i32 }
define void @list_move(%struct.list_head* %0, %struct.list_head* %1) {
%3 = alloca %struct.list_head*
%4 = alloca %struct.list_head*
store %struct.list_head* %0, %struct.list_head** %3
store %struct.list_head* %1, %struct.list_head** %4
%5 = load %struct.list_head*, %struct.list_head** %3
%6 = call i32 @list_del(%struct.list_head* %5)
%7 = load %struct.list_head*, %struct.list_head** %3
%8 = load %struct.list_head*, %struct.list_head** %4
%9 = call i32 @list_add(%struct.list_head* %7, %struct.list_head* %8)
ret void
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
define void @list_move(%struct.list_head* %0, %struct.list_head* %1) {
%3 = tail call i32 @list_del(%struct.list_head* %0)
%4 = tail call i32 @list_add(%struct.list_head* %0, %struct.list_head* %1)
ret void
}
/* Variables and functions */
bool IsSpanCompletelyOutside(int start, int len, int max) {
  if (start >= max)
    return true;
  if (start + len <= 0)
    return true;
  return false;
}


x86 assembly (clang, -O0):
<IsSpanCompletelyOutside>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1125 <IsSpanCompletelyOutside+0x25>
movl   $0x1,-0x4(%rbp)
jmp    1147 <IsSpanCompletelyOutside+0x47>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
cmp    $0x0,%eax
jg     1140 <IsSpanCompletelyOutside+0x40>
movl   $0x1,-0x4(%rbp)
jmp    1147 <IsSpanCompletelyOutside+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsSpanCompletelyOutside>:
cmp    %edx,%edi
setge  %al
add    %edi,%esi
setle  %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @IsSpanCompletelyOutside(i32 %0, i32 %1, i32 %2) {
%4 = icmp sge i32 %0, %2
%5 = add nsw i32 %1, %0
%6 = icmp slt i32 %5, 1
%7 = select i1 %4, i1 true, i1 %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ os_error(char *);
void *xcalloc(size_t nmemb, size_t size) {
  if (nmemb * size == 0)
    nmemb = size = 1;
  void *p = calloc(nmemb, size);
  if (!p)
    os_error("Allocating cleared memory failed");
  return p;
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
cmp    $0x0,%rax
jne    1153 <xcalloc+0x33>
movq   $0x1,-0x10(%rbp)
movq   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    117b <xcalloc+0x5b>
lea    0xe8a(%rip),%rdi
call   1040 <os_error@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %rbx
mov    %rsi,%rax
imul   %rdi,%rax
test   %rax,%rax
mov    $0x1,%eax
cmove  %rax,%rsi
cmove  %rax,%rdi
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1151 <xcalloc+0x31>
lea    0xeb4(%rip),%rdi
call   1040 <os_error@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Allocating cleared memory failed\00"
define i8* @xcalloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = mul i64 %6, %7
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i64 1, i64* %4
store i64 1, i64* %3
br label %11
11: ; preds = %10, %2
%12 = load i64, i64* %3
%13 = load i64, i64* %4
%14 = call i8* @calloc(i64 %12, i64 %13)
store i8* %14, i8** %5
%15 = load i8*, i8** %5
%16 = icmp ne i8* %15, null
br i1 %16, label %19, label %17
17: ; preds = %11
%18 = call i32 @os_error(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %19
19: ; preds = %17, %11
%20 = load i8*, i8** %5
ret i8* %20
}

LLVM IR (-O2):
@.str = [33 x i8] c"Allocating cleared memory failed\00"
define noalias i8* @xcalloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i64 1, i64 %1
%6 = select i1 %4, i64 1, i64 %0
%7 = tail call i8* @calloc(i64 %6, i64 %5)
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = tail call i32 @os_error(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %2
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ glutPostRedisplay();
void key(unsigned char c, int x, int y) {
  if (c == 27) {
    exit(0);
  }
  glutPostRedisplay();
}


x86 assembly (clang, -O0):
<key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x1b,%eax
jne    1148 <key+0x28>
xor    %edi,%edi
call   1040 <exit@plt>
mov    $0x0,%al
call   1030 <glutPostRedisplay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<key>:
cmp    $0x1b,%dil
je     112d <key+0xd>
xor    %eax,%eax
jmp    1030 <glutPostRedisplay@plt>
push   %rax
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @key(i8 zeroext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = icmp eq i32 %8, 27
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = call i32 @exit(i32 0)
unreachable
12: ; preds = %3
%13 = call i32 (...) @glutPostRedisplay()
ret void
}

LLVM IR (-O2):
define void @key(i8 zeroext %0, i32 %1, i32 %2) {
%4 = icmp eq i8 %0, 27
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %3
%8 = tail call i32 (...) @glutPostRedisplay()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts2(char *);
void GenPrintNewLine(void) { puts2(""); }


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

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @GenPrintNewLine() {
%1 = call i32 @puts2(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @GenPrintNewLine() {
%1 = tail call i32 @puts2(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *libc__IO_proc_open(char const *, char const *);
int /*<<< orphan*/ watch_log(char *, char const *);
FILE *_IO_popen(const char *command, const char *type) {
  watch_log("exec %s\n", command);
  return libc__IO_proc_open(command, type);
}


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

x86 assembly (clang, -O2):
<_IO_popen>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xecf(%rip),%rdi
mov    %rbx,%rsi
call   1040 <watch_log@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <libc__IO_proc_open@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"exec %s\0A\00"
define i32* @_IO_popen(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i32 @watch_log(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32* @libc__IO_proc_open(i8* %7, i8* %8)
ret i32* %9
}

LLVM IR (-O2):
@.str = [9 x i8] c"exec %s\0A\00"
define i32* @_IO_popen(i8* %0, i8* %1) {
%3 = tail call i32 @watch_log(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32* @libc__IO_proc_open(i8* %0, i8* %1)
ret i32* %4
}
/* Type definitions */
typedef unsigned long long uint64_t;

/* Variables and functions */
uint64_t pcr_unsigned_wrap(uint64_t x) {
  return x >= (300ULL * (1ULL << 33)) ? x - (300ULL * (1ULL << 33)) : x;
}


x86 assembly (clang, -O0):
<pcr_unsigned_wrap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movabs $0x25800000000,%rax
cmp    %rax,-0x8(%rbp)
jb     1136 <pcr_unsigned_wrap+0x36>
mov    -0x8(%rbp),%rax
movabs $0x25800000000,%rcx
sub    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    113e <pcr_unsigned_wrap+0x3e>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pcr_unsigned_wrap>:
mov    %rdi,%rcx
shr    $0x23,%rcx
movabs $0xfffffda800000000,%rax
fd ff ff
add    %rdi,%rax
cmp    $0x4b,%ecx
cmovb  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @pcr_unsigned_wrap(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp uge i64 %3, 2576980377600
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i64, i64* %2
%7 = sub i64 %6, 2576980377600
br label %10
8: ; preds = %1
%9 = load i64, i64* %2
br label %10
10: ; preds = %8, %5
%11 = phi i64 [ %7, %5 ], [ %9, %8 ]
ret i64 %11
}

LLVM IR (-O2):
define i64 @pcr_unsigned_wrap(i64 %0) {
%2 = icmp ugt i64 %0, 2576980377599
%3 = add i64 %0, -2576980377600
%4 = select i1 %2, i64 %3, i64 %0
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ error(int);
int write(int, void *, int);
void Write(int fd, void *buf, int count) {
  if (write(fd, buf, count) < count)
    error(fd);
}


x86 assembly (clang, -O0):
<Write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
cmp    -0x14(%rbp),%eax
jge    1152 <Write+0x32>
mov    -0x4(%rbp),%edi
call   1040 <error@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Write>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %edi,%ebx
call   1030 <write@plt>
cmp    %ebp,%eax
jge    113d <Write+0x1d>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <error@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @Write(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
%5 = icmp slt i32 %4, %2
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @error(i32 %0)
br label %8
8: ; preds = %6, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _sys_call(int, int /*<<< orphan*/, int /*<<< orphan*/,
                             int /*<<< orphan*/);
void yield_proc() { _sys_call(0x34, 0, 0, 0); }


x86 assembly (clang, -O0):
<yield_proc>:
push   %rbp
mov    %rsp,%rbp
mov    $0x34,%edi
xor    %ecx,%ecx
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <_sys_call@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<yield_proc>:
mov    $0x34,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <_sys_call@plt>

LLVM IR (-O0):
define void @yield_proc() {
%1 = call i32 @_sys_call(i32 52, i32 0, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @yield_proc() {
%1 = tail call i32 @_sys_call(i32 52, i32 0, i32 0, i32 0)
ret void
}
/* Variables and functions */
unsigned long strtoul(char const *, char **, int);
unsigned long get_ug_id(const char *s, long (*my_getxxnam)(const char *)) {
  unsigned long r;
  char *p;
  r = strtoul(s, &p, 10);
  if (*p || (s == p)) {
    r = my_getxxnam(s);
  }
  return r;
}


x86 assembly (clang, -O0):
<get_ug_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtoul@plt>
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1154 <get_ug_id+0x44>
mov    -0x8(%rbp),%rax
cmp    -0x20(%rbp),%rax
jne    1162 <get_ug_id+0x52>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdi
call   *%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_ug_id>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsp,%rsi
mov    $0xa,%edx
call   1030 <strtoul@plt>
mov    (%rsp),%rcx
cmp    %rbx,%rcx
je     113d <get_ug_id+0x2d>
cmpb   $0x0,(%rcx)
jne    113d <get_ug_id+0x2d>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %rbx,%rdi
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    *%rax

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

LLVM IR (-O2):
define i64 @get_ug_id(i8* %0, i64 (i8*)* nocapture %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i64 @strtoul(i8* %0, i8** %3, i32 10)
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
%9 = icmp eq i8* %6, %0
%10 = or i1 %9, %8
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = tail call i64 %1(i8* %0)
br label %13
13: ; preds = %2, %11
%14 = phi i64 [ %12, %11 ], [ %5, %2 ]
ret i64 %14
}
unsigned long EPINonBlockingReadAvail(unsigned long ulBase) {
  ;
  return ((*((volatile unsigned long *)(ulBase + 0x0000006C))));
}


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

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

LLVM IR (-O0):
define i64 @EPINonBlockingReadAvail(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 108
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @EPINonBlockingReadAvail(i64 %0) {
%2 = add i64 %0, 108
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
ret i64 %4
}