#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*/ CIDR2Network(char *);
int /*<<< orphan*/ Calculate_NetBroacastAdd(char *, char *, char *);
int /*<<< orphan*/ Network2CIDR(char *, char *);
int /*<<< orphan*/ checkip(char *, char *, char *);
int main() {
  char CIDR[30] = "10.39.65.1/22";
  char Net[30] = "10.39.65.1";
  char Mask[30] = "255.255.252.0";
  char BroadcastAdr[30] = "";
  char IP1[30] = "10.39.44.11";
  char IP2[30] = "10.39.63.255";
  char IP3[30] = "10.39.64.0";
  char IP4[30] = "10.39.66.11";
  char IP5[30] = "10.39.67.255";
  char IP6[30] = "10.39.68.0";
  CIDR2Network(CIDR);
  Network2CIDR(Net, Mask);
  Calculate_NetBroacastAdd(Net, Mask, BroadcastAdr);
  checkip(IP1, Net, Mask);
  checkip(IP2, Net, Mask);
  checkip(IP3, Net, Mask);
  checkip(IP4, Net, Mask);
  checkip(IP5, Net, Mask);
  checkip(IP6, Net, Mask);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x150,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xe97(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xe94(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xe91(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xe8f(%rip),%eax
mov    %eax,-0x18(%rbp)
mov    0xe89(%rip),%ax
mov    %ax,-0x14(%rbp)
mov    0xe82(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xe7f(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xe7c(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xe7a(%rip),%eax
mov    %eax,-0x38(%rbp)
mov    0xe74(%rip),%ax
mov    %ax,-0x34(%rbp)
mov    0xe6d(%rip),%rax
mov    %rax,-0x70(%rbp)
mov    0xe6a(%rip),%rax
mov    %rax,-0x68(%rbp)
mov    0xe67(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0xe65(%rip),%eax
mov    %eax,-0x58(%rbp)
mov    0xe5f(%rip),%ax
mov    %ax,-0x54(%rbp)
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x1e,%edx
call   1060 <memset@plt>
mov    0xe45(%rip),%rax
mov    %rax,-0xb0(%rbp)
mov    0xe3f(%rip),%rax
mov    %rax,-0xa8(%rbp)
mov    0xe39(%rip),%rax
mov    %rax,-0xa0(%rbp)
mov    0xe34(%rip),%eax
mov    %eax,-0x98(%rbp)
mov    0xe2b(%rip),%ax
mov    %ax,-0x94(%rbp)
mov    0xe21(%rip),%rax
mov    %rax,-0xd0(%rbp)
mov    0xe1b(%rip),%rax
mov    %rax,-0xc8(%rbp)
mov    0xe15(%rip),%rax
mov    %rax,-0xc0(%rbp)
mov    0xe10(%rip),%eax
mov    %eax,-0xb8(%rbp)
mov    0xe07(%rip),%ax
mov    %ax,-0xb4(%rbp)
mov    0xdfd(%rip),%rax
mov    %rax,-0xf0(%rbp)
mov    0xdf7(%rip),%rax
mov    %rax,-0xe8(%rbp)
mov    0xdf1(%rip),%rax
mov    %rax,-0xe0(%rbp)
mov    0xdec(%rip),%eax
mov    %eax,-0xd8(%rbp)
mov    0xde3(%rip),%ax
mov    %ax,-0xd4(%rbp)
mov    0xdd9(%rip),%rax
mov    %rax,-0x110(%rbp)
mov    0xdd3(%rip),%rax
mov    %rax,-0x108(%rbp)
mov    0xdcd(%rip),%rax
mov    %rax,-0x100(%rbp)
mov    0xdc8(%rip),%eax
mov    %eax,-0xf8(%rbp)
mov    0xdbf(%rip),%ax
mov    %ax,-0xf4(%rbp)
mov    0xdb5(%rip),%rax
mov    %rax,-0x130(%rbp)
mov    0xdaf(%rip),%rax
mov    %rax,-0x128(%rbp)
mov    0xda9(%rip),%rax
mov    %rax,-0x120(%rbp)
mov    0xda4(%rip),%eax
mov    %eax,-0x118(%rbp)
mov    0xd9b(%rip),%ax
mov    %ax,-0x114(%rbp)
mov    0xd91(%rip),%rax
mov    %rax,-0x150(%rbp)
mov    0xd8b(%rip),%rax
mov    %rax,-0x148(%rbp)
mov    0xd85(%rip),%rax
mov    %rax,-0x140(%rbp)
mov    0xd80(%rip),%eax
mov    %eax,-0x138(%rbp)
mov    0xd77(%rip),%ax
mov    %ax,-0x134(%rbp)
lea    -0x30(%rbp),%rdi
call   1050 <CIDR2Network@plt>
lea    -0x50(%rbp),%rdi
lea    -0x70(%rbp),%rsi
call   1070 <Network2CIDR@plt>
lea    -0x50(%rbp),%rdi
lea    -0x70(%rbp),%rsi
lea    -0x90(%rbp),%rdx
call   1040 <Calculate_NetBroacastAdd@plt>
lea    -0xb0(%rbp),%rdi
lea    -0x50(%rbp),%rsi
lea    -0x70(%rbp),%rdx
call   1030 <checkip@plt>
lea    -0xd0(%rbp),%rdi
lea    -0x50(%rbp),%rsi
lea    -0x70(%rbp),%rdx
call   1030 <checkip@plt>
lea    -0xf0(%rbp),%rdi
lea    -0x50(%rbp),%rsi
lea    -0x70(%rbp),%rdx
call   1030 <checkip@plt>
lea    -0x110(%rbp),%rdi
lea    -0x50(%rbp),%rsi
lea    -0x70(%rbp),%rdx
call   1030 <checkip@plt>
lea    -0x130(%rbp),%rdi
lea    -0x50(%rbp),%rsi
lea    -0x70(%rbp),%rdx
call   1030 <checkip@plt>
lea    -0x150(%rbp),%rdi
lea    -0x50(%rbp),%rsi
lea    -0x70(%rbp),%rdx
call   1030 <checkip@plt>
xor    %eax,%eax
add    $0x150,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x148,%rsp
movups 0xebd(%rip),%xmm0
movups %xmm0,0x12e(%rsp)
movaps 0xea0(%rip),%xmm0
movaps %xmm0,0x120(%rsp)
movups 0xebf(%rip),%xmm0
movups %xmm0,0x10e(%rsp)
movaps 0xea2(%rip),%xmm0
movaps %xmm0,0x100(%rsp)
movups 0xec1(%rip),%xmm0
movups %xmm0,0xee(%rsp)
movaps 0xea4(%rip),%xmm0
movaps %xmm0,0xe0(%rsp)
xorps  %xmm0,%xmm0
movups %xmm0,0xce(%rsp)
movaps %xmm0,0xc0(%rsp)
movups 0xeb0(%rip),%xmm0
movups %xmm0,0xae(%rsp)
movaps 0xe93(%rip),%xmm0
movaps %xmm0,0xa0(%rsp)
movups 0xeb2(%rip),%xmm0
movups %xmm0,0x8e(%rsp)
movaps 0xe95(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movups 0xeb4(%rip),%xmm0
movups %xmm0,0x6e(%rsp)
movaps 0xe9a(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movups 0xebc(%rip),%xmm0
movups %xmm0,0x4e(%rsp)
movaps 0xea2(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movups 0xec4(%rip),%xmm0
movups %xmm0,0x2e(%rsp)
movaps 0xeaa(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movups 0xecc(%rip),%xmm0
movups %xmm0,0xe(%rsp)
movaps 0xeb2(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x120(%rsp),%rdi
call   1050 <CIDR2Network@plt>
lea    0x100(%rsp),%rbx
lea    0xe0(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <Network2CIDR@plt>
lea    0xc0(%rsp),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <Calculate_NetBroacastAdd@plt>
lea    0xa0(%rsp),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <checkip@plt>
lea    0x80(%rsp),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <checkip@plt>
lea    0x60(%rsp),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <checkip@plt>
lea    0x40(%rsp),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <checkip@plt>
lea    0x20(%rsp),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <checkip@plt>
mov    %rsp,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <checkip@plt>
xor    %eax,%eax
add    $0x148,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.CIDR = [30 x i8] c"10.39.65.1/22\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.Net = [30 x i8] c"10.39.65.1\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.Mask = [30 x i8] c"255.255.252.0\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.IP1 = [30 x i8] c"10.39.44.11\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.IP2 = [30 x i8] c"10.39.63.255\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.IP3 = [30 x i8] c"10.39.64.0\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.IP4 = [30 x i8] c"10.39.66.11\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.IP5 = [30 x i8] c"10.39.67.255\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.IP6 = [30 x i8] c"10.39.68.0\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [30 x i8]
%3 = alloca [30 x i8]
%4 = alloca [30 x i8]
%5 = alloca [30 x i8]
%6 = alloca [30 x i8]
%7 = alloca [30 x i8]
%8 = alloca [30 x i8]
%9 = alloca [30 x i8]
%10 = alloca [30 x i8]
%11 = alloca [30 x i8]
store i32 0, i32* %1
%12 = bitcast [30 x i8]* %2 to i8*
%13 = bitcast [30 x i8]* %3 to i8*
%14 = bitcast [30 x i8]* %4 to i8*
%15 = bitcast [30 x i8]* %5 to i8*
%16 = bitcast [30 x i8]* %6 to i8*
%17 = bitcast [30 x i8]* %7 to i8*
%18 = bitcast [30 x i8]* %8 to i8*
%19 = bitcast [30 x i8]* %9 to i8*
%20 = bitcast [30 x i8]* %10 to i8*
%21 = bitcast [30 x i8]* %11 to i8*
%22 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%23 = call i32 @CIDR2Network(i8* %22)
%24 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%25 = getelementptr inbounds [30 x i8], [30 x i8]* %4, i64 0, i64 0
%26 = call i32 @Network2CIDR(i8* %24, i8* %25)
%27 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%28 = getelementptr inbounds [30 x i8], [30 x i8]* %4, i64 0, i64 0
%29 = getelementptr inbounds [30 x i8], [30 x i8]* %5, i64 0, i64 0
%30 = call i32 @Calculate_NetBroacastAdd(i8* %27, i8* %28, i8* %29)
%31 = getelementptr inbounds [30 x i8], [30 x i8]* %6, i64 0, i64 0
%32 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%33 = getelementptr inbounds [30 x i8], [30 x i8]* %4, i64 0, i64 0
%34 = call i32 @checkip(i8* %31, i8* %32, i8* %33)
%35 = getelementptr inbounds [30 x i8], [30 x i8]* %7, i64 0, i64 0
%36 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%37 = getelementptr inbounds [30 x i8], [30 x i8]* %4, i64 0, i64 0
%38 = call i32 @checkip(i8* %35, i8* %36, i8* %37)
%39 = getelementptr inbounds [30 x i8], [30 x i8]* %8, i64 0, i64 0
%40 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%41 = getelementptr inbounds [30 x i8], [30 x i8]* %4, i64 0, i64 0
%42 = call i32 @checkip(i8* %39, i8* %40, i8* %41)
%43 = getelementptr inbounds [30 x i8], [30 x i8]* %9, i64 0, i64 0
%44 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%45 = getelementptr inbounds [30 x i8], [30 x i8]* %4, i64 0, i64 0
%46 = call i32 @checkip(i8* %43, i8* %44, i8* %45)
%47 = getelementptr inbounds [30 x i8], [30 x i8]* %10, i64 0, i64 0
%48 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%49 = getelementptr inbounds [30 x i8], [30 x i8]* %4, i64 0, i64 0
%50 = call i32 @checkip(i8* %47, i8* %48, i8* %49)
%51 = getelementptr inbounds [30 x i8], [30 x i8]* %11, i64 0, i64 0
%52 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%53 = getelementptr inbounds [30 x i8], [30 x i8]* %4, i64 0, i64 0
%54 = call i32 @checkip(i8* %51, i8* %52, i8* %53)
ret i32 0
}

LLVM IR (-O2):
@__const.main.CIDR = [30 x i8] c"10.39.65.1/22\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.Net = [30 x i8] c"10.39.65.1\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.Mask = [30 x i8] c"255.255.252.0\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.IP1 = [30 x i8] c"10.39.44.11\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.IP2 = [30 x i8] c"10.39.63.255\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.IP3 = [30 x i8] c"10.39.64.0\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.IP4 = [30 x i8] c"10.39.66.11\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.IP5 = [30 x i8] c"10.39.67.255\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.IP6 = [30 x i8] c"10.39.68.0\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
define i32 @main() {
%1 = alloca [30 x i8]
%2 = alloca [30 x i8]
%3 = alloca [30 x i8]
%4 = alloca [30 x i8]
%5 = alloca [30 x i8]
%6 = alloca [30 x i8]
%7 = alloca [30 x i8]
%8 = alloca [30 x i8]
%9 = alloca [30 x i8]
%10 = alloca [30 x i8]
%11 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%12 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%13 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%14 = getelementptr inbounds [30 x i8], [30 x i8]* %4, i64 0, i64 0
%15 = getelementptr inbounds [30 x i8], [30 x i8]* %5, i64 0, i64 0
%16 = getelementptr inbounds [30 x i8], [30 x i8]* %6, i64 0, i64 0
%17 = getelementptr inbounds [30 x i8], [30 x i8]* %7, i64 0, i64 0
%18 = getelementptr inbounds [30 x i8], [30 x i8]* %8, i64 0, i64 0
%19 = getelementptr inbounds [30 x i8], [30 x i8]* %9, i64 0, i64 0
%20 = getelementptr inbounds [30 x i8], [30 x i8]* %10, i64 0, i64 0
%21 = call i32 @CIDR2Network(i8* %11)
%22 = call i32 @Network2CIDR(i8* %12, i8* %13)
%23 = call i32 @Calculate_NetBroacastAdd(i8* %12, i8* %13, i8* %14)
%24 = call i32 @checkip(i8* %15, i8* %12, i8* %13)
%25 = call i32 @checkip(i8* %16, i8* %12, i8* %13)
%26 = call i32 @checkip(i8* %17, i8* %12, i8* %13)
%27 = call i32 @checkip(i8* %18, i8* %12, i8* %13)
%28 = call i32 @checkip(i8* %19, i8* %12, i8* %13)
%29 = call i32 @checkip(i8* %20, i8* %12, i8* %13)
ret i32 0
}