#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*/ printf(char *, ...);
int /*<<< orphan*/ wait(int *);
void clean_up_child_process(int signal_number) {
  int status;
  {
    printf("nfcho(D)");
    printf("clean_up_child_process...(sig_num: %d)\n", signal_number);
    printf("\n");
  };
  wait(&status);
  {
    printf("nfcho(D)");
    printf("clean_up_child_process status: %d\n", status);
    printf("\n");
  };
}


x86 assembly (clang, -O0):
<clean_up_child_process>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x8(%rbp),%rdi
call   1040 <wait@plt>
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clean_up_child_process>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0xec3(%rip),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xebb(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x4(%rsp),%rdi
call   1050 <wait@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%esi
lea    0xeb1(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [9 x i8] c"nfcho(D)\00"
@.str.1 = [40 x i8] c"clean_up_child_process...(sig_num: %d)\0A\00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [35 x i8] c"clean_up_child_process status: %d\0A\00"
define void @clean_up_child_process(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @wait(i32* %3)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* %3
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), i32 %10)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"nfcho(D)\00"
@.str.1 = [40 x i8] c"clean_up_child_process...(sig_num: %d)\0A\00"
@.str.3 = [35 x i8] c"clean_up_child_process status: %d\0A\00"
define void @clean_up_child_process(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i32 %0)
%6 = tail call i32 @putchar(i32 10)
%7 = call i32 @wait(i32* %2)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %2
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), i32 %9)
%11 = call i32 @putchar(i32 10)
ret void
}