#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*/);
size_t vsd_read(unsigned char *, int /*<<< orphan*/, size_t);
int /*<<< orphan*/ vsd_set_size(size_t);
size_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) == vsd_size)) {
    fprintf(stderr, "%s %d\n",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/eabatalov/au-linux-kernel-autumn-2017/"
            "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/eabatalov/au-linux-kernel-autumn-2017/"
            "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/eabatalov/au-linux-kernel-autumn-2017/"
            "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) == vsd_size)) {
    fprintf(stderr, "%s %d\n",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/eabatalov/au-linux-kernel-autumn-2017/"
            "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/eabatalov/au-linux-kernel-autumn-2017/"
            "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/eabatalov/au-linux-kernel-autumn-2017/"
            "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/eabatalov/au-linux-kernel-autumn-2017/"
            "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/eabatalov/au-linux-kernel-autumn-2017/"
            "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/eabatalov/au-linux-kernel-autumn-2017/"
            "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    -0x10(%rbp),%rax
je     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    0xe6f(%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    0xe24(%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    0xdd6(%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    -0x10(%rbp),%rax
je     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    0xd74(%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    0xd26(%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    0xcdc(%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    0xc93(%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    0xc49(%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    0xc03(%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>
cmp    %r14,%rax
jne    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>
cmp    %r14,%rax
jne    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    0xc99(%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 = [182 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/eabatalov/au-linux-kernel-autumn-2017/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 = load i64, i64* %4
%30 = icmp eq i64 %28, %29
br i1 %30, label %36, label %31
31: ; preds = %24
%32 = load i32, i32* @stderr
%33 = call i32 @fprintf(i32 %32, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([182 x i8], [182 x i8]* @.str.1, i64 0, i64 0), i32 23)
%34 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%35 = call i32 (...) @abort()
unreachable
36: ; preds = %24
%37 = load i32, i32* %3
%38 = call i8* @vsd_mmap(i32 %37)
store i8* %38, i8** %7
%39 = load i8*, i8** %7
%40 = icmp ne i8* %39, null
br i1 %40, label %46, label %41
41: ; preds = %36
%42 = load i32, i32* @stderr
%43 = call i32 @fprintf(i32 %42, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([182 x i8], [182 x i8]* @.str.1, i64 0, i64 0), i32 26)
%44 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%45 = call i32 (...) @abort()
unreachable
46: ; preds = %36
%47 = load i8*, i8** %5
%48 = load i8*, i8** %7
%49 = load i64, i64* %4
%50 = call i32 @memcmp(i8* %47, i8* %48, i64 %49)
%51 = icmp ne i32 %50, 0
br i1 %51, label %52, label %57
52: ; preds = %46
%53 = load i32, i32* @stderr
%54 = call i32 @fprintf(i32 %53, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([182 x i8], [182 x i8]* @.str.1, i64 0, i64 0), i32 29)
%55 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%56 = call i32 (...) @abort()
unreachable
57: ; preds = %46
%58 = load i8*, i8** %7
%59 = getelementptr inbounds i8, i8* %58, i64 10
%60 = load i8, i8* %59
%61 = sext i8 %60 to i32
%62 = xor i32 %61, -1
%63 = trunc i32 %62 to i8
%64 = load i8*, i8** %7
%65 = getelementptr inbounds i8, i8* %64, i64 10
store i8 %63, i8* %65
%66 = load i8*, i8** %5
%67 = load i32, i32* %3
%68 = load i64, i64* %4
%69 = call i64 @vsd_read(i8* %66, i32 %67, i64 %68)
%70 = load i64, i64* %4
%71 = icmp eq i64 %69, %70
br i1 %71, label %77, label %72
72: ; preds = %57
%73 = load i32, i32* @stderr
%74 = call i32 @fprintf(i32 %73, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([182 x i8], [182 x i8]* @.str.1, i64 0, i64 0), i32 32)
%75 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%76 = call i32 (...) @abort()
unreachable
77: ; preds = %57
%78 = load i8*, i8** %5
%79 = load i8*, i8** %7
%80 = load i64, i64* %4
%81 = call i32 @memcmp(i8* %78, i8* %79, i64 %80)
%82 = icmp ne i32 %81, 0
br i1 %82, label %83, label %88
83: ; preds = %77
%84 = load i32, i32* @stderr
%85 = call i32 @fprintf(i32 %84, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([182 x i8], [182 x i8]* @.str.1, i64 0, i64 0), i32 33)
%86 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%87 = call i32 (...) @abort()
unreachable
88: ; preds = %77
%89 = load i64, i64* %4
%90 = udiv i64 %89, 2
%91 = call i32 @vsd_set_size(i64 %90)
%92 = icmp ne i32 %91, 0
br i1 %92, label %98, label %93
93: ; preds = %88
%94 = load i32, i32* @stderr
%95 = call i32 @fprintf(i32 %94, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([182 x i8], [182 x i8]* @.str.1, i64 0, i64 0), i32 36)
%96 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%97 = call i32 (...) @abort()
unreachable
98: ; preds = %88
%99 = load i8*, i8** %7
%100 = load i32, i32* %3
%101 = call i32 @vsd_munmap(i8* %99, i32 %100)
%102 = icmp ne i32 %101, 0
br i1 %102, label %103, label %108
103: ; preds = %98
%104 = load i32, i32* @stderr
%105 = call i32 @fprintf(i32 %104, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([182 x i8], [182 x i8]* @.str.1, i64 0, i64 0), i32 38)
%106 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%107 = call i32 (...) @abort()
unreachable
108: ; preds = %98
%109 = load i64, i64* %4
%110 = udiv i64 %109, 2
%111 = call i32 @vsd_set_size(i64 %110)
%112 = icmp ne i32 %111, 0
br i1 %112, label %113, label %118
113: ; preds = %108
%114 = load i32, i32* @stderr
%115 = call i32 @fprintf(i32 %114, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([182 x i8], [182 x i8]* @.str.1, i64 0, i64 0), i32 40)
%116 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%117 = call i32 (...) @abort()
unreachable
118: ; preds = %108
%119 = load i64, i64* %4
%120 = call i32 @vsd_set_size(i64 %119)
%121 = icmp ne i32 %120, 0
br i1 %121, label %122, label %127
122: ; preds = %118
%123 = load i32, i32* @stderr
%124 = call i32 @fprintf(i32 %123, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([182 x i8], [182 x i8]* @.str.1, i64 0, i64 0), i32 41)
%125 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%126 = call i32 (...) @abort()
unreachable
127: ; preds = %118
%128 = load i8*, i8** %5
%129 = call i32 @free(i8* %128)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [7 x i8] c"%s %d\0A\00"
@.str.1 = [182 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/eabatalov/au-linux-kernel-autumn-2017/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 eq 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 ([182 x i8], [182 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 ([182 x i8], [182 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 ([182 x i8], [182 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 eq 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 ([182 x i8], [182 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 ([182 x i8], [182 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 ([182 x i8], [182 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 ([182 x i8], [182 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 ([182 x i8], [182 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 ([182 x i8], [182 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
}