#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 */

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ MNT_DETACH;
int MS_REC;
int MS_SLAVE;
int O_DIRECTORY;
int O_RDONLY;
int /*<<< orphan*/ __NR_pivot_root;
int /*<<< orphan*/ err(int /*<<< orphan*/, char *, ...);
scalar_t__ fchdir(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
scalar_t__ mount(char *, char *, char *, int, int /*<<< orphan*/ *);
int open(char *, int);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char *, char *);
scalar_t__ syscall(int /*<<< orphan*/, char *, char *);
scalar_t__ umount2(char *, int /*<<< orphan*/);
int main(int argc, char **argv) {
  int old, new;
  if (argc < 2) {
    fprintf(stderr, "Usage: %s NEW-ROOT [PUT-OLD]\n", argv[0]);
    return 64;
  }
  if (argc > 2 && strcmp(argv[1], argv[2]) != 0) {
    if (syscall(__NR_pivot_root, argv[1], argv[2]) < 0)
      err(EXIT_FAILURE, "cannot pivot to new root %s", argv[1]);
    return EXIT_SUCCESS;
  }
  if (old = open("/", O_DIRECTORY | O_RDONLY), old < 0)
    err(EXIT_FAILURE, "cannot open /");
  if (new = open(argv[1], O_DIRECTORY | O_RDONLY), new < 0)
    err(EXIT_FAILURE, "cannot open %s", argv[1]);
  if (fchdir(new) < 0 || syscall(__NR_pivot_root, ".", ".") < 0)
    err(EXIT_FAILURE, "cannot pivot to new root %s", argv[1]);
  if (fchdir(old) < 0)
    err(EXIT_FAILURE, "cannot re-enter old root");
  if (mount("", ".", "", MS_SLAVE | MS_REC, NULL) < 0)
    err(EXIT_FAILURE, "cannot disable old root mount propagation");
  if (umount2(".", MNT_DETACH) < 0)
    err(EXIT_FAILURE, "cannot detach old root");
  if (fchdir(new) < 0)
    err(EXIT_FAILURE, "cannot re-enter new root");
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    11c8 <main+0x48>
mov    0x2e19(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe49(%rip),%rsi
call   1060 <fprintf@plt>
movl   $0x40,-0x4(%rbp)
jmp    140b <main+0x28b>
cmpl   $0x2,-0x8(%rbp)
jle    1249 <main+0xc9>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
je     1249 <main+0xc9>
mov    0x2dd8(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdx
call   1070 <syscall@plt>
cmp    $0x0,%rax
jge    1238 <main+0xb8>
mov    0x2d90(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xded(%rip),%rsi
mov    $0x0,%al
call   1080 <err@plt>
mov    0x2d61(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    140b <main+0x28b>
mov    0x2d78(%rip),%rax
mov    (%rax),%esi
mov    0x2d8f(%rip),%rax
or     (%rax),%esi
lea    0xde4(%rip),%rdi
call   10a0 <open@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    128b <main+0x10b>
mov    0x2d35(%rip),%rax
mov    (%rax),%edi
lea    0xdb6(%rip),%rsi
mov    $0x0,%al
call   1080 <err@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    0x2d2e(%rip),%rax
mov    (%rax),%esi
mov    0x2d45(%rip),%rax
or     (%rax),%esi
call   10a0 <open@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    12d6 <main+0x156>
mov    0x2cf2(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xd79(%rip),%rsi
mov    $0x0,%al
call   1080 <err@plt>
mov    -0x18(%rbp),%edi
call   1090 <fchdir@plt>
cmp    $0x0,%rax
jl     130a <main+0x18a>
mov    0x2ce1(%rip),%rax
mov    (%rax),%edi
lea    0xd5f(%rip),%rdx
mov    %rdx,%rsi
call   1070 <syscall@plt>
cmp    $0x0,%rax
jge    1329 <main+0x1a9>
mov    0x2c9f(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xcfc(%rip),%rsi
mov    $0x0,%al
call   1080 <err@plt>
mov    -0x14(%rbp),%edi
call   1090 <fchdir@plt>
cmp    $0x0,%rax
jge    1352 <main+0x1d2>
mov    0x2c6e(%rip),%rax
mov    (%rax),%edi
lea    0xd0e(%rip),%rsi
mov    $0x0,%al
call   1080 <err@plt>
mov    0x2c5f(%rip),%rax
mov    (%rax),%ecx
mov    0x2c7e(%rip),%rax
or     (%rax),%ecx
lea    0xcb2(%rip),%rdx
lea    0xce5(%rip),%rsi
xor    %eax,%eax
mov    %eax,%r8d
mov    %rdx,%rdi
call   1040 <mount@plt>
cmp    $0x0,%rax
jge    13a0 <main+0x220>
mov    0x2c20(%rip),%rax
mov    (%rax),%edi
lea    0xcd9(%rip),%rsi
mov    $0x0,%al
call   1080 <err@plt>
mov    0x2c01(%rip),%rax
mov    (%rax),%esi
lea    0xca7(%rip),%rdi
call   1030 <umount2@plt>
cmp    $0x0,%rax
jge    13d6 <main+0x256>
mov    0x2bea(%rip),%rax
mov    (%rax),%edi
lea    0xccd(%rip),%rsi
mov    $0x0,%al
call   1080 <err@plt>
mov    -0x18(%rbp),%edi
call   1090 <fchdir@plt>
cmp    $0x0,%rax
jge    13ff <main+0x27f>
mov    0x2bc1(%rip),%rax
mov    (%rax),%edi
lea    0xcbb(%rip),%rsi
mov    $0x0,%al
call   1080 <err@plt>
mov    0x2b9a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
cmp    $0x1,%edi
jg     11b1 <main+0x31>
mov    0x2e2a(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
lea    0xe5e(%rip),%rsi
call   1060 <fprintf@plt>
mov    $0x40,%eax
jmp    1384 <main+0x204>
cmp    $0x2,%edi
je     1207 <main+0x87>
mov    0x8(%rbx),%rdi
mov    0x10(%rbx),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1207 <main+0x87>
mov    0x2e01(%rip),%rax
mov    (%rax),%edi
mov    0x8(%rbx),%rsi
mov    0x10(%rbx),%rdx
call   1070 <syscall@plt>
test   %rax,%rax
jns    137b <main+0x1fb>
mov    0x2dc2(%rip),%rax
mov    (%rax),%edi
mov    0x8(%rbx),%rdx
lea    0xe23(%rip),%rsi
xor    %eax,%eax
call   1080 <err@plt>
jmp    137b <main+0x1fb>
mov    0x2dba(%rip),%r14
mov    0x2dd3(%rip),%rbp
mov    0x0(%rbp),%esi
or     (%r14),%esi
lea    0xe24(%rip),%rdi
call   10a0 <open@plt>
mov    %eax,%r15d
test   %eax,%eax
jns    1245 <main+0xc5>
mov    0x2d7b(%rip),%rax
mov    (%rax),%edi
lea    0xdfc(%rip),%rsi
xor    %eax,%eax
call   1080 <err@plt>
mov    0x8(%rbx),%rdi
mov    0x0(%rbp),%esi
or     (%r14),%esi
call   10a0 <open@plt>
mov    %eax,%r14d
test   %eax,%eax
jns    1276 <main+0xf6>
mov    0x2d4e(%rip),%rax
mov    (%rax),%edi
mov    0x8(%rbx),%rdx
lea    0xdd9(%rip),%rsi
xor    %eax,%eax
call   1080 <err@plt>
mov    %r14d,%edi
call   1090 <fchdir@plt>
test   %rax,%rax
js     12a0 <main+0x120>
mov    0x2d46(%rip),%rax
mov    (%rax),%edi
lea    0xdc4(%rip),%rdx
mov    %rdx,%rsi
call   1070 <syscall@plt>
test   %rax,%rax
jns    12bb <main+0x13b>
mov    0x2d09(%rip),%rax
mov    (%rax),%edi
mov    0x8(%rbx),%rdx
lea    0xd6a(%rip),%rsi
xor    %eax,%eax
call   1080 <err@plt>
mov    %r15d,%edi
call   1090 <fchdir@plt>
test   %rax,%rax
jns    12df <main+0x15f>
mov    0x2ce1(%rip),%rax
mov    (%rax),%edi
lea    0xd81(%rip),%rsi
xor    %eax,%eax
call   1080 <err@plt>
mov    0x2cd2(%rip),%rax
mov    0x2cf3(%rip),%rcx
mov    (%rcx),%ecx
or     (%rax),%ecx
lea    0xd5f(%rip),%rsi
lea    0xd1e(%rip),%rdi
mov    %rdi,%rdx
xor    %r8d,%r8d
call   1040 <mount@plt>
test   %rax,%rax
jns    1326 <main+0x1a6>
mov    0x2c9a(%rip),%rax
mov    (%rax),%edi
lea    0xd53(%rip),%rsi
xor    %eax,%eax
call   1080 <err@plt>
mov    0x2c7b(%rip),%rax
mov    (%rax),%esi
lea    0xd21(%rip),%rdi
call   1030 <umount2@plt>
test   %rax,%rax
jns    1357 <main+0x1d7>
mov    0x2c69(%rip),%rax
mov    (%rax),%edi
lea    0xd4c(%rip),%rsi
xor    %eax,%eax
call   1080 <err@plt>
mov    %r14d,%edi
call   1090 <fchdir@plt>
test   %rax,%rax
jns    137b <main+0x1fb>
mov    0x2c45(%rip),%rax
mov    (%rax),%edi
lea    0xd3f(%rip),%rsi
xor    %eax,%eax
call   1080 <err@plt>
mov    0x2c1e(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [30 x i8] c"Usage: %s NEW-ROOT [PUT-OLD]\0A\00"
@__NR_pivot_root = global i32 0
@EXIT_FAILURE = global i32 0
@.str.1 = [28 x i8] c"cannot pivot to new root %s\00"
@EXIT_SUCCESS = global i32 0
@.str.2 = [2 x i8] c"/\00"
@O_DIRECTORY = global i32 0
@O_RDONLY = global i32 0
@.str.3 = [14 x i8] c"cannot open /\00"
@.str.4 = [15 x i8] c"cannot open %s\00"
@.str.5 = [2 x i8] c".\00"
@.str.6 = [25 x i8] c"cannot re-enter old root\00"
@.str.7 = [1 x i8] zeroinitializer
@MS_SLAVE = global i32 0
@MS_REC = global i32 0
@.str.8 = [42 x i8] c"cannot disable old root mount propagation\00"
@MNT_DETACH = global i32 0
@.str.9 = [23 x i8] c"cannot detach old root\00"
@.str.10 = [25 x i8] c"cannot re-enter new root\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 2
br i1 %9, label %10, label %16
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 0
%14 = load i8*, i8** %13
%15 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %14)
store i32 64, i32* %3
br label %118
16: ; preds = %2
%17 = load i32, i32* %4
%18 = icmp sgt i32 %17, 2
br i1 %18, label %19, label %46
19: ; preds = %16
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = load i8*, i8** %21
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 2
%25 = load i8*, i8** %24
%26 = call i64 @strcmp(i8* %22, i8* %25)
%27 = icmp ne i64 %26, 0
br i1 %27, label %28, label %46
28: ; preds = %19
%29 = load i32, i32* @__NR_pivot_root
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 1
%32 = load i8*, i8** %31
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i64 2
%35 = load i8*, i8** %34
%36 = call i64 @syscall(i32 %29, i8* %32, i8* %35)
%37 = icmp slt i64 %36, 0
br i1 %37, label %38, label %44
38: ; preds = %28
%39 = load i32, i32* @EXIT_FAILURE
%40 = load i8**, i8*** %5
%41 = getelementptr inbounds i8*, i8** %40, i64 1
%42 = load i8*, i8** %41
%43 = call i32 (i32, i8*, ...) @err(i32 %39, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i8* %42)
br label %44
44: ; preds = %38, %28
%45 = load i32, i32* @EXIT_SUCCESS
store i32 %45, i32* %3
br label %118
46: ; preds = %19, %16
%47 = load i32, i32* @O_DIRECTORY
%48 = load i32, i32* @O_RDONLY
%49 = or i32 %47, %48
%50 = call i32 @open(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 %49)
store i32 %50, i32* %6
%51 = load i32, i32* %6
%52 = icmp slt i32 %51, 0
br i1 %52, label %53, label %56
53: ; preds = %46
%54 = load i32, i32* @EXIT_FAILURE
%55 = call i32 (i32, i8*, ...) @err(i32 %54, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
br label %56
56: ; preds = %53, %46
%57 = load i8**, i8*** %5
%58 = getelementptr inbounds i8*, i8** %57, i64 1
%59 = load i8*, i8** %58
%60 = load i32, i32* @O_DIRECTORY
%61 = load i32, i32* @O_RDONLY
%62 = or i32 %60, %61
%63 = call i32 @open(i8* %59, i32 %62)
store i32 %63, i32* %7
%64 = load i32, i32* %7
%65 = icmp slt i32 %64, 0
br i1 %65, label %66, label %72
66: ; preds = %56
%67 = load i32, i32* @EXIT_FAILURE
%68 = load i8**, i8*** %5
%69 = getelementptr inbounds i8*, i8** %68, i64 1
%70 = load i8*, i8** %69
%71 = call i32 (i32, i8*, ...) @err(i32 %67, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* %70)
br label %72
72: ; preds = %66, %56
%73 = load i32, i32* %7
%74 = call i64 @fchdir(i32 %73)
%75 = icmp slt i64 %74, 0
br i1 %75, label %80, label %76
76: ; preds = %72
%77 = load i32, i32* @__NR_pivot_root
%78 = call i64 @syscall(i32 %77, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%79 = icmp slt i64 %78, 0
br i1 %79, label %80, label %86
80: ; preds = %76, %72
%81 = load i32, i32* @EXIT_FAILURE
%82 = load i8**, i8*** %5
%83 = getelementptr inbounds i8*, i8** %82, i64 1
%84 = load i8*, i8** %83
%85 = call i32 (i32, i8*, ...) @err(i32 %81, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i8* %84)
br label %86
86: ; preds = %80, %76
%87 = load i32, i32* %6
%88 = call i64 @fchdir(i32 %87)
%89 = icmp slt i64 %88, 0
br i1 %89, label %90, label %93
90: ; preds = %86
%91 = load i32, i32* @EXIT_FAILURE
%92 = call i32 (i32, i8*, ...) @err(i32 %91, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0))
br label %93
93: ; preds = %90, %86
%94 = load i32, i32* @MS_SLAVE
%95 = load i32, i32* @MS_REC
%96 = or i32 %94, %95
%97 = call i64 @mount(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i64 0, i64 0), i32 %96, i32* null)
%98 = icmp slt i64 %97, 0
br i1 %98, label %99, label %102
99: ; preds = %93
%100 = load i32, i32* @EXIT_FAILURE
%101 = call i32 (i32, i8*, ...) @err(i32 %100, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.8, i64 0, i64 0))
br label %102
102: ; preds = %99, %93
%103 = load i32, i32* @MNT_DETACH
%104 = call i64 @umount2(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i32 %103)
%105 = icmp slt i64 %104, 0
br i1 %105, label %106, label %109
106: ; preds = %102
%107 = load i32, i32* @EXIT_FAILURE
%108 = call i32 (i32, i8*, ...) @err(i32 %107, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i64 0, i64 0))
br label %109
109: ; preds = %106, %102
%110 = load i32, i32* %7
%111 = call i64 @fchdir(i32 %110)
%112 = icmp slt i64 %111, 0
br i1 %112, label %113, label %116
113: ; preds = %109
%114 = load i32, i32* @EXIT_FAILURE
%115 = call i32 (i32, i8*, ...) @err(i32 %114, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.10, i64 0, i64 0))
br label %116
116: ; preds = %113, %109
%117 = load i32, i32* @EXIT_SUCCESS
store i32 %117, i32* %3
br label %118
118: ; preds = %116, %44, %10
%119 = load i32, i32* %3
ret i32 %119
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [30 x i8] c"Usage: %s NEW-ROOT [PUT-OLD]\0A\00"
@__NR_pivot_root = global i32 0
@EXIT_FAILURE = global i32 0
@.str.1 = [28 x i8] c"cannot pivot to new root %s\00"
@EXIT_SUCCESS = global i32 0
@.str.2 = [2 x i8] c"/\00"
@O_DIRECTORY = global i32 0
@O_RDONLY = global i32 0
@.str.3 = [14 x i8] c"cannot open /\00"
@.str.4 = [15 x i8] c"cannot open %s\00"
@.str.5 = [2 x i8] c".\00"
@.str.6 = [25 x i8] c"cannot re-enter old root\00"
@.str.7 = [1 x i8] zeroinitializer
@MS_SLAVE = global i32 0
@MS_REC = global i32 0
@.str.8 = [42 x i8] c"cannot disable old root mount propagation\00"
@MNT_DETACH = global i32 0
@.str.9 = [23 x i8] c"cannot detach old root\00"
@.str.10 = [25 x i8] c"cannot re-enter new root\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %1
%7 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %91
8: ; preds = %2
%9 = icmp eq i32 %0, 2
br i1 %9, label %29, label %10
10: ; preds = %8
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = getelementptr inbounds i8*, i8** %1, i64 2
%14 = load i8*, i8** %13
%15 = tail call i64 @strcmp(i8* %12, i8* %14)
%16 = icmp eq i64 %15, 0
br i1 %16, label %29, label %17
17: ; preds = %10
%18 = load i32, i32* @__NR_pivot_root
%19 = load i8*, i8** %11
%20 = load i8*, i8** %13
%21 = tail call i64 @syscall(i32 %18, i8* %19, i8* %20)
%22 = icmp slt i64 %21, 0
br i1 %22, label %23, label %27
23: ; preds = %17
%24 = load i32, i32* @EXIT_FAILURE
%25 = load i8*, i8** %11
%26 = tail call i32 (i32, i8*, ...) @err(i32 %24, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i8* %25)
br label %27
27: ; preds = %23, %17
%28 = load i32, i32* @EXIT_SUCCESS
br label %91
29: ; preds = %10, %8
%30 = load i32, i32* @O_DIRECTORY
%31 = load i32, i32* @O_RDONLY
%32 = or i32 %31, %30
%33 = tail call i32 @open(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 %32)
%34 = icmp slt i32 %33, 0
br i1 %34, label %35, label %38
35: ; preds = %29
%36 = load i32, i32* @EXIT_FAILURE
%37 = tail call i32 (i32, i8*, ...) @err(i32 %36, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
br label %38
38: ; preds = %35, %29
%39 = getelementptr inbounds i8*, i8** %1, i64 1
%40 = load i8*, i8** %39
%41 = load i32, i32* @O_DIRECTORY
%42 = load i32, i32* @O_RDONLY
%43 = or i32 %42, %41
%44 = tail call i32 @open(i8* %40, i32 %43)
%45 = icmp slt i32 %44, 0
br i1 %45, label %46, label %50
46: ; preds = %38
%47 = load i32, i32* @EXIT_FAILURE
%48 = load i8*, i8** %39
%49 = tail call i32 (i32, i8*, ...) @err(i32 %47, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* %48)
br label %50
50: ; preds = %46, %38
%51 = tail call i64 @fchdir(i32 %44)
%52 = icmp slt i64 %51, 0
br i1 %52, label %57, label %53
53: ; preds = %50
%54 = load i32, i32* @__NR_pivot_root
%55 = tail call i64 @syscall(i32 %54, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%56 = icmp slt i64 %55, 0
br i1 %56, label %57, label %61
57: ; preds = %53, %50
%58 = load i32, i32* @EXIT_FAILURE
%59 = load i8*, i8** %39
%60 = tail call i32 (i32, i8*, ...) @err(i32 %58, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i8* %59)
br label %61
61: ; preds = %57, %53
%62 = tail call i64 @fchdir(i32 %33)
%63 = icmp slt i64 %62, 0
br i1 %63, label %64, label %67
64: ; preds = %61
%65 = load i32, i32* @EXIT_FAILURE
%66 = tail call i32 (i32, i8*, ...) @err(i32 %65, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0))
br label %67
67: ; preds = %64, %61
%68 = load i32, i32* @MS_SLAVE
%69 = load i32, i32* @MS_REC
%70 = or i32 %69, %68
%71 = tail call i64 @mount(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i64 0, i64 0), i32 %70, i32* null)
%72 = icmp slt i64 %71, 0
br i1 %72, label %73, label %76
73: ; preds = %67
%74 = load i32, i32* @EXIT_FAILURE
%75 = tail call i32 (i32, i8*, ...) @err(i32 %74, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.8, i64 0, i64 0))
br label %76
76: ; preds = %73, %67
%77 = load i32, i32* @MNT_DETACH
%78 = tail call i64 @umount2(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i32 %77)
%79 = icmp slt i64 %78, 0
br i1 %79, label %80, label %83
80: ; preds = %76
%81 = load i32, i32* @EXIT_FAILURE
%82 = tail call i32 (i32, i8*, ...) @err(i32 %81, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i64 0, i64 0))
br label %83
83: ; preds = %80, %76
%84 = tail call i64 @fchdir(i32 %44)
%85 = icmp slt i64 %84, 0
br i1 %85, label %86, label %89
86: ; preds = %83
%87 = load i32, i32* @EXIT_FAILURE
%88 = tail call i32 (i32, i8*, ...) @err(i32 %87, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.10, i64 0, i64 0))
br label %89
89: ; preds = %86, %83
%90 = load i32, i32* @EXIT_SUCCESS
br label %91
91: ; preds = %89, %27, %4
%92 = phi i32 [ 64, %4 ], [ %28, %27 ], [ %90, %89 ]
ret i32 %92
}