#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 sockaddr_in {
  int sin_port;
  int /*<<< orphan*/ sin_family;
};
struct servent {
  int s_port;
  char *s_proto;
  char **s_aliases;
  char *s_name;
};

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
#define EAI_MEMORY 129
#define EAI_SYSTEM 128
int EINVAL;
int ENOENT;
int ENOMEM;
int ERANGE;
int /*<<< orphan*/ NI_DGRAM;
int getnameinfo(void *, int, int /*<<< orphan*/, int /*<<< orphan*/, char *,
                size_t, int /*<<< orphan*/);
scalar_t__ strcmp(char const *, char *);
int getservbyport_r(int port, const char *prots, struct servent *se, char *buf,
                    size_t buflen, struct servent **res) {
  int i;
  struct sockaddr_in sin = {
      .sin_family = AF_INET,
      .sin_port = port,
  };
  if (!prots) {
    int r = getservbyport_r(port, "tcp", se, buf, buflen, res);
    if (r)
      r = getservbyport_r(port, "udp", se, buf, buflen, res);
    return r;
  }
  i = (uintptr_t)buf & sizeof(char *) - 1;
  if (!i)
    i = sizeof(char *);
  if (buflen < 3 * sizeof(char *) - i)
    return ERANGE;
  buf += sizeof(char *) - i;
  buflen -= sizeof(char *) - i;
  if (strcmp(prots, "tcp") && strcmp(prots, "udp"))
    return EINVAL;
  se->s_port = port;
  se->s_proto = (char *)prots;
  se->s_aliases = (void *)buf;
  buf += 2 * sizeof(char *);
  buflen -= 2 * sizeof(char *);
  se->s_aliases[1] = 0;
  se->s_aliases[0] = se->s_name = buf;
  switch (getnameinfo((void *)&sin, sizeof sin, 0, 0, buf, buflen,
                      strcmp(prots, "udp") ? 0 : NI_DGRAM)) {
  case EAI_MEMORY:
  case EAI_SYSTEM:
    return ENOMEM;
  default:
    return ENOENT;
  case 0:
    break;
  }
  *res = se;
  return 0;
}


x86 assembly (clang, -O0):
<getservbyport_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    0x2e8c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x3c(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    11c5 <getservbyport_r+0x95>
mov    -0x8(%rbp),%edi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
lea    0xe7a(%rip),%rsi
call   1050 <getservbyport_r@plt>
mov    %eax,-0x44(%rbp)
cmpl   $0x0,-0x44(%rbp)
je     11ba <getservbyport_r+0x8a>
mov    -0x8(%rbp),%edi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
lea    0xe52(%rip),%rsi
call   1050 <getservbyport_r@plt>
mov    %eax,-0x44(%rbp)
mov    -0x44(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    13a4 <getservbyport_r+0x274>
mov    -0x20(%rbp),%rax
and    $0x7,%rax
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
jne    11e1 <getservbyport_r+0xb1>
movl   $0x8,-0x34(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rdx
mov    $0x18,%ecx
sub    %rdx,%rcx
cmp    %rcx,%rax
jae    120b <getservbyport_r+0xdb>
mov    0x2ddf(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    13a4 <getservbyport_r+0x274>
movslq -0x34(%rbp),%rcx
mov    $0x8,%eax
sub    %rcx,%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
movslq -0x34(%rbp),%rax
mov    $0x8,%ecx
sub    %rax,%rcx
mov    -0x28(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xdbf(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     127b <getservbyport_r+0x14b>
mov    -0x10(%rbp),%rdi
lea    0xda9(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     127b <getservbyport_r+0x14b>
mov    0x2d57(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    13a4 <getservbyport_r+0x274>
mov    -0x8(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,0x10(%rax)
mov    -0x20(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x20(%rbp)
mov    -0x28(%rbp),%rax
sub    $0x10,%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%rax
movq   $0x0,0x8(%rax)
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,0x18(%rax)
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rcx,(%rax)
lea    -0x40(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xd06(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     1317 <getservbyport_r+0x1e7>
xor    %eax,%eax
mov    %eax,-0x64(%rbp)
jmp    1323 <getservbyport_r+0x1f3>
mov    0x2c92(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x64(%rbp)
mov    -0x50(%rbp),%r9
mov    -0x58(%rbp),%r8
mov    -0x60(%rbp),%rdi
mov    -0x64(%rbp),%ecx
mov    %rsp,%rax
mov    %ecx,(%rax)
mov    $0x8,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <getnameinfo@plt>
mov    %eax,%ecx
mov    %ecx,-0x68(%rbp)
test   %eax,%eax
je     138d <getservbyport_r+0x25d>
jmp    1357 <getservbyport_r+0x227>
mov    -0x68(%rbp),%eax
add    $0xffffff80,%eax
sub    $0x1,%eax
ja     137c <getservbyport_r+0x24c>
jmp    136b <getservbyport_r+0x23b>
mov    0x2c5e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    13a4 <getservbyport_r+0x274>
mov    0x2c35(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    13a4 <getservbyport_r+0x274>
jmp    1392 <getservbyport_r+0x262>
mov    -0x18(%rbp),%rcx
mov    -0x30(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getservbyport_r>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r9,%rbx
mov    %rcx,%r15
mov    %rdx,%rbp
mov    %edi,%r13d
mov    %edi,0x8(%rsp)
mov    0x2e93(%rip),%rax
mov    (%rax),%eax
mov    %eax,0xc(%rsp)
test   %rsi,%rsi
je     118e <getservbyport_r+0x5e>
mov    %rbx,0x10(%rsp)
mov    %r15d,%eax
and    $0x7,%eax
mov    $0x8,%r14d
cmovne %eax,%r14d
mov    $0x18,%eax
sub    %r14,%rax
cmp    %r8,%rax
jbe    11da <getservbyport_r+0xaa>
mov    0x2e57(%rip),%rax
jmp    12ab <getservbyport_r+0x17b>
lea    0xe6b(%rip),%rsi
mov    %r13d,%edi
mov    %rbp,%rdx
mov    %r15,%rcx
mov    %r8,%r14
mov    %rbx,%r9
call   1050 <getservbyport_r@plt>
test   %eax,%eax
je     12a0 <getservbyport_r+0x170>
lea    0xe4c(%rip),%rsi
mov    %r13d,%edi
mov    %rbp,%rdx
mov    %r15,%rcx
mov    %r14,%r8
mov    %rbx,%r9
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <getservbyport_r@plt>
mov    %rsi,%r12
mov    %r8,%rbx
lea    0xe19(%rip),%rsi
mov    %r12,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1214 <getservbyport_r+0xe4>
lea    0xe09(%rip),%rsi
mov    %r12,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1214 <getservbyport_r+0xe4>
mov    0x2db9(%rip),%rax
jmp    12ab <getservbyport_r+0x17b>
sub    %r14,%r15
add    $0x8,%r15
mov    %r13d,0x0(%rbp)
mov    %r12,0x8(%rbp)
mov    %r15,0x10(%rbp)
add    %rbx,%r14
add    $0xffffffffffffffe8,%r14
movq   $0x0,0x8(%r15)
add    $0x10,%r15
mov    %r15,0x18(%rbp)
mov    0x10(%rbp),%rax
mov    %r15,(%rax)
lea    0xdb8(%rip),%rsi
mov    %r12,%rdi
call   1040 <strcmp@plt>
mov    $0x0,%ecx
test   %rax,%rax
jne    1267 <getservbyport_r+0x137>
mov    0x2d4b(%rip),%rax
mov    (%rax),%ecx
mov    %ecx,(%rsp)
lea    0x8(%rsp),%rdi
mov    $0x8,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    %r15,%r8
mov    %r14,%r9
call   1030 <getnameinfo@plt>
lea    -0x80(%rax),%ecx
cmp    $0x2,%ecx
mov    0x10(%rsp),%rbx
jae    1299 <getservbyport_r+0x169>
mov    0x2d39(%rip),%rax
jmp    12ab <getservbyport_r+0x17b>
test   %eax,%eax
jne    12a4 <getservbyport_r+0x174>
mov    %rbp,(%rbx)
xor    %eax,%eax
jmp    12ad <getservbyport_r+0x17d>
mov    0x2d0d(%rip),%rax
mov    (%rax),%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.servent = type { i32, i8*, i8**, i8* }
%struct.sockaddr_in = type { i32, i32 }
@AF_INET = global i32 0
@.str = [4 x i8] c"tcp\00"
@.str.1 = [4 x i8] c"udp\00"
@ERANGE = global i32 0
@EINVAL = global i32 0
@NI_DGRAM = global i32 0
@ENOMEM = global i32 0
@ENOENT = global i32 0
define i32 @getservbyport_r(i32 %0, i8* %1, %struct.servent* %2, i8* %3, i64 %4, %struct.servent** %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca %struct.servent*
%11 = alloca i8*
%12 = alloca i64
%13 = alloca %struct.servent**
%14 = alloca i32
%15 = alloca %struct.sockaddr_in
%16 = alloca i32
store i32 %0, i32* %8
store i8* %1, i8** %9
store %struct.servent* %2, %struct.servent** %10
store i8* %3, i8** %11
store i64 %4, i64* %12
store %struct.servent** %5, %struct.servent*** %13
%17 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %15, i32 0, i32 0
%18 = load i32, i32* %8
store i32 %18, i32* %17
%19 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %15, i32 0, i32 1
%20 = load i32, i32* @AF_INET
store i32 %20, i32* %19
%21 = load i8*, i8** %9
%22 = icmp ne i8* %21, null
br i1 %22, label %41, label %23
23: ; preds = %6
%24 = load i32, i32* %8
%25 = load %struct.servent*, %struct.servent** %10
%26 = load i8*, i8** %11
%27 = load i64, i64* %12
%28 = load %struct.servent**, %struct.servent*** %13
%29 = call i32 @getservbyport_r(i32 %24, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), %struct.servent* %25, i8* %26, i64 %27, %struct.servent** %28)
store i32 %29, i32* %16
%30 = load i32, i32* %16
%31 = icmp ne i32 %30, 0
br i1 %31, label %32, label %39
32: ; preds = %23
%33 = load i32, i32* %8
%34 = load %struct.servent*, %struct.servent** %10
%35 = load i8*, i8** %11
%36 = load i64, i64* %12
%37 = load %struct.servent**, %struct.servent*** %13
%38 = call i32 @getservbyport_r(i32 %33, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), %struct.servent* %34, i8* %35, i64 %36, %struct.servent** %37)
store i32 %38, i32* %16
br label %39
39: ; preds = %32, %23
%40 = load i32, i32* %16
store i32 %40, i32* %7
br label %123
41: ; preds = %6
%42 = load i8*, i8** %11
%43 = ptrtoint i8* %42 to i64
%44 = and i64 %43, 7
%45 = trunc i64 %44 to i32
store i32 %45, i32* %14
%46 = load i32, i32* %14
%47 = icmp ne i32 %46, 0
br i1 %47, label %49, label %48
48: ; preds = %41
store i32 8, i32* %14
br label %49
49: ; preds = %48, %41
%50 = load i64, i64* %12
%51 = load i32, i32* %14
%52 = sext i32 %51 to i64
%53 = sub i64 24, %52
%54 = icmp ult i64 %50, %53
br i1 %54, label %55, label %57
55: ; preds = %49
%56 = load i32, i32* @ERANGE
store i32 %56, i32* %7
br label %123
57: ; preds = %49
%58 = load i32, i32* %14
%59 = sext i32 %58 to i64
%60 = sub i64 8, %59
%61 = load i8*, i8** %11
%62 = getelementptr inbounds i8, i8* %61, i64 %60
store i8* %62, i8** %11
%63 = load i32, i32* %14
%64 = sext i32 %63 to i64
%65 = sub i64 8, %64
%66 = load i64, i64* %12
%67 = sub i64 %66, %65
store i64 %67, i64* %12
%68 = load i8*, i8** %9
%69 = call i64 @strcmp(i8* %68, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%70 = icmp ne i64 %69, 0
br i1 %70, label %71, label %77
71: ; preds = %57
%72 = load i8*, i8** %9
%73 = call i64 @strcmp(i8* %72, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%74 = icmp ne i64 %73, 0
br i1 %74, label %75, label %77
75: ; preds = %71
%76 = load i32, i32* @EINVAL
store i32 %76, i32* %7
br label %123
77: ; preds = %71, %57
%78 = load i32, i32* %8
%79 = load %struct.servent*, %struct.servent** %10
%80 = getelementptr inbounds %struct.servent, %struct.servent* %79, i32 0, i32 0
store i32 %78, i32* %80
%81 = load i8*, i8** %9
%82 = load %struct.servent*, %struct.servent** %10
%83 = getelementptr inbounds %struct.servent, %struct.servent* %82, i32 0, i32 1
store i8* %81, i8** %83
%84 = load i8*, i8** %11
%85 = bitcast i8* %84 to i8**
%86 = load %struct.servent*, %struct.servent** %10
%87 = getelementptr inbounds %struct.servent, %struct.servent* %86, i32 0, i32 2
store i8** %85, i8*** %87
%88 = load i8*, i8** %11
%89 = getelementptr inbounds i8, i8* %88, i64 16
store i8* %89, i8** %11
%90 = load i64, i64* %12
%91 = sub i64 %90, 16
store i64 %91, i64* %12
%92 = load %struct.servent*, %struct.servent** %10
%93 = getelementptr inbounds %struct.servent, %struct.servent* %92, i32 0, i32 2
%94 = load i8**, i8*** %93
%95 = getelementptr inbounds i8*, i8** %94, i64 1
store i8* null, i8** %95
%96 = load i8*, i8** %11
%97 = load %struct.servent*, %struct.servent** %10
%98 = getelementptr inbounds %struct.servent, %struct.servent* %97, i32 0, i32 3
store i8* %96, i8** %98
%99 = load %struct.servent*, %struct.servent** %10
%100 = getelementptr inbounds %struct.servent, %struct.servent* %99, i32 0, i32 2
%101 = load i8**, i8*** %100
%102 = getelementptr inbounds i8*, i8** %101, i64 0
store i8* %96, i8** %102
%103 = bitcast %struct.sockaddr_in* %15 to i8*
%104 = load i8*, i8** %11
%105 = load i64, i64* %12
%106 = load i8*, i8** %9
%107 = call i64 @strcmp(i8* %106, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%108 = icmp ne i64 %107, 0
br i1 %108, label %109, label %110
109: ; preds = %77
br label %112
110: ; preds = %77
%111 = load i32, i32* @NI_DGRAM
br label %112
112: ; preds = %110, %109
%113 = phi i32 [ 0, %109 ], [ %111, %110 ]
%114 = call i32 @getnameinfo(i8* %103, i32 8, i32 0, i32 0, i8* %104, i64 %105, i32 %113)
switch i32 %114, label %117 [
i32 129, label %115
i32 128, label %115
i32 0, label %119
]
115: ; preds = %112, %112
%116 = load i32, i32* @ENOMEM
store i32 %116, i32* %7
br label %123
117: ; preds = %112
%118 = load i32, i32* @ENOENT
store i32 %118, i32* %7
br label %123
119: ; preds = %112
br label %120
120: ; preds = %119
%121 = load %struct.servent*, %struct.servent** %10
%122 = load %struct.servent**, %struct.servent*** %13
store %struct.servent* %121, %struct.servent** %122
store i32 0, i32* %7
br label %123
123: ; preds = %120, %117, %115, %75, %55, %39
%124 = load i32, i32* %7
ret i32 %124
}

LLVM IR (-O2):
%struct.servent = type { i32, i8*, i8**, i8* }
%struct.sockaddr_in = type { i32, i32 }
@AF_INET = global i32 0
@.str = [4 x i8] c"tcp\00"
@.str.1 = [4 x i8] c"udp\00"
@ERANGE = global i32 0
@EINVAL = global i32 0
@NI_DGRAM = global i32 0
@ENOMEM = global i32 0
@ENOENT = global i32 0
define i32 @getservbyport_r(i32 %0, i8* %1, %struct.servent* %2, i8* %3, i64 %4, %struct.servent** %5) {
%7 = alloca %struct.sockaddr_in
%8 = bitcast %struct.sockaddr_in* %7 to i8*
%9 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i64 0, i32 0
store i32 %0, i32* %9
%10 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i64 0, i32 1
%11 = load i32, i32* @AF_INET
store i32 %11, i32* %10
%12 = icmp eq i8* %1, null
br i1 %12, label %13, label %18
13: ; preds = %6
%14 = tail call i32 @getservbyport_r(i32 %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), %struct.servent* %2, i8* %3, i64 %4, %struct.servent** %5)
%15 = icmp eq i32 %14, 0
br i1 %15, label %61, label %16
16: ; preds = %13
%17 = tail call i32 @getservbyport_r(i32 %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), %struct.servent* %2, i8* %3, i64 %4, %struct.servent** %5)
br label %61
18: ; preds = %6
%19 = ptrtoint i8* %3 to i64
%20 = trunc i64 %19 to i32
%21 = and i32 %20, 7
%22 = icmp eq i32 %21, 0
%23 = select i1 %22, i32 8, i32 %21
%24 = zext i32 %23 to i64
%25 = sub nuw nsw i64 24, %24
%26 = icmp ugt i64 %25, %4
br i1 %26, label %27, label %29
27: ; preds = %18
%28 = load i32, i32* @ERANGE
br label %61
29: ; preds = %18
%30 = sub nuw nsw i64 8, %24
%31 = getelementptr inbounds i8, i8* %3, i64 %30
%32 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%33 = icmp eq i64 %32, 0
br i1 %33, label %39, label %34
34: ; preds = %29
%35 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%36 = icmp eq i64 %35, 0
br i1 %36, label %39, label %37
37: ; preds = %34
%38 = load i32, i32* @EINVAL
br label %61
39: ; preds = %34, %29
%40 = getelementptr inbounds %struct.servent, %struct.servent* %2, i64 0, i32 0
store i32 %0, i32* %40
%41 = getelementptr inbounds %struct.servent, %struct.servent* %2, i64 0, i32 1
store i8* %1, i8** %41
%42 = getelementptr inbounds %struct.servent, %struct.servent* %2, i64 0, i32 2
%43 = bitcast i8*** %42 to i8**
store i8* %31, i8** %43
%44 = getelementptr inbounds i8, i8* %31, i64 16
%45 = add i64 %24, %4
%46 = add i64 %45, -24
%47 = getelementptr inbounds i8, i8* %31, i64 8
%48 = bitcast i8* %47 to i8**
store i8* null, i8** %48
%49 = getelementptr inbounds %struct.servent, %struct.servent* %2, i64 0, i32 3
store i8* %44, i8** %49
%50 = load i8**, i8*** %42
store i8* %44, i8** %50
%51 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%52 = icmp eq i64 %51, 0
%53 = load i32, i32* @NI_DGRAM
%54 = select i1 %52, i32 %53, i32 0
%55 = call i32 @getnameinfo(i8* %8, i32 8, i32 0, i32 0, i8* %44, i64 %46, i32 %54)
switch i32 %55, label %58 [
i32 129, label %56
i32 128, label %56
i32 0, label %60
]
56: ; preds = %39, %39
%57 = load i32, i32* @ENOMEM
br label %61
58: ; preds = %39
%59 = load i32, i32* @ENOENT
br label %61
60: ; preds = %39
store %struct.servent* %2, %struct.servent** %5
br label %61
61: ; preds = %13, %16, %60, %58, %56, %37, %27
%62 = phi i32 [ %28, %27 ], [ %38, %37 ], [ %59, %58 ], [ 0, %60 ], [ %57, %56 ], [ %17, %16 ], [ 0, %13 ]
ret i32 %62
}