#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ printf(char *);
int rand();
int randstring(int);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(void) {
  FILE *salt;
  int saltlen1;
  int saltlen2;
  int foo;
  srand(time(NULL));
  saltlen1 = (rand() & 20) + 5;
  saltlen2 = (rand() & 20) + 5;
  if ((salt = fopen("salt.h", "r")) != NULL) {
    fclose(salt);
    printf("Using existent Salt-File\n");
    exit(0x0);
  }
  printf("Creating Salt File\n");
  if ((salt = fopen("salt.h", "w")) == NULL) {
    printf("Cannot created Salt-File.. aborting\n");
    exit(0x1);
  }
  fprintf(salt, "/* The 1. Salt -> string containing anything, %d chars */\n",
          saltlen1);
  fprintf(salt, "#define SALT1 %c%s%c\n", 34, randstring(saltlen1), 34);
  fprintf(salt, "\n");
  fprintf(salt, "/* The 2. Salt -> string containing anything, %d chars */\n",
          saltlen2);
  fprintf(salt, "#define SALT2 %c%s%c\n", 34, randstring(saltlen2), 34);
  fprintf(salt, "\n");
  fprintf(salt, "/* the 1. Code -> a one byte startup code */\n");
  fprintf(salt, "#define CODE1 %d\n", 64 + (rand() & 15));
  fprintf(salt, "\n");
  fprintf(salt, "/* the 2. Code -> a one byte startup code */\n");
  fprintf(salt, "#define CODE2 %d\n", 64 + (rand() & 15));
  fprintf(salt, "\n");
  fprintf(salt, "/* the 1. Salt Offset -> value from 0-%d */\n", saltlen1 - 1);
  fprintf(salt, "#define SA1 %d\n", rand() & (saltlen1 - 1));
  fprintf(salt, "\n");
  fprintf(salt, "/* the 2. Salt Offset -> value from 0-%d */\n", saltlen2 - 1);
  fprintf(salt, "#define SA2 %d\n", rand() & (saltlen2 - 1));
  fprintf(salt, "\n");
  fprintf(salt, "/* the make salt routine */\n");
  fprintf(salt, "/* dont wonder about the redundance, its needed to somehow "
                "hide the fully salts */\n");
  fprintf(salt, "\n");
  fprintf(salt, "/* salt buffers */\n");
  fprintf(salt, "\n");
  fprintf(salt, "unsigned char slt1[%d];\n", saltlen1 + 1);
  fprintf(salt, "unsigned char slt2[%d];\n", saltlen2 + 1);
  fprintf(salt, "\n");
  fprintf(salt, "int makesalt(void)\n");
  fprintf(salt, "{\n");
  for (foo = 0; foo < saltlen1; foo++)
    fprintf(salt, "    slt1[%d]=SALT1[%d];\n", foo, foo);
  fprintf(salt, "    slt1[%d]=0;\n", saltlen1);
  for (foo = 0; foo < saltlen2; foo++)
    fprintf(salt, "    slt2[%d]=SALT2[%d];\n", foo, foo);
  fprintf(salt, "    slt2[%d]=0;\n", saltlen2);
  fprintf(salt, "    return 0x0;\n");
  fprintf(salt, "}");
  fprintf(salt, "\n");
  fclose(salt);
  printf("Salt File created. Move the Salt File to a safe location after\n");
  printf("psyBNC was compiled and delete it on your shell. You will need\n");
  printf("the File later for update Compiling.\n");
  exit(0x0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1070 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
mov    $0x0,%al
call   10b0 <rand@plt>
and    $0x14,%eax
add    $0x5,%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   10b0 <rand@plt>
and    $0x14,%eax
add    $0x5,%eax
mov    %eax,-0x18(%rbp)
lea    0xe2a(%rip),%rdi
lea    0xe2a(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     120c <main+0x7c>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
lea    0xe09(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1090 <exit@plt>
lea    0xe10(%rip),%rdi
call   1040 <printf@plt>
lea    0xde1(%rip),%rdi
lea    0xe11(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    124f <main+0xbf>
lea    0xdf9(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xe01(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x14(%rbp),%edi
call   10a0 <randstring@plt>
mov    -0x50(%rbp),%rdi
mov    %eax,%ecx
lea    0xe18(%rip),%rsi
mov    $0x22,%r8d
mov    %r8d,%edx
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0x1027(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%edx
lea    0xdfe(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x18(%rbp),%edi
call   10a0 <randstring@plt>
mov    -0x48(%rbp),%rdi
mov    %eax,%ecx
lea    0xe15(%rip),%rsi
mov    $0x22,%r8d
mov    %r8d,%edx
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0xfd3(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0xdfe(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    $0x0,%al
call   10b0 <rand@plt>
mov    -0x40(%rbp),%rdi
mov    %eax,%edx
and    $0xf,%edx
add    $0x40,%edx
lea    0xe03(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0xf86(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0xdf1(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    $0x0,%al
call   10b0 <rand@plt>
mov    -0x38(%rbp),%rdi
mov    %eax,%edx
and    $0xf,%edx
add    $0x40,%edx
lea    0xdf6(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0xf39(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
lea    0xdde(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    $0x0,%al
call   10b0 <rand@plt>
mov    -0x30(%rbp),%rdi
mov    %eax,%edx
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
and    %eax,%edx
lea    0xde0(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0xee4(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%edx
sub    $0x1,%edx
lea    0xdc6(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    $0x0,%al
call   10b0 <rand@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%edx
mov    -0x18(%rbp),%eax
sub    $0x1,%eax
and    %eax,%edx
lea    0xdc8(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0xe8f(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0xdb4(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0xdbf(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0xe59(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0xdef(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0xe35(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
add    $0x1,%edx
lea    0xdd9(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%edx
add    $0x1,%edx
lea    0xdda(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0xdf3(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0xdcf(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0xdd1(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1534 <main+0x3a4>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%edx
mov    -0x1c(%rbp),%ecx
lea    0xda9(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1502 <main+0x372>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xd9f(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1582 <main+0x3f2>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%edx
mov    -0x1c(%rbp),%ecx
lea    0xd85(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1550 <main+0x3c0>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%edx
lea    0xd7b(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0xd7a(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0xd79(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0xcfd(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
lea    0xd52(%rip),%rdi
call   1040 <printf@plt>
lea    0xd86(%rip),%rdi
call   1040 <printf@plt>
lea    0xdba(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1090 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
xor    %edi,%edi
call   1080 <time@plt>
mov    %eax,%edi
call   1060 <srand@plt>
xor    %eax,%eax
call   10d0 <rand@plt>
mov    %eax,%r12d
xor    %eax,%eax
call   10d0 <rand@plt>
mov    %eax,%ebx
lea    0xe1d(%rip),%rdi
lea    0x113e(%rip),%rsi
call   1090 <fopen@plt>
test   %rax,%rax
jne    122e <main+0x7e>
lea    0x10dd(%rip),%rdi
call   1030 <puts@plt>
lea    0xdf9(%rip),%rdi
lea    0xdf9(%rip),%rsi
call   1090 <fopen@plt>
test   %rax,%rax
jne    1242 <main+0x92>
lea    0x116f(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
mov    %rax,%rdi
call   1040 <fclose@plt>
lea    0x1175(%rip),%rdi
jmp    1597 <main+0x3e7>
mov    %rax,%r15
and    $0x14,%r12d
lea    0x5(%r12),%r13d
and    $0x14,%ebx
lea    0x5(%rbx),%r14d
lea    0xdad(%rip),%rsi
mov    %rax,%rdi
mov    %r13d,%edx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    %r13d,%edi
call   10c0 <randstring@plt>
lea    0xdcc(%rip),%rsi
mov    %r15,%rdi
mov    $0x22,%edx
mov    %eax,%ecx
mov    $0x22,%r8d
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    $0xa,%edi
mov    %r15,%rsi
call   1050 <fputc@plt>
lea    0xdb7(%rip),%rsi
mov    %r15,%rdi
mov    %r14d,%edx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    %r14d,%edi
call   10c0 <randstring@plt>
lea    0xdd6(%rip),%rsi
mov    %r15,%rdi
mov    $0x22,%edx
mov    %eax,%ecx
mov    $0x22,%r8d
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    $0xa,%edi
mov    %r15,%rsi
call   1050 <fputc@plt>
lea    0xdc1(%rip),%rdi
mov    $0x2d,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   10b0 <fwrite@plt>
xor    %eax,%eax
call   10d0 <rand@plt>
and    $0xf,%eax
lea    0x40(%rax),%edx
lea    0xdc9(%rip),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    $0xa,%edi
mov    %r15,%rsi
call   1050 <fputc@plt>
lea    0xdbd(%rip),%rdi
mov    $0x2d,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   10b0 <fwrite@plt>
xor    %eax,%eax
call   10d0 <rand@plt>
and    $0xf,%eax
lea    0x40(%rax),%edx
lea    0xdc5(%rip),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    $0xa,%edi
mov    %r15,%rsi
call   1050 <fputc@plt>
lea    0x4(%r12),%ebp
lea    0xdb4(%rip),%rsi
mov    %r15,%rdi
mov    %ebp,%edx
xor    %eax,%eax
call   1070 <fprintf@plt>
xor    %eax,%eax
call   10d0 <rand@plt>
and    %eax,%ebp
lea    0xdc5(%rip),%rsi
mov    %r15,%rdi
mov    %ebp,%edx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    $0xa,%edi
mov    %r15,%rsi
call   1050 <fputc@plt>
lea    0x4(%rbx),%ebp
lea    0xdb2(%rip),%rsi
mov    %r15,%rdi
mov    %ebp,%edx
xor    %eax,%eax
call   1070 <fprintf@plt>
xor    %eax,%eax
call   10d0 <rand@plt>
and    %eax,%ebp
lea    0xdc3(%rip),%rsi
mov    %r15,%rdi
mov    %ebp,%edx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    $0xa,%edi
mov    %r15,%rsi
call   1050 <fputc@plt>
lea    0xdb3(%rip),%rdi
mov    $0x1c,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   10b0 <fwrite@plt>
lea    0xdb7(%rip),%rdi
mov    $0x53,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   10b0 <fwrite@plt>
mov    $0xa,%edi
mov    %r15,%rsi
call   1050 <fputc@plt>
lea    0xde5(%rip),%rdi
mov    $0x13,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   10b0 <fwrite@plt>
mov    $0xa,%edi
mov    %r15,%rsi
call   1050 <fputc@plt>
add    $0x6,%r12d
lea    0xdcf(%rip),%rsi
mov    %r15,%rdi
mov    %r12d,%edx
xor    %eax,%eax
call   1070 <fprintf@plt>
add    $0x6,%ebx
lea    0xdd1(%rip),%rsi
mov    %r15,%rdi
mov    %ebx,%edx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    $0xa,%edi
mov    %r15,%rsi
call   1050 <fputc@plt>
lea    0xdca(%rip),%rdi
mov    $0x13,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   10b0 <fwrite@plt>
lea    0xdc5(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   10b0 <fwrite@plt>
lea    0xdaf(%rip),%rbp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %rbp,%rsi
mov    %ebx,%edx
mov    %ebx,%ecx
xor    %eax,%eax
call   1070 <fprintf@plt>
add    $0x1,%ebx
cmp    %ebx,%r13d
jne    14d0 <main+0x320>
lea    0xd9c(%rip),%rsi
mov    %r15,%rdi
mov    %r13d,%edx
xor    %eax,%eax
call   1070 <fprintf@plt>
lea    0xd99(%rip),%rbp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %rbp,%rsi
mov    %ebx,%edx
mov    %ebx,%ecx
xor    %eax,%eax
call   1070 <fprintf@plt>
add    $0x1,%ebx
cmp    %ebx,%r14d
jne    1510 <main+0x360>
lea    0xd86(%rip),%rsi
mov    %r15,%rdi
mov    %r14d,%edx
xor    %eax,%eax
call   1070 <fprintf@plt>
lea    0xd83(%rip),%rdi
mov    $0x10,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   10b0 <fwrite@plt>
mov    $0x7d,%edi
mov    %r15,%rsi
call   1050 <fputc@plt>
mov    $0xa,%edi
mov    %r15,%rsi
call   1050 <fputc@plt>
mov    %r15,%rdi
call   1040 <fclose@plt>
lea    0xd6c(%rip),%rdi
call   1030 <puts@plt>
lea    0xd9f(%rip),%rdi
call   1030 <puts@plt>
lea    0xdd2(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   10a0 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"salt.h\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [26 x i8] c"Using existent Salt-File\0A\00"
@.str.3 = [20 x i8] c"Creating Salt File\0A\00"
@.str.4 = [2 x i8] c"w\00"
@.str.5 = [37 x i8] c"Cannot created Salt-File.. aborting\0A\00"
@.str.6 = [59 x i8] c"/* The 1. Salt -> string containing anything, %d chars */\0A\00"
@.str.7 = [22 x i8] c"#define SALT1 %c%s%c\0A\00"
@.str.8 = [2 x i8] c"\0A\00"
@.str.9 = [59 x i8] c"/* The 2. Salt -> string containing anything, %d chars */\0A\00"
@.str.10 = [22 x i8] c"#define SALT2 %c%s%c\0A\00"
@.str.11 = [46 x i8] c"/* the 1. Code -> a one byte startup code */\0A\00"
@.str.12 = [18 x i8] c"#define CODE1 %d\0A\00"
@.str.13 = [46 x i8] c"/* the 2. Code -> a one byte startup code */\0A\00"
@.str.14 = [18 x i8] c"#define CODE2 %d\0A\00"
@.str.15 = [45 x i8] c"/* the 1. Salt Offset -> value from 0-%d */\0A\00"
@.str.16 = [16 x i8] c"#define SA1 %d\0A\00"
@.str.17 = [45 x i8] c"/* the 2. Salt Offset -> value from 0-%d */\0A\00"
@.str.18 = [16 x i8] c"#define SA2 %d\0A\00"
@.str.19 = [29 x i8] c"/* the make salt routine */\0A\00"
@.str.20 = [84 x i8] c"/* dont wonder about the redundance, its needed to somehow hide the fully salts */\0A\00"
@.str.21 = [20 x i8] c"/* salt buffers */\0A\00"
@.str.22 = [25 x i8] c"unsigned char slt1[%d];\0A\00"
@.str.23 = [25 x i8] c"unsigned char slt2[%d];\0A\00"
@.str.24 = [20 x i8] c"int makesalt(void)\0A\00"
@.str.25 = [3 x i8] c"{\0A\00"
@.str.26 = [25 x i8] c" slt1[%d]=SALT1[%d];\0A\00"
@.str.27 = [17 x i8] c" slt1[%d]=0;\0A\00"
@.str.28 = [25 x i8] c" slt2[%d]=SALT2[%d];\0A\00"
@.str.29 = [17 x i8] c" slt2[%d]=0;\0A\00"
@.str.30 = [17 x i8] c" return 0x0;\0A\00"
@.str.31 = [2 x i8] c"}\00"
@.str.32 = [64 x i8] c"Salt File created. Move the Salt File to a safe location after\0A\00"
@.str.33 = [64 x i8] c"psyBNC was compiled and delete it on your shell. You will need\0A\00"
@.str.34 = [38 x i8] c"the File later for update Compiling.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 @time(i32* null)
%7 = call i32 @srand(i32 %6)
%8 = call i32 (...) @rand()
%9 = and i32 %8, 20
%10 = add nsw i32 %9, 5
store i32 %10, i32* %3
%11 = call i32 (...) @rand()
%12 = and i32 %11, 20
%13 = add nsw i32 %12, 5
store i32 %13, i32* %4
%14 = call i32* @fopen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %14, i32** %2
%15 = icmp ne i32* %14, null
br i1 %15, label %16, label %21
16: ; preds = %0
%17 = load i32*, i32** %2
%18 = call i32 @fclose(i32* %17)
%19 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%20 = call i32 @exit(i32 0)
unreachable
21: ; preds = %0
%22 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%23 = call i32* @fopen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32* %23, i32** %2
%24 = icmp eq i32* %23, null
br i1 %24, label %25, label %28
25: ; preds = %21
%26 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0))
%27 = call i32 @exit(i32 1)
unreachable
28: ; preds = %21
%29 = load i32*, i32** %2
%30 = load i32, i32* %3
%31 = call i32 (i32*, i8*, ...) @fprintf(i32* %29, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.6, i64 0, i64 0), i32 %30)
%32 = load i32*, i32** %2
%33 = load i32, i32* %3
%34 = call i32 @randstring(i32 %33)
%35 = call i32 (i32*, i8*, ...) @fprintf(i32* %32, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i32 34, i32 %34, i32 34)
%36 = load i32*, i32** %2
%37 = call i32 (i32*, i8*, ...) @fprintf(i32* %36, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%38 = load i32*, i32** %2
%39 = load i32, i32* %4
%40 = call i32 (i32*, i8*, ...) @fprintf(i32* %38, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.9, i64 0, i64 0), i32 %39)
%41 = load i32*, i32** %2
%42 = load i32, i32* %4
%43 = call i32 @randstring(i32 %42)
%44 = call i32 (i32*, i8*, ...) @fprintf(i32* %41, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.10, i64 0, i64 0), i32 34, i32 %43, i32 34)
%45 = load i32*, i32** %2
%46 = call i32 (i32*, i8*, ...) @fprintf(i32* %45, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%47 = load i32*, i32** %2
%48 = call i32 (i32*, i8*, ...) @fprintf(i32* %47, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.11, i64 0, i64 0))
%49 = load i32*, i32** %2
%50 = call i32 (...) @rand()
%51 = and i32 %50, 15
%52 = add nsw i32 64, %51
%53 = call i32 (i32*, i8*, ...) @fprintf(i32* %49, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.12, i64 0, i64 0), i32 %52)
%54 = load i32*, i32** %2
%55 = call i32 (i32*, i8*, ...) @fprintf(i32* %54, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%56 = load i32*, i32** %2
%57 = call i32 (i32*, i8*, ...) @fprintf(i32* %56, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.13, i64 0, i64 0))
%58 = load i32*, i32** %2
%59 = call i32 (...) @rand()
%60 = and i32 %59, 15
%61 = add nsw i32 64, %60
%62 = call i32 (i32*, i8*, ...) @fprintf(i32* %58, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.14, i64 0, i64 0), i32 %61)
%63 = load i32*, i32** %2
%64 = call i32 (i32*, i8*, ...) @fprintf(i32* %63, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%65 = load i32*, i32** %2
%66 = load i32, i32* %3
%67 = sub nsw i32 %66, 1
%68 = call i32 (i32*, i8*, ...) @fprintf(i32* %65, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.15, i64 0, i64 0), i32 %67)
%69 = load i32*, i32** %2
%70 = call i32 (...) @rand()
%71 = load i32, i32* %3
%72 = sub nsw i32 %71, 1
%73 = and i32 %70, %72
%74 = call i32 (i32*, i8*, ...) @fprintf(i32* %69, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.16, i64 0, i64 0), i32 %73)
%75 = load i32*, i32** %2
%76 = call i32 (i32*, i8*, ...) @fprintf(i32* %75, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%77 = load i32*, i32** %2
%78 = load i32, i32* %4
%79 = sub nsw i32 %78, 1
%80 = call i32 (i32*, i8*, ...) @fprintf(i32* %77, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.17, i64 0, i64 0), i32 %79)
%81 = load i32*, i32** %2
%82 = call i32 (...) @rand()
%83 = load i32, i32* %4
%84 = sub nsw i32 %83, 1
%85 = and i32 %82, %84
%86 = call i32 (i32*, i8*, ...) @fprintf(i32* %81, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.18, i64 0, i64 0), i32 %85)
%87 = load i32*, i32** %2
%88 = call i32 (i32*, i8*, ...) @fprintf(i32* %87, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%89 = load i32*, i32** %2
%90 = call i32 (i32*, i8*, ...) @fprintf(i32* %89, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.19, i64 0, i64 0))
%91 = load i32*, i32** %2
%92 = call i32 (i32*, i8*, ...) @fprintf(i32* %91, i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str.20, i64 0, i64 0))
%93 = load i32*, i32** %2
%94 = call i32 (i32*, i8*, ...) @fprintf(i32* %93, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%95 = load i32*, i32** %2
%96 = call i32 (i32*, i8*, ...) @fprintf(i32* %95, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.21, i64 0, i64 0))
%97 = load i32*, i32** %2
%98 = call i32 (i32*, i8*, ...) @fprintf(i32* %97, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%99 = load i32*, i32** %2
%100 = load i32, i32* %3
%101 = add nsw i32 %100, 1
%102 = call i32 (i32*, i8*, ...) @fprintf(i32* %99, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.22, i64 0, i64 0), i32 %101)
%103 = load i32*, i32** %2
%104 = load i32, i32* %4
%105 = add nsw i32 %104, 1
%106 = call i32 (i32*, i8*, ...) @fprintf(i32* %103, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.23, i64 0, i64 0), i32 %105)
%107 = load i32*, i32** %2
%108 = call i32 (i32*, i8*, ...) @fprintf(i32* %107, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%109 = load i32*, i32** %2
%110 = call i32 (i32*, i8*, ...) @fprintf(i32* %109, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.24, i64 0, i64 0))
%111 = load i32*, i32** %2
%112 = call i32 (i32*, i8*, ...) @fprintf(i32* %111, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.25, i64 0, i64 0))
store i32 0, i32* %5
br label %113
113: ; preds = %122, %28
%114 = load i32, i32* %5
%115 = load i32, i32* %3
%116 = icmp slt i32 %114, %115
br i1 %116, label %117, label %125
117: ; preds = %113
%118 = load i32*, i32** %2
%119 = load i32, i32* %5
%120 = load i32, i32* %5
%121 = call i32 (i32*, i8*, ...) @fprintf(i32* %118, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.26, i64 0, i64 0), i32 %119, i32 %120)
br label %122
122: ; preds = %117
%123 = load i32, i32* %5
%124 = add nsw i32 %123, 1
store i32 %124, i32* %5
br label %113
125: ; preds = %113
%126 = load i32*, i32** %2
%127 = load i32, i32* %3
%128 = call i32 (i32*, i8*, ...) @fprintf(i32* %126, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.27, i64 0, i64 0), i32 %127)
store i32 0, i32* %5
br label %129
129: ; preds = %138, %125
%130 = load i32, i32* %5
%131 = load i32, i32* %4
%132 = icmp slt i32 %130, %131
br i1 %132, label %133, label %141
133: ; preds = %129
%134 = load i32*, i32** %2
%135 = load i32, i32* %5
%136 = load i32, i32* %5
%137 = call i32 (i32*, i8*, ...) @fprintf(i32* %134, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.28, i64 0, i64 0), i32 %135, i32 %136)
br label %138
138: ; preds = %133
%139 = load i32, i32* %5
%140 = add nsw i32 %139, 1
store i32 %140, i32* %5
br label %129
141: ; preds = %129
%142 = load i32*, i32** %2
%143 = load i32, i32* %4
%144 = call i32 (i32*, i8*, ...) @fprintf(i32* %142, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.29, i64 0, i64 0), i32 %143)
%145 = load i32*, i32** %2
%146 = call i32 (i32*, i8*, ...) @fprintf(i32* %145, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.30, i64 0, i64 0))
%147 = load i32*, i32** %2
%148 = call i32 (i32*, i8*, ...) @fprintf(i32* %147, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.31, i64 0, i64 0))
%149 = load i32*, i32** %2
%150 = call i32 (i32*, i8*, ...) @fprintf(i32* %149, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%151 = load i32*, i32** %2
%152 = call i32 @fclose(i32* %151)
%153 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.32, i64 0, i64 0))
%154 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.33, i64 0, i64 0))
%155 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.34, i64 0, i64 0))
%156 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [7 x i8] c"salt.h\00"
@.str.1 = [2 x i8] c"r\00"
@.str.4 = [2 x i8] c"w\00"
@.str.6 = [59 x i8] c"/* The 1. Salt -> string containing anything, %d chars */\0A\00"
@.str.7 = [22 x i8] c"#define SALT1 %c%s%c\0A\00"
@.str.9 = [59 x i8] c"/* The 2. Salt -> string containing anything, %d chars */\0A\00"
@.str.10 = [22 x i8] c"#define SALT2 %c%s%c\0A\00"
@.str.11 = [46 x i8] c"/* the 1. Code -> a one byte startup code */\0A\00"
@.str.12 = [18 x i8] c"#define CODE1 %d\0A\00"
@.str.13 = [46 x i8] c"/* the 2. Code -> a one byte startup code */\0A\00"
@.str.14 = [18 x i8] c"#define CODE2 %d\0A\00"
@.str.15 = [45 x i8] c"/* the 1. Salt Offset -> value from 0-%d */\0A\00"
@.str.16 = [16 x i8] c"#define SA1 %d\0A\00"
@.str.17 = [45 x i8] c"/* the 2. Salt Offset -> value from 0-%d */\0A\00"
@.str.18 = [16 x i8] c"#define SA2 %d\0A\00"
@.str.19 = [29 x i8] c"/* the make salt routine */\0A\00"
@.str.20 = [84 x i8] c"/* dont wonder about the redundance, its needed to somehow hide the fully salts */\0A\00"
@.str.21 = [20 x i8] c"/* salt buffers */\0A\00"
@.str.22 = [25 x i8] c"unsigned char slt1[%d];\0A\00"
@.str.23 = [25 x i8] c"unsigned char slt2[%d];\0A\00"
@.str.24 = [20 x i8] c"int makesalt(void)\0A\00"
@.str.25 = [3 x i8] c"{\0A\00"
@.str.26 = [25 x i8] c" slt1[%d]=SALT1[%d];\0A\00"
@.str.27 = [17 x i8] c" slt1[%d]=0;\0A\00"
@.str.28 = [25 x i8] c" slt2[%d]=SALT2[%d];\0A\00"
@.str.29 = [17 x i8] c" slt2[%d]=0;\0A\00"
@.str.30 = [17 x i8] c" return 0x0;\0A\00"
@str = [19 x i8] c"Creating Salt File\00"
@str.35 = [63 x i8] c"Salt File created. Move the Salt File to a safe location after\00"
@str.36 = [63 x i8] c"psyBNC was compiled and delete it on your shell. You will need\00"
@str.37 = [37 x i8] c"the File later for update Compiling.\00"
@str.38 = [36 x i8] c"Cannot created Salt-File.. aborting\00"
@str.39 = [25 x i8] c"Using existent Salt-File\00"
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 (...) @rand()
%4 = and i32 %3, 20
%5 = add nuw nsw i32 %4, 5
%6 = tail call i32 (...) @rand()
%7 = and i32 %6, 20
%8 = add nuw nsw i32 %7, 5
%9 = tail call i32* @fopen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%10 = icmp eq i32* %9, null
br i1 %10, label %15, label %11
11: ; preds = %0
%12 = tail call i32 @fclose(i32* %9)
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.39, i64 0, i64 0))
%14 = tail call i32 @exit(i32 0)
unreachable
15: ; preds = %0
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%17 = tail call i32* @fopen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%18 = icmp eq i32* %17, null
br i1 %18, label %19, label %22
19: ; preds = %15
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.38, i64 0, i64 0))
%21 = tail call i32 @exit(i32 1)
unreachable
22: ; preds = %15
%23 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %17, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.6, i64 0, i64 0), i32 %5)
%24 = tail call i32 @randstring(i32 %5)
%25 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %17, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i32 34, i32 %24, i32 34)
%26 = tail call i32 @fputc(i32 10, i32* %17)
%27 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %17, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.9, i64 0, i64 0), i32 %8)
%28 = tail call i32 @randstring(i32 %8)
%29 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %17, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.10, i64 0, i64 0), i32 34, i32 %28, i32 34)
%30 = tail call i32 @fputc(i32 10, i32* %17)
%31 = tail call i64 @fwrite(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.11, i64 0, i64 0), i64 45, i64 1, i32* %17)
%32 = tail call i32 (...) @rand()
%33 = and i32 %32, 15
%34 = or i32 %33, 64
%35 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %17, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.12, i64 0, i64 0), i32 %34)
%36 = tail call i32 @fputc(i32 10, i32* %17)
%37 = tail call i64 @fwrite(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.13, i64 0, i64 0), i64 45, i64 1, i32* %17)
%38 = tail call i32 (...) @rand()
%39 = and i32 %38, 15
%40 = or i32 %39, 64
%41 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %17, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.14, i64 0, i64 0), i32 %40)
%42 = tail call i32 @fputc(i32 10, i32* %17)
%43 = add nuw nsw i32 %4, 4
%44 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %17, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.15, i64 0, i64 0), i32 %43)
%45 = tail call i32 (...) @rand()
%46 = and i32 %45, %43
%47 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %17, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.16, i64 0, i64 0), i32 %46)
%48 = tail call i32 @fputc(i32 10, i32* %17)
%49 = add nuw nsw i32 %7, 4
%50 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %17, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.17, i64 0, i64 0), i32 %49)
%51 = tail call i32 (...) @rand()
%52 = and i32 %51, %49
%53 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %17, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.18, i64 0, i64 0), i32 %52)
%54 = tail call i32 @fputc(i32 10, i32* %17)
%55 = tail call i64 @fwrite(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.19, i64 0, i64 0), i64 28, i64 1, i32* %17)
%56 = tail call i64 @fwrite(i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str.20, i64 0, i64 0), i64 83, i64 1, i32* %17)
%57 = tail call i32 @fputc(i32 10, i32* %17)
%58 = tail call i64 @fwrite(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.21, i64 0, i64 0), i64 19, i64 1, i32* %17)
%59 = tail call i32 @fputc(i32 10, i32* %17)
%60 = add nuw nsw i32 %4, 6
%61 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %17, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.22, i64 0, i64 0), i32 %60)
%62 = add nuw nsw i32 %7, 6
%63 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %17, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.23, i64 0, i64 0), i32 %62)
%64 = tail call i32 @fputc(i32 10, i32* %17)
%65 = tail call i64 @fwrite(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.24, i64 0, i64 0), i64 19, i64 1, i32* %17)
%66 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.25, i64 0, i64 0), i64 2, i64 1, i32* %17)
br label %67
67: ; preds = %22, %67
%68 = phi i32 [ 0, %22 ], [ %70, %67 ]
%69 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %17, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.26, i64 0, i64 0), i32 %68, i32 %68)
%70 = add nuw nsw i32 %68, 1
%71 = icmp eq i32 %70, %5
br i1 %71, label %72, label %67
72: ; preds = %67
%73 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %17, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.27, i64 0, i64 0), i32 %5)
br label %74
74: ; preds = %72, %74
%75 = phi i32 [ 0, %72 ], [ %77, %74 ]
%76 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %17, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.28, i64 0, i64 0), i32 %75, i32 %75)
%77 = add nuw nsw i32 %75, 1
%78 = icmp eq i32 %77, %8
br i1 %78, label %79, label %74
79: ; preds = %74
%80 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %17, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.29, i64 0, i64 0), i32 %8)
%81 = tail call i64 @fwrite(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.30, i64 0, i64 0), i64 16, i64 1, i32* %17)
%82 = tail call i32 @fputc(i32 125, i32* %17)
%83 = tail call i32 @fputc(i32 10, i32* %17)
%84 = tail call i32 @fclose(i32* %17)
%85 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str.35, i64 0, i64 0))
%86 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str.36, i64 0, i64 0))
%87 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.37, i64 0, i64 0))
%88 = tail call i32 @exit(i32 0)
unreachable
}