#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 atoi(char *);
char *getenv(char *);
int /*<<< orphan*/ initSignal(int, char *, char *, char *);
int /*<<< orphan*/ wiringSetup();
void wyliodrinSetup() {
  wiringSetup();
  char *val = getenv("wyliodrin_port");
  int port = 0;
  if (val != NULL)
    port = atoi(val);
  if (port == 0)
    port = 6379;
  char *projectId = getenv("wyliodrin_project");
  char *sessionId = getenv("wyliodrin_session");
  char *userid = getenv("wyliodrin_userid");
  initSignal(port, projectId, sessionId, userid);
}


x86 assembly (clang, -O0):
<wyliodrinSetup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    $0x0,%al
call   1040 <wiringSetup@plt>
lea    0xeaa(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     117d <wyliodrinSetup+0x3d>
mov    -0x8(%rbp),%rdi
call   1060 <atoi@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    118e <wyliodrinSetup+0x4e>
movl   $0x18eb,-0xc(%rbp)
lea    0xe7a(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x18(%rbp)
lea    0xe7c(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x20(%rbp)
lea    0xe7e(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x28(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
call   1050 <initSignal@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wyliodrinSetup>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1040 <wiringSetup@plt>
lea    0xeae(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     116a <wyliodrinSetup+0x2a>
mov    %rax,%rdi
call   1060 <atoi@plt>
mov    %eax,%ebp
test   %eax,%eax
jne    116f <wyliodrinSetup+0x2f>
mov    $0x18eb,%ebp
lea    0xe99(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%r14
lea    0xe9c(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rbx
lea    0xe9f(%rip),%rdi
call   1030 <getenv@plt>
mov    %ebp,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    %rax,%rcx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <initSignal@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"wyliodrin_port\00"
@.str.1 = [18 x i8] c"wyliodrin_project\00"
@.str.2 = [18 x i8] c"wyliodrin_session\00"
@.str.3 = [17 x i8] c"wyliodrin_userid\00"
define void @wyliodrinSetup() {
%1 = alloca i8*
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = call i32 (...) @wiringSetup()
%7 = call i8* @getenv(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
store i8* %7, i8** %1
store i32 0, i32* %2
%8 = load i8*, i8** %1
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %13
10: ; preds = %0
%11 = load i8*, i8** %1
%12 = call i32 @atoi(i8* %11)
store i32 %12, i32* %2
br label %13
13: ; preds = %10, %0
%14 = load i32, i32* %2
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %13
store i32 6379, i32* %2
br label %17
17: ; preds = %16, %13
%18 = call i8* @getenv(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
store i8* %18, i8** %3
%19 = call i8* @getenv(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
store i8* %19, i8** %4
%20 = call i8* @getenv(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
store i8* %20, i8** %5
%21 = load i32, i32* %2
%22 = load i8*, i8** %3
%23 = load i8*, i8** %4
%24 = load i8*, i8** %5
%25 = call i32 @initSignal(i32 %21, i8* %22, i8* %23, i8* %24)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"wyliodrin_port\00"
@.str.1 = [18 x i8] c"wyliodrin_project\00"
@.str.2 = [18 x i8] c"wyliodrin_session\00"
@.str.3 = [17 x i8] c"wyliodrin_userid\00"
define void @wyliodrinSetup() {
%1 = tail call i32 (...) @wiringSetup()
%2 = tail call i8* @getenv(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %2, null
br i1 %3, label %7, label %4
4: ; preds = %0
%5 = tail call i32 @atoi(i8* %2)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %0, %4
br label %8
8: ; preds = %4, %7
%9 = phi i32 [ 6379, %7 ], [ %5, %4 ]
%10 = tail call i8* @getenv(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%11 = tail call i8* @getenv(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%12 = tail call i8* @getenv(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
%13 = tail call i32 @initSignal(i32 %9, i8* %10, i8* %11, i8* %12)
ret void
}