#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*/ sun;
struct sockaddr_un {
  int /*<<< orphan*/ sun_path;
  int /*<<< orphan*/ sun_family;
};
struct sockaddr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ AF_UNIX;
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ SOCK_DGRAM;
int atoi(char *);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int fsetxattr(int, char *, char *, scalar_t__, int /*<<< orphan*/);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int read(int, char *, int);
scalar_t__ sendto(int, char *, scalar_t__, int /*<<< orphan*/,
                  struct sockaddr *, int);
int /*<<< orphan*/ sleep(int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, char *, ...);
int /*<<< orphan*/ stderr;
char *strchr(char *, char);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(int /*<<< orphan*/, char *);
scalar_t__ strlen(char *);
int main(int argc, char *argv[]) {
  int sock;
  struct sockaddr_un sun;
  char buffer[500];
  char *path = "/tmp/testsmackuds";
  char *cp;
  char *outlabels[20];
  char plabel[256];
  int i;
  int oln;
  int nap = 1;
  int count = 0;
  int number = -1;
  int olcount = 0;
  oln = open("/proc/self/attr/smack.current", O_RDONLY);
  if (oln < 0)
    oln = open("/smack/current", O_RDONLY);
  if (oln < 0)
    oln = open("/proc/self/attr/current", O_RDONLY);
  i = read(oln, plabel, 256);
  close(oln);
  plabel[i] = '\0';
  if ((cp = strchr(plabel, '\n')) != NULL)
    *cp = '\0';
  outlabels[0] = plabel;
  for (i = 1; i < argc; i++) {
    if (strcmp(argv[i], "-c") == 0 || strcmp(argv[i], "--count") == 0)
      count = 1;
    else if (strcmp(argv[i], "-s") == 0 || strcmp(argv[i], "--sleep") == 0)
      nap = atoi(argv[++i]);
    else if (strcmp(argv[i], "-n") == 0 || strcmp(argv[i], "--number") == 0)
      number = atoi(argv[++i]);
    else if (strcmp(argv[i], "-o") == 0 || strcmp(argv[i], "--out") == 0)
      outlabels[olcount++] = argv[++i];
    else if (strcmp(argv[i], "-p") == 0 || strcmp(argv[i], "--path") == 0)
      path = argv[++i];
    else
      fprintf(stderr, "arg \"%s\" ignored\n", argv[i]);
  }
  if ((sock = socket(AF_UNIX, SOCK_DGRAM, 0)) < 0) {
    perror("socket");
    exit(1);
  }
  sun.sun_family = AF_UNIX;
  strcpy(sun.sun_path, path);
  for (cp = outlabels[0], oln = 0; number != 0; number--) {
    if (count != 0)
      sprintf(buffer, "%s %d", outlabels[oln], count++);
    else
      sprintf(buffer, "%s", outlabels[oln]);
    if (olcount > 0) {
      i = fsetxattr(sock, "security.SMACK64IPOUT", outlabels[oln],
                    strlen(outlabels[oln]) + 1, 0);
      cp = outlabels[oln];
      if (++oln >= olcount)
        oln = 0;
      if (i < 0) {
        fprintf(stderr, "Failed \"%s\" ", cp);
        perror("fsetxattr");
      }
    }
    if (sendto(sock, buffer, strlen(buffer) + 1, 0, (struct sockaddr *)&sun,
               sizeof(sun)) < 0) {
      fprintf(stderr, "Failed \"%s\" ", cp);
      perror("sendto");
    }
    if (nap > 0)
      sleep(nap);
  }
  close(sock);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xde0(%rip),%rax
mov    %rax,-0x228(%rbp)
movl   $0x1,-0x3dc(%rbp)
movl   $0x0,-0x3e0(%rbp)
movl   $0xffffffff,-0x3e4(%rbp)
ff ff ff
movl   $0x0,-0x3e8(%rbp)
mov    0x2d92(%rip),%rax
mov    (%rax),%esi
lea    0xdb3(%rip),%rdi
call   10c0 <open@plt>
mov    %eax,-0x3d8(%rbp)
cmpl   $0x0,-0x3d8(%rbp)
jge    1292 <main+0x92>
mov    0x2d6a(%rip),%rax
mov    (%rax),%esi
lea    0xda9(%rip),%rdi
call   10c0 <open@plt>
mov    %eax,-0x3d8(%rbp)
cmpl   $0x0,-0x3d8(%rbp)
jge    12ba <main+0xba>
mov    0x2d42(%rip),%rax
mov    (%rax),%esi
lea    0xd90(%rip),%rdi
call   10c0 <open@plt>
mov    %eax,-0x3d8(%rbp)
mov    -0x3d8(%rbp),%edi
lea    -0x3d0(%rbp),%rsi
mov    $0x100,%edx
call   1090 <read@plt>
mov    %eax,-0x3d4(%rbp)
mov    -0x3d8(%rbp),%edi
call   1080 <close@plt>
movslq -0x3d4(%rbp),%rax
movb   $0x0,-0x3d0(%rbp,%rax,1)
lea    -0x3d0(%rbp),%rdi
mov    $0xa,%esi
call   1060 <strchr@plt>
mov    %rax,-0x230(%rbp)
cmp    $0x0,%rax
je     131d <main+0x11d>
mov    -0x230(%rbp),%rax
movb   $0x0,(%rax)
lea    -0x3d0(%rbp),%rax
mov    %rax,-0x2d0(%rbp)
movl   $0x1,-0x3d4(%rbp)
mov    -0x3d4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    15ca <main+0x3ca>
mov    -0x10(%rbp),%rax
movslq -0x3d4(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xcfd(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
je     138e <main+0x18e>
mov    -0x10(%rbp),%rax
movslq -0x3d4(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xcdb(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    139d <main+0x19d>
movl   $0x1,-0x3e0(%rbp)
jmp    15b1 <main+0x3b1>
mov    -0x10(%rbp),%rax
movslq -0x3d4(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xcaf(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
je     13e7 <main+0x1e7>
mov    -0x10(%rbp),%rax
movslq -0x3d4(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xc8d(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    1411 <main+0x211>
mov    -0x10(%rbp),%rax
mov    -0x3d4(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x3d4(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   10e0 <atoi@plt>
mov    %eax,-0x3dc(%rbp)
jmp    15ac <main+0x3ac>
mov    -0x10(%rbp),%rax
movslq -0x3d4(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xc46(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
je     145b <main+0x25b>
mov    -0x10(%rbp),%rax
movslq -0x3d4(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xc24(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    1485 <main+0x285>
mov    -0x10(%rbp),%rax
mov    -0x3d4(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x3d4(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   10e0 <atoi@plt>
mov    %eax,-0x3e4(%rbp)
jmp    15a7 <main+0x3a7>
mov    -0x10(%rbp),%rax
movslq -0x3d4(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xbde(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
je     14cf <main+0x2cf>
mov    -0x10(%rbp),%rax
movslq -0x3d4(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xbbc(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    1509 <main+0x309>
mov    -0x10(%rbp),%rax
mov    -0x3d4(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x3d4(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rcx
mov    -0x3e8(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x3e8(%rbp)
cltq
mov    %rcx,-0x2d0(%rbp,%rax,8)
ff
jmp    15a2 <main+0x3a2>
mov    -0x10(%rbp),%rax
movslq -0x3d4(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xb63(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
je     1553 <main+0x353>
mov    -0x10(%rbp),%rax
movslq -0x3d4(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xb41(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    1579 <main+0x379>
mov    -0x10(%rbp),%rax
mov    -0x3d4(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x3d4(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x228(%rbp)
jmp    159d <main+0x39d>
mov    0x2a48(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
movslq -0x3d4(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xaf4(%rip),%rsi
call   10b0 <fprintf@plt>
jmp    15a2 <main+0x3a2>
jmp    15a7 <main+0x3a7>
jmp    15ac <main+0x3ac>
jmp    15b1 <main+0x3b1>
jmp    15b6 <main+0x3b6>
mov    -0x3d4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3d4(%rbp)
jmp    1335 <main+0x135>
mov    0x2a0f(%rip),%rax
mov    (%rax),%edi
mov    0x29fe(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1120 <socket@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jge    1605 <main+0x405>
lea    0xaa8(%rip),%rdi
call   10d0 <perror@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
mov    0x29d4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x20(%rbp),%edi
mov    -0x228(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x2d0(%rbp),%rax
mov    %rax,-0x230(%rbp)
movl   $0x0,-0x3d8(%rbp)
cmpl   $0x0,-0x3e4(%rbp)
je     1839 <main+0x639>
cmpl   $0x0,-0x3e0(%rbp)
je     168c <main+0x48c>
lea    -0x220(%rbp),%rdi
movslq -0x3d8(%rbp),%rax
mov    -0x2d0(%rbp,%rax,8),%rdx
ff
mov    -0x3e0(%rbp),%ecx
mov    %ecx,%eax
add    $0x1,%eax
mov    %eax,-0x3e0(%rbp)
lea    0xa25(%rip),%rsi
mov    $0x0,%al
call   10f0 <sprintf@plt>
jmp    16b0 <main+0x4b0>
lea    -0x220(%rbp),%rdi
movslq -0x3d8(%rbp),%rax
mov    -0x2d0(%rbp,%rax,8),%rdx
ff
lea    0xa02(%rip),%rsi
mov    $0x0,%al
call   10f0 <sprintf@plt>
cmpl   $0x0,-0x3e8(%rbp)
jle    178e <main+0x58e>
mov    -0x14(%rbp),%eax
mov    %eax,-0x3f4(%rbp)
movslq -0x3d8(%rbp),%rax
mov    -0x2d0(%rbp,%rax,8),%rax
ff
mov    %rax,-0x3f0(%rbp)
movslq -0x3d8(%rbp),%rax
mov    -0x2d0(%rbp,%rax,8),%rdi
ff
call   1050 <strlen@plt>
mov    -0x3f4(%rbp),%edi
mov    -0x3f0(%rbp),%rdx
mov    %rax,%rcx
add    $0x1,%rcx
lea    0x9a3(%rip),%rsi
xor    %r8d,%r8d
call   1040 <fsetxattr@plt>
mov    %eax,-0x3d4(%rbp)
movslq -0x3d8(%rbp),%rax
mov    -0x2d0(%rbp,%rax,8),%rax
ff
mov    %rax,-0x230(%rbp)
mov    -0x3d8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3d8(%rbp)
cmp    -0x3e8(%rbp),%eax
jl     1754 <main+0x554>
movl   $0x0,-0x3d8(%rbp)
cmpl   $0x0,-0x3d4(%rbp)
jge    1789 <main+0x589>
mov    0x2860(%rip),%rax
mov    (%rax),%edi
mov    -0x230(%rbp),%rdx
lea    0x94c(%rip),%rsi
call   10b0 <fprintf@plt>
lea    0x94d(%rip),%rdi
call   10d0 <perror@plt>
jmp    178e <main+0x58e>
mov    -0x14(%rbp),%eax
mov    %eax,-0x404(%rbp)
lea    -0x220(%rbp),%rax
mov    %rax,-0x400(%rbp)
lea    -0x220(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x404(%rbp),%edi
mov    -0x400(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
lea    -0x20(%rbp),%r8
xor    %ecx,%ecx
mov    $0x8,%r9d
call   1070 <sendto@plt>
cmp    $0x0,%rax
jge    1808 <main+0x608>
mov    0x27e1(%rip),%rax
mov    (%rax),%edi
mov    -0x230(%rbp),%rdx
lea    0x8cd(%rip),%rsi
call   10b0 <fprintf@plt>
lea    0x8d8(%rip),%rdi
call   10d0 <perror@plt>
cmpl   $0x0,-0x3dc(%rbp)
jle    1820 <main+0x620>
mov    -0x3dc(%rbp),%edi
call   1110 <sleep@plt>
jmp    1825 <main+0x625>
mov    -0x3e4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x3e4(%rbp)
jmp    1638 <main+0x438>
mov    -0x14(%rbp),%edi
call   1080 <close@plt>
xor    %eax,%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x3b8,%rsp
mov    %rsi,%r12
mov    %edi,%r15d
mov    0x2dca(%rip),%rbx
mov    (%rbx),%esi
lea    0xdeb(%rip),%rdi
call   10c0 <open@plt>
mov    %eax,%ebp
test   %eax,%eax
jns    1256 <main+0x56>
mov    (%rbx),%esi
lea    0xdf5(%rip),%rdi
call   10c0 <open@plt>
mov    %eax,%ebp
test   %eax,%eax
jns    1256 <main+0x56>
mov    (%rbx),%esi
lea    0xdf0(%rip),%rdi
call   10c0 <open@plt>
mov    %eax,%ebp
lea    0xc0(%rsp),%r14
mov    %ebp,%edi
mov    %r14,%rsi
mov    $0x100,%edx
call   1090 <read@plt>
mov    %eax,%ebx
mov    %ebp,%edi
call   1080 <close@plt>
movslq %ebx,%rax
movb   $0x0,0xc0(%rsp,%rax,1)
mov    %r14,%rdi
mov    $0xa,%esi
call   1060 <strchr@plt>
test   %rax,%rax
je     1296 <main+0x96>
movb   $0x0,(%rax)
mov    %r14,0x20(%rsp)
cmp    $0x2,%r15d
jl     145f <main+0x25f>
mov    %r15d,%ebx
lea    0xd51(%rip),%rax
mov    %rax,0x8(%rsp)
movl   $0x1,0x4(%rsp)
mov    $0xffffffff,%r15d
movl   $0x0,(%rsp)
xor    %r13d,%r13d
mov    $0x1,%r14d
jmp    12f3 <main+0xf3>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x1,%r13d
add    $0x1,%r14d
cmp    %ebx,%r14d
jge    1483 <main+0x283>
movslq %r14d,%rbp
mov    (%r12,%rbp,8),%rdi
lea    0xd56(%rip),%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
je     12e0 <main+0xe0>
mov    (%r12,%rbp,8),%rdi
lea    0xd44(%rip),%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
je     12e0 <main+0xe0>
mov    (%r12,%rbp,8),%rdi
lea    0xd37(%rip),%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
je     1400 <main+0x200>
mov    (%r12,%rbp,8),%rdi
lea    0xd21(%rip),%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
je     1400 <main+0x200>
mov    (%r12,%rbp,8),%rdi
lea    0xd10(%rip),%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
je     1417 <main+0x217>
mov    (%r12,%rbp,8),%rdi
lea    0xcfa(%rip),%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
je     1417 <main+0x217>
mov    (%r12,%rbp,8),%rdi
lea    0xcea(%rip),%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
je     142d <main+0x22d>
mov    (%r12,%rbp,8),%rdi
lea    0xcd4(%rip),%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
je     142d <main+0x22d>
mov    (%r12,%rbp,8),%rdi
lea    0xcc5(%rip),%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
je     144c <main+0x24c>
mov    (%r12,%rbp,8),%rdi
lea    0xcaf(%rip),%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
je     144c <main+0x24c>
mov    0x2be1(%rip),%rax
mov    (%rax),%edi
mov    (%r12,%rbp,8),%rdx
lea    0xc98(%rip),%rsi
call   10b0 <fprintf@plt>
jmp    12e6 <main+0xe6>
xchg   %ax,%ax
lea    0x1(%rbp),%r14d
mov    0x8(%r12,%rbp,8),%rdi
call   10e0 <atoi@plt>
mov    %eax,0x4(%rsp)
jmp    12e6 <main+0xe6>
lea    0x1(%rbp),%r14d
mov    0x8(%r12,%rbp,8),%rdi
call   10e0 <atoi@plt>
mov    %eax,%r15d
jmp    12e6 <main+0xe6>
lea    0x1(%rbp),%r14d
mov    0x8(%r12,%rbp,8),%rax
mov    (%rsp),%edx
movslq %edx,%rcx
add    $0x1,%edx
mov    %edx,(%rsp)
mov    %rax,0x20(%rsp,%rcx,8)
jmp    12e6 <main+0xe6>
lea    0x1(%rbp),%r14d
mov    0x8(%r12,%rbp,8),%rax
mov    %rax,0x8(%rsp)
jmp    12e6 <main+0xe6>
mov    $0xffffffff,%r15d
xor    %r13d,%r13d
movl   $0x1,0x4(%rsp)
lea    0xb89(%rip),%rax
mov    %rax,0x8(%rsp)
movl   $0x0,(%rsp)
mov    0x2b56(%rip),%r14
mov    (%r14),%edi
mov    0x2b44(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1120 <socket@plt>
mov    %eax,0x14(%rsp)
test   %eax,%eax
js     1640 <main+0x440>
mov    (%r14),%eax
mov    %eax,0x1c(%rsp)
mov    0x18(%rsp),%edi
mov    0x8(%rsp),%rsi
call   1030 <strcpy@plt>
test   %r15d,%r15d
mov    0x4(%rsp),%ebp
je     1623 <main+0x423>
mov    0x20(%rsp),%rax
mov    %rax,0x8(%rsp)
xor    %r14d,%r14d
jmp    14ea <main+0x2ea>
nopw   0x0(%rax,%rax,1)
add    $0xffffffff,%r15d
je     1623 <main+0x423>
movslq %r14d,%rax
mov    0x20(%rsp,%rax,8),%r12
mov    %r13,%rcx
test   %ecx,%ecx
je     1530 <main+0x330>
lea    0x1(%rcx),%r13d
lea    0x1c0(%rsp),%rdi
lea    0xb99(%rip),%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   10f0 <sprintf@plt>
mov    0x4(%rsp),%ebp
cmpl   $0x0,(%rsp)
jg     1549 <main+0x349>
jmp    1585 <main+0x385>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0x1c0(%rsp),%rdi
mov    %r12,%rsi
call   1030 <strcpy@plt>
xor    %r13d,%r13d
cmpl   $0x0,(%rsp)
jle    1585 <main+0x385>
mov    %r12,%rdi
call   1050 <strlen@plt>
lea    0x1(%rax),%rcx
mov    0x14(%rsp),%edi
lea    0xb4b(%rip),%rsi
mov    %r12,%rdx
xor    %r8d,%r8d
call   1040 <fsetxattr@plt>
add    $0x1,%r14d
cmp    (%rsp),%r14d
mov    $0x0,%ecx
cmovge %ecx,%r14d
test   %eax,%eax
js     15fa <main+0x3fa>
mov    %r12,0x8(%rsp)
lea    0x1c0(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <strlen@plt>
lea    0x1(%rax),%rdx
mov    0x14(%rsp),%edi
mov    %rbx,%rsi
xor    %ecx,%ecx
lea    0x18(%rsp),%r8
mov    $0x8,%r9d
call   1070 <sendto@plt>
test   %rax,%rax
js     15cb <main+0x3cb>
test   %ebp,%ebp
jle    14e0 <main+0x2e0>
mov    %ebp,%edi
call   1110 <sleep@plt>
jmp    14e0 <main+0x2e0>
mov    0x29f6(%rip),%rax
mov    (%rax),%edi
lea    0xae6(%rip),%rsi
mov    0x8(%rsp),%rdx
call   10b0 <fprintf@plt>
lea    0xaec(%rip),%rdi
call   10d0 <perror@plt>
test   %ebp,%ebp
jg     15bf <main+0x3bf>
jmp    14e0 <main+0x2e0>
mov    0x29c7(%rip),%rax
mov    (%rax),%edi
lea    0xab7(%rip),%rsi
mov    %r12,%rdx
call   10b0 <fprintf@plt>
lea    0xab5(%rip),%rdi
call   10d0 <perror@plt>
jmp    1580 <main+0x380>
mov    0x14(%rsp),%edi
call   1080 <close@plt>
xor    %eax,%eax
add    $0x3b8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xa57(%rip),%rdi
call   10d0 <perror@plt>
mov    $0x1,%edi
call   1100 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_un = type { i32, i32 }
%struct.sockaddr = type { i32 }
@.str = [18 x i8] c"/tmp/testsmackuds\00"
@.str.1 = [30 x i8] c"/proc/self/attr/smack.current\00"
@O_RDONLY = global i32 0
@.str.2 = [15 x i8] c"/smack/current\00"
@.str.3 = [24 x i8] c"/proc/self/attr/current\00"
@.str.4 = [3 x i8] c"-c\00"
@.str.5 = [8 x i8] c"--count\00"
@.str.6 = [3 x i8] c"-s\00"
@.str.7 = [8 x i8] c"--sleep\00"
@.str.8 = [3 x i8] c"-n\00"
@.str.9 = [9 x i8] c"--number\00"
@.str.10 = [3 x i8] c"-o\00"
@.str.11 = [6 x i8] c"--out\00"
@.str.12 = [3 x i8] c"-p\00"
@.str.13 = [7 x i8] c"--path\00"
@stderr = global i32 0
@.str.14 = [18 x i8] c"arg \22%s\22 ignored\0A\00"
@AF_UNIX = global i32 0
@SOCK_DGRAM = global i32 0
@.str.15 = [7 x i8] c"socket\00"
@.str.16 = [6 x i8] c"%s %d\00"
@.str.17 = [3 x i8] c"%s\00"
@.str.18 = [22 x i8] c"security.SMACK64IPOUT\00"
@.str.19 = [13 x i8] c"Failed \22%s\22 \00"
@.str.20 = [10 x i8] c"fsetxattr\00"
@.str.21 = [7 x i8] c"sendto\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca %struct.sockaddr_un
%8 = alloca [500 x i8]
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca [20 x i8*]
%12 = alloca [256 x i8]
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8** %9
store i32 1, i32* %15
store i32 0, i32* %16
store i32 -1, i32* %17
store i32 0, i32* %18
%19 = load i32, i32* @O_RDONLY
%20 = call i32 @open(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 %19)
store i32 %20, i32* %14
%21 = load i32, i32* %14
%22 = icmp slt i32 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %2
%24 = load i32, i32* @O_RDONLY
%25 = call i32 @open(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %24)
store i32 %25, i32* %14
br label %26
26: ; preds = %23, %2
%27 = load i32, i32* %14
%28 = icmp slt i32 %27, 0
br i1 %28, label %29, label %32
29: ; preds = %26
%30 = load i32, i32* @O_RDONLY
%31 = call i32 @open(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i32 %30)
store i32 %31, i32* %14
br label %32
32: ; preds = %29, %26
%33 = load i32, i32* %14
%34 = getelementptr inbounds [256 x i8], [256 x i8]* %12, i64 0, i64 0
%35 = call i32 @read(i32 %33, i8* %34, i32 256)
store i32 %35, i32* %13
%36 = load i32, i32* %14
%37 = call i32 @close(i32 %36)
%38 = load i32, i32* %13
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [256 x i8], [256 x i8]* %12, i64 0, i64 %39
store i8 0, i8* %40
%41 = getelementptr inbounds [256 x i8], [256 x i8]* %12, i64 0, i64 0
%42 = call i8* @strchr(i8* %41, i8 signext 10)
store i8* %42, i8** %10
%43 = icmp ne i8* %42, null
br i1 %43, label %44, label %46
44: ; preds = %32
%45 = load i8*, i8** %10
store i8 0, i8* %45
br label %46
46: ; preds = %44, %32
%47 = getelementptr inbounds [256 x i8], [256 x i8]* %12, i64 0, i64 0
%48 = getelementptr inbounds [20 x i8*], [20 x i8*]* %11, i64 0, i64 0
store i8* %47, i8** %48
store i32 1, i32* %13
br label %49
49: ; preds = %181, %46
%50 = load i32, i32* %13
%51 = load i32, i32* %4
%52 = icmp slt i32 %50, %51
br i1 %52, label %53, label %184
53: ; preds = %49
%54 = load i8**, i8*** %5
%55 = load i32, i32* %13
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds i8*, i8** %54, i64 %56
%58 = load i8*, i8** %57
%59 = call i64 @strcmp(i8* %58, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%60 = icmp eq i64 %59, 0
br i1 %60, label %69, label %61
61: ; preds = %53
%62 = load i8**, i8*** %5
%63 = load i32, i32* %13
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds i8*, i8** %62, i64 %64
%66 = load i8*, i8** %65
%67 = call i64 @strcmp(i8* %66, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%68 = icmp eq i64 %67, 0
br i1 %68, label %69, label %70
69: ; preds = %61, %53
store i32 1, i32* %16
br label %180
70: ; preds = %61
%71 = load i8**, i8*** %5
%72 = load i32, i32* %13
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds i8*, i8** %71, i64 %73
%75 = load i8*, i8** %74
%76 = call i64 @strcmp(i8* %75, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%77 = icmp eq i64 %76, 0
br i1 %77, label %86, label %78
78: ; preds = %70
%79 = load i8**, i8*** %5
%80 = load i32, i32* %13
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds i8*, i8** %79, i64 %81
%83 = load i8*, i8** %82
%84 = call i64 @strcmp(i8* %83, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
%85 = icmp eq i64 %84, 0
br i1 %85, label %86, label %94
86: ; preds = %78, %70
%87 = load i8**, i8*** %5
%88 = load i32, i32* %13
%89 = add nsw i32 %88, 1
store i32 %89, i32* %13
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds i8*, i8** %87, i64 %90
%92 = load i8*, i8** %91
%93 = call i32 @atoi(i8* %92)
store i32 %93, i32* %15
br label %179
94: ; preds = %78
%95 = load i8**, i8*** %5
%96 = load i32, i32* %13
%97 = sext i32 %96 to i64
%98 = getelementptr inbounds i8*, i8** %95, i64 %97
%99 = load i8*, i8** %98
%100 = call i64 @strcmp(i8* %99, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%101 = icmp eq i64 %100, 0
br i1 %101, label %110, label %102
102: ; preds = %94
%103 = load i8**, i8*** %5
%104 = load i32, i32* %13
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds i8*, i8** %103, i64 %105
%107 = load i8*, i8** %106
%108 = call i64 @strcmp(i8* %107, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0))
%109 = icmp eq i64 %108, 0
br i1 %109, label %110, label %118
110: ; preds = %102, %94
%111 = load i8**, i8*** %5
%112 = load i32, i32* %13
%113 = add nsw i32 %112, 1
store i32 %113, i32* %13
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds i8*, i8** %111, i64 %114
%116 = load i8*, i8** %115
%117 = call i32 @atoi(i8* %116)
store i32 %117, i32* %17
br label %178
118: ; preds = %102
%119 = load i8**, i8*** %5
%120 = load i32, i32* %13
%121 = sext i32 %120 to i64
%122 = getelementptr inbounds i8*, i8** %119, i64 %121
%123 = load i8*, i8** %122
%124 = call i64 @strcmp(i8* %123, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
%125 = icmp eq i64 %124, 0
br i1 %125, label %134, label %126
126: ; preds = %118
%127 = load i8**, i8*** %5
%128 = load i32, i32* %13
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds i8*, i8** %127, i64 %129
%131 = load i8*, i8** %130
%132 = call i64 @strcmp(i8* %131, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0))
%133 = icmp eq i64 %132, 0
br i1 %133, label %134, label %145
134: ; preds = %126, %118
%135 = load i8**, i8*** %5
%136 = load i32, i32* %13
%137 = add nsw i32 %136, 1
store i32 %137, i32* %13
%138 = sext i32 %137 to i64
%139 = getelementptr inbounds i8*, i8** %135, i64 %138
%140 = load i8*, i8** %139
%141 = load i32, i32* %18
%142 = add nsw i32 %141, 1
store i32 %142, i32* %18
%143 = sext i32 %141 to i64
%144 = getelementptr inbounds [20 x i8*], [20 x i8*]* %11, i64 0, i64 %143
store i8* %140, i8** %144
br label %177
145: ; preds = %126
%146 = load i8**, i8*** %5
%147 = load i32, i32* %13
%148 = sext i32 %147 to i64
%149 = getelementptr inbounds i8*, i8** %146, i64 %148
%150 = load i8*, i8** %149
%151 = call i64 @strcmp(i8* %150, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0))
%152 = icmp eq i64 %151, 0
br i1 %152, label %161, label %153
153: ; preds = %145
%154 = load i8**, i8*** %5
%155 = load i32, i32* %13
%156 = sext i32 %155 to i64
%157 = getelementptr inbounds i8*, i8** %154, i64 %156
%158 = load i8*, i8** %157
%159 = call i64 @strcmp(i8* %158, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0))
%160 = icmp eq i64 %159, 0
br i1 %160, label %161, label %168
161: ; preds = %153, %145
%162 = load i8**, i8*** %5
%163 = load i32, i32* %13
%164 = add nsw i32 %163, 1
store i32 %164, i32* %13
%165 = sext i32 %164 to i64
%166 = getelementptr inbounds i8*, i8** %162, i64 %165
%167 = load i8*, i8** %166
store i8* %167, i8** %9
br label %176
168: ; preds = %153
%169 = load i32, i32* @stderr
%170 = load i8**, i8*** %5
%171 = load i32, i32* %13
%172 = sext i32 %171 to i64
%173 = getelementptr inbounds i8*, i8** %170, i64 %172
%174 = load i8*, i8** %173
%175 = call i32 @fprintf(i32 %169, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.14, i64 0, i64 0), i8* %174)
br label %176
176: ; preds = %168, %161
br label %177
177: ; preds = %176, %134
br label %178
178: ; preds = %177, %110
br label %179
179: ; preds = %178, %86
br label %180
180: ; preds = %179, %69
br label %181
181: ; preds = %180
%182 = load i32, i32* %13
%183 = add nsw i32 %182, 1
store i32 %183, i32* %13
br label %49
184: ; preds = %49
%185 = load i32, i32* @AF_UNIX
%186 = load i32, i32* @SOCK_DGRAM
%187 = call i32 @socket(i32 %185, i32 %186, i32 0)
store i32 %187, i32* %6
%188 = icmp slt i32 %187, 0
br i1 %188, label %189, label %192
189: ; preds = %184
%190 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i64 0, i64 0))
%191 = call i32 @exit(i32 1)
unreachable
192: ; preds = %184
%193 = load i32, i32* @AF_UNIX
%194 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %7, i32 0, i32 1
store i32 %193, i32* %194
%195 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %7, i32 0, i32 0
%196 = load i32, i32* %195
%197 = load i8*, i8** %9
%198 = call i32 @strcpy(i32 %196, i8* %197)
%199 = getelementptr inbounds [20 x i8*], [20 x i8*]* %11, i64 0, i64 0
%200 = load i8*, i8** %199
store i8* %200, i8** %10
store i32 0, i32* %14
br label %201
201: ; preds = %278, %192
%202 = load i32, i32* %17
%203 = icmp ne i32 %202, 0
br i1 %203, label %204, label %281
204: ; preds = %201
%205 = load i32, i32* %16
%206 = icmp ne i32 %205, 0
br i1 %206, label %207, label %216
207: ; preds = %204
%208 = getelementptr inbounds [500 x i8], [500 x i8]* %8, i64 0, i64 0
%209 = load i32, i32* %14
%210 = sext i32 %209 to i64
%211 = getelementptr inbounds [20 x i8*], [20 x i8*]* %11, i64 0, i64 %210
%212 = load i8*, i8** %211
%213 = load i32, i32* %16
%214 = add nsw i32 %213, 1
store i32 %214, i32* %16
%215 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %208, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0), i8* %212, i32 %213)
br label %223
216: ; preds = %204
%217 = getelementptr inbounds [500 x i8], [500 x i8]* %8, i64 0, i64 0
%218 = load i32, i32* %14
%219 = sext i32 %218 to i64
%220 = getelementptr inbounds [20 x i8*], [20 x i8*]* %11, i64 0, i64 %219
%221 = load i8*, i8** %220
%222 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %217, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.17, i64 0, i64 0), i8* %221)
br label %223
223: ; preds = %216, %207
%224 = load i32, i32* %18
%225 = icmp sgt i32 %224, 0
br i1 %225, label %226, label %257
226: ; preds = %223
%227 = load i32, i32* %6
%228 = load i32, i32* %14
%229 = sext i32 %228 to i64
%230 = getelementptr inbounds [20 x i8*], [20 x i8*]* %11, i64 0, i64 %229
%231 = load i8*, i8** %230
%232 = load i32, i32* %14
%233 = sext i32 %232 to i64
%234 = getelementptr inbounds [20 x i8*], [20 x i8*]* %11, i64 0, i64 %233
%235 = load i8*, i8** %234
%236 = call i64 @strlen(i8* %235)
%237 = add nsw i64 %236, 1
%238 = call i32 @fsetxattr(i32 %227, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.18, i64 0, i64 0), i8* %231, i64 %237, i32 0)
store i32 %238, i32* %13
%239 = load i32, i32* %14
%240 = sext i32 %239 to i64
%241 = getelementptr inbounds [20 x i8*], [20 x i8*]* %11, i64 0, i64 %240
%242 = load i8*, i8** %241
store i8* %242, i8** %10
%243 = load i32, i32* %14
%244 = add nsw i32 %243, 1
store i32 %244, i32* %14
%245 = load i32, i32* %18
%246 = icmp sge i32 %244, %245
br i1 %246, label %247, label %248
247: ; preds = %226
store i32 0, i32* %14
br label %248
248: ; preds = %247, %226
%249 = load i32, i32* %13
%250 = icmp slt i32 %249, 0
br i1 %250, label %251, label %256
251: ; preds = %248
%252 = load i32, i32* @stderr
%253 = load i8*, i8** %10
%254 = call i32 @fprintf(i32 %252, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.19, i64 0, i64 0), i8* %253)
%255 = call i32 @perror(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.20, i64 0, i64 0))
br label %256
256: ; preds = %251, %248
br label %257
257: ; preds = %256, %223
%258 = load i32, i32* %6
%259 = getelementptr inbounds [500 x i8], [500 x i8]* %8, i64 0, i64 0
%260 = getelementptr inbounds [500 x i8], [500 x i8]* %8, i64 0, i64 0
%261 = call i64 @strlen(i8* %260)
%262 = add nsw i64 %261, 1
%263 = bitcast %struct.sockaddr_un* %7 to %struct.sockaddr*
%264 = call i64 @sendto(i32 %258, i8* %259, i64 %262, i32 0, %struct.sockaddr* %263, i32 8)
%265 = icmp slt i64 %264, 0
br i1 %265, label %266, label %271
266: ; preds = %257
%267 = load i32, i32* @stderr
%268 = load i8*, i8** %10
%269 = call i32 @fprintf(i32 %267, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.19, i64 0, i64 0), i8* %268)
%270 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.21, i64 0, i64 0))
br label %271
271: ; preds = %266, %257
%272 = load i32, i32* %15
%273 = icmp sgt i32 %272, 0
br i1 %273, label %274, label %277
274: ; preds = %271
%275 = load i32, i32* %15
%276 = call i32 @sleep(i32 %275)
br label %277
277: ; preds = %274, %271
br label %278
278: ; preds = %277
%279 = load i32, i32* %17
%280 = add nsw i32 %279, -1
store i32 %280, i32* %17
br label %201
281: ; preds = %201
%282 = load i32, i32* %6
%283 = call i32 @close(i32 %282)
ret i32 0
}

LLVM IR (-O2):
%struct.sockaddr_un = type { i32, i32 }
%struct.sockaddr = type { i32 }
@.str = [18 x i8] c"/tmp/testsmackuds\00"
@.str.1 = [30 x i8] c"/proc/self/attr/smack.current\00"
@O_RDONLY = global i32 0
@.str.2 = [15 x i8] c"/smack/current\00"
@.str.3 = [24 x i8] c"/proc/self/attr/current\00"
@.str.4 = [3 x i8] c"-c\00"
@.str.5 = [8 x i8] c"--count\00"
@.str.6 = [3 x i8] c"-s\00"
@.str.7 = [8 x i8] c"--sleep\00"
@.str.8 = [3 x i8] c"-n\00"
@.str.9 = [9 x i8] c"--number\00"
@.str.10 = [3 x i8] c"-o\00"
@.str.11 = [6 x i8] c"--out\00"
@.str.12 = [3 x i8] c"-p\00"
@.str.13 = [7 x i8] c"--path\00"
@stderr = global i32 0
@.str.14 = [18 x i8] c"arg \22%s\22 ignored\0A\00"
@AF_UNIX = global i32 0
@SOCK_DGRAM = global i32 0
@.str.15 = [7 x i8] c"socket\00"
@.str.16 = [6 x i8] c"%s %d\00"
@.str.18 = [22 x i8] c"security.SMACK64IPOUT\00"
@.str.19 = [13 x i8] c"Failed \22%s\22 \00"
@.str.20 = [10 x i8] c"fsetxattr\00"
@.str.21 = [7 x i8] c"sendto\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.sockaddr_un
%4 = alloca [500 x i8]
%5 = alloca [20 x i8*]
%6 = alloca [256 x i8]
%7 = bitcast %struct.sockaddr_un* %3 to i8*
%8 = getelementptr inbounds [500 x i8], [500 x i8]* %4, i64 0, i64 0
%9 = bitcast [20 x i8*]* %5 to i8*
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%11 = load i32, i32* @O_RDONLY
%12 = tail call i32 @open(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %21
14: ; preds = %2
%15 = load i32, i32* @O_RDONLY
%16 = tail call i32 @open(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %15)
%17 = icmp slt i32 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %14
%19 = load i32, i32* @O_RDONLY
%20 = tail call i32 @open(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i32 %19)
br label %21
21: ; preds = %2, %18, %14
%22 = phi i32 [ %20, %18 ], [ %16, %14 ], [ %12, %2 ]
%23 = call i32 @read(i32 %22, i8* %10, i32 256)
%24 = tail call i32 @close(i32 %22)
%25 = sext i32 %23 to i64
%26 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 %25
store i8 0, i8* %26
%27 = call i8* @strchr(i8* %10, i8 signext 10)
%28 = icmp eq i8* %27, null
br i1 %28, label %30, label %29
29: ; preds = %21
store i8 0, i8* %27
br label %30
30: ; preds = %29, %21
%31 = getelementptr inbounds [20 x i8*], [20 x i8*]* %5, i64 0, i64 0
store i8* %10, i8** %31
%32 = icmp sgt i32 %0, 1
br i1 %32, label %33, label %119
33: ; preds = %30, %110
%34 = phi i32 [ %116, %110 ], [ 0, %30 ]
%35 = phi i32 [ %115, %110 ], [ -1, %30 ]
%36 = phi i32 [ %114, %110 ], [ 0, %30 ]
%37 = phi i32 [ %113, %110 ], [ 1, %30 ]
%38 = phi i32 [ %117, %110 ], [ 1, %30 ]
%39 = phi i8* [ %111, %110 ], [ getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), %30 ]
%40 = sext i32 %38 to i64
%41 = getelementptr inbounds i8*, i8** %1, i64 %40
%42 = load i8*, i8** %41
%43 = call i64 @strcmp(i8* %42, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%44 = icmp eq i64 %43, 0
br i1 %44, label %110, label %45
45: ; preds = %33
%46 = load i8*, i8** %41
%47 = call i64 @strcmp(i8* %46, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%48 = icmp eq i64 %47, 0
br i1 %48, label %110, label %49
49: ; preds = %45
%50 = load i8*, i8** %41
%51 = call i64 @strcmp(i8* %50, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%52 = icmp eq i64 %51, 0
br i1 %52, label %57, label %53
53: ; preds = %49
%54 = load i8*, i8** %41
%55 = call i64 @strcmp(i8* %54, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
%56 = icmp eq i64 %55, 0
br i1 %56, label %57, label %63
57: ; preds = %53, %49
%58 = add nsw i32 %38, 1
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds i8*, i8** %1, i64 %59
%61 = load i8*, i8** %60
%62 = call i32 @atoi(i8* %61)
br label %110
63: ; preds = %53
%64 = load i8*, i8** %41
%65 = call i64 @strcmp(i8* %64, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%66 = icmp eq i64 %65, 0
br i1 %66, label %71, label %67
67: ; preds = %63
%68 = load i8*, i8** %41
%69 = call i64 @strcmp(i8* %68, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0))
%70 = icmp eq i64 %69, 0
br i1 %70, label %71, label %77
71: ; preds = %67, %63
%72 = add nsw i32 %38, 1
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds i8*, i8** %1, i64 %73
%75 = load i8*, i8** %74
%76 = call i32 @atoi(i8* %75)
br label %110
77: ; preds = %67
%78 = load i8*, i8** %41
%79 = call i64 @strcmp(i8* %78, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
%80 = icmp eq i64 %79, 0
br i1 %80, label %85, label %81
81: ; preds = %77
%82 = load i8*, i8** %41
%83 = call i64 @strcmp(i8* %82, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0))
%84 = icmp eq i64 %83, 0
br i1 %84, label %85, label %93
85: ; preds = %81, %77
%86 = add nsw i32 %38, 1
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds i8*, i8** %1, i64 %87
%89 = load i8*, i8** %88
%90 = add nsw i32 %34, 1
%91 = sext i32 %34 to i64
%92 = getelementptr inbounds [20 x i8*], [20 x i8*]* %5, i64 0, i64 %91
store i8* %89, i8** %92
br label %110
93: ; preds = %81
%94 = load i8*, i8** %41
%95 = call i64 @strcmp(i8* %94, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0))
%96 = icmp eq i64 %95, 0
br i1 %96, label %101, label %97
97: ; preds = %93
%98 = load i8*, i8** %41
%99 = call i64 @strcmp(i8* %98, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0))
%100 = icmp eq i64 %99, 0
br i1 %100, label %101, label %106
101: ; preds = %97, %93
%102 = add nsw i32 %38, 1
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds i8*, i8** %1, i64 %103
%105 = load i8*, i8** %104
br label %110
106: ; preds = %97
%107 = load i32, i32* @stderr
%108 = load i8*, i8** %41
%109 = call i32 @fprintf(i32 %107, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.14, i64 0, i64 0), i8* %108)
br label %110
110: ; preds = %33, %45, %71, %101, %106, %85, %57
%111 = phi i8* [ %39, %57 ], [ %39, %71 ], [ %39, %85 ], [ %105, %101 ], [ %39, %106 ], [ %39, %45 ], [ %39, %33 ]
%112 = phi i32 [ %58, %57 ], [ %72, %71 ], [ %86, %85 ], [ %102, %101 ], [ %38, %106 ], [ %38, %45 ], [ %38, %33 ]
%113 = phi i32 [ %62, %57 ], [ %37, %71 ], [ %37, %85 ], [ %37, %101 ], [ %37, %106 ], [ %37, %45 ], [ %37, %33 ]
%114 = phi i32 [ %36, %57 ], [ %36, %71 ], [ %36, %85 ], [ %36, %101 ], [ %36, %106 ], [ 1, %45 ], [ 1, %33 ]
%115 = phi i32 [ %35, %57 ], [ %76, %71 ], [ %35, %85 ], [ %35, %101 ], [ %35, %106 ], [ %35, %45 ], [ %35, %33 ]
%116 = phi i32 [ %34, %57 ], [ %34, %71 ], [ %90, %85 ], [ %34, %101 ], [ %34, %106 ], [ %34, %45 ], [ %34, %33 ]
%117 = add nsw i32 %112, 1
%118 = icmp slt i32 %117, %0
br i1 %118, label %33, label %119
119: ; preds = %110, %30
%120 = phi i8* [ getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), %30 ], [ %111, %110 ]
%121 = phi i32 [ 1, %30 ], [ %113, %110 ]
%122 = phi i32 [ 0, %30 ], [ %114, %110 ]
%123 = phi i32 [ -1, %30 ], [ %115, %110 ]
%124 = phi i32 [ 0, %30 ], [ %116, %110 ]
%125 = load i32, i32* @AF_UNIX
%126 = load i32, i32* @SOCK_DGRAM
%127 = call i32 @socket(i32 %125, i32 %126, i32 0)
%128 = icmp slt i32 %127, 0
br i1 %128, label %129, label %132
129: ; preds = %119
%130 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i64 0, i64 0))
%131 = call i32 @exit(i32 1)
unreachable
132: ; preds = %119
%133 = load i32, i32* @AF_UNIX
%134 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %3, i64 0, i32 1
store i32 %133, i32* %134
%135 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %3, i64 0, i32 0
%136 = load i32, i32* %135
%137 = call i32 @strcpy(i32 %136, i8* %120)
%138 = icmp eq i32 %123, 0
br i1 %138, label %189, label %139
139: ; preds = %132
%140 = load i8*, i8** %31
%141 = icmp sgt i32 %124, 0
%142 = bitcast %struct.sockaddr_un* %3 to %struct.sockaddr*
%143 = icmp sgt i32 %121, 0
br label %144
144: ; preds = %139, %186
%145 = phi i32 [ %123, %139 ], [ %187, %186 ]
%146 = phi i32 [ %122, %139 ], [ %159, %186 ]
%147 = phi i32 [ 0, %139 ], [ %174, %186 ]
%148 = phi i8* [ %140, %139 ], [ %173, %186 ]
%149 = icmp eq i32 %146, 0
%150 = sext i32 %147 to i64
%151 = getelementptr inbounds [20 x i8*], [20 x i8*]* %5, i64 0, i64 %150
%152 = load i8*, i8** %151
br i1 %149, label %156, label %153
153: ; preds = %144
%154 = add nsw i32 %146, 1
%155 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %8, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0), i8* %152, i32 %146)
br label %158
156: ; preds = %144
%157 = call i8* bitcast (i32 (i32, i8*)* @strcpy to i8* (i8*, i8*)*)(i8* %8, i8* %152)
br label %158
158: ; preds = %156, %153
%159 = phi i32 [ %154, %153 ], [ 0, %156 ]
br i1 %141, label %160, label %172
160: ; preds = %158
%161 = call i64 @strlen(i8* dereferenceable(1) %152)
%162 = add nsw i64 %161, 1
%163 = call i32 @fsetxattr(i32 %127, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.18, i64 0, i64 0), i8* %152, i64 %162, i32 0)
%164 = add nsw i32 %147, 1
%165 = icmp slt i32 %164, %124
%166 = select i1 %165, i32 %164, i32 0
%167 = icmp slt i32 %163, 0
br i1 %167, label %168, label %172
168: ; preds = %160
%169 = load i32, i32* @stderr
%170 = call i32 @fprintf(i32 %169, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.19, i64 0, i64 0), i8* %152)
%171 = call i32 @perror(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.20, i64 0, i64 0))
br label %172
172: ; preds = %160, %168, %158
%173 = phi i8* [ %152, %168 ], [ %152, %160 ], [ %148, %158 ]
%174 = phi i32 [ %166, %168 ], [ %166, %160 ], [ %147, %158 ]
%175 = call i64 @strlen(i8* %8)
%176 = add nsw i64 %175, 1
%177 = call i64 @sendto(i32 %127, i8* %8, i64 %176, i32 0, %struct.sockaddr* %142, i32 8)
%178 = icmp slt i64 %177, 0
br i1 %178, label %179, label %183
179: ; preds = %172
%180 = load i32, i32* @stderr
%181 = call i32 @fprintf(i32 %180, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.19, i64 0, i64 0), i8* %173)
%182 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.21, i64 0, i64 0))
br label %183
183: ; preds = %179, %172
br i1 %143, label %184, label %186
184: ; preds = %183
%185 = call i32 @sleep(i32 %121)
br label %186
186: ; preds = %183, %184
%187 = add nsw i32 %145, -1
%188 = icmp eq i32 %187, 0
br i1 %188, label %189, label %144
189: ; preds = %186, %132
%190 = call i32 @close(i32 %127)
ret i32 0
}