#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 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 wait(int *);
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 = wait(&state);
    if (cid == -1)
      break;
    if (WIFEXITED(state)) {
      printf("%d 正常结束,返回值%d\n", cid, WEXITSTATUS(state));
    } else if (WIFSIGNALED(state)) {
      printf("%d被信号%d终止\n", cid, WTERMSIG(state));
    }
    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   10c0 <sleep@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11fe <main+0x3e>
movl   $0x5,-0x4(%rbp)
jmp    1376 <main+0x1b6>
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   10c0 <sleep@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    126e <main+0xae>
mov    $0x8,%edi
call   10b0 <exit@plt>
movl   $0x0,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
call   10d0 <wait@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    12cf <main+0x10f>
jmp    136a <main+0x1aa>
mov    -0x10(%rbp),%edi
call   10a0 <WIFEXITED@plt>
cmp    $0x0,%rax
je     1307 <main+0x147>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%edi
call   1090 <WEXITSTATUS@plt>
mov    -0x14(%rbp),%esi
mov    %eax,%edx
lea    0xd2a(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    133f <main+0x17f>
mov    -0x10(%rbp),%edi
call   1070 <WIFSIGNALED@plt>
cmp    $0x0,%rax
je     133a <main+0x17a>
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%edi
call   1080 <WTERMSIG@plt>
mov    -0x18(%rbp),%esi
mov    %eax,%edx
lea    0xd0f(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    133f <main+0x17f>
mov    $0x1,%edx
lea    0xd0c(%rip),%rsi
mov    %edx,%edi
call   1040 <write@plt>
mov    $0x1,%edi
call   10c0 <sleep@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    12b4 <main+0xf4>
lea    0xce8(%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   %r12
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   10e0 <fork@plt>
test   %rax,%rax
je     129b <main+0xdb>
xor    %eax,%eax
call   10e0 <fork@plt>
test   %rax,%rax
je     14fb <main+0x33b>
lea    0xc(%rsp),%rdi
call   10d0 <wait@plt>
cmp    $0xffffffff,%eax
je     1288 <main+0xc8>
mov    %eax,%ebp
lea    0xe3a(%rip),%r14
lea    0xe48(%rip),%r15
lea    0xc(%rsp),%rbx
lea    0xe0a(%rip),%r12
jmp    125e <main+0x9e>
nopl   (%rax)
call   1090 <WEXITSTATUS@plt>
mov    %r12,%rdi
mov    %ebp,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x1,%edi
mov    %r15,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10c0 <sleep@plt>
mov    %rbx,%rdi
call   10d0 <wait@plt>
mov    %eax,%ebp
cmp    $0xffffffff,%eax
je     1288 <main+0xc8>
mov    0xc(%rsp),%edi
call   10a0 <WIFEXITED@plt>
mov    0xc(%rsp),%edi
test   %rax,%rax
jne    1220 <main+0x60>
call   1070 <WIFSIGNALED@plt>
test   %rax,%rax
je     1233 <main+0x73>
mov    0xc(%rsp),%edi
call   1080 <WTERMSIG@plt>
mov    %r14,%rdi
jmp    1228 <main+0x68>
lea    0xdca(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
jmp    14ee <main+0x32e>
xor    %eax,%eax
call   1050 <getpid@plt>
lea    0xd57(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xd57(%rip),%rbx
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10c0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10c0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10c0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10c0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10c0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10c0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10c0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10c0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10c0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10c0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10c0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10c0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10c0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10c0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10c0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10c0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10c0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10c0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10c0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10c0 <sleep@plt>
mov    $0x5,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %eax,%eax
call   1050 <getpid@plt>
lea    0xb09(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xb0a(%rip),%rbx
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10c0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10c0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10c0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10c0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10c0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10c0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10c0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10c0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10c0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10c0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10c0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10c0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10c0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10c0 <sleep@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10c0 <sleep@plt>
mov    $0x8,%edi
call   10b0 <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"
@.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 %70
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 = %65, %37
%39 = call i32 @wait(i32* %4)
store i32 %39, i32* %3
%40 = load i32, i32* %3
%41 = icmp eq i32 %40, -1
br i1 %41, label %42, label %43
42: ; preds = %38
br label %68
43: ; preds = %38
%44 = load i32, i32* %4
%45 = call i64 @WIFEXITED(i32 %44)
%46 = icmp ne i64 %45, 0
br i1 %46, label %47, label %52
47: ; preds = %43
%48 = load i32, i32* %3
%49 = load i32, i32* %4
%50 = call i32 @WEXITSTATUS(i32 %49)
%51 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i32 %48, i32 %50)
br label %62
52: ; preds = %43
%53 = load i32, i32* %4
%54 = call i64 @WIFSIGNALED(i32 %53)
%55 = icmp ne i64 %54, 0
br i1 %55, label %56, label %61
56: ; preds = %52
%57 = load i32, i32* %3
%58 = load i32, i32* %4
%59 = call i32 @WTERMSIG(i32 %58)
%60 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i32 %57, i32 %59)
br label %61
61: ; preds = %56, %52
br label %62
62: ; preds = %61, %47
%63 = call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i32 1)
%64 = call i32 @sleep(i32 1)
br label %65
65: ; preds = %62
%66 = load i32, i32* %2
%67 = add nsw i32 %66, 1
store i32 %67, i32* %2
br label %38
68: ; preds = %42
%69 = call i32 @puts(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0))
br label %70
70: ; preds = %68, %19
%71 = load i32, i32* %1
ret i32 %71
}

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"
@.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 %111
47: ; preds = %0
%48 = tail call i64 (...) @fork()
%49 = icmp eq i64 %48, 0
br i1 %49, label %54, label %50
50: ; preds = %47
%51 = bitcast i32* %1 to i8*
%52 = call i32 @wait(i32* %1)
%53 = icmp eq i32 %52, -1
br i1 %53, label %109, label %88
54: ; preds = %47
%55 = tail call i32 (...) @getpid()
%56 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %55)
%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 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 1)
%86 = tail call i32 @sleep(i32 1)
%87 = tail call i32 @exit(i32 8)
unreachable
88: ; preds = %50, %104
%89 = phi i32 [ %107, %104 ], [ %52, %50 ]
%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 = %88
%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 %89, i32 %95)
br label %104
97: ; preds = %88
%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 %89, i32 %102)
br label %104
104: ; preds = %94, %100, %97
%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)
%107 = call i32 @wait(i32* %1)
%108 = icmp eq i32 %107, -1
br i1 %108, label %109, label %88
109: ; preds = %104, %50
%110 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0))
br label %111
111: ; preds = %4, %109
%112 = phi i32 [ 0, %109 ], [ 5, %4 ]
ret i32 %112
}