#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 */
scalar_t__ errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *, char *,
                           char *);
int /*<<< orphan*/ stderr;
char *strerror(scalar_t__);
int /*<<< orphan*/ untraceable(char *);
char *xsh(int, char **);
int main(int argc, char **argv) {
  untraceable(argv[0]);
  argv[1] = xsh(argc, argv);
  fprintf(stderr, "%s%s%s: %s\n", argv[0], errno ? ": " : "",
          errno ? strerror(errno) : "", argv[1] ? argv[1] : "<null>");
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1060 <untraceable@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <xsh@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    0x2e60(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    0x2e41(%rip),%rax
mov    (%rax),%rdx
lea    0xe6a(%rip),%rax
lea    0xe64(%rip),%rcx
cmp    $0x0,%rdx
cmovne %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    0x2e1d(%rip),%rax
cmpq   $0x0,(%rax)
je     11dd <main+0x9d>
mov    0x2e0c(%rip),%rax
mov    (%rax),%rdi
call   1050 <strerror@plt>
mov    %rax,-0x30(%rbp)
jmp    11ed <main+0xad>
lea    0xe27(%rip),%rax
mov    %rax,-0x30(%rbp)
jmp    11ed <main+0xad>
mov    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x8(%rax)
je     1215 <main+0xd5>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x40(%rbp)
jmp    1225 <main+0xe5>
lea    0xdf3(%rip),%rax
mov    %rax,-0x40(%rbp)
jmp    1225 <main+0xe5>
mov    -0x38(%rbp),%r8
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%edi
mov    -0x40(%rbp),%r9
lea    0xdc1(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%ebp
mov    (%rsi),%rdi
call   1060 <untraceable@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <xsh@plt>
mov    %rax,0x8(%rbx)
mov    0x2e7a(%rip),%rcx
mov    (%rcx),%ebp
mov    (%rbx),%r14
mov    0x2e66(%rip),%rcx
mov    (%rcx),%rdi
test   %rdi,%rdi
je     118f <main+0x4f>
call   1050 <strerror@plt>
mov    %rax,%r8
mov    0x8(%rbx),%rax
lea    0xe7f(%rip),%rcx
jmp    1199 <main+0x59>
lea    0xe75(%rip),%rcx
mov    %rcx,%r8
test   %rax,%rax
lea    0xe6c(%rip),%r9
cmovne %rax,%r9
lea    0xe52(%rip),%rsi
mov    %ebp,%edi
mov    %r14,%rdx
call   1040 <fprintf@plt>
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [12 x i8] c"%s%s%s: %s\0A\00"
@errno = global i64 0
@.str.1 = [3 x i8] c": \00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [7 x i8] c"<null>\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 i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = call i32 @untraceable(i8* %8)
%10 = load i32, i32* %4
%11 = load i8**, i8*** %5
%12 = call i8* @xsh(i32 %10, i8** %11)
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
store i8* %12, i8** %14
%15 = load i32, i32* @stderr
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 0
%18 = load i8*, i8** %17
%19 = load i64, i64* @errno
%20 = icmp ne i64 %19, 0
%21 = zext i1 %20 to i64
%22 = select i1 %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0)
%23 = load i64, i64* @errno
%24 = icmp ne i64 %23, 0
br i1 %24, label %25, label %28
25: ; preds = %2
%26 = load i64, i64* @errno
%27 = call i8* @strerror(i64 %26)
br label %29
28: ; preds = %2
br label %29
29: ; preds = %28, %25
%30 = phi i8* [ %27, %25 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), %28 ]
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i64 1
%33 = load i8*, i8** %32
%34 = icmp ne i8* %33, null
br i1 %34, label %35, label %39
35: ; preds = %29
%36 = load i8**, i8*** %5
%37 = getelementptr inbounds i8*, i8** %36, i64 1
%38 = load i8*, i8** %37
br label %40
39: ; preds = %29
br label %40
40: ; preds = %39, %35
%41 = phi i8* [ %38, %35 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), %39 ]
%42 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %18, i8* %22, i8* %30, i8* %41)
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [12 x i8] c"%s%s%s: %s\0A\00"
@errno = global i64 0
@.str.1 = [3 x i8] c": \00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [7 x i8] c"<null>\00"
define i32 @main(i32 %0, i8** %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @untraceable(i8* %3)
%5 = tail call i8* @xsh(i32 %0, i8** %1)
%6 = getelementptr inbounds i8*, i8** %1, i64 1
store i8* %5, i8** %6
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %1
%9 = load i64, i64* @errno
%10 = icmp eq i64 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %2
%12 = tail call i8* @strerror(i64 %9)
%13 = load i8*, i8** %6
br label %14
14: ; preds = %2, %11
%15 = phi i8* [ %5, %2 ], [ %13, %11 ]
%16 = phi i8* [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), %2 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), %11 ]
%17 = phi i8* [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), %2 ], [ %12, %11 ]
%18 = icmp eq i8* %15, null
%19 = select i1 %18, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* %15
%20 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %16, i8* %17, i8* %19)
ret i32 1
}