#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 */
struct rpc_err {
  scalar_t__ re_status;
};
typedef int /*<<< orphan*/ CLIENT;

/* Variables and functions */
scalar_t__ RPC_SUCCESS;
int atoi(char *);
int /*<<< orphan*/ *clnt_create(char *, int, int, char *);
int /*<<< orphan*/ clnt_geterr(int /*<<< orphan*/ *, struct rpc_err *);
int /*<<< orphan*/ printf(char *, int);
int main(int argn, char *argc[]) {
  int run_mode = 0;
  int test_status = 1;
  int progNum = atoi(argc[2]);
  char proto[8] = "udp";
  CLIENT *clnt = NULL;
  struct rpc_err err;
  clnt = clnt_create(argc[1], progNum, 1, proto);
  if (run_mode == 1) {
    printf("CLIENT : %p\n", clnt);
  }
  clnt_geterr(clnt, &err);
  test_status = !(err.re_status == RPC_SUCCESS);
  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   1060 <atoi@plt>
mov    %eax,-0x1c(%rbp)
mov    0xe85(%rip),%rax
mov    %rax,-0x24(%rbp)
movq   $0x0,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x1c(%rbp),%esi
lea    -0x24(%rbp),%rcx
mov    $0x1,%edx
call   1040 <clnt_create@plt>
mov    %rax,-0x30(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    11c0 <main+0x80>
mov    -0x30(%rbp),%rax
mov    %eax,%esi
lea    0xe4d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x30(%rbp),%rdi
lea    -0x38(%rbp),%rsi
call   1050 <clnt_geterr@plt>
mov    -0x38(%rbp),%rax
mov    0x2e10(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xe23(%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   1060 <atoi@plt>
movq   $0x706475,0x8(%rsp)
mov    0x8(%rbx),%rdi
lea    0x8(%rsp),%rcx
mov    %eax,%esi
mov    $0x1,%edx
call   1040 <clnt_create@plt>
mov    %rsp,%rsi
mov    %rax,%rdi
call   1050 <clnt_geterr@plt>
mov    (%rsp),%rax
mov    0x2e63(%rip),%rcx
xor    %ebx,%ebx
cmp    (%rcx),%rax
setne  %bl
lea    0xe6c(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.rpc_err = type { i64 }
@__const.main.proto = [8 x i8] c"udp\00\00\00\00\00"
@.str = [13 x i8] c"CLIENT : %p\0A\00"
@RPC_SUCCESS = global i64 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 [8 x i8]
%10 = alloca i32*
%11 = alloca %struct.rpc_err
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
%16 = bitcast [8 x i8]* %9 to i8*
store i32* null, i32** %10
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
%20 = load i32, i32* %8
%21 = getelementptr inbounds [8 x i8], [8 x i8]* %9, i64 0, i64 0
%22 = call i32* @clnt_create(i8* %19, i32 %20, i32 1, i8* %21)
store i32* %22, i32** %10
%23 = load i32, i32* %6
%24 = icmp eq i32 %23, 1
br i1 %24, label %25, label %29
25: ; preds = %2
%26 = load i32*, i32** %10
%27 = ptrtoint i32* %26 to i32
%28 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %27)
br label %29
29: ; preds = %25, %2
%30 = load i32*, i32** %10
%31 = call i32 @clnt_geterr(i32* %30, %struct.rpc_err* %11)
%32 = getelementptr inbounds %struct.rpc_err, %struct.rpc_err* %11, i32 0, i32 0
%33 = load i64, i64* %32
%34 = load i64, i64* @RPC_SUCCESS
%35 = icmp eq i64 %33, %34
%36 = xor i1 %35, true
%37 = zext i1 %36 to i32
store i32 %37, i32* %7
%38 = load i32, i32* %7
%39 = call 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):
%struct.rpc_err = type { i64 }
@RPC_SUCCESS = global i64 0
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i64
%4 = alloca %struct.rpc_err
%5 = getelementptr inbounds i8*, i8** %1, i64 2
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
%8 = bitcast i64* %3 to i8*
store i64 7365749, i64* %3
%9 = bitcast %struct.rpc_err* %4 to i8*
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = call i32* @clnt_create(i8* %11, i32 %7, i32 1, i8* %8)
%13 = call i32 @clnt_geterr(i32* %12, %struct.rpc_err* %4)
%14 = getelementptr inbounds %struct.rpc_err, %struct.rpc_err* %4, i64 0, i32 0
%15 = load i64, i64* %14
%16 = load i64, i64* @RPC_SUCCESS
%17 = icmp ne i64 %15, %16
%18 = zext i1 %17 to i32
%19 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %18)
ret i32 %18
}