#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 atoi(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stdout;
void grandchild(void) {
  printf("grandchild started\n");
  int a = atoi("1337");
  a = atoi("1341");
  a = atoi("6243");
  a = atoi("21");
  a = atoi("1337");
  a = atoi("1341");
  a = atoi("6243");
  a = atoi("21");
  sleep(1);
  a = atoi("87162");
  a = atoi("1337");
  a = atoi("1341");
  a = atoi("6243");
  a = atoi("21");
  a = atoi("87162");
  a = atoi("87162");
  fprintf(stdout, "grandchild done\n");
}


x86 assembly (clang, -O0):
<grandchild>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb9(%rip),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x4(%rbp)
lea    0xeaf(%rip),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x4(%rbp)
lea    0xea5(%rip),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x4(%rbp)
lea    0xe9b(%rip),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x4(%rbp)
lea    0xe7d(%rip),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x4(%rbp)
lea    0xe73(%rip),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x4(%rbp)
lea    0xe69(%rip),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x4(%rbp)
lea    0xe5f(%rip),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x4(%rbp)
mov    $0x1,%edi
call   1060 <sleep@plt>
lea    0xe49(%rip),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x4(%rbp)
lea    0xe28(%rip),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x4(%rbp)
lea    0xe1e(%rip),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x4(%rbp)
lea    0xe14(%rip),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x4(%rbp)
lea    0xe0a(%rip),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x4(%rbp)
lea    0xdfe(%rip),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x4(%rbp)
lea    0xdef(%rip),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x4(%rbp)
mov    0x2d9a(%rip),%rax
mov    (%rax),%edi
lea    0xddd(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<grandchild>:
push   %rax
lea    0xed9(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xea9(%rip),%rsi
pop    %rax
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"grandchild started\0A\00"
@.str.1 = [5 x i8] c"1337\00"
@.str.2 = [5 x i8] c"1341\00"
@.str.3 = [5 x i8] c"6243\00"
@.str.4 = [3 x i8] c"21\00"
@.str.5 = [6 x i8] c"87162\00"
@stdout = global i32 0
@.str.6 = [17 x i8] c"grandchild done\0A\00"
define void @grandchild() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @atoi(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
store i32 %3, i32* %1
%4 = call i32 @atoi(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
store i32 %4, i32* %1
%5 = call i32 @atoi(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
store i32 %5, i32* %1
%6 = call i32 @atoi(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
store i32 %6, i32* %1
%7 = call i32 @atoi(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
store i32 %7, i32* %1
%8 = call i32 @atoi(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
store i32 %8, i32* %1
%9 = call i32 @atoi(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
store i32 %9, i32* %1
%10 = call i32 @atoi(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
store i32 %10, i32* %1
%11 = call i32 @sleep(i32 1)
%12 = call i32 @atoi(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
store i32 %12, i32* %1
%13 = call i32 @atoi(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
store i32 %13, i32* %1
%14 = call i32 @atoi(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
store i32 %14, i32* %1
%15 = call i32 @atoi(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
store i32 %15, i32* %1
%16 = call i32 @atoi(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
store i32 %16, i32* %1
%17 = call i32 @atoi(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
store i32 %17, i32* %1
%18 = call i32 @atoi(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
store i32 %18, i32* %1
%19 = load i32, i32* @stdout
%20 = call i32 @fprintf(i32 %19, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str.6 = [17 x i8] c"grandchild done\0A\00"
@str = [19 x i8] c"grandchild started\00"
define void @grandchild() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @sleep(i32 1)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0))
ret void
}