#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(int);
int /*<<< orphan*/ printf(char *, char *, char *);
int strlen(char *);
void print_help(char *name) {
  char *p;
  p = name + strlen(name);
  while (p != name && *p != '\\' && *p != '/')
    p--;
  if (p != name)
    name = p + 1;
  printf(
      "Proxylite %s - Simple, no threads, non-caching proxy server\n"
      "   Usage: %s [OPTIONS]\n\n"
      "   -h|--help    Show this help and quit\n"
      "   -f|--fork    Run in background (does not work in Windows)\n"
      "   -d|--debug   Print some debug messages while running\n"
      "   -4|--ipv4    Prefer IPV4 while resolving names\n"
      "   -6|--ipv6    Prefer IPV6 while resolving names\n"
      "   -p4 <port>   Port to bind the IPV4 socket\n"
      "   -p6 <port>   Port to bind the IPV6 socket\n"
      "   -b4 <ipv4>   Local IP to bind the IPV4 socket\n"
      "   -b6 <ipv6>   Local IP to bind the IPV6 socket\n"
      "   --relay <ip> <port> Send all traffic to another proxy server\n\n"
      "   --test <name> <port> Do 100 connections to the specified proxy\n"
      "                         and request the '/' URI from 5 well known\n"
      "                         sites, quit after the test.\n"
      "   --ltest <name> <port> Same as previous but connects to 127.0.0.1:80\n"
      "\nIf -b4|-b6 is not set they will bind to all available addresses.\n"
      "To disable IPV4 don't set -p4 or set to 0 (zero), same for IPV6.\n"
      "If -4 and -6 are used as argument the last used will be preferred.\n"
      "Using -f|--fork disables -d|--debug.\n\n",
      "0.4", name);
  exit(2);
}


x86 assembly (clang, -O0):
<print_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
cmp    -0x8(%rbp),%rcx
mov    %al,-0x19(%rbp)
je     1195 <print_help+0x65>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x5c,%ecx
mov    %al,-0x19(%rbp)
je     1195 <print_help+0x65>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    11a5 <print_help+0x75>
jmp    11b6 <print_help+0x86>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
jmp    115d <print_help+0x2d>
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
je     11d0 <print_help+0xa0>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xe25(%rip),%rdi
lea    0x125e(%rip),%rsi
call   1040 <printf@plt>
mov    $0x2,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<print_help>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %eax,%eax
je     115d <print_help+0x2d>
cltq
nop
movzbl (%rbx,%rax,1),%ecx
cmp    $0x2f,%cl
je     1156 <print_help+0x26>
cmp    $0x5c,%cl
je     1156 <print_help+0x26>
add    $0xffffffffffffffff,%rax
jne    1140 <print_help+0x10>
jmp    115d <print_help+0x2d>
add    %rax,%rbx
add    $0x1,%rbx
lea    0xe9c(%rip),%rdi
lea    0x12d5(%rip),%rsi
mov    %rbx,%rdx
call   1040 <printf@plt>
mov    $0x2,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [1088 x i8] c"Proxylite %s - Simple, no threads, non-caching proxy server\0A Usage: %s [OPTIONS]\0A\0A -h|--help Show this help and quit\0A -f|--fork Run in background (does not work in Windows)\0A -d|--debug Print some debug messages while running\0A -4|--ipv4 Prefer IPV4 while resolving names\0A -6|--ipv6 Prefer IPV6 while resolving names\0A -p4 <port> Port to bind the IPV4 socket\0A -p6 <port> Port to bind the IPV6 socket\0A -b4 <ipv4> Local IP to bind the IPV4 socket\0A -b6 <ipv6> Local IP to bind the IPV6 socket\0A --relay <ip> <port> Send all traffic to another proxy server\0A\0A --test <name> <port> Do 100 connections to the specified proxy\0A and request the '/' URI from 5 well known\0A sites, quit after the test.\0A --ltest <name> <port> Same as previous but connects to 127.0.0.1:80\0A\0AIf -b4|-b6 is not set they will bind to all available addresses.\0ATo disable IPV4 don't set -p4 or set to 0 (zero), same for IPV6.\0AIf -4 and -6 are used as argument the last used will be preferred.\0AUsing -f|--fork disables -d|--debug.\0A\0A\00"
@.str.1 = [4 x i8] c"0.4\00"
define void @print_help(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %4, i64 %7
store i8* %8, i8** %3
br label %9
9: ; preds = %25, %1
%10 = load i8*, i8** %3
%11 = load i8*, i8** %2
%12 = icmp ne i8* %10, %11
br i1 %12, label %13, label %23
13: ; preds = %9
%14 = load i8*, i8** %3
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp ne i32 %16, 92
br i1 %17, label %18, label %23
18: ; preds = %13
%19 = load i8*, i8** %3
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp ne i32 %21, 47
br label %23
23: ; preds = %18, %13, %9
%24 = phi i1 [ false, %13 ], [ false, %9 ], [ %22, %18 ]
br i1 %24, label %25, label %28
25: ; preds = %23
%26 = load i8*, i8** %3
%27 = getelementptr inbounds i8, i8* %26, i32 -1
store i8* %27, i8** %3
br label %9
28: ; preds = %23
%29 = load i8*, i8** %3
%30 = load i8*, i8** %2
%31 = icmp ne i8* %29, %30
br i1 %31, label %32, label %35
32: ; preds = %28
%33 = load i8*, i8** %3
%34 = getelementptr inbounds i8, i8* %33, i64 1
store i8* %34, i8** %2
br label %35
35: ; preds = %32, %28
%36 = load i8*, i8** %2
%37 = call i32 @printf(i8* getelementptr inbounds ([1088 x i8], [1088 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %36)
%38 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@.str = [1088 x i8] c"Proxylite %s - Simple, no threads, non-caching proxy server\0A Usage: %s [OPTIONS]\0A\0A -h|--help Show this help and quit\0A -f|--fork Run in background (does not work in Windows)\0A -d|--debug Print some debug messages while running\0A -4|--ipv4 Prefer IPV4 while resolving names\0A -6|--ipv6 Prefer IPV6 while resolving names\0A -p4 <port> Port to bind the IPV4 socket\0A -p6 <port> Port to bind the IPV6 socket\0A -b4 <ipv4> Local IP to bind the IPV4 socket\0A -b6 <ipv6> Local IP to bind the IPV6 socket\0A --relay <ip> <port> Send all traffic to another proxy server\0A\0A --test <name> <port> Do 100 connections to the specified proxy\0A and request the '/' URI from 5 well known\0A sites, quit after the test.\0A --ltest <name> <port> Same as previous but connects to 127.0.0.1:80\0A\0AIf -b4|-b6 is not set they will bind to all available addresses.\0ATo disable IPV4 don't set -p4 or set to 0 (zero), same for IPV6.\0AIf -4 and -6 are used as argument the last used will be preferred.\0AUsing -f|--fork disables -d|--debug.\0A\0A\00"
@.str.1 = [4 x i8] c"0.4\00"
define void @print_help(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
br label %7
7: ; preds = %4, %10
%8 = phi i8* [ %11, %10 ], [ %6, %4 ]
%9 = load i8, i8* %8
switch i8 %9, label %10 [
i8 92, label %13
i8 47, label %13
]
10: ; preds = %7
%11 = getelementptr inbounds i8, i8* %8, i64 -1
%12 = icmp eq i8* %11, %0
br i1 %12, label %15, label %7
13: ; preds = %7, %7
%14 = getelementptr inbounds i8, i8* %8, i64 1
br label %15
15: ; preds = %10, %1, %13
%16 = phi i8* [ %14, %13 ], [ %0, %1 ], [ %0, %10 ]
%17 = tail call i32 @printf(i8* getelementptr inbounds ([1088 x i8], [1088 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %16)
%18 = tail call i32 @exit(i32 2)
unreachable
}