#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 {
  char *sun_path;
  int /*<<< orphan*/ sun_family;
};
struct sockaddr {
  int dummy;
};
typedef int socklen_t;
typedef int /*<<< orphan*/ servaddr;
typedef int /*<<< orphan*/ clientaddr;
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ AF_UNIX;
int /*<<< orphan*/ SOCK_STREAM;
int accept(int, struct sockaddr *, int *);
scalar_t__ bind(int, struct sockaddr *, int);
int /*<<< orphan*/ bzero(struct sockaddr_un *, int);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
scalar_t__ listen(int, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int read(int, char *, int, int /*<<< orphan*/);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcpy(char *, char *);
int main(int argc, char **argv) {
  if (argc != 2) {
    fprintf(stderr, "usage: %s <socket file path>\n", argv[0]);
    return 1;
  }
  struct sockaddr_un servaddr;
  bzero(&servaddr, sizeof(servaddr));
  servaddr.sun_family = AF_UNIX;
  strcpy(servaddr.sun_path, argv[1]);
  int servfd = socket(AF_UNIX, SOCK_STREAM, 0);
  if (servfd < 0) {
    perror("cannot create socket");
    return 1;
  }
  if (bind(servfd, (struct sockaddr *)&servaddr, sizeof(servaddr)) != 0) {
    perror("cannot bind");
    return 1;
  }
  if (listen(servfd, 10) != 0) {
    perror("cannot listen");
    return 1;
  }
  printf("accepting...\n");
  while (1) {
    struct sockaddr_un clientaddr;
    bzero(&clientaddr, sizeof(clientaddr));
    socklen_t clientaddrlen = sizeof(clientaddr);
    int sockfd = accept(servfd, (struct sockaddr *)&clientaddr, &clientaddrlen);
    if (sockfd < 0) {
      continue;
    }
    printf("accepted connection from %s\n", clientaddr.sun_path);
    char buf[1024];
    int result = 0;
    int packets = 0;
    while (1) {
      ++packets;
      int ret = read(sockfd, buf, sizeof(buf), 0);
      if (ret <= 0) {
        break;
      }
      int i;
      for (i = 0; i < ret; ++i) {
        result += buf[i];
      }
    }
    close(sockfd);
    printf("closed connection %d %d\n", result, packets);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x450,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     11fb <main+0x4b>
mov    0x2dfe(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe16(%rip),%rsi
call   1070 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    13e5 <main+0x235>
lea    -0x20(%rbp),%rdi
mov    $0x10,%esi
call   10b0 <bzero@plt>
mov    0x2dd8(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <strcpy@plt>
mov    0x2dbb(%rip),%rax
mov    (%rax),%edi
mov    0x2d9a(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   10d0 <socket@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jge    1264 <main+0xb4>
lea    0xdcb(%rip),%rdi
call   10a0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    13e5 <main+0x235>
mov    -0x24(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0x10,%edx
call   1090 <bind@plt>
cmp    $0x0,%rax
je     1297 <main+0xe7>
lea    0xdad(%rip),%rdi
call   10a0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    13e5 <main+0x235>
mov    -0x24(%rbp),%edi
mov    $0xa,%esi
call   1080 <listen@plt>
cmp    $0x0,%rax
je     12c6 <main+0x116>
lea    0xd8a(%rip),%rdi
call   10a0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    13e5 <main+0x235>
lea    0xd80(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x38(%rbp),%rdi
mov    $0x10,%esi
call   10b0 <bzero@plt>
movl   $0x10,-0x3c(%rbp)
mov    -0x24(%rbp),%edi
lea    -0x38(%rbp),%rsi
lea    -0x3c(%rbp),%rdx
call   10c0 <accept@plt>
mov    %eax,-0x40(%rbp)
cmpl   $0x0,-0x40(%rbp)
jge    130b <main+0x15b>
jmp    12d4 <main+0x124>
mov    -0x38(%rbp),%rsi
lea    0xd45(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x444(%rbp)
movl   $0x0,-0x448(%rbp)
mov    -0x448(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x448(%rbp)
mov    -0x40(%rbp),%edi
lea    -0x440(%rbp),%rsi
mov    $0x400,%edx
xor    %ecx,%ecx
call   1060 <read@plt>
mov    %eax,-0x44c(%rbp)
cmpl   $0x0,-0x44c(%rbp)
jg     136e <main+0x1be>
jmp    13be <main+0x20e>
movl   $0x0,-0x450(%rbp)
mov    -0x450(%rbp),%eax
cmp    -0x44c(%rbp),%eax
jge    13b9 <main+0x209>
movslq -0x450(%rbp),%rax
movsbl -0x440(%rbp,%rax,1),%eax
ff
add    -0x444(%rbp),%eax
mov    %eax,-0x444(%rbp)
mov    -0x450(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x450(%rbp)
jmp    1378 <main+0x1c8>
jmp    1331 <main+0x181>
mov    -0x40(%rbp),%edi
call   1050 <close@plt>
mov    -0x444(%rbp),%esi
mov    -0x448(%rbp),%edx
lea    0xc9f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    12d4 <main+0x124>
mov    -0x4(%rbp),%eax
add    $0x450,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x438,%rsp
mov    %rsi,%rbx
cmp    $0x2,%edi
jne    1443 <main+0x283>
lea    0x10(%rsp),%rdi
mov    $0x10,%esi
call   10c0 <bzero@plt>
mov    0x2df5(%rip),%rbp
mov    0x0(%rbp),%eax
mov    %eax,0x18(%rsp)
mov    0x10(%rsp),%rdi
mov    0x8(%rbx),%rsi
call   1030 <strcpy@plt>
mov    0x0(%rbp),%edi
mov    0x2dbe(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   10e0 <socket@plt>
test   %eax,%eax
js     1472 <main+0x2b2>
mov    %eax,%r12d
lea    0x10(%rsp),%rsi
mov    %eax,%edi
mov    $0x10,%edx
call   10a0 <bind@plt>
test   %rax,%rax
jne    1480 <main+0x2c0>
mov    %r12d,%edi
mov    $0xa,%esi
call   1090 <listen@plt>
test   %rax,%rax
jne    148e <main+0x2ce>
lea    0xe26(%rip),%rdi
call   1040 <puts@plt>
lea    0x20(%rsp),%rbx
lea    0x30(%rsp),%rbp
jmp    1292 <main+0xd2>
xchg   %ax,%ax
mov    $0x1,%r13d
mov    %r15d,%edi
call   1060 <close@plt>
lea    0xde5(%rip),%rdi
mov    %r14d,%esi
mov    %r13d,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x10,%esi
call   10c0 <bzero@plt>
movl   $0x10,0xc(%rsp)
mov    %r12d,%edi
mov    %rbx,%rsi
lea    0xc(%rsp),%rdx
call   10d0 <accept@plt>
test   %eax,%eax
js     1292 <main+0xd2>
mov    %eax,%r15d
mov    0x20(%rsp),%rsi
xor    %r14d,%r14d
lea    0xd80(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r15d,%edi
mov    %rbp,%rsi
mov    $0x400,%edx
xor    %ecx,%ecx
call   1070 <read@plt>
test   %eax,%eax
jle    1270 <main+0xb0>
xor    %r14d,%r14d
mov    $0x1,%r13d
jmp    131e <main+0x15e>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%r13d
mov    %r15d,%edi
mov    %rbp,%rsi
mov    $0x400,%edx
xor    %ecx,%ecx
call   1070 <read@plt>
test   %eax,%eax
jle    1276 <main+0xb6>
mov    %eax,%ecx
cmp    $0x8,%eax
jae    1330 <main+0x170>
xor    %eax,%eax
jmp    1420 <main+0x260>
nopl   0x0(%rax)
mov    %ecx,%eax
and    $0xfffffff8,%eax
movd   %r14d,%xmm0
lea    -0x8(%rax),%rsi
mov    %rsi,%rdx
shr    $0x3,%rdx
add    $0x1,%rdx
test   %rsi,%rsi
je     1436 <main+0x276>
mov    %rdx,%rdi
and    $0xfffffffffffffffe,%rdi
pxor   %xmm1,%xmm1
xor    %esi,%esi
nop
movd   0x34(%rsp,%rsi,1),%xmm2
punpcklbw %xmm2,%xmm2
punpcklwd %xmm2,%xmm2
punpcklbw 0x30(%rsp,%rsi,1),%xmm3
punpcklwd %xmm3,%xmm3
psrad  $0x18,%xmm3
paddd  %xmm0,%xmm3
psrad  $0x18,%xmm2
paddd  %xmm1,%xmm2
movq   0x38(%rsp,%rsi,1),%xmm0
punpcklbw %xmm0,%xmm0
punpcklwd %xmm0,%xmm0
movd   0x3c(%rsp,%rsi,1),%xmm1
punpcklbw %xmm1,%xmm1
punpcklwd %xmm1,%xmm1
psrad  $0x18,%xmm0
paddd  %xmm3,%xmm0
psrad  $0x18,%xmm1
paddd  %xmm2,%xmm1
add    $0x10,%rsi
add    $0xfffffffffffffffe,%rdi
jne    1360 <main+0x1a0>
test   $0x1,%dl
je     13f5 <main+0x235>
movq   0x30(%rsp,%rsi,1),%xmm2
punpcklbw %xmm2,%xmm2
punpcklwd %xmm2,%xmm2
movd   0x34(%rsp,%rsi,1),%xmm3
punpcklbw %xmm3,%xmm3
punpcklwd %xmm3,%xmm3
psrad  $0x18,%xmm2
paddd  %xmm2,%xmm0
psrad  $0x18,%xmm3
paddd  %xmm3,%xmm1
paddd  %xmm1,%xmm0
pshufd $0xee,%xmm0,%xmm1
paddd  %xmm0,%xmm1
pshufd $0x55,%xmm1,%xmm0
paddd  %xmm1,%xmm0
movd   %xmm0,%r14d
cmp    %rcx,%rax
je     1300 <main+0x140>
nopl   0x0(%rax)
movsbl 0x30(%rsp,%rax,1),%edx
add    %edx,%r14d
add    $0x1,%rax
cmp    %rax,%rcx
jne    1420 <main+0x260>
jmp    1300 <main+0x140>
pxor   %xmm1,%xmm1
xor    %esi,%esi
test   $0x1,%dl
jne    13c7 <main+0x207>
jmp    13f5 <main+0x235>
mov    0x2b8e(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
lea    0xbaa(%rip),%rsi
call   1080 <fprintf@plt>
mov    $0x1,%eax
add    $0x438,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xba5(%rip),%rdi
call   10b0 <perror@plt>
jmp    145b <main+0x29b>
lea    0xbac(%rip),%rdi
call   10b0 <perror@plt>
jmp    145b <main+0x29b>
lea    0xbaa(%rip),%rdi
call   10b0 <perror@plt>
jmp    145b <main+0x29b>

LLVM IR (-O0):
%struct.sockaddr_un = type { i8*, i32 }
%struct.sockaddr = type { i32 }
@stderr = global i32 0
@.str = [30 x i8] c"usage: %s <socket file path>\0A\00"
@AF_UNIX = global i32 0
@SOCK_STREAM = global i32 0
@.str.1 = [21 x i8] c"cannot create socket\00"
@.str.2 = [12 x i8] c"cannot bind\00"
@.str.3 = [14 x i8] c"cannot listen\00"
@.str.4 = [14 x i8] c"accepting...\0A\00"
@.str.5 = [29 x i8] c"accepted connection from %s\0A\00"
@.str.6 = [25 x i8] c"closed connection %d %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.sockaddr_un
%7 = alloca i32
%8 = alloca %struct.sockaddr_un
%9 = alloca i32
%10 = alloca i32
%11 = alloca [1024 x i8]
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%16 = load i32, i32* %4
%17 = icmp ne i32 %16, 2
br i1 %17, label %18, label %24
18: ; preds = %2
%19 = load i32, i32* @stderr
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 0
%22 = load i8*, i8** %21
%23 = call i32 @fprintf(i32 %19, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %22)
store i32 1, i32* %3
br label %100
24: ; preds = %2
%25 = call i32 @bzero(%struct.sockaddr_un* %6, i32 16)
%26 = load i32, i32* @AF_UNIX
%27 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %6, i32 0, i32 1
store i32 %26, i32* %27
%28 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %6, i32 0, i32 0
%29 = load i8*, i8** %28
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 1
%32 = load i8*, i8** %31
%33 = call i32 @strcpy(i8* %29, i8* %32)
%34 = load i32, i32* @AF_UNIX
%35 = load i32, i32* @SOCK_STREAM
%36 = call i32 @socket(i32 %34, i32 %35, i32 0)
store i32 %36, i32* %7
%37 = load i32, i32* %7
%38 = icmp slt i32 %37, 0
br i1 %38, label %39, label %41
39: ; preds = %24
%40 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %3
br label %100
41: ; preds = %24
%42 = load i32, i32* %7
%43 = bitcast %struct.sockaddr_un* %6 to %struct.sockaddr*
%44 = call i64 @bind(i32 %42, %struct.sockaddr* %43, i32 16)
%45 = icmp ne i64 %44, 0
br i1 %45, label %46, label %48
46: ; preds = %41
%47 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %3
br label %100
48: ; preds = %41
%49 = load i32, i32* %7
%50 = call i64 @listen(i32 %49, i32 10)
%51 = icmp ne i64 %50, 0
br i1 %51, label %52, label %54
52: ; preds = %48
%53 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %3
br label %100
54: ; preds = %48
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
br label %56
56: ; preds = %54, %63, %94
%57 = call i32 @bzero(%struct.sockaddr_un* %8, i32 16)
store i32 16, i32* %9
%58 = load i32, i32* %7
%59 = bitcast %struct.sockaddr_un* %8 to %struct.sockaddr*
%60 = call i32 @accept(i32 %58, %struct.sockaddr* %59, i32* %9)
store i32 %60, i32* %10
%61 = load i32, i32* %10
%62 = icmp slt i32 %61, 0
br i1 %62, label %63, label %64
63: ; preds = %56
br label %56
64: ; preds = %56
%65 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %8, i32 0, i32 0
%66 = load i8*, i8** %65
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0), i8* %66)
store i32 0, i32* %12
store i32 0, i32* %13
br label %68
68: ; preds = %64, %93
%69 = load i32, i32* %13
%70 = add nsw i32 %69, 1
store i32 %70, i32* %13
%71 = load i32, i32* %10
%72 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%73 = call i32 @read(i32 %71, i8* %72, i32 1024, i32 0)
store i32 %73, i32* %14
%74 = load i32, i32* %14
%75 = icmp sle i32 %74, 0
br i1 %75, label %76, label %77
76: ; preds = %68
br label %94
77: ; preds = %68
store i32 0, i32* %15
br label %78
78: ; preds = %90, %77
%79 = load i32, i32* %15
%80 = load i32, i32* %14
%81 = icmp slt i32 %79, %80
br i1 %81, label %82, label %93
82: ; preds = %78
%83 = load i32, i32* %15
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 %84
%86 = load i8, i8* %85
%87 = sext i8 %86 to i32
%88 = load i32, i32* %12
%89 = add nsw i32 %88, %87
store i32 %89, i32* %12
br label %90
90: ; preds = %82
%91 = load i32, i32* %15
%92 = add nsw i32 %91, 1
store i32 %92, i32* %15
br label %78
93: ; preds = %78
br label %68
94: ; preds = %76
%95 = load i32, i32* %10
%96 = call i32 @close(i32 %95)
%97 = load i32, i32* %12
%98 = load i32, i32* %13
%99 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0), i32 %97, i32 %98)
br label %56
100: ; preds = %52, %46, %39, %18
%101 = load i32, i32* %3
ret i32 %101
}

LLVM IR (-O2):
%struct.sockaddr_un = type { i8*, i32 }
%struct.sockaddr = type { i32 }
@stderr = global i32 0
@.str = [30 x i8] c"usage: %s <socket file path>\0A\00"
@AF_UNIX = global i32 0
@SOCK_STREAM = global i32 0
@.str.1 = [21 x i8] c"cannot create socket\00"
@.str.2 = [12 x i8] c"cannot bind\00"
@.str.3 = [14 x i8] c"cannot listen\00"
@.str.5 = [29 x i8] c"accepted connection from %s\0A\00"
@.str.6 = [25 x i8] c"closed connection %d %d\0A\00"
@str = [13 x i8] c"accepting...\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.sockaddr_un
%4 = alloca %struct.sockaddr_un
%5 = alloca i32
%6 = alloca [1024 x i8]
%7 = icmp eq i32 %0, 2
br i1 %7, label %12, label %8
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %1
%11 = tail call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %148
12: ; preds = %2
%13 = bitcast %struct.sockaddr_un* %3 to i8*
%14 = call i32 @bzero(%struct.sockaddr_un* %3, i32 16)
%15 = load i32, i32* @AF_UNIX
%16 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %3, i64 0, i32 1
store i32 %15, i32* %16
%17 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %3, i64 0, i32 0
%18 = load i8*, i8** %17
%19 = getelementptr inbounds i8*, i8** %1, i64 1
%20 = load i8*, i8** %19
%21 = tail call i32 @strcpy(i8* %18, i8* %20)
%22 = load i32, i32* @AF_UNIX
%23 = load i32, i32* @SOCK_STREAM
%24 = tail call i32 @socket(i32 %22, i32 %23, i32 0)
%25 = icmp slt i32 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %12
%27 = tail call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
br label %147
28: ; preds = %12
%29 = bitcast %struct.sockaddr_un* %3 to %struct.sockaddr*
%30 = call i64 @bind(i32 %24, %struct.sockaddr* %29, i32 16)
%31 = icmp eq i64 %30, 0
br i1 %31, label %34, label %32
32: ; preds = %28
%33 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
br label %147
34: ; preds = %28
%35 = call i64 @listen(i32 %24, i32 10)
%36 = icmp eq i64 %35, 0
br i1 %36, label %39, label %37
37: ; preds = %34
%38 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
br label %147
39: ; preds = %34
%40 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%41 = bitcast %struct.sockaddr_un* %4 to i8*
%42 = bitcast i32* %5 to i8*
%43 = bitcast %struct.sockaddr_un* %4 to %struct.sockaddr*
%44 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %4, i64 0, i32 0
%45 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
br label %46
46: ; preds = %146, %39
%47 = call i32 @bzero(%struct.sockaddr_un* %4, i32 16)
store i32 16, i32* %5
%48 = call i32 @accept(i32 %24, %struct.sockaddr* %43, i32* %5)
%49 = icmp slt i32 %48, 0
br i1 %49, label %146, label %50
50: ; preds = %46
%51 = load i8*, i8** %44
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0), i8* %51)
%53 = call i32 @read(i32 %48, i8* %45, i32 1024, i32 0)
%54 = icmp slt i32 %53, 1
br i1 %54, label %141, label %60
55: ; preds = %132, %123
%56 = phi i32 [ %127, %123 ], [ %138, %132 ]
%57 = add nuw nsw i32 %62, 1
%58 = call i32 @read(i32 %48, i8* %45, i32 1024, i32 0)
%59 = icmp slt i32 %58, 1
br i1 %59, label %141, label %60
60: ; preds = %50, %55
%61 = phi i32 [ %58, %55 ], [ %53, %50 ]
%62 = phi i32 [ %57, %55 ], [ 1, %50 ]
%63 = phi i32 [ %56, %55 ], [ 0, %50 ]
%64 = zext i32 %61 to i64
%65 = icmp ult i32 %61, 8
br i1 %65, label %129, label %66
66: ; preds = %60
%67 = and i64 %64, 4294967288
%68 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %63, i64 0
%69 = add nsw i64 %67, -8
%70 = lshr exact i64 %69, 3
%71 = add nuw nsw i64 %70, 1
%72 = and i64 %71, 1
%73 = icmp eq i64 %69, 0
br i1 %73, label %105, label %74
74: ; preds = %66
%75 = and i64 %71, 4611686018427387902
br label %76
76: ; preds = %76, %74
%77 = phi i64 [ 0, %74 ], [ %102, %76 ]
%78 = phi <4 x i32> [ %68, %74 ], [ %100, %76 ]
%79 = phi <4 x i32> [ zeroinitializer, %74 ], [ %101, %76 ]
%80 = phi i64 [ 0, %74 ], [ %103, %76 ]
%81 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 %77
%82 = bitcast i8* %81 to <4 x i8>*
%83 = load <4 x i8>, <4 x i8>* %82
%84 = getelementptr inbounds i8, i8* %81, i64 4
%85 = bitcast i8* %84 to <4 x i8>*
%86 = load <4 x i8>, <4 x i8>* %85
%87 = sext <4 x i8> %83 to <4 x i32>
%88 = sext <4 x i8> %86 to <4 x i32>
%89 = add <4 x i32> %78, %87
%90 = add <4 x i32> %79, %88
%91 = or i64 %77, 8
%92 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 %91
%93 = bitcast i8* %92 to <4 x i8>*
%94 = load <4 x i8>, <4 x i8>* %93
%95 = getelementptr inbounds i8, i8* %92, i64 4
%96 = bitcast i8* %95 to <4 x i8>*
%97 = load <4 x i8>, <4 x i8>* %96
%98 = sext <4 x i8> %94 to <4 x i32>
%99 = sext <4 x i8> %97 to <4 x i32>
%100 = add <4 x i32> %89, %98
%101 = add <4 x i32> %90, %99
%102 = add nuw i64 %77, 16
%103 = add i64 %80, 2
%104 = icmp eq i64 %103, %75
br i1 %104, label %105, label %76
105: ; preds = %76, %66
%106 = phi <4 x i32> [ undef, %66 ], [ %100, %76 ]
%107 = phi <4 x i32> [ undef, %66 ], [ %101, %76 ]
%108 = phi i64 [ 0, %66 ], [ %102, %76 ]
%109 = phi <4 x i32> [ %68, %66 ], [ %100, %76 ]
%110 = phi <4 x i32> [ zeroinitializer, %66 ], [ %101, %76 ]
%111 = icmp eq i64 %72, 0
br i1 %111, label %123, label %112
112: ; preds = %105
%113 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 %108
%114 = bitcast i8* %113 to <4 x i8>*
%115 = load <4 x i8>, <4 x i8>* %114
%116 = getelementptr inbounds i8, i8* %113, i64 4
%117 = bitcast i8* %116 to <4 x i8>*
%118 = load <4 x i8>, <4 x i8>* %117
%119 = sext <4 x i8> %115 to <4 x i32>
%120 = sext <4 x i8> %118 to <4 x i32>
%121 = add <4 x i32> %109, %119
%122 = add <4 x i32> %110, %120
br label %123
123: ; preds = %105, %112
%124 = phi <4 x i32> [ %106, %105 ], [ %121, %112 ]
%125 = phi <4 x i32> [ %107, %105 ], [ %122, %112 ]
%126 = add <4 x i32> %125, %124
%127 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %126)
%128 = icmp eq i64 %67, %64
br i1 %128, label %55, label %129
129: ; preds = %60, %123
%130 = phi i64 [ 0, %60 ], [ %67, %123 ]
%131 = phi i32 [ %63, %60 ], [ %127, %123 ]
br label %132
132: ; preds = %129, %132
%133 = phi i64 [ %139, %132 ], [ %130, %129 ]
%134 = phi i32 [ %138, %132 ], [ %131, %129 ]
%135 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 %133
%136 = load i8, i8* %135
%137 = sext i8 %136 to i32
%138 = add nsw i32 %134, %137
%139 = add nuw nsw i64 %133, 1
%140 = icmp eq i64 %139, %64
br i1 %140, label %55, label %132
141: ; preds = %55, %50
%142 = phi i32 [ 0, %50 ], [ %56, %55 ]
%143 = phi i32 [ 1, %50 ], [ %57, %55 ]
%144 = call i32 @close(i32 %48)
%145 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0), i32 %142, i32 %143)
br label %146
146: ; preds = %46, %141
br label %46
147: ; preds = %37, %32, %26
br label %148
148: ; preds = %147, %8
ret i32 1
}