#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 */
typedef int /*<<< orphan*/ CLIENT;

/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ *clntraw_create(int, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argn, char *argc[]) {
  int run_mode = 0;
  int test_status = 1;
  int progNum = atoi(argc[2]);
  CLIENT *clnt = NULL;
  clnt = clntraw_create(progNum, 1);
  if (run_mode == 1) {
    printf("CLIENT : %p\n", clnt);
  }
  test_status = (clnt != NULL) ? 0 : 1;
  printf("%d\n", test_status);
  return test_status;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x1c(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x1c(%rbp),%edi
mov    $0x1,%esi
call   1030 <clntraw_create@plt>
mov    %rax,-0x28(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    1199 <main+0x69>
mov    -0x28(%rbp),%rax
mov    %eax,%esi
lea    0xe6c(%rip),%rdi
call   1040 <printf@plt>
mov    -0x28(%rbp),%rdx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xe55(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x10(%rsi),%rdi
call   1050 <atoi@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1030 <clntraw_create@plt>
xor    %ebx,%ebx
test   %rax,%rax
sete   %bl
lea    0xeab(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"CLIENT : %p\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 1, i32* %7
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 2
%12 = load i8*, i8** %11
%13 = call i32 @atoi(i8* %12)
store i32 %13, i32* %8
store i32* null, i32** %9
%14 = load i32, i32* %8
%15 = call i32* @clntraw_create(i32 %14, i32 1)
store i32* %15, i32** %9
%16 = load i32, i32* %6
%17 = icmp eq i32 %16, 1
br i1 %17, label %18, label %22
18: ; preds = %2
%19 = load i32*, i32** %9
%20 = ptrtoint i32* %19 to i32
%21 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %20)
br label %22
22: ; preds = %18, %2
%23 = load i32*, i32** %9
%24 = icmp ne i32* %23, null
%25 = zext i1 %24 to i64
%26 = select i1 %24, i32 0, i32 1
store i32 %26, i32* %7
%27 = load i32, i32* %7
%28 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %27)
%29 = load i32, i32* %7
ret i32 %29
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 2
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = tail call i32* @clntraw_create(i32 %5, i32 1)
%7 = icmp eq i32* %6, null
%8 = zext i1 %7 to i32
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 %8
}