#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*/ NXTransCleanup();
int /*<<< orphan*/ NXTransExit(int);
scalar_t__ NXTransParseCommandLine(int, char const **);
scalar_t__ NXTransParseEnvironment(char *, int /*<<< orphan*/);
int NXTransProxy(int, int, int /*<<< orphan*/ *);
char *getenv(char *);
int main(int argc, const char **argv) {
  int result = -1;
  char *options = NULL;
  options = getenv("NX_DISPLAY");
  if (NXTransParseCommandLine(argc, argv) < 0) {
    NXTransCleanup();
  }
  if (NXTransParseEnvironment(options, 0) < 0) {
    NXTransCleanup();
  }
  result = NXTransProxy(-1, -1, NULL);
  NXTransExit(result);
  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)
movl   $0xffffffff,-0x14(%rbp)
movq   $0x0,-0x20(%rbp)
lea    0xe74(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <NXTransParseCommandLine@plt>
cmp    $0x0,%rax
jge    11b2 <main+0x52>
mov    $0x0,%al
call   1080 <NXTransCleanup@plt>
mov    -0x20(%rbp),%rdi
xor    %esi,%esi
call   1070 <NXTransParseEnvironment@plt>
cmp    $0x0,%rax
jge    11ce <main+0x6e>
mov    $0x0,%al
call   1080 <NXTransCleanup@plt>
mov    $0xffffffff,%esi
xor    %eax,%eax
mov    %eax,%edx
mov    %esi,%edi
call   1040 <NXTransProxy@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1060 <NXTransExit@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xe90(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%r14
mov    %ebp,%edi
mov    %rbx,%rsi
call   1050 <NXTransParseCommandLine@plt>
test   %rax,%rax
jns    118e <main+0x2e>
xor    %eax,%eax
call   1080 <NXTransCleanup@plt>
mov    %r14,%rdi
xor    %esi,%esi
call   1070 <NXTransParseEnvironment@plt>
test   %rax,%rax
jns    11a4 <main+0x44>
xor    %eax,%eax
call   1080 <NXTransCleanup@plt>
mov    $0xffffffff,%edi
mov    $0xffffffff,%esi
xor    %edx,%edx
call   1040 <NXTransProxy@plt>
mov    %eax,%edi
call   1060 <NXTransExit@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"NX_DISPLAY\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 -1, i32* %6
store i8* null, i8** %7
%8 = call i8* @getenv(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
store i8* %8, i8** %7
%9 = load i32, i32* %4
%10 = load i8**, i8*** %5
%11 = call i64 @NXTransParseCommandLine(i32 %9, i8** %10)
%12 = icmp slt i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = call i32 (...) @NXTransCleanup()
br label %15
15: ; preds = %13, %2
%16 = load i8*, i8** %7
%17 = call i64 @NXTransParseEnvironment(i8* %16, i32 0)
%18 = icmp slt i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = call i32 (...) @NXTransCleanup()
br label %21
21: ; preds = %19, %15
%22 = call i32 @NXTransProxy(i32 -1, i32 -1, i32* null)
store i32 %22, i32* %6
%23 = load i32, i32* %6
%24 = call i32 @NXTransExit(i32 %23)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"NX_DISPLAY\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i8* @getenv(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = tail call i64 @NXTransParseCommandLine(i32 %0, i8** %1)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 (...) @NXTransCleanup()
br label %8
8: ; preds = %6, %2
%9 = tail call i64 @NXTransParseEnvironment(i8* %3, i32 0)
%10 = icmp slt i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = tail call i32 (...) @NXTransCleanup()
br label %13
13: ; preds = %11, %8
%14 = tail call i32 @NXTransProxy(i32 -1, i32 -1, i32* null)
%15 = tail call i32 @NXTransExit(i32 %14)
ret i32 0
}