#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*/ ipv4_bin_c(char *, char *);
int /*<<< orphan*/ ipv4_ipv6_c(char *, char *);
int /*<<< orphan*/ ipv6_bin_c(char *, char *);
int /*<<< orphan*/ ipv6_ipv4_c(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ valid_ipv4_c(char *, char *);
int /*<<< orphan*/ valid_ipv6_c(char *, char *);
int main() {
  char result[1024];
  valid_ipv4_c("245.67.88.129", result);
  printf("%s\n", result);
  result[0] = '\0';
  valid_ipv4_c("1.1.1.", result);
  printf("%s\n", result);
  result[0] = '\0';
  ipv4_ipv6_c("26.76.45.99", result);
  printf("%s\n", result);
  result[0] = '\0';
  ipv4_ipv6_c("12.155.278.75", result);
  printf("%s\n", result);
  result[0] = '\0';
  ipv4_bin_c("35.68.199.202", result);
  printf("%s\n", result);
  result[0] = '\0';
  ipv4_bin_c("97.67.133.29.1", result);
  printf("%s\n", result);
  result[0] = '\0';
  valid_ipv6_c("1::1", result);
  printf("%s\n", result);
  result[0] = '\0';
  valid_ipv6_c("5566:45FR:679A::", result);
  printf("%s\n", result);
  result[0] = '\0';
  ipv6_ipv4_c("2002::3456:5690", result);
  printf("%s\n", result);
  result[0] = '\0';
  ipv6_ipv4_c("::1::", result);
  printf("%s\n", result);
  result[0] = '\0';
  ipv6_bin_c("AB6D:4678:12FA::679B", result);
  printf("%s\n", result);
  result[0] = '\0';
  ipv6_bin_c("34FD::5720::5666", result);
  printf("%s\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x410(%rbp),%rsi
lea    0xe70(%rip),%rdi
call   1040 <valid_ipv4_c@plt>
lea    -0x410(%rbp),%rsi
lea    0xe6b(%rip),%rdi
call   1050 <printf@plt>
movb   $0x0,-0x410(%rbp)
lea    -0x410(%rbp),%rsi
lea    0xe55(%rip),%rdi
call   1040 <valid_ipv4_c@plt>
lea    -0x410(%rbp),%rsi
lea    0xe3e(%rip),%rdi
call   1050 <printf@plt>
movb   $0x0,-0x410(%rbp)
lea    -0x410(%rbp),%rsi
lea    0xe2f(%rip),%rdi
call   1060 <ipv4_ipv6_c@plt>
lea    -0x410(%rbp),%rsi
lea    0xe11(%rip),%rdi
call   1050 <printf@plt>
movb   $0x0,-0x410(%rbp)
lea    -0x410(%rbp),%rsi
lea    0xe0e(%rip),%rdi
call   1060 <ipv4_ipv6_c@plt>
lea    -0x410(%rbp),%rsi
lea    0xde4(%rip),%rdi
call   1050 <printf@plt>
movb   $0x0,-0x410(%rbp)
lea    -0x410(%rbp),%rsi
lea    0xdef(%rip),%rdi
call   1080 <ipv4_bin_c@plt>
lea    -0x410(%rbp),%rsi
lea    0xdb7(%rip),%rdi
call   1050 <printf@plt>
movb   $0x0,-0x410(%rbp)
lea    -0x410(%rbp),%rsi
lea    0xdd0(%rip),%rdi
call   1080 <ipv4_bin_c@plt>
lea    -0x410(%rbp),%rsi
lea    0xd8a(%rip),%rdi
call   1050 <printf@plt>
movb   $0x0,-0x410(%rbp)
lea    -0x410(%rbp),%rsi
lea    0xdb2(%rip),%rdi
call   1030 <valid_ipv6_c@plt>
lea    -0x410(%rbp),%rsi
lea    0xd5d(%rip),%rdi
call   1050 <printf@plt>
movb   $0x0,-0x410(%rbp)
lea    -0x410(%rbp),%rsi
lea    0xd8a(%rip),%rdi
call   1030 <valid_ipv6_c@plt>
lea    -0x410(%rbp),%rsi
lea    0xd30(%rip),%rdi
call   1050 <printf@plt>
movb   $0x0,-0x410(%rbp)
lea    -0x410(%rbp),%rsi
lea    0xd6e(%rip),%rdi
call   1070 <ipv6_ipv4_c@plt>
lea    -0x410(%rbp),%rsi
lea    0xd03(%rip),%rdi
call   1050 <printf@plt>
movb   $0x0,-0x410(%rbp)
lea    -0x410(%rbp),%rsi
lea    0xd51(%rip),%rdi
call   1070 <ipv6_ipv4_c@plt>
lea    -0x410(%rbp),%rsi
lea    0xcd6(%rip),%rdi
call   1050 <printf@plt>
movb   $0x0,-0x410(%rbp)
lea    -0x410(%rbp),%rsi
lea    0xd2a(%rip),%rdi
call   1090 <ipv6_bin_c@plt>
lea    -0x410(%rbp),%rsi
lea    0xca9(%rip),%rdi
call   1050 <printf@plt>
movb   $0x0,-0x410(%rbp)
lea    -0x410(%rbp),%rsi
lea    0xd12(%rip),%rdi
call   1090 <ipv6_bin_c@plt>
lea    -0x410(%rbp),%rsi
lea    0xc7c(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x408,%rsp
lea    0xe7f(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <valid_ipv4_c@plt>
lea    0xe7b(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
movb   $0x0,(%rsp)
lea    0xe69(%rip),%rdi
mov    %rbx,%rsi
call   1040 <valid_ipv4_c@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
movb   $0x0,(%rsp)
lea    0xe52(%rip),%rdi
mov    %rbx,%rsi
call   1060 <ipv4_ipv6_c@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
movb   $0x0,(%rsp)
lea    0xe40(%rip),%rdi
mov    %rbx,%rsi
call   1060 <ipv4_ipv6_c@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
movb   $0x0,(%rsp)
lea    0xe30(%rip),%rdi
mov    %rbx,%rsi
call   1080 <ipv4_bin_c@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
movb   $0x0,(%rsp)
lea    0xe20(%rip),%rdi
mov    %rbx,%rsi
call   1080 <ipv4_bin_c@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
movb   $0x0,(%rsp)
lea    0xe11(%rip),%rdi
mov    %rbx,%rsi
call   1030 <valid_ipv6_c@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
movb   $0x0,(%rsp)
lea    0xdf8(%rip),%rdi
mov    %rbx,%rsi
call   1030 <valid_ipv6_c@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
movb   $0x0,(%rsp)
lea    0xdeb(%rip),%rdi
mov    %rbx,%rsi
call   1070 <ipv6_ipv4_c@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
movb   $0x0,(%rsp)
lea    0xddd(%rip),%rdi
mov    %rbx,%rsi
call   1070 <ipv6_ipv4_c@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
movb   $0x0,(%rsp)
lea    0xdc5(%rip),%rdi
mov    %rbx,%rsi
call   1090 <ipv6_bin_c@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
movb   $0x0,(%rsp)
lea    0xdbc(%rip),%rdi
mov    %rbx,%rsi
call   1090 <ipv6_bin_c@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x408,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [14 x i8] c"245.67.88.129\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [7 x i8] c"1.1.1.\00"
@.str.3 = [12 x i8] c"26.76.45.99\00"
@.str.4 = [14 x i8] c"12.155.278.75\00"
@.str.5 = [14 x i8] c"35.68.199.202\00"
@.str.6 = [15 x i8] c"97.67.133.29.1\00"
@.str.7 = [5 x i8] c"1::1\00"
@.str.8 = [17 x i8] c"5566:45FR:679A::\00"
@.str.9 = [16 x i8] c"2002::3456:5690\00"
@.str.10 = [6 x i8] c"::1::\00"
@.str.11 = [21 x i8] c"AB6D:4678:12FA::679B\00"
@.str.12 = [17 x i8] c"34FD::5720::5666\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1024 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = call i32 @valid_ipv4_c(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
store i8 0, i8* %7
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%9 = call i32 @valid_ipv4_c(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %8)
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %10)
%12 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
store i8 0, i8* %12
%13 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%14 = call i32 @ipv4_ipv6_c(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i8* %13)
%15 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %15)
%17 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
store i8 0, i8* %17
%18 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%19 = call i32 @ipv4_ipv6_c(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i8* %18)
%20 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%21 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %20)
%22 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
store i8 0, i8* %22
%23 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%24 = call i32 @ipv4_bin_c(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i8* %23)
%25 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%26 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %25)
%27 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
store i8 0, i8* %27
%28 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%29 = call i32 @ipv4_bin_c(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), i8* %28)
%30 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%31 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %30)
%32 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
store i8 0, i8* %32
%33 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%34 = call i32 @valid_ipv6_c(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8* %33)
%35 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%36 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %35)
%37 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
store i8 0, i8* %37
%38 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%39 = call i32 @valid_ipv6_c(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.8, i64 0, i64 0), i8* %38)
%40 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%41 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %40)
%42 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
store i8 0, i8* %42
%43 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%44 = call i32 @ipv6_ipv4_c(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0), i8* %43)
%45 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%46 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %45)
%47 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
store i8 0, i8* %47
%48 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%49 = call i32 @ipv6_ipv4_c(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0), i8* %48)
%50 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%51 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %50)
%52 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
store i8 0, i8* %52
%53 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%54 = call i32 @ipv6_bin_c(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.11, i64 0, i64 0), i8* %53)
%55 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%56 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %55)
%57 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
store i8 0, i8* %57
%58 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%59 = call i32 @ipv6_bin_c(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.12, i64 0, i64 0), i8* %58)
%60 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%61 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %60)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"245.67.88.129\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [7 x i8] c"1.1.1.\00"
@.str.3 = [12 x i8] c"26.76.45.99\00"
@.str.4 = [14 x i8] c"12.155.278.75\00"
@.str.5 = [14 x i8] c"35.68.199.202\00"
@.str.6 = [15 x i8] c"97.67.133.29.1\00"
@.str.7 = [5 x i8] c"1::1\00"
@.str.8 = [17 x i8] c"5566:45FR:679A::\00"
@.str.9 = [16 x i8] c"2002::3456:5690\00"
@.str.10 = [6 x i8] c"::1::\00"
@.str.11 = [21 x i8] c"AB6D:4678:12FA::679B\00"
@.str.12 = [17 x i8] c"34FD::5720::5666\00"
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = call i32 @valid_ipv4_c(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
store i8 0, i8* %2
%5 = call i32 @valid_ipv4_c(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %2)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
store i8 0, i8* %2
%7 = call i32 @ipv4_ipv6_c(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i8* %2)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
store i8 0, i8* %2
%9 = call i32 @ipv4_ipv6_c(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i8* %2)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
store i8 0, i8* %2
%11 = call i32 @ipv4_bin_c(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i8* %2)
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
store i8 0, i8* %2
%13 = call i32 @ipv4_bin_c(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), i8* %2)
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
store i8 0, i8* %2
%15 = call i32 @valid_ipv6_c(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8* %2)
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
store i8 0, i8* %2
%17 = call i32 @valid_ipv6_c(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.8, i64 0, i64 0), i8* %2)
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
store i8 0, i8* %2
%19 = call i32 @ipv6_ipv4_c(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0), i8* %2)
%20 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
store i8 0, i8* %2
%21 = call i32 @ipv6_ipv4_c(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0), i8* %2)
%22 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
store i8 0, i8* %2
%23 = call i32 @ipv6_bin_c(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.11, i64 0, i64 0), i8* %2)
%24 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
store i8 0, i8* %2
%25 = call i32 @ipv6_bin_c(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.12, i64 0, i64 0), i8* %2)
%26 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}