#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 /*<<< 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 = 5000000;
  int port = 600;
  SVCXPRT *transp = NULL;
  pmap_unset(progNum, 1);
  if (run_mode) {
    printf("Before creation\n");
  }
  transp = svcudp_create(RPC_ANYSOCK);
  pmap_set(progNum, 1, IPPROTO_UDP, port);
  test_status = !pmap_unset(progNum, 1);
  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)
movl   $0x4c4b40,-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     119f <main+0x5f>
lea    0xe68(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0x2e42(%rip),%rax
mov    (%rax),%edi
call   1030 <svcudp_create@plt>
mov    %rax,-0x28(%rbp)
mov    -0x1c(%rbp),%edi
mov    0x2e15(%rip),%rax
mov    (%rax),%edx
mov    -0x20(%rbp),%ecx
mov    $0x1,%esi
call   1060 <pmap_set@plt>
mov    -0x1c(%rbp),%edi
mov    $0x1,%esi
call   1040 <pmap_unset@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xe20(%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    $0x4c4b40,%edi
mov    $0x1,%esi
call   1040 <pmap_unset@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1030 <svcudp_create@plt>
mov    0x2e6b(%rip),%rax
mov    (%rax),%edx
mov    $0x4c4b40,%edi
mov    $0x1,%esi
mov    $0x258,%ecx
call   1060 <pmap_set@plt>
mov    $0x4c4b40,%edi
mov    $0x1,%esi
call   1040 <pmap_unset@plt>
xor    %ebx,%ebx
test   %eax,%eax
sete   %bl
lea    0xe68(%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
store i32 5000000, i32* %8
store i32 600, i32* %9
store i32* null, i32** %10
%11 = load i32, i32* %8
%12 = call i32 @pmap_unset(i32 %11, i32 1)
%13 = load i32, i32* %6
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %2
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %17
17: ; preds = %15, %2
%18 = load i32, i32* @RPC_ANYSOCK
%19 = call i32* @svcudp_create(i32 %18)
store i32* %19, i32** %10
%20 = load i32, i32* %8
%21 = load i32, i32* @IPPROTO_UDP
%22 = load i32, i32* %9
%23 = call i32 @pmap_set(i32 %20, i32 1, i32 %21, i32 %22)
%24 = load i32, i32* %8
%25 = call i32 @pmap_unset(i32 %24, i32 1)
%26 = icmp ne i32 %25, 0
%27 = xor i1 %26, true
%28 = zext i1 %27 to i32
store i32 %28, i32* %7
%29 = load i32, i32* %7
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %29)
%31 = load i32, i32* %7
ret i32 %31
}

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 readnone %1) {
%3 = tail call i32 @pmap_unset(i32 5000000, i32 1)
%4 = load i32, i32* @RPC_ANYSOCK
%5 = tail call i32* @svcudp_create(i32 %4)
%6 = load i32, i32* @IPPROTO_UDP
%7 = tail call i32 @pmap_set(i32 5000000, i32 1, i32 %6, i32 600)
%8 = tail call i32 @pmap_unset(i32 5000000, i32 1)
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 %10
}