xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, unsigned int);
int /*<<< orphan*/ strncat(char *, char const *, unsigned int);
void aiccu_LocateFile(const char *what, char *filename, unsigned int length) {
  memset(filename, 0, length);
  strncat(filename, "/etc/", length);
  strncat(filename, what, length);
}


x86 assembly (clang, -O0):
<aiccu_LocateFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xeb1(%rip),%rsi
call   1040 <strncat@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <strncat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aiccu_LocateFile>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
lea    0xec3(%rip),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
call   1040 <strncat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <strncat@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"/etc/\00"
define void @aiccu_LocateFile(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = load i32, i32* %6
%9 = call i32 @memset(i8* %7, i32 0, i32 %8)
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = call i32 @strncat(i8* %10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load i8*, i8** %5
%14 = load i8*, i8** %4
%15 = load i32, i32* %6
%16 = call i32 @strncat(i8* %13, i8* %14, i32 %15)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"/etc/\00"
define void @aiccu_LocateFile(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @memset(i8* %1, i32 0, i32 %2)
%5 = tail call i32 @strncat(i8* %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %2)
%6 = tail call i32 @strncat(i8* %1, i8* %0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TV_Frame(int, int);
void SV_Frame(int realmsec, int gamemsec) { TV_Frame(realmsec, gamemsec); }


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

x86 assembly (clang, -O2):
<SV_Frame>:
jmp    1030 <TV_Frame@plt>

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

LLVM IR (-O2):
define void @SV_Frame(i32 %0, i32 %1) {
%3 = tail call i32 @TV_Frame(i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ inparam(int *);
int /*<<< orphan*/ unknown(int *);
void f(int *x) {
  if (3 > 4) {
    unknown(x);
  } else {
    inparam(x);
  }
}


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

x86 assembly (clang, -O2):
<f>:
jmp    1030 <inparam@plt>

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

LLVM IR (-O2):
define void @f(i32* %0) {
%2 = tail call i32 @inparam(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ create_password(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  char password[56];
  create_password(password, 56);
  printf("%s\n", password);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x38,%esi
call   1040 <create_password@plt>
lea    0xec4(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [56 x i8]
%4 = getelementptr inbounds [56 x i8], [56 x i8]* %3, i64 0, i64 0
%5 = call i32 @create_password(i8* %4, i32 56)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
double func(unsigned long long x) {
  if (x <= 0x7ffffffffffffffeULL)
    return (x + 1) * 0.01;
  return 0.0;
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movabs $0x7ffffffffffffffe,%rax
ff ff 7f
cmp    %rax,-0x10(%rbp)
ja     1161 <func+0x61>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
movq   %rax,%xmm0
movaps 0xee0(%rip),%xmm1
punpckldq %xmm1,%xmm0
movapd 0xee4(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  0xead(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1169 <func+0x69>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
movabs $0x7fffffffffffffff,%rax
ff ff 7f
cmp    %rax,%rdi
jb     1113 <func+0x13>
xorps  %xmm0,%xmm0
ret
add    $0x1,%rdi
movq   %rdi,%xmm1
punpckldq 0xedc(%rip),%xmm1
subpd  0xee4(%rip),%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
addsd  %xmm1,%xmm0
mulsd  0xee0(%rip),%xmm0
ret

LLVM IR (-O0):
define double @func(i64 %0) {
%2 = alloca double
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp ule i64 %4, 9223372036854775806
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i64, i64* %3
%8 = add i64 %7, 1
%9 = uitofp i64 %8 to double
%10 = fmul double %9, 1.000000e-02
store double %10, double* %2
br label %12
11: ; preds = %1
store double 0.000000e+00, double* %2
br label %12
12: ; preds = %11, %6
%13 = load double, double* %2
ret double %13
}

LLVM IR (-O2):
define double @func(i64 %0) {
%2 = icmp ult i64 %0, 9223372036854775807
%3 = add i64 %0, 1
%4 = uitofp i64 %3 to double
%5 = fmul double %4, 1.000000e-02
%6 = select i1 %2, double %5, double 0.000000e+00
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ init_Heart_ID_88();
int /*<<< orphan*/ init_atrial_actuator();
int /*<<< orphan*/ init_atrial_signal_sensor();
int /*<<< orphan*/ init_ventricle_actuator();
int /*<<< orphan*/ init_ventricle_signal_sensor();
void initialize_system() {
  init_Heart_ID_88();
  init_atrial_actuator();
  init_ventricle_signal_sensor();
  init_ventricle_actuator();
  init_atrial_signal_sensor();
}


x86 assembly (clang, -O0):
<initialize_system>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1070 <init_Heart_ID_88@plt>
mov    $0x0,%al
call   1030 <init_atrial_actuator@plt>
mov    $0x0,%al
call   1060 <init_ventricle_signal_sensor@plt>
mov    $0x0,%al
call   1040 <init_ventricle_actuator@plt>
mov    $0x0,%al
call   1050 <init_atrial_signal_sensor@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialize_system>:
push   %rax
xor    %eax,%eax
call   1070 <init_Heart_ID_88@plt>
xor    %eax,%eax
call   1030 <init_atrial_actuator@plt>
xor    %eax,%eax
call   1060 <init_ventricle_signal_sensor@plt>
xor    %eax,%eax
call   1040 <init_ventricle_actuator@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <init_atrial_signal_sensor@plt>

LLVM IR (-O0):
define void @initialize_system() {
%1 = call i32 (...) @init_Heart_ID_88()
%2 = call i32 (...) @init_atrial_actuator()
%3 = call i32 (...) @init_ventricle_signal_sensor()
%4 = call i32 (...) @init_ventricle_actuator()
%5 = call i32 (...) @init_atrial_signal_sensor()
ret void
}

LLVM IR (-O2):
define void @initialize_system() {
%1 = tail call i32 (...) @init_Heart_ID_88()
%2 = tail call i32 (...) @init_atrial_actuator()
%3 = tail call i32 (...) @init_ventricle_signal_sensor()
%4 = tail call i32 (...) @init_ventricle_actuator()
%5 = tail call i32 (...) @init_atrial_signal_sensor()
ret void
}
double real_min(double x, double y) { return ((x < y) ? x : y); }


x86 assembly (clang, -O0):
<real_min>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <real_min+0x31>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    113b <real_min+0x3b>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

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

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

LLVM IR (-O2):
define double @real_min(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *realloc(void *, size_t);
void *realloc_or_free(void *p, size_t sz) {
  void *n = realloc(p, sz);
  if (!n)
    free(p);
  return n;
}


x86 assembly (clang, -O0):
<realloc_or_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1155 <realloc_or_free+0x35>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<realloc_or_free>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113c <realloc_or_free+0x1c>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define noalias i8* @realloc_or_free(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @free(i8* %0)
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void smpte_fec_set_snbase_ext(uint8_t *p_fec, uint8_t snbase_ext) {
  p_fec[15] = snbase_ext;
}


x86 assembly (clang, -O0):
<smpte_fec_set_snbase_ext>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x3c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<smpte_fec_set_snbase_ext>:
mov    %esi,0x3c(%rdi)
ret

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

LLVM IR (-O2):
define void @smpte_fec_set_snbase_ext(i32* nocapture writeonly %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 15
store i32 %1, i32* %3
ret void
}
int do_188() { return 188; }


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

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

LLVM IR (-O0):
define i32 @do_188() {
ret i32 188
}

LLVM IR (-O2):
define i32 @do_188() {
ret i32 188
}
int mlr_canonical_mod(int a, int n) {
  int r = a % n;
  if (r >= 0)
    return r;
  else
    return r + n;
}


x86 assembly (clang, -O0):
<mlr_canonical_mod>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1129 <mlr_canonical_mod+0x29>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1132 <mlr_canonical_mod+0x32>
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mlr_canonical_mod>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
sar    $0x1f,%eax
and    %esi,%eax
add    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @mlr_canonical_mod(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = icmp slt i32 %3, 0
%5 = select i1 %4, i32 %1, i32 0
%6 = add nsw i32 %5, %3
ret i32 %6
}
unsigned int indexFor(unsigned int tablelength, void *hashvalue) {
  return (unsigned int)((unsigned int)hashvalue % tablelength);
}


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

x86 assembly (clang, -O2):
<indexFor>:
mov    %rsi,%rax
xor    %edx,%edx
div    %edi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @indexFor(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = ptrtoint i8* %5 to i32
%7 = load i32, i32* %3
%8 = urem i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @indexFor(i32 %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = trunc i64 %3 to i32
%5 = urem i32 %4, %0
ret i32 %5
}
int(so_addfl)(int fd, int flags, int require) {
  return so_rstfl(fd, &(int){0}, flags, flags, require);
}


x86 assembly (clang, -O0):
<so_addfl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%r8d
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <so_rstfl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<so_addfl>:
push   %rax
mov    %edx,%r8d
mov    %esi,%ecx
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    %ecx,%edx
xor    %eax,%eax
call   1030 <so_rstfl@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @so_addfl(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* %4
store i32 0, i32* %7
%9 = load i32, i32* %5
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = call i32 (i32, i32*, i32, i32, i32, ...) bitcast (i32 (...)* @so_rstfl to i32 (i32, i32*, i32, i32, i32, ...)*)(i32 %8, i32* %7, i32 %9, i32 %10, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @so_addfl(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
store i32 0, i32* %4
%5 = call i32 (i32, i32*, i32, i32, i32, ...) bitcast (i32 (...)* @so_rstfl to i32 (i32, i32*, i32, i32, i32, ...)*)(i32 %0, i32* %4, i32 %1, i32 %1, i32 %2)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ zest_ensure(int);
void test_8() {
  int i = 1 + 2;
  zest_ensure(i > 1);
}


x86 assembly (clang, -O0):
<test_8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x3,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <zest_ensure@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_8>:
mov    $0x1,%edi
jmp    1030 <zest_ensure@plt>

LLVM IR (-O0):
define void @test_8() {
%1 = alloca i32
store i32 3, i32* %1
%2 = load i32, i32* %1
%3 = icmp sgt i32 %2, 1
%4 = zext i1 %3 to i32
%5 = call i32 @zest_ensure(i32 %4)
ret void
}

LLVM IR (-O2):
define void @test_8() {
%1 = tail call i32 @zest_ensure(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isascii(int);
void t_isascii_0x82() {
  Assert_real((isascii(130) == 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_isascii.c",
              655, ("isascii should be 0 for 0x82"));
}


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

x86 assembly (clang, -O2):
<t_isascii_0x82>:
push   %rax
mov    $0x82,%edi
call   1030 <isascii@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x28f,%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_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0x82\00"
define void @t_isascii_0x82() {
%1 = call i64 @isascii(i32 130)
%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 655, 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_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0x82\00"
define void @t_isascii_0x82() {
%1 = tail call i64 @isascii(i32 130)
%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 655, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ cos(float);
float my_cos(float d) { return (float)cos(d); }


x86 assembly (clang, -O0):
<my_cos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <cos@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_cos>:
push   %rax
call   1030 <cos@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @my_cos(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i64 @cos(float %3)
%5 = sitofp i64 %4 to float
ret float %5
}

LLVM IR (-O2):
define float @my_cos(float %0) {
%2 = tail call i64 @cos(float %0)
%3 = sitofp i64 %2 to float
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ F_SETLK;
int /*<<< orphan*/ F_UNLCK;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ errx(int, char *);
int /*<<< orphan*/ try_lock(int /*<<< orphan*/, int /*<<< orphan*/,
                            int /*<<< orphan*/, long, long);
void unlock(long int start, long int len) {
  if (!try_lock(F_SETLK, F_UNLCK, SEEK_SET, start, len))
    errx(1, "unlock failed");
}


x86 assembly (clang, -O0):
<unlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
mov    0x2ea0(%rip),%rax
mov    (%rax),%esi
mov    0x2e87(%rip),%rax
mov    (%rax),%edx
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
call   1030 <try_lock@plt>
cmp    $0x0,%eax
jne    1172 <unlock+0x52>
mov    $0x1,%edi
lea    0xe93(%rip),%rsi
call   1040 <errx@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlock>:
push   %rax
mov    %rsi,%r8
mov    %rdi,%rcx
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
mov    0x2e90(%rip),%rax
mov    (%rax),%edx
call   1030 <try_lock@plt>
test   %eax,%eax
je     114d <unlock+0x2d>
pop    %rax
ret
lea    0xeac(%rip),%rsi
mov    $0x1,%edi
pop    %rax
jmp    1040 <errx@plt>

LLVM IR (-O0):
@F_SETLK = global i32 0
@F_UNLCK = global i32 0
@SEEK_SET = global i32 0
@.str = [14 x i8] c"unlock failed\00"
define void @unlock(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i32, i32* @F_SETLK
%6 = load i32, i32* @F_UNLCK
%7 = load i32, i32* @SEEK_SET
%8 = load i64, i64* %3
%9 = load i64, i64* %4
%10 = call i32 @try_lock(i32 %5, i32 %6, i32 %7, i64 %8, i64 %9)
%11 = icmp ne i32 %10, 0
br i1 %11, label %14, label %12
12: ; preds = %2
%13 = call i32 @errx(i32 1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12, %2
ret void
}

LLVM IR (-O2):
@F_SETLK = global i32 0
@F_UNLCK = global i32 0
@SEEK_SET = global i32 0
@.str = [14 x i8] c"unlock failed\00"
define void @unlock(i64 %0, i64 %1) {
%3 = load i32, i32* @F_SETLK
%4 = load i32, i32* @F_UNLCK
%5 = load i32, i32* @SEEK_SET
%6 = tail call i32 @try_lock(i32 %3, i32 %4, i32 %5, i64 %0, i64 %1)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, size_t, char *, struct tm *);
char *get_stime(char *stime, size_t size, time_t t) {
  struct tm *lt;
  lt = localtime(&t);
  strftime(stime, size, "%Y-%m-%dT%H:%M", lt);
  return stime;
}


x86 assembly (clang, -O0):
<get_stime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    -0x14(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rcx
lea    0xead(%rip),%rdx
call   1040 <strftime@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_stime>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %edx,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <localtime@plt>
lea    0xec1(%rip),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %rax,%rcx
call   1040 <strftime@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [15 x i8] c"%Y-%m-%dT%H:%M\00"
define i8* @get_stime(i8* %0, i64 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
%7 = alloca %struct.tm*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%8 = call %struct.tm* @localtime(i32* %6)
store %struct.tm* %8, %struct.tm** %7
%9 = load i8*, i8** %4
%10 = load i64, i64* %5
%11 = load %struct.tm*, %struct.tm** %7
%12 = call i32 @strftime(i8* %9, i64 %10, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), %struct.tm* %11)
%13 = load i8*, i8** %4
ret i8* %13
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [15 x i8] c"%Y-%m-%dT%H:%M\00"
define i8* @get_stime(i8* returned %0, i64 %1, i32 %2) {
%4 = alloca i32
store i32 %2, i32* %4
%5 = call %struct.tm* @localtime(i32* %4)
%6 = call i32 @strftime(i8* %0, i64 %1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), %struct.tm* %5)
ret i8* %0
}
/* Variables and functions */
int get_action_val_name_any(char *, char *, int, int);
int get_action_val_name_bin(char *saction, char *f_val, int len) {
  return get_action_val_name_any(saction, f_val, len, 1);
}


x86 assembly (clang, -O0):
<get_action_val_name_bin>:
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
mov    $0x1,%ecx
call   1030 <get_action_val_name_any@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_action_val_name_bin>:
mov    $0x1,%ecx
jmp    1030 <get_action_val_name_any@plt>

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

LLVM IR (-O2):
define i32 @get_action_val_name_bin(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @get_action_val_name_any(i8* %0, i8* %1, i32 %2, i32 1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ glColor3f(double, double, double);
int /*<<< orphan*/ glPopMatrix();
int /*<<< orphan*/ glPushMatrix();
int /*<<< orphan*/ glScalef(double, double, double);
int /*<<< orphan*/ glutWireDodecahedron();
void drawDodeca(void) {
  glColor3f(1.75, 0.0, 1.0);
  glPushMatrix();
  glScalef(3.0, 3.0, 3.0);
  glutWireDodecahedron();
  glPopMatrix();
}


x86 assembly (clang, -O0):
<drawDodeca>:
push   %rbp
mov    %rsp,%rbp
movsd  0xeac(%rip),%xmm0
xorps  %xmm1,%xmm1
movsd  0xea9(%rip),%xmm2
call   1040 <glColor3f@plt>
mov    $0x0,%al
call   1060 <glPushMatrix@plt>
movsd  0xe85(%rip),%xmm2
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   1050 <glScalef@plt>
mov    $0x0,%al
call   1070 <glutWireDodecahedron@plt>
mov    $0x0,%al
call   1030 <glPopMatrix@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawDodeca>:
push   %rax
movsd  0xea7(%rip),%xmm0
movsd  0xea7(%rip),%xmm2
xorps  %xmm1,%xmm1
call   1040 <glColor3f@plt>
xor    %eax,%eax
call   1060 <glPushMatrix@plt>
movsd  0xe98(%rip),%xmm0
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
call   1050 <glScalef@plt>
xor    %eax,%eax
call   1070 <glutWireDodecahedron@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <glPopMatrix@plt>

LLVM IR (-O0):
define void @drawDodeca() {
%1 = call i32 @glColor3f(double 1.750000e+00, double 0.000000e+00, double 1.000000e+00)
%2 = call i32 (...) @glPushMatrix()
%3 = call i32 @glScalef(double 3.000000e+00, double 3.000000e+00, double 3.000000e+00)
%4 = call i32 (...) @glutWireDodecahedron()
%5 = call i32 (...) @glPopMatrix()
ret void
}

LLVM IR (-O2):
define void @drawDodeca() {
%1 = tail call i32 @glColor3f(double 1.750000e+00, double 0.000000e+00, double 1.000000e+00)
%2 = tail call i32 (...) @glPushMatrix()
%3 = tail call i32 @glScalef(double 3.000000e+00, double 3.000000e+00, double 3.000000e+00)
%4 = tail call i32 (...) @glutWireDodecahedron()
%5 = tail call i32 (...) @glPopMatrix()
ret void
}
/* Variables and functions */
int GET32(int);
int /*<<< orphan*/ PUT32(int, unsigned int);
void uart_send(unsigned int c) {
  while (1) {
    if (GET32((0x20000000 + 0x00215054)) & 0x20)
      break;
  }
  PUT32((0x20000000 + 0x00215040), c);
}


x86 assembly (clang, -O0):
<uart_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x20215054,%edi
call   1040 <GET32@plt>
and    $0x20,%eax
cmp    $0x0,%eax
je     1146 <uart_send+0x26>
jmp    114b <uart_send+0x2b>
jmp    112b <uart_send+0xb>
mov    -0x4(%rbp),%esi
mov    $0x20215040,%edi
call   1030 <PUT32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_send>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x20215054,%edi
call   1040 <GET32@plt>
test   $0x20,%al
je     1130 <uart_send+0x10>
mov    $0x20215040,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <PUT32@plt>

LLVM IR (-O0):
define void @uart_send(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %1, %8
%4 = call i32 @GET32(i32 539054164)
%5 = and i32 %4, 32
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %9
8: ; preds = %3
br label %3
9: ; preds = %7
%10 = load i32, i32* %2
%11 = call i32 @PUT32(i32 539054144, i32 %10)
ret void
}

LLVM IR (-O2):
define void @uart_send(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @GET32(i32 539054164)
%4 = and i32 %3, 32
%5 = icmp eq i32 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
%7 = tail call i32 @PUT32(i32 539054144, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ UART_OutChar(char);
void UART_OutString(char *pt) {
  while (*pt) {
    UART_OutChar(*pt);
    pt++;
  }
}


x86 assembly (clang, -O0):
<UART_OutString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1146 <UART_OutString+0x36>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <UART_OutChar@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <UART_OutString+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UART_OutString>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <UART_OutString+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <UART_OutChar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <UART_OutString+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @UART_OutString(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @UART_OutChar(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x = __VERIFIER_nondet_int();
  while (x >= 0) {
    if (__VERIFIER_nondet_int()) {
      x -= 1;
    } else {
      x += 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     115f <main+0x4f>
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x0,%eax
je     1151 <main+0x41>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    115a <main+0x4a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <main+0x19>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
js     1132 <main+0x22>
mov    %eax,%ebx
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
neg    %eax
sbb    %eax,%eax
or     $0x1,%eax
add    %eax,%ebx
jns    1120 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = icmp sgt i32 %1, -1
br i1 %2, label %3, label %10
3: ; preds = %0, %3
%4 = phi i32 [ %8, %3 ], [ %1, %0 ]
%5 = tail call i32 (...) @__VERIFIER_nondet_int()
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i32 1, i32 -1
%8 = add nsw i32 %7, %4
%9 = icmp sgt i32 %8, -1
br i1 %9, label %3, label %10
10: ; preds = %3, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ writeHexWord(int, unsigned int);
void fprintx(int f, unsigned int w) { writeHexWord(f, w); }


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

x86 assembly (clang, -O2):
<fprintx>:
jmp    1030 <writeHexWord@plt>

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

LLVM IR (-O2):
define void @fprintx(i32 %0, i32 %1) {
%3 = tail call i32 @writeHexWord(i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int cow_str_find(char const *, char);
int cow_str_find_safe(const char *str, char c) {
  if (!str)
    return -1;
  return cow_str_find(str, c);
}


x86 assembly (clang, -O0):
<cow_str_find_safe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1139 <cow_str_find_safe+0x29>
movl   $0xffffffff,-0x4(%rbp)
jmp    1149 <cow_str_find_safe+0x39>
mov    -0x10(%rbp),%rdi
movsbl -0x11(%rbp),%esi
call   1030 <cow_str_find@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cow_str_find_safe>:
test   %rdi,%rdi
je     111e <cow_str_find_safe+0xe>
movsbl %sil,%esi
jmp    1030 <cow_str_find@plt>
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @cow_str_find_safe(i8* %0, i8 signext %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @cow_str_find(i8* %0, i8 signext %1)
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ %5, %4 ], [ -1, %2 ]
ret i32 %7
}
/* Variables and functions */
int CodonToQcoord(int, int);
int IsValidBase(int, int, int);
int IsValidGencode(int);
int /*<<< orphan*/ assert(int);
int CodonAsQcoord(int base, int seqtype, int gencode) {
  assert(seqtype == 2);
  assert(IsValidGencode(gencode));
  assert(IsValidBase(base, seqtype, gencode));
  return CodonToQcoord(base, gencode);
  return base;
}


x86 assembly (clang, -O0):
<CodonAsQcoord>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x2,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0xc(%rbp),%edi
call   1040 <IsValidGencode@plt>
mov    %eax,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1050 <IsValidBase@plt>
mov    %eax,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1060 <CodonToQcoord@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CodonAsQcoord>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%ebp
mov    %edi,%r14d
xor    %edi,%edi
cmp    $0x2,%esi
sete   %dil
call   1030 <assert@plt>
mov    %ebx,%edi
call   1040 <IsValidGencode@plt>
mov    %eax,%edi
call   1030 <assert@plt>
mov    %r14d,%edi
mov    %ebp,%esi
mov    %ebx,%edx
call   1050 <IsValidBase@plt>
mov    %eax,%edi
call   1030 <assert@plt>
mov    %r14d,%edi
mov    %ebx,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1060 <CodonToQcoord@plt>

LLVM IR (-O0):
define i32 @CodonAsQcoord(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = icmp eq i32 %7, 2
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i32, i32* %6
%12 = call i32 @IsValidGencode(i32 %11)
%13 = call i32 @assert(i32 %12)
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = load i32, i32* %6
%17 = call i32 @IsValidBase(i32 %14, i32 %15, i32 %16)
%18 = call i32 @assert(i32 %17)
%19 = load i32, i32* %4
%20 = load i32, i32* %6
%21 = call i32 @CodonToQcoord(i32 %19, i32 %20)
ret i32 %21
}

LLVM IR (-O2):
define i32 @CodonAsQcoord(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, 2
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = tail call i32 @IsValidGencode(i32 %2)
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @IsValidBase(i32 %0, i32 %1, i32 %2)
%10 = tail call i32 @assert(i32 %9)
%11 = tail call i32 @CodonToQcoord(i32 %0, i32 %2)
ret i32 %11
}
/* Type definitions */
typedef unsigned int uint16_t;

/* Variables and functions */
__attribute__((always_)) uint16_t rol16(uint16_t data, unsigned int rotation) {
  return ((data << rotation) | (data >> (16 - rotation)));
}


x86 assembly (clang, -O0):
<rol16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x10,%ecx
sub    -0x8(%rbp),%ecx
shr    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rol16>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
mov    $0x10,%dl
sub    %cl,%dl
mov    %edx,%ecx
shr    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rol16(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub i32 16, %9
%11 = lshr i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rol16(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub i32 16, %1
%5 = lshr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
int test_imm_0Fuint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x0F << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_0Fuint64_highword_reg>:
movabs $0xf00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_0Fuint64_highword_reg(i64 %0) {
%2 = and i64 %0, 64424509440
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int linked_list_int_cmp(const void *left, const void *right) {
  return ((int)left - (int)right);
}


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

x86 assembly (clang, -O2):
<linked_list_int_cmp>:
mov    %rdi,%rax
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @linked_list_int_cmp(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 = ptrtoint i8* %5 to i32
%7 = load i8*, i8** %4
%8 = ptrtoint i8* %7 to i32
%9 = sub nsw i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @linked_list_int_cmp(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = trunc i64 %3 to i32
%5 = ptrtoint i8* %1 to i64
%6 = trunc i64 %5 to i32
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ replaceAll(char *, char, char);
int main(int argc, const char *argv[]) {
  char string[100] = "Beebee";
  replaceAll(string, 'e', 'o');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x80(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1040 <memset@plt>
movb   $0x42,-0x80(%rbp)
movb   $0x65,-0x7f(%rbp)
movb   $0x65,-0x7e(%rbp)
movb   $0x62,-0x7d(%rbp)
movb   $0x65,-0x7c(%rbp)
movb   $0x65,-0x7b(%rbp)
lea    -0x80(%rbp),%rdi
mov    $0x65,%esi
mov    $0x6f,%edx
call   1030 <replaceAll@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x68,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movl   $0x0,0x60(%rsp)
movl   $0x62656542,(%rsp)
movw   $0x6565,0x4(%rsp)
mov    %rsp,%rdi
mov    $0x65,%esi
mov    $0x6f,%edx
call   1030 <replaceAll@plt>
xor    %eax,%eax
add    $0x68,%rsp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [100 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [100 x i8]* %6 to i8*
%8 = bitcast i8* %7 to [100 x i8]*
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i32 0, i32 0
store i8 66, i8* %9
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i32 0, i32 1
store i8 101, i8* %10
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i32 0, i32 2
store i8 101, i8* %11
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i32 0, i32 3
store i8 98, i8* %12
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i32 0, i32 4
store i8 101, i8* %13
%14 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i32 0, i32 5
store i8 101, i8* %14
%15 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%16 = call i32 @replaceAll(i8* %15, i8 signext 101, i8 signext 111)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
store i8 66, i8* %4
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 1
store i8 101, i8* %5
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 2
store i8 101, i8* %6
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 3
store i8 98, i8* %7
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 4
store i8 101, i8* %8
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 5
store i8 101, i8* %9
%10 = call i32 @replaceAll(i8* %4, i8 signext 101, i8 signext 111)
ret i32 0
}
double yardsToMetres(double yards) { return yards * 0.9144; }


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

x86 assembly (clang, -O2):
<yardsToMetres>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @yardsToMetres(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 9.144000e-01
ret double %4
}

LLVM IR (-O2):
define double @yardsToMetres(double %0) {
%2 = fmul double %0, 9.144000e-01
ret double %2
}
/* Type definitions */
struct value {
  int dummy;
};
struct key {
  int dummy;
};
struct hashtable {
  int dummy;
};

/* Variables and functions */
scalar_t__ hashtable_search(struct hashtable *, struct key *);
struct value *search_some(struct hashtable *h, struct key *k) {
  return (struct value *)(hashtable_search(h, k));
}


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

x86 assembly (clang, -O2):
<search_some>:
jmp    1030 <hashtable_search@plt>

LLVM IR (-O0):
%struct.value = type { i32 }
%struct.hashtable = type { i32 }
%struct.key = type { i32 }
define %struct.value* @search_some(%struct.hashtable* %0, %struct.key* %1) {
%3 = alloca %struct.hashtable*
%4 = alloca %struct.key*
store %struct.hashtable* %0, %struct.hashtable** %3
store %struct.key* %1, %struct.key** %4
%5 = load %struct.hashtable*, %struct.hashtable** %3
%6 = load %struct.key*, %struct.key** %4
%7 = call i64 @hashtable_search(%struct.hashtable* %5, %struct.key* %6)
%8 = inttoptr i64 %7 to %struct.value*
ret %struct.value* %8
}

LLVM IR (-O2):
%struct.value = type { i32 }
%struct.hashtable = type { i32 }
%struct.key = type { i32 }
define %struct.value* @search_some(%struct.hashtable* %0, %struct.key* %1) {
%3 = tail call i64 @hashtable_search(%struct.hashtable* %0, %struct.key* %1)
%4 = inttoptr i64 %3 to %struct.value*
ret %struct.value* %4
}
/* Variables and functions */
int /*<<< orphan*/ eprintf(char *);
void *malloc(size_t);
void *emalloc(size_t size) {
  void *p;
  p = malloc(size);
  if (!p)
    eprintf("Out of memory\n");
  return p;
}


x86 assembly (clang, -O0):
<emalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <emalloc+0x30>
lea    0xeb5(%rip),%rdi
call   1040 <eprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emalloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <emalloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <eprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Out of memory\0A\00"
define i8* @emalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 @eprintf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [15 x i8] c"Out of memory\0A\00"
define noalias i8* @emalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @eprintf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}