#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*/ xdrproc_t;
struct timeval {
  int tv_sec;
  int tv_usec;
};
typedef enum clnt_stat { ____Placeholder_clnt_stat } clnt_stat;
typedef int /*<<< orphan*/ CLIENT;

/* Variables and functions */
int atoi(char *);
int clnt_call(int /*<<< orphan*/ *, int, int /*<<< orphan*/, char *,
              int /*<<< orphan*/, char *, struct timeval);
int /*<<< orphan*/ *clnt_create(char *, int, int, char *);
char *clnt_sperrno(int);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ xdr_int;
int main(int argn, char *argc[]) {
  int run_mode = 0;
  int test_status = 1;
  int progNum = atoi(argc[2]);
  char nettype[16] = "udp";
  CLIENT *clnt = NULL;
  enum clnt_stat rslt;
  int recVar = -1;
  struct timeval total_timeout;
  char *chrRslt = NULL;
  if (run_mode == 1) {
    printf("Server : %s\n", argc[1]);
    printf("Server # %d\n", progNum);
    printf("Net : %s\n", nettype);
  }
  total_timeout.tv_sec = 1;
  total_timeout.tv_usec = 1;
  clnt = clnt_create(argc[1], progNum, 1, nettype);
  rslt = clnt_call((CLIENT *)clnt, 1, (xdrproc_t)xdr_int, (char *)&recVar,
                   (xdrproc_t)xdr_int, (char *)&recVar, total_timeout);
  chrRslt = clnt_sperrno(rslt);
  test_status = (chrRslt == NULL);
  printf("%d\n", test_status);
  return test_status;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%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   1070 <atoi@plt>
mov    %eax,-0x1c(%rbp)
mov    0xe75(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xe72(%rip),%rax
mov    %rax,-0x28(%rbp)
movq   $0x0,-0x38(%rbp)
movl   $0xffffffff,-0x40(%rbp)
movq   $0x0,-0x50(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    11f4 <main+0xa4>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe46(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%esi
lea    0xe42(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x30(%rbp),%rsi
lea    0xe3d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x48(%rbp)
movl   $0x1,-0x44(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x1c(%rbp),%esi
lea    -0x30(%rbp),%rcx
mov    $0x1,%edx
call   1040 <clnt_create@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    0x2dbe(%rip),%rax
mov    (%rax),%rax
mov    %eax,%edx
lea    -0x40(%rbp),%rcx
mov    0x2dae(%rip),%rax
mov    (%rax),%rax
mov    %eax,%r8d
lea    -0x40(%rbp),%r9
mov    -0x48(%rbp),%rax
mov    $0x1,%esi
mov    %rax,(%rsp)
call   1050 <clnt_call@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%edi
call   1060 <clnt_sperrno@plt>
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x50(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xda7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
mov    %rsi,%rbx
mov    0x10(%rsi),%rdi
call   1070 <atoi@plt>
movaps 0xe98(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movl   $0xffffffff,0xc(%rsp)
ff
mov    0x8(%rbx),%rdi
lea    0x10(%rsp),%rcx
mov    %eax,%esi
mov    $0x1,%edx
call   1040 <clnt_create@plt>
mov    0x2e57(%rip),%rcx
mov    (%rcx),%edx
movabs $0x100000001,%rcx
mov    %rcx,(%rsp)
lea    0xc(%rsp),%rcx
mov    %rax,%rdi
mov    $0x1,%esi
mov    %edx,%r8d
mov    %rcx,%r9
call   1050 <clnt_call@plt>
mov    %eax,%edi
call   1060 <clnt_sperrno@plt>
xor    %ebx,%ebx
test   %rax,%rax
sete   %bl
lea    0xe41(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebx,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
@__const.main.nettype = [16 x i8] c"udp\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [13 x i8] c"Server : %s\0A\00"
@.str.1 = [13 x i8] c"Server # %d\0A\00"
@.str.2 = [10 x i8] c"Net : %s\0A\00"
@xdr_int = global i64 0
@.str.3 = [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 [16 x i8]
%10 = alloca i32*
%11 = alloca i32
%12 = alloca i32
%13 = alloca %struct.timeval
%14 = alloca i8*
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
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 2
%17 = load i8*, i8** %16
%18 = call i32 @atoi(i8* %17)
store i32 %18, i32* %8
%19 = bitcast [16 x i8]* %9 to i8*
store i32* null, i32** %10
store i32 -1, i32* %12
store i8* null, i8** %14
%20 = load i32, i32* %6
%21 = icmp eq i32 %20, 1
br i1 %21, label %22, label %31
22: ; preds = %2
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 1
%25 = load i8*, i8** %24
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %25)
%27 = load i32, i32* %8
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %27)
%29 = getelementptr inbounds [16 x i8], [16 x i8]* %9, i64 0, i64 0
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %29)
br label %31
31: ; preds = %22, %2
%32 = getelementptr inbounds %struct.timeval, %struct.timeval* %13, i32 0, i32 0
store i32 1, i32* %32
%33 = getelementptr inbounds %struct.timeval, %struct.timeval* %13, i32 0, i32 1
store i32 1, i32* %33
%34 = load i8**, i8*** %5
%35 = getelementptr inbounds i8*, i8** %34, i64 1
%36 = load i8*, i8** %35
%37 = load i32, i32* %8
%38 = getelementptr inbounds [16 x i8], [16 x i8]* %9, i64 0, i64 0
%39 = call i32* @clnt_create(i8* %36, i32 %37, i32 1, i8* %38)
store i32* %39, i32** %10
%40 = load i32*, i32** %10
%41 = load i64, i64* @xdr_int
%42 = trunc i64 %41 to i32
%43 = bitcast i32* %12 to i8*
%44 = load i64, i64* @xdr_int
%45 = trunc i64 %44 to i32
%46 = bitcast i32* %12 to i8*
%47 = bitcast %struct.timeval* %13 to i64*
%48 = load i64, i64* %47
%49 = call i32 @clnt_call(i32* %40, i32 1, i32 %42, i8* %43, i32 %45, i8* %46, i64 %48)
store i32 %49, i32* %11
%50 = load i32, i32* %11
%51 = call i8* @clnt_sperrno(i32 %50)
store i8* %51, i8** %14
%52 = load i8*, i8** %14
%53 = icmp eq i8* %52, null
%54 = zext i1 %53 to i32
store i32 %54, i32* %7
%55 = load i32, i32* %7
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %55)
%57 = load i32, i32* %7
ret i32 %57
}

LLVM IR (-O2):
@__const.main.nettype = [16 x i8] c"udp\00\00\00\00\00\00\00\00\00\00\00\00\00"
@xdr_int = global i64 0
@.str.3 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [16 x i8]
%4 = alloca i32
%5 = getelementptr inbounds i8*, i8** %1, i64 2
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
%8 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%9 = bitcast i32* %4 to i8*
store i32 -1, i32* %4
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = call i32* @clnt_create(i8* %11, i32 %7, i32 1, i8* %8)
%13 = load i64, i64* @xdr_int
%14 = trunc i64 %13 to i32
%15 = call i32 @clnt_call(i32* %12, i32 1, i32 %14, i8* %9, i32 %14, i8* %9, i64 4294967297)
%16 = call i8* @clnt_sperrno(i32 %15)
%17 = icmp eq i8* %16, null
%18 = zext i1 %17 to i32
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %18)
ret i32 %18
}