xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ run_file(char *);
int main(int argc, char *argv[]) {
  if (argc == 1) {
    printf("usage: %s FILE\n", argv[0]);
    return 2;
  }
  run_file(argv[1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    115f <main+0x3f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xeb2(%rip),%rdi
call   1040 <printf@plt>
movl   $0x2,-0x4(%rbp)
jmp    1173 <main+0x53>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <run_file@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jne    113c <main+0x1c>
mov    (%rsi),%rsi
lea    0xed0(%rip),%rdi
call   1040 <printf@plt>
mov    $0x2,%eax
pop    %rcx
ret
mov    0x8(%rsi),%rdi
call   1030 <run_file@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"usage: %s FILE\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %11)
store i32 2, i32* %3
br label %18
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i32 @run_file(i8* %16)
store i32 0, i32* %3
br label %18
18: ; preds = %13, %8
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@.str = [16 x i8] c"usage: %s FILE\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %5)
br label %11
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @run_file(i8* %9)
br label %11
11: ; preds = %7, %4
%12 = phi i32 [ 2, %4 ], [ 0, %7 ]
ret i32 %12
}
double dotProd(double *x1, double *x2) {
  return (x1[0] * x2[0] + x1[1] * x2[1] + x1[2] * x2[2]);
}


x86 assembly (clang, -O0):
<dotProd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dotProd>:
movsd  0x8(%rdi),%xmm0
mulsd  0x8(%rsi),%xmm0
movsd  (%rdi),%xmm1
mulsd  (%rsi),%xmm1
addsd  %xmm0,%xmm1
movsd  0x10(%rdi),%xmm0
mulsd  0x10(%rsi),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @dotProd(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 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double*, double** %4
%9 = getelementptr inbounds double, double* %8, i64 0
%10 = load double, double* %9
%11 = load double*, double** %3
%12 = getelementptr inbounds double, double* %11, i64 1
%13 = load double, double* %12
%14 = load double*, double** %4
%15 = getelementptr inbounds double, double* %14, i64 1
%16 = load double, double* %15
%17 = fmul double %13, %16
%18 = call double @llvm.fmuladd.f64(double %7, double %10, double %17)
%19 = load double*, double** %3
%20 = getelementptr inbounds double, double* %19, i64 2
%21 = load double, double* %20
%22 = load double*, double** %4
%23 = getelementptr inbounds double, double* %22, i64 2
%24 = load double, double* %23
%25 = call double @llvm.fmuladd.f64(double %21, double %24, double %18)
ret double %25
}

LLVM IR (-O2):
define double @dotProd(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = getelementptr inbounds double, double* %0, i64 1
%6 = load double, double* %5
%7 = getelementptr inbounds double, double* %1, i64 1
%8 = load double, double* %7
%9 = fmul double %6, %8
%10 = tail call double @llvm.fmuladd.f64(double %3, double %4, double %9)
%11 = getelementptr inbounds double, double* %0, i64 2
%12 = load double, double* %11
%13 = getelementptr inbounds double, double* %1, i64 2
%14 = load double, double* %13
%15 = tail call double @llvm.fmuladd.f64(double %12, double %14, double %10)
ret double %15
}
/* Variables and functions */
scalar_t__ Pfun(int, int);
float accum(int k) {
  int i;
  float tmp = 0.0;
#pragma omp target
#pragma omp parallel for reduction(+ : tmp)
  for (i = 0; i < 1000; i++)
    tmp += Pfun(i, k);
  return tmp;
}


x86 assembly (clang, -O0):
<accum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jge    115f <accum+0x4f>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1030 <Pfun@plt>
cvtsi2ss %rax,%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112a <accum+0x1a>
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<accum>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
xorps  %xmm0,%xmm0
nopw   0x0(%rax,%rax,1)
movss  %xmm0,0x4(%rsp)
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <Pfun@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
movss  0x4(%rsp),%xmm1
addss  %xmm0,%xmm1
movss  %xmm1,0x4(%rsp)
movss  0x4(%rsp),%xmm0
add    $0x1,%ebp
cmp    $0x3e8,%ebp
jne    1120 <accum+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define float @accum(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
store i32 %0, i32* %2
store float 0.000000e+00, float* %4
store i32 0, i32* %3
br label %5
5: ; preds = %15, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 1000
br i1 %7, label %8, label %18
8: ; preds = %5
%9 = load i32, i32* %3
%10 = load i32, i32* %2
%11 = call i64 @Pfun(i32 %9, i32 %10)
%12 = sitofp i64 %11 to float
%13 = load float, float* %4
%14 = fadd float %13, %12
store float %14, float* %4
br label %15
15: ; preds = %8
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %5
18: ; preds = %5
%19 = load float, float* %4
ret float %19
}

LLVM IR (-O2):
define float @accum(i32 %0) {
br label %2
2: ; preds = %1, %2
%3 = phi float [ 0.000000e+00, %1 ], [ %7, %2 ]
%4 = phi i32 [ 0, %1 ], [ %8, %2 ]
%5 = tail call i64 @Pfun(i32 %4, i32 %0)
%6 = sitofp i64 %5 to float
%7 = fadd float %3, %6
%8 = add nuw nsw i32 %4, 1
%9 = icmp eq i32 %8, 1000
br i1 %9, label %10, label %2
10: ; preds = %2
ret float %7
}
void fdc_log(const char *fmt, ...) {}


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

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

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

LLVM IR (-O2):
define void @fdc_log(i8* nocapture %0, ...) {
ret void
}
extern int AssortedIntArgs(int x, short y, char z) {
  if (x == 101 && y == 102 && z == 103)
    return 3;
  return 0;
}


x86 assembly (clang, -O0):
<AssortedIntArgs>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %si,%cx
mov    %edi,-0x8(%rbp)
mov    %cx,-0xa(%rbp)
mov    %al,-0xb(%rbp)
cmpl   $0x65,-0x8(%rbp)
jne    1143 <AssortedIntArgs+0x43>
movswl -0xa(%rbp),%eax
cmp    $0x66,%eax
jne    1143 <AssortedIntArgs+0x43>
movsbl -0xb(%rbp),%eax
cmp    $0x67,%eax
jne    1143 <AssortedIntArgs+0x43>
movl   $0x3,-0x4(%rbp)
jmp    114a <AssortedIntArgs+0x4a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AssortedIntArgs>:
xor    %eax,%eax
cmp    $0x67,%dl
sete   %al
xor    %ecx,%ecx
cmp    $0x66,%si
lea    (%rax,%rax,2),%eax
cmovne %ecx,%eax
cmp    $0x65,%edi
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @AssortedIntArgs(i32 %0, i16 signext %1, i8 signext %2) {
%4 = icmp eq i32 %0, 101
%5 = icmp eq i16 %1, 102
%6 = and i1 %4, %5
%7 = icmp eq i8 %2, 103
%8 = and i1 %6, %7
%9 = select i1 %8, i32 3, i32 0
ret i32 %9
}
/* Type definitions */
struct vec4i {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ vec4i_negative(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
__attribute__((always_)) struct vec4i *psvec4i_negative(struct vec4i *result,
                                                        struct vec4i *a) {
  vec4i_negative((int32_t *)result, (int32_t *)a);
  return result;
}


x86 assembly (clang, -O0):
<psvec4i_negative>:
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 <vec4i_negative@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psvec4i_negative>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec4i_negative@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vec4i = type { i32 }
define %struct.vec4i* @psvec4i_negative(%struct.vec4i* %0, %struct.vec4i* %1) {
%3 = alloca %struct.vec4i*
%4 = alloca %struct.vec4i*
store %struct.vec4i* %0, %struct.vec4i** %3
store %struct.vec4i* %1, %struct.vec4i** %4
%5 = load %struct.vec4i*, %struct.vec4i** %3
%6 = bitcast %struct.vec4i* %5 to i32*
%7 = load %struct.vec4i*, %struct.vec4i** %4
%8 = bitcast %struct.vec4i* %7 to i32*
%9 = call i32 @vec4i_negative(i32* %6, i32* %8)
%10 = load %struct.vec4i*, %struct.vec4i** %3
ret %struct.vec4i* %10
}

LLVM IR (-O2):
%struct.vec4i = type { i32 }
define %struct.vec4i* @psvec4i_negative(%struct.vec4i* returned %0, %struct.vec4i* %1) {
%3 = getelementptr %struct.vec4i, %struct.vec4i* %0, i64 0, i32 0
%4 = getelementptr %struct.vec4i, %struct.vec4i* %1, i64 0, i32 0
%5 = tail call i32 @vec4i_negative(i32* %3, i32* %4)
ret %struct.vec4i* %0
}
/* Variables and functions */
int sscanf(char *, char *, float *);
float strtofloat_alc(char *str) {
  float value;
  if (str == NULL) {
    return 0;
  }
  if (sscanf(str, "%f", &value) != 1) {
    return 0;
  }
  return value;
}


x86 assembly (clang, -O0):
<strtofloat_alc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <strtofloat_alc+0x24>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1168 <strtofloat_alc+0x58>
mov    -0x10(%rbp),%rdi
lea    0xec1(%rip),%rsi
lea    -0x14(%rbp),%rdx
call   1030 <sscanf@plt>
cmp    $0x1,%eax
je     115e <strtofloat_alc+0x4e>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1168 <strtofloat_alc+0x58>
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtofloat_alc>:
test   %rdi,%rdi
je     1134 <strtofloat_alc+0x24>
push   %rax
lea    0xee3(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1030 <sscanf@plt>
cmp    $0x1,%eax
je     1138 <strtofloat_alc+0x28>
xorps  %xmm0,%xmm0
add    $0x8,%rsp
ret
xorps  %xmm0,%xmm0
ret
movss  0x4(%rsp),%xmm0
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
define float @strtofloat_alc(i8* %0) {
%2 = alloca float
%3 = alloca i8*
%4 = alloca float
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %8
7: ; preds = %1
store float 0.000000e+00, float* %2
br label %15
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i32 @sscanf(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %4)
%11 = icmp ne i32 %10, 1
br i1 %11, label %12, label %13
12: ; preds = %8
store float 0.000000e+00, float* %2
br label %15
13: ; preds = %8
%14 = load float, float* %4
store float %14, float* %2
br label %15
15: ; preds = %13, %12, %7
%16 = load float, float* %2
ret float %16
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define float @strtofloat_alc(i8* %0) {
%2 = alloca float
%3 = bitcast float* %2 to i8*
%4 = icmp eq i8* %0, null
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %2)
%7 = icmp eq i32 %6, 1
%8 = load float, float* %2
%9 = select i1 %7, float %8, float 0.000000e+00
br label %10
10: ; preds = %5, %1
%11 = phi float [ 0.000000e+00, %1 ], [ %9, %5 ]
ret float %11
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ strcat(char *, char const *);
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char const *);
char *test_hello(const char *name) {
  const char *hello = " -> hello";
  char *result =
      (char *)malloc(sizeof(char) * (strlen(name) + strlen(hello)) + 1);
  strcpy(result, name);
  strcat(result, hello);
  return result;
}


x86 assembly (clang, -O0):
<test_hello>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xead(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
add    %ecx,%eax
cltq
shl    $0x0,%rax
add    $0x1,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_hello>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r12
call   1040 <strlen@plt>
mov    %eax,%r14d
lea    0xea6(%rip),%r15
mov    %r15,%rdi
call   1040 <strlen@plt>
lea    (%r14,%rax,1),%edi
add    $0x1,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r12,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1060 <strcat@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [10 x i8] c" -> hello\00"
define i8* @test_hello(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8** %3
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = add nsw i32 %6, %8
%10 = sext i32 %9 to i64
%11 = mul i64 1, %10
%12 = add i64 %11, 1
%13 = trunc i64 %12 to i32
%14 = call i64 @malloc(i32 %13)
%15 = inttoptr i64 %14 to i8*
store i8* %15, i8** %4
%16 = load i8*, i8** %4
%17 = load i8*, i8** %2
%18 = call i32 @strcpy(i8* %16, i8* %17)
%19 = load i8*, i8** %4
%20 = load i8*, i8** %3
%21 = call i32 @strcat(i8* %19, i8* %20)
%22 = load i8*, i8** %4
ret i8* %22
}

LLVM IR (-O2):
@.str = [10 x i8] c" -> hello\00"
define i8* @test_hello(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @strlen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = add i32 %2, 1
%5 = add i32 %4, %3
%6 = tail call i64 @malloc(i32 %5)
%7 = inttoptr i64 %6 to i8*
%8 = tail call i32 @strcpy(i8* %7, i8* %0)
%9 = tail call i32 @strcat(i8* %7, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i8* %7
}
int qd_is_negative(const double *a) { return (a[0] < 0.0) ? 1 : 0; }


x86 assembly (clang, -O0):
<qd_is_negative>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
xorps  %xmm0,%xmm0
xor    %eax,%eax
mov    $0x1,%ecx
ucomisd %xmm1,%xmm0
cmova  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<qd_is_negative>:
xorpd  %xmm0,%xmm0
xor    %eax,%eax
ucomisd (%rdi),%xmm0
seta   %al
ret

LLVM IR (-O0):
define i32 @qd_is_negative(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = fcmp olt double %5, 0.000000e+00
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 1, i32 0
ret i32 %8
}

LLVM IR (-O2):
define i32 @qd_is_negative(double* nocapture %0) {
%2 = load double, double* %0
%3 = fcmp olt double %2, 0.000000e+00
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void pcap_free(void *ptr) { free((char *)ptr); }


x86 assembly (clang, -O0):
<pcap_free>:
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):
<pcap_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @pcap_free(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 @pcap_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void RTSemEventSetSignaller(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSemEventSetSignaller() {
ret void
}
/* Variables and functions */
int wordncmp(char *, char *);
int sortcmp(char **p, char **q) { return wordncmp(*p, *q); }


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

x86 assembly (clang, -O2):
<sortcmp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <wordncmp@plt>

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

LLVM IR (-O2):
define i32 @sortcmp(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
%5 = tail call i32 @wordncmp(i8* %3, i8* %4)
ret i32 %5
}
/* Variables and functions */
int orig_isatty(int);
scalar_t__ should_fake(int);
int isatty(int fd) {
  if (should_fake(fd)) {
    return 1;
  }
  return orig_isatty(fd);
}


x86 assembly (clang, -O0):
<isatty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <should_fake@plt>
cmp    $0x0,%rax
je     1149 <isatty+0x29>
movl   $0x1,-0x4(%rbp)
jmp    1154 <isatty+0x34>
mov    -0x8(%rbp),%edi
call   1040 <orig_isatty@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isatty>:
push   %rbx
mov    %edi,%ebx
call   1030 <should_fake@plt>
test   %rax,%rax
je     1134 <isatty+0x14>
mov    $0x1,%eax
pop    %rbx
ret
mov    %ebx,%edi
pop    %rbx
jmp    1040 <orig_isatty@plt>

LLVM IR (-O0):
define i32 @isatty(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @should_fake(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %11
8: ; preds = %1
%9 = load i32, i32* %3
%10 = call i32 @orig_isatty(i32 %9)
store i32 %10, i32* %2
br label %11
11: ; preds = %8, %7
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @isatty(i32 %0) {
%2 = tail call i64 @should_fake(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @orig_isatty(i32 %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ 1, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void abertura() {
  printf("/****************/\n");
  printf("/ Jogo de Forca */\n");
  printf("/****************/\n\n");
}


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

x86 assembly (clang, -O2):
<abertura>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeef(%rip),%rdi
call   1030 <puts@plt>
lea    0xef6(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"/****************/\0A\00"
@.str.1 = [20 x i8] c"/ Jogo de Forca */\0A\00"
@.str.2 = [21 x i8] c"/****************/\0A\0A\00"
define void @abertura() {
%1 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [19 x i8] c"/****************/\00"
@str.3 = [19 x i8] c"/ Jogo de Forca */\00"
@str.4 = [20 x i8] c"/****************/\0A\00"
define void @abertura() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ e_absx();
int /*<<< orphan*/ e_dec();
int /*<<< orphan*/ e_writeback();
void e_dec_absx() {
  e_absx();
  e_dec();
  e_writeback();
}


x86 assembly (clang, -O0):
<e_dec_absx>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <e_absx@plt>
mov    $0x0,%al
call   1040 <e_dec@plt>
mov    $0x0,%al
call   1030 <e_writeback@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<e_dec_absx>:
push   %rax
xor    %eax,%eax
call   1050 <e_absx@plt>
xor    %eax,%eax
call   1040 <e_dec@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <e_writeback@plt>

LLVM IR (-O0):
define void @e_dec_absx() {
%1 = call i32 (...) @e_absx()
%2 = call i32 (...) @e_dec()
%3 = call i32 (...) @e_writeback()
ret void
}

LLVM IR (-O2):
define void @e_dec_absx() {
%1 = tail call i32 (...) @e_absx()
%2 = tail call i32 (...) @e_dec()
%3 = tail call i32 (...) @e_writeback()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SPC_TRIM(char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  char *filename = NULL;
  if (argc != 2) {
    printf("Input filename!\n");
    return -1;
  }
  filename = argv[1];
  SPC_TRIM(filename);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1160 <main+0x40>
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    117c <main+0x5c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <SPC_TRIM@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1133 <main+0x13>
mov    0x8(%rsi),%rdi
call   1040 <SPC_TRIM@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xec6(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Input filename!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %6
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 2
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %17
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
store i8* %14, i8** %6
%15 = load i8*, i8** %6
%16 = call i32 @SPC_TRIM(i8* %15)
store i32 0, i32* %3
br label %17
17: ; preds = %11, %9
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@str = [16 x i8] c"Input filename!\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
br label %10
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @SPC_TRIM(i8* %8)
br label %10
10: ; preds = %6, %4
%11 = phi i32 [ -1, %4 ], [ 0, %6 ]
ret i32 %11
}
/* Type definitions */
struct mcuio_packet {
  int dummy;
};

/* Variables and functions */
int BIT(int);
int mcuio_packet_type(struct mcuio_packet *);
int /*<<< orphan*/ mcuio_set_packet_type(struct mcuio_packet *, int);
void mcuio_packet_set_reply(struct mcuio_packet *p) {
  mcuio_set_packet_type(p, mcuio_packet_type(p) | BIT(6));
}


x86 assembly (clang, -O0):
<mcuio_packet_set_reply>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <mcuio_packet_type@plt>
mov    %eax,-0x14(%rbp)
mov    $0x6,%edi
call   1030 <BIT@plt>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rdi
or     %eax,%esi
call   1050 <mcuio_set_packet_type@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mcuio_packet_set_reply>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <mcuio_packet_type@plt>
mov    %eax,%ebp
mov    $0x6,%edi
call   1030 <BIT@plt>
or     %eax,%ebp
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <mcuio_set_packet_type@plt>

LLVM IR (-O0):
%struct.mcuio_packet = type { i32 }
define void @mcuio_packet_set_reply(%struct.mcuio_packet* %0) {
%2 = alloca %struct.mcuio_packet*
store %struct.mcuio_packet* %0, %struct.mcuio_packet** %2
%3 = load %struct.mcuio_packet*, %struct.mcuio_packet** %2
%4 = load %struct.mcuio_packet*, %struct.mcuio_packet** %2
%5 = call i32 @mcuio_packet_type(%struct.mcuio_packet* %4)
%6 = call i32 @BIT(i32 6)
%7 = or i32 %5, %6
%8 = call i32 @mcuio_set_packet_type(%struct.mcuio_packet* %3, i32 %7)
ret void
}

LLVM IR (-O2):
%struct.mcuio_packet = type { i32 }
define void @mcuio_packet_set_reply(%struct.mcuio_packet* %0) {
%2 = tail call i32 @mcuio_packet_type(%struct.mcuio_packet* %0)
%3 = tail call i32 @BIT(i32 6)
%4 = or i32 %3, %2
%5 = tail call i32 @mcuio_set_packet_type(%struct.mcuio_packet* %0, i32 %4)
ret void
}
/* Variables and functions */
int close(int);
int Serial_ClosePort(int portId) { return close(portId); }


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

x86 assembly (clang, -O2):
<Serial_ClosePort>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @Serial_ClosePort(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
void gtk_tool_item_set_visible_horizontal() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tool_item_set_visible_horizontal() {
ret void
}
/* Type definitions */
struct sockaddr_in {
  int /*<<< orphan*/ sin_addr;
};

/* Variables and functions */
char const *inet_ntoa(int /*<<< orphan*/);
const char *net_getConnectedIP_ipv4(struct sockaddr_in *dest) {
  return inet_ntoa(dest->sin_addr);
}


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

x86 assembly (clang, -O2):
<net_getConnectedIP_ipv4>:
mov    (%rdi),%edi
jmp    1030 <inet_ntoa@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
define i8* @net_getConnectedIP_ipv4(%struct.sockaddr_in* %0) {
%2 = alloca %struct.sockaddr_in*
store %struct.sockaddr_in* %0, %struct.sockaddr_in** %2
%3 = load %struct.sockaddr_in*, %struct.sockaddr_in** %2
%4 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = call i8* @inet_ntoa(i32 %5)
ret i8* %6
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
define i8* @net_getConnectedIP_ipv4(%struct.sockaddr_in* nocapture %0) {
%2 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = tail call i8* @inet_ntoa(i32 %3)
ret i8* %4
}
char irc_tolower(const char c) {
  if ((c >= 'A') && (c <= 'Z'))
    return ((c - 'A') + 'a');
  if (c == '[')
    return ('{');
  if (c == ']')
    return ('{');
  if (c == '\\')
    return ('|');
  return (c);
}


x86 assembly (clang, -O0):
<irc_tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x41,%eax
jl     1136 <irc_tolower+0x36>
movsbl -0x2(%rbp),%eax
cmp    $0x5a,%eax
jg     1136 <irc_tolower+0x36>
movsbl -0x2(%rbp),%eax
sub    $0x41,%eax
add    $0x61,%eax
mov    %al,-0x1(%rbp)
jmp    117e <irc_tolower+0x7e>
movsbl -0x2(%rbp),%eax
cmp    $0x5b,%eax
jne    114c <irc_tolower+0x4c>
movb   $0x7b,-0x1(%rbp)
jmp    117e <irc_tolower+0x7e>
movsbl -0x2(%rbp),%eax
cmp    $0x5d,%eax
jne    1162 <irc_tolower+0x62>
movb   $0x7b,-0x1(%rbp)
jmp    117e <irc_tolower+0x7e>
movsbl -0x2(%rbp),%eax
cmp    $0x5c,%eax
jne    1178 <irc_tolower+0x78>
movb   $0x7c,-0x1(%rbp)
jmp    117e <irc_tolower+0x7e>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_tolower>:
mov    %edi,%eax
lea    -0x41(%rax),%ecx
cmp    $0x19,%cl
ja     110d <irc_tolower+0xd>
add    $0x20,%al
ret
lea    -0x5b(%rax),%ecx
cmp    $0x2,%cl
ja     1122 <irc_tolower+0x22>
movzbl %cl,%ecx
shl    $0x3,%ecx
mov    $0x7b7c7b,%eax
shr    %cl,%eax
ret

LLVM IR (-O0):
define signext i8 @irc_tolower(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 65
br i1 %6, label %7, label %17
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 90
br i1 %10, label %11, label %17
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 65
%15 = add nsw i32 %14, 97
%16 = trunc i32 %15 to i8
store i8 %16, i8* %2
br label %34
17: ; preds = %7, %1
%18 = load i8, i8* %3
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 91
br i1 %20, label %21, label %22
21: ; preds = %17
store i8 123, i8* %2
br label %34
22: ; preds = %17
%23 = load i8, i8* %3
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 93
br i1 %25, label %26, label %27
26: ; preds = %22
store i8 123, i8* %2
br label %34
27: ; preds = %22
%28 = load i8, i8* %3
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %29, 92
br i1 %30, label %31, label %32
31: ; preds = %27
store i8 124, i8* %2
br label %34
32: ; preds = %27
%33 = load i8, i8* %3
store i8 %33, i8* %2
br label %34
34: ; preds = %32, %31, %26, %21, %11
%35 = load i8, i8* %2
ret i8 %35
}

LLVM IR (-O2):
define signext i8 @irc_tolower(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = add nuw nsw i8 %0, 32
br label %14
6: ; preds = %1
%7 = add i8 %0, -91
%8 = icmp ult i8 %7, 3
br i1 %8, label %9, label %14
9: ; preds = %6
%10 = zext i8 %7 to i24
%11 = shl nuw nsw i24 %10, 3
%12 = lshr i24 8092795, %11
%13 = trunc i24 %12 to i8
br label %14
14: ; preds = %6, %9, %4
%15 = phi i8 [ %5, %4 ], [ %13, %9 ], [ %0, %6 ]
ret i8 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void beep(void) { printf("%cbeep\n", 7); }


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

x86 assembly (clang, -O2):
<beep>:
lea    0xee9(%rip),%rdi
mov    $0x7,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%cbeep\0A\00"
define void @beep() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 7)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%cbeep\0A\00"
define void @beep() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 7)
ret void
}
struct typeVarList *NewList(void) {
  return (0);
}


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

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

LLVM IR (-O0):
%struct.typeVarList = type opaque
define %struct.typeVarList* @NewList() {
ret %struct.typeVarList* null
}

LLVM IR (-O2):
%struct.typeVarList = type opaque
define noalias %struct.typeVarList* @NewList() {
ret %struct.typeVarList* null
}
/* Variables and functions */
float mmapAdd(float *, long, double);
float mmapDec(float *addr, long i) { return mmapAdd(addr, i, -1.0); }


x86 assembly (clang, -O0):
<mmapDec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movsd  0xed0(%rip),%xmm0
call   1030 <mmapAdd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mmapDec>:
movsd  0xee8(%rip),%xmm0
jmp    1030 <mmapAdd@plt>

LLVM IR (-O0):
define float @mmapDec(float* %0, i64 %1) {
%3 = alloca float*
%4 = alloca i64
store float* %0, float** %3
store i64 %1, i64* %4
%5 = load float*, float** %3
%6 = load i64, i64* %4
%7 = call float @mmapAdd(float* %5, i64 %6, double -1.000000e+00)
ret float %7
}

LLVM IR (-O2):
define float @mmapDec(float* %0, i64 %1) {
%3 = tail call float @mmapAdd(float* %0, i64 %1, double -1.000000e+00)
ret float %3
}
int f6() {
  int x = 4;
  ++x;
  return 1;
}


x86 assembly (clang, -O0):
<f6>:
push   %rbp
mov    %rsp,%rbp
movl   $0x4,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f6() {
%1 = alloca i32
store i32 4, i32* %1
%2 = load i32, i32* %1
%3 = add nsw i32 %2, 1
store i32 %3, i32* %1
ret i32 1
}

LLVM IR (-O2):
define i32 @f6() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ squeeze(char *, char *);
int main() {
  char s1[6] = {'t', 'e', 's', 't', 'i', '\0'};
  char s2[4] = {'t', 'e', '\0'};
  squeeze(s1, s2);
  printf("%s\n", s1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xec5(%rip),%ax
mov    %ax,-0x6(%rbp)
mov    0xec1(%rip),%eax
mov    %eax,-0xe(%rbp)
lea    -0xa(%rbp),%rdi
lea    -0xe(%rbp),%rsi
call   1030 <squeeze@plt>
lea    -0xa(%rbp),%rsi
lea    0xea2(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movw   $0x69,0xc(%rsp)
movl   $0x74736574,0x8(%rsp)
74
movl   $0x6574,0x4(%rsp)
lea    0x8(%rsp),%rbx
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <squeeze@plt>
lea    0xeb1(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.s1 = [6 x i8] c"testi\00"
@__const.main.s2 = [4 x i8] c"te\00\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i8]
%3 = alloca [4 x i8]
store i32 0, i32* %1
%4 = bitcast [6 x i8]* %2 to i8*
%5 = bitcast [4 x i8]* %3 to i8*
%6 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%8 = call i32 @squeeze(i8* %6, i8* %7)
%9 = getelementptr inbounds [6 x i8], [6 x i8]* %2, 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):
@__const.main.s1 = [6 x i8] c"testi\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%4 = bitcast i32* %2 to i8*
store i32 25972, i32* %2
%5 = call i32 @squeeze(i8* %3, i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
unsigned int _uiMagTest(void) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @_uiMagTest() {
ret i32 0
}
void lower(char *str) {
  int i = 0;
  while (str[i] != '\0') {
    if (str[i] >= 'A' && str[i] <= 'Z')
      str[i] += 'a' - 'A';
    i += 1;
  }
}


x86 assembly (clang, -O0):
<lower>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     116e <lower+0x6e>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x41,%eax
jl     1160 <lower+0x60>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5a,%eax
jg     1160 <lower+0x60>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edx
add    $0x20,%edx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <lower+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lower>:
mov    (%rdi),%al
test   %al,%al
je     112a <lower+0x2a>
add    $0x1,%rdi
jmp    111b <lower+0x1b>
nopl   0x0(%rax)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     112a <lower+0x2a>
lea    -0x41(%rax),%ecx
cmp    $0x19,%cl
ja     1110 <lower+0x10>
add    $0x20,%al
mov    %al,-0x1(%rdi)
jmp    1110 <lower+0x10>
ret

LLVM IR (-O0):
define void @lower(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %37, %1
%5 = load i8*, i8** %2
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %40
12: ; preds = %4
%13 = load i8*, i8** %2
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp sge i32 %18, 65
br i1 %19, label %20, label %37
20: ; preds = %12
%21 = load i8*, i8** %2
%22 = load i32, i32* %3
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %21, i64 %23
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = icmp sle i32 %26, 90
br i1 %27, label %28, label %37
28: ; preds = %20
%29 = load i8*, i8** %2
%30 = load i32, i32* %3
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i8, i8* %29, i64 %31
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
%35 = add nsw i32 %34, 32
%36 = trunc i32 %35 to i8
store i8 %36, i8* %32
br label %37
37: ; preds = %28, %20, %12
%38 = load i32, i32* %3
%39 = add nsw i32 %38, 1
store i32 %39, i32* %3
br label %4
40: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @lower(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %17, label %4
4: ; preds = %1, %12
%5 = phi i64 [ %13, %12 ], [ 0, %1 ]
%6 = phi i8 [ %15, %12 ], [ %2, %1 ]
%7 = phi i8* [ %14, %12 ], [ %0, %1 ]
%8 = add i8 %6, -65
%9 = icmp ult i8 %8, 26
br i1 %9, label %10, label %12
10: ; preds = %4
%11 = add nuw nsw i8 %6, 32
store i8 %11, i8* %7
br label %12
12: ; preds = %10, %4
%13 = add nuw i64 %5, 1
%14 = getelementptr inbounds i8, i8* %0, i64 %13
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %4
17: ; preds = %12, %1
ret void
}
char *langRomTypeMatsushitaSram() { return "Matsushita SRAM"; }


x86 assembly (clang, -O0):
<langRomTypeMatsushitaSram>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<langRomTypeMatsushitaSram>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Matsushita SRAM\00"
define i8* @langRomTypeMatsushitaSram() {
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [16 x i8] c"Matsushita SRAM\00"
define i8* @langRomTypeMatsushitaSram() {
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0)
}
int f3(int x) { return -x; }


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

x86 assembly (clang, -O2):
<f3>:
mov    %edi,%eax
neg    %eax
ret

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

LLVM IR (-O2):
define i32 @f3(i32 %0) {
%2 = sub nsw i32 0, %0
ret i32 %2
}
/* Variables and functions */
char *strchr(char *, char);
int count_lines(char *text) {
  int count = 1;
  while ((text = strchr(text, '\n')))
    text++, count++;
  return count;
}


x86 assembly (clang, -O0):
<count_lines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
je     1159 <count_lines+0x49>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <count_lines+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_lines>:
push   %rbx
mov    $0xa,%esi
call   1030 <strchr@plt>
mov    $0x1,%ebx
test   %rax,%rax
je     1149 <count_lines+0x39>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rax
add    $0x1,%ebx
mov    %rax,%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
test   %rax,%rax
jne    1130 <count_lines+0x20>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @count_lines(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 10)
%3 = icmp eq i8* %2, null
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %9, %4 ], [ %2, %1 ]
%6 = phi i32 [ %8, %4 ], [ 1, %1 ]
%7 = getelementptr inbounds i8, i8* %5, i64 1
%8 = add nuw nsw i32 %6, 1
%9 = tail call i8* @strchr(i8* dereferenceable(1) %7, i8 signext 10)
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 1, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x23() {
  Assert_real((isupper(35) == 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_isupper.c",
              180, ("isupper should be 0 for #"));
}


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

x86 assembly (clang, -O2):
<t_isupper_0x23>:
push   %rax
mov    $0x23,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0xb4,%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_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 0 for #\00"
define void @t_isupper_0x23() {
%1 = call i64 @isupper(i32 35)
%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 180, i8* getelementptr inbounds ([26 x i8], [26 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_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 0 for #\00"
define void @t_isupper_0x23() {
%1 = tail call i64 @isupper(i32 35)
%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 180, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void smp_rmb(void) { __asm__ __volatile__("" : : : "memory"); }


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

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

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

LLVM IR (-O2):
define void @smp_rmb() {
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_error_set_const(void *e, const char *name, const char *message) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_error_set_const>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
mov    0x2ec7(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_error_set_const(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* @EINVAL
%8 = sub nsw i32 0, %7
ret i32 %8
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_error_set_const(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = load i32, i32* @EINVAL
%5 = sub nsw i32 0, %4
ret i32 %5
}