xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
bool validate_input(int argc, char argv) {
  if (argc < 1) {
    printf("Usage:\n udpv6 < IPv6 >\n");
    exit(1);
  }
  return false;
}


x86 assembly (clang, -O0):
<validate_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
cmpl   $0x1,-0x4(%rbp)
jge    1151 <validate_input+0x31>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<validate_input>:
test   %edi,%edi
jle    1127 <validate_input+0x7>
xor    %eax,%eax
ret
push   %rax
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Usage:\0A udpv6 < IPv6 >\0A\00"
define i32 @validate_input(i32 %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
store i8 %1, i8* %4
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 1
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @exit(i32 1)
unreachable
10: ; preds = %2
ret i32 0
}

LLVM IR (-O2):
@str = [23 x i8] c"Usage:\0A udpv6 < IPv6 >\00"
define i32 @validate_input(i32 %0, i8 signext %1) {
%3 = icmp slt i32 %0, 1
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %2
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ EBADF;
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
pid_t tcgetpgrp(int fd) {
  if (fd < 0) {
    __set_errno(EBADF);
    return (pid_t)-1;
  }
  __set_errno(ENOSYS);
  return (pid_t)-1;
}


x86 assembly (clang, -O0):
<tcgetpgrp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    113f <tcgetpgrp+0x2f>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1154 <tcgetpgrp+0x44>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcgetpgrp>:
push   %rax
test   %edi,%edi
jns    111e <tcgetpgrp+0xe>
mov    0x2ebc(%rip),%rax
jmp    1125 <tcgetpgrp+0x15>
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@EBADF = global i32 0
@ENOSYS = global i32 0
define i32 @tcgetpgrp(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* @EBADF
%8 = call i32 @__set_errno(i32 %7)
store i32 -1, i32* %2
br label %12
9: ; preds = %1
%10 = load i32, i32* @ENOSYS
%11 = call i32 @__set_errno(i32 %10)
store i32 -1, i32* %2
br label %12
12: ; preds = %9, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@EBADF = global i32 0
@ENOSYS = global i32 0
define i32 @tcgetpgrp(i32 %0) {
%2 = icmp slt i32 %0, 0
%3 = load i32, i32* @EBADF
%4 = load i32, i32* @ENOSYS
%5 = select i1 %2, i32 %3, i32 %4
%6 = tail call i32 @__set_errno(i32 %5)
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ CheckErrnoImpl(int, char *);
scalar_t__ pthread_cancel(int /*<<< orphan*/ const);
scalar_t__ pthread_join(int /*<<< orphan*/ const, int /*<<< orphan*/ *);
void CancelThread(const pthread_t thread) {
  (CheckErrnoImpl((pthread_cancel(thread) == 0),
                  "pthread_cancel(thread) == 0"));
  (CheckErrnoImpl((pthread_join(thread, NULL) == 0),
                  "pthread_join(thread, NULL) == 0"));
}


x86 assembly (clang, -O0):
<CancelThread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <pthread_cancel@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xeaa(%rip),%rsi
call   1030 <CheckErrnoImpl@plt>
mov    -0x4(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <pthread_join@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xea2(%rip),%rsi
call   1030 <CheckErrnoImpl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CancelThread>:
push   %rbx
mov    %edi,%ebx
call   1050 <pthread_cancel@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xeb8(%rip),%rsi
call   1030 <CheckErrnoImpl@plt>
mov    %ebx,%edi
xor    %esi,%esi
call   1040 <pthread_join@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xeb6(%rip),%rsi
pop    %rbx
jmp    1030 <CheckErrnoImpl@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"pthread_cancel(thread) == 0\00"
@.str.1 = [32 x i8] c"pthread_join(thread, NULL) == 0\00"
define void @CancelThread(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @pthread_cancel(i32 %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @CheckErrnoImpl(i32 %6, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %2
%9 = call i64 @pthread_join(i32 %8, i32* null)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
%12 = call i32 @CheckErrnoImpl(i32 %11, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"pthread_cancel(thread) == 0\00"
@.str.1 = [32 x i8] c"pthread_join(thread, NULL) == 0\00"
define void @CancelThread(i32 %0) {
%2 = tail call i64 @pthread_cancel(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @CheckErrnoImpl(i32 %4, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%6 = tail call i64 @pthread_join(i32 %0, i32* null)
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
%9 = tail call i32 @CheckErrnoImpl(i32 %8, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ MC_avg1_8(int, int /*<<< orphan*/ *,
                             int /*<<< orphan*/ const *, int,
                             int /*<<< orphan*/);
void MC_avg_o_8_mmxext(uint8_t *dest, const uint8_t *ref, int stride,
                       int height) {
  MC_avg1_8(height, dest, ref, stride, 0);
}


x86 assembly (clang, -O0):
<MC_avg_o_8_mmxext>:
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    -0x18(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
xor    %r8d,%r8d
call   1030 <MC_avg1_8@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MC_avg_o_8_mmxext>:
mov    %edx,%eax
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %ecx,%edi
mov    %eax,%ecx
xor    %r8d,%r8d
jmp    1030 <MC_avg1_8@plt>

LLVM IR (-O0):
define void @MC_avg_o_8_mmxext(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = load i32*, i32** %5
%11 = load i32*, i32** %6
%12 = load i32, i32* %7
%13 = call i32 @MC_avg1_8(i32 %9, i32* %10, i32* %11, i32 %12, i32 0)
ret void
}

LLVM IR (-O2):
define void @MC_avg_o_8_mmxext(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = tail call i32 @MC_avg1_8(i32 %3, i32* %0, i32* %1, i32 %2, i32 0)
ret void
}
void CG_Item_f(void) {}


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

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

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

LLVM IR (-O2):
define void @CG_Item_f() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo();
void isr2(void) { foo(); }


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

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

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

LLVM IR (-O2):
define void @isr2() {
%1 = tail call i32 (...) @foo()
ret void
}
unsigned t2(unsigned a, unsigned b) {
  printf("%s: a: %u\n", __func__, a);
  printf("%s: b: %u\n", __func__, b);
  return a + b;
}


x86 assembly (clang, -O0):
<t2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
lea    0xed8(%rip),%rdi
lea    0xedc(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%edx
lea    0xece(%rip),%rdi
lea    0xec4(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t2>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xee1(%rip),%rdi
lea    0xee5(%rip),%r14
mov    %r14,%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
mov    %r14,%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
add    %ebp,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"%s: a: %u\0A\00"
@__func__.t2 = [3 x i8] c"t2\00"
@.str.1 = [11 x i8] c"%s: b: %u\0A\00"
define i32 @t2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__func__.t2, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %4
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__func__.t2, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = add i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
@.str = [11 x i8] c"%s: a: %u\0A\00"
@__func__.t2 = [3 x i8] c"t2\00"
@.str.1 = [11 x i8] c"%s: b: %u\0A\00"
define i32 @t2(i32 %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__func__.t2, i64 0, i64 0), i32 %0)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__func__.t2, i64 0, i64 0), i32 %1)
%5 = add i32 %1, %0
ret i32 %5
}
void yy_z_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @yy_z_targetInit__I() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getint();
int /*<<< orphan*/ test(int /*<<< orphan*/, int);
main() {
  test(getint(), 2);
  test(getint(), 3);
  test(getint(), 6);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getint@plt>
mov    %eax,%edi
mov    $0x2,%esi
call   1040 <test@plt>
mov    $0x0,%al
call   1030 <getint@plt>
mov    %eax,%edi
mov    $0x3,%esi
call   1040 <test@plt>
mov    $0x0,%al
call   1030 <getint@plt>
mov    %eax,%edi
mov    $0x6,%esi
call   1040 <test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <getint@plt>
mov    %eax,%edi
mov    $0x2,%esi
call   1040 <test@plt>
xor    %eax,%eax
call   1030 <getint@plt>
mov    %eax,%edi
mov    $0x3,%esi
call   1040 <test@plt>
xor    %eax,%eax
call   1030 <getint@plt>
mov    %eax,%edi
mov    $0x6,%esi
call   1040 <test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @getint()
%3 = call i32 @test(i32 %2, i32 2)
%4 = call i32 (...) @getint()
%5 = call i32 @test(i32 %4, i32 3)
%6 = call i32 (...) @getint()
%7 = call i32 @test(i32 %6, i32 6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @getint()
%2 = tail call i32 @test(i32 %1, i32 2)
%3 = tail call i32 (...) @getint()
%4 = tail call i32 @test(i32 %3, i32 3)
%5 = tail call i32 (...) @getint()
%6 = tail call i32 @test(i32 %5, i32 6)
ret i32 0
}
/* Variables and functions */
double exp(double);
double sqrt(int);
double func(double x, double y) { return y * exp(y + x) / sqrt(1. - y * y); }


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
addsd  -0x8(%rbp),%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe77(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
addsd  %xmm1,%xmm0
call   1030 <exp@plt>
movsd  0x8(%rsp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rsp)
mulsd  %xmm1,%xmm1
movsd  0xeb1(%rip),%xmm0
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <sqrt@plt>
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @func(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 = load double, double* %4
%7 = load double, double* %3
%8 = fadd double %6, %7
%9 = call double @exp(double %8)
%10 = fmul double %5, %9
%11 = load double, double* %4
%12 = load double, double* %4
%13 = fneg double %11
%14 = call double @llvm.fmuladd.f64(double %13, double %12, double 1.000000e+00)
%15 = fptosi double %14 to i32
%16 = call double @sqrt(i32 %15)
%17 = fdiv double %10, %16
ret double %17
}

LLVM IR (-O2):
define double @func(double %0, double %1) {
%3 = fadd double %0, %1
%4 = tail call double @exp(double %3)
%5 = fmul double %4, %1
%6 = fneg double %1
%7 = tail call double @llvm.fmuladd.f64(double %6, double %1, double 1.000000e+00)
%8 = fptosi double %7 to i32
%9 = tail call double @sqrt(i32 %8)
%10 = fdiv double %5, %9
ret double %10
}
/* Variables and functions */
int atoi(char const *);
char CByteChars(const char *Src) {
  int ret = atoi(Src);
  return (char)ret;
}


x86 assembly (clang, -O0):
<CByteChars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <atoi@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CByteChars>:
push   %rax
call   1030 <atoi@plt>
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @CByteChars(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @atoi(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = trunc i32 %6 to i8
ret i8 %7
}

LLVM IR (-O2):
define signext i8 @CByteChars(i8* nocapture %0) {
%2 = tail call i32 @atoi(i8* %0)
%3 = trunc i32 %2 to i8
ret i8 %3
}
void player_swap(int p1, int p2, int *sort_array) {
  int tmp;
  tmp = sort_array[p1];
  sort_array[p1] = sort_array[p2];
  sort_array[p2] = tmp;
}


x86 assembly (clang, -O0):
<player_swap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<player_swap>:
movslq %edi,%rax
mov    (%rdx,%rax,4),%ecx
movslq %esi,%rsi
mov    (%rdx,%rsi,4),%edi
mov    %edi,(%rdx,%rax,4)
mov    %ecx,(%rdx,%rsi,4)
ret

LLVM IR (-O0):
define void @player_swap(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%8 = load i32*, i32** %6
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %6
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %6
%19 = load i32, i32* %4
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
%23 = load i32*, i32** %6
%24 = load i32, i32* %5
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
ret void
}

LLVM IR (-O2):
define void @player_swap(i32 %0, i32 %1, i32* nocapture %2) {
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds i32, i32* %2, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %1 to i64
%8 = getelementptr inbounds i32, i32* %2, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
unsigned char encode_salinity(float s) {
  float out;
  if (s < 20.0)
    return 0;
  else {
    out = (s - 20.0) * 10.0;
    if (out > 255.0)
      out = 255.0;
    return (unsigned char)out;
  }
}


x86 assembly (clang, -O0):
<encode_salinity>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xee6(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    112d <encode_salinity+0x2d>
movb   $0x0,-0x1(%rbp)
jmp    1187 <encode_salinity+0x87>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xec2(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xec6(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xea0(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    117f <encode_salinity+0x7f>
movss  0xe9e(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
cvttss2si -0xc(%rbp),%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<encode_salinity>:
movss  0xef8(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    1110 <encode_salinity+0x10>
xor    %eax,%eax
ret
cvtss2sd %xmm0,%xmm0
addsd  0xeec(%rip),%xmm0
mulsd  0xeec(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  0xed4(%rip),%xmm1
minss  %xmm0,%xmm1
cvttss2si %xmm1,%eax
ret

LLVM IR (-O0):
define zeroext i8 @encode_salinity(float %0) {
%2 = alloca i8
%3 = alloca float
%4 = alloca float
store float %0, float* %3
%5 = load float, float* %3
%6 = fpext float %5 to double
%7 = fcmp olt double %6, 2.000000e+01
br i1 %7, label %8, label %9
8: ; preds = %1
store i8 0, i8* %2
br label %22
9: ; preds = %1
%10 = load float, float* %3
%11 = fpext float %10 to double
%12 = fsub double %11, 2.000000e+01
%13 = fmul double %12, 1.000000e+01
%14 = fptrunc double %13 to float
store float %14, float* %4
%15 = load float, float* %4
%16 = fpext float %15 to double
%17 = fcmp ogt double %16, 2.550000e+02
br i1 %17, label %18, label %19
18: ; preds = %9
store float 2.550000e+02, float* %4
br label %19
19: ; preds = %18, %9
%20 = load float, float* %4
%21 = fptoui float %20 to i8
store i8 %21, i8* %2
br label %22
22: ; preds = %19, %8
%23 = load i8, i8* %2
ret i8 %23
}

LLVM IR (-O2):
define zeroext i8 @encode_salinity(float %0) {
%2 = fcmp olt float %0, 2.000000e+01
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = fpext float %0 to double
%5 = fadd double %4, -2.000000e+01
%6 = fmul double %5, 1.000000e+01
%7 = fptrunc double %6 to float
%8 = fcmp ogt float %7, 2.550000e+02
%9 = select i1 %8, float 2.550000e+02, float %7
%10 = fptoui float %9 to i8
br label %11
11: ; preds = %1, %3
%12 = phi i8 [ %10, %3 ], [ 0, %1 ]
ret i8 %12
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0x81() {
  Assert_real((isprint(129) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isprint.c",
              650, ("isprint should be 0 for 0x81"));
}


x86 assembly (clang, -O0):
<t_isprint_0x81>:
push   %rbp
mov    %rsp,%rbp
mov    $0x81,%edi
call   1030 <isprint@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x28a,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0x81>:
push   %rax
mov    $0x81,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x28a,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x81\00"
define void @t_isprint_0x81() {
%1 = call i64 @isprint(i32 129)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 650, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x81\00"
define void @t_isprint_0x81() {
%1 = tail call i64 @isprint(i32 129)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 650, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pixel_unpack_portable_u8s16_uv(unsigned char *, short *,
                                                  int);
int /*<<< orphan*/ pixel_unpack_portable_u8s16_y(unsigned char *, short *, int);
void llconv_yvu_planar_u8s16(unsigned char *source, short int *dest,
                             int nbpixels) {
  pixel_unpack_portable_u8s16_y(source, dest, nbpixels);
  pixel_unpack_portable_u8s16_uv(&source[nbpixels], &dest[nbpixels],
                                 nbpixels >> 1);
}


x86 assembly (clang, -O0):
<llconv_yvu_planar_u8s16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <pixel_unpack_portable_u8s16_y@plt>
mov    -0x8(%rbp),%rdi
movslq -0x14(%rbp),%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rax
shl    $0x1,%rax
add    %rax,%rsi
mov    -0x14(%rbp),%edx
sar    $0x1,%edx
call   1040 <pixel_unpack_portable_u8s16_uv@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<llconv_yvu_planar_u8s16>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <pixel_unpack_portable_u8s16_y@plt>
movslq %ebp,%rdx
add    %rdx,%rbx
lea    (%r14,%rdx,2),%rsi
sar    %edx
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <pixel_unpack_portable_u8s16_uv@plt>

LLVM IR (-O0):
define void @llconv_yvu_planar_u8s16(i8* %0, i16* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i16*
%6 = alloca i32
store i8* %0, i8** %4
store i16* %1, i16** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i16*, i16** %5
%9 = load i32, i32* %6
%10 = call i32 @pixel_unpack_portable_u8s16_y(i8* %7, i16* %8, i32 %9)
%11 = load i8*, i8** %4
%12 = load i32, i32* %6
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i16*, i16** %5
%16 = load i32, i32* %6
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i16, i16* %15, i64 %17
%19 = load i32, i32* %6
%20 = ashr i32 %19, 1
%21 = call i32 @pixel_unpack_portable_u8s16_uv(i8* %14, i16* %18, i32 %20)
ret void
}

LLVM IR (-O2):
define void @llconv_yvu_planar_u8s16(i8* %0, i16* %1, i32 %2) {
%4 = tail call i32 @pixel_unpack_portable_u8s16_y(i8* %0, i16* %1, i32 %2)
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = getelementptr inbounds i16, i16* %1, i64 %5
%8 = ashr i32 %2, 1
%9 = tail call i32 @pixel_unpack_portable_u8s16_uv(i8* %6, i16* %7, i32 %8)
ret void
}
/* Variables and functions */
double fabs(double);
double log10(double);
double dbamp(float amp) {
  double fabs_amp = fabs((double)amp);
  return (20.0 * log10(fabs_amp));
}


x86 assembly (clang, -O0):
<dbamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movaps 0xee3(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <log10@plt>
movaps %xmm0,%xmm1
movsd  0xeb5(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dbamp>:
push   %rax
andps  0xee8(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <log10@plt>
mulsd  0xee7(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @dbamp(float %0) {
%2 = alloca float
%3 = alloca double
store float %0, float* %2
%4 = load float, float* %2
%5 = fpext float %4 to double
%6 = call double @llvm.fabs.f64(double %5)
store double %6, double* %3
%7 = load double, double* %3
%8 = call double @log10(double %7)
%9 = fmul double 2.000000e+01, %8
ret double %9
}

LLVM IR (-O2):
define double @dbamp(float %0) {
%2 = tail call float @llvm.fabs.f32(float %0)
%3 = fpext float %2 to double
%4 = tail call double @log10(double %3)
%5 = fmul double %4, 2.000000e+01
ret double %5
}
void ARGBToI422() {}


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

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

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

LLVM IR (-O2):
define void @ARGBToI422() {
ret void
}
int mkstemps(char *template, int suffixlen) {
  printf("tcl>>> %s\n", __func__);
  return -1;
}


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

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"tcl>>> %s\0A\00"
@__func__.mkstemps = [9 x i8] c"mkstemps\00"
define i32 @mkstemps(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__func__.mkstemps, i64 0, i64 0))
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ heapify(int *, int, int);
void createheap(int *a, int n) {
  int i;
  for (i = (n - 1) / 2; i >= 0; i--) {
    heapify(a, i, n);
  }
}


x86 assembly (clang, -O0):
<createheap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1157 <createheap+0x47>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <heapify@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1130 <createheap+0x20>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<createheap>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
js     1141 <createheap+0x31>
mov    %esi,%ebx
mov    %rdi,%r14
lea    -0x1(%rbx),%eax
shr    $0x1f,%eax
lea    (%rbx,%rax,1),%ebp
add    $0xffffffff,%ebp
sar    %ebp
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <heapify@plt>
add    $0xffffffff,%ebp
jb     1130 <createheap+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @createheap(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* %4
%7 = sub nsw i32 %6, 1
%8 = sdiv i32 %7, 2
store i32 %8, i32* %5
br label %9
9: ; preds = %17, %2
%10 = load i32, i32* %5
%11 = icmp sge i32 %10, 0
br i1 %11, label %12, label %20
12: ; preds = %9
%13 = load i32*, i32** %3
%14 = load i32, i32* %5
%15 = load i32, i32* %4
%16 = call i32 @heapify(i32* %13, i32 %14, i32 %15)
br label %17
17: ; preds = %12
%18 = load i32, i32* %5
%19 = add nsw i32 %18, -1
store i32 %19, i32* %5
br label %9
20: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @createheap(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, -1
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = add nsw i32 %1, -1
%6 = sdiv i32 %5, 2
br label %7
7: ; preds = %4, %7
%8 = phi i32 [ %10, %7 ], [ %6, %4 ]
%9 = tail call i32 @heapify(i32* %0, i32 %8, i32 %1)
%10 = add nsw i32 %8, -1
%11 = icmp eq i32 %8, 0
br i1 %11, label %12, label %7
12: ; preds = %7, %2
ret void
}
void d2i_ASN1_UTF8STRING(void) {}


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

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

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

LLVM IR (-O2):
define void @d2i_ASN1_UTF8STRING() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long, unsigned short);
void setreg16(unsigned long int addr, unsigned short int value) {
  *((volatile unsigned short int *)addr) = value;
  printf("Wrote half word at 0x%08lx = 0x%04x.\n", addr, value);
}


x86 assembly (clang, -O0):
<setreg16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0xa(%rbp),%cx
mov    -0x8(%rbp),%rax
mov    %cx,(%rax)
mov    -0x8(%rbp),%rsi
lea    0xec7(%rip),%rdi
movzwl -0xa(%rbp),%edx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setreg16>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    %dx,(%rdi)
lea    0xee1(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"Wrote half word at 0x%08lx = 0x%04x.\0A\00"
define void @setreg16(i64 %0, i16 zeroext %1) {
%3 = alloca i64
%4 = alloca i16
store i64 %0, i64* %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = load i64, i64* %3
%7 = inttoptr i64 %6 to i16*
store volatile i16 %5, i16* %7
%8 = load i64, i64* %3
%9 = load i16, i16* %4
%10 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i64 %8, i16 zeroext %9)
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"Wrote half word at 0x%08lx = 0x%04x.\0A\00"
define void @setreg16(i64 %0, i16 zeroext %1) {
%3 = inttoptr i64 %0 to i16*
store volatile i16 %1, i16* %3
%4 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i64 %0, i16 zeroext %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ VThreadBase_SetName(char const *);
void VThread_SetName(const char *name) { VThreadBase_SetName(name); }


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

x86 assembly (clang, -O2):
<VThread_SetName>:
jmp    1030 <VThreadBase_SetName@plt>

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

LLVM IR (-O2):
define void @VThread_SetName(i8* %0) {
%2 = tail call i32 @VThreadBase_SetName(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mbstate_t;

/* Variables and functions */
size_t mbrtowc(int /*<<< orphan*/ *, char const *, size_t,
               int /*<<< orphan*/ *);
size_t mbrlen(const char *s, size_t n, mbstate_t *ps) {
  static mbstate_t internal;
  return mbrtowc(NULL, s, n, ps != NULL ? ps : &internal);
}


x86 assembly (clang, -O0):
<mbrlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     114c <mbrlen+0x3c>
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    115c <mbrlen+0x4c>
lea    0x2ed9(%rip),%rax
mov    %rax,-0x30(%rbp)
jmp    115c <mbrlen+0x4c>
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%edi
call   1030 <mbrtowc@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mbrlen>:
mov    %rsi,%rax
mov    %rdi,%rsi
test   %rdx,%rdx
lea    0x2f0c(%rip),%rcx
cmovne %rdx,%rcx
xor    %edi,%edi
mov    %rax,%rdx
jmp    1030 <mbrtowc@plt>

LLVM IR (-O0):
@mbrlen.internal = internal global i32 0
define i64 @mbrlen(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 = icmp ne i32* %9, null
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load i32*, i32** %6
br label %14
13: ; preds = %3
br label %14
14: ; preds = %13, %11
%15 = phi i32* [ %12, %11 ], [ @mbrlen.internal, %13 ]
%16 = call i64 @mbrtowc(i32* null, i8* %7, i64 %8, i32* %15)
ret i64 %16
}

LLVM IR (-O2):
@mbrlen.internal = internal global i32 0
define i64 @mbrlen(i8* %0, i64 %1, i32* %2) {
%4 = icmp eq i32* %2, null
%5 = select i1 %4, i32* @mbrlen.internal, i32* %2
%6 = tail call i64 @mbrtowc(i32* null, i8* %0, i64 %1, i32* %5)
ret i64 %6
}
/* Type definitions */
struct stat {
  size_t st_size;
};

/* Variables and functions */
int stat(char const *, struct stat *);
size_t filesize(const char *filename) {
  struct stat st;
  return (stat(filename, &st) == -1 ? 0 : st.st_size);
}


x86 assembly (clang, -O0):
<filesize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0xffffffff,%eax
jne    113d <filesize+0x2d>
xor    %eax,%eax
mov    %rax,-0x18(%rbp)
jmp    1145 <filesize+0x35>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filesize>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
cmp    $0xffffffff,%eax
je     1124 <filesize+0x14>
mov    (%rsp),%rax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i64 }
define i64 @filesize(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @stat(i8* %4, %struct.stat* %3)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %8
7: ; preds = %1
br label %11
8: ; preds = %1
%9 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%10 = load i64, i64* %9
br label %11
11: ; preds = %8, %7
%12 = phi i64 [ 0, %7 ], [ %10, %8 ]
ret i64 %12
}

LLVM IR (-O2):
%struct.stat = type { i64 }
define i64 @filesize(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, -1
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i64, i64* %6
%8 = select i1 %5, i64 0, i64 %7
ret i64 %8
}
double min3d(double x1, double x2, double x3) {
  x1 = x1 > x2 ? x2 : x1;
  x1 = x1 > x3 ? x3 : x1;
  return x1;
}


x86 assembly (clang, -O0):
<min3d>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1132 <min3d+0x32>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    113c <min3d+0x3c>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1165 <min3d+0x65>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    116f <min3d+0x6f>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<min3d>:
minsd  %xmm0,%xmm1
minsd  %xmm1,%xmm2
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @min3d(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = fcmp ogt double %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load double, double* %5
br label %14
12: ; preds = %3
%13 = load double, double* %4
br label %14
14: ; preds = %12, %10
%15 = phi double [ %11, %10 ], [ %13, %12 ]
store double %15, double* %4
%16 = load double, double* %4
%17 = load double, double* %6
%18 = fcmp ogt double %16, %17
br i1 %18, label %19, label %21
19: ; preds = %14
%20 = load double, double* %6
br label %23
21: ; preds = %14
%22 = load double, double* %4
br label %23
23: ; preds = %21, %19
%24 = phi double [ %20, %19 ], [ %22, %21 ]
store double %24, double* %4
%25 = load double, double* %4
ret double %25
}

LLVM IR (-O2):
define double @min3d(double %0, double %1, double %2) {
%4 = fcmp ogt double %0, %1
%5 = select i1 %4, double %1, double %0
%6 = fcmp ogt double %5, %2
%7 = select i1 %6, double %2, double %5
ret double %7
}
/* Variables and functions */
scalar_t__ dice_parse(char const *, int *, int *, int *);
int dice_valid(const char *fmt) {
  int num, faces, bias;
  if (!fmt)
    return 0;
  return dice_parse(fmt, &num, &faces, &bias) ? 0 : 1;
}


x86 assembly (clang, -O0):
<dice_valid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <dice_valid+0x23>
movl   $0x0,-0x4(%rbp)
jmp    115c <dice_valid+0x4c>
mov    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
call   1030 <dice_parse@plt>
mov    %rax,%rdx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dice_valid>:
test   %rdi,%rdi
je     113d <dice_valid+0x2d>
sub    $0x18,%rsp
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1030 <dice_parse@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
add    $0x18,%rsp
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @dice_valid(i8* %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = icmp eq i8* %0, null
br i1 %8, label %13, label %9
9: ; preds = %1
%10 = call i64 @dice_parse(i8* %0, i32* %2, i32* %3, i32* %4)
%11 = icmp eq i64 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %1, %9
%14 = phi i32 [ %12, %9 ], [ 0, %1 ]
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;

/* Variables and functions */
float cbor_peek_float(uint8_t *data) {
  union {
    uint32_t n;
    float x;
  } tmp = {.n = ((uint32_t)data[0]) << 24 | ((uint32_t)data[1]) << 16 |
                ((uint32_t)data[2]) << 8 | ((uint32_t)data[3])};
  return tmp.x;
}


x86 assembly (clang, -O0):
<cbor_peek_float>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
or     0xc(%rcx),%eax
mov    %eax,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbor_peek_float>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x8(%rdi),%eax
shl    $0x8,%eax
or     %ecx,%eax
or     0xc(%rdi),%eax
movd   %eax,%xmm0
ret

LLVM IR (-O0):
%union.anon = type { i32 }
define float @cbor_peek_float(i32* %0) {
%2 = alloca i32*
%3 = alloca %union.anon
store i32* %0, i32** %2
%4 = bitcast %union.anon* %3 to i32*
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = shl i32 %7, 24
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 1
%11 = load i32, i32* %10
%12 = shl i32 %11, 16
%13 = or i32 %8, %12
%14 = load i32*, i32** %2
%15 = getelementptr inbounds i32, i32* %14, i64 2
%16 = load i32, i32* %15
%17 = shl i32 %16, 8
%18 = or i32 %13, %17
%19 = load i32*, i32** %2
%20 = getelementptr inbounds i32, i32* %19, i64 3
%21 = load i32, i32* %20
%22 = or i32 %18, %21
store i32 %22, i32* %4
%23 = bitcast %union.anon* %3 to float*
%24 = load float, float* %23
ret float %24
}

LLVM IR (-O2):
define float @cbor_peek_float(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 24
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = shl i32 %5, 16
%7 = or i32 %6, %3
%8 = getelementptr inbounds i32, i32* %0, i64 2
%9 = load i32, i32* %8
%10 = shl i32 %9, 8
%11 = or i32 %7, %10
%12 = getelementptr inbounds i32, i32* %0, i64 3
%13 = load i32, i32* %12
%14 = or i32 %11, %13
%15 = bitcast i32 %14 to float
ret float %15
}
/* Type definitions */
struct sockaddr_storage {
  int dummy;
};
struct sockaddr {
  int dummy;
};
typedef int socklen_t;

/* Variables and functions */
int recvfrom(int, void *, int, int, struct sockaddr *, int *);
int socket_udp_recv(int sock, struct sockaddr_storage *addr, void *buffer,
                    int n, int flags) {
  socklen_t addr_size;
  addr_size = sizeof(struct sockaddr_storage);
  return (
      recvfrom(sock, buffer, n, flags, (struct sockaddr *)addr, &addr_size));
}


x86 assembly (clang, -O0):
<socket_udp_recv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
movl   $0x4,-0x24(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
mov    -0x10(%rbp),%r8
lea    -0x24(%rbp),%r9
call   1030 <recvfrom@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_udp_recv>:
push   %rax
mov    %rsi,%rax
movl   $0x4,0x4(%rsp)
lea    0x4(%rsp),%r9
mov    %rdx,%rsi
mov    %ecx,%edx
mov    %r8d,%ecx
mov    %rax,%r8
call   1030 <recvfrom@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.sockaddr_storage = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @socket_udp_recv(i32 %0, %struct.sockaddr_storage* %1, i8* %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca %struct.sockaddr_storage*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 %0, i32* %6
store %struct.sockaddr_storage* %1, %struct.sockaddr_storage** %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
store i32 4, i32* %11
%12 = load i32, i32* %6
%13 = load i8*, i8** %8
%14 = load i32, i32* %9
%15 = load i32, i32* %10
%16 = load %struct.sockaddr_storage*, %struct.sockaddr_storage** %7
%17 = bitcast %struct.sockaddr_storage* %16 to %struct.sockaddr*
%18 = call i32 @recvfrom(i32 %12, i8* %13, i32 %14, i32 %15, %struct.sockaddr* %17, i32* %11)
ret i32 %18
}

LLVM IR (-O2):
%struct.sockaddr_storage = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @socket_udp_recv(i32 %0, %struct.sockaddr_storage* %1, i8* %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = bitcast i32* %6 to i8*
store i32 4, i32* %6
%8 = bitcast %struct.sockaddr_storage* %1 to %struct.sockaddr*
%9 = call i32 @recvfrom(i32 %0, i8* %2, i32 %3, i32 %4, %struct.sockaddr* %8, i32* %6)
ret i32 %9
}
int test_imm_99int8_reg(signed char val) {
  return ((val) & (-0x99 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_99int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff67,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_99int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, -153
%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_99int8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -153
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
__attribute__((noipa)) void *return_alloca_plus_cst(int n) {
  int *p = (int *)__builtin_alloca(n);
  p += 1;
  sink(p);
  return p;
}


x86 assembly (clang, -O0):
<return_alloca_plus_cst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rax
sub    %rcx,%rax
mov    %rax,%rsp
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <sink@plt>
mov    -0x10(%rbp),%rax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<return_alloca_plus_cst>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
movslq %edi,%rax
mov    %rsp,%rcx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
mov    %rcx,%rdx
sub    %rax,%rdx
mov    %rdx,%rsp
neg    %rax
lea    (%rcx,%rax,1),%rbx
add    $0x4,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <sink@plt>
mov    %rbx,%rax
lea    -0x8(%rbp),%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @return_alloca_plus_cst(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = alloca i8, i64 %5
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %3
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 1
store i32* %9, i32** %3
%10 = load i32*, i32** %3
%11 = call i32 (i32*, ...) bitcast (i32 (...)* @sink to i32 (i32*, ...)*)(i32* %10)
%12 = load i32*, i32** %3
%13 = bitcast i32* %12 to i8*
ret i8* %13
}

LLVM IR (-O2):
define i8* @return_alloca_plus_cst(i32 %0) {
%2 = sext i32 %0 to i64
%3 = alloca i8, i64 %2
%4 = getelementptr inbounds i8, i8* %3, i64 4
%5 = bitcast i8* %4 to i32*
%6 = call i32 (i32*, ...) bitcast (i32 (...)* @sink to i32 (i32*, ...)*)(i32* %5)
ret i8* %4
}