#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 /*<<< orphan*/ s_addr;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ htonl(unsigned int);
int /*<<< orphan*/ printf(char *, ...);
int sscanf(char const *, char *, int *);
int strspn(char const *, char *);
int load_ip_address(const char *data, struct in_addr *addr) {
  int i, tmp;
  unsigned int ip;
  const char *pos;
  assert(data != NULL);
  assert(addr != NULL);
  pos = data;
  while (*pos == ' ' || *pos == '\t')
    pos++;
  ip = 0;
  for (i = 0;; i++) {
    if (sscanf(pos, "%d", &tmp) != 1) {
      printf("load_ip_address: Unable to parse IP byte "
             "from string '%s'\n",
             pos);
      return 0;
    }
    if (tmp > 255) {
      printf("load_ip_address: Invalid IP byte %d higher "
             "than 255\n",
             tmp);
      return 0;
    }
    if (tmp < 0) {
      printf("load_ip_address: Invalid IP byte %d lower "
             "than 0\n",
             tmp);
      return 0;
    }
    assert(tmp >= 0);
    assert(tmp <= 255);
    ip = (ip << 8) | tmp;
    pos = pos + strspn(pos, "0123456789");
    if (*pos == '\0' || *pos == ' ' || *pos == '\t') {
      if (i == 4 - 1)
        break;
      printf("load_ip_address: Separating dot not found\n");
      return 0;
    }
    if (*pos == '.') {
      if (i == 4 - 1) {
        printf("load_ip_address: Too many IP "
               "bytes, only %u expected\n",
               4);
        return 0;
      }
      pos++;
    } else {
      printf("load_ip_address: IP byte is not a number\n");
      return 0;
    }
  }
  addr->s_addr = htonl(ip);
  return 1;
}


x86 assembly (clang, -O0):
<load_ip_address>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
cmpq   $0x0,-0x18(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x31(%rbp)
je     11b1 <load_ip_address+0x61>
mov    -0x30(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x31(%rbp)
mov    -0x31(%rbp),%al
test   $0x1,%al
jne    11c1 <load_ip_address+0x71>
jmp    11d2 <load_ip_address+0x82>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    118c <load_ip_address+0x3c>
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x30(%rbp),%rdi
lea    0xe15(%rip),%rsi
lea    -0x20(%rbp),%rdx
call   1070 <sscanf@plt>
cmp    $0x1,%eax
je     121b <load_ip_address+0xcb>
mov    -0x30(%rbp),%rsi
lea    0xdfb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    13ac <load_ip_address+0x25c>
cmpl   $0xff,-0x20(%rbp)
jle    1245 <load_ip_address+0xf5>
mov    -0x20(%rbp),%esi
lea    0xe0c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    13ac <load_ip_address+0x25c>
cmpl   $0x0,-0x20(%rbp)
jge    126c <load_ip_address+0x11c>
mov    -0x20(%rbp),%esi
lea    0xe1a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    13ac <load_ip_address+0x25c>
cmpl   $0x0,-0x20(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
cmpl   $0xff,-0x20(%rbp)
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x24(%rbp),%eax
shl    $0x8,%eax
or     -0x20(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x30(%rbp),%rdi
lea    0xdf5(%rip),%rsi
call   1050 <strspn@plt>
mov    %eax,%ecx
mov    -0x40(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     12f5 <load_ip_address+0x1a5>
mov    -0x30(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     12f5 <load_ip_address+0x1a5>
mov    -0x30(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
jne    131e <load_ip_address+0x1ce>
cmpl   $0x3,-0x1c(%rbp)
jne    1304 <load_ip_address+0x1b4>
jmp    1395 <load_ip_address+0x245>
lea    0xda5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    13ac <load_ip_address+0x25c>
mov    -0x30(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    1368 <load_ip_address+0x218>
cmpl   $0x3,-0x1c(%rbp)
jne    1357 <load_ip_address+0x207>
lea    0xd9c(%rip),%rdi
mov    $0x4,%esi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    13ac <load_ip_address+0x25c>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    1382 <load_ip_address+0x232>
lea    0xda2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    13ac <load_ip_address+0x25c>
jmp    1387 <load_ip_address+0x237>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11e0 <load_ip_address+0x90>
mov    -0x24(%rbp),%edi
call   1040 <htonl@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<load_ip_address>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1070 <assert@plt>
xor    %edi,%edi
test   %r14,%r14
setne  %dil
call   1070 <assert@plt>
jmp    1194 <load_ip_address+0x34>
nop
add    $0x1,%rbx
movzbl (%rbx),%eax
cmp    $0x9,%al
je     1190 <load_ip_address+0x30>
cmp    $0x20,%al
je     1190 <load_ip_address+0x30>
lea    0xe5a(%rip),%rsi
lea    0x4(%rsp),%rdx
mov    %rbx,%rdi
call   1080 <sscanf@plt>
cmp    $0x1,%eax
jne    13f2 <load_ip_address+0x292>
mov    0x4(%rsp),%esi
cmp    $0xff,%esi
jle    11d4 <load_ip_address+0x74>
lea    0xe6f(%rip),%rdi
jmp    13e4 <load_ip_address+0x284>
test   %esi,%esi
js     13dd <load_ip_address+0x27d>
mov    $0x1,%edi
call   1070 <assert@plt>
xor    %edi,%edi
cmpl   $0x100,0x4(%rsp)
setl   %dil
call   1070 <assert@plt>
mov    0x4(%rsp),%r13d
lea    0xea0(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strspn@plt>
movslq %eax,%rbp
mov    (%rbx,%rbp,1),%al
cmp    $0x1f,%al
jg     1224 <load_ip_address+0xc4>
test   %al,%al
je     1230 <load_ip_address+0xd0>
cmp    $0x9,%al
je     1230 <load_ip_address+0xd0>
jmp    142e <load_ip_address+0x2ce>
cmp    $0x2e,%al
je     123c <load_ip_address+0xdc>
cmp    $0x20,%al
jne    142e <load_ip_address+0x2ce>
lea    0xed8(%rip),%rdi
jmp    1435 <load_ip_address+0x2d5>
lea    (%rbx,%rbp,1),%r12
add    $0x1,%r12
lea    0xdb5(%rip),%rsi
lea    0x4(%rsp),%rdx
mov    %r12,%rdi
call   1080 <sscanf@plt>
cmp    $0x1,%eax
jne    13ef <load_ip_address+0x28f>
mov    0x4(%rsp),%esi
cmp    $0xff,%esi
jg     11c8 <load_ip_address+0x68>
test   %esi,%esi
js     13dd <load_ip_address+0x27d>
mov    $0x1,%edi
call   1070 <assert@plt>
xor    %edi,%edi
cmpl   $0x100,0x4(%rsp)
setl   %dil
call   1070 <assert@plt>
mov    0x4(%rsp),%r15d
lea    0xe03(%rip),%rsi
mov    %r12,%rdi
call   1060 <strspn@plt>
cltq
add    %rax,%rbp
mov    0x1(%rbx,%rbp,1),%al
cmp    $0x1f,%al
jle    1217 <load_ip_address+0xb7>
cmp    $0x20,%al
je     1230 <load_ip_address+0xd0>
cmp    $0x2e,%al
jne    142e <load_ip_address+0x2ce>
lea    (%rbx,%rbp,1),%r12
add    $0x2,%r12
lea    0xd26(%rip),%rsi
lea    0x4(%rsp),%rdx
mov    %r12,%rdi
call   1080 <sscanf@plt>
cmp    $0x1,%eax
jne    13ef <load_ip_address+0x28f>
mov    0x4(%rsp),%esi
cmp    $0xff,%esi
jg     11c8 <load_ip_address+0x68>
test   %esi,%esi
js     13dd <load_ip_address+0x27d>
mov    $0x1,%edi
call   1070 <assert@plt>
xor    %edi,%edi
cmpl   $0x100,0x4(%rsp)
setl   %dil
call   1070 <assert@plt>
shl    $0x10,%r13d
shl    $0x8,%r15d
or     %r13d,%r15d
or     0x4(%rsp),%r15d
lea    0xd69(%rip),%rsi
mov    %r12,%rdi
call   1060 <strspn@plt>
cltq
add    %rax,%rbp
mov    0x2(%rbx,%rbp,1),%al
cmp    $0x1f,%al
jle    1217 <load_ip_address+0xb7>
cmp    $0x20,%al
je     1230 <load_ip_address+0xd0>
cmp    $0x2e,%al
jne    142e <load_ip_address+0x2ce>
lea    (%rbx,%rbp,1),%r12
add    $0x3,%r12
lea    0xc8c(%rip),%rsi
lea    0x4(%rsp),%rdx
mov    %r12,%rdi
call   1080 <sscanf@plt>
cmp    $0x1,%eax
jne    13ef <load_ip_address+0x28f>
mov    0x4(%rsp),%esi
cmp    $0xff,%esi
jg     11c8 <load_ip_address+0x68>
test   %esi,%esi
js     13dd <load_ip_address+0x27d>
mov    $0x1,%edi
call   1070 <assert@plt>
xor    %edi,%edi
cmpl   $0x100,0x4(%rsp)
setl   %dil
call   1070 <assert@plt>
lea    0xce7(%rip),%rsi
mov    %r12,%rdi
call   1060 <strspn@plt>
cltq
add    %rax,%rbp
mov    0x3(%rbx,%rbp,1),%al
cmp    $0x1f,%al
jg     1416 <load_ip_address+0x2b6>
test   %al,%al
je     143e <load_ip_address+0x2de>
cmp    $0x9,%al
je     143e <load_ip_address+0x2de>
jmp    142e <load_ip_address+0x2ce>
lea    0xc8f(%rip),%rdi
xor    %ebp,%ebp
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1405 <load_ip_address+0x2a5>
mov    %r12,%rbx
lea    0xc0a(%rip),%rdi
xor    %ebp,%ebp
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
cmp    $0x20,%al
je     143e <load_ip_address+0x2de>
cmp    $0x2e,%al
jne    142e <load_ip_address+0x2ce>
lea    0xc8b(%rip),%rdi
xor    %ebp,%ebp
mov    $0x4,%esi
jmp    13e6 <load_ip_address+0x286>
lea    0xcb1(%rip),%rdi
call   1030 <puts@plt>
xor    %ebp,%ebp
jmp    1405 <load_ip_address+0x2a5>
shl    $0x8,%r15d
or     0x4(%rsp),%r15d
mov    %r15d,%edi
call   1050 <htonl@plt>
mov    %eax,(%r14)
mov    $0x1,%ebp
jmp    1405 <load_ip_address+0x2a5>

LLVM IR (-O0):
%struct.in_addr = type { i32 }
@.str = [3 x i8] c"%d\00"
@.str.1 = [59 x i8] c"load_ip_address: Unable to parse IP byte from string '%s'\0A\00"
@.str.2 = [53 x i8] c"load_ip_address: Invalid IP byte %d higher than 255\0A\00"
@.str.3 = [50 x i8] c"load_ip_address: Invalid IP byte %d lower than 0\0A\00"
@.str.4 = [11 x i8] c"0123456789\00"
@.str.5 = [43 x i8] c"load_ip_address: Separating dot not found\0A\00"
@.str.6 = [54 x i8] c"load_ip_address: Too many IP bytes, only %u expected\0A\00"
@.str.7 = [42 x i8] c"load_ip_address: IP byte is not a number\0A\00"
define i32 @load_ip_address(i8* %0, %struct.in_addr* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca %struct.in_addr*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
store i8* %0, i8** %4
store %struct.in_addr* %1, %struct.in_addr** %5
%10 = load i8*, i8** %4
%11 = icmp ne i8* %10, null
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load %struct.in_addr*, %struct.in_addr** %5
%15 = icmp ne %struct.in_addr* %14, null
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
%18 = load i8*, i8** %4
store i8* %18, i8** %9
br label %19
19: ; preds = %31, %2
%20 = load i8*, i8** %9
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = icmp eq i32 %22, 32
br i1 %23, label %29, label %24
24: ; preds = %19
%25 = load i8*, i8** %9
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = icmp eq i32 %27, 9
br label %29
29: ; preds = %24, %19
%30 = phi i1 [ true, %19 ], [ %28, %24 ]
br i1 %30, label %31, label %34
31: ; preds = %29
%32 = load i8*, i8** %9
%33 = getelementptr inbounds i8, i8* %32, i32 1
store i8* %33, i8** %9
br label %19
34: ; preds = %29
store i32 0, i32* %8
store i32 0, i32* %6
br label %35
35: ; preds = %108, %34
%36 = load i8*, i8** %9
%37 = call i32 @sscanf(i8* %36, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %7)
%38 = icmp ne i32 %37, 1
br i1 %38, label %39, label %42
39: ; preds = %35
%40 = load i8*, i8** %9
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.1, i64 0, i64 0), i8* %40)
store i32 0, i32* %3
br label %116
42: ; preds = %35
%43 = load i32, i32* %7
%44 = icmp sgt i32 %43, 255
br i1 %44, label %45, label %48
45: ; preds = %42
%46 = load i32, i32* %7
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0), i32 %46)
store i32 0, i32* %3
br label %116
48: ; preds = %42
%49 = load i32, i32* %7
%50 = icmp slt i32 %49, 0
br i1 %50, label %51, label %54
51: ; preds = %48
%52 = load i32, i32* %7
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.3, i64 0, i64 0), i32 %52)
store i32 0, i32* %3
br label %116
54: ; preds = %48
%55 = load i32, i32* %7
%56 = icmp sge i32 %55, 0
%57 = zext i1 %56 to i32
%58 = call i32 @assert(i32 %57)
%59 = load i32, i32* %7
%60 = icmp sle i32 %59, 255
%61 = zext i1 %60 to i32
%62 = call i32 @assert(i32 %61)
%63 = load i32, i32* %8
%64 = shl i32 %63, 8
%65 = load i32, i32* %7
%66 = or i32 %64, %65
store i32 %66, i32* %8
%67 = load i8*, i8** %9
%68 = load i8*, i8** %9
%69 = call i32 @strspn(i8* %68, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds i8, i8* %67, i64 %70
store i8* %71, i8** %9
%72 = load i8*, i8** %9
%73 = load i8, i8* %72
%74 = sext i8 %73 to i32
%75 = icmp eq i32 %74, 0
br i1 %75, label %86, label %76
76: ; preds = %54
%77 = load i8*, i8** %9
%78 = load i8, i8* %77
%79 = sext i8 %78 to i32
%80 = icmp eq i32 %79, 32
br i1 %80, label %86, label %81
81: ; preds = %76
%82 = load i8*, i8** %9
%83 = load i8, i8* %82
%84 = sext i8 %83 to i32
%85 = icmp eq i32 %84, 9
br i1 %85, label %86, label %92
86: ; preds = %81, %76, %54
%87 = load i32, i32* %6
%88 = icmp eq i32 %87, 3
br i1 %88, label %89, label %90
89: ; preds = %86
br label %111
90: ; preds = %86
%91 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %3
br label %116
92: ; preds = %81
%93 = load i8*, i8** %9
%94 = load i8, i8* %93
%95 = sext i8 %94 to i32
%96 = icmp eq i32 %95, 46
br i1 %96, label %97, label %105
97: ; preds = %92
%98 = load i32, i32* %6
%99 = icmp eq i32 %98, 3
br i1 %99, label %100, label %102
100: ; preds = %97
%101 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.6, i64 0, i64 0), i32 4)
store i32 0, i32* %3
br label %116
102: ; preds = %97
%103 = load i8*, i8** %9
%104 = getelementptr inbounds i8, i8* %103, i32 1
store i8* %104, i8** %9
br label %107
105: ; preds = %92
%106 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.7, i64 0, i64 0))
store i32 0, i32* %3
br label %116
107: ; preds = %102
br label %108
108: ; preds = %107
%109 = load i32, i32* %6
%110 = add nsw i32 %109, 1
store i32 %110, i32* %6
br label %35
111: ; preds = %89
%112 = load i32, i32* %8
%113 = call i32 @htonl(i32 %112)
%114 = load %struct.in_addr*, %struct.in_addr** %5
%115 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %114, i32 0, i32 0
store i32 %113, i32* %115
store i32 1, i32* %3
br label %116
116: ; preds = %111, %105, %100, %90, %51, %45, %39
%117 = load i32, i32* %3
ret i32 %117
}

LLVM IR (-O2):
%struct.in_addr = type { i32 }
@.str = [3 x i8] c"%d\00"
@.str.1 = [59 x i8] c"load_ip_address: Unable to parse IP byte from string '%s'\0A\00"
@.str.2 = [53 x i8] c"load_ip_address: Invalid IP byte %d higher than 255\0A\00"
@.str.3 = [50 x i8] c"load_ip_address: Invalid IP byte %d lower than 0\0A\00"
@.str.4 = [11 x i8] c"0123456789\00"
@.str.6 = [54 x i8] c"load_ip_address: Too many IP bytes, only %u expected\0A\00"
@str = [41 x i8] c"load_ip_address: IP byte is not a number\00"
@str.8 = [42 x i8] c"load_ip_address: Separating dot not found\00"
define i32 @load_ip_address(i8* %0, %struct.in_addr* writeonly %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = icmp ne i8* %0, null
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = icmp ne %struct.in_addr* %1, null
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
br label %11
11: ; preds = %20, %2
%12 = phi i8* [ %0, %2 ], [ %21, %20 ]
%13 = load i8, i8* %12
switch i8 %13, label %14 [
i8 32, label %20
i8 9, label %20
]
14: ; preds = %11
%15 = call i32 @sscanf(i8* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%16 = icmp eq i32 %15, 1
br i1 %16, label %17, label %22
17: ; preds = %14
%18 = load i32, i32* %3
%19 = icmp sgt i32 %18, 255
br i1 %19, label %25, label %28
20: ; preds = %11, %11
%21 = getelementptr inbounds i8, i8* %12, i64 1
br label %11
22: ; preds = %46, %68, %92, %14
%23 = phi i8* [ %12, %14 ], [ %47, %46 ], [ %69, %68 ], [ %93, %92 ]
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @.str.1, i64 0, i64 0), i8* %23)
br label %119
25: ; preds = %96, %72, %52, %17
%26 = phi i32 [ %18, %17 ], [ %53, %52 ], [ %73, %72 ], [ %97, %96 ]
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0), i32 %26)
br label %119
28: ; preds = %17
%29 = icmp slt i32 %18, 0
br i1 %29, label %30, label %33
30: ; preds = %99, %75, %55, %28
%31 = phi i32 [ %18, %28 ], [ %53, %55 ], [ %73, %75 ], [ %97, %99 ]
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.3, i64 0, i64 0), i32 %31)
br label %119
33: ; preds = %28
%34 = call i32 @assert(i32 1)
%35 = load i32, i32* %3
%36 = icmp slt i32 %35, 256
%37 = zext i1 %36 to i32
%38 = call i32 @assert(i32 %37)
%39 = load i32, i32* %3
%40 = call i32 @strspn(i8* %12, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds i8, i8* %12, i64 %41
%43 = load i8, i8* %42
switch i8 %43, label %111 [
i8 0, label %44
i8 32, label %44
i8 9, label %44
i8 46, label %46
]
44: ; preds = %33, %33, %33, %57, %57, %57, %77, %77, %77
%45 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.8, i64 0, i64 0))
br label %119
46: ; preds = %33
%47 = getelementptr inbounds i8, i8* %42, i64 1
%48 = call i32 @sscanf(i8* %47, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%49 = icmp eq i32 %48, 1
br i1 %49, label %52, label %22
50: ; preds = %101
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.6, i64 0, i64 0), i32 4)
br label %119
52: ; preds = %46
%53 = load i32, i32* %3
%54 = icmp sgt i32 %53, 255
br i1 %54, label %25, label %55
55: ; preds = %52
%56 = icmp slt i32 %53, 0
br i1 %56, label %30, label %57
57: ; preds = %55
%58 = call i32 @assert(i32 1)
%59 = load i32, i32* %3
%60 = icmp slt i32 %59, 256
%61 = zext i1 %60 to i32
%62 = call i32 @assert(i32 %61)
%63 = load i32, i32* %3
%64 = call i32 @strspn(i8* %47, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds i8, i8* %47, i64 %65
%67 = load i8, i8* %66
switch i8 %67, label %111 [
i8 0, label %44
i8 32, label %44
i8 9, label %44
i8 46, label %68
]
68: ; preds = %57
%69 = getelementptr inbounds i8, i8* %66, i64 1
%70 = call i32 @sscanf(i8* %69, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%71 = icmp eq i32 %70, 1
br i1 %71, label %72, label %22
72: ; preds = %68
%73 = load i32, i32* %3
%74 = icmp sgt i32 %73, 255
br i1 %74, label %25, label %75
75: ; preds = %72
%76 = icmp slt i32 %73, 0
br i1 %76, label %30, label %77
77: ; preds = %75
%78 = call i32 @assert(i32 1)
%79 = load i32, i32* %3
%80 = icmp slt i32 %79, 256
%81 = zext i1 %80 to i32
%82 = call i32 @assert(i32 %81)
%83 = shl i32 %39, 16
%84 = shl i32 %63, 8
%85 = or i32 %83, %84
%86 = load i32, i32* %3
%87 = or i32 %86, %85
%88 = call i32 @strspn(i8* %69, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds i8, i8* %69, i64 %89
%91 = load i8, i8* %90
switch i8 %91, label %111 [
i8 0, label %44
i8 32, label %44
i8 9, label %44
i8 46, label %92
]
92: ; preds = %77
%93 = getelementptr inbounds i8, i8* %90, i64 1
%94 = call i32 @sscanf(i8* %93, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%95 = icmp eq i32 %94, 1
br i1 %95, label %96, label %22
96: ; preds = %92
%97 = load i32, i32* %3
%98 = icmp sgt i32 %97, 255
br i1 %98, label %25, label %99
99: ; preds = %96
%100 = icmp slt i32 %97, 0
br i1 %100, label %30, label %101
101: ; preds = %99
%102 = call i32 @assert(i32 1)
%103 = load i32, i32* %3
%104 = icmp slt i32 %103, 256
%105 = zext i1 %104 to i32
%106 = call i32 @assert(i32 %105)
%107 = call i32 @strspn(i8* %93, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds i8, i8* %93, i64 %108
%110 = load i8, i8* %109
switch i8 %110, label %111 [
i8 0, label %113
i8 32, label %113
i8 9, label %113
i8 46, label %50
]
111: ; preds = %101, %77, %57, %33
%112 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
br label %119
113: ; preds = %101, %101, %101
%114 = load i32, i32* %3
%115 = shl i32 %87, 8
%116 = or i32 %114, %115
%117 = call i32 @htonl(i32 %116)
%118 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %1, i64 0, i32 0
store i32 %117, i32* %118
br label %119
119: ; preds = %113, %111, %50, %44, %30, %25, %22
%120 = phi i32 [ 0, %22 ], [ 0, %25 ], [ 0, %30 ], [ 1, %113 ], [ 0, %44 ], [ 0, %50 ], [ 0, %111 ]
ret i32 %120
}