#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 */
typedef struct TYPE_4__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  int si_pid;
};
typedef TYPE_1__ siginfo_t;

/* Variables and functions */
scalar_t__ EINTR;
int /*<<< orphan*/ WNOHANG;
scalar_t__ errno;
char *format_num(int);
int /*<<< orphan*/ manage(TYPE_1__ *);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
char *strerror(scalar_t__);
int strlen(char const *);
int waitpid(int, int *, int /*<<< orphan*/);
int /*<<< orphan*/ write(int, char const *, int);
void childhandler(int sig, siginfo_t *si, void *context) {
  int status, ret;
  int i;
  char buf[100];
  static const char entered[] = "Entered childhandler\n";
  static const char exited[] = "Exited childhandler\n";
  write(1, entered, strlen(entered));
retry:
  if ((ret = waitpid(si->si_pid, &status, WNOHANG)) == si->si_pid) {
    strcpy(buf, "\treaped process ");
    strcat(buf, format_num(si->si_pid));
    strcat(buf, "\n");
    write(1, buf, strlen(buf));
    manage(si);
  } else if (ret > 0) {
    strcpy(buf, "\treaped unexpected pid ");
    strcat(buf, format_num(ret));
    strcat(buf, "\n");
    write(1, buf, strlen(buf));
    goto retry;
  } else if (ret == 0) {
    strcpy(buf, "\tpid ");
    strcat(buf, format_num(si->si_pid));
    strcat(buf, " changed status\n");
    write(1, buf, strlen(buf));
    manage(si);
  } else if (ret == -1 && errno == EINTR) {
    write(1, "\tretrying\n", 10);
    goto retry;
  } else {
    strcpy(buf, "\twaitpid() failed: ");
    strcat(buf, strerror(errno));
    strcat(buf, "\n");
    write(1, buf, strlen(buf));
  }
  write(1, exited, strlen(exited));
}


x86 assembly (clang, -O0):
<childhandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xe63(%rip),%rdi
call   1060 <strlen@plt>
mov    %eax,%edx
mov    $0x1,%edi
lea    0xe50(%rip),%rsi
call   1050 <write@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
mov    0x2e26(%rip),%rax
mov    (%rax),%edx
lea    -0x1c(%rbp),%rsi
call   1080 <waitpid@plt>
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jne    1265 <childhandler+0xe5>
lea    -0x90(%rbp),%rdi
lea    0xe4b(%rip),%rsi
call   1040 <strcpy@plt>
lea    -0x90(%rbp),%rax
mov    %rax,-0xa0(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1030 <format_num@plt>
mov    -0xa0(%rbp),%rdi
mov    %rax,%rsi
call   1090 <strcat@plt>
lea    -0x90(%rbp),%rdi
lea    0xe59(%rip),%rsi
call   1090 <strcat@plt>
lea    -0x90(%rbp),%rax
mov    %rax,-0x98(%rbp)
lea    -0x90(%rbp),%rdi
call   1060 <strlen@plt>
mov    -0x98(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1050 <write@plt>
mov    -0x10(%rbp),%rdi
call   1070 <manage@plt>
jmp    144c <childhandler+0x2cc>
cmpl   $0x0,-0x20(%rbp)
jle    12ec <childhandler+0x16c>
lea    -0x90(%rbp),%rdi
lea    0xdc9(%rip),%rsi
call   1040 <strcpy@plt>
lea    -0x90(%rbp),%rax
mov    %rax,-0xb0(%rbp)
mov    -0x20(%rbp),%edi
call   1030 <format_num@plt>
mov    -0xb0(%rbp),%rdi
mov    %rax,%rsi
call   1090 <strcat@plt>
lea    -0x90(%rbp),%rdi
lea    0xdc9(%rip),%rsi
call   1090 <strcat@plt>
lea    -0x90(%rbp),%rax
mov    %rax,-0xa8(%rbp)
lea    -0x90(%rbp),%rdi
call   1060 <strlen@plt>
mov    -0xa8(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1050 <write@plt>
jmp    11b5 <childhandler+0x35>
cmpl   $0x0,-0x20(%rbp)
jne    137f <childhandler+0x1ff>
lea    -0x90(%rbp),%rdi
lea    0xd5a(%rip),%rsi
call   1040 <strcpy@plt>
lea    -0x90(%rbp),%rax
mov    %rax,-0xc0(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1030 <format_num@plt>
mov    -0xc0(%rbp),%rdi
mov    %rax,%rsi
call   1090 <strcat@plt>
lea    -0x90(%rbp),%rdi
lea    0xd25(%rip),%rsi
call   1090 <strcat@plt>
lea    -0x90(%rbp),%rax
mov    %rax,-0xb8(%rbp)
lea    -0x90(%rbp),%rdi
call   1060 <strlen@plt>
mov    -0xb8(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1050 <write@plt>
mov    -0x10(%rbp),%rdi
call   1070 <manage@plt>
jmp    1442 <childhandler+0x2c2>
cmpl   $0xffffffff,-0x20(%rbp)
jne    13be <childhandler+0x23e>
mov    0x2c48(%rip),%rax
mov    (%rax),%rax
mov    0x2c36(%rip),%rcx
cmp    (%rcx),%rax
jne    13be <childhandler+0x23e>
mov    $0x1,%edi
lea    0xcc6(%rip),%rsi
mov    $0xa,%edx
call   1050 <write@plt>
jmp    11b5 <childhandler+0x35>
lea    -0x90(%rbp),%rdi
lea    0xcb4(%rip),%rsi
call   1040 <strcpy@plt>
lea    -0x90(%rbp),%rax
mov    %rax,-0xd0(%rbp)
mov    0x2bf2(%rip),%rax
mov    (%rax),%rdi
call   10a0 <strerror@plt>
mov    -0xd0(%rbp),%rdi
mov    %rax,%rsi
call   1090 <strcat@plt>
lea    -0x90(%rbp),%rdi
lea    0xc73(%rip),%rsi
call   1090 <strcat@plt>
lea    -0x90(%rbp),%rax
mov    %rax,-0xc8(%rbp)
lea    -0x90(%rbp),%rdi
call   1060 <strlen@plt>
mov    -0xc8(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1050 <write@plt>
jmp    1442 <childhandler+0x2c2>
jmp    1447 <childhandler+0x2c7>
jmp    144c <childhandler+0x2cc>
lea    0xbcd(%rip),%rdi
call   1060 <strlen@plt>
mov    %eax,%edx
mov    $0x1,%edi
lea    0xbba(%rip),%rsi
call   1050 <write@plt>
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<childhandler>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %rsi,%r15
lea    0xe68(%rip),%rbx
mov    %rbx,%rdi
call   1060 <strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1050 <write@plt>
mov    (%r15),%edi
mov    0x2e2f(%rip),%r14
mov    (%r14),%edx
lea    0xc(%rsp),%rsi
call   1080 <waitpid@plt>
cmp    (%r15),%eax
jne    1251 <childhandler+0xd1>
lea    0xe5f(%rip),%rsi
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <strcpy@plt>
mov    (%r15),%edi
call   1030 <format_num@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1090 <strcat@plt>
lea    0xe81(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcat@plt>
mov    %rbx,%rdi
call   1060 <strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1050 <write@plt>
mov    %r15,%rdi
call   1070 <manage@plt>
lea    0xdf5(%rip),%rbx
mov    %rbx,%rdi
call   1060 <strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1050 <write@plt>
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %eax,%ebp
lea    0x10(%rsp),%rbx
lea    0xe1f(%rip),%r12
lea    0xc(%rsp),%r13
jmp    12cc <childhandler+0x14c>
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
lea    0xdcc(%rip),%rsi
call   1040 <strcpy@plt>
mov    %ebp,%edi
call   1030 <format_num@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1090 <strcat@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1090 <strcat@plt>
mov    %rbx,%rdi
call   1060 <strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1050 <write@plt>
mov    (%r15),%edi
mov    (%r14),%edx
mov    %r13,%rsi
call   1080 <waitpid@plt>
mov    %eax,%ebp
cmp    (%r15),%eax
je     11cf <childhandler+0x4f>
test   %ebp,%ebp
jg     1270 <childhandler+0xf0>
cmp    $0xffffffff,%ebp
jne    12fe <childhandler+0x17e>
mov    0x2cfc(%rip),%rax
mov    (%rax),%rax
mov    0x2cea(%rip),%rcx
cmp    (%rcx),%rax
jne    1335 <childhandler+0x1b5>
mov    $0x1,%edi
lea    0xd7e(%rip),%rsi
mov    $0xa,%edx
jmp    12ae <childhandler+0x12e>
test   %ebp,%ebp
jne    1335 <childhandler+0x1b5>
lea    0xd55(%rip),%rsi
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <strcpy@plt>
mov    (%r15),%edi
call   1030 <format_num@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1090 <strcat@plt>
lea    0xd34(%rip),%rsi
jmp    11fd <childhandler+0x7d>
lea    0xd44(%rip),%rsi
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <strcpy@plt>
mov    0x2c88(%rip),%rax
mov    (%rax),%rdi
call   10a0 <strerror@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1090 <strcat@plt>
lea    0xd14(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcat@plt>
mov    %rbx,%rdi
call   1060 <strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1050 <write@plt>
jmp    1224 <childhandler+0xa4>

LLVM IR (-O0):
%struct.TYPE_4__ = type { i32 }
@childhandler.entered = internal constant [22 x i8] c"Entered childhandler\0A\00"
@childhandler.exited = internal constant [21 x i8] c"Exited childhandler\0A\00"
@WNOHANG = global i32 0
@.str = [17 x i8] c"\09reaped process \00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [24 x i8] c"\09reaped unexpected pid \00"
@.str.3 = [6 x i8] c"\09pid \00"
@.str.4 = [17 x i8] c" changed status\0A\00"
@errno = global i64 0
@EINTR = global i64 0
@.str.5 = [11 x i8] c"\09retrying\0A\00"
@.str.6 = [20 x i8] c"\09waitpid() failed: \00"
define void @childhandler(i32 %0, %struct.TYPE_4__* %1, i8* %2) {
%4 = alloca i32
%5 = alloca %struct.TYPE_4__*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca [100 x i8]
store i32 %0, i32* %4
store %struct.TYPE_4__* %1, %struct.TYPE_4__** %5
store i8* %2, i8** %6
%11 = call i32 @strlen(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @childhandler.entered, i64 0, i64 0))
%12 = call i32 @write(i32 1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @childhandler.entered, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %83, %43, %3
%14 = load %struct.TYPE_4__*, %struct.TYPE_4__** %5
%15 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %14, i32 0, i32 0
%16 = load i32, i32* %15
%17 = load i32, i32* @WNOHANG
%18 = call i32 @waitpid(i32 %16, i32* %7, i32 %17)
store i32 %18, i32* %8
%19 = load %struct.TYPE_4__*, %struct.TYPE_4__** %5
%20 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %19, i32 0, i32 0
%21 = load i32, i32* %20
%22 = icmp eq i32 %18, %21
br i1 %22, label %23, label %40
23: ; preds = %13
%24 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%25 = call i32 @strcpy(i8* %24, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%26 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%27 = load %struct.TYPE_4__*, %struct.TYPE_4__** %5
%28 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %27, i32 0, i32 0
%29 = load i32, i32* %28
%30 = call i8* @format_num(i32 %29)
%31 = call i32 @strcat(i8* %26, i8* %30)
%32 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%33 = call i32 @strcat(i8* %32, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%34 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%35 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%36 = call i32 @strlen(i8* %35)
%37 = call i32 @write(i32 1, i8* %34, i32 %36)
%38 = load %struct.TYPE_4__*, %struct.TYPE_4__** %5
%39 = call i32 @manage(%struct.TYPE_4__* %38)
br label %101
40: ; preds = %13
%41 = load i32, i32* %8
%42 = icmp sgt i32 %41, 0
br i1 %42, label %43, label %56
43: ; preds = %40
%44 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%45 = call i32 @strcpy(i8* %44, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%46 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%47 = load i32, i32* %8
%48 = call i8* @format_num(i32 %47)
%49 = call i32 @strcat(i8* %46, i8* %48)
%50 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%51 = call i32 @strcat(i8* %50, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%52 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%53 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%54 = call i32 @strlen(i8* %53)
%55 = call i32 @write(i32 1, i8* %52, i32 %54)
br label %13
56: ; preds = %40
%57 = load i32, i32* %8
%58 = icmp eq i32 %57, 0
br i1 %58, label %59, label %76
59: ; preds = %56
%60 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%61 = call i32 @strcpy(i8* %60, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%62 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%63 = load %struct.TYPE_4__*, %struct.TYPE_4__** %5
%64 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %63, i32 0, i32 0
%65 = load i32, i32* %64
%66 = call i8* @format_num(i32 %65)
%67 = call i32 @strcat(i8* %62, i8* %66)
%68 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%69 = call i32 @strcat(i8* %68, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0))
%70 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%71 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%72 = call i32 @strlen(i8* %71)
%73 = call i32 @write(i32 1, i8* %70, i32 %72)
%74 = load %struct.TYPE_4__*, %struct.TYPE_4__** %5
%75 = call i32 @manage(%struct.TYPE_4__* %74)
br label %99
76: ; preds = %56
%77 = load i32, i32* %8
%78 = icmp eq i32 %77, -1
br i1 %78, label %79, label %85
79: ; preds = %76
%80 = load i64, i64* @errno
%81 = load i64, i64* @EINTR
%82 = icmp eq i64 %80, %81
br i1 %82, label %83, label %85
83: ; preds = %79
%84 = call i32 @write(i32 1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i32 10)
br label %13
85: ; preds = %79, %76
%86 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%87 = call i32 @strcpy(i8* %86, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0))
%88 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%89 = load i64, i64* @errno
%90 = call i8* @strerror(i64 %89)
%91 = call i32 @strcat(i8* %88, i8* %90)
%92 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%93 = call i32 @strcat(i8* %92, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%94 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%95 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%96 = call i32 @strlen(i8* %95)
%97 = call i32 @write(i32 1, i8* %94, i32 %96)
br label %98
98: ; preds = %85
br label %99
99: ; preds = %98, %59
br label %100
100: ; preds = %99
br label %101
101: ; preds = %100, %23
%102 = call i32 @strlen(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @childhandler.exited, i64 0, i64 0))
%103 = call i32 @write(i32 1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @childhandler.exited, i64 0, i64 0), i32 %102)
ret void
}

LLVM IR (-O2):
%struct.TYPE_4__ = type { i32 }
@childhandler.entered = internal constant [22 x i8] c"Entered childhandler\0A\00"
@childhandler.exited = internal constant [21 x i8] c"Exited childhandler\0A\00"
@WNOHANG = global i32 0
@.str = [17 x i8] c"\09reaped process \00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [24 x i8] c"\09reaped unexpected pid \00"
@.str.3 = [6 x i8] c"\09pid \00"
@.str.4 = [17 x i8] c" changed status\0A\00"
@errno = global i64 0
@EINTR = global i64 0
@.str.5 = [11 x i8] c"\09retrying\0A\00"
@.str.6 = [20 x i8] c"\09waitpid() failed: \00"
define void @childhandler(i32 %0, %struct.TYPE_4__* %1, i8* nocapture readnone %2) {
%4 = alloca i32
%5 = alloca [100 x i8]
%6 = bitcast i32* %4 to i8*
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%8 = tail call i32 @strlen(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @childhandler.entered, i64 0, i64 0))
%9 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @childhandler.entered, i64 0, i64 0), i32 %8)
%10 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %1, i64 0, i32 0
%11 = load i32, i32* %10
%12 = load i32, i32* @WNOHANG
%13 = call i32 @waitpid(i32 %11, i32* %4, i32 %12)
%14 = load i32, i32* %10
%15 = icmp eq i32 %13, %14
br i1 %15, label %16, label %25
16: ; preds = %35, %3
%17 = call i32 @strcpy(i8* %7, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%18 = load i32, i32* %10
%19 = call i8* @format_num(i32 %18)
%20 = call i32 @strcat(i8* %7, i8* %19)
%21 = call i32 @strcat(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%22 = call i32 @strlen(i8* %7)
%23 = call i32 @write(i32 1, i8* %7, i32 %22)
%24 = call i32 @manage(%struct.TYPE_4__* %1)
br label %65
25: ; preds = %3, %35
%26 = phi i32 [ %38, %35 ], [ %13, %3 ]
%27 = icmp sgt i32 %26, 0
br i1 %27, label %28, label %41
28: ; preds = %25
%29 = call i32 @strcpy(i8* %7, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%30 = call i8* @format_num(i32 %26)
%31 = call i32 @strcat(i8* %7, i8* %30)
%32 = call i32 @strcat(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%33 = call i32 @strlen(i8* %7)
%34 = call i32 @write(i32 1, i8* %7, i32 %33)
br label %35
35: ; preds = %28, %55
%36 = load i32, i32* %10
%37 = load i32, i32* @WNOHANG
%38 = call i32 @waitpid(i32 %36, i32* %4, i32 %37)
%39 = load i32, i32* %10
%40 = icmp eq i32 %38, %39
br i1 %40, label %16, label %25
41: ; preds = %25
switch i32 %26, label %57 [
i32 0, label %42
i32 -1, label %51
]
42: ; preds = %41
%43 = call i32 @strcpy(i8* %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%44 = load i32, i32* %10
%45 = call i8* @format_num(i32 %44)
%46 = call i32 @strcat(i8* %7, i8* %45)
%47 = call i32 @strcat(i8* %7, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0))
%48 = call i32 @strlen(i8* %7)
%49 = call i32 @write(i32 1, i8* %7, i32 %48)
%50 = call i32 @manage(%struct.TYPE_4__* %1)
br label %65
51: ; preds = %41
%52 = load i64, i64* @errno
%53 = load i64, i64* @EINTR
%54 = icmp eq i64 %52, %53
br i1 %54, label %55, label %57
55: ; preds = %51
%56 = call i32 @write(i32 1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i32 10)
br label %35
57: ; preds = %41, %51
%58 = call i32 @strcpy(i8* %7, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0))
%59 = load i64, i64* @errno
%60 = call i8* @strerror(i64 %59)
%61 = call i32 @strcat(i8* %7, i8* %60)
%62 = call i32 @strcat(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%63 = call i32 @strlen(i8* %7)
%64 = call i32 @write(i32 1, i8* %7, i32 %63)
br label %65
65: ; preds = %57, %42, %16
%66 = call i32 @strlen(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @childhandler.exited, i64 0, i64 0))
%67 = call i32 @write(i32 1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @childhandler.exited, i64 0, i64 0), i32 %66)
ret void
}