xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ streamStats_stats_withSetLongerThenShorter_correct();
void test_streamStats_all() {
  printf("================================ Testing StreamStats\n");
  streamStats_stats_withSetLongerThenShorter_correct();
  printf("================================ End StreamStats Test: Success\n");
}


x86 assembly (clang, -O0):
<test_streamStats_all>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <streamStats_stats_withSetLongerThenShorter_correct@plt>
lea    0xef8(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_streamStats_all>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <streamStats_stats_withSetLongerThenShorter_correct@plt>
lea    0xefa(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [54 x i8] c"================================ Testing StreamStats\0A\00"
@.str.1 = [64 x i8] c"================================ End StreamStats Test: Success\0A\00"
define void @test_streamStats_all() {
%1 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @streamStats_stats_withSetLongerThenShorter_correct()
%3 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [53 x i8] c"================================ Testing StreamStats\00"
@str.2 = [63 x i8] c"================================ End StreamStats Test: Success\00"
define void @test_streamStats_all() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @streamStats_stats_withSetLongerThenShorter_correct()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sync();
int fsync(int fd) {
  sync();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @fsync(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @sync()
ret i32 0
}

LLVM IR (-O2):
define i32 @fsync(i32 %0) {
%2 = tail call i32 (...) @sync()
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned long window;
};
struct TYPE_4__ {
  TYPE_1__ xconfigure;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xconfigure_window(void *_p, unsigned long _v) {
  ((XEvent *)_p)->xconfigure.window = (unsigned long)_v;
}


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

x86 assembly (clang, -O2):
<set_XEvent_xconfigure_window>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define void @set_XEvent_xconfigure_window(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i64 %5, i64* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xconfigure_window(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
int test_imm_E7uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0xE7 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_E7uint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 16
%5 = and i64 %4, 231
%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_E7uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 15138816
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
scalar_t__ tag_readblock(int /*<<< orphan*/, char *);
void print_header(void) {
  char buf[16];
  if (tag_readblock(0, buf)) {
  }
}


x86 assembly (clang, -O0):
<print_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rsi
xor    %edi,%edi
call   1030 <tag_readblock@plt>
cmp    $0x0,%rax
je     1132 <print_header+0x22>
jmp    1132 <print_header+0x22>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_header>:
sub    $0x18,%rsp
mov    %rsp,%rsi
xor    %edi,%edi
call   1030 <tag_readblock@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @print_header() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = call i64 @tag_readblock(i32 0, i8* %2)
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
br label %6
6: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
define void @print_header() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = call i64 @tag_readblock(i32 0, i8* %2)
ret void
}
char *chase_symlinks(const char *file) { return 0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @chase_symlinks(i8* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ flush_problems();
int /*<<< orphan*/ problem(int /*<<< orphan*/, char *);
void punt(char *msg) {
  problem(0, msg);
  flush_problems();
  exit(8);
}


x86 assembly (clang, -O0):
<punt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
xor    %edi,%edi
call   1030 <problem@plt>
mov    $0x0,%al
call   1040 <flush_problems@plt>
mov    $0x8,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<punt>:
push   %rax
mov    %rdi,%rsi
xor    %edi,%edi
call   1030 <problem@plt>
xor    %eax,%eax
call   1040 <flush_problems@plt>
mov    $0x8,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define void @punt(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @problem(i32 0, i8* %3)
%5 = call i32 (...) @flush_problems()
%6 = call i32 @exit(i32 8)
unreachable
}

LLVM IR (-O2):
define void @punt(i8* %0) {
%2 = tail call i32 @problem(i32 0, i8* %0)
%3 = tail call i32 (...) @flush_problems()
%4 = tail call i32 @exit(i32 8)
unreachable
}
/* Variables and functions */
scalar_t__ iswhite(char);
void skipwhite(char **sp) {
  char *s = *sp;
  while (iswhite(*s))
    s++;
  *sp = s;
}


x86 assembly (clang, -O0):
<skipwhite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <iswhite@plt>
cmp    $0x0,%rax
je     114e <skipwhite+0x3e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1127 <skipwhite+0x17>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipwhite>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rbx
add    $0xffffffffffffffff,%rbx
xchg   %ax,%ax
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <iswhite@plt>
test   %rax,%rax
jne    1120 <skipwhite+0x10>
mov    %rbx,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @skipwhite(i8** nocapture %0) {
%2 = load i8*, i8** %0
br label %3
3: ; preds = %3, %1
%4 = phi i8* [ %2, %1 ], [ %8, %3 ]
%5 = load i8, i8* %4
%6 = tail call i64 @iswhite(i8 signext %5)
%7 = icmp eq i64 %6, 0
%8 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %7, label %9, label %3
9: ; preds = %3
store i8* %4, i8** %0
ret void
}
void fill_buf(char *buf, int pos) { buf[pos] = 0; }


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

x86 assembly (clang, -O2):
<fill_buf>:
movslq %esi,%rax
movb   $0x0,(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @fill_buf(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
store i8 0, i8* %8
ret void
}

LLVM IR (-O2):
define void @fill_buf(i8* nocapture writeonly %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
store i8 0, i8* %4
ret void
}
/* Variables and functions */
double *malloc(int);
double *realloc(double *, int);
double sum_array(double *, int);
double realloc_test() {
  double *x = malloc(2 * sizeof(double));
  x[0] = 41;
  x[1] = 42;
  double *y = realloc(x, 4 * sizeof(double));
  y[2] = 43;
  y[3] = 44;
  return sum_array(y, 4);
}


x86 assembly (clang, -O0):
<realloc_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x10,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xec6(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0xeae(%rip),%xmm0
movsd  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rdi
mov    $0x20,%esi
call   1050 <realloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  0xe83(%rip),%xmm0
movsd  %xmm0,0x10(%rax)
mov    -0x10(%rbp),%rax
movsd  0xe6a(%rip),%xmm0
movsd  %xmm0,0x18(%rax)
mov    -0x10(%rbp),%rdi
mov    $0x4,%esi
call   1030 <sum_array@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<realloc_test>:
push   %rax
mov    $0x10,%edi
call   1040 <malloc@plt>
movaps 0xebe(%rip),%xmm0
movups %xmm0,(%rax)
mov    %rax,%rdi
mov    $0x20,%esi
call   1050 <realloc@plt>
movaps 0xeb7(%rip),%xmm0
movups %xmm0,0x10(%rax)
mov    %rax,%rdi
mov    $0x4,%esi
pop    %rax
jmp    1030 <sum_array@plt>

LLVM IR (-O0):
define double @realloc_test() {
%1 = alloca double*
%2 = alloca double*
%3 = call double* @malloc(i32 16)
store double* %3, double** %1
%4 = load double*, double** %1
%5 = getelementptr inbounds double, double* %4, i64 0
store double 4.100000e+01, double* %5
%6 = load double*, double** %1
%7 = getelementptr inbounds double, double* %6, i64 1
store double 4.200000e+01, double* %7
%8 = load double*, double** %1
%9 = call double* @realloc(double* %8, i32 32)
store double* %9, double** %2
%10 = load double*, double** %2
%11 = getelementptr inbounds double, double* %10, i64 2
store double 4.300000e+01, double* %11
%12 = load double*, double** %2
%13 = getelementptr inbounds double, double* %12, i64 3
store double 4.400000e+01, double* %13
%14 = load double*, double** %2
%15 = call double @sum_array(double* %14, i32 4)
ret double %15
}

LLVM IR (-O2):
define double @realloc_test() {
%1 = tail call double* @malloc(i32 16)
%2 = bitcast double* %1 to <2 x double>*
store <2 x double> <double 4.100000e+01, double 4.200000e+01>, <2 x double>* %2
%3 = tail call double* @realloc(double* %1, i32 32)
%4 = getelementptr inbounds double, double* %3, i64 2
%5 = bitcast double* %4 to <2 x double>*
store <2 x double> <double 4.300000e+01, double 4.400000e+01>, <2 x double>* %5
%6 = tail call double @sum_array(double* %3, i32 4)
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ verify_v3_kdf(char *, char *, char *, char *, char *);
void test_v3_kdf_Passphrase(void) {
  verify_v3_kdf("Passphrase", "3", "this is a bit longer password",
                "0304050607080102",
                "71343acb 1e9675b0 16ac65dc fe5ddac2 e57ed9c3 5565fdbb "
                "2dd6d2ce fe263d5b");
}


x86 assembly (clang, -O0):
<test_v3_kdf_Passphrase>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee9(%rip),%rsi
lea    0xee4(%rip),%rdx
lea    0xefb(%rip),%rcx
lea    0xf05(%rip),%r8
call   1030 <verify_v3_kdf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_v3_kdf_Passphrase>:
lea    0xee9(%rip),%rdi
lea    0xeed(%rip),%rsi
lea    0xee8(%rip),%rdx
lea    0xeff(%rip),%rcx
lea    0xf09(%rip),%r8
jmp    1030 <verify_v3_kdf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"Passphrase\00"
@.str.1 = [2 x i8] c"3\00"
@.str.2 = [30 x i8] c"this is a bit longer password\00"
@.str.3 = [17 x i8] c"0304050607080102\00"
@.str.4 = [72 x i8] c"71343acb 1e9675b0 16ac65dc fe5ddac2 e57ed9c3 5565fdbb 2dd6d2ce fe263d5b\00"
define void @test_v3_kdf_Passphrase() {
%1 = call i32 @verify_v3_kdf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"Passphrase\00"
@.str.1 = [2 x i8] c"3\00"
@.str.2 = [30 x i8] c"this is a bit longer password\00"
@.str.3 = [17 x i8] c"0304050607080102\00"
@.str.4 = [72 x i8] c"71343acb 1e9675b0 16ac65dc fe5ddac2 e57ed9c3 5565fdbb 2dd6d2ce fe263d5b\00"
define void @test_v3_kdf_Passphrase() {
%1 = tail call i32 @verify_v3_kdf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.4, i64 0, i64 0))
ret void
}
double pathconN_nm2_sign(double x) { return x < 0 ? -1 : x > 0 ? 1 : x; }


x86 assembly (clang, -O0):
<pathconN_nm2_sign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1129 <pathconN_nm2_sign+0x29>
movsd  0xee9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1161 <pathconN_nm2_sign+0x61>
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    114d <pathconN_nm2_sign+0x4d>
movsd  0xebd(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1157 <pathconN_nm2_sign+0x57>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathconN_nm2_sign>:
xorpd  %xmm1,%xmm1
xorpd  %xmm2,%xmm2
cmpltsd %xmm0,%xmm2
movsd  0xeeb(%rip),%xmm3
andpd  %xmm2,%xmm3
andnpd %xmm0,%xmm2
orpd   %xmm3,%xmm2
cmpltsd %xmm1,%xmm0
movapd %xmm0,%xmm1
andnpd %xmm2,%xmm1
movsd  0xed2(%rip),%xmm2
andpd  %xmm2,%xmm0
orpd   %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @pathconN_nm2_sign(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %6
5: ; preds = %1
br label %14
6: ; preds = %1
%7 = load double, double* %2
%8 = fcmp ogt double %7, 0.000000e+00
br i1 %8, label %9, label %10
9: ; preds = %6
br label %12
10: ; preds = %6
%11 = load double, double* %2
br label %12
12: ; preds = %10, %9
%13 = phi double [ 1.000000e+00, %9 ], [ %11, %10 ]
br label %14
14: ; preds = %12, %5
%15 = phi double [ -1.000000e+00, %5 ], [ %13, %12 ]
ret double %15
}

LLVM IR (-O2):
define double @pathconN_nm2_sign(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fcmp ogt double %0, 0.000000e+00
%4 = select i1 %3, double 1.000000e+00, double %0
%5 = select i1 %2, double -1.000000e+00, double %4
ret double %5
}
/* Variables and functions */
double log(double);
double rand_val(int /*<<< orphan*/);
double exponential(double x) {
  double z;
  do {
    z = rand_val(0);
  } while ((z == 0) || (z == 1));
  return (-x * log(z));
}


x86 assembly (clang, -O0):
<exponential>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
xor    %edi,%edi
call   1030 <rand_val@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x1,%al
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x11(%rbp)
jne    115b <exponential+0x3b>
jp     115b <exponential+0x3b>
jmp    1177 <exponential+0x57>
movsd  -0x10(%rbp),%xmm0
movsd  0xe98(%rip),%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    112d <exponential+0xd>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exponential>:
sub    $0x18,%rsp
movapd %xmm0,(%rsp)
nopl   0x0(%rax)
xor    %edi,%edi
call   1030 <rand_val@plt>
ucomisd 0xec9(%rip),%xmm0
jne    1143 <exponential+0x23>
jnp    1130 <exponential+0x10>
ucomisd 0xeb5(%rip),%xmm0
jne    114f <exponential+0x2f>
jnp    1130 <exponential+0x10>
movaps (%rsp),%xmm1
xorps  0xeb6(%rip),%xmm1
movaps %xmm1,(%rsp)
call   1040 <log@plt>
mulsd  (%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @exponential(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
br label %4
4: ; preds = %12, %1
%5 = call double @rand_val(i32 0)
store double %5, double* %3
br label %6
6: ; preds = %4
%7 = load double, double* %3
%8 = fcmp oeq double %7, 0.000000e+00
br i1 %8, label %12, label %9
9: ; preds = %6
%10 = load double, double* %3
%11 = fcmp oeq double %10, 1.000000e+00
br label %12
12: ; preds = %9, %6
%13 = phi i1 [ true, %6 ], [ %11, %9 ]
br i1 %13, label %4, label %14
14: ; preds = %12
%15 = load double, double* %2
%16 = fneg double %15
%17 = load double, double* %3
%18 = call double @log(double %17)
%19 = fmul double %16, %18
ret double %19
}

LLVM IR (-O2):
define double @exponential(double %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call double @rand_val(i32 0)
%4 = fcmp oeq double %3, 0.000000e+00
%5 = fcmp oeq double %3, 1.000000e+00
%6 = or i1 %4, %5
br i1 %6, label %2, label %7
7: ; preds = %2
%8 = fneg double %0
%9 = tail call double @log(double %3)
%10 = fmul double %9, %8
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ _dump_buf_with_offset(unsigned char *, int,
                                         int /*<<< orphan*/);
_dump_buf(unsigned char *p, int s) { _dump_buf_with_offset(p, s, 0); }


x86 assembly (clang, -O0):
<_dump_buf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
xor    %edx,%edx
call   1030 <_dump_buf_with_offset@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @_dump_buf(i8* %0, i32 %1) {
%3 = tail call i32 @_dump_buf_with_offset(i8* %0, i32 %1, i32 0)
ret i32 undef
}
char *undotslash(char *p) {
  if (*p == '.' && p[1] == '/')
    return p + 2;
  return p;
}


x86 assembly (clang, -O0):
<undotslash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    113a <undotslash+0x3a>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x2f,%eax
jne    113a <undotslash+0x3a>
mov    -0x10(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
jmp    1142 <undotslash+0x42>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<undotslash>:
mov    %rdi,%rax
cmpb   $0x2e,(%rdi)
jne    1115 <undotslash+0x15>
xor    %ecx,%ecx
cmpb   $0x2f,0x1(%rax)
sete   %cl
lea    (%rax,%rcx,2),%rax
ret

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

LLVM IR (-O2):
define i8* @undotslash(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 46
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 47
%8 = select i1 %7, i64 2, i64 0
%9 = getelementptr i8, i8* %0, i64 %8
br label %10
10: ; preds = %4, %1
%11 = phi i8* [ %0, %1 ], [ %9, %4 ]
ret i8* %11
}
void inpout32_out(short PortAddress, short data) {}


x86 assembly (clang, -O0):
<inpout32_out>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @inpout32_out(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
ret void
}

LLVM IR (-O2):
define void @inpout32_out(i16 signext %0, i16 signext %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_cond_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/ *);
int /*<<< orphan*/ cond_signal(int /*<<< orphan*/ *);
int pthread_cond_signal(pthread_cond_t *cond) {
  assert(cond);
  cond_signal(cond);
  return 0;
}


x86 assembly (clang, -O0):
<pthread_cond_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1040 <cond_signal@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_cond_signal>:
push   %rbx
mov    %rdi,%rbx
call   1030 <assert@plt>
mov    %rbx,%rdi
call   1040 <cond_signal@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @pthread_cond_signal(i32* %0) {
%2 = tail call i32 @assert(i32* %0)
%3 = tail call i32 @cond_signal(i32* %0)
ret i32 0
}
/* Variables and functions */
int nod(int, int);
int nok(int a, int b) { return a * b / nod(a, b); }


x86 assembly (clang, -O0):
<nok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <nod@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nok>:
push   %rbx
mov    %esi,%ebx
imul   %edi,%ebx
call   1030 <nod@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @nok(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = tail call i32 @nod(i32 %0, i32 %1)
%5 = sdiv i32 %3, %4
ret i32 %5
}
char *ft_strchr(const char *s, int c) {
  char *str;
  str = (char *)s;
  while (*str && *str != c)
    str++;
  return (*str == c ? str : 0);
}


x86 assembly (clang, -O0):
<ft_strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
je     1138 <ft_strchr+0x38>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    -0xc(%rbp),%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1148 <ft_strchr+0x48>
jmp    1159 <ft_strchr+0x59>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1113 <ft_strchr+0x13>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    -0xc(%rbp),%eax
jne    1176 <ft_strchr+0x76>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    1181 <ft_strchr+0x81>
xor    %eax,%eax
mov    %rax,-0x28(%rbp)
jmp    1181 <ft_strchr+0x81>
mov    -0x28(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strchr>:
add    $0xffffffffffffffff,%rdi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl 0x1(%rdi),%ecx
add    $0x1,%rdi
test   %ecx,%ecx
je     1120 <ft_strchr+0x20>
cmp    %esi,%ecx
jne    1110 <ft_strchr+0x10>
xor    %eax,%eax
cmp    %esi,%ecx
cmove  %rdi,%rax
ret

LLVM IR (-O0):
define i8* @ft_strchr(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
br label %7
7: ; preds = %20, %2
%8 = load i8*, i8** %5
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %18
12: ; preds = %7
%13 = load i8*, i8** %5
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = load i32, i32* %4
%17 = icmp ne i32 %15, %16
br label %18
18: ; preds = %12, %7
%19 = phi i1 [ false, %7 ], [ %17, %12 ]
br i1 %19, label %20, label %23
20: ; preds = %18
%21 = load i8*, i8** %5
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %5
br label %7
23: ; preds = %18
%24 = load i8*, i8** %5
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = load i32, i32* %4
%28 = icmp eq i32 %26, %27
br i1 %28, label %29, label %31
29: ; preds = %23
%30 = load i8*, i8** %5
br label %32
31: ; preds = %23
br label %32
32: ; preds = %31, %29
%33 = phi i8* [ %30, %29 ], [ null, %31 ]
ret i8* %33
}

LLVM IR (-O2):
define i8* @ft_strchr(i8* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %10, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = sext i8 %5 to i32
%8 = icmp eq i32 %7, %1
%9 = or i1 %6, %8
%10 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %9, label %11, label %3
11: ; preds = %3
%12 = select i1 %8, i8* %4, i8* null
ret i8* %12
}
/* Variables and functions */
int /*<<< orphan*/ SetAddress(char);
void SetPage(char num) { SetAddress((num * 16000)); }


x86 assembly (clang, -O0):
<SetPage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
imul   $0x3e80,%eax,%eax
movsbl %al,%edi
call   1030 <SetAddress@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetPage>:
shl    $0x7,%dil
movsbl %dil,%edi
jmp    1030 <SetAddress@plt>

LLVM IR (-O0):
define void @SetPage(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = mul nsw i32 %4, 16000
%6 = trunc i32 %5 to i8
%7 = call i32 @SetAddress(i8 signext %6)
ret void
}

LLVM IR (-O2):
define void @SetPage(i8 signext %0) {
%2 = shl i8 %0, 7
%3 = tail call i32 @SetAddress(i8 signext %2)
ret void
}
/* Variables and functions */
void *malloc(size_t);
void *uws_malloc(size_t size) {
  void *p = malloc(size);
  return p;
}


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

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

LLVM IR (-O0):
define i8* @uws_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
define noalias i8* @uws_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
void flush_dcache_mmap_unlock(struct address_space *mapping) {}


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

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

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

LLVM IR (-O2):
%struct.address_space = type opaque
define void @flush_dcache_mmap_unlock(%struct.address_space* nocapture %0) {
ret void
}
int test_lt(void *x, void *y) { return (x < y); }


x86 assembly (clang, -O0):
<test_lt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setb   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_lt>:
xor    %eax,%eax
cmp    %rsi,%rdi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @test_lt(i8* readnone %0, i8* readnone %1) {
%3 = icmp ult i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int *set42(int *);
void dpd() {
  int *y;
  int *z;
  z = set42(y);
}


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

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

LLVM IR (-O0):
define void @dpd() {
%1 = alloca i32*
%2 = alloca i32*
%3 = load i32*, i32** %1
%4 = call i32* @set42(i32* %3)
store i32* %4, i32** %2
ret void
}

LLVM IR (-O2):
define void @dpd() {
%1 = tail call i32* @set42(i32* undef)
ret void
}
int mus_wav_load_lrsw(int ch, int num) {
  printf("%s not implemented\n", __func__);
  return (-1);
}


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

x86 assembly (clang, -O2):
<mus_wav_load_lrsw>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xef5(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"%s not implemented\0A\00"
@__func__.mus_wav_load_lrsw = [18 x i8] c"mus_wav_load_lrsw\00"
define i32 @mus_wav_load_lrsw(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.mus_wav_load_lrsw, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@.str = [20 x i8] c"%s not implemented\0A\00"
@__func__.mus_wav_load_lrsw = [18 x i8] c"mus_wav_load_lrsw\00"
define i32 @mus_wav_load_lrsw(i32 %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.mus_wav_load_lrsw, i64 0, i64 0))
ret i32 -1
}
/* Type definitions */
struct _stor_fdelete_rsp {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ osapi_free(struct _stor_fdelete_rsp *);
void stor_fdelete_rsp_free(struct _stor_fdelete_rsp *ptr) { osapi_free(ptr); }


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

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

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

LLVM IR (-O2):
%struct._stor_fdelete_rsp = type { i32 }
define void @stor_fdelete_rsp_free(%struct._stor_fdelete_rsp* %0) {
%2 = tail call i32 @osapi_free(%struct._stor_fdelete_rsp* %0)
ret void
}
void nvidia_bl_exit(struct nvidia_par *par) {}


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

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

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

LLVM IR (-O2):
%struct.nvidia_par = type opaque
define void @nvidia_bl_exit(%struct.nvidia_par* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void __refmem_allocator_system_free(void *ctx, void *mem) { free(mem); }


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

x86 assembly (clang, -O2):
<__refmem_allocator_system_free>:
mov    %rsi,%rdi
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @__refmem_allocator_system_free(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = tail call i32 @free(i8* %1)
ret void
}
double dither(void) {
  short bit;
  static short x = 0xbabe;
  bit = (x ^ (x >> 2) ^ (x >> 3) ^ (x >> 5)) & 1;
  x = x >> 1 | (bit << 15);
  return (double)x / 65536 - 0.5;
}


x86 assembly (clang, -O0):
<dither>:
push   %rbp
mov    %rsp,%rbp
movswl 0x2f15(%rip),%ecx
mov    %ecx,%edx
shr    $0x2,%edx
mov    %ecx,%eax
xor    %edx,%eax
mov    %ecx,%edx
shr    $0x3,%edx
xor    %edx,%eax
shr    $0x5,%ecx
xor    %ecx,%eax
and    $0x1,%eax
mov    %ax,-0x2(%rbp)
movswl 0x2ef2(%rip),%eax
shr    %eax
movzwl -0x2(%rbp),%ecx
shl    $0xf,%ecx
or     %ecx,%eax
mov    %ax,0x2ee0(%rip)
movswl 0x2ed9(%rip),%eax
cvtsi2sd %eax,%xmm0
movsd  0xeb5(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xea1(%rip),%xmm1
subsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dither>:
movswl 0x2f19(%rip),%eax
mov    %eax,%ecx
shr    $0x2,%ecx
xor    %eax,%ecx
mov    %eax,%edx
shr    $0x3,%edx
mov    %eax,%esi
shr    $0x5,%esi
xor    %edx,%esi
xor    %ecx,%esi
shr    %eax
shl    $0xf,%esi
or     %eax,%esi
mov    %si,0x2ef6(%rip)
movswl %si,%eax
cvtsi2sd %eax,%xmm0
mulsd  0xec7(%rip),%xmm0
addsd  0xec7(%rip),%xmm0
ret

LLVM IR (-O0):
@dither.x = internal global i16 -17730
define double @dither() {
%1 = alloca i16
%2 = load i16, i16* @dither.x
%3 = sext i16 %2 to i32
%4 = load i16, i16* @dither.x
%5 = sext i16 %4 to i32
%6 = ashr i32 %5, 2
%7 = xor i32 %3, %6
%8 = load i16, i16* @dither.x
%9 = sext i16 %8 to i32
%10 = ashr i32 %9, 3
%11 = xor i32 %7, %10
%12 = load i16, i16* @dither.x
%13 = sext i16 %12 to i32
%14 = ashr i32 %13, 5
%15 = xor i32 %11, %14
%16 = and i32 %15, 1
%17 = trunc i32 %16 to i16
store i16 %17, i16* %1
%18 = load i16, i16* @dither.x
%19 = sext i16 %18 to i32
%20 = ashr i32 %19, 1
%21 = load i16, i16* %1
%22 = sext i16 %21 to i32
%23 = shl i32 %22, 15
%24 = or i32 %20, %23
%25 = trunc i32 %24 to i16
store i16 %25, i16* @dither.x
%26 = load i16, i16* @dither.x
%27 = sitofp i16 %26 to double
%28 = fdiv double %27, 6.553600e+04
%29 = fsub double %28, 5.000000e-01
ret double %29
}

LLVM IR (-O2):
@dither.x = internal unnamed_addr global i16 -17730
define double @dither() {
%1 = load i16, i16* @dither.x
%2 = sext i16 %1 to i32
%3 = lshr i32 %2, 2
%4 = xor i32 %3, %2
%5 = lshr i32 %2, 3
%6 = xor i32 %4, %5
%7 = lshr i32 %2, 5
%8 = xor i32 %6, %7
%9 = ashr i32 %2, 1
%10 = shl i32 %8, 15
%11 = or i32 %10, %9
%12 = trunc i32 %11 to i16
store i16 %12, i16* @dither.x
%13 = sitofp i16 %12 to double
%14 = fmul double %13, 0x3EF0000000000000
%15 = fadd double %14, -5.000000e-01
ret double %15
}
int test_imm_B7uint16_reg(unsigned short val) {
  return ((val) & (-0xB7 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B7uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffff49,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_B7uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, -183
%6 = icmp ne i32 %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_B7uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -183
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
__attribute__((weak)) int getpid() { return 1; }


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

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

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

LLVM IR (-O2):
define weak i32 @getpid() {
ret i32 1
}
/* Type definitions */
struct iovec {
  int dummy;
};
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
ssize_t writev(int fildes, const struct iovec *iov, int iovcnt) { return 0; }


x86 assembly (clang, -O0):
<writev>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.iovec = type { i32 }
define i32 @writev(i32 %0, %struct.iovec* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.iovec*
%6 = alloca i32
store i32 %0, i32* %4
store %struct.iovec* %1, %struct.iovec** %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
%struct.iovec = type { i32 }
define i32 @writev(i32 %0, %struct.iovec* nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ print_char(char const, int);
void print_string_by_length(const char *str, int length, int color) {
  int i = 0;
  while (i < length) {
    print_char(str[i], color);
    i++;
  }
}


x86 assembly (clang, -O0):
<print_string_by_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <print_string_by_length+0x49>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    -0x10(%rbp),%esi
movsbl %al,%edi
call   1030 <print_char@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <print_string_by_length+0x19>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_string_by_length>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    1146 <print_string_by_length+0x36>
mov    %edx,%r14d
mov    %rdi,%r15
mov    %esi,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
movsbl (%r15,%rbx,1),%edi
mov    %r14d,%esi
call   1030 <print_char@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1130 <print_string_by_length+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @print_string_by_length(i8* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %14
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %12, %7 ]
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = tail call i32 @print_char(i8 signext %10, i32 %2)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ intercambiar(char *, int, int);
int strlen(char *);
void invierte_cadena(char cadena[]) {
  int largo = strlen(cadena);
  for (int i = 0; i < (largo / 2); i++) {
    intercambiar(cadena, i, (largo - 1) - i);
  }
}


x86 assembly (clang, -O0):
<invierte_cadena>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cmp    %ecx,%eax
jge    1180 <invierte_cadena+0x60>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
sub    -0x10(%rbp),%edx
call   1040 <intercambiar@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113f <invierte_cadena+0x1f>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<invierte_cadena>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
cmp    $0x2,%eax
jl     1167 <invierte_cadena+0x47>
mov    %eax,%ebp
mov    %eax,%r15d
shr    $0x1f,%r15d
add    %eax,%r15d
sar    %r15d
add    $0xffffffff,%ebp
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
call   1040 <intercambiar@plt>
add    $0x1,%ebx
add    $0xffffffff,%ebp
cmp    %ebx,%r15d
jne    1150 <invierte_cadena+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @invierte_cadena(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
store i32 %6, i32* %3
store i32 0, i32* %4
br label %7
7: ; preds = %20, %1
%8 = load i32, i32* %4
%9 = load i32, i32* %3
%10 = sdiv i32 %9, 2
%11 = icmp slt i32 %8, %10
br i1 %11, label %12, label %23
12: ; preds = %7
%13 = load i8*, i8** %2
%14 = load i32, i32* %4
%15 = load i32, i32* %3
%16 = sub nsw i32 %15, 1
%17 = load i32, i32* %4
%18 = sub nsw i32 %16, %17
%19 = call i32 @intercambiar(i8* %13, i32 %14, i32 %18)
br label %20
20: ; preds = %12
%21 = load i32, i32* %4
%22 = add nsw i32 %21, 1
store i32 %22, i32* %4
br label %7
23: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @invierte_cadena(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = sdiv i32 %2, 2
%4 = icmp sgt i32 %2, 1
br i1 %4, label %6, label %5
5: ; preds = %6, %1
ret void
6: ; preds = %1, %6
%7 = phi i32 [ %11, %6 ], [ 0, %1 ]
%8 = xor i32 %7, -1
%9 = add i32 %2, %8
%10 = tail call i32 @intercambiar(i8* %0, i32 %7, i32 %9)
%11 = add nuw nsw i32 %7, 1
%12 = icmp eq i32 %11, %3
br i1 %12, label %5, label %6
}
int SDL_imageFilterSubMMX(unsigned char *Src1, unsigned char *Src2,
                          unsigned char *Dest, unsigned int SrcLength) {
  return (-1);
}


x86 assembly (clang, -O0):
<SDL_imageFilterSubMMX>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @SDL_imageFilterSubMMX(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i32 %3) {
ret i32 -1
}
void X509V3_add_value_bool_nf(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ log_common(unsigned short, int /*<<< orphan*/, char *,
                              struct all_addr *, char *);
void log_query(unsigned short flags, char *name, struct all_addr *addr,
               char *arg) {
  log_common(flags, 0, name, addr, arg);
}


x86 assembly (clang, -O0):
<log_query>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x2(%rbp),%ax
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
xor    %esi,%esi
movzwl %ax,%edi
call   1030 <log_common@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_query>:
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <log_common@plt>

LLVM IR (-O0):
%struct.all_addr = type { i32 }
define void @log_query(i16 zeroext %0, i8* %1, %struct.all_addr* %2, i8* %3) {
%5 = alloca i16
%6 = alloca i8*
%7 = alloca %struct.all_addr*
%8 = alloca i8*
store i16 %0, i16* %5
store i8* %1, i8** %6
store %struct.all_addr* %2, %struct.all_addr** %7
store i8* %3, i8** %8
%9 = load i16, i16* %5
%10 = load i8*, i8** %6
%11 = load %struct.all_addr*, %struct.all_addr** %7
%12 = load i8*, i8** %8
%13 = call i32 @log_common(i16 zeroext %9, i32 0, i8* %10, %struct.all_addr* %11, i8* %12)
ret void
}

LLVM IR (-O2):
%struct.all_addr = type { i32 }
define void @log_query(i16 zeroext %0, i8* %1, %struct.all_addr* %2, i8* %3) {
%5 = tail call i32 @log_common(i16 zeroext %0, i32 0, i8* %1, %struct.all_addr* %2, i8* %3)
ret void
}