#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*/ make(char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  argc--, argv++;
  if (!argc) {
    printf("Usage:\n");
    printf("build <program>\n");
    return 1;
  } else {
    while (argc) {
      make(*argv);
      argc--;
      argv++;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1179 <main+0x59>
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11ba <main+0x9a>
jmp    117e <main+0x5e>
cmpl   $0x0,-0x8(%rbp)
je     11ae <main+0x8e>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <make@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    117e <main+0x5e>
jmp    11b3 <main+0x93>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
cmp    $0x1,%edi
je     1156 <main+0x36>
mov    %rsi,%r14
mov    %edi,%r15d
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r14,%rbx,8),%rdi
call   1040 <make@plt>
add    $0x1,%rbx
cmp    %ebx,%r15d
jne    1140 <main+0x20>
xor    %eax,%eax
jmp    1173 <main+0x53>
lea    0xea3(%rip),%rdi
call   1030 <puts@plt>
lea    0xe9e(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [8 x i8] c"Usage:\0A\00"
@.str.1 = [17 x i8] c"build <program>\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = add nsw i32 %6, -1
store i32 %7, i32* %4
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i32 1
store i8** %9, i8*** %5
%10 = load i32, i32* %4
%11 = icmp ne i32 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %2
%13 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %3
br label %29
15: ; preds = %2
br label %16
16: ; preds = %19, %15
%17 = load i32, i32* %4
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %27
19: ; preds = %16
%20 = load i8**, i8*** %5
%21 = load i8*, i8** %20
%22 = call i32 @make(i8* %21)
%23 = load i32, i32* %4
%24 = add nsw i32 %23, -1
store i32 %24, i32* %4
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i32 1
store i8** %26, i8*** %5
br label %16
27: ; preds = %16
br label %28
28: ; preds = %27
store i32 0, i32* %3
br label %29
29: ; preds = %28, %12
%30 = load i32, i32* %3
ret i32 %30
}

LLVM IR (-O2):
@str = [7 x i8] c"Usage:\00"
@str.2 = [16 x i8] c"build <program>\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = add nsw i32 %0, -1
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.2, i64 0, i64 0))
br label %16
8: ; preds = %2, %8
%9 = phi i8** [ %11, %8 ], [ %1, %2 ]
%10 = phi i32 [ %14, %8 ], [ %3, %2 ]
%11 = getelementptr inbounds i8*, i8** %9, i64 1
%12 = load i8*, i8** %11
%13 = tail call i32 @make(i8* %12)
%14 = add nsw i32 %10, -1
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %8
16: ; preds = %8, %5
%17 = phi i32 [ 1, %5 ], [ 0, %8 ]
ret i32 %17
}