#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;
  int intRec;
  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    $0x40,%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    -0x24(%rbp),%rax
mov    $0x1,%edx
mov    $0x1388,%ecx
mov    %r10d,(%rsp)
mov    %rax,0x8(%rsp)
call   1050 <callrpc@plt>
mov    -0x20(%rbp),%eax
cmp    -0x24(%rbp),%eax
je     11c3 <main+0x93>
movl   $0x1,-0x18(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    11e1 <main+0xb1>
mov    -0x20(%rbp),%esi
mov    -0x24(%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    $0x40,%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 i32
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
%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* %9
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = load i32, i32* %8
%19 = load i64, i64* @xdr_int
%20 = trunc i64 %19 to i32
%21 = bitcast i32* %9 to i8*
%22 = load i64, i64* @xdr_int
%23 = trunc i64 %22 to i32
%24 = bitcast i32* %10 to i8*
%25 = call i32 @callrpc(i8* %17, i32 %18, i32 1, i32 5000, i32 %20, i8* %21, i32 %23, i8* %24)
%26 = load i32, i32* %9
%27 = load i32, i32* %10
%28 = icmp ne i32 %26, %27
br i1 %28, label %29, label %30
29: ; preds = %2
store i32 1, i32* %7
br label %30
30: ; preds = %29, %2
%31 = load i32, i32* %6
%32 = icmp eq i32 %31, 1
br i1 %32, label %33, label %37
33: ; preds = %30
%34 = load i32, i32* %9
%35 = load i32, i32* %10
%36 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %34, i32 %35)
br label %37
37: ; preds = %33, %30
%38 = load i32, i32* %7
%39 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %38)
%40 = load i32, i32* %7
ret i32 %40
}

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
}