xunge/DecIR huggingface dataset:
int is_space_char(c)
char c;
{ return (c == '\n' || c == ' ' || c == '\t' || c == '\0'); }


x86 assembly (clang, -O0):
<is_space_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x2(%rbp)
je     114d <is_space_char+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     114d <is_space_char+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x2(%rbp)
je     114d <is_space_char+0x4d>
movsbl -0x1(%rbp),%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_space_char>:
shl    $0x18,%edi
mov    $0x1,%eax
cmp    $0x9000000,%edi
je     1127 <is_space_char+0x27>
cmp    $0xa000000,%edi
je     1127 <is_space_char+0x27>
cmp    $0x20000000,%edi
je     1127 <is_space_char+0x27>
xor    %eax,%eax
test   %edi,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @is_space_char(i32 %0) {
%2 = alloca i8
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 10
br i1 %6, label %19, label %7
7: ; preds = %1
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 32
br i1 %10, label %19, label %11
11: ; preds = %7
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 9
br i1 %14, label %19, label %15
15: ; preds = %11
%16 = load i8, i8* %2
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 0
br label %19
19: ; preds = %15, %11, %7, %1
%20 = phi i1 [ true, %11 ], [ true, %7 ], [ true, %1 ], [ %18, %15 ]
%21 = zext i1 %20 to i32
ret i32 %21
}

LLVM IR (-O2):
define i32 @is_space_char(i32 %0) {
%2 = shl i32 %0, 24
switch i32 %2, label %3 [
i32 536870912, label %6
i32 167772160, label %6
i32 150994944, label %6
]
3: ; preds = %1
%4 = icmp eq i32 %2, 0
%5 = zext i1 %4 to i32
br label %6
6: ; preds = %1, %1, %1, %3
%7 = phi i32 [ 1, %1 ], [ %5, %3 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %7
}
int zero_histogram(histogram, gray_levels)
int gray_levels;
unsigned long histogram[];
{
  int i;
  for (i = 0; i < gray_levels; i++)
    histogram[i] = 0;
  return (1);
}


x86 assembly (clang, -O0):
<zero_histogram>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113c <zero_histogram+0x3c>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <zero_histogram+0x12>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zero_histogram>:
test   %esi,%esi
jle    1126 <zero_histogram+0x16>
push   %rax
mov    %esi,%edx
shl    $0x3,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @zero_histogram(i64* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast i64* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 3
br label %8
8: ; preds = %4, %2
ret i32 1
}
/* Type definitions */
struct block {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct block *);
void block_delete(struct block *block) { free(block); }


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

LLVM IR (-O0):
%struct.block = type { i32 }
define void @block_delete(%struct.block* %0) {
%2 = alloca %struct.block*
store %struct.block* %0, %struct.block** %2
%3 = load %struct.block*, %struct.block** %2
%4 = call i32 @free(%struct.block* %3)
ret void
}

LLVM IR (-O2):
%struct.block = type { i32 }
define void @block_delete(%struct.block* nocapture %0) {
%2 = tail call i32 @free(%struct.block* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ WDT_BOD_DriverIRQHandler();
__attribute__((weak)) void WDT_BOD_IRQHandler(void) {
  WDT_BOD_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @WDT_BOD_IRQHandler() {
%1 = call i32 (...) @WDT_BOD_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @WDT_BOD_IRQHandler() {
%1 = tail call i32 (...) @WDT_BOD_DriverIRQHandler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ recursive(int *, int /*<<< orphan*/, int, int ***, int *,
                             int);
int **permuteUnique(int *nums, int numsSize, int *returnSize) {
  int **ret = NULL;
  *returnSize = 0;
  recursive(nums, 0, numsSize - 1, &ret, returnSize, numsSize);
  return ret;
}


x86 assembly (clang, -O0):
<permuteUnique>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
mov    -0x18(%rbp),%r8
mov    -0xc(%rbp),%r9d
xor    %esi,%esi
lea    -0x20(%rbp),%rcx
call   1030 <recursive@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<permuteUnique>:
push   %rax
mov    %rdx,%r8
mov    %esi,%r9d
movq   $0x0,(%rsp)
movl   $0x0,(%rdx)
lea    -0x1(%r9),%edx
mov    %rsp,%rcx
xor    %esi,%esi
call   1030 <recursive@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
define i32** @permuteUnique(i32* %0, i32 %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32**
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
store i32** null, i32*** %7
%8 = load i32*, i32** %6
store i32 0, i32* %8
%9 = load i32*, i32** %4
%10 = load i32, i32* %5
%11 = sub nsw i32 %10, 1
%12 = load i32*, i32** %6
%13 = load i32, i32* %5
%14 = call i32 @recursive(i32* %9, i32 0, i32 %11, i32*** %7, i32* %12, i32 %13)
%15 = load i32**, i32*** %7
ret i32** %15
}

LLVM IR (-O2):
define i32** @permuteUnique(i32* %0, i32 %1, i32* %2) {
%4 = alloca i32**
%5 = bitcast i32*** %4 to i8*
store i32** null, i32*** %4
store i32 0, i32* %2
%6 = add nsw i32 %1, -1
%7 = call i32 @recursive(i32* %0, i32 0, i32 %6, i32*** %4, i32* %2, i32 %1)
%8 = load i32**, i32*** %4
ret i32** %8
}
int compare_array(int *a, int *b, int len) {
  int i = 0;
  for (i = 0; i < len; i++) {
    if (a[i] != b[i]) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<compare_array>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1164 <compare_array+0x64>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x18(%rbp),%rcx
movslq -0x20(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
je     1151 <compare_array+0x51>
movl   $0x0,-0x4(%rbp)
jmp    116b <compare_array+0x6b>
jmp    1156 <compare_array+0x56>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    111d <compare_array+0x1d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_array>:
mov    $0x1,%eax
test   %edx,%edx
jle    1121 <compare_array+0x21>
mov    %edx,%r8d
xor    %edx,%edx
xchg   %ax,%ax
mov    (%rdi,%rdx,4),%ecx
cmp    (%rsi,%rdx,4),%ecx
jne    1122 <compare_array+0x22>
add    $0x1,%rdx
cmp    %rdx,%r8
jne    1110 <compare_array+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @compare_array(i32* nocapture %0, i32* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %16, %6
br i1 %8, label %17, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %16, %7 ]
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = getelementptr inbounds i32, i32* %1, i64 %10
%14 = load i32, i32* %13
%15 = icmp eq i32 %12, %14
%16 = add nuw nsw i64 %10, 1
br i1 %15, label %7, label %17
17: ; preds = %9, %7, %3
%18 = phi i32 [ 1, %3 ], [ 1, %7 ], [ 0, %9 ]
ret i32 %18
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ SIG_BLOCK;
int /*<<< orphan*/ sigfillset(int /*<<< orphan*/ *);
int /*<<< orphan*/ sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *);
void block_all_signals() {
  sigset_t mask;
  sigfillset(&mask);
  sigprocmask(SIG_BLOCK, &mask, NULL);
}


x86 assembly (clang, -O0):
<block_all_signals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1040 <sigfillset@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
lea    -0x4(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigprocmask@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<block_all_signals>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <sigfillset@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <sigprocmask@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@SIG_BLOCK = global i32 0
define void @block_all_signals() {
%1 = alloca i32
%2 = call i32 @sigfillset(i32* %1)
%3 = load i32, i32* @SIG_BLOCK
%4 = call i32 @sigprocmask(i32 %3, i32* %1, i32* null)
ret void
}

LLVM IR (-O2):
@SIG_BLOCK = global i32 0
define void @block_all_signals() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @sigfillset(i32* %1)
%4 = load i32, i32* @SIG_BLOCK
%5 = call i32 @sigprocmask(i32 %4, i32* %1, i32* null)
ret void
}
int f_i3(int i0, int i1, int i2) { return i2; }


x86 assembly (clang, -O0):
<f_i3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_i3>:
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @f_i3(i32 %0, i32 %1, i32 returned %2) {
ret i32 %2
}
/* Variables and functions */
double RAND_MAX;
scalar_t__ rand();
int getRandom(int a, int b) {
  return (int)((b - a) * ((double)rand() / RAND_MAX) + a);
}


x86 assembly (clang, -O0):
<getRandom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
movsd  -0x10(%rbp),%xmm0
cvtsi2sd %rax,%xmm2
mov    0x2ea3(%rip),%rax
divsd  (%rax),%xmm2
cvtsi2sdl -0x4(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRandom>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
sub    %edi,%esi
cvtsi2sd %esi,%xmm0
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
mov    0x2eaf(%rip),%rax
divsd  (%rax),%xmm0
cvtsi2sd %ebx,%xmm1
mulsd  0x8(%rsp),%xmm0
addsd  %xmm0,%xmm1
cvttsd2si %xmm1,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define i32 @getRandom(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = sub nsw i32 %5, %6
%8 = sitofp i32 %7 to double
%9 = call i64 (...) @rand()
%10 = sitofp i64 %9 to double
%11 = load double, double* @RAND_MAX
%12 = fdiv double %10, %11
%13 = load i32, i32* %3
%14 = sitofp i32 %13 to double
%15 = call double @llvm.fmuladd.f64(double %8, double %12, double %14)
%16 = fptosi double %15 to i32
ret i32 %16
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define i32 @getRandom(i32 %0, i32 %1) {
%3 = sub nsw i32 %1, %0
%4 = sitofp i32 %3 to double
%5 = tail call i64 (...) @rand()
%6 = sitofp i64 %5 to double
%7 = load double, double* @RAND_MAX
%8 = fdiv double %6, %7
%9 = sitofp i32 %0 to double
%10 = tail call double @llvm.fmuladd.f64(double %4, double %8, double %9)
%11 = fptosi double %10 to i32
ret i32 %11
}
int __attribute__((unused)) isprint(int c) {
  c &= 0x7f;
  return c >= 32 && c < 127;
}


x86 assembly (clang, -O0):
<isprint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7f,%eax
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1129 <isprint+0x29>
cmpl   $0x7f,-0x4(%rbp)
setl   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprint>:
and    $0x7f,%edi
cmp    $0x20,%edi
setae  %al
cmp    $0x7f,%edi
setne  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isprint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 127
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp sge i32 %5, 32
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 127
br label %10
10: ; preds = %7, %1
%11 = phi i1 [ false, %1 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isprint(i32 %0) {
%2 = and i32 %0, 127
%3 = icmp ugt i32 %2, 31
%4 = icmp ne i32 %2, 127
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x3f() {
  Assert_real((isodigit(63) == 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_isodigit.c",
              320, ("isodigit should be 0 for ?"));
}


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

x86 assembly (clang, -O2):
<t_isodigit_0x3f>:
push   %rax
mov    $0x3f,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x140,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

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

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 0 for ?\00"
define void @t_isodigit_0x3f() {
%1 = tail call i64 @isodigit(i32 63)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 320, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int ft_isalpha(int);
int ft_isdigit(int);
int ft_isalnum(int c) {
  if (ft_isdigit(c) == 1 || ft_isalpha(c) == 1)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<ft_isalnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <ft_isdigit@plt>
cmp    $0x1,%eax
je     114d <ft_isalnum+0x2d>
mov    -0x8(%rbp),%edi
call   1040 <ft_isalpha@plt>
cmp    $0x1,%eax
jne    1159 <ft_isalnum+0x39>
movl   $0x1,-0x4(%rbp)
jmp    1160 <ft_isalnum+0x40>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isalnum>:
push   %rbx
mov    %edi,%ebx
call   1030 <ft_isdigit@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0x1,%ecx
je     1145 <ft_isalnum+0x25>
mov    %ebx,%edi
call   1040 <ft_isalpha@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
sete   %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @ft_isalnum(i32 %0) {
%2 = tail call i32 @ft_isdigit(i32 %0)
%3 = icmp eq i32 %2, 1
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @ft_isalpha(i32 %0)
%6 = icmp eq i32 %5, 1
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
void XSetWindowBorder() {}


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

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

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

LLVM IR (-O2):
define void @XSetWindowBorder() {
ret void
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ printf(char *, size_t);
void *our_malloc(size_t size) {
  printf("ALLOC %d bytes\n", size);
  return malloc(size);
}


x86 assembly (clang, -O0):
<our_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<our_malloc>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <malloc@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"ALLOC %d bytes\0A\00"
define i8* @our_malloc(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i64 %3)
%5 = load i64, i64* %2
%6 = call i8* @malloc(i64 %5)
ret i8* %6
}

LLVM IR (-O2):
@.str = [16 x i8] c"ALLOC %d bytes\0A\00"
define noalias i8* @our_malloc(i64 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i64 %0)
%3 = tail call i8* @malloc(i64 %0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printErr(char const *);
void rp_fatal(char const *str) {
  printErr(str);
  exit(1);
}


x86 assembly (clang, -O0):
<rp_fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <printErr@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<rp_fatal>:
push   %rax
call   1030 <printErr@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @rp_fatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printErr(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @rp_fatal(i8* %0) {
%2 = tail call i32 @printErr(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ __svgalib_driver8p_putbox(int, int, int, int, void *, int);
void __svgalib_driver8p_putboxpart(int x, int y, int w, int h, int ow, int oh,
                                   void *b, int xo, int yo) {
  __svgalib_driver8p_putbox(x, y, w, h, b + yo * ow + xo, ow);
}


x86 assembly (clang, -O0):
<__svgalib_driver8p_putboxpart>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    0x10(%rbp),%r8
mov    0x20(%rbp),%eax
imul   -0x14(%rbp),%eax
cltq
add    %rax,%r8
movslq 0x18(%rbp),%rax
add    %rax,%r8
mov    -0x14(%rbp),%r9d
call   1030 <__svgalib_driver8p_putbox@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__svgalib_driver8p_putboxpart>:
mov    %r8d,%r9d
movslq 0x10(%rsp),%r10
mov    0x18(%rsp),%eax
imul   %r8d,%eax
movslq %eax,%r8
add    0x8(%rsp),%r8
add    %r10,%r8
jmp    1030 <__svgalib_driver8p_putbox@plt>

LLVM IR (-O0):
define void @__svgalib_driver8p_putboxpart(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i8* %6, i32 %7, i32 %8) {
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i8*
%17 = alloca i32
%18 = alloca i32
store i32 %0, i32* %10
store i32 %1, i32* %11
store i32 %2, i32* %12
store i32 %3, i32* %13
store i32 %4, i32* %14
store i32 %5, i32* %15
store i8* %6, i8** %16
store i32 %7, i32* %17
store i32 %8, i32* %18
%19 = load i32, i32* %10
%20 = load i32, i32* %11
%21 = load i32, i32* %12
%22 = load i32, i32* %13
%23 = load i8*, i8** %16
%24 = load i32, i32* %18
%25 = load i32, i32* %14
%26 = mul nsw i32 %24, %25
%27 = sext i32 %26 to i64
%28 = getelementptr i8, i8* %23, i64 %27
%29 = load i32, i32* %17
%30 = sext i32 %29 to i64
%31 = getelementptr i8, i8* %28, i64 %30
%32 = load i32, i32* %14
%33 = call i32 @__svgalib_driver8p_putbox(i32 %19, i32 %20, i32 %21, i32 %22, i8* %31, i32 %32)
ret void
}

LLVM IR (-O2):
define void @__svgalib_driver8p_putboxpart(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i8* %6, i32 %7, i32 %8) {
%10 = mul nsw i32 %8, %4
%11 = sext i32 %10 to i64
%12 = getelementptr i8, i8* %6, i64 %11
%13 = sext i32 %7 to i64
%14 = getelementptr i8, i8* %12, i64 %13
%15 = tail call i32 @__svgalib_driver8p_putbox(i32 %0, i32 %1, i32 %2, i32 %3, i8* %14, i32 %4)
ret void
}
int BPQSerialSetPollDelay(unsigned int hDevice, int PollDelay) { return 0; }


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

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

LLVM IR (-O0):
define i32 @BPQSerialSetPollDelay(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @BPQSerialSetPollDelay(i32 %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int system(char *);
__attribute__((__weak__, __always___)) int softboundcets_system(char *ptr) {
  return system(ptr);
}


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

x86 assembly (clang, -O2):
<softboundcets_system>:
jmp    1030 <system@plt>

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

LLVM IR (-O2):
define weak i32 @softboundcets_system(i8* %0) {
%2 = tail call i32 @system(i8* %0)
ret i32 %2
}
/* Type definitions */
struct ibv_cq {
  int dummy;
};

/* Variables and functions */
int _destroy_cq(struct ibv_cq *);
int /*<<< orphan*/ dmtcp_plugin_disable_ckpt();
int /*<<< orphan*/ dmtcp_plugin_enable_ckpt();
int ibv_destroy_cq(struct ibv_cq *cq) {
  dmtcp_plugin_disable_ckpt();
  int rslt = _destroy_cq(cq);
  dmtcp_plugin_enable_ckpt();
  return rslt;
}


x86 assembly (clang, -O0):
<ibv_destroy_cq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <dmtcp_plugin_disable_ckpt@plt>
mov    -0x8(%rbp),%rdi
call   1040 <_destroy_cq@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1050 <dmtcp_plugin_enable_ckpt@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ibv_destroy_cq>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <dmtcp_plugin_disable_ckpt@plt>
mov    %rbx,%rdi
call   1040 <_destroy_cq@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <dmtcp_plugin_enable_ckpt@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.ibv_cq = type { i32 }
define i32 @ibv_destroy_cq(%struct.ibv_cq* %0) {
%2 = alloca %struct.ibv_cq*
%3 = alloca i32
store %struct.ibv_cq* %0, %struct.ibv_cq** %2
%4 = call i32 (...) @dmtcp_plugin_disable_ckpt()
%5 = load %struct.ibv_cq*, %struct.ibv_cq** %2
%6 = call i32 @_destroy_cq(%struct.ibv_cq* %5)
store i32 %6, i32* %3
%7 = call i32 (...) @dmtcp_plugin_enable_ckpt()
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
%struct.ibv_cq = type { i32 }
define i32 @ibv_destroy_cq(%struct.ibv_cq* %0) {
%2 = tail call i32 (...) @dmtcp_plugin_disable_ckpt()
%3 = tail call i32 @_destroy_cq(%struct.ibv_cq* %0)
%4 = tail call i32 (...) @dmtcp_plugin_enable_ckpt()
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void plugin(void) { printf("This is plug-in 1\n"); }


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"This is plug-in 1\0A\00"
define void @plugin() {
%1 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [18 x i8] c"This is plug-in 1\00"
define void @plugin() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void pgn_free(void *ptr) { free((char *)ptr); }


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

LLVM IR (-O0):
define void @pgn_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 @pgn_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
void error(const char *theMessage) {
  perror(theMessage);
  exit(1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @error(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
long fibonacci(int);
int /*<<< orphan*/ printf(char *, long);
int main(void) {
  long n = fibonacci(10);
  printf("fibonacci(10)=%ld\n", n);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1040 <fibonacci@plt>
lea    0xece(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"fibonacci(10)=%ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
%3 = call i64 @fibonacci(i32 10)
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i64 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"fibonacci(10)=%ld\0A\00"
define i32 @main() {
%1 = tail call i64 @fibonacci(i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i64 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ rm_rf_subvolume_and_free(char *);
void rm_rf_subvolume_and_freep(char **p) {
  if (*p)
    rm_rf_subvolume_and_free(*p);
}


x86 assembly (clang, -O0):
<rm_rf_subvolume_and_freep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1136 <rm_rf_subvolume_and_freep+0x26>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <rm_rf_subvolume_and_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rm_rf_subvolume_and_freep>:
mov    (%rdi),%rdi
test   %rdi,%rdi
je     111d <rm_rf_subvolume_and_freep+0xd>
jmp    1030 <rm_rf_subvolume_and_free@plt>
ret

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

LLVM IR (-O2):
define void @rm_rf_subvolume_and_freep(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @rm_rf_subvolume_and_free(i8* %2)
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int f163(int *);
int f164(int *p) { return f163(p); }


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

x86 assembly (clang, -O2):
<f164>:
jmp    1030 <f163@plt>

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

LLVM IR (-O2):
define i32 @f164(i32* %0) {
%2 = tail call i32 @f163(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ isprint(char);
int util_checkprint(char *str) {
  while (*str) {
    if (!isprint(*str))
      return -1;
    str++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<util_checkprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115b <util_checkprint+0x4b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isprint@plt>
cmp    $0x0,%eax
jne    114a <util_checkprint+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1162 <util_checkprint+0x52>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <util_checkprint+0xc>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_checkprint>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
xor    %ebp,%ebp
test   %al,%al
je     114e <util_checkprint+0x3e>
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl %al,%edi
call   1030 <isprint@plt>
test   %eax,%eax
je     1149 <util_checkprint+0x39>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <util_checkprint+0x20>
jmp    114e <util_checkprint+0x3e>
mov    $0xffffffff,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @util_checkprint(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %7
4: ; preds = %7
%5 = load i8, i8* %12
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %12, %4 ], [ %0, %1 ]
%10 = tail call i32 @isprint(i8 signext %8)
%11 = icmp eq i32 %10, 0
%12 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %11, label %13, label %4
13: ; preds = %7, %4, %1
%14 = phi i32 [ 0, %1 ], [ 0, %4 ], [ -1, %7 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ printw(char *);
void intro(void) {
  printw("Tiny BASIC for Curses, version 0.8.6\n");
  printw("Type HELP if you need help\n\n");
}


x86 assembly (clang, -O0):
<intro>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printw@plt>
lea    0xeff(%rip),%rdi
call   1030 <printw@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<intro>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printw@plt>
lea    0xf02(%rip),%rdi
pop    %rax
jmp    1030 <printw@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"Tiny BASIC for Curses, version 0.8.6\0A\00"
@.str.1 = [29 x i8] c"Type HELP if you need help\0A\0A\00"
define void @intro() {
%1 = call i32 @printw(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printw(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"Tiny BASIC for Curses, version 0.8.6\0A\00"
@.str.1 = [29 x i8] c"Type HELP if you need help\0A\0A\00"
define void @intro() {
%1 = tail call i32 @printw(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printw(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void g_str_has_suffix() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ wrs_mem(int /*<<< orphan*/ *, int);
void wrs_uint32(uint32_t v) { wrs_mem(&v, sizeof(v)); }


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

x86 assembly (clang, -O2):
<wrs_uint32>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
call   1030 <wrs_mem@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @wrs_uint32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @wrs_mem(i32* %2, i32 4)
ret void
}
/* Variables and functions */
int *create_int_array(int);
int /*<<< orphan*/ double_int_array(int *, int);
int /*<<< orphan*/ free(int *);
int /*<<< orphan*/ print_int_array(int *, int);
int /*<<< orphan*/ printf(char *);
int main() {
  int a_size = 10;
  int *a = create_int_array(a_size);
  print_int_array(a, a_size);
  printf("Doubling array\n");
  double_int_array(a, a_size);
  print_int_array(a, a_size);
  free(a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <create_int_array@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1070 <print_int_array@plt>
lea    0xe7b(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1060 <double_int_array@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1070 <print_int_array@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xa,%edi
call   1050 <create_int_array@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0xa,%esi
call   1070 <print_int_array@plt>
lea    0xe8e(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1060 <double_int_array@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1070 <print_int_array@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Doubling array\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32 0, i32* %1
store i32 10, i32* %2
%4 = load i32, i32* %2
%5 = call i32* @create_int_array(i32 %4)
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = load i32, i32* %2
%8 = call i32 @print_int_array(i32* %6, i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%10 = load i32*, i32** %3
%11 = load i32, i32* %2
%12 = call i32 @double_int_array(i32* %10, i32 %11)
%13 = load i32*, i32** %3
%14 = load i32, i32* %2
%15 = call i32 @print_int_array(i32* %13, i32 %14)
%16 = load i32*, i32** %3
%17 = call i32 @free(i32* %16)
ret i32 0
}

LLVM IR (-O2):
@str = [15 x i8] c"Doubling array\00"
define i32 @main() {
%1 = tail call i32* @create_int_array(i32 10)
%2 = tail call i32 @print_int_array(i32* %1, i32 10)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @double_int_array(i32* %1, i32 10)
%5 = tail call i32 @print_int_array(i32* %1, i32 10)
%6 = tail call i32 @free(i32* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ IsSoundChar(char);
char *PSkipSoundChars(const char *pch) {
  char *pcht = (char *)pch;
  while (1) {
    if (!IsSoundChar(*pcht))
      break;
    pcht++;
  }
  return pcht;
}


x86 assembly (clang, -O0):
<PSkipSoundChars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <IsSoundChar@plt>
cmp    $0x0,%eax
jne    113e <PSkipSoundChars+0x2e>
jmp    114f <PSkipSoundChars+0x3f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <PSkipSoundChars+0x14>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PSkipSoundChars>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <IsSoundChar@plt>
test   %eax,%eax
jne    1120 <PSkipSoundChars+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @PSkipSoundChars(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i32 @IsSoundChar(i8 signext %4)
%6 = icmp eq i32 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %3
}
void min(unsigned int *a, unsigned int b) { *a = (*a < b) ? *a : b; }


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
cmp    -0xc(%rbp),%eax
jae    1128 <min+0x28>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
jmp    112e <min+0x2e>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    (%rdi),%eax
cmp    %esi,%eax
cmovb  %eax,%esi
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @min(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = icmp ult i32 %3, %1
%5 = select i1 %4, i32 %3, i32 %1
store i32 %5, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HWTIMER_SYS_SystickIsrAction();
void SysTick_Handler(void) { HWTIMER_SYS_SystickIsrAction(); }


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

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

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

LLVM IR (-O2):
define void @SysTick_Handler() {
%1 = tail call i32 (...) @HWTIMER_SYS_SystickIsrAction()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ paintCharSpace(int, int, int /*<<< orphan*/,
                                  int /*<<< orphan*/, int /*<<< orphan*/);
void paintBackGround() {
  for (int i = 0; i < 1024; i += 8) {
    for (int j = 0; j < 768; j += 16) {
      paintCharSpace(i, j, 0, 0, 0);
    }
  }
}


x86 assembly (clang, -O0):
<paintBackGround>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x400,-0x4(%rbp)
jge    1175 <paintBackGround+0x65>
movl   $0x0,-0x8(%rbp)
cmpl   $0x300,-0x8(%rbp)
jge    1162 <paintBackGround+0x52>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
xor    %r8d,%r8d
mov    %r8d,%edx
mov    %r8d,%ecx
call   1030 <paintCharSpace@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <paintBackGround+0x23>
jmp    1167 <paintBackGround+0x57>
mov    -0x4(%rbp),%eax
add    $0x8,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <paintBackGround+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<paintBackGround>:
push   %rbp
push   %rbx
push   %rax
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0xfffffff0,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x10,%ebp
mov    %ebx,%edi
mov    %ebp,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <paintCharSpace@plt>
cmp    $0x2f0,%ebp
jb     1130 <paintBackGround+0x20>
lea    0x8(%rbx),%eax
cmp    $0x3f8,%ebx
mov    %eax,%ebx
jb     1120 <paintBackGround+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @paintBackGround() {
br label %1
1: ; preds = %0, %4
%2 = phi i32 [ 0, %0 ], [ %5, %4 ]
br label %7
3: ; preds = %4
ret void
4: ; preds = %7
%5 = add nuw nsw i32 %2, 8
%6 = icmp ult i32 %2, 1016
br i1 %6, label %1, label %3
7: ; preds = %1, %7
%8 = phi i32 [ 0, %1 ], [ %10, %7 ]
%9 = tail call i32 @paintCharSpace(i32 %2, i32 %8, i32 0, i32 0, i32 0)
%10 = add nuw nsw i32 %8, 16
%11 = icmp ult i32 %8, 752
br i1 %11, label %7, label %4
}
/* Variables and functions */
int /*<<< orphan*/ outbyte(int /*<<< orphan*/);
void print(char *ptr) {
  while (*ptr) {
    outbyte(*ptr++);
  }
}


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

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

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

LLVM IR (-O2):
define void @print(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @outbyte(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}