#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 pid_t;

/* Variables and functions */
int WEXITSTATUS(int);
scalar_t__ WIFEXITED(int);
scalar_t__ WIFSIGNALED(int);
int /*<<< orphan*/ WNOHANG;
int WTERMSIG(int);
int /*<<< orphan*/ exit(int);
scalar_t__ fork();
int getpid();
int /*<<< orphan*/ printf(char *, int, ...);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ sleep(int);
int waitpid(int, int *, int /*<<< orphan*/);
int /*<<< orphan*/ write(int, char *, int);
int main() {
  int i;
  if (fork() == 0) {
    printf("first child:%d\n", getpid());
    for (i = 0; i < 20; i++) {
      write(1, ".", 1);
      sleep(1);
    }
    return 5;
  }
  if (fork() == 0) {
    printf("second child:%d\n", getpid());
    for (i = 0; i < 15; i++) {
      write(1, "*", 1);
      sleep(1);
    }
    exit(8);
  }
  for (i = 0;; i++) {
    pid_t cid;
    int state;
    cid = waitpid(-1, &state, WNOHANG);
    if (cid == -1)
      break;
    if (cid != 0) {
      if (WIFEXITED(state)) {
        printf("%d正常结束,返回值:%d\n", cid, WEXITSTATUS(state));
      } else if (WIFSIGNALED(state)) {
        printf("%d被信号%d终止\n", cid, WTERMSIG(state));
      }
    } else {
    }
    write(1, "#", 1);
    sleep(1);
  }
  puts("子进程全部终止");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   10e0 <fork@plt>
cmp    $0x0,%rax
jne    123f <main+0x7f>
mov    $0x0,%al
call   1050 <getpid@plt>
mov    %eax,%esi
lea    0xe10(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x14,-0x8(%rbp)
jge    1233 <main+0x73>
mov    $0x1,%edx
lea    0xdfc(%rip),%rsi
mov    %edx,%edi
call   1040 <write@plt>
mov    $0x1,%edi
call   10d0 <sleep@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11fe <main+0x3e>
movl   $0x5,-0x4(%rbp)
jmp    1398 <main+0x1d8>
mov    $0x0,%al
call   10e0 <fork@plt>
cmp    $0x0,%rax
jne    12ad <main+0xed>
mov    $0x0,%al
call   1050 <getpid@plt>
mov    %eax,%esi
lea    0xdb2(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0xf,-0x8(%rbp)
jge    12a3 <main+0xe3>
mov    $0x1,%edx
lea    0xd9f(%rip),%rsi
mov    %edx,%edi
call   1040 <write@plt>
mov    $0x1,%edi
call   10d0 <sleep@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    126e <main+0xae>
mov    $0x8,%edi
call   10c0 <exit@plt>
movl   $0x0,-0x8(%rbp)
mov    0x2d2d(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
lea    -0x10(%rbp),%rsi
call   10a0 <waitpid@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    12dd <main+0x11d>
jmp    138c <main+0x1cc>
cmpl   $0x0,-0xc(%rbp)
je     135c <main+0x19c>
mov    -0x10(%rbp),%edi
call   10b0 <WIFEXITED@plt>
cmp    $0x0,%rax
je     131f <main+0x15f>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%edi
call   1090 <WEXITSTATUS@plt>
mov    -0x14(%rbp),%esi
mov    %eax,%edx
lea    0xd12(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1357 <main+0x197>
mov    -0x10(%rbp),%edi
call   1070 <WIFSIGNALED@plt>
cmp    $0x0,%rax
je     1352 <main+0x192>
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%edi
call   1080 <WTERMSIG@plt>
mov    -0x18(%rbp),%esi
mov    %eax,%edx
lea    0xcf7(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1357 <main+0x197>
jmp    1361 <main+0x1a1>
jmp    1361 <main+0x1a1>
mov    $0x1,%edx
lea    0xcea(%rip),%rsi
mov    %edx,%edi
call   1040 <write@plt>
mov    $0x1,%edi
call   10d0 <sleep@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    12b4 <main+0xf4>
lea    0xcc6(%rip),%rdi
call   1030 <puts@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
xor    %eax,%eax
call   10e0 <fork@plt>
test   %rax,%rax
je     1298 <main+0xd8>
xor    %eax,%eax
call   10e0 <fork@plt>
test   %rax,%rax
je     14fa <main+0x33a>
mov    0x2df6(%rip),%r13
lea    0x4(%rsp),%rbx
lea    0xe59(%rip),%r14
lea    0xe3d(%rip),%r15
lea    0xe19(%rip),%r12
jmp    123f <main+0x7f>
xchg   %ax,%ax
call   1090 <WEXITSTATUS@plt>
mov    %r12,%rdi
mov    %ebp,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x1,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10d0 <sleep@plt>
mov    0x0(%r13),%edx
mov    $0xffffffff,%edi
mov    %rbx,%rsi
call   10a0 <waitpid@plt>
test   %eax,%eax
je     1223 <main+0x63>
mov    %eax,%ebp
cmp    $0xffffffff,%eax
je     1285 <main+0xc5>
mov    0x4(%rsp),%edi
call   10b0 <WIFEXITED@plt>
mov    0x4(%rsp),%edi
test   %rax,%rax
jne    1210 <main+0x50>
call   1070 <WIFSIGNALED@plt>
test   %rax,%rax
je     1223 <main+0x63>
mov    0x4(%rsp),%edi
call   1080 <WTERMSIG@plt>
mov    %r15,%rdi
jmp    1218 <main+0x58>
lea    0xdcd(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
jmp    14eb <main+0x32b>
xor    %eax,%eax
call   1050 <getpid@plt>
lea    0xd5a(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xd5a(%rip),%rbx
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10d0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10d0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10d0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10d0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10d0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10d0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10d0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10d0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10d0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10d0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10d0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10d0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10d0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10d0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10d0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10d0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10d0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10d0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10d0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10d0 <sleep@plt>
mov    $0x5,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %eax,%eax
call   1050 <getpid@plt>
lea    0xb0a(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xb0b(%rip),%rbx
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10d0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10d0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10d0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10d0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10d0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10d0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10d0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10d0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10d0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10d0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10d0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10d0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10d0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10d0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10d0 <sleep@plt>
mov    $0x8,%edi
call   10c0 <exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"first child:%d\0A\00"
@.str.1 = [2 x i8] c".\00"
@.str.2 = [17 x i8] c"second child:%d\0A\00"
@.str.3 = [2 x i8] c"*\00"
@WNOHANG = global i32 0
@.str.4 = [29 x i8] c"%d\E6\AD\A3\E5\B8\B8\E7\BB\93\E6\9D\9F,\E8\BF\94\E5\9B\9E\E5\80\BC:%d\0A\00"
@.str.5 = [21 x i8] c"%d\E8\A2\AB\E4\BF\A1\E5\8F\B7%d\E7\BB\88\E6\AD\A2\0A\00"
@.str.6 = [2 x i8] c"#\00"
@.str.7 = [22 x i8] c"\E5\AD\90\E8\BF\9B\E7\A8\8B\E5\85\A8\E9\83\A8\E7\BB\88\E6\AD\A2\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i64 (...) @fork()
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %20
7: ; preds = %0
%8 = call i32 (...) @getpid()
%9 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %8)
store i32 0, i32* %2
br label %10
10: ; preds = %16, %7
%11 = load i32, i32* %2
%12 = icmp slt i32 %11, 20
br i1 %12, label %13, label %19
13: ; preds = %10
%14 = call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
%15 = call i32 @sleep(i32 1)
br label %16
16: ; preds = %13
%17 = load i32, i32* %2
%18 = add nsw i32 %17, 1
store i32 %18, i32* %2
br label %10
19: ; preds = %10
store i32 5, i32* %1
br label %76
20: ; preds = %0
%21 = call i64 (...) @fork()
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %37
23: ; preds = %20
%24 = call i32 (...) @getpid()
%25 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %24)
store i32 0, i32* %2
br label %26
26: ; preds = %32, %23
%27 = load i32, i32* %2
%28 = icmp slt i32 %27, 15
br i1 %28, label %29, label %35
29: ; preds = %26
%30 = call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 1)
%31 = call i32 @sleep(i32 1)
br label %32
32: ; preds = %29
%33 = load i32, i32* %2
%34 = add nsw i32 %33, 1
store i32 %34, i32* %2
br label %26
35: ; preds = %26
%36 = call i32 @exit(i32 8)
unreachable
37: ; preds = %20
store i32 0, i32* %2
br label %38
38: ; preds = %71, %37
%39 = load i32, i32* @WNOHANG
%40 = call i32 @waitpid(i32 -1, i32* %4, i32 %39)
store i32 %40, i32* %3
%41 = load i32, i32* %3
%42 = icmp eq i32 %41, -1
br i1 %42, label %43, label %44
43: ; preds = %38
br label %74
44: ; preds = %38
%45 = load i32, i32* %3
%46 = icmp ne i32 %45, 0
br i1 %46, label %47, label %67
47: ; preds = %44
%48 = load i32, i32* %4
%49 = call i64 @WIFEXITED(i32 %48)
%50 = icmp ne i64 %49, 0
br i1 %50, label %51, label %56
51: ; preds = %47
%52 = load i32, i32* %3
%53 = load i32, i32* %4
%54 = call i32 @WEXITSTATUS(i32 %53)
%55 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i32 %52, i32 %54)
br label %66
56: ; preds = %47
%57 = load i32, i32* %4
%58 = call i64 @WIFSIGNALED(i32 %57)
%59 = icmp ne i64 %58, 0
br i1 %59, label %60, label %65
60: ; preds = %56
%61 = load i32, i32* %3
%62 = load i32, i32* %4
%63 = call i32 @WTERMSIG(i32 %62)
%64 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i32 %61, i32 %63)
br label %65
65: ; preds = %60, %56
br label %66
66: ; preds = %65, %51
br label %68
67: ; preds = %44
br label %68
68: ; preds = %67, %66
%69 = call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i32 1)
%70 = call i32 @sleep(i32 1)
br label %71
71: ; preds = %68
%72 = load i32, i32* %2
%73 = add nsw i32 %72, 1
store i32 %73, i32* %2
br label %38
74: ; preds = %43
%75 = call i32 @puts(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0))
br label %76
76: ; preds = %74, %19
%77 = load i32, i32* %1
ret i32 %77
}

LLVM IR (-O2):
@.str = [16 x i8] c"first child:%d\0A\00"
@.str.1 = [2 x i8] c".\00"
@.str.2 = [17 x i8] c"second child:%d\0A\00"
@.str.3 = [2 x i8] c"*\00"
@WNOHANG = global i32 0
@.str.4 = [29 x i8] c"%d\E6\AD\A3\E5\B8\B8\E7\BB\93\E6\9D\9F,\E8\BF\94\E5\9B\9E\E5\80\BC:%d\0A\00"
@.str.5 = [21 x i8] c"%d\E8\A2\AB\E4\BF\A1\E5\8F\B7%d\E7\BB\88\E6\AD\A2\0A\00"
@.str.6 = [2 x i8] c"#\00"
@.str.7 = [22 x i8] c"\E5\AD\90\E8\BF\9B\E7\A8\8B\E5\85\A8\E9\83\A8\E7\BB\88\E6\AD\A2\00"
define i32 @main() {
%1 = alloca i32
%2 = tail call i64 (...) @fork()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %47
4: ; preds = %0
%5 = tail call i32 (...) @getpid()
%6 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
%8 = tail call i32 @sleep(i32 1)
%9 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
%10 = tail call i32 @sleep(i32 1)
%11 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
%12 = tail call i32 @sleep(i32 1)
%13 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
%14 = tail call i32 @sleep(i32 1)
%15 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
%16 = tail call i32 @sleep(i32 1)
%17 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
%18 = tail call i32 @sleep(i32 1)
%19 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
%20 = tail call i32 @sleep(i32 1)
%21 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
%22 = tail call i32 @sleep(i32 1)
%23 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
%24 = tail call i32 @sleep(i32 1)
%25 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
%26 = tail call i32 @sleep(i32 1)
%27 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
%28 = tail call i32 @sleep(i32 1)
%29 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
%30 = tail call i32 @sleep(i32 1)
%31 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
%32 = tail call i32 @sleep(i32 1)
%33 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
%34 = tail call i32 @sleep(i32 1)
%35 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
%36 = tail call i32 @sleep(i32 1)
%37 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
%38 = tail call i32 @sleep(i32 1)
%39 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
%40 = tail call i32 @sleep(i32 1)
%41 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
%42 = tail call i32 @sleep(i32 1)
%43 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
%44 = tail call i32 @sleep(i32 1)
%45 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
%46 = tail call i32 @sleep(i32 1)
br label %109
47: ; preds = %0
%48 = tail call i64 (...) @fork()
%49 = icmp eq i64 %48, 0
br i1 %49, label %52, label %50
50: ; preds = %47
%51 = bitcast i32* %1 to i8*
br label %86
52: ; preds = %47
%53 = tail call i32 (...) @getpid()
%54 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %53)
%55 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 1)
%56 = tail call i32 @sleep(i32 1)
%57 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 1)
%58 = tail call i32 @sleep(i32 1)
%59 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 1)
%60 = tail call i32 @sleep(i32 1)
%61 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 1)
%62 = tail call i32 @sleep(i32 1)
%63 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 1)
%64 = tail call i32 @sleep(i32 1)
%65 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 1)
%66 = tail call i32 @sleep(i32 1)
%67 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 1)
%68 = tail call i32 @sleep(i32 1)
%69 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 1)
%70 = tail call i32 @sleep(i32 1)
%71 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 1)
%72 = tail call i32 @sleep(i32 1)
%73 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 1)
%74 = tail call i32 @sleep(i32 1)
%75 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 1)
%76 = tail call i32 @sleep(i32 1)
%77 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 1)
%78 = tail call i32 @sleep(i32 1)
%79 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 1)
%80 = tail call i32 @sleep(i32 1)
%81 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 1)
%82 = tail call i32 @sleep(i32 1)
%83 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 1)
%84 = tail call i32 @sleep(i32 1)
%85 = tail call i32 @exit(i32 8)
unreachable
86: ; preds = %50, %104
%87 = load i32, i32* @WNOHANG
%88 = call i32 @waitpid(i32 -1, i32* %1, i32 %87)
switch i32 %88, label %89 [
i32 -1, label %107
i32 0, label %104
]
89: ; preds = %86
%90 = load i32, i32* %1
%91 = call i64 @WIFEXITED(i32 %90)
%92 = icmp eq i64 %91, 0
%93 = load i32, i32* %1
br i1 %92, label %97, label %94
94: ; preds = %89
%95 = call i32 @WEXITSTATUS(i32 %93)
%96 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i32 %88, i32 %95)
br label %104
97: ; preds = %89
%98 = call i64 @WIFSIGNALED(i32 %93)
%99 = icmp eq i64 %98, 0
br i1 %99, label %104, label %100
100: ; preds = %97
%101 = load i32, i32* %1
%102 = call i32 @WTERMSIG(i32 %101)
%103 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i32 %88, i32 %102)
br label %104
104: ; preds = %97, %100, %94, %86
%105 = call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i32 1)
%106 = call i32 @sleep(i32 1)
br label %86
107: ; preds = %86
%108 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0))
br label %109
109: ; preds = %4, %107
%110 = phi i32 [ 0, %107 ], [ 5, %4 ]
ret i32 %110
}