#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(int /*<<< orphan*/);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ errno;
int fork();
int getpid();
int getppid();
int /*<<< orphan*/ pipe(int *);
int /*<<< orphan*/ read(int, char *, int);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
int /*<<< orphan*/ test_daemon();
int /*<<< orphan*/ test_init(int, char **);
int /*<<< orphan*/ test_msg(char *, ...);
int /*<<< orphan*/ test_waitsig();
int /*<<< orphan*/ write(int, char *, int);
int main(int argc, char **argv) {
  char x;
  int pid, ppid;
  int sp[2], fp[2], rp[2];
  test_init(argc, argv);
  pipe(sp);
  pipe(fp);
  pipe(rp);
  pid = fork();
  if (pid == 0) {
    close(sp[0]);
    close(fp[1]);
    close(rp[0]);
    pid = getpid();
    ppid = getppid();
    close(sp[1]);
    read(fp[0], &x, 1);
    close(fp[0]);
    if (pid != getpid())
      x = 'p';
    else if (ppid != getppid())
      x = 'P';
    else
      x = '0';
    write(rp[1], &x, 1);
    close(rp[1]);
    _exit(0);
  }
  x = 'X';
  close(sp[1]);
  close(fp[0]);
  close(rp[1]);
  read(sp[1], &x, 1);
  test_daemon();
  test_waitsig();
  close(fp[1]);
  read(rp[0], &x, 1);
  close(rp[0]);
  if (x == 'X')
    test_msg("FAIL: %s:%d: "
             "Sync failed"
             " (errno = %d (%s))\n",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/LK4D4/criu/refs/heads/master/test/zdtm/"
             "live/static/pstree.c",
             63, errno, strerror(errno));
  else if (x == 'p')
    test_msg("FAIL: %s:%d: "
             "Pid failed"
             " (errno = %d (%s))\n",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/LK4D4/criu/refs/heads/master/test/zdtm/"
             "live/static/pstree.c",
             65, errno, strerror(errno));
  else if (x == 'P')
    test_msg("FAIL: %s:%d: "
             "PPid failed"
             " (errno = %d (%s))\n",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/LK4D4/criu/refs/heads/master/test/zdtm/"
             "live/static/pstree.c",
             67, errno, strerror(errno));
  else if (x != '0')
    test_msg("FAIL: %s:%d: "
             "Shit happened"
             " (errno = %d (%s))\n",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/LK4D4/criu/refs/heads/master/test/zdtm/"
             "live/static/pstree.c",
             69, errno, strerror(errno));
  else
    test_msg("PASS\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <test_init@plt>
lea    -0x24(%rbp),%rdi
call   1090 <pipe@plt>
lea    -0x2c(%rbp),%rdi
call   1090 <pipe@plt>
lea    -0x34(%rbp),%rdi
call   1090 <pipe@plt>
mov    $0x0,%al
call   10f0 <fork@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jne    12dd <main+0x10d>
mov    -0x24(%rbp),%edi
call   1080 <close@plt>
mov    -0x28(%rbp),%edi
call   1080 <close@plt>
mov    -0x34(%rbp),%edi
call   1080 <close@plt>
mov    $0x0,%al
call   1060 <getpid@plt>
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   10d0 <getppid@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x20(%rbp),%edi
call   1080 <close@plt>
mov    -0x2c(%rbp),%edi
lea    -0x11(%rbp),%rsi
mov    $0x1,%edx
call   10b0 <read@plt>
mov    -0x2c(%rbp),%edi
call   1080 <close@plt>
mov    -0x18(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    $0x0,%al
call   1060 <getpid@plt>
mov    %eax,%ecx
mov    -0x38(%rbp),%eax
cmp    %ecx,%eax
je     1291 <main+0xc1>
movb   $0x70,-0x11(%rbp)
jmp    12bd <main+0xed>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    $0x0,%al
call   10d0 <getppid@plt>
mov    %eax,%ecx
mov    -0x3c(%rbp),%eax
cmp    %ecx,%eax
je     12b4 <main+0xe4>
movb   $0x50,-0x11(%rbp)
jmp    12b8 <main+0xe8>
movb   $0x30,-0x11(%rbp)
jmp    12bd <main+0xed>
mov    -0x30(%rbp),%edi
lea    -0x11(%rbp),%rsi
mov    $0x1,%edx
call   1050 <write@plt>
mov    -0x30(%rbp),%edi
call   1080 <close@plt>
xor    %edi,%edi
call   1030 <_exit@plt>
movb   $0x58,-0x11(%rbp)
mov    -0x20(%rbp),%edi
call   1080 <close@plt>
mov    -0x2c(%rbp),%edi
call   1080 <close@plt>
mov    -0x30(%rbp),%edi
call   1080 <close@plt>
mov    -0x20(%rbp),%edi
lea    -0x11(%rbp),%rsi
mov    $0x1,%edx
call   10b0 <read@plt>
mov    $0x0,%al
call   1070 <test_daemon@plt>
mov    $0x0,%al
call   10c0 <test_waitsig@plt>
mov    -0x28(%rbp),%edi
call   1080 <close@plt>
mov    -0x34(%rbp),%edi
lea    -0x11(%rbp),%rsi
mov    $0x1,%edx
call   10b0 <read@plt>
mov    -0x34(%rbp),%edi
call   1080 <close@plt>
movsbl -0x11(%rbp),%eax
cmp    $0x58,%eax
jne    1385 <main+0x1b5>
mov    0x2c93(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x40(%rbp)
mov    0x2c87(%rip),%rax
mov    (%rax),%edi
call   10e0 <strerror@plt>
mov    -0x40(%rbp),%ecx
mov    %eax,%r8d
lea    0xc93(%rip),%rdi
lea    0xcb8(%rip),%rsi
mov    $0x3f,%edx
mov    $0x0,%al
call   10a0 <test_msg@plt>
jmp    1486 <main+0x2b6>
movsbl -0x11(%rbp),%eax
cmp    $0x70,%eax
jne    13d1 <main+0x201>
mov    0x2c47(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x44(%rbp)
mov    0x2c3b(%rip),%rax
mov    (%rax),%edi
call   10e0 <strerror@plt>
mov    -0x44(%rbp),%ecx
mov    %eax,%r8d
lea    0xd09(%rip),%rdi
lea    0xc6c(%rip),%rsi
mov    $0x41,%edx
mov    $0x0,%al
call   10a0 <test_msg@plt>
jmp    1481 <main+0x2b1>
movsbl -0x11(%rbp),%eax
cmp    $0x50,%eax
jne    141d <main+0x24d>
mov    0x2bfb(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x48(%rbp)
mov    0x2bef(%rip),%rax
mov    (%rax),%edi
call   10e0 <strerror@plt>
mov    -0x48(%rbp),%ecx
mov    %eax,%r8d
lea    0xce8(%rip),%rdi
lea    0xc20(%rip),%rsi
mov    $0x43,%edx
mov    $0x0,%al
call   10a0 <test_msg@plt>
jmp    147c <main+0x2ac>
movsbl -0x11(%rbp),%eax
cmp    $0x30,%eax
je     1469 <main+0x299>
mov    0x2baf(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4c(%rbp)
mov    0x2ba3(%rip),%rax
mov    (%rax),%edi
call   10e0 <strerror@plt>
mov    -0x4c(%rbp),%ecx
mov    %eax,%r8d
lea    0xcc8(%rip),%rdi
lea    0xbd4(%rip),%rsi
mov    $0x45,%edx
mov    $0x0,%al
call   10a0 <test_msg@plt>
jmp    1477 <main+0x2a7>
lea    0xcd7(%rip),%rdi
mov    $0x0,%al
call   10a0 <test_msg@plt>
jmp    147c <main+0x2ac>
jmp    1481 <main+0x2b1>
jmp    1486 <main+0x2b6>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x28,%rsp
call   1040 <test_init@plt>
lea    0x20(%rsp),%rdi
call   1090 <pipe@plt>
lea    0x18(%rsp),%rdi
call   1090 <pipe@plt>
lea    0x10(%rsp),%rdi
call   1090 <pipe@plt>
xor    %eax,%eax
call   10f0 <fork@plt>
test   %eax,%eax
je     1349 <main+0x179>
movb   $0x58,0xf(%rsp)
mov    0x24(%rsp),%edi
call   1080 <close@plt>
mov    0x18(%rsp),%edi
call   1080 <close@plt>
mov    0x14(%rsp),%edi
call   1080 <close@plt>
mov    0x24(%rsp),%edi
lea    0xf(%rsp),%rbx
mov    %rbx,%rsi
mov    $0x1,%edx
call   10b0 <read@plt>
xor    %eax,%eax
call   1070 <test_daemon@plt>
xor    %eax,%eax
call   10c0 <test_waitsig@plt>
mov    0x1c(%rsp),%edi
call   1080 <close@plt>
mov    0x10(%rsp),%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   10b0 <read@plt>
mov    0x10(%rsp),%edi
call   1080 <close@plt>
mov    0xf(%rsp),%al
add    $0xd0,%al
rol    $0x5,%al
cmp    $0x8,%al
ja     12ec <main+0x11c>
movzbl %al,%eax
lea    0xd7a(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   10a0 <test_msg@plt>
jmp    1340 <main+0x170>
mov    0x2d37(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   10e0 <strerror@plt>
lea    0xe58(%rip),%rdi
lea    0xd90(%rip),%rsi
mov    $0x43,%edx
jmp    1334 <main+0x164>
mov    0x2d12(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   10e0 <strerror@plt>
lea    0xd46(%rip),%rdi
lea    0xd6b(%rip),%rsi
mov    $0x3f,%edx
jmp    1334 <main+0x164>
mov    0x2ced(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   10e0 <strerror@plt>
lea    0xe3a(%rip),%rdi
lea    0xd46(%rip),%rsi
mov    $0x45,%edx
jmp    1334 <main+0x164>
mov    0x2cc8(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   10e0 <strerror@plt>
lea    0xdbe(%rip),%rdi
lea    0xd21(%rip),%rsi
mov    $0x41,%edx
mov    %ebx,%ecx
mov    %eax,%r8d
xor    %eax,%eax
call   10a0 <test_msg@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %rbp
ret
mov    0x20(%rsp),%edi
call   1080 <close@plt>
mov    0x1c(%rsp),%edi
call   1080 <close@plt>
mov    0x10(%rsp),%edi
call   1080 <close@plt>
xor    %eax,%eax
call   1060 <getpid@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   10d0 <getppid@plt>
mov    %eax,%ebx
mov    0x24(%rsp),%edi
call   1080 <close@plt>
mov    0x18(%rsp),%edi
lea    0xf(%rsp),%rsi
mov    $0x1,%edx
call   10b0 <read@plt>
mov    0x18(%rsp),%edi
call   1080 <close@plt>
xor    %eax,%eax
call   1060 <getpid@plt>
cmp    %eax,%ebp
jne    13b8 <main+0x1e8>
xor    %eax,%eax
call   10d0 <getppid@plt>
cmp    %eax,%ebx
jne    13bf <main+0x1ef>
movb   $0x30,0xf(%rsp)
jmp    13c4 <main+0x1f4>
movb   $0x70,0xf(%rsp)
jmp    13c4 <main+0x1f4>
movb   $0x50,0xf(%rsp)
mov    0x14(%rsp),%edi
lea    0xf(%rsp),%rsi
mov    $0x1,%edx
call   1050 <write@plt>
mov    0x14(%rsp),%edi
call   1080 <close@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"FAIL: %s:%d: Sync failed (errno = %d (%s))\0A\00"
@.str.1 = [150 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/LK4D4/criu/refs/heads/master/test/zdtm/live/static/pstree.c\00"
@errno = global i32 0
@.str.2 = [43 x i8] c"FAIL: %s:%d: Pid failed (errno = %d (%s))\0A\00"
@.str.3 = [44 x i8] c"FAIL: %s:%d: PPid failed (errno = %d (%s))\0A\00"
@.str.4 = [46 x i8] c"FAIL: %s:%d: Shit happened (errno = %d (%s))\0A\00"
@.str.5 = [6 x i8] c"PASS\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
%7 = alloca i32
%8 = alloca i32
%9 = alloca [2 x i32]
%10 = alloca [2 x i32]
%11 = alloca [2 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = load i32, i32* %4
%13 = load i8**, i8*** %5
%14 = call i32 @test_init(i32 %12, i8** %13)
%15 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%16 = call i32 @pipe(i32* %15)
%17 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 0
%18 = call i32 @pipe(i32* %17)
%19 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0, i64 0
%20 = call i32 @pipe(i32* %19)
%21 = call i32 (...) @fork()
store i32 %21, i32* %7
%22 = load i32, i32* %7
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %64
24: ; preds = %2
%25 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%26 = load i32, i32* %25
%27 = call i32 @close(i32 %26)
%28 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 1
%29 = load i32, i32* %28
%30 = call i32 @close(i32 %29)
%31 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0, i64 0
%32 = load i32, i32* %31
%33 = call i32 @close(i32 %32)
%34 = call i32 (...) @getpid()
store i32 %34, i32* %7
%35 = call i32 (...) @getppid()
store i32 %35, i32* %8
%36 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 1
%37 = load i32, i32* %36
%38 = call i32 @close(i32 %37)
%39 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 0
%40 = load i32, i32* %39
%41 = call i32 @read(i32 %40, i8* %6, i32 1)
%42 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 0
%43 = load i32, i32* %42
%44 = call i32 @close(i32 %43)
%45 = load i32, i32* %7
%46 = call i32 (...) @getpid()
%47 = icmp ne i32 %45, %46
br i1 %47, label %48, label %49
48: ; preds = %24
store i8 112, i8* %6
br label %56
49: ; preds = %24
%50 = load i32, i32* %8
%51 = call i32 (...) @getppid()
%52 = icmp ne i32 %50, %51
br i1 %52, label %53, label %54
53: ; preds = %49
store i8 80, i8* %6
br label %55
54: ; preds = %49
store i8 48, i8* %6
br label %55
55: ; preds = %54, %53
br label %56
56: ; preds = %55, %48
%57 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0, i64 1
%58 = load i32, i32* %57
%59 = call i32 @write(i32 %58, i8* %6, i32 1)
%60 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0, i64 1
%61 = load i32, i32* %60
%62 = call i32 @close(i32 %61)
%63 = call i32 @_exit(i32 0)
unreachable
64: ; preds = %2
store i8 88, i8* %6
%65 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 1
%66 = load i32, i32* %65
%67 = call i32 @close(i32 %66)
%68 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 0
%69 = load i32, i32* %68
%70 = call i32 @close(i32 %69)
%71 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0, i64 1
%72 = load i32, i32* %71
%73 = call i32 @close(i32 %72)
%74 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 1
%75 = load i32, i32* %74
%76 = call i32 @read(i32 %75, i8* %6, i32 1)
%77 = call i32 (...) @test_daemon()
%78 = call i32 (...) @test_waitsig()
%79 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 1
%80 = load i32, i32* %79
%81 = call i32 @close(i32 %80)
%82 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0, i64 0
%83 = load i32, i32* %82
%84 = call i32 @read(i32 %83, i8* %6, i32 1)
%85 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0, i64 0
%86 = load i32, i32* %85
%87 = call i32 @close(i32 %86)
%88 = load i8, i8* %6
%89 = sext i8 %88 to i32
%90 = icmp eq i32 %89, 88
br i1 %90, label %91, label %96
91: ; preds = %64
%92 = load i32, i32* @errno
%93 = load i32, i32* @errno
%94 = call i32 @strerror(i32 %93)
%95 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str.1, i64 0, i64 0), i32 63, i32 %92, i32 %94)
br label %128
96: ; preds = %64
%97 = load i8, i8* %6
%98 = sext i8 %97 to i32
%99 = icmp eq i32 %98, 112
br i1 %99, label %100, label %105
100: ; preds = %96
%101 = load i32, i32* @errno
%102 = load i32, i32* @errno
%103 = call i32 @strerror(i32 %102)
%104 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str.1, i64 0, i64 0), i32 65, i32 %101, i32 %103)
br label %127
105: ; preds = %96
%106 = load i8, i8* %6
%107 = sext i8 %106 to i32
%108 = icmp eq i32 %107, 80
br i1 %108, label %109, label %114
109: ; preds = %105
%110 = load i32, i32* @errno
%111 = load i32, i32* @errno
%112 = call i32 @strerror(i32 %111)
%113 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str.1, i64 0, i64 0), i32 67, i32 %110, i32 %112)
br label %126
114: ; preds = %105
%115 = load i8, i8* %6
%116 = sext i8 %115 to i32
%117 = icmp ne i32 %116, 48
br i1 %117, label %118, label %123
118: ; preds = %114
%119 = load i32, i32* @errno
%120 = load i32, i32* @errno
%121 = call i32 @strerror(i32 %120)
%122 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str.1, i64 0, i64 0), i32 69, i32 %119, i32 %121)
br label %125
123: ; preds = %114
%124 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
br label %125
125: ; preds = %123, %118
br label %126
126: ; preds = %125, %109
br label %127
127: ; preds = %126, %100
br label %128
128: ; preds = %127, %91
ret i32 0
}

LLVM IR (-O2):
@.str = [44 x i8] c"FAIL: %s:%d: Sync failed (errno = %d (%s))\0A\00"
@.str.1 = [150 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/LK4D4/criu/refs/heads/master/test/zdtm/live/static/pstree.c\00"
@errno = global i32 0
@.str.2 = [43 x i8] c"FAIL: %s:%d: Pid failed (errno = %d (%s))\0A\00"
@.str.3 = [44 x i8] c"FAIL: %s:%d: PPid failed (errno = %d (%s))\0A\00"
@.str.4 = [46 x i8] c"FAIL: %s:%d: Shit happened (errno = %d (%s))\0A\00"
@.str.5 = [6 x i8] c"PASS\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i8
%4 = alloca [2 x i32]
%5 = alloca [2 x i32]
%6 = alloca [2 x i32]
%7 = bitcast [2 x i32]* %4 to i8*
%8 = bitcast [2 x i32]* %5 to i8*
%9 = bitcast [2 x i32]* %6 to i8*
%10 = tail call i32 @test_init(i32 %0, i8** %1)
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%12 = call i32 @pipe(i32* %11)
%13 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%14 = call i32 @pipe(i32* %13)
%15 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%16 = call i32 @pipe(i32* %15)
%17 = call i32 (...) @fork()
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %51
19: ; preds = %2
%20 = load i32, i32* %11
%21 = call i32 @close(i32 %20)
%22 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 1
%23 = load i32, i32* %22
%24 = call i32 @close(i32 %23)
%25 = load i32, i32* %15
%26 = call i32 @close(i32 %25)
%27 = call i32 (...) @getpid()
%28 = call i32 (...) @getppid()
%29 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
%30 = load i32, i32* %29
%31 = call i32 @close(i32 %30)
%32 = load i32, i32* %13
%33 = call i32 @read(i32 %32, i8* %3, i32 1)
%34 = load i32, i32* %13
%35 = call i32 @close(i32 %34)
%36 = call i32 (...) @getpid()
%37 = icmp eq i32 %27, %36
br i1 %37, label %39, label %38
38: ; preds = %19
store i8 112, i8* %3
br label %44
39: ; preds = %19
%40 = call i32 (...) @getppid()
%41 = icmp eq i32 %28, %40
br i1 %41, label %43, label %42
42: ; preds = %39
store i8 80, i8* %3
br label %44
43: ; preds = %39
store i8 48, i8* %3
br label %44
44: ; preds = %42, %43, %38
%45 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
%46 = load i32, i32* %45
%47 = call i32 @write(i32 %46, i8* %3, i32 1)
%48 = load i32, i32* %45
%49 = call i32 @close(i32 %48)
%50 = call i32 @_exit(i32 0)
unreachable
51: ; preds = %2
store i8 88, i8* %3
%52 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
%53 = load i32, i32* %52
%54 = call i32 @close(i32 %53)
%55 = load i32, i32* %13
%56 = call i32 @close(i32 %55)
%57 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
%58 = load i32, i32* %57
%59 = call i32 @close(i32 %58)
%60 = load i32, i32* %52
%61 = call i32 @read(i32 %60, i8* %3, i32 1)
%62 = call i32 (...) @test_daemon()
%63 = call i32 (...) @test_waitsig()
%64 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 1
%65 = load i32, i32* %64
%66 = call i32 @close(i32 %65)
%67 = load i32, i32* %15
%68 = call i32 @read(i32 %67, i8* %3, i32 1)
%69 = load i32, i32* %15
%70 = call i32 @close(i32 %69)
%71 = load i8, i8* %3
%72 = add i8 %71, -48
%73 = call i8 @llvm.fshl.i8(i8 %72, i8 %72, i8 5)
switch i8 %73, label %86 [
i8 5, label %74
i8 8, label %78
i8 4, label %82
i8 0, label %90
]
74: ; preds = %51
%75 = load i32, i32* @errno
%76 = call i32 @strerror(i32 %75)
%77 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str.1, i64 0, i64 0), i32 63, i32 %75, i32 %76)
br label %92
78: ; preds = %51
%79 = load i32, i32* @errno
%80 = call i32 @strerror(i32 %79)
%81 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str.1, i64 0, i64 0), i32 65, i32 %79, i32 %80)
br label %92
82: ; preds = %51
%83 = load i32, i32* @errno
%84 = call i32 @strerror(i32 %83)
%85 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str.1, i64 0, i64 0), i32 67, i32 %83, i32 %84)
br label %92
86: ; preds = %51
%87 = load i32, i32* @errno
%88 = call i32 @strerror(i32 %87)
%89 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str.1, i64 0, i64 0), i32 69, i32 %87, i32 %88)
br label %92
90: ; preds = %51
%91 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
br label %92
92: ; preds = %78, %86, %90, %82, %74
ret i32 0
}