#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_PROGNOTREGISTERED;
int atoi(char *);
int 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 = 1;
  int progNum = atoi(argc[2]);
  enum clnt_stat cs;
  int var_snd = 0;
  cs = callrpc(argc[1], 667, 1, 1, (xdrproc_t)xdr_int, (char *)&var_snd,
               (xdrproc_t)xdr_int, (char *)&var_snd);
  test_status = (cs != RPC_PROGNOTREGISTERED);
  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   1040 <atoi@plt>
mov    %eax,-0x1c(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    0x2e6e(%rip),%rax
mov    (%rax),%rax
mov    %eax,%r8d
lea    -0x24(%rbp),%r9
mov    0x2e5d(%rip),%rax
mov    (%rax),%rax
mov    %eax,%r10d
lea    -0x24(%rbp),%rax
mov    $0x29b,%esi
mov    $0x1,%ecx
mov    %ecx,%edx
mov    %r10d,(%rsp)
mov    %rax,0x8(%rsp)
call   1050 <callrpc@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    0x2e24(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xe2d(%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
movl   $0x0,0xc(%rsp)
mov    0x8(%rsi),%rdi
mov    0x2eb0(%rip),%rax
mov    (%rax),%r8d
lea    0xc(%rsp),%r9
mov    $0x29b,%esi
mov    $0x1,%edx
mov    $0x1,%ecx
push   %r9
push   %r8
call   1040 <callrpc@plt>
add    $0x10,%rsp
mov    0x2e7d(%rip),%rcx
xor    %ebx,%ebx
cmp    (%rcx),%eax
setne  %bl
lea    0xe8f(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@xdr_int = global i64 0
@RPC_PROGNOTREGISTERED = global i32 0
@.str = [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 0, i32* %10
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = load i64, i64* @xdr_int
%19 = trunc i64 %18 to i32
%20 = bitcast i32* %10 to i8*
%21 = load i64, i64* @xdr_int
%22 = trunc i64 %21 to i32
%23 = bitcast i32* %10 to i8*
%24 = call i32 @callrpc(i8* %17, i32 667, i32 1, i32 1, i32 %19, i8* %20, i32 %22, i8* %23)
store i32 %24, i32* %9
%25 = load i32, i32* %9
%26 = load i32, i32* @RPC_PROGNOTREGISTERED
%27 = icmp ne i32 %25, %26
%28 = zext i1 %27 to i32
store i32 %28, i32* %7
%29 = load i32, i32* %7
%30 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %29)
%31 = load i32, i32* %7
ret i32 %31
}

LLVM IR (-O2):
@xdr_int = global i64 0
@RPC_PROGNOTREGISTERED = global i32 0
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = load i64, i64* @xdr_int
%8 = trunc i64 %7 to i32
%9 = call i32 @callrpc(i8* %6, i32 667, i32 1, i32 1, i32 %8, i8* %4, i32 %8, i8* %4)
%10 = load i32, i32* @RPC_PROGNOTREGISTERED
%11 = icmp ne i32 %9, %10
%12 = zext i1 %11 to i32
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
ret i32 %12
}