#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 scalar_t__ ssize_t;

/* Variables and functions */
scalar_t__ EACCES;
scalar_t__ EINVAL;
unsigned long MS_RDONLY;
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int);
scalar_t__ errno;
int /*<<< orphan*/ free(char *);
int identify_fs(int, char const **, int /*<<< orphan*/ *, int /*<<< orphan*/);
int mount(char const *, char const *, char const *, unsigned long,
          void const *);
int open(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *, ...);
scalar_t__ readfile(char *, char **);
char *strchr(char *, char);
const char *mount_block(const char *source, const char *target,
                        const char *type, unsigned long flags,
                        const void *data) {
  char *fslist, *p, *ep;
  const char *rp;
  ssize_t fsbytes;
  int fd;
  if (type) {
    printf("kinit: trying to mount %s on %s with type %s\n", source, target,
           type);
    int rv = mount(source, target, type, flags, data);
    if (rv == -1 && errno == EACCES && !(flags & MS_RDONLY))
      rv = mount(source, target, type, flags | MS_RDONLY, data);
    return rv ? NULL : type;
  }
  fd = open(source, O_RDONLY);
  if (fd >= 0) {
    int err = identify_fs(fd, &type, NULL, 0);
    close(fd);
    if (!err && type) {
      printf("kinit: %s appears to be a %s filesystem\n", source, type);
      type = mount_block(source, target, type, flags, data);
      if (type)
        return type;
    }
  }
  printf("kinit: failed to identify filesystem %s, trying all\n", source);
  fsbytes = readfile("/proc/filesystems", &fslist);
  errno = EINVAL;
  if (fsbytes < 0)
    return NULL;
  p = fslist;
  ep = fslist + fsbytes;
  rp = NULL;
  while (p < ep) {
    type = p;
    p = strchr(p, '\n');
    if (!p)
      break;
    *p++ = '\0';
    if (*type != '\t')
      continue;
    type++;
    rp = mount_block(source, target, type, flags, data);
    if (rp)
      break;
    if (errno != EINVAL)
      break;
  }
  free(fslist);
  return rp;
}


x86 assembly (clang, -O0):
<mount_block>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1279 <mount_block+0xe9>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    0xe36(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
call   1040 <mount@plt>
mov    %eax,-0x60(%rbp)
cmpl   $0xffffffff,-0x60(%rbp)
jne    124f <mount_block+0xbf>
mov    0x2dca(%rip),%rax
mov    (%rax),%rax
mov    0x2dd8(%rip),%rcx
cmp    (%rcx),%rax
jne    124f <mount_block+0xbf>
mov    -0x28(%rbp),%rax
mov    0x2dbc(%rip),%rcx
and    (%rcx),%rax
cmp    $0x0,%rax
jne    124f <mount_block+0xbf>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    0x2d98(%rip),%rax
or     (%rax),%rcx
mov    -0x30(%rbp),%r8
call   1040 <mount@plt>
mov    %eax,-0x60(%rbp)
cmpl   $0x0,-0x60(%rbp)
je     1264 <mount_block+0xd4>
xor    %eax,%eax
mov    %rax,-0x70(%rbp)
jmp    126c <mount_block+0xdc>
mov    -0x20(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    -0x70(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    145a <mount_block+0x2ca>
mov    -0x10(%rbp),%rdi
mov    0x2d64(%rip),%rax
mov    (%rax),%esi
call   10a0 <open@plt>
mov    %eax,-0x5c(%rbp)
cmpl   $0x0,-0x5c(%rbp)
jl     131f <mount_block+0x18f>
mov    -0x5c(%rbp),%edi
lea    -0x20(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
xor    %ecx,%ecx
call   1090 <identify_fs@plt>
mov    %eax,-0x64(%rbp)
mov    -0x5c(%rbp),%edi
call   1080 <close@plt>
cmpl   $0x0,-0x64(%rbp)
jne    131a <mount_block+0x18a>
cmpq   $0x0,-0x20(%rbp)
je     131a <mount_block+0x18a>
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0xd55(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
call   1070 <mount_block@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1315 <mount_block+0x185>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    145a <mount_block+0x2ca>
jmp    131a <mount_block+0x18a>
jmp    131f <mount_block+0x18f>
mov    -0x10(%rbp),%rsi
lea    0xd2d(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xd54(%rip),%rdi
lea    -0x38(%rbp),%rsi
call   10b0 <readfile@plt>
mov    %rax,-0x58(%rbp)
mov    0x2c74(%rip),%rax
mov    (%rax),%rcx
mov    0x2c72(%rip),%rax
mov    %rcx,(%rax)
cmpq   $0x0,-0x58(%rbp)
jge    1371 <mount_block+0x1e1>
movq   $0x0,-0x8(%rbp)
jmp    145a <mount_block+0x2ca>
mov    -0x38(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x38(%rbp),%rax
add    -0x58(%rbp),%rax
mov    %rax,-0x48(%rbp)
movq   $0x0,-0x50(%rbp)
mov    -0x40(%rbp),%rax
cmp    -0x48(%rbp),%rax
jae    1449 <mount_block+0x2b9>
mov    -0x40(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x40(%rbp),%rdi
mov    $0xa,%esi
call   1050 <strchr@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    13c5 <mount_block+0x235>
jmp    1449 <mount_block+0x2b9>
mov    -0x40(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x40(%rbp)
movb   $0x0,(%rax)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
je     13ec <mount_block+0x25c>
jmp    138d <mount_block+0x1fd>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
call   1070 <mount_block@plt>
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x50(%rbp)
je     1425 <mount_block+0x295>
jmp    1449 <mount_block+0x2b9>
mov    0x2b9c(%rip),%rax
mov    (%rax),%rax
mov    0x2b8a(%rip),%rcx
cmp    (%rcx),%rax
je     1444 <mount_block+0x2b4>
jmp    1449 <mount_block+0x2b9>
jmp    138d <mount_block+0x1fd>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x50(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mount_block>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %r8,%r14
mov    %rcx,%r15
mov    %rsi,%r12
mov    %rdi,%r13
mov    %rdx,0x8(%rsp)
test   %rdx,%rdx
je     11f8 <mount_block+0x68>
mov    %rdx,%rbp
lea    0xe42(%rip),%rdi
mov    %r13,%rsi
mov    %r12,%rdx
mov    %rbp,%rcx
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r13,%rdi
mov    %r12,%rsi
mov    %rbp,%rdx
mov    %r15,%rcx
mov    %r14,%r8
call   1040 <mount@plt>
cmp    $0xffffffff,%eax
je     13ea <mount_block+0x25a>
xor    %ebx,%ebx
test   %eax,%eax
cmove  %rbp,%rbx
jmp    1426 <mount_block+0x296>
mov    0x2de9(%rip),%rax
mov    (%rax),%esi
mov    %r13,%rdi
call   10a0 <open@plt>
test   %eax,%eax
js     126e <mount_block+0xde>
mov    %eax,%ebx
lea    0x8(%rsp),%rsi
mov    %eax,%edi
xor    %edx,%edx
xor    %ecx,%ecx
call   1090 <identify_fs@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1080 <close@plt>
test   %ebp,%ebp
jne    126e <mount_block+0xde>
mov    0x8(%rsp),%rdx
test   %rdx,%rdx
je     126e <mount_block+0xde>
lea    0xdf1(%rip),%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x8(%rsp),%rdx
mov    %r13,%rdi
mov    %r12,%rsi
mov    %r15,%rcx
mov    %r14,%r8
call   1070 <mount_block@plt>
mov    %rax,%rbx
mov    %rax,0x8(%rsp)
test   %rax,%rax
jne    1426 <mount_block+0x296>
mov    %r15,0x10(%rsp)
lea    0xddd(%rip),%rdi
xor    %ebx,%ebx
mov    %r13,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xdff(%rip),%rdi
lea    0x20(%rsp),%rsi
call   10b0 <readfile@plt>
mov    %rax,%r15
mov    0x2d1f(%rip),%rax
mov    (%rax),%rax
mov    0x2d1d(%rip),%rcx
mov    %rax,(%rcx)
test   %r15,%r15
js     1426 <mount_block+0x296>
mov    0x20(%rsp),%rbp
je     141c <mount_block+0x28c>
mov    %r14,0x18(%rsp)
mov    %rbp,0x8(%rsp)
mov    %rbp,%rdi
mov    $0xa,%esi
call   1050 <strchr@plt>
test   %rax,%rax
je     1413 <mount_block+0x283>
mov    %rax,%r14
add    %r15,%rbp
mov    0x2cf1(%rip),%r15
jmp    1327 <mount_block+0x197>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmp    %rbp,%r14
jae    1413 <mount_block+0x283>
mov    %r14,0x8(%rsp)
mov    %r14,%rdi
mov    $0xa,%esi
call   1050 <strchr@plt>
mov    %rax,%r14
test   %rax,%rax
je     1413 <mount_block+0x283>
movb   $0x0,(%r14)
add    $0x1,%r14
mov    0x8(%rsp),%rbx
cmpb   $0x9,(%rbx)
jne    1300 <mount_block+0x170>
add    $0x1,%rbx
mov    %rbx,0x8(%rsp)
lea    0xcb7(%rip),%rdi
mov    %r13,%rsi
mov    %r12,%rdx
mov    %rbx,%rcx
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r13,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
mov    0x10(%rsp),%rcx
mov    0x18(%rsp),%r8
call   1040 <mount@plt>
cmp    $0xffffffff,%eax
je     138a <mount_block+0x1fa>
test   %eax,%eax
je     1415 <mount_block+0x285>
mov    0x2c43(%rip),%rax
mov    (%rax),%rax
jmp    13b0 <mount_block+0x220>
mov    0x2c37(%rip),%rax
mov    (%rax),%rax
cmp    (%r15),%rax
jne    13b0 <mount_block+0x220>
mov    0x2c38(%rip),%rcx
mov    (%rcx),%rcx
test   %rcx,0x10(%rsp)
je     13cc <mount_block+0x23c>
nopw   0x0(%rax,%rax,1)
mov    0x2c09(%rip),%rcx
cmp    (%rcx),%rax
jne    1413 <mount_block+0x283>
mov    $0x0,%ebx
cmp    %rbp,%r14
jb     1309 <mount_block+0x179>
jmp    1415 <mount_block+0x285>
or     0x10(%rsp),%rcx
mov    %r13,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
mov    0x18(%rsp),%r8
call   1040 <mount@plt>
test   %eax,%eax
jne    137e <mount_block+0x1ee>
jmp    1415 <mount_block+0x285>
mov    0x2bd7(%rip),%rax
mov    (%rax),%rax
mov    0x2be5(%rip),%rcx
cmp    (%rcx),%rax
jne    140f <mount_block+0x27f>
mov    0x2bd1(%rip),%rax
mov    (%rax),%rcx
test   %r15,%rcx
je     1438 <mount_block+0x2a8>
xor    %ebx,%ebx
jmp    1426 <mount_block+0x296>
xor    %ebx,%ebx
mov    0x20(%rsp),%rbp
jmp    141e <mount_block+0x28e>
xor    %ebx,%ebx
mov    %rbp,%rdi
call   1030 <free@plt>
mov    %rbx,%rax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
or     %r15,%rcx
mov    %r13,%rdi
mov    %r12,%rsi
mov    %rbp,%rdx
mov    %r14,%r8
call   1040 <mount@plt>
jmp    11eb <mount_block+0x5b>

LLVM IR (-O0):
@.str = [46 x i8] c"kinit: trying to mount %s on %s with type %s\0A\00"
@errno = global i64 0
@EACCES = global i64 0
@MS_RDONLY = global i64 0
@O_RDONLY = global i32 0
@.str.1 = [41 x i8] c"kinit: %s appears to be a %s filesystem\0A\00"
@.str.2 = [53 x i8] c"kinit: failed to identify filesystem %s, trying all\0A\00"
@.str.3 = [18 x i8] c"/proc/filesystems\00"
@EINVAL = global i64 0
define i8* @mount_block(i8* %0, i8* %1, i8* %2, i64 %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca i64
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
store i8* %0, i8** %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store i64 %3, i64* %10
store i8* %4, i8** %11
%20 = load i8*, i8** %9
%21 = icmp ne i8* %20, null
br i1 %21, label %22, label %61
22: ; preds = %5
%23 = load i8*, i8** %7
%24 = load i8*, i8** %8
%25 = load i8*, i8** %9
%26 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %23, i8* %24, i8* %25)
%27 = load i8*, i8** %7
%28 = load i8*, i8** %8
%29 = load i8*, i8** %9
%30 = load i64, i64* %10
%31 = load i8*, i8** %11
%32 = call i32 @mount(i8* %27, i8* %28, i8* %29, i64 %30, i8* %31)
store i32 %32, i32* %18
%33 = load i32, i32* %18
%34 = icmp eq i32 %33, -1
br i1 %34, label %35, label %53
35: ; preds = %22
%36 = load i64, i64* @errno
%37 = load i64, i64* @EACCES
%38 = icmp eq i64 %36, %37
br i1 %38, label %39, label %53
39: ; preds = %35
%40 = load i64, i64* %10
%41 = load i64, i64* @MS_RDONLY
%42 = and i64 %40, %41
%43 = icmp ne i64 %42, 0
br i1 %43, label %53, label %44
44: ; preds = %39
%45 = load i8*, i8** %7
%46 = load i8*, i8** %8
%47 = load i8*, i8** %9
%48 = load i64, i64* %10
%49 = load i64, i64* @MS_RDONLY
%50 = or i64 %48, %49
%51 = load i8*, i8** %11
%52 = call i32 @mount(i8* %45, i8* %46, i8* %47, i64 %50, i8* %51)
store i32 %52, i32* %18
br label %53
53: ; preds = %44, %39, %35, %22
%54 = load i32, i32* %18
%55 = icmp ne i32 %54, 0
br i1 %55, label %56, label %57
56: ; preds = %53
br label %59
57: ; preds = %53
%58 = load i8*, i8** %9
br label %59
59: ; preds = %57, %56
%60 = phi i8* [ null, %56 ], [ %58, %57 ]
store i8* %60, i8** %6
br label %147
61: ; preds = %5
%62 = load i8*, i8** %7
%63 = load i32, i32* @O_RDONLY
%64 = call i32 @open(i8* %62, i32 %63)
store i32 %64, i32* %17
%65 = load i32, i32* %17
%66 = icmp sge i32 %65, 0
br i1 %66, label %67, label %93
67: ; preds = %61
%68 = load i32, i32* %17
%69 = call i32 @identify_fs(i32 %68, i8** %9, i32* null, i32 0)
store i32 %69, i32* %19
%70 = load i32, i32* %17
%71 = call i32 @close(i32 %70)
%72 = load i32, i32* %19
%73 = icmp ne i32 %72, 0
br i1 %73, label %92, label %74
74: ; preds = %67
%75 = load i8*, i8** %9
%76 = icmp ne i8* %75, null
br i1 %76, label %77, label %92
77: ; preds = %74
%78 = load i8*, i8** %7
%79 = load i8*, i8** %9
%80 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i8* %78, i8* %79)
%81 = load i8*, i8** %7
%82 = load i8*, i8** %8
%83 = load i8*, i8** %9
%84 = load i64, i64* %10
%85 = load i8*, i8** %11
%86 = call i8* @mount_block(i8* %81, i8* %82, i8* %83, i64 %84, i8* %85)
store i8* %86, i8** %9
%87 = load i8*, i8** %9
%88 = icmp ne i8* %87, null
br i1 %88, label %89, label %91
89: ; preds = %77
%90 = load i8*, i8** %9
store i8* %90, i8** %6
br label %147
91: ; preds = %77
br label %92
92: ; preds = %91, %74, %67
br label %93
93: ; preds = %92, %61
%94 = load i8*, i8** %7
%95 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0), i8* %94)
%96 = call i64 @readfile(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8** %12)
store i64 %96, i64* %16
%97 = load i64, i64* @EINVAL
store i64 %97, i64* @errno
%98 = load i64, i64* %16
%99 = icmp slt i64 %98, 0
br i1 %99, label %100, label %101
100: ; preds = %93
store i8* null, i8** %6
br label %147
101: ; preds = %93
%102 = load i8*, i8** %12
store i8* %102, i8** %13
%103 = load i8*, i8** %12
%104 = load i64, i64* %16
%105 = getelementptr inbounds i8, i8* %103, i64 %104
store i8* %105, i8** %14
store i8* null, i8** %15
br label %106
106: ; preds = %142, %124, %101
%107 = load i8*, i8** %13
%108 = load i8*, i8** %14
%109 = icmp ult i8* %107, %108
br i1 %109, label %110, label %143
110: ; preds = %106
%111 = load i8*, i8** %13
store i8* %111, i8** %9
%112 = load i8*, i8** %13
%113 = call i8* @strchr(i8* %112, i8 signext 10)
store i8* %113, i8** %13
%114 = load i8*, i8** %13
%115 = icmp ne i8* %114, null
br i1 %115, label %117, label %116
116: ; preds = %110
br label %143
117: ; preds = %110
%118 = load i8*, i8** %13
%119 = getelementptr inbounds i8, i8* %118, i32 1
store i8* %119, i8** %13
store i8 0, i8* %118
%120 = load i8*, i8** %9
%121 = load i8, i8* %120
%122 = sext i8 %121 to i32
%123 = icmp ne i32 %122, 9
br i1 %123, label %124, label %125
124: ; preds = %117
br label %106
125: ; preds = %117
%126 = load i8*, i8** %9
%127 = getelementptr inbounds i8, i8* %126, i32 1
store i8* %127, i8** %9
%128 = load i8*, i8** %7
%129 = load i8*, i8** %8
%130 = load i8*, i8** %9
%131 = load i64, i64* %10
%132 = load i8*, i8** %11
%133 = call i8* @mount_block(i8* %128, i8* %129, i8* %130, i64 %131, i8* %132)
store i8* %133, i8** %15
%134 = load i8*, i8** %15
%135 = icmp ne i8* %134, null
br i1 %135, label %136, label %137
136: ; preds = %125
br label %143
137: ; preds = %125
%138 = load i64, i64* @errno
%139 = load i64, i64* @EINVAL
%140 = icmp ne i64 %138, %139
br i1 %140, label %141, label %142
141: ; preds = %137
br label %143
142: ; preds = %137
br label %106
143: ; preds = %141, %136, %116, %106
%144 = load i8*, i8** %12
%145 = call i32 @free(i8* %144)
%146 = load i8*, i8** %15
store i8* %146, i8** %6
br label %147
147: ; preds = %143, %100, %89, %59
%148 = load i8*, i8** %6
ret i8* %148
}

LLVM IR (-O2):
@.str = [46 x i8] c"kinit: trying to mount %s on %s with type %s\0A\00"
@errno = global i64 0
@EACCES = global i64 0
@MS_RDONLY = global i64 0
@O_RDONLY = global i32 0
@.str.1 = [41 x i8] c"kinit: %s appears to be a %s filesystem\0A\00"
@.str.2 = [53 x i8] c"kinit: failed to identify filesystem %s, trying all\0A\00"
@.str.3 = [18 x i8] c"/proc/filesystems\00"
@EINVAL = global i64 0
define i8* @mount_block(i8* %0, i8* %1, i8* %2, i64 %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i8*
store i8* %2, i8** %6
%8 = bitcast i8** %7 to i8*
%9 = icmp eq i8* %2, null
br i1 %9, label %29, label %10
10: ; preds = %5
%11 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i8* %2)
%12 = tail call i32 @mount(i8* %0, i8* %1, i8* %2, i64 %3, i8* %4)
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %25
14: ; preds = %10
%15 = load i64, i64* @errno
%16 = load i64, i64* @EACCES
%17 = icmp eq i64 %15, %16
br i1 %17, label %18, label %102
18: ; preds = %14
%19 = load i64, i64* @MS_RDONLY
%20 = and i64 %19, %3
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %102
22: ; preds = %18
%23 = or i64 %19, %3
%24 = tail call i32 @mount(i8* %0, i8* %1, i8* %2, i64 %23, i8* %4)
br label %25
25: ; preds = %22, %10
%26 = phi i32 [ %24, %22 ], [ %12, %10 ]
%27 = icmp eq i32 %26, 0
%28 = select i1 %27, i8* %2, i8* null
br label %102
29: ; preds = %5
%30 = load i32, i32* @O_RDONLY
%31 = tail call i32 @open(i8* %0, i32 %30)
%32 = icmp sgt i32 %31, -1
br i1 %32, label %33, label %45
33: ; preds = %29
%34 = call i32 @identify_fs(i32 %31, i8** %6, i32* null, i32 0)
%35 = call i32 @close(i32 %31)
%36 = icmp eq i32 %34, 0
%37 = load i8*, i8** %6
%38 = icmp ne i8* %37, null
%39 = select i1 %36, i1 %38, i1 false
br i1 %39, label %40, label %45
40: ; preds = %33
%41 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* %37)
%42 = load i8*, i8** %6
%43 = call i8* @mount_block(i8* %0, i8* %1, i8* %42, i64 %3, i8* %4)
store i8* %43, i8** %6
%44 = icmp eq i8* %43, null
br i1 %44, label %45, label %102
45: ; preds = %40, %33, %29
%46 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0), i8* %0)
%47 = call i64 @readfile(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8** %7)
%48 = load i64, i64* @EINVAL
store i64 %48, i64* @errno
%49 = icmp slt i64 %47, 0
br i1 %49, label %102, label %50
50: ; preds = %45
%51 = load i8*, i8** %7
%52 = getelementptr inbounds i8, i8* %51, i64 %47
%53 = icmp eq i64 %47, 0
br i1 %53, label %98, label %54
54: ; preds = %50
store i8* %51, i8** %6
%55 = call i8* @strchr(i8* dereferenceable(1) %51, i8 signext 10)
%56 = icmp eq i8* %55, null
br i1 %56, label %95, label %57
57: ; preds = %54, %65
%58 = phi i8* [ %66, %65 ], [ %55, %54 ]
%59 = getelementptr inbounds i8, i8* %58, i64 1
store i8 0, i8* %58
%60 = load i8*, i8** %6
%61 = load i8, i8* %60
%62 = icmp eq i8 %61, 9
br i1 %62, label %68, label %63
63: ; preds = %57
%64 = icmp ult i8* %59, %52
br i1 %64, label %65, label %95
65: ; preds = %63, %89
store i8* %59, i8** %6
%66 = call i8* @strchr(i8* dereferenceable(1) %59, i8 signext 10)
%67 = icmp eq i8* %66, null
br i1 %67, label %95, label %57
68: ; preds = %57
%69 = getelementptr inbounds i8, i8* %60, i64 1
store i8* %69, i8** %6
%70 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i8* %69)
%71 = call i32 @mount(i8* %0, i8* %1, i8* %69, i64 %3, i8* %4)
%72 = icmp eq i32 %71, -1
br i1 %72, label %73, label %84
73: ; preds = %68
%74 = load i64, i64* @errno
%75 = load i64, i64* @EACCES
%76 = icmp eq i64 %74, %75
br i1 %76, label %77, label %89
77: ; preds = %73
%78 = load i64, i64* @MS_RDONLY
%79 = and i64 %78, %3
%80 = icmp eq i64 %79, 0
br i1 %80, label %81, label %89
81: ; preds = %77
%82 = or i64 %78, %3
%83 = call i32 @mount(i8* %0, i8* %1, i8* %69, i64 %82, i8* %4)
br label %84
84: ; preds = %68, %81
%85 = phi i32 [ %83, %81 ], [ %71, %68 ]
%86 = icmp eq i32 %85, 0
br i1 %86, label %95, label %87
87: ; preds = %84
%88 = load i64, i64* @errno
br label %89
89: ; preds = %87, %73, %77
%90 = phi i64 [ %88, %87 ], [ %74, %73 ], [ %74, %77 ]
%91 = load i64, i64* @EINVAL
%92 = icmp eq i64 %90, %91
%93 = icmp ult i8* %59, %52
%94 = select i1 %92, i1 %93, i1 false
br i1 %94, label %65, label %95
95: ; preds = %63, %65, %89, %84, %54
%96 = phi i8* [ null, %54 ], [ null, %63 ], [ null, %65 ], [ null, %89 ], [ %69, %84 ]
%97 = load i8*, i8** %7
br label %98
98: ; preds = %95, %50
%99 = phi i8* [ %51, %50 ], [ %97, %95 ]
%100 = phi i8* [ null, %50 ], [ %96, %95 ]
%101 = call i32 @free(i8* %99)
br label %102
102: ; preds = %25, %14, %18, %40, %45, %98
%103 = phi i8* [ %100, %98 ], [ null, %45 ], [ %43, %40 ], [ null, %18 ], [ null, %14 ], [ %28, %25 ]
ret i8* %103
}