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

/* Variables and functions */
int /*<<< orphan*/ exit(int);
scalar_t__ fork();
int getpid();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sleep(int);
scalar_t__ wait(int *);
int main() {
  pid_t chpid, child1, child2;
  int ii, stat;
  printf("\nI am a process my process id is %d\n", getpid());
  printf("I am going to create two child proceses & make them run some code\n");
  child1 = fork();
  if (child1 == 0) {
    printf("I am first child, my pid is %d\n", getpid());
    printf("I first child going to execute following loop for 6 times\n");
    for (ii = 0; ii < 6; ii++) {
      printf("\nI am child 1, this is iteration %d of loop \n", ii + 1);
      printf("I am tired, sleeping for 10 seconds\n\n");
      sleep(10);
    }
    exit(2);
  }
  child2 = fork();
  if (child2 == 0) {
    printf("I am second child, my pid is %d\n", getpid());
    printf("I second child going to execute following loop for 8 times\n");
    for (ii = 0; ii < 8; ii++) {
      printf("\nI am child 2, this is iteration %d of loop \n", ii + 1);
      printf("I am tired, sleeping for 5 seconds\n\n");
      sleep(5);
    }
    exit(3);
  }
  printf("I am parent, my children are working & sleeping, i wait for them\n");
  chpid = wait(&stat);
  if (chpid == child1)
    printf("My first child terminated with status %d\n", stat);
  if (chpid == child2)
    printf("My second child terminated with status %d\n", stat);
  chpid = wait(&stat);
  if (chpid == child1)
    printf("My first child terminated with status %d\n", stat);
  if (chpid == child2)
    printf("My second child terminated with status %d\n", stat);
  printf("\nBoth children got terminated, now i will do the same\n\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1080 <fork@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1224 <main+0xc4>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x24(%rbp)
cmpl   $0x6,-0x24(%rbp)
jge    121a <main+0xba>
mov    -0x24(%rbp),%esi
add    $0x1,%esi
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xef6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xa,%edi
call   1060 <sleep@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11d6 <main+0x76>
mov    $0x2,%edi
call   1050 <exit@plt>
mov    $0x0,%al
call   1080 <fork@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    12b4 <main+0x154>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xee0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x24(%rbp)
cmpl   $0x8,-0x24(%rbp)
jge    12aa <main+0x14a>
mov    -0x24(%rbp),%esi
add    $0x1,%esi
lea    0xef7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf17(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x5,%edi
call   1060 <sleep@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1266 <main+0x106>
mov    $0x3,%edi
call   1050 <exit@plt>
lea    0xf0c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x28(%rbp),%rdi
call   1070 <wait@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    12ee <main+0x18e>
mov    -0x28(%rbp),%esi
lea    0xf22(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jne    130d <main+0x1ad>
mov    -0x28(%rbp),%esi
lea    0xf2d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x28(%rbp),%rdi
call   1070 <wait@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    1339 <main+0x1d9>
mov    -0x28(%rbp),%esi
lea    0xed7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jne    1358 <main+0x1f8>
mov    -0x28(%rbp),%esi
lea    0xee2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeff(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   1040 <getpid@plt>
lea    0xe79(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xf80(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1090 <fork@plt>
test   %rax,%rax
je     125c <main+0xec>
mov    %rax,%r15
xor    %eax,%eax
call   1090 <fork@plt>
test   %rax,%rax
je     135d <main+0x1ed>
mov    %rax,%r14
lea    0xf90(%rip),%rdi
call   1030 <puts@plt>
lea    0xc(%rsp),%rdi
call   1080 <wait@plt>
mov    %rax,%rbx
cmp    %r15,%rax
jne    11f2 <main+0x82>
mov    0xc(%rsp),%esi
lea    0xed7(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    %r14,%rbx
jne    1209 <main+0x99>
mov    0xc(%rsp),%esi
lea    0xeea(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xc(%rsp),%rdi
call   1080 <wait@plt>
mov    %rax,%rbx
cmp    %r15,%rax
jne    122d <main+0xbd>
mov    0xc(%rsp),%esi
lea    0xe9c(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    %r14,%rbx
jne    1244 <main+0xd4>
mov    0xc(%rsp),%esi
lea    0xeaf(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xf4f(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
xor    %eax,%eax
call   1040 <getpid@plt>
lea    0xdbb(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xfb6(%rip),%rdi
call   1030 <puts@plt>
lea    0xdbf(%rip),%r14
mov    %r14,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xfce(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0xa,%edi
call   1070 <sleep@plt>
mov    %r14,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0xa,%edi
call   1070 <sleep@plt>
mov    %r14,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0xa,%edi
call   1070 <sleep@plt>
mov    %r14,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0xa,%edi
call   1070 <sleep@plt>
mov    %r14,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0xa,%edi
call   1070 <sleep@plt>
mov    %r14,%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0xa,%edi
call   1070 <sleep@plt>
mov    $0x2,%edi
call   1060 <exit@plt>
xor    %eax,%eax
call   1040 <getpid@plt>
lea    0xd08(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe56(%rip),%rdi
call   1030 <puts@plt>
lea    0xd0d(%rip),%r14
mov    %r14,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe6f(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x5,%edi
call   1070 <sleep@plt>
mov    %r14,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x5,%edi
call   1070 <sleep@plt>
mov    %r14,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x5,%edi
call   1070 <sleep@plt>
mov    %r14,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x5,%edi
call   1070 <sleep@plt>
mov    %r14,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x5,%edi
call   1070 <sleep@plt>
mov    %r14,%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x5,%edi
call   1070 <sleep@plt>
mov    %r14,%rdi
mov    $0x7,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x5,%edi
call   1070 <sleep@plt>
mov    %r14,%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x5,%edi
call   1070 <sleep@plt>
mov    $0x3,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"\0AI am a process my process id is %d\0A\00"
@.str.1 = [67 x i8] c"I am going to create two child proceses & make them run some code\0A\00"
@.str.2 = [32 x i8] c"I am first child, my pid is %d\0A\00"
@.str.3 = [59 x i8] c"I first child going to execute following loop for 6 times\0A\00"
@.str.4 = [46 x i8] c"\0AI am child 1, this is iteration %d of loop \0A\00"
@.str.5 = [38 x i8] c"I am tired, sleeping for 10 seconds\0A\0A\00"
@.str.6 = [33 x i8] c"I am second child, my pid is %d\0A\00"
@.str.7 = [60 x i8] c"I second child going to execute following loop for 8 times\0A\00"
@.str.8 = [46 x i8] c"\0AI am child 2, this is iteration %d of loop \0A\00"
@.str.9 = [37 x i8] c"I am tired, sleeping for 5 seconds\0A\0A\00"
@.str.10 = [66 x i8] c"I am parent, my children are working & sleeping, i wait for them\0A\00"
@.str.11 = [42 x i8] c"My first child terminated with status %d\0A\00"
@.str.12 = [43 x i8] c"My second child terminated with status %d\0A\00"
@.str.13 = [56 x i8] c"\0ABoth children got terminated, now i will do the same\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = call i32 (...) @getpid()
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.1, i64 0, i64 0))
%10 = call i64 (...) @fork()
store i64 %10, i64* %3
%11 = load i64, i64* %3
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %31
13: ; preds = %0
%14 = call i32 (...) @getpid()
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i32 %14)
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %5
br label %17
17: ; preds = %26, %13
%18 = load i32, i32* %5
%19 = icmp slt i32 %18, 6
br i1 %19, label %20, label %29
20: ; preds = %17
%21 = load i32, i32* %5
%22 = add nsw i32 %21, 1
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.4, i64 0, i64 0), i32 %22)
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.5, i64 0, i64 0))
%25 = call i32 @sleep(i32 10)
br label %26
26: ; preds = %20
%27 = load i32, i32* %5
%28 = add nsw i32 %27, 1
store i32 %28, i32* %5
br label %17
29: ; preds = %17
%30 = call i32 @exit(i32 2)
unreachable
31: ; preds = %0
%32 = call i64 (...) @fork()
store i64 %32, i64* %4
%33 = load i64, i64* %4
%34 = icmp eq i64 %33, 0
br i1 %34, label %35, label %53
35: ; preds = %31
%36 = call i32 (...) @getpid()
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.6, i64 0, i64 0), i32 %36)
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.7, i64 0, i64 0))
store i32 0, i32* %5
br label %39
39: ; preds = %48, %35
%40 = load i32, i32* %5
%41 = icmp slt i32 %40, 8
br i1 %41, label %42, label %51
42: ; preds = %39
%43 = load i32, i32* %5
%44 = add nsw i32 %43, 1
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.8, i64 0, i64 0), i32 %44)
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.9, i64 0, i64 0))
%47 = call i32 @sleep(i32 5)
br label %48
48: ; preds = %42
%49 = load i32, i32* %5
%50 = add nsw i32 %49, 1
store i32 %50, i32* %5
br label %39
51: ; preds = %39
%52 = call i32 @exit(i32 3)
unreachable
53: ; preds = %31
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.10, i64 0, i64 0))
%55 = call i64 @wait(i32* %6)
store i64 %55, i64* %2
%56 = load i64, i64* %2
%57 = load i64, i64* %3
%58 = icmp eq i64 %56, %57
br i1 %58, label %59, label %62
59: ; preds = %53
%60 = load i32, i32* %6
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.11, i64 0, i64 0), i32 %60)
br label %62
62: ; preds = %59, %53
%63 = load i64, i64* %2
%64 = load i64, i64* %4
%65 = icmp eq i64 %63, %64
br i1 %65, label %66, label %69
66: ; preds = %62
%67 = load i32, i32* %6
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.12, i64 0, i64 0), i32 %67)
br label %69
69: ; preds = %66, %62
%70 = call i64 @wait(i32* %6)
store i64 %70, i64* %2
%71 = load i64, i64* %2
%72 = load i64, i64* %3
%73 = icmp eq i64 %71, %72
br i1 %73, label %74, label %77
74: ; preds = %69
%75 = load i32, i32* %6
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.11, i64 0, i64 0), i32 %75)
br label %77
77: ; preds = %74, %69
%78 = load i64, i64* %2
%79 = load i64, i64* %4
%80 = icmp eq i64 %78, %79
br i1 %80, label %81, label %84
81: ; preds = %77
%82 = load i32, i32* %6
%83 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.12, i64 0, i64 0), i32 %82)
br label %84
84: ; preds = %81, %77
%85 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.13, i64 0, i64 0))
%86 = load i32, i32* %1
ret i32 %86
}

LLVM IR (-O2):
@.str = [37 x i8] c"\0AI am a process my process id is %d\0A\00"
@.str.2 = [32 x i8] c"I am first child, my pid is %d\0A\00"
@.str.4 = [46 x i8] c"\0AI am child 1, this is iteration %d of loop \0A\00"
@.str.6 = [33 x i8] c"I am second child, my pid is %d\0A\00"
@.str.8 = [46 x i8] c"\0AI am child 2, this is iteration %d of loop \0A\00"
@.str.11 = [42 x i8] c"My first child terminated with status %d\0A\00"
@.str.12 = [43 x i8] c"My second child terminated with status %d\0A\00"
@str = [66 x i8] c"I am going to create two child proceses & make them run some code\00"
@str.14 = [65 x i8] c"I am parent, my children are working & sleeping, i wait for them\00"
@str.15 = [55 x i8] c"\0ABoth children got terminated, now i will do the same\0A\00"
@str.16 = [59 x i8] c"I second child going to execute following loop for 8 times\00"
@str.17 = [36 x i8] c"I am tired, sleeping for 5 seconds\0A\00"
@str.18 = [58 x i8] c"I first child going to execute following loop for 6 times\00"
@str.19 = [37 x i8] c"I am tired, sleeping for 10 seconds\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (...) @getpid()
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @str, i64 0, i64 0))
%6 = tail call i64 (...) @fork()
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %31
8: ; preds = %0
%9 = tail call i32 (...) @getpid()
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i32 %9)
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str.18, i64 0, i64 0))
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.4, i64 0, i64 0), i32 1)
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.19, i64 0, i64 0))
%14 = tail call i32 @sleep(i32 10)
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.4, i64 0, i64 0), i32 2)
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.19, i64 0, i64 0))
%17 = tail call i32 @sleep(i32 10)
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.4, i64 0, i64 0), i32 3)
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.19, i64 0, i64 0))
%20 = tail call i32 @sleep(i32 10)
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.4, i64 0, i64 0), i32 4)
%22 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.19, i64 0, i64 0))
%23 = tail call i32 @sleep(i32 10)
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.4, i64 0, i64 0), i32 5)
%25 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.19, i64 0, i64 0))
%26 = tail call i32 @sleep(i32 10)
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.4, i64 0, i64 0), i32 6)
%28 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.19, i64 0, i64 0))
%29 = tail call i32 @sleep(i32 10)
%30 = tail call i32 @exit(i32 2)
unreachable
31: ; preds = %0
%32 = tail call i64 (...) @fork()
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %63
34: ; preds = %31
%35 = tail call i32 (...) @getpid()
%36 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.6, i64 0, i64 0), i32 %35)
%37 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str.16, i64 0, i64 0))
%38 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.8, i64 0, i64 0), i32 1)
%39 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.17, i64 0, i64 0))
%40 = tail call i32 @sleep(i32 5)
%41 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.8, i64 0, i64 0), i32 2)
%42 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.17, i64 0, i64 0))
%43 = tail call i32 @sleep(i32 5)
%44 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.8, i64 0, i64 0), i32 3)
%45 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.17, i64 0, i64 0))
%46 = tail call i32 @sleep(i32 5)
%47 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.8, i64 0, i64 0), i32 4)
%48 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.17, i64 0, i64 0))
%49 = tail call i32 @sleep(i32 5)
%50 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.8, i64 0, i64 0), i32 5)
%51 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.17, i64 0, i64 0))
%52 = tail call i32 @sleep(i32 5)
%53 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.8, i64 0, i64 0), i32 6)
%54 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.17, i64 0, i64 0))
%55 = tail call i32 @sleep(i32 5)
%56 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.8, i64 0, i64 0), i32 7)
%57 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.17, i64 0, i64 0))
%58 = tail call i32 @sleep(i32 5)
%59 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.8, i64 0, i64 0), i32 8)
%60 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.17, i64 0, i64 0))
%61 = tail call i32 @sleep(i32 5)
%62 = tail call i32 @exit(i32 3)
unreachable
63: ; preds = %31
%64 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @str.14, i64 0, i64 0))
%65 = call i64 @wait(i32* %1)
%66 = icmp eq i64 %65, %6
br i1 %66, label %67, label %70
67: ; preds = %63
%68 = load i32, i32* %1
%69 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.11, i64 0, i64 0), i32 %68)
br label %70
70: ; preds = %67, %63
%71 = icmp eq i64 %65, %32
br i1 %71, label %72, label %75
72: ; preds = %70
%73 = load i32, i32* %1
%74 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.12, i64 0, i64 0), i32 %73)
br label %75
75: ; preds = %72, %70
%76 = call i64 @wait(i32* %1)
%77 = icmp eq i64 %76, %6
br i1 %77, label %78, label %81
78: ; preds = %75
%79 = load i32, i32* %1
%80 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.11, i64 0, i64 0), i32 %79)
br label %81
81: ; preds = %78, %75
%82 = icmp eq i64 %76, %32
br i1 %82, label %83, label %86
83: ; preds = %81
%84 = load i32, i32* %1
%85 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.12, i64 0, i64 0), i32 %84)
br label %86
86: ; preds = %83, %81
%87 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.15, i64 0, i64 0))
ret i32 0
}