#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 const *, 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 = 1;
  if (run_mode == 1) {
    printf("progNum : %d\n", progNum);
  }
  cs = callrpc((const char *)argc[1], progNum, 1, 2, (xdrproc_t)xdr_int,
               (char *)&varSnd, (xdrproc_t)xdr_int, (char *)&varSnd);
  test_status = varSnd;
  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   $0x1,-0x24(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    1194 <main+0x54>
mov    -0x1c(%rbp),%esi
lea    0xe71(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x1c(%rbp),%esi
mov    0x2e42(%rip),%rax
mov    (%rax),%rax
mov    %eax,%r8d
lea    -0x24(%rbp),%r9
mov    0x2e31(%rip),%rax
mov    (%rax),%rax
mov    %eax,%r10d
lea    -0x24(%rbp),%rax
mov    $0x1,%edx
mov    $0x2,%ecx
mov    %r10d,(%rsp)
mov    %rax,0x8(%rsp)
call   1060 <callrpc@plt>
mov    %eax,-0x20(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x20(%rbp),%eax
mov    0x2df4(%rip),%rcx
cmp    (%rcx),%eax
je     11fc <main+0xbc>
mov    -0x20(%rbp),%edi
call   1040 <clnt_perrno@plt>
mov    -0x18(%rbp),%esi
lea    0xe04(%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   $0x1,0xc(%rsp)
mov    0x8(%rbx),%rdi
mov    0x2e84(%rip),%rcx
mov    (%rcx),%r8d
lea    0xc(%rsp),%r9
mov    %eax,%esi
mov    $0x1,%edx
mov    $0x2,%ecx
push   %r9
push   %r8
call   1060 <callrpc@plt>
add    $0x10,%rsp
mov    0xc(%rsp),%ebx
mov    0x2e50(%rip),%rcx
cmp    (%rcx),%eax
je     119b <main+0x5b>
mov    %eax,%edi
call   1040 <clnt_perrno@plt>
lea    0xe5e(%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
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
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 2
%13 = load i8*, i8** %12
%14 = call i32 @atoi(i8* %13)
store i32 %14, i32* %8
store i32 1, i32* %10
%15 = load i32, i32* %6
%16 = icmp eq i32 %15, 1
br i1 %16, label %17, label %20
17: ; preds = %2
%18 = load i32, i32* %8
%19 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %18)
br label %20
20: ; preds = %17, %2
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 1
%23 = load i8*, i8** %22
%24 = load i32, i32* %8
%25 = load i64, i64* @xdr_int
%26 = trunc i64 %25 to i32
%27 = bitcast i32* %10 to i8*
%28 = load i64, i64* @xdr_int
%29 = trunc i64 %28 to i32
%30 = bitcast i32* %10 to i8*
%31 = call i32 @callrpc(i8* %23, i32 %24, i32 1, i32 2, i32 %26, i8* %27, i32 %29, i8* %30)
store i32 %31, i32* %9
%32 = load i32, i32* %10
store i32 %32, i32* %7
%33 = load i32, i32* %9
%34 = load i32, i32* @RPC_SUCCESS
%35 = icmp ne i32 %33, %34
br i1 %35, label %36, label %39
36: ; preds = %20
%37 = load i32, i32* %9
%38 = call i32 @clnt_perrno(i32 %37)
br label %39
39: ; preds = %36, %20
%40 = load i32, i32* %7
%41 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %40)
%42 = load i32, i32* %7
ret i32 %42
}

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 = getelementptr inbounds i8*, i8** %1, i64 2
%5 = load i8*, i8** %4
%6 = tail call i32 @atoi(i8* %5)
%7 = bitcast i32* %3 to i8*
store i32 1, i32* %3
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = load i64, i64* @xdr_int
%11 = trunc i64 %10 to i32
%12 = call i32 @callrpc(i8* %9, i32 %6, i32 1, i32 2, i32 %11, i8* %7, i32 %11, i8* %7)
%13 = load i32, i32* %3
%14 = load i32, i32* @RPC_SUCCESS
%15 = icmp eq i32 %12, %14
br i1 %15, label %18, label %16
16: ; preds = %2
%17 = call i32 @clnt_perrno(i32 %12)
br label %18
18: ; preds = %16, %2
%19 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %13)
ret i32 %13
}