#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 TYPE_2__ {
  int /*<<< orphan*/ s_addr;
};
struct sockaddr_in {
  TYPE_1__ sin_addr;
  void *sin_port;
};
struct ether_addr {
  int dummy;
};
typedef int /*<<< orphan*/ in_addr_t;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
struct ether_addr *ether_aton_r(char *, struct ether_addr *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int getopt(int, char **, char *);
void *htons(void *);
int inet_pton(int /*<<< orphan*/, char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
int sscanf(char *, char *, unsigned int *);
int /*<<< orphan*/ stderr;
char *strchr(char *, char);
int parseArgvGedek(int argc, char *argv[], in_addr_t *destGedekIpAddress,
                   struct ether_addr *destGedekMacAddress,
                   struct sockaddr_in *gedekDestinationIpPort1,
                   struct ether_addr *destGedekDestinationMacAddress1,
                   struct sockaddr_in *gedekDestinationIpPort2,
                   struct ether_addr *destGedekDestinationMacAddress2) {
  int c;
  int ret;
  struct ether_addr *ret_ether_addr = NULL;
  char *port_number = NULL;
  char *strGedekMacAddress = NULL;
  char *strGedekIpAddress = NULL;
  char *strGedekDestinationIpPort1 = NULL;
  char *strGedekDestinationMac1 = NULL;
  char *strGedekDestinationIpPort2 = NULL;
  char *strGedekDestinationMac2 = NULL;
  while ((c = getopt(argc, argv, "h")) != -1) {
    switch (c) {
    case 'h':
      return (-1);
      break;
    case '?':
      break;
    default:
      break;
    }
  }
  if (argc != 7) {
    return (-1);
  }
  strGedekMacAddress = argv[1];
  strGedekIpAddress = argv[2];
  strGedekDestinationIpPort1 = argv[3];
  strGedekDestinationMac1 = argv[4];
  strGedekDestinationIpPort2 = argv[5];
  strGedekDestinationMac2 = argv[6];
  ret = inet_pton(AF_INET, strGedekIpAddress, destGedekIpAddress);
  if (ret <= 0) {
    if (ret == 0) {
      fprintf(stderr,
              "New GEDEK Ip Address is Not in presentation format: %s\n",
              strGedekIpAddress);
    } else {
      perror("inet_pton");
      return (ret);
    }
  }
  ret_ether_addr = ether_aton_r(strGedekMacAddress, destGedekMacAddress);
  if (ret_ether_addr == NULL) {
    fprintf(stderr, "GEDEK Mac Address is Not in presentation format: %s\n",
            strGedekMacAddress);
    return (-1);
  }
  port_number = strchr(strGedekDestinationIpPort1, ':');
  if (port_number == NULL) {
    fprintf(stderr,
            "New GEDEK Destination1 IP Address and Port is Not in presentation "
            "format: %s\n",
            strGedekDestinationIpPort1);
    return (-2);
  }
  ret = sscanf(port_number + 1, "%ud",
               (unsigned int *)&gedekDestinationIpPort1->sin_port);
  if (ret != 1) {
    fprintf(stderr,
            "New GEDEK Destination1 IP Address and Port is Not in presentation "
            "format: %s\n",
            port_number + 1);
    return (-2);
  }
  gedekDestinationIpPort1->sin_port = htons(gedekDestinationIpPort1->sin_port);
  *(port_number) = '\0';
  ret = inet_pton(AF_INET, strGedekDestinationIpPort1,
                  &gedekDestinationIpPort1->sin_addr.s_addr);
  if (ret <= 0) {
    if (ret == 0) {
      fprintf(stderr,
              "New GEDEK Destination1 IP Address and Port is Not in "
              "presentation format: %s\n",
              strGedekDestinationIpPort1);
    } else {
      perror("inet_pton");
      return (ret);
    }
  }
  ret_ether_addr =
      ether_aton_r(strGedekDestinationMac1, destGedekDestinationMacAddress1);
  if (ret_ether_addr == NULL) {
    fprintf(stderr,
            "New GEDEK Destination2 Mac Address is Not in presentation format: "
            "%s\n",
            strGedekDestinationMac1);
    return (-1);
  }
  port_number = strchr(strGedekDestinationIpPort2, ':');
  if (port_number == NULL) {
    fprintf(stderr,
            "New GEDEK Destination2 IP Address and Port is Not in presentation "
            "format: %s\n",
            strGedekDestinationIpPort2);
    return (-2);
  }
  ret = sscanf(port_number + 1, "%ud",
               (unsigned int *)&gedekDestinationIpPort2->sin_port);
  if (ret != 1) {
    fprintf(stderr,
            "New GEDEK Destination2 IP Address and Port is Not in presentation "
            "format: %s\n",
            port_number + 1);
    return (-2);
  }
  gedekDestinationIpPort2->sin_port = htons(gedekDestinationIpPort2->sin_port);
  *(port_number) = '\0';
  ret = inet_pton(AF_INET, strGedekDestinationIpPort2,
                  &gedekDestinationIpPort2->sin_addr.s_addr);
  if (ret <= 0) {
    if (ret == 0) {
      fprintf(stderr,
              "New GEDEK Destination1 IP Address and Port is Not in "
              "presentation format: %s\n",
              strGedekDestinationIpPort2);
    } else {
      perror("inet_pton");
      return (ret);
    }
  }
  ret_ether_addr =
      ether_aton_r(strGedekDestinationMac2, destGedekDestinationMacAddress2);
  if (ret_ether_addr == NULL) {
    fprintf(stderr,
            "New GEDEK Destination2 MAC Address is Not in presentation format: "
            "%s\n",
            strGedekDestinationMac2);
    return (-1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<parseArgvGedek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movq   $0x0,-0x40(%rbp)
movq   $0x0,-0x48(%rbp)
movq   $0x0,-0x50(%rbp)
movq   $0x0,-0x58(%rbp)
movq   $0x0,-0x60(%rbp)
movq   $0x0,-0x68(%rbp)
movq   $0x0,-0x70(%rbp)
movq   $0x0,-0x78(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe08(%rip),%rdx
call   10a0 <getopt@plt>
mov    %eax,-0x34(%rbp)
cmp    $0xffffffff,%eax
je     1249 <parseArgvGedek+0xc9>
mov    -0x34(%rbp),%eax
mov    %eax,-0x7c(%rbp)
sub    $0x3f,%eax
je     123a <parseArgvGedek+0xba>
jmp    121d <parseArgvGedek+0x9d>
mov    -0x7c(%rbp),%eax
sub    $0x68,%eax
jne    123f <parseArgvGedek+0xbf>
jmp    122e <parseArgvGedek+0xae>
movl   $0xffffffff,-0x4(%rbp)
jmp    160c <parseArgvGedek+0x48c>
jmp    1244 <parseArgvGedek+0xc4>
jmp    1244 <parseArgvGedek+0xc4>
jmp    11ea <parseArgvGedek+0x6a>
cmpl   $0x7,-0x8(%rbp)
je     125f <parseArgvGedek+0xdf>
movl   $0xffffffff,-0x4(%rbp)
jmp    160c <parseArgvGedek+0x48c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x50(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x58(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x60(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rax
mov    %rax,-0x68(%rbp)
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rax
mov    %rax,-0x70(%rbp)
mov    -0x10(%rbp),%rax
mov    0x30(%rax),%rax
mov    %rax,-0x78(%rbp)
mov    0x2d3a(%rip),%rax
mov    (%rax),%edi
mov    -0x58(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1060 <inet_pton@plt>
mov    %eax,-0x38(%rbp)
cmpl   $0x0,-0x38(%rbp)
jg     130e <parseArgvGedek+0x18e>
cmpl   $0x0,-0x38(%rbp)
jne    12f2 <parseArgvGedek+0x172>
mov    0x2cfd(%rip),%rax
mov    (%rax),%edi
mov    -0x58(%rbp),%rdx
lea    0xd1a(%rip),%rsi
call   1050 <fprintf@plt>
jmp    1309 <parseArgvGedek+0x189>
lea    0xd41(%rip),%rdi
call   1090 <perror@plt>
mov    -0x38(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    160c <parseArgvGedek+0x48c>
jmp    130e <parseArgvGedek+0x18e>
mov    -0x50(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1070 <ether_aton_r@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    134f <parseArgvGedek+0x1cf>
mov    0x2ca7(%rip),%rax
mov    (%rax),%edi
mov    -0x50(%rbp),%rdx
lea    0xd06(%rip),%rsi
call   1050 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    160c <parseArgvGedek+0x48c>
mov    -0x60(%rbp),%rdi
mov    $0x3a,%esi
call   1040 <strchr@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
jne    1391 <parseArgvGedek+0x211>
mov    0x2c65(%rip),%rax
mov    (%rax),%edi
mov    -0x60(%rbp),%rdx
lea    0xcf9(%rip),%rsi
call   1050 <fprintf@plt>
movl   $0xfffffffe,-0x4(%rbp)
jmp    160c <parseArgvGedek+0x48c>
mov    -0x48(%rbp),%rdi
add    $0x1,%rdi
mov    -0x28(%rbp),%rdx
add    $0x8,%rdx
lea    0xd1f(%rip),%rsi
call   1080 <sscanf@plt>
mov    %eax,-0x38(%rbp)
cmpl   $0x1,-0x38(%rbp)
je     13e3 <parseArgvGedek+0x263>
mov    0x2c17(%rip),%rax
mov    (%rax),%edi
mov    -0x48(%rbp),%rdx
add    $0x1,%rdx
lea    0xca7(%rip),%rsi
call   1050 <fprintf@plt>
movl   $0xfffffffe,-0x4(%rbp)
jmp    160c <parseArgvGedek+0x48c>
mov    -0x28(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <htons@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0x48(%rbp),%rax
movb   $0x0,(%rax)
mov    0x2bdf(%rip),%rax
mov    (%rax),%edi
mov    -0x60(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1060 <inet_pton@plt>
mov    %eax,-0x38(%rbp)
cmpl   $0x0,-0x38(%rbp)
jg     1469 <parseArgvGedek+0x2e9>
cmpl   $0x0,-0x38(%rbp)
jne    144d <parseArgvGedek+0x2cd>
mov    0x2ba2(%rip),%rax
mov    (%rax),%edi
mov    -0x60(%rbp),%rdx
lea    0xc36(%rip),%rsi
call   1050 <fprintf@plt>
jmp    1464 <parseArgvGedek+0x2e4>
lea    0xbe6(%rip),%rdi
call   1090 <perror@plt>
mov    -0x38(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    160c <parseArgvGedek+0x48c>
jmp    1469 <parseArgvGedek+0x2e9>
mov    -0x68(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1070 <ether_aton_r@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    14aa <parseArgvGedek+0x32a>
mov    0x2b4c(%rip),%rax
mov    (%rax),%edi
mov    -0x68(%rbp),%rdx
lea    0xc32(%rip),%rsi
call   1050 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    160c <parseArgvGedek+0x48c>
mov    -0x70(%rbp),%rdi
mov    $0x3a,%esi
call   1040 <strchr@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
jne    14ec <parseArgvGedek+0x36c>
mov    0x2b0a(%rip),%rax
mov    (%rax),%edi
mov    -0x70(%rbp),%rdx
lea    0xc36(%rip),%rsi
call   1050 <fprintf@plt>
movl   $0xfffffffe,-0x4(%rbp)
jmp    160c <parseArgvGedek+0x48c>
mov    -0x48(%rbp),%rdi
add    $0x1,%rdi
mov    0x10(%rbp),%rdx
add    $0x8,%rdx
lea    0xbc4(%rip),%rsi
call   1080 <sscanf@plt>
mov    %eax,-0x38(%rbp)
cmpl   $0x1,-0x38(%rbp)
je     153e <parseArgvGedek+0x3be>
mov    0x2abc(%rip),%rax
mov    (%rax),%edi
mov    -0x48(%rbp),%rdx
add    $0x1,%rdx
lea    0xbe4(%rip),%rsi
call   1050 <fprintf@plt>
movl   $0xfffffffe,-0x4(%rbp)
jmp    160c <parseArgvGedek+0x48c>
mov    0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <htons@plt>
mov    %rax,%rcx
mov    0x10(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0x48(%rbp),%rax
movb   $0x0,(%rax)
mov    0x2a84(%rip),%rax
mov    (%rax),%edi
mov    -0x70(%rbp),%rsi
mov    0x10(%rbp),%rdx
call   1060 <inet_pton@plt>
mov    %eax,-0x38(%rbp)
cmpl   $0x0,-0x38(%rbp)
jg     15c4 <parseArgvGedek+0x444>
cmpl   $0x0,-0x38(%rbp)
jne    15a8 <parseArgvGedek+0x428>
mov    0x2a47(%rip),%rax
mov    (%rax),%edi
mov    -0x70(%rbp),%rdx
lea    0xadb(%rip),%rsi
call   1050 <fprintf@plt>
jmp    15bf <parseArgvGedek+0x43f>
lea    0xa8b(%rip),%rdi
call   1090 <perror@plt>
mov    -0x38(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    160c <parseArgvGedek+0x48c>
jmp    15c4 <parseArgvGedek+0x444>
mov    -0x78(%rbp),%rdi
mov    0x18(%rbp),%rsi
call   1070 <ether_aton_r@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    1605 <parseArgvGedek+0x485>
mov    0x29f1(%rip),%rax
mov    (%rax),%edi
mov    -0x78(%rbp),%rdx
lea    0xb6b(%rip),%rsi
call   1050 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    160c <parseArgvGedek+0x48c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseArgvGedek>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %r9,%r13
mov    %r8,0x20(%rsp)
mov    %rcx,%r15
mov    %rdx,%r12
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xe58(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   10a0 <getopt@plt>
cmp    $0x68,%eax
je     13c6 <parseArgvGedek+0x246>
cmp    $0xffffffff,%eax
jne    11b0 <parseArgvGedek+0x30>
mov    $0xffffffff,%r14d
cmp    $0x7,%ebp
jne    13cc <parseArgvGedek+0x24c>
mov    %r13,0x18(%rsp)
mov    0x8(%rbx),%rbp
mov    0x10(%rbx),%r13
mov    0x18(%rbx),%rax
mov    %rax,0x8(%rsp)
mov    0x20(%rbx),%rax
mov    %rax,0x10(%rsp)
mov    0x28(%rbx),%rax
mov    %rax,(%rsp)
mov    0x30(%rbx),%rbx
mov    0x2ddc(%rip),%rax
mov    (%rax),%edi
mov    %r13,%rsi
mov    %r12,%rdx
call   1060 <inet_pton@plt>
test   %eax,%eax
jg     123b <parseArgvGedek+0xbb>
jne    144f <parseArgvGedek+0x2cf>
mov    0x2dae(%rip),%rax
mov    (%rax),%edi
lea    0xdcf(%rip),%rsi
mov    %r13,%rdx
call   1050 <fprintf@plt>
mov    %rbp,%rdi
mov    %r15,%rsi
call   1070 <ether_aton_r@plt>
test   %rax,%rax
je     13ae <parseArgvGedek+0x22e>
mov    %rbx,%r12
mov    0x8(%rsp),%r15
mov    %r15,%rdi
mov    $0x3a,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     13de <parseArgvGedek+0x25e>
mov    %rax,%rbx
lea    0x1(%rax),%r14
mov    0x20(%rsp),%rbp
lea    0x8(%rbp),%rdx
lea    0xe43(%rip),%rsi
mov    %r14,%rdi
call   1080 <sscanf@plt>
cmp    $0x1,%eax
jne    13f3 <parseArgvGedek+0x273>
mov    0x8(%rbp),%rdi
call   1030 <htons@plt>
mov    %rax,0x8(%rbp)
movb   $0x0,(%rbx)
mov    0x2d3c(%rip),%rax
mov    (%rax),%edi
mov    %r15,%rsi
mov    %rbp,%rdx
call   1060 <inet_pton@plt>
test   %eax,%eax
mov    0x68(%rsp),%r15
mov    0x60(%rsp),%r13
jg     12e7 <parseArgvGedek+0x167>
jne    144f <parseArgvGedek+0x2cf>
mov    0x2d04(%rip),%rax
mov    (%rax),%edi
lea    0xd9c(%rip),%rsi
mov    0x8(%rsp),%rdx
call   1050 <fprintf@plt>
mov    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    0x18(%rsp),%rsi
call   1070 <ether_aton_r@plt>
test   %rax,%rax
je     1413 <parseArgvGedek+0x293>
mov    (%rsp),%rbp
mov    %rbp,%rdi
mov    $0x3a,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     1428 <parseArgvGedek+0x2a8>
mov    %rax,%rbx
lea    0x1(%rax),%r14
lea    0x8(%r13),%rdx
lea    0xd99(%rip),%rsi
mov    %r14,%rdi
call   1080 <sscanf@plt>
cmp    $0x1,%eax
jne    143d <parseArgvGedek+0x2bd>
mov    0x8(%r13),%rdi
call   1030 <htons@plt>
mov    %rax,0x8(%r13)
movb   $0x0,(%rbx)
mov    0x2c92(%rip),%rax
mov    (%rax),%edi
mov    %rbp,%rsi
mov    %r13,%rdx
call   1060 <inet_pton@plt>
test   %eax,%eax
mov    %r12,%rbx
jg     1389 <parseArgvGedek+0x209>
jne    144f <parseArgvGedek+0x2cf>
mov    0x2c61(%rip),%rax
mov    (%rax),%edi
lea    0xcf9(%rip),%rsi
mov    (%rsp),%rdx
call   1050 <fprintf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1070 <ether_aton_r@plt>
xor    %r14d,%r14d
test   %rax,%rax
jne    13cc <parseArgvGedek+0x24c>
mov    0x2c35(%rip),%rax
mov    (%rax),%edi
lea    0xdb3(%rip),%rsi
jmp    1423 <parseArgvGedek+0x2a3>
mov    0x2c23(%rip),%rax
mov    (%rax),%edi
lea    0xc86(%rip),%rsi
mov    %rbp,%rdx
call   1050 <fprintf@plt>
mov    $0xffffffff,%r14d
mov    %r14d,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2bf3(%rip),%rax
mov    (%rax),%edi
lea    0xc8b(%rip),%rsi
mov    %r15,%rdx
jmp    1406 <parseArgvGedek+0x286>
mov    0x2bde(%rip),%rax
mov    (%rax),%edi
lea    0xc76(%rip),%rsi
mov    %r14,%rdx
call   1050 <fprintf@plt>
mov    $0xfffffffe,%r14d
jmp    13cc <parseArgvGedek+0x24c>
mov    0x2bbe(%rip),%rax
mov    (%rax),%edi
lea    0xca8(%rip),%rsi
mov    %rbx,%rdx
jmp    13c1 <parseArgvGedek+0x241>
mov    0x2ba9(%rip),%rax
mov    (%rax),%edi
lea    0xcd9(%rip),%rsi
mov    %rbp,%rdx
jmp    1406 <parseArgvGedek+0x286>
mov    0x2b94(%rip),%rax
mov    (%rax),%edi
lea    0xcc4(%rip),%rsi
jmp    1403 <parseArgvGedek+0x283>
mov    %eax,%r14d
lea    0xbe1(%rip),%rdi
call   1090 <perror@plt>
jmp    13cc <parseArgvGedek+0x24c>

LLVM IR (-O0):
%struct.sockaddr_in = type { %struct.TYPE_2__, i8* }
%struct.TYPE_2__ = type { i32 }
%struct.ether_addr = type { i32 }
@.str = [2 x i8] c"h\00"
@AF_INET = global i32 0
@stderr = global i32 0
@.str.1 = [56 x i8] c"New GEDEK Ip Address is Not in presentation format: %s\0A\00"
@.str.2 = [10 x i8] c"inet_pton\00"
@.str.3 = [53 x i8] c"GEDEK Mac Address is Not in presentation format: %s\0A\00"
@.str.4 = [78 x i8] c"New GEDEK Destination1 IP Address and Port is Not in presentation format: %s\0A\00"
@.str.5 = [4 x i8] c"%ud\00"
@.str.6 = [70 x i8] c"New GEDEK Destination2 Mac Address is Not in presentation format: %s\0A\00"
@.str.7 = [78 x i8] c"New GEDEK Destination2 IP Address and Port is Not in presentation format: %s\0A\00"
@.str.8 = [70 x i8] c"New GEDEK Destination2 MAC Address is Not in presentation format: %s\0A\00"
define i32 @parseArgvGedek(i32 %0, i8** %1, i32* %2, %struct.ether_addr* %3, %struct.sockaddr_in* %4, %struct.ether_addr* %5, %struct.sockaddr_in* %6, %struct.ether_addr* %7) {
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8**
%12 = alloca i32*
%13 = alloca %struct.ether_addr*
%14 = alloca %struct.sockaddr_in*
%15 = alloca %struct.ether_addr*
%16 = alloca %struct.sockaddr_in*
%17 = alloca %struct.ether_addr*
%18 = alloca i32
%19 = alloca i32
%20 = alloca %struct.ether_addr*
%21 = alloca i8*
%22 = alloca i8*
%23 = alloca i8*
%24 = alloca i8*
%25 = alloca i8*
%26 = alloca i8*
%27 = alloca i8*
store i32 %0, i32* %10
store i8** %1, i8*** %11
store i32* %2, i32** %12
store %struct.ether_addr* %3, %struct.ether_addr** %13
store %struct.sockaddr_in* %4, %struct.sockaddr_in** %14
store %struct.ether_addr* %5, %struct.ether_addr** %15
store %struct.sockaddr_in* %6, %struct.sockaddr_in** %16
store %struct.ether_addr* %7, %struct.ether_addr** %17
store %struct.ether_addr* null, %struct.ether_addr** %20
store i8* null, i8** %21
store i8* null, i8** %22
store i8* null, i8** %23
store i8* null, i8** %24
store i8* null, i8** %25
store i8* null, i8** %26
store i8* null, i8** %27
br label %28
28: ; preds = %38, %8
%29 = load i32, i32* %10
%30 = load i8**, i8*** %11
%31 = call i32 @getopt(i32 %29, i8** %30, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32 %31, i32* %18
%32 = icmp ne i32 %31, -1
br i1 %32, label %33, label %39
33: ; preds = %28
%34 = load i32, i32* %18
switch i32 %34, label %37 [
i32 104, label %35
i32 63, label %36
]
35: ; preds = %33
store i32 -1, i32* %9
br label %210
36: ; preds = %33
br label %38
37: ; preds = %33
br label %38
38: ; preds = %37, %36
br label %28
39: ; preds = %28
%40 = load i32, i32* %10
%41 = icmp ne i32 %40, 7
br i1 %41, label %42, label %43
42: ; preds = %39
store i32 -1, i32* %9
br label %210
43: ; preds = %39
%44 = load i8**, i8*** %11
%45 = getelementptr inbounds i8*, i8** %44, i64 1
%46 = load i8*, i8** %45
store i8* %46, i8** %22
%47 = load i8**, i8*** %11
%48 = getelementptr inbounds i8*, i8** %47, i64 2
%49 = load i8*, i8** %48
store i8* %49, i8** %23
%50 = load i8**, i8*** %11
%51 = getelementptr inbounds i8*, i8** %50, i64 3
%52 = load i8*, i8** %51
store i8* %52, i8** %24
%53 = load i8**, i8*** %11
%54 = getelementptr inbounds i8*, i8** %53, i64 4
%55 = load i8*, i8** %54
store i8* %55, i8** %25
%56 = load i8**, i8*** %11
%57 = getelementptr inbounds i8*, i8** %56, i64 5
%58 = load i8*, i8** %57
store i8* %58, i8** %26
%59 = load i8**, i8*** %11
%60 = getelementptr inbounds i8*, i8** %59, i64 6
%61 = load i8*, i8** %60
store i8* %61, i8** %27
%62 = load i32, i32* @AF_INET
%63 = load i8*, i8** %23
%64 = load i32*, i32** %12
%65 = call i32 @inet_pton(i32 %62, i8* %63, i32* %64)
store i32 %65, i32* %19
%66 = load i32, i32* %19
%67 = icmp sle i32 %66, 0
br i1 %67, label %68, label %79
68: ; preds = %43
%69 = load i32, i32* %19
%70 = icmp eq i32 %69, 0
br i1 %70, label %71, label %75
71: ; preds = %68
%72 = load i32, i32* @stderr
%73 = load i8*, i8** %23
%74 = call i32 @fprintf(i32 %72, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0), i8* %73)
br label %78
75: ; preds = %68
%76 = call i32 @perror(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%77 = load i32, i32* %19
store i32 %77, i32* %9
br label %210
78: ; preds = %71
br label %79
79: ; preds = %78, %43
%80 = load i8*, i8** %22
%81 = load %struct.ether_addr*, %struct.ether_addr** %13
%82 = call %struct.ether_addr* @ether_aton_r(i8* %80, %struct.ether_addr* %81)
store %struct.ether_addr* %82, %struct.ether_addr** %20
%83 = load %struct.ether_addr*, %struct.ether_addr** %20
%84 = icmp eq %struct.ether_addr* %83, null
br i1 %84, label %85, label %89
85: ; preds = %79
%86 = load i32, i32* @stderr
%87 = load i8*, i8** %22
%88 = call i32 @fprintf(i32 %86, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.3, i64 0, i64 0), i8* %87)
store i32 -1, i32* %9
br label %210
89: ; preds = %79
%90 = load i8*, i8** %24
%91 = call i8* @strchr(i8* %90, i8 signext 58)
store i8* %91, i8** %21
%92 = load i8*, i8** %21
%93 = icmp eq i8* %92, null
br i1 %93, label %94, label %98
94: ; preds = %89
%95 = load i32, i32* @stderr
%96 = load i8*, i8** %24
%97 = call i32 @fprintf(i32 %95, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.4, i64 0, i64 0), i8* %96)
store i32 -2, i32* %9
br label %210
98: ; preds = %89
%99 = load i8*, i8** %21
%100 = getelementptr inbounds i8, i8* %99, i64 1
%101 = load %struct.sockaddr_in*, %struct.sockaddr_in** %14
%102 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %101, i32 0, i32 1
%103 = bitcast i8** %102 to i32*
%104 = call i32 @sscanf(i8* %100, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32* %103)
store i32 %104, i32* %19
%105 = load i32, i32* %19
%106 = icmp ne i32 %105, 1
br i1 %106, label %107, label %112
107: ; preds = %98
%108 = load i32, i32* @stderr
%109 = load i8*, i8** %21
%110 = getelementptr inbounds i8, i8* %109, i64 1
%111 = call i32 @fprintf(i32 %108, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.4, i64 0, i64 0), i8* %110)
store i32 -2, i32* %9
br label %210
112: ; preds = %98
%113 = load %struct.sockaddr_in*, %struct.sockaddr_in** %14
%114 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %113, i32 0, i32 1
%115 = load i8*, i8** %114
%116 = call i8* @htons(i8* %115)
%117 = load %struct.sockaddr_in*, %struct.sockaddr_in** %14
%118 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %117, i32 0, i32 1
store i8* %116, i8** %118
%119 = load i8*, i8** %21
store i8 0, i8* %119
%120 = load i32, i32* @AF_INET
%121 = load i8*, i8** %24
%122 = load %struct.sockaddr_in*, %struct.sockaddr_in** %14
%123 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %122, i32 0, i32 0
%124 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %123, i32 0, i32 0
%125 = call i32 @inet_pton(i32 %120, i8* %121, i32* %124)
store i32 %125, i32* %19
%126 = load i32, i32* %19
%127 = icmp sle i32 %126, 0
br i1 %127, label %128, label %139
128: ; preds = %112
%129 = load i32, i32* %19
%130 = icmp eq i32 %129, 0
br i1 %130, label %131, label %135
131: ; preds = %128
%132 = load i32, i32* @stderr
%133 = load i8*, i8** %24
%134 = call i32 @fprintf(i32 %132, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.4, i64 0, i64 0), i8* %133)
br label %138
135: ; preds = %128
%136 = call i32 @perror(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%137 = load i32, i32* %19
store i32 %137, i32* %9
br label %210
138: ; preds = %131
br label %139
139: ; preds = %138, %112
%140 = load i8*, i8** %25
%141 = load %struct.ether_addr*, %struct.ether_addr** %15
%142 = call %struct.ether_addr* @ether_aton_r(i8* %140, %struct.ether_addr* %141)
store %struct.ether_addr* %142, %struct.ether_addr** %20
%143 = load %struct.ether_addr*, %struct.ether_addr** %20
%144 = icmp eq %struct.ether_addr* %143, null
br i1 %144, label %145, label %149
145: ; preds = %139
%146 = load i32, i32* @stderr
%147 = load i8*, i8** %25
%148 = call i32 @fprintf(i32 %146, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.6, i64 0, i64 0), i8* %147)
store i32 -1, i32* %9
br label %210
149: ; preds = %139
%150 = load i8*, i8** %26
%151 = call i8* @strchr(i8* %150, i8 signext 58)
store i8* %151, i8** %21
%152 = load i8*, i8** %21
%153 = icmp eq i8* %152, null
br i1 %153, label %154, label %158
154: ; preds = %149
%155 = load i32, i32* @stderr
%156 = load i8*, i8** %26
%157 = call i32 @fprintf(i32 %155, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.7, i64 0, i64 0), i8* %156)
store i32 -2, i32* %9
br label %210
158: ; preds = %149
%159 = load i8*, i8** %21
%160 = getelementptr inbounds i8, i8* %159, i64 1
%161 = load %struct.sockaddr_in*, %struct.sockaddr_in** %16
%162 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %161, i32 0, i32 1
%163 = bitcast i8** %162 to i32*
%164 = call i32 @sscanf(i8* %160, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32* %163)
store i32 %164, i32* %19
%165 = load i32, i32* %19
%166 = icmp ne i32 %165, 1
br i1 %166, label %167, label %172
167: ; preds = %158
%168 = load i32, i32* @stderr
%169 = load i8*, i8** %21
%170 = getelementptr inbounds i8, i8* %169, i64 1
%171 = call i32 @fprintf(i32 %168, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.7, i64 0, i64 0), i8* %170)
store i32 -2, i32* %9
br label %210
172: ; preds = %158
%173 = load %struct.sockaddr_in*, %struct.sockaddr_in** %16
%174 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %173, i32 0, i32 1
%175 = load i8*, i8** %174
%176 = call i8* @htons(i8* %175)
%177 = load %struct.sockaddr_in*, %struct.sockaddr_in** %16
%178 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %177, i32 0, i32 1
store i8* %176, i8** %178
%179 = load i8*, i8** %21
store i8 0, i8* %179
%180 = load i32, i32* @AF_INET
%181 = load i8*, i8** %26
%182 = load %struct.sockaddr_in*, %struct.sockaddr_in** %16
%183 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %182, i32 0, i32 0
%184 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %183, i32 0, i32 0
%185 = call i32 @inet_pton(i32 %180, i8* %181, i32* %184)
store i32 %185, i32* %19
%186 = load i32, i32* %19
%187 = icmp sle i32 %186, 0
br i1 %187, label %188, label %199
188: ; preds = %172
%189 = load i32, i32* %19
%190 = icmp eq i32 %189, 0
br i1 %190, label %191, label %195
191: ; preds = %188
%192 = load i32, i32* @stderr
%193 = load i8*, i8** %26
%194 = call i32 @fprintf(i32 %192, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.4, i64 0, i64 0), i8* %193)
br label %198
195: ; preds = %188
%196 = call i32 @perror(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%197 = load i32, i32* %19
store i32 %197, i32* %9
br label %210
198: ; preds = %191
br label %199
199: ; preds = %198, %172
%200 = load i8*, i8** %27
%201 = load %struct.ether_addr*, %struct.ether_addr** %17
%202 = call %struct.ether_addr* @ether_aton_r(i8* %200, %struct.ether_addr* %201)
store %struct.ether_addr* %202, %struct.ether_addr** %20
%203 = load %struct.ether_addr*, %struct.ether_addr** %20
%204 = icmp eq %struct.ether_addr* %203, null
br i1 %204, label %205, label %209
205: ; preds = %199
%206 = load i32, i32* @stderr
%207 = load i8*, i8** %27
%208 = call i32 @fprintf(i32 %206, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.8, i64 0, i64 0), i8* %207)
store i32 -1, i32* %9
br label %210
209: ; preds = %199
store i32 0, i32* %9
br label %210
210: ; preds = %209, %205, %195, %167, %154, %145, %135, %107, %94, %85, %75, %42, %35
%211 = load i32, i32* %9
ret i32 %211
}

LLVM IR (-O2):
%struct.sockaddr_in = type { %struct.TYPE_2__, i8* }
%struct.TYPE_2__ = type { i32 }
%struct.ether_addr = type { i32 }
@.str = [2 x i8] c"h\00"
@AF_INET = global i32 0
@stderr = global i32 0
@.str.1 = [56 x i8] c"New GEDEK Ip Address is Not in presentation format: %s\0A\00"
@.str.2 = [10 x i8] c"inet_pton\00"
@.str.3 = [53 x i8] c"GEDEK Mac Address is Not in presentation format: %s\0A\00"
@.str.4 = [78 x i8] c"New GEDEK Destination1 IP Address and Port is Not in presentation format: %s\0A\00"
@.str.5 = [4 x i8] c"%ud\00"
@.str.6 = [70 x i8] c"New GEDEK Destination2 Mac Address is Not in presentation format: %s\0A\00"
@.str.7 = [78 x i8] c"New GEDEK Destination2 IP Address and Port is Not in presentation format: %s\0A\00"
@.str.8 = [70 x i8] c"New GEDEK Destination2 MAC Address is Not in presentation format: %s\0A\00"
define i32 @parseArgvGedek(i32 %0, i8** %1, i32* %2, %struct.ether_addr* %3, %struct.sockaddr_in* %4, %struct.ether_addr* %5, %struct.sockaddr_in* %6, %struct.ether_addr* %7) {
br label %9
9: ; preds = %9, %8
%10 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
switch i32 %10, label %9 [
i32 -1, label %11
i32 104, label %112
]
11: ; preds = %9
%12 = icmp eq i32 %0, 7
br i1 %12, label %13, label %112
13: ; preds = %11
%14 = getelementptr inbounds i8*, i8** %1, i64 1
%15 = load i8*, i8** %14
%16 = getelementptr inbounds i8*, i8** %1, i64 2
%17 = load i8*, i8** %16
%18 = getelementptr inbounds i8*, i8** %1, i64 3
%19 = load i8*, i8** %18
%20 = getelementptr inbounds i8*, i8** %1, i64 4
%21 = load i8*, i8** %20
%22 = getelementptr inbounds i8*, i8** %1, i64 5
%23 = load i8*, i8** %22
%24 = getelementptr inbounds i8*, i8** %1, i64 6
%25 = load i8*, i8** %24
%26 = load i32, i32* @AF_INET
%27 = tail call i32 @inet_pton(i32 %26, i8* %17, i32* %2)
%28 = icmp slt i32 %27, 1
br i1 %28, label %29, label %36
29: ; preds = %13
%30 = icmp eq i32 %27, 0
br i1 %30, label %31, label %34
31: ; preds = %29
%32 = load i32, i32* @stderr
%33 = tail call i32 @fprintf(i32 %32, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0), i8* %17)
br label %36
34: ; preds = %29
%35 = tail call i32 @perror(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
br label %112
36: ; preds = %31, %13
%37 = tail call %struct.ether_addr* @ether_aton_r(i8* %15, %struct.ether_addr* %3)
%38 = icmp eq %struct.ether_addr* %37, null
br i1 %38, label %39, label %42
39: ; preds = %36
%40 = load i32, i32* @stderr
%41 = tail call i32 @fprintf(i32 %40, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.3, i64 0, i64 0), i8* %15)
br label %112
42: ; preds = %36
%43 = tail call i8* @strchr(i8* dereferenceable(1) %19, i8 signext 58)
%44 = icmp eq i8* %43, null
br i1 %44, label %45, label %48
45: ; preds = %42
%46 = load i32, i32* @stderr
%47 = tail call i32 @fprintf(i32 %46, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.4, i64 0, i64 0), i8* %19)
br label %112
48: ; preds = %42
%49 = getelementptr inbounds i8, i8* %43, i64 1
%50 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 1
%51 = bitcast i8** %50 to i32*
%52 = tail call i32 @sscanf(i8* %49, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32* %51)
%53 = icmp eq i32 %52, 1
br i1 %53, label %57, label %54
54: ; preds = %48
%55 = load i32, i32* @stderr
%56 = tail call i32 @fprintf(i32 %55, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.4, i64 0, i64 0), i8* %49)
br label %112
57: ; preds = %48
%58 = load i8*, i8** %50
%59 = tail call i8* @htons(i8* %58)
store i8* %59, i8** %50
store i8 0, i8* %43
%60 = load i32, i32* @AF_INET
%61 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 0, i32 0
%62 = tail call i32 @inet_pton(i32 %60, i8* %19, i32* %61)
%63 = icmp slt i32 %62, 1
br i1 %63, label %64, label %71
64: ; preds = %57
%65 = icmp eq i32 %62, 0
br i1 %65, label %66, label %69
66: ; preds = %64
%67 = load i32, i32* @stderr
%68 = tail call i32 @fprintf(i32 %67, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.4, i64 0, i64 0), i8* %19)
br label %71
69: ; preds = %64
%70 = tail call i32 @perror(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
br label %112
71: ; preds = %66, %57
%72 = tail call %struct.ether_addr* @ether_aton_r(i8* %21, %struct.ether_addr* %5)
%73 = icmp eq %struct.ether_addr* %72, null
br i1 %73, label %74, label %77
74: ; preds = %71
%75 = load i32, i32* @stderr
%76 = tail call i32 @fprintf(i32 %75, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.6, i64 0, i64 0), i8* %21)
br label %112
77: ; preds = %71
%78 = tail call i8* @strchr(i8* dereferenceable(1) %23, i8 signext 58)
%79 = icmp eq i8* %78, null
br i1 %79, label %80, label %83
80: ; preds = %77
%81 = load i32, i32* @stderr
%82 = tail call i32 @fprintf(i32 %81, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.7, i64 0, i64 0), i8* %23)
br label %112
83: ; preds = %77
%84 = getelementptr inbounds i8, i8* %78, i64 1
%85 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i64 0, i32 1
%86 = bitcast i8** %85 to i32*
%87 = tail call i32 @sscanf(i8* %84, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32* %86)
%88 = icmp eq i32 %87, 1
br i1 %88, label %92, label %89
89: ; preds = %83
%90 = load i32, i32* @stderr
%91 = tail call i32 @fprintf(i32 %90, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.7, i64 0, i64 0), i8* %84)
br label %112
92: ; preds = %83
%93 = load i8*, i8** %85
%94 = tail call i8* @htons(i8* %93)
store i8* %94, i8** %85
store i8 0, i8* %78
%95 = load i32, i32* @AF_INET
%96 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i64 0, i32 0, i32 0
%97 = tail call i32 @inet_pton(i32 %95, i8* %23, i32* %96)
%98 = icmp slt i32 %97, 1
br i1 %98, label %99, label %106
99: ; preds = %92
%100 = icmp eq i32 %97, 0
br i1 %100, label %101, label %104
101: ; preds = %99
%102 = load i32, i32* @stderr
%103 = tail call i32 @fprintf(i32 %102, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.4, i64 0, i64 0), i8* %23)
br label %106
104: ; preds = %99
%105 = tail call i32 @perror(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
br label %112
106: ; preds = %101, %92
%107 = tail call %struct.ether_addr* @ether_aton_r(i8* %25, %struct.ether_addr* %7)
%108 = icmp eq %struct.ether_addr* %107, null
br i1 %108, label %109, label %112
109: ; preds = %106
%110 = load i32, i32* @stderr
%111 = tail call i32 @fprintf(i32 %110, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.8, i64 0, i64 0), i8* %25)
br label %112
112: ; preds = %9, %106, %11, %109, %104, %89, %80, %74, %69, %54, %45, %39, %34
%113 = phi i32 [ -1, %39 ], [ -2, %45 ], [ -2, %54 ], [ -1, %74 ], [ -2, %80 ], [ -2, %89 ], [ -1, %109 ], [ %97, %104 ], [ %62, %69 ], [ %27, %34 ], [ -1, %11 ], [ 0, %106 ], [ -1, %9 ]
ret i32 %113
}