#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;

/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ callrpc(char *, int, int, int, int /*<<< orphan*/, char *,
                           int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *, int, ...);
scalar_t__ xdr_int;
int main(int argn, char *argc[]) {
  int run_mode = 0;
  int test_status = 0;
  int progNum = atoi(argc[2]);
  int intSnd;
  double dblSnd;
  long lngSnd;
  char *strSnd;
  int intRec;
  double dblRec;
  long lngRec;
  char *strRec;
  intSnd = 1;
  callrpc(argc[1], progNum, 1, 5000, (xdrproc_t)xdr_int, (char *)&intSnd,
          (xdrproc_t)xdr_int, (char *)&intRec);
  if (intSnd != intRec)
    test_status = 1;
  if (run_mode == 1)
    printf("Send (int) : %d, Received : %d\n", intSnd, intRec);
  printf("%d\n", test_status);
  return test_status;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x1c(%rbp)
movl   $0x1,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x1c(%rbp),%esi
mov    0x2e6b(%rip),%rax
mov    (%rax),%rax
mov    %eax,%r8d
lea    -0x20(%rbp),%r9
mov    0x2e5a(%rip),%rax
mov    (%rax),%rax
mov    %eax,%r10d
lea    -0x3c(%rbp),%rax
mov    $0x1,%edx
mov    $0x1388,%ecx
mov    %r10d,(%rsp)
mov    %rax,0x8(%rsp)
call   1050 <callrpc@plt>
mov    -0x20(%rbp),%eax
cmp    -0x3c(%rbp),%eax
je     11c3 <main+0x93>
movl   $0x1,-0x18(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    11e1 <main+0xb1>
mov    -0x20(%rbp),%esi
mov    -0x3c(%rbp),%edx
lea    0xe26(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xe31(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    0x10(%rsi),%rdi
call   1040 <atoi@plt>
movl   $0x1,0x8(%rsp)
mov    0x8(%rbx),%rdi
mov    0x2e94(%rip),%rcx
mov    (%rcx),%r8d
lea    0xc(%rsp),%rbx
lea    0x8(%rsp),%r9
mov    %eax,%esi
mov    $0x1,%edx
mov    $0x1388,%ecx
push   %rbx
push   %r8
call   1050 <callrpc@plt>
add    $0x10,%rsp
mov    0x8(%rsp),%eax
xor    %ebx,%ebx
cmp    0xc(%rsp),%eax
setne  %bl
lea    0xe73(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@xdr_int = global i64 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*
%9 = bitcast i32* %4 to i8*
store i32 1, i32* %3
%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 5000, i32 %13, i8* %8, i32 %13, i8* %9)
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = icmp ne i32 %15, %16
%18 = zext i1 %17 to i32
%19 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %18)
ret i32 %18
}