#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 EXIT_FAILURE;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int pipe_exec(int, char **);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ usage(int /*<<< orphan*/, char *);
int main(int argc, char *argv[]) {
  int i, ret = EXIT_FAILURE;
  if (argc < 1) {
    usage(stdout, argv[0]);
    fprintf(stderr, "Error: Too few arguments!\n");
    exit(EXIT_FAILURE);
  }
  for (i = 0; i < (argc - 1); i++)
    argv[i] = argv[i + 1];
  argv[i] = NULL;
  return pipe_exec(argc - 1, &argv[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    0x2e7b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    11a4 <main+0x64>
mov    0x2e5d(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
call   1040 <usage@plt>
mov    0x2e58(%rip),%rax
mov    (%rax),%edi
lea    0xe6f(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e3b(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    11e7 <main+0xa7>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11ab <main+0x6b>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    -0x10(%rbp),%rsi
call   1060 <pipe_exec@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
test   %edi,%edi
jle    1198 <main+0x48>
lea    -0x1(%rdi),%r14d
cmp    $0x1,%edi
jne    1168 <main+0x18>
xor    %eax,%eax
jmp    117e <main+0x2e>
lea    0x8(%rbx),%rsi
mov    %r14d,%edx
shl    $0x3,%rdx
mov    %rbx,%rdi
call   1050 <memmove@plt>
mov    %r14,%rax
movq   $0x0,(%rbx,%rax,8)
mov    %r14d,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1070 <pipe_exec@plt>
mov    0x2e31(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rsi
call   1040 <usage@plt>
mov    0x2e30(%rip),%rax
mov    (%rax),%edi
lea    0xe47(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e13(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@stdout = global i32 0
@stderr = global i32 0
@.str = [27 x i8] c"Error: Too few arguments!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* @EXIT_FAILURE
store i32 %8, i32* %7
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 1
br i1 %10, label %11, label %21
11: ; preds = %2
%12 = load i32, i32* @stdout
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 0
%15 = load i8*, i8** %14
%16 = call i32 @usage(i32 %12, i8* %15)
%17 = load i32, i32* @stderr
%18 = call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%19 = load i32, i32* @EXIT_FAILURE
%20 = call i32 @exit(i32 %19)
unreachable
21: ; preds = %2
store i32 0, i32* %6
br label %22
22: ; preds = %38, %21
%23 = load i32, i32* %6
%24 = load i32, i32* %4
%25 = sub nsw i32 %24, 1
%26 = icmp slt i32 %23, %25
br i1 %26, label %27, label %41
27: ; preds = %22
%28 = load i8**, i8*** %5
%29 = load i32, i32* %6
%30 = add nsw i32 %29, 1
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i8*, i8** %28, i64 %31
%33 = load i8*, i8** %32
%34 = load i8**, i8*** %5
%35 = load i32, i32* %6
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds i8*, i8** %34, i64 %36
store i8* %33, i8** %37
br label %38
38: ; preds = %27
%39 = load i32, i32* %6
%40 = add nsw i32 %39, 1
store i32 %40, i32* %6
br label %22
41: ; preds = %22
%42 = load i8**, i8*** %5
%43 = load i32, i32* %6
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds i8*, i8** %42, i64 %44
store i8* null, i8** %45
%46 = load i32, i32* %4
%47 = sub nsw i32 %46, 1
%48 = load i8**, i8*** %5
%49 = getelementptr inbounds i8*, i8** %48, i64 0
%50 = call i32 @pipe_exec(i32 %47, i8** %49)
ret i32 %50
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@stdout = global i32 0
@stderr = global i32 0
@.str = [27 x i8] c"Error: Too few arguments!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = bitcast i8** %1 to i8*
%4 = icmp slt i32 %0, 1
br i1 %4, label %15, label %5
5: ; preds = %2
%6 = add nsw i32 %0, -1
%7 = icmp eq i32 %0, 1
br i1 %7, label %23, label %8
8: ; preds = %5
%9 = getelementptr i8*, i8** %1, i64 1
%10 = bitcast i8** %9 to i8*
%11 = zext i32 %6 to i64
%12 = shl nuw nsw i64 %11, 3
%13 = add nsw i32 %0, -1
%14 = zext i32 %13 to i64
br label %23
15: ; preds = %2
%16 = load i32, i32* @stdout
%17 = load i8*, i8** %1
%18 = tail call i32 @usage(i32 %16, i8* %17)
%19 = load i32, i32* @stderr
%20 = tail call i32 @fprintf(i32 %19, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%21 = load i32, i32* @EXIT_FAILURE
%22 = tail call i32 @exit(i32 %21)
unreachable
23: ; preds = %8, %5
%24 = phi i64 [ 0, %5 ], [ %14, %8 ]
%25 = getelementptr inbounds i8*, i8** %1, i64 %24
store i8* null, i8** %25
%26 = tail call i32 @pipe_exec(i32 %6, i8** %1)
ret i32 %26
}