#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*/ fileno(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
scalar_t__ isatty(int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
void print_help(char *argv0) {
  fprintf(stderr, "\n ---portl---\n\n");
  fprintf(stderr, "Listens on given port for incoming connections/packets and "
                  "prints bytes to STDOUT.\n\n");
  fprintf(stderr, "Synopsis:\n");
  if (isatty(fileno(stdout)))
    fprintf(stderr, "\e[1m");
  fprintf(stderr, "portl [OPTIONS] [PORT]\n\n");
  if (isatty(fileno(stdout)))
    fprintf(stderr, "\e[0m");
  fprintf(stderr, "PORT = The port on which to listen\n\n");
  fprintf(stderr, "+------------------+--------------------------------+\n");
  fprintf(stderr, "| PARAMETER        | FUNCTION                       |\n");
  fprintf(stderr, "+------------------+--------------------------------+\n");
  fprintf(stderr, "| -u, --udp        | Run in UDP mode                |\n");
  fprintf(stderr, "| -t, --tcp        | Run in TCP mode (default)      |\n");
  fprintf(stderr, "| -h, --help       | Print this help message        |\n");
  fprintf(stderr, "| -v, --verbose    | Enable debugging output        |\n");
  fprintf(stderr, "| -p, --persistent | Always wait for new connection |\n");
  fprintf(stderr, "+------------------+--------------------------------+\n");
  fprintf(stderr,
          "\nArguments are handled in the order they are given and the last "
          "one of a type will overwrite any previous ones of the same type!\n");
}


x86 assembly (clang, -O0):
<print_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
lea    0xeb4(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
lea    0xeaf(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
lea    0xeef(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e56(%rip),%rax
mov    (%rax),%edi
call   1050 <fileno@plt>
mov    %eax,%edi
call   1030 <isatty@plt>
cmp    $0x0,%rax
je     11af <print_help+0x7f>
mov    0x2e3f(%rip),%rax
mov    (%rax),%edi
lea    0xec6(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e2a(%rip),%rax
mov    (%rax),%edi
lea    0xeb6(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e0d(%rip),%rax
mov    (%rax),%edi
call   1050 <fileno@plt>
mov    %eax,%edi
call   1030 <isatty@plt>
cmp    $0x0,%rax
je     11f8 <print_help+0xc8>
mov    0x2df6(%rip),%rax
mov    (%rax),%edi
lea    0xe9b(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2de1(%rip),%rax
mov    (%rax),%edi
lea    0xe8b(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2dcc(%rip),%rax
mov    (%rax),%edi
lea    0xe9b(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2db7(%rip),%rax
mov    (%rax),%edi
lea    0xebd(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2da2(%rip),%rax
mov    (%rax),%edi
lea    0xe71(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2d8d(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2d78(%rip),%rax
mov    (%rax),%edi
lea    0xeec(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2d63(%rip),%rax
mov    (%rax),%edi
lea    0xf0e(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2d4e(%rip),%rax
mov    (%rax),%edi
lea    0xf30(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2d39(%rip),%rax
mov    (%rax),%edi
lea    0xf52(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2d24(%rip),%rax
mov    (%rax),%edi
lea    0xdf3(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2d0f(%rip),%rax
mov    (%rax),%edi
lea    0xf5f(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_help>:
push   %r14
push   %rbx
push   %rax
mov    0x2ea5(%rip),%rbx
mov    (%rbx),%edi
lea    0xebc(%rip),%rsi
call   1040 <fprintf@plt>
mov    (%rbx),%edi
lea    0xebe(%rip),%rsi
call   1040 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf05(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e6c(%rip),%r14
mov    (%r14),%edi
call   1050 <fileno@plt>
mov    %eax,%edi
call   1030 <isatty@plt>
test   %rax,%rax
je     118e <print_help+0x5e>
mov    (%rbx),%edi
lea    0xee7(%rip),%rsi
call   1040 <fprintf@plt>
mov    (%rbx),%edi
lea    0xede(%rip),%rsi
call   1040 <fprintf@plt>
mov    (%r14),%edi
call   1050 <fileno@plt>
mov    %eax,%edi
call   1030 <isatty@plt>
test   %rax,%rax
je     11be <print_help+0x8e>
mov    (%rbx),%edi
lea    0xed5(%rip),%rsi
call   1040 <fprintf@plt>
mov    (%rbx),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    (%rbx),%edi
lea    0xee3(%rip),%r14
mov    %r14,%rsi
call   1040 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf09(%rip),%rsi
call   1040 <fprintf@plt>
mov    (%rbx),%edi
mov    %r14,%rsi
call   1040 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf28(%rip),%rsi
call   1040 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf51(%rip),%rsi
call   1040 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf7a(%rip),%rsi
call   1040 <fprintf@plt>
mov    (%rbx),%edi
lea    0xfa3(%rip),%rsi
call   1040 <fprintf@plt>
mov    (%rbx),%edi
lea    0xfcc(%rip),%rsi
call   1040 <fprintf@plt>
mov    (%rbx),%edi
mov    %r14,%rsi
call   1040 <fprintf@plt>
mov    (%rbx),%edi
lea    0xfeb(%rip),%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [16 x i8] c"\0A ---portl---\0A\0A\00"
@.str.1 = [85 x i8] c"Listens on given port for incoming connections/packets and prints bytes to STDOUT.\0A\0A\00"
@.str.2 = [11 x i8] c"Synopsis:\0A\00"
@stdout = global i32 0
@.str.3 = [5 x i8] c"\1B[1m\00"
@.str.4 = [25 x i8] c"portl [OPTIONS] [PORT]\0A\0A\00"
@.str.5 = [5 x i8] c"\1B[0m\00"
@.str.6 = [37 x i8] c"PORT = The port on which to listen\0A\0A\00"
@.str.7 = [55 x i8] c"+------------------+--------------------------------+\0A\00"
@.str.8 = [55 x i8] c"| PARAMETER | FUNCTION |\0A\00"
@.str.9 = [55 x i8] c"| -u, --udp | Run in UDP mode |\0A\00"
@.str.10 = [55 x i8] c"| -t, --tcp | Run in TCP mode (default) |\0A\00"
@.str.11 = [55 x i8] c"| -h, --help | Print this help message |\0A\00"
@.str.12 = [55 x i8] c"| -v, --verbose | Enable debugging output |\0A\00"
@.str.13 = [55 x i8] c"| -p, --persistent | Always wait for new connection |\0A\00"
@.str.14 = [130 x i8] c"\0AArguments are handled in the order they are given and the last one of a type will overwrite any previous ones of the same type!\0A\00"
define void @print_help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%9 = load i32, i32* @stdout
%10 = call i32 @fileno(i32 %9)
%11 = call i64 @isatty(i32 %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %1
%14 = load i32, i32* @stderr
%15 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
br label %16
16: ; preds = %13, %1
%17 = load i32, i32* @stderr
%18 = call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0))
%19 = load i32, i32* @stdout
%20 = call i32 @fileno(i32 %19)
%21 = call i64 @isatty(i32 %20)
%22 = icmp ne i64 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %16
%24 = load i32, i32* @stderr
%25 = call i32 @fprintf(i32 %24, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
br label %26
26: ; preds = %23, %16
%27 = load i32, i32* @stderr
%28 = call i32 @fprintf(i32 %27, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.6, i64 0, i64 0))
%29 = load i32, i32* @stderr
%30 = call i32 @fprintf(i32 %29, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.7, i64 0, i64 0))
%31 = load i32, i32* @stderr
%32 = call i32 @fprintf(i32 %31, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.8, i64 0, i64 0))
%33 = load i32, i32* @stderr
%34 = call i32 @fprintf(i32 %33, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.7, i64 0, i64 0))
%35 = load i32, i32* @stderr
%36 = call i32 @fprintf(i32 %35, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.9, i64 0, i64 0))
%37 = load i32, i32* @stderr
%38 = call i32 @fprintf(i32 %37, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.10, i64 0, i64 0))
%39 = load i32, i32* @stderr
%40 = call i32 @fprintf(i32 %39, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.11, i64 0, i64 0))
%41 = load i32, i32* @stderr
%42 = call i32 @fprintf(i32 %41, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.12, i64 0, i64 0))
%43 = load i32, i32* @stderr
%44 = call i32 @fprintf(i32 %43, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.13, i64 0, i64 0))
%45 = load i32, i32* @stderr
%46 = call i32 @fprintf(i32 %45, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.7, i64 0, i64 0))
%47 = load i32, i32* @stderr
%48 = call i32 @fprintf(i32 %47, i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str.14, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"\0A ---portl---\0A\0A\00"
@.str.1 = [85 x i8] c"Listens on given port for incoming connections/packets and prints bytes to STDOUT.\0A\0A\00"
@.str.2 = [11 x i8] c"Synopsis:\0A\00"
@stdout = global i32 0
@.str.3 = [5 x i8] c"\1B[1m\00"
@.str.4 = [25 x i8] c"portl [OPTIONS] [PORT]\0A\0A\00"
@.str.5 = [5 x i8] c"\1B[0m\00"
@.str.6 = [37 x i8] c"PORT = The port on which to listen\0A\0A\00"
@.str.7 = [55 x i8] c"+------------------+--------------------------------+\0A\00"
@.str.8 = [55 x i8] c"| PARAMETER | FUNCTION |\0A\00"
@.str.9 = [55 x i8] c"| -u, --udp | Run in UDP mode |\0A\00"
@.str.10 = [55 x i8] c"| -t, --tcp | Run in TCP mode (default) |\0A\00"
@.str.11 = [55 x i8] c"| -h, --help | Print this help message |\0A\00"
@.str.12 = [55 x i8] c"| -v, --verbose | Enable debugging output |\0A\00"
@.str.13 = [55 x i8] c"| -p, --persistent | Always wait for new connection |\0A\00"
@.str.14 = [130 x i8] c"\0AArguments are handled in the order they are given and the last one of a type will overwrite any previous ones of the same type!\0A\00"
define void @print_help(i8* nocapture readnone %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%8 = load i32, i32* @stdout
%9 = tail call i32 @fileno(i32 %8)
%10 = tail call i64 @isatty(i32 %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %1
%13 = load i32, i32* @stderr
%14 = tail call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
br label %15
15: ; preds = %12, %1
%16 = load i32, i32* @stderr
%17 = tail call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0))
%18 = load i32, i32* @stdout
%19 = tail call i32 @fileno(i32 %18)
%20 = tail call i64 @isatty(i32 %19)
%21 = icmp eq i64 %20, 0
br i1 %21, label %25, label %22
22: ; preds = %15
%23 = load i32, i32* @stderr
%24 = tail call i32 @fprintf(i32 %23, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
br label %25
25: ; preds = %22, %15
%26 = load i32, i32* @stderr
%27 = tail call i32 @fprintf(i32 %26, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.6, i64 0, i64 0))
%28 = load i32, i32* @stderr
%29 = tail call i32 @fprintf(i32 %28, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.7, i64 0, i64 0))
%30 = load i32, i32* @stderr
%31 = tail call i32 @fprintf(i32 %30, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.8, i64 0, i64 0))
%32 = load i32, i32* @stderr
%33 = tail call i32 @fprintf(i32 %32, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.7, i64 0, i64 0))
%34 = load i32, i32* @stderr
%35 = tail call i32 @fprintf(i32 %34, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.9, i64 0, i64 0))
%36 = load i32, i32* @stderr
%37 = tail call i32 @fprintf(i32 %36, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.10, i64 0, i64 0))
%38 = load i32, i32* @stderr
%39 = tail call i32 @fprintf(i32 %38, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.11, i64 0, i64 0))
%40 = load i32, i32* @stderr
%41 = tail call i32 @fprintf(i32 %40, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.12, i64 0, i64 0))
%42 = load i32, i32* @stderr
%43 = tail call i32 @fprintf(i32 %42, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.13, i64 0, i64 0))
%44 = load i32, i32* @stderr
%45 = tail call i32 @fprintf(i32 %44, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.7, i64 0, i64 0))
%46 = load i32, i32* @stderr
%47 = tail call i32 @fprintf(i32 %46, i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str.14, i64 0, i64 0))
ret void
}