#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*/ printf(char *, int);
int /*<<< orphan*/ svc_destroy(int /*<<< orphan*/ *);
int /*<<< orphan*/ *svcfd_create(int, int, int);
int /*<<< orphan*/ xprt_register(int /*<<< orphan*/ *);
int main(void) {
  int test_status = 1;
  SVCXPRT *svcr = NULL;
  int fd = 0;
  svcr = svcfd_create(fd, 1024, 1024);
  if (svcr == NULL)
    return test_status;
  xprt_register(svcr);
  test_status = 0;
  svc_destroy(svcr);
  printf("%d\n", test_status);
  return test_status;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    $0x400,%edx
mov    %edx,%esi
call   1060 <svcfd_create@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    118e <main+0x4e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    11bc <main+0x7c>
mov    -0x10(%rbp),%rdi
call   1050 <xprt_register@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <svc_destroy@plt>
mov    -0x8(%rbp),%esi
lea    0xe4f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %edi,%edi
mov    $0x400,%esi
mov    $0x400,%edx
call   1060 <svcfd_create@plt>
test   %rax,%rax
je     117e <main+0x3e>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <xprt_register@plt>
mov    %rbx,%rdi
call   1040 <svc_destroy@plt>
lea    0xe8b(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
jmp    1183 <main+0x43>
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32* null, i32** %3
store i32 0, i32* %4
%5 = load i32, i32* %4
%6 = call i32* @svcfd_create(i32 %5, i32 1024, i32 1024)
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = icmp eq i32* %7, null
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = load i32, i32* %2
store i32 %10, i32* %1
br label %19
11: ; preds = %0
%12 = load i32*, i32** %3
%13 = call i32 @xprt_register(i32* %12)
store i32 0, i32* %2
%14 = load i32*, i32** %3
%15 = call i32 @svc_destroy(i32* %14)
%16 = load i32, i32* %2
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %16)
%18 = load i32, i32* %2
store i32 %18, i32* %1
br label %19
19: ; preds = %11, %9
%20 = load i32, i32* %1
ret i32 %20
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32* @svcfd_create(i32 0, i32 1024, i32 1024)
%2 = icmp eq i32* %1, null
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = tail call i32 @xprt_register(i32* %1)
%5 = tail call i32 @svc_destroy(i32* %1)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
br label %7
7: ; preds = %0, %3
%8 = phi i32 [ 0, %3 ], [ 1, %0 ]
ret i32 %8
}