#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*/ FILE;

/* Variables and functions */
char EOF;
int /*<<< orphan*/ cleanup();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
char fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
char fscanf(int /*<<< orphan*/ *, char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ putc(char, int /*<<< orphan*/ *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ *stdout;
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ strstr(char *, char *);
int /*<<< orphan*/ system(char *);
int main(int argc, char *argv[]) {
  int strrec, i;
  char c;
  char *d;
  char command[255] = "";
  char buffer[255] = "";
  if (argc == 1) {
    fprintf(stdout, "Usage: ipgeo hostname \n");
    exit(1);
  }
  for (i = 1; i < argc; i++) {
    strcat(buffer, " ");
    strcat(buffer, argv[i]);
  }
  sprintf(command, "traceroute %s > routeinfo.txt", buffer);
  system(command);
  strcpy(buffer, "");
  FILE *wp = fopen("iplist.txt", "w");
  FILE *rp = fopen("routeinfo.txt", "r");
  if (wp == NULL || rp == NULL) {
    cleanup();
    exit(2);
  }
  fgets(buffer, 255, rp);
  while ((c = fgetc(rp)) != EOF) {
    if (c == ')') {
      strrec = 0;
      putc('\n', wp);
    } else if (c == '(') {
      strrec = 1;
      continue;
    }
    if (strrec == 1)
      putc(c, wp);
  }
  fclose(rp);
  fclose(wp);
  rp = fopen("iplist.txt", "r");
  if (rp == NULL) {
    cleanup();
    exit(2);
  }
  printf("%s", buffer);
  fscanf(rp, "%s", buffer);
  while (fscanf(rp, "%s", buffer) != EOF) {
    if (!strstr(buffer, "172."))
      sprintf(command, "curl -s ipinfo.io/%s>>output.txt", buffer);
    system(command);
  }
  fclose(rp);
  rp = fopen("output.txt", "r");
  wp = fopen("final.txt", "w");
  if (rp == NULL || wp == NULL) {
    cleanup();
    exit(4);
  }
  while (fgets(buffer, 80, rp) != NULL) {
    for (d = buffer; *d != '\n'; d++) {
      if (*d == '{' || *d == '}') {
        fputs("--------------------------------------------------------"
              "-----------------------",
              wp);
        break;
      }
      if (*d != '"' && *d != ',')
        putc(*d, wp);
      else if (*d == '"' && *(d + 1) == '"')
        fprintf(wp, "N/A");
    }
    putc('\n', wp);
  }
  fclose(rp);
  fclose(wp);
  rp = fopen("final.txt", "r");
  if (rp == NULL) {
    cleanup();
    exit(5);
  }
  while (fgets(buffer, 80, rp) != NULL) {
    if (!strstr(buffer, "hostname") && !strstr(buffer, "org"))
      printf("%s", buffer);
  }
  fclose(rp);
  cleanup();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x240,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x130(%rbp),%rdi
xor    %esi,%esi
mov    $0xff,%edx
call   1080 <memset@plt>
lea    -0x230(%rbp),%rdi
xor    %esi,%esi
mov    $0xff,%edx
call   1080 <memset@plt>
cmpl   $0x1,-0x8(%rbp)
jne    1279 <main+0x69>
mov    0x2d78(%rip),%rax
mov    (%rax),%rdi
lea    0xd96(%rip),%rsi
call   10d0 <fprintf@plt>
mov    $0x1,%edi
call   1120 <exit@plt>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    12c5 <main+0xb5>
lea    -0x230(%rbp),%rdi
lea    0xd7e(%rip),%rsi
call   1100 <strcat@plt>
lea    -0x230(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
call   1100 <strcat@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1280 <main+0x70>
lea    -0x130(%rbp),%rdi
lea    -0x230(%rbp),%rdx
lea    0xd40(%rip),%rsi
call   1110 <sprintf@plt>
lea    -0x130(%rbp),%rdi
call   1050 <system@plt>
lea    -0x230(%rbp),%rdi
lea    0xd1e(%rip),%rsi
call   1030 <strcpy@plt>
lea    0xd33(%rip),%rdi
lea    0xd37(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,-0x238(%rbp)
lea    0xd0b(%rip),%rdi
lea    0xd1f(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,-0x240(%rbp)
cmpq   $0x0,-0x238(%rbp)
je     134e <main+0x13e>
cmpq   $0x0,-0x240(%rbp)
jne    135f <main+0x14f>
mov    $0x0,%al
call   10e0 <cleanup@plt>
mov    $0x2,%edi
call   1120 <exit@plt>
lea    -0x230(%rbp),%rdi
mov    -0x240(%rbp),%rdx
mov    $0xff,%esi
call   10b0 <fgets@plt>
mov    -0x240(%rbp),%rdi
call   10a0 <fgetc@plt>
mov    %al,-0x19(%rbp)
movsbl %al,%eax
mov    0x2c58(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1404 <main+0x1f4>
movsbl -0x19(%rbp),%eax
cmp    $0x29,%eax
jne    13c5 <main+0x1b5>
movl   $0x0,-0x14(%rbp)
mov    -0x238(%rbp),%rsi
mov    $0xa,%edi
call   10c0 <putc@plt>
jmp    13e3 <main+0x1d3>
movsbl -0x19(%rbp),%eax
cmp    $0x28,%eax
jne    13de <main+0x1ce>
movl   $0x1,-0x14(%rbp)
jmp    1377 <main+0x167>
jmp    13e3 <main+0x1d3>
cmpl   $0x1,-0x14(%rbp)
jne    13ff <main+0x1ef>
mov    -0x19(%rbp),%al
mov    -0x238(%rbp),%rsi
movsbl %al,%edi
call   10c0 <putc@plt>
jmp    1377 <main+0x167>
mov    -0x240(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x238(%rbp),%rdi
call   1040 <fclose@plt>
lea    0xc15(%rip),%rdi
lea    0xc1b(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,-0x240(%rbp)
cmpq   $0x0,-0x240(%rbp)
jne    1455 <main+0x245>
mov    $0x0,%al
call   10e0 <cleanup@plt>
mov    $0x2,%edi
call   1120 <exit@plt>
lea    -0x230(%rbp),%rsi
lea    0xbe4(%rip),%rdi
call   1060 <printf@plt>
mov    -0x240(%rbp),%rdi
lea    -0x230(%rbp),%rdx
lea    0xbca(%rip),%rsi
call   1090 <fscanf@plt>
mov    -0x240(%rbp),%rdi
lea    -0x230(%rbp),%rdx
lea    0xbb0(%rip),%rsi
call   1090 <fscanf@plt>
movsbl %al,%eax
mov    0x2b42(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     14f8 <main+0x2e8>
lea    -0x230(%rbp),%rdi
lea    0xb8b(%rip),%rsi
call   1130 <strstr@plt>
cmp    $0x0,%eax
jne    14e7 <main+0x2d7>
lea    -0x130(%rbp),%rdi
lea    -0x230(%rbp),%rdx
lea    0xb6d(%rip),%rsi
call   1110 <sprintf@plt>
lea    -0x130(%rbp),%rdi
call   1050 <system@plt>
jmp    1482 <main+0x272>
mov    -0x240(%rbp),%rdi
call   1040 <fclose@plt>
lea    0xb5a(%rip),%rdi
lea    0xb33(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,-0x240(%rbp)
lea    0xb4b(%rip),%rdi
lea    0xb17(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,-0x238(%rbp)
cmpq   $0x0,-0x240(%rbp)
je     1554 <main+0x344>
cmpq   $0x0,-0x238(%rbp)
jne    1565 <main+0x355>
mov    $0x0,%al
call   10e0 <cleanup@plt>
mov    $0x4,%edi
call   1120 <exit@plt>
jmp    156a <main+0x35a>
lea    -0x230(%rbp),%rdi
mov    -0x240(%rbp),%rdx
mov    $0x50,%esi
call   10b0 <fgets@plt>
cmp    $0x0,%rax
je     167e <main+0x46e>
lea    -0x230(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     1668 <main+0x458>
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7b,%eax
je     15c7 <main+0x3b7>
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7d,%eax
jne    15df <main+0x3cf>
mov    -0x238(%rbp),%rsi
lea    0xaa5(%rip),%rdi
call   1070 <fputs@plt>
jmp    1668 <main+0x458>
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x22,%eax
je     1619 <main+0x409>
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2c,%eax
je     1619 <main+0x409>
mov    -0x28(%rbp),%rax
mov    (%rax),%al
mov    -0x238(%rbp),%rsi
movsbl %al,%edi
call   10c0 <putc@plt>
jmp    1652 <main+0x442>
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x22,%eax
jne    164d <main+0x43d>
mov    -0x28(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x22,%eax
jne    164d <main+0x43d>
mov    -0x238(%rbp),%rdi
lea    0xa82(%rip),%rsi
call   10d0 <fprintf@plt>
jmp    1652 <main+0x442>
jmp    1657 <main+0x447>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1597 <main+0x387>
mov    -0x238(%rbp),%rsi
mov    $0xa,%edi
call   10c0 <putc@plt>
jmp    156a <main+0x35a>
mov    -0x240(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x238(%rbp),%rdi
call   1040 <fclose@plt>
lea    0x9d3(%rip),%rdi
lea    0x9a1(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,-0x240(%rbp)
cmpq   $0x0,-0x240(%rbp)
jne    16cf <main+0x4bf>
mov    $0x0,%al
call   10e0 <cleanup@plt>
mov    $0x5,%edi
call   1120 <exit@plt>
jmp    16d4 <main+0x4c4>
lea    -0x230(%rbp),%rdi
mov    -0x240(%rbp),%rdx
mov    $0x50,%esi
call   10b0 <fgets@plt>
cmp    $0x0,%rax
je     1746 <main+0x536>
lea    -0x230(%rbp),%rdi
lea    0x9ca(%rip),%rsi
call   1130 <strstr@plt>
cmp    $0x0,%eax
jne    1741 <main+0x531>
lea    -0x230(%rbp),%rdi
lea    0x9b7(%rip),%rsi
call   1130 <strstr@plt>
cmp    $0x0,%eax
jne    1741 <main+0x531>
lea    -0x230(%rbp),%rsi
lea    0x90b(%rip),%rdi
call   1060 <printf@plt>
jmp    16d4 <main+0x4c4>
mov    -0x240(%rbp),%rdi
call   1040 <fclose@plt>
mov    $0x0,%al
call   10e0 <cleanup@plt>
xor    %edi,%edi
call   1120 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x208,%rsp
xorps  %xmm0,%xmm0
movups %xmm0,0x1ef(%rsp)
movaps %xmm0,0x1e0(%rsp)
movaps %xmm0,0x1d0(%rsp)
movaps %xmm0,0x1c0(%rsp)
movaps %xmm0,0x1b0(%rsp)
movaps %xmm0,0x1a0(%rsp)
movaps %xmm0,0x190(%rsp)
movaps %xmm0,0x180(%rsp)
movaps %xmm0,0x170(%rsp)
movaps %xmm0,0x160(%rsp)
movaps %xmm0,0x150(%rsp)
movaps %xmm0,0x140(%rsp)
movaps %xmm0,0x130(%rsp)
movaps %xmm0,0x120(%rsp)
movaps %xmm0,0x110(%rsp)
movaps %xmm0,0x100(%rsp)
movups %xmm0,0xef(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
cmp    $0x1,%edi
jne    131a <main+0x12a>
mov    0x2ce1(%rip),%rax
mov    (%rax),%rcx
lea    0xcff(%rip),%rdi
mov    $0x17,%esi
mov    $0x1,%edx
call   1100 <fwrite@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
jle    1360 <main+0x170>
mov    %rsi,%r15
mov    %edi,%r12d
mov    $0x1,%ebx
lea    0xcea(%rip),%r14
mov    %rsp,%rbp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbp,%rdi
mov    %r14,%rsi
call   10d0 <strcat@plt>
mov    (%r15,%rbx,8),%rsi
mov    %rbp,%rdi
call   10d0 <strcat@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1340 <main+0x150>
lea    0xcb3(%rip),%rsi
lea    0x100(%rsp),%rbx
mov    %rsp,%rbp
mov    %rbx,%rdi
mov    %rbp,%rdx
call   10e0 <sprintf@plt>
mov    %rbx,%rdi
call   1050 <system@plt>
lea    0xc8b(%rip),%rsi
mov    %rbp,%rdi
call   1030 <strcpy@plt>
lea    0xc9d(%rip),%rdi
lea    0xca1(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,%r14
lea    0xc79(%rip),%rdi
lea    0xc8d(%rip),%rsi
call   10c0 <fopen@plt>
test   %r14,%r14
je     1417 <main+0x227>
mov    %rax,%r15
test   %rax,%rax
je     1417 <main+0x227>
mov    %rsp,%rdi
mov    $0xff,%esi
mov    %r15,%rdx
call   1090 <fgets@plt>
mov    %r15,%rdi
call   1080 <fgetc@plt>
mov    0x2bff(%rip),%r12
cmp    (%r12),%al
jne    1428 <main+0x238>
mov    %r15,%rdi
call   1040 <fclose@plt>
mov    %r14,%rdi
call   1040 <fclose@plt>
lea    0xc32(%rip),%rdi
lea    0xc38(%rip),%rsi
call   10c0 <fopen@plt>
test   %rax,%rax
jne    1479 <main+0x289>
xor    %eax,%eax
call   10b0 <cleanup@plt>
mov    $0x2,%edi
call   10f0 <exit@plt>
jmp    1443 <main+0x253>
nopw   0x0(%rax,%rax,1)
mov    $0x1,%ebx
mov    %r15,%rdi
call   1080 <fgetc@plt>
cmp    (%r12),%al
je     13ef <main+0x1ff>
cmp    $0x28,%al
je     1430 <main+0x240>
cmp    $0x29,%al
jne    1460 <main+0x270>
xor    %ebp,%ebp
mov    $0xa,%al
jmp    146a <main+0x27a>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x1,%ebp
cmp    $0x1,%ebx
jne    1435 <main+0x245>
movsbl %al,%edi
mov    %r14,%rsi
call   10a0 <putc@plt>
mov    %ebp,%ebx
jmp    1435 <main+0x245>
mov    %rax,%r15
lea    0xbc4(%rip),%rbx
mov    %rsp,%rbp
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1060 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %rbp,%rdx
call   1070 <fscanf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %rbp,%rdx
call   1070 <fscanf@plt>
cmp    (%r12),%al
jne    1556 <main+0x366>
mov    %r15,%rdi
call   1040 <fclose@plt>
lea    0xb9f(%rip),%rdi
lea    0xb78(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,%r14
lea    0xb94(%rip),%rdi
lea    0xb60(%rip),%rsi
call   10c0 <fopen@plt>
test   %r14,%r14
je     15c3 <main+0x3d3>
mov    %rax,%rbx
test   %rax,%rax
je     15c3 <main+0x3d3>
mov    %rsp,%r15
mov    %r15,%rdi
mov    $0x50,%esi
mov    %r14,%rdx
call   1090 <fgets@plt>
test   %rax,%rax
jne    15d4 <main+0x3e4>
mov    %r14,%rdi
call   1040 <fclose@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
lea    0xb40(%rip),%rdi
lea    0xb0e(%rip),%rsi
call   10c0 <fopen@plt>
test   %rax,%rax
jne    1692 <main+0x4a2>
xor    %eax,%eax
call   10b0 <cleanup@plt>
mov    $0x5,%edi
call   10f0 <exit@plt>
lea    0xaed(%rip),%r14
mov    %rsp,%rbx
lea    0x100(%rsp),%r13
lea    0xad8(%rip),%rbp
jmp    15a0 <main+0x3b0>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r13,%rdi
call   1050 <system@plt>
mov    %r15,%rdi
mov    %rbp,%rsi
mov    %rbx,%rdx
call   1070 <fscanf@plt>
cmp    (%r12),%al
je     14b7 <main+0x2c7>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1110 <strstr@plt>
test   %eax,%eax
jne    1580 <main+0x390>
mov    %r13,%rdi
lea    0xa96(%rip),%rsi
mov    %rbx,%rdx
call   10e0 <sprintf@plt>
jmp    1580 <main+0x390>
xor    %eax,%eax
call   10b0 <cleanup@plt>
mov    $0x4,%edi
call   10f0 <exit@plt>
lea    0xaef(%rip),%r12
lea    0xa98(%rip),%r13
mov    %r15,%rbp
jmp    15f4 <main+0x404>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rbp
movzbl 0x0(%rbp),%eax
cmp    $0x2b,%al
jle    1620 <main+0x430>
cmp    $0x2c,%al
je     15f0 <main+0x400>
cmp    $0x7d,%al
je     1608 <main+0x418>
cmp    $0x7b,%al
jne    167e <main+0x48e>
mov    $0x4f,%esi
mov    $0x1,%edx
mov    %r13,%rdi
mov    %rbx,%rcx
call   1100 <fwrite@plt>
jmp    1650 <main+0x460>
nop
cmp    $0xa,%al
je     1650 <main+0x460>
cmp    $0x22,%al
jne    167e <main+0x48e>
cmpb   $0x22,0x1(%rbp)
jne    15f0 <main+0x400>
mov    $0x3,%esi
mov    $0x1,%edx
mov    %r12,%rdi
mov    %rbx,%rcx
call   1100 <fwrite@plt>
jmp    15f0 <main+0x400>
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0xa,%edi
mov    %rbx,%rsi
call   10a0 <putc@plt>
mov    %r15,%rdi
mov    $0x50,%esi
mov    %r14,%rdx
call   1090 <fgets@plt>
mov    %r15,%rbp
test   %rax,%rax
jne    15f4 <main+0x404>
jmp    1519 <main+0x329>
movsbl %al,%edi
mov    %rbx,%rsi
call   10a0 <putc@plt>
add    $0x1,%rbp
jmp    15f4 <main+0x404>
mov    %rax,%r15
mov    %rsp,%rdi
mov    $0x50,%esi
mov    %rax,%rdx
call   1090 <fgets@plt>
test   %rax,%rax
jne    16c0 <main+0x4d0>
mov    %r15,%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
call   10b0 <cleanup@plt>
xor    %edi,%edi
call   10f0 <exit@plt>
lea    0xa07(%rip),%r14
mov    %rsp,%rbx
lea    0xa06(%rip),%r12
lea    0x96f(%rip),%r13
jmp    16f5 <main+0x505>
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x50,%esi
mov    %r15,%rdx
call   1090 <fgets@plt>
test   %rax,%rax
je     16aa <main+0x4ba>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1110 <strstr@plt>
test   %eax,%eax
jne    16e0 <main+0x4f0>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1110 <strstr@plt>
test   %eax,%eax
jne    16e0 <main+0x4f0>
mov    %r13,%rdi
mov    %rbx,%rsi
call   1060 <printf@plt>
jmp    16e0 <main+0x4f0>

LLVM IR (-O0):
@stdout = global i32* null
@.str = [24 x i8] c"Usage: ipgeo hostname \0A\00"
@.str.1 = [2 x i8] c" \00"
@.str.2 = [30 x i8] c"traceroute %s > routeinfo.txt\00"
@.str.3 = [1 x i8] zeroinitializer
@.str.4 = [11 x i8] c"iplist.txt\00"
@.str.5 = [2 x i8] c"w\00"
@.str.6 = [14 x i8] c"routeinfo.txt\00"
@.str.7 = [2 x i8] c"r\00"
@EOF = global i8 0
@.str.8 = [3 x i8] c"%s\00"
@.str.9 = [5 x i8] c"172.\00"
@.str.10 = [33 x i8] c"curl -s ipinfo.io/%s>>output.txt\00"
@.str.11 = [11 x i8] c"output.txt\00"
@.str.12 = [10 x i8] c"final.txt\00"
@.str.13 = [80 x i8] c"-------------------------------------------------------------------------------\00"
@.str.14 = [4 x i8] c"N/A\00"
@.str.15 = [9 x i8] c"hostname\00"
@.str.16 = [4 x i8] c"org\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 i8
%9 = alloca i8*
%10 = alloca [255 x i8]
%11 = alloca [255 x i8]
%12 = alloca i32*
%13 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%14 = bitcast [255 x i8]* %10 to i8*
%15 = bitcast [255 x i8]* %11 to i8*
%16 = load i32, i32* %4
%17 = icmp eq i32 %16, 1
br i1 %17, label %18, label %22
18: ; preds = %2
%19 = load i32*, i32** @stdout
%20 = call i32 @fprintf(i32* %19, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%21 = call i32 @exit(i32 1)
unreachable
22: ; preds = %2
store i32 1, i32* %7
br label %23
23: ; preds = %37, %22
%24 = load i32, i32* %7
%25 = load i32, i32* %4
%26 = icmp slt i32 %24, %25
br i1 %26, label %27, label %40
27: ; preds = %23
%28 = getelementptr inbounds [255 x i8], [255 x i8]* %11, i64 0, i64 0
%29 = call i32 @strcat(i8* %28, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%30 = getelementptr inbounds [255 x i8], [255 x i8]* %11, i64 0, i64 0
%31 = load i8**, i8*** %5
%32 = load i32, i32* %7
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i8*, i8** %31, i64 %33
%35 = load i8*, i8** %34
%36 = call i32 @strcat(i8* %30, i8* %35)
br label %37
37: ; preds = %27
%38 = load i32, i32* %7
%39 = add nsw i32 %38, 1
store i32 %39, i32* %7
br label %23
40: ; preds = %23
%41 = getelementptr inbounds [255 x i8], [255 x i8]* %10, i64 0, i64 0
%42 = getelementptr inbounds [255 x i8], [255 x i8]* %11, i64 0, i64 0
%43 = call i32 @sprintf(i8* %41, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* %42)
%44 = getelementptr inbounds [255 x i8], [255 x i8]* %10, i64 0, i64 0
%45 = call i32 @system(i8* %44)
%46 = getelementptr inbounds [255 x i8], [255 x i8]* %11, i64 0, i64 0
%47 = call i32 @strcpy(i8* %46, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
%48 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
store i32* %48, i32** %12
%49 = call i32* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
store i32* %49, i32** %13
%50 = load i32*, i32** %12
%51 = icmp eq i32* %50, null
br i1 %51, label %55, label %52
52: ; preds = %40
%53 = load i32*, i32** %13
%54 = icmp eq i32* %53, null
br i1 %54, label %55, label %58
55: ; preds = %52, %40
%56 = call i32 (...) @cleanup()
%57 = call i32 @exit(i32 2)
unreachable
58: ; preds = %52
%59 = getelementptr inbounds [255 x i8], [255 x i8]* %11, i64 0, i64 0
%60 = load i32*, i32** %13
%61 = call i32* @fgets(i8* %59, i32 255, i32* %60)
br label %62
62: ; preds = %89, %80, %58
%63 = load i32*, i32** %13
%64 = call signext i8 @fgetc(i32* %63)
store i8 %64, i8* %8
%65 = sext i8 %64 to i32
%66 = load i8, i8* @EOF
%67 = sext i8 %66 to i32
%68 = icmp ne i32 %65, %67
br i1 %68, label %69, label %90
69: ; preds = %62
%70 = load i8, i8* %8
%71 = sext i8 %70 to i32
%72 = icmp eq i32 %71, 41
br i1 %72, label %73, label %76
73: ; preds = %69
store i32 0, i32* %6
%74 = load i32*, i32** %12
%75 = call i32 @putc(i8 signext 10, i32* %74)
br label %82
76: ; preds = %69
%77 = load i8, i8* %8
%78 = sext i8 %77 to i32
%79 = icmp eq i32 %78, 40
br i1 %79, label %80, label %81
80: ; preds = %76
store i32 1, i32* %6
br label %62
81: ; preds = %76
br label %82
82: ; preds = %81, %73
%83 = load i32, i32* %6
%84 = icmp eq i32 %83, 1
br i1 %84, label %85, label %89
85: ; preds = %82
%86 = load i8, i8* %8
%87 = load i32*, i32** %12
%88 = call i32 @putc(i8 signext %86, i32* %87)
br label %89
89: ; preds = %85, %82
br label %62
90: ; preds = %62
%91 = load i32*, i32** %13
%92 = call i32 @fclose(i32* %91)
%93 = load i32*, i32** %12
%94 = call i32 @fclose(i32* %93)
%95 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
store i32* %95, i32** %13
%96 = load i32*, i32** %13
%97 = icmp eq i32* %96, null
br i1 %97, label %98, label %101
98: ; preds = %90
%99 = call i32 (...) @cleanup()
%100 = call i32 @exit(i32 2)
unreachable
101: ; preds = %90
%102 = getelementptr inbounds [255 x i8], [255 x i8]* %11, i64 0, i64 0
%103 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8* %102)
%104 = load i32*, i32** %13
%105 = getelementptr inbounds [255 x i8], [255 x i8]* %11, i64 0, i64 0
%106 = call signext i8 @fscanf(i32* %104, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8* %105)
br label %107
107: ; preds = %123, %101
%108 = load i32*, i32** %13
%109 = getelementptr inbounds [255 x i8], [255 x i8]* %11, i64 0, i64 0
%110 = call signext i8 @fscanf(i32* %108, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8* %109)
%111 = sext i8 %110 to i32
%112 = load i8, i8* @EOF
%113 = sext i8 %112 to i32
%114 = icmp ne i32 %111, %113
br i1 %114, label %115, label %126
115: ; preds = %107
%116 = getelementptr inbounds [255 x i8], [255 x i8]* %11, i64 0, i64 0
%117 = call i32 @strstr(i8* %116, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%118 = icmp ne i32 %117, 0
br i1 %118, label %123, label %119
119: ; preds = %115
%120 = getelementptr inbounds [255 x i8], [255 x i8]* %10, i64 0, i64 0
%121 = getelementptr inbounds [255 x i8], [255 x i8]* %11, i64 0, i64 0
%122 = call i32 @sprintf(i8* %120, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.10, i64 0, i64 0), i8* %121)
br label %123
123: ; preds = %119, %115
%124 = getelementptr inbounds [255 x i8], [255 x i8]* %10, i64 0, i64 0
%125 = call i32 @system(i8* %124)
br label %107
126: ; preds = %107
%127 = load i32*, i32** %13
%128 = call i32 @fclose(i32* %127)
%129 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
store i32* %129, i32** %13
%130 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
store i32* %130, i32** %12
%131 = load i32*, i32** %13
%132 = icmp eq i32* %131, null
br i1 %132, label %136, label %133
133: ; preds = %126
%134 = load i32*, i32** %12
%135 = icmp eq i32* %134, null
br i1 %135, label %136, label %139
136: ; preds = %133, %126
%137 = call i32 (...) @cleanup()
%138 = call i32 @exit(i32 4)
unreachable
139: ; preds = %133
br label %140
140: ; preds = %199, %139
%141 = getelementptr inbounds [255 x i8], [255 x i8]* %11, i64 0, i64 0
%142 = load i32*, i32** %13
%143 = call i32* @fgets(i8* %141, i32 80, i32* %142)
%144 = icmp ne i32* %143, null
br i1 %144, label %145, label %202
145: ; preds = %140
%146 = getelementptr inbounds [255 x i8], [255 x i8]* %11, i64 0, i64 0
store i8* %146, i8** %9
br label %147
147: ; preds = %196, %145
%148 = load i8*, i8** %9
%149 = load i8, i8* %148
%150 = sext i8 %149 to i32
%151 = icmp ne i32 %150, 10
br i1 %151, label %152, label %199
152: ; preds = %147
%153 = load i8*, i8** %9
%154 = load i8, i8* %153
%155 = sext i8 %154 to i32
%156 = icmp eq i32 %155, 123
br i1 %156, label %162, label %157
157: ; preds = %152
%158 = load i8*, i8** %9
%159 = load i8, i8* %158
%160 = sext i8 %159 to i32
%161 = icmp eq i32 %160, 125
br i1 %161, label %162, label %165
162: ; preds = %157, %152
%163 = load i32*, i32** %12
%164 = call i32 @fputs(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.13, i64 0, i64 0), i32* %163)
br label %199
165: ; preds = %157
%166 = load i8*, i8** %9
%167 = load i8, i8* %166
%168 = sext i8 %167 to i32
%169 = icmp ne i32 %168, 34
br i1 %169, label %170, label %180
170: ; preds = %165
%171 = load i8*, i8** %9
%172 = load i8, i8* %171
%173 = sext i8 %172 to i32
%174 = icmp ne i32 %173, 44
br i1 %174, label %175, label %180
175: ; preds = %170
%176 = load i8*, i8** %9
%177 = load i8, i8* %176
%178 = load i32*, i32** %12
%179 = call i32 @putc(i8 signext %177, i32* %178)
br label %195
180: ; preds = %170, %165
%181 = load i8*, i8** %9
%182 = load i8, i8* %181
%183 = sext i8 %182 to i32
%184 = icmp eq i32 %183, 34
br i1 %184, label %185, label %194
185: ; preds = %180
%186 = load i8*, i8** %9
%187 = getelementptr inbounds i8, i8* %186, i64 1
%188 = load i8, i8* %187
%189 = sext i8 %188 to i32
%190 = icmp eq i32 %189, 34
br i1 %190, label %191, label %194
191: ; preds = %185
%192 = load i32*, i32** %12
%193 = call i32 @fprintf(i32* %192, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0))
br label %194
194: ; preds = %191, %185, %180
br label %195
195: ; preds = %194, %175
br label %196
196: ; preds = %195
%197 = load i8*, i8** %9
%198 = getelementptr inbounds i8, i8* %197, i32 1
store i8* %198, i8** %9
br label %147
199: ; preds = %162, %147
%200 = load i32*, i32** %12
%201 = call i32 @putc(i8 signext 10, i32* %200)
br label %140
202: ; preds = %140
%203 = load i32*, i32** %13
%204 = call i32 @fclose(i32* %203)
%205 = load i32*, i32** %12
%206 = call i32 @fclose(i32* %205)
%207 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
store i32* %207, i32** %13
%208 = load i32*, i32** %13
%209 = icmp eq i32* %208, null
br i1 %209, label %210, label %213
210: ; preds = %202
%211 = call i32 (...) @cleanup()
%212 = call i32 @exit(i32 5)
unreachable
213: ; preds = %202
br label %214
214: ; preds = %230, %213
%215 = getelementptr inbounds [255 x i8], [255 x i8]* %11, i64 0, i64 0
%216 = load i32*, i32** %13
%217 = call i32* @fgets(i8* %215, i32 80, i32* %216)
%218 = icmp ne i32* %217, null
br i1 %218, label %219, label %231
219: ; preds = %214
%220 = getelementptr inbounds [255 x i8], [255 x i8]* %11, i64 0, i64 0
%221 = call i32 @strstr(i8* %220, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0))
%222 = icmp ne i32 %221, 0
br i1 %222, label %230, label %223
223: ; preds = %219
%224 = getelementptr inbounds [255 x i8], [255 x i8]* %11, i64 0, i64 0
%225 = call i32 @strstr(i8* %224, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0))
%226 = icmp ne i32 %225, 0
br i1 %226, label %230, label %227
227: ; preds = %223
%228 = getelementptr inbounds [255 x i8], [255 x i8]* %11, i64 0, i64 0
%229 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8* %228)
br label %230
230: ; preds = %227, %223, %219
br label %214
231: ; preds = %214
%232 = load i32*, i32** %13
%233 = call i32 @fclose(i32* %232)
%234 = call i32 (...) @cleanup()
%235 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stdout = global i32* null
@.str = [24 x i8] c"Usage: ipgeo hostname \0A\00"
@.str.1 = [2 x i8] c" \00"
@.str.2 = [30 x i8] c"traceroute %s > routeinfo.txt\00"
@.str.3 = [1 x i8] zeroinitializer
@.str.4 = [11 x i8] c"iplist.txt\00"
@.str.5 = [2 x i8] c"w\00"
@.str.6 = [14 x i8] c"routeinfo.txt\00"
@.str.7 = [2 x i8] c"r\00"
@EOF = global i8 0
@.str.8 = [3 x i8] c"%s\00"
@.str.9 = [5 x i8] c"172.\00"
@.str.10 = [33 x i8] c"curl -s ipinfo.io/%s>>output.txt\00"
@.str.11 = [11 x i8] c"output.txt\00"
@.str.12 = [10 x i8] c"final.txt\00"
@.str.13 = [80 x i8] c"-------------------------------------------------------------------------------\00"
@.str.14 = [4 x i8] c"N/A\00"
@.str.15 = [9 x i8] c"hostname\00"
@.str.16 = [4 x i8] c"org\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [255 x i8]
%4 = alloca [255 x i8]
%5 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [255 x i8], [255 x i8]* %4, i64 0, i64 0
%7 = icmp eq i32 %0, 1
br i1 %7, label %12, label %8
8: ; preds = %2
%9 = icmp sgt i32 %0, 1
br i1 %9, label %10, label %24
10: ; preds = %8
%11 = zext i32 %0 to i64
br label %16
12: ; preds = %2
%13 = load i32*, i32** @stdout
%14 = tail call i64 @fwrite(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i64 23, i64 1, i32* %13)
%15 = tail call i32 @exit(i32 1)
unreachable
16: ; preds = %10, %16
%17 = phi i64 [ 1, %10 ], [ %22, %16 ]
%18 = call i32 @strcat(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%19 = getelementptr inbounds i8*, i8** %1, i64 %17
%20 = load i8*, i8** %19
%21 = call i32 @strcat(i8* %6, i8* %20)
%22 = add nuw nsw i64 %17, 1
%23 = icmp eq i64 %22, %11
br i1 %23, label %24, label %16
24: ; preds = %16, %8
%25 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* %6)
%26 = call i32 @system(i8* %5)
%27 = call i32 @strcpy(i8* %6, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
%28 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%29 = call i32* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%30 = icmp eq i32* %28, null
%31 = icmp eq i32* %29, null
%32 = or i1 %30, %31
br i1 %32, label %33, label %36
33: ; preds = %24
%34 = call i32 (...) @cleanup()
%35 = call i32 @exit(i32 2)
unreachable
36: ; preds = %24
%37 = call i32* @fgets(i8* %6, i32 255, i32* %29)
%38 = call signext i8 @fgetc(i32* %29)
%39 = load i8, i8* @EOF
%40 = icmp eq i8 %38, %39
br i1 %40, label %55, label %41
41: ; preds = %36, %50
%42 = phi i8 [ %52, %50 ], [ %38, %36 ]
%43 = phi i32 [ %51, %50 ], [ undef, %36 ]
switch i8 %42, label %44 [
i8 41, label %46
i8 40, label %50
]
44: ; preds = %41
%45 = icmp eq i32 %43, 1
br i1 %45, label %46, label %50
46: ; preds = %44, %41
%47 = phi i8 [ 10, %41 ], [ %42, %44 ]
%48 = phi i32 [ 0, %41 ], [ 1, %44 ]
%49 = call i32 @putc(i8 signext %47, i32* %28)
br label %50
50: ; preds = %46, %44, %41
%51 = phi i32 [ 1, %41 ], [ %43, %44 ], [ %48, %46 ]
%52 = call signext i8 @fgetc(i32* %29)
%53 = load i8, i8* @EOF
%54 = icmp eq i8 %52, %53
br i1 %54, label %55, label %41
55: ; preds = %50, %36
%56 = call i32 @fclose(i32* %29)
%57 = call i32 @fclose(i32* %28)
%58 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%59 = icmp eq i32* %58, null
br i1 %59, label %60, label %63
60: ; preds = %55
%61 = call i32 (...) @cleanup()
%62 = call i32 @exit(i32 2)
unreachable
63: ; preds = %55
%64 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8* %6)
%65 = call signext i8 @fscanf(i32* %58, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8* %6)
%66 = call signext i8 @fscanf(i32* %58, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8* %6)
%67 = load i8, i8* @EOF
%68 = icmp eq i8 %66, %67
br i1 %68, label %79, label %69
69: ; preds = %63, %74
%70 = call i32 @strstr(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%71 = icmp eq i32 %70, 0
br i1 %71, label %72, label %74
72: ; preds = %69
%73 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.10, i64 0, i64 0), i8* %6)
br label %74
74: ; preds = %72, %69
%75 = call i32 @system(i8* %5)
%76 = call signext i8 @fscanf(i32* %58, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8* %6)
%77 = load i8, i8* @EOF
%78 = icmp eq i8 %76, %77
br i1 %78, label %79, label %69
79: ; preds = %74, %63
%80 = call i32 @fclose(i32* %58)
%81 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%82 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%83 = icmp eq i32* %81, null
%84 = icmp eq i32* %82, null
%85 = or i1 %83, %84
br i1 %85, label %89, label %86
86: ; preds = %79
%87 = call i32* @fgets(i8* %6, i32 80, i32* %81)
%88 = icmp eq i32* %87, null
br i1 %88, label %113, label %92
89: ; preds = %79
%90 = call i32 (...) @cleanup()
%91 = call i32 @exit(i32 4)
unreachable
92: ; preds = %86, %107
%93 = phi i8* [ %108, %107 ], [ %6, %86 ]
%94 = load i8, i8* %93
switch i8 %94, label %97 [
i8 10, label %109
i8 123, label %95
i8 125, label %95
i8 34, label %99
i8 44, label %105
]
95: ; preds = %92, %92
%96 = call i64 @fwrite(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.13, i64 0, i64 0), i64 79, i64 1, i32* %82)
br label %109
97: ; preds = %92
%98 = call i32 @putc(i8 signext %94, i32* %82)
br label %105
99: ; preds = %92
%100 = getelementptr inbounds i8, i8* %93, i64 1
%101 = load i8, i8* %100
%102 = icmp eq i8 %101, 34
br i1 %102, label %103, label %105
103: ; preds = %99
%104 = call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0), i64 3, i64 1, i32* %82)
br label %105
105: ; preds = %92, %97, %103, %99
%106 = getelementptr inbounds i8, i8* %93, i64 1
br label %107
107: ; preds = %105, %109
%108 = phi i8* [ %106, %105 ], [ %6, %109 ]
br label %92
109: ; preds = %92, %95
%110 = call i32 @putc(i8 signext 10, i32* %82)
%111 = call i32* @fgets(i8* %6, i32 80, i32* %81)
%112 = icmp eq i32* %111, null
br i1 %112, label %113, label %107
113: ; preds = %109, %86
%114 = call i32 @fclose(i32* %81)
%115 = call i32 @fclose(i32* %82)
%116 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%117 = icmp eq i32* %116, null
br i1 %117, label %121, label %118
118: ; preds = %113
%119 = call i32* @fgets(i8* %6, i32 80, i32* %116)
%120 = icmp eq i32* %119, null
br i1 %120, label %135, label %124
121: ; preds = %113
%122 = call i32 (...) @cleanup()
%123 = call i32 @exit(i32 5)
unreachable
124: ; preds = %118, %132
%125 = call i32 @strstr(i8* %6, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0))
%126 = icmp eq i32 %125, 0
br i1 %126, label %127, label %132
127: ; preds = %124
%128 = call i32 @strstr(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0))
%129 = icmp eq i32 %128, 0
br i1 %129, label %130, label %132
130: ; preds = %127
%131 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8* %6)
br label %132
132: ; preds = %130, %127, %124
%133 = call i32* @fgets(i8* %6, i32 80, i32* %116)
%134 = icmp eq i32* %133, null
br i1 %134, label %135, label %124
135: ; preds = %132, %118
%136 = call i32 @fclose(i32* %116)
%137 = call i32 (...) @cleanup()
%138 = call i32 @exit(i32 0)
unreachable
}