xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x7b() {
  Assert_real((isupper(123) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isupper.c",
              620, ("isupper should be 0 for {"));
}


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

x86 assembly (clang, -O2):
<t_isupper_0x7b>:
push   %rax
mov    $0x7b,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x26c,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 0 for {\00"
define void @t_isupper_0x7b() {
%1 = call i64 @isupper(i32 123)
%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 620, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 0 for {\00"
define void @t_isupper_0x7b() {
%1 = tail call i64 @isupper(i32 123)
%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 620, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int main() {
  abort();
  abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ appendCODE(int /*<<< orphan*/);
int /*<<< orphan*/ makeCODEif_icmpne(int, int /*<<< orphan*/ *);
void code_if_icmpne(int label) { appendCODE(makeCODEif_icmpne(label, NULL)); }


x86 assembly (clang, -O0):
<code_if_icmpne>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <makeCODEif_icmpne@plt>
mov    %eax,%edi
call   1040 <appendCODE@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<code_if_icmpne>:
push   %rax
xor    %esi,%esi
call   1030 <makeCODEif_icmpne@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <appendCODE@plt>

LLVM IR (-O0):
define void @code_if_icmpne(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @makeCODEif_icmpne(i32 %3, i32* null)
%5 = call i32 @appendCODE(i32 %4)
ret void
}

LLVM IR (-O2):
define void @code_if_icmpne(i32 %0) {
%2 = tail call i32 @makeCODEif_icmpne(i32 %0, i32* null)
%3 = tail call i32 @appendCODE(i32 %2)
ret void
}
unsigned char escaped_char(unsigned char c) {
  switch (c) {
  case 'b':
    return '\b';
  case 'f':
    return '\f';
  case 'n':
    return '\n';
  case 'r':
    return '\r';
  case 't':
    return '\t';
  default:
    return c;
  }
}


x86 assembly (clang, -O0):
<escaped_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
add    $0xffffff9e,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x12,%eax
ja     1161 <escaped_char+0x61>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x8,-0x1(%rbp)
jmp    1167 <escaped_char+0x67>
movb   $0xc,-0x1(%rbp)
jmp    1167 <escaped_char+0x67>
movb   $0xa,-0x1(%rbp)
jmp    1167 <escaped_char+0x67>
movb   $0xd,-0x1(%rbp)
jmp    1167 <escaped_char+0x67>
movb   $0x9,-0x1(%rbp)
jmp    1167 <escaped_char+0x67>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<escaped_char>:
mov    %edi,%eax
mov    %edi,%ecx
add    $0xffffff9e,%ecx
ror    %ecx
cmp    $0x9,%ecx
ja     1125 <escaped_char+0x25>
mov    $0x345,%edx
bt     %ecx,%edx
jae    1125 <escaped_char+0x25>
movslq %ecx,%rax
lea    0xede(%rip),%rcx
mov    (%rax,%rcx,1),%al
ret

LLVM IR (-O0):
define zeroext i8 @escaped_char(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
switch i32 %5, label %11 [
i32 98, label %6
i32 102, label %7
i32 110, label %8
i32 114, label %9
i32 116, label %10
]
6: ; preds = %1
store i8 8, i8* %2
br label %13
7: ; preds = %1
store i8 12, i8* %2
br label %13
8: ; preds = %1
store i8 10, i8* %2
br label %13
9: ; preds = %1
store i8 13, i8* %2
br label %13
10: ; preds = %1
store i8 9, i8* %2
br label %13
11: ; preds = %1
%12 = load i8, i8* %3
store i8 %12, i8* %2
br label %13
13: ; preds = %11, %10, %9, %8, %7, %6
%14 = load i8, i8* %2
ret i8 %14
}

LLVM IR (-O2):
@switch.table.escaped_char = [10 x i8] c"\08\08\0C\08\08\08\0A\08\0D\09"
define zeroext i8 @escaped_char(i8 zeroext %0) {
%2 = zext i8 %0 to i32
%3 = add nsw i32 %2, -98
%4 = tail call i32 @llvm.fshl.i32(i32 %3, i32 %3, i32 31)
%5 = icmp ult i32 %4, 10
br i1 %5, label %6, label %15
6: ; preds = %1
%7 = trunc i32 %4 to i16
%8 = lshr i16 837, %7
%9 = and i16 %8, 1
%10 = icmp eq i16 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %6
%12 = sext i32 %4 to i64
%13 = getelementptr inbounds [10 x i8], [10 x i8]* @switch.table.escaped_char, i64 0, i64 %12
%14 = load i8, i8* %13
br label %15
15: ; preds = %1, %6, %11
%16 = phi i8 [ %14, %11 ], [ %0, %6 ], [ %0, %1 ]
ret i8 %16
}
void __imlib_CopyToRGBA(unsigned int color, unsigned int *dst) { *dst = color; }


x86 assembly (clang, -O0):
<__imlib_CopyToRGBA>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__imlib_CopyToRGBA>:
mov    %edi,(%rsi)
ret

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

LLVM IR (-O2):
define void @__imlib_CopyToRGBA(i32 %0, i32* nocapture writeonly %1) {
store i32 %0, i32* %1
ret void
}
/* Type definitions */
typedef unsigned long long uint64_t;

/* Variables and functions */
uint64_t effective_addr(uint64_t addr) { return addr & ((1ULL << 48) - 1); }


x86 assembly (clang, -O0):
<effective_addr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movabs $0xffffffffffff,%rax
and    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<effective_addr>:
movabs $0xffffffffffff,%rax
and    %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @effective_addr(i64 %0) {
%2 = and i64 %0, 281474976710655
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ err(int, char *);
scalar_t__ pipe(int *);
void open_pipes(int pipes[2][2]) {
  for (unsigned int i = 0; i < 2; i++) {
    if (pipe(pipes[i]) < 0)
      err(1, "pipe");
  }
}


x86 assembly (clang, -O0):
<open_pipes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jae    117e <open_pipes+0x5e>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%eax
shl    $0x3,%rax
add    %rax,%rdi
call   1030 <pipe@plt>
cmp    $0x0,%rax
jge    116b <open_pipes+0x4b>
mov    $0x1,%edi
lea    0xe9a(%rip),%rsi
call   1040 <err@plt>
jmp    1170 <open_pipes+0x50>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <open_pipes+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_pipes>:
push   %rbx
mov    %rdi,%rbx
call   1030 <pipe@plt>
test   %rax,%rax
jns    113f <open_pipes+0x1f>
lea    0xecb(%rip),%rsi
mov    $0x1,%edi
call   1040 <err@plt>
add    $0x8,%rbx
mov    %rbx,%rdi
call   1030 <pipe@plt>
test   %rax,%rax
js     1152 <open_pipes+0x32>
pop    %rbx
ret
lea    0xea7(%rip),%rsi
mov    $0x1,%edi
pop    %rbx
jmp    1040 <err@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"pipe\00"
define void @open_pipes([2 x i32]* %0) {
%2 = alloca [2 x i32]*
%3 = alloca i32
store [2 x i32]* %0, [2 x i32]** %2
store i32 0, i32* %3
br label %4
4: ; preds = %18, %1
%5 = load i32, i32* %3
%6 = icmp ult i32 %5, 2
br i1 %6, label %7, label %21
7: ; preds = %4
%8 = load [2 x i32]*, [2 x i32]** %2
%9 = load i32, i32* %3
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 %10
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0, i64 0
%13 = call i64 @pipe(i32* %12)
%14 = icmp slt i64 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %7
%16 = call i32 @err(i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %17
17: ; preds = %15, %7
br label %18
18: ; preds = %17
%19 = load i32, i32* %3
%20 = add i32 %19, 1
store i32 %20, i32* %3
br label %4
21: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"pipe\00"
define void @open_pipes([2 x i32]* %0) {
%2 = getelementptr inbounds [2 x i32], [2 x i32]* %0, i64 0, i64 0
%3 = tail call i64 @pipe(i32* %2)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %1, %5
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %0, i64 1, i64 0
%9 = tail call i64 @pipe(i32* %8)
%10 = icmp slt i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %7
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;
typedef int int32_t;

/* Variables and functions */
__attribute__((always_)) uint32_t __SHADD16(uint32_t x, uint32_t y) {
  int32_t r, s;
  r = (((((int32_t)x << 16) >> 16) + (((int32_t)y << 16) >> 16)) >> 1) &
      (int32_t)0x0000FFFF;
  s = (((((int32_t)x) >> 16) + (((int32_t)y) >> 16)) >> 1) &
      (int32_t)0x0000FFFF;
  return ((uint32_t)((s << 16) | (r)));
}


x86 assembly (clang, -O0):
<__SHADD16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x10,%eax
sar    $0x10,%eax
mov    -0x10(%rbp),%rcx
shl    $0x10,%ecx
sar    $0x10,%ecx
add    %ecx,%eax
sar    $0x1,%eax
and    $0xffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x10,%eax
mov    -0x10(%rbp),%rcx
sar    $0x10,%ecx
add    %ecx,%eax
sar    $0x1,%eax
and    $0xffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
shl    $0x10,%eax
or     -0x14(%rbp),%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<__SHADD16>:
movswl %di,%eax
movswl %si,%ecx
add    %eax,%ecx
shr    %ecx
movzwl %cx,%eax
sar    $0x10,%edi
sar    $0x10,%esi
add    %edi,%esi
and    $0xfffffffe,%esi
shl    $0xf,%esi
or     %eax,%esi
movslq %esi,%rax
ret

LLVM IR (-O0):
define i64 @__SHADD16(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
store i64 %0, i64* %3
store i64 %1, i64* %4
%7 = load i64, i64* %3
%8 = trunc i64 %7 to i32
%9 = shl i32 %8, 16
%10 = ashr i32 %9, 16
%11 = load i64, i64* %4
%12 = trunc i64 %11 to i32
%13 = shl i32 %12, 16
%14 = ashr i32 %13, 16
%15 = add nsw i32 %10, %14
%16 = ashr i32 %15, 1
%17 = and i32 %16, 65535
store i32 %17, i32* %5
%18 = load i64, i64* %3
%19 = trunc i64 %18 to i32
%20 = ashr i32 %19, 16
%21 = load i64, i64* %4
%22 = trunc i64 %21 to i32
%23 = ashr i32 %22, 16
%24 = add nsw i32 %20, %23
%25 = ashr i32 %24, 1
%26 = and i32 %25, 65535
store i32 %26, i32* %6
%27 = load i32, i32* %6
%28 = shl i32 %27, 16
%29 = load i32, i32* %5
%30 = or i32 %28, %29
%31 = sext i32 %30 to i64
ret i64 %31
}

LLVM IR (-O2):
define i64 @__SHADD16(i64 %0, i64 %1) {
%3 = trunc i64 %0 to i32
%4 = shl i32 %3, 16
%5 = ashr exact i32 %4, 16
%6 = trunc i64 %1 to i32
%7 = shl i32 %6, 16
%8 = ashr exact i32 %7, 16
%9 = add nsw i32 %8, %5
%10 = lshr i32 %9, 1
%11 = and i32 %10, 65535
%12 = ashr i32 %3, 16
%13 = ashr i32 %6, 16
%14 = add nsw i32 %13, %12
%15 = shl nsw i32 %14, 15
%16 = and i32 %15, -65536
%17 = or i32 %11, %16
%18 = sext i32 %17 to i64
ret i64 %18
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
uint32_t ones(uint32_t n) {
  uint32_t len_ones;
  uint32_t i;
  i = 0;
  len_ones = 0;
  while (i < n) {
    len_ones = (len_ones << 1) | 1;
    i++;
  }
  return (len_ones);
}


x86 assembly (clang, -O0):
<ones>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jge    1147 <ones+0x47>
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
or     $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1118 <ones+0x18>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ones>:
test   %rdi,%rdi
jle    1118 <ones+0x18>
lea    -0x1(%rdi),%rax
mov    %edi,%ecx
and    $0x7,%ecx
cmp    $0x7,%rax
jae    111b <ones+0x1b>
xor    %eax,%eax
jmp    1140 <ones+0x40>
xor    %eax,%eax
ret
and    $0xfffffffffffffff8,%rdi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
shl    $0x8,%rax
or     $0xff,%rax
add    $0xfffffffffffffff8,%rdi
jne    1130 <ones+0x30>
test   %rcx,%rcx
je     115d <ones+0x5d>
cs nopw 0x0(%rax,%rax,1)
nop
add    %rax,%rax
add    $0x1,%rax
add    $0xffffffffffffffff,%rcx
jne    1150 <ones+0x50>
ret

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

LLVM IR (-O2):
define i64 @ones(i64 %0) {
%2 = icmp sgt i64 %0, 0
br i1 %2, label %3, label %27
3: ; preds = %1
%4 = add i64 %0, -1
%5 = and i64 %0, 7
%6 = icmp ult i64 %4, 7
br i1 %6, label %16, label %7
7: ; preds = %3
%8 = and i64 %0, -8
br label %9
9: ; preds = %9, %7
%10 = phi i64 [ 0, %7 ], [ %13, %9 ]
%11 = phi i64 [ 0, %7 ], [ %14, %9 ]
%12 = shl i64 %10, 8
%13 = or i64 %12, 255
%14 = add i64 %11, 8
%15 = icmp eq i64 %14, %8
br i1 %15, label %16, label %9
16: ; preds = %9, %3
%17 = phi i64 [ undef, %3 ], [ %13, %9 ]
%18 = phi i64 [ 0, %3 ], [ %13, %9 ]
%19 = icmp eq i64 %5, 0
br i1 %19, label %27, label %20
20: ; preds = %16, %20
%21 = phi i64 [ %24, %20 ], [ %18, %16 ]
%22 = phi i64 [ %25, %20 ], [ 0, %16 ]
%23 = shl i64 %21, 1
%24 = or i64 %23, 1
%25 = add i64 %22, 1
%26 = icmp eq i64 %25, %5
br i1 %26, label %27, label %20
27: ; preds = %16, %20, %1
%28 = phi i64 [ 0, %1 ], [ %17, %16 ], [ %24, %20 ]
ret i64 %28
}
/* Type definitions */
struct stat {
  int st_size;
};
typedef int /*<<< orphan*/ dig;

/* Variables and functions */
int /*<<< orphan*/ check(char const *, int);
int /*<<< orphan*/ snprintf(unsigned char *, int, char *, char const *);
int /*<<< orphan*/ stat(char const *, struct stat *);
void digFile(const char *file) {
  unsigned char dig[256];
  snprintf(dig, sizeof(dig), "%s.dig", file);
  struct stat buffer;
  stat(file, &buffer);
  int size = buffer.st_size;
  check(file, size);
}


x86 assembly (clang, -O0):
<digFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x100,%esi
lea    0xeaa(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x118(%rbp),%rsi
call   1040 <stat@plt>
mov    -0x118(%rbp),%eax
mov    %eax,-0x11c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x11c(%rbp),%esi
call   1050 <check@plt>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<digFile>:
push   %rbx
sub    $0x110,%rsp
mov    %rdi,%rbx
lea    0xebe(%rip),%rdx
lea    0x10(%rsp),%rdi
mov    $0x100,%esi
mov    %rbx,%rcx
call   1030 <snprintf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <stat@plt>
mov    0x8(%rsp),%esi
mov    %rbx,%rdi
call   1050 <check@plt>
add    $0x110,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [7 x i8] c"%s.dig\00"
define void @digFile(i8* %0) {
%2 = alloca i8*
%3 = alloca [256 x i8]
%4 = alloca %struct.stat
%5 = alloca i32
store i8* %0, i8** %2
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%7 = load i8*, i8** %2
%8 = call i32 @snprintf(i8* %6, i32 256, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load i8*, i8** %2
%10 = call i32 @stat(i8* %9, %struct.stat* %4)
%11 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%12 = load i32, i32* %11
store i32 %12, i32* %5
%13 = load i8*, i8** %2
%14 = load i32, i32* %5
%15 = call i32 @check(i8* %13, i32 %14)
ret void
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [7 x i8] c"%s.dig\00"
define void @digFile(i8* %0) {
%2 = alloca [256 x i8]
%3 = alloca %struct.stat
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 256, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = bitcast %struct.stat* %3 to i8*
%7 = call i32 @stat(i8* %0, %struct.stat* %3)
%8 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 0
%9 = load i32, i32* %8
%10 = call i32 @check(i8* %0, i32 %9)
ret void
}
char char2hex(char in) { return (in <= '9') ? in - '0' : (in - 'a') + 10; }


x86 assembly (clang, -O0):
<char2hex>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
jg     1126 <char2hex+0x26>
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <char2hex+0x33>
movsbl -0x1(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<char2hex>:
cmp    $0x3a,%dil
mov    $0xd0,%ecx
mov    $0xa9,%eax
cmovl  %ecx,%eax
add    %dil,%al
ret

LLVM IR (-O0):
define signext i8 @char2hex(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sle i32 %4, 57
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = sub nsw i32 %8, 48
br label %15
10: ; preds = %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = sub nsw i32 %12, 97
%14 = add nsw i32 %13, 10
br label %15
15: ; preds = %10, %6
%16 = phi i32 [ %9, %6 ], [ %14, %10 ]
%17 = trunc i32 %16 to i8
ret i8 %17
}

LLVM IR (-O2):
define signext i8 @char2hex(i8 signext %0) {
%2 = icmp slt i8 %0, 58
%3 = select i1 %2, i8 -48, i8 -87
%4 = add i8 %3, %0
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ fileno(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int main(int argc, char **argv) {
  fileno(stdout);
  return -1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1030 <fileno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
call   1030 <fileno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@stdout = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @fileno(i32 %3)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0x28() {
  Assert_real((isalnum(40) == 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_isalnum.c",
              205, ("isalnum should be 0 for ("));
}


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

x86 assembly (clang, -O2):
<t_isalnum_0x28>:
push   %rax
mov    $0x28,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0xcd,%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_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 0 for (\00"
define void @t_isalnum_0x28() {
%1 = call i64 @isalnum(i32 40)
%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 205, 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_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 0 for (\00"
define void @t_isalnum_0x28() {
%1 = tail call i64 @isalnum(i32 40)
%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 205, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ perror(int /*<<< orphan*/ *);
void *ecalloc(size_t nmemb, size_t size) {
  void *p;
  if (!(p = calloc(nmemb, size)))
    perror(NULL);
  return p;
}


x86 assembly (clang, -O0):
<ecalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1154 <ecalloc+0x34>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <perror@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ecalloc>:
push   %rbx
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1133 <ecalloc+0x13>
mov    %rbx,%rax
pop    %rbx
ret
xor    %edi,%edi
call   1040 <perror@plt>
jmp    112e <ecalloc+0xe>

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

LLVM IR (-O2):
define noalias i8* @ecalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @perror(i32* null)
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t GET_BE32(const uint8_t *a) {
  return ((uint32_t)a[0] << 24) | (a[1] << 16) | (a[2] << 8) | a[3];
}


x86 assembly (clang, -O0):
<GET_BE32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
or     0xc(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GET_BE32>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x8(%rdi),%eax
shl    $0x8,%eax
or     %ecx,%eax
or     0xc(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @GET_BE32(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = shl i32 %5, 24
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
%10 = shl i32 %9, 16
%11 = or i32 %6, %10
%12 = load i32*, i32** %2
%13 = getelementptr inbounds i32, i32* %12, i64 2
%14 = load i32, i32* %13
%15 = shl i32 %14, 8
%16 = or i32 %11, %15
%17 = load i32*, i32** %2
%18 = getelementptr inbounds i32, i32* %17, i64 3
%19 = load i32, i32* %18
%20 = or i32 %16, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @GET_BE32(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 24
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = shl i32 %5, 16
%7 = or i32 %6, %3
%8 = getelementptr inbounds i32, i32* %0, i64 2
%9 = load i32, i32* %8
%10 = shl i32 %9, 8
%11 = or i32 %7, %10
%12 = getelementptr inbounds i32, i32* %0, i64 3
%13 = load i32, i32* %12
%14 = or i32 %11, %13
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ unset_pollfd(int);
void ws_close(int listener) {
  unset_pollfd(listener);
  close(listener);
}


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

x86 assembly (clang, -O2):
<ws_close>:
push   %rbx
mov    %edi,%ebx
call   1040 <unset_pollfd@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @ws_close(i32 %0) {
%2 = tail call i32 @unset_pollfd(i32 %0)
%3 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ closefile(int /*<<< orphan*/);
int /*<<< orphan*/ getnonullfile(int);
void io_close(void) { closefile(getnonullfile(2)); }


x86 assembly (clang, -O0):
<io_close>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1040 <getnonullfile@plt>
mov    %eax,%edi
call   1030 <closefile@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_close>:
push   %rax
mov    $0x2,%edi
call   1040 <getnonullfile@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <closefile@plt>

LLVM IR (-O0):
define void @io_close() {
%1 = call i32 @getnonullfile(i32 2)
%2 = call i32 @closefile(i32 %1)
ret void
}

LLVM IR (-O2):
define void @io_close() {
%1 = tail call i32 @getnonullfile(i32 2)
%2 = tail call i32 @closefile(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ malloc(unsigned int);
void *emalloc(unsigned int n) {
  void *ptr;
  ptr = (void *)malloc(n);
  if (ptr == NULL) {
    exit(EXIT_FAILURE);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<emalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <emalloc+0x30>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emalloc>:
push   %rax
call   1030 <malloc@plt>
test   %rax,%rax
je     112d <emalloc+0xd>
pop    %rcx
ret
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define i8* @emalloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i64 @malloc(i32 %4)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32, i32* @EXIT_FAILURE
%11 = call i32 @exit(i32 %10)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define i8* @emalloc(i32 %0) {
%2 = tail call i64 @malloc(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
7: ; preds = %1
%8 = inttoptr i64 %2 to i8*
ret i8* %8
}
/* Type definitions */
struct timeb {
  double millitm;
  int /*<<< orphan*/ time;
};

/* Variables and functions */
int /*<<< orphan*/ ftime(struct timeb *);
double seconds_to_milliseconds(int /*<<< orphan*/);
double milliseconds_since_epoch() {
  struct timeb current_time;
  ftime(&current_time);
  return seconds_to_milliseconds(current_time.time) + current_time.millitm;
}


x86 assembly (clang, -O0):
<milliseconds_since_epoch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
call   1040 <ftime@plt>
mov    -0x8(%rbp),%edi
call   1030 <seconds_to_milliseconds@plt>
addsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<milliseconds_since_epoch>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
call   1040 <ftime@plt>
mov    0x10(%rsp),%edi
call   1030 <seconds_to_milliseconds@plt>
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeb = type { double, i32 }
define double @milliseconds_since_epoch() {
%1 = alloca %struct.timeb
%2 = call i32 @ftime(%struct.timeb* %1)
%3 = getelementptr inbounds %struct.timeb, %struct.timeb* %1, i32 0, i32 1
%4 = load i32, i32* %3
%5 = call double @seconds_to_milliseconds(i32 %4)
%6 = getelementptr inbounds %struct.timeb, %struct.timeb* %1, i32 0, i32 0
%7 = load double, double* %6
%8 = fadd double %5, %7
ret double %8
}

LLVM IR (-O2):
%struct.timeb = type { double, i32 }
define double @milliseconds_since_epoch() {
%1 = alloca %struct.timeb
%2 = bitcast %struct.timeb* %1 to i8*
%3 = call i32 @ftime(%struct.timeb* %1)
%4 = getelementptr inbounds %struct.timeb, %struct.timeb* %1, i64 0, i32 1
%5 = load i32, i32* %4
%6 = call double @seconds_to_milliseconds(i32 %5)
%7 = getelementptr inbounds %struct.timeb, %struct.timeb* %1, i64 0, i32 0
%8 = load double, double* %7
%9 = fadd double %6, %8
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void stampa_stringa(char parola[]) {
  printf("Hai inserito la parola: %s\n", parola);
}


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

x86 assembly (clang, -O2):
<stampa_stringa>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Hai inserito la parola: %s\0A\00"
define void @stampa_stringa(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"Hai inserito la parola: %s\0A\00"
define void @stampa_stringa(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int standend();
int t_attrend() { return standend(); }


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

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

LLVM IR (-O0):
define i32 @t_attrend() {
%1 = call i32 (...) @standend()
ret i32 %1
}

LLVM IR (-O2):
define i32 @t_attrend() {
%1 = tail call i32 (...) @standend()
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void inicia_cronometro(time_t *medidor) { *medidor = time(NULL); }


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

x86 assembly (clang, -O2):
<inicia_cronometro>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
call   1030 <time@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @inicia_cronometro(i32* nocapture writeonly %0) {
%2 = tail call i32 @time(i32* null)
store i32 %2, i32* %0
ret void
}
double fabs(double x) {
  double t;
  __asm__("pcmpeqd %0, %0" : "=x"(t));
  __asm__("psrlq   $1, %0" : "+x"(t));
  __asm__("andps   %1, %0" : "+x"(x) : "x"(t));
  return x;
}


x86 assembly (clang, -O0):
<fabs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
pcmpeqd %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
psrlq  $0x1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
andps  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fabs>:
pcmpeqd %xmm1,%xmm1
psrlq  $0x1,%xmm1
andps  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @fabs(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = call double asm "pcmpeqd $0, $0", "=x,~{dirflag},~{fpsr},~{flags}"()
store double %4, double* %3
%5 = load double, double* %3
%6 = call double asm "psrlq $$1, $0", "=x,0,~{dirflag},~{fpsr},~{flags}"(double %5)
store double %6, double* %3
%7 = load double, double* %2
%8 = load double, double* %3
%9 = call double asm "andps $1, $0", "=x,x,0,~{dirflag},~{fpsr},~{flags}"(double %8, double %7)
store double %9, double* %2
%10 = load double, double* %2
ret double %10
}

LLVM IR (-O2):
define double @fabs(double %0) {
%2 = tail call double asm "pcmpeqd $0, $0", "=x,~{dirflag},~{fpsr},~{flags}"()
%3 = tail call double asm "psrlq $$1, $0", "=x,0,~{dirflag},~{fpsr},~{flags}"(double %2)
%4 = tail call double asm "andps $1, $0", "=x,x,0,~{dirflag},~{fpsr},~{flags}"(double %3, double %0)
ret double %4
}
void force_error() {}


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

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

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

LLVM IR (-O2):
define void @force_error() {
ret void
}
int valid_size(int size) {
  switch (size) {
  case 1:
  case 2:
  case 4:
  case 8:
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<valid_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xffffffff,%eax
sub    $0x2,%eax
jb     1140 <valid_size+0x40>
jmp    111e <valid_size+0x1e>
mov    -0xc(%rbp),%eax
sub    $0x4,%eax
je     1140 <valid_size+0x40>
jmp    112f <valid_size+0x2f>
mov    -0xc(%rbp),%eax
sub    $0x8,%eax
jne    114c <valid_size+0x4c>
jmp    1140 <valid_size+0x40>
movl   $0x1,-0x4(%rbp)
jmp    1153 <valid_size+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<valid_size>:
add    $0xffffffff,%edi
xor    %eax,%eax
cmp    $0x7,%edi
ja     1117 <valid_size+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

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

LLVM IR (-O2):
@switch.table.valid_size = [8 x i32] [i32 1, i32 1, i32 0, i32 1, i32 0, i32 0, i32 0, i32 1]
define i32 @valid_size(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 8
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [8 x i32], [8 x i32]* @switch.table.valid_size, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ checaNumero(int);
main() {
  int num;
  checaNumero(num);
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = call i32 @checaNumero(i32 %2)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @checaNumero(i32 undef)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ kconsole_init();
int /*<<< orphan*/ kprintf(char *, ...);
void kinit(void) {
  kconsole_init();
  kprintf("Hello, world!\n");
  kprintf("%d\n", 1 + 4);
}


x86 assembly (clang, -O0):
<kinit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <kconsole_init@plt>
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <kprintf@plt>
lea    0xecf(%rip),%rdi
mov    $0x5,%esi
mov    $0x0,%al
call   1030 <kprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<kinit>:
push   %rax
xor    %eax,%eax
call   1040 <kconsole_init@plt>
lea    0xed1(%rip),%rdi
xor    %eax,%eax
call   1030 <kprintf@plt>
lea    0xed2(%rip),%rdi
mov    $0x5,%esi
xor    %eax,%eax
pop    %rcx
jmp    1030 <kprintf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Hello, world!\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define void @kinit() {
%1 = call i32 (...) @kconsole_init()
%2 = call i32 (i8*, ...) @kprintf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (i8*, ...) @kprintf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 5)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"Hello, world!\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define void @kinit() {
%1 = tail call i32 (...) @kconsole_init()
%2 = tail call i32 (i8*, ...) @kprintf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @kprintf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 5)
ret void
}
/* Type definitions */
typedef int u_int32_t;

/* Variables and functions */
u_int32_t exiftags_gcd(u_int32_t a, u_int32_t b) {
  if (!b)
    return (a);
  return (exiftags_gcd(b, a % b));
}


x86 assembly (clang, -O0):
<exiftags_gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1133 <exiftags_gcd+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1147 <exiftags_gcd+0x37>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%esi
call   1030 <exiftags_gcd@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exiftags_gcd>:
mov    %edi,%eax
test   %esi,%esi
je     111d <exiftags_gcd+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <exiftags_gcd+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @exiftags_gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32 [ %5, %4 ], [ %0, %2 ]
%7 = srem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %5, %4 ]
ret i32 %10
}
char *strcpy(char *d, char *s) {
  register char *d1 = d;
  while (*d1++ = *s++)
    ;
  return d;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1143 <strcpy+0x43>
jmp    1114 <strcpy+0x14>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ mlMatrixCopy(float *, float *);
int /*<<< orphan*/ mlMatrixMultTo(float *, float const *, float *);
void mlMatrixMult(float *a, const float *b) {
  float result[16];
  mlMatrixMultTo(a, b, result);
  mlMatrixCopy(result, a);
}


x86 assembly (clang, -O0):
<mlMatrixMult>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x50(%rbp),%rdx
call   1040 <mlMatrixMultTo@plt>
lea    -0x50(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <mlMatrixCopy@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mlMatrixMult>:
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdx
call   1040 <mlMatrixMultTo@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <mlMatrixCopy@plt>
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @mlMatrixMult(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca [16 x float]
store float* %0, float** %3
store float* %1, float** %4
%6 = load float*, float** %3
%7 = load float*, float** %4
%8 = getelementptr inbounds [16 x float], [16 x float]* %5, i64 0, i64 0
%9 = call i32 @mlMatrixMultTo(float* %6, float* %7, float* %8)
%10 = getelementptr inbounds [16 x float], [16 x float]* %5, i64 0, i64 0
%11 = load float*, float** %3
%12 = call i32 @mlMatrixCopy(float* %10, float* %11)
ret void
}

LLVM IR (-O2):
define void @mlMatrixMult(float* %0, float* %1) {
%3 = alloca [16 x float]
%4 = bitcast [16 x float]* %3 to i8*
%5 = getelementptr inbounds [16 x float], [16 x float]* %3, i64 0, i64 0
%6 = call i32 @mlMatrixMultTo(float* %0, float* %1, float* %5)
%7 = call i32 @mlMatrixCopy(float* %5, float* %0)
ret void
}
/* Variables and functions */
int f27(int *);
int f28(int *p) { return f27(p); }


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

x86 assembly (clang, -O2):
<f28>:
jmp    1030 <f27@plt>

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

LLVM IR (-O2):
define i32 @f28(i32* %0) {
%2 = tail call i32 @f27(i32* %0)
ret i32 %2
}
xcpumin_(t) double *t;
{
  double sec;
  second_(&sec);
  *t = sec / 60.0;
}


x86 assembly (clang, -O0):
<xcpumin_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1030 <second_@plt>
movsd  -0x18(%rbp),%xmm0
movsd  0xecc(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcpumin_>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rdi
xor    %eax,%eax
call   1030 <second_@plt>
movsd  0x8(%rsp),%xmm0
divsd  0xece(%rip),%xmm0
movsd  %xmm0,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @xcpumin_(double* %0) {
%2 = alloca i32
%3 = alloca double*
%4 = alloca double
store double* %0, double** %3
%5 = call i32 (double*, ...) bitcast (i32 (...)* @second_ to i32 (double*, ...)*)(double* %4)
%6 = load double, double* %4
%7 = fdiv double %6, 6.000000e+01
%8 = load double*, double** %3
store double %7, double* %8
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @xcpumin_(double* nocapture writeonly %0) {
%2 = alloca double
%3 = bitcast double* %2 to i8*
%4 = call i32 (double*, ...) bitcast (i32 (...)* @second_ to i32 (double*, ...)*)(double* %2)
%5 = load double, double* %2
%6 = fdiv double %5, 6.000000e+01
store double %6, double* %0
ret i32 undef
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int solcon_retrieve_next_multprec_initialize(void) {
  int a, *b, fail;
  double *c;
  a = 0;
  fail = _ada_use_c2phc4c(279, &a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<solcon_retrieve_next_multprec_initialize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x117,%edi
lea    -0x4(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solcon_retrieve_next_multprec_initialize>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x117,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @solcon_retrieve_next_multprec_initialize() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @_ada_use_c2phc4c(i32 279, i32* %1, i32* undef, double* undef, i32 0)
ret i32 %3
}