xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, unsigned char);
void getdatastr(void *pdata, char *dataval_strbuff, int strbufflen) {
  snprintf(dataval_strbuff, strbufflen, "%c", (unsigned char)(int)pdata);
}


x86 assembly (clang, -O0):
<getdatastr>:
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),%esi
mov    -0x8(%rbp),%rax
lea    0xecb(%rip),%rdx
movzbl %al,%ecx
call   1030 <snprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getdatastr>:
movzbl %dil,%ecx
lea    0xee5(%rip),%rax
mov    %rsi,%rdi
mov    %edx,%esi
mov    %rax,%rdx
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define void @getdatastr(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 = load i8*, i8** %4
%10 = ptrtoint i8* %9 to i32
%11 = trunc i32 %10 to i8
%12 = call i32 @snprintf(i8* %7, i32 %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 zeroext %11)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @getdatastr(i8* %0, i8* %1, i32 %2) {
%4 = ptrtoint i8* %0 to i64
%5 = trunc i64 %4 to i8
%6 = tail call i32 @snprintf(i8* %1, i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 zeroext %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, double *, double *);
int main() {
  double A, B;
  scanf("%lf %lf", &A, &B);
  printf("MEDIA = %0.5lf\n", ((A * 3.5) + (B * 7.5)) / (3.5 + 7.5));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xee2(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
movsd  0xec0(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
movsd  0xeab(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe93(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xeed(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1040 <scanf@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
mulsd  0xeb2(%rip),%xmm1
mulsd  0xeb2(%rip),%xmm0
addsd  %xmm1,%xmm0
divsd  0xeae(%rip),%xmm0
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%lf %lf\00"
@.str.1 = [16 x i8] c"MEDIA = %0.5lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double* %2, double* %3)
%5 = load double, double* %2
%6 = load double, double* %3
%7 = fmul double %6, 7.500000e+00
%8 = call double @llvm.fmuladd.f64(double %5, double 3.500000e+00, double %7)
%9 = fdiv double %8, 1.100000e+01
%10 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), double %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"%lf %lf\00"
@.str.1 = [16 x i8] c"MEDIA = %0.5lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = bitcast double* %1 to i8*
%4 = bitcast double* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double* %1, double* %2)
%6 = load double, double* %1
%7 = load double, double* %2
%8 = fmul double %7, 7.500000e+00
%9 = call double @llvm.fmuladd.f64(double %6, double 3.500000e+00, double %8)
%10 = fdiv double %9, 1.100000e+01
%11 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), double %10)
ret i32 0
}
int compare_int(const void *x1, const void *x2) {
  int y1 = *(const int *)x1;
  int y2 = *(const int *)x2;
  int ret;
  if (y1 < y2) {
    ret = -1;
  } else if (y1 > y2) {
    ret = +1;
  } else {
    ret = 0;
  }
  return ret;
}


x86 assembly (clang, -O0):
<compare_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1136 <compare_int+0x36>
movl   $0xffffffff,-0x1c(%rbp)
jmp    115a <compare_int+0x5a>
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jle    114e <compare_int+0x4e>
movl   $0x1,-0x1c(%rbp)
jmp    1155 <compare_int+0x55>
movl   $0x0,-0x1c(%rbp)
jmp    115a <compare_int+0x5a>
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_int>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @compare_int(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
store i32 %10, i32* %5
%11 = load i8*, i8** %4
%12 = bitcast i8* %11 to i32*
%13 = load i32, i32* %12
store i32 %13, i32* %6
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 -1, i32* %7
br label %25
18: ; preds = %2
%19 = load i32, i32* %5
%20 = load i32, i32* %6
%21 = icmp sgt i32 %19, %20
br i1 %21, label %22, label %23
22: ; preds = %18
store i32 1, i32* %7
br label %24
23: ; preds = %18
store i32 0, i32* %7
br label %24
24: ; preds = %23, %22
br label %25
25: ; preds = %24, %17
%26 = load i32, i32* %7
ret i32 %26
}

LLVM IR (-O2):
define i32 @compare_int(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp slt i32 %4, %6
%8 = icmp sgt i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Type definitions */
struct btf_type {
  int dummy;
};
typedef int /*<<< orphan*/ __u8;
typedef int /*<<< orphan*/ __u32;

/* Variables and functions */
int /*<<< orphan*/ BTF_INT_ENCODING(int /*<<< orphan*/);
__u8 btf_int_encoding(const struct btf_type *t) {
  return BTF_INT_ENCODING(*(__u32 *)(t + 1));
}


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

x86 assembly (clang, -O2):
<btf_int_encoding>:
mov    0x4(%rdi),%edi
jmp    1030 <BTF_INT_ENCODING@plt>

LLVM IR (-O0):
%struct.btf_type = type { i32 }
define i32 @btf_int_encoding(%struct.btf_type* %0) {
%2 = alloca %struct.btf_type*
store %struct.btf_type* %0, %struct.btf_type** %2
%3 = load %struct.btf_type*, %struct.btf_type** %2
%4 = getelementptr inbounds %struct.btf_type, %struct.btf_type* %3, i64 1
%5 = bitcast %struct.btf_type* %4 to i32*
%6 = load i32, i32* %5
%7 = call i32 @BTF_INT_ENCODING(i32 %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.btf_type = type { i32 }
define i32 @btf_int_encoding(%struct.btf_type* nocapture %0) {
%2 = getelementptr inbounds %struct.btf_type, %struct.btf_type* %0, i64 1, i32 0
%3 = load i32, i32* %2
%4 = tail call i32 @BTF_INT_ENCODING(i32 %3)
ret i32 %4
}
float K_C(float n) {
  n -= 273.15;
  return n;
}


x86 assembly (clang, -O0):
<K_C>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee6(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<K_C>:
cvtss2sd %xmm0,%xmm0
addsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @K_C(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fsub double %4, 2.731500e+02
%6 = fptrunc double %5 to float
store float %6, float* %2
%7 = load float, float* %2
ret float %7
}

LLVM IR (-O2):
define float @K_C(float %0) {
%2 = fpext float %0 to double
%3 = fadd double %2, -2.731500e+02
%4 = fptrunc double %3 to float
ret float %4
}
int az_avoidReferenceGrid(int output) {
  if (output > 10) {
    output += (output - 11) / 15 + 1;
  }
  return output;
}


x86 assembly (clang, -O0):
<az_avoidReferenceGrid>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jle    1128 <az_avoidReferenceGrid+0x28>
mov    -0x4(%rbp),%eax
sub    $0xb,%eax
mov    $0xf,%ecx
cltd
idiv   %ecx
add    $0x1,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<az_avoidReferenceGrid>:
mov    %edi,%eax
cmp    $0xb,%edi
jl     111c <az_avoidReferenceGrid+0x1c>
lea    -0xb(%rax),%ecx
mov    $0x88888889,%edx
imul   %rcx,%rdx
shr    $0x23,%rdx
add    %edx,%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @az_avoidReferenceGrid(i32 %0) {
%2 = icmp sgt i32 %0, 10
br i1 %2, label %3, label %8
3: ; preds = %1
%4 = add nsw i32 %0, -11
%5 = udiv i32 %4, 15
%6 = add nuw i32 %0, 1
%7 = add nuw i32 %6, %5
br label %8
8: ; preds = %3, %1
%9 = phi i32 [ %7, %3 ], [ %0, %1 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void psg_write(uint8_t data) {}


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

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

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

LLVM IR (-O2):
define void @psg_write(i32 %0) {
ret void
}
/* Variables and functions */
int abs(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int zmiennaa, zmiennab;
  zmiennaa = abs(1);
  printf("absolute value of first variable = %d\n", zmiennaa);
  zmiennab = abs(-100);
  printf("absolute value of 2nd variable = %d\n", zmiennab);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <abs@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
mov    $0xffffff9c,%edi
call   1030 <abs@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xefe(%rip),%rdi
mov    $0x64,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"absolute value of first variable = %d\0A\00"
@.str.1 = [37 x i8] c"absolute value of 2nd variable = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @abs(i32 1)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @abs(i32 -100)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [39 x i8] c"absolute value of first variable = %d\0A\00"
@.str.1 = [37 x i8] c"absolute value of 2nd variable = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i32 100)
ret i32 0
}
void writeLong(unsigned char *p, unsigned long v) {
  p[3] = (unsigned char)(v & 0xFF);
  v >>= 8;
  p[2] = (unsigned char)(v & 0xFF);
  v >>= 8;
  p[1] = (unsigned char)(v & 0xFF);
  v >>= 8;
  p[0] = (unsigned char)v;
}


x86 assembly (clang, -O0):
<writeLong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x10(%rbp),%rax
shr    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x10(%rbp),%rax
shr    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rax
shr    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeLong>:
bswap  %esi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @writeLong(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = and i64 %5, 255
%7 = trunc i64 %6 to i8
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 3
store i8 %7, i8* %9
%10 = load i64, i64* %4
%11 = lshr i64 %10, 8
store i64 %11, i64* %4
%12 = load i64, i64* %4
%13 = and i64 %12, 255
%14 = trunc i64 %13 to i8
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 2
store i8 %14, i8* %16
%17 = load i64, i64* %4
%18 = lshr i64 %17, 8
store i64 %18, i64* %4
%19 = load i64, i64* %4
%20 = and i64 %19, 255
%21 = trunc i64 %20 to i8
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i64 1
store i8 %21, i8* %23
%24 = load i64, i64* %4
%25 = lshr i64 %24, 8
store i64 %25, i64* %4
%26 = load i64, i64* %4
%27 = trunc i64 %26 to i8
%28 = load i8*, i8** %3
%29 = getelementptr inbounds i8, i8* %28, i64 0
store i8 %27, i8* %29
ret void
}

LLVM IR (-O2):
define void @writeLong(i8* nocapture writeonly %0, i64 %1) {
%3 = trunc i64 %1 to i8
%4 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %3, i8* %4
%5 = lshr i64 %1, 8
%6 = trunc i64 %5 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %6, i8* %7
%8 = lshr i64 %1, 16
%9 = trunc i64 %8 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %9, i8* %10
%11 = lshr i64 %1, 24
%12 = trunc i64 %11 to i8
store i8 %12, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void prior_free_delta(void *data) { free(data); }


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

x86 assembly (clang, -O2):
<prior_free_delta>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @prior_free_delta(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glTexParameteri(unsigned int, unsigned int, int);
void TexParameteri(unsigned int t, unsigned int p, int prm) {
  glTexParameteri(t, p, prm);
}


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

x86 assembly (clang, -O2):
<TexParameteri>:
jmp    1030 <glTexParameteri@plt>

LLVM IR (-O0):
define void @TexParameteri(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* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @glTexParameteri(i32 %7, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @TexParameteri(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @glTexParameteri(i32 %0, i32 %1, i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int _pthread_set_state(int /*<<< orphan*/ *, int, int);
int pthread_attr_setdetachstate(pthread_attr_t *a, int flag) {
  return _pthread_set_state(a, 0x04, flag);
}


x86 assembly (clang, -O0):
<pthread_attr_setdetachstate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    $0x4,%esi
call   1030 <_pthread_set_state@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_attr_setdetachstate>:
mov    %esi,%edx
mov    $0x4,%esi
jmp    1030 <_pthread_set_state@plt>

LLVM IR (-O0):
define i32 @pthread_attr_setdetachstate(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 @_pthread_set_state(i32* %5, i32 4, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @pthread_attr_setdetachstate(i32* %0, i32 %1) {
%3 = tail call i32 @_pthread_set_state(i32* %0, i32 4, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void check_mem(int *x, int *y) {
  if (x == NULL || y == NULL) {
    printf("ERROR: Memory allocation failed\n");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<check_mem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1146 <check_mem+0x26>
cmpq   $0x0,-0x10(%rbp)
jne    115c <check_mem+0x3c>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_mem>:
test   %rdi,%rdi
je     112b <check_mem+0xb>
test   %rsi,%rsi
je     112b <check_mem+0xb>
ret
push   %rax
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"ERROR: Memory allocation failed\0A\00"
define void @check_mem(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 = icmp eq i32* %5, null
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32*, i32** %4
%9 = icmp eq i32* %8, null
br i1 %9, label %10, label %13
10: ; preds = %7, %2
%11 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %7
ret void
}

LLVM IR (-O2):
@str = [32 x i8] c"ERROR: Memory allocation failed\00"
define void @check_mem(i32* readnone %0, i32* readnone %1) {
%3 = icmp eq i32* %0, null
%4 = icmp eq i32* %1, null
%5 = or i1 %3, %4
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
ret void
}
unsigned int startSuperProc(unsigned char *path) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @startSuperProc(i8* nocapture readnone %0) {
ret i32 0
}
unsigned int wait_button_action() {
  while (((*(volatile int *)(0x20000050)) & 0x000F) == 0x00)
    ;
  unsigned int lState = (*(volatile int *)(0x20000050)) & 0x0F;
  while (((*(volatile int *)(0x20000050)) & 0x000F) != 0x00)
    ;
  return lState;
}


x86 assembly (clang, -O0):
<wait_button_action>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20000050,%eax
mov    (%rax),%eax
and    $0xf,%eax
cmp    $0x0,%eax
jne    111c <wait_button_action+0x1c>
jmp    1104 <wait_button_action+0x4>
mov    $0x20000050,%eax
mov    (%rax),%eax
and    $0xf,%eax
mov    %eax,-0x4(%rbp)
mov    $0x20000050,%eax
mov    (%rax),%eax
and    $0xf,%eax
cmp    $0x0,%eax
je     1141 <wait_button_action+0x41>
jmp    1129 <wait_button_action+0x29>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_button_action>:
testl  $0xf,0x20000050
je     1100 <wait_button_action>
mov    0x20000050,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
testl  $0xf,0x20000050
jne    1120 <wait_button_action+0x20>
and    $0xf,%eax
ret

LLVM IR (-O0):
define i32 @wait_button_action() {
%1 = alloca i32
br label %2
2: ; preds = %6, %0
%3 = load volatile i32, i32* inttoptr (i64 536870992 to i32*)
%4 = and i32 %3, 15
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %2
br label %2
7: ; preds = %2
%8 = load volatile i32, i32* inttoptr (i64 536870992 to i32*)
%9 = and i32 %8, 15
store i32 %9, i32* %1
br label %10
10: ; preds = %14, %7
%11 = load volatile i32, i32* inttoptr (i64 536870992 to i32*)
%12 = and i32 %11, 15
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %10
br label %10
15: ; preds = %10
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
define i32 @wait_button_action() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i32, i32* inttoptr (i64 536870992 to i32*)
%3 = and i32 %2, 15
%4 = icmp eq i32 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
%6 = load volatile i32, i32* inttoptr (i64 536870992 to i32*)
br label %7
7: ; preds = %7, %5
%8 = load volatile i32, i32* inttoptr (i64 536870992 to i32*)
%9 = and i32 %8, 15
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %7
11: ; preds = %7
%12 = and i32 %6, 15
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ write_command_packet(int, int, int, int);
void wait(int n) {
  int i;
  for (i = 0; i < n; i++) {
    write_command_packet(0xa0, 0xe0, 0, 1);
    write_command_packet(0xa1, 0xa0, 200000, 2);
  }
}


x86 assembly (clang, -O0):
<wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    116b <wait+0x5b>
mov    $0xa0,%edi
mov    $0xe0,%esi
xor    %edx,%edx
mov    $0x1,%ecx
call   1030 <write_command_packet@plt>
mov    $0xa1,%edi
mov    $0xa0,%esi
mov    $0x30d40,%edx
mov    $0x2,%ecx
call   1030 <write_command_packet@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <wait+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait>:
push   %rbx
test   %edi,%edi
jle    1154 <wait+0x44>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0xa0,%edi
mov    $0xe0,%esi
xor    %edx,%edx
mov    $0x1,%ecx
call   1030 <write_command_packet@plt>
mov    $0xa1,%edi
mov    $0xa0,%esi
mov    $0x30d40,%edx
mov    $0x2,%ecx
call   1030 <write_command_packet@plt>
add    $0xffffffff,%ebx
jne    1120 <wait+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @wait(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %11, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %14
8: ; preds = %4
%9 = call i32 @write_command_packet(i32 160, i32 224, i32 0, i32 1)
%10 = call i32 @write_command_packet(i32 161, i32 160, i32 200000, i32 2)
br label %11
11: ; preds = %8
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %4
14: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @wait(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = tail call i32 @write_command_packet(i32 160, i32 224, i32 0, i32 1)
%6 = tail call i32 @write_command_packet(i32 161, i32 160, i32 200000, i32 2)
%7 = add nuw nsw i32 %4, 1
%8 = icmp eq i32 %7, %0
br i1 %8, label %9, label %3
9: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void badparms() {
  fprintf(stderr, "fsplit: usage:  fsplit [-e efile] ... [file] \n");
  exit(1);
}


x86 assembly (clang, -O0):
<badparms>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<badparms>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [47 x i8] c"fsplit: usage: fsplit [-e efile] ... [file] \0A\00"
define void @badparms() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [47 x i8] c"fsplit: usage: fsplit [-e efile] ... [file] \0A\00"
define void @badparms() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
int metil_mpi_size() { return 0; }


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

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

LLVM IR (-O0):
define i32 @metil_mpi_size() {
ret i32 0
}

LLVM IR (-O2):
define i32 @metil_mpi_size() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void PrintNMargin(void) {
  int i;
  for (i = 1; i <= 4; i++)
    putchar(' ');
}


x86 assembly (clang, -O0):
<PrintNMargin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
cmpl   $0x4,-0x4(%rbp)
jg     1141 <PrintNMargin+0x31>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <PrintNMargin+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintNMargin>:
push   %rax
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @PrintNMargin() {
%1 = alloca i32
store i32 1, i32* %1
br label %2
2: ; preds = %7, %0
%3 = load i32, i32* %1
%4 = icmp sle i32 %3, 4
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = call i32 @putchar(i8 signext 32)
br label %7
7: ; preds = %5
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
br label %2
10: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @PrintNMargin() {
%1 = tail call i32 @putchar(i8 signext 32)
%2 = tail call i32 @putchar(i8 signext 32)
%3 = tail call i32 @putchar(i8 signext 32)
%4 = tail call i32 @putchar(i8 signext 32)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _setReg(int, int);
int adxlEnd() {
  _setReg(0x2E, 0x00);
  _setReg(0x2D, 0x00);
  return 0;
}


x86 assembly (clang, -O0):
<adxlEnd>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2e,%edi
xor    %esi,%esi
call   1030 <_setReg@plt>
mov    $0x2d,%edi
xor    %esi,%esi
call   1030 <_setReg@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adxlEnd>:
push   %rax
mov    $0x2e,%edi
xor    %esi,%esi
call   1030 <_setReg@plt>
mov    $0x2d,%edi
xor    %esi,%esi
call   1030 <_setReg@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @adxlEnd() {
%1 = call i32 @_setReg(i32 46, i32 0)
%2 = call i32 @_setReg(i32 45, i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @adxlEnd() {
%1 = tail call i32 @_setReg(i32 46, i32 0)
%2 = tail call i32 @_setReg(i32 45, i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ foo(int /*<<< orphan*/, int);
void bar() { foo(0, 2); }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x2,%esi
call   1030 <foo@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
xor    %edi,%edi
mov    $0x2,%esi
jmp    1030 <foo@plt>

LLVM IR (-O0):
define void @bar() {
%1 = call i32 @foo(i32 0, i32 2)
ret void
}

LLVM IR (-O2):
define void @bar() {
%1 = tail call i32 @foo(i32 0, i32 2)
ret void
}
/* Variables and functions */
int complex(int, int);
int benchmark() {
  int a = 1, b = 1, answer = 0;
  answer = complex(a, b);
  return answer;
}


x86 assembly (clang, -O0):
<benchmark>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <complex@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @benchmark() {
%1 = tail call i32 @complex(i32 1, i32 1)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isxdigit(int);
void t_isxdigit_0x61() {
  Assert_real((isxdigit(97)),
              "/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_isxdigit.c",
              490, ("isxdigit should be 1 for a"));
}


x86 assembly (clang, -O0):
<t_isxdigit_0x61>:
push   %rbp
mov    %rsp,%rbp
mov    $0x61,%edi
call   1030 <isxdigit@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x1ea,%edx
lea    0xf66(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isxdigit_0x61>:
push   %rax
mov    $0x61,%edi
call   1030 <isxdigit@plt>
lea    0xece(%rip),%rsi
lea    0xf70(%rip),%rcx
mov    %eax,%edi
mov    $0x1ea,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 1 for a\00"
define void @t_isxdigit_0x61() {
%1 = call i32 @isxdigit(i32 97)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 490, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 1 for a\00"
define void @t_isxdigit_0x61() {
%1 = tail call i32 @isxdigit(i32 97)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 490, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int cmp2Desc(const void *pa, const void *pb) {
  const short *a = (const short *)pa;
  const short *b = (const short *)pb;
  if (a[2] < b[2])
    return +1;
  if (a[2] > b[2])
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<cmp2Desc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movswl 0x4(%rax),%eax
mov    -0x28(%rbp),%rcx
movswl 0x4(%rcx),%ecx
cmp    %ecx,%eax
jge    1140 <cmp2Desc+0x40>
movl   $0x1,-0x4(%rbp)
jmp    116b <cmp2Desc+0x6b>
mov    -0x20(%rbp),%rax
movswl 0x4(%rax),%eax
mov    -0x28(%rbp),%rcx
movswl 0x4(%rcx),%ecx
cmp    %ecx,%eax
jle    1164 <cmp2Desc+0x64>
movl   $0xffffffff,-0x4(%rbp)
jmp    116b <cmp2Desc+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp2Desc>:
movzwl 0x4(%rdi),%eax
movzwl 0x4(%rsi),%ecx
xor    %edx,%edx
cmp    %cx,%ax
setg   %dl
neg    %edx
cmp    %cx,%ax
mov    $0x1,%eax
cmovge %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @cmp2Desc(i8* nocapture %0, i8* nocapture %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 4
%4 = bitcast i8* %3 to i16*
%5 = load i16, i16* %4
%6 = getelementptr inbounds i8, i8* %1, i64 4
%7 = bitcast i8* %6 to i16*
%8 = load i16, i16* %7
%9 = icmp slt i16 %5, %8
%10 = icmp sgt i16 %5, %8
%11 = sext i1 %10 to i32
%12 = select i1 %9, i32 1, i32 %11
ret i32 %12
}
/* Forward declarations */
typedef struct tms TYPE_1__;

/* Type definitions */
typedef scalar_t__ clock_t;
struct tms {
  scalar_t__ tms_utime;
  scalar_t__ tms_stime;
  scalar_t__ tms_cutime;
  scalar_t__ tms_cstime;
};

/* Variables and functions */
scalar_t__ times(TYPE_1__ *);
clock_t GetTime(void) {
  clock_t t;
  struct tms {
    clock_t tms_utime;
    clock_t tms_stime;
    clock_t tms_cutime;
    clock_t tms_cstime;
  } tmrec;
  t = times(&tmrec);
  t = tmrec.tms_utime + tmrec.tms_stime;
  return t;
}


x86 assembly (clang, -O0):
<GetTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x28(%rbp),%rdi
call   1030 <times@plt>
mov    %rax,-0x8(%rbp)
mov    -0x28(%rbp),%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetTime>:
sub    $0x28,%rsp
lea    0x8(%rsp),%rdi
call   1030 <times@plt>
mov    0x10(%rsp),%rax
add    0x8(%rsp),%rax
add    $0x28,%rsp
ret

LLVM IR (-O0):
%struct.tms = type { i64, i64, i64, i64 }
%struct.tms.0 = type { i64, i64, i64, i64 }
define i64 @GetTime() {
%1 = alloca i64
%2 = alloca %struct.tms
%3 = bitcast %struct.tms* %2 to %struct.tms.0*
%4 = call i64 @times(%struct.tms.0* %3)
store i64 %4, i64* %1
%5 = getelementptr inbounds %struct.tms, %struct.tms* %2, i32 0, i32 0
%6 = load i64, i64* %5
%7 = getelementptr inbounds %struct.tms, %struct.tms* %2, i32 0, i32 1
%8 = load i64, i64* %7
%9 = add nsw i64 %6, %8
store i64 %9, i64* %1
%10 = load i64, i64* %1
ret i64 %10
}

LLVM IR (-O2):
%struct.tms = type { i64, i64, i64, i64 }
%struct.tms.0 = type { i64, i64, i64, i64 }
define i64 @GetTime() {
%1 = alloca %struct.tms
%2 = bitcast %struct.tms* %1 to i8*
%3 = bitcast %struct.tms* %1 to %struct.tms.0*
%4 = call i64 @times(%struct.tms.0* %3)
%5 = getelementptr inbounds %struct.tms, %struct.tms* %1, i64 0, i32 0
%6 = load i64, i64* %5
%7 = getelementptr inbounds %struct.tms, %struct.tms* %1, i64 0, i32 1
%8 = load i64, i64* %7
%9 = add nsw i64 %8, %6
ret i64 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t fwrite(void const *, int, size_t, int /*<<< orphan*/ *);
size_t write_bin(FILE *fp, const void *array, size_t arrayBytes) {
  return fwrite(array, 1, arrayBytes, fp);
}


x86 assembly (clang, -O0):
<write_bin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fwrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_bin>:
mov    %rdi,%rcx
mov    %rsi,%rdi
mov    $0x1,%esi
jmp    1030 <fwrite@plt>

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

LLVM IR (-O2):
define i64 @write_bin(i32* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = tail call i64 @fwrite(i8* %1, i32 1, i64 %2, i32* %0)
ret i64 %4
}
/* Variables and functions */
int execlp(char *, char *, char *, char *, int /*<<< orphan*/ *);
int intrp_copyfile(char *src, char *dest) {
  return execlp("cp", "copyfile", src, dest, NULL);
}


x86 assembly (clang, -O0):
<intrp_copyfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xed1(%rip),%rdi
lea    0xecd(%rip),%rsi
xor    %eax,%eax
mov    %eax,%r8d
call   1030 <execlp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intrp_copyfile>:
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0xee3(%rip),%rdi
lea    0xedf(%rip),%rsi
xor    %r8d,%r8d
jmp    1030 <execlp@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"cp\00"
@.str.1 = [9 x i8] c"copyfile\00"
define i32 @intrp_copyfile(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %5, i8* %6, i32* null)
ret i32 %7
}

LLVM IR (-O2):
@.str = [3 x i8] c"cp\00"
@.str.1 = [9 x i8] c"copyfile\00"
define i32 @intrp_copyfile(i8* %0, i8* %1) {
%3 = tail call i32 @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* %1, i32* null)
ret i32 %3
}
int cmp(void *x, void *y) {
  int a, b;
  a = (int)x;
  b = (int)y;
  if (a < b)
    return -1;
  if (a == b)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1132 <cmp+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    1151 <cmp+0x51>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jne    114a <cmp+0x4a>
movl   $0x0,-0x4(%rbp)
jmp    1151 <cmp+0x51>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp>:
xor    %ecx,%ecx
cmp    %esi,%edi
setne  %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @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 = icmp slt i32 %4, %6
%8 = icmp ne i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Type definitions */
struct radtree {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct radtree *);
int /*<<< orphan*/ radix_tree_clear(struct radtree *);
void radix_tree_delete(struct radtree *rt) {
  if (!rt)
    return;
  radix_tree_clear(rt);
  free(rt);
}


x86 assembly (clang, -O0):
<radix_tree_delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113c <radix_tree_delete+0x1c>
jmp    114e <radix_tree_delete+0x2e>
mov    -0x8(%rbp),%rdi
call   1040 <radix_tree_clear@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<radix_tree_delete>:
test   %rdi,%rdi
je     1137 <radix_tree_delete+0x17>
push   %rbx
mov    %rdi,%rbx
call   1040 <radix_tree_clear@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
%struct.radtree = type { i32 }
define void @radix_tree_delete(%struct.radtree* %0) {
%2 = alloca %struct.radtree*
store %struct.radtree* %0, %struct.radtree** %2
%3 = load %struct.radtree*, %struct.radtree** %2
%4 = icmp ne %struct.radtree* %3, null
br i1 %4, label %6, label %5
5: ; preds = %1
br label %11
6: ; preds = %1
%7 = load %struct.radtree*, %struct.radtree** %2
%8 = call i32 @radix_tree_clear(%struct.radtree* %7)
%9 = load %struct.radtree*, %struct.radtree** %2
%10 = call i32 @free(%struct.radtree* %9)
br label %11
11: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
%struct.radtree = type { i32 }
define void @radix_tree_delete(%struct.radtree* %0) {
%2 = icmp eq %struct.radtree* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @radix_tree_clear(%struct.radtree* %0)
%5 = tail call i32 @free(%struct.radtree* %0)
br label %6
6: ; preds = %1, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PTRACE_CONT;
int /*<<< orphan*/ ptrace(int /*<<< orphan*/, int /*<<< orphan*/,
                          int /*<<< orphan*/ *, int /*<<< orphan*/ *);
extern void violate(void) { ptrace(PTRACE_CONT, 0, NULL, NULL); }


x86 assembly (clang, -O0):
<violate>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
xor    %eax,%eax
mov    %eax,%ecx
mov    %rcx,%rdx
call   1030 <ptrace@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<violate>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <ptrace@plt>

LLVM IR (-O0):
@PTRACE_CONT = global i32 0
define void @violate() {
%1 = load i32, i32* @PTRACE_CONT
%2 = call i32 @ptrace(i32 %1, i32 0, i32* null, i32* null)
ret void
}

LLVM IR (-O2):
@PTRACE_CONT = global i32 0
define void @violate() {
%1 = load i32, i32* @PTRACE_CONT
%2 = tail call i32 @ptrace(i32 %1, i32 0, i32* null, i32* null)
ret void
}
void do_peace_talks(int side) {}


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

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

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

LLVM IR (-O2):
define void @do_peace_talks(i32 %0) {
ret void
}
int main(void) {
  int v = -1;
  int r = 17;
  int u = r >> v;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0xffffffff,-0x4(%rbp)
movl   $0x11,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    %cl,%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 -1, i32* %1
store i32 17, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* %1
%6 = ashr i32 %4, %5
store i32 %6, i32* %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void generic_pipe_buf_unmap(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<generic_pipe_buf_unmap>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<generic_pipe_buf_unmap>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.generic_pipe_buf_unmap = [23 x i8] c"generic_pipe_buf_unmap\00"
define void @generic_pipe_buf_unmap() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @__func__.generic_pipe_buf_unmap, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.generic_pipe_buf_unmap = [23 x i8] c"generic_pipe_buf_unmap\00"
define void @generic_pipe_buf_unmap() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @__func__.generic_pipe_buf_unmap, i64 0, i64 0))
ret void
}
int glmMaxIndex2d(double a, double b, int i1, int i2) {
  if (a > b)
    return i1;
  return i2;
}


x86 assembly (clang, -O0):
<glmMaxIndex2d>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    %esi,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    112f <glmMaxIndex2d+0x2f>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1135 <glmMaxIndex2d+0x35>
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmMaxIndex2d>:
ucomisd %xmm1,%xmm0
mov    %edi,%eax
cmovbe %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @glmMaxIndex2d(double %0, double %1, i32 %2, i32 %3) {
%5 = fcmp ogt double %0, %1
%6 = select i1 %5, i32 %2, i32 %3
ret i32 %6
}