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

/* Variables and functions */
int /*<<< orphan*/ keccak_squeezeblocks(unsigned char *, unsigned long long,
                                        int /*<<< orphan*/ *, int);
void cshake256_simple_squeezeblocks(unsigned char *output,
                                    unsigned long long nblocks, uint64_t *s) {
  keccak_squeezeblocks(output, nblocks, s, 136);
}


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

x86 assembly (clang, -O2):
<cshake256_simple_squeezeblocks>:
mov    $0x88,%ecx
jmp    1030 <keccak_squeezeblocks@plt>

LLVM IR (-O0):
define void @cshake256_simple_squeezeblocks(i8* %0, i64 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32* %2, i32** %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = load i32*, i32** %6
%10 = call i32 @keccak_squeezeblocks(i8* %7, i64 %8, i32* %9, i32 136)
ret void
}

LLVM IR (-O2):
define void @cshake256_simple_squeezeblocks(i8* %0, i64 %1, i32* %2) {
%4 = tail call i32 @keccak_squeezeblocks(i8* %0, i64 %1, i32* %2, i32 136)
ret void
}
void genblez_idle() {}


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

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

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

LLVM IR (-O2):
define void @genblez_idle() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t round32(uint32_t value) {
  uint32_t round32_mask = (1 << 5) - 1;
  return ((value + round32_mask) & ~round32_mask);
}


x86 assembly (clang, -O0):
<round32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1f,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<round32>:
lea    0x1f(%rdi),%eax
and    $0xffffffe0,%eax
ret

LLVM IR (-O0):
define i32 @round32(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 31, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = add nsw i32 %4, %5
%7 = load i32, i32* %3
%8 = xor i32 %7, -1
%9 = and i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @round32(i32 %0) {
%2 = add nsw i32 %0, 31
%3 = and i32 %2, -32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void clear() {
  if ((2 == 0) || (2 == 2))
    system("clear");
  if (2 == 1)
    system("cls");
}


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
define void @clear() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int int16_t;

/* Variables and functions */
int /*<<< orphan*/ rint(double);
int16_t fsaturate(double damp) {
  if (damp > 32767.0)
    return (32767);
  if (damp < -32768.0)
    return (-32767 - 1);
  return (int16_t)rint(damp);
}


x86 assembly (clang, -O0):
<fsaturate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1140 <fsaturate+0x30>
movl   $0x7fff,-0x4(%rbp)
jmp    116c <fsaturate+0x5c>
movsd  0xec0(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    115f <fsaturate+0x4f>
movl   $0xffff8000,-0x4(%rbp)
jmp    116c <fsaturate+0x5c>
movsd  -0x10(%rbp),%xmm0
call   1030 <rint@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsaturate>:
mov    $0x7fff,%eax
ucomisd 0xee3(%rip),%xmm0
ja     1132 <fsaturate+0x22>
mov    $0xffff8000,%eax
movsd  0xedc(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1133 <fsaturate+0x23>
ret
jmp    1030 <rint@plt>

LLVM IR (-O0):
define i32 @fsaturate(double %0) {
%2 = alloca i32
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ogt double %4, 3.276700e+04
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 32767, i32* %2
br label %14
7: ; preds = %1
%8 = load double, double* %3
%9 = fcmp olt double %8, -3.276800e+04
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 -32768, i32* %2
br label %14
11: ; preds = %7
%12 = load double, double* %3
%13 = call i32 @rint(double %12)
store i32 %13, i32* %2
br label %14
14: ; preds = %11, %10, %6
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @fsaturate(double %0) {
%2 = fcmp ogt double %0, 3.276700e+04
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = fcmp olt double %0, -3.276800e+04
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @rint(double %0)
br label %7
7: ; preds = %3, %1, %5
%8 = phi i32 [ %6, %5 ], [ 32767, %1 ], [ -32768, %3 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ CG_DrawHudStatusBar();
void CG_DrawSpectatorHud(void) { CG_DrawHudStatusBar(); }


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

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

LLVM IR (-O0):
define void @CG_DrawSpectatorHud() {
%1 = call i32 (...) @CG_DrawHudStatusBar()
ret void
}

LLVM IR (-O2):
define void @CG_DrawSpectatorHud() {
%1 = tail call i32 (...) @CG_DrawHudStatusBar()
ret void
}
/* Type definitions */
struct timespec {
  int /*<<< orphan*/ tv_nsec;
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
void kvu_timespec_assign(struct timespec *x, const struct timespec *y) {
  x->tv_sec = y->tv_sec;
  x->tv_nsec = y->tv_nsec;
}


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

x86 assembly (clang, -O2):
<kvu_timespec_assign>:
mov    0x4(%rsi),%eax
mov    %eax,0x4(%rdi)
mov    (%rsi),%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define void @kvu_timespec_assign(%struct.timespec* %0, %struct.timespec* %1) {
%3 = alloca %struct.timespec*
%4 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %3
store %struct.timespec* %1, %struct.timespec** %4
%5 = load %struct.timespec*, %struct.timespec** %4
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 1
%7 = load i32, i32* %6
%8 = load %struct.timespec*, %struct.timespec** %3
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %8, i32 0, i32 1
store i32 %7, i32* %9
%10 = load %struct.timespec*, %struct.timespec** %4
%11 = getelementptr inbounds %struct.timespec, %struct.timespec* %10, i32 0, i32 0
%12 = load i32, i32* %11
%13 = load %struct.timespec*, %struct.timespec** %3
%14 = getelementptr inbounds %struct.timespec, %struct.timespec* %13, i32 0, i32 0
store i32 %12, i32* %14
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define void @kvu_timespec_assign(%struct.timespec* nocapture writeonly %0, %struct.timespec* nocapture %1) {
%3 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%4 = load i32, i32* %3
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
store i32 %4, i32* %5
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%7 = load i32, i32* %6
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
store i32 %7, i32* %8
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *Fopen(char *, char *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void TestReadFile(char *fn) {
  FILE *f = Fopen(fn, "r");
  fclose(f);
}


x86 assembly (clang, -O0):
<TestReadFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <Fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TestReadFile>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <Fopen@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
define void @TestReadFile(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32* @Fopen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = call i32 @fclose(i32* %6)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define void @TestReadFile(i8* %0) {
%2 = tail call i32* @Fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @fclose(i32* %2)
ret void
}
void AT_initList(int argc, char *argv[]) {
  (void)argc;
  (void)argv;
}


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

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

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

LLVM IR (-O2):
define void @AT_initList(i32 %0, i8** nocapture %1) {
ret void
}
void __attribute__((weak)) end_timer(unsigned int *sec, unsigned int *usec) {
  *sec = -1;
  *usec = -1;
}


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

x86 assembly (clang, -O2):
<end_timer>:
movl   $0xffffffff,(%rdi)
movl   $0xffffffff,(%rsi)
ret

LLVM IR (-O0):
define weak void @end_timer(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
store i32 -1, i32* %5
%6 = load i32*, i32** %4
store i32 -1, i32* %6
ret void
}

LLVM IR (-O2):
define weak void @end_timer(i32* %0, i32* %1) {
store i32 -1, i32* %0
store i32 -1, i32* %1
ret void
}
unsigned int type_field(unsigned int ntype) { return (ntype & 0xff); }


x86 assembly (clang, -O0):
<type_field>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<type_field>:
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @type_field(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
ret i32 %4
}

LLVM IR (-O2):
define i32 @type_field(i32 %0) {
%2 = and i32 %0, 255
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ pipe(int *);
void xpipe(int filedes[2]) { pipe(filedes); }


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

x86 assembly (clang, -O2):
<xpipe>:
jmp    1030 <pipe@plt>

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

LLVM IR (-O2):
define void @xpipe(i32* %0) {
%2 = tail call i32 @pipe(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int child() {
  sleep(1);
  return 0;
}


x86 assembly (clang, -O0):
<child>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <sleep@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<child>:
push   %rax
mov    $0x1,%edi
call   1030 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @child() {
%1 = call i32 @sleep(i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @child() {
%1 = tail call i32 @sleep(i32 1)
ret i32 0
}
/* Type definitions */
union bpf_attr {
  int bpf_fd;
  int /*<<< orphan*/ pathname;
};
typedef int /*<<< orphan*/ attr;

/* Variables and functions */
int /*<<< orphan*/ BPF_OBJ_PIN;
int /*<<< orphan*/ memset(union bpf_attr *, int /*<<< orphan*/, int);
int /*<<< orphan*/ ptr_to_u64(void *);
int sys_bpf(int /*<<< orphan*/, union bpf_attr *, int);
int bpf_obj_pin(int fd, const char *pathname) {
  union bpf_attr attr;
  memset(&attr, 0, sizeof(attr));
  attr.pathname = ptr_to_u64((void *)pathname);
  attr.bpf_fd = fd;
  return sys_bpf(BPF_OBJ_PIN, &attr, sizeof(attr));
}


x86 assembly (clang, -O0):
<bpf_obj_pin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1050 <memset@plt>
mov    -0x10(%rbp),%rdi
call   1040 <ptr_to_u64@plt>
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
lea    -0x18(%rbp),%rsi
mov    $0x4,%edx
call   1030 <sys_bpf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpf_obj_pin>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0x8(%rsp),%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1050 <memset@plt>
mov    %rbx,%rdi
call   1040 <ptr_to_u64@plt>
mov    %ebp,0x8(%rsp)
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
mov    %r14,%rsi
mov    $0x4,%edx
call   1030 <sys_bpf@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%union.bpf_attr = type { i32 }
@BPF_OBJ_PIN = global i32 0
define i32 @bpf_obj_pin(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca %union.bpf_attr
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = call i32 @memset(%union.bpf_attr* %5, i32 0, i32 4)
%7 = load i8*, i8** %4
%8 = call i32 @ptr_to_u64(i8* %7)
%9 = bitcast %union.bpf_attr* %5 to i32*
store i32 %8, i32* %9
%10 = load i32, i32* %3
%11 = bitcast %union.bpf_attr* %5 to i32*
store i32 %10, i32* %11
%12 = load i32, i32* @BPF_OBJ_PIN
%13 = call i32 @sys_bpf(i32 %12, %union.bpf_attr* %5, i32 4)
ret i32 %13
}

LLVM IR (-O2):
%union.bpf_attr = type { i32 }
@BPF_OBJ_PIN = global i32 0
define i32 @bpf_obj_pin(i32 %0, i8* %1) {
%3 = alloca %union.bpf_attr
%4 = bitcast %union.bpf_attr* %3 to i8*
%5 = call i32 @memset(%union.bpf_attr* %3, i32 0, i32 4)
%6 = call i32 @ptr_to_u64(i8* %1)
%7 = getelementptr inbounds %union.bpf_attr, %union.bpf_attr* %3, i64 0, i32 0
store i32 %0, i32* %7
%8 = load i32, i32* @BPF_OBJ_PIN
%9 = call i32 @sys_bpf(i32 %8, %union.bpf_attr* %3, i32 4)
ret i32 %9
}
/* Variables and functions */
float fabsf(float);
float metric_abs(float left, float right) { return fabsf(left) - fabsf(right); }


x86 assembly (clang, -O0):
<metric_abs>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movaps 0xee6(%rip),%xmm1
pand   %xmm1,%xmm0
movss  -0x8(%rbp),%xmm1
movaps 0xed6(%rip),%xmm2
pand   %xmm2,%xmm1
subss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<metric_abs>:
movaps 0xef9(%rip),%xmm2
andps  %xmm2,%xmm0
andps  %xmm2,%xmm1
subss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @metric_abs(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = call float @llvm.fabs.f32(float %5)
%7 = load float, float* %4
%8 = call float @llvm.fabs.f32(float %7)
%9 = fsub float %6, %8
ret float %9
}

LLVM IR (-O2):
define float @metric_abs(float %0, float %1) {
%3 = tail call float @llvm.fabs.f32(float %0)
%4 = tail call float @llvm.fabs.f32(float %1)
%5 = fsub float %3, %4
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ roadmap_file_remove(int /*<<< orphan*/, char *);
int /*<<< orphan*/ roadmap_path_user();
void roadmap_log_purge(void) {
  roadmap_file_remove(roadmap_path_user(), "postmortem");
}


x86 assembly (clang, -O0):
<roadmap_log_purge>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <roadmap_path_user@plt>
mov    %eax,%edi
lea    0xecc(%rip),%rsi
call   1040 <roadmap_file_remove@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<roadmap_log_purge>:
push   %rax
xor    %eax,%eax
call   1030 <roadmap_path_user@plt>
lea    0xed1(%rip),%rsi
mov    %eax,%edi
pop    %rax
jmp    1040 <roadmap_file_remove@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"postmortem\00"
define void @roadmap_log_purge() {
%1 = tail call i32 (...) @roadmap_path_user()
%2 = tail call i32 @roadmap_file_remove(i32 %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int strlen(char *);
int string_length(char *text) { return strlen(text); }


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

x86 assembly (clang, -O2):
<string_length>:
jmp    1030 <strlen@plt>

LLVM IR (-O0):
define i32 @string_length(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strlen(i8* %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @string_length(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
ret i32 %2
}
/* Type definitions */
typedef char uint8_t;

/* Variables and functions */
int /*<<< orphan*/ CC_SPI_Transfer(int, char *, int /*<<< orphan*/, int);
void TI_CC_SPIStrobe(int fd, char strobe) {
  uint8_t txBuf[1] = {0};
  txBuf[0] = strobe;
  CC_SPI_Transfer(fd, txBuf, 0, 1);
}


x86 assembly (clang, -O0):
<TI_CC_SPIStrobe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
lea    -0x6(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <memset@plt>
mov    -0x5(%rbp),%al
mov    %al,-0x6(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x6(%rbp),%rsi
xor    %edx,%edx
mov    $0x1,%ecx
call   1040 <CC_SPI_Transfer@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TI_CC_SPIStrobe>:
push   %rax
mov    %sil,0x7(%rsp)
lea    0x7(%rsp),%rsi
xor    %edx,%edx
mov    $0x1,%ecx
call   1030 <CC_SPI_Transfer@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @TI_CC_SPIStrobe(i32 %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca [1 x i8]
store i32 %0, i32* %3
store i8 %1, i8* %4
%6 = bitcast [1 x i8]* %5 to i8*
%7 = load i8, i8* %4
%8 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
store i8 %7, i8* %8
%9 = load i32, i32* %3
%10 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%11 = call i32 @CC_SPI_Transfer(i32 %9, i8* %10, i32 0, i32 1)
ret void
}

LLVM IR (-O2):
define void @TI_CC_SPIStrobe(i32 %0, i8 signext %1) {
%3 = alloca [1 x i8]
%4 = getelementptr inbounds [1 x i8], [1 x i8]* %3, i64 0, i64 0
store i8 %1, i8* %4
%5 = call i32 @CC_SPI_Transfer(i32 %0, i8* %4, i32 0, i32 1)
ret void
}
/* Type definitions */
struct usergetkey_cmdline_parser_params {
  int dummy;
};
struct usergetkey_args_info {
  int dummy;
};

/* Variables and functions */
int usergetkey_cmdline_parser_internal(
    int, char **, struct usergetkey_args_info *,
    struct usergetkey_cmdline_parser_params *, int /*<<< orphan*/);
int usergetkey_cmdline_parser_ext(
    int argc, char **argv, struct usergetkey_args_info *args_info,
    struct usergetkey_cmdline_parser_params *params) {
  int result;
  result = usergetkey_cmdline_parser_internal(argc, argv, args_info, params, 0);
  return result;
}


x86 assembly (clang, -O0):
<usergetkey_cmdline_parser_ext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
xor    %r8d,%r8d
call   1030 <usergetkey_cmdline_parser_internal@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usergetkey_cmdline_parser_ext>:
xor    %r8d,%r8d
jmp    1030 <usergetkey_cmdline_parser_internal@plt>

LLVM IR (-O0):
%struct.usergetkey_args_info = type { i32 }
%struct.usergetkey_cmdline_parser_params = type { i32 }
define i32 @usergetkey_cmdline_parser_ext(i32 %0, i8** %1, %struct.usergetkey_args_info* %2, %struct.usergetkey_cmdline_parser_params* %3) {
%5 = alloca i32
%6 = alloca i8**
%7 = alloca %struct.usergetkey_args_info*
%8 = alloca %struct.usergetkey_cmdline_parser_params*
%9 = alloca i32
store i32 %0, i32* %5
store i8** %1, i8*** %6
store %struct.usergetkey_args_info* %2, %struct.usergetkey_args_info** %7
store %struct.usergetkey_cmdline_parser_params* %3, %struct.usergetkey_cmdline_parser_params** %8
%10 = load i32, i32* %5
%11 = load i8**, i8*** %6
%12 = load %struct.usergetkey_args_info*, %struct.usergetkey_args_info** %7
%13 = load %struct.usergetkey_cmdline_parser_params*, %struct.usergetkey_cmdline_parser_params** %8
%14 = call i32 @usergetkey_cmdline_parser_internal(i32 %10, i8** %11, %struct.usergetkey_args_info* %12, %struct.usergetkey_cmdline_parser_params* %13, i32 0)
store i32 %14, i32* %9
%15 = load i32, i32* %9
ret i32 %15
}

LLVM IR (-O2):
%struct.usergetkey_args_info = type { i32 }
%struct.usergetkey_cmdline_parser_params = type { i32 }
define i32 @usergetkey_cmdline_parser_ext(i32 %0, i8** %1, %struct.usergetkey_args_info* %2, %struct.usergetkey_cmdline_parser_params* %3) {
%5 = tail call i32 @usergetkey_cmdline_parser_internal(i32 %0, i8** %1, %struct.usergetkey_args_info* %2, %struct.usergetkey_cmdline_parser_params* %3, i32 0)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
void f4(char *source) {
  char *destination = 0;
  destination = destination - 0;
  memcpy(destination, source, 10);
}


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0xa,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4>:
mov    %rdi,%rsi
xor    %edi,%edi
mov    $0xa,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @f4(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
store i8* null, i8** %3
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 0
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i8*, i8** %2
%8 = call i32 @memcpy(i8* %6, i8* %7, i32 10)
ret void
}

LLVM IR (-O2):
define void @f4(i8* %0) {
%2 = tail call i32 @memcpy(i8* null, i8* %0, i32 10)
ret void
}
void RTStrToInt32Ex(void) {}


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

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

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

LLVM IR (-O2):
define void @RTStrToInt32Ex() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printInt(const int *arr, size_t count) {
  for (size_t i = 0; i < count; ++i) {
    printf("%d ", arr[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printInt>:
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    1160 <printInt+0x50>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <printInt+0x18>
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printInt>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     1157 <printInt+0x37>
mov    %rsi,%r12
mov    %rdi,%r14
lea    0xec6(%rip),%r15
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    (%r14,%rbx,4),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printInt+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"%d \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @printInt(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %16, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = icmp ult i64 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i64, i64* %5
%13 = getelementptr inbounds i32, i32* %11, i64 %12
%14 = load i32, i32* %13
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %14)
br label %16
16: ; preds = %10
%17 = load i64, i64* %5
%18 = add i64 %17, 1
store i64 %18, i64* %5
br label %6
19: ; preds = %6
%20 = 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"%d \00"
define void @printInt(i32* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %6, %2
%5 = tail call i32 @putchar(i32 10)
ret void
6: ; preds = %2, %6
%7 = phi i64 [ %11, %6 ], [ 0, %2 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw i64 %7, 1
%12 = icmp eq i64 %11, %1
br i1 %12, label %4, label %6
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMRC4_get(void) { return U_WMRCORENONE_get("U_WMRC4"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRC4\00"
define i32 @U_WMRC4_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRC4\00"
define i32 @U_WMRC4_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
int main() {
  int (*pfi)(char *, char *);
  pfi = pfn(10, 20);
  pfi("str1", "str2");
  printf("\nPress any key to end...");
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
mov    $0x14,%esi
mov    $0x0,%al
call   1050 <pfn@plt>
cltq
mov    %rax,-0x10(%rbp)
lea    0xea3(%rip),%rdi
lea    0xea1(%rip),%rsi
call   *-0x10(%rbp)
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
mov    $0x14,%esi
xor    %eax,%eax
call   1050 <pfn@plt>
cltq
lea    0xeb5(%rip),%rdi
lea    0xeb3(%rip),%rsi
call   *%rax
lea    0xeaf(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"str1\00"
@.str.1 = [5 x i8] c"str2\00"
@.str.2 = [25 x i8] c"\0APress any key to end...\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32 (i8*, i8*)*
store i32 0, i32* %1
%3 = call i32 (i32, i32, ...) bitcast (i32 (...)* @pfn to i32 (i32, i32, ...)*)(i32 10, i32 20)
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i32 (i8*, i8*)*
store i32 (i8*, i8*)* %5, i32 (i8*, i8*)** %2
%6 = load i32 (i8*, i8*)*, i32 (i8*, i8*)** %2
%7 = call i32 %6(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"str1\00"
@.str.1 = [5 x i8] c"str2\00"
@.str.2 = [25 x i8] c"\0APress any key to end...\00"
define i32 @main() {
%1 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @pfn to i32 (i32, i32, ...)*)(i32 10, i32 20)
%2 = sext i32 %1 to i64
%3 = inttoptr i64 %2 to i32 (i8*, i8*)*
%4 = tail call i32 %3(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int strlen(const char *str) {
  int i;
  for (i = 0; str[i]; i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1134 <strlen+0x34>
jmp    1126 <strlen+0x26>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
int test_imm_14uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x14 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_14uint64_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, 20
%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_14uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 20
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void led_status_default(void) {}


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

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

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

LLVM IR (-O2):
define void @led_status_default() {
ret void
}
double casimir_T_scaled_to_SI(double T, double ScriptL) {
  return 3.161526510740123e-26 /
         (2 * 3.141592653589793238462643383279502884197169L * 1.3806488e-23 *
          ScriptL) *
         T;
}


x86 assembly (clang, -O0):
<casimir_T_scaled_to_SI>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
fldl   -0x10(%rbp)
fldt   0xee9(%rip)
fmulp  %st,%st(1)
fldl   0xef1(%rip)
fdivp  %st,%st(1)
fldl   -0x8(%rbp)
fmulp  %st,%st(1)
fstpl  -0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<casimir_T_scaled_to_SI>:
movsd  %xmm1,-0x10(%rsp)
fldt   0xef4(%rip)
fmull  -0x10(%rsp)
fdivrl 0xefa(%rip)
movsd  %xmm0,-0x8(%rsp)
fmull  -0x8(%rsp)
fstpl  -0x18(%rsp)
movsd  -0x18(%rsp),%xmm0
ret

LLVM IR (-O0):
define double @casimir_T_scaled_to_SI(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = fpext double %5 to x86_fp80
%7 = fmul x86_fp80 0xK3FB5D1BEDBC684460C74, %6
%8 = fdiv x86_fp80 0xK3FAA9C8D1C1B2EB73000, %7
%9 = load double, double* %3
%10 = fpext double %9 to x86_fp80
%11 = fmul x86_fp80 %8, %10
%12 = fptrunc x86_fp80 %11 to double
ret double %12
}

LLVM IR (-O2):
define double @casimir_T_scaled_to_SI(double %0, double %1) {
%3 = fpext double %1 to x86_fp80
%4 = fmul x86_fp80 %3, 0xK3FB5D1BEDBC684460C74
%5 = fdiv x86_fp80 0xK3FAA9C8D1C1B2EB73000, %4
%6 = fpext double %0 to x86_fp80
%7 = fmul x86_fp80 %5, %6
%8 = fptrunc x86_fp80 %7 to double
ret double %8
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int pthread_attr_setdetachstate(int /*<<< orphan*/ *, int);
int my_pthread_attr_setdetachstate(pthread_attr_t *__attr, int state) {
  pthread_attr_t *realattr = (pthread_attr_t *)*(int *)__attr;
  return pthread_attr_setdetachstate(realattr, state);
}


x86 assembly (clang, -O0):
<my_pthread_attr_setdetachstate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <pthread_attr_setdetachstate@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_pthread_attr_setdetachstate>:
movslq (%rdi),%rdi
jmp    1030 <pthread_attr_setdetachstate@plt>

LLVM IR (-O0):
define i32 @my_pthread_attr_setdetachstate(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32*
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
store i32* %9, i32** %5
%10 = load i32*, i32** %5
%11 = load i32, i32* %4
%12 = call i32 @pthread_attr_setdetachstate(i32* %10, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @my_pthread_attr_setdetachstate(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = tail call i32 @pthread_attr_setdetachstate(i32* %5, i32 %1)
ret i32 %6
}
int uni_utf8_len(unsigned long uc) {
  if (uc <= 0x007FUL) {
    return 1;
  }
  if (uc <= 0x07FFUL) {
    return 2;
  }
  if (uc <= 0xFFFFUL) {
    return 3;
  }
  if (uc <= 0x10FFFFUL) {
    return 4;
  }
  return 0;
}


x86 assembly (clang, -O0):
<uni_utf8_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x7f,-0x10(%rbp)
ja     111f <uni_utf8_len+0x1f>
movl   $0x1,-0x4(%rbp)
jmp    1174 <uni_utf8_len+0x74>
cmpq   $0x7ff,-0x10(%rbp)
ja     1139 <uni_utf8_len+0x39>
movl   $0x2,-0x4(%rbp)
jmp    1174 <uni_utf8_len+0x74>
cmpq   $0xffff,-0x10(%rbp)
ja     1153 <uni_utf8_len+0x53>
movl   $0x3,-0x4(%rbp)
jmp    1174 <uni_utf8_len+0x74>
cmpq   $0x10ffff,-0x10(%rbp)
ja     116d <uni_utf8_len+0x6d>
movl   $0x4,-0x4(%rbp)
jmp    1174 <uni_utf8_len+0x74>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uni_utf8_len>:
mov    $0x1,%eax
cmp    $0x80,%rdi
jb     1139 <uni_utf8_len+0x39>
mov    $0x2,%eax
cmp    $0x800,%rdi
jb     1139 <uni_utf8_len+0x39>
mov    $0x3,%eax
cmp    $0x10000,%rdi
jb     1139 <uni_utf8_len+0x39>
xor    %eax,%eax
cmp    $0x110000,%rdi
setb   %al
shl    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @uni_utf8_len(i64 %0) {
%2 = alloca i32
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp ule i64 %4, 127
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %20
7: ; preds = %1
%8 = load i64, i64* %3
%9 = icmp ule i64 %8, 2047
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 2, i32* %2
br label %20
11: ; preds = %7
%12 = load i64, i64* %3
%13 = icmp ule i64 %12, 65535
br i1 %13, label %14, label %15
14: ; preds = %11
store i32 3, i32* %2
br label %20
15: ; preds = %11
%16 = load i64, i64* %3
%17 = icmp ule i64 %16, 1114111
br i1 %17, label %18, label %19
18: ; preds = %15
store i32 4, i32* %2
br label %20
19: ; preds = %15
store i32 0, i32* %2
br label %20
20: ; preds = %19, %18, %14, %10, %6
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @uni_utf8_len(i64 %0) {
%2 = icmp ult i64 %0, 128
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = icmp ult i64 %0, 2048
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = icmp ult i64 %0, 65536
br i1 %6, label %10, label %7
7: ; preds = %5
%8 = icmp ult i64 %0, 1114112
%9 = select i1 %8, i32 4, i32 0
br label %10
10: ; preds = %7, %5, %3, %1
%11 = phi i32 [ 1, %1 ], [ 2, %3 ], [ 3, %5 ], [ %9, %7 ]
ret i32 %11
}
/* Variables and functions */
unsigned int __tzmsk_u32(unsigned int);
unsigned int test__tzmsk_u32(unsigned int a) { return __tzmsk_u32(a); }


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

x86 assembly (clang, -O2):
<test__tzmsk_u32>:
jmp    1030 <__tzmsk_u32@plt>

LLVM IR (-O0):
define i32 @test__tzmsk_u32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @__tzmsk_u32(i32 %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @test__tzmsk_u32(i32 %0) {
%2 = tail call i32 @__tzmsk_u32(i32 %0)
ret i32 %2
}
void symbol(char c) {}


x86 assembly (clang, -O0):
<symbol>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @symbol(i8 signext %0) {
ret void
}
/* Type definitions */
struct ArrayList {
  int dummy;
};

/* Variables and functions */
int ArrayList_insert(struct ArrayList const *, void *, int /*<<< orphan*/);
int ArrayList_prepend(const struct ArrayList *this, void *item) {
  if (this == NULL)
    return -2;
  return ArrayList_insert(this, item, 0);
}


x86 assembly (clang, -O0):
<ArrayList_prepend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1137 <ArrayList_prepend+0x27>
movl   $0xfffffffe,-0x4(%rbp)
jmp    1149 <ArrayList_prepend+0x39>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
xor    %edx,%edx
call   1030 <ArrayList_insert@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ArrayList_prepend>:
test   %rdi,%rdi
je     111c <ArrayList_prepend+0xc>
xor    %edx,%edx
jmp    1030 <ArrayList_insert@plt>
mov    $0xfffffffe,%eax
ret

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

LLVM IR (-O2):
%struct.ArrayList = type { i32 }
define i32 @ArrayList_prepend(%struct.ArrayList* %0, i8* %1) {
%3 = icmp eq %struct.ArrayList* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @ArrayList_insert(%struct.ArrayList* %0, i8* %1, i32 0)
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ %5, %4 ], [ -2, %2 ]
ret i32 %7
}
int test_imm_DBuint16_reg(unsigned short val) {
  return ((val) & (-0xDB << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_DBuint16_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, -219
%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_DBuint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -219
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int next_five_terms(int n) {
  if (n > 10) {
    return 0;
  } else {
    return (next_five_terms(n - 1) + next_five_terms(n - 2));
  }
}


x86 assembly (clang, -O0):
<next_five_terms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jle    1131 <next_five_terms+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1154 <next_five_terms+0x44>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <next_five_terms@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <next_five_terms@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_five_terms>:
push   %rbx
cmp    $0xa,%edi
jle    111a <next_five_terms+0xa>
xor    %eax,%eax
pop    %rbx
ret
mov    %edi,%ebx
add    $0xffffffff,%ebx
nop
mov    %ebx,%edi
call   1030 <next_five_terms@plt>
add    $0xfffffffe,%ebx
jmp    1120 <next_five_terms+0x10>

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

LLVM IR (-O2):
define i32 @next_five_terms(i32 %0) {
%2 = icmp sgt i32 %0, 10
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ %0, %1 ]
%5 = add nsw i32 %4, -1
%6 = tail call i32 @next_five_terms(i32 %5)
%7 = add nsw i32 %4, -2
br label %3
8: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ vOneTwo(unsigned char const *, int, unsigned char *);
void vOneTwoX0(const unsigned char *psIn, int iLength, unsigned char *pszOut) {
  vOneTwo(psIn, iLength, pszOut);
  if (iLength < 0)
    iLength = 0;
  pszOut[2 * iLength] = 0;
}


x86 assembly (clang, -O0):
<vOneTwoX0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <vOneTwo@plt>
cmpl   $0x0,-0xc(%rbp)
jge    1144 <vOneTwoX0+0x34>
movl   $0x0,-0xc(%rbp)
mov    -0x18(%rbp),%rax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vOneTwoX0>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %esi,%ebp
call   1030 <vOneTwo@plt>
xor    %eax,%eax
test   %ebp,%ebp
cmovns %ebp,%eax
movb   $0x0,(%rbx,%rax,2)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @vOneTwoX0(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @vOneTwo(i8* %0, i32 %1, i8* %2)
%5 = icmp sgt i32 %1, 0
%6 = select i1 %5, i32 %1, i32 0
%7 = shl nuw nsw i32 %6, 1
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %2, i64 %8
store i8 0, i8* %9
ret void
}
void SteamAPI_ISteamFriends_ClearRichPresence(void *self) {
  xlogf("%s(self = %p)\n", __func__, self);
}


x86 assembly (clang, -O0):
<SteamAPI_ISteamFriends_ClearRichPresence>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xed9(%rip),%rdi
lea    0xee1(%rip),%rsi
mov    $0x0,%al
call   1030 <xlogf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SteamAPI_ISteamFriends_ClearRichPresence>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xeee(%rip),%rsi
xor    %eax,%eax
jmp    1030 <xlogf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamFriends_ClearRichPresence = [41 x i8] c"SteamAPI_ISteamFriends_ClearRichPresence\00"
define void @SteamAPI_ISteamFriends_ClearRichPresence(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([41 x i8], [41 x i8]* @__func__.SteamAPI_ISteamFriends_ClearRichPresence, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamFriends_ClearRichPresence = [41 x i8] c"SteamAPI_ISteamFriends_ClearRichPresence\00"
define void @SteamAPI_ISteamFriends_ClearRichPresence(i8* %0) {
%2 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([41 x i8], [41 x i8]* @__func__.SteamAPI_ISteamFriends_ClearRichPresence, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ base_test();
int /*<<< orphan*/ greth_test(int);
int /*<<< orphan*/ report_end();
int /*<<< orphan*/ report_start();
main() {
  report_start();
  base_test();
  greth_test(0x80000b00);
  report_end();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <report_start@plt>
mov    $0x0,%al
call   1050 <base_test@plt>
mov    $0x80000b00,%edi
call   1040 <greth_test@plt>
mov    $0x0,%al
call   1030 <report_end@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <report_start@plt>
xor    %eax,%eax
call   1050 <base_test@plt>
mov    $0x80000b00,%edi
call   1040 <greth_test@plt>
xor    %eax,%eax
call   1030 <report_end@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @report_start()
%2 = call i32 (...) @base_test()
%3 = call i32 @greth_test(i32 -2147480832)
%4 = call i32 (...) @report_end()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @report_start()
%2 = tail call i32 (...) @base_test()
%3 = tail call i32 @greth_test(i32 -2147480832)
%4 = tail call i32 (...) @report_end()
ret i32 0
}