#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*/ forkIt(char **, char **, int);
int getInput(char *, char **, int);
int /*<<< orphan*/ parseInput(char *, char **);
int main() {
  char *args[80 / 2 + 1];
  char line[80] = {0};
  char history[10][80];
  int histCount = 1;
  while (1) {
    histCount = getInput(line, history, histCount);
    parseInput(line, args);
    forkIt(args, history, histCount - 1);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4d0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x1a0(%rbp),%rdi
xor    %esi,%esi
mov    $0x50,%edx
call   1060 <memset@plt>
movl   $0x1,-0x4c4(%rbp)
lea    -0x1a0(%rbp),%rdi
lea    -0x4c0(%rbp),%rsi
mov    -0x4c4(%rbp),%edx
call   1050 <getInput@plt>
mov    %eax,-0x4c4(%rbp)
lea    -0x1a0(%rbp),%rdi
lea    -0x150(%rbp),%rsi
call   1040 <parseInput@plt>
lea    -0x150(%rbp),%rdi
lea    -0x4c0(%rbp),%rsi
mov    -0x4c4(%rbp),%edx
sub    $0x1,%edx
mov    %edx,-0x4c8(%rbp)
call   1030 <forkIt@plt>
jmp    116f <main+0x2f>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x4c8,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
mov    $0x1,%ebp
mov    %rsp,%r14
lea    0x1a0(%rsp),%r15
lea    0x50(%rsp),%rbx
nopl   (%rax)
mov    %r14,%rdi
mov    %r15,%rsi
mov    %ebp,%edx
call   1050 <getInput@plt>
mov    %eax,%ebp
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <parseInput@plt>
mov    %ebp,%edx
add    $0xffffffff,%edx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <forkIt@plt>
jmp    1170 <main+0x40>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [41 x i8*]
%3 = alloca [80 x i8]
%4 = alloca [10 x [80 x i8]]
%5 = alloca i32
store i32 0, i32* %1
%6 = bitcast [80 x i8]* %3 to i8*
store i32 1, i32* %5
br label %7
7: ; preds = %0, %7
%8 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%9 = getelementptr inbounds [10 x [80 x i8]], [10 x [80 x i8]]* %4, i64 0, i64 0
%10 = bitcast [80 x i8]* %9 to i8**
%11 = load i32, i32* %5
%12 = call i32 @getInput(i8* %8, i8** %10, i32 %11)
store i32 %12, i32* %5
%13 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%14 = getelementptr inbounds [41 x i8*], [41 x i8*]* %2, i64 0, i64 0
%15 = call i32 @parseInput(i8* %13, i8** %14)
%16 = getelementptr inbounds [41 x i8*], [41 x i8*]* %2, i64 0, i64 0
%17 = getelementptr inbounds [10 x [80 x i8]], [10 x [80 x i8]]* %4, i64 0, i64 0
%18 = bitcast [80 x i8]* %17 to i8**
%19 = load i32, i32* %5
%20 = sub nsw i32 %19, 1
%21 = call i32 @forkIt(i8** %16, i8** %18, i32 %20)
br label %7
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [41 x i8*]
%2 = alloca [80 x i8]
%3 = alloca [10 x [80 x i8]]
%4 = bitcast [41 x i8*]* %1 to i8*
%5 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [10 x [80 x i8]], [10 x [80 x i8]]* %3, i64 0, i64 0, i64 0
%7 = bitcast [10 x [80 x i8]]* %3 to i8**
%8 = getelementptr inbounds [41 x i8*], [41 x i8*]* %1, i64 0, i64 0
br label %9
9: ; preds = %9, %0
%10 = phi i32 [ 1, %0 ], [ %11, %9 ]
%11 = call i32 @getInput(i8* %5, i8** %7, i32 %10)
%12 = call i32 @parseInput(i8* %5, i8** %8)
%13 = add nsw i32 %11, -1
%14 = call i32 @forkIt(i8** %8, i8** %7, i32 %13)
br label %9
}