#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 stat {
  int st_mode;
};
struct sockaddr_un {
  int /*<<< orphan*/ sun_family;
  int /*<<< orphan*/ sun_path;
};
struct sockaddr_in6 {
  int /*<<< orphan*/ sin6_port;
  int /*<<< orphan*/ sin6_addr;
};
struct sockaddr_in {
  int /*<<< orphan*/ sin_port;
  int /*<<< orphan*/ sin_addr;
};
struct sockaddr {
  int sa_family;
};
typedef int /*<<< orphan*/ sockname;
typedef int socklen_t;

/* Variables and functions */
#define AF_INET 129
#define AF_INET6 128
int /*<<< orphan*/ AF_UNIX;
int S_IFSOCK;
int /*<<< orphan*/ inet_ntop(int, int /*<<< orphan*/ *, char *, int);
unsigned int ntohs(int /*<<< orphan*/);
char *path_prefix();
int snprintf(int /*<<< orphan*/, int, char *, char *, char const *,
             unsigned int);
int stat(int /*<<< orphan*/, struct stat *);
const char *addr_translate(struct sockaddr_un *sun, const struct sockaddr *addr,
                           socklen_t addrlen, int allow_anon) {
  const char *err;
  char sockname[64];
  const char *any_name;
  unsigned int port;
  switch (addr->sa_family) {
  case AF_INET:;
    struct sockaddr_in *sin = (void *)addr;
    err = "addrlen too short";
    if (addrlen < sizeof(*sin))
      goto err;
    err = "failed to print network address";
    if (!inet_ntop(addr->sa_family, &sin->sin_addr, sockname, sizeof(sockname)))
      goto err;
    any_name = "0.0.0.0";
    port = ntohs(sin->sin_port);
    break;
  case AF_INET6:;
    struct sockaddr_in6 *sin6 = (void *)addr;
    err = "addrlen too short";
    if (addrlen < sizeof(*sin6))
      goto err;
    err = "failed to print network address";
    if (!inet_ntop(addr->sa_family, &sin6->sin6_addr, sockname,
                   sizeof(sockname)))
      goto err;
    any_name = "::";
    port = ntohs(sin6->sin6_port);
    break;
  default:
    goto skip;
  }
  int do_specific = 1;
  if (allow_anon) {
    err = "Unix socket path truncated";
    if (snprintf(sun->sun_path, sizeof(sun->sun_path), "%s/[%s]:%u",
                 path_prefix(), any_name, port) >= sizeof(sun->sun_path))
      goto err;
    struct stat sb;
    int ret = stat(sun->sun_path, &sb);
    if (ret == 0 && sb.st_mode & S_IFSOCK)
      do_specific = 0;
  }
  if (do_specific) {
    err = "Unix socket path truncated";
    if (snprintf(sun->sun_path, sizeof(sun->sun_path), "%s/[%s]:%u",
                 path_prefix(), sockname, port) >= sizeof(sun->sun_path))
      goto err;
  }
  sun->sun_family = AF_UNIX;
  return NULL;
skip:
  return "";
err:
  return err;
}


x86 assembly (clang, -O0):
<addr_translate>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xa0(%rbp)
sub    $0x80,%eax
je     121d <addr_translate+0xcd>
jmp    1185 <addr_translate+0x35>
mov    -0xa0(%rbp),%eax
sub    $0x81,%eax
jne    129f <addr_translate+0x14f>
jmp    119b <addr_translate+0x4b>
mov    -0x18(%rbp),%rax
mov    %rax,-0x88(%rbp)
lea    0xe53(%rip),%rax
mov    %rax,-0x28(%rbp)
movslq -0x1c(%rbp),%rax
cmp    $0x8,%rax
jae    11c4 <addr_translate+0x74>
jmp    13e7 <addr_translate+0x297>
lea    0xe47(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
mov    -0x88(%rbp),%rsi
add    $0x4,%rsi
lea    -0x70(%rbp),%rdx
mov    $0x40,%ecx
call   1030 <inet_ntop@plt>
cmp    $0x0,%eax
jne    11fc <addr_translate+0xac>
jmp    13e7 <addr_translate+0x297>
lea    0xe2f(%rip),%rax
mov    %rax,-0x78(%rbp)
mov    -0x88(%rbp),%rax
mov    (%rax),%edi
call   1070 <ntohs@plt>
mov    %eax,-0x7c(%rbp)
jmp    12a4 <addr_translate+0x154>
mov    -0x18(%rbp),%rax
mov    %rax,-0x90(%rbp)
lea    0xdd1(%rip),%rax
mov    %rax,-0x28(%rbp)
movslq -0x1c(%rbp),%rax
cmp    $0x8,%rax
jae    1246 <addr_translate+0xf6>
jmp    13e7 <addr_translate+0x297>
lea    0xdc5(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
mov    -0x90(%rbp),%rsi
add    $0x4,%rsi
lea    -0x70(%rbp),%rdx
mov    $0x40,%ecx
call   1030 <inet_ntop@plt>
cmp    $0x0,%eax
jne    127e <addr_translate+0x12e>
jmp    13e7 <addr_translate+0x297>
lea    0xdb5(%rip),%rax
mov    %rax,-0x78(%rbp)
mov    -0x90(%rbp),%rax
mov    (%rax),%edi
call   1070 <ntohs@plt>
mov    %eax,-0x7c(%rbp)
jmp    12a4 <addr_translate+0x154>
jmp    13d7 <addr_translate+0x287>
movl   $0x1,-0x94(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     1357 <addr_translate+0x207>
lea    0xd7e(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0xa4(%rbp)
mov    $0x0,%al
call   1050 <path_prefix@plt>
mov    -0xa4(%rbp),%edi
mov    %rax,%rcx
mov    -0x78(%rbp),%r8
mov    -0x7c(%rbp),%r9d
mov    $0x4,%esi
lea    0xd64(%rip),%rdx
call   1040 <snprintf@plt>
cltq
cmp    $0x4,%rax
jb     130a <addr_translate+0x1ba>
jmp    13e7 <addr_translate+0x297>
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%edi
lea    -0x98(%rbp),%rsi
call   1060 <stat@plt>
mov    %eax,-0x9c(%rbp)
cmpl   $0x0,-0x9c(%rbp)
jne    1352 <addr_translate+0x202>
mov    -0x98(%rbp),%eax
mov    0x2c9b(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1352 <addr_translate+0x202>
movl   $0x0,-0x94(%rbp)
jmp    1357 <addr_translate+0x207>
cmpl   $0x0,-0x94(%rbp)
je     13bb <addr_translate+0x26b>
lea    0xcd2(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0xa8(%rbp)
mov    $0x0,%al
call   1050 <path_prefix@plt>
mov    -0xa8(%rbp),%edi
mov    %rax,%rcx
lea    -0x70(%rbp),%r8
mov    -0x7c(%rbp),%r9d
mov    $0x4,%esi
lea    0xcb8(%rip),%rdx
call   1040 <snprintf@plt>
cltq
cmp    $0x4,%rax
jb     13b6 <addr_translate+0x266>
jmp    13e7 <addr_translate+0x297>
jmp    13bb <addr_translate+0x26b>
mov    0x2c26(%rip),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movq   $0x0,-0x8(%rbp)
jmp    13ef <addr_translate+0x29f>
lea    0xc5b(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13ef <addr_translate+0x29f>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addr_translate>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x50,%rsp
mov    %ecx,%ebp
mov    %rsi,%rbx
mov    %rdi,%r15
mov    (%rsi),%eax
cmp    $0x80,%eax
je     11a2 <addr_translate+0x52>
cmp    $0x81,%eax
jne    11b3 <addr_translate+0x63>
cmp    $0x8,%edx
jb     11a7 <addr_translate+0x57>
lea    0x4(%rbx),%rsi
lea    0x10(%rsp),%rdx
mov    $0x81,%edi
mov    $0x40,%ecx
call   1030 <inet_ntop@plt>
test   %eax,%eax
je     1278 <addr_translate+0x128>
lea    0xe92(%rip),%r12
jmp    11e6 <addr_translate+0x96>
cmp    $0x8,%edx
jae    11bf <addr_translate+0x6f>
lea    0xe52(%rip),%rax
jmp    128f <addr_translate+0x13f>
lea    0xe7f(%rip),%rax
jmp    128f <addr_translate+0x13f>
lea    0x4(%rbx),%rsi
lea    0x10(%rsp),%rdx
mov    $0x80,%edi
mov    $0x40,%ecx
call   1030 <inet_ntop@plt>
test   %eax,%eax
je     1278 <addr_translate+0x128>
lea    0xe54(%rip),%r12
mov    (%rbx),%edi
call   1070 <ntohs@plt>
mov    %eax,%r14d
test   %ebp,%ebp
je     1241 <addr_translate+0xf1>
mov    0x4(%r15),%ebx
xor    %eax,%eax
call   1050 <path_prefix@plt>
lea    0xe52(%rip),%rdx
mov    %ebx,%edi
mov    $0x4,%esi
mov    %rax,%rcx
mov    %r12,%r8
mov    %r14d,%r9d
call   1040 <snprintf@plt>
cmp    $0x3,%eax
ja     126f <addr_translate+0x11f>
mov    0x4(%r15),%edi
lea    0x8(%rsp),%rsi
call   1060 <stat@plt>
test   %eax,%eax
jne    1241 <addr_translate+0xf1>
mov    0x2d9f(%rip),%rax
mov    (%rax),%eax
test   %eax,0x8(%rsp)
jne    1281 <addr_translate+0x131>
mov    0x4(%r15),%ebx
xor    %eax,%eax
call   1050 <path_prefix@plt>
lea    0xe05(%rip),%rdx
lea    0x10(%rsp),%r8
mov    %ebx,%edi
mov    $0x4,%esi
mov    %rax,%rcx
mov    %r14d,%r9d
call   1040 <snprintf@plt>
cmp    $0x3,%eax
jbe    1281 <addr_translate+0x131>
lea    0xdc7(%rip),%rax
jmp    128f <addr_translate+0x13f>
lea    0xd93(%rip),%rax
jmp    128f <addr_translate+0x13f>
mov    0x2d60(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%r15)
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.sockaddr_un = type { i32, i32 }
%struct.sockaddr = type { i32 }
%struct.sockaddr_in = type { i32, i32 }
%struct.sockaddr_in6 = type { i32, i32 }
%struct.stat = type { i32 }
@.str = [18 x i8] c"addrlen too short\00"
@.str.1 = [32 x i8] c"failed to print network address\00"
@.str.2 = [8 x i8] c"0.0.0.0\00"
@.str.3 = [3 x i8] c"::\00"
@.str.4 = [27 x i8] c"Unix socket path truncated\00"
@.str.5 = [11 x i8] c"%s/[%s]:%u\00"
@S_IFSOCK = global i32 0
@AF_UNIX = global i32 0
@.str.6 = [1 x i8] zeroinitializer
define i8* @addr_translate(%struct.sockaddr_un* %0, %struct.sockaddr* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca %struct.sockaddr_un*
%7 = alloca %struct.sockaddr*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
%11 = alloca [64 x i8]
%12 = alloca i8*
%13 = alloca i32
%14 = alloca %struct.sockaddr_in*
%15 = alloca %struct.sockaddr_in6*
%16 = alloca i32
%17 = alloca %struct.stat
%18 = alloca i32
store %struct.sockaddr_un* %0, %struct.sockaddr_un** %6
store %struct.sockaddr* %1, %struct.sockaddr** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
%19 = load %struct.sockaddr*, %struct.sockaddr** %7
%20 = getelementptr inbounds %struct.sockaddr, %struct.sockaddr* %19, i32 0, i32 0
%21 = load i32, i32* %20
switch i32 %21, label %68 [
i32 129, label %22
i32 128, label %45
]
22: ; preds = %4
%23 = load %struct.sockaddr*, %struct.sockaddr** %7
%24 = bitcast %struct.sockaddr* %23 to i8*
%25 = bitcast i8* %24 to %struct.sockaddr_in*
store %struct.sockaddr_in* %25, %struct.sockaddr_in** %14
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8** %10
%26 = load i32, i32* %8
%27 = sext i32 %26 to i64
%28 = icmp ult i64 %27, 8
br i1 %28, label %29, label %30
29: ; preds = %22
br label %118
30: ; preds = %22
store i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i8** %10
%31 = load %struct.sockaddr*, %struct.sockaddr** %7
%32 = getelementptr inbounds %struct.sockaddr, %struct.sockaddr* %31, i32 0, i32 0
%33 = load i32, i32* %32
%34 = load %struct.sockaddr_in*, %struct.sockaddr_in** %14
%35 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %34, i32 0, i32 1
%36 = getelementptr inbounds [64 x i8], [64 x i8]* %11, i64 0, i64 0
%37 = call i32 @inet_ntop(i32 %33, i32* %35, i8* %36, i32 64)
%38 = icmp ne i32 %37, 0
br i1 %38, label %40, label %39
39: ; preds = %30
br label %118
40: ; preds = %30
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8** %12
%41 = load %struct.sockaddr_in*, %struct.sockaddr_in** %14
%42 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %41, i32 0, i32 0
%43 = load i32, i32* %42
%44 = call i32 @ntohs(i32 %43)
store i32 %44, i32* %13
br label %69
45: ; preds = %4
%46 = load %struct.sockaddr*, %struct.sockaddr** %7
%47 = bitcast %struct.sockaddr* %46 to i8*
%48 = bitcast i8* %47 to %struct.sockaddr_in6*
store %struct.sockaddr_in6* %48, %struct.sockaddr_in6** %15
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8** %10
%49 = load i32, i32* %8
%50 = sext i32 %49 to i64
%51 = icmp ult i64 %50, 8
br i1 %51, label %52, label %53
52: ; preds = %45
br label %118
53: ; preds = %45
store i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i8** %10
%54 = load %struct.sockaddr*, %struct.sockaddr** %7
%55 = getelementptr inbounds %struct.sockaddr, %struct.sockaddr* %54, i32 0, i32 0
%56 = load i32, i32* %55
%57 = load %struct.sockaddr_in6*, %struct.sockaddr_in6** %15
%58 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %57, i32 0, i32 1
%59 = getelementptr inbounds [64 x i8], [64 x i8]* %11, i64 0, i64 0
%60 = call i32 @inet_ntop(i32 %56, i32* %58, i8* %59, i32 64)
%61 = icmp ne i32 %60, 0
br i1 %61, label %63, label %62
62: ; preds = %53
br label %118
63: ; preds = %53
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8** %12
%64 = load %struct.sockaddr_in6*, %struct.sockaddr_in6** %15
%65 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %64, i32 0, i32 0
%66 = load i32, i32* %65
%67 = call i32 @ntohs(i32 %66)
store i32 %67, i32* %13
br label %69
68: ; preds = %4
br label %117
69: ; preds = %63, %40
store i32 1, i32* %16
%70 = load i32, i32* %9
%71 = icmp ne i32 %70, 0
br i1 %71, label %72, label %98
72: ; preds = %69
store i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i8** %10
%73 = load %struct.sockaddr_un*, %struct.sockaddr_un** %6
%74 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %73, i32 0, i32 1
%75 = load i32, i32* %74
%76 = call i8* (...) @path_prefix()
%77 = load i8*, i8** %12
%78 = load i32, i32* %13
%79 = call i32 @snprintf(i32 %75, i32 4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i8* %76, i8* %77, i32 %78)
%80 = sext i32 %79 to i64
%81 = icmp uge i64 %80, 4
br i1 %81, label %82, label %83
82: ; preds = %72
br label %118
83: ; preds = %72
%84 = load %struct.sockaddr_un*, %struct.sockaddr_un** %6
%85 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %84, i32 0, i32 1
%86 = load i32, i32* %85
%87 = call i32 @stat(i32 %86, %struct.stat* %17)
store i32 %87, i32* %18
%88 = load i32, i32* %18
%89 = icmp eq i32 %88, 0
br i1 %89, label %90, label %97
90: ; preds = %83
%91 = getelementptr inbounds %struct.stat, %struct.stat* %17, i32 0, i32 0
%92 = load i32, i32* %91
%93 = load i32, i32* @S_IFSOCK
%94 = and i32 %92, %93
%95 = icmp ne i32 %94, 0
br i1 %95, label %96, label %97
96: ; preds = %90
store i32 0, i32* %16
br label %97
97: ; preds = %96, %90, %83
br label %98
98: ; preds = %97, %69
%99 = load i32, i32* %16
%100 = icmp ne i32 %99, 0
br i1 %100, label %101, label %113
101: ; preds = %98
store i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i8** %10
%102 = load %struct.sockaddr_un*, %struct.sockaddr_un** %6
%103 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %102, i32 0, i32 1
%104 = load i32, i32* %103
%105 = call i8* (...) @path_prefix()
%106 = getelementptr inbounds [64 x i8], [64 x i8]* %11, i64 0, i64 0
%107 = load i32, i32* %13
%108 = call i32 @snprintf(i32 %104, i32 4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i8* %105, i8* %106, i32 %107)
%109 = sext i32 %108 to i64
%110 = icmp uge i64 %109, 4
br i1 %110, label %111, label %112
111: ; preds = %101
br label %118
112: ; preds = %101
br label %113
113: ; preds = %112, %98
%114 = load i32, i32* @AF_UNIX
%115 = load %struct.sockaddr_un*, %struct.sockaddr_un** %6
%116 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %115, i32 0, i32 0
store i32 %114, i32* %116
store i8* null, i8** %5
br label %120
117: ; preds = %68
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.6, i64 0, i64 0), i8** %5
br label %120
118: ; preds = %111, %82, %62, %52, %39, %29
%119 = load i8*, i8** %10
store i8* %119, i8** %5
br label %120
120: ; preds = %118, %117, %113
%121 = load i8*, i8** %5
ret i8* %121
}

LLVM IR (-O2):
%struct.sockaddr_un = type { i32, i32 }
%struct.sockaddr = type { i32 }
%struct.stat = type { i32 }
@.str = [18 x i8] c"addrlen too short\00"
@.str.1 = [32 x i8] c"failed to print network address\00"
@.str.2 = [8 x i8] c"0.0.0.0\00"
@.str.3 = [3 x i8] c"::\00"
@.str.4 = [27 x i8] c"Unix socket path truncated\00"
@.str.5 = [11 x i8] c"%s/[%s]:%u\00"
@S_IFSOCK = global i32 0
@AF_UNIX = global i32 0
@.str.6 = [1 x i8] zeroinitializer
define i8* @addr_translate(%struct.sockaddr_un* nocapture %0, %struct.sockaddr* %1, i32 %2, i32 %3) {
%5 = alloca [64 x i8]
%6 = alloca %struct.stat
%7 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%8 = getelementptr inbounds %struct.sockaddr, %struct.sockaddr* %1, i64 0, i32 0
%9 = load i32, i32* %8
switch i32 %9, label %55 [
i32 129, label %10
i32 128, label %16
]
10: ; preds = %4
%11 = icmp ult i32 %2, 8
br i1 %11, label %55, label %12
12: ; preds = %10
%13 = getelementptr inbounds %struct.sockaddr, %struct.sockaddr* %1, i64 1, i32 0
%14 = call i32 @inet_ntop(i32 129, i32* %13, i8* %7, i32 64)
%15 = icmp eq i32 %14, 0
br i1 %15, label %55, label %22
16: ; preds = %4
%17 = icmp ult i32 %2, 8
br i1 %17, label %55, label %18
18: ; preds = %16
%19 = getelementptr inbounds %struct.sockaddr, %struct.sockaddr* %1, i64 1, i32 0
%20 = call i32 @inet_ntop(i32 128, i32* %19, i8* %7, i32 64)
%21 = icmp eq i32 %20, 0
br i1 %21, label %55, label %22
22: ; preds = %18, %12
%23 = phi i8* [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), %12 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), %18 ]
%24 = load i32, i32* %8
%25 = call i32 @ntohs(i32 %24)
%26 = icmp eq i32 %3, 0
br i1 %26, label %46, label %27
27: ; preds = %22
%28 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %0, i64 0, i32 1
%29 = load i32, i32* %28
%30 = call i8* (...) @path_prefix()
%31 = call i32 @snprintf(i32 %29, i32 4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i8* %30, i8* %23, i32 %25)
%32 = icmp ugt i32 %31, 3
br i1 %32, label %55, label %33
33: ; preds = %27
%34 = bitcast %struct.stat* %6 to i8*
%35 = load i32, i32* %28
%36 = call i32 @stat(i32 %35, %struct.stat* %6)
%37 = icmp eq i32 %36, 0
br i1 %37, label %38, label %44
38: ; preds = %33
%39 = getelementptr inbounds %struct.stat, %struct.stat* %6, i64 0, i32 0
%40 = load i32, i32* %39
%41 = load i32, i32* @S_IFSOCK
%42 = and i32 %41, %40
%43 = icmp eq i32 %42, 0
br i1 %43, label %44, label %45
44: ; preds = %33, %38
br label %46
45: ; preds = %38
br label %52
46: ; preds = %22, %44
%47 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %0, i64 0, i32 1
%48 = load i32, i32* %47
%49 = call i8* (...) @path_prefix()
%50 = call i32 @snprintf(i32 %48, i32 4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i8* %49, i8* %7, i32 %25)
%51 = icmp ugt i32 %50, 3
br i1 %51, label %55, label %52
52: ; preds = %45, %46
%53 = load i32, i32* @AF_UNIX
%54 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %0, i64 0, i32 0
store i32 %53, i32* %54
br label %55
55: ; preds = %10, %12, %16, %18, %27, %46, %4, %52
%56 = phi i8* [ null, %52 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.6, i64 0, i64 0), %4 ], [ getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), %16 ], [ getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), %27 ], [ getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), %46 ], [ getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), %18 ], [ getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), %10 ], [ getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), %12 ]
ret i8* %56
}