xunge/DecIR huggingface dataset:
/* Type definitions */
struct user_desc {
  int dummy;
};
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ __NR_clone;
int /*<<< orphan*/ syscall(int /*<<< orphan*/, int, void *, int *,
                           struct user_desc *, int *);
pid_t raw_clone(int flags, void *child_stack, int *parent_tidptr,
                struct user_desc *newtls, int *child_tidptr) {
  return syscall(__NR_clone, flags, child_stack, parent_tidptr, newtls,
                 child_tidptr);
}


x86 assembly (clang, -O0):
<raw_clone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
call   1030 <syscall@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<raw_clone>:
mov    %r8,%r9
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2ecb(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.user_desc = type { i32 }
@__NR_clone = global i32 0
define i32 @raw_clone(i32 %0, i8* %1, i32* %2, %struct.user_desc* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32*
%9 = alloca %struct.user_desc*
%10 = alloca i32*
store i32 %0, i32* %6
store i8* %1, i8** %7
store i32* %2, i32** %8
store %struct.user_desc* %3, %struct.user_desc** %9
store i32* %4, i32** %10
%11 = load i32, i32* @__NR_clone
%12 = load i32, i32* %6
%13 = load i8*, i8** %7
%14 = load i32*, i32** %8
%15 = load %struct.user_desc*, %struct.user_desc** %9
%16 = load i32*, i32** %10
%17 = call i32 @syscall(i32 %11, i32 %12, i8* %13, i32* %14, %struct.user_desc* %15, i32* %16)
ret i32 %17
}

LLVM IR (-O2):
%struct.user_desc = type { i32 }
@__NR_clone = global i32 0
define i32 @raw_clone(i32 %0, i8* %1, i32* %2, %struct.user_desc* %3, i32* %4) {
%6 = load i32, i32* @__NR_clone
%7 = tail call i32 @syscall(i32 %6, i32 %0, i8* %1, i32* %2, %struct.user_desc* %3, i32* %4)
ret i32 %7
}
int typeof1(char c) {
  if (c == '(')
    return 1;
  if (c == ')')
    return 2;
  if (c == '+' || c == '-' || c == '*' || c == '/')
    return 3;
  if (c == ' ')
    return 4;
  else
    return 5;
}


x86 assembly (clang, -O0):
<typeof1>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x28,%eax
jne    1123 <typeof1+0x23>
movl   $0x1,-0x4(%rbp)
jmp    119c <typeof1+0x9c>
movsbl -0x5(%rbp),%eax
cmp    $0x29,%eax
jne    113c <typeof1+0x3c>
movl   $0x2,-0x4(%rbp)
jmp    119c <typeof1+0x9c>
movsbl -0x5(%rbp),%eax
cmp    $0x2b,%eax
je     1170 <typeof1+0x70>
movsbl -0x5(%rbp),%eax
cmp    $0x2d,%eax
je     1170 <typeof1+0x70>
movsbl -0x5(%rbp),%eax
cmp    $0x2a,%eax
je     1170 <typeof1+0x70>
movsbl -0x5(%rbp),%eax
cmp    $0x2f,%eax
jne    117c <typeof1+0x7c>
movl   $0x3,-0x4(%rbp)
jmp    119c <typeof1+0x9c>
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
jne    1195 <typeof1+0x95>
movl   $0x4,-0x4(%rbp)
jmp    119c <typeof1+0x9c>
movl   $0x5,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<typeof1>:
add    $0xe0,%dil
mov    $0x5,%eax
cmp    $0xf,%dil
ja     111d <typeof1+0x1d>
movsbq %dil,%rax
lea    0xee6(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @typeof1(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
%6 = icmp eq i32 %5, 40
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %36
8: ; preds = %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 41
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 2, i32* %2
br label %36
13: ; preds = %8
%14 = load i8, i8* %3
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 43
br i1 %16, label %29, label %17
17: ; preds = %13
%18 = load i8, i8* %3
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 45
br i1 %20, label %29, label %21
21: ; preds = %17
%22 = load i8, i8* %3
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 42
br i1 %24, label %29, label %25
25: ; preds = %21
%26 = load i8, i8* %3
%27 = sext i8 %26 to i32
%28 = icmp eq i32 %27, 47
br i1 %28, label %29, label %30
29: ; preds = %25, %21, %17, %13
store i32 3, i32* %2
br label %36
30: ; preds = %25
%31 = load i8, i8* %3
%32 = sext i8 %31 to i32
%33 = icmp eq i32 %32, 32
br i1 %33, label %34, label %35
34: ; preds = %30
store i32 4, i32* %2
br label %36
35: ; preds = %30
store i32 5, i32* %2
br label %36
36: ; preds = %35, %34, %29, %12, %7
%37 = load i32, i32* %2
ret i32 %37
}

LLVM IR (-O2):
@switch.table.typeof1 = [16 x i32] [i32 4, i32 5, i32 5, i32 5, i32 5, i32 5, i32 5, i32 5, i32 1, i32 2, i32 3, i32 3, i32 5, i32 3, i32 5, i32 3]
define i32 @typeof1(i8 signext %0) {
%2 = add i8 %0, -32
%3 = icmp ult i8 %2, 16
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i8 %2 to i64
%6 = getelementptr inbounds [16 x i32], [16 x i32]* @switch.table.typeof1, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 5, %1 ]
ret i32 %9
}
void astar_getCoordByWidth(int width, int node, int *x, int *y) {
  *x = node % width;
  *y = node / width;
}


x86 assembly (clang, -O0):
<astar_getCoordByWidth>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %edx,(%rax)
mov    -0x8(%rbp),%eax
cltd
idivl  -0x4(%rbp)
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<astar_getCoordByWidth>:
mov    %rdx,%r8
mov    %esi,%eax
cltd
idiv   %edi
mov    %edx,(%r8)
mov    %eax,(%rcx)
ret

LLVM IR (-O0):
define void @astar_getCoordByWidth(i32 %0, i32 %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32, i32* %6
%10 = load i32, i32* %5
%11 = srem i32 %9, %10
%12 = load i32*, i32** %7
store i32 %11, i32* %12
%13 = load i32, i32* %6
%14 = load i32, i32* %5
%15 = sdiv i32 %13, %14
%16 = load i32*, i32** %8
store i32 %15, i32* %16
ret void
}

LLVM IR (-O2):
define void @astar_getCoordByWidth(i32 %0, i32 %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3) {
%5 = srem i32 %1, %0
store i32 %5, i32* %2
%6 = sdiv i32 %1, %0
store i32 %6, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ emu_file_write_track_bits(int, int /*<<< orphan*/ *,
                                             int /*<<< orphan*/, int, int,
                                             int /*<<< orphan*/);
int /*<<< orphan*/ fsync(int);
void emu_file_close(int fd, int write_eof) {
  if (fd != -1) {
    if (write_eof) {
      emu_file_write_track_bits(fd, NULL, 0, -1, -1, 0);
    }
    fsync(fd);
    close(fd);
  }
}


x86 assembly (clang, -O0):
<emu_file_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
je     117d <emu_file_close+0x4d>
cmpl   $0x0,-0x8(%rbp)
je     116d <emu_file_close+0x3d>
mov    -0x4(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
xor    %r9d,%r9d
mov    $0xffffffff,%r8d
mov    %r9d,%edx
mov    %r8d,%ecx
call   1050 <emu_file_write_track_bits@plt>
mov    -0x4(%rbp),%edi
call   1040 <fsync@plt>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emu_file_close>:
cmp    $0xffffffff,%edi
je     1164 <emu_file_close+0x34>
push   %rbx
mov    %edi,%ebx
test   %esi,%esi
je     1155 <emu_file_close+0x25>
mov    %ebx,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    $0xffffffff,%ecx
mov    $0xffffffff,%r8d
xor    %r9d,%r9d
call   1050 <emu_file_write_track_bits@plt>
mov    %ebx,%edi
call   1040 <fsync@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <close@plt>
ret

LLVM IR (-O0):
define void @emu_file_close(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 = icmp ne i32 %5, -1
br i1 %6, label %7, label %18
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load i32, i32* %3
%12 = call i32 @emu_file_write_track_bits(i32 %11, i32* null, i32 0, i32 -1, i32 -1, i32 0)
br label %13
13: ; preds = %10, %7
%14 = load i32, i32* %3
%15 = call i32 @fsync(i32 %14)
%16 = load i32, i32* %3
%17 = call i32 @close(i32 %16)
br label %18
18: ; preds = %13, %2
ret void
}

LLVM IR (-O2):
define void @emu_file_close(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, -1
br i1 %3, label %11, label %4
4: ; preds = %2
%5 = icmp eq i32 %1, 0
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = tail call i32 @emu_file_write_track_bits(i32 %0, i32* null, i32 0, i32 -1, i32 -1, i32 0)
br label %8
8: ; preds = %6, %4
%9 = tail call i32 @fsync(i32 %0)
%10 = tail call i32 @close(i32 %0)
br label %11
11: ; preds = %8, %2
ret void
}
int es_letra(char c) { return c >= 'A' && c <= 'z'; }


x86 assembly (clang, -O0):
<es_letra>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <es_letra+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x7a,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<es_letra>:
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x3a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @es_letra(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 122
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @es_letra(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 58
%4 = zext i1 %3 to i32
ret i32 %4
}
int KAPI_ia64_GetAPIVersion_MAJOR() { return 4; }


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

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

LLVM IR (-O0):
define i32 @KAPI_ia64_GetAPIVersion_MAJOR() {
ret i32 4
}

LLVM IR (-O2):
define i32 @KAPI_ia64_GetAPIVersion_MAJOR() {
ret i32 4
}
double CHARGEF(void) { return 0.5 / 2; }


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

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

LLVM IR (-O0):
define double @CHARGEF() {
ret double 2.500000e-01
}

LLVM IR (-O2):
define double @CHARGEF() {
ret double 2.500000e-01
}
XChangeWindowAttributes() {}


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

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

LLVM IR (-O0):
define i32 @XChangeWindowAttributes() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XChangeWindowAttributes() {
ret i32 undef
}
int fun781() { return 781; }


x86 assembly (clang, -O0):
<fun781>:
push   %rbp
mov    %rsp,%rbp
mov    $0x30d,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fun781() {
ret i32 781
}

LLVM IR (-O2):
define i32 @fun781() {
ret i32 781
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) { printf("Hello, world."); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"Hello, world.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void RTS3Create(void) {}


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

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

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

LLVM IR (-O2):
define void @RTS3Create() {
ret void
}
adrx0imm1(r0, r1, x0, x1, p0, p1) double r0, r1;
double *p0, *p1;
{
  if ((((double *)10000000)[x0]) <= 33)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adrx0imm1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    %esi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
movslq -0x1c(%rbp),%rcx
movsd  0xed8(%rip),%xmm0
mov    $0x989680,%eax
ucomisd (%rax,%rcx,8),%xmm0
jb     1144 <adrx0imm1+0x44>
movl   $0x1,-0x4(%rbp)
jmp    114b <adrx0imm1+0x4b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrx0imm1>:
movslq %edi,%rcx
movsd  0xef5(%rip),%xmm0
xor    %eax,%eax
ucomisd 0x989680(,%rcx,8),%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @adrx0imm1(double %0, double %1, i32 %2, i32 %3, double* %4, double* %5) {
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca i32
%11 = alloca i32
%12 = alloca double*
%13 = alloca double*
store double %0, double* %8
store double %1, double* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store double* %4, double** %12
store double* %5, double** %13
%14 = load i32, i32* %10
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds double, double* inttoptr (i64 10000000 to double*), i64 %15
%17 = load double, double* %16
%18 = fcmp ole double %17, 3.300000e+01
br i1 %18, label %19, label %20
19: ; preds = %6
store i32 1, i32* %7
br label %21
20: ; preds = %6
store i32 0, i32* %7
br label %21
21: ; preds = %20, %19
%22 = load i32, i32* %7
ret i32 %22
}

LLVM IR (-O2):
define i32 @adrx0imm1(double %0, double %1, i32 %2, i32 %3, double* nocapture readnone %4, double* nocapture readnone %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds double, double* inttoptr (i64 10000000 to double*), i64 %7
%9 = load double, double* %8
%10 = fcmp ole double %9, 3.300000e+01
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int __get_IPSR();
__attribute__((always_)) int irq_is_in(void) { return (__get_IPSR() & 0xFF); }


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

x86 assembly (clang, -O2):
<irq_is_in>:
push   %rax
xor    %eax,%eax
call   1030 <__get_IPSR@plt>
movzbl %al,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @irq_is_in() {
%1 = call i32 (...) @__get_IPSR()
%2 = and i32 %1, 255
ret i32 %2
}

LLVM IR (-O2):
define i32 @irq_is_in() {
%1 = tail call i32 (...) @__get_IPSR()
%2 = and i32 %1, 255
ret i32 %2
}
/* Variables and functions */
double genrand_int32();
double genrand_real2(void) { return genrand_int32() * 2.3283064365386963e-10; }


x86 assembly (clang, -O0):
<genrand_real2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <genrand_int32@plt>
movsd  0xedd(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<genrand_real2>:
push   %rax
xor    %eax,%eax
call   1030 <genrand_int32@plt>
mulsd  0xee0(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @genrand_real2() {
%1 = call double (...) @genrand_int32()
%2 = fmul double %1, 0x3DF0000000000000
ret double %2
}

LLVM IR (-O2):
define double @genrand_real2() {
%1 = tail call double (...) @genrand_int32()
%2 = fmul double %1, 0x3DF0000000000000
ret double %2
}
int f10(int x, int y) {
  if (x != -0x7fffffff)
    return x % -y;
  return 34;
}


x86 assembly (clang, -O0):
<f10>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x80000001,-0x8(%rbp)
je     112a <f10+0x2a>
mov    -0x8(%rbp),%eax
xor    %ecx,%ecx
sub    -0xc(%rbp),%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
jmp    1131 <f10+0x31>
movl   $0x22,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f10>:
mov    $0x22,%eax
cmp    $0x80000001,%edi
je     1116 <f10+0x16>
neg    %esi
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @f10(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, -2147483647
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = sub nsw i32 0, %1
%6 = srem i32 %0, %5
br label %7
7: ; preds = %2, %4
%8 = phi i32 [ %6, %4 ], [ 34, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_15072() {
  Assert_real((isqrt(15072) == 122),
              "/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/stdlib/isqrt.c",
              1600, ("Integer square root of 15072 should be 122"));
}


x86 assembly (clang, -O0):
<t_sqrt_15072>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3ae0,%edi
call   1030 <isqrt@plt>
cmp    $0x7a,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x640,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_15072>:
push   %rax
mov    $0x3ae0,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x7a,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x640,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [43 x i8] c"Integer square root of 15072 should be 122\00"
define void @t_sqrt_15072() {
%1 = call i32 @isqrt(i32 15072)
%2 = icmp eq i32 %1, 122
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1600, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [43 x i8] c"Integer square root of 15072 should be 122\00"
define void @t_sqrt_15072() {
%1 = tail call i32 @isqrt(i32 15072)
%2 = icmp eq i32 %1, 122
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1600, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void ddump(void *p2, int len) {
  char *p = (char *)p2;
  int i;
  for (i = 0; i < len; i++) {
    do {
    } while (0);
    p++;
    if ((i & 15) == 15) {
      do {
      } while (0);
    }
  }
  if (i & 15) {
    do {
    } while (0);
  }
}


x86 assembly (clang, -O0):
<ddump>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    116d <ddump+0x6d>
jmp    112b <ddump+0x2b>
jmp    1130 <ddump+0x30>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
and    $0xf,%eax
cmp    $0xf,%eax
jne    115a <ddump+0x5a>
jmp    1150 <ddump+0x50>
jmp    1155 <ddump+0x55>
jmp    115a <ddump+0x5a>
jmp    115f <ddump+0x5f>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    111a <ddump+0x1a>
mov    -0x1c(%rbp),%eax
and    $0xf,%eax
cmp    $0x0,%eax
je     118b <ddump+0x8b>
jmp    1181 <ddump+0x81>
jmp    1186 <ddump+0x86>
jmp    118b <ddump+0x8b>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @ddump(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abortmsg(char *);
void *realloc(void *, size_t);
void *reallocx(void *ptr, size_t size) {
  void *result = realloc(ptr, size);
  if (!result)
    abortmsg("failed to realloc");
  return result;
}


x86 assembly (clang, -O0):
<reallocx>:
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 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1158 <reallocx+0x38>
lea    0xead(%rip),%rdi
call   1040 <abortmsg@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reallocx>:
push   %rbx
call   1030 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <reallocx+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <abortmsg@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"failed to realloc\00"
define i8* @reallocx(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %13, label %11
11: ; preds = %2
%12 = call i32 @abortmsg(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %2
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
@.str = [18 x i8] c"failed to realloc\00"
define noalias i8* @reallocx(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @abortmsg(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ pipeout_close();
int /*<<< orphan*/ pipeout_open();
int /*<<< orphan*/ pipeout_write(char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
void pipeout_error(char *str) {
  pipeout_open();
  pipeout_write(str, strlen(str));
  pipeout_close();
}


x86 assembly (clang, -O0):
<pipeout_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1060 <pipeout_open@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1050 <pipeout_write@plt>
mov    $0x0,%al
call   1030 <pipeout_close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pipeout_error>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1060 <pipeout_open@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <pipeout_write@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <pipeout_close@plt>

LLVM IR (-O0):
define void @pipeout_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @pipeout_open()
%4 = load i8*, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = call i32 @pipeout_write(i8* %4, i32 %6)
%8 = call i32 (...) @pipeout_close()
ret void
}

LLVM IR (-O2):
define void @pipeout_error(i8* %0) {
%2 = tail call i32 (...) @pipeout_open()
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @pipeout_write(i8* %0, i32 %3)
%5 = tail call i32 (...) @pipeout_close()
ret void
}
int tcg_target_get_call_iarg_regs_count(int flags) { return 8; }


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

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

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

LLVM IR (-O2):
define i32 @tcg_target_get_call_iarg_regs_count(i32 %0) {
ret i32 8
}
int min3(int a, int b, int c) {
  int min = a;
  if (b < min)
    min = b;
  if (c < min)
    min = c;
  return min;
}


x86 assembly (clang, -O0):
<min3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1125 <min3+0x25>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1137 <min3+0x37>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @min3(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* %4
store i32 %8, i32* %7
%9 = load i32, i32* %5
%10 = load i32, i32* %7
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %3
%13 = load i32, i32* %5
store i32 %13, i32* %7
br label %14
14: ; preds = %12, %3
%15 = load i32, i32* %6
%16 = load i32, i32* %7
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = load i32, i32* %6
store i32 %19, i32* %7
br label %20
20: ; preds = %18, %14
%21 = load i32, i32* %7
ret i32 %21
}

LLVM IR (-O2):
define i32 @min3(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %0
%5 = select i1 %4, i32 %1, i32 %0
%6 = icmp sgt i32 %5, %2
%7 = select i1 %6, i32 %2, i32 %5
ret i32 %7
}
/* Type definitions */
struct hostent {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
struct hostent *gethostbyname2(char *, int /*<<< orphan*/);
int main() {
  struct hostent *h = gethostbyname2("localhost", AF_INET);
  return h == NULL;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%esi
lea    0xed1(%rip),%rdi
call   1030 <gethostbyname2@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <gethostbyname2@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.hostent = type { i32 }
@.str = [10 x i8] c"localhost\00"
@AF_INET = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.hostent*
store i32 0, i32* %1
%3 = load i32, i32* @AF_INET
%4 = call %struct.hostent* @gethostbyname2(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3)
store %struct.hostent* %4, %struct.hostent** %2
%5 = load %struct.hostent*, %struct.hostent** %2
%6 = icmp eq %struct.hostent* %5, null
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
%struct.hostent = type { i32 }
@.str = [10 x i8] c"localhost\00"
@AF_INET = global i32 0
define i32 @main() {
%1 = load i32, i32* @AF_INET
%2 = tail call %struct.hostent* @gethostbyname2(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp eq %struct.hostent* %2, null
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *strcop(char *);
void str_array_set(char **arr, int pos, char *val) {
  if (arr[pos] != NULL)
    free(arr[pos]);
  arr[pos] = strcop(val);
}


x86 assembly (clang, -O0):
<str_array_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1157 <str_array_set+0x37>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1040 <strcop@plt>
mov    %rax,%rdx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_array_set>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rdi,%r15
movslq %esi,%rbx
mov    (%rdi,%rbx,8),%rdi
test   %rdi,%rdi
je     113c <str_array_set+0x1c>
call   1030 <free@plt>
mov    %r14,%rdi
call   1040 <strcop@plt>
mov    %rax,(%r15,%rbx,8)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @str_array_set(i8** %0, i32 %1, i8* %2) {
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i8*
store i8** %0, i8*** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8**, i8*** %4
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8*, i8** %7, i64 %9
%11 = load i8*, i8** %10
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %20
13: ; preds = %3
%14 = load i8**, i8*** %4
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8*, i8** %14, i64 %16
%18 = load i8*, i8** %17
%19 = call i32 @free(i8* %18)
br label %20
20: ; preds = %13, %3
%21 = load i8*, i8** %6
%22 = call i8* @strcop(i8* %21)
%23 = load i8**, i8*** %4
%24 = load i32, i32* %5
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8*, i8** %23, i64 %25
store i8* %22, i8** %26
ret void
}

LLVM IR (-O2):
define void @str_array_set(i8** nocapture %0, i32 %1, i8* %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8*, i8** %0, i64 %4
%6 = load i8*, i8** %5
%7 = icmp eq i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %3
%9 = tail call i32 @free(i8* %6)
br label %10
10: ; preds = %8, %3
%11 = tail call i8* @strcop(i8* %2)
store i8* %11, i8** %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, short, short);
void b_debug_16(short idx, short *cells, int size) {
  printf("Index Pointer: %d Value at Index Pointer: %d\n", idx, cells[idx]);
}


x86 assembly (clang, -O0):
<b_debug_16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x2(%rbp),%dx
mov    -0x10(%rbp),%rax
movswq -0x2(%rbp),%rcx
lea    0xec6(%rip),%rdi
movswl %dx,%esi
movswl (%rax,%rcx,2),%edx
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_debug_16>:
movslq %edi,%rax
movswl (%rsi,%rax,2),%edx
lea    0xee2(%rip),%rdi
mov    %eax,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"Index Pointer: %d Value at Index Pointer: %d\0A\00"
define void @b_debug_16(i16 signext %0, i16* %1, i32 %2) {
%4 = alloca i16
%5 = alloca i16*
%6 = alloca i32
store i16 %0, i16* %4
store i16* %1, i16** %5
store i32 %2, i32* %6
%7 = load i16, i16* %4
%8 = load i16*, i16** %5
%9 = load i16, i16* %4
%10 = sext i16 %9 to i64
%11 = getelementptr inbounds i16, i16* %8, i64 %10
%12 = load i16, i16* %11
%13 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i16 signext %7, i16 signext %12)
ret void
}

LLVM IR (-O2):
@.str = [46 x i8] c"Index Pointer: %d Value at Index Pointer: %d\0A\00"
define void @b_debug_16(i16 signext %0, i16* nocapture %1, i32 %2) {
%4 = sext i16 %0 to i64
%5 = getelementptr inbounds i16, i16* %1, i64 %4
%6 = load i16, i16* %5
%7 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i16 signext %0, i16 signext %6)
ret void
}
void *test_anti_range_101(unsigned short n) {
  extern void *alloc_anti_range_101(unsigned short)
      __attribute__((alloc_size(1)));
  if (0 <= n && n <= 2)
    n = 0 - 1;
  return alloc_anti_range_101(n);
}


x86 assembly (clang, -O0):
<test_anti_range_101>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jg     1140 <test_anti_range_101+0x30>
movzwl -0x2(%rbp),%eax
cmp    $0x2,%eax
jg     1140 <test_anti_range_101+0x30>
movw   $0xffff,-0x2(%rbp)
movzwl -0x2(%rbp),%edi
call   1030 <alloc_anti_range_101@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_101>:
cmp    $0x3,%di
mov    $0xffff,%eax
cmovb  %eax,%edi
jmp    1030 <alloc_anti_range_101@plt>

LLVM IR (-O0):
define i8* @test_anti_range_101(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = icmp sle i32 0, %4
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i16, i16* %2
%8 = zext i16 %7 to i32
%9 = icmp sle i32 %8, 2
br i1 %9, label %10, label %11
10: ; preds = %6
store i16 -1, i16* %2
br label %11
11: ; preds = %10, %6, %1
%12 = load i16, i16* %2
%13 = call i8* @alloc_anti_range_101(i16 zeroext %12)
ret i8* %13
}

LLVM IR (-O2):
define i8* @test_anti_range_101(i16 zeroext %0) {
%2 = icmp ult i16 %0, 3
%3 = select i1 %2, i16 -1, i16 %0
%4 = tail call i8* @alloc_anti_range_101(i16 zeroext %3)
ret i8* %4
}
/* Variables and functions */
int shim_enosys(int /*<<< orphan*/, int);
int shim_unshare(int flags) { return shim_enosys(0, flags); }


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

x86 assembly (clang, -O2):
<shim_unshare>:
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <shim_enosys@plt>

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

LLVM IR (-O2):
define i32 @shim_unshare(i32 %0) {
%2 = tail call i32 @shim_enosys(i32 0, i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void f1(void) { puts("\nf1"); }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"\0Af1\00"
define void @f1() {
%1 = call i32 @puts(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"\0Af1\00"
define void @f1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
void roadmap_start_download_map(void) {}


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

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

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

LLVM IR (-O2):
define void @roadmap_start_download_map() {
ret void
}
int *__attribute__((no, used)) ox(int *i, int *j) { return i; }


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

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

LLVM IR (-O0):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32* (i32*, i32*)* @ox to i8*)], section "llvm.metadata"
define i32* @ox(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
ret i32* %5
}

LLVM IR (-O2):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32* (i32*, i32*)* @ox to i8*)], section "llvm.metadata"
define i32* @ox(i32* readnone returned %0, i32* nocapture readnone %1) {
ret i32* %0
}
char *stralloc2(s1, s2)
char *s1;
char *s2;
{
  return strcat(strcpy(my_malloc(strlen(s1) + strlen(s2) + 1, "stralloc2"), s1),
                s2);
}


x86 assembly (clang, -O0):
<stralloc2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x18(%rbp),%rdi
add    %rax,%rdi
add    $0x1,%rdi
lea    0xe88(%rip),%rsi
mov    $0x0,%al
call   1030 <my_malloc@plt>
movslq %eax,%rdi
mov    -0x8(%rbp),%rsi
call   1040 <strcpy@plt>
mov    %rax,%rdi
mov    -0x10(%rbp),%rsi
call   1060 <strcat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stralloc2>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1050 <strlen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1050 <strlen@plt>
lea    (%rbx,%rax,1),%rdi
add    $0x1,%rdi
lea    0xe96(%rip),%rsi
xor    %eax,%eax
call   1030 <my_malloc@plt>
movslq %eax,%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1060 <strcat@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"stralloc2\00"
define i8* @stralloc2(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i64 @strlen(i8* %5)
%7 = load i8*, i8** %4
%8 = call i64 @strlen(i8* %7)
%9 = add i64 %6, %8
%10 = add i64 %9, 1
%11 = call i32 (i64, i8*, ...) bitcast (i32 (...)* @my_malloc to i32 (i64, i8*, ...)*)(i64 %10, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i8*
%14 = load i8*, i8** %3
%15 = call i8* @strcpy(i8* %13, i8* %14)
%16 = load i8*, i8** %4
%17 = call i8* @strcat(i8* %15, i8* %16)
ret i8* %17
}

LLVM IR (-O2):
@.str = [10 x i8] c"stralloc2\00"
define i8* @stralloc2(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = add i64 %3, 1
%6 = add i64 %5, %4
%7 = tail call i32 (i64, i8*, ...) bitcast (i32 (...)* @my_malloc to i32 (i64, i8*, ...)*)(i64 %6, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
%10 = tail call i8* @strcpy(i8* dereferenceable(1) %9, i8* dereferenceable(1) %0)
%11 = tail call i8* @strcat(i8* dereferenceable(1) %9, i8* dereferenceable(1) %1)
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ F_OK;
scalar_t__ access(char const *, int /*<<< orphan*/);
int is_file(const char *filename) { return (access(filename, F_OK) == 0); }


x86 assembly (clang, -O0):
<is_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_file>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@F_OK = global i32 0
define i32 @is_file(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @F_OK
%5 = call i64 @access(i8* %3, i32 %4)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
@F_OK = global i32 0
define i32 @is_file(i8* nocapture %0) {
%2 = load i32, i32* @F_OK
%3 = tail call i64 @access(i8* %0, i32 %2)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
void gdk_pango_renderer_new() {}


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

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

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

LLVM IR (-O2):
define void @gdk_pango_renderer_new() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *, char *);
void print_help(char *name) {
  printf("Version: %s\nCopyright (C) 2014 daneos.\nReleased under the GNU GPL "
         "v2 license.\n\n"
         "List only these files, you have access to\nUSAGE:\n"
         "   %s [-rwx] [-u username] [-v s/l/m] [dir]\n\n"
         "   -rwx          which permissions shoud be checked (default: rw)\n"
         "   -u username   check permissions for specific user (default: "
         "current user)\n"
         "   -v s/l/m      s - short view, l - long view, m - minimal view "
         "(default: l)\n"
         "   dir           directory to list (default: .)\n\n",
         "1.0.1", name);
  exit(0);
}


x86 assembly (clang, -O0):
<print_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xec9(%rip),%rdi
lea    0x107e(%rip),%rsi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_help>:
push   %rax
mov    %rdi,%rdx
lea    0xed5(%rip),%rdi
lea    0x108a(%rip),%rsi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [444 x i8] c"Version: %s\0ACopyright (C) 2014 daneos.\0AReleased under the GNU GPL v2 license.\0A\0AList only these files, you have access to\0AUSAGE:\0A %s [-rwx] [-u username] [-v s/l/m] [dir]\0A\0A -rwx which permissions shoud be checked (default: rw)\0A -u username check permissions for specific user (default: current user)\0A -v s/l/m s - short view, l - long view, m - minimal view (default: l)\0A dir directory to list (default: .)\0A\0A\00"
@.str.1 = [6 x i8] c"1.0.1\00"
define void @print_help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([444 x i8], [444 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [444 x i8] c"Version: %s\0ACopyright (C) 2014 daneos.\0AReleased under the GNU GPL v2 license.\0A\0AList only these files, you have access to\0AUSAGE:\0A %s [-rwx] [-u username] [-v s/l/m] [dir]\0A\0A -rwx which permissions shoud be checked (default: rw)\0A -u username check permissions for specific user (default: current user)\0A -v s/l/m s - short view, l - long view, m - minimal view (default: l)\0A dir directory to list (default: .)\0A\0A\00"
@.str.1 = [6 x i8] c"1.0.1\00"
define void @print_help(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([444 x i8], [444 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 0)
unreachable
}
void kol_paint_string(unsigned x, unsigned y, char *s, unsigned c) {
  asm volatile("int $0x40" ::"a"(4), "b"(x * 65536 + y), "c"(c), "d"(s));
}


x86 assembly (clang, -O0):
<kol_paint_string>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0xc(%rbp),%ebx
shl    $0x10,%ebx
add    -0x10(%rbp),%ebx
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%rdx
mov    $0x4,%eax
int    $0x40
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<kol_paint_string>:
push   %rbx
shl    $0x10,%edi
lea    (%rdi,%rsi,1),%ebx
mov    $0x4,%eax
int    $0x40
pop    %rbx
ret

LLVM IR (-O0):
define void @kol_paint_string(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = mul i32 %9, 65536
%11 = load i32, i32* %6
%12 = add i32 %10, %11
%13 = load i32, i32* %8
%14 = load i8*, i8** %7
ret void
}

LLVM IR (-O2):
define void @kol_paint_string(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = shl i32 %0, 16
%6 = add i32 %5, %1
tail call void asm sideeffect "int $$0x40", "{ax},{bx},{cx},{dx},~{dirflag},~{fpsr},~{flags}"(i32 4, i32 %6, i32 %3, i8* %2)
ret void
}
long int simple_1(long int *xp, long int y) {
  long int t = *xp + t;
  *xp = t;
  return t;
}


x86 assembly (clang, -O0):
<simple_1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @simple_1(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
%5 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%6 = load i64*, i64** %3
%7 = load i64, i64* %6
%8 = load i64, i64* %5
%9 = add nsw i64 %7, %8
store i64 %9, i64* %5
%10 = load i64, i64* %5
%11 = load i64*, i64** %3
store i64 %10, i64* %11
%12 = load i64, i64* %5
ret i64 %12
}

LLVM IR (-O2):
define i64 @simple_1(i64* nocapture readnone %0, i64 %1) {
ret i64 undef
}
/* Variables and functions */
int snprintf(char *, size_t, char *, char *, char const *);
int fixture_buffer(char *buff, size_t n, const char *file) {
  return snprintf(buff, n, "%s/%s", "../fixtures", file);
}


x86 assembly (clang, -O0):
<fixture_buffer>:
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    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%r8
lea    0xec9(%rip),%rdx
lea    0xec8(%rip),%rcx
call   1030 <snprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fixture_buffer>:
mov    %rdx,%r8
lea    0xee6(%rip),%rdx
lea    0xee5(%rip),%rcx
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%s/%s\00"
@.str.1 = [12 x i8] c"../fixtures\00"
define i32 @fixture_buffer(i8* %0, i64 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = load i8*, i8** %6
%10 = call i32 @snprintf(i8* %7, i64 %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %9)
ret i32 %10
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s/%s\00"
@.str.1 = [12 x i8] c"../fixtures\00"
define i32 @fixture_buffer(i8* %0, i64 %1, i8* %2) {
%4 = tail call i32 @snprintf(i8* %0, i64 %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 %4
}
int fpxxo(void) { return 5 + 100; }


x86 assembly (clang, -O0):
<fpxxo>:
push   %rbp
mov    %rsp,%rbp
mov    $0x69,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fpxxo() {
ret i32 105
}

LLVM IR (-O2):
define i32 @fpxxo() {
ret i32 105
}
void do_fiq(struct pt_regs *pt_regs) { return; }


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

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

LLVM IR (-O0):
%struct.pt_regs = type opaque
define void @do_fiq(%struct.pt_regs* %0) {
%2 = alloca %struct.pt_regs*
store %struct.pt_regs* %0, %struct.pt_regs** %2
ret void
}

LLVM IR (-O2):
%struct.pt_regs = type opaque
define void @do_fiq(%struct.pt_regs* nocapture %0) {
ret void
}