#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*/ fprintf(int /*<<< orphan*/, char *, ...);
int main0(long, long);
int sscanf(char *, char *, long *);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  int ngood;
  long ip_min = 0, ip_max = 4294967295;
  if (argc > 1) {
    if (argc != 3) {
      fprintf(stderr,
              "must provide exactly two arguments: <ip_min> <ip_max>\n");
      return 1;
    }
    ngood = sscanf(argv[1], "%ld", &ip_min);
    if (ngood != 1) {
      fprintf(stderr, "bad argument: %s\n", argv[1]);
      return 1;
    }
    ngood = sscanf(argv[2], "%ld", &ip_max);
    if (ngood != 1) {
      fprintf(stderr, "bad argument: %s\n", argv[2]);
      return 1;
    }
  }
  return main0(ip_min, ip_max);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x20(%rbp)
mov    $0xffffffff,%eax
mov    %rax,-0x28(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1233 <main+0x103>
cmpl   $0x3,-0x8(%rbp)
je     118e <main+0x5e>
mov    0x2e6e(%rip),%rax
mov    (%rax),%edi
lea    0xe85(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1243 <main+0x113>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe9a(%rip),%rsi
lea    -0x20(%rbp),%rdx
call   1040 <sscanf@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
je     11de <main+0xae>
mov    0x2e26(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xe70(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1243 <main+0x113>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xe4a(%rip),%rsi
lea    -0x28(%rbp),%rdx
call   1040 <sscanf@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
je     122e <main+0xfe>
mov    0x2dd6(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdx
lea    0xe20(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1243 <main+0x113>
jmp    1233 <main+0x103>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1050 <main0@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    $0xffffffff,%esi
movq   $0x0,0x8(%rsp)
mov    %rsi,(%rsp)
cmp    $0x2,%edi
jl     1191 <main+0x61>
cmp    $0x3,%edi
jne    119a <main+0x6a>
mov    0x8(%rbx),%rdi
lea    0xed8(%rip),%rsi
lea    0x8(%rsp),%rdx
call   1040 <sscanf@plt>
cmp    $0x1,%eax
jne    11b3 <main+0x83>
mov    0x10(%rbx),%rdi
lea    0xebe(%rip),%rsi
mov    %rsp,%rdx
call   1040 <sscanf@plt>
cmp    $0x1,%eax
jne    11c2 <main+0x92>
mov    0x8(%rsp),%rdi
mov    (%rsp),%rsi
jmp    1193 <main+0x63>
xor    %edi,%edi
call   1050 <main0@plt>
jmp    11e2 <main+0xb2>
mov    0x2e3f(%rip),%rax
mov    (%rax),%edi
lea    0xe56(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
jmp    11dd <main+0xad>
mov    0x2e26(%rip),%rax
mov    (%rax),%edi
mov    0x8(%rbx),%rdx
jmp    11cf <main+0x9f>
mov    0x2e17(%rip),%rax
mov    (%rax),%edi
mov    0x10(%rbx),%rdx
lea    0xe65(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [55 x i8] c"must provide exactly two arguments: <ip_min> <ip_max>\0A\00"
@.str.1 = [4 x i8] c"%ld\00"
@.str.2 = [18 x i8] c"bad argument: %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i64
%8 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 0, i64* %7
store i64 4294967295, i64* %8
%9 = load i32, i32* %4
%10 = icmp sgt i32 %9, 1
br i1 %10, label %11, label %44
11: ; preds = %2
%12 = load i32, i32* %4
%13 = icmp ne i32 %12, 3
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load i32, i32* @stderr
%16 = call i32 (i32, i8*, ...) @fprintf(i32 %15, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %48
17: ; preds = %11
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 1
%20 = load i8*, i8** %19
%21 = call i32 @sscanf(i8* %20, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64* %7)
store i32 %21, i32* %6
%22 = load i32, i32* %6
%23 = icmp ne i32 %22, 1
br i1 %23, label %24, label %30
24: ; preds = %17
%25 = load i32, i32* @stderr
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 1
%28 = load i8*, i8** %27
%29 = call i32 (i32, i8*, ...) @fprintf(i32 %25, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* %28)
store i32 1, i32* %3
br label %48
30: ; preds = %17
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i64 2
%33 = load i8*, i8** %32
%34 = call i32 @sscanf(i8* %33, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64* %8)
store i32 %34, i32* %6
%35 = load i32, i32* %6
%36 = icmp ne i32 %35, 1
br i1 %36, label %37, label %43
37: ; preds = %30
%38 = load i32, i32* @stderr
%39 = load i8**, i8*** %5
%40 = getelementptr inbounds i8*, i8** %39, i64 2
%41 = load i8*, i8** %40
%42 = call i32 (i32, i8*, ...) @fprintf(i32 %38, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* %41)
store i32 1, i32* %3
br label %48
43: ; preds = %30
br label %44
44: ; preds = %43, %2
%45 = load i64, i64* %7
%46 = load i64, i64* %8
%47 = call i32 @main0(i64 %45, i64 %46)
store i32 %47, i32* %3
br label %48
48: ; preds = %44, %37, %24, %14
%49 = load i32, i32* %3
ret i32 %49
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [55 x i8] c"must provide exactly two arguments: <ip_min> <ip_max>\0A\00"
@.str.1 = [4 x i8] c"%ld\00"
@.str.2 = [18 x i8] c"bad argument: %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i64
%4 = alloca i64
%5 = bitcast i64* %3 to i8*
store i64 0, i64* %3
%6 = bitcast i64* %4 to i8*
store i64 4294967295, i64* %4
%7 = icmp sgt i32 %0, 1
br i1 %7, label %8, label %34
8: ; preds = %2
%9 = icmp eq i32 %0, 3
br i1 %9, label %13, label %10
10: ; preds = %8
%11 = load i32, i32* @stderr
%12 = tail call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
br label %38
13: ; preds = %8
%14 = getelementptr inbounds i8*, i8** %1, i64 1
%15 = load i8*, i8** %14
%16 = call i32 @sscanf(i8* %15, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64* %3)
%17 = icmp eq i32 %16, 1
br i1 %17, label %22, label %18
18: ; preds = %13
%19 = load i32, i32* @stderr
%20 = load i8*, i8** %14
%21 = call i32 (i32, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* %20)
br label %38
22: ; preds = %13
%23 = getelementptr inbounds i8*, i8** %1, i64 2
%24 = load i8*, i8** %23
%25 = call i32 @sscanf(i8* %24, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64* %4)
%26 = icmp eq i32 %25, 1
br i1 %26, label %27, label %30
27: ; preds = %22
%28 = load i64, i64* %3
%29 = load i64, i64* %4
br label %34
30: ; preds = %22
%31 = load i32, i32* @stderr
%32 = load i8*, i8** %23
%33 = call i32 (i32, i8*, ...) @fprintf(i32 %31, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* %32)
br label %38
34: ; preds = %27, %2
%35 = phi i64 [ %29, %27 ], [ 4294967295, %2 ]
%36 = phi i64 [ %28, %27 ], [ 0, %2 ]
%37 = call i32 @main0(i64 %36, i64 %35)
br label %38
38: ; preds = %34, %30, %18, %10
%39 = phi i32 [ 1, %10 ], [ 1, %18 ], [ 1, %30 ], [ %37, %34 ]
ret i32 %39
}