#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*/ print_version();
int /*<<< orphan*/ printf(char *);
void print_help() {
  print_version();
  printf("A PoC to bruteforce the Cryptsetup implementation of Linux Unified "
         "Key Setup (LUKS).\n");
  printf(
      "See http://crypt.coffee/research/luks.html for more information.\n\n");
  printf("Usage: skul [-h] [-v] <filename>\n\n");
  printf("Options:\n");
  printf("   -h\tdisplay this help text and exit\n");
  printf("   -v\tdisplay version information and exit\n\n");
  printf("Filename:\n");
  printf("   The name of the file containing the LUKS encrypted partition.\n");
  printf("   For testing purposes Skul comes with an example cryptsetup's "
         "encrypted\n");
  printf("   partition header in the `disks/` directory.\n");
  printf("   To test your own disk you first need to dump the LUKS header of "
         "the partition:\n");
  printf("      # dd if=/dev/sdX of=./my_dump bs=1024 count=3072\n");
  printf("      # chown myusr:myusr ./my_dump\n");
  printf("   Then you can run:\n");
  printf("      $ skul ./my_dump\n\n");
  printf("Configuring Skul:\n");
  printf("   You can configure Skul through it's configuration file "
         "`conf/skul.cfg`\n\n");
  printf("** For BlackArch Linux users:\n");
  printf("   You can find the Skul directory at `/usr/share/skul`\n\n");
  printf("Report bugs to sha@crypt.coffee\n");
  printf("Cryptcoffee Skul home page: https://github.com/cryptcoffee/skul\n");
}


x86 assembly (clang, -O0):
<print_help>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <print_version@plt>
lea    0xece(%rip),%rdi
call   1040 <printf@plt>
lea    0xf18(%rip),%rdi
call   1040 <printf@plt>
lea    0xf4f(%rip),%rdi
call   1040 <printf@plt>
lea    0xf66(%rip),%rdi
call   1040 <printf@plt>
lea    0xf64(%rip),%rdi
call   1040 <printf@plt>
lea    0xf7f(%rip),%rdi
call   1040 <printf@plt>
lea    0xfa0(%rip),%rdi
call   1040 <printf@plt>
lea    0xf9f(%rip),%rdi
call   1040 <printf@plt>
lea    0xfd5(%rip),%rdi
call   1040 <printf@plt>
lea    0x1014(%rip),%rdi
call   1040 <printf@plt>
lea    0x1038(%rip),%rdi
call   1040 <printf@plt>
lea    0x107f(%rip),%rdi
call   1040 <printf@plt>
lea    0x10ab(%rip),%rdi
call   1040 <printf@plt>
lea    0x10c4(%rip),%rdi
call   1040 <printf@plt>
lea    0x10ce(%rip),%rdi
call   1040 <printf@plt>
lea    0x10db(%rip),%rdi
call   1040 <printf@plt>
lea    0x10e2(%rip),%rdi
call   1040 <printf@plt>
lea    0x1122(%rip),%rdi
call   1040 <printf@plt>
lea    0x1135(%rip),%rdi
call   1040 <printf@plt>
lea    0x1163(%rip),%rdi
call   1040 <printf@plt>
lea    0x1178(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_help>:
push   %rax
xor    %eax,%eax
call   1040 <print_version@plt>
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1a(%rip),%rdi
call   1030 <puts@plt>
lea    0xf50(%rip),%rdi
call   1030 <puts@plt>
lea    0xf66(%rip),%rdi
call   1030 <puts@plt>
lea    0xf63(%rip),%rdi
call   1030 <puts@plt>
lea    0xf7d(%rip),%rdi
call   1030 <puts@plt>
lea    0xf9d(%rip),%rdi
call   1030 <puts@plt>
lea    0xf9b(%rip),%rdi
call   1030 <puts@plt>
lea    0xfd0(%rip),%rdi
call   1030 <puts@plt>
lea    0x100e(%rip),%rdi
call   1030 <puts@plt>
lea    0x1031(%rip),%rdi
call   1030 <puts@plt>
lea    0x1077(%rip),%rdi
call   1030 <puts@plt>
lea    0x10a2(%rip),%rdi
call   1030 <puts@plt>
lea    0x10ba(%rip),%rdi
call   1030 <puts@plt>
lea    0x10c3(%rip),%rdi
call   1030 <puts@plt>
lea    0x10cf(%rip),%rdi
call   1030 <puts@plt>
lea    0x10d5(%rip),%rdi
call   1030 <puts@plt>
lea    0x1114(%rip),%rdi
call   1030 <puts@plt>
lea    0x1126(%rip),%rdi
call   1030 <puts@plt>
lea    0x1153(%rip),%rdi
call   1030 <puts@plt>
lea    0x1167(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [86 x i8] c"A PoC to bruteforce the Cryptsetup implementation of Linux Unified Key Setup (LUKS).\0A\00"
@.str.1 = [67 x i8] c"See http://crypt.coffee/research/luks.html for more information.\0A\0A\00"
@.str.2 = [35 x i8] c"Usage: skul [-h] [-v] <filename>\0A\0A\00"
@.str.3 = [10 x i8] c"Options:\0A\00"
@.str.4 = [39 x i8] c" -h\09display this help text and exit\0A\00"
@.str.5 = [45 x i8] c" -v\09display version information and exit\0A\0A\00"
@.str.6 = [11 x i8] c"Filename:\0A\00"
@.str.7 = [66 x i8] c" The name of the file containing the LUKS encrypted partition.\0A\00"
@.str.8 = [75 x i8] c" For testing purposes Skul comes with an example cryptsetup's encrypted\0A\00"
@.str.9 = [48 x i8] c" partition header in the `disks/` directory.\0A\00"
@.str.10 = [83 x i8] c" To test your own disk you first need to dump the LUKS header of the partition:\0A\00"
@.str.11 = [56 x i8] c" # dd if=/dev/sdX of=./my_dump bs=1024 count=3072\0A\00"
@.str.12 = [37 x i8] c" # chown myusr:myusr ./my_dump\0A\00"
@.str.13 = [22 x i8] c" Then you can run:\0A\00"
@.str.14 = [25 x i8] c" $ skul ./my_dump\0A\0A\00"
@.str.15 = [19 x i8] c"Configuring Skul:\0A\00"
@.str.16 = [76 x i8] c" You can configure Skul through it's configuration file `conf/skul.cfg`\0A\0A\00"
@.str.17 = [31 x i8] c"** For BlackArch Linux users:\0A\00"
@.str.18 = [58 x i8] c" You can find the Skul directory at `/usr/share/skul`\0A\0A\00"
@.str.19 = [33 x i8] c"Report bugs to sha@crypt.coffee\0A\00"
@.str.20 = [65 x i8] c"Cryptcoffee Skul home page: https://github.com/cryptcoffee/skul\0A\00"
define void @print_help() {
%1 = call i32 (...) @print_version()
%2 = call i32 @printf(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.4, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.5, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.7, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.8, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.9, i64 0, i64 0))
%12 = call i32 @printf(i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str.10, i64 0, i64 0))
%13 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.11, i64 0, i64 0))
%14 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.12, i64 0, i64 0))
%15 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.13, i64 0, i64 0))
%16 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.14, i64 0, i64 0))
%17 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.15, i64 0, i64 0))
%18 = call i32 @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.16, i64 0, i64 0))
%19 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.17, i64 0, i64 0))
%20 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.18, i64 0, i64 0))
%21 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.19, i64 0, i64 0))
%22 = call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.20, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [85 x i8] c"A PoC to bruteforce the Cryptsetup implementation of Linux Unified Key Setup (LUKS).\00"
@str.21 = [66 x i8] c"See http://crypt.coffee/research/luks.html for more information.\0A\00"
@str.22 = [34 x i8] c"Usage: skul [-h] [-v] <filename>\0A\00"
@str.23 = [9 x i8] c"Options:\00"
@str.24 = [38 x i8] c" -h\09display this help text and exit\00"
@str.25 = [44 x i8] c" -v\09display version information and exit\0A\00"
@str.26 = [10 x i8] c"Filename:\00"
@str.27 = [65 x i8] c" The name of the file containing the LUKS encrypted partition.\00"
@str.28 = [74 x i8] c" For testing purposes Skul comes with an example cryptsetup's encrypted\00"
@str.29 = [47 x i8] c" partition header in the `disks/` directory.\00"
@str.30 = [82 x i8] c" To test your own disk you first need to dump the LUKS header of the partition:\00"
@str.31 = [55 x i8] c" # dd if=/dev/sdX of=./my_dump bs=1024 count=3072\00"
@str.32 = [36 x i8] c" # chown myusr:myusr ./my_dump\00"
@str.33 = [21 x i8] c" Then you can run:\00"
@str.34 = [24 x i8] c" $ skul ./my_dump\0A\00"
@str.35 = [18 x i8] c"Configuring Skul:\00"
@str.36 = [75 x i8] c" You can configure Skul through it's configuration file `conf/skul.cfg`\0A\00"
@str.37 = [30 x i8] c"** For BlackArch Linux users:\00"
@str.38 = [57 x i8] c" You can find the Skul directory at `/usr/share/skul`\0A\00"
@str.39 = [32 x i8] c"Report bugs to sha@crypt.coffee\00"
@str.40 = [64 x i8] c"Cryptcoffee Skul home page: https://github.com/cryptcoffee/skul\00"
define void @print_help() {
%1 = tail call i32 (...) @print_version()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([85 x i8], [85 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @str.21, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.22, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.23, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.24, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.25, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.26, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @str.27, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([74 x i8], [74 x i8]* @str.28, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str.29, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([82 x i8], [82 x i8]* @str.30, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.31, i64 0, i64 0))
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.32, i64 0, i64 0))
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.33, i64 0, i64 0))
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.34, i64 0, i64 0))
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.35, i64 0, i64 0))
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @str.36, i64 0, i64 0))
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.37, i64 0, i64 0))
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.38, i64 0, i64 0))
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.39, i64 0, i64 0))
%22 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str.40, i64 0, i64 0))
ret void
}