#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 MS_MGC_VAL;
int MS_RDONLY;
int WEXITSTATUS(int);
int /*<<< orphan*/ WIFEXITED(int);
int /*<<< orphan*/ execve(char *, char **, char **);
int fork();
int mount(char *, char *, char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sleep(int);
int wait(int *);
int main(void) {
  char *kexec_load[] = {"/kexec", "-l", "/mnt/install/powerpc/vmlinux",
                        "--initrd=/mnt/install/powerpc/initrd.gz", NULL};
  char *kexec_run[] = {"/kexec", "-e", "-x", NULL};
  char *env[] = {NULL};
  int status;
  printf("Mounting /sys...\n");
  if (mount("sysfs", "/sys", "sysfs", MS_MGC_VAL, NULL) != 0)
    perror("mount");
  printf("Mounting Debian Install CD /dev/sr0...\n");
  do {
    status = mount("/dev/sr0", "/mnt", "iso9660", MS_MGC_VAL | MS_RDONLY, NULL);
    if (status != 0) {
      perror("mount");
      sleep(5);
    }
  } while (status != 0);
  printf("Loading kernel and initramfs from CD...\n");
  switch (fork()) {
  case -1:
    perror("fork");
    break;
  case 0:
    execve(kexec_load[0], kexec_load, env);
    perror("execve");
    break;
  default:
    if (wait(&status) == -1) {
      perror("wait");
      break;
    }
    if (!WIFEXITED(status)) {
      printf("child not terminated normally\n");
      break;
    }
    if (WEXITSTATUS(status) != 0) {
      printf("kexec returned %d\n", WEXITSTATUS(status));
      break;
    }
    printf("Starting kernel...\n");
    execve(kexec_run[0], kexec_run, env);
    perror("execve");
  }
  return 0xaa;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1050 <memset@plt>
lea    0xe3a(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    0xe36(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xe2e(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xe40(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0x2bfe(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0x2bfb(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0x2bf8(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0x2bf5(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    -0x58(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1050 <memset@plt>
lea    0xe27(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2d9c(%rip),%rax
mov    (%rax),%ecx
lea    0xe22(%rip),%rdx
lea    0xe21(%rip),%rsi
xor    %eax,%eax
mov    %eax,%r8d
mov    %rdx,%rdi
call   1030 <mount@plt>
cmp    $0x0,%eax
je     126e <main+0xce>
lea    0xe09(%rip),%rdi
call   1080 <perror@plt>
lea    0xe03(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2d55(%rip),%rax
mov    (%rax),%ecx
mov    0x2d5c(%rip),%rax
or     (%rax),%ecx
lea    0xe0b(%rip),%rdi
lea    0xe0d(%rip),%rsi
lea    0xe0b(%rip),%rdx
xor    %eax,%eax
mov    %eax,%r8d
call   1030 <mount@plt>
mov    %eax,-0x5c(%rbp)
cmpl   $0x0,-0x5c(%rbp)
je     12d0 <main+0x130>
lea    0xdb1(%rip),%rdi
call   1080 <perror@plt>
mov    $0x5,%edi
call   10a0 <sleep@plt>
jmp    12d5 <main+0x135>
cmpl   $0x0,-0x5c(%rbp)
jne    127c <main+0xdc>
lea    0xdd0(%rip),%rdi
xor    %eax,%eax
mov    %al,-0x61(%rbp)
call   1040 <printf@plt>
mov    -0x61(%rbp),%al
call   10c0 <fork@plt>
mov    %eax,%ecx
mov    %ecx,-0x60(%rbp)
sub    $0xffffffff,%eax
je     131b <main+0x17b>
jmp    130b <main+0x16b>
mov    -0x60(%rbp),%eax
test   %eax,%eax
je     132c <main+0x18c>
jmp    134e <main+0x1ae>
lea    0xdbd(%rip),%rdi
call   1080 <perror@plt>
jmp    13ee <main+0x24e>
mov    -0x30(%rbp),%rdi
lea    -0x30(%rbp),%rsi
lea    -0x58(%rbp),%rdx
call   1060 <execve@plt>
lea    0xda0(%rip),%rdi
call   1080 <perror@plt>
jmp    13ee <main+0x24e>
lea    -0x5c(%rbp),%rdi
call   10b0 <wait@plt>
cmp    $0xffffffff,%eax
jne    1371 <main+0x1d1>
lea    0xd84(%rip),%rdi
call   1080 <perror@plt>
jmp    13ee <main+0x24e>
mov    -0x5c(%rbp),%edi
call   1090 <WIFEXITED@plt>
cmp    $0x0,%eax
jne    1395 <main+0x1f5>
lea    0xd67(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13ee <main+0x24e>
mov    -0x5c(%rbp),%edi
call   1070 <WEXITSTATUS@plt>
cmp    $0x0,%eax
je     13c3 <main+0x223>
mov    -0x5c(%rbp),%edi
call   1070 <WEXITSTATUS@plt>
mov    %eax,%esi
lea    0xd58(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13ee <main+0x24e>
lea    0xd58(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x50(%rbp),%rdi
lea    -0x50(%rbp),%rsi
lea    -0x58(%rbp),%rdx
call   1060 <execve@plt>
lea    0xcfb(%rip),%rdi
call   1080 <perror@plt>
mov    $0xaa,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
movq   $0x0,0x30(%rsp)
lea    0xe42(%rip),%rax
mov    %rax,0x10(%rsp)
lea    0xe3d(%rip),%rax
mov    %rax,0x18(%rsp)
lea    0xe34(%rip),%rax
mov    %rax,0x20(%rsp)
lea    0xe45(%rip),%rax
mov    %rax,0x28(%rsp)
movaps 0x2c12(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0x2bf6(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movq   $0x0,0x8(%rsp)
lea    0xe91(%rip),%rdi
call   1030 <puts@plt>
mov    0x2dbd(%rip),%r13
mov    0x0(%r13),%ecx
lea    0xe35(%rip),%rsi
lea    0xe28(%rip),%rdi
mov    %rdi,%rdx
xor    %r8d,%r8d
call   1040 <mount@plt>
test   %eax,%eax
jne    133b <main+0x19b>
lea    0xe6a(%rip),%rdi
call   1030 <puts@plt>
mov    0x2d95(%rip),%rbp
mov    0x0(%rbp),%ecx
or     0x0(%r13),%ecx
lea    0xe05(%rip),%rdi
lea    0xe07(%rip),%rsi
lea    0xe05(%rip),%rdx
xor    %r8d,%r8d
call   1040 <mount@plt>
test   %eax,%eax
je     12c5 <main+0x125>
lea    0xdde(%rip),%r14
lea    0xddd(%rip),%r15
lea    0xddf(%rip),%r12
lea    0xddd(%rip),%rbx
mov    %r14,%rdi
call   1080 <perror@plt>
mov    $0x5,%edi
call   10a0 <sleep@plt>
mov    0x0(%rbp),%ecx
or     0x0(%r13),%ecx
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
xor    %r8d,%r8d
call   1040 <mount@plt>
test   %eax,%eax
jne    1297 <main+0xf7>
movl   $0x0,0x4(%rsp)
lea    0xe04(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   10c0 <fork@plt>
test   %eax,%eax
je     134c <main+0x1ac>
cmp    $0xffffffff,%eax
je     135a <main+0x1ba>
lea    0x4(%rsp),%rdi
call   10b0 <wait@plt>
cmp    $0xffffffff,%eax
je     1363 <main+0x1c3>
mov    0x4(%rsp),%edi
call   1090 <WIFEXITED@plt>
test   %eax,%eax
je     132d <main+0x18d>
mov    0x4(%rsp),%edi
call   1070 <WEXITSTATUS@plt>
test   %eax,%eax
je     136c <main+0x1cc>
mov    0x4(%rsp),%edi
call   1070 <WEXITSTATUS@plt>
lea    0xd6b(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    139a <main+0x1fa>
lea    0xdcc(%rip),%rdi
call   1030 <puts@plt>
jmp    139a <main+0x1fa>
lea    0xd1e(%rip),%rdi
call   1080 <perror@plt>
jmp    1240 <main+0xa0>
lea    0xcad(%rip),%rdi
lea    0x10(%rsp),%rsi
jmp    1384 <main+0x1e4>
lea    0xd1b(%rip),%rdi
jmp    1395 <main+0x1f5>
lea    0xd1e(%rip),%rdi
jmp    1395 <main+0x1f5>
lea    0xdab(%rip),%rdi
call   1030 <puts@plt>
lea    0xc81(%rip),%rdi
lea    0x40(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1060 <execve@plt>
lea    0xcec(%rip),%rdi
call   1080 <perror@plt>
mov    $0xaa,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"/kexec\00"
@.str.1 = [3 x i8] c"-l\00"
@.str.2 = [29 x i8] c"/mnt/install/powerpc/vmlinux\00"
@.str.3 = [40 x i8] c"--initrd=/mnt/install/powerpc/initrd.gz\00"
@.str.4 = [3 x i8] c"-e\00"
@.str.5 = [3 x i8] c"-x\00"
@__const.main.kexec_run = [4 x i8*] [i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i32 0, i32 0), i8* null]
@.str.6 = [18 x i8] c"Mounting /sys...\0A\00"
@.str.7 = [6 x i8] c"sysfs\00"
@.str.8 = [5 x i8] c"/sys\00"
@MS_MGC_VAL = global i32 0
@.str.9 = [6 x i8] c"mount\00"
@.str.10 = [40 x i8] c"Mounting Debian Install CD /dev/sr0...\0A\00"
@.str.11 = [9 x i8] c"/dev/sr0\00"
@.str.12 = [5 x i8] c"/mnt\00"
@.str.13 = [8 x i8] c"iso9660\00"
@MS_RDONLY = global i32 0
@.str.14 = [41 x i8] c"Loading kernel and initramfs from CD...\0A\00"
@.str.15 = [5 x i8] c"fork\00"
@.str.16 = [7 x i8] c"execve\00"
@.str.17 = [5 x i8] c"wait\00"
@.str.18 = [31 x i8] c"child not terminated normally\0A\00"
@.str.19 = [19 x i8] c"kexec returned %d\0A\00"
@.str.20 = [20 x i8] c"Starting kernel...\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i8*]
%3 = alloca [4 x i8*]
%4 = alloca [1 x i8*]
%5 = alloca i32
store i32 0, i32* %1
%6 = bitcast [5 x i8*]* %2 to i8*
%7 = bitcast i8* %6 to [5 x i8*]*
%8 = getelementptr inbounds [5 x i8*], [5 x i8*]* %7, i32 0, i32 0
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i32 0, i32 0), i8** %8
%9 = getelementptr inbounds [5 x i8*], [5 x i8*]* %7, i32 0, i32 1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i32 0, i32 0), i8** %9
%10 = getelementptr inbounds [5 x i8*], [5 x i8*]* %7, i32 0, i32 2
store i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i32 0, i32 0), i8** %10
%11 = getelementptr inbounds [5 x i8*], [5 x i8*]* %7, i32 0, i32 3
store i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i32 0, i32 0), i8** %11
%12 = bitcast [4 x i8*]* %3 to i8*
%13 = bitcast [1 x i8*]* %4 to i8*
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0))
%15 = load i32, i32* @MS_MGC_VAL
%16 = call i32 @mount(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i32 %15, i32* null)
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %0
%19 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
br label %20
20: ; preds = %18, %0
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.10, i64 0, i64 0))
br label %22
22: ; preds = %33, %20
%23 = load i32, i32* @MS_MGC_VAL
%24 = load i32, i32* @MS_RDONLY
%25 = or i32 %23, %24
%26 = call i32 @mount(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.13, i64 0, i64 0), i32 %25, i32* null)
store i32 %26, i32* %5
%27 = load i32, i32* %5
%28 = icmp ne i32 %27, 0
br i1 %28, label %29, label %32
29: ; preds = %22
%30 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
%31 = call i32 @sleep(i32 5)
br label %32
32: ; preds = %29, %22
br label %33
33: ; preds = %32
%34 = load i32, i32* %5
%35 = icmp ne i32 %34, 0
br i1 %35, label %22, label %36
36: ; preds = %33
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.14, i64 0, i64 0))
%38 = call i32 (...) @fork()
switch i32 %38, label %48 [
i32 -1, label %39
i32 0, label %41
]
39: ; preds = %36
%40 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0))
br label %75
41: ; preds = %36
%42 = getelementptr inbounds [5 x i8*], [5 x i8*]* %2, i64 0, i64 0
%43 = load i8*, i8** %42
%44 = getelementptr inbounds [5 x i8*], [5 x i8*]* %2, i64 0, i64 0
%45 = getelementptr inbounds [1 x i8*], [1 x i8*]* %4, i64 0, i64 0
%46 = call i32 @execve(i8* %43, i8** %44, i8** %45)
%47 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.16, i64 0, i64 0))
br label %75
48: ; preds = %36
%49 = call i32 @wait(i32* %5)
%50 = icmp eq i32 %49, -1
br i1 %50, label %51, label %53
51: ; preds = %48
%52 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.17, i64 0, i64 0))
br label %75
53: ; preds = %48
%54 = load i32, i32* %5
%55 = call i32 @WIFEXITED(i32 %54)
%56 = icmp ne i32 %55, 0
br i1 %56, label %59, label %57
57: ; preds = %53
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.18, i64 0, i64 0))
br label %75
59: ; preds = %53
%60 = load i32, i32* %5
%61 = call i32 @WEXITSTATUS(i32 %60)
%62 = icmp ne i32 %61, 0
br i1 %62, label %63, label %67
63: ; preds = %59
%64 = load i32, i32* %5
%65 = call i32 @WEXITSTATUS(i32 %64)
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.19, i64 0, i64 0), i32 %65)
br label %75
67: ; preds = %59
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.20, i64 0, i64 0))
%69 = getelementptr inbounds [4 x i8*], [4 x i8*]* %3, i64 0, i64 0
%70 = load i8*, i8** %69
%71 = getelementptr inbounds [4 x i8*], [4 x i8*]* %3, i64 0, i64 0
%72 = getelementptr inbounds [1 x i8*], [1 x i8*]* %4, i64 0, i64 0
%73 = call i32 @execve(i8* %70, i8** %71, i8** %72)
%74 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.16, i64 0, i64 0))
br label %75
75: ; preds = %67, %63, %57, %51, %41, %39
ret i32 170
}

LLVM IR (-O2):
@.str = [7 x i8] c"/kexec\00"
@.str.1 = [3 x i8] c"-l\00"
@.str.2 = [29 x i8] c"/mnt/install/powerpc/vmlinux\00"
@.str.3 = [40 x i8] c"--initrd=/mnt/install/powerpc/initrd.gz\00"
@.str.4 = [3 x i8] c"-e\00"
@.str.5 = [3 x i8] c"-x\00"
@__const.main.kexec_run = [4 x i8*] [i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i32 0, i32 0), i8* null]
@.str.7 = [6 x i8] c"sysfs\00"
@.str.8 = [5 x i8] c"/sys\00"
@MS_MGC_VAL = global i32 0
@.str.9 = [6 x i8] c"mount\00"
@.str.11 = [9 x i8] c"/dev/sr0\00"
@.str.12 = [5 x i8] c"/mnt\00"
@.str.13 = [8 x i8] c"iso9660\00"
@MS_RDONLY = global i32 0
@.str.15 = [5 x i8] c"fork\00"
@.str.16 = [7 x i8] c"execve\00"
@.str.17 = [5 x i8] c"wait\00"
@.str.19 = [19 x i8] c"kexec returned %d\0A\00"
@str = [17 x i8] c"Mounting /sys...\00"
@str.21 = [39 x i8] c"Mounting Debian Install CD /dev/sr0...\00"
@str.22 = [40 x i8] c"Loading kernel and initramfs from CD...\00"
@str.23 = [30 x i8] c"child not terminated normally\00"
@str.24 = [19 x i8] c"Starting kernel...\00"
define i32 @main() {
%1 = alloca [5 x i8*]
%2 = alloca [4 x i8*]
%3 = alloca [1 x i8*]
%4 = alloca i32
%5 = bitcast [5 x i8*]* %1 to i8*
%6 = getelementptr inbounds [5 x i8*], [5 x i8*]* %1, i64 0, i64 4
%7 = bitcast i8** %6 to i64*
store i64 0, i64* %7
%8 = getelementptr inbounds [5 x i8*], [5 x i8*]* %1, i64 0, i64 0
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %8
%9 = getelementptr inbounds [5 x i8*], [5 x i8*]* %1, i64 0, i64 1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %9
%10 = getelementptr inbounds [5 x i8*], [5 x i8*]* %1, i64 0, i64 2
store i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i8** %10
%11 = getelementptr inbounds [5 x i8*], [5 x i8*]* %1, i64 0, i64 3
store i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0), i8** %11
%12 = bitcast [4 x i8*]* %2 to i8*
%13 = bitcast [1 x i8*]* %3 to i8*
%14 = bitcast [1 x i8*]* %3 to i64*
store i64 0, i64* %14
%15 = bitcast i32* %4 to i8*
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%17 = load i32, i32* @MS_MGC_VAL
%18 = tail call i32 @mount(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i32 %17, i32* null)
%19 = icmp eq i32 %18, 0
br i1 %19, label %22, label %20
20: ; preds = %0
%21 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
br label %22
22: ; preds = %20, %0
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.21, i64 0, i64 0))
%24 = load i32, i32* @MS_MGC_VAL
%25 = load i32, i32* @MS_RDONLY
%26 = or i32 %25, %24
%27 = tail call i32 @mount(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.13, i64 0, i64 0), i32 %26, i32* null)
%28 = icmp eq i32 %27, 0
br i1 %28, label %37, label %29
29: ; preds = %22, %29
%30 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
%31 = tail call i32 @sleep(i32 5)
%32 = load i32, i32* @MS_MGC_VAL
%33 = load i32, i32* @MS_RDONLY
%34 = or i32 %33, %32
%35 = tail call i32 @mount(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.13, i64 0, i64 0), i32 %34, i32* null)
%36 = icmp eq i32 %35, 0
br i1 %36, label %37, label %29
37: ; preds = %29, %22
store i32 0, i32* %4
%38 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.22, i64 0, i64 0))
%39 = tail call i32 (...) @fork()
switch i32 %39, label %46 [
i32 -1, label %40
i32 0, label %42
]
40: ; preds = %37
%41 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0))
br label %71
42: ; preds = %37
%43 = getelementptr inbounds [1 x i8*], [1 x i8*]* %3, i64 0, i64 0
%44 = call i32 @execve(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %8, i8** %43)
%45 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.16, i64 0, i64 0))
br label %71
46: ; preds = %37
%47 = call i32 @wait(i32* %4)
%48 = icmp eq i32 %47, -1
br i1 %48, label %49, label %51
49: ; preds = %46
%50 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.17, i64 0, i64 0))
br label %71
51: ; preds = %46
%52 = load i32, i32* %4
%53 = call i32 @WIFEXITED(i32 %52)
%54 = icmp eq i32 %53, 0
br i1 %54, label %55, label %57
55: ; preds = %51
%56 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.23, i64 0, i64 0))
br label %71
57: ; preds = %51
%58 = load i32, i32* %4
%59 = call i32 @WEXITSTATUS(i32 %58)
%60 = icmp eq i32 %59, 0
br i1 %60, label %65, label %61
61: ; preds = %57
%62 = load i32, i32* %4
%63 = call i32 @WEXITSTATUS(i32 %62)
%64 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.19, i64 0, i64 0), i32 %63)
br label %71
65: ; preds = %57
%66 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.24, i64 0, i64 0))
%67 = getelementptr inbounds [4 x i8*], [4 x i8*]* %2, i64 0, i64 0
%68 = getelementptr inbounds [1 x i8*], [1 x i8*]* %3, i64 0, i64 0
%69 = call i32 @execve(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %67, i8** %68)
%70 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.16, i64 0, i64 0))
br label %71
71: ; preds = %65, %61, %55, %49, %42, %40
ret i32 170
}