xunge/DecIR huggingface dataset:
void stack_push(struct tst_expr_tok *stack[], unsigned int *op_stack_pos,
                struct tst_expr_tok *op) {
  stack[(*op_stack_pos)++] = op;
}


x86 assembly (clang, -O0):
<stack_push>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rsi
mov    (%rsi),%ecx
mov    %ecx,%edi
add    $0x1,%edi
mov    %edi,(%rsi)
mov    %ecx,%ecx
mov    %rdx,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<stack_push>:
mov    (%rsi),%eax
lea    0x1(%rax),%ecx
mov    %ecx,(%rsi)
mov    %rdx,(%rdi,%rax,8)
ret

LLVM IR (-O0):
%struct.tst_expr_tok = type opaque
define void @stack_push(%struct.tst_expr_tok** %0, i32* %1, %struct.tst_expr_tok* %2) {
%4 = alloca %struct.tst_expr_tok**
%5 = alloca i32*
%6 = alloca %struct.tst_expr_tok*
store %struct.tst_expr_tok** %0, %struct.tst_expr_tok*** %4
store i32* %1, i32** %5
store %struct.tst_expr_tok* %2, %struct.tst_expr_tok** %6
%7 = load %struct.tst_expr_tok*, %struct.tst_expr_tok** %6
%8 = load %struct.tst_expr_tok**, %struct.tst_expr_tok*** %4
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = add i32 %10, 1
store i32 %11, i32* %9
%12 = zext i32 %10 to i64
%13 = getelementptr inbounds %struct.tst_expr_tok*, %struct.tst_expr_tok** %8, i64 %12
store %struct.tst_expr_tok* %7, %struct.tst_expr_tok** %13
ret void
}

LLVM IR (-O2):
%struct.tst_expr_tok = type opaque
define void @stack_push(%struct.tst_expr_tok** nocapture writeonly %0, i32* nocapture %1, %struct.tst_expr_tok* %2) {
%4 = load i32, i32* %1
%5 = add i32 %4, 1
store i32 %5, i32* %1
%6 = zext i32 %4 to i64
%7 = getelementptr inbounds %struct.tst_expr_tok*, %struct.tst_expr_tok** %0, i64 %6
store %struct.tst_expr_tok* %2, %struct.tst_expr_tok** %7
ret void
}
void zero(char *buffer, int len) {
  int i = -1;
  while (++i < len) {
    buffer[i] = 0;
  }
}


x86 assembly (clang, -O0):
<zero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0xffffffff,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmp    -0xc(%rbp),%eax
jge    1135 <zero+0x35>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    1112 <zero+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<zero>:
test   %esi,%esi
jle    1122 <zero+0x12>
push   %rax
mov    %esi,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @zero(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ intercala(int *, int, int, int);
void mergesort(int v[], int inicio, int fim) {
  int meio;
  if (inicio < fim) {
    meio = (inicio + fim) / 2;
    mergesort(v, inicio, meio);
    mergesort(v, meio + 1, fim);
    intercala(v, inicio, meio, fim);
  }
  return;
}


x86 assembly (clang, -O0):
<mergesort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1182 <mergesort+0x62>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1040 <mergesort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <mergesort@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1030 <intercala@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mergesort>:
cmp    %edx,%esi
jge    1172 <mergesort+0x52>
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%r12d
mov    %rdi,%r15
lea    (%r14,%r12,1),%eax
mov    %eax,%ebx
shr    $0x1f,%ebx
add    %eax,%ebx
sar    %ebx
mov    %ebx,%edx
call   1040 <mergesort@plt>
lea    0x1(%rbx),%esi
mov    %r15,%rdi
mov    %r14d,%edx
call   1040 <mergesort@plt>
mov    %r15,%rdi
mov    %r12d,%esi
mov    %ebx,%edx
mov    %r14d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <intercala@plt>
ret

LLVM IR (-O0):
define void @mergesort(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %28
11: ; preds = %3
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = add nsw i32 %12, %13
%15 = sdiv i32 %14, 2
store i32 %15, i32* %7
%16 = load i32*, i32** %4
%17 = load i32, i32* %5
%18 = load i32, i32* %7
%19 = load i32*, i32** %4
%20 = load i32, i32* %7
%21 = add nsw i32 %20, 1
%22 = load i32, i32* %6
%23 = load i32*, i32** %4
%24 = load i32, i32* %5
%25 = load i32, i32* %7
%26 = load i32, i32* %6
%27 = call i32 @intercala(i32* %23, i32 %24, i32 %25, i32 %26)
br label %28
28: ; preds = %11, %3
ret void
}

LLVM IR (-O2):
define void @mergesort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %6, label %5
5: ; preds = %3, %6
ret void
6: ; preds = %3
%7 = add nsw i32 %2, %1
%8 = sdiv i32 %7, 2
tail call void @mergesort(i32* %0, i32 %1, i32 %8)
%9 = add nsw i32 %8, 1
tail call void @mergesort(i32* %0, i32 %9, i32 %2)
%10 = tail call i32 @intercala(i32* %0, i32 %1, i32 %8, i32 %2)
br label %5
}
main() {
  int i;
  for (i = 0; i < 5; i++)
    ;
  printf(i);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1143 <main+0x33>
jmp    1135 <main+0x25>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
movslq -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* inttoptr (i64 5 to i8*))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void func() { printf("Something.\n"); }


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

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

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

LLVM IR (-O2):
@str = [11 x i8] c"Something.\00"
define void @func() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret void
}
int jl_isconnect_e(env)
register struct wnn_env *env;
{
  if (js_isconnect(env) == 0)
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<jl_isconnect_e>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <js_isconnect@plt>
cmp    $0x0,%eax
jne    113c <jl_isconnect_e+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1143 <jl_isconnect_e+0x33>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jl_isconnect_e>:
push   %rax
xor    %eax,%eax
call   1030 <js_isconnect@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.wnn_env = type opaque
define i32 @jl_isconnect_e(%struct.wnn_env* %0) {
%2 = alloca i32
%3 = alloca %struct.wnn_env*
store %struct.wnn_env* %0, %struct.wnn_env** %3
%4 = load %struct.wnn_env*, %struct.wnn_env** %3
%5 = call i32 (%struct.wnn_env*, ...) bitcast (i32 (...)* @js_isconnect to i32 (%struct.wnn_env*, ...)*)(%struct.wnn_env* %4)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
%struct.wnn_env = type opaque
define i32 @jl_isconnect_e(%struct.wnn_env* %0) {
%2 = tail call i32 (%struct.wnn_env*, ...) bitcast (i32 (...)* @js_isconnect to i32 (%struct.wnn_env*, ...)*)(%struct.wnn_env* %0)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
int fcmp(double a, double b) { return (a > b) - (a < b); }


x86 assembly (clang, -O0):
<fcmp>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fcmp>:
xor    %eax,%eax
ucomisd %xmm1,%xmm0
seta   %al
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
seta   %cl
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @fcmp(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp ogt double %5, %6
%8 = zext i1 %7 to i32
%9 = load double, double* %3
%10 = load double, double* %4
%11 = fcmp olt double %9, %10
%12 = zext i1 %11 to i32
%13 = sub nsw i32 %8, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @fcmp(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = zext i1 %3 to i32
%5 = fcmp olt double %0, %1
%6 = sext i1 %5 to i32
%7 = add nsw i32 %6, %4
ret i32 %7
}
/* Type definitions */
typedef scalar_t__ uint32_t;
typedef scalar_t__ int32_t;

/* Variables and functions */
int32_t min_u32(uint32_t a, uint32_t b) { return a < b ? a : b; }


x86 assembly (clang, -O0):
<min_u32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1127 <min_u32+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <min_u32+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min_u32>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovl  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @min_u32(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ omp_nest_lock_t;

/* Variables and functions */
void omp_init_nest_lock(omp_nest_lock_t *_Lock) {}


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

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

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

LLVM IR (-O2):
define void @omp_init_nest_lock(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __svgalib_driver24_getbox(int, int, int, int, void *, int);
void __svgalib_driver24_getboxpart(int x, int y, int w, int h, int ow, int oh,
                                   void *b, int xo, int yo) {
  __svgalib_driver24_getbox(x, y, w, h, b + yo * ow + xo, ow);
}


x86 assembly (clang, -O0):
<__svgalib_driver24_getboxpart>:
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_driver24_getbox@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__svgalib_driver24_getboxpart>:
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_driver24_getbox@plt>

LLVM IR (-O0):
define void @__svgalib_driver24_getboxpart(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_driver24_getbox(i32 %19, i32 %20, i32 %21, i32 %22, i8* %31, i32 %32)
ret void
}

LLVM IR (-O2):
define void @__svgalib_driver24_getboxpart(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_driver24_getbox(i32 %0, i32 %1, i32 %2, i32 %3, i8* %14, i32 %4)
ret void
}
int path_032_expected_1(int y) {
  int x = 0;
  switch (y)
    x++;
  return x;
}


x86 assembly (clang, -O0):
<path_032_expected_1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @path_032_expected_1(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
switch i32 %4, label %5 [
]
5: ; preds = %1
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @path_032_expected_1(i32 %0) {
ret i32 0
}
__attribute__((always_)) int IOPinRead(int PortNo, int PinNo) { return 0; }


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

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

LLVM IR (-O0):
define i32 @IOPinRead(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 @IOPinRead(i32 %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0xf0() {
  Assert_real((isalpha(240) == 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_isalpha.c",
              1205, ("isalpha should be 0 for 0xf0"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0xf0>:
push   %rax
mov    $0xf0,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4b5,%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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xf0\00"
define void @t_isalpha_0xf0() {
%1 = call i64 @isalpha(i32 240)
%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 1205, 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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xf0\00"
define void @t_isalpha_0xf0() {
%1 = tail call i64 @isalpha(i32 240)
%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 1205, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, unsigned long);
void eeh_memcpy_fromio(void *dest, void *src, unsigned long n) {
  void *vsrc = (void *)((((unsigned long)(src)) & 0xFFFFFFFF) | (0xEUL << 60));
  memcpy(dest, vsrc, n);
}


x86 assembly (clang, -O0):
<eeh_memcpy_fromio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movabs $0xffffffff,%rcx
and    %rcx,%rax
movabs $0xe000000000000000,%rcx
or     %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eeh_memcpy_fromio>:
mov    %esi,%eax
movabs $0xe000000000000000,%rsi
or     %rax,%rsi
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @eeh_memcpy_fromio(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i8*, i8** %5
%9 = ptrtoint i8* %8 to i64
%10 = and i64 %9, 4294967295
%11 = or i64 %10, -2305843009213693952
%12 = inttoptr i64 %11 to i8*
store i8* %12, i8** %7
%13 = load i8*, i8** %4
%14 = load i8*, i8** %7
%15 = load i64, i64* %6
%16 = call i32 @memcpy(i8* %13, i8* %14, i64 %15)
ret void
}

LLVM IR (-O2):
define void @eeh_memcpy_fromio(i8* %0, i8* %1, i64 %2) {
%4 = ptrtoint i8* %1 to i64
%5 = and i64 %4, 4294967295
%6 = or i64 %5, -2305843009213693952
%7 = inttoptr i64 %6 to i8*
%8 = tail call i32 @memcpy(i8* %0, i8* %7, i64 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
size_t wcsrtombs(char *, int /*<<< orphan*/ const **, size_t,
                 int /*<<< orphan*/);
size_t wcstombs(char *s, const wchar_t *ws, size_t n) {
  return wcsrtombs(s, &ws, n, 0);
}


x86 assembly (clang, -O0):
<wcstombs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    -0x10(%rbp),%rsi
xor    %ecx,%ecx
call   1030 <wcsrtombs@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcstombs>:
push   %rax
mov    %rsi,(%rsp)
mov    %rsp,%rsi
xor    %ecx,%ecx
call   1030 <wcsrtombs@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i64 @wcstombs(i8* %0, i32* %1, i64 %2) {
%4 = alloca i32*
store i32* %1, i32** %4
%5 = call i64 @wcsrtombs(i8* %0, i32** %4, i64 %2, i32 0)
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ fdumphex(int /*<<< orphan*/, unsigned char const *, size_t);
int /*<<< orphan*/ stdout;
void dumphex(const unsigned char *src, size_t len) {
  fdumphex(stdout, src, len);
}


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

x86 assembly (clang, -O2):
<dumphex>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
jmp    1030 <fdumphex@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @dumphex(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i32, i32* @stdout
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i32 @fdumphex(i32 %5, i8* %6, i64 %7)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @dumphex(i8* %0, i64 %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @fdumphex(i32 %3, i8* %0, i64 %1)
ret void
}
/* Variables and functions */
char *strcat(char *restrict dest, const char *restrict src) { return NULL; }


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

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

LLVM IR (-O0):
define i8* @strcat(i8* noalias %0, i8* noalias %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @strcat(i8* noalias nocapture readnone %0, i8* noalias nocapture readnone %1) {
ret i8* null
}
void XkbFreeGeomSections() {}


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

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

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

LLVM IR (-O2):
define void @XkbFreeGeomSections() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __NR_ioprio_set;
int syscall(int /*<<< orphan*/, int, int, int);
int ioprio_set(int which, int who, int ioprio) {
  return syscall(__NR_ioprio_set, which, who, ioprio);
}


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

x86 assembly (clang, -O2):
<ioprio_set>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@__NR_ioprio_set = global i32 0
define i32 @ioprio_set(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* @__NR_ioprio_set
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @syscall(i32 %7, i32 %8, i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
@__NR_ioprio_set = global i32 0
define i32 @ioprio_set(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @__NR_ioprio_set
%5 = tail call i32 @syscall(i32 %4, i32 %0, i32 %1, i32 %2)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ hard_cli();
int /*<<< orphan*/ rt_sched_unlock();
void rtos_irq_reacquire_lock(void) {
  hard_cli();
  rt_sched_unlock();
}


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

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

LLVM IR (-O0):
define void @rtos_irq_reacquire_lock() {
%1 = call i32 (...) @hard_cli()
%2 = call i32 (...) @rt_sched_unlock()
ret void
}

LLVM IR (-O2):
define void @rtos_irq_reacquire_lock() {
%1 = tail call i32 (...) @hard_cli()
%2 = tail call i32 (...) @rt_sched_unlock()
ret void
}
void UARTFIFOEnable(unsigned int baseAdd) {
  (*((volatile unsigned int *)(baseAdd + (0x8)))) =
      ((0x00000001u) | (0x00000002u) | (0x00000004u));
}


x86 assembly (clang, -O0):
<UARTFIFOEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x8,%eax
mov    %eax,%eax
movl   $0x7,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTFIFOEnable>:
add    $0x8,%edi
movl   $0x7,(%rdi)
ret

LLVM IR (-O0):
define void @UARTFIFOEnable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 8
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
store volatile i32 7, i32* %6
ret void
}

LLVM IR (-O2):
define void @UARTFIFOEnable(i32 %0) {
%2 = add i32 %0, 8
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
store volatile i32 7, i32* %4
ret void
}
int __test_and_set_bit(int nr, volatile unsigned long *addr) {
  unsigned long mask = (1UL << ((nr) % (sizeof(long) * 8)));
  unsigned long *p = ((unsigned long *)addr) + ((nr) / (sizeof(long) * 8));
  unsigned long old = *p;
  *p = old | mask;
  return (old & mask) != 0;
}


x86 assembly (clang, -O0):
<__test_and_set_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movslq -0x4(%rbp),%rcx
and    $0x3f,%rcx
mov    $0x1,%eax
shl    %cl,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
shr    $0x6,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rcx
or     -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rax
and    -0x18(%rbp),%rax
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__test_and_set_bit>:
movslq %edi,%rcx
mov    %rcx,%rax
shr    $0x6,%rax
mov    (%rsi,%rax,8),%rdx
mov    %rdx,%rdi
bts    %rcx,%rdi
mov    %rdi,(%rsi,%rax,8)
xor    %eax,%eax
bt     %rcx,%rdx
setb   %al
ret

LLVM IR (-O0):
define i32 @__test_and_set_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64*
%7 = alloca i64
store i32 %0, i32* %3
store i64* %1, i64** %4
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = urem i64 %9, 64
%11 = shl i64 1, %10
store i64 %11, i64* %5
%12 = load i64*, i64** %4
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = udiv i64 %14, 64
%16 = getelementptr inbounds i64, i64* %12, i64 %15
store i64* %16, i64** %6
%17 = load i64*, i64** %6
%18 = load i64, i64* %17
store i64 %18, i64* %7
%19 = load i64, i64* %7
%20 = load i64, i64* %5
%21 = or i64 %19, %20
%22 = load i64*, i64** %6
store i64 %21, i64* %22
%23 = load i64, i64* %7
%24 = load i64, i64* %5
%25 = and i64 %23, %24
%26 = icmp ne i64 %25, 0
%27 = zext i1 %26 to i32
ret i32 %27
}

LLVM IR (-O2):
define i32 @__test_and_set_bit(i32 %0, i64* nocapture %1) {
%3 = sext i32 %0 to i64
%4 = and i64 %3, 63
%5 = shl nuw i64 1, %4
%6 = lshr i64 %3, 6
%7 = getelementptr inbounds i64, i64* %1, i64 %6
%8 = load i64, i64* %7
%9 = or i64 %8, %5
store i64 %9, i64* %7
%10 = and i64 %8, %5
%11 = icmp ne i64 %10, 0
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x62() {
  Assert_real((isspace(98) == 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_isspace.c",
              495, ("isspace should be 0 for b"));
}


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

x86 assembly (clang, -O2):
<t_isspace_0x62>:
push   %rax
mov    $0x62,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x1ef,%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_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for b\00"
define void @t_isspace_0x62() {
%1 = call i64 @isspace(i32 98)
%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 495, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for b\00"
define void @t_isspace_0x62() {
%1 = tail call i64 @isspace(i32 98)
%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 495, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct UPnPService {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void RNDResponseSink_RenderingControl_SetMute(struct UPnPService *Service,
                                              int ErrorCode, void *User) {
  printf("RND Invoke Response: RenderingControl/SetMute[ErrorCode:%d]()\r\n",
         ErrorCode);
}


x86 assembly (clang, -O0):
<RNDResponseSink_RenderingControl_SetMute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%esi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.UPnPService = type { i32 }
@.str = [64 x i8] c"RND Invoke Response: RenderingControl/SetMute[ErrorCode:%d]()\0D\0A\00"
define void @RNDResponseSink_RenderingControl_SetMute(%struct.UPnPService* %0, i32 %1, i8* %2) {
%4 = alloca %struct.UPnPService*
%5 = alloca i32
%6 = alloca i8*
store %struct.UPnPService* %0, %struct.UPnPService** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
%8 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
%struct.UPnPService = type { i32 }
@.str = [64 x i8] c"RND Invoke Response: RenderingControl/SetMute[ErrorCode:%d]()\0D\0A\00"
define void @RNDResponseSink_RenderingControl_SetMute(%struct.UPnPService* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strokeThickness(int);
int /*<<< orphan*/ textSize(int);
void setup() {
  strokeThickness(1);
  textSize(24);
}


x86 assembly (clang, -O0):
<setup>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <strokeThickness@plt>
mov    $0x18,%edi
call   1040 <textSize@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup>:
push   %rax
mov    $0x1,%edi
call   1030 <strokeThickness@plt>
mov    $0x18,%edi
pop    %rax
jmp    1040 <textSize@plt>

LLVM IR (-O0):
define void @setup() {
%1 = call i32 @strokeThickness(i32 1)
%2 = call i32 @textSize(i32 24)
ret void
}

LLVM IR (-O2):
define void @setup() {
%1 = tail call i32 @strokeThickness(i32 1)
%2 = tail call i32 @textSize(i32 24)
ret void
}
void cdra2c(asci, charac) int *asci;
char *charac;
{ charac[0] = (char)*asci; }


x86 assembly (clang, -O0):
<cdra2c>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdra2c>:
mov    (%rdi),%al
mov    %al,(%rsi)
ret

LLVM IR (-O0):
define void @cdra2c(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %5
%7 = trunc i32 %6 to i8
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i64 0
store i8 %7, i8* %9
ret void
}

LLVM IR (-O2):
define void @cdra2c(i32* nocapture %0, i8* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = trunc i32 %3 to i8
store i8 %4, i8* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr,
          "Usage: pbmsplit [-w rows|-o rows] [-n rows] {-|infile} [outfile]\n");
  exit(-1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [66 x i8] c"Usage: pbmsplit [-w rows|-o rows] [-n rows] {-|infile} [outfile]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [66 x i8] c"Usage: pbmsplit [-w rows|-o rows] [-n rows] {-|infile} [outfile]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ sigdelread_setup();
int /*<<< orphan*/ sigdelwrite_setup();
int /*<<< orphan*/ sigvd_setup();
void d_delay_setup(void) {
  sigdelwrite_setup();
  sigdelread_setup();
  sigvd_setup();
}


x86 assembly (clang, -O0):
<d_delay_setup>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <sigdelwrite_setup@plt>
mov    $0x0,%al
call   1030 <sigdelread_setup@plt>
mov    $0x0,%al
call   1040 <sigvd_setup@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_delay_setup>:
push   %rax
xor    %eax,%eax
call   1050 <sigdelwrite_setup@plt>
xor    %eax,%eax
call   1030 <sigdelread_setup@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <sigvd_setup@plt>

LLVM IR (-O0):
define void @d_delay_setup() {
%1 = call i32 (...) @sigdelwrite_setup()
%2 = call i32 (...) @sigdelread_setup()
%3 = call i32 (...) @sigvd_setup()
ret void
}

LLVM IR (-O2):
define void @d_delay_setup() {
%1 = tail call i32 (...) @sigdelwrite_setup()
%2 = tail call i32 (...) @sigdelread_setup()
%3 = tail call i32 (...) @sigvd_setup()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int /*<<< orphan*/ write(int, char const *, int /*<<< orphan*/);
int handle_csense(int fd) {
  const char *cmd = "csense\n";
  write(fd, cmd, strlen(cmd));
  return 0;
}


x86 assembly (clang, -O0):
<handle_csense>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_csense>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0xed3(%rip),%r14
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [8 x i8] c"csense\0A\00"
define i32 @handle_csense(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i32, i32* %2
%5 = load i8*, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = call i32 @write(i32 %4, i8* %5, i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"csense\0A\00"
define i32 @handle_csense(i32 %0) {
%2 = tail call i32 @strlen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @write(i32 %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
int is_word_separator(char c) {
  switch (c) {
  case '\n':
  case '\t':
  case ' ':
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<is_word_separator>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xfffffff7,%eax
sub    $0x2,%eax
jb     1133 <is_word_separator+0x33>
jmp    1122 <is_word_separator+0x22>
mov    -0xc(%rbp),%eax
sub    $0x20,%eax
jne    113f <is_word_separator+0x3f>
jmp    1133 <is_word_separator+0x33>
movl   $0x1,-0x4(%rbp)
jmp    1146 <is_word_separator+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_word_separator>:
cmp    $0x20,%edi
ja     111d <is_word_separator+0x1d>
mov    $0x1,%eax
mov    %edi,%ecx
movabs $0x100000600,%rdx
bt     %rcx,%rdx
jae    111d <is_word_separator+0x1d>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @is_word_separator(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %7 [
i32 10, label %6
i32 9, label %6
i32 32, label %6
]
6: ; preds = %1, %1, %1
store i32 1, i32* %2
br label %8
7: ; preds = %1
store i32 0, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @is_word_separator(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %3 [
i32 10, label %4
i32 9, label %4
i32 32, label %4
]
3: ; preds = %1
br label %4
4: ; preds = %1, %1, %1, %3
%5 = phi i32 [ 0, %3 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ foo(unsigned short);
__attribute__((no, noclone)) unsigned short f11(unsigned short x,
                                                unsigned short y) {
  unsigned short r = x + y;
  if (x <= r)
    foo(r);
  return r;
}


x86 assembly (clang, -O0):
<f11>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movzwl -0x2(%rbp),%eax
movzwl -0x4(%rbp),%ecx
add    %ecx,%eax
mov    %ax,-0x6(%rbp)
movzwl -0x2(%rbp),%eax
movzwl -0x6(%rbp),%ecx
cmp    %ecx,%eax
jg     114d <f11+0x3d>
movzwl -0x6(%rbp),%edi
call   1030 <foo@plt>
movzwl -0x6(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f11>:
push   %rbx
mov    %esi,%ebx
add    %di,%bx
jb     1120 <f11+0x10>
movzwl %bx,%edi
call   1030 <foo@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i16 @f11(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
%5 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%6 = load i16, i16* %3
%7 = zext i16 %6 to i32
%8 = load i16, i16* %4
%9 = zext i16 %8 to i32
%10 = add nsw i32 %7, %9
%11 = trunc i32 %10 to i16
store i16 %11, i16* %5
%12 = load i16, i16* %3
%13 = zext i16 %12 to i32
%14 = load i16, i16* %5
%15 = zext i16 %14 to i32
%16 = icmp sle i32 %13, %15
br i1 %16, label %17, label %20
17: ; preds = %2
%18 = load i16, i16* %5
%19 = call i32 @foo(i16 zeroext %18)
br label %20
20: ; preds = %17, %2
%21 = load i16, i16* %5
ret i16 %21
}

LLVM IR (-O2):
define zeroext i16 @f11(i16 zeroext %0, i16 zeroext %1) {
%3 = add i16 %1, %0
%4 = icmp ult i16 %3, %0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @foo(i16 zeroext %3)
br label %7
7: ; preds = %5, %2
ret i16 %3
}
/* Variables and functions */
int /*<<< orphan*/ err(int, char *);
void *malloc(size_t);
void *xmalloc(size_t size) {
  void *ret = malloc(size);
  if (ret == NULL)
    err(1, "malloc() failed");
  return ret;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1155 <xmalloc+0x35>
mov    $0x1,%edi
lea    0xeb0(%rip),%rsi
call   1030 <err@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113f <xmalloc+0x1f>
lea    0xecb(%rip),%rsi
mov    $0x1,%edi
call   1030 <err@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [16 x i8] c"malloc() failed\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int elevado(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int i = 0;
  printf("Introduzca el numero:");
  scanf("%d", &i);
  int x = 0;
  x = elevado(i, 3);
  printf("El numero es:%d\n", x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec2(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x3,%esi
call   1050 <elevado@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xec0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
mov    $0x3,%esi
call   1050 <elevado@plt>
lea    0xeac(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Introduzca el numero:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [17 x i8] c"El numero es:%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
store i32 0, i32* %2
%5 = load i32, i32* %1
%6 = call i32 @elevado(i32 %5, i32 3)
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"Introduzca el numero:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [17 x i8] c"El numero es:%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @elevado(i32 %5, i32 3)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void at_wrong_file() { printf("wrong hex-file\n"); }


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

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

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

LLVM IR (-O2):
@str = [15 x i8] c"wrong hex-file\00"
define void @at_wrong_file() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret void
}
double __huge_val(void) { return 1.0e+1000; }


x86 assembly (clang, -O0):
<__huge_val>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @__huge_val() {
ret double 0x7FF0000000000000
}

LLVM IR (-O2):
define double @__huge_val() {
ret double 0x7FF0000000000000
}
/* Variables and functions */
int smack_get_file(char **, char *);
int smack_get_relabel_self(char **label) {
  return smack_get_file(label, "relabel-self");
}


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

x86 assembly (clang, -O2):
<smack_get_relabel_self>:
lea    0xee9(%rip),%rsi
jmp    1030 <smack_get_file@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"relabel-self\00"
define i32 @smack_get_relabel_self(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = call i32 @smack_get_file(i8** %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}

LLVM IR (-O2):
@.str = [13 x i8] c"relabel-self\00"
define i32 @smack_get_relabel_self(i8** %0) {
%2 = tail call i32 @smack_get_file(i8** %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}