#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*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *, ...);
int process_loop(int, char **);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  if (argc != 3) {
    fprintf(stderr,
            "\n%s\nversion %s\n\nUsage:\n  %s host1,host2  "
            "port1,port2,port-port\n\nExample:\n  %s gmail.com,google.com "
            "80,440-444\n\n",
            "Source: https://github.com/mchirico/ct", "0.0.4b", argv[0],
            argv[0]);
    fprintf(
        stderr, "\nSteps to get and build latest verson:\n%s\n%s",
        "  curl  https://raw.githubusercontent.com/mchirico/ct/master/src/ct.c "
        " > ct.c",
        "  gcc ct.c -o ct -lpthread\n\n");
    exit(EXIT_FAILURE);
  }
  return process_loop(argc, argv);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     11b6 <main+0x86>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%r8
mov    -0x10(%rbp),%rax
mov    (%rax),%r9
lea    0xe92(%rip),%rsi
lea    0xefb(%rip),%rdx
lea    0xf1b(%rip),%rcx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2e56(%rip),%rax
mov    (%rax),%edi
lea    0xf0b(%rip),%rsi
lea    0xf31(%rip),%rdx
lea    0xf78(%rip),%rcx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2e29(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <process_loop@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x3,%edi
jne    113f <main+0xf>
mov    $0x3,%edi
jmp    1030 <process_loop@plt>
push   %rbx
mov    0x2e99(%rip),%rbx
mov    (%rbx),%edi
mov    (%rsi),%r8
lea    0xead(%rip),%rsi
lea    0xf16(%rip),%rdx
lea    0xf36(%rip),%rcx
mov    %r8,%r9
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf2a(%rip),%rsi
lea    0xf50(%rip),%rdx
lea    0xf97(%rip),%rcx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    0x2e48(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [112 x i8] c"\0A%s\0Aversion %s\0A\0AUsage:\0A %s host1,host2 port1,port2,port-port\0A\0AExample:\0A %s gmail.com,google.com 80,440-444\0A\0A\00"
@.str.1 = [39 x i8] c"Source: https://github.com/mchirico/ct\00"
@.str.2 = [7 x i8] c"0.0.4b\00"
@.str.3 = [45 x i8] c"\0ASteps to get and build latest verson:\0A%s\0A%s\00"
@.str.4 = [78 x i8] c" curl https://raw.githubusercontent.com/mchirico/ct/master/src/ct.c > ct.c\00"
@.str.5 = [29 x i8] c" gcc ct.c -o ct -lpthread\0A\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 3
br i1 %7, label %8, label %21
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 0
%12 = load i8*, i8** %11
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 0
%15 = load i8*, i8** %14
%16 = call i32 (i32, i8*, i8*, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([112 x i8], [112 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %12, i8* %15)
%17 = load i32, i32* @stderr
%18 = call i32 (i32, i8*, i8*, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0))
%19 = load i32, i32* @EXIT_FAILURE
%20 = call i32 @exit(i32 %19)
unreachable
21: ; preds = %2
%22 = load i32, i32* %4
%23 = load i8**, i8*** %5
%24 = call i32 @process_loop(i32 %22, i8** %23)
ret i32 %24
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [112 x i8] c"\0A%s\0Aversion %s\0A\0AUsage:\0A %s host1,host2 port1,port2,port-port\0A\0AExample:\0A %s gmail.com,google.com 80,440-444\0A\0A\00"
@.str.1 = [39 x i8] c"Source: https://github.com/mchirico/ct\00"
@.str.2 = [7 x i8] c"0.0.4b\00"
@.str.3 = [45 x i8] c"\0ASteps to get and build latest verson:\0A%s\0A%s\00"
@.str.4 = [78 x i8] c" curl https://raw.githubusercontent.com/mchirico/ct/master/src/ct.c > ct.c\00"
@.str.5 = [29 x i8] c" gcc ct.c -o ct -lpthread\0A\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %1
%7 = tail call i32 (i32, i8*, i8*, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([112 x i8], [112 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %6, i8* %6)
%8 = load i32, i32* @stderr
%9 = tail call i32 (i32, i8*, i8*, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0))
%10 = load i32, i32* @EXIT_FAILURE
%11 = tail call i32 @exit(i32 %10)
unreachable
12: ; preds = %2
%13 = tail call i32 @process_loop(i32 3, i8** %1)
ret i32 %13
}