#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;
typedef enum clnt_stat { ____Placeholder_clnt_stat } clnt_stat;

/* Variables and functions */
int RPC_SUCCESS;
int atoi(char *);
int callrpc(char *, int, int, int, int /*<<< orphan*/, char *,
            int /*<<< orphan*/, char *);
int /*<<< orphan*/ clnt_perrno(int);
int /*<<< orphan*/ printf(char *, int);
scalar_t__ xdr_int;
int main(int argn, char *argc[]) {
  int run_mode = 0;
  int test_status = 1;
  int progNum = atoi(argc[2]);
  enum clnt_stat cs;
  int varSnd = 10;
  int varRec = -1;
  if (run_mode == 1) {
    printf("progNum : %d\n", progNum);
  }
  cs = callrpc(argc[1], progNum, 1, 1, (xdrproc_t)xdr_int, (char *)&varSnd,
               (xdrproc_t)xdr_int, (char *)&varRec);
  test_status = (cs == RPC_SUCCESS) ? 0 : 1;
  if (cs != RPC_SUCCESS)
    clnt_perrno(cs);
  printf("%d\n", test_status);
  return test_status;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%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)
movl   $0xa,-0x24(%rbp)
movl   $0xffffffff,-0x28(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    119b <main+0x5b>
mov    -0x1c(%rbp),%esi
lea    0xe6a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x1c(%rbp),%esi
mov    0x2e3b(%rip),%rax
mov    (%rax),%rax
mov    %eax,%r8d
lea    -0x24(%rbp),%r9
mov    0x2e2a(%rip),%rax
mov    (%rax),%rax
mov    %eax,%r10d
lea    -0x28(%rbp),%rax
mov    $0x1,%ecx
mov    %ecx,%edx
mov    %r10d,(%rsp)
mov    %rax,0x8(%rsp)
call   1060 <callrpc@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%edx
mov    0x2df6(%rip),%rax
mov    (%rax),%esi
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x20(%rbp),%eax
mov    0x2ddb(%rip),%rcx
cmp    (%rcx),%eax
je     1215 <main+0xd5>
mov    -0x20(%rbp),%edi
call   1040 <clnt_perrno@plt>
mov    -0x18(%rbp),%esi
lea    0xdeb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    0x10(%rsi),%rdi
call   1050 <atoi@plt>
movl   $0xa,0xc(%rsp)
movl   $0xffffffff,0x8(%rsp)
ff
mov    0x8(%rbx),%rdi
mov    0x2e7c(%rip),%rcx
mov    (%rcx),%r8d
lea    0x8(%rsp),%rbx
lea    0xc(%rsp),%r9
mov    %eax,%esi
mov    $0x1,%edx
mov    $0x1,%ecx
push   %rbx
push   %r8
call   1060 <callrpc@plt>
add    $0x10,%rsp
mov    0x2e48(%rip),%rcx
xor    %ebx,%ebx
cmp    (%rcx),%eax
setne  %bl
je     11a8 <main+0x68>
mov    %eax,%edi
call   1040 <clnt_perrno@plt>
lea    0xe51(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"progNum : %d\0A\00"
@xdr_int = global i64 0
@RPC_SUCCESS = global i32 0
@.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
%10 = alloca i32
%11 = 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
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 2
%14 = load i8*, i8** %13
%15 = call i32 @atoi(i8* %14)
store i32 %15, i32* %8
store i32 10, i32* %10
store i32 -1, i32* %11
%16 = load i32, i32* %6
%17 = icmp eq i32 %16, 1
br i1 %17, label %18, label %21
18: ; preds = %2
%19 = load i32, i32* %8
%20 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %19)
br label %21
21: ; preds = %18, %2
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 1
%24 = load i8*, i8** %23
%25 = load i32, i32* %8
%26 = load i64, i64* @xdr_int
%27 = trunc i64 %26 to i32
%28 = bitcast i32* %10 to i8*
%29 = load i64, i64* @xdr_int
%30 = trunc i64 %29 to i32
%31 = bitcast i32* %11 to i8*
%32 = call i32 @callrpc(i8* %24, i32 %25, i32 1, i32 1, i32 %27, i8* %28, i32 %30, i8* %31)
store i32 %32, i32* %9
%33 = load i32, i32* %9
%34 = load i32, i32* @RPC_SUCCESS
%35 = icmp eq i32 %33, %34
%36 = zext i1 %35 to i64
%37 = select i1 %35, i32 0, i32 1
store i32 %37, i32* %7
%38 = load i32, i32* %9
%39 = load i32, i32* @RPC_SUCCESS
%40 = icmp ne i32 %38, %39
br i1 %40, label %41, label %44
41: ; preds = %21
%42 = load i32, i32* %9
%43 = call i32 @clnt_perrno(i32 %42)
br label %44
44: ; preds = %41, %21
%45 = load i32, i32* %7
%46 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %45)
%47 = load i32, i32* %7
ret i32 %47
}

LLVM IR (-O2):
@xdr_int = global i64 0
@RPC_SUCCESS = global i32 0
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca i32
%5 = getelementptr inbounds i8*, i8** %1, i64 2
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
%8 = bitcast i32* %3 to i8*
store i32 10, i32* %3
%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 = load i64, i64* @xdr_int
%13 = trunc i64 %12 to i32
%14 = call i32 @callrpc(i8* %11, i32 %7, i32 1, i32 1, i32 %13, i8* %8, i32 %13, i8* %9)
%15 = load i32, i32* @RPC_SUCCESS
%16 = icmp ne i32 %14, %15
%17 = zext i1 %16 to i32
%18 = icmp eq i32 %14, %15
br i1 %18, label %21, label %19
19: ; preds = %2
%20 = call i32 @clnt_perrno(i32 %14)
br label %21
21: ; preds = %19, %2
%22 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %17)
ret i32 %17
}