#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*/,
              int /*<<< orphan*/ *, int /*<<< orphan*/, char *, struct timeval);
int /*<<< orphan*/ *clnt_create(char *, int, int, char *);
char *clnt_sperror(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ xdr_int;
scalar_t__ xdr_void;
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_void, NULL,
                   (xdrproc_t)xdr_int, (char *)&recVar, total_timeout);
  chrRslt = clnt_sperror(clnt, "#SUCCESS");
  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   1060 <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    0x2db6(%rip),%rax
mov    (%rax),%rax
mov    %eax,%edx
mov    0x2db2(%rip),%rax
mov    (%rax),%rax
mov    %eax,%r8d
lea    -0x40(%rbp),%r9
mov    -0x48(%rbp),%rax
mov    $0x1,%esi
xor    %ecx,%ecx
mov    %rax,(%rsp)
call   1050 <clnt_call@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x38(%rbp),%rdi
lea    0xdd2(%rip),%rsi
call   1070 <clnt_sperror@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    0xda1(%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   1060 <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    %rax,%rbx
mov    0x2e4c(%rip),%rax
mov    (%rax),%edx
mov    0x2e4b(%rip),%rax
mov    (%rax),%r8d
movabs $0x100000001,%rax
mov    %rax,(%rsp)
lea    0xc(%rsp),%r9
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %ecx,%ecx
call   1050 <clnt_call@plt>
lea    0xe47(%rip),%rsi
mov    %rbx,%rdi
call   1070 <clnt_sperror@plt>
xor    %ebx,%ebx
test   %rax,%rax
sete   %bl
lea    0xe39(%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_void = global i64 0
@xdr_int = global i64 0
@.str.3 = [9 x i8] c"#SUCCESS\00"
@.str.4 = [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_void
%42 = trunc i64 %41 to i32
%43 = load i64, i64* @xdr_int
%44 = trunc i64 %43 to i32
%45 = bitcast i32* %12 to i8*
%46 = bitcast %struct.timeval* %13 to i64*
%47 = load i64, i64* %46
%48 = call i32 @clnt_call(i32* %40, i32 1, i32 %42, i32* null, i32 %44, i8* %45, i64 %47)
store i32 %48, i32* %11
%49 = load i32*, i32** %10
%50 = call i8* @clnt_sperror(i32* %49, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
store i8* %50, i8** %14
%51 = load i8*, i8** %14
%52 = icmp eq i8* %51, null
%53 = zext i1 %52 to i32
store i32 %53, i32* %7
%54 = load i32, i32* %7
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %54)
%56 = load i32, i32* %7
ret i32 %56
}

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_void = global i64 0
@xdr_int = global i64 0
@.str.3 = [9 x i8] c"#SUCCESS\00"
@.str.4 = [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_void
%14 = trunc i64 %13 to i32
%15 = load i64, i64* @xdr_int
%16 = trunc i64 %15 to i32
%17 = call i32 @clnt_call(i32* %12, i32 1, i32 %14, i32* null, i32 %16, i8* %9, i64 4294967297)
%18 = call i8* @clnt_sperror(i32* %12, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
%19 = icmp eq i8* %18, null
%20 = zext i1 %19 to i32
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %20)
ret i32 %20
}