xunge/DecIR huggingface dataset:
int arrIndex(int x, int y, int size) { return x * size + y; }


x86 assembly (clang, -O0):
<arrIndex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
imul   -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<arrIndex>:
imul   %edx,%edi
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @arrIndex(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 = load i32, i32* %6
%9 = mul nsw i32 %7, %8
%10 = load i32, i32* %5
%11 = add nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @arrIndex(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %2, %0
%5 = add nsw i32 %4, %1
ret i32 %5
}
/* Variables and functions */
int *realloc(int *, int);
int last_vector(int *n, int **vector) {
  *n -= 1;
  (*vector) = realloc((*vector), *n * sizeof(**vector));
  return 0;
}


x86 assembly (clang, -O0):
<last_vector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
sub    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x8(%rbp),%rax
movslq (%rax),%rax
shl    $0x2,%rax
mov    %eax,%esi
call   1030 <realloc@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<last_vector>:
push   %rbx
mov    %rsi,%rbx
mov    (%rdi),%eax
lea    -0x1(%rax),%ecx
mov    %ecx,(%rdi)
mov    (%rsi),%rdi
lea    -0x4(,%rax,4),%esi
call   1030 <realloc@plt>
mov    %rax,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @last_vector(i32* %0, i32** %1) {
%3 = alloca i32*
%4 = alloca i32**
store i32* %0, i32** %3
store i32** %1, i32*** %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %5
%7 = sub nsw i32 %6, 1
store i32 %7, i32* %5
%8 = load i32**, i32*** %4
%9 = load i32*, i32** %8
%10 = load i32*, i32** %3
%11 = load i32, i32* %10
%12 = sext i32 %11 to i64
%13 = mul i64 %12, 4
%14 = trunc i64 %13 to i32
%15 = call i32* @realloc(i32* %9, i32 %14)
%16 = load i32**, i32*** %4
store i32* %15, i32** %16
ret i32 0
}

LLVM IR (-O2):
define i32 @last_vector(i32* nocapture %0, i32** nocapture %1) {
%3 = load i32, i32* %0
%4 = add nsw i32 %3, -1
store i32 %4, i32* %0
%5 = load i32*, i32** %1
%6 = shl i32 %4, 2
%7 = tail call i32* @realloc(i32* %5, i32 %6)
store i32* %7, i32** %1
ret i32 0
}
unsigned int libplayer_version(void) { return (2 << 16 | 0 << 8 | 2); }


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

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

LLVM IR (-O0):
define i32 @libplayer_version() {
ret i32 131074
}

LLVM IR (-O2):
define i32 @libplayer_version() {
ret i32 131074
}
void test_invalid_clause() {
  int i;
#pragma omp target parallel for foo bar
  for (i = 0; i < 16; ++i)
    ;
}


x86 assembly (clang, -O0):
<test_invalid_clause>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1128 <test_invalid_clause+0x28>
jmp    111a <test_invalid_clause+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <test_invalid_clause+0xb>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test_invalid_clause() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %6, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 16
br i1 %4, label %5, label %9
5: ; preds = %2
br label %6
6: ; preds = %5
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
br label %2
9: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @test_invalid_clause() {
ret void
}
void worker_bport_ack() {}


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

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

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

LLVM IR (-O2):
define void @worker_bport_ack() {
ret void
}
void glwin_draw_image(void *voidhandle, int xsize, int ysize,
                      unsigned char *img) {
  { return; }
}


x86 assembly (clang, -O0):
<glwin_draw_image>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @glwin_draw_image(i8* %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
ret void
}

LLVM IR (-O2):
define void @glwin_draw_image(i8* nocapture %0, i32 %1, i32 %2, i8* nocapture %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ reset_tty();
void timeout(int i) {
  (void)i;
  reset_tty();
  exit(0);
}


x86 assembly (clang, -O0):
<timeout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <reset_tty@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<timeout>:
push   %rax
xor    %eax,%eax
call   1030 <reset_tty@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @timeout(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (...) @reset_tty()
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @timeout(i32 %0) {
%2 = tail call i32 (...) @reset_tty()
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void exit_usage(const char *program) {
  fprintf(stderr,
          "usage: %s -f <bpf_file> [-v] [-h]"
          " -a <arch> -s <syscall_num> [-0 <a0>] ... [-5 <a5>]\n",
          program);
  exit(EINVAL);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [86 x i8] c"usage: %s -f <bpf_file> [-v] [-h] -a <arch> -s <syscall_num> [-0 <a0>] ... [-5 <a5>]\0A\00"
@EINVAL = global i32 0
define void @exit_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EINVAL
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [86 x i8] c"usage: %s -f <bpf_file> [-v] [-h] -a <arch> -s <syscall_num> [-0 <a0>] ... [-5 <a5>]\0A\00"
@EINVAL = global i32 0
define void @exit_usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EINVAL
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ write_ZIGBEE_short(int, int);
void PWR_reset() { write_ZIGBEE_short(0x2A, 0x04); }


x86 assembly (clang, -O0):
<PWR_reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2a,%edi
mov    $0x4,%esi
call   1030 <write_ZIGBEE_short@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWR_reset>:
mov    $0x2a,%edi
mov    $0x4,%esi
jmp    1030 <write_ZIGBEE_short@plt>

LLVM IR (-O0):
define void @PWR_reset() {
%1 = call i32 @write_ZIGBEE_short(i32 42, i32 4)
ret void
}

LLVM IR (-O2):
define void @PWR_reset() {
%1 = tail call i32 @write_ZIGBEE_short(i32 42, i32 4)
ret void
}
/* Variables and functions */
int __TBB_machine_fetchadd4(int volatile *, int);
int __itt_interlocked_increment(volatile int *ptr) {
  return __TBB_machine_fetchadd4(ptr, 1) + 1;
}


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

x86 assembly (clang, -O2):
<__itt_interlocked_increment>:
push   %rax
mov    $0x1,%esi
call   1030 <__TBB_machine_fetchadd4@plt>
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @__itt_interlocked_increment(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @__TBB_machine_fetchadd4(i32* %3, i32 1)
%5 = add nsw i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @__itt_interlocked_increment(i32* %0) {
%2 = tail call i32 @__TBB_machine_fetchadd4(i32* %0, i32 1)
%3 = add nsw i32 %2, 1
ret i32 %3
}
/* Type definitions */
struct list {
  int dummy;
};

/* Variables and functions */
scalar_t__ list_find(struct list *, void *);
int list_prepend(struct list *, void *);
int list_prepend_safe(struct list *l, void *d) {
  if (list_find(l, d) >= 0)
    return 1;
  return list_prepend(l, d);
}


x86 assembly (clang, -O0):
<list_prepend_safe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <list_find@plt>
cmp    $0x0,%rax
jl     1153 <list_prepend_safe+0x33>
movl   $0x1,-0x4(%rbp)
jmp    1163 <list_prepend_safe+0x43>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <list_prepend@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_prepend_safe>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <list_find@plt>
test   %rax,%rax
js     1141 <list_prepend_safe+0x21>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <list_prepend@plt>

LLVM IR (-O0):
%struct.list = type { i32 }
define i32 @list_prepend_safe(%struct.list* %0, i8* %1) {
%3 = alloca i32
%4 = alloca %struct.list*
%5 = alloca i8*
store %struct.list* %0, %struct.list** %4
store i8* %1, i8** %5
%6 = load %struct.list*, %struct.list** %4
%7 = load i8*, i8** %5
%8 = call i64 @list_find(%struct.list* %6, i8* %7)
%9 = icmp sge i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 1, i32* %3
br label %15
11: ; preds = %2
%12 = load %struct.list*, %struct.list** %4
%13 = load i8*, i8** %5
%14 = call i32 @list_prepend(%struct.list* %12, i8* %13)
store i32 %14, i32* %3
br label %15
15: ; preds = %11, %10
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
%struct.list = type { i32 }
define i32 @list_prepend_safe(%struct.list* %0, i8* %1) {
%3 = tail call i64 @list_find(%struct.list* %0, i8* %1)
%4 = icmp sgt i64 %3, -1
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @list_prepend(%struct.list* %0, i8* %1)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ 1, %2 ]
ret i32 %8
}
/* Variables and functions */
int EOF;
int gettoken();
int skip_it(void) {
  register int t;
  while ((t = gettoken()) != EOF && t != (-3))
    ;
  return (t);
}


x86 assembly (clang, -O0):
<skip_it>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <gettoken@plt>
mov    %eax,%ecx
mov    %ecx,-0x4(%rbp)
xor    %eax,%eax
mov    0x2ebb(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0x5(%rbp)
je     1142 <skip_it+0x32>
cmpl   $0xfffffffd,-0x4(%rbp)
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    1152 <skip_it+0x42>
jmp    1157 <skip_it+0x47>
jmp    1118 <skip_it+0x8>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_it>:
push   %rbx
mov    0x2ed0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <gettoken@plt>
cmp    $0xfffffffd,%eax
je     1130 <skip_it+0x20>
cmp    (%rbx),%eax
jne    1120 <skip_it+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @skip_it() {
%1 = alloca i32
br label %2
2: ; preds = %11, %0
%3 = call i32 (...) @gettoken()
store i32 %3, i32* %1
%4 = load i32, i32* @EOF
%5 = icmp ne i32 %3, %4
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = load i32, i32* %1
%8 = icmp ne i32 %7, -3
br label %9
9: ; preds = %6, %2
%10 = phi i1 [ false, %2 ], [ %8, %6 ]
br i1 %10, label %11, label %12
11: ; preds = %9
br label %2
12: ; preds = %9
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @skip_it() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @gettoken()
%3 = load i32, i32* @EOF
%4 = icmp ne i32 %2, %3
%5 = icmp ne i32 %2, -3
%6 = and i1 %5, %4
br i1 %6, label %1, label %7
7: ; preds = %1
ret i32 %2
}
void eglSurfaceAttrib(void) { return; }


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

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

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

LLVM IR (-O2):
define void @eglSurfaceAttrib() {
ret void
}
/* Type definitions */
struct DynArr {
  int dummy;
};

/* Variables and functions */
scalar_t__ isEmptyDynArr(struct DynArr *);
int /*<<< orphan*/ popDynArr(struct DynArr *);
double pow(double, int);
int /*<<< orphan*/ pushDynArr(struct DynArr *, double);
double topDynArr(struct DynArr *);
void cube(struct DynArr *stack) {
  double a, c;
  if (isEmptyDynArr(stack))
    return;
  a = topDynArr(stack);
  popDynArr(stack);
  c = pow(a, 3);
  pushDynArr(stack, c);
}


x86 assembly (clang, -O0):
<cube>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <isEmptyDynArr@plt>
cmp    $0x0,%rax
je     1174 <cube+0x24>
jmp    11ad <cube+0x5d>
mov    -0x8(%rbp),%rdi
call   1030 <topDynArr@plt>
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <popDynArr@plt>
movsd  -0x10(%rbp),%xmm0
mov    $0x3,%edi
call   1060 <pow@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
movsd  -0x18(%rbp),%xmm0
call   1070 <pushDynArr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cube>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1050 <isEmptyDynArr@plt>
test   %rax,%rax
je     1168 <cube+0x18>
add    $0x10,%rsp
pop    %rbx
ret
mov    %rbx,%rdi
call   1030 <topDynArr@plt>
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1040 <popDynArr@plt>
movsd  0x8(%rsp),%xmm0
mov    $0x3,%edi
call   1060 <pow@plt>
mov    %rbx,%rdi
add    $0x10,%rsp
pop    %rbx
jmp    1070 <pushDynArr@plt>

LLVM IR (-O0):
%struct.DynArr = type { i32 }
define void @cube(%struct.DynArr* %0) {
%2 = alloca %struct.DynArr*
%3 = alloca double
%4 = alloca double
store %struct.DynArr* %0, %struct.DynArr** %2
%5 = load %struct.DynArr*, %struct.DynArr** %2
%6 = call i64 @isEmptyDynArr(%struct.DynArr* %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
br label %19
9: ; preds = %1
%10 = load %struct.DynArr*, %struct.DynArr** %2
%11 = call double @topDynArr(%struct.DynArr* %10)
store double %11, double* %3
%12 = load %struct.DynArr*, %struct.DynArr** %2
%13 = call i32 @popDynArr(%struct.DynArr* %12)
%14 = load double, double* %3
%15 = call double @pow(double %14, i32 3)
store double %15, double* %4
%16 = load %struct.DynArr*, %struct.DynArr** %2
%17 = load double, double* %4
%18 = call i32 @pushDynArr(%struct.DynArr* %16, double %17)
br label %19
19: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
%struct.DynArr = type { i32 }
define void @cube(%struct.DynArr* %0) {
%2 = tail call i64 @isEmptyDynArr(%struct.DynArr* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = tail call double @topDynArr(%struct.DynArr* %0)
%6 = tail call i32 @popDynArr(%struct.DynArr* %0)
%7 = tail call double @pow(double %5, i32 3)
%8 = tail call i32 @pushDynArr(%struct.DynArr* %0, double %7)
br label %9
9: ; preds = %1, %4
ret void
}
/* Type definitions */
struct tgdb_list {
  int dummy;
};
struct annotate_two {
  int dummy;
};

/* Variables and functions */
int handle_breakpoints_invalid(struct annotate_two *a2, const char *buf,
                               size_t n, struct tgdb_list *list) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.annotate_two = type { i32 }
%struct.tgdb_list = type { i32 }
define i32 @handle_breakpoints_invalid(%struct.annotate_two* %0, i8* %1, i64 %2, %struct.tgdb_list* %3) {
%5 = alloca %struct.annotate_two*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca %struct.tgdb_list*
store %struct.annotate_two* %0, %struct.annotate_two** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store %struct.tgdb_list* %3, %struct.tgdb_list** %8
ret i32 0
}

LLVM IR (-O2):
%struct.annotate_two = type { i32 }
%struct.tgdb_list = type { i32 }
define i32 @handle_breakpoints_invalid(%struct.annotate_two* nocapture readnone %0, i8* nocapture readnone %1, i64 %2, %struct.tgdb_list* nocapture readnone %3) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
scalar_t__ malloc(unsigned int);
int /*<<< orphan*/ stderr;
float *alloc_1d_dbl(int n) {
  float *new_t;
  new_t = (float *)malloc((unsigned)(n * sizeof(float)));
  if (new_t == NULL) {
    fprintf(stderr, "ALLOC_1D_DBL: Couldn't allocate array of floats\n");
    return (NULL);
  }
  return (new_t);
}


x86 assembly (clang, -O0):
<alloc_1d_dbl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116b <alloc_1d_dbl+0x4b>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
lea    0xea7(%rip),%rsi
call   1030 <fprintf@plt>
movq   $0x0,-0x8(%rbp)
jmp    1173 <alloc_1d_dbl+0x53>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_1d_dbl>:
push   %rax
shl    $0x2,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1130 <alloc_1d_dbl+0x10>
pop    %rcx
ret
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [49 x i8] c"ALLOC_1D_DBL: Couldn't allocate array of floats\0A\00"
define float* @alloc_1d_dbl(i32 %0) {
%2 = alloca float*
%3 = alloca i32
%4 = alloca float*
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = sext i32 %5 to i64
%7 = mul i64 %6, 4
%8 = trunc i64 %7 to i32
%9 = call i64 @malloc(i32 %8)
%10 = inttoptr i64 %9 to float*
store float* %10, float** %4
%11 = load float*, float** %4
%12 = icmp eq float* %11, null
br i1 %12, label %13, label %16
13: ; preds = %1
%14 = load i32, i32* @stderr
%15 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
store float* null, float** %2
br label %18
16: ; preds = %1
%17 = load float*, float** %4
store float* %17, float** %2
br label %18
18: ; preds = %16, %13
%19 = load float*, float** %2
ret float* %19
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [49 x i8] c"ALLOC_1D_DBL: Couldn't allocate array of floats\0A\00"
define float* @alloc_1d_dbl(i32 %0) {
%2 = shl i32 %0, 2
%3 = tail call i64 @malloc(i32 %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
br label %10
8: ; preds = %1
%9 = inttoptr i64 %3 to float*
br label %10
10: ; preds = %8, %5
%11 = phi float* [ null, %5 ], [ %9, %8 ]
ret float* %11
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int numbtrop_quaddobl_clear(void) {
  int fail, *a, *b;
  double *c;
  fail = _ada_use_c2phc(728, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<numbtrop_quaddobl_clear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x2d8,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numbtrop_quaddobl_clear>:
mov    $0x2d8,%edi
jmp    1030 <_ada_use_c2phc@plt>

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

LLVM IR (-O2):
define i32 @numbtrop_quaddobl_clear() {
%1 = tail call i32 @_ada_use_c2phc(i32 728, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ addbyte(int);
void load_param_3_reg_32(int reg) {
  if (reg & 8) {
    addbyte(0x44);
    addbyte(0x89);
    addbyte(0xc0 | 2 | (reg << 3));
  } else {
    addbyte(0x90);
    addbyte(0x89);
    addbyte(0xc0 | 2 | (reg << 3));
  }
}


x86 assembly (clang, -O0):
<load_param_3_reg_32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     1154 <load_param_3_reg_32+0x44>
mov    $0x44,%edi
call   1030 <addbyte@plt>
mov    $0x89,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%edi
shl    $0x3,%edi
or     $0xc2,%edi
call   1030 <addbyte@plt>
jmp    1179 <load_param_3_reg_32+0x69>
mov    $0x90,%edi
call   1030 <addbyte@plt>
mov    $0x89,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%edi
shl    $0x3,%edi
or     $0xc2,%edi
call   1030 <addbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<load_param_3_reg_32>:
push   %rbx
mov    %edi,%ebx
test   $0x8,%bl
mov    $0x90,%eax
mov    $0x44,%edi
cmove  %eax,%edi
call   1030 <addbyte@plt>
mov    $0x89,%edi
call   1030 <addbyte@plt>
shl    $0x3,%ebx
or     $0xc2,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <addbyte@plt>

LLVM IR (-O0):
define void @load_param_3_reg_32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 8
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = call i32 @addbyte(i32 68)
%8 = call i32 @addbyte(i32 137)
%9 = load i32, i32* %2
%10 = shl i32 %9, 3
%11 = or i32 194, %10
%12 = call i32 @addbyte(i32 %11)
br label %20
13: ; preds = %1
%14 = call i32 @addbyte(i32 144)
%15 = call i32 @addbyte(i32 137)
%16 = load i32, i32* %2
%17 = shl i32 %16, 3
%18 = or i32 194, %17
%19 = call i32 @addbyte(i32 %18)
br label %20
20: ; preds = %13, %6
ret void
}

LLVM IR (-O2):
define void @load_param_3_reg_32(i32 %0) {
%2 = and i32 %0, 8
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 144, i32 68
%5 = tail call i32 @addbyte(i32 %4)
%6 = tail call i32 @addbyte(i32 137)
%7 = shl i32 %0, 3
%8 = or i32 %7, 194
%9 = tail call i32 @addbyte(i32 %8)
ret void
}
float max_f(float a, float b) {
  if (a >= b)
    return a;
  return b;
}


x86 assembly (clang, -O0):
<max_f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jb     112c <max_f+0x2c>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1136 <max_f+0x36>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_f>:
movaps %xmm1,%xmm2
cmpless %xmm0,%xmm2
andps  %xmm2,%xmm0
andnps %xmm1,%xmm2
orps   %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @max_f(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = load float, float* %5
%8 = fcmp oge float %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load float, float* %4
store float %10, float* %3
br label %13
11: ; preds = %2
%12 = load float, float* %5
store float %12, float* %3
br label %13
13: ; preds = %11, %9
%14 = load float, float* %3
ret float %14
}

LLVM IR (-O2):
define float @max_f(float %0, float %1) {
%3 = fcmp oge float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Type definitions */
typedef int /*<<< orphan*/ GLuint;
typedef int /*<<< orphan*/ GLint;
typedef int /*<<< orphan*/ GLenum;

/* Variables and functions */
int /*<<< orphan*/ glPixelMapuiv(int /*<<< orphan*/, int /*<<< orphan*/,
                                 int /*<<< orphan*/ *);
void PixelMapuiv(GLenum map, GLint mapsize, GLuint *values) {
  glPixelMapuiv(map, mapsize, values);
}


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

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

LLVM IR (-O0):
define void @PixelMapuiv(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 = load i32, i32* %5
%9 = load i32*, i32** %6
%10 = call i32 @glPixelMapuiv(i32 %7, i32 %8, i32* %9)
ret void
}

LLVM IR (-O2):
define void @PixelMapuiv(i32 %0, i32 %1, i32* %2) {
%4 = tail call i32 @glPixelMapuiv(i32 %0, i32 %1, i32* %2)
ret void
}
/* Variables and functions */
double fabs(double);
int /*<<< orphan*/ link_error();
void foo(double x) {
  double p, q;
  p = fabs(x);
  q = 0.0;
  if (p < q)
    link_error();
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movaps 0xed7(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1155 <foo+0x45>
mov    $0x0,%al
call   1030 <link_error@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @foo(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
%6 = call double @llvm.fabs.f64(double %5)
store double %6, double* %3
store double 0.000000e+00, double* %4
%7 = load double, double* %3
%8 = load double, double* %4
%9 = fcmp olt double %7, %8
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = call i32 (...) @link_error()
br label %12
12: ; preds = %10, %1
ret void
}

LLVM IR (-O2):
define void @foo(double %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void xfree(void *p) {
  if (p)
    free(p);
}


x86 assembly (clang, -O0):
<xfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <xfree+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfree>:
test   %rdi,%rdi
je     111a <xfree+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @xfree(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @xfree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char **);
int main() {
  char name[20];
  printf("Ditt förnamn: ");
  scanf("%s", &name);
  printf("Hej %s!\n", name);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
lea    0xec7(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Ditt f\C3\B6rnamn: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [9 x i8] c"Hej %s!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = bitcast [20 x i8]* %2 to i8**
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %4)
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"Ditt f\C3\B6rnamn: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [9 x i8] c"Hej %s!\0A\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = bitcast [20 x i8]* %1 to i8**
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %4)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %2)
ret i32 0
}
void rop3_202_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = S ^ *D;
  stk2 = T & stk3;
  stk1 = *D ^ stk2;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_202_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
xor    %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_202_0_1>:
mov    (%rdi),%al
mov    %eax,%ecx
xor    %sil,%cl
and    %dl,%cl
xor    %al,%cl
and    %sil,%cl
and    %dl,%sil
not    %sil
and    %al,%sil
or     %cl,%sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_202_0_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = load i8*, i8** %4
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = xor i32 %11, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %9
%17 = load i8, i8* %6
%18 = zext i8 %17 to i32
%19 = load i8, i8* %9
%20 = zext i8 %19 to i32
%21 = and i32 %18, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %8
%23 = load i8*, i8** %4
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = load i8, i8* %8
%27 = zext i8 %26 to i32
%28 = xor i32 %25, %27
%29 = trunc i32 %28 to i8
store i8 %29, i8* %7
%30 = load i8, i8* %7
%31 = zext i8 %30 to i32
%32 = load i8, i8* %5
%33 = zext i8 %32 to i32
%34 = and i32 %31, %33
%35 = load i8, i8* %7
%36 = zext i8 %35 to i32
%37 = load i8, i8* %6
%38 = zext i8 %37 to i32
%39 = xor i32 %38, -1
%40 = and i32 %36, %39
%41 = or i32 %34, %40
%42 = load i8, i8* %6
%43 = zext i8 %42 to i32
%44 = load i8, i8* %5
%45 = zext i8 %44 to i32
%46 = xor i32 %45, -1
%47 = and i32 %43, %46
%48 = load i8*, i8** %4
%49 = load i8, i8* %48
%50 = zext i8 %49 to i32
%51 = and i32 %47, %50
%52 = or i32 %41, %51
%53 = trunc i32 %52 to i8
%54 = load i8*, i8** %4
store i8 %53, i8* %54
ret void
}

LLVM IR (-O2):
define void @rop3_202_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, %1
%6 = and i8 %5, %2
%7 = xor i8 %6, %4
%8 = and i8 %7, %1
%9 = and i8 %1, %2
%10 = xor i8 %9, -1
%11 = and i8 %4, %10
%12 = or i8 %11, %8
store i8 %12, i8* %0
ret void
}
void Sub16Bits(unsigned short *borrow, unsigned short *a, unsigned short b,
               unsigned short c) {
  unsigned long accum;
  accum = (unsigned long)b;
  accum -= (unsigned long)c;
  accum -= (unsigned long)*borrow;
  *borrow = (unsigned long)((accum & 0x00010000) ? 1 : 0);
  *a = (unsigned short)(accum & 0xFFFF);
  return;
}


x86 assembly (clang, -O0):
<Sub16Bits>:
push   %rbp
mov    %rsp,%rbp
mov    %cx,%ax
mov    %dx,%cx
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %cx,-0x12(%rbp)
mov    %ax,-0x14(%rbp)
movzwl -0x12(%rbp),%eax
mov    %rax,-0x20(%rbp)
movzwl -0x14(%rbp),%eax
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%eax
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdx
and    $0x10000,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
cltq
mov    %ax,%cx
mov    -0x8(%rbp),%rax
mov    %cx,(%rax)
mov    -0x20(%rbp),%rax
and    $0xffff,%rax
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sub16Bits>:
mov    %edx,%eax
mov    %ecx,%ecx
movzwl (%rdi),%edx
add    %rcx,%rdx
sub    %rdx,%rax
mov    %eax,%ecx
shr    $0x10,%ecx
and    $0x1,%ecx
mov    %cx,(%rdi)
mov    %ax,(%rsi)
ret

LLVM IR (-O0):
define void @Sub16Bits(i16* %0, i16* %1, i16 zeroext %2, i16 zeroext %3) {
%5 = alloca i16*
%6 = alloca i16*
%7 = alloca i16
%8 = alloca i16
%9 = alloca i64
store i16* %0, i16** %5
store i16* %1, i16** %6
store i16 %2, i16* %7
store i16 %3, i16* %8
%10 = load i16, i16* %7
%11 = zext i16 %10 to i64
store i64 %11, i64* %9
%12 = load i16, i16* %8
%13 = zext i16 %12 to i64
%14 = load i64, i64* %9
%15 = sub i64 %14, %13
store i64 %15, i64* %9
%16 = load i16*, i16** %5
%17 = load i16, i16* %16
%18 = zext i16 %17 to i64
%19 = load i64, i64* %9
%20 = sub i64 %19, %18
store i64 %20, i64* %9
%21 = load i64, i64* %9
%22 = and i64 %21, 65536
%23 = icmp ne i64 %22, 0
%24 = zext i1 %23 to i64
%25 = select i1 %23, i32 1, i32 0
%26 = sext i32 %25 to i64
%27 = trunc i64 %26 to i16
%28 = load i16*, i16** %5
store i16 %27, i16* %28
%29 = load i64, i64* %9
%30 = and i64 %29, 65535
%31 = trunc i64 %30 to i16
%32 = load i16*, i16** %6
store i16 %31, i16* %32
ret void
}

LLVM IR (-O2):
define void @Sub16Bits(i16* nocapture %0, i16* nocapture writeonly %1, i16 zeroext %2, i16 zeroext %3) {
%5 = zext i16 %2 to i64
%6 = zext i16 %3 to i64
%7 = load i16, i16* %0
%8 = zext i16 %7 to i64
%9 = add nuw nsw i64 %6, %8
%10 = sub nsw i64 %5, %9
%11 = lshr i64 %10, 16
%12 = trunc i64 %11 to i16
%13 = and i16 %12, 1
store i16 %13, i16* %0
%14 = trunc i64 %10 to i16
store i16 %14, i16* %1
ret void
}
/* Variables and functions */
int getchar();
int g_getchar(void) { return getchar(); }


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

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

LLVM IR (-O0):
define i32 @g_getchar() {
%1 = call i32 (...) @getchar()
ret i32 %1
}

LLVM IR (-O2):
define i32 @g_getchar() {
%1 = tail call i32 (...) @getchar()
ret i32 %1
}
void pypy_check_stack_count(void) {}


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

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

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

LLVM IR (-O2):
define void @pypy_check_stack_count() {
ret void
}
/* Variables and functions */
char *strdup(char *);
void find_system_model(char **system_model) {
  *system_model = strdup("Teach Me SMBIOS");
  return;
}


x86 assembly (clang, -O0):
<find_system_model>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <strdup@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_system_model>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
call   1030 <strdup@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Teach Me SMBIOS\00"
define void @find_system_model(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i8* @strdup(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = load i8**, i8*** %2
store i8* %3, i8** %4
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Teach Me SMBIOS\00"
define void @find_system_model(i8** nocapture writeonly %0) {
%2 = tail call dereferenceable_or_null(16) i8* @strdup(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
store i8* %2, i8** %0
ret void
}
void handle_WINCH(int sig) {}


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

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

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

LLVM IR (-O2):
define void @handle_WINCH(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void f() { printf("this is f(inline)\n"); }


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"this is f(inline)\0A\00"
define void @f() {
%1 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [18 x i8] c"this is f(inline)\00"
define void @f() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret void
}
void g_hash_table_destroy() {}


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

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

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

LLVM IR (-O2):
define void @g_hash_table_destroy() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("I am myexe.\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"I am myexe.\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"I am myexe.\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
}
double _AUTOPILOT_get_roll_step(void) { return 1.1; }


x86 assembly (clang, -O0):
<_AUTOPILOT_get_roll_step>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_AUTOPILOT_get_roll_step>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @_AUTOPILOT_get_roll_step() {
ret double 1.100000e+00
}

LLVM IR (-O2):
define double @_AUTOPILOT_get_roll_step() {
ret double 1.100000e+00
}
char *HelloWorldLib_sayHello() { return "Hello NAR LIB World!"; }


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"Hello NAR LIB World!\00"
define i8* @HelloWorldLib_sayHello() {
ret i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [21 x i8] c"Hello NAR LIB World!\00"
define i8* @HelloWorldLib_sayHello() {
ret i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int recv(int, void *, int, int /*<<< orphan*/);
int udp_recv(int udpfd, void *buffer, int bufferSize) {
  return recv(udpfd, buffer, bufferSize, 0);
}


x86 assembly (clang, -O0):
<udp_recv>:
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
xor    %ecx,%ecx
call   1030 <recv@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<udp_recv>:
xor    %ecx,%ecx
jmp    1030 <recv@plt>

LLVM IR (-O0):
define i32 @udp_recv(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 @recv(i32 %7, i8* %8, i32 %9, i32 0)
ret i32 %10
}

LLVM IR (-O2):
define i32 @udp_recv(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @recv(i32 %0, i8* %1, i32 %2, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ execve(char *, char **, char **);
int /*<<< orphan*/ setreuid(int, int);
int main(int argc, char *argv[]) {
  char *newargv[] = {NULL};
  char *newenviron[] = {NULL};
  setreuid(1337, 31337);
  execve("/bin/sh", newargv, newenviron);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
mov    $0x539,%edi
mov    $0x7a69,%esi
call   1050 <setreuid@plt>
lea    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdx
lea    0xe7c(%rip),%rdi
call   1040 <execve@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
movq   $0x0,0x8(%rsp)
mov    $0x539,%edi
mov    $0x7a69,%esi
call   1040 <setreuid@plt>
lea    0xeb4(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1030 <execve@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"/bin/sh\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [1 x i8*]
%7 = alloca [1 x i8*]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [1 x i8*]* %6 to i8*
%9 = bitcast [1 x i8*]* %7 to i8*
%10 = call i32 @setreuid(i32 1337, i32 31337)
%11 = getelementptr inbounds [1 x i8*], [1 x i8*]* %6, i64 0, i64 0
%12 = getelementptr inbounds [1 x i8*], [1 x i8*]* %7, i64 0, i64 0
%13 = call i32 @execve(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %11, i8** %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"/bin/sh\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [1 x i8*]
%4 = alloca [1 x i8*]
%5 = bitcast [1 x i8*]* %3 to i8*
%6 = bitcast [1 x i8*]* %3 to i64*
store i64 0, i64* %6
%7 = bitcast [1 x i8*]* %4 to i8*
%8 = bitcast [1 x i8*]* %4 to i64*
store i64 0, i64* %8
%9 = tail call i32 @setreuid(i32 1337, i32 31337)
%10 = getelementptr inbounds [1 x i8*], [1 x i8*]* %3, i64 0, i64 0
%11 = getelementptr inbounds [1 x i8*], [1 x i8*]* %4, i64 0, i64 0
%12 = call i32 @execve(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %10, i8** %11)
ret i32 0
}
int f03(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @f03() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ wint_t;
typedef scalar_t__ wctrans_t;

/* Variables and functions */
int /*<<< orphan*/ wctrans_table_lookup(char const *, int /*<<< orphan*/);
wint_t __towctrans(wint_t wc, wctrans_t desc) {
  if (desc == (wctrans_t)0)
    return wc;
  return wctrans_table_lookup((const char *)desc, wc);
}


x86 assembly (clang, -O0):
<__towctrans>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1135 <__towctrans+0x25>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1144 <__towctrans+0x34>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1030 <wctrans_table_lookup@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__towctrans>:
mov    %edi,%eax
test   %rsi,%rsi
je     1121 <__towctrans+0x11>
mov    %rsi,%rdi
mov    %eax,%esi
jmp    1030 <wctrans_table_lookup@plt>
ret

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

LLVM IR (-O2):
define i32 @__towctrans(i32 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = inttoptr i64 %1 to i8*
%6 = tail call i32 @wctrans_table_lookup(i8* %5, i32 %0)
br label %7
7: ; preds = %2, %4
%8 = phi i32 [ %6, %4 ], [ %0, %2 ]
ret i32 %8
}
unsigned int unsignedint_ignoring_unsignedshortint(unsigned int x,
                                                   unsigned short int y) {
  return x;
}


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

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

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

LLVM IR (-O2):
define i32 @unsignedint_ignoring_unsignedshortint(i32 returned %0, i16 zeroext %1) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void dtor2() { printf("Destroy2!\n"); }


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

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

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

LLVM IR (-O2):
@str = [10 x i8] c"Destroy2!\00"
define void @dtor2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret void
}