int main(int argc, char **argv) {
  int count, correctAnswers = 0;
  int ip[4], subnet[4];
  int tmpsubnet[13][2] = {{0, 0},    {128, 0},   {192, 0},   {224, 0},
                          {240, 0},  {248, 0},   {252, 0},   {254, 0},
                          {255, 0},  {255, 128}, {255, 192}, {255, 224},
                          {255, 240}};
  int tmpsubnet2[13][2] = {{255, 255}, {127, 255}, {63, 255}, {31, 255},
                           {15, 255},  {7, 255},   {3, 255},  {1, 255},
                           {0, 255},   {0, 127},   {0, 63},   {0, 31},
                           {0, 15}};
  int usrNetwork[4], usrBcast[4], ansNetwork[4], ansBcast[4];
  int flag, tmp;
  srand(time(0));
  subnet[0] = 255;
  subnet[1] = 255;
  for (count = 0; count < 4; count++) {
    flag = 0;
    ip[0] = rand() % 255;
    ip[1] = rand() % 255;
    ip[2] = rand() % 255;
    ip[3] = rand() % 255;
    tmp = rand() % 13;
    subnet[2] = tmpsubnet[tmp][0];
    subnet[3] = tmpsubnet[tmp][1];
    printf("IP address : %d.%d.%d.%d\n", ip[0], ip[1], ip[2], ip[3]);
    printf("Subnet mask: %d.%d.%d.%d\n", subnet[0], subnet[1], subnet[2],
           subnet[3]);
    printf("Network address: ");
    scanf("%d.%d.%d.%d", &usrNetwork[0], &usrNetwork[1], &usrNetwork[2],
          &usrNetwork[3]);
    printf("Broadcast address: ");
    scanf("%d.%d.%d.%d", &usrBcast[0], &usrBcast[1], &usrBcast[2],
          &usrBcast[3]);
    ansNetwork[0] = ip[0] & subnet[0];
    ansNetwork[1] = ip[1] & subnet[1];
    ansNetwork[2] = ip[2] & subnet[2];
    ansNetwork[3] = ip[3] & subnet[3];
    if ((usrNetwork[0] == ansNetwork[0]) && (usrNetwork[1] == ansNetwork[1]) &&
        (usrNetwork[2] == ansNetwork[2]) && (usrNetwork[3] == ansNetwork[3])) {
      correctAnswers++;
      flag++;
    } else
      printf("Network address is incorrect! The answer is %d.%d.%d.%d\n",
             ansNetwork[0], ansNetwork[1], ansNetwork[2], ansNetwork[3]);
    ansBcast[0] = ip[0];
    ansBcast[1] = ip[1];
    ansBcast[2] = ip[2] | tmpsubnet2[tmp][0];
    ansBcast[3] = ip[3] | tmpsubnet2[tmp][1];
    if ((usrBcast[0] == ansBcast[0]) && (usrBcast[1] == ansBcast[1]) &&
        (usrBcast[2] == ansBcast[2]) && (usrBcast[3] == ansBcast[3])) {
      correctAnswers++;
      flag++;
    } else
      printf("Broadcast address is incorrect! The answer is %d.%d.%d.%d\n",
             ip[0], ip[1], ip[2] | tmpsubnet2[tmp][0],
             ip[3] | tmpsubnet2[tmp][1]);
    if (flag == 2)
      printf("Good job!\n");
    printf("\n");
  }
  printf("Your score: %.1f\n", correctAnswers / 8.0 * 100);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x170,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
lea    -0xb0(%rbp),%rdi
lea    0xe82(%rip),%rsi
mov    $0x68,%edx
call   1050 <memcpy@plt>
lea    -0x120(%rbp),%rdi
lea    0xeda(%rip),%rsi
mov    $0x68,%edx
call   1050 <memcpy@plt>
xor    %edi,%edi
mov    $0x0,%al
call   1060 <time@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1040 <srand@plt>
movl   $0xff,-0x40(%rbp)
movl   $0xff,-0x3c(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    14f8 <main+0x398>
movl   $0x0,-0x164(%rbp)
mov    $0x0,%al
call   1080 <rand@plt>
mov    $0xff,%ecx
cltd
idiv   %ecx
mov    %edx,-0x30(%rbp)
mov    $0x0,%al
call   1080 <rand@plt>
mov    $0xff,%ecx
cltd
idiv   %ecx
mov    %edx,-0x2c(%rbp)
mov    $0x0,%al
call   1080 <rand@plt>
mov    $0xff,%ecx
cltd
idiv   %ecx
mov    %edx,-0x28(%rbp)
mov    $0x0,%al
call   1080 <rand@plt>
mov    $0xff,%ecx
cltd
idiv   %ecx
mov    %edx,-0x24(%rbp)
mov    $0x0,%al
call   1080 <rand@plt>
mov    $0xd,%ecx
cltd
idiv   %ecx
mov    %edx,-0x168(%rbp)
movslq -0x168(%rbp),%rax
mov    -0xb0(%rbp,%rax,8),%eax
mov    %eax,-0x38(%rbp)
movslq -0x168(%rbp),%rax
mov    -0xac(%rbp,%rax,8),%eax
mov    %eax,-0x34(%rbp)
mov    -0x30(%rbp),%esi
mov    -0x2c(%rbp),%edx
mov    -0x28(%rbp),%ecx
mov    -0x24(%rbp),%r8d
lea    0xe6a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x40(%rbp),%esi
mov    -0x3c(%rbp),%edx
mov    -0x38(%rbp),%ecx
mov    -0x34(%rbp),%r8d
lea    0xe69(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe75(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x130(%rbp),%rsi
lea    -0x130(%rbp),%rdx
add    $0x4,%rdx
lea    -0x130(%rbp),%rcx
add    $0x8,%rcx
lea    -0x130(%rbp),%r8
add    $0xc,%r8
lea    0xe51(%rip),%rdi
mov    $0x0,%al
call   1070 <scanf@plt>
lea    0xe4f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x140(%rbp),%rsi
lea    -0x140(%rbp),%rdx
add    $0x4,%rdx
lea    -0x140(%rbp),%rcx
add    $0x8,%rcx
lea    -0x140(%rbp),%r8
add    $0xc,%r8
lea    0xe0d(%rip),%rdi
mov    $0x0,%al
call   1070 <scanf@plt>
mov    -0x30(%rbp),%eax
and    -0x40(%rbp),%eax
mov    %eax,-0x150(%rbp)
mov    -0x2c(%rbp),%eax
and    -0x3c(%rbp),%eax
mov    %eax,-0x14c(%rbp)
mov    -0x28(%rbp),%eax
and    -0x38(%rbp),%eax
mov    %eax,-0x148(%rbp)
mov    -0x24(%rbp),%eax
and    -0x34(%rbp),%eax
mov    %eax,-0x144(%rbp)
mov    -0x130(%rbp),%eax
cmp    -0x150(%rbp),%eax
jne    13bd <main+0x25d>
mov    -0x12c(%rbp),%eax
cmp    -0x14c(%rbp),%eax
jne    13bd <main+0x25d>
mov    -0x128(%rbp),%eax
cmp    -0x148(%rbp),%eax
jne    13bd <main+0x25d>
mov    -0x124(%rbp),%eax
cmp    -0x144(%rbp),%eax
jne    13bd <main+0x25d>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x164(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x164(%rbp)
jmp    13e4 <main+0x284>
mov    -0x150(%rbp),%esi
mov    -0x14c(%rbp),%edx
mov    -0x148(%rbp),%ecx
mov    -0x144(%rbp),%r8d
lea    0xd71(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x30(%rbp),%eax
mov    %eax,-0x160(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x15c(%rbp)
mov    -0x28(%rbp),%eax
movslq -0x168(%rbp),%rcx
or     -0x120(%rbp,%rcx,8),%eax
mov    %eax,-0x158(%rbp)
mov    -0x24(%rbp),%eax
movslq -0x168(%rbp),%rcx
or     -0x11c(%rbp,%rcx,8),%eax
mov    %eax,-0x154(%rbp)
mov    -0x140(%rbp),%eax
cmp    -0x160(%rbp),%eax
jne    1489 <main+0x329>
mov    -0x13c(%rbp),%eax
cmp    -0x15c(%rbp),%eax
jne    1489 <main+0x329>
mov    -0x138(%rbp),%eax
cmp    -0x158(%rbp),%eax
jne    1489 <main+0x329>
mov    -0x134(%rbp),%eax
cmp    -0x154(%rbp),%eax
jne    1489 <main+0x329>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x164(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x164(%rbp)
jmp    14c1 <main+0x361>
mov    -0x30(%rbp),%esi
mov    -0x2c(%rbp),%edx
mov    -0x28(%rbp),%ecx
movslq -0x168(%rbp),%rax
or     -0x120(%rbp,%rax,8),%ecx
mov    -0x24(%rbp),%r8d
movslq -0x168(%rbp),%rax
or     -0x11c(%rbp,%rax,8),%r8d
ff
lea    0xccd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x2,-0x164(%rbp)
jne    14dc <main+0x37c>
lea    0xced(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xce8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11d7 <main+0x77>
cvtsi2sdl -0x18(%rbp),%xmm0
movsd  0xb03(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xaef(%rip),%xmm1
mulsd  %xmm1,%xmm0
lea    0xcb1(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x170,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
xor    %edi,%edi
xor    %eax,%eax
call   1070 <time@plt>
mov    %eax,%edi
xor    %eax,%eax
call   1060 <srand@plt>
mov    $0x4,%ebx
xor    %r14d,%r14d
jmp    11d0 <main+0x60>
nopw   0x0(%rax,%rax,1)
lea    0xfe0(%rip),%rdi
mov    %r15d,%esi
mov    %r12d,%edx
mov    %ebx,%ecx
mov    %ebp,%r8d
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x8(%rsp),%ebx
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
je     141e <main+0x2ae>
mov    %r14d,0xc(%rsp)
mov    %ebx,0x8(%rsp)
xor    %eax,%eax
call   1090 <rand@plt>
cltq
imul   $0xffffffff80808081,%rax,%r15
shr    $0x20,%r15
add    %eax,%r15d
mov    %r15d,%ecx
shr    $0x1f,%ecx
sar    $0x7,%r15d
add    %ecx,%r15d
mov    %r15d,%ecx
shl    $0x8,%ecx
sub    %ecx,%r15d
add    %eax,%r15d
xor    %eax,%eax
call   1090 <rand@plt>
cltq
imul   $0xffffffff80808081,%rax,%r12
shr    $0x20,%r12
add    %eax,%r12d
mov    %r12d,%ecx
shr    $0x1f,%ecx
sar    $0x7,%r12d
add    %ecx,%r12d
mov    %r12d,%ecx
shl    $0x8,%ecx
sub    %ecx,%r12d
add    %eax,%r12d
xor    %eax,%eax
call   1090 <rand@plt>
cltq
imul   $0xffffffff80808081,%rax,%rbx
shr    $0x20,%rbx
add    %eax,%ebx
mov    %ebx,%ecx
shr    $0x1f,%ecx
sar    $0x7,%ebx
add    %ecx,%ebx
mov    %ebx,%ecx
shl    $0x8,%ecx
sub    %ecx,%ebx
add    %eax,%ebx
xor    %eax,%eax
call   1090 <rand@plt>
cltq
imul   $0xffffffff80808081,%rax,%rbp
shr    $0x20,%rbp
add    %eax,%ebp
mov    %ebp,%ecx
shr    $0x1f,%ecx
sar    $0x7,%ebp
add    %ecx,%ebp
mov    %ebp,%ecx
shl    $0x8,%ecx
sub    %ecx,%ebp
add    %eax,%ebp
xor    %eax,%eax
call   1090 <rand@plt>
cltq
imul   $0x4ec4ec4f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,2),%edx
lea    (%rcx,%rdx,4),%ecx
sub    %ecx,%eax
movslq %eax,%rcx
lea    0xd56(%rip),%rax
mov    (%rax,%rcx,8),%r14d
mov    %rcx,0x30(%rsp)
mov    0x4(%rax,%rcx,8),%r13d
lea    0xe19(%rip),%rdi
mov    %r15d,%esi
mov    %r12d,%edx
mov    %ebx,%ecx
mov    %ebp,%r8d
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe1a(%rip),%rdi
mov    $0xff,%esi
mov    $0xff,%edx
mov    %r14d,%ecx
mov    %r13d,%r8d
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe16(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe1a(%rip),%rdi
lea    0x20(%rsp),%rsi
lea    0x24(%rsp),%rdx
lea    0x28(%rsp),%rcx
lea    0x2c(%rsp),%r8
xor    %eax,%eax
call   1080 <scanf@plt>
lea    0xe04(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xdea(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x14(%rsp),%rdx
lea    0x18(%rsp),%rcx
lea    0x1c(%rsp),%r8
xor    %eax,%eax
call   1080 <scanf@plt>
movzbl %r15b,%esi
movzbl %r12b,%edx
and    %ebx,%r14d
and    %ebp,%r13d
mov    0x20(%rsp),%eax
xor    %esi,%eax
mov    0x24(%rsp),%ecx
xor    %edx,%ecx
or     %eax,%ecx
mov    0x28(%rsp),%eax
xor    %r14d,%eax
or     %ecx,%eax
mov    0x2c(%rsp),%ecx
xor    %r13d,%ecx
or     %eax,%ecx
sete   %dil
jne    13a0 <main+0x230>
mov    0xc(%rsp),%r14d
add    $0x1,%r14d
jmp    13c3 <main+0x253>
xchg   %ax,%ax
mov    %dil,0x7(%rsp)
lea    0xda2(%rip),%rdi
mov    %r14d,%ecx
mov    %r13d,%r8d
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x7(%rsp),%edi
mov    0xc(%rsp),%r14d
mov    0x30(%rsp),%rcx
lea    0xcb1(%rip),%rax
or     (%rax,%rcx,8),%ebx
or     0x4(%rax,%rcx,8),%ebp
cmp    %r15d,0x10(%rsp)
jne    11a0 <main+0x30>
cmp    %r12d,0x14(%rsp)
jne    11a0 <main+0x30>
cmp    %ebx,0x18(%rsp)
jne    11a0 <main+0x30>
cmp    %ebp,0x1c(%rsp)
jne    11a0 <main+0x30>
add    $0x1,%r14d
test   %dil,%dil
je     11b9 <main+0x49>
lea    0xdc0(%rip),%rdi
call   1040 <puts@plt>
jmp    11b9 <main+0x49>
cvtsi2sd %r14d,%xmm0
mulsd  0xbd5(%rip),%xmm0
mulsd  0xbd5(%rip),%xmm0
lea    0xd88(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.tmpsubnet = [13 x [2 x i32]] [[2 x i32] zeroinitializer, [2 x i32] [i32 128, i32 0], [2 x i32] [i32 192, i32 0], [2 x i32] [i32 224, i32 0], [2 x i32] [i32 240, i32 0], [2 x i32] [i32 248, i32 0], [2 x i32] [i32 252, i32 0], [2 x i32] [i32 254, i32 0], [2 x i32] [i32 255, i32 0], [2 x i32] [i32 255, i32 128], [2 x i32] [i32 255, i32 192], [2 x i32] [i32 255, i32 224], [2 x i32] [i32 255, i32 240]]
@__const.main.tmpsubnet2 = [13 x [2 x i32]] [[2 x i32] [i32 255, i32 255], [2 x i32] [i32 127, i32 255], [2 x i32] [i32 63, i32 255], [2 x i32] [i32 31, i32 255], [2 x i32] [i32 15, i32 255], [2 x i32] [i32 7, i32 255], [2 x i32] [i32 3, i32 255], [2 x i32] [i32 1, i32 255], [2 x i32] [i32 0, i32 255], [2 x i32] [i32 0, i32 127], [2 x i32] [i32 0, i32 63], [2 x i32] [i32 0, i32 31], [2 x i32] [i32 0, i32 15]]
@.str = [26 x i8] c"IP address : %d.%d.%d.%d\0A\00"
@.str.1 = [26 x i8] c"Subnet mask: %d.%d.%d.%d\0A\00"
@.str.2 = [18 x i8] c"Network address: \00"
@.str.3 = [12 x i8] c"%d.%d.%d.%d\00"
@.str.4 = [20 x i8] c"Broadcast address: \00"
@.str.5 = [57 x i8] c"Network address is incorrect! The answer is %d.%d.%d.%d\0A\00"
@.str.6 = [59 x i8] c"Broadcast address is incorrect! The answer is %d.%d.%d.%d\0A\00"
@.str.7 = [11 x i8] c"Good job!\0A\00"
@.str.8 = [2 x i8] c"\0A\00"
@.str.9 = [18 x i8] c"Your score: %.1f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca [4 x i32]
%9 = alloca [4 x i32]
%10 = alloca [13 x [2 x i32]]
%11 = alloca [13 x [2 x i32]]
%12 = alloca [4 x i32]
%13 = alloca [4 x i32]
%14 = alloca [4 x i32]
%15 = alloca [4 x i32]
%16 = alloca i32
%17 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %7
%18 = bitcast [13 x [2 x i32]]* %10 to i8*
%19 = bitcast [13 x [2 x i32]]* %11 to i8*
%20 = call i32 (i32, ...) bitcast (i32 (...)* @time to i32 (i32, ...)*)(i32 0)
%21 = call i32 (i32, ...) bitcast (i32 (...)* @srand to i32 (i32, ...)*)(i32 %20)
%22 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 0
store i32 255, i32* %22
%23 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 1
store i32 255, i32* %23
store i32 0, i32* %6
br label %24
24: ; preds = %228, %2
%25 = load i32, i32* %6
%26 = icmp slt i32 %25, 4
br i1 %26, label %27, label %231
27: ; preds = %24
store i32 0, i32* %16
%28 = call i32 (...) @rand()
%29 = srem i32 %28, 255
%30 = getelementptr inbounds [4 x i32], [4 x i32]* %8, i64 0, i64 0
store i32 %29, i32* %30
%31 = call i32 (...) @rand()
%32 = srem i32 %31, 255
%33 = getelementptr inbounds [4 x i32], [4 x i32]* %8, i64 0, i64 1
store i32 %32, i32* %33
%34 = call i32 (...) @rand()
%35 = srem i32 %34, 255
%36 = getelementptr inbounds [4 x i32], [4 x i32]* %8, i64 0, i64 2
store i32 %35, i32* %36
%37 = call i32 (...) @rand()
%38 = srem i32 %37, 255
%39 = getelementptr inbounds [4 x i32], [4 x i32]* %8, i64 0, i64 3
store i32 %38, i32* %39
%40 = call i32 (...) @rand()
%41 = srem i32 %40, 13
store i32 %41, i32* %17
%42 = load i32, i32* %17
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [13 x [2 x i32]], [13 x [2 x i32]]* %10, i64 0, i64 %43
%45 = getelementptr inbounds [2 x i32], [2 x i32]* %44, i64 0, i64 0
%46 = load i32, i32* %45
%47 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 2
store i32 %46, i32* %47
%48 = load i32, i32* %17
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [13 x [2 x i32]], [13 x [2 x i32]]* %10, i64 0, i64 %49
%51 = getelementptr inbounds [2 x i32], [2 x i32]* %50, i64 0, i64 1
%52 = load i32, i32* %51
%53 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 3
store i32 %52, i32* %53
%54 = getelementptr inbounds [4 x i32], [4 x i32]* %8, i64 0, i64 0
%55 = load i32, i32* %54
%56 = getelementptr inbounds [4 x i32], [4 x i32]* %8, i64 0, i64 1
%57 = load i32, i32* %56
%58 = getelementptr inbounds [4 x i32], [4 x i32]* %8, i64 0, i64 2
%59 = load i32, i32* %58
%60 = getelementptr inbounds [4 x i32], [4 x i32]* %8, i64 0, i64 3
%61 = load i32, i32* %60
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %55, i32 %57, i32 %59, i32 %61)
%63 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 0
%64 = load i32, i32* %63
%65 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 1
%66 = load i32, i32* %65
%67 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 2
%68 = load i32, i32* %67
%69 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 3
%70 = load i32, i32* %69
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %64, i32 %66, i32 %68, i32 %70)
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%73 = getelementptr inbounds [4 x i32], [4 x i32]* %12, i64 0, i64 0
%74 = getelementptr inbounds [4 x i32], [4 x i32]* %12, i64 0, i64 1
%75 = getelementptr inbounds [4 x i32], [4 x i32]* %12, i64 0, i64 2
%76 = getelementptr inbounds [4 x i32], [4 x i32]* %12, i64 0, i64 3
%77 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32* %73, i32* %74, i32* %75, i32* %76)
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
%79 = getelementptr inbounds [4 x i32], [4 x i32]* %13, i64 0, i64 0
%80 = getelementptr inbounds [4 x i32], [4 x i32]* %13, i64 0, i64 1
%81 = getelementptr inbounds [4 x i32], [4 x i32]* %13, i64 0, i64 2
%82 = getelementptr inbounds [4 x i32], [4 x i32]* %13, i64 0, i64 3
%83 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32* %79, i32* %80, i32* %81, i32* %82)
%84 = getelementptr inbounds [4 x i32], [4 x i32]* %8, i64 0, i64 0
%85 = load i32, i32* %84
%86 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 0
%87 = load i32, i32* %86
%88 = and i32 %85, %87
%89 = getelementptr inbounds [4 x i32], [4 x i32]* %14, i64 0, i64 0
store i32 %88, i32* %89
%90 = getelementptr inbounds [4 x i32], [4 x i32]* %8, i64 0, i64 1
%91 = load i32, i32* %90
%92 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 1
%93 = load i32, i32* %92
%94 = and i32 %91, %93
%95 = getelementptr inbounds [4 x i32], [4 x i32]* %14, i64 0, i64 1
store i32 %94, i32* %95
%96 = getelementptr inbounds [4 x i32], [4 x i32]* %8, i64 0, i64 2
%97 = load i32, i32* %96
%98 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 2
%99 = load i32, i32* %98
%100 = and i32 %97, %99
%101 = getelementptr inbounds [4 x i32], [4 x i32]* %14, i64 0, i64 2
store i32 %100, i32* %101
%102 = getelementptr inbounds [4 x i32], [4 x i32]* %8, i64 0, i64 3
%103 = load i32, i32* %102
%104 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 3
%105 = load i32, i32* %104
%106 = and i32 %103, %105
%107 = getelementptr inbounds [4 x i32], [4 x i32]* %14, i64 0, i64 3
store i32 %106, i32* %107
%108 = getelementptr inbounds [4 x i32], [4 x i32]* %12, i64 0, i64 0
%109 = load i32, i32* %108
%110 = getelementptr inbounds [4 x i32], [4 x i32]* %14, i64 0, i64 0
%111 = load i32, i32* %110
%112 = icmp eq i32 %109, %111
br i1 %112, label %113, label %136
113: ; preds = %27
%114 = getelementptr inbounds [4 x i32], [4 x i32]* %12, i64 0, i64 1
%115 = load i32, i32* %114
%116 = getelementptr inbounds [4 x i32], [4 x i32]* %14, i64 0, i64 1
%117 = load i32, i32* %116
%118 = icmp eq i32 %115, %117
br i1 %118, label %119, label %136
119: ; preds = %113
%120 = getelementptr inbounds [4 x i32], [4 x i32]* %12, i64 0, i64 2
%121 = load i32, i32* %120
%122 = getelementptr inbounds [4 x i32], [4 x i32]* %14, i64 0, i64 2
%123 = load i32, i32* %122
%124 = icmp eq i32 %121, %123
br i1 %124, label %125, label %136
125: ; preds = %119
%126 = getelementptr inbounds [4 x i32], [4 x i32]* %12, i64 0, i64 3
%127 = load i32, i32* %126
%128 = getelementptr inbounds [4 x i32], [4 x i32]* %14, i64 0, i64 3
%129 = load i32, i32* %128
%130 = icmp eq i32 %127, %129
br i1 %130, label %131, label %136
131: ; preds = %125
%132 = load i32, i32* %7
%133 = add nsw i32 %132, 1
store i32 %133, i32* %7
%134 = load i32, i32* %16
%135 = add nsw i32 %134, 1
store i32 %135, i32* %16
br label %146
136: ; preds = %125, %119, %113, %27
%137 = getelementptr inbounds [4 x i32], [4 x i32]* %14, i64 0, i64 0
%138 = load i32, i32* %137
%139 = getelementptr inbounds [4 x i32], [4 x i32]* %14, i64 0, i64 1
%140 = load i32, i32* %139
%141 = getelementptr inbounds [4 x i32], [4 x i32]* %14, i64 0, i64 2
%142 = load i32, i32* %141
%143 = getelementptr inbounds [4 x i32], [4 x i32]* %14, i64 0, i64 3
%144 = load i32, i32* %143
%145 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.5, i64 0, i64 0), i32 %138, i32 %140, i32 %142, i32 %144)
br label %146
146: ; preds = %136, %131
%147 = getelementptr inbounds [4 x i32], [4 x i32]* %8, i64 0, i64 0
%148 = load i32, i32* %147
%149 = getelementptr inbounds [4 x i32], [4 x i32]* %15, i64 0, i64 0
store i32 %148, i32* %149
%150 = getelementptr inbounds [4 x i32], [4 x i32]* %8, i64 0, i64 1
%151 = load i32, i32* %150
%152 = getelementptr inbounds [4 x i32], [4 x i32]* %15, i64 0, i64 1
store i32 %151, i32* %152
%153 = getelementptr inbounds [4 x i32], [4 x i32]* %8, i64 0, i64 2
%154 = load i32, i32* %153
%155 = load i32, i32* %17
%156 = sext i32 %155 to i64
%157 = getelementptr inbounds [13 x [2 x i32]], [13 x [2 x i32]]* %11, i64 0, i64 %156
%158 = getelementptr inbounds [2 x i32], [2 x i32]* %157, i64 0, i64 0
%159 = load i32, i32* %158
%160 = or i32 %154, %159
%161 = getelementptr inbounds [4 x i32], [4 x i32]* %15, i64 0, i64 2
store i32 %160, i32* %161
%162 = getelementptr inbounds [4 x i32], [4 x i32]* %8, i64 0, i64 3
%163 = load i32, i32* %162
%164 = load i32, i32* %17
%165 = sext i32 %164 to i64
%166 = getelementptr inbounds [13 x [2 x i32]], [13 x [2 x i32]]* %11, i64 0, i64 %165
%167 = getelementptr inbounds [2 x i32], [2 x i32]* %166, i64 0, i64 1
%168 = load i32, i32* %167
%169 = or i32 %163, %168
%170 = getelementptr inbounds [4 x i32], [4 x i32]* %15, i64 0, i64 3
store i32 %169, i32* %170
%171 = getelementptr inbounds [4 x i32], [4 x i32]* %13, i64 0, i64 0
%172 = load i32, i32* %171
%173 = getelementptr inbounds [4 x i32], [4 x i32]* %15, i64 0, i64 0
%174 = load i32, i32* %173
%175 = icmp eq i32 %172, %174
br i1 %175, label %176, label %199
176: ; preds = %146
%177 = getelementptr inbounds [4 x i32], [4 x i32]* %13, i64 0, i64 1
%178 = load i32, i32* %177
%179 = getelementptr inbounds [4 x i32], [4 x i32]* %15, i64 0, i64 1
%180 = load i32, i32* %179
%181 = icmp eq i32 %178, %180
br i1 %181, label %182, label %199
182: ; preds = %176
%183 = getelementptr inbounds [4 x i32], [4 x i32]* %13, i64 0, i64 2
%184 = load i32, i32* %183
%185 = getelementptr inbounds [4 x i32], [4 x i32]* %15, i64 0, i64 2
%186 = load i32, i32* %185
%187 = icmp eq i32 %184, %186
br i1 %187, label %188, label %199
188: ; preds = %182
%189 = getelementptr inbounds [4 x i32], [4 x i32]* %13, i64 0, i64 3
%190 = load i32, i32* %189
%191 = getelementptr inbounds [4 x i32], [4 x i32]* %15, i64 0, i64 3
%192 = load i32, i32* %191
%193 = icmp eq i32 %190, %192
br i1 %193, label %194, label %199
194: ; preds = %188
%195 = load i32, i32* %7
%196 = add nsw i32 %195, 1
store i32 %196, i32* %7
%197 = load i32, i32* %16
%198 = add nsw i32 %197, 1
store i32 %198, i32* %16
br label %221
199: ; preds = %188, %182, %176, %146
%200 = getelementptr inbounds [4 x i32], [4 x i32]* %8, i64 0, i64 0
%201 = load i32, i32* %200
%202 = getelementptr inbounds [4 x i32], [4 x i32]* %8, i64 0, i64 1
%203 = load i32, i32* %202
%204 = getelementptr inbounds [4 x i32], [4 x i32]* %8, i64 0, i64 2
%205 = load i32, i32* %204
%206 = load i32, i32* %17
%207 = sext i32 %206 to i64
%208 = getelementptr inbounds [13 x [2 x i32]], [13 x [2 x i32]]* %11, i64 0, i64 %207
%209 = getelementptr inbounds [2 x i32], [2 x i32]* %208, i64 0, i64 0
%210 = load i32, i32* %209
%211 = or i32 %205, %210
%212 = getelementptr inbounds [4 x i32], [4 x i32]* %8, i64 0, i64 3
%213 = load i32, i32* %212
%214 = load i32, i32* %17
%215 = sext i32 %214 to i64
%216 = getelementptr inbounds [13 x [2 x i32]], [13 x [2 x i32]]* %11, i64 0, i64 %215
%217 = getelementptr inbounds [2 x i32], [2 x i32]* %216, i64 0, i64 1
%218 = load i32, i32* %217
%219 = or i32 %213, %218
%220 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.6, i64 0, i64 0), i32 %201, i32 %203, i32 %211, i32 %219)
br label %221
221: ; preds = %199, %194
%222 = load i32, i32* %16
%223 = icmp eq i32 %222, 2
br i1 %223, label %224, label %226
224: ; preds = %221
%225 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
br label %226
226: ; preds = %224, %221
%227 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
br label %228
228: ; preds = %226
%229 = load i32, i32* %6
%230 = add nsw i32 %229, 1
store i32 %230, i32* %6
br label %24
231: ; preds = %24
%232 = load i32, i32* %7
%233 = sitofp i32 %232 to double
%234 = fdiv double %233, 8.000000e+00
%235 = fmul double %234, 1.000000e+02
%236 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0), double %235)
ret i32 0
}

LLVM IR (-O2):
@__const.main.tmpsubnet = [13 x [2 x i32]] [[2 x i32] zeroinitializer, [2 x i32] [i32 128, i32 0], [2 x i32] [i32 192, i32 0], [2 x i32] [i32 224, i32 0], [2 x i32] [i32 240, i32 0], [2 x i32] [i32 248, i32 0], [2 x i32] [i32 252, i32 0], [2 x i32] [i32 254, i32 0], [2 x i32] [i32 255, i32 0], [2 x i32] [i32 255, i32 128], [2 x i32] [i32 255, i32 192], [2 x i32] [i32 255, i32 224], [2 x i32] [i32 255, i32 240]]
@__const.main.tmpsubnet2 = [13 x [2 x i32]] [[2 x i32] [i32 255, i32 255], [2 x i32] [i32 127, i32 255], [2 x i32] [i32 63, i32 255], [2 x i32] [i32 31, i32 255], [2 x i32] [i32 15, i32 255], [2 x i32] [i32 7, i32 255], [2 x i32] [i32 3, i32 255], [2 x i32] [i32 1, i32 255], [2 x i32] [i32 0, i32 255], [2 x i32] [i32 0, i32 127], [2 x i32] [i32 0, i32 63], [2 x i32] [i32 0, i32 31], [2 x i32] [i32 0, i32 15]]
@.str = [26 x i8] c"IP address : %d.%d.%d.%d\0A\00"
@.str.1 = [26 x i8] c"Subnet mask: %d.%d.%d.%d\0A\00"
@.str.2 = [18 x i8] c"Network address: \00"
@.str.3 = [12 x i8] c"%d.%d.%d.%d\00"
@.str.4 = [20 x i8] c"Broadcast address: \00"
@.str.5 = [57 x i8] c"Network address is incorrect! The answer is %d.%d.%d.%d\0A\00"
@.str.6 = [59 x i8] c"Broadcast address is incorrect! The answer is %d.%d.%d.%d\0A\00"
@.str.9 = [18 x i8] c"Your score: %.1f\0A\00"
@str = [10 x i8] c"Good job!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [4 x i32]
%4 = alloca [4 x i32]
%5 = bitcast [4 x i32]* %3 to i8*
%6 = bitcast [4 x i32]* %4 to i8*
%7 = tail call i32 (i32, ...) bitcast (i32 (...)* @time to i32 (i32, ...)*)(i32 0)
%8 = tail call i32 (i32, ...) bitcast (i32 (...)* @srand to i32 (i32, ...)*)(i32 %7)
%9 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%10 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 1
%11 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 2
%12 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 3
%13 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 0
%14 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 1
%15 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 2
%16 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 3
br label %17
17: ; preds = %2, %85
%18 = phi i32 [ 0, %2 ], [ %88, %85 ]
%19 = phi i32 [ 0, %2 ], [ %86, %85 ]
%20 = call i32 (...) @rand()
%21 = srem i32 %20, 255
%22 = call i32 (...) @rand()
%23 = srem i32 %22, 255
%24 = call i32 (...) @rand()
%25 = srem i32 %24, 255
%26 = call i32 (...) @rand()
%27 = srem i32 %26, 255
%28 = call i32 (...) @rand()
%29 = srem i32 %28, 13
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [13 x [2 x i32]], [13 x [2 x i32]]* @__const.main.tmpsubnet, i64 0, i64 %30, i64 0
%32 = load i32, i32* %31
%33 = getelementptr inbounds [13 x [2 x i32]], [13 x [2 x i32]]* @__const.main.tmpsubnet, i64 0, i64 %30, i64 1
%34 = load i32, i32* %33
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %21, i32 %23, i32 %25, i32 %27)
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 255, i32 255, i32 %32, i32 %34)
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%38 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32* %9, i32* %10, i32* %11, i32* %12)
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
%40 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32* %13, i32* %14, i32* %15, i32* %16)
%41 = and i32 %21, 255
%42 = and i32 %23, 255
%43 = and i32 %32, %25
%44 = and i32 %34, %27
%45 = load i32, i32* %9
%46 = icmp eq i32 %45, %41
%47 = load i32, i32* %10
%48 = icmp eq i32 %47, %42
%49 = select i1 %46, i1 %48, i1 false
%50 = load i32, i32* %11
%51 = icmp eq i32 %50, %43
%52 = select i1 %49, i1 %51, i1 false
%53 = load i32, i32* %12
%54 = icmp eq i32 %53, %44
%55 = select i1 %52, i1 %54, i1 false
br i1 %55, label %56, label %58
56: ; preds = %17
%57 = add nsw i32 %19, 1
br label %60
58: ; preds = %17
%59 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str.5, i64 0, i64 0), i32 %41, i32 %42, i32 %43, i32 %44)
br label %60
60: ; preds = %58, %56
%61 = phi i32 [ %57, %56 ], [ %19, %58 ]
%62 = getelementptr inbounds [13 x [2 x i32]], [13 x [2 x i32]]* @__const.main.tmpsubnet2, i64 0, i64 %30, i64 0
%63 = load i32, i32* %62
%64 = or i32 %63, %25
%65 = getelementptr inbounds [13 x [2 x i32]], [13 x [2 x i32]]* @__const.main.tmpsubnet2, i64 0, i64 %30, i64 1
%66 = load i32, i32* %65
%67 = or i32 %66, %27
%68 = load i32, i32* %13
%69 = icmp eq i32 %68, %21
%70 = load i32, i32* %14
%71 = icmp eq i32 %70, %23
%72 = select i1 %69, i1 %71, i1 false
%73 = load i32, i32* %15
%74 = icmp eq i32 %73, %64
%75 = select i1 %72, i1 %74, i1 false
%76 = load i32, i32* %16
%77 = icmp eq i32 %76, %67
%78 = select i1 %75, i1 %77, i1 false
br i1 %78, label %81, label %79
79: ; preds = %60
%80 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @.str.6, i64 0, i64 0), i32 %21, i32 %23, i32 %64, i32 %67)
br label %85
81: ; preds = %60
%82 = add nsw i32 %61, 1
br i1 %55, label %83, label %85
83: ; preds = %81
%84 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
br label %85
85: ; preds = %79, %83, %81
%86 = phi i32 [ %61, %79 ], [ %82, %83 ], [ %82, %81 ]
%87 = call i32 @putchar(i32 10)
%88 = add nuw nsw i32 %18, 1
%89 = icmp eq i32 %88, 4
br i1 %89, label %90, label %17
90: ; preds = %85
%91 = sitofp i32 %86 to double
%92 = fmul double %91, 1.250000e-01
%93 = fmul double %92, 1.000000e+02
%94 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0), double %93)
ret i32 0
}