#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 in_addr {
  int s_addr;
};

/* Variables and functions */
int /*<<< orphan*/ LOG_ERR;
void *htonl(unsigned int);
int sscanf(char *, char *, unsigned int *, unsigned int *, unsigned int *,
           unsigned int *, unsigned int *, unsigned int *, unsigned int *,
           unsigned int *);
int /*<<< orphan*/ sys_err(int /*<<< orphan*/, char *, int, int /*<<< orphan*/,
                           char *);
int ippool_aton(struct in_addr *addr, struct in_addr *mask, char *pool,
                int number) {
  unsigned int a1, a2, a3, a4;
  unsigned int m1, m2, m3, m4;
  int c = 0;
  int m = 0;
  int masklog = 0;
  (void)number;
  c = sscanf(pool, "%u.%u.%u.%u/%u.%u.%u.%u", &a1, &a2, &a3, &a4, &m1, &m2, &m3,
             &m4);
  switch (c) {
  case 4:
    mask->s_addr = 0xffffffff;
    break;
  case 5:
    if (m1 > 32) {
      sys_err(LOG_ERR,
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/borellyc/cb-pepperspot/refs/heads/"
              "master/src/ippool.c",
              518, 0, "Invalid mask");
      return -1;
    }
    mask->s_addr = htonl(0xffffffff << (32 - m1));
    break;
  case 8:
    if (m1 >= 256 || m2 >= 256 || m3 >= 256 || m4 >= 256) {
      sys_err(LOG_ERR,
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/borellyc/cb-pepperspot/refs/heads/"
              "master/src/ippool.c",
              525, 0, "Invalid mask");
      return -1;
    }
    m = m1 * 0x1000000 + m2 * 0x10000 + m3 * 0x100 + m4;
    for (masklog = 0; ((1 << masklog) < ((~m) + 1)); masklog++)
      ;
    if (((~m) + 1) != (1 << masklog)) {
      sys_err(LOG_ERR,
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/borellyc/cb-pepperspot/refs/heads/"
              "master/src/ippool.c",
              532, 0, "Invalid mask");
      return -1;
    }
    mask->s_addr = htonl(m);
    break;
  default:
    sys_err(LOG_ERR,
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/borellyc/cb-pepperspot/refs/heads/"
            "master/src/ippool.c",
            538, 0, "Invalid mask");
    return -1;
  }
  if (a1 >= 256 || a2 >= 256 || a3 >= 256 || a4 >= 256) {
    sys_err(LOG_ERR,
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/borellyc/cb-pepperspot/refs/heads/"
            "master/src/ippool.c",
            543, 0, "Wrong IP address format");
    return -1;
  } else
    addr->s_addr = htonl(a1 * 0x1000000 + a2 * 0x10000 + a3 * 0x100 + a4);
  return 0;
}


x86 assembly (clang, -O0):
<ippool_aton>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
movl   $0x0,-0x48(%rbp)
movl   $0x0,-0x4c(%rbp)
movl   $0x0,-0x50(%rbp)
mov    -0x20(%rbp),%rdi
mov    %rsp,%rax
lea    -0x44(%rbp),%rcx
mov    %rcx,0x18(%rax)
lea    -0x40(%rbp),%rcx
mov    %rcx,0x10(%rax)
lea    -0x3c(%rbp),%rcx
mov    %rcx,0x8(%rax)
lea    -0x38(%rbp),%rcx
mov    %rcx,(%rax)
lea    0xe74(%rip),%rsi
lea    -0x28(%rbp),%rdx
lea    -0x2c(%rbp),%rcx
lea    -0x30(%rbp),%r8
lea    -0x34(%rbp),%r9
call   1040 <sscanf@plt>
mov    %eax,-0x48(%rbp)
mov    -0x48(%rbp),%eax
mov    %eax,-0x54(%rbp)
sub    $0x4,%eax
je     11da <ippool_aton+0xaa>
jmp    11b8 <ippool_aton+0x88>
mov    -0x54(%rbp),%eax
sub    $0x5,%eax
je     11e9 <ippool_aton+0xb9>
jmp    11c9 <ippool_aton+0x99>
mov    -0x54(%rbp),%eax
sub    $0x8,%eax
je     1243 <ippool_aton+0x113>
jmp    1358 <ippool_aton+0x228>
mov    -0x18(%rbp),%rax
movl   $0xffffffff,(%rax)
jmp    1387 <ippool_aton+0x257>
cmpl   $0x20,-0x38(%rbp)
jbe    1222 <ippool_aton+0xf2>
mov    0x2dde(%rip),%rax
mov    (%rax),%edi
lea    0xe15(%rip),%rsi
mov    $0x206,%edx
xor    %ecx,%ecx
lea    0xe97(%rip),%r8
call   1050 <sys_err@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1417 <ippool_aton+0x2e7>
mov    $0x20,%ecx
sub    -0x38(%rbp),%ecx
mov    $0xffffffff,%edi
shl    %cl,%edi
call   1030 <htonl@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
jmp    1387 <ippool_aton+0x257>
cmpl   $0x100,-0x38(%rbp)
jae    1277 <ippool_aton+0x147>
cmpl   $0x100,-0x3c(%rbp)
jae    1277 <ippool_aton+0x147>
cmpl   $0x100,-0x40(%rbp)
jae    1277 <ippool_aton+0x147>
cmpl   $0x100,-0x44(%rbp)
jb     12a6 <ippool_aton+0x176>
mov    0x2d5a(%rip),%rax
mov    (%rax),%edi
lea    0xd91(%rip),%rsi
mov    $0x20d,%edx
xor    %ecx,%ecx
lea    0xe13(%rip),%r8
call   1050 <sys_err@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1417 <ippool_aton+0x2e7>
mov    -0x38(%rbp),%eax
shl    $0x18,%eax
mov    -0x3c(%rbp),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
mov    -0x40(%rbp),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
add    -0x44(%rbp),%eax
mov    %eax,-0x4c(%rbp)
movl   $0x0,-0x50(%rbp)
mov    -0x50(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    -0x4c(%rbp),%ecx
xor    $0xffffffff,%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    12f7 <ippool_aton+0x1c7>
jmp    12e9 <ippool_aton+0x1b9>
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    12c9 <ippool_aton+0x199>
mov    -0x4c(%rbp),%eax
xor    $0xffffffff,%eax
add    $0x1,%eax
mov    -0x50(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
cmp    %ecx,%eax
je     1343 <ippool_aton+0x213>
mov    0x2cbd(%rip),%rax
mov    (%rax),%edi
lea    0xcf4(%rip),%rsi
mov    $0x214,%edx
xor    %ecx,%ecx
lea    0xd76(%rip),%r8
call   1050 <sys_err@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1417 <ippool_aton+0x2e7>
mov    -0x4c(%rbp),%edi
call   1030 <htonl@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
jmp    1387 <ippool_aton+0x257>
mov    0x2c79(%rip),%rax
mov    (%rax),%edi
lea    0xcb0(%rip),%rsi
mov    $0x21a,%edx
xor    %ecx,%ecx
lea    0xd32(%rip),%r8
call   1050 <sys_err@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1417 <ippool_aton+0x2e7>
cmpl   $0x100,-0x28(%rbp)
jae    13bb <ippool_aton+0x28b>
cmpl   $0x100,-0x2c(%rbp)
jae    13bb <ippool_aton+0x28b>
cmpl   $0x100,-0x30(%rbp)
jae    13bb <ippool_aton+0x28b>
cmpl   $0x100,-0x34(%rbp)
jb     13ea <ippool_aton+0x2ba>
mov    0x2c16(%rip),%rax
mov    (%rax),%edi
lea    0xc4d(%rip),%rsi
mov    $0x21f,%edx
xor    %ecx,%ecx
lea    0xcdc(%rip),%r8
call   1050 <sys_err@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1417 <ippool_aton+0x2e7>
mov    -0x28(%rbp),%edi
shl    $0x18,%edi
mov    -0x2c(%rbp),%eax
shl    $0x10,%eax
add    %eax,%edi
mov    -0x30(%rbp),%eax
shl    $0x8,%eax
add    %eax,%edi
add    -0x34(%rbp),%edi
call   1030 <htonl@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ippool_aton>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rdx,%rax
mov    %rsi,%r15
mov    %rdi,%r14
lea    0xc(%rsp),%rbx
lea    0x10(%rsp),%r10
lea    0x14(%rsp),%r11
lea    0x8(%rsp),%r12
lea    0xea1(%rip),%rsi
lea    0x24(%rsp),%rdx
lea    0x20(%rsp),%rcx
lea    0x1c(%rsp),%r8
lea    0x18(%rsp),%r9
mov    %rax,%rdi
push   %rbx
push   %r10
push   %r11
push   %r12
call   1040 <sscanf@plt>
add    $0x20,%rsp
cmp    $0x4,%eax
je     1251 <ippool_aton+0x121>
cmp    $0x8,%eax
je     11cb <ippool_aton+0x9b>
cmp    $0x5,%eax
jne    1258 <ippool_aton+0x128>
mov    0x8(%rsp),%ecx
cmp    $0x21,%ecx
jb     1297 <ippool_aton+0x167>
mov    0x2e27(%rip),%rax
mov    (%rax),%edi
lea    0xe5e(%rip),%rsi
lea    0xee7(%rip),%r8
mov    $0x206,%edx
jmp    130e <ippool_aton+0x1de>
mov    0x8(%rsp),%eax
cmp    $0xff,%eax
ja     1279 <ippool_aton+0x149>
mov    0x14(%rsp),%ecx
cmp    $0xff,%ecx
ja     1279 <ippool_aton+0x149>
mov    0x10(%rsp),%edi
cmp    $0xff,%edi
ja     1279 <ippool_aton+0x149>
mov    0xc(%rsp),%edx
cmp    $0x100,%edx
jae    1279 <ippool_aton+0x149>
shl    $0x18,%eax
shl    $0x10,%ecx
add    %eax,%ecx
shl    $0x8,%edi
add    %ecx,%edi
add    %edx,%edi
mov    %edi,%eax
neg    %eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edx
shl    %cl,%edx
add    $0x1,%ecx
cmp    %eax,%edx
jl     1220 <ippool_aton+0xf0>
je     12a0 <ippool_aton+0x170>
mov    0x2da1(%rip),%rax
mov    (%rax),%edi
lea    0xdd8(%rip),%rsi
lea    0xe61(%rip),%r8
mov    $0x214,%edx
jmp    130e <ippool_aton+0x1de>
mov    $0xffffffff,%eax
jmp    12a5 <ippool_aton+0x175>
mov    0x2d79(%rip),%rax
mov    (%rax),%edi
lea    0xdb0(%rip),%rsi
lea    0xe39(%rip),%r8
mov    $0x21a,%edx
jmp    130e <ippool_aton+0x1de>
mov    0x2d58(%rip),%rax
mov    (%rax),%edi
lea    0xd8f(%rip),%rsi
lea    0xe18(%rip),%r8
mov    $0x20d,%edx
jmp    130e <ippool_aton+0x1de>
neg    %cl
mov    $0xffffffff,%edi
shl    %cl,%edi
call   1030 <htonl@plt>
mov    %eax,(%r15)
mov    0x24(%rsp),%eax
cmp    $0xff,%eax
ja     12f2 <ippool_aton+0x1c2>
mov    0x20(%rsp),%ecx
cmp    $0xff,%ecx
ja     12f2 <ippool_aton+0x1c2>
mov    0x1c(%rsp),%edi
cmp    $0xff,%edi
ja     12f2 <ippool_aton+0x1c2>
mov    0x18(%rsp),%edx
cmp    $0x100,%edx
jae    12f2 <ippool_aton+0x1c2>
shl    $0x18,%eax
shl    $0x10,%ecx
add    %eax,%ecx
shl    $0x8,%edi
add    %ecx,%edi
add    %edx,%edi
call   1030 <htonl@plt>
mov    %eax,(%r14)
xor    %eax,%eax
jmp    131a <ippool_aton+0x1ea>
mov    0x2cdf(%rip),%rax
mov    (%rax),%edi
lea    0xd16(%rip),%rsi
lea    0xdac(%rip),%r8
mov    $0x21f,%edx
xor    %ecx,%ecx
call   1050 <sys_err@plt>
mov    $0xffffffff,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.in_addr = type { i32 }
@.str = [24 x i8] c"%u.%u.%u.%u/%u.%u.%u.%u\00"
@LOG_ERR = global i32 0
@.str.1 = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/borellyc/cb-pepperspot/refs/heads/master/src/ippool.c\00"
@.str.2 = [13 x i8] c"Invalid mask\00"
@.str.3 = [24 x i8] c"Wrong IP address format\00"
define i32 @ippool_aton(%struct.in_addr* %0, %struct.in_addr* %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca %struct.in_addr*
%7 = alloca %struct.in_addr*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
store %struct.in_addr* %0, %struct.in_addr** %6
store %struct.in_addr* %1, %struct.in_addr** %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i32 0, i32* %18
store i32 0, i32* %19
store i32 0, i32* %20
%21 = load i32, i32* %9
%22 = load i8*, i8** %8
%23 = call i32 @sscanf(i8* %22, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32* %10, i32* %11, i32* %12, i32* %13, i32* %14, i32* %15, i32* %16, i32* %17)
store i32 %23, i32* %18
%24 = load i32, i32* %18
switch i32 %24, label %95 [
i32 4, label %25
i32 5, label %28
i32 8, label %42
]
25: ; preds = %4
%26 = load %struct.in_addr*, %struct.in_addr** %7
%27 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %26, i32 0, i32 0
store i32 -1, i32* %27
br label %98
28: ; preds = %4
%29 = load i32, i32* %14
%30 = icmp ugt i32 %29, 32
br i1 %30, label %31, label %34
31: ; preds = %28
%32 = load i32, i32* @LOG_ERR
%33 = call i32 @sys_err(i32 %32, i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str.1, i64 0, i64 0), i32 518, i32 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
store i32 -1, i32* %5
br label %129
34: ; preds = %28
%35 = load i32, i32* %14
%36 = sub i32 32, %35
%37 = shl i32 -1, %36
%38 = call i8* @htonl(i32 %37)
%39 = ptrtoint i8* %38 to i32
%40 = load %struct.in_addr*, %struct.in_addr** %7
%41 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %40, i32 0, i32 0
store i32 %39, i32* %41
br label %98
42: ; preds = %4
%43 = load i32, i32* %14
%44 = icmp uge i32 %43, 256
br i1 %44, label %54, label %45
45: ; preds = %42
%46 = load i32, i32* %15
%47 = icmp uge i32 %46, 256
br i1 %47, label %54, label %48
48: ; preds = %45
%49 = load i32, i32* %16
%50 = icmp uge i32 %49, 256
br i1 %50, label %54, label %51
51: ; preds = %48
%52 = load i32, i32* %17
%53 = icmp uge i32 %52, 256
br i1 %53, label %54, label %57
54: ; preds = %51, %48, %45, %42
%55 = load i32, i32* @LOG_ERR
%56 = call i32 @sys_err(i32 %55, i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str.1, i64 0, i64 0), i32 525, i32 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
store i32 -1, i32* %5
br label %129
57: ; preds = %51
%58 = load i32, i32* %14
%59 = mul i32 %58, 16777216
%60 = load i32, i32* %15
%61 = mul i32 %60, 65536
%62 = add i32 %59, %61
%63 = load i32, i32* %16
%64 = mul i32 %63, 256
%65 = add i32 %62, %64
%66 = load i32, i32* %17
%67 = add i32 %65, %66
store i32 %67, i32* %19
store i32 0, i32* %20
br label %68
68: ; preds = %76, %57
%69 = load i32, i32* %20
%70 = shl i32 1, %69
%71 = load i32, i32* %19
%72 = xor i32 %71, -1
%73 = add nsw i32 %72, 1
%74 = icmp slt i32 %70, %73
br i1 %74, label %75, label %79
75: ; preds = %68
br label %76
76: ; preds = %75
%77 = load i32, i32* %20
%78 = add nsw i32 %77, 1
store i32 %78, i32* %20
br label %68
79: ; preds = %68
%80 = load i32, i32* %19
%81 = xor i32 %80, -1
%82 = add nsw i32 %81, 1
%83 = load i32, i32* %20
%84 = shl i32 1, %83
%85 = icmp ne i32 %82, %84
br i1 %85, label %86, label %89
86: ; preds = %79
%87 = load i32, i32* @LOG_ERR
%88 = call i32 @sys_err(i32 %87, i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str.1, i64 0, i64 0), i32 532, i32 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
store i32 -1, i32* %5
br label %129
89: ; preds = %79
%90 = load i32, i32* %19
%91 = call i8* @htonl(i32 %90)
%92 = ptrtoint i8* %91 to i32
%93 = load %struct.in_addr*, %struct.in_addr** %7
%94 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %93, i32 0, i32 0
store i32 %92, i32* %94
br label %98
95: ; preds = %4
%96 = load i32, i32* @LOG_ERR
%97 = call i32 @sys_err(i32 %96, i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str.1, i64 0, i64 0), i32 538, i32 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
store i32 -1, i32* %5
br label %129
98: ; preds = %89, %34, %25
%99 = load i32, i32* %10
%100 = icmp uge i32 %99, 256
br i1 %100, label %110, label %101
101: ; preds = %98
%102 = load i32, i32* %11
%103 = icmp uge i32 %102, 256
br i1 %103, label %110, label %104
104: ; preds = %101
%105 = load i32, i32* %12
%106 = icmp uge i32 %105, 256
br i1 %106, label %110, label %107
107: ; preds = %104
%108 = load i32, i32* %13
%109 = icmp uge i32 %108, 256
br i1 %109, label %110, label %113
110: ; preds = %107, %104, %101, %98
%111 = load i32, i32* @LOG_ERR
%112 = call i32 @sys_err(i32 %111, i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str.1, i64 0, i64 0), i32 543, i32 0, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
store i32 -1, i32* %5
br label %129
113: ; preds = %107
%114 = load i32, i32* %10
%115 = mul i32 %114, 16777216
%116 = load i32, i32* %11
%117 = mul i32 %116, 65536
%118 = add i32 %115, %117
%119 = load i32, i32* %12
%120 = mul i32 %119, 256
%121 = add i32 %118, %120
%122 = load i32, i32* %13
%123 = add i32 %121, %122
%124 = call i8* @htonl(i32 %123)
%125 = ptrtoint i8* %124 to i32
%126 = load %struct.in_addr*, %struct.in_addr** %6
%127 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %126, i32 0, i32 0
store i32 %125, i32* %127
br label %128
128: ; preds = %113
store i32 0, i32* %5
br label %129
129: ; preds = %128, %110, %95, %86, %54, %31
%130 = load i32, i32* %5
ret i32 %130
}

LLVM IR (-O2):
%struct.in_addr = type { i32 }
@.str = [24 x i8] c"%u.%u.%u.%u/%u.%u.%u.%u\00"
@LOG_ERR = global i32 0
@.str.1 = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/borellyc/cb-pepperspot/refs/heads/master/src/ippool.c\00"
@.str.2 = [13 x i8] c"Invalid mask\00"
@.str.3 = [24 x i8] c"Wrong IP address format\00"
define i32 @ippool_aton(%struct.in_addr* nocapture writeonly %0, %struct.in_addr* nocapture writeonly %1, i8* nocapture %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = bitcast i32* %5 to i8*
%14 = bitcast i32* %6 to i8*
%15 = bitcast i32* %7 to i8*
%16 = bitcast i32* %8 to i8*
%17 = bitcast i32* %9 to i8*
%18 = bitcast i32* %10 to i8*
%19 = bitcast i32* %11 to i8*
%20 = bitcast i32* %12 to i8*
%21 = call i32 @sscanf(i8* %2, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32* %5, i32* %6, i32* %7, i32* %8, i32* %9, i32* %10, i32* %11, i32* %12)
switch i32 %21, label %64 [
i32 4, label %72
i32 5, label %22
i32 8, label %31
]
22: ; preds = %4
%23 = load i32, i32* %9
%24 = icmp ugt i32 %23, 32
br i1 %24, label %25, label %28
25: ; preds = %22
%26 = load i32, i32* @LOG_ERR
%27 = call i32 @sys_err(i32 %26, i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str.1, i64 0, i64 0), i32 518, i32 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
br label %100
28: ; preds = %22
%29 = sub nuw nsw i32 32, %23
%30 = shl nsw i32 -1, %29
br label %67
31: ; preds = %4
%32 = load i32, i32* %9
%33 = icmp ugt i32 %32, 255
%34 = load i32, i32* %10
%35 = icmp ugt i32 %34, 255
%36 = select i1 %33, i1 true, i1 %35
%37 = load i32, i32* %11
%38 = icmp ugt i32 %37, 255
%39 = select i1 %36, i1 true, i1 %38
%40 = load i32, i32* %12
%41 = icmp ugt i32 %40, 255
%42 = select i1 %39, i1 true, i1 %41
br i1 %42, label %43, label %46
43: ; preds = %31
%44 = load i32, i32* @LOG_ERR
%45 = call i32 @sys_err(i32 %44, i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str.1, i64 0, i64 0), i32 525, i32 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
br label %100
46: ; preds = %31
%47 = shl nuw i32 %32, 24
%48 = shl nuw nsw i32 %34, 16
%49 = add nuw i32 %48, %47
%50 = shl nuw nsw i32 %37, 8
%51 = add nuw i32 %49, %50
%52 = add nuw i32 %51, %40
%53 = sub i32 0, %52
br label %54
54: ; preds = %54, %46
%55 = phi i32 [ 0, %46 ], [ %58, %54 ]
%56 = shl nuw i32 1, %55
%57 = icmp slt i32 %56, %53
%58 = add nuw nsw i32 %55, 1
br i1 %57, label %54, label %59
59: ; preds = %54
%60 = icmp eq i32 %56, %53
br i1 %60, label %67, label %61
61: ; preds = %59
%62 = load i32, i32* @LOG_ERR
%63 = call i32 @sys_err(i32 %62, i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str.1, i64 0, i64 0), i32 532, i32 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
br label %100
64: ; preds = %4
%65 = load i32, i32* @LOG_ERR
%66 = call i32 @sys_err(i32 %65, i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str.1, i64 0, i64 0), i32 538, i32 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
br label %100
67: ; preds = %59, %28
%68 = phi i32 [ %30, %28 ], [ %52, %59 ]
%69 = call i8* @htonl(i32 %68)
%70 = ptrtoint i8* %69 to i64
%71 = trunc i64 %70 to i32
br label %72
72: ; preds = %67, %4
%73 = phi i32 [ -1, %4 ], [ %71, %67 ]
%74 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %1, i64 0, i32 0
store i32 %73, i32* %74
%75 = load i32, i32* %5
%76 = icmp ugt i32 %75, 255
%77 = load i32, i32* %6
%78 = icmp ugt i32 %77, 255
%79 = select i1 %76, i1 true, i1 %78
%80 = load i32, i32* %7
%81 = icmp ugt i32 %80, 255
%82 = select i1 %79, i1 true, i1 %81
%83 = load i32, i32* %8
%84 = icmp ugt i32 %83, 255
%85 = select i1 %82, i1 true, i1 %84
br i1 %85, label %86, label %89
86: ; preds = %72
%87 = load i32, i32* @LOG_ERR
%88 = call i32 @sys_err(i32 %87, i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str.1, i64 0, i64 0), i32 543, i32 0, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
br label %100
89: ; preds = %72
%90 = shl nuw i32 %75, 24
%91 = shl nuw nsw i32 %77, 16
%92 = add nuw i32 %91, %90
%93 = shl nuw nsw i32 %80, 8
%94 = add nuw i32 %92, %93
%95 = add nuw i32 %94, %83
%96 = call i8* @htonl(i32 %95)
%97 = ptrtoint i8* %96 to i64
%98 = trunc i64 %97 to i32
%99 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %0, i64 0, i32 0
store i32 %98, i32* %99
br label %100
100: ; preds = %89, %86, %64, %61, %43, %25
%101 = phi i32 [ -1, %64 ], [ -1, %43 ], [ -1, %61 ], [ -1, %86 ], [ 0, %89 ], [ -1, %25 ]
ret i32 %101
}