#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 PHS(unsigned char *, unsigned int, char *, unsigned int, char *,
        unsigned int, unsigned int, unsigned int);
unsigned int atoi(char *);
unsigned int atol(char *);
int /*<<< orphan*/ free(unsigned char *);
unsigned char *malloc(unsigned int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ strcmp(char *, char *);
unsigned int strlen(char *);
int /*<<< orphan*/ testVectors(unsigned int, unsigned int);
int main(int argc, char *argv[]) {
  unsigned int kLen = 64;
  unsigned int t_cost = 0;
  unsigned int m_cost = 0;
  char *pwd = "Lyra sponge";
  unsigned int pwdLen = 11;
  char *salt = "saltsaltsaltsalt";
  unsigned int saltLen = 16;
  switch (argc) {
  case 2:
    if (strcmp(argv[1], "--help") == 0) {
      printf("Usage: \n");
      printf("       Lyra2 pwd salt kLen tCost nRows \n\n");
      printf("Inputs:\n");
      printf(" - pwd: the password\n");
      printf(" - salt: the salt\n");
      printf(" - kLen: output size\n");
      printf(" - tCost: the time cost parameter\n");
      printf(" - nRows: the number of rows parameter\n");
      printf("\n");
      printf("Or:\n");
      printf("       Lyra2 tCost nRows --testVectors (to generate test vectors "
             "and test Lyra2 operation)\n\n");
      return 0;
    } else {
      printf("Invalid options.\nFor more information, try \"Lyra2 --help\".\n");
      return 0;
    }
    break;
  case 6:
    pwd = argv[1];
    pwdLen = strlen(pwd);
    salt = argv[2];
    saltLen = strlen(salt);
    kLen = atol(argv[3]);
    t_cost = atol(argv[4]);
    m_cost = atol(argv[5]);
    break;
  case 4:
    if (strcmp(argv[3], "--testVectors") == 0) {
      t_cost = atoi(argv[1]);
      m_cost = atoi(argv[2]);
      testVectors(t_cost, m_cost);
      return 0;
    } else {
      printf("Invalid options.\nFor more information, try \"Lyra2 --help\".\n");
      return 0;
    }
    break;
  default:
    printf("Invalid options.\nTry \"Lyra2 --help\" for help.\n");
    return 0;
  }
  if (m_cost < 3) {
    printf("nRows must be >= 3\n");
    return 0;
  }
  unsigned char *K = malloc(kLen);
  printf("Inputs: \n");
  printf("\tPassword: %s\n", pwd);
  printf("\tPassword Length: %u\n", pwdLen);
  printf("\tSalt: %s\n", salt);
  printf("\tSalt Length: %u\n", saltLen);
  printf("\tOutput Length: %u\n", kLen);
  printf(
      "------------------------------------------------------------------------"
      "------------------------------------------------------------------\n");
  printf("Parameters: \n");
  printf("\tT: %u\n", t_cost);
  printf("\tR: %u\n", m_cost);
  printf("\tC: %u\n", 256);
  printf("\tParallelism: %u\n", 2);
  printf("\tSynchronism (used just if Parallelism > 1): %u\n", 2);
  char *spongeName = "";
  if (0 == 0) {
    spongeName = "Blake2";
  } else {
    spongeName = "BlaMka";
  }
  printf("\tSponge: %s\n", spongeName);
  printf("\tSponge Blocks (bitrate): %u = %u bits\n", 12, 12 * 64);
  size_t sizeMemMatrix = (size_t)((size_t)m_cost * (size_t)((12 * 256) * 8));
  if (sizeMemMatrix > (1610612736)) {
    printf(
        "\tMemory: %ld bytes (IMPORTANT: This implementation is known to have "
        "issues for such a large memory usage)\n",
        sizeMemMatrix);
  } else {
    printf("\tMemory: %ld bytes\n", sizeMemMatrix);
  }
  printf(
      "------------------------------------------------------------------------"
      "------------------------------------------------------------------\n");
  int result;
  result = PHS(K, kLen, pwd, pwdLen, salt, saltLen, t_cost, m_cost);
  switch (result) {
  case 0:
    printf("Output: \n");
    printf("\n\tK: ");
    int i;
    for (i = 0; i < kLen; i++) {
      printf("%x|", K[i]);
    }
    break;
  case -1:
    printf("Error: unable to allocate memory (nRows too large?)\n");
    break;
  default:
    printf("Unexpected error\n");
    break;
  }
  printf("\n");
  printf(
      "------------------------------------------------------------------------"
      "------------------------------------------------------------------\n");
  free(K);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x40,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
lea    0xe3b(%rip),%rax
mov    %rax,-0x28(%rbp)
movl   $0xb,-0x2c(%rbp)
lea    0xe35(%rip),%rax
mov    %rax,-0x38(%rbp)
movl   $0x10,-0x3c(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x64(%rbp)
sub    $0x2,%eax
je     1218 <main+0x88>
jmp    11f6 <main+0x66>
mov    -0x64(%rbp),%eax
sub    $0x4,%eax
je     135a <main+0x1ca>
jmp    1207 <main+0x77>
mov    -0x64(%rbp),%eax
sub    $0x6,%eax
je     12f5 <main+0x165>
jmp    13c8 <main+0x238>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdf6(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%eax
jne    12db <main+0x14b>
lea    0xde8(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xde3(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xdff(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xdfa(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe02(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe07(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe0f(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe24(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xda9(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe30(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe27(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    167e <main+0x4ee>
lea    0xe6a(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    167e <main+0x4ee>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   10a0 <atol@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
call   10a0 <atol@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rdi
call   10a0 <atol@plt>
mov    %eax,-0x1c(%rbp)
jmp    13e2 <main+0x252>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xe1f(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%eax
jne    13ae <main+0x21e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10b0 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10b0 <atoi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x1c(%rbp),%esi
call   1040 <testVectors@plt>
movl   $0x0,-0x4(%rbp)
jmp    167e <main+0x4ee>
lea    0xd97(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    167e <main+0x4ee>
lea    0xdc7(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    167e <main+0x4ee>
cmpl   $0x3,-0x1c(%rbp)
jae    1406 <main+0x276>
lea    0xdd2(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    167e <main+0x4ee>
mov    -0x14(%rbp),%edi
call   1090 <malloc@plt>
mov    %rax,-0x48(%rbp)
lea    0xdc0(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x28(%rbp),%rsi
lea    0xdb8(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x2c(%rbp),%esi
lea    0xdb6(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x38(%rbp),%rsi
lea    0xdba(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x3c(%rbp),%esi
lea    0xdb4(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xdb5(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xdbb(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe39(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xe36(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x1c(%rbp),%esi
lea    0xe2d(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe27(%rip),%rdi
mov    $0x100,%esi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe1c(%rip),%rdi
mov    $0x2,%esi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe1b(%rip),%rdi
mov    $0x2,%esi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xb61(%rip),%rax
mov    %rax,-0x50(%rbp)
lea    0xe2e(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rsi
lea    0xe26(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe25(%rip),%rdi
mov    $0xc,%esi
mov    $0x300,%edx
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x1c(%rbp),%eax
imul   $0x6000,%rax,%rax
mov    %rax,-0x58(%rbp)
cmpq   $0x60000000,-0x58(%rbp)
60
jbe    1561 <main+0x3d1>
mov    -0x58(%rbp),%rsi
lea    0xe15(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1573 <main+0x3e3>
mov    -0x58(%rbp),%rsi
lea    0xe69(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xcbf(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    -0x48(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x28(%rbp),%rdx
mov    -0x2c(%rbp),%ecx
mov    -0x38(%rbp),%r8
mov    -0x3c(%rbp),%r9d
mov    -0x18(%rbp),%r10d
mov    -0x1c(%rbp),%r11d
mov    %rsp,%rax
mov    %r11d,0x8(%rax)
mov    %r10d,(%rax)
call   1070 <PHS@plt>
mov    %eax,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
mov    %eax,-0x68(%rbp)
sub    $0xffffffff,%eax
je     1631 <main+0x4a1>
jmp    15c5 <main+0x435>
mov    -0x68(%rbp),%eax
test   %eax,%eax
jne    1644 <main+0x4b4>
jmp    15d5 <main+0x445>
lea    0xe0d(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe09(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x60(%rbp)
mov    -0x60(%rbp),%eax
cmp    -0x14(%rbp),%eax
jae    162c <main+0x49c>
mov    -0x48(%rbp),%rax
movslq -0x60(%rbp),%rcx
movzbl (%rax,%rcx,1),%esi
lea    0xde2(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x60(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x60(%rbp)
jmp    15f8 <main+0x468>
jmp    1652 <main+0x4c2>
lea    0xdc5(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1652 <main+0x4c2>
lea    0xde7(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0x9fc(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xbd2(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%rbx
cmp    $0x6,%edi
je     127b <main+0xcb>
cmp    $0x4,%edi
je     12d2 <main+0x122>
cmp    $0x2,%edi
jne    12fb <main+0x14b>
mov    0x8(%rbx),%rdi
lea    0xe19(%rip),%rsi
call   10a0 <strcmp@plt>
test   %eax,%eax
jne    12ea <main+0x13a>
lea    0x10cd(%rip),%rdi
call   1060 <puts@plt>
lea    0x10c9(%rip),%rdi
call   1060 <puts@plt>
lea    0x10e6(%rip),%rdi
call   1060 <puts@plt>
lea    0x10e2(%rip),%rdi
call   1060 <puts@plt>
lea    0x10eb(%rip),%rdi
call   1060 <puts@plt>
lea    0x10f1(%rip),%rdi
call   1060 <puts@plt>
lea    0x10fa(%rip),%rdi
call   1060 <puts@plt>
lea    0x1110(%rip),%rdi
call   1060 <puts@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
lea    0x1121(%rip),%rdi
call   1060 <puts@plt>
lea    0x1119(%rip),%rdi
call   1060 <puts@plt>
jmp    153c <main+0x38c>
mov    0x8(%rbx),%rdi
mov    %rdi,%r14
call   1070 <strlen@plt>
mov    %eax,%r12d
mov    0x10(%rbx),%rdi
mov    %rdi,%r15
call   1070 <strlen@plt>
mov    %eax,0x14(%rsp)
mov    0x18(%rbx),%rdi
call   10c0 <atol@plt>
mov    %eax,%ebp
mov    0x20(%rbx),%rdi
call   10c0 <atol@plt>
mov    %rax,0x20(%rsp)
mov    0x28(%rbx),%rdi
call   10c0 <atol@plt>
cmp    $0x3,%eax
jae    130c <main+0x15c>
lea    0xfb2(%rip),%rdi
call   1060 <puts@plt>
jmp    153c <main+0x38c>
mov    0x18(%rbx),%rdi
lea    0xd2a(%rip),%rsi
call   10a0 <strcmp@plt>
test   %eax,%eax
je     14ea <main+0x33a>
lea    0xf9c(%rip),%rdi
call   1060 <puts@plt>
jmp    153c <main+0x38c>
lea    0x10e4(%rip),%rdi
call   1060 <puts@plt>
jmp    153c <main+0x38c>
mov    %eax,%r13d
mov    %ebp,%edi
call   10b0 <malloc@plt>
mov    %r12d,%ebx
mov    %r12d,0x10(%rsp)
mov    %rax,%r12
lea    0xe63(%rip),%rdi
call   1060 <puts@plt>
lea    0xce1(%rip),%rdi
mov    %r14,0x18(%rsp)
mov    %r14,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xcda(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xce0(%rip),%rdi
mov    %r15,%r14
mov    %r15,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xcd7(%rip),%rdi
mov    0x14(%rsp),%ebx
mov    %ebx,%esi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xcd5(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xe43(%rip),%rdi
call   1060 <puts@plt>
lea    0xdf6(%rip),%rdi
call   1060 <puts@plt>
lea    0xcc1(%rip),%rdi
mov    0x20(%rsp),%r15
mov    %r15d,%esi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xcb3(%rip),%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xcaa(%rip),%rdi
mov    $0x100,%esi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xc9f(%rip),%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xc9e(%rip),%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xcc3(%rip),%rdi
lea    0xcb5(%rip),%rsi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xcbb(%rip),%rdi
mov    $0xc,%esi
mov    $0x300,%edx
xor    %eax,%eax
call   1080 <printf@plt>
mov    %r13d,%eax
shl    $0xd,%rax
lea    (%rax,%rax,2),%rsi
cmp    $0x60000001,%rsi
lea    0xcb9(%rip),%rax
lea    0xd1d(%rip),%rdi
cmovae %rax,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xd73(%rip),%rdi
call   1060 <puts@plt>
mov    %r12,%rdi
mov    %ebp,0xc(%rsp)
mov    %ebp,%esi
mov    0x18(%rsp),%rdx
mov    0x10(%rsp),%ecx
mov    %r14,%r8
mov    %ebx,%r9d
push   %r13
push   %r15
call   1090 <PHS@plt>
add    $0x10,%rsp
cmp    $0xffffffff,%eax
je     1509 <main+0x359>
test   %eax,%eax
jne    1512 <main+0x362>
lea    0xdc4(%rip),%rdi
call   1060 <puts@plt>
lea    0xcd9(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    0xc(%rsp),%ebx
test   %ebx,%ebx
je     151e <main+0x36e>
mov    %ebx,%ebx
lea    0xcc7(%rip),%r14
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%r12,%rbp,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    14d0 <main+0x320>
jmp    151e <main+0x36e>
mov    0x8(%rbx),%rdi
call   10d0 <atoi@plt>
mov    %eax,%ebp
mov    0x10(%rbx),%rdi
call   10d0 <atoi@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1050 <testVectors@plt>
jmp    153c <main+0x38c>
lea    0xc91(%rip),%rdi
jmp    1519 <main+0x369>
lea    0xd50(%rip),%rdi
call   1060 <puts@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
lea    0xca6(%rip),%rdi
call   1060 <puts@plt>
mov    %r12,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Lyra sponge\00"
@.str.1 = [17 x i8] c"saltsaltsaltsalt\00"
@.str.2 = [7 x i8] c"--help\00"
@.str.3 = [9 x i8] c"Usage: \0A\00"
@.str.4 = [42 x i8] c" Lyra2 pwd salt kLen tCost nRows \0A\0A\00"
@.str.5 = [9 x i8] c"Inputs:\0A\00"
@.str.6 = [22 x i8] c" - pwd: the password\0A\00"
@.str.7 = [19 x i8] c" - salt: the salt\0A\00"
@.str.8 = [22 x i8] c" - kLen: output size\0A\00"
@.str.9 = [35 x i8] c" - tCost: the time cost parameter\0A\00"
@.str.10 = [40 x i8] c" - nRows: the number of rows parameter\0A\00"
@.str.11 = [2 x i8] c"\0A\00"
@.str.12 = [5 x i8] c"Or:\0A\00"
@.str.13 = [93 x i8] c" Lyra2 tCost nRows --testVectors (to generate test vectors and test Lyra2 operation)\0A\0A\00"
@.str.14 = [60 x i8] c"Invalid options.\0AFor more information, try \22Lyra2 --help\22.\0A\00"
@.str.15 = [14 x i8] c"--testVectors\00"
@.str.16 = [47 x i8] c"Invalid options.\0ATry \22Lyra2 --help\22 for help.\0A\00"
@.str.17 = [20 x i8] c"nRows must be >= 3\0A\00"
@.str.18 = [10 x i8] c"Inputs: \0A\00"
@.str.19 = [15 x i8] c"\09Password: %s\0A\00"
@.str.20 = [22 x i8] c"\09Password Length: %u\0A\00"
@.str.21 = [11 x i8] c"\09Salt: %s\0A\00"
@.str.22 = [18 x i8] c"\09Salt Length: %u\0A\00"
@.str.23 = [20 x i8] c"\09Output Length: %u\0A\00"
@.str.24 = [140 x i8] c"------------------------------------------------------------------------------------------------------------------------------------------\0A\00"
@.str.25 = [14 x i8] c"Parameters: \0A\00"
@.str.26 = [8 x i8] c"\09T: %u\0A\00"
@.str.27 = [8 x i8] c"\09R: %u\0A\00"
@.str.28 = [8 x i8] c"\09C: %u\0A\00"
@.str.29 = [18 x i8] c"\09Parallelism: %u\0A\00"
@.str.30 = [49 x i8] c"\09Synchronism (used just if Parallelism > 1): %u\0A\00"
@.str.31 = [1 x i8] zeroinitializer
@.str.32 = [7 x i8] c"Blake2\00"
@.str.33 = [13 x i8] c"\09Sponge: %s\0A\00"
@.str.34 = [40 x i8] c"\09Sponge Blocks (bitrate): %u = %u bits\0A\00"
@.str.35 = [107 x i8] c"\09Memory: %ld bytes (IMPORTANT: This implementation is known to have issues for such a large memory usage)\0A\00"
@.str.36 = [20 x i8] c"\09Memory: %ld bytes\0A\00"
@.str.37 = [10 x i8] c"Output: \0A\00"
@.str.38 = [6 x i8] c"\0A\09K: \00"
@.str.39 = [4 x i8] c"%x|\00"
@.str.40 = [53 x i8] c"Error: unable to allocate memory (nRows too large?)\0A\00"
@.str.41 = [18 x i8] c"Unexpected error\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i64
%16 = alloca i32
%17 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 64, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %9
store i32 11, i32* %10
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8** %11
store i32 16, i32* %12
%18 = load i32, i32* %4
switch i32 %18, label %82 [
i32 2, label %19
i32 6, label %39
i32 4, label %62
]
19: ; preds = %2
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = load i8*, i8** %21
%23 = call i32 @strcmp(i8* %22, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%24 = icmp eq i32 %23, 0
br i1 %24, label %25, label %37
25: ; preds = %19
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.4, i64 0, i64 0))
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0))
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0))
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0))
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.9, i64 0, i64 0))
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.10, i64 0, i64 0))
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0))
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([93 x i8], [93 x i8]* @.str.13, i64 0, i64 0))
store i32 0, i32* %3
br label %166
37: ; preds = %19
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.14, i64 0, i64 0))
store i32 0, i32* %3
br label %166
39: ; preds = %2
%40 = load i8**, i8*** %5
%41 = getelementptr inbounds i8*, i8** %40, i64 1
%42 = load i8*, i8** %41
store i8* %42, i8** %9
%43 = load i8*, i8** %9
%44 = call i32 @strlen(i8* %43)
store i32 %44, i32* %10
%45 = load i8**, i8*** %5
%46 = getelementptr inbounds i8*, i8** %45, i64 2
%47 = load i8*, i8** %46
store i8* %47, i8** %11
%48 = load i8*, i8** %11
%49 = call i32 @strlen(i8* %48)
store i32 %49, i32* %12
%50 = load i8**, i8*** %5
%51 = getelementptr inbounds i8*, i8** %50, i64 3
%52 = load i8*, i8** %51
%53 = call i32 @atol(i8* %52)
store i32 %53, i32* %6
%54 = load i8**, i8*** %5
%55 = getelementptr inbounds i8*, i8** %54, i64 4
%56 = load i8*, i8** %55
%57 = call i32 @atol(i8* %56)
store i32 %57, i32* %7
%58 = load i8**, i8*** %5
%59 = getelementptr inbounds i8*, i8** %58, i64 5
%60 = load i8*, i8** %59
%61 = call i32 @atol(i8* %60)
store i32 %61, i32* %8
br label %84
62: ; preds = %2
%63 = load i8**, i8*** %5
%64 = getelementptr inbounds i8*, i8** %63, i64 3
%65 = load i8*, i8** %64
%66 = call i32 @strcmp(i8* %65, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.15, i64 0, i64 0))
%67 = icmp eq i32 %66, 0
br i1 %67, label %68, label %80
68: ; preds = %62
%69 = load i8**, i8*** %5
%70 = getelementptr inbounds i8*, i8** %69, i64 1
%71 = load i8*, i8** %70
%72 = call i32 @atoi(i8* %71)
store i32 %72, i32* %7
%73 = load i8**, i8*** %5
%74 = getelementptr inbounds i8*, i8** %73, i64 2
%75 = load i8*, i8** %74
%76 = call i32 @atoi(i8* %75)
store i32 %76, i32* %8
%77 = load i32, i32* %7
%78 = load i32, i32* %8
%79 = call i32 @testVectors(i32 %77, i32 %78)
store i32 0, i32* %3
br label %166
80: ; preds = %62
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.14, i64 0, i64 0))
store i32 0, i32* %3
br label %166
82: ; preds = %2
%83 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.16, i64 0, i64 0))
store i32 0, i32* %3
br label %166
84: ; preds = %39
%85 = load i32, i32* %8
%86 = icmp ult i32 %85, 3
br i1 %86, label %87, label %89
87: ; preds = %84
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.17, i64 0, i64 0))
store i32 0, i32* %3
br label %166
89: ; preds = %84
%90 = load i32, i32* %6
%91 = call i8* @malloc(i32 %90)
store i8* %91, i8** %13
%92 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.18, i64 0, i64 0))
%93 = load i8*, i8** %9
%94 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.19, i64 0, i64 0), i8* %93)
%95 = load i32, i32* %10
%96 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.20, i64 0, i64 0), i32 %95)
%97 = load i8*, i8** %11
%98 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.21, i64 0, i64 0), i8* %97)
%99 = load i32, i32* %12
%100 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.22, i64 0, i64 0), i32 %99)
%101 = load i32, i32* %6
%102 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.23, i64 0, i64 0), i32 %101)
%103 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.24, i64 0, i64 0))
%104 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.25, i64 0, i64 0))
%105 = load i32, i32* %7
%106 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.26, i64 0, i64 0), i32 %105)
%107 = load i32, i32* %8
%108 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.27, i64 0, i64 0), i32 %107)
%109 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.28, i64 0, i64 0), i32 256)
%110 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.29, i64 0, i64 0), i32 2)
%111 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.30, i64 0, i64 0), i32 2)
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.31, i64 0, i64 0), i8** %14
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.32, i64 0, i64 0), i8** %14
%112 = load i8*, i8** %14
%113 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.33, i64 0, i64 0), i8* %112)
%114 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.34, i64 0, i64 0), i32 12, i32 768)
%115 = load i32, i32* %8
%116 = zext i32 %115 to i64
%117 = mul i64 %116, 24576
store i64 %117, i64* %15
%118 = load i64, i64* %15
%119 = icmp ugt i64 %118, 1610612736
br i1 %119, label %120, label %123
120: ; preds = %89
%121 = load i64, i64* %15
%122 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([107 x i8], [107 x i8]* @.str.35, i64 0, i64 0), i64 %121)
br label %126
123: ; preds = %89
%124 = load i64, i64* %15
%125 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.36, i64 0, i64 0), i64 %124)
br label %126
126: ; preds = %123, %120
%127 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.24, i64 0, i64 0))
%128 = load i8*, i8** %13
%129 = load i32, i32* %6
%130 = load i8*, i8** %9
%131 = load i32, i32* %10
%132 = load i8*, i8** %11
%133 = load i32, i32* %12
%134 = load i32, i32* %7
%135 = load i32, i32* %8
%136 = call i32 @PHS(i8* %128, i32 %129, i8* %130, i32 %131, i8* %132, i32 %133, i32 %134, i32 %135)
store i32 %136, i32* %16
%137 = load i32, i32* %16
switch i32 %137, label %159 [
i32 0, label %138
i32 -1, label %157
]
138: ; preds = %126
%139 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.37, i64 0, i64 0))
%140 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.38, i64 0, i64 0))
store i32 0, i32* %17
br label %141
141: ; preds = %153, %138
%142 = load i32, i32* %17
%143 = load i32, i32* %6
%144 = icmp ult i32 %142, %143
br i1 %144, label %145, label %156
145: ; preds = %141
%146 = load i8*, i8** %13
%147 = load i32, i32* %17
%148 = sext i32 %147 to i64
%149 = getelementptr inbounds i8, i8* %146, i64 %148
%150 = load i8, i8* %149
%151 = zext i8 %150 to i32
%152 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.39, i64 0, i64 0), i32 %151)
br label %153
153: ; preds = %145
%154 = load i32, i32* %17
%155 = add nsw i32 %154, 1
store i32 %155, i32* %17
br label %141
156: ; preds = %141
br label %161
157: ; preds = %126
%158 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.40, i64 0, i64 0))
br label %161
159: ; preds = %126
%160 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.41, i64 0, i64 0))
br label %161
161: ; preds = %159, %157, %156
%162 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
%163 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.24, i64 0, i64 0))
%164 = load i8*, i8** %13
%165 = call i32 @free(i8* %164)
store i32 0, i32* %3
br label %166
166: ; preds = %161, %87, %82, %80, %68, %37, %25
%167 = load i32, i32* %3
ret i32 %167
}

LLVM IR (-O2):
@.str.2 = [7 x i8] c"--help\00"
@.str.15 = [14 x i8] c"--testVectors\00"
@.str.19 = [15 x i8] c"\09Password: %s\0A\00"
@.str.20 = [22 x i8] c"\09Password Length: %u\0A\00"
@.str.21 = [11 x i8] c"\09Salt: %s\0A\00"
@.str.22 = [18 x i8] c"\09Salt Length: %u\0A\00"
@.str.23 = [20 x i8] c"\09Output Length: %u\0A\00"
@.str.26 = [8 x i8] c"\09T: %u\0A\00"
@.str.27 = [8 x i8] c"\09R: %u\0A\00"
@.str.28 = [8 x i8] c"\09C: %u\0A\00"
@.str.29 = [18 x i8] c"\09Parallelism: %u\0A\00"
@.str.30 = [49 x i8] c"\09Synchronism (used just if Parallelism > 1): %u\0A\00"
@.str.32 = [7 x i8] c"Blake2\00"
@.str.33 = [13 x i8] c"\09Sponge: %s\0A\00"
@.str.34 = [40 x i8] c"\09Sponge Blocks (bitrate): %u = %u bits\0A\00"
@.str.35 = [107 x i8] c"\09Memory: %ld bytes (IMPORTANT: This implementation is known to have issues for such a large memory usage)\0A\00"
@.str.36 = [20 x i8] c"\09Memory: %ld bytes\0A\00"
@.str.38 = [6 x i8] c"\0A\09K: \00"
@.str.39 = [4 x i8] c"%x|\00"
@str.42 = [9 x i8] c"Inputs: \00"
@str.44 = [13 x i8] c"Parameters: \00"
@str.46 = [52 x i8] c"Error: unable to allocate memory (nRows too large?)\00"
@str.47 = [139 x i8] c"------------------------------------------------------------------------------------------------------------------------------------------\00"
@str.48 = [9 x i8] c"Output: \00"
@str.49 = [17 x i8] c"Unexpected error\00"
@str.50 = [19 x i8] c"nRows must be >= 3\00"
@str.51 = [59 x i8] c"Invalid options.\0AFor more information, try \22Lyra2 --help\22.\00"
@str.52 = [8 x i8] c"Usage: \00"
@str.53 = [41 x i8] c" Lyra2 pwd salt kLen tCost nRows \0A\00"
@str.54 = [8 x i8] c"Inputs:\00"
@str.55 = [21 x i8] c" - pwd: the password\00"
@str.56 = [18 x i8] c" - salt: the salt\00"
@str.57 = [21 x i8] c" - kLen: output size\00"
@str.58 = [34 x i8] c" - tCost: the time cost parameter\00"
@str.59 = [39 x i8] c" - nRows: the number of rows parameter\00"
@str.60 = [4 x i8] c"Or:\00"
@str.61 = [92 x i8] c" Lyra2 tCost nRows --testVectors (to generate test vectors and test Lyra2 operation)\0A\00"
@str.62 = [46 x i8] c"Invalid options.\0ATry \22Lyra2 --help\22 for help.\00"
define i32 @main(i32 %0, i8** nocapture %1) {
switch i32 %0, label %54 [
i32 2, label %3
i32 6, label %22
i32 4, label %39
]
3: ; preds = %2
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = tail call i32 @strcmp(i8* dereferenceable(1) %5, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %20
8: ; preds = %3
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.52, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.53, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.54, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.55, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.56, i64 0, i64 0))
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.57, i64 0, i64 0))
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.58, i64 0, i64 0))
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.59, i64 0, i64 0))
%17 = tail call i32 @putchar(i32 10)
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.60, i64 0, i64 0))
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([92 x i8], [92 x i8]* @str.61, i64 0, i64 0))
br label %104
20: ; preds = %3
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str.51, i64 0, i64 0))
br label %104
22: ; preds = %2
%23 = getelementptr inbounds i8*, i8** %1, i64 1
%24 = load i8*, i8** %23
%25 = tail call i32 @strlen(i8* %24)
%26 = getelementptr inbounds i8*, i8** %1, i64 2
%27 = load i8*, i8** %26
%28 = tail call i32 @strlen(i8* %27)
%29 = getelementptr inbounds i8*, i8** %1, i64 3
%30 = load i8*, i8** %29
%31 = tail call i32 @atol(i8* %30)
%32 = getelementptr inbounds i8*, i8** %1, i64 4
%33 = load i8*, i8** %32
%34 = tail call i32 @atol(i8* %33)
%35 = getelementptr inbounds i8*, i8** %1, i64 5
%36 = load i8*, i8** %35
%37 = tail call i32 @atol(i8* %36)
%38 = icmp ult i32 %37, 3
br i1 %38, label %56, label %58
39: ; preds = %2
%40 = getelementptr inbounds i8*, i8** %1, i64 3
%41 = load i8*, i8** %40
%42 = tail call i32 @strcmp(i8* dereferenceable(1) %41, i8* dereferenceable(14) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.15, i64 0, i64 0))
%43 = icmp eq i32 %42, 0
br i1 %43, label %44, label %52
44: ; preds = %39
%45 = getelementptr inbounds i8*, i8** %1, i64 1
%46 = load i8*, i8** %45
%47 = tail call i32 @atoi(i8* %46)
%48 = getelementptr inbounds i8*, i8** %1, i64 2
%49 = load i8*, i8** %48
%50 = tail call i32 @atoi(i8* %49)
%51 = tail call i32 @testVectors(i32 %47, i32 %50)
br label %104
52: ; preds = %39
%53 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str.51, i64 0, i64 0))
br label %104
54: ; preds = %2
%55 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.62, i64 0, i64 0))
br label %104
56: ; preds = %22
%57 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.50, i64 0, i64 0))
br label %104
58: ; preds = %22
%59 = tail call i8* @malloc(i32 %31)
%60 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.42, i64 0, i64 0))
%61 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.19, i64 0, i64 0), i8* %24)
%62 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.20, i64 0, i64 0), i32 %25)
%63 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.21, i64 0, i64 0), i8* %27)
%64 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.22, i64 0, i64 0), i32 %28)
%65 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.23, i64 0, i64 0), i32 %31)
%66 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([139 x i8], [139 x i8]* @str.47, i64 0, i64 0))
%67 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.44, i64 0, i64 0))
%68 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.26, i64 0, i64 0), i32 %34)
%69 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.27, i64 0, i64 0), i32 %37)
%70 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.28, i64 0, i64 0), i32 256)
%71 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.29, i64 0, i64 0), i32 2)
%72 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.30, i64 0, i64 0), i32 2)
%73 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.33, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.32, i64 0, i64 0))
%74 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.34, i64 0, i64 0), i32 12, i32 768)
%75 = zext i32 %37 to i64
%76 = mul nuw nsw i64 %75, 24576
%77 = icmp ugt i64 %76, 1610612736
%78 = select i1 %77, i8* getelementptr inbounds ([107 x i8], [107 x i8]* @.str.35, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.36, i64 0, i64 0)
%79 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %78, i64 %76)
%80 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([139 x i8], [139 x i8]* @str.47, i64 0, i64 0))
%81 = tail call i32 @PHS(i8* %59, i32 %31, i8* %24, i32 %25, i8* %27, i32 %28, i32 %34, i32 %37)
switch i32 %81, label %96 [
i32 0, label %82
i32 -1, label %97
]
82: ; preds = %58
%83 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.48, i64 0, i64 0))
%84 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.38, i64 0, i64 0))
%85 = icmp eq i32 %31, 0
br i1 %85, label %100, label %86
86: ; preds = %82
%87 = zext i32 %31 to i64
br label %88
88: ; preds = %86, %88
%89 = phi i64 [ 0, %86 ], [ %94, %88 ]
%90 = getelementptr inbounds i8, i8* %59, i64 %89
%91 = load i8, i8* %90
%92 = zext i8 %91 to i32
%93 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.39, i64 0, i64 0), i32 %92)
%94 = add nuw nsw i64 %89, 1
%95 = icmp eq i64 %94, %87
br i1 %95, label %100, label %88
96: ; preds = %58
br label %97
97: ; preds = %58, %96
%98 = phi i8* [ getelementptr inbounds ([17 x i8], [17 x i8]* @str.49, i64 0, i64 0), %96 ], [ getelementptr inbounds ([52 x i8], [52 x i8]* @str.46, i64 0, i64 0), %58 ]
%99 = tail call i32 @puts(i8* dereferenceable(1) %98)
br label %100
100: ; preds = %88, %97, %82
%101 = tail call i32 @putchar(i32 10)
%102 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([139 x i8], [139 x i8]* @str.47, i64 0, i64 0))
%103 = tail call i32 @free(i8* %59)
br label %104
104: ; preds = %100, %56, %54, %52, %44, %20, %8
ret i32 0
}