xunge/DecIR huggingface dataset:
/* Type definitions */
struct IMAGE {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ int_interpret(struct IMAGE *);
int int_readfile(int /*<<< orphan*/ *, struct IMAGE *);
void int_eval(struct IMAGE *image, FILE *fi) {
  while (int_readfile(fi, image) != -1)
    int_interpret(image);
}


x86 assembly (clang, -O0):
<int_eval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <int_readfile@plt>
cmp    $0xffffffff,%eax
je     1154 <int_eval+0x34>
mov    -0x8(%rbp),%rdi
call   1030 <int_interpret@plt>
jmp    1130 <int_eval+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_eval>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
nopl   (%rax)
mov    %rbx,%rsi
call   1040 <int_readfile@plt>
cmp    $0xffffffff,%eax
je     114a <int_eval+0x2a>
mov    %rbx,%rdi
call   1030 <int_interpret@plt>
mov    %r14,%rdi
jmp    1130 <int_eval+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.IMAGE = type { i32 }
define void @int_eval(%struct.IMAGE* %0, i32* %1) {
%3 = alloca %struct.IMAGE*
%4 = alloca i32*
store %struct.IMAGE* %0, %struct.IMAGE** %3
store i32* %1, i32** %4
br label %5
5: ; preds = %10, %2
%6 = load i32*, i32** %4
%7 = load %struct.IMAGE*, %struct.IMAGE** %3
%8 = call i32 @int_readfile(i32* %6, %struct.IMAGE* %7)
%9 = icmp ne i32 %8, -1
br i1 %9, label %10, label %13
10: ; preds = %5
%11 = load %struct.IMAGE*, %struct.IMAGE** %3
%12 = call i32 @int_interpret(%struct.IMAGE* %11)
br label %5
13: ; preds = %5
ret void
}

LLVM IR (-O2):
%struct.IMAGE = type { i32 }
define void @int_eval(%struct.IMAGE* %0, i32* %1) {
%3 = tail call i32 @int_readfile(i32* %1, %struct.IMAGE* %0)
%4 = icmp eq i32 %3, -1
br i1 %4, label %9, label %5
5: ; preds = %2, %5
%6 = tail call i32 @int_interpret(%struct.IMAGE* %0)
%7 = tail call i32 @int_readfile(i32* %1, %struct.IMAGE* %0)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %5
9: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void dump(char *c, size_t l) {
  size_t i;
  for (i = 0; i < l; ++i)
    printf("%x ", c[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<dump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1161 <dump+0x51>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <dump+0x18>
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     1158 <dump+0x38>
mov    %rsi,%r12
mov    %rdi,%r14
lea    0xec6(%rip),%r15
xor    %ebx,%ebx
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <dump+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%x \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @dump(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %17, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = icmp ult i64 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = load i64, i64* %5
%13 = getelementptr inbounds i8, i8* %11, i64 %12
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i64, i64* %5
%19 = add i64 %18, 1
store i64 %19, i64* %5
br label %6
20: ; preds = %6
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%x \00"
define void @dump(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %10, %4 ], [ 0, %2 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = add nuw i64 %5, 1
%11 = icmp eq i64 %10, %1
br i1 %11, label %12, label %4
12: ; preds = %4, %2
%13 = tail call i32 @putchar(i32 10)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
time_t timestamp() {
  time_t ltime;
  ltime = time(NULL);
  return ltime;
}


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

x86 assembly (clang, -O2):
<timestamp>:
xor    %edi,%edi
jmp    1030 <time@plt>

LLVM IR (-O0):
define i32 @timestamp() {
%1 = alloca i32
%2 = call i32 @time(i32* null)
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @timestamp() {
%1 = tail call i32 @time(i32* null)
ret i32 %1
}
__attribute__((always_)) void patch_CAS_1_1_9170_extra(void) {}


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

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

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

LLVM IR (-O2):
define void @patch_CAS_1_1_9170_extra() {
ret void
}
void foo(int *p) {
  long long i = 0;
#pragma omp target device(i)
  ;
#pragma omp target update device(i) to(p[0])
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @foo(i32* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ __pmp_scheduler_init(int, int, int /*<<< orphan*/,
                                        int /*<<< orphan*/, int /*<<< orphan*/,
                                        int /*<<< orphan*/);
void __ompc_scheduler_init_4(int global_id, int sched, int lower, int upper,
                             int inc, int chunk) {
  ;
  __pmp_scheduler_init(global_id, sched, (int64_t)lower, (int64_t)upper,
                       (int64_t)inc, (int64_t)chunk);
}


x86 assembly (clang, -O0):
<__ompc_scheduler_init_4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
call   1030 <__pmp_scheduler_init@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @__ompc_scheduler_init_4(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = load i32, i32* %10
%17 = load i32, i32* %11
%18 = load i32, i32* %12
%19 = call i32 @__pmp_scheduler_init(i32 %13, i32 %14, i32 %15, i32 %16, i32 %17, i32 %18)
ret void
}

LLVM IR (-O2):
define void @__ompc_scheduler_init_4(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = tail call i32 @__pmp_scheduler_init(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5)
ret void
}
double modulus(double x) {
  if (x >= 0)
    return x;
  else
    return -x;
}


x86 assembly (clang, -O0):
<modulus>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     112a <modulus+0x2a>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    114b <modulus+0x4b>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<modulus>:
movapd 0xef8(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm1,%xmm1
cmpnlesd %xmm0,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @modulus(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp oge double %4, 0.000000e+00
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load double, double* %3
store double %7, double* %2
br label %11
8: ; preds = %1
%9 = load double, double* %3
%10 = fneg double %9
store double %10, double* %2
br label %11
11: ; preds = %8, %6
%12 = load double, double* %2
ret double %12
}

LLVM IR (-O2):
define double @modulus(double %0) {
%2 = fcmp ult double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
ret double %4
}
int SERVER_invalid_command(char *buffer) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @SERVER_invalid_command(i8* nocapture readnone %0) {
ret i32 1
}
/* Type definitions */
struct timeval {
  int /*<<< orphan*/ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ srandom(int /*<<< orphan*/);
int prepare_buffers() {
  struct timeval t;
  gettimeofday(&t, NULL);
  srandom(t.tv_usec);
  return 0;
}


x86 assembly (clang, -O0):
<prepare_buffers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <gettimeofday@plt>
mov    -0x8(%rbp),%edi
call   1030 <srandom@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prepare_buffers>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1040 <gettimeofday@plt>
mov    (%rsp),%edi
call   1030 <srandom@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i32 @prepare_buffers() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = call i32 @srandom(i32 %4)
ret i32 0
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i32 @prepare_buffers() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = tail call i32 @srandom(i32 %5)
ret i32 0
}
/* Variables and functions */
double __infer_nondet_double();
double acosh(double x) { return __infer_nondet_double(); }


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

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

LLVM IR (-O0):
define double @acosh(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call double (...) @__infer_nondet_double()
ret double %3
}

LLVM IR (-O2):
define double @acosh(double %0) {
%2 = tail call double (...) @__infer_nondet_double()
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
int /*<<< orphan*/ g(int);
int get();
int h(int i) {
  if (i < 42) {
    f(i);
  } else {
    g(i);
  }
  return get();
}


x86 assembly (clang, -O0):
<h>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x2a,-0x4(%rbp)
jge    1152 <h+0x22>
mov    -0x4(%rbp),%edi
call   1030 <f@plt>
jmp    115a <h+0x2a>
mov    -0x4(%rbp),%edi
call   1050 <g@plt>
mov    $0x0,%al
call   1040 <get@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h>:
push   %rax
cmp    $0x29,%edi
jg     113d <h+0xd>
call   1030 <f@plt>
jmp    1142 <h+0x12>
call   1050 <g@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <get@plt>

LLVM IR (-O0):
define i32 @h(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 42
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @f(i32 %6)
br label %11
8: ; preds = %1
%9 = load i32, i32* %2
%10 = call i32 @g(i32 %9)
br label %11
11: ; preds = %8, %5
%12 = call i32 (...) @get()
ret i32 %12
}

LLVM IR (-O2):
define i32 @h(i32 %0) {
%2 = icmp slt i32 %0, 42
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @f(i32 %0)
br label %7
5: ; preds = %1
%6 = tail call i32 @g(i32 %0)
br label %7
7: ; preds = %5, %3
%8 = tail call i32 (...) @get()
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
FILE *open_file(char *s, char *mode) {
  FILE *f = fopen(s, mode);
  if (!f) {
    fprintf(stderr, "ERROR: cannot open file %s\n", s);
    exit(1);
  }
  return f;
}


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

x86 assembly (clang, -O2):
<open_file>:
push   %rbx
mov    %rdi,%rbx
call   1040 <fopen@plt>
test   %rax,%rax
je     1140 <open_file+0x10>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"ERROR: cannot open file %s\0A\00"
define noalias i32* @open_file(i8* %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %0)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
ret i32* %3
}
int I_NoAppServicesLobbyGetReady(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @I_NoAppServicesLobbyGetReady() {
ret i32 0
}
void intel_display_debugfs_register(struct drm_i915_private *i915) {}


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

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

LLVM IR (-O0):
%struct.drm_i915_private = type opaque
define void @intel_display_debugfs_register(%struct.drm_i915_private* %0) {
%2 = alloca %struct.drm_i915_private*
store %struct.drm_i915_private* %0, %struct.drm_i915_private** %2
ret void
}

LLVM IR (-O2):
%struct.drm_i915_private = type opaque
define void @intel_display_debugfs_register(%struct.drm_i915_private* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void moveto(int col, int row) { printf("\33[%u;%uH", row, col); }


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"\1B[%u;%uH\00"
define void @moveto(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"\1B[%u;%uH\00"
define void @moveto(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0)
ret void
}
int test_imm_32uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x32 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_32uint64_lowword_mem>:
testb  $0x32,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_32uint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 50
%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_32uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 50
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int max_my(int a, int b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<max_my>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <max_my+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <max_my+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_my>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @max_my(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;
typedef int int32_t;

/* Variables and functions */
void s24_to_bigendian(uint8_t *dst, int32_t s24) {
  dst[0] = (s24 >> 16) & 0xFF;
  dst[1] = (s24 >> 8) & 0xFF;
  dst[2] = s24 & 0xFF;
}


x86 assembly (clang, -O0):
<s24_to_bigendian>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x10,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<s24_to_bigendian>:
mov    %esi,%eax
movzbl %ah,%ecx
movzbl %al,%edx
shr    $0x10,%eax
movzbl %al,%eax
mov    %eax,(%rdi)
mov    %ecx,0x4(%rdi)
mov    %edx,0x8(%rdi)
ret

LLVM IR (-O0):
define void @s24_to_bigendian(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 16
%7 = and i32 %6, 255
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 0
store i32 %7, i32* %9
%10 = load i32, i32* %4
%11 = ashr i32 %10, 8
%12 = and i32 %11, 255
%13 = load i32*, i32** %3
%14 = getelementptr inbounds i32, i32* %13, i64 1
store i32 %12, i32* %14
%15 = load i32, i32* %4
%16 = and i32 %15, 255
%17 = load i32*, i32** %3
%18 = getelementptr inbounds i32, i32* %17, i64 2
store i32 %16, i32* %18
ret void
}

LLVM IR (-O2):
define void @s24_to_bigendian(i32* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 16
%4 = and i32 %3, 255
store i32 %4, i32* %0
%5 = lshr i32 %1, 8
%6 = and i32 %5, 255
%7 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %6, i32* %7
%8 = and i32 %1, 255
%9 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %8, i32* %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int do_invalid_stuff() {
  printf("The serial number is invalid!\n");
  exit(1);
}


x86 assembly (clang, -O0):
<do_invalid_stuff>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<do_invalid_stuff>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"The serial number is invalid!\0A\00"
define i32 @do_invalid_stuff() {
%1 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [30 x i8] c"The serial number is invalid!\00"
define i32 @do_invalid_stuff() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
a() { return 5; }


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

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

LLVM IR (-O0):
define i32 @a() {
ret i32 5
}

LLVM IR (-O2):
define i32 @a() {
ret i32 5
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
uint64_t bmin_uint64(uint64_t a, uint64_t b) { return (a < b ? a : b); }


x86 assembly (clang, -O0):
<bmin_uint64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1127 <bmin_uint64+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <bmin_uint64+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bmin_uint64>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovl  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @bmin_uint64(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
void uh_tls_client_detach(struct client *cl) {}


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

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

LLVM IR (-O0):
%struct.client = type opaque
define void @uh_tls_client_detach(%struct.client* %0) {
%2 = alloca %struct.client*
store %struct.client* %0, %struct.client** %2
ret void
}

LLVM IR (-O2):
%struct.client = type opaque
define void @uh_tls_client_detach(%struct.client* nocapture %0) {
ret void
}
/* Variables and functions */
int test_hello();
int main() { return -test_hello(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_hello()
%3 = sub nsw i32 0, %2
ret i32 %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_hello()
%2 = sub nsw i32 0, %1
ret i32 %2
}
int create_length(long msec) { return ((msec * 64) / 1000); }


x86 assembly (clang, -O0):
<create_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x6,%rax
mov    $0x3e8,%ecx
cqto
idiv   %rcx
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_length>:
mov    %rdi,%rax
shl    $0x6,%rax
movabs $0x20c49ba5e353f7cf,%rcx
9b c4 20
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
shr    $0x7,%rdx
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @create_length(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul nsw i64 %3, 64
%5 = sdiv i64 %4, 1000
%6 = trunc i64 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @create_length(i64 %0) {
%2 = shl nsw i64 %0, 6
%3 = sdiv i64 %2, 1000
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Type definitions */
struct ParsedPMinisock_cell {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ParsedPMinisock_freeCell(struct ParsedPMinisock_cell *);
void ParsedPMinisock_deleteCell(struct ParsedPMinisock_cell *cell) {
  ParsedPMinisock_freeCell(cell);
}


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

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

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

LLVM IR (-O2):
%struct.ParsedPMinisock_cell = type { i32 }
define void @ParsedPMinisock_deleteCell(%struct.ParsedPMinisock_cell* %0) {
%2 = tail call i32 @ParsedPMinisock_freeCell(%struct.ParsedPMinisock_cell* %0)
ret void
}
int issetugid() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @issetugid() {
ret i32 0
}
int littleEndian() {
  int x = 1;
  return (*(char *)&x == 1);
}


x86 assembly (clang, -O0):
<littleEndian>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
movsbl -0x4(%rbp),%eax
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @littleEndian() {
%1 = alloca i32
store i32 1, i32* %1
%2 = bitcast i32* %1 to i8*
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 1
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @littleEndian() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ CodeByte(int);
unsigned CodeEncode(unsigned n, int nflag) {
  if ((n >> 6) == 0)
    return ((n & (0x3F)) | nflag);
  CodeByte((CodeEncode((n >> 7), nflag) | (0x80)));
  return (n & (0x7F));
}


x86 assembly (clang, -O0):
<CodeEncode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x6,%eax
cmp    $0x0,%eax
jne    114e <CodeEncode+0x2e>
mov    -0x8(%rbp),%eax
and    $0x3f,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1172 <CodeEncode+0x52>
mov    -0x8(%rbp),%edi
shr    $0x7,%edi
mov    -0xc(%rbp),%esi
call   1040 <CodeEncode@plt>
mov    %eax,%edi
or     $0x80,%edi
call   1030 <CodeByte@plt>
mov    -0x8(%rbp),%eax
and    $0x7f,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CodeEncode>:
push   %rbx
mov    %edi,%ebx
cmp    $0x3f,%edi
ja     112c <CodeEncode+0xc>
or     %ebx,%esi
jmp    1147 <CodeEncode+0x27>
mov    %ebx,%edi
shr    $0x7,%edi
call   1040 <CodeEncode@plt>
or     $0x80,%eax
mov    %eax,%edi
call   1030 <CodeByte@plt>
and    $0x7f,%ebx
mov    %ebx,%esi
mov    %esi,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @CodeEncode(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = lshr i32 %6, 6
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i32, i32* %4
%11 = and i32 %10, 63
%12 = load i32, i32* %5
%13 = or i32 %11, %12
store i32 %13, i32* %3
br label %23
14: ; preds = %2
%15 = load i32, i32* %4
%16 = lshr i32 %15, 7
%17 = load i32, i32* %5
%18 = call i32 @CodeEncode(i32 %16, i32 %17)
%19 = or i32 %18, 128
%20 = call i32 @CodeByte(i32 %19)
%21 = load i32, i32* %4
%22 = and i32 %21, 127
store i32 %22, i32* %3
br label %23
23: ; preds = %14, %9
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @CodeEncode(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, 64
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = or i32 %1, %0
br label %6
6: ; preds = %4, %8
%7 = phi i32 [ %13, %8 ], [ %5, %4 ]
ret i32 %7
8: ; preds = %2
%9 = lshr i32 %0, 7
%10 = tail call i32 @CodeEncode(i32 %9, i32 %1)
%11 = or i32 %10, 128
%12 = tail call i32 @CodeByte(i32 %11)
%13 = and i32 %0, 127
br label %6
}
/* Variables and functions */
int getch();
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int ch;
  printf("Hello, world!\n");
  ch = getch();
  printf("[ %d ]\n", ch);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed0(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <getch@plt>
lea    0xeb5(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str.1 = [8 x i8] c"[ %d ]\0A\00"
@str = [14 x i8] c"Hello, world!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @getch()
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ bitstuff(char *);
int /*<<< orphan*/ bitunstuff(char *);
int main(int argc, char *argv[]) {
  bitstuff(argv[1]);
  bitunstuff(argv[1]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <bitstuff@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <bitunstuff@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1030 <bitstuff@plt>
mov    0x8(%rbx),%rdi
call   1040 <bitunstuff@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = getelementptr inbounds i8*, i8** %5, i64 1
%7 = load i8*, i8** %6
%8 = call i32 @bitstuff(i8* %7)
%9 = load i8**, i8*** %4
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @bitunstuff(i8* %11)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @bitstuff(i8* %4)
%6 = load i8*, i8** %3
%7 = tail call i32 @bitunstuff(i8* %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ foo(int, float *, float *, float *, float *, float *,
                       float *);
int main() {
  float x[14], y[14], z[14], f3[14], f1[14], w[14];
  foo(14, x, y, z, f3, f1, w);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x190,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rsi
lea    -0x80(%rbp),%rdx
lea    -0xc0(%rbp),%rcx
lea    -0x100(%rbp),%r8
lea    -0x140(%rbp),%r9
lea    -0x180(%rbp),%rax
mov    $0xe,%edi
mov    %rax,(%rsp)
call   1030 <foo@plt>
xor    %eax,%eax
add    $0x190,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x188,%rsp
lea    0x10(%rsp),%rax
mov    %rax,(%rsp)
lea    0x150(%rsp),%rsi
lea    0x110(%rsp),%rdx
lea    0xd0(%rsp),%rcx
lea    0x90(%rsp),%r8
lea    0x50(%rsp),%r9
mov    $0xe,%edi
call   1030 <foo@plt>
xor    %eax,%eax
add    $0x188,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [14 x float]
%3 = alloca [14 x float]
%4 = alloca [14 x float]
%5 = alloca [14 x float]
%6 = alloca [14 x float]
%7 = alloca [14 x float]
store i32 0, i32* %1
%8 = getelementptr inbounds [14 x float], [14 x float]* %2, i64 0, i64 0
%9 = getelementptr inbounds [14 x float], [14 x float]* %3, i64 0, i64 0
%10 = getelementptr inbounds [14 x float], [14 x float]* %4, i64 0, i64 0
%11 = getelementptr inbounds [14 x float], [14 x float]* %5, i64 0, i64 0
%12 = getelementptr inbounds [14 x float], [14 x float]* %6, i64 0, i64 0
%13 = getelementptr inbounds [14 x float], [14 x float]* %7, i64 0, i64 0
%14 = call i32 @foo(i32 14, float* %8, float* %9, float* %10, float* %11, float* %12, float* %13)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [14 x float]
%2 = alloca [14 x float]
%3 = alloca [14 x float]
%4 = alloca [14 x float]
%5 = alloca [14 x float]
%6 = alloca [14 x float]
%7 = bitcast [14 x float]* %1 to i8*
%8 = bitcast [14 x float]* %2 to i8*
%9 = bitcast [14 x float]* %3 to i8*
%10 = bitcast [14 x float]* %4 to i8*
%11 = bitcast [14 x float]* %5 to i8*
%12 = bitcast [14 x float]* %6 to i8*
%13 = getelementptr inbounds [14 x float], [14 x float]* %1, i64 0, i64 0
%14 = getelementptr inbounds [14 x float], [14 x float]* %2, i64 0, i64 0
%15 = getelementptr inbounds [14 x float], [14 x float]* %3, i64 0, i64 0
%16 = getelementptr inbounds [14 x float], [14 x float]* %4, i64 0, i64 0
%17 = getelementptr inbounds [14 x float], [14 x float]* %5, i64 0, i64 0
%18 = getelementptr inbounds [14 x float], [14 x float]* %6, i64 0, i64 0
%19 = call i32 @foo(i32 14, float* %13, float* %14, float* %15, float* %16, float* %17, float* %18)
ret i32 0
}
int pldummy_ljii() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @pldummy_ljii() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ z();
fff(unsigned long long i) {
  if (i & 0xfff0000000000ull)
    z();
}


x86 assembly (clang, -O0):
<fff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
movabs $0xfff0000000000,%rax
and    -0x10(%rbp),%rax
cmp    $0x0,%rax
je     113b <fff+0x2b>
mov    $0x0,%al
call   1030 <z@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fff>:
movabs $0xfff0000000000,%rax
test   %rax,%rdi
je     112b <fff+0x1b>
push   %rax
xor    %eax,%eax
call   1030 <z@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @fff(i64 %0) {
%2 = alloca i32
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = and i64 %4, 4502500115742720
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 (...) @z()
br label %9
9: ; preds = %7, %1
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @fff(i64 %0) {
%2 = and i64 %0, 4502500115742720
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (...) @z()
br label %6
6: ; preds = %4, %1
ret i32 undef
}
/* Type definitions */
struct channel {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ UNUSED(struct channel *);
void channel_set_current(struct channel *c) { UNUSED(c); }


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

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

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

LLVM IR (-O2):
%struct.channel = type { i32 }
define void @channel_set_current(%struct.channel* %0) {
%2 = tail call i32 @UNUSED(%struct.channel* %0)
ret void
}
int null_event_handler(struct fgui_widget *widget, struct fgui_event *event) {
  return 1;
}


x86 assembly (clang, -O0):
<null_event_handler>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.fgui_widget = type opaque
%struct.fgui_event = type opaque
define i32 @null_event_handler(%struct.fgui_widget* %0, %struct.fgui_event* %1) {
%3 = alloca %struct.fgui_widget*
%4 = alloca %struct.fgui_event*
store %struct.fgui_widget* %0, %struct.fgui_widget** %3
store %struct.fgui_event* %1, %struct.fgui_event** %4
ret i32 1
}

LLVM IR (-O2):
%struct.fgui_widget = type opaque
%struct.fgui_event = type opaque
define i32 @null_event_handler(%struct.fgui_widget* nocapture readnone %0, %struct.fgui_event* nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
int ENODEV;
int sci_adi_init(void) { return -ENODEV; }


x86 assembly (clang, -O0):
<sci_adi_init>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    0x2ed3(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sci_adi_init>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@ENODEV = global i32 0
define i32 @sci_adi_init() {
%1 = load i32, i32* @ENODEV
%2 = sub nsw i32 0, %1
ret i32 %2
}

LLVM IR (-O2):
@ENODEV = global i32 0
define i32 @sci_adi_init() {
%1 = load i32, i32* @ENODEV
%2 = sub nsw i32 0, %1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ fsize(char *);
int main(int argc, char *argv[]) {
  if (argc == 1) {
    fsize(".");
  } else {
    while (--argc > 0) {
      fsize(*++argv);
    }
  }
  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)
cmpl   $0x1,-0x8(%rbp)
jne    1141 <main+0x31>
lea    0xec9(%rip),%rdi
call   1030 <fsize@plt>
jmp    117a <main+0x6a>
jmp    1146 <main+0x36>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1175 <main+0x65>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rdi
call   1030 <fsize@plt>
jmp    1146 <main+0x36>
jmp    117a <main+0x6a>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
cmp    $0x1,%edi
jne    1126 <main+0x16>
lea    0xee1(%rip),%rdi
call   1030 <fsize@plt>
jmp    1154 <main+0x44>
jle    1154 <main+0x44>
mov    %rsi,%rbx
mov    %edi,%ebp
add    $0x8,%rbx
add    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%rbx),%rdi
call   1030 <fsize@plt>
add    $0x8,%rbx
add    $0xffffffff,%ebp
cmp    $0x2,%ebp
ja     1140 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c".\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 = load i32, i32* %4
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @fsize(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %21
10: ; preds = %2
br label %11
11: ; preds = %15, %10
%12 = load i32, i32* %4
%13 = add nsw i32 %12, -1
store i32 %13, i32* %4
%14 = icmp sgt i32 %13, 0
br i1 %14, label %15, label %20
15: ; preds = %11
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i32 1
store i8** %17, i8*** %5
%18 = load i8*, i8** %17
%19 = call i32 @fsize(i8* %18)
br label %11
20: ; preds = %11
br label %21
21: ; preds = %20, %8
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = icmp sgt i32 %0, 1
br i1 %5, label %8, label %16
6: ; preds = %2
%7 = tail call i32 @fsize(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %16
8: ; preds = %4, %8
%9 = phi i8** [ %12, %8 ], [ %1, %4 ]
%10 = phi i32 [ %11, %8 ], [ %0, %4 ]
%11 = add nsw i32 %10, -1
%12 = getelementptr inbounds i8*, i8** %9, i64 1
%13 = load i8*, i8** %12
%14 = tail call i32 @fsize(i8* %13)
%15 = icmp ugt i32 %10, 2
br i1 %15, label %8, label %16
16: ; preds = %8, %4, %6
ret i32 0
}
double topocentric_zenith_angle(double e) { return 90.0 - e; }


x86 assembly (clang, -O0):
<topocentric_zenith_angle>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<topocentric_zenith_angle>:
movsd  0xef8(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @topocentric_zenith_angle(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double 9.000000e+01, %3
ret double %4
}

LLVM IR (-O2):
define double @topocentric_zenith_angle(double %0) {
%2 = fsub double 9.000000e+01, %0
ret double %2
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
int rdd08sdp_get_length(int const *);
uint16_t rdd08sdp_get_counter(const uint16_t *p_rdd08) {
  uint8_t i_length = rdd08sdp_get_length(p_rdd08);
  return ((p_rdd08[i_length - 3] & 0xff) << 8) | (p_rdd08[i_length - 2] & 0xff);
}


x86 assembly (clang, -O0):
<rdd08sdp_get_counter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <rdd08sdp_get_length@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x3,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
and    $0xff,%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%edx
sub    $0x2,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,4),%ecx
and    $0xff,%ecx
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdd08sdp_get_counter>:
push   %rbx
mov    %rdi,%rbx
call   1030 <rdd08sdp_get_length@plt>
cltq
mov    -0xc(%rbx,%rax,4),%ecx
shl    $0x8,%ecx
movzwl %cx,%ecx
movzbl -0x8(%rbx,%rax,4),%eax
or     %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @rdd08sdp_get_counter(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @rdd08sdp_get_length(i32* %4)
store i32 %5, i32* %3
%6 = load i32*, i32** %2
%7 = load i32, i32* %3
%8 = sub nsw i32 %7, 3
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %6, i64 %9
%11 = load i32, i32* %10
%12 = and i32 %11, 255
%13 = shl i32 %12, 8
%14 = load i32*, i32** %2
%15 = load i32, i32* %3
%16 = sub nsw i32 %15, 2
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %14, i64 %17
%19 = load i32, i32* %18
%20 = and i32 %19, 255
%21 = or i32 %13, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @rdd08sdp_get_counter(i32* %0) {
%2 = tail call i32 @rdd08sdp_get_length(i32* %0)
%3 = add nsw i32 %2, -3
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = shl i32 %6, 8
%8 = and i32 %7, 65280
%9 = add nsw i32 %2, -2
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = and i32 %12, 255
%14 = or i32 %8, %13
ret i32 %14
}
int M(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @M() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void __attribute__((noreturn)) die(void) { abort(); }


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

x86 assembly (clang, -O2):
<die>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @die() {
%1 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @die() {
%1 = tail call i32 (...) @abort()
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3_vfs;

/* Variables and functions */
int /*<<< orphan*/ usleep(int);
int unixSleep(sqlite3_vfs *NotUsed, int microseconds) {
  usleep(microseconds);
  (void)(NotUsed);
  return microseconds;
}


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

x86 assembly (clang, -O2):
<unixSleep>:
push   %rbx
mov    %esi,%ebx
mov    %esi,%edi
call   1030 <usleep@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @unixSleep(i32* nocapture readnone %0, i32 returned %1) {
%3 = tail call i32 @usleep(i32 %1)
ret i32 %1
}