xunge/DecIR huggingface dataset:
void vec3_set(float *dst, float x, float y, float z) {
  dst[0] = x;
  dst[1] = y;
  dst[2] = z;
}


x86 assembly (clang, -O0):
<vec3_set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
movss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec3_set>:
movss  %xmm0,(%rdi)
movss  %xmm1,0x4(%rdi)
movss  %xmm2,0x8(%rdi)
ret

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

LLVM IR (-O2):
define void @vec3_set(float* nocapture writeonly %0, float %1, float %2, float %3) {
store float %1, float* %0
%5 = getelementptr inbounds float, float* %0, i64 1
store float %2, float* %5
%6 = getelementptr inbounds float, float* %0, i64 2
store float %3, float* %6
ret void
}
void reswap() {
  asm volatile("movq 0x8(%%r15), %%rax\n\t"
               "addq $0x10, %%r15\n\t"
               "movq %%rsp, %%r13\n\t"
               "movq %%r14, %%rsp\n\t"
               "movq %%r13, %%r14\n\t"
               "movq %%r10, %%r9\n\t"
               "movq %%r11, %%r10\n\t"
               "movq %%r9, %%r11\n\t"
               "pushq %%rax\n\t" ::
                   :);
}


x86 assembly (clang, -O0):
<reswap>:
push   %rbp
mov    %rsp,%rbp
mov    0x8(%r15),%rax
add    $0x10,%r15
mov    %rsp,%r13
mov    %r14,%rsp
mov    %r13,%r14
mov    %r10,%r9
mov    %r11,%r10
mov    %r9,%r11
push   %rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reswap>:
mov    0x8(%r15),%rax
add    $0x10,%r15
mov    %rsp,%r13
mov    %r14,%rsp
mov    %r13,%r14
mov    %r10,%r9
mov    %r11,%r10
mov    %r9,%r11
push   %rax
ret

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

LLVM IR (-O2):
define void @reswap() {
tail call void asm sideeffect "movq 0x8(%r15), %rax\0A\09addq $$0x10, %r15\0A\09movq %rsp, %r13\0A\09movq %r14, %rsp\0A\09movq %r13, %r14\0A\09movq %r10, %r9\0A\09movq %r11, %r10\0A\09movq %r9, %r11\0A\09pushq %rax\0A\09", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SPI0_DriverIRQHandler();
__attribute__((weak, section(".after_vectors"))) void SPI0_IRQHandler(void) {
  SPI0_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @SPI0_IRQHandler() section ".after_vectors" {
%1 = call i32 (...) @SPI0_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @SPI0_IRQHandler() section ".after_vectors" {
%1 = tail call i32 (...) @SPI0_DriverIRQHandler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("*..\n**.\n***\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [12 x i8] c"*..\0A**.\0A***\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct pm8xxx_mpp_config_data {
  int dummy;
};

/* Variables and functions */
int ENXIO;
int pm8xxx_mpp_config(unsigned mpp, struct pm8xxx_mpp_config_data *config) {
  return -ENXIO;
}


x86 assembly (clang, -O0):
<pm8xxx_mpp_config>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    0x2ecc(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.pm8xxx_mpp_config_data = type { i32 }
@ENXIO = global i32 0
define i32 @pm8xxx_mpp_config(i32 %0, %struct.pm8xxx_mpp_config_data* %1) {
%3 = alloca i32
%4 = alloca %struct.pm8xxx_mpp_config_data*
store i32 %0, i32* %3
store %struct.pm8xxx_mpp_config_data* %1, %struct.pm8xxx_mpp_config_data** %4
%5 = load i32, i32* @ENXIO
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
%struct.pm8xxx_mpp_config_data = type { i32 }
@ENXIO = global i32 0
define i32 @pm8xxx_mpp_config(i32 %0, %struct.pm8xxx_mpp_config_data* nocapture readnone %1) {
%3 = load i32, i32* @ENXIO
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
scalar_t__ strlen(char *);
int /*<<< orphan*/ write(int, char *, scalar_t__);
void msg_send(int comm, char *msg) {
  write(comm, msg, strlen(msg) + 1);
  printf("send -> %s", msg);
}


x86 assembly (clang, -O0):
<msg_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
call   1030 <write@plt>
mov    -0x10(%rbp),%rsi
lea    0xe8c(%rip),%rdi
call   1050 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msg_send>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <write@plt>
lea    0xeab(%rip),%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"send -> %s\00"
define void @msg_send(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
%7 = load i8*, i8** %4
%8 = call i64 @strlen(i8* %7)
%9 = add nsw i64 %8, 1
%10 = call i32 @write(i32 %5, i8* %6, i64 %9)
%11 = load i8*, i8** %4
%12 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %11)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"send -> %s\00"
define void @msg_send(i32 %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = add nsw i64 %3, 1
%5 = tail call i32 @write(i32 %0, i8* %1, i64 %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *, char *, char *);
void parse_error(char *expected, char *got, char *context) {
  printf("Expected %s, got %s near %s", expected, got, context);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<parse_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<parse_error>:
push   %rax
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Expected %s, got %s near %s\00"
@EXIT_FAILURE = global i32 0
define void @parse_error(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8, i8* %9)
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
}

LLVM IR (-O2):
@.str = [28 x i8] c"Expected %s, got %s near %s\00"
@EXIT_FAILURE = global i32 0
define void @parse_error(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i8* %2)
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
};

/* Variables and functions */
bool tkh_timeval_is_valid(const struct timeval *tv) { return tv->tv_usec >= 0; }


x86 assembly (clang, -O0):
<tkh_timeval_is_valid>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
setge  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tkh_timeval_is_valid>:
mov    (%rdi),%rax
shr    $0x3f,%rax
xor    $0x1,%eax
ret

LLVM IR (-O0):
%struct.timeval = type { i64 }
define i32 @tkh_timeval_is_valid(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %2
%3 = load %struct.timeval*, %struct.timeval** %2
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%5 = load i64, i64* %4
%6 = icmp sge i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
%struct.timeval = type { i64 }
define i32 @tkh_timeval_is_valid(%struct.timeval* nocapture %0) {
%2 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%3 = load i64, i64* %2
%4 = lshr i64 %3, 63
%5 = trunc i64 %4 to i32
%6 = xor i32 %5, 1
ret i32 %6
}
Normalize(v) double v[3];
{
  double Mag(), vt[3];
  Vdiv(vt, v, Mag(v));
  Vset(v, vt);
}


x86 assembly (clang, -O0):
<Normalize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x30(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1040 <Mag@plt>
mov    -0x40(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    $0x1,%al
call   1030 <Vdiv@plt>
mov    -0x10(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x0,%al
call   1050 <Vset@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Normalize>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <Mag@plt>
mov    %rsp,%r14
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x1,%al
call   1030 <Vdiv@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <Vset@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @Normalize(double* %0) {
%2 = alloca i32
%3 = alloca double*
%4 = alloca [3 x double]
store double* %0, double** %3
%5 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 0
%6 = load double*, double** %3
%7 = load double*, double** %3
%8 = call double (double*, ...) bitcast (double (...)* @Mag to double (double*, ...)*)(double* %7)
%9 = call i32 (double*, double*, double, ...) bitcast (i32 (...)* @Vdiv to i32 (double*, double*, double, ...)*)(double* %5, double* %6, double %8)
%10 = load double*, double** %3
%11 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 0
%12 = call i32 (double*, double*, ...) bitcast (i32 (...)* @Vset to i32 (double*, double*, ...)*)(double* %10, double* %11)
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @Normalize(double* %0) {
%2 = alloca [3 x double]
%3 = bitcast [3 x double]* %2 to i8*
%4 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 0
%5 = tail call double (double*, ...) bitcast (double (...)* @Mag to double (double*, ...)*)(double* %0)
%6 = call i32 (double*, double*, double, ...) bitcast (i32 (...)* @Vdiv to i32 (double*, double*, double, ...)*)(double* %4, double* %0, double %5)
%7 = call i32 (double*, double*, ...) bitcast (i32 (...)* @Vset to i32 (double*, double*, ...)*)(double* %0, double* %4)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage(void) { printf("Usage: ls [-hlR] path\n"); }


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"Usage: ls [-hlR] path\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [22 x i8] c"Usage: ls [-hlR] path\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ c();
void a(int d, ...) {
  switch (d) {
  case 5:
    a(4, 2, 4);
    break;
  case 4:
    a(3, 1, 3, 5);
    break;
  case 3:
    a(2, 11, 13, 17, 23);
    break;
  case 2:
    a(1);
    break;
  case 1:
    c();
  }
}


x86 assembly (clang, -O0):
<a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x4,%eax
ja     11c7 <a+0xa7>
mov    -0x10(%rbp),%rax
lea    0xeb5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x4,%edx
mov    $0x2,%esi
mov    %edx,%edi
mov    $0x0,%al
call   1040 <a@plt>
jmp    11c7 <a+0xa7>
mov    $0x3,%edx
mov    $0x1,%esi
mov    $0x5,%ecx
mov    %edx,%edi
mov    $0x0,%al
call   1040 <a@plt>
jmp    11c7 <a+0xa7>
mov    $0x2,%edi
mov    $0xb,%esi
mov    $0xd,%edx
mov    $0x11,%ecx
mov    $0x17,%r8d
mov    $0x0,%al
call   1040 <a@plt>
jmp    11c7 <a+0xa7>
mov    $0x1,%edi
mov    $0x0,%al
call   1040 <a@plt>
jmp    11c7 <a+0xa7>
mov    $0x0,%al
call   1030 <c@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a>:
add    $0xffffffff,%edi
cmp    $0x4,%edi
ja     113f <a+0x1f>
lea    0xed1(%rip),%rax
movslq (%rax,%rdi,4),%rcx
add    %rax,%rcx
jmp    *%rcx
xor    %eax,%eax
jmp    1030 <c@plt>
ret
mov    $0x2,%edi
mov    $0xb,%esi
mov    $0xd,%edx
mov    $0x11,%ecx
mov    $0x17,%r8d
xor    %eax,%eax
jmp    1040 <a@plt>
mov    $0x3,%edi
mov    $0x1,%esi
mov    $0x3,%edx
mov    $0x5,%ecx
xor    %eax,%eax
jmp    1040 <a@plt>
mov    $0x4,%edi
mov    $0x2,%esi
mov    $0x4,%edx
xor    %eax,%eax
jmp    1040 <a@plt>

LLVM IR (-O0):
define void @a(i32 %0, ...) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %10 [
i32 5, label %4
i32 4, label %5
i32 3, label %6
i32 2, label %7
i32 1, label %8
]
4: ; preds = %1
br label %10
5: ; preds = %1
br label %10
6: ; preds = %1
br label %10
7: ; preds = %1
br label %10
8: ; preds = %1
%9 = call i32 (...) @c()
br label %10
10: ; preds = %8, %1, %7, %6, %5, %4
ret void
}

LLVM IR (-O2):
define void @a(i32 %0, ...) {
switch i32 %0, label %9 [
i32 5, label %2
i32 4, label %3
i32 3, label %4
i32 2, label %5
i32 1, label %7
]
2: ; preds = %1
tail call void (i32, ...) @a(i32 4, i32 2, i32 4)
br label %9
3: ; preds = %1
tail call void (i32, ...) @a(i32 3, i32 1, i32 3, i32 5)
br label %9
4: ; preds = %1
tail call void (i32, ...) @a(i32 2, i32 11, i32 13, i32 17, i32 23)
br label %9
5: ; preds = %1
%6 = tail call i32 (...) @c()
br label %9
7: ; preds = %1
%8 = tail call i32 (...) @c()
br label %9
9: ; preds = %7, %1, %5, %4, %3, %2
ret void
}
/* Variables and functions */
unsigned int fetch_int();
int /*<<< orphan*/ fetch_skip(int);
void fetch_skip_audio(void) {
  unsigned x = fetch_int();
  fetch_skip(2);
  if (x == 0x586988d8) {
    return;
  }
  fetch_skip(7);
}


x86 assembly (clang, -O0):
<fetch_skip_audio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <fetch_int@plt>
mov    %eax,-0x4(%rbp)
mov    $0x2,%edi
call   1030 <fetch_skip@plt>
cmpl   $0x586988d8,-0x4(%rbp)
jne    114e <fetch_skip_audio+0x2e>
jmp    1158 <fetch_skip_audio+0x38>
mov    $0x7,%edi
call   1030 <fetch_skip@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fetch_skip_audio>:
push   %rbx
xor    %eax,%eax
call   1040 <fetch_int@plt>
mov    %eax,%ebx
mov    $0x2,%edi
call   1030 <fetch_skip@plt>
cmp    $0x586988d8,%ebx
jne    113e <fetch_skip_audio+0x1e>
pop    %rbx
ret
mov    $0x7,%edi
pop    %rbx
jmp    1030 <fetch_skip@plt>

LLVM IR (-O0):
define void @fetch_skip_audio() {
%1 = alloca i32
%2 = call i32 (...) @fetch_int()
store i32 %2, i32* %1
%3 = call i32 @fetch_skip(i32 2)
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 1483311320
br i1 %5, label %6, label %7
6: ; preds = %0
br label %9
7: ; preds = %0
%8 = call i32 @fetch_skip(i32 7)
br label %9
9: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
define void @fetch_skip_audio() {
%1 = tail call i32 (...) @fetch_int()
%2 = tail call i32 @fetch_skip(i32 2)
%3 = icmp eq i32 %1, 1483311320
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 @fetch_skip(i32 7)
br label %6
6: ; preds = %0, %4
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ MAP_SHARED;
int PROT_READ;
int PROT_WRITE;
void *mmap(int /*<<< orphan*/ *, size_t, int, int /*<<< orphan*/, int,
           int /*<<< orphan*/);
void *mapmem(const char *msg, size_t size, int fd, off_t off) {
  void *map = mmap(NULL, size, (PROT_READ | PROT_WRITE), MAP_SHARED, fd, off);
  return map;
}


x86 assembly (clang, -O0):
<mapmem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    0x2ec7(%rip),%rax
mov    (%rax),%edx
mov    0x2e96(%rip),%rax
or     (%rax),%edx
mov    0x2ea5(%rip),%rax
mov    (%rax),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
xor    %eax,%eax
mov    %eax,%edi
call   1030 <mmap@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mapmem>:
mov    0x2ee1(%rip),%rdi
mov    0x2eb2(%rip),%rax
mov    (%rax),%eax
or     (%rdi),%eax
mov    %ecx,%r9d
mov    %edx,%r8d
mov    0x2eb9(%rip),%rcx
mov    (%rcx),%ecx
xor    %edi,%edi
mov    %eax,%edx
jmp    1030 <mmap@plt>

LLVM IR (-O0):
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
@MAP_SHARED = global i32 0
define i8* @mapmem(i8* %0, i64 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i64, i64* %6
%11 = load i32, i32* @PROT_READ
%12 = load i32, i32* @PROT_WRITE
%13 = or i32 %11, %12
%14 = load i32, i32* @MAP_SHARED
%15 = load i32, i32* %7
%16 = load i32, i32* %8
%17 = call i8* @mmap(i32* null, i64 %10, i32 %13, i32 %14, i32 %15, i32 %16)
store i8* %17, i8** %9
%18 = load i8*, i8** %9
ret i8* %18
}

LLVM IR (-O2):
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
@MAP_SHARED = global i32 0
define i8* @mapmem(i8* nocapture readnone %0, i64 %1, i32 %2, i32 %3) {
%5 = load i32, i32* @PROT_READ
%6 = load i32, i32* @PROT_WRITE
%7 = or i32 %6, %5
%8 = load i32, i32* @MAP_SHARED
%9 = tail call i8* @mmap(i32* null, i64 %1, i32 %7, i32 %8, i32 %2, i32 %3)
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int pipe(int *);
int xpipe(int *p) {
  if (pipe(p) == -1) {
    perror("Error in pipe() function: ");
    return (-1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<xpipe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <pipe@plt>
cmp    $0xffffffff,%eax
jne    1156 <xpipe+0x36>
lea    0xebb(%rip),%rdi
call   1040 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    115d <xpipe+0x3d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xpipe>:
push   %rax
call   1030 <pipe@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
je     1131 <xpipe+0x11>
pop    %rcx
ret
lea    0xec8(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Error in pipe() function: \00"
define i32 @xpipe(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = call i32 @pipe(i32* %4)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @perror(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %2
br label %10
9: ; preds = %1
store i32 0, i32* %2
br label %10
10: ; preds = %9, %7
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@.str = [27 x i8] c"Error in pipe() function: \00"
define i32 @xpipe(i32* %0) {
%2 = tail call i32 @pipe(i32* %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ -1, %4 ], [ 0, %1 ]
ret i32 %7
}
int index_less_equal(double *array, int size, double target) {
  int i;
  for (i = 0; i < size; i++) {
    if (array[i] > target)
      return i;
  }
  return i;
}


x86 assembly (clang, -O0):
<index_less_equal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movsd  %xmm0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1159 <index_less_equal+0x59>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    1146 <index_less_equal+0x46>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115f <index_less_equal+0x5f>
jmp    114b <index_less_equal+0x4b>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1117 <index_less_equal+0x17>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<index_less_equal>:
test   %esi,%esi
jle    1127 <index_less_equal+0x27>
mov    %esi,%ecx
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
movsd  (%rdi,%rax,8),%xmm1
ucomisd %xmm0,%xmm1
ja     1126 <index_less_equal+0x26>
add    $0x1,%rax
cmp    %rax,%rcx
jne    1110 <index_less_equal+0x10>
mov    %ecx,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @index_less_equal(double* %0, i32 %1, double %2) {
%4 = alloca i32
%5 = alloca double*
%6 = alloca i32
%7 = alloca double
%8 = alloca i32
store double* %0, double** %5
store i32 %1, i32* %6
store double %2, double* %7
store i32 0, i32* %8
br label %9
9: ; preds = %24, %3
%10 = load i32, i32* %8
%11 = load i32, i32* %6
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %27
13: ; preds = %9
%14 = load double*, double** %5
%15 = load i32, i32* %8
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds double, double* %14, i64 %16
%18 = load double, double* %17
%19 = load double, double* %7
%20 = fcmp ogt double %18, %19
br i1 %20, label %21, label %23
21: ; preds = %13
%22 = load i32, i32* %8
store i32 %22, i32* %4
br label %29
23: ; preds = %13
br label %24
24: ; preds = %23
%25 = load i32, i32* %8
%26 = add nsw i32 %25, 1
store i32 %26, i32* %8
br label %9
27: ; preds = %9
%28 = load i32, i32* %8
store i32 %28, i32* %4
br label %29
29: ; preds = %27, %21
%30 = load i32, i32* %4
ret i32 %30
}

LLVM IR (-O2):
define i32 @index_less_equal(double* nocapture %0, i32 %1, double %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = getelementptr inbounds double, double* %0, i64 %8
%10 = load double, double* %9
%11 = fcmp ogt double %10, %2
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %17, label %7
15: ; preds = %7
%16 = trunc i64 %8 to i32
br label %17
17: ; preds = %12, %15, %3
%18 = phi i32 [ 0, %3 ], [ %16, %15 ], [ %1, %12 ]
ret i32 %18
}
int test_imm_14uint16_mem(unsigned short *val) {
  return ((*val) & (-0x14 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_14uint16_mem>:
movzwl (%rdi),%eax
test   $0xffec,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_14uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -20
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void gtk_button_leave() {}


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

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

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

LLVM IR (-O2):
define void @gtk_button_leave() {
ret void
}
/* Variables and functions */
int GL_COLOR_BUFFER_BIT;
int GL_DEPTH_BUFFER_BIT;
int /*<<< orphan*/ GL_RENDER;
int /*<<< orphan*/ drawRects(int /*<<< orphan*/);
int /*<<< orphan*/ glClear(int);
int /*<<< orphan*/ glutSwapBuffers();
void display(void) {
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  drawRects(GL_RENDER);
  glutSwapBuffers();
}


x86 assembly (clang, -O0):
<display>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
mov    0x2ea4(%rip),%rax
or     (%rax),%edi
call   1030 <glClear@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
call   1050 <drawRects@plt>
mov    $0x0,%al
call   1040 <glutSwapBuffers@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<display>:
push   %rax
mov    0x2e98(%rip),%rax
mov    0x2ea9(%rip),%rcx
mov    (%rcx),%edi
or     (%rax),%edi
call   1030 <glClear@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
call   1050 <drawRects@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <glutSwapBuffers@plt>

LLVM IR (-O0):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_DEPTH_BUFFER_BIT = global i32 0
@GL_RENDER = global i32 0
define void @display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = load i32, i32* @GL_DEPTH_BUFFER_BIT
%3 = or i32 %1, %2
%4 = call i32 @glClear(i32 %3)
%5 = load i32, i32* @GL_RENDER
%6 = call i32 @drawRects(i32 %5)
%7 = call i32 (...) @glutSwapBuffers()
ret void
}

LLVM IR (-O2):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_DEPTH_BUFFER_BIT = global i32 0
@GL_RENDER = global i32 0
define void @display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = load i32, i32* @GL_DEPTH_BUFFER_BIT
%3 = or i32 %2, %1
%4 = tail call i32 @glClear(i32 %3)
%5 = load i32, i32* @GL_RENDER
%6 = tail call i32 @drawRects(i32 %5)
%7 = tail call i32 (...) @glutSwapBuffers()
ret void
}
int roccat_connect(struct class *klass, struct hid_device *hid) { return -1; }


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

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

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

LLVM IR (-O2):
%struct.class = type opaque
%struct.hid_device = type opaque
define i32 @roccat_connect(%struct.class* nocapture readnone %0, %struct.hid_device* nocapture readnone %1) {
ret i32 -1
}
char *skip_whitespace(char *s) {
  while (*s == ' ' || (unsigned char)(*s - 9) <= (13 - 9))
    s++;
  return (char *)s;
}


x86 assembly (clang, -O0):
<skip_whitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x9(%rbp)
je     1133 <skip_whitespace+0x33>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
sub    $0x9,%eax
movzbl %al,%eax
cmp    $0x4,%eax
setle  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1143 <skip_whitespace+0x43>
jmp    1154 <skip_whitespace+0x54>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <skip_whitespace+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_whitespace>:
mov    %rdi,%rax
jmp    1114 <skip_whitespace+0x14>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rax
movzbl (%rax),%ecx
lea    -0x9(%rcx),%edx
cmp    $0x5,%dl
jb     1110 <skip_whitespace+0x10>
cmp    $0x20,%cl
je     1110 <skip_whitespace+0x10>
ret

LLVM IR (-O0):
define i8* @skip_whitespace(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %18, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 32
br i1 %7, label %16, label %8
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = sub nsw i32 %11, 9
%13 = trunc i32 %12 to i8
%14 = zext i8 %13 to i32
%15 = icmp sle i32 %14, 4
br label %16
16: ; preds = %8, %3
%17 = phi i1 [ true, %3 ], [ %15, %8 ]
br i1 %17, label %18, label %21
18: ; preds = %16
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %2
br label %3
21: ; preds = %16
%22 = load i8*, i8** %2
ret i8* %22
}

LLVM IR (-O2):
define i8* @skip_whitespace(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 32, label %5
i8 13, label %5
i8 12, label %5
i8 11, label %5
i8 10, label %5
i8 9, label %5
]
5: ; preds = %2, %2, %2, %2, %2, %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
ret i8* %3
}
long double baz(long double x, long double y) {
  return x * x * x * x * y * y * y * y;
}


x86 assembly (clang, -O0):
<baz>:
push   %rbp
mov    %rsp,%rbp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fld    %st(0)
fmul   %st(1),%st
fmul   %st(1),%st
fmulp  %st,%st(1)
fldt   -0x20(%rbp)
fmul   %st,%st(1)
fmul   %st,%st(1)
fmul   %st,%st(1)
fmulp  %st,%st(1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<baz>:
fldt   0x18(%rsp)
fldt   0x8(%rsp)
fld    %st(0)
fmul   %st(1),%st
fmul   %st(1),%st
fmulp  %st,%st(1)
fmul   %st(1),%st
fmul   %st(1),%st
fmul   %st(1),%st
fmulp  %st,%st(1)
ret

LLVM IR (-O0):
define x86_fp80 @baz(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %3
%7 = fmul x86_fp80 %5, %6
%8 = load x86_fp80, x86_fp80* %3
%9 = fmul x86_fp80 %7, %8
%10 = load x86_fp80, x86_fp80* %3
%11 = fmul x86_fp80 %9, %10
%12 = load x86_fp80, x86_fp80* %4
%13 = fmul x86_fp80 %11, %12
%14 = load x86_fp80, x86_fp80* %4
%15 = fmul x86_fp80 %13, %14
%16 = load x86_fp80, x86_fp80* %4
%17 = fmul x86_fp80 %15, %16
%18 = load x86_fp80, x86_fp80* %4
%19 = fmul x86_fp80 %17, %18
ret x86_fp80 %19
}

LLVM IR (-O2):
define x86_fp80 @baz(x86_fp80 %0, x86_fp80 %1) {
%3 = fmul x86_fp80 %0, %0
%4 = fmul x86_fp80 %3, %0
%5 = fmul x86_fp80 %4, %0
%6 = fmul x86_fp80 %5, %1
%7 = fmul x86_fp80 %6, %1
%8 = fmul x86_fp80 %7, %1
%9 = fmul x86_fp80 %8, %1
ret x86_fp80 %9
}
int flvmeta_isfinite(double d) { return !(d != d); }


x86 assembly (clang, -O0):
<flvmeta_isfinite>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x8(%rbp),%xmm0
setne  %al
setp   %cl
or     %cl,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<flvmeta_isfinite>:
xor    %eax,%eax
ucomisd %xmm0,%xmm0
setnp  %al
ret

LLVM IR (-O0):
define i32 @flvmeta_isfinite(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fcmp une double %3, %4
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @flvmeta_isfinite(double %0) {
%2 = fcmp ord double %0, 0.000000e+00
%3 = zext i1 %2 to i32
ret i32 %3
}
void capturing2capturingPosbehind_rv_endCapturing() {}


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

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

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

LLVM IR (-O2):
define void @capturing2capturingPosbehind_rv_endCapturing() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;
typedef int /*<<< orphan*/ dev_t;

/* Variables and functions */
int mknod(const char *pathname, mode_t mode, dev_t dev) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @mknod(i8* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 0
}
int skip_spaces(char *str) {
  char *p = str;
  while (*p == ' ')
    p++;
  return p - str;
}


x86 assembly (clang, -O0):
<skip_spaces>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    1131 <skip_spaces+0x31>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <skip_spaces+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @skip_spaces(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 32
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %2, label %7
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
/* Variables and functions */
unsigned int __builtin_cdtbcd(unsigned int);
unsigned int to_bcd(unsigned int a) { return __builtin_cdtbcd(a); }


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

x86 assembly (clang, -O2):
<to_bcd>:
jmp    1030 <__builtin_cdtbcd@plt>

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

LLVM IR (-O2):
define i32 @to_bcd(i32 %0) {
%2 = tail call i32 @__builtin_cdtbcd(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ pr_info(char *, int);
int sci_get_chip_id();
int soc_id_is_sc9830iv0(void) {
  pr_info("chip id is %x\n", sci_get_chip_id());
  return ((sci_get_chip_id() & (0xFFFFFFFF)) == ((0x6b4c5300) & (0xFFFFFFFF)));
}


x86 assembly (clang, -O0):
<soc_id_is_sc9830iv0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <sci_get_chip_id@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1030 <pr_info@plt>
mov    $0x0,%al
call   1040 <sci_get_chip_id@plt>
and    $0xffffffff,%eax
cmp    $0x6b4c5300,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<soc_id_is_sc9830iv0>:
push   %rax
xor    %eax,%eax
call   1040 <sci_get_chip_id@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1030 <pr_info@plt>
xor    %eax,%eax
call   1040 <sci_get_chip_id@plt>
xor    %ecx,%ecx
cmp    $0x6b4c5300,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"chip id is %x\0A\00"
define i32 @soc_id_is_sc9830iv0() {
%1 = call i32 (...) @sci_get_chip_id()
%2 = call i32 @pr_info(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 (...) @sci_get_chip_id()
%4 = and i32 %3, -1
%5 = icmp eq i32 %4, 1800164096
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [15 x i8] c"chip id is %x\0A\00"
define i32 @soc_id_is_sc9830iv0() {
%1 = tail call i32 (...) @sci_get_chip_id()
%2 = tail call i32 @pr_info(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @sci_get_chip_id()
%4 = icmp eq i32 %3, 1800164096
%5 = zext i1 %4 to i32
ret i32 %5
}
void EchoP__uart0__putDone(void) {}


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

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

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

LLVM IR (-O2):
define void @EchoP__uart0__putDone() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void rpi_car_backward() {
  printf("### RPi Car Backward ###\n");
  ;
  ;
  ;
  ;
}


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"### RPi Car Backward ###\0A\00"
define void @rpi_car_backward() {
%1 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [25 x i8] c"### RPi Car Backward ###\00"
define void @rpi_car_backward() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret void
}
__attribute__((__noreturn__,
               __unused__)) void(cheat_unwrapped__Exit)(int const status) {
  _Exit(status);
}


x86 assembly (clang, -O0):
<cheat_unwrapped__Exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <_Exit@plt>

x86 assembly (clang, -O2):
<cheat_unwrapped__Exit>:
push   %rax
call   1030 <_Exit@plt>

LLVM IR (-O0):
define void @cheat_unwrapped__Exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
unreachable
}

LLVM IR (-O2):
define void @cheat_unwrapped__Exit(i32 %0) {
tail call void @_Exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *, int);
void Xil_Assert(const char *file, int line) {
  printf("Assertion failed at %s:%d\n", file, line);
  exit(1);
}


x86 assembly (clang, -O0):
<Xil_Assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<Xil_Assert>:
push   %rax
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Assertion failed at %s:%d\0A\00"
define void @Xil_Assert(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 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6)
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [27 x i8] c"Assertion failed at %s:%d\0A\00"
define void @Xil_Assert(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%4 = tail call i32 @exit(i32 1)
unreachable
}
unsigned char _is_blank_char(char c) { return (c == ' ') || (c == '\t'); }


x86 assembly (clang, -O0):
<_is_blank_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     1129 <_is_blank_char+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_is_blank_char>:
cmp    $0x20,%dil
sete   %cl
cmp    $0x9,%dil
sete   %al
or     %cl,%al
ret

LLVM IR (-O0):
define zeroext i8 @_is_blank_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 32
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 9
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
%13 = trunc i32 %12 to i8
ret i8 %13
}

LLVM IR (-O2):
define zeroext i8 @_is_blank_char(i8 signext %0) {
%2 = icmp eq i8 %0, 32
%3 = icmp eq i8 %0, 9
%4 = or i1 %2, %3
%5 = zext i1 %4 to i8
ret i8 %5
}
void g_value_array_prepend() {}


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

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

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

LLVM IR (-O2):
define void @g_value_array_prepend() {
ret void
}
/* Variables and functions */
char *malloc_or_die(char *, scalar_t__);
char *strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *copy_string(const char *s) {
  char *ss;
  if (s == NULL)
    return NULL;
  ss = malloc_or_die("copy_string", strlen(s) + 1);
  return strcpy(ss, s);
}


x86 assembly (clang, -O0):
<copy_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <copy_string+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1185 <copy_string+0x55>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rsi
add    $0x1,%rsi
lea    0xe95(%rip),%rdi
call   1050 <malloc_or_die@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_string>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     1161 <copy_string+0x31>
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rsi
lea    0xeb4(%rip),%rdi
call   1050 <malloc_or_die@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
jmp    1164 <copy_string+0x34>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [12 x i8] c"copy_string\00"
define i8* @copy_string(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %8
7: ; preds = %1
store i8* null, i8** %2
br label %16
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i64 @strlen(i8* %9)
%11 = add nsw i64 %10, 1
%12 = call i8* @malloc_or_die(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i64 %11)
store i8* %12, i8** %4
%13 = load i8*, i8** %4
%14 = load i8*, i8** %3
%15 = call i8* @strcpy(i8* %13, i8* %14)
store i8* %15, i8** %2
br label %16
16: ; preds = %8, %7
%17 = load i8*, i8** %2
ret i8* %17
}

LLVM IR (-O2):
@.str = [12 x i8] c"copy_string\00"
define i8* @copy_string(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
%5 = add nsw i64 %4, 1
%6 = tail call i8* @malloc_or_die(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i64 %5)
%7 = tail call i8* @strcpy(i8* dereferenceable(1) %6, i8* %0)
br label %8
8: ; preds = %1, %3
%9 = phi i8* [ %6, %3 ], [ null, %1 ]
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
char wat();
int main(void) {
  char huh = wat();
  putchar(huh);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <wat@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <wat@plt>
movsbl %al,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i8
%2 = call signext i8 (...) @wat()
store i8 %2, i8* %1
%3 = load i8, i8* %1
%4 = call i32 @putchar(i8 signext %3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call signext i8 (...) @wat()
%2 = tail call i32 @putchar(i8 signext %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void ft_free2(char *s1, char *s2) {
  if (s1)
    free(s1);
  if (s2)
    free(s2);
}


x86 assembly (clang, -O0):
<ft_free2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1134 <ft_free2+0x24>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0x10(%rbp)
je     1148 <ft_free2+0x38>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_free2>:
push   %rbx
mov    %rsi,%rbx
test   %rdi,%rdi
je     111e <ft_free2+0xe>
call   1030 <free@plt>
test   %rbx,%rbx
je     112c <ft_free2+0x1c>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
pop    %rbx
ret

LLVM IR (-O0):
define void @ft_free2(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 = icmp ne i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = call i32 @free(i8* %8)
br label %10
10: ; preds = %7, %2
%11 = load i8*, i8** %4
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i8*, i8** %4
%15 = call i32 @free(i8* %14)
br label %16
16: ; preds = %13, %10
ret void
}

LLVM IR (-O2):
define void @ft_free2(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @free(i8* %0)
br label %6
6: ; preds = %4, %2
%7 = icmp eq i8* %1, null
br i1 %7, label %10, label %8
8: ; preds = %6
%9 = tail call i32 @free(i8* %1)
br label %10
10: ; preds = %8, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ver_up_auto_mark_1_1_3();
void ver_up_game_data_1_1_3(void) { ver_up_auto_mark_1_1_3(); }


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

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

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

LLVM IR (-O2):
define void @ver_up_game_data_1_1_3() {
%1 = tail call i32 (...) @ver_up_auto_mark_1_1_3()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ initDroidPwMgmt();
void initPowerManagement(void) { initDroidPwMgmt(); }


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

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

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

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