#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 /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("[\n");
  printf("[ --server|-s <ip/dns>    - the server to target\n");
  printf("[ --port|-p   <port>      - the port to target\n");
  printf("[ --file|-f   <filename>  - file to write data to\n");
  printf("[ --bind|-b   <ip>        - bind to ip for exploiting clients\n");
  printf("[ --precmd|-c <n>         - send precmd buffer (STARTTLS)\n");
  printf("[			    0 = SMTP\n");
  printf("[			    1 = POP3\n");
  printf("[			    2 = IMAP\n");
  printf("[ --loop|-l		  - loop the exploit attempts\n");
  printf("[ --type|-t   <n>         - select exploit to try\n");
  printf("[                           0 = null length\n");
  printf("[			    1 = max leak\n");
  printf("[			    n = heartbeat payload_length\n");
  printf("[ --udp|-u               - use dtls/udp\n");
  printf("[\n");
  printf("[ --verbose|-v            - output leak to screen\n");
  printf("[ --help|-h               - this output\n");
  printf("[\n");
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
lea    0xef2(%rip),%rdi
call   1030 <printf@plt>
lea    0xf16(%rip),%rdi
call   1030 <printf@plt>
lea    0xf3d(%rip),%rdi
call   1030 <printf@plt>
lea    0xf70(%rip),%rdi
call   1030 <printf@plt>
lea    0xf9f(%rip),%rdi
call   1030 <printf@plt>
lea    0xfa5(%rip),%rdi
call   1030 <printf@plt>
lea    0xfab(%rip),%rdi
call   1030 <printf@plt>
lea    0xfb1(%rip),%rdi
call   1030 <printf@plt>
lea    0xfd1(%rip),%rdi
call   1030 <printf@plt>
lea    0xff8(%rip),%rdi
call   1030 <printf@plt>
lea    0x1019(%rip),%rdi
call   1030 <printf@plt>
lea    0x1023(%rip),%rdi
call   1030 <printf@plt>
lea    0x103d(%rip),%rdi
call   1030 <printf@plt>
lea    0xe21(%rip),%rdi
call   1030 <printf@plt>
lea    0x104e(%rip),%rdi
call   1030 <printf@plt>
lea    0x1075(%rip),%rdi
call   1030 <printf@plt>
lea    0xdfd(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
lea    0x115a(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xec9(%rip),%rdi
call   1030 <puts@plt>
lea    0xeee(%rip),%rdi
call   1030 <puts@plt>
lea    0xf11(%rip),%rdi
call   1030 <puts@plt>
lea    0xf37(%rip),%rdi
call   1030 <puts@plt>
lea    0xf69(%rip),%rdi
call   1030 <puts@plt>
lea    0xf97(%rip),%rdi
call   1030 <puts@plt>
lea    0xf9c(%rip),%rdi
call   1030 <puts@plt>
lea    0xfa1(%rip),%rdi
call   1030 <puts@plt>
lea    0xfa6(%rip),%rdi
call   1030 <puts@plt>
lea    0xfc5(%rip),%rdi
call   1030 <puts@plt>
lea    0xfeb(%rip),%rdi
call   1030 <puts@plt>
lea    0x100b(%rip),%rdi
call   1030 <puts@plt>
lea    0x1014(%rip),%rdi
call   1030 <puts@plt>
lea    0x102d(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0x1041(%rip),%rdi
call   1030 <puts@plt>
lea    0x1067(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"[\0A\00"
@.str.1 = [50 x i8] c"[ --server|-s <ip/dns> - the server to target\0A\00"
@.str.2 = [48 x i8] c"[ --port|-p <port> - the port to target\0A\00"
@.str.3 = [51 x i8] c"[ --file|-f <filename> - file to write data to\0A\00"
@.str.4 = [63 x i8] c"[ --bind|-b <ip> - bind to ip for exploiting clients\0A\00"
@.str.5 = [59 x i8] c"[ --precmd|-c <n> - send precmd buffer (STARTTLS)\0A\00"
@.str.6 = [18 x i8] c"[\09\09\09 0 = SMTP\0A\00"
@.str.7 = [18 x i8] c"[\09\09\09 1 = POP3\0A\00"
@.str.8 = [18 x i8] c"[\09\09\09 2 = IMAP\0A\00"
@.str.9 = [44 x i8] c"[ --loop|-l\09\09 - loop the exploit attempts\0A\00"
@.str.10 = [51 x i8] c"[ --type|-t <n> - select exploit to try\0A\00"
@.str.11 = [45 x i8] c"[ 0 = null length\0A\00"
@.str.12 = [22 x i8] c"[\09\09\09 1 = max leak\0A\00"
@.str.13 = [38 x i8] c"[\09\09\09 n = heartbeat payload_length\0A\00"
@.str.14 = [41 x i8] c"[ --udp|-u - use dtls/udp\0A\00"
@.str.15 = [51 x i8] c"[ --verbose|-v - output leak to screen\0A\00"
@.str.16 = [41 x i8] c"[ --help|-h - this output\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.4, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.5, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.9, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.10, i64 0, i64 0))
%12 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.11, i64 0, i64 0))
%13 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.12, i64 0, i64 0))
%14 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.13, i64 0, i64 0))
%15 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.14, i64 0, i64 0))
%16 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%17 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.15, i64 0, i64 0))
%18 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.16, i64 0, i64 0))
%19 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%20 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str.17 = [49 x i8] c"[ --server|-s <ip/dns> - the server to target\00"
@str.18 = [47 x i8] c"[ --port|-p <port> - the port to target\00"
@str.19 = [50 x i8] c"[ --file|-f <filename> - file to write data to\00"
@str.20 = [62 x i8] c"[ --bind|-b <ip> - bind to ip for exploiting clients\00"
@str.21 = [58 x i8] c"[ --precmd|-c <n> - send precmd buffer (STARTTLS)\00"
@str.22 = [17 x i8] c"[\09\09\09 0 = SMTP\00"
@str.23 = [17 x i8] c"[\09\09\09 1 = POP3\00"
@str.24 = [17 x i8] c"[\09\09\09 2 = IMAP\00"
@str.25 = [43 x i8] c"[ --loop|-l\09\09 - loop the exploit attempts\00"
@str.26 = [50 x i8] c"[ --type|-t <n> - select exploit to try\00"
@str.27 = [44 x i8] c"[ 0 = null length\00"
@str.28 = [21 x i8] c"[\09\09\09 1 = max leak\00"
@str.29 = [37 x i8] c"[\09\09\09 n = heartbeat payload_length\00"
@str.30 = [40 x i8] c"[ --udp|-u - use dtls/udp\00"
@str.32 = [50 x i8] c"[ --verbose|-v - output leak to screen\00"
@str.33 = [40 x i8] c"[ --help|-h - this output\00"
@str.34 = [2 x i8] c"[\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.34, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.17, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str.18, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.19, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str.20, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str.21, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.22, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.23, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.24, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.25, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.26, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.27, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.28, i64 0, i64 0))
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.29, i64 0, i64 0))
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.30, i64 0, i64 0))
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.34, i64 0, i64 0))
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.32, i64 0, i64 0))
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.33, i64 0, i64 0))
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.34, i64 0, i64 0))
%20 = tail call i32 @exit(i32 0)
unreachable
}