#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_un {
  scalar_t__ sun_family;
  int /*<<< orphan*/ sun_path;
};
struct sockaddr {
  int dummy;
};
typedef int socklen_t;
typedef int /*<<< orphan*/ sockaddr;
typedef int mode_t;

/* Variables and functions */
scalar_t__ AF_UNIX;
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ SOCK_STREAM;
int SUN_LEN(struct sockaddr_un *);
int S_IRWXO;
int S_IXGRP;
int S_IXUSR;
int bind(int, struct sockaddr const *, int);
int /*<<< orphan*/ bzero(struct sockaddr_un *, int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int getsockname(int, struct sockaddr *, int *);
scalar_t__ getuid();
int listen(int, int);
int /*<<< orphan*/ perror(char *);
int socket(scalar_t__, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int strcmp(int /*<<< orphan*/, char const *);
int /*<<< orphan*/ strcpy(int /*<<< orphan*/, char const *);
int strncmp(int /*<<< orphan*/, char const *, int);
int umask(int);
int /*<<< orphan*/ unlink(char const *);
int main() {
  const char *sockname = "/test-nnnnnnnn-socket";
  struct sockaddr_un sockaddr;
  socklen_t socklen;
  mode_t mask;
  int status;
  int fd;
  if (getuid() == 0)
    return 125;
  (void)unlink(sockname);
  fd = socket(AF_UNIX, SOCK_STREAM, 0);
  if (fd < 0) {
    perror("socket");
    exit(EXIT_FAILURE);
  }
  bzero(&sockaddr, sizeof(sockaddr));
  sockaddr.sun_family = AF_UNIX;
  strcpy(sockaddr.sun_path, sockname);
  mask = umask(S_IXUSR | S_IXGRP | S_IRWXO);
  status = bind(fd, (const struct sockaddr *)&sockaddr, SUN_LEN(&sockaddr));
  if (status < 0) {
    perror("bind");
    exit(EXIT_FAILURE);
  }
  umask(mask);
  status = listen(fd, 50);
  if (status < 0) {
    perror("listen");
    exit(EXIT_FAILURE);
  }
  bzero(&sockaddr, sizeof(sockaddr));
  socklen = sizeof(sockaddr);
  status = getsockname(fd, (struct sockaddr *)&sockaddr, &socklen);
  if (status < 0) {
    perror("getsockname");
    exit(EXIT_FAILURE);
  }
  if (socklen != SUN_LEN(&sockaddr) + 1) {
    fprintf(stderr, "socklen: %d != %d + 1\n", socklen, SUN_LEN(&sockaddr));
    exit(EXIT_FAILURE);
  }
  if (sockaddr.sun_family != AF_UNIX) {
    fprintf(stderr, "! AF_UNIX\n");
    exit(EXIT_FAILURE);
  }
  if (socklen == sizeof(sockaddr) + 1)
    status = strncmp(sockaddr.sun_path, sockname, sizeof(sockaddr.sun_path));
  else
    status = strcmp(sockaddr.sun_path, sockname);
  if (status != 0) {
    fprintf(stderr, "! %s\n", sockname);
    exit(EXIT_FAILURE);
  }
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xdfa(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <getuid@plt>
cmp    $0x0,%rax
jne    1226 <main+0x36>
mov    $0x7d,%eax
add    $0x50,%rsp
pop    %rbp
ret
mov    -0x10(%rbp),%rdi
call   1030 <unlink@plt>
mov    0x2da2(%rip),%rax
mov    (%rax),%rdi
mov    0x2d78(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1110 <socket@plt>
mov    %eax,-0x30(%rbp)
cmpl   $0x0,-0x30(%rbp)
jge    1270 <main+0x80>
lea    0xdb2(%rip),%rdi
call   10c0 <perror@plt>
mov    0x2d47(%rip),%rax
mov    (%rax),%edi
call   10f0 <exit@plt>
lea    -0x20(%rbp),%rdi
mov    $0x10,%esi
call   10d0 <bzero@plt>
mov    0x2d53(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <strcpy@plt>
mov    0x2d41(%rip),%rax
mov    (%rax),%edi
mov    0x2d28(%rip),%rax
or     (%rax),%edi
mov    0x2d3f(%rip),%rax
or     (%rax),%edi
call   1090 <umask@plt>
mov    %eax,-0x28(%rbp)
mov    -0x30(%rbp),%eax
mov    %eax,-0x3c(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x38(%rbp)
lea    -0x20(%rbp),%rdi
call   1100 <SUN_LEN@plt>
mov    -0x3c(%rbp),%edi
mov    -0x38(%rbp),%rsi
mov    %eax,%edx
call   10b0 <bind@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jge    1307 <main+0x117>
lea    0xd22(%rip),%rdi
call   10c0 <perror@plt>
mov    0x2cb0(%rip),%rax
mov    (%rax),%edi
call   10f0 <exit@plt>
mov    -0x28(%rbp),%edi
call   1090 <umask@plt>
mov    -0x30(%rbp),%edi
mov    $0x32,%esi
call   10a0 <listen@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jge    1343 <main+0x153>
lea    0xceb(%rip),%rdi
call   10c0 <perror@plt>
mov    0x2c74(%rip),%rax
mov    (%rax),%edi
call   10f0 <exit@plt>
lea    -0x20(%rbp),%rdi
mov    $0x10,%esi
call   10d0 <bzero@plt>
movl   $0x10,-0x24(%rbp)
mov    -0x30(%rbp),%edi
lea    -0x20(%rbp),%rsi
lea    -0x24(%rbp),%rdx
call   10e0 <getsockname@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jge    138f <main+0x19f>
lea    0xca6(%rip),%rdi
call   10c0 <perror@plt>
mov    0x2c28(%rip),%rax
mov    (%rax),%edi
call   10f0 <exit@plt>
mov    -0x24(%rbp),%eax
mov    %eax,-0x40(%rbp)
lea    -0x20(%rbp),%rdi
call   1100 <SUN_LEN@plt>
mov    %eax,%ecx
mov    -0x40(%rbp),%eax
add    $0x1,%ecx
cmp    %ecx,%eax
je     13ed <main+0x1fd>
mov    0x2c0b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x48(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x44(%rbp)
lea    -0x20(%rbp),%rdi
call   1100 <SUN_LEN@plt>
mov    -0x48(%rbp),%edi
mov    -0x44(%rbp),%edx
mov    %eax,%ecx
lea    0xc56(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    0x2bca(%rip),%rax
mov    (%rax),%edi
call   10f0 <exit@plt>
mov    -0x20(%rbp),%rax
mov    0x2be0(%rip),%rcx
cmp    (%rcx),%rax
je     1426 <main+0x236>
mov    0x2bb8(%rip),%rax
mov    (%rax),%edi
lea    0xc34(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    0x2b91(%rip),%rax
mov    (%rax),%edi
call   10f0 <exit@plt>
movslq -0x24(%rbp),%rax
cmp    $0x11,%rax
jne    144d <main+0x25d>
mov    -0x18(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
mov    %eax,-0x2c(%rbp)
jmp    145c <main+0x26c>
mov    -0x18(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1070 <strcmp@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
je     148f <main+0x29f>
mov    0x2b53(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xbd6(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    0x2b28(%rip),%rax
mov    (%rax),%edi
call   10f0 <exit@plt>
mov    0x2b12(%rip),%rax
mov    (%rax),%edi
call   10f0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
xor    %eax,%eax
call   1060 <getuid@plt>
test   %rax,%rax
jne    1216 <main+0x26>
mov    $0x7d,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xde3(%rip),%rdi
call   1030 <unlink@plt>
mov    0x2daf(%rip),%r15
mov    (%r15),%rdi
mov    0x2d85(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1110 <socket@plt>
test   %eax,%eax
jns    124c <main+0x5c>
lea    0xdc8(%rip),%rdi
jmp    130f <main+0x11f>
mov    %eax,%ebx
lea    0x8(%rsp),%r14
mov    %r14,%rdi
mov    $0x10,%esi
call   10d0 <bzero@plt>
mov    (%r15),%rax
mov    %rax,0x8(%rsp)
mov    0x10(%rsp),%edi
lea    0xd8d(%rip),%rsi
call   1050 <strcpy@plt>
mov    0x2d61(%rip),%rax
mov    0x2d4a(%rip),%rcx
mov    (%rcx),%edi
or     (%rax),%edi
mov    0x2d5f(%rip),%rax
or     (%rax),%edi
call   1090 <umask@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1100 <SUN_LEN@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   10b0 <bind@plt>
test   %eax,%eax
jns    12bb <main+0xcb>
lea    0xd5d(%rip),%rdi
jmp    130f <main+0x11f>
mov    %ebp,%edi
call   1090 <umask@plt>
mov    %ebx,%edi
mov    $0x32,%esi
call   10a0 <listen@plt>
test   %eax,%eax
jns    12db <main+0xeb>
lea    0xd42(%rip),%rdi
jmp    130f <main+0x11f>
lea    0x8(%rsp),%rbp
mov    %rbp,%rdi
mov    $0x10,%esi
call   10d0 <bzero@plt>
movl   $0x10,0x4(%rsp)
lea    0x4(%rsp),%rdx
mov    %ebx,%edi
mov    %rbp,%rsi
call   10e0 <getsockname@plt>
test   %eax,%eax
jns    1322 <main+0x132>
lea    0xd13(%rip),%rdi
call   10c0 <perror@plt>
mov    0x2c95(%rip),%rax
mov    (%rax),%edi
call   10f0 <exit@plt>
mov    0x4(%rsp),%ebx
lea    0x8(%rsp),%rdi
call   1100 <SUN_LEN@plt>
add    $0x1,%eax
cmp    %eax,%ebx
jne    135f <main+0x16f>
mov    0x8(%rsp),%rax
cmp    (%r15),%rax
jne    138c <main+0x19c>
cmpl   $0x11,0x4(%rsp)
mov    0x10(%rsp),%edi
lea    0xcaf(%rip),%rsi
jne    13a8 <main+0x1b8>
mov    $0x4,%edx
call   1040 <strncmp@plt>
jmp    13ad <main+0x1bd>
mov    0x2c5a(%rip),%rax
mov    (%rax),%ebx
mov    0x4(%rsp),%ebp
lea    0x8(%rsp),%rdi
call   1100 <SUN_LEN@plt>
lea    0xcb1(%rip),%rsi
mov    %ebx,%edi
mov    %ebp,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1080 <fprintf@plt>
jmp    1314 <main+0x124>
mov    0x2c2d(%rip),%rax
mov    (%rax),%edi
lea    0xca9(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
jmp    1314 <main+0x124>
call   1070 <strcmp@plt>
test   %eax,%eax
jne    13bf <main+0x1cf>
mov    0x2bf0(%rip),%rax
mov    (%rax),%edi
call   10f0 <exit@plt>
mov    0x2bfa(%rip),%rax
mov    (%rax),%edi
lea    0xc81(%rip),%rsi
lea    0xc2a(%rip),%rdx
xor    %eax,%eax
call   1080 <fprintf@plt>
jmp    1314 <main+0x124>

LLVM IR (-O0):
%struct.sockaddr_un = type { i64, i32 }
%struct.sockaddr = type { i32 }
@.str = [22 x i8] c"/test-nnnnnnnn-socket\00"
@AF_UNIX = global i64 0
@SOCK_STREAM = global i32 0
@.str.1 = [7 x i8] c"socket\00"
@EXIT_FAILURE = global i32 0
@S_IXUSR = global i32 0
@S_IXGRP = global i32 0
@S_IRWXO = global i32 0
@.str.2 = [5 x i8] c"bind\00"
@.str.3 = [7 x i8] c"listen\00"
@.str.4 = [12 x i8] c"getsockname\00"
@stderr = global i32 0
@.str.5 = [23 x i8] c"socklen: %d != %d + 1\0A\00"
@.str.6 = [11 x i8] c"! AF_UNIX\0A\00"
@.str.7 = [6 x i8] c"! %s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca %struct.sockaddr_un
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8** %2
%8 = call i64 (...) @getuid()
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %0
ret i32 125
11: ; preds = %0
%12 = load i8*, i8** %2
%13 = call i32 @unlink(i8* %12)
%14 = load i64, i64* @AF_UNIX
%15 = load i32, i32* @SOCK_STREAM
%16 = call i32 @socket(i64 %14, i32 %15, i32 0)
store i32 %16, i32* %7
%17 = load i32, i32* %7
%18 = icmp slt i32 %17, 0
br i1 %18, label %19, label %23
19: ; preds = %11
%20 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%21 = load i32, i32* @EXIT_FAILURE
%22 = call i32 @exit(i32 %21)
unreachable
23: ; preds = %11
%24 = call i32 @bzero(%struct.sockaddr_un* %3, i32 16)
%25 = load i64, i64* @AF_UNIX
%26 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %3, i32 0, i32 0
store i64 %25, i64* %26
%27 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %3, i32 0, i32 1
%28 = load i32, i32* %27
%29 = load i8*, i8** %2
%30 = call i32 @strcpy(i32 %28, i8* %29)
%31 = load i32, i32* @S_IXUSR
%32 = load i32, i32* @S_IXGRP
%33 = or i32 %31, %32
%34 = load i32, i32* @S_IRWXO
%35 = or i32 %33, %34
%36 = call i32 @umask(i32 %35)
store i32 %36, i32* %5
%37 = load i32, i32* %7
%38 = bitcast %struct.sockaddr_un* %3 to %struct.sockaddr*
%39 = call i32 @SUN_LEN(%struct.sockaddr_un* %3)
%40 = call i32 @bind(i32 %37, %struct.sockaddr* %38, i32 %39)
store i32 %40, i32* %6
%41 = load i32, i32* %6
%42 = icmp slt i32 %41, 0
br i1 %42, label %43, label %47
43: ; preds = %23
%44 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%45 = load i32, i32* @EXIT_FAILURE
%46 = call i32 @exit(i32 %45)
unreachable
47: ; preds = %23
%48 = load i32, i32* %5
%49 = call i32 @umask(i32 %48)
%50 = load i32, i32* %7
%51 = call i32 @listen(i32 %50, i32 50)
store i32 %51, i32* %6
%52 = load i32, i32* %6
%53 = icmp slt i32 %52, 0
br i1 %53, label %54, label %58
54: ; preds = %47
%55 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%56 = load i32, i32* @EXIT_FAILURE
%57 = call i32 @exit(i32 %56)
unreachable
58: ; preds = %47
%59 = call i32 @bzero(%struct.sockaddr_un* %3, i32 16)
store i32 16, i32* %4
%60 = load i32, i32* %7
%61 = bitcast %struct.sockaddr_un* %3 to %struct.sockaddr*
%62 = call i32 @getsockname(i32 %60, %struct.sockaddr* %61, i32* %4)
store i32 %62, i32* %6
%63 = load i32, i32* %6
%64 = icmp slt i32 %63, 0
br i1 %64, label %65, label %69
65: ; preds = %58
%66 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
%67 = load i32, i32* @EXIT_FAILURE
%68 = call i32 @exit(i32 %67)
unreachable
69: ; preds = %58
%70 = load i32, i32* %4
%71 = call i32 @SUN_LEN(%struct.sockaddr_un* %3)
%72 = add nsw i32 %71, 1
%73 = icmp ne i32 %70, %72
br i1 %73, label %74, label %81
74: ; preds = %69
%75 = load i32, i32* @stderr
%76 = load i32, i32* %4
%77 = call i32 @SUN_LEN(%struct.sockaddr_un* %3)
%78 = call i32 (i32, i8*, ...) @fprintf(i32 %75, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), i32 %76, i32 %77)
%79 = load i32, i32* @EXIT_FAILURE
%80 = call i32 @exit(i32 %79)
unreachable
81: ; preds = %69
%82 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %3, i32 0, i32 0
%83 = load i64, i64* %82
%84 = load i64, i64* @AF_UNIX
%85 = icmp ne i64 %83, %84
br i1 %85, label %86, label %91
86: ; preds = %81
%87 = load i32, i32* @stderr
%88 = call i32 (i32, i8*, ...) @fprintf(i32 %87, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
%89 = load i32, i32* @EXIT_FAILURE
%90 = call i32 @exit(i32 %89)
unreachable
91: ; preds = %81
%92 = load i32, i32* %4
%93 = sext i32 %92 to i64
%94 = icmp eq i64 %93, 17
br i1 %94, label %95, label %100
95: ; preds = %91
%96 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %3, i32 0, i32 1
%97 = load i32, i32* %96
%98 = load i8*, i8** %2
%99 = call i32 @strncmp(i32 %97, i8* %98, i32 4)
store i32 %99, i32* %6
br label %105
100: ; preds = %91
%101 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %3, i32 0, i32 1
%102 = load i32, i32* %101
%103 = load i8*, i8** %2
%104 = call i32 @strcmp(i32 %102, i8* %103)
store i32 %104, i32* %6
br label %105
105: ; preds = %100, %95
%106 = load i32, i32* %6
%107 = icmp ne i32 %106, 0
br i1 %107, label %108, label %114
108: ; preds = %105
%109 = load i32, i32* @stderr
%110 = load i8*, i8** %2
%111 = call i32 (i32, i8*, ...) @fprintf(i32 %109, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i8* %110)
%112 = load i32, i32* @EXIT_FAILURE
%113 = call i32 @exit(i32 %112)
unreachable
114: ; preds = %105
%115 = load i32, i32* @EXIT_SUCCESS
%116 = call i32 @exit(i32 %115)
unreachable
}

LLVM IR (-O2):
%struct.sockaddr_un = type { i64, i32 }
%struct.sockaddr = type { i32 }
@.str = [22 x i8] c"/test-nnnnnnnn-socket\00"
@AF_UNIX = global i64 0
@SOCK_STREAM = global i32 0
@.str.1 = [7 x i8] c"socket\00"
@EXIT_FAILURE = global i32 0
@S_IXUSR = global i32 0
@S_IXGRP = global i32 0
@S_IRWXO = global i32 0
@.str.2 = [5 x i8] c"bind\00"
@.str.3 = [7 x i8] c"listen\00"
@.str.4 = [12 x i8] c"getsockname\00"
@stderr = global i32 0
@.str.5 = [23 x i8] c"socklen: %d != %d + 1\0A\00"
@.str.6 = [11 x i8] c"! AF_UNIX\0A\00"
@.str.7 = [6 x i8] c"! %s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca %struct.sockaddr_un
%2 = alloca i32
%3 = bitcast %struct.sockaddr_un* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i64 (...) @getuid()
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %0
ret i32 125
8: ; preds = %0
%9 = tail call i32 @unlink(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%10 = load i64, i64* @AF_UNIX
%11 = load i32, i32* @SOCK_STREAM
%12 = tail call i32 @socket(i64 %10, i32 %11, i32 0)
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %18
14: ; preds = %8
%15 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%16 = load i32, i32* @EXIT_FAILURE
%17 = tail call i32 @exit(i32 %16)
unreachable
18: ; preds = %8
%19 = call i32 @bzero(%struct.sockaddr_un* %1, i32 16)
%20 = load i64, i64* @AF_UNIX
%21 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %1, i64 0, i32 0
store i64 %20, i64* %21
%22 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %1, i64 0, i32 1
%23 = load i32, i32* %22
%24 = tail call i32 @strcpy(i32 %23, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%25 = load i32, i32* @S_IXUSR
%26 = load i32, i32* @S_IXGRP
%27 = or i32 %26, %25
%28 = load i32, i32* @S_IRWXO
%29 = or i32 %27, %28
%30 = tail call i32 @umask(i32 %29)
%31 = bitcast %struct.sockaddr_un* %1 to %struct.sockaddr*
%32 = call i32 @SUN_LEN(%struct.sockaddr_un* %1)
%33 = call i32 @bind(i32 %12, %struct.sockaddr* %31, i32 %32)
%34 = icmp slt i32 %33, 0
br i1 %34, label %35, label %39
35: ; preds = %18
%36 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%37 = load i32, i32* @EXIT_FAILURE
%38 = call i32 @exit(i32 %37)
unreachable
39: ; preds = %18
%40 = call i32 @umask(i32 %30)
%41 = call i32 @listen(i32 %12, i32 50)
%42 = icmp slt i32 %41, 0
br i1 %42, label %43, label %47
43: ; preds = %39
%44 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%45 = load i32, i32* @EXIT_FAILURE
%46 = call i32 @exit(i32 %45)
unreachable
47: ; preds = %39
%48 = call i32 @bzero(%struct.sockaddr_un* %1, i32 16)
store i32 16, i32* %2
%49 = call i32 @getsockname(i32 %12, %struct.sockaddr* %31, i32* %2)
%50 = icmp slt i32 %49, 0
br i1 %50, label %51, label %55
51: ; preds = %47
%52 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
%53 = load i32, i32* @EXIT_FAILURE
%54 = call i32 @exit(i32 %53)
unreachable
55: ; preds = %47
%56 = load i32, i32* %2
%57 = call i32 @SUN_LEN(%struct.sockaddr_un* %1)
%58 = add nsw i32 %57, 1
%59 = icmp eq i32 %56, %58
br i1 %59, label %67, label %60
60: ; preds = %55
%61 = load i32, i32* @stderr
%62 = load i32, i32* %2
%63 = call i32 @SUN_LEN(%struct.sockaddr_un* %1)
%64 = call i32 (i32, i8*, ...) @fprintf(i32 %61, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), i32 %62, i32 %63)
%65 = load i32, i32* @EXIT_FAILURE
%66 = call i32 @exit(i32 %65)
unreachable
67: ; preds = %55
%68 = load i64, i64* %21
%69 = load i64, i64* @AF_UNIX
%70 = icmp eq i64 %68, %69
br i1 %70, label %76, label %71
71: ; preds = %67
%72 = load i32, i32* @stderr
%73 = call i32 (i32, i8*, ...) @fprintf(i32 %72, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
%74 = load i32, i32* @EXIT_FAILURE
%75 = call i32 @exit(i32 %74)
unreachable
76: ; preds = %67
%77 = load i32, i32* %2
%78 = icmp eq i32 %77, 17
%79 = load i32, i32* %22
br i1 %78, label %80, label %82
80: ; preds = %76
%81 = call i32 @strncmp(i32 %79, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 4)
br label %84
82: ; preds = %76
%83 = call i32 @strcmp(i32 %79, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %84
84: ; preds = %82, %80
%85 = phi i32 [ %81, %80 ], [ %83, %82 ]
%86 = icmp eq i32 %85, 0
br i1 %86, label %92, label %87
87: ; preds = %84
%88 = load i32, i32* @stderr
%89 = call i32 (i32, i8*, ...) @fprintf(i32 %88, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%90 = load i32, i32* @EXIT_FAILURE
%91 = call i32 @exit(i32 %90)
unreachable
92: ; preds = %84
%93 = load i32, i32* @EXIT_SUCCESS
%94 = call i32 @exit(i32 %93)
unreachable
}