#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*/ execute(char **);
scalar_t__ fgets(char *, int, int /*<<< orphan*/);
char *make_string(char *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ stdin;
int main(int argc, char *argv[]) {
  char *arglist[20 + 1];
  int num_args;
  char argbuf[100];
  num_args = 0;
  while (num_args < 20) {
    printf("Arg[%d]? ", num_args);
    if (fgets(argbuf, 100, stdin) && *argbuf != '\n')
      arglist[num_args++] = make_string(argbuf);
    else {
      if (num_args > 0) {
        arglist[num_args] = NULL;
        execute(arglist);
        num_args = 0;
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0xc4(%rbp)
cmpl   $0x14,-0xc4(%rbp)
jge    1225 <main+0xe5>
mov    -0xc4(%rbp),%esi
lea    0xe83(%rip),%rdi
call   1030 <printf@plt>
lea    -0x130(%rbp),%rdi
mov    0x2e58(%rip),%rax
mov    (%rax),%edx
mov    $0x64,%esi
call   1050 <fgets@plt>
cmp    $0x0,%rax
je     11e5 <main+0xa5>
movsbl -0x130(%rbp),%eax
cmp    $0xa,%eax
je     11e5 <main+0xa5>
lea    -0x130(%rbp),%rdi
call   1060 <make_string@plt>
mov    %rax,%rcx
mov    -0xc4(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0xc4(%rbp)
cltq
mov    %rcx,-0xc0(%rbp,%rax,8)
ff
jmp    1220 <main+0xe0>
cmpl   $0x0,-0xc4(%rbp)
jle    121b <main+0xdb>
movslq -0xc4(%rbp),%rax
movq   $0x0,-0xc0(%rbp,%rax,8)
lea    -0xc0(%rbp),%rdi
call   1040 <execute@plt>
movl   $0x0,-0xc4(%rbp)
jmp    1220 <main+0xe0>
jmp    1163 <main+0x23>
xor    %eax,%eax
add    $0x130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x120,%rsp
xor    %ebp,%ebp
lea    0xea8(%rip),%r14
mov    0x2e89(%rip),%r12
mov    %rsp,%rbx
lea    0x70(%rsp),%r15
jmp    1188 <main+0x48>
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1060 <make_string@plt>
movslq %ebp,%rcx
add    $0x1,%ebp
mov    %rax,0x70(%rsp,%rcx,8)
cmp    $0x14,%ebp
jge    11c9 <main+0x89>
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
mov    (%r12),%edx
mov    %rbx,%rdi
mov    $0x64,%esi
call   1050 <fgets@plt>
test   %rax,%rax
je     11ae <main+0x6e>
cmpb   $0xa,(%rsp)
jne    1170 <main+0x30>
test   %ebp,%ebp
jle    1183 <main+0x43>
mov    %ebp,%eax
movq   $0x0,0x70(%rsp,%rax,8)
mov    %r15,%rdi
call   1040 <execute@plt>
xor    %ebp,%ebp
jmp    1183 <main+0x43>
xor    %eax,%eax
add    $0x120,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Arg[%d]? \00"
@stdin = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [21 x i8*]
%7 = alloca i32
%8 = alloca [100 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %7
br label %9
9: ; preds = %41, %2
%10 = load i32, i32* %7
%11 = icmp slt i32 %10, 20
br i1 %11, label %12, label %42
12: ; preds = %9
%13 = load i32, i32* %7
%14 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%16 = load i32, i32* @stdin
%17 = call i64 @fgets(i8* %15, i32 100, i32 %16)
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %31
19: ; preds = %12
%20 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = icmp ne i32 %22, 10
br i1 %23, label %24, label %31
24: ; preds = %19
%25 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%26 = call i8* @make_string(i8* %25)
%27 = load i32, i32* %7
%28 = add nsw i32 %27, 1
store i32 %28, i32* %7
%29 = sext i32 %27 to i64
%30 = getelementptr inbounds [21 x i8*], [21 x i8*]* %6, i64 0, i64 %29
store i8* %26, i8** %30
br label %41
31: ; preds = %19, %12
%32 = load i32, i32* %7
%33 = icmp sgt i32 %32, 0
br i1 %33, label %34, label %40
34: ; preds = %31
%35 = load i32, i32* %7
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [21 x i8*], [21 x i8*]* %6, i64 0, i64 %36
store i8* null, i8** %37
%38 = getelementptr inbounds [21 x i8*], [21 x i8*]* %6, i64 0, i64 0
%39 = call i32 @execute(i8** %38)
store i32 0, i32* %7
br label %40
40: ; preds = %34, %31
br label %41
41: ; preds = %40, %24
br label %9
42: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"Arg[%d]? \00"
@stdin = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [21 x i8*]
%4 = alloca [100 x i8]
%5 = bitcast [21 x i8*]* %3 to i8*
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%7 = getelementptr inbounds [21 x i8*], [21 x i8*]* %3, i64 0, i64 0
br label %8
8: ; preds = %2, %28
%9 = phi i32 [ 0, %2 ], [ %29, %28 ]
%10 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* @stdin
%12 = call i64 @fgets(i8* %6, i32 100, i32 %11)
%13 = icmp ne i64 %12, 0
%14 = load i8, i8* %6
%15 = icmp ne i8 %14, 10
%16 = select i1 %13, i1 %15, i1 false
br i1 %16, label %17, label %22
17: ; preds = %8
%18 = call i8* @make_string(i8* %6)
%19 = add nsw i32 %9, 1
%20 = sext i32 %9 to i64
%21 = getelementptr inbounds [21 x i8*], [21 x i8*]* %3, i64 0, i64 %20
store i8* %18, i8** %21
br label %28
22: ; preds = %8
%23 = icmp sgt i32 %9, 0
br i1 %23, label %24, label %28
24: ; preds = %22
%25 = zext i32 %9 to i64
%26 = getelementptr inbounds [21 x i8*], [21 x i8*]* %3, i64 0, i64 %25
store i8* null, i8** %26
%27 = call i32 @execute(i8** %7)
br label %28
28: ; preds = %22, %24, %17
%29 = phi i32 [ %19, %17 ], [ 0, %24 ], [ %9, %22 ]
%30 = icmp slt i32 %29, 20
br i1 %30, label %8, label %31
31: ; preds = %28
ret i32 0
}