#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int);
int /*<<< orphan*/ free(unsigned char *);
unsigned char *malloc(size_t);
int /*<<< orphan*/ memcmp(unsigned char *, char *, size_t);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stderr;
char *vsd_mmap(int /*<<< orphan*/);
int /*<<< orphan*/ vsd_munmap(char *, int /*<<< orphan*/);
scalar_t__ vsd_read(unsigned char *, int /*<<< orphan*/, size_t);
int /*<<< orphan*/ vsd_set_size(size_t);
scalar_t__ vsd_write(unsigned char *, int /*<<< orphan*/, size_t);
void run_one_test(off_t vsd_offset, size_t vsd_size) {
  unsigned char *vsd_rw_buf = malloc(vsd_size);
  size_t i = 0;
  for (; i < vsd_size; ++i) {
    vsd_rw_buf[i] = i % 255;
  }
  if (!(vsd_write(vsd_rw_buf, vsd_offset, vsd_size) >= 0)) {
    fprintf(
        stderr, "%s %d\n",
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/AntonGitName/au-linux-kernel-spring-2016/"
        "refs/heads/master/tasks/vsd2/vsd_userspace/vsd_test.c",
        23);
    perror("Test failed");
    abort();
  };
  char *vsd_mem = vsd_mmap(vsd_offset);
  if (!(vsd_mem)) {
    fprintf(
        stderr, "%s %d\n",
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/AntonGitName/au-linux-kernel-spring-2016/"
        "refs/heads/master/tasks/vsd2/vsd_userspace/vsd_test.c",
        26);
    perror("Test failed");
    abort();
  };
  if (!(!memcmp(vsd_rw_buf, vsd_mem, vsd_size))) {
    fprintf(
        stderr, "%s %d\n",
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/AntonGitName/au-linux-kernel-spring-2016/"
        "refs/heads/master/tasks/vsd2/vsd_userspace/vsd_test.c",
        29);
    perror("Test failed");
    abort();
  };
  vsd_mem[10] = ~vsd_mem[10];
  if (!(vsd_read(vsd_rw_buf, vsd_offset, vsd_size) >= 0)) {
    fprintf(
        stderr, "%s %d\n",
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/AntonGitName/au-linux-kernel-spring-2016/"
        "refs/heads/master/tasks/vsd2/vsd_userspace/vsd_test.c",
        32);
    perror("Test failed");
    abort();
  };
  if (!(!memcmp(vsd_rw_buf, vsd_mem, vsd_size))) {
    fprintf(
        stderr, "%s %d\n",
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/AntonGitName/au-linux-kernel-spring-2016/"
        "refs/heads/master/tasks/vsd2/vsd_userspace/vsd_test.c",
        33);
    perror("Test failed");
    abort();
  };
  if (!(vsd_set_size(vsd_size / 2))) {
    fprintf(
        stderr, "%s %d\n",
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/AntonGitName/au-linux-kernel-spring-2016/"
        "refs/heads/master/tasks/vsd2/vsd_userspace/vsd_test.c",
        36);
    perror("Test failed");
    abort();
  };
  if (!(!vsd_munmap(vsd_mem, vsd_offset))) {
    fprintf(
        stderr, "%s %d\n",
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/AntonGitName/au-linux-kernel-spring-2016/"
        "refs/heads/master/tasks/vsd2/vsd_userspace/vsd_test.c",
        38);
    perror("Test failed");
    abort();
  };
  if (!(!vsd_set_size(vsd_size / 2))) {
    fprintf(
        stderr, "%s %d\n",
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/AntonGitName/au-linux-kernel-spring-2016/"
        "refs/heads/master/tasks/vsd2/vsd_userspace/vsd_test.c",
        40);
    perror("Test failed");
    abort();
  };
  if (!(!vsd_set_size(vsd_size))) {
    fprintf(
        stderr, "%s %d\n",
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/AntonGitName/au-linux-kernel-spring-2016/"
        "refs/heads/master/tasks/vsd2/vsd_userspace/vsd_test.c",
        41);
    perror("Test failed");
    abort();
  };
  free(vsd_rw_buf);
}


x86 assembly (clang, -O0):
<run_one_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1070 <malloc@plt>
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    120c <run_one_test+0x5c>
mov    -0x20(%rbp),%rax
mov    $0xff,%ecx
xor    %edx,%edx
div    %rcx
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    11d4 <run_one_test+0x24>
mov    -0x18(%rbp),%rdi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   10d0 <vsd_write@plt>
cmp    $0x0,%rax
jge    125a <run_one_test+0xaa>
mov    0x2db3(%rip),%rax
mov    (%rax),%edi
lea    0xdca(%rip),%rsi
lea    0xdca(%rip),%rdx
mov    $0x17,%ecx
call   1060 <fprintf@plt>
lea    0xe72(%rip),%rdi
call   10a0 <perror@plt>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x4(%rbp),%edi
call   10c0 <vsd_mmap@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    12a5 <run_one_test+0xf5>
mov    0x2d68(%rip),%rax
mov    (%rax),%edi
lea    0xd7f(%rip),%rsi
lea    0xd7f(%rip),%rdx
mov    $0x1a,%ecx
call   1060 <fprintf@plt>
lea    0xe27(%rip),%rdi
call   10a0 <perror@plt>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1050 <memcmp@plt>
cmp    $0x0,%eax
je     12f3 <run_one_test+0x143>
mov    0x2d1a(%rip),%rax
mov    (%rax),%edi
lea    0xd31(%rip),%rsi
lea    0xd31(%rip),%rdx
mov    $0x1d,%ecx
call   1060 <fprintf@plt>
lea    0xdd9(%rip),%rdi
call   10a0 <perror@plt>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x28(%rbp),%rax
movsbl 0xa(%rax),%eax
xor    $0xffffffff,%eax
mov    %al,%cl
mov    -0x28(%rbp),%rax
mov    %cl,0xa(%rax)
mov    -0x18(%rbp),%rdi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1080 <vsd_read@plt>
cmp    $0x0,%rax
jge    1355 <run_one_test+0x1a5>
mov    0x2cb8(%rip),%rax
mov    (%rax),%edi
lea    0xccf(%rip),%rsi
lea    0xccf(%rip),%rdx
mov    $0x20,%ecx
call   1060 <fprintf@plt>
lea    0xd77(%rip),%rdi
call   10a0 <perror@plt>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1050 <memcmp@plt>
cmp    $0x0,%eax
je     13a3 <run_one_test+0x1f3>
mov    0x2c6a(%rip),%rax
mov    (%rax),%edi
lea    0xc81(%rip),%rsi
lea    0xc81(%rip),%rdx
mov    $0x21,%ecx
call   1060 <fprintf@plt>
lea    0xd29(%rip),%rdi
call   10a0 <perror@plt>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x10(%rbp),%rdi
shr    $0x1,%rdi
call   10b0 <vsd_set_size@plt>
cmp    $0x0,%eax
jne    13ed <run_one_test+0x23d>
mov    0x2c20(%rip),%rax
mov    (%rax),%edi
lea    0xc37(%rip),%rsi
lea    0xc37(%rip),%rdx
mov    $0x24,%ecx
call   1060 <fprintf@plt>
lea    0xcdf(%rip),%rdi
call   10a0 <perror@plt>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x28(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1090 <vsd_munmap@plt>
cmp    $0x0,%eax
je     1436 <run_one_test+0x286>
mov    0x2bd7(%rip),%rax
mov    (%rax),%edi
lea    0xbee(%rip),%rsi
lea    0xbee(%rip),%rdx
mov    $0x26,%ecx
call   1060 <fprintf@plt>
lea    0xc96(%rip),%rdi
call   10a0 <perror@plt>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x10(%rbp),%rdi
shr    $0x1,%rdi
call   10b0 <vsd_set_size@plt>
cmp    $0x0,%eax
je     1480 <run_one_test+0x2d0>
mov    0x2b8d(%rip),%rax
mov    (%rax),%edi
lea    0xba4(%rip),%rsi
lea    0xba4(%rip),%rdx
mov    $0x28,%ecx
call   1060 <fprintf@plt>
lea    0xc4c(%rip),%rdi
call   10a0 <perror@plt>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x10(%rbp),%rdi
call   10b0 <vsd_set_size@plt>
cmp    $0x0,%eax
je     14c6 <run_one_test+0x316>
mov    0x2b47(%rip),%rax
mov    (%rax),%edi
lea    0xb5e(%rip),%rsi
lea    0xb5e(%rip),%rdx
mov    $0x29,%ecx
call   1060 <fprintf@plt>
lea    0xc06(%rip),%rdi
call   10a0 <perror@plt>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_one_test>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rsi,%r14
mov    %edi,%r15d
mov    %rsi,%rdi
call   1060 <malloc@plt>
mov    %rax,%rbx
test   %r14,%r14
je     1234 <run_one_test+0x84>
movabs $0x8080808080808081,%r8
80 80 80
cmp    $0x1,%r14
jne    11e2 <run_one_test+0x32>
xor    %ecx,%ecx
jmp    1220 <run_one_test+0x70>
mov    %r14,%rbp
and    $0xfffffffffffffffe,%rbp
mov    $0x1,%esi
xor    %ecx,%ecx
mov    %rsi,%rax
mul    %r8
mov    %rdx,%rdi
shr    $0x7,%rdi
mov    %rcx,%rax
mul    %r8
add    %sil,%dil
shr    $0x7,%edx
add    %ecx,%edx
mov    %dl,(%rbx,%rcx,1)
mov    %dil,0x1(%rbx,%rcx,1)
add    $0x2,%rcx
add    $0x2,%rsi
cmp    %rcx,%rbp
jne    11f0 <run_one_test+0x40>
test   $0x1,%r14b
je     1234 <run_one_test+0x84>
mov    %rcx,%rax
mul    %r8
shr    $0x7,%edx
add    %ecx,%edx
mov    %dl,(%rbx,%rcx,1)
mov    %rbx,%rdi
mov    %r15d,%esi
mov    %r14,%rdx
call   10d0 <vsd_write@plt>
test   %rax,%rax
js     1300 <run_one_test+0x150>
mov    %r15d,%edi
call   10c0 <vsd_mmap@plt>
test   %rax,%rax
je     1321 <run_one_test+0x171>
mov    %rax,%r12
mov    %rbx,%rdi
mov    %rax,%rsi
mov    %r14,%rdx
call   1070 <bcmp@plt>
test   %eax,%eax
jne    1342 <run_one_test+0x192>
notb   0xa(%r12)
mov    %rbx,%rdi
mov    %r15d,%esi
mov    %r14,%rdx
call   1080 <vsd_read@plt>
test   %rax,%rax
js     1363 <run_one_test+0x1b3>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r14,%rdx
call   1070 <bcmp@plt>
test   %eax,%eax
jne    1384 <run_one_test+0x1d4>
mov    %r14,%rbp
shr    %rbp
mov    %rbp,%rdi
call   10b0 <vsd_set_size@plt>
test   %eax,%eax
je     13a2 <run_one_test+0x1f2>
mov    %r12,%rdi
mov    %r15d,%esi
call   1090 <vsd_munmap@plt>
test   %eax,%eax
jne    13c0 <run_one_test+0x210>
mov    %rbp,%rdi
call   10b0 <vsd_set_size@plt>
test   %eax,%eax
jne    13de <run_one_test+0x22e>
mov    %r14,%rdi
call   10b0 <vsd_set_size@plt>
test   %eax,%eax
jne    13fc <run_one_test+0x24c>
mov    %rbx,%rdi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>
mov    0x2cd9(%rip),%rax
mov    (%rax),%edi
lea    0xcf0(%rip),%rsi
lea    0xcf0(%rip),%rdx
mov    $0x17,%ecx
jmp    1418 <run_one_test+0x268>
mov    0x2cb8(%rip),%rax
mov    (%rax),%edi
lea    0xccf(%rip),%rsi
lea    0xccf(%rip),%rdx
mov    $0x1a,%ecx
jmp    1418 <run_one_test+0x268>
mov    0x2c97(%rip),%rax
mov    (%rax),%edi
lea    0xcae(%rip),%rsi
lea    0xcae(%rip),%rdx
mov    $0x1d,%ecx
jmp    1418 <run_one_test+0x268>
mov    0x2c76(%rip),%rax
mov    (%rax),%edi
lea    0xc8d(%rip),%rsi
lea    0xc8d(%rip),%rdx
mov    $0x20,%ecx
jmp    1418 <run_one_test+0x268>
mov    0x2c55(%rip),%rax
mov    (%rax),%edi
lea    0xc6c(%rip),%rsi
lea    0xc6c(%rip),%rdx
mov    $0x21,%ecx
jmp    1418 <run_one_test+0x268>
mov    0x2c37(%rip),%rax
mov    (%rax),%edi
lea    0xc4e(%rip),%rsi
lea    0xc4e(%rip),%rdx
mov    $0x24,%ecx
jmp    1418 <run_one_test+0x268>
mov    0x2c19(%rip),%rax
mov    (%rax),%edi
lea    0xc30(%rip),%rsi
lea    0xc30(%rip),%rdx
mov    $0x26,%ecx
jmp    1418 <run_one_test+0x268>
mov    0x2bfb(%rip),%rax
mov    (%rax),%edi
lea    0xc12(%rip),%rsi
lea    0xc12(%rip),%rdx
mov    $0x28,%ecx
jmp    1418 <run_one_test+0x268>
mov    0x2bdd(%rip),%rax
mov    (%rax),%edi
lea    0xbf4(%rip),%rsi
lea    0xbf4(%rip),%rdx
mov    $0x29,%ecx
call   1050 <fprintf@plt>
lea    0xc9c(%rip),%rdi
call   10a0 <perror@plt>
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [7 x i8] c"%s %d\0A\00"
@.str.1 = [185 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AntonGitName/au-linux-kernel-spring-2016/refs/heads/master/tasks/vsd2/vsd_userspace/vsd_test.c\00"
@.str.2 = [12 x i8] c"Test failed\00"
define void @run_one_test(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
store i32 %0, i32* %3
store i64 %1, i64* %4
%8 = load i64, i64* %4
%9 = call i8* @malloc(i64 %8)
store i8* %9, i8** %5
store i64 0, i64* %6
br label %10
10: ; preds = %21, %2
%11 = load i64, i64* %6
%12 = load i64, i64* %4
%13 = icmp ult i64 %11, %12
br i1 %13, label %14, label %24
14: ; preds = %10
%15 = load i64, i64* %6
%16 = urem i64 %15, 255
%17 = trunc i64 %16 to i8
%18 = load i8*, i8** %5
%19 = load i64, i64* %6
%20 = getelementptr inbounds i8, i8* %18, i64 %19
store i8 %17, i8* %20
br label %21
21: ; preds = %14
%22 = load i64, i64* %6
%23 = add i64 %22, 1
store i64 %23, i64* %6
br label %10
24: ; preds = %10
%25 = load i8*, i8** %5
%26 = load i32, i32* %3
%27 = load i64, i64* %4
%28 = call i64 @vsd_write(i8* %25, i32 %26, i64 %27)
%29 = icmp sge i64 %28, 0
br i1 %29, label %35, label %30
30: ; preds = %24
%31 = load i32, i32* @stderr
%32 = call i32 @fprintf(i32 %31, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([185 x i8], [185 x i8]* @.str.1, i64 0, i64 0), i32 23)
%33 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%34 = call i32 (...) @abort()
unreachable
35: ; preds = %24
%36 = load i32, i32* %3
%37 = call i8* @vsd_mmap(i32 %36)
store i8* %37, i8** %7
%38 = load i8*, i8** %7
%39 = icmp ne i8* %38, null
br i1 %39, label %45, label %40
40: ; preds = %35
%41 = load i32, i32* @stderr
%42 = call i32 @fprintf(i32 %41, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([185 x i8], [185 x i8]* @.str.1, i64 0, i64 0), i32 26)
%43 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%44 = call i32 (...) @abort()
unreachable
45: ; preds = %35
%46 = load i8*, i8** %5
%47 = load i8*, i8** %7
%48 = load i64, i64* %4
%49 = call i32 @memcmp(i8* %46, i8* %47, i64 %48)
%50 = icmp ne i32 %49, 0
br i1 %50, label %51, label %56
51: ; preds = %45
%52 = load i32, i32* @stderr
%53 = call i32 @fprintf(i32 %52, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([185 x i8], [185 x i8]* @.str.1, i64 0, i64 0), i32 29)
%54 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%55 = call i32 (...) @abort()
unreachable
56: ; preds = %45
%57 = load i8*, i8** %7
%58 = getelementptr inbounds i8, i8* %57, i64 10
%59 = load i8, i8* %58
%60 = sext i8 %59 to i32
%61 = xor i32 %60, -1
%62 = trunc i32 %61 to i8
%63 = load i8*, i8** %7
%64 = getelementptr inbounds i8, i8* %63, i64 10
store i8 %62, i8* %64
%65 = load i8*, i8** %5
%66 = load i32, i32* %3
%67 = load i64, i64* %4
%68 = call i64 @vsd_read(i8* %65, i32 %66, i64 %67)
%69 = icmp sge i64 %68, 0
br i1 %69, label %75, label %70
70: ; preds = %56
%71 = load i32, i32* @stderr
%72 = call i32 @fprintf(i32 %71, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([185 x i8], [185 x i8]* @.str.1, i64 0, i64 0), i32 32)
%73 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%74 = call i32 (...) @abort()
unreachable
75: ; preds = %56
%76 = load i8*, i8** %5
%77 = load i8*, i8** %7
%78 = load i64, i64* %4
%79 = call i32 @memcmp(i8* %76, i8* %77, i64 %78)
%80 = icmp ne i32 %79, 0
br i1 %80, label %81, label %86
81: ; preds = %75
%82 = load i32, i32* @stderr
%83 = call i32 @fprintf(i32 %82, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([185 x i8], [185 x i8]* @.str.1, i64 0, i64 0), i32 33)
%84 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%85 = call i32 (...) @abort()
unreachable
86: ; preds = %75
%87 = load i64, i64* %4
%88 = udiv i64 %87, 2
%89 = call i32 @vsd_set_size(i64 %88)
%90 = icmp ne i32 %89, 0
br i1 %90, label %96, label %91
91: ; preds = %86
%92 = load i32, i32* @stderr
%93 = call i32 @fprintf(i32 %92, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([185 x i8], [185 x i8]* @.str.1, i64 0, i64 0), i32 36)
%94 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%95 = call i32 (...) @abort()
unreachable
96: ; preds = %86
%97 = load i8*, i8** %7
%98 = load i32, i32* %3
%99 = call i32 @vsd_munmap(i8* %97, i32 %98)
%100 = icmp ne i32 %99, 0
br i1 %100, label %101, label %106
101: ; preds = %96
%102 = load i32, i32* @stderr
%103 = call i32 @fprintf(i32 %102, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([185 x i8], [185 x i8]* @.str.1, i64 0, i64 0), i32 38)
%104 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%105 = call i32 (...) @abort()
unreachable
106: ; preds = %96
%107 = load i64, i64* %4
%108 = udiv i64 %107, 2
%109 = call i32 @vsd_set_size(i64 %108)
%110 = icmp ne i32 %109, 0
br i1 %110, label %111, label %116
111: ; preds = %106
%112 = load i32, i32* @stderr
%113 = call i32 @fprintf(i32 %112, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([185 x i8], [185 x i8]* @.str.1, i64 0, i64 0), i32 40)
%114 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%115 = call i32 (...) @abort()
unreachable
116: ; preds = %106
%117 = load i64, i64* %4
%118 = call i32 @vsd_set_size(i64 %117)
%119 = icmp ne i32 %118, 0
br i1 %119, label %120, label %125
120: ; preds = %116
%121 = load i32, i32* @stderr
%122 = call i32 @fprintf(i32 %121, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([185 x i8], [185 x i8]* @.str.1, i64 0, i64 0), i32 41)
%123 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%124 = call i32 (...) @abort()
unreachable
125: ; preds = %116
%126 = load i8*, i8** %5
%127 = call i32 @free(i8* %126)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [7 x i8] c"%s %d\0A\00"
@.str.1 = [185 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AntonGitName/au-linux-kernel-spring-2016/refs/heads/master/tasks/vsd2/vsd_userspace/vsd_test.c\00"
@.str.2 = [12 x i8] c"Test failed\00"
define void @run_one_test(i32 %0, i64 %1) {
%3 = tail call i8* @malloc(i64 %1)
%4 = icmp eq i64 %1, 0
br i1 %4, label %30, label %5
5: ; preds = %2
%6 = and i64 %1, 1
%7 = icmp eq i64 %1, 1
br i1 %7, label %23, label %8
8: ; preds = %5
%9 = and i64 %1, -2
br label %10
10: ; preds = %10, %8
%11 = phi i64 [ 0, %8 ], [ %20, %10 ]
%12 = phi i64 [ 0, %8 ], [ %21, %10 ]
%13 = urem i64 %11, 255
%14 = trunc i64 %13 to i8
%15 = getelementptr inbounds i8, i8* %3, i64 %11
store i8 %14, i8* %15
%16 = or i64 %11, 1
%17 = urem i64 %16, 255
%18 = trunc i64 %17 to i8
%19 = getelementptr inbounds i8, i8* %3, i64 %16
store i8 %18, i8* %19
%20 = add nuw i64 %11, 2
%21 = add i64 %12, 2
%22 = icmp eq i64 %21, %9
br i1 %22, label %23, label %10
23: ; preds = %10, %5
%24 = phi i64 [ 0, %5 ], [ %20, %10 ]
%25 = icmp eq i64 %6, 0
br i1 %25, label %30, label %26
26: ; preds = %23
%27 = urem i64 %24, 255
%28 = trunc i64 %27 to i8
%29 = getelementptr inbounds i8, i8* %3, i64 %24
store i8 %28, i8* %29
br label %30
30: ; preds = %26, %23, %2
%31 = tail call i64 @vsd_write(i8* %3, i32 %0, i64 %1)
%32 = icmp sgt i64 %31, -1
br i1 %32, label %38, label %33
33: ; preds = %30
%34 = load i32, i32* @stderr
%35 = tail call i32 @fprintf(i32 %34, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([185 x i8], [185 x i8]* @.str.1, i64 0, i64 0), i32 23)
%36 = tail call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%37 = tail call i32 (...) @abort()
unreachable
38: ; preds = %30
%39 = tail call i8* @vsd_mmap(i32 %0)
%40 = icmp eq i8* %39, null
br i1 %40, label %41, label %46
41: ; preds = %38
%42 = load i32, i32* @stderr
%43 = tail call i32 @fprintf(i32 %42, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([185 x i8], [185 x i8]* @.str.1, i64 0, i64 0), i32 26)
%44 = tail call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%45 = tail call i32 (...) @abort()
unreachable
46: ; preds = %38
%47 = tail call i32 @bcmp(i8* %3, i8* %39, i64 %1)
%48 = icmp eq i32 %47, 0
br i1 %48, label %54, label %49
49: ; preds = %46
%50 = load i32, i32* @stderr
%51 = tail call i32 @fprintf(i32 %50, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([185 x i8], [185 x i8]* @.str.1, i64 0, i64 0), i32 29)
%52 = tail call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%53 = tail call i32 (...) @abort()
unreachable
54: ; preds = %46
%55 = getelementptr inbounds i8, i8* %39, i64 10
%56 = load i8, i8* %55
%57 = xor i8 %56, -1
store i8 %57, i8* %55
%58 = tail call i64 @vsd_read(i8* %3, i32 %0, i64 %1)
%59 = icmp sgt i64 %58, -1
br i1 %59, label %65, label %60
60: ; preds = %54
%61 = load i32, i32* @stderr
%62 = tail call i32 @fprintf(i32 %61, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([185 x i8], [185 x i8]* @.str.1, i64 0, i64 0), i32 32)
%63 = tail call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%64 = tail call i32 (...) @abort()
unreachable
65: ; preds = %54
%66 = tail call i32 @bcmp(i8* %3, i8* %39, i64 %1)
%67 = icmp eq i32 %66, 0
br i1 %67, label %73, label %68
68: ; preds = %65
%69 = load i32, i32* @stderr
%70 = tail call i32 @fprintf(i32 %69, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([185 x i8], [185 x i8]* @.str.1, i64 0, i64 0), i32 33)
%71 = tail call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%72 = tail call i32 (...) @abort()
unreachable
73: ; preds = %65
%74 = lshr i64 %1, 1
%75 = tail call i32 @vsd_set_size(i64 %74)
%76 = icmp eq i32 %75, 0
br i1 %76, label %77, label %82
77: ; preds = %73
%78 = load i32, i32* @stderr
%79 = tail call i32 @fprintf(i32 %78, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([185 x i8], [185 x i8]* @.str.1, i64 0, i64 0), i32 36)
%80 = tail call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%81 = tail call i32 (...) @abort()
unreachable
82: ; preds = %73
%83 = tail call i32 @vsd_munmap(i8* %39, i32 %0)
%84 = icmp eq i32 %83, 0
br i1 %84, label %90, label %85
85: ; preds = %82
%86 = load i32, i32* @stderr
%87 = tail call i32 @fprintf(i32 %86, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([185 x i8], [185 x i8]* @.str.1, i64 0, i64 0), i32 38)
%88 = tail call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%89 = tail call i32 (...) @abort()
unreachable
90: ; preds = %82
%91 = tail call i32 @vsd_set_size(i64 %74)
%92 = icmp eq i32 %91, 0
br i1 %92, label %98, label %93
93: ; preds = %90
%94 = load i32, i32* @stderr
%95 = tail call i32 @fprintf(i32 %94, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([185 x i8], [185 x i8]* @.str.1, i64 0, i64 0), i32 40)
%96 = tail call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%97 = tail call i32 (...) @abort()
unreachable
98: ; preds = %90
%99 = tail call i32 @vsd_set_size(i64 %1)
%100 = icmp eq i32 %99, 0
br i1 %100, label %106, label %101
101: ; preds = %98
%102 = load i32, i32* @stderr
%103 = tail call i32 @fprintf(i32 %102, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([185 x i8], [185 x i8]* @.str.1, i64 0, i64 0), i32 41)
%104 = tail call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%105 = tail call i32 (...) @abort()
unreachable
106: ; preds = %98
%107 = tail call i32 @free(i8* %3)
ret void
}