#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 *);
int /*<<< orphan*/ clnt_perrno(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;
  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);
  clnt_perrno(rslt);
  test_status = 0;
  printf("%d\n", test_status);
  return test_status;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%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)
cmpl   $0x1,-0x14(%rbp)
jne    11ec <main+0x9c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe4e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%esi
lea    0xe4a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x30(%rbp),%rsi
lea    0xe45(%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    0x2dc6(%rip),%rax
mov    (%rax),%rax
mov    %eax,%edx
lea    -0x40(%rbp),%rcx
mov    0x2db6(%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_perrno@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xdbc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x50,%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_perrno@plt>
lea    0xe49(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%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
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
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 2
%16 = load i8*, i8** %15
%17 = call i32 @atoi(i8* %16)
store i32 %17, i32* %8
%18 = bitcast [16 x i8]* %9 to i8*
store i32* null, i32** %10
store i32 -1, i32* %12
%19 = load i32, i32* %6
%20 = icmp eq i32 %19, 1
br i1 %20, label %21, label %30
21: ; preds = %2
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 1
%24 = load i8*, i8** %23
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %24)
%26 = load i32, i32* %8
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %26)
%28 = getelementptr inbounds [16 x i8], [16 x i8]* %9, i64 0, i64 0
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %28)
br label %30
30: ; preds = %21, %2
%31 = getelementptr inbounds %struct.timeval, %struct.timeval* %13, i32 0, i32 0
store i32 1, i32* %31
%32 = getelementptr inbounds %struct.timeval, %struct.timeval* %13, i32 0, i32 1
store i32 1, i32* %32
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i64 1
%35 = load i8*, i8** %34
%36 = load i32, i32* %8
%37 = getelementptr inbounds [16 x i8], [16 x i8]* %9, i64 0, i64 0
%38 = call i32* @clnt_create(i8* %35, i32 %36, i32 1, i8* %37)
store i32* %38, i32** %10
%39 = load i32*, i32** %10
%40 = load i64, i64* @xdr_int
%41 = trunc i64 %40 to i32
%42 = bitcast i32* %12 to i8*
%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* %39, i32 1, i32 %41, i8* %42, i32 %44, i8* %45, i64 %47)
store i32 %48, i32* %11
%49 = load i32, i32* %11
%50 = call i32 @clnt_perrno(i32 %49)
store i32 0, i32* %7
%51 = load i32, i32* %7
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %51)
%53 = load i32, i32* %7
ret i32 %53
}

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 i32 @clnt_perrno(i32 %15)
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret i32 0
}