#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 *);
int /*<<< orphan*/ clnt_perror(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;
  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);
  clnt_perror(clnt, "#SUCCESS");
  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   1050 <clnt_create@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    0x2dbe(%rip),%rax
mov    (%rax),%rax
mov    %eax,%edx
mov    0x2dba(%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   1060 <clnt_call@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x38(%rbp),%rdi
lea    0xdda(%rip),%rsi
call   1040 <clnt_perror@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xdb6(%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   1050 <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   1060 <clnt_call@plt>
lea    0xe47(%rip),%rsi
mov    %rbx,%rdi
call   1040 <clnt_perror@plt>
lea    0xe41(%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_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
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_void
%41 = trunc i64 %40 to i32
%42 = load i64, i64* @xdr_int
%43 = trunc i64 %42 to i32
%44 = bitcast i32* %12 to i8*
%45 = bitcast %struct.timeval* %13 to i64*
%46 = load i64, i64* %45
%47 = call i32 @clnt_call(i32* %39, i32 1, i32 %41, i32* null, i32 %43, i8* %44, i64 %46)
store i32 %47, i32* %11
%48 = load i32*, i32** %10
%49 = call i32 @clnt_perror(i32* %48, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %7
%50 = load i32, i32* %7
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %50)
%52 = load i32, i32* %7
ret i32 %52
}

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