xunge/DecIR huggingface dataset:
int jpeg_quality_scaling(int quality) {
  if (quality <= 0) {
    quality = 1;
  }
  if (quality > 100) {
    quality = 100;
  }
  if (quality < 50) {
    quality = 5000 / quality;
  } else {
    quality = 200 - quality * 2;
  }
  return quality;
}


x86 assembly (clang, -O0):
<jpeg_quality_scaling>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jg     1118 <jpeg_quality_scaling+0x18>
movl   $0x1,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jle    1129 <jpeg_quality_scaling+0x29>
movl   $0x64,-0x4(%rbp)
cmpl   $0x32,-0x4(%rbp)
jge    1144 <jpeg_quality_scaling+0x44>
mov    $0x1388,%eax
cltd
idivl  -0x4(%rbp)
mov    %eax,-0x4(%rbp)
jmp    1154 <jpeg_quality_scaling+0x54>
mov    -0x4(%rbp),%ecx
shl    $0x1,%ecx
mov    $0xc8,%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jpeg_quality_scaling>:
test   %edi,%edi
mov    $0x1,%eax
cmovg  %edi,%eax
cmp    $0x64,%eax
mov    $0x64,%ecx
cmovb  %eax,%ecx
cmp    $0x31,%ecx
ja     1127 <jpeg_quality_scaling+0x27>
mov    $0x1388,%ax
xor    %edx,%edx
div    %cx
movzwl %ax,%eax
ret
add    %ecx,%ecx
mov    $0xc8,%eax
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @jpeg_quality_scaling(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
store i32 1, i32* %2
br label %6
6: ; preds = %5, %1
%7 = load i32, i32* %2
%8 = icmp sgt i32 %7, 100
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 100, i32* %2
br label %10
10: ; preds = %9, %6
%11 = load i32, i32* %2
%12 = icmp slt i32 %11, 50
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i32, i32* %2
%15 = sdiv i32 5000, %14
store i32 %15, i32* %2
br label %20
16: ; preds = %10
%17 = load i32, i32* %2
%18 = mul nsw i32 %17, 2
%19 = sub nsw i32 200, %18
store i32 %19, i32* %2
br label %20
20: ; preds = %16, %13
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @jpeg_quality_scaling(i32 %0) {
%2 = icmp sgt i32 %0, 1
%3 = select i1 %2, i32 %0, i32 1
%4 = icmp ult i32 %3, 100
%5 = select i1 %4, i32 %3, i32 100
%6 = icmp ult i32 %5, 50
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = trunc i32 %5 to i16
%9 = udiv i16 5000, %8
%10 = zext i16 %9 to i32
br label %14
11: ; preds = %1
%12 = mul nsw i32 %5, -2
%13 = add nsw i32 %12, 200
br label %14
14: ; preds = %11, %7
%15 = phi i32 [ %10, %7 ], [ %13, %11 ]
ret i32 %15
}
int omap_voltage_register_pmic(struct voltagedomain *voltdm,
                               struct omap_volt_pmic_info *pmic_info) {}


x86 assembly (clang, -O0):
<omap_voltage_register_pmic>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.voltagedomain = type opaque
%struct.omap_volt_pmic_info = type opaque
define i32 @omap_voltage_register_pmic(%struct.voltagedomain* %0, %struct.omap_volt_pmic_info* %1) {
%3 = alloca i32
%4 = alloca %struct.voltagedomain*
%5 = alloca %struct.omap_volt_pmic_info*
store %struct.voltagedomain* %0, %struct.voltagedomain** %4
store %struct.omap_volt_pmic_info* %1, %struct.omap_volt_pmic_info** %5
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
%struct.voltagedomain = type opaque
%struct.omap_volt_pmic_info = type opaque
define i32 @omap_voltage_register_pmic(%struct.voltagedomain* nocapture readnone %0, %struct.omap_volt_pmic_info* nocapture readnone %1) {
ret i32 undef
}
int Tcl_ConvertElement(src, dst, flags) const char *src;
char *dst;
int flags;
{ return Tcl_ConvertCountedElement(src, -1, dst, flags); }


x86 assembly (clang, -O0):
<Tcl_ConvertElement>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0xffffffff,%esi
mov    $0x0,%al
call   1030 <Tcl_ConvertCountedElement@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Tcl_ConvertElement>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    $0xffffffff,%esi
xor    %eax,%eax
jmp    1030 <Tcl_ConvertCountedElement@plt>

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

LLVM IR (-O2):
define i32 @Tcl_ConvertElement(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 (i8*, i32, i8*, i32, ...) bitcast (i32 (...)* @Tcl_ConvertCountedElement to i32 (i8*, i32, i8*, i32, ...)*)(i8* %0, i32 -1, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
unsigned char *base64ntostr(char const *, int *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
unsigned char *base64tostr(const char *in_string, int *opt_len) {
  return base64ntostr(in_string, opt_len, strlen(in_string));
}


x86 assembly (clang, -O0):
<base64tostr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <base64ntostr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<base64tostr>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <base64ntostr@plt>

LLVM IR (-O0):
define i8* @base64tostr(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i8*, i8** %3
%6 = load i32*, i32** %4
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = call i8* @base64ntostr(i8* %5, i32* %6, i32 %8)
ret i8* %9
}

LLVM IR (-O2):
define i8* @base64tostr(i8* %0, i32* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i8* @base64ntostr(i8* %0, i32* %1, i32 %3)
ret i8* %4
}
void dladdr1(void) {}


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

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

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

LLVM IR (-O2):
define void @dladdr1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
int puts(const char *s) {
  while (*s) {
    putchar(*s++);
  }
  putchar('\n');
  return 1;
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <puts+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <putchar@plt>
jmp    111c <puts+0xc>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = tail call i32 @putchar(i8 signext %5)
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = tail call i32 @putchar(i8 signext 10)
ret i32 1
}
/* Type definitions */
typedef unsigned long long uint64_t;

/* Variables and functions */
int count_bits(unsigned long long);
int count_bits_above(uint64_t cstring, const int i) {
  cstring &= ~((2ull << i) - 1);
  return count_bits(cstring);
}


x86 assembly (clang, -O0):
<count_bits_above>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
mov    $0x2,%eax
shl    %cl,%rax
sub    $0x1,%rax
xor    $0xffffffffffffffff,%rax
and    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <count_bits@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_bits_above>:
mov    %esi,%ecx
mov    $0xfffffffffffffffe,%rax
shl    %cl,%rax
and    %rax,%rdi
jmp    1030 <count_bits@plt>

LLVM IR (-O0):
define i32 @count_bits_above(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = zext i32 %5 to i64
%7 = shl i64 2, %6
%8 = sub i64 %7, 1
%9 = xor i64 %8, -1
%10 = load i64, i64* %3
%11 = and i64 %10, %9
store i64 %11, i64* %3
%12 = load i64, i64* %3
%13 = call i32 @count_bits(i64 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @count_bits_above(i64 %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = shl i64 -2, %3
%5 = and i64 %4, %0
%6 = tail call i32 @count_bits(i64 %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void print_usage(char *cmd) {
  fprintf(
      stderr,
      "%s [-p workers] #files file_size random_size_multiplier output_dir\n",
      cmd);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [68 x i8] c"%s [-p workers] #files file_size random_size_multiplier output_dir\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [68 x i8] c"%s [-p workers] #files file_size random_size_multiplier output_dir\0A\00"
define void @print_usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OpcodeNotDone();
void initv(void) { OpcodeNotDone(); }


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

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

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

LLVM IR (-O2):
define void @initv() {
%1 = tail call i32 (...) @OpcodeNotDone()
ret void
}
void GB_PLUS_f_FP64(double *z, const double *x, const double *y) {
  (*z) = (*x) + (*y);
}


x86 assembly (clang, -O0):
<GB_PLUS_f_FP64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
addsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GB_PLUS_f_FP64>:
movsd  (%rsi),%xmm0
addsd  (%rdx),%xmm0
movsd  %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @GB_PLUS_f_FP64(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double*, double** %5
%8 = load double, double* %7
%9 = load double*, double** %6
%10 = load double, double* %9
%11 = fadd double %8, %10
%12 = load double*, double** %4
store double %11, double* %12
ret void
}

LLVM IR (-O2):
define void @GB_PLUS_f_FP64(double* nocapture writeonly %0, double* nocapture %1, double* nocapture %2) {
%4 = load double, double* %1
%5 = load double, double* %2
%6 = fadd double %4, %5
store double %6, double* %0
ret void
}
const char *ConvertPUID(char id) {
  switch (id) {
  case 1:
    return "Light 1";
  case 2:
    return "Light 2";
  case 3:
    return "Receptacle";
  }
  return "Unknown";
}


x86 assembly (clang, -O0):
<ConvertPUID>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x1,%eax
je     1141 <ConvertPUID+0x41>
jmp    111f <ConvertPUID+0x1f>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     1151 <ConvertPUID+0x51>
jmp    1130 <ConvertPUID+0x30>
mov    -0x10(%rbp),%eax
sub    $0x3,%eax
je     1161 <ConvertPUID+0x61>
jmp    1171 <ConvertPUID+0x71>
lea    0xeb8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    117c <ConvertPUID+0x7c>
lea    0xeb0(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    117c <ConvertPUID+0x7c>
lea    0xea8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    117c <ConvertPUID+0x7c>
lea    0xea3(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ConvertPUID>:
add    $0xffffffff,%edi
cmp    $0x2,%edi
ja     111a <ConvertPUID+0x1a>
movslq %edi,%rax
lea    0xf12(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret
lea    0xefa(%rip),%rax
ret

LLVM IR (-O0):
@.str = [8 x i8] c"Light 1\00"
@.str.1 = [8 x i8] c"Light 2\00"
@.str.2 = [11 x i8] c"Receptacle\00"
@.str.3 = [8 x i8] c"Unknown\00"
define i8* @ConvertPUID(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
switch i32 %5, label %9 [
i32 1, label %6
i32 2, label %7
i32 3, label %8
]
6: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %2
br label %10
7: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %10
8: ; preds = %1
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %10
9: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %10
10: ; preds = %9, %8, %7, %6
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
@.str = [8 x i8] c"Light 1\00"
@.str.1 = [8 x i8] c"Light 2\00"
@.str.2 = [11 x i8] c"Receptacle\00"
@.str.3 = [8 x i8] c"Unknown\00"
@reltable.ConvertPUID = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str to i64), i64 ptrtoint ([3 x i32]* @reltable.ConvertPUID to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.1 to i64), i64 ptrtoint ([3 x i32]* @reltable.ConvertPUID to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @.str.2 to i64), i64 ptrtoint ([3 x i32]* @reltable.ConvertPUID to i64)) to i32)]
define i8* @ConvertPUID(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -1
%4 = icmp ult i32 %3, 3
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = sext i32 %3 to i64
%7 = shl i64 %6, 2
%8 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.ConvertPUID to i8*), i64 %7)
br label %9
9: ; preds = %1, %5
%10 = phi i8* [ %8, %5 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), %1 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char const *);
void PrintF(const char *c) { printf(c); }


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

x86 assembly (clang, -O2):
<PrintF>:
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
define void @PrintF(i8* nocapture %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void closePipes(int aPipes[]) {
  int i;
  for (i = 0; i < 3; i++)
    close(aPipes[i]);
}


x86 assembly (clang, -O0):
<closePipes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jge    114b <closePipes+0x3b>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1030 <close@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <closePipes+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<closePipes>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1030 <close@plt>
mov    0x4(%rbx),%edi
call   1030 <close@plt>
mov    0x8(%rbx),%edi
pop    %rbx
jmp    1030 <close@plt>

LLVM IR (-O0):
define void @closePipes(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
br label %4
4: ; preds = %14, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 3
br i1 %6, label %7, label %17
7: ; preds = %4
%8 = load i32*, i32** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
%13 = call i32 @close(i32 %12)
br label %14
14: ; preds = %7
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %4
17: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @closePipes(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @close(i32 %2)
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = tail call i32 @close(i32 %5)
%7 = getelementptr inbounds i32, i32* %0, i64 2
%8 = load i32, i32* %7
%9 = tail call i32 @close(i32 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SendChar(int);
void _ttywrch(int ch) {
  SendChar(ch);
  return;
}


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

x86 assembly (clang, -O2):
<_ttywrch>:
jmp    1030 <SendChar@plt>

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

LLVM IR (-O2):
define void @_ttywrch(i32 %0) {
%2 = tail call i32 @SendChar(i32 %0)
ret void
}
unsigned long int float_to_f(unsigned long int recv) { return recv; }


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

x86 assembly (clang, -O2):
<float_to_f>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @float_to_f(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
ret i64 %3
}

LLVM IR (-O2):
define i64 @float_to_f(i64 returned %0) {
ret i64 %0
}
/* Variables and functions */
int /*<<< orphan*/ fn00001394();
void fn000013AC() {
  fn00001394();
  fn00001394();
  fn00001394();
  fn00001394();
  fn00001394();
  fn00001394();
  fn00001394();
  fn00001394();
  fn00001394();
  fn00001394();
  return;
}


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

x86 assembly (clang, -O2):
push   %rax
xor    %eax,%eax
call   1030 <fn00001394@plt>
xor    %eax,%eax
call   1030 <fn00001394@plt>
xor    %eax,%eax
call   1030 <fn00001394@plt>
xor    %eax,%eax
call   1030 <fn00001394@plt>
xor    %eax,%eax
call   1030 <fn00001394@plt>
xor    %eax,%eax
call   1030 <fn00001394@plt>
xor    %eax,%eax
call   1030 <fn00001394@plt>
xor    %eax,%eax
call   1030 <fn00001394@plt>
xor    %eax,%eax
call   1030 <fn00001394@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <fn00001394@plt>

LLVM IR (-O0):
define void @fn000013AC() {
%1 = call i32 (...) @fn00001394()
%2 = call i32 (...) @fn00001394()
%3 = call i32 (...) @fn00001394()
%4 = call i32 (...) @fn00001394()
%5 = call i32 (...) @fn00001394()
%6 = call i32 (...) @fn00001394()
%7 = call i32 (...) @fn00001394()
%8 = call i32 (...) @fn00001394()
%9 = call i32 (...) @fn00001394()
%10 = call i32 (...) @fn00001394()
ret void
}

LLVM IR (-O2):
define void @fn000013AC() {
%1 = tail call i32 (...) @fn00001394()
%2 = tail call i32 (...) @fn00001394()
%3 = tail call i32 (...) @fn00001394()
%4 = tail call i32 (...) @fn00001394()
%5 = tail call i32 (...) @fn00001394()
%6 = tail call i32 (...) @fn00001394()
%7 = tail call i32 (...) @fn00001394()
%8 = tail call i32 (...) @fn00001394()
%9 = tail call i32 (...) @fn00001394()
%10 = tail call i32 (...) @fn00001394()
ret void
}
/* Variables and functions */
scalar_t__ strncmp(char *, char *, int);
int is_empty_line(char *c) {
  return strncmp(c, "\r\n\r\n", 4) == 0 || strncmp(c, "\n\n", 2) == 0;
}


x86 assembly (clang, -O0):
<is_empty_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     1162 <is_empty_line+0x52>
mov    -0x8(%rbp),%rdi
lea    0xeb7(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_empty_line>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     114b <is_empty_line+0x3b>
lea    0xed4(%rip),%rsi
mov    %rbx,%rdi
mov    $0x2,%edx
call   1030 <strncmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"\0D\0A\0D\0A\00"
@.str.1 = [3 x i8] c"\0A\0A\00"
define i32 @is_empty_line(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strncmp(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%5 = icmp eq i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i64 @strncmp(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 2)
%9 = icmp eq i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@.str = [5 x i8] c"\0D\0A\0D\0A\00"
@.str.1 = [3 x i8] c"\0A\0A\00"
define i32 @is_empty_line(i8* %0) {
%2 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 2)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0xed() {
  Assert_real((iscntrl(237) == 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_iscntrl.c",
              1190, ("iscntrl should be 0 for 0xed"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0xed>:
push   %rax
mov    $0xed,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4a6,%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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xed\00"
define void @t_iscntrl_0xed() {
%1 = call i64 @iscntrl(i32 237)
%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 1190, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xed\00"
define void @t_iscntrl_0xed() {
%1 = tail call i64 @iscntrl(i32 237)
%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 1190, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test1(int);
int /*<<< orphan*/ test2(int);
int /*<<< orphan*/ test3();
int /*<<< orphan*/ test4();
int /*<<< orphan*/ test5();
int /*<<< orphan*/ test6();
int main(void) {
  test1(42);
  test2(42);
  test3();
  test4();
  test5();
  test6();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2a,%edi
call   1050 <test1@plt>
mov    $0x2a,%edi
call   1080 <test2@plt>
mov    $0x0,%al
call   1040 <test3@plt>
mov    $0x0,%al
call   1070 <test4@plt>
mov    $0x0,%al
call   1030 <test5@plt>
mov    $0x0,%al
call   1060 <test6@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2a,%edi
call   1050 <test1@plt>
mov    $0x2a,%edi
call   1080 <test2@plt>
xor    %eax,%eax
call   1040 <test3@plt>
xor    %eax,%eax
call   1070 <test4@plt>
xor    %eax,%eax
call   1030 <test5@plt>
xor    %eax,%eax
call   1060 <test6@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @test1(i32 42)
%3 = call i32 @test2(i32 42)
%4 = call i32 (...) @test3()
%5 = call i32 (...) @test4()
%6 = call i32 (...) @test5()
%7 = call i32 (...) @test6()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test1(i32 42)
%2 = tail call i32 @test2(i32 42)
%3 = tail call i32 (...) @test3()
%4 = tail call i32 (...) @test4()
%5 = tail call i32 (...) @test5()
%6 = tail call i32 (...) @test6()
ret i32 0
}
/* Variables and functions */
double FastInvSqrt(int);
int /*<<< orphan*/ mt_bestseed();
int /*<<< orphan*/ printf(char *, double);
int rand();
void main() {
  mt_bestseed();
  int r = rand() % 100;
  printf("random number %d \n", r);
  printf("And it's inverse root%f\n", FastInvSqrt(r));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <mt_bestseed@plt>
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <FastInvSqrt@plt>
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <mt_bestseed@plt>
xor    %eax,%eax
call   1060 <rand@plt>
movslq %eax,%rbx
imul   $0x51eb851f,%rbx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
imul   $0x64,%eax,%eax
sub    %eax,%ebx
cvtsi2sd %ebx,%xmm0
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <FastInvSqrt@plt>
lea    0xe8a(%rip),%rdi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"random number %d \0A\00"
@.str.1 = [25 x i8] c"And it's inverse root%f\0A\00"
define void @main() {
%1 = alloca i32
%2 = call i32 (...) @mt_bestseed()
%3 = call i32 (...) @rand()
%4 = srem i32 %3, 100
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = sitofp i32 %5 to double
%7 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), double %6)
%8 = load i32, i32* %1
%9 = call double @FastInvSqrt(i32 %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), double %9)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"random number %d \0A\00"
@.str.1 = [25 x i8] c"And it's inverse root%f\0A\00"
define void @main() {
%1 = tail call i32 (...) @mt_bestseed()
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, 100
%4 = sitofp i32 %3 to double
%5 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), double %4)
%6 = tail call double @FastInvSqrt(i32 %3)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), double %6)
ret void
}
/* Variables and functions */
scalar_t__ parseInt(char *, int);
char *stringToInt(scalar_t__);
char *wum_sub(char *a, char *b) {
  return stringToInt((parseInt(a, 10) - parseInt(b, 10)));
}


x86 assembly (clang, -O0):
<wum_sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1030 <parseInt@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1030 <parseInt@plt>
mov    -0x18(%rbp),%rdi
sub    %rax,%rdi
call   1040 <stringToInt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wum_sub>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    $0xa,%esi
call   1030 <parseInt@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    $0xa,%esi
call   1030 <parseInt@plt>
sub    %rax,%rbx
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <stringToInt@plt>

LLVM IR (-O0):
define i8* @wum_sub(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 = call i64 @parseInt(i8* %5, i32 10)
%7 = load i8*, i8** %4
%8 = call i64 @parseInt(i8* %7, i32 10)
%9 = sub nsw i64 %6, %8
%10 = call i8* @stringToInt(i64 %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @wum_sub(i8* %0, i8* %1) {
%3 = tail call i64 @parseInt(i8* %0, i32 10)
%4 = tail call i64 @parseInt(i8* %1, i32 10)
%5 = sub nsw i64 %3, %4
%6 = tail call i8* @stringToInt(i64 %5)
ret i8* %6
}
int len(int a[]) {
  int i = 0;
  while (a[i] != '\0') {
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     112f <len+0x2f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <len+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<len>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpl   $0x0,(%rdi)
lea    0x4(%rdi),%rdi
jne    1110 <len+0x10>
ret

LLVM IR (-O0):
define i32 @len(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** %2
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = load i32, i32* %8
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %4
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %4
14: ; preds = %4
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @len(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
void sig_pipe(int signum) { printf("%s: catched the SIGPIPE\n", __func__); }


x86 assembly (clang, -O0):
<sig_pipe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
lea    0xef0(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_pipe>:
lea    0xee9(%rip),%rdi
lea    0xefb(%rip),%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"%s: catched the SIGPIPE\0A\00"
@__func__.sig_pipe = [9 x i8] c"sig_pipe\00"
define void @sig_pipe(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__func__.sig_pipe, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"%s: catched the SIGPIPE\0A\00"
@__func__.sig_pipe = [9 x i8] c"sig_pipe\00"
define void @sig_pipe(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__func__.sig_pipe, i64 0, i64 0))
ret void
}
/* Variables and functions */
int _gdbio_close_r(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ errno;
int gdbio_close(int fd) { return _gdbio_close_r(&errno, fd); }


x86 assembly (clang, -O0):
<gdbio_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    0x2ebb(%rip),%rdi
call   1030 <_gdbio_close_r@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdbio_close>:
mov    %edi,%esi
mov    0x2ec7(%rip),%rdi
jmp    1030 <_gdbio_close_r@plt>

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

LLVM IR (-O2):
@errno = global i32 0
define i32 @gdbio_close(i32 %0) {
%2 = tail call i32 @_gdbio_close_r(i32* @errno, i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ fexpect(char *, int, int /*<<< orphan*/, int);
void t7() {
  int a;
  int *p1 = &a + 1;
  int *p2 = 1 + &a;
  fexpect("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/input/8cc/"
          "pointer.c",
          53, 0, p1 - p2);
  ;
}


x86 assembly (clang, -O0):
<t7>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x4(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
lea    -0x4(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    %rcx,%rax
sar    $0x2,%rax
mov    %eax,%ecx
lea    0xeb8(%rip),%rdi
mov    $0x35,%esi
xor    %edx,%edx
call   1030 <fexpect@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t7>:
lea    0xee9(%rip),%rdi
mov    $0x35,%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <fexpect@plt>

LLVM IR (-O0):
@.str = [140 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/input/8cc/pointer.c\00"
define void @t7() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = getelementptr inbounds i32, i32* %1, i64 1
store i32* %4, i32** %2
%5 = getelementptr inbounds i32, i32* %1, i64 1
store i32* %5, i32** %3
%6 = load i32*, i32** %2
%7 = load i32*, i32** %3
%8 = ptrtoint i32* %6 to i64
%9 = ptrtoint i32* %7 to i64
%10 = sub i64 %8, %9
%11 = sdiv exact i64 %10, 4
%12 = trunc i64 %11 to i32
%13 = call i32 @fexpect(i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str, i64 0, i64 0), i32 53, i32 0, i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [140 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/input/8cc/pointer.c\00"
define void @t7() {
%1 = tail call i32 @fexpect(i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str, i64 0, i64 0), i32 53, i32 0, i32 0)
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x;
  x = __VERIFIER_nondet_int();
  while (x >= 0) {
    x = -2 * x + 10;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1145 <main+0x35>
imul   $0xfffffffe,-0x8(%rbp),%eax
add    $0xa,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <main+0x19>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
int minimo(int x, int y) {
  if (x < y)
    return x;
  else
    return y;
}


x86 assembly (clang, -O0):
<minimo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1121 <minimo+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <minimo+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<minimo>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @minimo(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ ol(char *);
m_dec() { ol("DEC  AX"); }


x86 assembly (clang, -O0):
<m_dec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <ol@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [8 x i8] c"DEC AX\00"
define i32 @m_dec() {
%1 = alloca i32
%2 = call i32 @ol(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [8 x i8] c"DEC AX\00"
define i32 @m_dec() {
%1 = tail call i32 @ol(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
char DOS_convert_path_char(char byte) {
  if (byte == '/')
    return ('\\');
  if (byte == '\\')
    return ('/');
  return (byte);
}


x86 assembly (clang, -O0):
<DOS_convert_path_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x2f,%eax
jne    1120 <DOS_convert_path_char+0x20>
movb   $0x5c,-0x1(%rbp)
jmp    113c <DOS_convert_path_char+0x3c>
movsbl -0x2(%rbp),%eax
cmp    $0x5c,%eax
jne    1136 <DOS_convert_path_char+0x36>
movb   $0x2f,-0x1(%rbp)
jmp    113c <DOS_convert_path_char+0x3c>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<DOS_convert_path_char>:
mov    %edi,%eax
cmp    $0x2f,%al
je     110d <DOS_convert_path_char+0xd>
cmp    $0x5c,%al
jne    110c <DOS_convert_path_char+0xc>
mov    $0x2f,%al
ret
mov    $0x5c,%al
ret

LLVM IR (-O0):
define signext i8 @DOS_convert_path_char(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 eq i32 %5, 47
br i1 %6, label %7, label %8
7: ; preds = %1
store i8 92, i8* %2
br label %15
8: ; preds = %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 92
br i1 %11, label %12, label %13
12: ; preds = %8
store i8 47, i8* %2
br label %15
13: ; preds = %8
%14 = load i8, i8* %3
store i8 %14, i8* %2
br label %15
15: ; preds = %13, %12, %7
%16 = load i8, i8* %2
ret i8 %16
}

LLVM IR (-O2):
define signext i8 @DOS_convert_path_char(i8 signext %0) {
switch i8 %0, label %3 [
i8 47, label %4
i8 92, label %2
]
2: ; preds = %1
br label %4
3: ; preds = %1
br label %4
4: ; preds = %1, %3, %2
%5 = phi i8 [ 47, %2 ], [ %0, %3 ], [ 92, %1 ]
ret i8 %5
}
/* Type definitions */
struct in_addr {
  int dummy;
};

/* Variables and functions */
char *inet_ntoa(struct in_addr const);
int /*<<< orphan*/ strcpy(char *, char const *);
const char *inet_ntoa_r(const struct in_addr in, char *buf) {
  const char *tmp = inet_ntoa(in);
  strcpy(buf, tmp);
  return buf;
}


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

x86 assembly (clang, -O2):
<inet_ntoa_r>:
push   %rbx
mov    %rsi,%rbx
call   1040 <inet_ntoa@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.in_addr = type { i32 }
define i8* @inet_ntoa_r(i32 %0, i8* %1) {
%3 = alloca %struct.in_addr
%4 = alloca i8*
%5 = alloca i8*
%6 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %3, i32 0, i32 0
store i32 %0, i32* %6
store i8* %1, i8** %4
%7 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %3, i32 0, i32 0
%8 = load i32, i32* %7
%9 = call i8* @inet_ntoa(i32 %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %4
%11 = load i8*, i8** %5
%12 = call i32 @strcpy(i8* %10, i8* %11)
%13 = load i8*, i8** %4
ret i8* %13
}

LLVM IR (-O2):
define i8* @inet_ntoa_r(i32 %0, i8* returned %1) {
%3 = tail call i8* @inet_ntoa(i32 %0)
%4 = tail call i32 @strcpy(i8* %1, i8* %3)
ret i8* %1
}
void XtAppSetTypeConverter() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ hd44780_ll_instruction_write(int);
int8_t hd44780_clear_display(void) {
  return (hd44780_ll_instruction_write(0x01));
}


x86 assembly (clang, -O0):
<hd44780_clear_display>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <hd44780_ll_instruction_write@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @hd44780_clear_display() {
%1 = call i32 @hd44780_ll_instruction_write(i32 1)
ret i32 %1
}

LLVM IR (-O2):
define i32 @hd44780_clear_display() {
%1 = tail call i32 @hd44780_ll_instruction_write(i32 1)
ret i32 %1
}
/* Variables and functions */
void *MAP_FAILED;
int /*<<< orphan*/ MAP_SHARED;
int /*<<< orphan*/ abort();
void *mmap(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/, int,
           int /*<<< orphan*/);
void *buffer_reader(int fd, int flags) {
  void *r;
  r = mmap(NULL, 4096, flags, MAP_SHARED, fd, 0);
  if (r == MAP_FAILED)
    abort();
  return r;
}


x86 assembly (clang, -O0):
<buffer_reader>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edx
mov    0x2eb8(%rip),%rax
mov    (%rax),%ecx
mov    -0x4(%rbp),%r8d
xor    %eax,%eax
mov    %eax,%edi
mov    $0x1000,%esi
xor    %r9d,%r9d
call   1040 <mmap@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2e7a(%rip),%rcx
cmp    (%rcx),%rax
jne    116e <buffer_reader+0x4e>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buffer_reader>:
push   %rax
mov    %esi,%edx
mov    %edi,%r8d
mov    0x2ec3(%rip),%rax
mov    (%rax),%ecx
xor    %edi,%edi
mov    $0x1000,%esi
xor    %r9d,%r9d
call   1040 <mmap@plt>
mov    0x2e93(%rip),%rcx
cmp    (%rcx),%rax
je     114c <buffer_reader+0x2c>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@MAP_SHARED = global i32 0
@MAP_FAILED = global i8* null
define i8* @buffer_reader(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = load i32, i32* @MAP_SHARED
%8 = load i32, i32* %3
%9 = call i8* @mmap(i32* null, i32 4096, i32 %6, i32 %7, i32 %8, i32 0)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = load i8*, i8** @MAP_FAILED
%12 = icmp eq i8* %10, %11
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = call i32 (...) @abort()
unreachable
15: ; preds = %2
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
@MAP_SHARED = global i32 0
@MAP_FAILED = global i8* null
define i8* @buffer_reader(i32 %0, i32 %1) {
%3 = load i32, i32* @MAP_SHARED
%4 = tail call i8* @mmap(i32* null, i32 4096, i32 %1, i32 %3, i32 %0, i32 0)
%5 = load i8*, i8** @MAP_FAILED
%6 = icmp eq i8* %4, %5
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 (...) @abort()
unreachable
9: ; preds = %2
ret i8* %4
}
/* Variables and functions */
int normalized_hex_string_length(char *);
int max_phrase_length(char hex_string[]) {
  int length = normalized_hex_string_length(hex_string);
  return (length / 4) * (11 + 1) - 1;
}


x86 assembly (clang, -O0):
<max_phrase_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <normalized_hex_string_length@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
imul   $0xc,%eax,%eax
sub    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_phrase_length>:
push   %rax
call   1030 <normalized_hex_string_length@plt>
lea    0x3(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
sar    $0x2,%ecx
lea    (%rcx,%rcx,2),%eax
lea    -0x1(,%rax,4),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @max_phrase_length(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @normalized_hex_string_length(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = sdiv i32 %6, 4
%8 = mul nsw i32 %7, 12
%9 = sub nsw i32 %8, 1
ret i32 %9
}

LLVM IR (-O2):
define i32 @max_phrase_length(i8* %0) {
%2 = tail call i32 @normalized_hex_string_length(i8* %0)
%3 = sdiv i32 %2, 4
%4 = mul nsw i32 %3, 12
%5 = add nsw i32 %4, -1
ret i32 %5
}