#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*/ SIGINT;
int /*<<< orphan*/ SIGQUIT;
int /*<<< orphan*/ SIG_DFL;
int /*<<< orphan*/ execvp(char *, char **);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  signal(SIGINT, SIG_DFL);
  signal(SIGQUIT, SIG_DFL);
  argc--;
  argv++;
  if (argc <= 0)
    exit(1);
  execvp(argv[0], argv);
  fprintf(stderr, "%s: Command not found\n", argv[0]);
  exit(127);
  exit(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    0x2e8b(%rip),%rax
mov    (%rax),%edi
mov    0x2e62(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
mov    0x2e6c(%rip),%rax
mov    (%rax),%edi
mov    0x2e4b(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
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)
jg     11ad <main+0x6d>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <execvp@plt>
mov    0x2e0c(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe2c(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x7f,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
mov    0x2e6f(%rip),%r14
mov    (%r14),%esi
call   1030 <signal@plt>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
mov    (%r14),%esi
call   1030 <signal@plt>
cmp    $0x1,%ebp
jg     1181 <main+0x41>
mov    $0x1,%edi
call   1060 <exit@plt>
add    $0x8,%rbx
mov    (%rbx),%rdi
mov    %rbx,%rsi
call   1050 <execvp@plt>
mov    0x2e39(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
lea    0xe5d(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x7f,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@SIGINT = global i32 0
@SIG_DFL = global i32 0
@SIGQUIT = global i32 0
@stderr = global i32 0
@.str = [23 x i8] c"%s: Command not found\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* @SIGINT
%7 = load i32, i32* @SIG_DFL
%8 = call i32 @signal(i32 %6, i32 %7)
%9 = load i32, i32* @SIGQUIT
%10 = load i32, i32* @SIG_DFL
%11 = call i32 @signal(i32 %9, i32 %10)
%12 = load i32, i32* %4
%13 = add nsw i32 %12, -1
store i32 %13, i32* %4
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i32 1
store i8** %15, i8*** %5
%16 = load i32, i32* %4
%17 = icmp sle i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %2
%19 = call i32 @exit(i32 1)
unreachable
20: ; preds = %2
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 0
%23 = load i8*, i8** %22
%24 = load i8**, i8*** %5
%25 = call i32 @execvp(i8* %23, i8** %24)
%26 = load i32, i32* @stderr
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 0
%29 = load i8*, i8** %28
%30 = call i32 @fprintf(i32 %26, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %29)
%31 = call i32 @exit(i32 127)
unreachable
}

LLVM IR (-O2):
@SIGINT = global i32 0
@SIG_DFL = global i32 0
@SIGQUIT = global i32 0
@stderr = global i32 0
@.str = [23 x i8] c"%s: Command not found\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = load i32, i32* @SIGINT
%4 = load i32, i32* @SIG_DFL
%5 = tail call i32 @signal(i32 %3, i32 %4)
%6 = load i32, i32* @SIGQUIT
%7 = load i32, i32* @SIG_DFL
%8 = tail call i32 @signal(i32 %6, i32 %7)
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = icmp slt i32 %0, 2
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = tail call i32 @exit(i32 1)
unreachable
13: ; preds = %2
%14 = load i8*, i8** %9
%15 = tail call i32 @execvp(i8* %14, i8** %9)
%16 = load i32, i32* @stderr
%17 = load i8*, i8** %9
%18 = tail call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %17)
%19 = tail call i32 @exit(i32 127)
unreachable
}