#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*/ sigset_t;
typedef int /*<<< orphan*/ c;

/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int /*<<< orphan*/ SIG_SETMASK;
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ chdir(char *);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ closefrom(int);
int dup2(int, int);
int /*<<< orphan*/ exit(int);
int fork();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ process_owner(int);
int receive_message(int, char *, int, int *, int *);
int setsid();
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
int /*<<< orphan*/ sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
int strtol(char *, char **, int);
int /*<<< orphan*/ waitpid(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  int nullfd;
  char *end;
  int cfd;
  sigset_t empty;
  if (argc != 2 || !argv[1][0])
    goto out_inval;
  cfd = strtol(argv[1], &end, 10);
  if (*end)
    goto out_inval;
  switch (fork()) {
  case -1:
    perror("ulockmgr_server: fork");
    exit(1);
  case 0:
    break;
  default:
    _exit(0);
  }
  if (setsid() == -1) {
    perror("ulockmgr_server: setsid");
    exit(1);
  }
  (void)chdir("/");
  sigemptyset(&empty);
  sigprocmask(SIG_SETMASK, &empty, NULL);
  if (dup2(cfd, 4) == -1) {
    perror("ulockmgr_server: dup2");
    exit(1);
  }
  cfd = 4;
  nullfd = open("/dev/null", O_RDWR);
  dup2(nullfd, 0);
  dup2(nullfd, 1);
  close(3);
  closefrom(5);
  while (1) {
    char c;
    int sock;
    int pid;
    int numfds = 1;
    int res = receive_message(cfd, &c, sizeof(c), &sock, &numfds);
    if (!res)
      break;
    if (res == -1)
      exit(1);
    assert(numfds == 1);
    pid = fork();
    if (pid == -1) {
      perror("ulockmgr_server: fork");
      close(sock);
      continue;
    }
    if (pid == 0) {
      close(cfd);
      pid = fork();
      if (pid == -1) {
        perror("ulockmgr_server: fork");
        _exit(1);
      }
      if (pid == 0)
        process_owner(sock);
      _exit(0);
    }
    waitpid(pid, NULL, 0);
    close(sock);
  }
  return 0;
out_inval:
  fprintf(stderr, "%s should be started by libulockmgr\n", argv[0]);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    1251 <main+0x31>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
cmpb   $0x0,(%rax)
jne    1256 <main+0x36>
jmp    1494 <main+0x274>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x20(%rbp),%rsi
mov    $0xa,%edx
call   10e0 <strtol@plt>
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     1281 <main+0x61>
jmp    1494 <main+0x274>
xor    %eax,%eax
call   1140 <fork@plt>
mov    %eax,%ecx
mov    %ecx,-0x40(%rbp)
sub    $0xffffffff,%eax
je     12ab <main+0x8b>
jmp    129b <main+0x7b>
mov    -0x40(%rbp),%eax
test   %eax,%eax
je     12c1 <main+0xa1>
jmp    12c6 <main+0xa6>
lea    0xd4e(%rip),%rdi
call   1120 <perror@plt>
mov    $0x1,%edi
call   1130 <exit@plt>
jmp    12cd <main+0xad>
xor    %edi,%edi
call   1040 <_exit@plt>
mov    $0x0,%al
call   10a0 <setsid@plt>
cmp    $0xffffffff,%eax
jne    12f3 <main+0xd3>
lea    0xd32(%rip),%rdi
call   1120 <perror@plt>
mov    $0x1,%edi
call   1130 <exit@plt>
lea    0xd34(%rip),%rdi
call   1070 <chdir@plt>
lea    -0x28(%rbp),%rdi
call   10d0 <sigemptyset@plt>
mov    0x2cd1(%rip),%rax
mov    (%rax),%edi
lea    -0x28(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigprocmask@plt>
mov    -0x24(%rbp),%edi
mov    $0x4,%esi
call   1080 <dup2@plt>
cmp    $0xffffffff,%eax
jne    134a <main+0x12a>
lea    0xcf5(%rip),%rdi
call   1120 <perror@plt>
mov    $0x1,%edi
call   1130 <exit@plt>
movl   $0x4,-0x24(%rbp)
mov    0x2c90(%rip),%rax
mov    (%rax),%esi
lea    0xce5(%rip),%rdi
call   1110 <open@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
xor    %esi,%esi
call   1080 <dup2@plt>
mov    -0x14(%rbp),%edi
mov    $0x1,%esi
call   1080 <dup2@plt>
mov    $0x3,%edi
call   1090 <close@plt>
mov    $0x5,%edi
call   1050 <closefrom@plt>
movl   $0x1,-0x38(%rbp)
mov    -0x24(%rbp),%edi
lea    -0x29(%rbp),%rsi
mov    $0x1,%edx
lea    -0x30(%rbp),%rcx
lea    -0x38(%rbp),%r8
call   10f0 <receive_message@plt>
mov    %eax,-0x3c(%rbp)
cmpl   $0x0,-0x3c(%rbp)
jne    13c6 <main+0x1a6>
jmp    1488 <main+0x268>
cmpl   $0xffffffff,-0x3c(%rbp)
jne    13da <main+0x1ba>
mov    $0x1,%edi
call   1130 <exit@plt>
cmpl   $0x1,-0x38(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   10b0 <assert@plt>
mov    $0x0,%al
call   1140 <fork@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0xffffffff,-0x34(%rbp)
jne    1418 <main+0x1f8>
lea    0xbfa(%rip),%rdi
call   1120 <perror@plt>
mov    -0x30(%rbp),%edi
call   1090 <close@plt>
jmp    1394 <main+0x174>
cmpl   $0x0,-0x34(%rbp)
jne    146d <main+0x24d>
mov    -0x24(%rbp),%edi
call   1090 <close@plt>
mov    $0x0,%al
call   1140 <fork@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0xffffffff,-0x34(%rbp)
jne    1454 <main+0x234>
lea    0xbbb(%rip),%rdi
call   1120 <perror@plt>
mov    $0x1,%edi
call   1040 <_exit@plt>
cmpl   $0x0,-0x34(%rbp)
jne    1466 <main+0x246>
mov    -0x30(%rbp),%edi
call   1060 <process_owner@plt>
xor    %edi,%edi
call   1040 <_exit@plt>
mov    -0x34(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1100 <waitpid@plt>
mov    -0x30(%rbp),%edi
call   1090 <close@plt>
jmp    1394 <main+0x174>
movl   $0x0,-0x4(%rbp)
jmp    14b7 <main+0x297>
mov    0x2b35(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xba5(%rip),%rsi
call   10c0 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x20,%rsp
mov    %rsi,%rbx
cmp    $0x2,%edi
jne    1258 <main+0x38>
mov    0x8(%rbx),%rdi
cmpb   $0x0,(%rdi)
je     1258 <main+0x38>
lea    0x10(%rsp),%rsi
mov    $0xa,%edx
call   10e0 <strtol@plt>
mov    %eax,%ebp
mov    0x10(%rsp),%rax
cmpb   $0x0,(%rax)
je     1282 <main+0x62>
mov    0x2d71(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
lea    0xde5(%rip),%rsi
call   10c0 <fprintf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %eax,%eax
call   1140 <fork@plt>
test   %eax,%eax
jne    1400 <main+0x1e0>
xor    %eax,%eax
call   10a0 <setsid@plt>
cmp    $0xffffffff,%eax
je     140e <main+0x1ee>
lea    0xd86(%rip),%rdi
call   1070 <chdir@plt>
lea    0x1c(%rsp),%rbx
mov    %rbx,%rdi
call   10d0 <sigemptyset@plt>
mov    0x2d1f(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <sigprocmask@plt>
mov    %ebp,%edi
mov    $0x4,%esi
call   1080 <dup2@plt>
cmp    $0xffffffff,%eax
je     1417 <main+0x1f7>
mov    0x2cff(%rip),%rax
mov    (%rax),%esi
lea    0xd54(%rip),%rdi
call   1110 <open@plt>
mov    %eax,%ebx
mov    %eax,%edi
xor    %esi,%esi
call   1080 <dup2@plt>
mov    %ebx,%edi
mov    $0x1,%esi
call   1080 <dup2@plt>
mov    $0x3,%edi
call   1090 <close@plt>
mov    $0x5,%edi
call   1050 <closefrom@plt>
lea    0x7(%rsp),%r14
lea    0xc(%rsp),%r15
lea    0x8(%rsp),%rbx
lea    0xcc8(%rip),%r12
jmp    1359 <main+0x139>
mov    %r12,%rdi
call   1120 <perror@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0xc(%rsp),%edi
call   1090 <close@plt>
movl   $0x1,0x8(%rsp)
mov    $0x4,%edi
mov    %r14,%rsi
mov    $0x1,%edx
mov    %r15,%rcx
mov    %rbx,%r8
call   10f0 <receive_message@plt>
test   %eax,%eax
je     13af <main+0x18f>
cmp    $0xffffffff,%eax
je     13b6 <main+0x196>
xor    %edi,%edi
cmpl   $0x1,0x8(%rsp)
sete   %dil
call   10b0 <assert@plt>
xor    %eax,%eax
call   1140 <fork@plt>
cmp    $0xffffffff,%eax
je     133a <main+0x11a>
test   %eax,%eax
je     13c0 <main+0x1a0>
mov    %eax,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1100 <waitpid@plt>
jmp    1350 <main+0x130>
xor    %eax,%eax
jmp    1275 <main+0x55>
mov    $0x1,%edi
call   1130 <exit@plt>
mov    $0x4,%edi
call   1090 <close@plt>
xor    %eax,%eax
call   1140 <fork@plt>
test   %eax,%eax
je     13f0 <main+0x1d0>
cmp    $0xffffffff,%eax
jne    13f9 <main+0x1d9>
lea    0xc1f(%rip),%rdi
call   1120 <perror@plt>
mov    $0x1,%edi
call   1040 <_exit@plt>
mov    0xc(%rsp),%edi
call   1060 <process_owner@plt>
xor    %edi,%edi
call   1040 <_exit@plt>
cmp    $0xffffffff,%eax
jne    13f9 <main+0x1d9>
lea    0xbf4(%rip),%rdi
jmp    141e <main+0x1fe>
lea    0xc01(%rip),%rdi
jmp    141e <main+0x1fe>
lea    0xc12(%rip),%rdi
call   1120 <perror@plt>
mov    $0x1,%edi
call   1130 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"ulockmgr_server: fork\00"
@.str.1 = [24 x i8] c"ulockmgr_server: setsid\00"
@.str.2 = [2 x i8] c"/\00"
@SIG_SETMASK = global i32 0
@.str.3 = [22 x i8] c"ulockmgr_server: dup2\00"
@.str.4 = [10 x i8] c"/dev/null\00"
@O_RDWR = global i32 0
@stderr = global i32 0
@.str.5 = [37 x i8] c"%s should be started by libulockmgr\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%15 = load i32, i32* %4
%16 = icmp ne i32 %15, 2
br i1 %16, label %24, label %17
17: ; preds = %2
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 1
%20 = load i8*, i8** %19
%21 = getelementptr inbounds i8, i8* %20, i64 0
%22 = load i8, i8* %21
%23 = icmp ne i8 %22, 0
br i1 %23, label %25, label %24
24: ; preds = %17, %2
br label %117
25: ; preds = %17
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 1
%28 = load i8*, i8** %27
%29 = call i32 @strtol(i8* %28, i8** %7, i32 10)
store i32 %29, i32* %8
%30 = load i8*, i8** %7
%31 = load i8, i8* %30
%32 = icmp ne i8 %31, 0
br i1 %32, label %33, label %34
33: ; preds = %25
br label %117
34: ; preds = %25
%35 = call i32 (...) @fork()
switch i32 %35, label %40 [
i32 -1, label %36
i32 0, label %39
]
36: ; preds = %34
%37 = call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%38 = call i32 @exit(i32 1)
unreachable
39: ; preds = %34
br label %42
40: ; preds = %34
%41 = call i32 @_exit(i32 0)
unreachable
42: ; preds = %39
%43 = call i32 (...) @setsid()
%44 = icmp eq i32 %43, -1
br i1 %44, label %45, label %48
45: ; preds = %42
%46 = call i32 @perror(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%47 = call i32 @exit(i32 1)
unreachable
48: ; preds = %42
%49 = call i32 @chdir(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%50 = call i32 @sigemptyset(i32* %9)
%51 = load i32, i32* @SIG_SETMASK
%52 = call i32 @sigprocmask(i32 %51, i32* %9, i32* null)
%53 = load i32, i32* %8
%54 = call i32 @dup2(i32 %53, i32 4)
%55 = icmp eq i32 %54, -1
br i1 %55, label %56, label %59
56: ; preds = %48
%57 = call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
%58 = call i32 @exit(i32 1)
unreachable
59: ; preds = %48
store i32 4, i32* %8
%60 = load i32, i32* @O_RDWR
%61 = call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %60)
store i32 %61, i32* %6
%62 = load i32, i32* %6
%63 = call i32 @dup2(i32 %62, i32 0)
%64 = load i32, i32* %6
%65 = call i32 @dup2(i32 %64, i32 1)
%66 = call i32 @close(i32 3)
%67 = call i32 @closefrom(i32 5)
br label %68
68: ; preds = %59, %87, %111
store i32 1, i32* %13
%69 = load i32, i32* %8
%70 = call i32 @receive_message(i32 %69, i8* %10, i32 1, i32* %11, i32* %13)
store i32 %70, i32* %14
%71 = load i32, i32* %14
%72 = icmp ne i32 %71, 0
br i1 %72, label %74, label %73
73: ; preds = %68
br label %116
74: ; preds = %68
%75 = load i32, i32* %14
%76 = icmp eq i32 %75, -1
br i1 %76, label %77, label %79
77: ; preds = %74
%78 = call i32 @exit(i32 1)
unreachable
79: ; preds = %74
%80 = load i32, i32* %13
%81 = icmp eq i32 %80, 1
%82 = zext i1 %81 to i32
%83 = call i32 @assert(i32 %82)
%84 = call i32 (...) @fork()
store i32 %84, i32* %12
%85 = load i32, i32* %12
%86 = icmp eq i32 %85, -1
br i1 %86, label %87, label %91
87: ; preds = %79
%88 = call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%89 = load i32, i32* %11
%90 = call i32 @close(i32 %89)
br label %68
91: ; preds = %79
%92 = load i32, i32* %12
%93 = icmp eq i32 %92, 0
br i1 %93, label %94, label %111
94: ; preds = %91
%95 = load i32, i32* %8
%96 = call i32 @close(i32 %95)
%97 = call i32 (...) @fork()
store i32 %97, i32* %12
%98 = load i32, i32* %12
%99 = icmp eq i32 %98, -1
br i1 %99, label %100, label %103
100: ; preds = %94
%101 = call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%102 = call i32 @_exit(i32 1)
unreachable
103: ; preds = %94
%104 = load i32, i32* %12
%105 = icmp eq i32 %104, 0
br i1 %105, label %106, label %109
106: ; preds = %103
%107 = load i32, i32* %11
%108 = call i32 @process_owner(i32 %107)
br label %109
109: ; preds = %106, %103
%110 = call i32 @_exit(i32 0)
unreachable
111: ; preds = %91
%112 = load i32, i32* %12
%113 = call i32 @waitpid(i32 %112, i32* null, i32 0)
%114 = load i32, i32* %11
%115 = call i32 @close(i32 %114)
br label %68
116: ; preds = %73
store i32 0, i32* %3
br label %123
117: ; preds = %33, %24
%118 = load i32, i32* @stderr
%119 = load i8**, i8*** %5
%120 = getelementptr inbounds i8*, i8** %119, i64 0
%121 = load i8*, i8** %120
%122 = call i32 @fprintf(i32 %118, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0), i8* %121)
store i32 1, i32* %3
br label %123
123: ; preds = %117, %116
%124 = load i32, i32* %3
ret i32 %124
}

LLVM IR (-O2):
@.str = [22 x i8] c"ulockmgr_server: fork\00"
@.str.1 = [24 x i8] c"ulockmgr_server: setsid\00"
@.str.2 = [2 x i8] c"/\00"
@SIG_SETMASK = global i32 0
@.str.3 = [22 x i8] c"ulockmgr_server: dup2\00"
@.str.4 = [10 x i8] c"/dev/null\00"
@O_RDWR = global i32 0
@stderr = global i32 0
@.str.5 = [37 x i8] c"%s should be started by libulockmgr\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8
%6 = alloca i32
%7 = alloca i32
%8 = bitcast i8** %3 to i8*
%9 = bitcast i32* %4 to i8*
%10 = icmp eq i32 %0, 2
br i1 %10, label %11, label %82
11: ; preds = %2
%12 = getelementptr inbounds i8*, i8** %1, i64 1
%13 = load i8*, i8** %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %82, label %16
16: ; preds = %11
%17 = call i32 @strtol(i8* %13, i8** %3, i32 10)
%18 = load i8*, i8** %3
%19 = load i8, i8* %18
%20 = icmp eq i8 %19, 0
br i1 %20, label %21, label %82
21: ; preds = %16
%22 = tail call i32 (...) @fork()
switch i32 %22, label %26 [
i32 -1, label %23
i32 0, label %28
]
23: ; preds = %21
%24 = tail call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%25 = tail call i32 @exit(i32 1)
unreachable
26: ; preds = %21
%27 = tail call i32 @_exit(i32 0)
unreachable
28: ; preds = %21
%29 = tail call i32 (...) @setsid()
%30 = icmp eq i32 %29, -1
br i1 %30, label %31, label %34
31: ; preds = %28
%32 = tail call i32 @perror(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%33 = tail call i32 @exit(i32 1)
unreachable
34: ; preds = %28
%35 = tail call i32 @chdir(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%36 = call i32 @sigemptyset(i32* %4)
%37 = load i32, i32* @SIG_SETMASK
%38 = call i32 @sigprocmask(i32 %37, i32* %4, i32* null)
%39 = call i32 @dup2(i32 %17, i32 4)
%40 = icmp eq i32 %39, -1
br i1 %40, label %41, label %44
41: ; preds = %34
%42 = call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
%43 = call i32 @exit(i32 1)
unreachable
44: ; preds = %34
%45 = load i32, i32* @O_RDWR
%46 = call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %45)
%47 = call i32 @dup2(i32 %46, i32 0)
%48 = call i32 @dup2(i32 %46, i32 1)
%49 = call i32 @close(i32 3)
%50 = call i32 @closefrom(i32 5)
%51 = bitcast i32* %6 to i8*
%52 = bitcast i32* %7 to i8*
br label %53
53: ; preds = %79, %44
store i32 1, i32* %7
%54 = call i32 @receive_message(i32 4, i8* %5, i32 1, i32* %6, i32* %7)
switch i32 %54, label %58 [
i32 0, label %55
i32 -1, label %56
]
55: ; preds = %53
br label %86
56: ; preds = %53
%57 = call i32 @exit(i32 1)
unreachable
58: ; preds = %53
%59 = load i32, i32* %7
%60 = icmp eq i32 %59, 1
%61 = zext i1 %60 to i32
%62 = call i32 @assert(i32 %61)
%63 = call i32 (...) @fork()
switch i32 %63, label %77 [
i32 -1, label %64
i32 0, label %66
]
64: ; preds = %58
%65 = call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %79
66: ; preds = %58
%67 = call i32 @close(i32 4)
%68 = call i32 (...) @fork()
switch i32 %68, label %75 [
i32 -1, label %69
i32 0, label %72
]
69: ; preds = %66
%70 = call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%71 = call i32 @_exit(i32 1)
unreachable
72: ; preds = %66
%73 = load i32, i32* %6
%74 = call i32 @process_owner(i32 %73)
br label %75
75: ; preds = %66, %72
%76 = call i32 @_exit(i32 0)
unreachable
77: ; preds = %58
%78 = call i32 @waitpid(i32 %63, i32* null, i32 0)
br label %79
79: ; preds = %77, %64
%80 = load i32, i32* %6
%81 = call i32 @close(i32 %80)
br label %53
82: ; preds = %16, %2, %11
%83 = load i32, i32* @stderr
%84 = load i8*, i8** %1
%85 = tail call i32 @fprintf(i32 %83, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0), i8* %84)
br label %86
86: ; preds = %55, %82
%87 = phi i32 [ 1, %82 ], [ 0, %55 ]
ret i32 %87
}