#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
struct option {
  char *name;
  char val;
  scalar_t__ flag;
  scalar_t__ has_arg;
};

/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ free(struct option *);
int getopt_long(int, char **, char *, struct option *, int *);
struct option *malloc(int);
scalar_t__ no_argument;
char *optarg;
int opterr;
int optind;
scalar_t__ optional_argument;
int optopt;
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ putchar(char);
scalar_t__ required_argument;
int /*<<< orphan*/ stderr;
size_t strlen(char *);
char *strtok(char *, char *);
int main(int argc, char **argv) {
  struct option *longopts;
  char *shortopts, *name, *cur;
  int c, i, count;
  int longind = -1;
  if (argc < 4) {
    printf("Usage:  %s <shortopts> <longopts> [args]\n", argv[0]);
    printf("<shortopts>\tString of shortopts to pass to getopt()\n");
    printf("<longopts>\tSpace-separated list of long options.\n"
           "\t\tsame : notation for arguments as short options\n");
    return EXIT_FAILURE;
  }
  shortopts = argv[1];
  cur = argv[2];
  count = 2;
  while (*cur)
    if (*cur++ == ' ')
      count++;
  longopts = malloc(sizeof(struct option) * count);
  if (!longopts) {
    fprintf(stderr, "Unable to allocate memory for long options.\n");
    return EXIT_FAILURE;
  }
  name = strtok(argv[2], " ");
  for (i = 0; name != NULL; i++) {
    size_t namelen = strlen(name);
    if (namelen > 0 && name[namelen - 1] == ':') {
      if (namelen > 1 && name[namelen - 2] == ':') {
        longopts[i].has_arg = optional_argument;
        name[namelen - 2] = '\0';
      } else {
        longopts[i].has_arg = required_argument;
        name[namelen - 1] = '\0';
      }
    } else
      longopts[i].has_arg = no_argument;
    longopts[i].name = name;
    longopts[i].flag = 0;
    longopts[i].val = name[0];
    name = strtok(NULL, " ");
  }
  assert(i < count);
  longopts[i].name = 0;
  longopts[i].has_arg = 0;
  longopts[i].flag = 0;
  longopts[i].val = 0;
  while ((c = getopt_long(argc - 3, argv + 3, shortopts, longopts, &longind)) !=
         -1) {
    switch (c) {
    case 0:
      printf("Encountered option '%s' with arg '%s', flag set.\n",
             longopts[longind].name, optarg);
      break;
    case ':':
      printf("Encountered option '%c' missing argument\n", optopt);
      break;
    case '?':
      printf("Encountered unexpected option '%c'\n", optopt);
      break;
    default:
      printf("Encountered option '%c' with argument '%s'\n", c, optarg);
      break;
    }
    printf("optind=%d\topterr=%d\toptopt=%d\toptarg='%s'\tlongind='%d'\n",
           optind, opterr, optopt, optarg, longind);
    for (i = 3; i < argc; i++)
      printf("argv[%d] = %s\n", i - 3, argv[i]);
  }
  if (optind + 3 < argc) {
    printf("Remaining arguments:  ");
    while (optind + 3 < argc) {
      printf("'%s' ", argv[optind + 3]);
      optind++;
    }
    putchar('\n');
  }
  free(longopts);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xffffffff,-0x40(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    11f9 <main+0x69>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe3b(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xe57(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xe7e(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    0x2db9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1658 <main+0x4c8>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x30(%rbp)
movl   $0x2,-0x3c(%rbp)
mov    -0x30(%rbp),%rax
cmpb   $0x0,(%rax)
je     124e <main+0xbe>
mov    -0x30(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x30(%rbp)
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    1249 <main+0xb9>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1218 <main+0x88>
movslq -0x3c(%rbp),%rax
shl    $0x5,%rax
mov    %eax,%edi
call   10a0 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1292 <main+0x102>
mov    0x2d45(%rip),%rax
mov    (%rax),%edi
lea    0xe46(%rip),%rsi
call   1090 <fprintf@plt>
mov    0x2d20(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1658 <main+0x4c8>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xf56(%rip),%rsi
call   10b0 <strtok@plt>
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x38(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     13f9 <main+0x269>
mov    -0x28(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
jbe    1375 <main+0x1e5>
mov    -0x28(%rbp),%rax
mov    -0x48(%rbp),%rcx
sub    $0x1,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x3a,%eax
jne    1375 <main+0x1e5>
cmpq   $0x1,-0x48(%rbp)
jbe    1343 <main+0x1b3>
mov    -0x28(%rbp),%rax
mov    -0x48(%rbp),%rcx
sub    $0x2,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x3a,%eax
jne    1343 <main+0x1b3>
mov    0x2cc8(%rip),%rax
mov    (%rax),%rcx
mov    -0x18(%rbp),%rax
movslq -0x38(%rbp),%rdx
shl    $0x5,%rdx
add    %rdx,%rax
mov    %rcx,0x18(%rax)
mov    -0x28(%rbp),%rax
mov    -0x48(%rbp),%rcx
sub    $0x2,%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    1370 <main+0x1e0>
mov    0x2c7e(%rip),%rax
mov    (%rax),%rcx
mov    -0x18(%rbp),%rax
movslq -0x38(%rbp),%rdx
shl    $0x5,%rdx
add    %rdx,%rax
mov    %rcx,0x18(%rax)
mov    -0x28(%rbp),%rax
mov    -0x48(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    1392 <main+0x202>
mov    0x2c34(%rip),%rax
mov    (%rax),%rcx
mov    -0x18(%rbp),%rax
movslq -0x38(%rbp),%rdx
shl    $0x5,%rdx
add    %rdx,%rax
mov    %rcx,0x18(%rax)
mov    -0x28(%rbp),%rcx
mov    -0x18(%rbp),%rax
movslq -0x38(%rbp),%rdx
shl    $0x5,%rdx
add    %rdx,%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
movslq -0x38(%rbp),%rcx
shl    $0x5,%rcx
add    %rcx,%rax
movq   $0x0,0x10(%rax)
mov    -0x28(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
movslq -0x38(%rbp),%rdx
shl    $0x5,%rdx
add    %rdx,%rax
mov    %cl,0x8(%rax)
xor    %eax,%eax
mov    %eax,%edi
lea    0xe15(%rip),%rsi
call   10b0 <strtok@plt>
mov    %rax,-0x28(%rbp)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    12b1 <main+0x121>
mov    -0x38(%rbp),%eax
cmp    -0x3c(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1080 <assert@plt>
mov    -0x18(%rbp),%rax
movslq -0x38(%rbp),%rcx
shl    $0x5,%rcx
add    %rcx,%rax
movq   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movslq -0x38(%rbp),%rcx
shl    $0x5,%rcx
add    %rcx,%rax
movq   $0x0,0x18(%rax)
mov    -0x18(%rbp),%rax
movslq -0x38(%rbp),%rcx
shl    $0x5,%rcx
add    %rcx,%rax
movq   $0x0,0x10(%rax)
mov    -0x18(%rbp),%rax
movslq -0x38(%rbp),%rcx
shl    $0x5,%rcx
add    %rcx,%rax
movb   $0x0,0x8(%rax)
mov    -0x8(%rbp),%edi
sub    $0x3,%edi
mov    -0x10(%rbp),%rsi
add    $0x18,%rsi
mov    -0x20(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    -0x40(%rbp),%r8
call   1060 <getopt_long@plt>
mov    %eax,-0x34(%rbp)
cmp    $0xffffffff,%eax
je     15c2 <main+0x432>
mov    -0x34(%rbp),%eax
mov    %eax,-0x4c(%rbp)
test   %eax,%eax
je     14c3 <main+0x333>
jmp    14a1 <main+0x311>
mov    -0x4c(%rbp),%eax
sub    $0x3a,%eax
je     14f2 <main+0x362>
jmp    14b2 <main+0x322>
mov    -0x4c(%rbp),%eax
sub    $0x3f,%eax
je     150e <main+0x37e>
jmp    152a <main+0x39a>
mov    -0x18(%rbp),%rax
movslq -0x40(%rbp),%rcx
shl    $0x5,%rcx
add    %rcx,%rax
mov    (%rax),%rsi
mov    0x2b1c(%rip),%rax
mov    (%rax),%rdx
lea    0xc09(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    1545 <main+0x3b5>
mov    0x2adf(%rip),%rax
mov    (%rax),%esi
lea    0xc1f(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    1545 <main+0x3b5>
mov    0x2ac3(%rip),%rax
mov    (%rax),%esi
lea    0xc2d(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    1545 <main+0x3b5>
mov    -0x34(%rbp),%esi
mov    0x2ac4(%rip),%rax
mov    (%rax),%rdx
lea    0xc31(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    0x2a84(%rip),%rax
mov    (%rax),%esi
mov    0x2a4b(%rip),%rax
mov    (%rax),%edx
mov    0x2a7a(%rip),%rax
mov    (%rax),%ecx
mov    0x2a91(%rip),%rax
mov    (%rax),%r8
mov    -0x40(%rbp),%r9d
lea    0xc26(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x3,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    15bd <main+0x42d>
mov    -0x38(%rbp),%esi
sub    $0x3,%esi
mov    -0x10(%rbp),%rax
movslq -0x38(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xc2b(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1583 <main+0x3f3>
jmp    1463 <main+0x2d3>
mov    0x2a07(%rip),%rax
mov    (%rax),%eax
add    $0x3,%eax
cmp    -0x8(%rbp),%eax
jge    1643 <main+0x4b3>
lea    0xc04(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    0x29e4(%rip),%rax
mov    (%rax),%eax
add    $0x3,%eax
cmp    -0x8(%rbp),%eax
jge    1639 <main+0x4a9>
mov    -0x10(%rbp),%rax
mov    0x29cb(%rip),%rcx
mov    (%rcx),%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xbe1(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    0x29aa(%rip),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    0x299e(%rip),%rax
mov    %ecx,(%rax)
jmp    15e5 <main+0x455>
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    0x2945(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%rbx
movl   $0xffffffff,0x4(%rsp)
ff
cmp    $0x3,%edi
jg     11f3 <main+0x53>
mov    (%rbx),%rsi
lea    0xe38(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xf91(%rip),%rdi
call   1050 <puts@plt>
lea    0xfb9(%rip),%rdi
call   1050 <puts@plt>
mov    0x2dba(%rip),%rax
jmp    156b <main+0x3cb>
mov    %edi,%ebp
mov    0x10(%rbx),%r14
mov    (%r14),%cl
test   %cl,%cl
je     1228 <main+0x88>
lea    0x1(%r14),%rax
mov    $0x2,%r12d
nopw   0x0(%rax,%rax,1)
xor    %edx,%edx
cmp    $0x20,%cl
sete   %dl
add    %edx,%r12d
movzbl (%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1210 <main+0x70>
jmp    122e <main+0x8e>
mov    $0x2,%r12d
mov    0x8(%rbx),%rax
mov    %rax,0x20(%rsp)
mov    %r12d,%edi
shl    $0x5,%edi
call   10b0 <malloc@plt>
mov    %rax,0x8(%rsp)
test   %rax,%rax
je     1329 <main+0x189>
mov    %rbp,0x10(%rsp)
lea    0xf03(%rip),%rsi
mov    %r14,%rdi
call   10c0 <strtok@plt>
test   %rax,%rax
je     134a <main+0x1aa>
mov    %rax,%r13
mov    0x8(%rsp),%rbp
add    $0x18,%rbp
xor    %r15d,%r15d
lea    0xedc(%rip),%r14
jmp    12d0 <main+0x130>
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x2d19(%rip),%rax
mov    (%rax),%rax
mov    %rax,0x0(%rbp)
mov    %r13,-0x18(%rbp)
movq   $0x0,-0x8(%rbp)
movzbl 0x0(%r13),%eax
mov    %al,-0x10(%rbp)
xor    %edi,%edi
mov    %r14,%rsi
call   10c0 <strtok@plt>
mov    %rax,%r13
add    $0x20,%rbp
add    $0x1,%r15d
test   %rax,%rax
je     134d <main+0x1ad>
mov    %r13,%rdi
call   1060 <strlen@plt>
test   %rax,%rax
je     1290 <main+0xf0>
cmpb   $0x3a,-0x1(%rax,%r13,1)
jne    1290 <main+0xf0>
cmp    $0x2,%rax
jb     1310 <main+0x170>
cmpb   $0x3a,-0x2(%rax,%r13,1)
jne    1310 <main+0x170>
mov    0x2ce6(%rip),%rcx
mov    (%rcx),%rcx
mov    %rcx,0x0(%rbp)
movb   $0x0,-0x2(%r13,%rax,1)
jmp    129e <main+0xfe>
nopl   0x0(%rax)
mov    0x2cb1(%rip),%rcx
mov    (%rcx),%rcx
mov    %rcx,0x0(%rbp)
movb   $0x0,-0x1(%r13,%rax,1)
jmp    129e <main+0xfe>
mov    0x2c88(%rip),%rax
mov    (%rax),%edi
lea    0xcf1(%rip),%rsi
call   10a0 <fprintf@plt>
mov    0x2c63(%rip),%rax
jmp    156b <main+0x3cb>
xor    %r15d,%r15d
xor    %edi,%edi
cmp    %r12d,%r15d
setb   %dil
call   1090 <assert@plt>
mov    %r15d,%eax
shl    $0x5,%rax
mov    0x8(%rsp),%rdx
movq   $0x0,(%rdx,%rax,1)
movb   $0x0,0x8(%rdx,%rax,1)
mov    0x10(%rsp),%rcx
lea    -0x3(%rcx),%esi
mov    %esi,0x1c(%rsp)
lea    0x18(%rbx),%r13
xorps  %xmm0,%xmm0
movups %xmm0,0x10(%rdx,%rax,1)
mov    %ecx,%r15d
add    $0xfffffffffffffffd,%r15
lea    0xda1(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    0x1c(%rsp),%edi
mov    %r13,%rsi
mov    0x20(%rsp),%rdx
mov    0x8(%rsp),%rcx
lea    0x4(%rsp),%r8
call   1070 <getopt_long@plt>
cmp    $0x39,%eax
jle    1400 <main+0x260>
cmp    $0x3a,%eax
je     1440 <main+0x2a0>
cmp    $0x3f,%eax
mov    0x2c29(%rip),%rbp
mov    0x2c02(%rip),%r12
jne    1475 <main+0x2d5>
mov    (%r12),%esi
lea    0xccc(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
jmp    1489 <main+0x2e9>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
test   %eax,%eax
jne    1462 <main+0x2c2>
movslq 0x4(%rsp),%rax
shl    $0x5,%rax
mov    0x8(%rsp),%rcx
mov    (%rcx,%rax,1),%rsi
mov    0x2bdb(%rip),%rbp
mov    0x0(%rbp),%rdx
lea    0xc2f(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x2ba2(%rip),%r12
jmp    1489 <main+0x2e9>
nopl   0x0(%rax,%rax,1)
mov    0x2b91(%rip),%r12
mov    (%r12),%esi
lea    0xc37(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x2b98(%rip),%rbp
jmp    1489 <main+0x2e9>
cmp    $0xffffffff,%eax
mov    0x2b8c(%rip),%rbp
mov    0x2b65(%rip),%r12
je     14f0 <main+0x350>
mov    0x0(%rbp),%rdx
lea    0xc57(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x2b40(%rip),%rax
mov    (%rax),%esi
mov    0x2b07(%rip),%rax
mov    (%rax),%edx
mov    (%r12),%ecx
mov    0x0(%rbp),%r8
mov    0x4(%rsp),%r9d
lea    0xc54(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
cmpl   $0x4,0x10(%rsp)
jl     13a0 <main+0x200>
xor    %r12d,%r12d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    0x18(%rbx,%r12,8),%rdx
mov    %r14,%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1080 <printf@plt>
add    $0x1,%r12
cmp    %r12,%r15
jne    14d0 <main+0x330>
jmp    13a0 <main+0x200>
mov    0x2ad9(%rip),%r15
mov    (%r15),%eax
add    $0x3,%eax
mov    0x10(%rsp),%rbp
cmp    %ebp,%eax
jge    155a <main+0x3ba>
lea    0xc3d(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    (%r15),%eax
add    $0x3,%eax
cmp    %ebp,%eax
jge    1550 <main+0x3b0>
lea    0xc3c(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
cltq
mov    (%rbx,%rax,8),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    (%r15),%eax
lea    0x1(%rax),%ecx
mov    %ecx,(%r15)
add    $0x4,%eax
cmp    %ebp,%eax
jl     1530 <main+0x390>
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
mov    0x2a2d(%rip),%rax
mov    (%rax),%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.option = type { i8*, i8, i64, i64 }
@.str = [42 x i8] c"Usage: %s <shortopts> <longopts> [args]\0A\00"
@.str.1 = [53 x i8] c"<shortopts>\09String of shortopts to pass to getopt()\0A\00"
@.str.2 = [99 x i8] c"<longopts>\09Space-separated list of long options.\0A\09\09same : notation for arguments as short options\0A\00"
@EXIT_FAILURE = global i32 0
@stderr = global i32 0
@.str.3 = [45 x i8] c"Unable to allocate memory for long options.\0A\00"
@.str.4 = [2 x i8] c" \00"
@optional_argument = global i64 0
@required_argument = global i64 0
@no_argument = global i64 0
@.str.5 = [50 x i8] c"Encountered option '%s' with arg '%s', flag set.\0A\00"
@optarg = global i8* null
@.str.6 = [42 x i8] c"Encountered option '%c' missing argument\0A\00"
@optopt = global i32 0
@.str.7 = [36 x i8] c"Encountered unexpected option '%c'\0A\00"
@.str.8 = [44 x i8] c"Encountered option '%c' with argument '%s'\0A\00"
@.str.9 = [56 x i8] c"optind=%d\09opterr=%d\09optopt=%d\09optarg='%s'\09longind='%d'\0A\00"
@optind = global i32 0
@opterr = global i32 0
@.str.10 = [15 x i8] c"argv[%d] = %s\0A\00"
@.str.11 = [23 x i8] c"Remaining arguments: \00"
@.str.12 = [6 x i8] c"'%s' \00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.option*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 -1, i32* %13
%15 = load i32, i32* %4
%16 = icmp slt i32 %15, 4
br i1 %16, label %17, label %25
17: ; preds = %2
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 0
%20 = load i8*, i8** %19
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %20)
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0))
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([99 x i8], [99 x i8]* @.str.2, i64 0, i64 0))
%24 = load i32, i32* @EXIT_FAILURE
store i32 %24, i32* %3
br label %252
25: ; preds = %2
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 1
%28 = load i8*, i8** %27
store i8* %28, i8** %7
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i64 2
%31 = load i8*, i8** %30
store i8* %31, i8** %9
store i32 2, i32* %12
br label %32
32: ; preds = %45, %25
%33 = load i8*, i8** %9
%34 = load i8, i8* %33
%35 = icmp ne i8 %34, 0
br i1 %35, label %36, label %46
36: ; preds = %32
%37 = load i8*, i8** %9
%38 = getelementptr inbounds i8, i8* %37, i32 1
store i8* %38, i8** %9
%39 = load i8, i8* %37
%40 = sext i8 %39 to i32
%41 = icmp eq i32 %40, 32
br i1 %41, label %42, label %45
42: ; preds = %36
%43 = load i32, i32* %12
%44 = add nsw i32 %43, 1
store i32 %44, i32* %12
br label %45
45: ; preds = %42, %36
br label %32
46: ; preds = %32
%47 = load i32, i32* %12
%48 = sext i32 %47 to i64
%49 = mul i64 32, %48
%50 = trunc i64 %49 to i32
%51 = call %struct.option* @malloc(i32 %50)
store %struct.option* %51, %struct.option** %6
%52 = load %struct.option*, %struct.option** %6
%53 = icmp ne %struct.option* %52, null
br i1 %53, label %58, label %54
54: ; preds = %46
%55 = load i32, i32* @stderr
%56 = call i32 @fprintf(i32 %55, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0))
%57 = load i32, i32* @EXIT_FAILURE
store i32 %57, i32* %3
br label %252
58: ; preds = %46
%59 = load i8**, i8*** %5
%60 = getelementptr inbounds i8*, i8** %59, i64 2
%61 = load i8*, i8** %60
%62 = call i8* @strtok(i8* %61, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i8* %62, i8** %8
store i32 0, i32* %11
br label %63
63: ; preds = %141, %58
%64 = load i8*, i8** %8
%65 = icmp ne i8* %64, null
br i1 %65, label %66, label %144
66: ; preds = %63
%67 = load i8*, i8** %8
%68 = call i64 @strlen(i8* %67)
store i64 %68, i64* %14
%69 = load i64, i64* %14
%70 = icmp ugt i64 %69, 0
br i1 %70, label %71, label %113
71: ; preds = %66
%72 = load i8*, i8** %8
%73 = load i64, i64* %14
%74 = sub i64 %73, 1
%75 = getelementptr inbounds i8, i8* %72, i64 %74
%76 = load i8, i8* %75
%77 = sext i8 %76 to i32
%78 = icmp eq i32 %77, 58
br i1 %78, label %79, label %113
79: ; preds = %71
%80 = load i64, i64* %14
%81 = icmp ugt i64 %80, 1
br i1 %81, label %82, label %101
82: ; preds = %79
%83 = load i8*, i8** %8
%84 = load i64, i64* %14
%85 = sub i64 %84, 2
%86 = getelementptr inbounds i8, i8* %83, i64 %85
%87 = load i8, i8* %86
%88 = sext i8 %87 to i32
%89 = icmp eq i32 %88, 58
br i1 %89, label %90, label %101
90: ; preds = %82
%91 = load i64, i64* @optional_argument
%92 = load %struct.option*, %struct.option** %6
%93 = load i32, i32* %11
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds %struct.option, %struct.option* %92, i64 %94
%96 = getelementptr inbounds %struct.option, %struct.option* %95, i32 0, i32 3
store i64 %91, i64* %96
%97 = load i8*, i8** %8
%98 = load i64, i64* %14
%99 = sub i64 %98, 2
%100 = getelementptr inbounds i8, i8* %97, i64 %99
store i8 0, i8* %100
br label %112
101: ; preds = %82, %79
%102 = load i64, i64* @required_argument
%103 = load %struct.option*, %struct.option** %6
%104 = load i32, i32* %11
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds %struct.option, %struct.option* %103, i64 %105
%107 = getelementptr inbounds %struct.option, %struct.option* %106, i32 0, i32 3
store i64 %102, i64* %107
%108 = load i8*, i8** %8
%109 = load i64, i64* %14
%110 = sub i64 %109, 1
%111 = getelementptr inbounds i8, i8* %108, i64 %110
store i8 0, i8* %111
br label %112
112: ; preds = %101, %90
br label %120
113: ; preds = %71, %66
%114 = load i64, i64* @no_argument
%115 = load %struct.option*, %struct.option** %6
%116 = load i32, i32* %11
%117 = sext i32 %116 to i64
%118 = getelementptr inbounds %struct.option, %struct.option* %115, i64 %117
%119 = getelementptr inbounds %struct.option, %struct.option* %118, i32 0, i32 3
store i64 %114, i64* %119
br label %120
120: ; preds = %113, %112
%121 = load i8*, i8** %8
%122 = load %struct.option*, %struct.option** %6
%123 = load i32, i32* %11
%124 = sext i32 %123 to i64
%125 = getelementptr inbounds %struct.option, %struct.option* %122, i64 %124
%126 = getelementptr inbounds %struct.option, %struct.option* %125, i32 0, i32 0
store i8* %121, i8** %126
%127 = load %struct.option*, %struct.option** %6
%128 = load i32, i32* %11
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds %struct.option, %struct.option* %127, i64 %129
%131 = getelementptr inbounds %struct.option, %struct.option* %130, i32 0, i32 2
store i64 0, i64* %131
%132 = load i8*, i8** %8
%133 = getelementptr inbounds i8, i8* %132, i64 0
%134 = load i8, i8* %133
%135 = load %struct.option*, %struct.option** %6
%136 = load i32, i32* %11
%137 = sext i32 %136 to i64
%138 = getelementptr inbounds %struct.option, %struct.option* %135, i64 %137
%139 = getelementptr inbounds %struct.option, %struct.option* %138, i32 0, i32 1
store i8 %134, i8* %139
%140 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i8* %140, i8** %8
br label %141
141: ; preds = %120
%142 = load i32, i32* %11
%143 = add nsw i32 %142, 1
store i32 %143, i32* %11
br label %63
144: ; preds = %63
%145 = load i32, i32* %11
%146 = load i32, i32* %12
%147 = icmp slt i32 %145, %146
%148 = zext i1 %147 to i32
%149 = call i32 @assert(i32 %148)
%150 = load %struct.option*, %struct.option** %6
%151 = load i32, i32* %11
%152 = sext i32 %151 to i64
%153 = getelementptr inbounds %struct.option, %struct.option* %150, i64 %152
%154 = getelementptr inbounds %struct.option, %struct.option* %153, i32 0, i32 0
store i8* null, i8** %154
%155 = load %struct.option*, %struct.option** %6
%156 = load i32, i32* %11
%157 = sext i32 %156 to i64
%158 = getelementptr inbounds %struct.option, %struct.option* %155, i64 %157
%159 = getelementptr inbounds %struct.option, %struct.option* %158, i32 0, i32 3
store i64 0, i64* %159
%160 = load %struct.option*, %struct.option** %6
%161 = load i32, i32* %11
%162 = sext i32 %161 to i64
%163 = getelementptr inbounds %struct.option, %struct.option* %160, i64 %162
%164 = getelementptr inbounds %struct.option, %struct.option* %163, i32 0, i32 2
store i64 0, i64* %164
%165 = load %struct.option*, %struct.option** %6
%166 = load i32, i32* %11
%167 = sext i32 %166 to i64
%168 = getelementptr inbounds %struct.option, %struct.option* %165, i64 %167
%169 = getelementptr inbounds %struct.option, %struct.option* %168, i32 0, i32 1
store i8 0, i8* %169
br label %170
170: ; preds = %223, %144
%171 = load i32, i32* %4
%172 = sub nsw i32 %171, 3
%173 = load i8**, i8*** %5
%174 = getelementptr inbounds i8*, i8** %173, i64 3
%175 = load i8*, i8** %7
%176 = load %struct.option*, %struct.option** %6
%177 = call i32 @getopt_long(i32 %172, i8** %174, i8* %175, %struct.option* %176, i32* %13)
store i32 %177, i32* %10
%178 = icmp ne i32 %177, -1
br i1 %178, label %179, label %224
179: ; preds = %170
%180 = load i32, i32* %10
switch i32 %180, label %196 [
i32 0, label %181
i32 58, label %190
i32 63, label %193
]
181: ; preds = %179
%182 = load %struct.option*, %struct.option** %6
%183 = load i32, i32* %13
%184 = sext i32 %183 to i64
%185 = getelementptr inbounds %struct.option, %struct.option* %182, i64 %184
%186 = getelementptr inbounds %struct.option, %struct.option* %185, i32 0, i32 0
%187 = load i8*, i8** %186
%188 = load i8*, i8** @optarg
%189 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.5, i64 0, i64 0), i8* %187, i8* %188)
br label %200
190: ; preds = %179
%191 = load i32, i32* @optopt
%192 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.6, i64 0, i64 0), i32 %191)
br label %200
193: ; preds = %179
%194 = load i32, i32* @optopt
%195 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.7, i64 0, i64 0), i32 %194)
br label %200
196: ; preds = %179
%197 = load i32, i32* %10
%198 = load i8*, i8** @optarg
%199 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.8, i64 0, i64 0), i32 %197, i8* %198)
br label %200
200: ; preds = %196, %193, %190, %181
%201 = load i32, i32* @optind
%202 = load i32, i32* @opterr
%203 = load i32, i32* @optopt
%204 = load i8*, i8** @optarg
%205 = load i32, i32* %13
%206 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.9, i64 0, i64 0), i32 %201, i32 %202, i32 %203, i8* %204, i32 %205)
store i32 3, i32* %11
br label %207
207: ; preds = %220, %200
%208 = load i32, i32* %11
%209 = load i32, i32* %4
%210 = icmp slt i32 %208, %209
br i1 %210, label %211, label %223
211: ; preds = %207
%212 = load i32, i32* %11
%213 = sub nsw i32 %212, 3
%214 = load i8**, i8*** %5
%215 = load i32, i32* %11
%216 = sext i32 %215 to i64
%217 = getelementptr inbounds i8*, i8** %214, i64 %216
%218 = load i8*, i8** %217
%219 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.10, i64 0, i64 0), i32 %213, i8* %218)
br label %220
220: ; preds = %211
%221 = load i32, i32* %11
%222 = add nsw i32 %221, 1
store i32 %222, i32* %11
br label %207
223: ; preds = %207
br label %170
224: ; preds = %170
%225 = load i32, i32* @optind
%226 = add nsw i32 %225, 3
%227 = load i32, i32* %4
%228 = icmp slt i32 %226, %227
br i1 %228, label %229, label %248
229: ; preds = %224
%230 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.11, i64 0, i64 0))
br label %231
231: ; preds = %236, %229
%232 = load i32, i32* @optind
%233 = add nsw i32 %232, 3
%234 = load i32, i32* %4
%235 = icmp slt i32 %233, %234
br i1 %235, label %236, label %246
236: ; preds = %231
%237 = load i8**, i8*** %5
%238 = load i32, i32* @optind
%239 = add nsw i32 %238, 3
%240 = sext i32 %239 to i64
%241 = getelementptr inbounds i8*, i8** %237, i64 %240
%242 = load i8*, i8** %241
%243 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i8* %242)
%244 = load i32, i32* @optind
%245 = add nsw i32 %244, 1
store i32 %245, i32* @optind
br label %231
246: ; preds = %231
%247 = call i32 @putchar(i8 signext 10)
br label %248
248: ; preds = %246, %224
%249 = load %struct.option*, %struct.option** %6
%250 = call i32 @free(%struct.option* %249)
%251 = load i32, i32* @EXIT_SUCCESS
store i32 %251, i32* %3
br label %252
252: ; preds = %248, %54, %17
%253 = load i32, i32* %3
ret i32 %253
}

LLVM IR (-O2):
%struct.option = type { i8*, i8, i64, i64 }
@.str = [42 x i8] c"Usage: %s <shortopts> <longopts> [args]\0A\00"
@EXIT_FAILURE = global i32 0
@stderr = global i32 0
@.str.3 = [45 x i8] c"Unable to allocate memory for long options.\0A\00"
@.str.4 = [2 x i8] c" \00"
@optional_argument = global i64 0
@required_argument = global i64 0
@no_argument = global i64 0
@.str.5 = [50 x i8] c"Encountered option '%s' with arg '%s', flag set.\0A\00"
@optarg = global i8* null
@.str.6 = [42 x i8] c"Encountered option '%c' missing argument\0A\00"
@optopt = global i32 0
@.str.7 = [36 x i8] c"Encountered unexpected option '%c'\0A\00"
@.str.8 = [44 x i8] c"Encountered option '%c' with argument '%s'\0A\00"
@.str.9 = [56 x i8] c"optind=%d\09opterr=%d\09optopt=%d\09optarg='%s'\09longind='%d'\0A\00"
@optind = global i32 0
@opterr = global i32 0
@.str.10 = [15 x i8] c"argv[%d] = %s\0A\00"
@.str.11 = [23 x i8] c"Remaining arguments: \00"
@.str.12 = [6 x i8] c"'%s' \00"
@EXIT_SUCCESS = global i32 0
@str = [52 x i8] c"<shortopts>\09String of shortopts to pass to getopt()\00"
@str.13 = [98 x i8] c"<longopts>\09Space-separated list of long options.\0A\09\09same : notation for arguments as short options\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 -1, i32* %3
%5 = icmp slt i32 %0, 4
br i1 %5, label %6, label %11
6: ; preds = %2
%7 = load i8*, i8** %1
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([98 x i8], [98 x i8]* @str.13, i64 0, i64 0))
br label %147
11: ; preds = %2
%12 = getelementptr inbounds i8*, i8** %1, i64 1
%13 = load i8*, i8** %12
%14 = getelementptr inbounds i8*, i8** %1, i64 2
%15 = load i8*, i8** %14
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 0
br i1 %17, label %28, label %18
18: ; preds = %11, %18
%19 = phi i8 [ %26, %18 ], [ %16, %11 ]
%20 = phi i32 [ %25, %18 ], [ 2, %11 ]
%21 = phi i8* [ %22, %18 ], [ %15, %11 ]
%22 = getelementptr inbounds i8, i8* %21, i64 1
%23 = icmp eq i8 %19, 32
%24 = zext i1 %23 to i32
%25 = add nuw nsw i32 %20, %24
%26 = load i8, i8* %22
%27 = icmp eq i8 %26, 0
br i1 %27, label %28, label %18
28: ; preds = %18, %11
%29 = phi i32 [ 2, %11 ], [ %25, %18 ]
%30 = shl i32 %29, 5
%31 = tail call %struct.option* @malloc(i32 %30)
%32 = icmp eq %struct.option* %31, null
br i1 %32, label %33, label %36
33: ; preds = %28
%34 = load i32, i32* @stderr
%35 = tail call i32 @fprintf(i32 %34, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0))
br label %147
36: ; preds = %28
%37 = tail call i8* @strtok(i8* %15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%38 = icmp eq i8* %37, null
br i1 %38, label %75, label %39
39: ; preds = %36, %65
%40 = phi i64 [ %71, %65 ], [ 0, %36 ]
%41 = phi i8* [ %70, %65 ], [ %37, %36 ]
%42 = tail call i64 @strlen(i8* %41)
%43 = icmp eq i64 %42, 0
br i1 %43, label %62, label %44
44: ; preds = %39
%45 = add i64 %42, -1
%46 = getelementptr inbounds i8, i8* %41, i64 %45
%47 = load i8, i8* %46
%48 = icmp eq i8 %47, 58
br i1 %48, label %49, label %62
49: ; preds = %44
%50 = icmp ugt i64 %42, 1
br i1 %50, label %51, label %59
51: ; preds = %49
%52 = add i64 %42, -2
%53 = getelementptr inbounds i8, i8* %41, i64 %52
%54 = load i8, i8* %53
%55 = icmp eq i8 %54, 58
br i1 %55, label %56, label %59
56: ; preds = %51
%57 = load i64, i64* @optional_argument
%58 = getelementptr inbounds %struct.option, %struct.option* %31, i64 %40, i32 3
store i64 %57, i64* %58
store i8 0, i8* %53
br label %65
59: ; preds = %51, %49
%60 = load i64, i64* @required_argument
%61 = getelementptr inbounds %struct.option, %struct.option* %31, i64 %40, i32 3
store i64 %60, i64* %61
store i8 0, i8* %46
br label %65
62: ; preds = %44, %39
%63 = load i64, i64* @no_argument
%64 = getelementptr inbounds %struct.option, %struct.option* %31, i64 %40, i32 3
store i64 %63, i64* %64
br label %65
65: ; preds = %56, %59, %62
%66 = getelementptr inbounds %struct.option, %struct.option* %31, i64 %40, i32 0
store i8* %41, i8** %66
%67 = getelementptr inbounds %struct.option, %struct.option* %31, i64 %40, i32 2
store i64 0, i64* %67
%68 = load i8, i8* %41
%69 = getelementptr inbounds %struct.option, %struct.option* %31, i64 %40, i32 1
store i8 %68, i8* %69
%70 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%71 = add nuw i64 %40, 1
%72 = icmp eq i8* %70, null
br i1 %72, label %73, label %39
73: ; preds = %65
%74 = trunc i64 %71 to i32
br label %75
75: ; preds = %73, %36
%76 = phi i32 [ 0, %36 ], [ %74, %73 ]
%77 = icmp ult i32 %76, %29
%78 = zext i1 %77 to i32
%79 = tail call i32 @assert(i32 %78)
%80 = zext i32 %76 to i64
%81 = getelementptr inbounds %struct.option, %struct.option* %31, i64 %80, i32 0
store i8* null, i8** %81
%82 = getelementptr inbounds %struct.option, %struct.option* %31, i64 %80, i32 2
%83 = getelementptr inbounds %struct.option, %struct.option* %31, i64 %80, i32 1
store i8 0, i8* %83
%84 = add nsw i32 %0, -3
%85 = getelementptr inbounds i8*, i8** %1, i64 3
%86 = icmp sgt i32 %0, 3
%87 = bitcast i64* %82 to i8*
%88 = zext i32 %0 to i64
br label %89
89: ; preds = %114, %75
%90 = call i32 @getopt_long(i32 %84, i8** %85, i8* %13, %struct.option* %31, i32* %3)
switch i32 %90, label %104 [
i32 -1, label %124
i32 0, label %91
i32 58, label %98
i32 63, label %101
]
91: ; preds = %89
%92 = load i32, i32* %3
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds %struct.option, %struct.option* %31, i64 %93, i32 0
%95 = load i8*, i8** %94
%96 = load i8*, i8** @optarg
%97 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.5, i64 0, i64 0), i8* %95, i8* %96)
br label %107
98: ; preds = %89
%99 = load i32, i32* @optopt
%100 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.6, i64 0, i64 0), i32 %99)
br label %107
101: ; preds = %89
%102 = load i32, i32* @optopt
%103 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.7, i64 0, i64 0), i32 %102)
br label %107
104: ; preds = %89
%105 = load i8*, i8** @optarg
%106 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.8, i64 0, i64 0), i32 %90, i8* %105)
br label %107
107: ; preds = %104, %101, %98, %91
%108 = load i32, i32* @optind
%109 = load i32, i32* @opterr
%110 = load i32, i32* @optopt
%111 = load i8*, i8** @optarg
%112 = load i32, i32* %3
%113 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str.9, i64 0, i64 0), i32 %108, i32 %109, i32 %110, i8* %111, i32 %112)
br i1 %86, label %115, label %114
114: ; preds = %115, %107
br label %89
115: ; preds = %107, %115
%116 = phi i64 [ %122, %115 ], [ 3, %107 ]
%117 = getelementptr inbounds i8*, i8** %1, i64 %116
%118 = load i8*, i8** %117
%119 = trunc i64 %116 to i32
%120 = add i32 %119, -3
%121 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.10, i64 0, i64 0), i32 %120, i8* %118)
%122 = add nuw nsw i64 %116, 1
%123 = icmp eq i64 %122, %88
br i1 %123, label %114, label %115
124: ; preds = %89
%125 = load i32, i32* @optind
%126 = add nsw i32 %125, 3
%127 = icmp slt i32 %126, %0
br i1 %127, label %128, label %145
128: ; preds = %124
%129 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.11, i64 0, i64 0))
%130 = load i32, i32* @optind
%131 = add nsw i32 %130, 3
%132 = icmp slt i32 %131, %0
br i1 %132, label %133, label %143
133: ; preds = %128, %133
%134 = phi i32 [ %141, %133 ], [ %131, %128 ]
%135 = sext i32 %134 to i64
%136 = getelementptr inbounds i8*, i8** %1, i64 %135
%137 = load i8*, i8** %136
%138 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i8* %137)
%139 = load i32, i32* @optind
%140 = add nsw i32 %139, 1
store i32 %140, i32* @optind
%141 = add nsw i32 %139, 4
%142 = icmp slt i32 %141, %0
br i1 %142, label %133, label %143
143: ; preds = %133, %128
%144 = call i32 @putchar(i8 signext 10)
br label %145
145: ; preds = %143, %124
%146 = call i32 @free(%struct.option* %31)
br label %147
147: ; preds = %145, %33, %6
%148 = phi i32* [ @EXIT_FAILURE, %6 ], [ @EXIT_SUCCESS, %145 ], [ @EXIT_FAILURE, %33 ]
%149 = load i32, i32* %148
ret i32 %149
}