#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 stat {
  int st_size;
};
struct ip {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ bzero(char *, int);
int close(int);
int /*<<< orphan*/ err(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ free(char *);
scalar_t__ fstat(int, struct stat *);
int /*<<< orphan*/ ipdump();
struct ip *ipfind(int, int, int, int);
int /*<<< orphan*/ ipinsert(int, int, int, int);
int /*<<< orphan*/ ipmapcreate();
char *malloc(int);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int read(int, char *, int);
int sscanf(char *, char *, int *, int *, int *, int *);
char *strdup(char *);
char *strsep(char **, char *);
int /*<<< orphan*/ usage(char *);
int main(int argc, char **argv) {
  int ip0, ip1, ip2, ip3, fin, r, tab;
  char *line, *buf, *b, *bufin, *ap;
  struct ip *isnew;
  struct stat st;
  if (argc < 2)
    usage(argv[0]);
  fin = open(argv[1], O_RDONLY);
  if (fin == -1)
    err(EXIT_FAILURE, "Couldn't open file %s\n", argv[1]);
  if (fstat(fin, &st) != 0)
    err(EXIT_FAILURE, "Couldn't fstat() input descriptor");
  bufin = malloc(st.st_size);
  if (bufin == NULL)
    err(EXIT_FAILURE, "Couldn't allocate memory");
  bzero(bufin, st.st_size);
  r = read(fin, bufin, st.st_size);
  assert(r == st.st_size);
  while ((line = strsep(&bufin, "\n")) != NULL) {
    buf = b = strdup(line);
    assert(buf != NULL);
    for (;;) {
      if (buf == NULL)
        break;
      tab = 0;
      ap = strsep(&buf, " ");
      if (ap == NULL) {
        ap = strsep(&buf, "\t");
        if (ap == NULL) {
          break;
        } else {
          tab = 1;
        }
      }
      r = sscanf(strdup(ap), "%d.%d.%d.%d", &ip0, &ip1, &ip2, &ip3);
      if (0) {
        if (tab)
          printf("\t%s", ap);
        else if (buf == NULL)
          printf("%s", ap);
        else
          printf("%s ", ap);
      }
      if (r == 4) {
        isnew = ipfind(ip0, ip1, ip2, ip3);
        if (isnew == NULL)
          ipinsert(ip0, ip1, ip2, ip3);
      }
    }
    free(b);
  }
  ipmapcreate();
  ipdump();
  free(bufin);
  if (close(fin) == -1)
    err(EXIT_FAILURE, "Couldn't close input descriptor");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    124c <main+0x2c>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   10e0 <usage@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    0x2d8d(%rip),%rax
mov    (%rax),%esi
call   10f0 <open@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0xffffffff,-0x24(%rbp)
jne    128e <main+0x6e>
mov    0x2d62(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xd79(%rip),%rsi
mov    $0x0,%al
call   1080 <err@plt>
mov    -0x24(%rbp),%edi
lea    -0x68(%rbp),%rsi
call   1140 <fstat@plt>
cmp    $0x0,%rax
je     12bb <main+0x9b>
mov    0x2d2d(%rip),%rax
mov    (%rax),%edi
lea    0xd63(%rip),%rsi
mov    $0x0,%al
call   1080 <err@plt>
mov    -0x68(%rbp),%edi
call   1090 <malloc@plt>
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x50(%rbp)
jne    12e9 <main+0xc9>
mov    0x2cff(%rip),%rax
mov    (%rax),%edi
lea    0xd57(%rip),%rsi
mov    $0x0,%al
call   1080 <err@plt>
mov    -0x50(%rbp),%rdi
mov    -0x68(%rbp),%esi
call   1110 <bzero@plt>
mov    -0x24(%rbp),%edi
mov    -0x50(%rbp),%rsi
mov    -0x68(%rbp),%edx
call   1060 <read@plt>
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x68(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
lea    -0x50(%rbp),%rdi
lea    0xcf0(%rip),%rsi
call   10a0 <strsep@plt>
mov    %rax,-0x38(%rbp)
cmp    $0x0,%rax
je     143f <main+0x21f>
mov    -0x38(%rbp),%rdi
call   1130 <strdup@plt>
mov    %rax,-0x48(%rbp)
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
cmpq   $0x0,-0x40(%rbp)
jne    136b <main+0x14b>
jmp    1431 <main+0x211>
movl   $0x0,-0x2c(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xcd5(%rip),%rsi
call   10a0 <strsep@plt>
mov    %rax,-0x58(%rbp)
cmpq   $0x0,-0x58(%rbp)
jne    13c1 <main+0x1a1>
lea    -0x40(%rbp),%rdi
lea    0xcb8(%rip),%rsi
call   10a0 <strsep@plt>
mov    %rax,-0x58(%rbp)
cmpq   $0x0,-0x58(%rbp)
jne    13b5 <main+0x195>
jmp    1431 <main+0x211>
movl   $0x1,-0x2c(%rbp)
jmp    13c1 <main+0x1a1>
mov    -0x58(%rbp),%rdi
call   1130 <strdup@plt>
mov    %rax,%rdi
lea    0xc82(%rip),%rsi
lea    -0x14(%rbp),%rdx
lea    -0x18(%rbp),%rcx
lea    -0x1c(%rbp),%r8
lea    -0x20(%rbp),%r9
call   10c0 <sscanf@plt>
mov    %eax,-0x28(%rbp)
cmpl   $0x4,-0x28(%rbp)
jne    142c <main+0x20c>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
call   10b0 <ipfind@plt>
mov    %rax,-0x60(%rbp)
cmpq   $0x0,-0x60(%rbp)
jne    1427 <main+0x207>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
call   1040 <ipinsert@plt>
jmp    142c <main+0x20c>
jmp    135b <main+0x13b>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
jmp    131a <main+0xfa>
mov    $0x0,%al
call   10d0 <ipmapcreate@plt>
mov    $0x0,%al
call   1100 <ipdump@plt>
mov    -0x50(%rbp),%rdi
call   1030 <free@plt>
mov    -0x24(%rbp),%edi
call   1050 <close@plt>
cmp    $0xffffffff,%eax
jne    147e <main+0x25e>
mov    0x2b6a(%rip),%rax
mov    (%rax),%edi
lea    0xbeb(%rip),%rsi
mov    $0x0,%al
call   1080 <err@plt>
mov    0x2b4b(%rip),%rax
mov    (%rax),%edi
call   1120 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rsi,%rbx
cmp    $0x1,%edi
jg     123e <main+0x1e>
mov    (%rbx),%rdi
call   10e0 <usage@plt>
mov    0x8(%rbx),%rdi
mov    0x2d9f(%rip),%rax
mov    (%rax),%esi
call   10f0 <open@plt>
mov    %eax,%r14d
cmp    $0xffffffff,%eax
jne    1273 <main+0x53>
mov    0x2d79(%rip),%rax
mov    (%rax),%edi
mov    0x8(%rbx),%rdx
lea    0xd94(%rip),%rsi
xor    %eax,%eax
call   1080 <err@plt>
lea    0x10(%rsp),%rsi
mov    %r14d,%edi
call   1140 <fstat@plt>
test   %rax,%rax
je     129c <main+0x7c>
mov    0x2d4c(%rip),%rax
mov    (%rax),%edi
lea    0xd82(%rip),%rsi
xor    %eax,%eax
call   1080 <err@plt>
mov    0x10(%rsp),%ebx
mov    %ebx,%edi
call   1090 <malloc@plt>
mov    %rax,%rbp
mov    %rax,0x18(%rsp)
test   %rax,%rax
jne    12cb <main+0xab>
mov    0x2d1d(%rip),%rax
mov    (%rax),%edi
lea    0xd75(%rip),%rsi
xor    %eax,%eax
call   1080 <err@plt>
mov    %rbp,%rdi
mov    %ebx,%esi
call   1110 <bzero@plt>
mov    %r14d,0x2c(%rsp)
mov    %r14d,%edi
mov    %rbp,%rsi
mov    %ebx,%edx
call   1060 <read@plt>
xor    %edi,%edi
cmp    %ebx,%eax
sete   %dil
call   1070 <assert@plt>
lea    0xd1a(%rip),%rsi
lea    0x18(%rsp),%rdi
call   10a0 <strsep@plt>
test   %rax,%rax
jne    1355 <main+0x135>
xor    %eax,%eax
call   10d0 <ipmapcreate@plt>
xor    %eax,%eax
call   1100 <ipdump@plt>
mov    0x18(%rsp),%rdi
call   1030 <free@plt>
mov    0x2c(%rsp),%edi
call   1050 <close@plt>
cmp    $0xffffffff,%eax
jne    1347 <main+0x127>
mov    0x2ca1(%rip),%rax
mov    (%rax),%edi
lea    0xd22(%rip),%rsi
xor    %eax,%eax
call   1080 <err@plt>
mov    0x2c82(%rip),%rax
mov    (%rax),%edi
call   1120 <exit@plt>
lea    0x20(%rsp),%rbp
lea    0xcf5(%rip),%r14
lea    0xc(%rsp),%r15
lea    0x8(%rsp),%r12
lea    0x4(%rsp),%r13
mov    %rsp,%rbx
jmp    13a4 <main+0x184>
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x30(%rsp),%rdi
call   1030 <free@plt>
lea    0x18(%rsp),%rdi
lea    0xc7f(%rip),%rsi
call   10a0 <strsep@plt>
test   %rax,%rax
je     130a <main+0xea>
mov    %rax,%rdi
call   1130 <strdup@plt>
mov    %rax,0x20(%rsp)
xor    %edi,%edi
mov    %rax,0x30(%rsp)
test   %rax,%rax
setne  %dil
call   1070 <assert@plt>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmpq   $0x0,0x20(%rsp)
je     1380 <main+0x160>
mov    %rbp,%rdi
lea    0xc70(%rip),%rsi
call   10a0 <strsep@plt>
test   %rax,%rax
jne    1400 <main+0x1e0>
mov    %rbp,%rdi
lea    0xc5e(%rip),%rsi
call   10a0 <strsep@plt>
test   %rax,%rax
je     1380 <main+0x160>
mov    %rax,%rdi
call   1130 <strdup@plt>
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
mov    %r12,%rcx
mov    %r13,%r8
mov    %rbx,%r9
call   10c0 <sscanf@plt>
cmp    $0x4,%eax
jne    13d0 <main+0x1b0>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%edx
mov    (%rsp),%ecx
call   10b0 <ipfind@plt>
test   %rax,%rax
jne    13d0 <main+0x1b0>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%edx
mov    (%rsp),%ecx
call   1040 <ipinsert@plt>
jmp    13d0 <main+0x1b0>

LLVM IR (-O0):
%struct.ip = type { i32 }
%struct.stat = type { i32 }
@O_RDONLY = global i32 0
@EXIT_FAILURE = global i32 0
@.str = [23 x i8] c"Couldn't open file %s\0A\00"
@.str.1 = [34 x i8] c"Couldn't fstat() input descriptor\00"
@.str.2 = [25 x i8] c"Couldn't allocate memory\00"
@.str.3 = [2 x i8] c"\0A\00"
@.str.4 = [2 x i8] c" \00"
@.str.5 = [2 x i8] c"\09\00"
@.str.6 = [12 x i8] c"%d.%d.%d.%d\00"
@.str.7 = [32 x i8] c"Couldn't close input descriptor\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca i8*
%17 = alloca i8*
%18 = alloca %struct.ip*
%19 = alloca %struct.stat
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%20 = load i32, i32* %4
%21 = icmp slt i32 %20, 2
br i1 %21, label %22, label %27
22: ; preds = %2
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 0
%25 = load i8*, i8** %24
%26 = call i32 @usage(i8* %25)
br label %27
27: ; preds = %22, %2
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 1
%30 = load i8*, i8** %29
%31 = load i32, i32* @O_RDONLY
%32 = call i32 @open(i8* %30, i32 %31)
store i32 %32, i32* %10
%33 = load i32, i32* %10
%34 = icmp eq i32 %33, -1
br i1 %34, label %35, label %41
35: ; preds = %27
%36 = load i32, i32* @EXIT_FAILURE
%37 = load i8**, i8*** %5
%38 = getelementptr inbounds i8*, i8** %37, i64 1
%39 = load i8*, i8** %38
%40 = call i32 (i32, i8*, ...) @err(i32 %36, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %39)
br label %41
41: ; preds = %35, %27
%42 = load i32, i32* %10
%43 = call i64 @fstat(i32 %42, %struct.stat* %19)
%44 = icmp ne i64 %43, 0
br i1 %44, label %45, label %48
45: ; preds = %41
%46 = load i32, i32* @EXIT_FAILURE
%47 = call i32 (i32, i8*, ...) @err(i32 %46, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
br label %48
48: ; preds = %45, %41
%49 = getelementptr inbounds %struct.stat, %struct.stat* %19, i32 0, i32 0
%50 = load i32, i32* %49
%51 = call i8* @malloc(i32 %50)
store i8* %51, i8** %16
%52 = load i8*, i8** %16
%53 = icmp eq i8* %52, null
br i1 %53, label %54, label %57
54: ; preds = %48
%55 = load i32, i32* @EXIT_FAILURE
%56 = call i32 (i32, i8*, ...) @err(i32 %55, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
br label %57
57: ; preds = %54, %48
%58 = load i8*, i8** %16
%59 = getelementptr inbounds %struct.stat, %struct.stat* %19, i32 0, i32 0
%60 = load i32, i32* %59
%61 = call i32 @bzero(i8* %58, i32 %60)
%62 = load i32, i32* %10
%63 = load i8*, i8** %16
%64 = getelementptr inbounds %struct.stat, %struct.stat* %19, i32 0, i32 0
%65 = load i32, i32* %64
%66 = call i32 @read(i32 %62, i8* %63, i32 %65)
store i32 %66, i32* %11
%67 = load i32, i32* %11
%68 = getelementptr inbounds %struct.stat, %struct.stat* %19, i32 0, i32 0
%69 = load i32, i32* %68
%70 = icmp eq i32 %67, %69
%71 = zext i1 %70 to i32
%72 = call i32 @assert(i32 %71)
br label %73
73: ; preds = %120, %57
%74 = call i8* @strsep(i8** %16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i8* %74, i8** %13
%75 = icmp ne i8* %74, null
br i1 %75, label %76, label %123
76: ; preds = %73
%77 = load i8*, i8** %13
%78 = call i8* @strdup(i8* %77)
store i8* %78, i8** %15
store i8* %78, i8** %14
%79 = load i8*, i8** %14
%80 = icmp ne i8* %79, null
%81 = zext i1 %80 to i32
%82 = call i32 @assert(i32 %81)
br label %83
83: ; preds = %119, %76
%84 = load i8*, i8** %14
%85 = icmp eq i8* %84, null
br i1 %85, label %86, label %87
86: ; preds = %83
br label %120
87: ; preds = %83
store i32 0, i32* %12
%88 = call i8* @strsep(i8** %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i8* %88, i8** %17
%89 = load i8*, i8** %17
%90 = icmp eq i8* %89, null
br i1 %90, label %91, label %98
91: ; preds = %87
%92 = call i8* @strsep(i8** %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
store i8* %92, i8** %17
%93 = load i8*, i8** %17
%94 = icmp eq i8* %93, null
br i1 %94, label %95, label %96
95: ; preds = %91
br label %120
96: ; preds = %91
store i32 1, i32* %12
br label %97
97: ; preds = %96
br label %98
98: ; preds = %97, %87
%99 = load i8*, i8** %17
%100 = call i8* @strdup(i8* %99)
%101 = call i32 @sscanf(i8* %100, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i32* %6, i32* %7, i32* %8, i32* %9)
store i32 %101, i32* %11
%102 = load i32, i32* %11
%103 = icmp eq i32 %102, 4
br i1 %103, label %104, label %119
104: ; preds = %98
%105 = load i32, i32* %6
%106 = load i32, i32* %7
%107 = load i32, i32* %8
%108 = load i32, i32* %9
%109 = call %struct.ip* @ipfind(i32 %105, i32 %106, i32 %107, i32 %108)
store %struct.ip* %109, %struct.ip** %18
%110 = load %struct.ip*, %struct.ip** %18
%111 = icmp eq %struct.ip* %110, null
br i1 %111, label %112, label %118
112: ; preds = %104
%113 = load i32, i32* %6
%114 = load i32, i32* %7
%115 = load i32, i32* %8
%116 = load i32, i32* %9
%117 = call i32 @ipinsert(i32 %113, i32 %114, i32 %115, i32 %116)
br label %118
118: ; preds = %112, %104
br label %119
119: ; preds = %118, %98
br label %83
120: ; preds = %95, %86
%121 = load i8*, i8** %15
%122 = call i32 @free(i8* %121)
br label %73
123: ; preds = %73
%124 = call i32 (...) @ipmapcreate()
%125 = call i32 (...) @ipdump()
%126 = load i8*, i8** %16
%127 = call i32 @free(i8* %126)
%128 = load i32, i32* %10
%129 = call i32 @close(i32 %128)
%130 = icmp eq i32 %129, -1
br i1 %130, label %131, label %134
131: ; preds = %123
%132 = load i32, i32* @EXIT_FAILURE
%133 = call i32 (i32, i8*, ...) @err(i32 %132, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.7, i64 0, i64 0))
br label %134
134: ; preds = %131, %123
%135 = load i32, i32* @EXIT_SUCCESS
%136 = call i32 @exit(i32 %135)
unreachable
}

LLVM IR (-O2):
%struct.stat = type { i32 }
%struct.ip = type { i32 }
@O_RDONLY = global i32 0
@EXIT_FAILURE = global i32 0
@.str = [23 x i8] c"Couldn't open file %s\0A\00"
@.str.1 = [34 x i8] c"Couldn't fstat() input descriptor\00"
@.str.2 = [25 x i8] c"Couldn't allocate memory\00"
@.str.3 = [2 x i8] c"\0A\00"
@.str.4 = [2 x i8] c" \00"
@.str.5 = [2 x i8] c"\09\00"
@.str.6 = [12 x i8] c"%d.%d.%d.%d\00"
@.str.7 = [32 x i8] c"Couldn't close input descriptor\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca %struct.stat
%10 = bitcast i32* %3 to i8*
%11 = bitcast i32* %4 to i8*
%12 = bitcast i32* %5 to i8*
%13 = bitcast i32* %6 to i8*
%14 = bitcast i8** %7 to i8*
%15 = bitcast i8** %8 to i8*
%16 = bitcast %struct.stat* %9 to i8*
%17 = icmp slt i32 %0, 2
br i1 %17, label %18, label %21
18: ; preds = %2
%19 = load i8*, i8** %1
%20 = tail call i32 @usage(i8* %19)
br label %21
21: ; preds = %18, %2
%22 = getelementptr inbounds i8*, i8** %1, i64 1
%23 = load i8*, i8** %22
%24 = load i32, i32* @O_RDONLY
%25 = tail call i32 @open(i8* %23, i32 %24)
%26 = icmp eq i32 %25, -1
br i1 %26, label %27, label %31
27: ; preds = %21
%28 = load i32, i32* @EXIT_FAILURE
%29 = load i8*, i8** %22
%30 = tail call i32 (i32, i8*, ...) @err(i32 %28, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %29)
br label %31
31: ; preds = %27, %21
%32 = call i64 @fstat(i32 %25, %struct.stat* %9)
%33 = icmp eq i64 %32, 0
br i1 %33, label %37, label %34
34: ; preds = %31
%35 = load i32, i32* @EXIT_FAILURE
%36 = tail call i32 (i32, i8*, ...) @err(i32 %35, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
br label %37
37: ; preds = %34, %31
%38 = getelementptr inbounds %struct.stat, %struct.stat* %9, i64 0, i32 0
%39 = load i32, i32* %38
%40 = tail call i8* @malloc(i32 %39)
store i8* %40, i8** %8
%41 = icmp eq i8* %40, null
br i1 %41, label %42, label %45
42: ; preds = %37
%43 = load i32, i32* @EXIT_FAILURE
%44 = tail call i32 (i32, i8*, ...) @err(i32 %43, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
br label %45
45: ; preds = %42, %37
%46 = tail call i32 @bzero(i8* %40, i32 %39)
%47 = tail call i32 @read(i32 %25, i8* %40, i32 %39)
%48 = icmp eq i32 %47, %39
%49 = zext i1 %48 to i32
%50 = tail call i32 @assert(i32 %49)
%51 = call i8* @strsep(i8** %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%52 = icmp eq i8* %51, null
br i1 %52, label %92, label %53
53: ; preds = %45, %88
%54 = phi i8* [ %90, %88 ], [ %51, %45 ]
%55 = call i8* @strdup(i8* %54)
store i8* %55, i8** %7
%56 = icmp ne i8* %55, null
%57 = zext i1 %56 to i32
%58 = call i32 @assert(i32 %57)
%59 = load i8*, i8** %7
%60 = icmp eq i8* %59, null
br i1 %60, label %88, label %61
61: ; preds = %53, %85
%62 = call i8* @strsep(i8** %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%63 = icmp eq i8* %62, null
br i1 %63, label %64, label %67
64: ; preds = %61
%65 = call i8* @strsep(i8** %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%66 = icmp eq i8* %65, null
br i1 %66, label %88, label %67
67: ; preds = %64, %61
%68 = phi i8* [ %62, %61 ], [ %65, %64 ]
%69 = call i8* @strdup(i8* %68)
%70 = call i32 @sscanf(i8* %69, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i32* %3, i32* %4, i32* %5, i32* %6)
%71 = icmp eq i32 %70, 4
br i1 %71, label %72, label %85
72: ; preds = %67
%73 = load i32, i32* %3
%74 = load i32, i32* %4
%75 = load i32, i32* %5
%76 = load i32, i32* %6
%77 = call %struct.ip* @ipfind(i32 %73, i32 %74, i32 %75, i32 %76)
%78 = icmp eq %struct.ip* %77, null
br i1 %78, label %79, label %85
79: ; preds = %72
%80 = load i32, i32* %3
%81 = load i32, i32* %4
%82 = load i32, i32* %5
%83 = load i32, i32* %6
%84 = call i32 @ipinsert(i32 %80, i32 %81, i32 %82, i32 %83)
br label %85
85: ; preds = %72, %79, %67
%86 = load i8*, i8** %7
%87 = icmp eq i8* %86, null
br i1 %87, label %88, label %61
88: ; preds = %85, %64, %53
%89 = call i32 @free(i8* %55)
%90 = call i8* @strsep(i8** %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%91 = icmp eq i8* %90, null
br i1 %91, label %92, label %53
92: ; preds = %88, %45
%93 = call i32 (...) @ipmapcreate()
%94 = call i32 (...) @ipdump()
%95 = load i8*, i8** %8
%96 = call i32 @free(i8* %95)
%97 = call i32 @close(i32 %25)
%98 = icmp eq i32 %97, -1
br i1 %98, label %99, label %102
99: ; preds = %92
%100 = load i32, i32* @EXIT_FAILURE
%101 = call i32 (i32, i8*, ...) @err(i32 %100, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.7, i64 0, i64 0))
br label %102
102: ; preds = %99, %92
%103 = load i32, i32* @EXIT_SUCCESS
%104 = call i32 @exit(i32 %103)
unreachable
}