#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 {
  void *s_addr;
};
typedef int /*<<< orphan*/ last;
typedef int /*<<< orphan*/ first;
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int INET_ADDRSTRLEN;
int atoi(char const *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
void *htonl(int);
int /*<<< orphan*/ *inet_ntop(int /*<<< orphan*/, struct in_addr *, char *,
                              int);
int inet_pton(int /*<<< orphan*/, char const *, struct in_addr *);
int ntohl(void *);
int /*<<< orphan*/ printf(char *, char *, char *, char *);
int /*<<< orphan*/ stderr;
int main(int argc, const char *argv[]) {
  struct in_addr base;
  int bits, count, i, subnet;
  if (argc != 4) {
    fprintf(stderr, "ip_sub: <starting ip> <bits> <count\n>");
    return (1);
  }
  if (inet_pton(AF_INET, argv[1], &base) != 1) {
    fprintf(stderr, "argv[1] (%s) looks bad\n", argv[1]);
    return (1);
  }
  bits = atoi(argv[2]);
  if (bits < 8 || bits >= 32) {
    fprintf(stderr, "bad subnet size, only [8, 32) valid\n");
    return (1);
  }
  count = atoi(argv[3]);
  subnet = ntohl(base.s_addr);
  if ((subnet & (1 << (32 - bits))) != 0) {
    fprintf(stderr, "address doesn't match subnet\n");
    return (1);
  }
  for (i = 0; i < count; i++, subnet += 1 << (32 - bits)) {
    struct in_addr addr;
    char buf[INET_ADDRSTRLEN];
    char first[INET_ADDRSTRLEN];
    char last[INET_ADDRSTRLEN];
    addr.s_addr = htonl(subnet);
    if (inet_ntop(AF_INET, &addr, buf, sizeof(buf)) == NULL) {
      fprintf(stderr, "conversion failed!\n");
      return (1);
    }
    addr.s_addr = htonl(subnet + 1);
    if (inet_ntop(AF_INET, &addr, first, sizeof(first)) == NULL) {
      fprintf(stderr, "conversion failed!\n");
      return (1);
    }
    addr.s_addr = htonl(subnet + 2);
    if (inet_ntop(AF_INET, &addr, last, sizeof(last)) == NULL) {
      fprintf(stderr, "conversion failed!\n");
      return (1);
    }
    printf("%s %s %s\n", buf, first, last);
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x4,-0x8(%rbp)
je     11b6 <main+0x46>
mov    0x2e3e(%rip),%rax
mov    (%rax),%edi
lea    0xe5d(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    14c3 <main+0x353>
mov    0x2e2b(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    -0x18(%rbp),%rdx
call   1070 <inet_pton@plt>
cmp    $0x1,%eax
je     1204 <main+0x94>
mov    0x2df8(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xe35(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    14c3 <main+0x353>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1080 <atoi@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x8,-0x1c(%rbp)
jl     1228 <main+0xb8>
cmpl   $0x20,-0x1c(%rbp)
jl     124b <main+0xdb>
mov    0x2da9(%rip),%rax
mov    (%rax),%edi
lea    0xe06(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    14c3 <main+0x353>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1080 <atoi@plt>
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1090 <ntohl@plt>
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    $0x20,%ecx
sub    -0x1c(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     12a9 <main+0x139>
mov    0x2d4b(%rip),%rax
mov    (%rax),%edi
lea    0xdcd(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    14c3 <main+0x353>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    14bc <main+0x34c>
mov    0x2d0d(%rip),%rax
mov    (%rax),%ecx
mov    %rcx,-0x60(%rbp)
mov    %rsp,%rdx
mov    %rdx,-0x38(%rbp)
mov    %rcx,%rsi
add    $0xf,%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rdx
sub    %rsi,%rdx
mov    %rdx,-0x68(%rbp)
mov    %rdx,%rsp
mov    %rcx,-0x40(%rbp)
mov    (%rax),%ecx
mov    %rcx,-0x88(%rbp)
mov    %rcx,%rsi
add    $0xf,%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rdx
sub    %rsi,%rdx
mov    %rdx,-0x80(%rbp)
mov    %rdx,%rsp
mov    %rcx,-0x48(%rbp)
mov    (%rax),%eax
mov    %rax,-0x78(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x70(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x50(%rbp)
mov    -0x28(%rbp),%edi
call   1050 <htonl@plt>
mov    -0x68(%rbp),%rdx
mov    %rax,%rcx
mov    -0x60(%rbp),%rax
mov    %rcx,-0x30(%rbp)
mov    0x2c97(%rip),%rcx
mov    (%rcx),%edi
mov    %eax,%ecx
lea    -0x30(%rbp),%rsi
call   1030 <inet_ntop@plt>
cmp    $0x0,%rax
jne    1392 <main+0x222>
mov    0x2c69(%rip),%rax
mov    (%rax),%edi
lea    0xd09(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x54(%rbp)
jmp    1478 <main+0x308>
mov    -0x28(%rbp),%edi
add    $0x1,%edi
call   1050 <htonl@plt>
mov    -0x80(%rbp),%rdx
mov    %rax,%rcx
mov    -0x88(%rbp),%rax
mov    %rcx,-0x30(%rbp)
mov    0x2c32(%rip),%rcx
mov    (%rcx),%edi
mov    %eax,%ecx
lea    -0x30(%rbp),%rsi
call   1030 <inet_ntop@plt>
cmp    $0x0,%rax
jne    13f7 <main+0x287>
mov    0x2c04(%rip),%rax
mov    (%rax),%edi
lea    0xca4(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x54(%rbp)
jmp    1478 <main+0x308>
mov    -0x28(%rbp),%edi
add    $0x2,%edi
call   1050 <htonl@plt>
mov    -0x70(%rbp),%rdx
mov    %rax,%rcx
mov    -0x78(%rbp),%rax
mov    %rcx,-0x30(%rbp)
mov    0x2bd0(%rip),%rcx
mov    (%rcx),%edi
mov    %eax,%ecx
lea    -0x30(%rbp),%rsi
call   1030 <inet_ntop@plt>
cmp    $0x0,%rax
jne    1459 <main+0x2e9>
mov    0x2ba2(%rip),%rax
mov    (%rax),%edi
lea    0xc42(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x54(%rbp)
jmp    1478 <main+0x308>
mov    -0x70(%rbp),%rcx
mov    -0x80(%rbp),%rdx
mov    -0x68(%rbp),%rsi
lea    0xc29(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x54(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,%rsp
mov    -0x54(%rbp),%eax
test   %eax,%eax
je     1494 <main+0x324>
jmp    148f <main+0x31f>
jmp    14c3 <main+0x353>
jmp    1499 <main+0x329>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    $0x20,%ecx
sub    -0x1c(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
add    -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
jmp    12b0 <main+0x140>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
cmp    $0x4,%edi
jne    11cb <main+0x5b>
mov    %rsi,%rbx
mov    0x2e58(%rip),%rax
mov    (%rax),%edi
mov    0x8(%rsi),%rsi
lea    -0x50(%rbp),%rdx
call   1070 <inet_pton@plt>
cmp    $0x1,%eax
jne    11e4 <main+0x74>
mov    0x10(%rbx),%rdi
call   1080 <atoi@plt>
mov    %eax,%r14d
lea    -0x20(%r14),%eax
cmp    $0xffffffe7,%eax
ja     1215 <main+0xa5>
mov    0x2e18(%rip),%rax
mov    (%rax),%edi
lea    0xe75(%rip),%rsi
jmp    11db <main+0x6b>
mov    0x2e06(%rip),%rax
mov    (%rax),%edi
lea    0xe25(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
jmp    11ff <main+0x8f>
mov    0x2ded(%rip),%rax
mov    (%rax),%edi
mov    0x8(%rbx),%rdx
lea    0xe2e(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x18(%rbx),%rdi
call   1080 <atoi@plt>
mov    %eax,%r15d
mov    -0x50(%rbp),%rdi
call   1090 <ntohl@plt>
mov    %r14d,%ecx
neg    %cl
mov    $0x1,%ebx
mov    $0x1,%edx
shl    %cl,%edx
mov    $0x20,%cl
sub    %r14b,%cl
movzbl %cl,%ecx
bt     %ecx,%eax
jae    1261 <main+0xf1>
mov    0x2d89(%rip),%rax
mov    (%rax),%edi
lea    0xe0b(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
jmp    1204 <main+0x94>
test   %r15d,%r15d
jle    1364 <main+0x1f4>
mov    %edx,-0x34(%rbp)
nopl   (%rax)
mov    %r15d,-0x38(%rbp)
mov    %rsp,-0x40(%rbp)
mov    0x2d51(%rip),%rdx
mov    (%rdx),%ecx
mov    %rcx,-0x48(%rbp)
mov    %rsp,%r13
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
sub    %rcx,%r13
mov    %r13,%rsp
mov    (%rdx),%r14d
mov    %rsp,%r12
lea    0xf(%r14),%rcx
and    $0xfffffffffffffff0,%rcx
sub    %rcx,%r12
mov    %r12,%rsp
mov    %rsp,%r15
sub    %rcx,%r15
mov    %r15,%rsp
mov    %rax,%rbx
mov    %ebx,%edi
call   1050 <htonl@plt>
mov    %rax,-0x30(%rbp)
mov    0x2d20(%rip),%rax
mov    (%rax),%edi
lea    -0x30(%rbp),%rsi
mov    %r13,%rdx
mov    -0x48(%rbp),%rcx
call   1030 <inet_ntop@plt>
test   %rax,%rax
je     136b <main+0x1fb>
lea    0x1(%rbx),%edi
call   1050 <htonl@plt>
mov    %rax,-0x30(%rbp)
mov    0x2cf2(%rip),%rax
mov    (%rax),%edi
lea    -0x30(%rbp),%rsi
mov    %r12,%rdx
mov    %r14d,%ecx
call   1030 <inet_ntop@plt>
test   %rax,%rax
je     136b <main+0x1fb>
lea    0x2(%rbx),%edi
call   1050 <htonl@plt>
mov    %rax,-0x30(%rbp)
mov    0x2cc9(%rip),%rax
mov    (%rax),%edi
lea    -0x30(%rbp),%rsi
mov    %r15,%rdx
mov    %r14d,%ecx
call   1030 <inet_ntop@plt>
test   %rax,%rax
je     136b <main+0x1fb>
lea    0xd59(%rip),%rdi
mov    %r13,%rsi
mov    %r12,%rdx
mov    %r15,%rcx
call   1040 <printf@plt>
mov    -0x40(%rbp),%rsp
mov    -0x34(%rbp),%edx
add    %edx,%ebx
mov    -0x38(%rbp),%r15d
add    $0xffffffff,%r15d
mov    %rbx,%rax
jne    1270 <main+0x100>
xor    %ebx,%ebx
jmp    1204 <main+0x94>
mov    0x2c66(%rip),%rax
mov    (%rax),%edi
lea    0xd06(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    -0x40(%rbp),%rsp
jmp    11ff <main+0x8f>

LLVM IR (-O0):
%struct.in_addr = type { i8* }
@stderr = global i32 0
@.str = [38 x i8] c"ip_sub: <starting ip> <bits> <count\0A>\00"
@AF_INET = global i32 0
@.str.1 = [24 x i8] c"argv[1] (%s) looks bad\0A\00"
@.str.2 = [37 x i8] c"bad subnet size, only [8, 32) valid\0A\00"
@.str.3 = [30 x i8] c"address doesn't match subnet\0A\00"
@INET_ADDRSTRLEN = global i32 0
@.str.4 = [20 x i8] c"conversion failed!\0A\00"
@.str.5 = [10 x i8] c"%s %s %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.in_addr
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca %struct.in_addr
%12 = alloca i8*
%13 = alloca i64
%14 = alloca i64
%15 = alloca i64
%16 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%17 = load i32, i32* %4
%18 = icmp ne i32 %17, 4
br i1 %18, label %19, label %22
19: ; preds = %2
%20 = load i32, i32* @stderr
%21 = call i32 (i32, i8*, ...) @fprintf(i32 %20, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %130
22: ; preds = %2
%23 = load i32, i32* @AF_INET
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 1
%26 = load i8*, i8** %25
%27 = call i32 @inet_pton(i32 %23, i8* %26, %struct.in_addr* %6)
%28 = icmp ne i32 %27, 1
br i1 %28, label %29, label %35
29: ; preds = %22
%30 = load i32, i32* @stderr
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i64 1
%33 = load i8*, i8** %32
%34 = call i32 (i32, i8*, ...) @fprintf(i32 %30, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %33)
store i32 1, i32* %3
br label %130
35: ; preds = %22
%36 = load i8**, i8*** %5
%37 = getelementptr inbounds i8*, i8** %36, i64 2
%38 = load i8*, i8** %37
%39 = call i32 @atoi(i8* %38)
store i32 %39, i32* %7
%40 = load i32, i32* %7
%41 = icmp slt i32 %40, 8
br i1 %41, label %45, label %42
42: ; preds = %35
%43 = load i32, i32* %7
%44 = icmp sge i32 %43, 32
br i1 %44, label %45, label %48
45: ; preds = %42, %35
%46 = load i32, i32* @stderr
%47 = call i32 (i32, i8*, ...) @fprintf(i32 %46, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %3
br label %130
48: ; preds = %42
%49 = load i8**, i8*** %5
%50 = getelementptr inbounds i8*, i8** %49, i64 3
%51 = load i8*, i8** %50
%52 = call i32 @atoi(i8* %51)
store i32 %52, i32* %8
%53 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %6, i32 0, i32 0
%54 = load i8*, i8** %53
%55 = call i32 @ntohl(i8* %54)
store i32 %55, i32* %10
%56 = load i32, i32* %10
%57 = load i32, i32* %7
%58 = sub nsw i32 32, %57
%59 = shl i32 1, %58
%60 = and i32 %56, %59
%61 = icmp ne i32 %60, 0
br i1 %61, label %62, label %65
62: ; preds = %48
%63 = load i32, i32* @stderr
%64 = call i32 (i32, i8*, ...) @fprintf(i32 %63, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %3
br label %130
65: ; preds = %48
store i32 0, i32* %9
br label %66
66: ; preds = %121, %65
%67 = load i32, i32* %9
%68 = load i32, i32* %8
%69 = icmp slt i32 %67, %68
br i1 %69, label %70, label %129
70: ; preds = %66
%71 = load i32, i32* @INET_ADDRSTRLEN
%72 = zext i32 %71 to i64
%73 = call i8* @llvm.stacksave()
store i8* %73, i8** %12
%74 = alloca i8, i64 %72
store i64 %72, i64* %13
%75 = load i32, i32* @INET_ADDRSTRLEN
%76 = zext i32 %75 to i64
%77 = alloca i8, i64 %76
store i64 %76, i64* %14
%78 = load i32, i32* @INET_ADDRSTRLEN
%79 = zext i32 %78 to i64
%80 = alloca i8, i64 %79
store i64 %79, i64* %15
%81 = load i32, i32* %10
%82 = call i8* @htonl(i32 %81)
%83 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %11, i32 0, i32 0
store i8* %82, i8** %83
%84 = load i32, i32* @AF_INET
%85 = trunc i64 %72 to i32
%86 = call i32* @inet_ntop(i32 %84, %struct.in_addr* %11, i8* %74, i32 %85)
%87 = icmp eq i32* %86, null
br i1 %87, label %88, label %91
88: ; preds = %70
%89 = load i32, i32* @stderr
%90 = call i32 (i32, i8*, ...) @fprintf(i32 %89, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
store i32 1, i32* %3
store i32 1, i32* %16
br label %117
91: ; preds = %70
%92 = load i32, i32* %10
%93 = add nsw i32 %92, 1
%94 = call i8* @htonl(i32 %93)
%95 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %11, i32 0, i32 0
store i8* %94, i8** %95
%96 = load i32, i32* @AF_INET
%97 = trunc i64 %76 to i32
%98 = call i32* @inet_ntop(i32 %96, %struct.in_addr* %11, i8* %77, i32 %97)
%99 = icmp eq i32* %98, null
br i1 %99, label %100, label %103
100: ; preds = %91
%101 = load i32, i32* @stderr
%102 = call i32 (i32, i8*, ...) @fprintf(i32 %101, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
store i32 1, i32* %3
store i32 1, i32* %16
br label %117
103: ; preds = %91
%104 = load i32, i32* %10
%105 = add nsw i32 %104, 2
%106 = call i8* @htonl(i32 %105)
%107 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %11, i32 0, i32 0
store i8* %106, i8** %107
%108 = load i32, i32* @AF_INET
%109 = trunc i64 %79 to i32
%110 = call i32* @inet_ntop(i32 %108, %struct.in_addr* %11, i8* %80, i32 %109)
%111 = icmp eq i32* %110, null
br i1 %111, label %112, label %115
112: ; preds = %103
%113 = load i32, i32* @stderr
%114 = call i32 (i32, i8*, ...) @fprintf(i32 %113, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
store i32 1, i32* %3
store i32 1, i32* %16
br label %117
115: ; preds = %103
%116 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i8* %74, i8* %77, i8* %80)
store i32 0, i32* %16
br label %117
117: ; preds = %115, %112, %100, %88
%118 = load i8*, i8** %12
%119 = load i32, i32* %16
switch i32 %119, label %132 [
i32 0, label %120
i32 1, label %130
]
120: ; preds = %117
br label %121
121: ; preds = %120
%122 = load i32, i32* %9
%123 = add nsw i32 %122, 1
store i32 %123, i32* %9
%124 = load i32, i32* %7
%125 = sub nsw i32 32, %124
%126 = shl i32 1, %125
%127 = load i32, i32* %10
%128 = add nsw i32 %127, %126
store i32 %128, i32* %10
br label %66
129: ; preds = %66
store i32 0, i32* %3
br label %130
130: ; preds = %129, %117, %62, %45, %29, %19
%131 = load i32, i32* %3
ret i32 %131
132: ; preds = %117
unreachable
}

LLVM IR (-O2):
%struct.in_addr = type { i8* }
@stderr = global i32 0
@.str = [38 x i8] c"ip_sub: <starting ip> <bits> <count\0A>\00"
@AF_INET = global i32 0
@.str.1 = [24 x i8] c"argv[1] (%s) looks bad\0A\00"
@.str.2 = [37 x i8] c"bad subnet size, only [8, 32) valid\0A\00"
@.str.3 = [30 x i8] c"address doesn't match subnet\0A\00"
@INET_ADDRSTRLEN = global i32 0
@.str.4 = [20 x i8] c"conversion failed!\0A\00"
@.str.5 = [10 x i8] c"%s %s %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.in_addr
%4 = alloca %struct.in_addr
%5 = bitcast %struct.in_addr* %3 to i8*
%6 = icmp eq i32 %0, 4
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = tail call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
br label %83
10: ; preds = %2
%11 = load i32, i32* @AF_INET
%12 = getelementptr inbounds i8*, i8** %1, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @inet_pton(i32 %11, i8* %13, %struct.in_addr* %3)
%15 = icmp eq i32 %14, 1
br i1 %15, label %20, label %16
16: ; preds = %10
%17 = load i32, i32* @stderr
%18 = load i8*, i8** %12
%19 = call i32 (i32, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %18)
br label %83
20: ; preds = %10
%21 = getelementptr inbounds i8*, i8** %1, i64 2
%22 = load i8*, i8** %21
%23 = call i32 @atoi(i8* %22)
%24 = add i32 %23, -32
%25 = icmp ult i32 %24, -24
br i1 %25, label %26, label %29
26: ; preds = %20
%27 = load i32, i32* @stderr
%28 = call i32 (i32, i8*, ...) @fprintf(i32 %27, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
br label %83
29: ; preds = %20
%30 = getelementptr inbounds i8*, i8** %1, i64 3
%31 = load i8*, i8** %30
%32 = call i32 @atoi(i8* %31)
%33 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %3, i64 0, i32 0
%34 = load i8*, i8** %33
%35 = call i32 @ntohl(i8* %34)
%36 = sub nuw nsw i32 32, %23
%37 = shl nuw nsw i32 1, %36
%38 = and i32 %35, %37
%39 = icmp eq i32 %38, 0
br i1 %39, label %40, label %45
40: ; preds = %29
%41 = icmp sgt i32 %32, 0
br i1 %41, label %42, label %83
42: ; preds = %40
%43 = bitcast %struct.in_addr* %4 to i8*
%44 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %4, i64 0, i32 0
br label %48
45: ; preds = %29
%46 = load i32, i32* @stderr
%47 = call i32 (i32, i8*, ...) @fprintf(i32 %46, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
br label %83
48: ; preds = %42, %78
%49 = phi i32 [ 0, %42 ], [ %80, %78 ]
%50 = phi i32 [ %35, %42 ], [ %81, %78 ]
%51 = load i32, i32* @INET_ADDRSTRLEN
%52 = zext i32 %51 to i64
%53 = call i8* @llvm.stacksave()
%54 = alloca i8, i64 %52
%55 = load i32, i32* @INET_ADDRSTRLEN
%56 = zext i32 %55 to i64
%57 = alloca i8, i64 %56
%58 = alloca i8, i64 %56
%59 = call i8* @htonl(i32 %50)
store i8* %59, i8** %44
%60 = load i32, i32* @AF_INET
%61 = call i32* @inet_ntop(i32 %60, %struct.in_addr* %4, i8* %54, i32 %51)
%62 = icmp eq i32* %61, null
br i1 %62, label %75, label %63
63: ; preds = %48
%64 = add nsw i32 %50, 1
%65 = call i8* @htonl(i32 %64)
store i8* %65, i8** %44
%66 = load i32, i32* @AF_INET
%67 = call i32* @inet_ntop(i32 %66, %struct.in_addr* %4, i8* %57, i32 %55)
%68 = icmp eq i32* %67, null
br i1 %68, label %75, label %69
69: ; preds = %63
%70 = add nsw i32 %50, 2
%71 = call i8* @htonl(i32 %70)
store i8* %71, i8** %44
%72 = load i32, i32* @AF_INET
%73 = call i32* @inet_ntop(i32 %72, %struct.in_addr* %4, i8* %58, i32 %55)
%74 = icmp eq i32* %73, null
br i1 %74, label %75, label %78
75: ; preds = %69, %63, %48
%76 = load i32, i32* @stderr
%77 = call i32 (i32, i8*, ...) @fprintf(i32 %76, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
br label %83
78: ; preds = %69
%79 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i8* %54, i8* %57, i8* %58)
%80 = add nuw nsw i32 %49, 1
%81 = add nsw i32 %50, %37
%82 = icmp eq i32 %80, %32
br i1 %82, label %83, label %48
83: ; preds = %78, %40, %75, %45, %26, %16, %7
%84 = phi i32 [ 1, %7 ], [ 1, %16 ], [ 1, %26 ], [ 1, %45 ], [ 1, %75 ], [ 0, %40 ], [ 0, %78 ]
ret i32 %84
}