#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*/ udpRemoteServerAddr;
typedef int /*<<< orphan*/ udpClientAddr;
typedef int /*<<< orphan*/ ttl;
typedef int /*<<< orphan*/ tcpRemoteServerAddr;
typedef int /*<<< orphan*/ tcpClientAddr;
struct in_addr {
  void *s_addr;
};
struct sockaddr_in {
  void *sin_port;
  struct in_addr sin_addr;
  void *sin_family;
};
struct sockaddr {
  int dummy;
};
struct hostent {
  char *h_name;
  scalar_t__ *h_addr_list;
  int /*<<< orphan*/ h_length;
  void *h_addrtype;
};
typedef int /*<<< orphan*/ mcastRemoteServerAddr;
typedef int /*<<< orphan*/ mcastClientAddr;

/* Variables and functions */
void *AF_INET;
int /*<<< orphan*/ INADDR_ANY;
int /*<<< orphan*/ IN_MULTICAST(int /*<<< orphan*/);
int /*<<< orphan*/ IPPROTO_IP;
int /*<<< orphan*/ IP_MULTICAST_TTL;
int /*<<< orphan*/ SOCK_DGRAM;
int /*<<< orphan*/ SOCK_STREAM;
int bind(int, struct sockaddr *, int);
int /*<<< orphan*/ close(int);
int connect(int, struct sockaddr *, int);
int /*<<< orphan*/ exit(int);
struct hostent *gethostbyname(char *);
void *htonl(int /*<<< orphan*/);
void *htons(int);
char *inet_ntoa(struct in_addr);
int /*<<< orphan*/ ltp_run_ping_tests(char *);
int /*<<< orphan*/ ltp_run_traceroute_tests(char *);
int /*<<< orphan*/ memcpy(char *, scalar_t__, int /*<<< orphan*/);
int /*<<< orphan*/ ntohl(void *);
int /*<<< orphan*/ printf(char *, ...);
int send(int, char *, scalar_t__, int /*<<< orphan*/);
int sendto(int, char *, scalar_t__, int /*<<< orphan*/, struct sockaddr *, int);
scalar_t__ setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/,
                      unsigned char *, int);
int /*<<< orphan*/ sleep(int);
int socket(void *, int /*<<< orphan*/, int /*<<< orphan*/);
scalar_t__ strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
int main(int argc, char *argv[]) {
  int udpSocketHandle, tcpSocketHandle, mcastSocketHandle, rc, i;
  struct sockaddr_in udpClientAddr, udpRemoteServerAddr, tcpClientAddr,
      tcpRemoteServerAddr, mcastClientAddr, mcastRemoteServerAddr;
  struct hostent *hostEntry;
  char hostName[256], progName[256], traceName[256], multiCast = 1;
  unsigned char ttl = 1;
  mcastSocketHandle = -1;
  if (argc < 4) {
    printf("usage :<server-hostname> <trace-hostName> <data1> ... <dataN> \n");
    exit(1);
  }
  strncpy(progName, argv[0], 256);
  strncpy(hostName, argv[1], 256);
  strncpy(traceName, argv[2], 256);
  hostEntry = gethostbyname(hostName);
  if (hostEntry == NULL) {
    printf("%s: unknown host passed'%s' \n", progName, hostName);
    exit(1);
  }
  printf("%s: sending data to '%s' (IP : %s) \n", progName, hostEntry->h_name,
         inet_ntoa(*(struct in_addr *)hostEntry->h_addr_list[0]));
  udpRemoteServerAddr.sin_family = hostEntry->h_addrtype;
  memcpy((char *)&udpRemoteServerAddr.sin_addr.s_addr,
         hostEntry->h_addr_list[0], hostEntry->h_length);
  udpRemoteServerAddr.sin_port = htons(10000);
  tcpRemoteServerAddr.sin_family = hostEntry->h_addrtype;
  memcpy((char *)&tcpRemoteServerAddr.sin_addr.s_addr,
         hostEntry->h_addr_list[0], hostEntry->h_length);
  tcpRemoteServerAddr.sin_port = htons(10001);
  mcastRemoteServerAddr.sin_family = hostEntry->h_addrtype;
  memcpy((char *)&mcastRemoteServerAddr.sin_addr.s_addr,
         hostEntry->h_addr_list[0], hostEntry->h_length);
  mcastRemoteServerAddr.sin_port = htons(10002);
  udpSocketHandle = socket(AF_INET, SOCK_DGRAM, 0);
  tcpSocketHandle = socket(AF_INET, SOCK_STREAM, 0);
  if (udpSocketHandle < 0) {
    printf("%s: Error: cannot open UDP socket \n", progName);
  }
  if (tcpSocketHandle < 0) {
    printf("%s: Error: cannot open TCP socket \n", progName);
  }
  udpClientAddr.sin_family = AF_INET;
  udpClientAddr.sin_addr.s_addr = htonl(INADDR_ANY);
  udpClientAddr.sin_port = htons(0);
  tcpClientAddr.sin_family = AF_INET;
  tcpClientAddr.sin_addr.s_addr = htonl(INADDR_ANY);
  tcpClientAddr.sin_port = htons(0);
  if (udpSocketHandle > 0) {
    rc = bind(udpSocketHandle, (struct sockaddr *)&udpClientAddr,
              sizeof(udpClientAddr));
    if (rc < 0) {
      printf("%s: Error: cannot bind UDP port\n", progName);
    }
  }
  if (tcpSocketHandle > 0) {
    rc = bind(tcpSocketHandle, (struct sockaddr *)&tcpClientAddr,
              sizeof(tcpClientAddr));
    if (rc < 0) {
      printf("%s: Error: cannot bind TCP port\n", progName);
    } else {
      rc = connect(tcpSocketHandle, (struct sockaddr *)&tcpRemoteServerAddr,
                   sizeof(tcpRemoteServerAddr));
      if (rc < 0) {
        printf("Error: cannot connect tp TCP Server \n");
      }
    }
  }
  if (!IN_MULTICAST(ntohl(mcastRemoteServerAddr.sin_addr.s_addr))) {
    printf("%s : Hostname [%s] passed [%s] is not a multicast server\n",
           progName, hostName, inet_ntoa(mcastRemoteServerAddr.sin_addr));
    printf("The multiCast Server will not be started \n");
    multiCast = 0;
  } else {
    mcastSocketHandle = socket(AF_INET, SOCK_DGRAM, 0);
    if (mcastSocketHandle < 0) {
      printf("Error: %s : cannot open mulitCast socket\n", progName);
      multiCast = 0;
    }
    mcastClientAddr.sin_family = AF_INET;
    mcastClientAddr.sin_addr.s_addr = htonl(INADDR_ANY);
    mcastClientAddr.sin_port = htons(0);
    if (bind(mcastSocketHandle, (struct sockaddr *)&mcastClientAddr,
             sizeof(mcastClientAddr)) < 0) {
      printf("Error: binding multiCast socket");
      multiCast = 0;
    }
    if (setsockopt(mcastSocketHandle, IPPROTO_IP, IP_MULTICAST_TTL, &ttl,
                   sizeof(ttl)) < 0) {
      printf("Error: %s : cannot set ttl = %d \n", progName, ttl);
      multiCast = 0;
    }
    printf("%s : sending data on multicast group '%s' (%s)\n", progName,
           hostEntry->h_name,
           inet_ntoa(*(struct in_addr *)hostEntry->h_addr_list[0]));
  }
  for (i = 3; i < argc; i++) {
    if (udpSocketHandle > 0) {
      rc = sendto(udpSocketHandle, argv[i], strlen(argv[i]) + 1, 0,
                  (struct sockaddr *)&udpRemoteServerAddr,
                  sizeof(udpRemoteServerAddr));
      if (rc < 0) {
        printf("%s: cannot send UDP data %d \n", progName, i - 1);
        close(udpSocketHandle);
      } else {
        printf("%s: UDP data%u sent (%s)\n", progName, i - 1, argv[i]);
      }
    } else {
      printf("%s UDP Socket not open for send \n", hostName);
    }
    if (tcpSocketHandle > 0) {
      rc = send(tcpSocketHandle, argv[i], strlen(argv[i]) + 1, 0);
      if (rc < 0) {
        printf("cannot send TCP data ");
        close(tcpSocketHandle);
      } else {
        printf("%s: TCP data%u sent (%s)\n", progName, i - 1, argv[i]);
      }
    } else {
      printf("%s TCP Socket not open for send \n", hostName);
    }
    if (multiCast) {
      rc = sendto(mcastSocketHandle, argv[i], strlen(argv[i]) + 1, 0,
                  (struct sockaddr *)&mcastRemoteServerAddr,
                  sizeof(mcastRemoteServerAddr));
      if (rc < 0) {
        printf("%s : cannot send multiCast data %d\n", progName, i - 1);
        close(mcastSocketHandle);
        multiCast = 0;
      }
    }
  }
  sleep(5);
  ltp_run_traceroute_tests(traceName);
  ltp_run_ping_tests(hostName);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x430,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x1,-0x3c1(%rbp)
movb   $0x1,-0x3c2(%rbp)
movl   $0xffffffff,-0x1c(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    12a0 <main+0x50>
lea    0xd71(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
mov    $0x1,%edi
call   1130 <exit@plt>
lea    -0x2c0(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    $0x100,%edx
call   1030 <strncpy@plt>
lea    -0x1c0(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
mov    $0x100,%edx
call   1030 <strncpy@plt>
lea    -0x3c0(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
mov    $0x100,%edx
call   1030 <strncpy@plt>
lea    -0x1c0(%rbp),%rdi
call   10e0 <gethostbyname@plt>
mov    %rax,-0xc0(%rbp)
cmpq   $0x0,-0xc0(%rbp)
jne    1331 <main+0xe1>
lea    -0x2c0(%rbp),%rsi
lea    -0x1c0(%rbp),%rdx
lea    0xd20(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
mov    $0x1,%edi
call   1130 <exit@plt>
lea    -0x2c0(%rbp),%rax
mov    %rax,-0x3d8(%rbp)
mov    -0xc0(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x3d0(%rbp)
mov    -0xc0(%rbp),%rax
mov    0x8(%rax),%rax
mov    (%rax),%rax
mov    (%rax),%rdi
call   1050 <inet_ntoa@plt>
mov    -0x3d8(%rbp),%rsi
mov    -0x3d0(%rbp),%rdx
mov    %rax,%rcx
lea    0xce0(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
mov    -0xc0(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x48(%rbp)
lea    -0x58(%rbp),%rdi
add    $0x8,%rdi
mov    -0xc0(%rbp),%rax
mov    0x8(%rax),%rax
mov    (%rax),%rsi
mov    -0xc0(%rbp),%rax
mov    0x10(%rax),%edx
call   10f0 <memcpy@plt>
mov    $0x2710,%edi
call   1070 <htons@plt>
mov    %rax,-0x58(%rbp)
mov    -0xc0(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x78(%rbp)
lea    -0x88(%rbp),%rdi
add    $0x8,%rdi
mov    -0xc0(%rbp),%rax
mov    0x8(%rax),%rax
mov    (%rax),%rsi
mov    -0xc0(%rbp),%rax
mov    0x10(%rax),%edx
call   10f0 <memcpy@plt>
mov    $0x2711,%edi
call   1070 <htons@plt>
mov    %rax,-0x88(%rbp)
mov    -0xc0(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0xa8(%rbp)
lea    -0xb8(%rbp),%rdi
add    $0x8,%rdi
mov    -0xc0(%rbp),%rax
mov    0x8(%rax),%rax
mov    (%rax),%rsi
mov    -0xc0(%rbp),%rax
mov    0x10(%rax),%edx
call   10f0 <memcpy@plt>
mov    $0x2712,%edi
call   1070 <htons@plt>
mov    %rax,-0xb8(%rbp)
mov    0x2b87(%rip),%rax
mov    (%rax),%rdi
mov    0x2b65(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1170 <socket@plt>
mov    %eax,-0x14(%rbp)
mov    0x2b6a(%rip),%rax
mov    (%rax),%rdi
mov    0x2b38(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1170 <socket@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    14b3 <main+0x263>
lea    -0x2c0(%rbp),%rsi
lea    0xbd7(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
cmpl   $0x0,-0x18(%rbp)
jge    14d2 <main+0x282>
lea    -0x2c0(%rbp),%rsi
lea    0xbdc(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
mov    0x2b0f(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
mov    0x2af1(%rip),%rax
mov    (%rax),%edi
call   10a0 <htonl@plt>
mov    %rax,-0x38(%rbp)
xor    %edi,%edi
call   1070 <htons@plt>
mov    %rax,-0x40(%rbp)
mov    0x2ae4(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x60(%rbp)
mov    0x2ac6(%rip),%rax
mov    (%rax),%edi
call   10a0 <htonl@plt>
mov    %rax,-0x68(%rbp)
xor    %edi,%edi
call   1070 <htons@plt>
mov    %rax,-0x70(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    156a <main+0x31a>
mov    -0x14(%rbp),%edi
lea    -0x40(%rbp),%rsi
mov    $0x18,%edx
call   1100 <bind@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jge    1565 <main+0x315>
lea    -0x2c0(%rbp),%rsi
lea    0xb6d(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
jmp    156a <main+0x31a>
cmpl   $0x0,-0x18(%rbp)
jle    15e5 <main+0x395>
mov    -0x18(%rbp),%edi
lea    -0x70(%rbp),%rsi
mov    $0x18,%edx
call   1100 <bind@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jge    15ac <main+0x35c>
lea    -0x2c0(%rbp),%rsi
lea    0xb4c(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
jmp    15e0 <main+0x390>
mov    -0x18(%rbp),%edi
lea    -0x88(%rbp),%rsi
mov    $0x18,%edx
call   1140 <connect@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jge    15db <main+0x38b>
lea    0xb39(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
jmp    15e0 <main+0x390>
jmp    15e5 <main+0x395>
mov    -0xb0(%rbp),%rdi
call   1150 <ntohl@plt>
mov    %eax,%edi
call   10d0 <IN_MULTICAST@plt>
cmp    $0x0,%eax
jne    1662 <main+0x412>
lea    -0x2c0(%rbp),%rax
mov    %rax,-0x3e8(%rbp)
lea    -0x1c0(%rbp),%rax
mov    %rax,-0x3e0(%rbp)
mov    -0xb0(%rbp),%rdi
call   1050 <inet_ntoa@plt>
mov    -0x3e8(%rbp),%rsi
mov    -0x3e0(%rbp),%rdx
mov    %rax,%rcx
lea    0xaf2(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
lea    0xb1e(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
movb   $0x0,-0x3c1(%rbp)
jmp    17b3 <main+0x563>
mov    0x297f(%rip),%rax
mov    (%rax),%rdi
mov    0x295d(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1170 <socket@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    16a5 <main+0x455>
lea    -0x2c0(%rbp),%rsi
lea    0xb01(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
movb   $0x0,-0x3c1(%rbp)
mov    0x293c(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x90(%rbp)
mov    0x291b(%rip),%rax
mov    (%rax),%edi
call   10a0 <htonl@plt>
mov    %rax,-0x98(%rbp)
xor    %edi,%edi
call   1070 <htons@plt>
mov    %rax,-0xa0(%rbp)
mov    -0x1c(%rbp),%edi
lea    -0xa0(%rbp),%rsi
mov    $0x18,%edx
call   1100 <bind@plt>
cmp    $0x0,%eax
jge    170b <main+0x4bb>
lea    0xac5(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
movb   $0x0,-0x3c1(%rbp)
mov    -0x1c(%rbp),%edi
mov    0x28cb(%rip),%rax
mov    (%rax),%esi
mov    0x289a(%rip),%rax
mov    (%rax),%edx
lea    -0x3c2(%rbp),%rcx
mov    $0x1,%r8d
call   1040 <setsockopt@plt>
cmp    $0x0,%rax
jge    175f <main+0x50f>
lea    -0x2c0(%rbp),%rsi
movzbl -0x3c2(%rbp),%edx
lea    0xa91(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
movb   $0x0,-0x3c1(%rbp)
lea    -0x2c0(%rbp),%rax
mov    %rax,-0x3f8(%rbp)
mov    -0xc0(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x3f0(%rbp)
mov    -0xc0(%rbp),%rax
mov    0x8(%rax),%rax
mov    (%rax),%rax
mov    (%rax),%rdi
call   1050 <inet_ntoa@plt>
mov    -0x3f8(%rbp),%rsi
mov    -0x3f0(%rbp),%rdx
mov    %rax,%rcx
lea    0xa58(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
movl   $0x3,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1a04 <main+0x7b4>
cmpl   $0x0,-0x14(%rbp)
jle    1883 <main+0x633>
mov    -0x14(%rbp),%eax
mov    %eax,-0x404(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x400(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1060 <strlen@plt>
mov    -0x404(%rbp),%edi
mov    -0x400(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
lea    -0x58(%rbp),%r8
xor    %ecx,%ecx
mov    $0x18,%r9d
call   10b0 <sendto@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jge    1857 <main+0x607>
lea    -0x2c0(%rbp),%rsi
mov    -0x24(%rbp),%edx
sub    $0x1,%edx
lea    0x9f1(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
mov    -0x14(%rbp),%edi
call   10c0 <close@plt>
jmp    187e <main+0x62e>
lea    -0x2c0(%rbp),%rsi
mov    -0x24(%rbp),%edx
sub    $0x1,%edx
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rcx
lea    0x9db(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
jmp    1898 <main+0x648>
lea    -0x1c0(%rbp),%rsi
lea    0x9db(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
cmpl   $0x0,-0x18(%rbp)
jle    193e <main+0x6ee>
mov    -0x18(%rbp),%eax
mov    %eax,-0x414(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x410(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1060 <strlen@plt>
mov    -0x414(%rbp),%edi
mov    -0x410(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
xor    %ecx,%ecx
call   1080 <send@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jge    1912 <main+0x6c2>
lea    0x990(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
mov    -0x18(%rbp),%edi
call   10c0 <close@plt>
jmp    1939 <main+0x6e9>
lea    -0x2c0(%rbp),%rsi
mov    -0x24(%rbp),%edx
sub    $0x1,%edx
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rcx
lea    0x972(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
jmp    1953 <main+0x703>
lea    -0x1c0(%rbp),%rsi
lea    0x972(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
cmpb   $0x0,-0x3c1(%rbp)
je     19f1 <main+0x7a1>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x424(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x420(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1060 <strlen@plt>
mov    -0x424(%rbp),%edi
mov    -0x420(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
lea    -0xb8(%rbp),%r8
xor    %ecx,%ecx
mov    $0x18,%r9d
call   10b0 <sendto@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jge    19ec <main+0x79c>
lea    -0x2c0(%rbp),%rsi
mov    -0x24(%rbp),%edx
sub    $0x1,%edx
lea    0x90a(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
mov    -0x1c(%rbp),%edi
call   10c0 <close@plt>
movb   $0x0,-0x3c1(%rbp)
jmp    19f1 <main+0x7a1>
jmp    19f6 <main+0x7a6>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    17ba <main+0x56a>
mov    $0x5,%edi
call   1160 <sleep@plt>
lea    -0x3c0(%rbp),%rdi
call   1120 <ltp_run_traceroute_tests@plt>
lea    -0x1c0(%rbp),%rdi
call   1110 <ltp_run_ping_tests@plt>
xor    %eax,%eax
add    $0x430,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x3b8,%rsp
movb   $0x1,0xb(%rsp)
cmp    $0x3,%edi
jle    184e <main+0x5ee>
mov    %rsi,%rbx
mov    %edi,%r13d
mov    (%rsi),%rsi
lea    0xb0(%rsp),%rdi
mov    $0x100,%edx
call   1030 <strncpy@plt>
mov    0x8(%rbx),%rsi
lea    0x1b0(%rsp),%rbp
mov    %rbp,%rdi
mov    $0x100,%edx
call   1030 <strncpy@plt>
mov    %rbx,0x18(%rsp)
mov    0x10(%rbx),%rsi
lea    0x2b0(%rsp),%rdi
mov    $0x100,%edx
call   1030 <strncpy@plt>
mov    %rbp,%rdi
call   10f0 <gethostbyname@plt>
test   %rax,%rax
je     1864 <main+0x604>
mov    %rax,%r15
mov    (%rax),%rbp
mov    0x8(%rax),%rax
mov    (%rax),%rax
mov    (%rax),%rdi
call   1060 <inet_ntoa@plt>
lea    0xd23(%rip),%rdi
lea    0xb0(%rsp),%rsi
mov    %rbp,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   10a0 <printf@plt>
mov    0x18(%r15),%rax
mov    %rax,0x90(%rsp)
lea    0x88(%rsp),%rdi
mov    0x8(%r15),%rax
mov    (%rax),%rsi
mov    0x10(%r15),%edx
call   1100 <memcpy@plt>
mov    $0x2710,%edi
call   1080 <htons@plt>
mov    %rax,0x80(%rsp)
mov    0x18(%r15),%rax
mov    %rax,0x60(%rsp)
lea    0x58(%rsp),%rdi
mov    0x8(%r15),%rax
mov    (%rax),%rsi
mov    0x10(%r15),%edx
call   1100 <memcpy@plt>
mov    $0x2711,%edi
call   1080 <htons@plt>
mov    %rax,0x50(%rsp)
mov    0x18(%r15),%rax
mov    %rax,0x30(%rsp)
lea    0x28(%rsp),%rdi
mov    0x8(%r15),%rax
mov    (%rax),%rsi
mov    0x10(%r15),%edx
call   1100 <memcpy@plt>
mov    $0x2712,%edi
call   1080 <htons@plt>
mov    %rax,0x20(%rsp)
mov    0x2c41(%rip),%r14
mov    (%r14),%rdi
mov    0x2c1f(%rip),%r12
mov    (%r12),%esi
xor    %edx,%edx
call   1180 <socket@plt>
mov    %eax,%ebp
mov    (%r14),%rdi
mov    0x2bf8(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1180 <socket@plt>
mov    %eax,%ebx
mov    %ebp,0xc(%rsp)
test   %ebp,%ebp
jns    13f1 <main+0x191>
lea    0xc61(%rip),%rdi
lea    0xb0(%rsp),%rsi
xor    %eax,%eax
call   10a0 <printf@plt>
mov    %r13d,%ebp
mov    %ebx,0x10(%rsp)
test   %ebx,%ebx
jns    1412 <main+0x1b2>
lea    0xc64(%rip),%rdi
lea    0xb0(%rsp),%rsi
xor    %eax,%eax
call   10a0 <printf@plt>
mov    (%r14),%rax
mov    %rax,0xa8(%rsp)
mov    0x2bb4(%rip),%r13
mov    0x0(%r13),%edi
call   10b0 <htonl@plt>
mov    %rax,0xa0(%rsp)
xor    %edi,%edi
call   1080 <htons@plt>
mov    %rax,0x98(%rsp)
mov    (%r14),%rax
mov    %rax,0x78(%rsp)
mov    0x0(%r13),%edi
call   10b0 <htonl@plt>
mov    %rax,0x70(%rsp)
xor    %edi,%edi
call   1080 <htons@plt>
mov    %rax,0x68(%rsp)
cmpl   $0x0,0xc(%rsp)
jle    149d <main+0x23d>
lea    0x98(%rsp),%rsi
mov    0xc(%rsp),%edi
mov    $0x18,%edx
call   1110 <bind@plt>
test   %eax,%eax
jns    149d <main+0x23d>
lea    0xbfd(%rip),%rdi
lea    0xb0(%rsp),%rsi
xor    %eax,%eax
call   10a0 <printf@plt>
cmpl   $0x0,0x10(%rsp)
jle    14f6 <main+0x296>
lea    0x68(%rsp),%rsi
mov    0x10(%rsp),%ebx
mov    %ebx,%edi
mov    $0x18,%edx
call   1110 <bind@plt>
test   %eax,%eax
js     14e0 <main+0x280>
lea    0x50(%rsp),%rsi
mov    %ebx,%edi
mov    $0x18,%edx
call   1150 <connect@plt>
test   %eax,%eax
jns    14f6 <main+0x296>
lea    0xdc4(%rip),%rdi
call   1040 <puts@plt>
jmp    14f6 <main+0x296>
lea    0xbc5(%rip),%rdi
lea    0xb0(%rsp),%rsi
xor    %eax,%eax
call   10a0 <printf@plt>
mov    0x28(%rsp),%rdi
call   1160 <ntohl@plt>
mov    %eax,%edi
call   10e0 <IN_MULTICAST@plt>
test   %eax,%eax
je     1604 <main+0x3a4>
mov    (%r14),%rdi
mov    (%r12),%esi
xor    %edx,%edx
call   1180 <socket@plt>
mov    %eax,%ebx
mov    $0x1,%r12b
test   %eax,%eax
jns    153f <main+0x2df>
lea    0xbda(%rip),%rdi
xor    %r12d,%r12d
lea    0xb0(%rsp),%rsi
xor    %eax,%eax
call   10a0 <printf@plt>
mov    (%r14),%rax
mov    %rax,0x48(%rsp)
mov    0x0(%r13),%edi
call   10b0 <htonl@plt>
mov    %rax,0x40(%rsp)
xor    %edi,%edi
call   1080 <htons@plt>
mov    %rax,0x38(%rsp)
lea    0x38(%rsp),%rsi
mov    %ebx,%edi
mov    $0x18,%edx
call   1110 <bind@plt>
test   %eax,%eax
jns    1587 <main+0x327>
lea    0xbb4(%rip),%rdi
xor    %r12d,%r12d
xor    %eax,%eax
call   10a0 <printf@plt>
mov    0x2a52(%rip),%rax
mov    (%rax),%esi
mov    0x2a21(%rip),%rax
mov    (%rax),%edx
lea    0xb(%rsp),%rcx
mov    %ebx,0x14(%rsp)
mov    %ebx,%edi
mov    $0x1,%r8d
call   1050 <setsockopt@plt>
test   %rax,%rax
mov    %ebp,%ebx
jns    15d4 <main+0x374>
movzbl 0xb(%rsp),%edx
lea    0xb8f(%rip),%rdi
xor    %r12d,%r12d
lea    0xb0(%rsp),%rsi
xor    %eax,%eax
call   10a0 <printf@plt>
mov    (%r15),%rbp
mov    0x8(%r15),%rax
mov    (%rax),%rax
mov    (%rax),%rdi
call   1060 <inet_ntoa@plt>
lea    0xb86(%rip),%rdi
lea    0xb0(%rsp),%rsi
mov    %rbp,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   10a0 <printf@plt>
jmp    1648 <main+0x3e8>
mov    0x28(%rsp),%rdi
call   1060 <inet_ntoa@plt>
lea    0xab8(%rip),%rdi
xor    %r12d,%r12d
lea    0xb0(%rsp),%rsi
lea    0x1b0(%rsp),%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   10a0 <printf@plt>
lea    0xc3a(%rip),%rdi
call   1040 <puts@plt>
movl   $0xffffffff,0x14(%rsp)
ff
mov    %ebp,%ebx
mov    %ebx,%r14d
mov    $0x3,%r13d
mov    0xc(%rsp),%ebp
mov    0x10(%rsp),%r15d
mov    0x18(%rsp),%rbx
jmp    1680 <main+0x420>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %r12d,%r12d
add    $0x1,%r13
cmp    %r13,%r14
je     1816 <main+0x5b6>
test   %ebp,%ebp
jle    16e0 <main+0x480>
mov    (%rbx,%r13,8),%r15
mov    %r15,%rdi
call   1070 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %ebp,%edi
mov    %r15,%rsi
xor    %ecx,%ecx
lea    0x80(%rsp),%r8
mov    $0x18,%r9d
call   10c0 <sendto@plt>
test   %eax,%eax
js     1720 <main+0x4c0>
mov    (%rbx,%r13,8),%rcx
lea    -0x1(%r13),%edx
lea    0xb00(%rip),%rdi
lea    0xb0(%rsp),%rsi
xor    %eax,%eax
call   10a0 <printf@plt>
jmp    1741 <main+0x4e1>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0xaf4(%rip),%rdi
lea    0x1b0(%rsp),%rsi
xor    %eax,%eax
call   10a0 <printf@plt>
test   %r15d,%r15d
jg     174b <main+0x4eb>
lea    0xb2b(%rip),%rdi
lea    0x1b0(%rsp),%rsi
xor    %eax,%eax
call   10a0 <printf@plt>
test   %r12b,%r12b
jne    17b3 <main+0x553>
jmp    1670 <main+0x410>
nop
lea    -0x1(%r13),%edx
lea    0xa78(%rip),%rdi
lea    0xb0(%rsp),%rsi
xor    %eax,%eax
call   10a0 <printf@plt>
mov    %ebp,%edi
call   10d0 <close@plt>
mov    0x10(%rsp),%r15d
test   %r15d,%r15d
jle    16fb <main+0x49b>
mov    (%rbx,%r13,8),%rbp
mov    %rbp,%rdi
call   1070 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %r15d,%edi
mov    %rbp,%rsi
xor    %ecx,%ecx
call   1090 <send@plt>
test   %eax,%eax
js     1790 <main+0x530>
mov    (%rbx,%r13,8),%rcx
lea    -0x1(%r13),%edx
lea    0xa98(%rip),%rdi
lea    0xb0(%rsp),%rsi
xor    %eax,%eax
call   10a0 <printf@plt>
jmp    17a6 <main+0x546>
nopl   0x0(%rax)
lea    0xa66(%rip),%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
mov    %r15d,%edi
call   10d0 <close@plt>
mov    0xc(%rsp),%ebp
test   %r12b,%r12b
je     1670 <main+0x410>
mov    (%rbx,%r13,8),%rbp
mov    %rbp,%rdi
call   1070 <strlen@plt>
lea    0x1(%rax),%rdx
mov    0x14(%rsp),%edi
mov    %rbp,%rsi
mov    0xc(%rsp),%ebp
xor    %ecx,%ecx
lea    0x20(%rsp),%r8
mov    $0x18,%r9d
call   10c0 <sendto@plt>
mov    $0x1,%r12b
test   %eax,%eax
jns    1673 <main+0x413>
lea    -0x1(%r13),%edx
xor    %r12d,%r12d
lea    0xa56(%rip),%rdi
lea    0xb0(%rsp),%rsi
xor    %eax,%eax
call   10a0 <printf@plt>
mov    0x14(%rsp),%edi
call   10d0 <close@plt>
jmp    1673 <main+0x413>
mov    $0x5,%edi
call   1170 <sleep@plt>
lea    0x2b0(%rsp),%rdi
call   1130 <ltp_run_traceroute_tests@plt>
lea    0x1b0(%rsp),%rdi
call   1120 <ltp_run_ping_tests@plt>
xor    %eax,%eax
add    $0x3b8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xa6d(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   1140 <exit@plt>
lea    0x795(%rip),%rdi
lea    0xb0(%rsp),%rsi
lea    0x1b0(%rsp),%rdx
xor    %eax,%eax
call   10a0 <printf@plt>
mov    $0x1,%edi
call   1140 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { i8*, %struct.in_addr, i8* }
%struct.in_addr = type { i8* }
%struct.hostent = type { i8*, i64*, i32, i8* }
%struct.sockaddr = type { i32 }
@.str = [64 x i8] c"usage :<server-hostname> <trace-hostName> <data1> ... <dataN> \0A\00"
@.str.1 = [30 x i8] c"%s: unknown host passed'%s' \0A\00"
@.str.2 = [37 x i8] c"%s: sending data to '%s' (IP : %s) \0A\00"
@AF_INET = global i8* null
@SOCK_DGRAM = global i32 0
@SOCK_STREAM = global i32 0
@.str.3 = [36 x i8] c"%s: Error: cannot open UDP socket \0A\00"
@.str.4 = [36 x i8] c"%s: Error: cannot open TCP socket \0A\00"
@INADDR_ANY = global i32 0
@.str.5 = [33 x i8] c"%s: Error: cannot bind UDP port\0A\00"
@.str.6 = [33 x i8] c"%s: Error: cannot bind TCP port\0A\00"
@.str.7 = [38 x i8] c"Error: cannot connect tp TCP Server \0A\00"
@.str.8 = [58 x i8] c"%s : Hostname [%s] passed [%s] is not a multicast server\0A\00"
@.str.9 = [43 x i8] c"The multiCast Server will not be started \0A\00"
@.str.10 = [42 x i8] c"Error: %s : cannot open mulitCast socket\0A\00"
@.str.11 = [32 x i8] c"Error: binding multiCast socket\00"
@IPPROTO_IP = global i32 0
@IP_MULTICAST_TTL = global i32 0
@.str.12 = [34 x i8] c"Error: %s : cannot set ttl = %d \0A\00"
@.str.13 = [48 x i8] c"%s : sending data on multicast group '%s' (%s)\0A\00"
@.str.14 = [30 x i8] c"%s: cannot send UDP data %d \0A\00"
@.str.15 = [26 x i8] c"%s: UDP data%u sent (%s)\0A\00"
@.str.16 = [34 x i8] c"%s UDP Socket not open for send \0A\00"
@.str.17 = [22 x i8] c"cannot send TCP data \00"
@.str.18 = [26 x i8] c"%s: TCP data%u sent (%s)\0A\00"
@.str.19 = [34 x i8] c"%s TCP Socket not open for send \0A\00"
@.str.20 = [36 x i8] c"%s : cannot send multiCast data %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca %struct.sockaddr_in
%12 = alloca %struct.sockaddr_in
%13 = alloca %struct.sockaddr_in
%14 = alloca %struct.sockaddr_in
%15 = alloca %struct.sockaddr_in
%16 = alloca %struct.sockaddr_in
%17 = alloca %struct.hostent*
%18 = alloca [256 x i8]
%19 = alloca [256 x i8]
%20 = alloca [256 x i8]
%21 = alloca i8
%22 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8 1, i8* %21
store i8 1, i8* %22
store i32 -1, i32* %8
%23 = load i32, i32* %4
%24 = icmp slt i32 %23, 4
br i1 %24, label %25, label %28
25: ; preds = %2
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
%27 = call i32 @exit(i32 1)
unreachable
28: ; preds = %2
%29 = getelementptr inbounds [256 x i8], [256 x i8]* %19, i64 0, i64 0
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 0
%32 = load i8*, i8** %31
%33 = call i32 @strncpy(i8* %29, i8* %32, i32 256)
%34 = getelementptr inbounds [256 x i8], [256 x i8]* %18, i64 0, i64 0
%35 = load i8**, i8*** %5
%36 = getelementptr inbounds i8*, i8** %35, i64 1
%37 = load i8*, i8** %36
%38 = call i32 @strncpy(i8* %34, i8* %37, i32 256)
%39 = getelementptr inbounds [256 x i8], [256 x i8]* %20, i64 0, i64 0
%40 = load i8**, i8*** %5
%41 = getelementptr inbounds i8*, i8** %40, i64 2
%42 = load i8*, i8** %41
%43 = call i32 @strncpy(i8* %39, i8* %42, i32 256)
%44 = getelementptr inbounds [256 x i8], [256 x i8]* %18, i64 0, i64 0
%45 = call %struct.hostent* @gethostbyname(i8* %44)
store %struct.hostent* %45, %struct.hostent** %17
%46 = load %struct.hostent*, %struct.hostent** %17
%47 = icmp eq %struct.hostent* %46, null
br i1 %47, label %48, label %53
48: ; preds = %28
%49 = getelementptr inbounds [256 x i8], [256 x i8]* %19, i64 0, i64 0
%50 = getelementptr inbounds [256 x i8], [256 x i8]* %18, i64 0, i64 0
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* %49, i8* %50)
%52 = call i32 @exit(i32 1)
unreachable
53: ; preds = %28
%54 = getelementptr inbounds [256 x i8], [256 x i8]* %19, i64 0, i64 0
%55 = load %struct.hostent*, %struct.hostent** %17
%56 = getelementptr inbounds %struct.hostent, %struct.hostent* %55, i32 0, i32 0
%57 = load i8*, i8** %56
%58 = load %struct.hostent*, %struct.hostent** %17
%59 = getelementptr inbounds %struct.hostent, %struct.hostent* %58, i32 0, i32 1
%60 = load i64*, i64** %59
%61 = getelementptr inbounds i64, i64* %60, i64 0
%62 = load i64, i64* %61
%63 = inttoptr i64 %62 to %struct.in_addr*
%64 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %63, i32 0, i32 0
%65 = load i8*, i8** %64
%66 = call i8* @inet_ntoa(i8* %65)
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i8* %54, i8* %57, i8* %66)
%68 = load %struct.hostent*, %struct.hostent** %17
%69 = getelementptr inbounds %struct.hostent, %struct.hostent* %68, i32 0, i32 3
%70 = load i8*, i8** %69
%71 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %12, i32 0, i32 2
store i8* %70, i8** %71
%72 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %12, i32 0, i32 1
%73 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %72, i32 0, i32 0
%74 = bitcast i8** %73 to i8*
%75 = load %struct.hostent*, %struct.hostent** %17
%76 = getelementptr inbounds %struct.hostent, %struct.hostent* %75, i32 0, i32 1
%77 = load i64*, i64** %76
%78 = getelementptr inbounds i64, i64* %77, i64 0
%79 = load i64, i64* %78
%80 = load %struct.hostent*, %struct.hostent** %17
%81 = getelementptr inbounds %struct.hostent, %struct.hostent* %80, i32 0, i32 2
%82 = load i32, i32* %81
%83 = call i32 @memcpy(i8* %74, i64 %79, i32 %82)
%84 = call i8* @htons(i32 10000)
%85 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %12, i32 0, i32 0
store i8* %84, i8** %85
%86 = load %struct.hostent*, %struct.hostent** %17
%87 = getelementptr inbounds %struct.hostent, %struct.hostent* %86, i32 0, i32 3
%88 = load i8*, i8** %87
%89 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %14, i32 0, i32 2
store i8* %88, i8** %89
%90 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %14, i32 0, i32 1
%91 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %90, i32 0, i32 0
%92 = bitcast i8** %91 to i8*
%93 = load %struct.hostent*, %struct.hostent** %17
%94 = getelementptr inbounds %struct.hostent, %struct.hostent* %93, i32 0, i32 1
%95 = load i64*, i64** %94
%96 = getelementptr inbounds i64, i64* %95, i64 0
%97 = load i64, i64* %96
%98 = load %struct.hostent*, %struct.hostent** %17
%99 = getelementptr inbounds %struct.hostent, %struct.hostent* %98, i32 0, i32 2
%100 = load i32, i32* %99
%101 = call i32 @memcpy(i8* %92, i64 %97, i32 %100)
%102 = call i8* @htons(i32 10001)
%103 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %14, i32 0, i32 0
store i8* %102, i8** %103
%104 = load %struct.hostent*, %struct.hostent** %17
%105 = getelementptr inbounds %struct.hostent, %struct.hostent* %104, i32 0, i32 3
%106 = load i8*, i8** %105
%107 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %16, i32 0, i32 2
store i8* %106, i8** %107
%108 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %16, i32 0, i32 1
%109 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %108, i32 0, i32 0
%110 = bitcast i8** %109 to i8*
%111 = load %struct.hostent*, %struct.hostent** %17
%112 = getelementptr inbounds %struct.hostent, %struct.hostent* %111, i32 0, i32 1
%113 = load i64*, i64** %112
%114 = getelementptr inbounds i64, i64* %113, i64 0
%115 = load i64, i64* %114
%116 = load %struct.hostent*, %struct.hostent** %17
%117 = getelementptr inbounds %struct.hostent, %struct.hostent* %116, i32 0, i32 2
%118 = load i32, i32* %117
%119 = call i32 @memcpy(i8* %110, i64 %115, i32 %118)
%120 = call i8* @htons(i32 10002)
%121 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %16, i32 0, i32 0
store i8* %120, i8** %121
%122 = load i8*, i8** @AF_INET
%123 = load i32, i32* @SOCK_DGRAM
%124 = call i32 @socket(i8* %122, i32 %123, i32 0)
store i32 %124, i32* %6
%125 = load i8*, i8** @AF_INET
%126 = load i32, i32* @SOCK_STREAM
%127 = call i32 @socket(i8* %125, i32 %126, i32 0)
store i32 %127, i32* %7
%128 = load i32, i32* %6
%129 = icmp slt i32 %128, 0
br i1 %129, label %130, label %133
130: ; preds = %53
%131 = getelementptr inbounds [256 x i8], [256 x i8]* %19, i64 0, i64 0
%132 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0), i8* %131)
br label %133
133: ; preds = %130, %53
%134 = load i32, i32* %7
%135 = icmp slt i32 %134, 0
br i1 %135, label %136, label %139
136: ; preds = %133
%137 = getelementptr inbounds [256 x i8], [256 x i8]* %19, i64 0, i64 0
%138 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0), i8* %137)
br label %139
139: ; preds = %136, %133
%140 = load i8*, i8** @AF_INET
%141 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %11, i32 0, i32 2
store i8* %140, i8** %141
%142 = load i32, i32* @INADDR_ANY
%143 = call i8* @htonl(i32 %142)
%144 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %11, i32 0, i32 1
%145 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %144, i32 0, i32 0
store i8* %143, i8** %145
%146 = call i8* @htons(i32 0)
%147 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %11, i32 0, i32 0
store i8* %146, i8** %147
%148 = load i8*, i8** @AF_INET
%149 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %13, i32 0, i32 2
store i8* %148, i8** %149
%150 = load i32, i32* @INADDR_ANY
%151 = call i8* @htonl(i32 %150)
%152 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %13, i32 0, i32 1
%153 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %152, i32 0, i32 0
store i8* %151, i8** %153
%154 = call i8* @htons(i32 0)
%155 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %13, i32 0, i32 0
store i8* %154, i8** %155
%156 = load i32, i32* %6
%157 = icmp sgt i32 %156, 0
br i1 %157, label %158, label %168
158: ; preds = %139
%159 = load i32, i32* %6
%160 = bitcast %struct.sockaddr_in* %11 to %struct.sockaddr*
%161 = call i32 @bind(i32 %159, %struct.sockaddr* %160, i32 24)
store i32 %161, i32* %9
%162 = load i32, i32* %9
%163 = icmp slt i32 %162, 0
br i1 %163, label %164, label %167
164: ; preds = %158
%165 = getelementptr inbounds [256 x i8], [256 x i8]* %19, i64 0, i64 0
%166 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0), i8* %165)
br label %167
167: ; preds = %164, %158
br label %168
168: ; preds = %167, %139
%169 = load i32, i32* %7
%170 = icmp sgt i32 %169, 0
br i1 %170, label %171, label %190
171: ; preds = %168
%172 = load i32, i32* %7
%173 = bitcast %struct.sockaddr_in* %13 to %struct.sockaddr*
%174 = call i32 @bind(i32 %172, %struct.sockaddr* %173, i32 24)
store i32 %174, i32* %9
%175 = load i32, i32* %9
%176 = icmp slt i32 %175, 0
br i1 %176, label %177, label %180
177: ; preds = %171
%178 = getelementptr inbounds [256 x i8], [256 x i8]* %19, i64 0, i64 0
%179 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.6, i64 0, i64 0), i8* %178)
br label %189
180: ; preds = %171
%181 = load i32, i32* %7
%182 = bitcast %struct.sockaddr_in* %14 to %struct.sockaddr*
%183 = call i32 @connect(i32 %181, %struct.sockaddr* %182, i32 24)
store i32 %183, i32* %9
%184 = load i32, i32* %9
%185 = icmp slt i32 %184, 0
br i1 %185, label %186, label %188
186: ; preds = %180
%187 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.7, i64 0, i64 0))
br label %188
188: ; preds = %186, %180
br label %189
189: ; preds = %188, %177
br label %190
190: ; preds = %189, %168
%191 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %16, i32 0, i32 1
%192 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %191, i32 0, i32 0
%193 = load i8*, i8** %192
%194 = call i32 @ntohl(i8* %193)
%195 = call i32 @IN_MULTICAST(i32 %194)
%196 = icmp ne i32 %195, 0
br i1 %196, label %206, label %197
197: ; preds = %190
%198 = getelementptr inbounds [256 x i8], [256 x i8]* %19, i64 0, i64 0
%199 = getelementptr inbounds [256 x i8], [256 x i8]* %18, i64 0, i64 0
%200 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %16, i32 0, i32 1
%201 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %200, i32 0, i32 0
%202 = load i8*, i8** %201
%203 = call i8* @inet_ntoa(i8* %202)
%204 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.8, i64 0, i64 0), i8* %198, i8* %199, i8* %203)
%205 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.9, i64 0, i64 0))
store i8 0, i8* %21
br label %256
206: ; preds = %190
%207 = load i8*, i8** @AF_INET
%208 = load i32, i32* @SOCK_DGRAM
%209 = call i32 @socket(i8* %207, i32 %208, i32 0)
store i32 %209, i32* %8
%210 = load i32, i32* %8
%211 = icmp slt i32 %210, 0
br i1 %211, label %212, label %215
212: ; preds = %206
%213 = getelementptr inbounds [256 x i8], [256 x i8]* %19, i64 0, i64 0
%214 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.10, i64 0, i64 0), i8* %213)
store i8 0, i8* %21
br label %215
215: ; preds = %212, %206
%216 = load i8*, i8** @AF_INET
%217 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %15, i32 0, i32 2
store i8* %216, i8** %217
%218 = load i32, i32* @INADDR_ANY
%219 = call i8* @htonl(i32 %218)
%220 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %15, i32 0, i32 1
%221 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %220, i32 0, i32 0
store i8* %219, i8** %221
%222 = call i8* @htons(i32 0)
%223 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %15, i32 0, i32 0
store i8* %222, i8** %223
%224 = load i32, i32* %8
%225 = bitcast %struct.sockaddr_in* %15 to %struct.sockaddr*
%226 = call i32 @bind(i32 %224, %struct.sockaddr* %225, i32 24)
%227 = icmp slt i32 %226, 0
br i1 %227, label %228, label %230
228: ; preds = %215
%229 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.11, i64 0, i64 0))
store i8 0, i8* %21
br label %230
230: ; preds = %228, %215
%231 = load i32, i32* %8
%232 = load i32, i32* @IPPROTO_IP
%233 = load i32, i32* @IP_MULTICAST_TTL
%234 = call i64 @setsockopt(i32 %231, i32 %232, i32 %233, i8* %22, i32 1)
%235 = icmp slt i64 %234, 0
br i1 %235, label %236, label %241
236: ; preds = %230
%237 = getelementptr inbounds [256 x i8], [256 x i8]* %19, i64 0, i64 0
%238 = load i8, i8* %22
%239 = zext i8 %238 to i32
%240 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.12, i64 0, i64 0), i8* %237, i32 %239)
store i8 0, i8* %21
br label %241
241: ; preds = %236, %230
%242 = getelementptr inbounds [256 x i8], [256 x i8]* %19, i64 0, i64 0
%243 = load %struct.hostent*, %struct.hostent** %17
%244 = getelementptr inbounds %struct.hostent, %struct.hostent* %243, i32 0, i32 0
%245 = load i8*, i8** %244
%246 = load %struct.hostent*, %struct.hostent** %17
%247 = getelementptr inbounds %struct.hostent, %struct.hostent* %246, i32 0, i32 1
%248 = load i64*, i64** %247
%249 = getelementptr inbounds i64, i64* %248, i64 0
%250 = load i64, i64* %249
%251 = inttoptr i64 %250 to %struct.in_addr*
%252 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %251, i32 0, i32 0
%253 = load i8*, i8** %252
%254 = call i8* @inet_ntoa(i8* %253)
%255 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.13, i64 0, i64 0), i8* %242, i8* %245, i8* %254)
br label %256
256: ; preds = %241, %197
store i32 3, i32* %10
br label %257
257: ; preds = %371, %256
%258 = load i32, i32* %10
%259 = load i32, i32* %4
%260 = icmp slt i32 %258, %259
br i1 %260, label %261, label %374
261: ; preds = %257
%262 = load i32, i32* %6
%263 = icmp sgt i32 %262, 0
br i1 %263, label %264, label %300
264: ; preds = %261
%265 = load i32, i32* %6
%266 = load i8**, i8*** %5
%267 = load i32, i32* %10
%268 = sext i32 %267 to i64
%269 = getelementptr inbounds i8*, i8** %266, i64 %268
%270 = load i8*, i8** %269
%271 = load i8**, i8*** %5
%272 = load i32, i32* %10
%273 = sext i32 %272 to i64
%274 = getelementptr inbounds i8*, i8** %271, i64 %273
%275 = load i8*, i8** %274
%276 = call i64 @strlen(i8* %275)
%277 = add nsw i64 %276, 1
%278 = bitcast %struct.sockaddr_in* %12 to %struct.sockaddr*
%279 = call i32 @sendto(i32 %265, i8* %270, i64 %277, i32 0, %struct.sockaddr* %278, i32 24)
store i32 %279, i32* %9
%280 = load i32, i32* %9
%281 = icmp slt i32 %280, 0
br i1 %281, label %282, label %289
282: ; preds = %264
%283 = getelementptr inbounds [256 x i8], [256 x i8]* %19, i64 0, i64 0
%284 = load i32, i32* %10
%285 = sub nsw i32 %284, 1
%286 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.14, i64 0, i64 0), i8* %283, i32 %285)
%287 = load i32, i32* %6
%288 = call i32 @close(i32 %287)
br label %299
289: ; preds = %264
%290 = getelementptr inbounds [256 x i8], [256 x i8]* %19, i64 0, i64 0
%291 = load i32, i32* %10
%292 = sub nsw i32 %291, 1
%293 = load i8**, i8*** %5
%294 = load i32, i32* %10
%295 = sext i32 %294 to i64
%296 = getelementptr inbounds i8*, i8** %293, i64 %295
%297 = load i8*, i8** %296
%298 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.15, i64 0, i64 0), i8* %290, i32 %292, i8* %297)
br label %299
299: ; preds = %289, %282
br label %303
300: ; preds = %261
%301 = getelementptr inbounds [256 x i8], [256 x i8]* %18, i64 0, i64 0
%302 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.16, i64 0, i64 0), i8* %301)
br label %303
303: ; preds = %300, %299
%304 = load i32, i32* %7
%305 = icmp sgt i32 %304, 0
br i1 %305, label %306, label %338
306: ; preds = %303
%307 = load i32, i32* %7
%308 = load i8**, i8*** %5
%309 = load i32, i32* %10
%310 = sext i32 %309 to i64
%311 = getelementptr inbounds i8*, i8** %308, i64 %310
%312 = load i8*, i8** %311
%313 = load i8**, i8*** %5
%314 = load i32, i32* %10
%315 = sext i32 %314 to i64
%316 = getelementptr inbounds i8*, i8** %313, i64 %315
%317 = load i8*, i8** %316
%318 = call i64 @strlen(i8* %317)
%319 = add nsw i64 %318, 1
%320 = call i32 @send(i32 %307, i8* %312, i64 %319, i32 0)
store i32 %320, i32* %9
%321 = load i32, i32* %9
%322 = icmp slt i32 %321, 0
br i1 %322, label %323, label %327
323: ; preds = %306
%324 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.17, i64 0, i64 0))
%325 = load i32, i32* %7
%326 = call i32 @close(i32 %325)
br label %337
327: ; preds = %306
%328 = getelementptr inbounds [256 x i8], [256 x i8]* %19, i64 0, i64 0
%329 = load i32, i32* %10
%330 = sub nsw i32 %329, 1
%331 = load i8**, i8*** %5
%332 = load i32, i32* %10
%333 = sext i32 %332 to i64
%334 = getelementptr inbounds i8*, i8** %331, i64 %333
%335 = load i8*, i8** %334
%336 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.18, i64 0, i64 0), i8* %328, i32 %330, i8* %335)
br label %337
337: ; preds = %327, %323
br label %341
338: ; preds = %303
%339 = getelementptr inbounds [256 x i8], [256 x i8]* %18, i64 0, i64 0
%340 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.19, i64 0, i64 0), i8* %339)
br label %341
341: ; preds = %338, %337
%342 = load i8, i8* %21
%343 = icmp ne i8 %342, 0
br i1 %343, label %344, label %370
344: ; preds = %341
%345 = load i32, i32* %8
%346 = load i8**, i8*** %5
%347 = load i32, i32* %10
%348 = sext i32 %347 to i64
%349 = getelementptr inbounds i8*, i8** %346, i64 %348
%350 = load i8*, i8** %349
%351 = load i8**, i8*** %5
%352 = load i32, i32* %10
%353 = sext i32 %352 to i64
%354 = getelementptr inbounds i8*, i8** %351, i64 %353
%355 = load i8*, i8** %354
%356 = call i64 @strlen(i8* %355)
%357 = add nsw i64 %356, 1
%358 = bitcast %struct.sockaddr_in* %16 to %struct.sockaddr*
%359 = call i32 @sendto(i32 %345, i8* %350, i64 %357, i32 0, %struct.sockaddr* %358, i32 24)
store i32 %359, i32* %9
%360 = load i32, i32* %9
%361 = icmp slt i32 %360, 0
br i1 %361, label %362, label %369
362: ; preds = %344
%363 = getelementptr inbounds [256 x i8], [256 x i8]* %19, i64 0, i64 0
%364 = load i32, i32* %10
%365 = sub nsw i32 %364, 1
%366 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.20, i64 0, i64 0), i8* %363, i32 %365)
%367 = load i32, i32* %8
%368 = call i32 @close(i32 %367)
store i8 0, i8* %21
br label %369
369: ; preds = %362, %344
br label %370
370: ; preds = %369, %341
br label %371
371: ; preds = %370
%372 = load i32, i32* %10
%373 = add nsw i32 %372, 1
store i32 %373, i32* %10
br label %257
374: ; preds = %257
%375 = call i32 @sleep(i32 5)
%376 = getelementptr inbounds [256 x i8], [256 x i8]* %20, i64 0, i64 0
%377 = call i32 @ltp_run_traceroute_tests(i8* %376)
%378 = getelementptr inbounds [256 x i8], [256 x i8]* %18, i64 0, i64 0
%379 = call i32 @ltp_run_ping_tests(i8* %378)
ret i32 0
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i8*, %struct.in_addr, i8* }
%struct.in_addr = type { i8* }
%struct.hostent = type { i8*, i64*, i32, i8* }
%struct.sockaddr = type { i32 }
@.str.1 = [30 x i8] c"%s: unknown host passed'%s' \0A\00"
@.str.2 = [37 x i8] c"%s: sending data to '%s' (IP : %s) \0A\00"
@AF_INET = global i8* null
@SOCK_DGRAM = global i32 0
@SOCK_STREAM = global i32 0
@.str.3 = [36 x i8] c"%s: Error: cannot open UDP socket \0A\00"
@.str.4 = [36 x i8] c"%s: Error: cannot open TCP socket \0A\00"
@INADDR_ANY = global i32 0
@.str.5 = [33 x i8] c"%s: Error: cannot bind UDP port\0A\00"
@.str.6 = [33 x i8] c"%s: Error: cannot bind TCP port\0A\00"
@.str.8 = [58 x i8] c"%s : Hostname [%s] passed [%s] is not a multicast server\0A\00"
@.str.10 = [42 x i8] c"Error: %s : cannot open mulitCast socket\0A\00"
@.str.11 = [32 x i8] c"Error: binding multiCast socket\00"
@IPPROTO_IP = global i32 0
@IP_MULTICAST_TTL = global i32 0
@.str.12 = [34 x i8] c"Error: %s : cannot set ttl = %d \0A\00"
@.str.13 = [48 x i8] c"%s : sending data on multicast group '%s' (%s)\0A\00"
@.str.14 = [30 x i8] c"%s: cannot send UDP data %d \0A\00"
@.str.15 = [26 x i8] c"%s: UDP data%u sent (%s)\0A\00"
@.str.16 = [34 x i8] c"%s UDP Socket not open for send \0A\00"
@.str.17 = [22 x i8] c"cannot send TCP data \00"
@.str.18 = [26 x i8] c"%s: TCP data%u sent (%s)\0A\00"
@.str.19 = [34 x i8] c"%s TCP Socket not open for send \0A\00"
@.str.20 = [36 x i8] c"%s : cannot send multiCast data %d\0A\00"
@str = [42 x i8] c"The multiCast Server will not be started \00"
@str.21 = [37 x i8] c"Error: cannot connect tp TCP Server \00"
@str.22 = [63 x i8] c"usage :<server-hostname> <trace-hostName> <data1> ... <dataN> \00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.sockaddr_in
%4 = alloca %struct.sockaddr_in
%5 = alloca %struct.sockaddr_in
%6 = alloca %struct.sockaddr_in
%7 = alloca %struct.sockaddr_in
%8 = alloca %struct.sockaddr_in
%9 = alloca [256 x i8]
%10 = alloca [256 x i8]
%11 = alloca [256 x i8]
%12 = alloca i8
%13 = bitcast %struct.sockaddr_in* %3 to i8*
%14 = bitcast %struct.sockaddr_in* %4 to i8*
%15 = bitcast %struct.sockaddr_in* %5 to i8*
%16 = bitcast %struct.sockaddr_in* %6 to i8*
%17 = bitcast %struct.sockaddr_in* %7 to i8*
%18 = bitcast %struct.sockaddr_in* %8 to i8*
%19 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%20 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%21 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
store i8 1, i8* %12
%22 = icmp slt i32 %0, 4
br i1 %22, label %23, label %26
23: ; preds = %2
%24 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str.22, i64 0, i64 0))
%25 = tail call i32 @exit(i32 1)
unreachable
26: ; preds = %2
%27 = load i8*, i8** %1
%28 = call i32 @strncpy(i8* %20, i8* %27, i32 256)
%29 = getelementptr inbounds i8*, i8** %1, i64 1
%30 = load i8*, i8** %29
%31 = call i32 @strncpy(i8* %19, i8* %30, i32 256)
%32 = getelementptr inbounds i8*, i8** %1, i64 2
%33 = load i8*, i8** %32
%34 = call i32 @strncpy(i8* %21, i8* %33, i32 256)
%35 = call %struct.hostent* @gethostbyname(i8* %19)
%36 = icmp eq %struct.hostent* %35, null
br i1 %36, label %37, label %40
37: ; preds = %26
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* %20, i8* %19)
%39 = call i32 @exit(i32 1)
unreachable
40: ; preds = %26
%41 = getelementptr inbounds %struct.hostent, %struct.hostent* %35, i64 0, i32 0
%42 = load i8*, i8** %41
%43 = getelementptr inbounds %struct.hostent, %struct.hostent* %35, i64 0, i32 1
%44 = load i64*, i64** %43
%45 = load i64, i64* %44
%46 = inttoptr i64 %45 to %struct.in_addr*
%47 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %46, i64 0, i32 0
%48 = load i8*, i8** %47
%49 = call i8* @inet_ntoa(i8* %48)
%50 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i8* %20, i8* %42, i8* %49)
%51 = getelementptr inbounds %struct.hostent, %struct.hostent* %35, i64 0, i32 3
%52 = load i8*, i8** %51
%53 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 2
store i8* %52, i8** %53
%54 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 1, i32 0
%55 = bitcast i8** %54 to i8*
%56 = load i64*, i64** %43
%57 = load i64, i64* %56
%58 = getelementptr inbounds %struct.hostent, %struct.hostent* %35, i64 0, i32 2
%59 = load i32, i32* %58
%60 = call i32 @memcpy(i8* %55, i64 %57, i32 %59)
%61 = call i8* @htons(i32 10000)
%62 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 0
store i8* %61, i8** %62
%63 = load i8*, i8** %51
%64 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i64 0, i32 2
store i8* %63, i8** %64
%65 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i64 0, i32 1, i32 0
%66 = bitcast i8** %65 to i8*
%67 = load i64*, i64** %43
%68 = load i64, i64* %67
%69 = load i32, i32* %58
%70 = call i32 @memcpy(i8* %66, i64 %68, i32 %69)
%71 = call i8* @htons(i32 10001)
%72 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i64 0, i32 0
store i8* %71, i8** %72
%73 = load i8*, i8** %51
%74 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %8, i64 0, i32 2
store i8* %73, i8** %74
%75 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %8, i64 0, i32 1, i32 0
%76 = bitcast i8** %75 to i8*
%77 = load i64*, i64** %43
%78 = load i64, i64* %77
%79 = load i32, i32* %58
%80 = call i32 @memcpy(i8* %76, i64 %78, i32 %79)
%81 = call i8* @htons(i32 10002)
%82 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %8, i64 0, i32 0
store i8* %81, i8** %82
%83 = load i8*, i8** @AF_INET
%84 = load i32, i32* @SOCK_DGRAM
%85 = call i32 @socket(i8* %83, i32 %84, i32 0)
%86 = load i8*, i8** @AF_INET
%87 = load i32, i32* @SOCK_STREAM
%88 = call i32 @socket(i8* %86, i32 %87, i32 0)
%89 = icmp slt i32 %85, 0
br i1 %89, label %90, label %92
90: ; preds = %40
%91 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0), i8* %20)
br label %92
92: ; preds = %90, %40
%93 = icmp slt i32 %88, 0
br i1 %93, label %94, label %96
94: ; preds = %92
%95 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0), i8* %20)
br label %96
96: ; preds = %94, %92
%97 = load i8*, i8** @AF_INET
%98 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 2
store i8* %97, i8** %98
%99 = load i32, i32* @INADDR_ANY
%100 = call i8* @htonl(i32 %99)
%101 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 1, i32 0
store i8* %100, i8** %101
%102 = call i8* @htons(i32 0)
%103 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 0
store i8* %102, i8** %103
%104 = load i8*, i8** @AF_INET
%105 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %5, i64 0, i32 2
store i8* %104, i8** %105
%106 = load i32, i32* @INADDR_ANY
%107 = call i8* @htonl(i32 %106)
%108 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %5, i64 0, i32 1, i32 0
store i8* %107, i8** %108
%109 = call i8* @htons(i32 0)
%110 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %5, i64 0, i32 0
store i8* %109, i8** %110
%111 = icmp sgt i32 %85, 0
br i1 %111, label %112, label %118
112: ; preds = %96
%113 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%114 = call i32 @bind(i32 %85, %struct.sockaddr* %113, i32 24)
%115 = icmp slt i32 %114, 0
br i1 %115, label %116, label %118
116: ; preds = %112
%117 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0), i8* %20)
br label %118
118: ; preds = %112, %116, %96
%119 = icmp sgt i32 %88, 0
br i1 %119, label %120, label %132
120: ; preds = %118
%121 = bitcast %struct.sockaddr_in* %5 to %struct.sockaddr*
%122 = call i32 @bind(i32 %88, %struct.sockaddr* %121, i32 24)
%123 = icmp slt i32 %122, 0
br i1 %123, label %124, label %126
124: ; preds = %120
%125 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.6, i64 0, i64 0), i8* %20)
br label %132
126: ; preds = %120
%127 = bitcast %struct.sockaddr_in* %6 to %struct.sockaddr*
%128 = call i32 @connect(i32 %88, %struct.sockaddr* %127, i32 24)
%129 = icmp slt i32 %128, 0
br i1 %129, label %130, label %132
130: ; preds = %126
%131 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.21, i64 0, i64 0))
br label %132
132: ; preds = %124, %130, %126, %118
%133 = load i8*, i8** %75
%134 = call i32 @ntohl(i8* %133)
%135 = call i32 @IN_MULTICAST(i32 %134)
%136 = icmp eq i32 %135, 0
br i1 %136, label %137, label %142
137: ; preds = %132
%138 = load i8*, i8** %75
%139 = call i8* @inet_ntoa(i8* %138)
%140 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str.8, i64 0, i64 0), i8* %20, i8* %19, i8* %139)
%141 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
br label %183
142: ; preds = %132
%143 = load i8*, i8** @AF_INET
%144 = load i32, i32* @SOCK_DGRAM
%145 = call i32 @socket(i8* %143, i32 %144, i32 0)
%146 = icmp slt i32 %145, 0
br i1 %146, label %147, label %149
147: ; preds = %142
%148 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.10, i64 0, i64 0), i8* %20)
br label %149
149: ; preds = %147, %142
%150 = phi i8 [ 0, %147 ], [ 1, %142 ]
%151 = load i8*, i8** @AF_INET
%152 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i64 0, i32 2
store i8* %151, i8** %152
%153 = load i32, i32* @INADDR_ANY
%154 = call i8* @htonl(i32 %153)
%155 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i64 0, i32 1, i32 0
store i8* %154, i8** %155
%156 = call i8* @htons(i32 0)
%157 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i64 0, i32 0
store i8* %156, i8** %157
%158 = bitcast %struct.sockaddr_in* %7 to %struct.sockaddr*
%159 = call i32 @bind(i32 %145, %struct.sockaddr* %158, i32 24)
%160 = icmp slt i32 %159, 0
br i1 %160, label %161, label %163
161: ; preds = %149
%162 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.11, i64 0, i64 0))
br label %163
163: ; preds = %161, %149
%164 = phi i8 [ 0, %161 ], [ %150, %149 ]
%165 = load i32, i32* @IPPROTO_IP
%166 = load i32, i32* @IP_MULTICAST_TTL
%167 = call i64 @setsockopt(i32 %145, i32 %165, i32 %166, i8* %12, i32 1)
%168 = icmp slt i64 %167, 0
br i1 %168, label %169, label %173
169: ; preds = %163
%170 = load i8, i8* %12
%171 = zext i8 %170 to i32
%172 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.12, i64 0, i64 0), i8* %20, i32 %171)
br label %173
173: ; preds = %169, %163
%174 = phi i8 [ 0, %169 ], [ %164, %163 ]
%175 = load i8*, i8** %41
%176 = load i64*, i64** %43
%177 = load i64, i64* %176
%178 = inttoptr i64 %177 to %struct.in_addr*
%179 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %178, i64 0, i32 0
%180 = load i8*, i8** %179
%181 = call i8* @inet_ntoa(i8* %180)
%182 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.13, i64 0, i64 0), i8* %20, i8* %175, i8* %181)
br label %183
183: ; preds = %137, %173
%184 = phi i32 [ %145, %173 ], [ -1, %137 ]
%185 = phi i8 [ %174, %173 ], [ 0, %137 ]
%186 = bitcast %struct.sockaddr_in* %4 to %struct.sockaddr*
%187 = bitcast %struct.sockaddr_in* %8 to %struct.sockaddr*
%188 = zext i32 %0 to i64
br label %189
189: ; preds = %183, %243
%190 = phi i64 [ 3, %183 ], [ %245, %243 ]
%191 = phi i8 [ %185, %183 ], [ %244, %243 ]
br i1 %111, label %192, label %209
192: ; preds = %189
%193 = getelementptr inbounds i8*, i8** %1, i64 %190
%194 = load i8*, i8** %193
%195 = call i64 @strlen(i8* dereferenceable(1) %194)
%196 = add nsw i64 %195, 1
%197 = call i32 @sendto(i32 %85, i8* %194, i64 %196, i32 0, %struct.sockaddr* %186, i32 24)
%198 = icmp slt i32 %197, 0
br i1 %198, label %199, label %204
199: ; preds = %192
%200 = trunc i64 %190 to i32
%201 = add i32 %200, -1
%202 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.14, i64 0, i64 0), i8* %20, i32 %201)
%203 = call i32 @close(i32 %85)
br label %211
204: ; preds = %192
%205 = load i8*, i8** %193
%206 = trunc i64 %190 to i32
%207 = add i32 %206, -1
%208 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.15, i64 0, i64 0), i8* %20, i32 %207, i8* %205)
br label %211
209: ; preds = %189
%210 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.16, i64 0, i64 0), i8* %19)
br label %211
211: ; preds = %199, %204, %209
br i1 %119, label %212, label %227
212: ; preds = %211
%213 = getelementptr inbounds i8*, i8** %1, i64 %190
%214 = load i8*, i8** %213
%215 = call i64 @strlen(i8* dereferenceable(1) %214)
%216 = add nsw i64 %215, 1
%217 = call i32 @send(i32 %88, i8* %214, i64 %216, i32 0)
%218 = icmp slt i32 %217, 0
br i1 %218, label %219, label %222
219: ; preds = %212
%220 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.17, i64 0, i64 0))
%221 = call i32 @close(i32 %88)
br label %229
222: ; preds = %212
%223 = load i8*, i8** %213
%224 = trunc i64 %190 to i32
%225 = add i32 %224, -1
%226 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.18, i64 0, i64 0), i8* %20, i32 %225, i8* %223)
br label %229
227: ; preds = %211
%228 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.19, i64 0, i64 0), i8* %19)
br label %229
229: ; preds = %219, %222, %227
%230 = icmp eq i8 %191, 0
br i1 %230, label %243, label %231
231: ; preds = %229
%232 = getelementptr inbounds i8*, i8** %1, i64 %190
%233 = load i8*, i8** %232
%234 = call i64 @strlen(i8* dereferenceable(1) %233)
%235 = add nsw i64 %234, 1
%236 = call i32 @sendto(i32 %184, i8* %233, i64 %235, i32 0, %struct.sockaddr* %187, i32 24)
%237 = icmp slt i32 %236, 0
br i1 %237, label %238, label %243
238: ; preds = %231
%239 = trunc i64 %190 to i32
%240 = add i32 %239, -1
%241 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.20, i64 0, i64 0), i8* %20, i32 %240)
%242 = call i32 @close(i32 %184)
br label %243
243: ; preds = %229, %238, %231
%244 = phi i8 [ 0, %238 ], [ 1, %231 ], [ 0, %229 ]
%245 = add nuw nsw i64 %190, 1
%246 = icmp eq i64 %245, %188
br i1 %246, label %247, label %189
247: ; preds = %243
%248 = call i32 @sleep(i32 5)
%249 = call i32 @ltp_run_traceroute_tests(i8* %21)
%250 = call i32 @ltp_run_ping_tests(i8* %19)
ret i32 0
}