#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 */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct udphdr {
  int dummy;
};
struct TYPE_2__ {
  int /*<<< orphan*/ s_addr;
};
struct sockaddr_in {
  TYPE_1__ sin_addr;
  void *sin_port;
  void *sin_family;
};
struct sockaddr {
  int dummy;
};
struct iphdr {
  int dummy;
};
typedef int /*<<< orphan*/ sin;

/* Variables and functions */
void *AF_INET;
int /*<<< orphan*/ IPPROTO_TCP;
int /*<<< orphan*/ PF_INET;
int /*<<< orphan*/ SOCK_STREAM;
void *atoi(char *);
scalar_t__ bind(int, struct sockaddr *, int);
int /*<<< orphan*/ bzero(char *, int);
int /*<<< orphan*/ close(int);
scalar_t__ connect(int, struct sockaddr *, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int fsetxattr(int, char *, char *, int, int /*<<< orphan*/);
void *htons(unsigned short);
int /*<<< orphan*/ inet_addr(char *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, char *, ...);
int read(int, char *, int);
scalar_t__ send(int, char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ sleep(int);
int smack_self(char *);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
int main(int argc, char *argv[]) {
  int sock;
  struct sockaddr_in sin;
  unsigned short local_port = 8001;
  unsigned short remote_port = 8000;
  char buffer[1500];
  char rbuffer[1500];
  char *remote_ip_str = "127.0.0.1";
  char *cp;
  char *olabel = NULL;
  int i;
  int sent;
  int reply = 0;
  int replies = 0;
  int nap = 1;
  int count = 0;
  int number = -1;
  for (i = 1; i < argc; i++) {
    if (strcmp(argv[i], "-c") == 0 || strcmp(argv[i], "--count") == 0)
      count = 1;
    else if (strcmp(argv[i], "-h") == 0 || strcmp(argv[i], "--host") == 0)
      remote_ip_str = argv[++i];
    else if (strcmp(argv[i], "-p") == 0 || strcmp(argv[i], "--port") == 0)
      remote_port = atoi(argv[++i]);
    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)
      olabel = argv[++i];
    else if (strcmp(argv[i], "-r") == 0 || strcmp(argv[i], "--reply") == 0) {
      reply = 1;
    } else
      fprintf(stderr, "arg \"%s\" ignored\n", argv[i]);
  }
  if ((sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) {
    perror("socket");
    exit(1);
  }
  if (olabel != NULL) {
    i = fsetxattr(sock, "security.SMACK64IPOUT", olabel, strlen(olabel) + 1, 0);
    if (i < 0) {
      perror("Setting output Smack label");
      exit(1);
    }
    i = fsetxattr(sock, "security.SMACK64IPIN", olabel, strlen(olabel) + 1, 0);
    if (i < 0) {
      perror("Setting input Smack label");
      exit(1);
    }
  }
  bzero((char *)&sin, sizeof(sin));
  sin.sin_family = AF_INET;
  sin.sin_port = htons(local_port);
  for (i = 0; i < 1000; i++) {
    if ((bind(sock, (struct sockaddr *)&sin, sizeof(sin))) >= 0)
      break;
    sin.sin_port = htons(local_port++);
  }
  if (i >= 1000) {
    fprintf(stderr, "failed 1000 binds\n");
    exit(1);
  }
  bzero((char *)&sin, sizeof(sin));
  sin.sin_family = AF_INET;
  sin.sin_port = htons(remote_port);
  sin.sin_addr.s_addr = inet_addr(remote_ip_str);
  if (connect(sock, (struct sockaddr *)&sin, sizeof(sin)) < 0) {
    perror("connect");
    exit(1);
  }
  if (olabel != NULL) {
    strcpy(buffer, olabel);
    i = strlen(buffer);
  } else if ((i = smack_self(buffer)) < 0) {
    fprintf(stderr, "Cannot read process Smack label.\n");
    exit(1);
  }
  cp = buffer + i;
  for (; number != 0; number--) {
    if (count != 0)
      sprintf(cp, " %d", count++);
    sent = strlen(buffer) + 1;
    if (send(sock, buffer, sent, 0) < 0)
      perror("send");
    if (reply != 0) {
      rbuffer[0] = '\0';
      i = read(sock, rbuffer,
               (1500 - ((sizeof(struct iphdr) + sizeof(struct udphdr)))));
      if (i >= 0)
        rbuffer[i] = '\0';
      if (i <= sent && strcmp(buffer, rbuffer) == 0) {
        replies++;
        printf("Reply: \"%s\", %d right %d\n", rbuffer, i, replies);
      } else {
        printf("Reply: \"%s\" isn't \"%s\", %d %d\n", rbuffer, buffer, sent, i);
      }
    }
    if (nap > 0)
      sleep(nap);
  }
  close(sock);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movw   $0x1f41,-0x32(%rbp)
movw   $0x1f40,-0x34(%rbp)
lea    0xd84(%rip),%rax
mov    %rax,-0xbf8(%rbp)
movq   $0x0,-0xc08(%rbp)
movl   $0x0,-0xc14(%rbp)
movl   $0x0,-0xc18(%rbp)
movl   $0x1,-0xc1c(%rbp)
movl   $0x0,-0xc20(%rbp)
movl   $0xffffffff,-0xc24(%rbp)
ff ff ff
movl   $0x1,-0xc0c(%rbp)
mov    -0xc0c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1622 <main+0x3d2>
mov    -0x10(%rbp),%rax
movslq -0xc0c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd1b(%rip),%rsi
call   10d0 <strcmp@plt>
cmp    $0x0,%rax
je     1323 <main+0xd3>
mov    -0x10(%rbp),%rax
movslq -0xc0c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xcf9(%rip),%rsi
call   10d0 <strcmp@plt>
cmp    $0x0,%rax
jne    1332 <main+0xe2>
movl   $0x1,-0xc20(%rbp)
jmp    1609 <main+0x3b9>
mov    -0x10(%rbp),%rax
movslq -0xc0c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xccd(%rip),%rsi
call   10d0 <strcmp@plt>
cmp    $0x0,%rax
je     137c <main+0x12c>
mov    -0x10(%rbp),%rax
movslq -0xc0c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xcab(%rip),%rsi
call   10d0 <strcmp@plt>
cmp    $0x0,%rax
jne    13a2 <main+0x152>
mov    -0x10(%rbp),%rax
mov    -0xc0c(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0xc0c(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0xbf8(%rbp)
jmp    1604 <main+0x3b4>
mov    -0x10(%rbp),%rax
movslq -0xc0c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xc67(%rip),%rsi
call   10d0 <strcmp@plt>
cmp    $0x0,%rax
je     13ec <main+0x19c>
mov    -0x10(%rbp),%rax
movslq -0xc0c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xc45(%rip),%rsi
call   10d0 <strcmp@plt>
cmp    $0x0,%rax
jne    1414 <main+0x1c4>
mov    -0x10(%rbp),%rax
mov    -0xc0c(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0xc0c(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1120 <atoi@plt>
mov    %ax,-0x34(%rbp)
jmp    15ff <main+0x3af>
mov    -0x10(%rbp),%rax
movslq -0xc0c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xbff(%rip),%rsi
call   10d0 <strcmp@plt>
cmp    $0x0,%rax
je     145e <main+0x20e>
mov    -0x10(%rbp),%rax
movslq -0xc0c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xbdd(%rip),%rsi
call   10d0 <strcmp@plt>
cmp    $0x0,%rax
jne    1488 <main+0x238>
mov    -0x10(%rbp),%rax
mov    -0xc0c(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0xc0c(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1120 <atoi@plt>
mov    %eax,-0xc1c(%rbp)
jmp    15fa <main+0x3aa>
mov    -0x10(%rbp),%rax
movslq -0xc0c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xb96(%rip),%rsi
call   10d0 <strcmp@plt>
cmp    $0x0,%rax
je     14d2 <main+0x282>
mov    -0x10(%rbp),%rax
movslq -0xc0c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xb74(%rip),%rsi
call   10d0 <strcmp@plt>
cmp    $0x0,%rax
jne    14fc <main+0x2ac>
mov    -0x10(%rbp),%rax
mov    -0xc0c(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0xc0c(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1120 <atoi@plt>
mov    %eax,-0xc24(%rbp)
jmp    15f5 <main+0x3a5>
mov    -0x10(%rbp),%rax
movslq -0xc0c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xb2e(%rip),%rsi
call   10d0 <strcmp@plt>
cmp    $0x0,%rax
je     1546 <main+0x2f6>
mov    -0x10(%rbp),%rax
movslq -0xc0c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xb0c(%rip),%rsi
call   10d0 <strcmp@plt>
cmp    $0x0,%rax
jne    156c <main+0x31c>
mov    -0x10(%rbp),%rax
mov    -0xc0c(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0xc0c(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0xc08(%rbp)
jmp    15f0 <main+0x3a0>
mov    -0x10(%rbp),%rax
movslq -0xc0c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xac7(%rip),%rsi
call   10d0 <strcmp@plt>
cmp    $0x0,%rax
je     15b6 <main+0x366>
mov    -0x10(%rbp),%rax
movslq -0xc0c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xaa5(%rip),%rsi
call   10d0 <strcmp@plt>
cmp    $0x0,%rax
jne    15c5 <main+0x375>
movl   $0x1,-0xc14(%rbp)
jmp    15eb <main+0x39b>
mov    0x2a04(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
movslq -0xc0c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xa70(%rip),%rsi
mov    $0x0,%al
call   10e0 <fprintf@plt>
jmp    15f0 <main+0x3a0>
jmp    15f5 <main+0x3a5>
jmp    15fa <main+0x3aa>
jmp    15ff <main+0x3af>
jmp    1604 <main+0x3b4>
jmp    1609 <main+0x3b9>
jmp    160e <main+0x3be>
mov    -0xc0c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc0c(%rbp)
jmp    12ca <main+0x7a>
mov    0x2997(%rip),%rax
mov    (%rax),%edi
mov    0x2996(%rip),%rax
mov    (%rax),%esi
mov    0x29a5(%rip),%rax
mov    (%rax),%edx
call   1170 <socket@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jge    1664 <main+0x414>
lea    0xa11(%rip),%rdi
call   1100 <perror@plt>
mov    $0x1,%edi
call   1140 <exit@plt>
cmpq   $0x0,-0xc08(%rbp)
je     1751 <main+0x501>
mov    -0x14(%rbp),%eax
mov    %eax,-0xc34(%rbp)
mov    -0xc08(%rbp),%rax
mov    %rax,-0xc30(%rbp)
mov    -0xc08(%rbp),%rdi
call   1060 <strlen@plt>
mov    -0xc34(%rbp),%edi
mov    -0xc30(%rbp),%rdx
mov    %eax,%ecx
add    $0x1,%ecx
lea    0x9bf(%rip),%rsi
xor    %r8d,%r8d
call   1040 <fsetxattr@plt>
mov    %eax,-0xc0c(%rbp)
cmpl   $0x0,-0xc0c(%rbp)
jge    16df <main+0x48f>
lea    0x9b3(%rip),%rdi
call   1100 <perror@plt>
mov    $0x1,%edi
call   1140 <exit@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0xc44(%rbp)
mov    -0xc08(%rbp),%rax
mov    %rax,-0xc40(%rbp)
mov    -0xc08(%rbp),%rdi
call   1060 <strlen@plt>
mov    -0xc44(%rbp),%edi
mov    -0xc40(%rbp),%rdx
mov    %eax,%ecx
add    $0x1,%ecx
lea    0x983(%rip),%rsi
xor    %r8d,%r8d
call   1040 <fsetxattr@plt>
mov    %eax,-0xc0c(%rbp)
cmpl   $0x0,-0xc0c(%rbp)
jge    174c <main+0x4fc>
lea    0x976(%rip),%rdi
call   1100 <perror@plt>
mov    $0x1,%edi
call   1140 <exit@plt>
jmp    1751 <main+0x501>
lea    -0x30(%rbp),%rdi
mov    $0x18,%esi
call   1110 <bzero@plt>
mov    0x2882(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
movzwl -0x32(%rbp),%edi
call   1070 <htons@plt>
mov    %rax,-0x28(%rbp)
movl   $0x0,-0xc0c(%rbp)
cmpl   $0x3e8,-0xc0c(%rbp)
jge    17e3 <main+0x593>
mov    -0x14(%rbp),%edi
lea    -0x30(%rbp),%rsi
mov    $0x18,%edx
call   10f0 <bind@plt>
cmp    $0x0,%rax
jl     17b4 <main+0x564>
jmp    17e3 <main+0x593>
mov    -0x32(%rbp),%ax
mov    %ax,%cx
add    $0x1,%cx
mov    %cx,-0x32(%rbp)
movzwl %ax,%edi
call   1070 <htons@plt>
mov    %rax,-0x28(%rbp)
mov    -0xc0c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc0c(%rbp)
jmp    1784 <main+0x534>
cmpl   $0x3e8,-0xc0c(%rbp)
jl     1814 <main+0x5c4>
mov    0x27d6(%rip),%rax
mov    (%rax),%edi
lea    0x8ca(%rip),%rsi
mov    $0x0,%al
call   10e0 <fprintf@plt>
mov    $0x1,%edi
call   1140 <exit@plt>
lea    -0x30(%rbp),%rdi
mov    $0x18,%esi
call   1110 <bzero@plt>
mov    0x27bf(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
movzwl -0x34(%rbp),%edi
call   1070 <htons@plt>
mov    %rax,-0x28(%rbp)
mov    -0xbf8(%rbp),%rdi
call   10c0 <inet_addr@plt>
mov    %eax,-0x30(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x30(%rbp),%rsi
mov    $0x18,%edx
call   1150 <connect@plt>
cmp    $0x0,%rax
jge    187d <main+0x62d>
lea    0x872(%rip),%rdi
call   1100 <perror@plt>
mov    $0x1,%edi
call   1140 <exit@plt>
cmpq   $0x0,-0xc08(%rbp)
je     18b5 <main+0x665>
lea    -0x610(%rbp),%rdi
mov    -0xc08(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x610(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,-0xc0c(%rbp)
jmp    18f6 <main+0x6a6>
lea    -0x610(%rbp),%rdi
call   1050 <smack_self@plt>
mov    %eax,-0xc0c(%rbp)
cmp    $0x0,%eax
jge    18f1 <main+0x6a1>
mov    0x26f9(%rip),%rax
mov    (%rax),%edi
lea    0x808(%rip),%rsi
mov    $0x0,%al
call   10e0 <fprintf@plt>
mov    $0x1,%edi
call   1140 <exit@plt>
jmp    18f6 <main+0x6a6>
lea    -0x610(%rbp),%rax
movslq -0xc0c(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0xc00(%rbp)
cmpl   $0x0,-0xc24(%rbp)
je     1a9b <main+0x84b>
cmpl   $0x0,-0xc20(%rbp)
je     194c <main+0x6fc>
mov    -0xc00(%rbp),%rdi
mov    -0xc20(%rbp),%edx
mov    %edx,%eax
add    $0x1,%eax
mov    %eax,-0xc20(%rbp)
lea    0x7c3(%rip),%rsi
call   1130 <sprintf@plt>
lea    -0x610(%rbp),%rdi
call   1060 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0xc10(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x610(%rbp),%rsi
mov    -0xc10(%rbp),%edx
xor    %ecx,%ecx
call   1080 <send@plt>
cmp    $0x0,%rax
jge    198e <main+0x73e>
lea    0x785(%rip),%rdi
call   1100 <perror@plt>
cmpl   $0x0,-0xc14(%rbp)
je     1a6a <main+0x81a>
movb   $0x0,-0xbf0(%rbp)
mov    -0x14(%rbp),%edi
lea    -0xbf0(%rbp),%rsi
mov    $0x5d4,%edx
call   10b0 <read@plt>
mov    %eax,-0xc0c(%rbp)
cmpl   $0x0,-0xc0c(%rbp)
jl     19d8 <main+0x788>
movslq -0xc0c(%rbp),%rax
movb   $0x0,-0xbf0(%rbp,%rax,1)
mov    -0xc0c(%rbp),%eax
cmp    -0xc10(%rbp),%eax
jg     1a3c <main+0x7ec>
lea    -0x610(%rbp),%rdi
lea    -0xbf0(%rbp),%rsi
call   10d0 <strcmp@plt>
cmp    $0x0,%rax
jne    1a3c <main+0x7ec>
mov    -0xc18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc18(%rbp)
lea    -0xbf0(%rbp),%rsi
mov    -0xc0c(%rbp),%edx
mov    -0xc18(%rbp),%ecx
lea    0x6e3(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
jmp    1a65 <main+0x815>
lea    -0xbf0(%rbp),%rsi
lea    -0x610(%rbp),%rdx
mov    -0xc10(%rbp),%ecx
mov    -0xc0c(%rbp),%r8d
lea    0x6cf(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
jmp    1a6a <main+0x81a>
cmpl   $0x0,-0xc1c(%rbp)
jle    1a82 <main+0x832>
mov    -0xc1c(%rbp),%edi
call   1160 <sleep@plt>
jmp    1a87 <main+0x837>
mov    -0xc24(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc24(%rbp)
jmp    190e <main+0x6be>
mov    -0x14(%rbp),%edi
call   10a0 <close@plt>
xor    %eax,%eax
add    $0xc50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xc08,%rsp
cmp    $0x2,%edi
jl     14c9 <main+0x279>
mov    %rsi,%rbp
mov    %edi,%ebx
lea    0xd8a(%rip),%rax
mov    %rax,0x10(%rsp)
mov    $0x1f40,%ax
mov    %rax,0x8(%rsp)
mov    $0x1,%eax
mov    %rax,0x18(%rsp)
mov    $0xffffffff,%r12d
xor    %r15d,%r15d
movl   $0x0,0x4(%rsp)
mov    $0x1,%r14d
xor    %eax,%eax
mov    %rax,0x20(%rsp)
jmp    12c3 <main+0x73>
xchg   %ax,%ax
mov    $0x1,%r15d
add    $0x1,%r14d
cmp    %ebx,%r14d
jge    1500 <main+0x2b0>
movslq %r14d,%r13
mov    0x0(%rbp,%r13,8),%rdi
lea    0xd38(%rip),%rsi
call   10d0 <strcmp@plt>
test   %rax,%rax
je     12b0 <main+0x60>
mov    0x0(%rbp,%r13,8),%rdi
lea    0xd25(%rip),%rsi
call   10d0 <strcmp@plt>
test   %rax,%rax
je     12b0 <main+0x60>
mov    0x0(%rbp,%r13,8),%rdi
lea    0xd17(%rip),%rsi
call   10d0 <strcmp@plt>
test   %rax,%rax
je     1450 <main+0x200>
mov    0x0(%rbp,%r13,8),%rdi
lea    0xd00(%rip),%rsi
call   10d0 <strcmp@plt>
test   %rax,%rax
je     1450 <main+0x200>
mov    0x0(%rbp,%r13,8),%rdi
lea    0xced(%rip),%rsi
call   10d0 <strcmp@plt>
test   %rax,%rax
je     1463 <main+0x213>
mov    0x0(%rbp,%r13,8),%rdi
lea    0xcd6(%rip),%rsi
call   10d0 <strcmp@plt>
test   %rax,%rax
je     1463 <main+0x213>
mov    0x0(%rbp,%r13,8),%rdi
lea    0xcc3(%rip),%rsi
call   10d0 <strcmp@plt>
test   %rax,%rax
je     147b <main+0x22b>
mov    0x0(%rbp,%r13,8),%rdi
lea    0xcac(%rip),%rsi
call   10d0 <strcmp@plt>
test   %rax,%rax
je     147b <main+0x22b>
mov    0x0(%rbp,%r13,8),%rdi
lea    0xc9a(%rip),%rsi
call   10d0 <strcmp@plt>
test   %rax,%rax
je     1493 <main+0x243>
mov    0x0(%rbp,%r13,8),%rdi
lea    0xc83(%rip),%rsi
call   10d0 <strcmp@plt>
test   %rax,%rax
je     1493 <main+0x243>
mov    0x0(%rbp,%r13,8),%rdi
lea    0xc72(%rip),%rsi
call   10d0 <strcmp@plt>
test   %rax,%rax
je     14a9 <main+0x259>
mov    0x0(%rbp,%r13,8),%rdi
lea    0xc5b(%rip),%rsi
call   10d0 <strcmp@plt>
test   %rax,%rax
je     14a9 <main+0x259>
mov    0x0(%rbp,%r13,8),%rdi
lea    0xc47(%rip),%rsi
call   10d0 <strcmp@plt>
test   %rax,%rax
je     14bc <main+0x26c>
mov    0x0(%rbp,%r13,8),%rdi
lea    0xc30(%rip),%rsi
call   10d0 <strcmp@plt>
test   %rax,%rax
je     14bc <main+0x26c>
mov    0x2b9f(%rip),%rax
mov    (%rax),%edi
mov    0x0(%rbp,%r13,8),%rdx
lea    0xc15(%rip),%rsi
xor    %eax,%eax
call   10e0 <fprintf@plt>
jmp    12b6 <main+0x66>
nopl   0x0(%rax,%rax,1)
lea    0x1(%r13),%r14d
mov    0x8(%rbp,%r13,8),%rax
mov    %rax,0x10(%rsp)
jmp    12b6 <main+0x66>
lea    0x1(%r13),%r14d
mov    0x8(%rbp,%r13,8),%rdi
call   1120 <atoi@plt>
mov    %rax,0x8(%rsp)
jmp    12b6 <main+0x66>
lea    0x1(%r13),%r14d
mov    0x8(%rbp,%r13,8),%rdi
call   1120 <atoi@plt>
mov    %rax,0x18(%rsp)
jmp    12b6 <main+0x66>
lea    0x1(%r13),%r14d
mov    0x8(%rbp,%r13,8),%rdi
call   1120 <atoi@plt>
mov    %rax,%r12
jmp    12b6 <main+0x66>
lea    0x1(%r13),%r14d
mov    0x8(%rbp,%r13,8),%rax
mov    %rax,0x20(%rsp)
jmp    12b6 <main+0x66>
movl   $0x1,0x4(%rsp)
jmp    12b6 <main+0x66>
mov    $0xffffffff,%r12d
mov    $0x1,%eax
mov    %rax,0x18(%rsp)
xor    %eax,%eax
mov    %rax,0x20(%rsp)
mov    $0x1f40,%ax
mov    %rax,0x8(%rsp)
lea    0xb10(%rip),%rax
mov    %rax,0x10(%rsp)
movl   $0x0,0x4(%rsp)
xor    %r15d,%r15d
mov    0x2ab9(%rip),%rax
mov    (%rax),%edi
mov    0x2ab8(%rip),%rax
mov    (%rax),%esi
mov    0x2ac7(%rip),%rax
mov    (%rax),%edx
call   1170 <socket@plt>
test   %eax,%eax
js     17ee <main+0x59e>
mov    %eax,%r14d
mov    0x20(%rsp),%rbx
test   %rbx,%rbx
je     1585 <main+0x335>
mov    %rbx,%rdi
call   1060 <strlen@plt>
lea    0x1(%rax),%ecx
lea    0xb26(%rip),%rsi
mov    %r14d,%edi
mov    %rbx,%rdx
xor    %r8d,%r8d
call   1040 <fsetxattr@plt>
test   %eax,%eax
js     1800 <main+0x5b0>
mov    %rbx,%rdi
call   1060 <strlen@plt>
lea    0x1(%rax),%ecx
lea    0xb2f(%rip),%rsi
mov    %r14d,%edi
mov    %rbx,%rdx
xor    %r8d,%r8d
call   1040 <fsetxattr@plt>
test   %eax,%eax
js     1809 <main+0x5b9>
mov    %r12,%r13
lea    0x28(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x18,%esi
call   1110 <bzero@plt>
mov    0x2a47(%rip),%r12
mov    (%r12),%rax
mov    %rax,0x38(%rsp)
mov    $0x1f41,%edi
call   1070 <htons@plt>
mov    %rax,0x30(%rsp)
mov    $0xfffffc18,%ebp
xchg   %ax,%ax
mov    %r14d,%edi
mov    %rbx,%rsi
mov    $0x18,%edx
call   10f0 <bind@plt>
test   %rax,%rax
jns    160d <main+0x3bd>
lea    0x2329(%rbp),%eax
movzwl %ax,%edi
call   1070 <htons@plt>
mov    %rax,0x30(%rsp)
inc    %ebp
jne    15c0 <main+0x370>
mov    0x29dd(%rip),%rax
mov    (%rax),%edi
lea    0xad1(%rip),%rsi
xor    %eax,%eax
call   10e0 <fprintf@plt>
mov    $0x1,%edi
call   1140 <exit@plt>
lea    0x28(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x18,%esi
call   1110 <bzero@plt>
mov    (%r12),%rax
mov    %rax,0x38(%rsp)
movzwl 0x8(%rsp),%edi
call   1070 <htons@plt>
mov    %rax,0x30(%rsp)
mov    0x10(%rsp),%rdi
call   10c0 <inet_addr@plt>
mov    %eax,0x28(%rsp)
mov    %r14d,%edi
mov    %rbx,%rsi
mov    $0x18,%edx
call   1150 <connect@plt>
test   %rax,%rax
js     17f7 <main+0x5a7>
mov    0x20(%rsp),%rsi
test   %rsi,%rsi
mov    0x18(%rsp),%r12
je     1687 <main+0x437>
lea    0x40(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1060 <strlen@plt>
mov    %r15,%rdx
jmp    169c <main+0x44c>
lea    0x40(%rsp),%rdi
call   1050 <smack_self@plt>
test   %eax,%eax
mov    %r15,%rdx
js     181f <main+0x5cf>
test   %r13d,%r13d
je     17d2 <main+0x582>
cltq
add    %rsp,%rax
add    $0x40,%rax
mov    %rax,0x10(%rsp)
movl   $0x0,0x8(%rsp)
jmp    16cd <main+0x47d>
nopl   (%rax)
mov    %r15d,%edx
add    $0xffffffff,%r13d
je     17d2 <main+0x582>
mov    $0x0,%r15d
test   %edx,%edx
je     16ec <main+0x49c>
lea    0x1(%rdx),%r15d
mov    0x10(%rsp),%rdi
lea    0xa23(%rip),%rsi
call   1130 <sprintf@plt>
lea    0x40(%rsp),%rbp
mov    %rbp,%rdi
call   1060 <strlen@plt>
mov    %eax,%ebx
add    $0x1,%ebx
mov    %r14d,%edi
mov    %rbp,%rsi
mov    %ebx,%edx
xor    %ecx,%ecx
call   1080 <send@plt>
test   %rax,%rax
js     17b9 <main+0x569>
cmpl   $0x0,0x4(%rsp)
je     1783 <main+0x533>
movb   $0x0,0x620(%rsp)
mov    %r14d,%edi
lea    0x620(%rsp),%r12
mov    %r12,%rsi
mov    $0x5d4,%edx
call   10b0 <read@plt>
mov    %eax,%ebp
test   %eax,%eax
js     174d <main+0x4fd>
mov    %ebp,%eax
movb   $0x0,0x620(%rsp,%rax,1)
cmp    %ebx,%ebp
jg     1763 <main+0x513>
lea    0x40(%rsp),%rdi
mov    %r12,%rsi
call   10d0 <strcmp@plt>
test   %rax,%rax
je     1799 <main+0x549>
lea    0x9c3(%rip),%rdi
mov    %r12,%rsi
lea    0x40(%rsp),%rdx
mov    %ebx,%ecx
mov    %ebp,%r8d
xor    %eax,%eax
call   1090 <printf@plt>
mov    0x18(%rsp),%r12
test   %r12d,%r12d
jle    16c0 <main+0x470>
mov    %r12d,%edi
call   1160 <sleep@plt>
jmp    16c0 <main+0x470>
mov    0x8(%rsp),%ecx
add    $0x1,%ecx
lea    0x96c(%rip),%rdi
mov    %r12,%rsi
mov    %ebp,%edx
mov    %ecx,0x8(%rsp)
xor    %eax,%eax
call   1090 <printf@plt>
jmp    177e <main+0x52e>
lea    0x94e(%rip),%rdi
call   1100 <perror@plt>
cmpl   $0x0,0x4(%rsp)
jne    171d <main+0x4cd>
jmp    1783 <main+0x533>
mov    %r14d,%edi
call   10a0 <close@plt>
xor    %eax,%eax
add    $0xc08,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x871(%rip),%rdi
jmp    1810 <main+0x5c0>
lea    0x8e2(%rip),%rdi
jmp    1810 <main+0x5c0>
lea    0x87c(%rip),%rdi
jmp    1810 <main+0x5c0>
lea    0x8a3(%rip),%rdi
call   1100 <perror@plt>
mov    $0x1,%edi
call   1140 <exit@plt>
mov    0x27aa(%rip),%rax
mov    (%rax),%edi
lea    0x8b9(%rip),%rsi
jmp    15fc <main+0x3ac>

LLVM IR (-O0):
%struct.sockaddr_in = type { %struct.TYPE_2__, i8*, i8* }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [10 x i8] c"127.0.0.1\00"
@.str.1 = [3 x i8] c"-c\00"
@.str.2 = [8 x i8] c"--count\00"
@.str.3 = [3 x i8] c"-h\00"
@.str.4 = [7 x i8] c"--host\00"
@.str.5 = [3 x i8] c"-p\00"
@.str.6 = [7 x i8] c"--port\00"
@.str.7 = [3 x i8] c"-s\00"
@.str.8 = [8 x i8] c"--sleep\00"
@.str.9 = [3 x i8] c"-n\00"
@.str.10 = [9 x i8] c"--number\00"
@.str.11 = [3 x i8] c"-o\00"
@.str.12 = [6 x i8] c"--out\00"
@.str.13 = [3 x i8] c"-r\00"
@.str.14 = [8 x i8] c"--reply\00"
@stderr = global i32 0
@.str.15 = [18 x i8] c"arg \22%s\22 ignored\0A\00"
@PF_INET = global i32 0
@SOCK_STREAM = global i32 0
@IPPROTO_TCP = global i32 0
@.str.16 = [7 x i8] c"socket\00"
@.str.17 = [22 x i8] c"security.SMACK64IPOUT\00"
@.str.18 = [27 x i8] c"Setting output Smack label\00"
@.str.19 = [21 x i8] c"security.SMACK64IPIN\00"
@.str.20 = [26 x i8] c"Setting input Smack label\00"
@AF_INET = global i8* null
@.str.21 = [19 x i8] c"failed 1000 binds\0A\00"
@.str.22 = [8 x i8] c"connect\00"
@.str.23 = [34 x i8] c"Cannot read process Smack label.\0A\00"
@.str.24 = [4 x i8] c" %d\00"
@.str.25 = [5 x i8] c"send\00"
@.str.26 = [26 x i8] c"Reply: \22%s\22, %d right %d\0A\00"
@.str.27 = [31 x i8] c"Reply: \22%s\22 isn't \22%s\22, %d %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca %struct.sockaddr_in
%8 = alloca i16
%9 = alloca i16
%10 = alloca [1500 x i8]
%11 = alloca [1500 x i8]
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i16 8001, i16* %8
store i16 8000, i16* %9
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8** %12
store i8* null, i8** %14
store i32 0, i32* %17
store i32 0, i32* %18
store i32 1, i32* %19
store i32 0, i32* %20
store i32 -1, i32* %21
store i32 1, i32* %15
br label %22
22: ; preds = %196, %2
%23 = load i32, i32* %15
%24 = load i32, i32* %4
%25 = icmp slt i32 %23, %24
br i1 %25, label %26, label %199
26: ; preds = %22
%27 = load i8**, i8*** %5
%28 = load i32, i32* %15
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8*, i8** %27, i64 %29
%31 = load i8*, i8** %30
%32 = call i64 @strcmp(i8* %31, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%33 = icmp eq i64 %32, 0
br i1 %33, label %42, label %34
34: ; preds = %26
%35 = load i8**, i8*** %5
%36 = load i32, i32* %15
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds i8*, i8** %35, i64 %37
%39 = load i8*, i8** %38
%40 = call i64 @strcmp(i8* %39, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%41 = icmp eq i64 %40, 0
br i1 %41, label %42, label %43
42: ; preds = %34, %26
store i32 1, i32* %20
br label %195
43: ; preds = %34
%44 = load i8**, i8*** %5
%45 = load i32, i32* %15
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds i8*, i8** %44, i64 %46
%48 = load i8*, i8** %47
%49 = call i64 @strcmp(i8* %48, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%50 = icmp eq i64 %49, 0
br i1 %50, label %59, label %51
51: ; preds = %43
%52 = load i8**, i8*** %5
%53 = load i32, i32* %15
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds i8*, i8** %52, i64 %54
%56 = load i8*, i8** %55
%57 = call i64 @strcmp(i8* %56, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%58 = icmp eq i64 %57, 0
br i1 %58, label %59, label %66
59: ; preds = %51, %43
%60 = load i8**, i8*** %5
%61 = load i32, i32* %15
%62 = add nsw i32 %61, 1
store i32 %62, i32* %15
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds i8*, i8** %60, i64 %63
%65 = load i8*, i8** %64
store i8* %65, i8** %12
br label %194
66: ; preds = %51
%67 = load i8**, i8*** %5
%68 = load i32, i32* %15
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds i8*, i8** %67, i64 %69
%71 = load i8*, i8** %70
%72 = call i64 @strcmp(i8* %71, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%73 = icmp eq i64 %72, 0
br i1 %73, label %82, label %74
74: ; preds = %66
%75 = load i8**, i8*** %5
%76 = load i32, i32* %15
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds i8*, i8** %75, i64 %77
%79 = load i8*, i8** %78
%80 = call i64 @strcmp(i8* %79, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%81 = icmp eq i64 %80, 0
br i1 %81, label %82, label %91
82: ; preds = %74, %66
%83 = load i8**, i8*** %5
%84 = load i32, i32* %15
%85 = add nsw i32 %84, 1
store i32 %85, i32* %15
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds i8*, i8** %83, i64 %86
%88 = load i8*, i8** %87
%89 = call i8* @atoi(i8* %88)
%90 = ptrtoint i8* %89 to i16
store i16 %90, i16* %9
br label %193
91: ; preds = %74
%92 = load i8**, i8*** %5
%93 = load i32, i32* %15
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds i8*, i8** %92, i64 %94
%96 = load i8*, i8** %95
%97 = call i64 @strcmp(i8* %96, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%98 = icmp eq i64 %97, 0
br i1 %98, label %107, label %99
99: ; preds = %91
%100 = load i8**, i8*** %5
%101 = load i32, i32* %15
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds i8*, i8** %100, i64 %102
%104 = load i8*, i8** %103
%105 = call i64 @strcmp(i8* %104, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
%106 = icmp eq i64 %105, 0
br i1 %106, label %107, label %116
107: ; preds = %99, %91
%108 = load i8**, i8*** %5
%109 = load i32, i32* %15
%110 = add nsw i32 %109, 1
store i32 %110, i32* %15
%111 = sext i32 %110 to i64
%112 = getelementptr inbounds i8*, i8** %108, i64 %111
%113 = load i8*, i8** %112
%114 = call i8* @atoi(i8* %113)
%115 = ptrtoint i8* %114 to i32
store i32 %115, i32* %19
br label %192
116: ; preds = %99
%117 = load i8**, i8*** %5
%118 = load i32, i32* %15
%119 = sext i32 %118 to i64
%120 = getelementptr inbounds i8*, i8** %117, i64 %119
%121 = load i8*, i8** %120
%122 = call i64 @strcmp(i8* %121, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
%123 = icmp eq i64 %122, 0
br i1 %123, label %132, label %124
124: ; preds = %116
%125 = load i8**, i8*** %5
%126 = load i32, i32* %15
%127 = sext i32 %126 to i64
%128 = getelementptr inbounds i8*, i8** %125, i64 %127
%129 = load i8*, i8** %128
%130 = call i64 @strcmp(i8* %129, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0))
%131 = icmp eq i64 %130, 0
br i1 %131, label %132, label %141
132: ; preds = %124, %116
%133 = load i8**, i8*** %5
%134 = load i32, i32* %15
%135 = add nsw i32 %134, 1
store i32 %135, i32* %15
%136 = sext i32 %135 to i64
%137 = getelementptr inbounds i8*, i8** %133, i64 %136
%138 = load i8*, i8** %137
%139 = call i8* @atoi(i8* %138)
%140 = ptrtoint i8* %139 to i32
store i32 %140, i32* %21
br label %191
141: ; preds = %124
%142 = load i8**, i8*** %5
%143 = load i32, i32* %15
%144 = sext i32 %143 to i64
%145 = getelementptr inbounds i8*, i8** %142, i64 %144
%146 = load i8*, i8** %145
%147 = call i64 @strcmp(i8* %146, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
%148 = icmp eq i64 %147, 0
br i1 %148, label %157, label %149
149: ; preds = %141
%150 = load i8**, i8*** %5
%151 = load i32, i32* %15
%152 = sext i32 %151 to i64
%153 = getelementptr inbounds i8*, i8** %150, i64 %152
%154 = load i8*, i8** %153
%155 = call i64 @strcmp(i8* %154, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0))
%156 = icmp eq i64 %155, 0
br i1 %156, label %157, label %164
157: ; preds = %149, %141
%158 = load i8**, i8*** %5
%159 = load i32, i32* %15
%160 = add nsw i32 %159, 1
store i32 %160, i32* %15
%161 = sext i32 %160 to i64
%162 = getelementptr inbounds i8*, i8** %158, i64 %161
%163 = load i8*, i8** %162
store i8* %163, i8** %14
br label %190
164: ; preds = %149
%165 = load i8**, i8*** %5
%166 = load i32, i32* %15
%167 = sext i32 %166 to i64
%168 = getelementptr inbounds i8*, i8** %165, i64 %167
%169 = load i8*, i8** %168
%170 = call i64 @strcmp(i8* %169, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
%171 = icmp eq i64 %170, 0
br i1 %171, label %180, label %172
172: ; preds = %164
%173 = load i8**, i8*** %5
%174 = load i32, i32* %15
%175 = sext i32 %174 to i64
%176 = getelementptr inbounds i8*, i8** %173, i64 %175
%177 = load i8*, i8** %176
%178 = call i64 @strcmp(i8* %177, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.14, i64 0, i64 0))
%179 = icmp eq i64 %178, 0
br i1 %179, label %180, label %181
180: ; preds = %172, %164
store i32 1, i32* %17
br label %189
181: ; preds = %172
%182 = load i32, i32* @stderr
%183 = load i8**, i8*** %5
%184 = load i32, i32* %15
%185 = sext i32 %184 to i64
%186 = getelementptr inbounds i8*, i8** %183, i64 %185
%187 = load i8*, i8** %186
%188 = call i32 (i32, i8*, ...) @fprintf(i32 %182, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.15, i64 0, i64 0), i8* %187)
br label %189
189: ; preds = %181, %180
br label %190
190: ; preds = %189, %157
br label %191
191: ; preds = %190, %132
br label %192
192: ; preds = %191, %107
br label %193
193: ; preds = %192, %82
br label %194
194: ; preds = %193, %59
br label %195
195: ; preds = %194, %42
br label %196
196: ; preds = %195
%197 = load i32, i32* %15
%198 = add nsw i32 %197, 1
store i32 %198, i32* %15
br label %22
199: ; preds = %22
%200 = load i32, i32* @PF_INET
%201 = load i32, i32* @SOCK_STREAM
%202 = load i32, i32* @IPPROTO_TCP
%203 = call i32 @socket(i32 %200, i32 %201, i32 %202)
store i32 %203, i32* %6
%204 = icmp slt i32 %203, 0
br i1 %204, label %205, label %208
205: ; preds = %199
%206 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.16, i64 0, i64 0))
%207 = call i32 @exit(i32 1)
unreachable
208: ; preds = %199
%209 = load i8*, i8** %14
%210 = icmp ne i8* %209, null
br i1 %210, label %211, label %236
211: ; preds = %208
%212 = load i32, i32* %6
%213 = load i8*, i8** %14
%214 = load i8*, i8** %14
%215 = call i32 @strlen(i8* %214)
%216 = add nsw i32 %215, 1
%217 = call i32 @fsetxattr(i32 %212, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.17, i64 0, i64 0), i8* %213, i32 %216, i32 0)
store i32 %217, i32* %15
%218 = load i32, i32* %15
%219 = icmp slt i32 %218, 0
br i1 %219, label %220, label %223
220: ; preds = %211
%221 = call i32 @perror(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.18, i64 0, i64 0))
%222 = call i32 @exit(i32 1)
unreachable
223: ; preds = %211
%224 = load i32, i32* %6
%225 = load i8*, i8** %14
%226 = load i8*, i8** %14
%227 = call i32 @strlen(i8* %226)
%228 = add nsw i32 %227, 1
%229 = call i32 @fsetxattr(i32 %224, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.19, i64 0, i64 0), i8* %225, i32 %228, i32 0)
store i32 %229, i32* %15
%230 = load i32, i32* %15
%231 = icmp slt i32 %230, 0
br i1 %231, label %232, label %235
232: ; preds = %223
%233 = call i32 @perror(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.20, i64 0, i64 0))
%234 = call i32 @exit(i32 1)
unreachable
235: ; preds = %223
br label %236
236: ; preds = %235, %208
%237 = bitcast %struct.sockaddr_in* %7 to i8*
%238 = call i32 @bzero(i8* %237, i32 24)
%239 = load i8*, i8** @AF_INET
%240 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i32 0, i32 2
store i8* %239, i8** %240
%241 = load i16, i16* %8
%242 = call i8* @htons(i16 zeroext %241)
%243 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i32 0, i32 1
store i8* %242, i8** %243
store i32 0, i32* %15
br label %244
244: ; preds = %258, %236
%245 = load i32, i32* %15
%246 = icmp slt i32 %245, 1000
br i1 %246, label %247, label %261
247: ; preds = %244
%248 = load i32, i32* %6
%249 = bitcast %struct.sockaddr_in* %7 to %struct.sockaddr*
%250 = call i64 @bind(i32 %248, %struct.sockaddr* %249, i32 24)
%251 = icmp sge i64 %250, 0
br i1 %251, label %252, label %253
252: ; preds = %247
br label %261
253: ; preds = %247
%254 = load i16, i16* %8
%255 = add i16 %254, 1
store i16 %255, i16* %8
%256 = call i8* @htons(i16 zeroext %254)
%257 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i32 0, i32 1
store i8* %256, i8** %257
br label %258
258: ; preds = %253
%259 = load i32, i32* %15
%260 = add nsw i32 %259, 1
store i32 %260, i32* %15
br label %244
261: ; preds = %252, %244
%262 = load i32, i32* %15
%263 = icmp sge i32 %262, 1000
br i1 %263, label %264, label %268
264: ; preds = %261
%265 = load i32, i32* @stderr
%266 = call i32 (i32, i8*, ...) @fprintf(i32 %265, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.21, i64 0, i64 0))
%267 = call i32 @exit(i32 1)
unreachable
268: ; preds = %261
%269 = bitcast %struct.sockaddr_in* %7 to i8*
%270 = call i32 @bzero(i8* %269, i32 24)
%271 = load i8*, i8** @AF_INET
%272 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i32 0, i32 2
store i8* %271, i8** %272
%273 = load i16, i16* %9
%274 = call i8* @htons(i16 zeroext %273)
%275 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i32 0, i32 1
store i8* %274, i8** %275
%276 = load i8*, i8** %12
%277 = call i32 @inet_addr(i8* %276)
%278 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i32 0, i32 0
%279 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %278, i32 0, i32 0
store i32 %277, i32* %279
%280 = load i32, i32* %6
%281 = bitcast %struct.sockaddr_in* %7 to %struct.sockaddr*
%282 = call i64 @connect(i32 %280, %struct.sockaddr* %281, i32 24)
%283 = icmp slt i64 %282, 0
br i1 %283, label %284, label %287
284: ; preds = %268
%285 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.22, i64 0, i64 0))
%286 = call i32 @exit(i32 1)
unreachable
287: ; preds = %268
%288 = load i8*, i8** %14
%289 = icmp ne i8* %288, null
br i1 %289, label %290, label %296
290: ; preds = %287
%291 = getelementptr inbounds [1500 x i8], [1500 x i8]* %10, i64 0, i64 0
%292 = load i8*, i8** %14
%293 = call i32 @strcpy(i8* %291, i8* %292)
%294 = getelementptr inbounds [1500 x i8], [1500 x i8]* %10, i64 0, i64 0
%295 = call i32 @strlen(i8* %294)
store i32 %295, i32* %15
br label %305
296: ; preds = %287
%297 = getelementptr inbounds [1500 x i8], [1500 x i8]* %10, i64 0, i64 0
%298 = call i32 @smack_self(i8* %297)
store i32 %298, i32* %15
%299 = icmp slt i32 %298, 0
br i1 %299, label %300, label %304
300: ; preds = %296
%301 = load i32, i32* @stderr
%302 = call i32 (i32, i8*, ...) @fprintf(i32 %301, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.23, i64 0, i64 0))
%303 = call i32 @exit(i32 1)
unreachable
304: ; preds = %296
br label %305
305: ; preds = %304, %290
%306 = getelementptr inbounds [1500 x i8], [1500 x i8]* %10, i64 0, i64 0
%307 = load i32, i32* %15
%308 = sext i32 %307 to i64
%309 = getelementptr inbounds i8, i8* %306, i64 %308
store i8* %309, i8** %13
br label %310
310: ; preds = %376, %305
%311 = load i32, i32* %21
%312 = icmp ne i32 %311, 0
br i1 %312, label %313, label %379
313: ; preds = %310
%314 = load i32, i32* %20
%315 = icmp ne i32 %314, 0
br i1 %315, label %316, label %321
316: ; preds = %313
%317 = load i8*, i8** %13
%318 = load i32, i32* %20
%319 = add nsw i32 %318, 1
store i32 %319, i32* %20
%320 = call i32 @sprintf(i8* %317, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.24, i64 0, i64 0), i32 %318)
br label %321
321: ; preds = %316, %313
%322 = getelementptr inbounds [1500 x i8], [1500 x i8]* %10, i64 0, i64 0
%323 = call i32 @strlen(i8* %322)
%324 = add nsw i32 %323, 1
store i32 %324, i32* %16
%325 = load i32, i32* %6
%326 = getelementptr inbounds [1500 x i8], [1500 x i8]* %10, i64 0, i64 0
%327 = load i32, i32* %16
%328 = call i64 @send(i32 %325, i8* %326, i32 %327, i32 0)
%329 = icmp slt i64 %328, 0
br i1 %329, label %330, label %332
330: ; preds = %321
%331 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.25, i64 0, i64 0))
br label %332
332: ; preds = %330, %321
%333 = load i32, i32* %17
%334 = icmp ne i32 %333, 0
br i1 %334, label %335, label %369
335: ; preds = %332
%336 = getelementptr inbounds [1500 x i8], [1500 x i8]* %11, i64 0, i64 0
store i8 0, i8* %336
%337 = load i32, i32* %6
%338 = getelementptr inbounds [1500 x i8], [1500 x i8]* %11, i64 0, i64 0
%339 = call i32 @read(i32 %337, i8* %338, i32 1492)
store i32 %339, i32* %15
%340 = load i32, i32* %15
%341 = icmp sge i32 %340, 0
br i1 %341, label %342, label %346
342: ; preds = %335
%343 = load i32, i32* %15
%344 = sext i32 %343 to i64
%345 = getelementptr inbounds [1500 x i8], [1500 x i8]* %11, i64 0, i64 %344
store i8 0, i8* %345
br label %346
346: ; preds = %342, %335
%347 = load i32, i32* %15
%348 = load i32, i32* %16
%349 = icmp sle i32 %347, %348
br i1 %349, label %350, label %362
350: ; preds = %346
%351 = getelementptr inbounds [1500 x i8], [1500 x i8]* %10, i64 0, i64 0
%352 = getelementptr inbounds [1500 x i8], [1500 x i8]* %11, i64 0, i64 0
%353 = call i64 @strcmp(i8* %351, i8* %352)
%354 = icmp eq i64 %353, 0
br i1 %354, label %355, label %362
355: ; preds = %350
%356 = load i32, i32* %18
%357 = add nsw i32 %356, 1
store i32 %357, i32* %18
%358 = getelementptr inbounds [1500 x i8], [1500 x i8]* %11, i64 0, i64 0
%359 = load i32, i32* %15
%360 = load i32, i32* %18
%361 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.26, i64 0, i64 0), i8* %358, i32 %359, i32 %360)
br label %368
362: ; preds = %350, %346
%363 = getelementptr inbounds [1500 x i8], [1500 x i8]* %11, i64 0, i64 0
%364 = getelementptr inbounds [1500 x i8], [1500 x i8]* %10, i64 0, i64 0
%365 = load i32, i32* %16
%366 = load i32, i32* %15
%367 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.27, i64 0, i64 0), i8* %363, i8* %364, i32 %365, i32 %366)
br label %368
368: ; preds = %362, %355
br label %369
369: ; preds = %368, %332
%370 = load i32, i32* %19
%371 = icmp sgt i32 %370, 0
br i1 %371, label %372, label %375
372: ; preds = %369
%373 = load i32, i32* %19
%374 = call i32 @sleep(i32 %373)
br label %375
375: ; preds = %372, %369
br label %376
376: ; preds = %375
%377 = load i32, i32* %21
%378 = add nsw i32 %377, -1
store i32 %378, i32* %21
br label %310
379: ; preds = %310
%380 = load i32, i32* %6
%381 = call i32 @close(i32 %380)
ret i32 0
}

LLVM IR (-O2):
%struct.sockaddr_in = type { %struct.TYPE_2__, i8*, i8* }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [10 x i8] c"127.0.0.1\00"
@.str.1 = [3 x i8] c"-c\00"
@.str.2 = [8 x i8] c"--count\00"
@.str.3 = [3 x i8] c"-h\00"
@.str.4 = [7 x i8] c"--host\00"
@.str.5 = [3 x i8] c"-p\00"
@.str.6 = [7 x i8] c"--port\00"
@.str.7 = [3 x i8] c"-s\00"
@.str.8 = [8 x i8] c"--sleep\00"
@.str.9 = [3 x i8] c"-n\00"
@.str.10 = [9 x i8] c"--number\00"
@.str.11 = [3 x i8] c"-o\00"
@.str.12 = [6 x i8] c"--out\00"
@.str.13 = [3 x i8] c"-r\00"
@.str.14 = [8 x i8] c"--reply\00"
@stderr = global i32 0
@.str.15 = [18 x i8] c"arg \22%s\22 ignored\0A\00"
@PF_INET = global i32 0
@SOCK_STREAM = global i32 0
@IPPROTO_TCP = global i32 0
@.str.16 = [7 x i8] c"socket\00"
@.str.17 = [22 x i8] c"security.SMACK64IPOUT\00"
@.str.18 = [27 x i8] c"Setting output Smack label\00"
@.str.19 = [21 x i8] c"security.SMACK64IPIN\00"
@.str.20 = [26 x i8] c"Setting input Smack label\00"
@AF_INET = global i8* null
@.str.21 = [19 x i8] c"failed 1000 binds\0A\00"
@.str.22 = [8 x i8] c"connect\00"
@.str.23 = [34 x i8] c"Cannot read process Smack label.\0A\00"
@.str.24 = [4 x i8] c" %d\00"
@.str.25 = [5 x i8] c"send\00"
@.str.26 = [26 x i8] c"Reply: \22%s\22, %d right %d\0A\00"
@.str.27 = [31 x i8] c"Reply: \22%s\22 isn't \22%s\22, %d %d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.sockaddr_in
%4 = alloca [1500 x i8]
%5 = alloca [1500 x i8]
%6 = bitcast %struct.sockaddr_in* %3 to i8*
%7 = getelementptr inbounds [1500 x i8], [1500 x i8]* %4, i64 0, i64 0
%8 = getelementptr inbounds [1500 x i8], [1500 x i8]* %5, i64 0, i64 0
%9 = icmp sgt i32 %0, 1
br i1 %9, label %10, label %125
10: ; preds = %2, %114
%11 = phi i32 [ %122, %114 ], [ -1, %2 ]
%12 = phi i32 [ %121, %114 ], [ 0, %2 ]
%13 = phi i32 [ %120, %114 ], [ 1, %2 ]
%14 = phi i32 [ %119, %114 ], [ 0, %2 ]
%15 = phi i32 [ %123, %114 ], [ 1, %2 ]
%16 = phi i8* [ %117, %114 ], [ null, %2 ]
%17 = phi i16 [ %116, %114 ], [ 8000, %2 ]
%18 = phi i8* [ %115, %114 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), %2 ]
%19 = sext i32 %15 to i64
%20 = getelementptr inbounds i8*, i8** %1, i64 %19
%21 = load i8*, i8** %20
%22 = tail call i64 @strcmp(i8* %21, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%23 = icmp eq i64 %22, 0
br i1 %23, label %114, label %24
24: ; preds = %10
%25 = load i8*, i8** %20
%26 = tail call i64 @strcmp(i8* %25, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
br i1 %27, label %114, label %28
28: ; preds = %24
%29 = load i8*, i8** %20
%30 = tail call i64 @strcmp(i8* %29, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%31 = icmp eq i64 %30, 0
br i1 %31, label %36, label %32
32: ; preds = %28
%33 = load i8*, i8** %20
%34 = tail call i64 @strcmp(i8* %33, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%35 = icmp eq i64 %34, 0
br i1 %35, label %36, label %41
36: ; preds = %32, %28
%37 = add nsw i32 %15, 1
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds i8*, i8** %1, i64 %38
%40 = load i8*, i8** %39
br label %114
41: ; preds = %32
%42 = load i8*, i8** %20
%43 = tail call i64 @strcmp(i8* %42, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%44 = icmp eq i64 %43, 0
br i1 %44, label %49, label %45
45: ; preds = %41
%46 = load i8*, i8** %20
%47 = tail call i64 @strcmp(i8* %46, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%48 = icmp eq i64 %47, 0
br i1 %48, label %49, label %57
49: ; preds = %45, %41
%50 = add nsw i32 %15, 1
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds i8*, i8** %1, i64 %51
%53 = load i8*, i8** %52
%54 = tail call i8* @atoi(i8* %53)
%55 = ptrtoint i8* %54 to i64
%56 = trunc i64 %55 to i16
br label %114
57: ; preds = %45
%58 = load i8*, i8** %20
%59 = tail call i64 @strcmp(i8* %58, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%60 = icmp eq i64 %59, 0
br i1 %60, label %65, label %61
61: ; preds = %57
%62 = load i8*, i8** %20
%63 = tail call i64 @strcmp(i8* %62, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
%64 = icmp eq i64 %63, 0
br i1 %64, label %65, label %73
65: ; preds = %61, %57
%66 = add nsw i32 %15, 1
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds i8*, i8** %1, i64 %67
%69 = load i8*, i8** %68
%70 = tail call i8* @atoi(i8* %69)
%71 = ptrtoint i8* %70 to i64
%72 = trunc i64 %71 to i32
br label %114
73: ; preds = %61
%74 = load i8*, i8** %20
%75 = tail call i64 @strcmp(i8* %74, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
%76 = icmp eq i64 %75, 0
br i1 %76, label %81, label %77
77: ; preds = %73
%78 = load i8*, i8** %20
%79 = tail call i64 @strcmp(i8* %78, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0))
%80 = icmp eq i64 %79, 0
br i1 %80, label %81, label %89
81: ; preds = %77, %73
%82 = add nsw i32 %15, 1
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds i8*, i8** %1, i64 %83
%85 = load i8*, i8** %84
%86 = tail call i8* @atoi(i8* %85)
%87 = ptrtoint i8* %86 to i64
%88 = trunc i64 %87 to i32
br label %114
89: ; preds = %77
%90 = load i8*, i8** %20
%91 = tail call i64 @strcmp(i8* %90, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
%92 = icmp eq i64 %91, 0
br i1 %92, label %97, label %93
93: ; preds = %89
%94 = load i8*, i8** %20
%95 = tail call i64 @strcmp(i8* %94, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0))
%96 = icmp eq i64 %95, 0
br i1 %96, label %97, label %102
97: ; preds = %93, %89
%98 = add nsw i32 %15, 1
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds i8*, i8** %1, i64 %99
%101 = load i8*, i8** %100
br label %114
102: ; preds = %93
%103 = load i8*, i8** %20
%104 = tail call i64 @strcmp(i8* %103, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
%105 = icmp eq i64 %104, 0
br i1 %105, label %114, label %106
106: ; preds = %102
%107 = load i8*, i8** %20
%108 = tail call i64 @strcmp(i8* %107, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.14, i64 0, i64 0))
%109 = icmp eq i64 %108, 0
br i1 %109, label %114, label %110
110: ; preds = %106
%111 = load i32, i32* @stderr
%112 = load i8*, i8** %20
%113 = tail call i32 (i32, i8*, ...) @fprintf(i32 %111, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.15, i64 0, i64 0), i8* %112)
br label %114
114: ; preds = %102, %106, %10, %24, %49, %81, %110, %97, %65, %36
%115 = phi i8* [ %40, %36 ], [ %18, %49 ], [ %18, %65 ], [ %18, %81 ], [ %18, %97 ], [ %18, %110 ], [ %18, %24 ], [ %18, %10 ], [ %18, %106 ], [ %18, %102 ]
%116 = phi i16 [ %17, %36 ], [ %56, %49 ], [ %17, %65 ], [ %17, %81 ], [ %17, %97 ], [ %17, %110 ], [ %17, %24 ], [ %17, %10 ], [ %17, %106 ], [ %17, %102 ]
%117 = phi i8* [ %16, %36 ], [ %16, %49 ], [ %16, %65 ], [ %16, %81 ], [ %101, %97 ], [ %16, %110 ], [ %16, %24 ], [ %16, %10 ], [ %16, %106 ], [ %16, %102 ]
%118 = phi i32 [ %37, %36 ], [ %50, %49 ], [ %66, %65 ], [ %82, %81 ], [ %98, %97 ], [ %15, %110 ], [ %15, %24 ], [ %15, %10 ], [ %15, %106 ], [ %15, %102 ]
%119 = phi i32 [ %14, %36 ], [ %14, %49 ], [ %14, %65 ], [ %14, %81 ], [ %14, %97 ], [ %14, %110 ], [ %14, %24 ], [ %14, %10 ], [ 1, %106 ], [ 1, %102 ]
%120 = phi i32 [ %13, %36 ], [ %13, %49 ], [ %72, %65 ], [ %13, %81 ], [ %13, %97 ], [ %13, %110 ], [ %13, %24 ], [ %13, %10 ], [ %13, %106 ], [ %13, %102 ]
%121 = phi i32 [ %12, %36 ], [ %12, %49 ], [ %12, %65 ], [ %12, %81 ], [ %12, %97 ], [ %12, %110 ], [ 1, %24 ], [ 1, %10 ], [ %12, %106 ], [ %12, %102 ]
%122 = phi i32 [ %11, %36 ], [ %11, %49 ], [ %11, %65 ], [ %88, %81 ], [ %11, %97 ], [ %11, %110 ], [ %11, %24 ], [ %11, %10 ], [ %11, %106 ], [ %11, %102 ]
%123 = add nsw i32 %118, 1
%124 = icmp slt i32 %123, %0
br i1 %124, label %10, label %125
125: ; preds = %114, %2
%126 = phi i8* [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), %2 ], [ %115, %114 ]
%127 = phi i16 [ 8000, %2 ], [ %116, %114 ]
%128 = phi i8* [ null, %2 ], [ %117, %114 ]
%129 = phi i32 [ 0, %2 ], [ %119, %114 ]
%130 = phi i32 [ 1, %2 ], [ %120, %114 ]
%131 = phi i32 [ 0, %2 ], [ %121, %114 ]
%132 = phi i32 [ -1, %2 ], [ %122, %114 ]
%133 = load i32, i32* @PF_INET
%134 = load i32, i32* @SOCK_STREAM
%135 = load i32, i32* @IPPROTO_TCP
%136 = tail call i32 @socket(i32 %133, i32 %134, i32 %135)
%137 = icmp slt i32 %136, 0
br i1 %137, label %138, label %141
138: ; preds = %125
%139 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.16, i64 0, i64 0))
%140 = tail call i32 @exit(i32 1)
unreachable
141: ; preds = %125
%142 = icmp eq i8* %128, null
br i1 %142, label %159, label %143
143: ; preds = %141
%144 = tail call i32 @strlen(i8* %128)
%145 = add nsw i32 %144, 1
%146 = tail call i32 @fsetxattr(i32 %136, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.17, i64 0, i64 0), i8* %128, i32 %145, i32 0)
%147 = icmp slt i32 %146, 0
br i1 %147, label %148, label %151
148: ; preds = %143
%149 = tail call i32 @perror(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.18, i64 0, i64 0))
%150 = tail call i32 @exit(i32 1)
unreachable
151: ; preds = %143
%152 = tail call i32 @strlen(i8* %128)
%153 = add nsw i32 %152, 1
%154 = tail call i32 @fsetxattr(i32 %136, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.19, i64 0, i64 0), i8* %128, i32 %153, i32 0)
%155 = icmp slt i32 %154, 0
br i1 %155, label %156, label %159
156: ; preds = %151
%157 = tail call i32 @perror(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.20, i64 0, i64 0))
%158 = tail call i32 @exit(i32 1)
unreachable
159: ; preds = %151, %141
%160 = call i32 @bzero(i8* %6, i32 24)
%161 = load i8*, i8** @AF_INET
%162 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 2
store i8* %161, i8** %162
%163 = tail call i8* @htons(i16 zeroext 8001)
%164 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 1
store i8* %163, i8** %164
%165 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
br label %166
166: ; preds = %159, %171
%167 = phi i16 [ 8001, %159 ], [ %172, %171 ]
%168 = phi i32 [ 0, %159 ], [ %174, %171 ]
%169 = call i64 @bind(i32 %136, %struct.sockaddr* %165, i32 24)
%170 = icmp sgt i64 %169, -1
br i1 %170, label %180, label %171
171: ; preds = %166
%172 = add nuw nsw i16 %167, 1
%173 = call i8* @htons(i16 zeroext %167)
store i8* %173, i8** %164
%174 = add nuw nsw i32 %168, 1
%175 = icmp eq i32 %174, 1000
br i1 %175, label %176, label %166
176: ; preds = %171
%177 = load i32, i32* @stderr
%178 = call i32 (i32, i8*, ...) @fprintf(i32 %177, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.21, i64 0, i64 0))
%179 = call i32 @exit(i32 1)
unreachable
180: ; preds = %166
%181 = call i32 @bzero(i8* %6, i32 24)
%182 = load i8*, i8** @AF_INET
store i8* %182, i8** %162
%183 = call i8* @htons(i16 zeroext %127)
store i8* %183, i8** %164
%184 = call i32 @inet_addr(i8* %126)
%185 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 0, i32 0
store i32 %184, i32* %185
%186 = call i64 @connect(i32 %136, %struct.sockaddr* %165, i32 24)
%187 = icmp slt i64 %186, 0
br i1 %187, label %188, label %191
188: ; preds = %180
%189 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.22, i64 0, i64 0))
%190 = call i32 @exit(i32 1)
unreachable
191: ; preds = %180
br i1 %142, label %195, label %192
192: ; preds = %191
%193 = call i32 @strcpy(i8* %7, i8* %128)
%194 = call i32 @strlen(i8* %7)
br label %202
195: ; preds = %191
%196 = call i32 @smack_self(i8* %7)
%197 = icmp slt i32 %196, 0
br i1 %197, label %198, label %202
198: ; preds = %195
%199 = load i32, i32* @stderr
%200 = call i32 (i32, i8*, ...) @fprintf(i32 %199, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.23, i64 0, i64 0))
%201 = call i32 @exit(i32 1)
unreachable
202: ; preds = %195, %192
%203 = phi i32 [ %194, %192 ], [ %196, %195 ]
%204 = sext i32 %203 to i64
%205 = getelementptr inbounds [1500 x i8], [1500 x i8]* %4, i64 0, i64 %204
%206 = icmp eq i32 %132, 0
br i1 %206, label %250, label %207
207: ; preds = %202
%208 = icmp eq i32 %129, 0
%209 = icmp sgt i32 %130, 0
br label %210
210: ; preds = %207, %247
%211 = phi i32 [ %132, %207 ], [ %248, %247 ]
%212 = phi i32 [ %131, %207 ], [ %219, %247 ]
%213 = phi i32 [ 0, %207 ], [ %244, %247 ]
%214 = icmp eq i32 %212, 0
br i1 %214, label %218, label %215
215: ; preds = %210
%216 = add nsw i32 %212, 1
%217 = call i32 @sprintf(i8* %205, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.24, i64 0, i64 0), i32 %212)
br label %218
218: ; preds = %215, %210
%219 = phi i32 [ %216, %215 ], [ 0, %210 ]
%220 = call i32 @strlen(i8* %7)
%221 = add nsw i32 %220, 1
%222 = call i64 @send(i32 %136, i8* %7, i32 %221, i32 0)
%223 = icmp slt i64 %222, 0
br i1 %223, label %224, label %226
224: ; preds = %218
%225 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.25, i64 0, i64 0))
br label %226
226: ; preds = %224, %218
br i1 %208, label %243, label %227
227: ; preds = %226
store i8 0, i8* %8
%228 = call i32 @read(i32 %136, i8* %8, i32 1492)
%229 = icmp sgt i32 %228, -1
br i1 %229, label %230, label %233
230: ; preds = %227
%231 = zext i32 %228 to i64
%232 = getelementptr inbounds [1500 x i8], [1500 x i8]* %5, i64 0, i64 %231
store i8 0, i8* %232
br label %233
233: ; preds = %230, %227
%234 = icmp sgt i32 %228, %221
br i1 %234, label %241, label %235
235: ; preds = %233
%236 = call i64 @strcmp(i8* %7, i8* %8)
%237 = icmp eq i64 %236, 0
br i1 %237, label %238, label %241
238: ; preds = %235
%239 = add nsw i32 %213, 1
%240 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.26, i64 0, i64 0), i8* %8, i32 %228, i32 %239)
br label %243
241: ; preds = %235, %233
%242 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.27, i64 0, i64 0), i8* %8, i8* %7, i32 %221, i32 %228)
br label %243
243: ; preds = %238, %241, %226
%244 = phi i32 [ %239, %238 ], [ %213, %241 ], [ %213, %226 ]
br i1 %209, label %245, label %247
245: ; preds = %243
%246 = call i32 @sleep(i32 %130)
br label %247
247: ; preds = %243, %245
%248 = add nsw i32 %211, -1
%249 = icmp eq i32 %248, 0
br i1 %249, label %250, label %210
250: ; preds = %247, %202
%251 = call i32 @close(i32 %136)
ret i32 0
}