#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*/ SVCXPRT;

/* Variables and functions */
int /*<<< orphan*/ IPPROTO_UDP;
int /*<<< orphan*/ RPC_ANYSOCK;
int atoi(char *);
int /*<<< orphan*/ pmap_set(int, int, int /*<<< orphan*/, int);
int /*<<< orphan*/ pmap_unset(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ *svcudp_create(int /*<<< orphan*/);
int main(int argn, char *argc[]) {
  int run_mode = 0;
  int test_status = 1;
  int progNum = atoi(argc[2]);
  int port = 600;
  SVCXPRT *transp = NULL;
  pmap_unset(progNum, 1);
  if (run_mode) {
    printf("Before creation\n");
  }
  transp = svcudp_create(RPC_ANYSOCK);
  test_status = !pmap_set(progNum, 1, IPPROTO_UDP, port);
  printf("%d\n", test_status);
  return test_status;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%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)
movl   $0x258,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x1c(%rbp),%edi
mov    $0x1,%esi
call   1040 <pmap_unset@plt>
cmpl   $0x0,-0x14(%rbp)
je     11b8 <main+0x68>
lea    0xe4f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0x2e29(%rip),%rax
mov    (%rax),%edi
call   1030 <svcudp_create@plt>
mov    %rax,-0x28(%rbp)
mov    -0x1c(%rbp),%edi
mov    0x2dfc(%rip),%rax
mov    (%rax),%edx
mov    -0x20(%rbp),%ecx
mov    $0x1,%esi
call   1070 <pmap_set@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xe14(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x10(%rsi),%rdi
call   1060 <atoi@plt>
mov    %eax,%ebx
mov    %eax,%edi
mov    $0x1,%esi
call   1040 <pmap_unset@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
call   1030 <svcudp_create@plt>
mov    0x2e53(%rip),%rax
mov    (%rax),%edx
mov    %ebx,%edi
mov    $0x1,%esi
mov    $0x258,%ecx
call   1070 <pmap_set@plt>
xor    %ebx,%ebx
test   %eax,%eax
sete   %bl
lea    0xe62(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Before creation\0A\00"
@RPC_ANYSOCK = global i32 0
@IPPROTO_UDP = 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 600, i32* %9
store i32* null, i32** %10
%15 = load i32, i32* %8
%16 = call i32 @pmap_unset(i32 %15, i32 1)
%17 = load i32, i32* %6
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %2
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %21
21: ; preds = %19, %2
%22 = load i32, i32* @RPC_ANYSOCK
%23 = call i32* @svcudp_create(i32 %22)
store i32* %23, i32** %10
%24 = load i32, i32* %8
%25 = load i32, i32* @IPPROTO_UDP
%26 = load i32, i32* %9
%27 = call i32 @pmap_set(i32 %24, i32 1, i32 %25, i32 %26)
%28 = icmp ne i32 %27, 0
%29 = xor i1 %28, true
%30 = zext i1 %29 to i32
store i32 %30, i32* %7
%31 = load i32, i32* %7
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %31)
%33 = load i32, i32* %7
ret i32 %33
}

LLVM IR (-O2):
@RPC_ANYSOCK = global i32 0
@IPPROTO_UDP = global i32 0
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 2
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = tail call i32 @pmap_unset(i32 %5, i32 1)
%7 = load i32, i32* @RPC_ANYSOCK
%8 = tail call i32* @svcudp_create(i32 %7)
%9 = load i32, i32* @IPPROTO_UDP
%10 = tail call i32 @pmap_set(i32 %5, i32 1, i32 %9, i32 600)
%11 = icmp eq i32 %10, 0
%12 = zext i1 %11 to i32
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %12)
ret i32 %12
}