#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*/ do_file(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  char *prog_name = argv[0];
  if (argc == 1) {
    printf("Usage is %s [options] <file-list>\n", prog_name);
    exit(8);
  }
  for (; argc > 1; --argc) {
    do_file(argv[1]);
    ++argv;
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1175 <main+0x45>
mov    -0x18(%rbp),%rsi
lea    0xe9a(%rip),%rdi
call   1040 <printf@plt>
mov    $0x8,%edi
call   1050 <exit@plt>
jmp    117a <main+0x4a>
cmpl   $0x1,-0x8(%rbp)
jle    11ab <main+0x7b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <do_file@plt>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    117a <main+0x4a>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
cmp    $0x1,%edi
je     116d <main+0x3d>
jle    1164 <main+0x34>
mov    %edi,%ebp
add    $0x1,%ebp
add    $0x8,%rbx
cs nopw 0x0(%rax,%rax,1)
mov    (%rbx),%rdi
call   1030 <do_file@plt>
add    $0xffffffff,%ebp
add    $0x8,%rbx
cmp    $0x2,%ebp
ja     1150 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    (%rbx),%rsi
lea    0xe89(%rip),%rdi
call   1040 <printf@plt>
mov    $0x8,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [35 x i8] c"Usage is %s [options] <file-list>\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = icmp sgt i32 %0, 1
br i1 %5, label %10, label %18
6: ; preds = %2
%7 = load i8*, i8** %1
%8 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = tail call i32 @exit(i32 8)
unreachable
10: ; preds = %4, %10
%11 = phi i32 [ %16, %10 ], [ %0, %4 ]
%12 = phi i8** [ %13, %10 ], [ %1, %4 ]
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = tail call i32 @do_file(i8* %14)
%16 = add nsw i32 %11, -1
%17 = icmp ugt i32 %11, 2
br i1 %17, label %10, label %18
18: ; preds = %10, %4
ret i32 0
}