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

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ ipv4fromstring(char *, unsigned char *);
int main(void) {
  unsigned char ip[4];
  ipv4fromstring("010.000.000.001", ip);
  do {
    if (!(ip[0] == 10 && ip[1] == 0 && ip[2] == 0 && ip[3] == 1))
      abort();
  } while (0);
  ipv4fromstring("128.010.020.031", ip);
  do {
    if (!(ip[0] == 128 && ip[1] == 10 && ip[2] == 20 && ip[3] == 31))
      abort();
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rsi
lea    0xec6(%rip),%rdi
call   1040 <ipv4fromstring@plt>
movzbl -0x8(%rbp),%eax
cmp    $0xa,%eax
jne    1173 <main+0x53>
movzbl -0x7(%rbp),%eax
cmp    $0x0,%eax
jne    1173 <main+0x53>
movzbl -0x6(%rbp),%eax
cmp    $0x0,%eax
jne    1173 <main+0x53>
movzbl -0x5(%rbp),%eax
cmp    $0x1,%eax
je     117a <main+0x5a>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    117f <main+0x5f>
lea    -0x8(%rbp),%rsi
lea    0xe86(%rip),%rdi
call   1040 <ipv4fromstring@plt>
movzbl -0x8(%rbp),%eax
cmp    $0x80,%eax
jne    11c5 <main+0xa5>
movzbl -0x7(%rbp),%eax
cmp    $0xa,%eax
jne    11c5 <main+0xa5>
movzbl -0x6(%rbp),%eax
cmp    $0x14,%eax
jne    11c5 <main+0xa5>
movzbl -0x5(%rbp),%eax
cmp    $0x1f,%eax
je     11cc <main+0xac>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    11d1 <main+0xb1>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <ipv4fromstring@plt>
movd   0x4(%rsp),%xmm0
movd   %xmm0,%eax
cmp    $0x100000a,%eax
jne    1169 <main+0x49>
lea    0xec6(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <ipv4fromstring@plt>
movd   0x4(%rsp),%xmm0
movd   %xmm0,%eax
cmp    $0x1f140a80,%eax
jne    1169 <main+0x49>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"010.000.000.001\00"
@.str.1 = [16 x i8] c"128.010.020.031\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%4 = call i32 @ipv4fromstring(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %3)
br label %5
5: ; preds = %0
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = icmp eq i32 %8, 10
br i1 %9, label %10, label %25
10: ; preds = %5
%11 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %25
15: ; preds = %10
%16 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 2
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %25
20: ; preds = %15
%21 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 3
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = icmp eq i32 %23, 1
br i1 %24, label %27, label %25
25: ; preds = %20, %15, %10, %5
%26 = call i32 (...) @abort()
unreachable
27: ; preds = %20
br label %28
28: ; preds = %27
%29 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%30 = call i32 @ipv4fromstring(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %29)
br label %31
31: ; preds = %28
%32 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%33 = load i8, i8* %32
%34 = zext i8 %33 to i32
%35 = icmp eq i32 %34, 128
br i1 %35, label %36, label %51
36: ; preds = %31
%37 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 1
%38 = load i8, i8* %37
%39 = zext i8 %38 to i32
%40 = icmp eq i32 %39, 10
br i1 %40, label %41, label %51
41: ; preds = %36
%42 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 2
%43 = load i8, i8* %42
%44 = zext i8 %43 to i32
%45 = icmp eq i32 %44, 20
br i1 %45, label %46, label %51
46: ; preds = %41
%47 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 3
%48 = load i8, i8* %47
%49 = zext i8 %48 to i32
%50 = icmp eq i32 %49, 31
br i1 %50, label %53, label %51
51: ; preds = %46, %41, %36, %31
%52 = call i32 (...) @abort()
unreachable
53: ; preds = %46
br label %54
54: ; preds = %53
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"010.000.000.001\00"
@.str.1 = [16 x i8] c"128.010.020.031\00"
define i32 @main() {
%1 = alloca <4 x i8>
%2 = getelementptr inbounds <4 x i8>, <4 x i8>* %1, i64 0, i64 0
%3 = call i32 @ipv4fromstring(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load <4 x i8>, <4 x i8>* %1
%5 = freeze <4 x i8> %4
%6 = bitcast <4 x i8> %5 to i32
%7 = icmp eq i32 %6, 16777226
br i1 %7, label %10, label %8
8: ; preds = %0
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %0
%11 = call i32 @ipv4fromstring(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%12 = load <4 x i8>, <4 x i8>* %1
%13 = freeze <4 x i8> %12
%14 = bitcast <4 x i8> %13 to i32
%15 = icmp eq i32 %14, 521407104
br i1 %15, label %18, label %16
16: ; preds = %10
%17 = call i32 (...) @abort()
unreachable
18: ; preds = %10
ret i32 0
}