#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 double tempf2;
typedef double tempf1;
typedef double tempd2;
typedef double tempd1;

/* Variables and functions */
int free_rng(int *);
double get_rn_dbl(int *);
float get_rn_flt(int *);
int get_rn_int(int *);
int /*<<< orphan*/ ignore(char *);
int *init_rng(int, int, int, int /*<<< orphan*/);
int pack_rng(int *, char **);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
scalar_t__ spawn_rng(int *, int, int ***, int);
int *unpack_rng(char *);
int check_gen() {
  int *gen1, *gen2, *gen3, *gen4, **gen5, **newgen1, **newgen2, i, size;
  char *s;
  int tempi, tempi2, correct, result = 1;
  int ngens, seed, nsp;
  float tempf1, tempf2;
  double tempd1;
  ngens = 3;
  seed = 985456376;
  gen1 = init_rng(0, ngens, seed, 0);
  gen2 = init_rng(1, ngens, seed, 0);
  gen3 = init_rng(2, ngens, seed, 0);
  correct = 1;
  for (i = 0; i < 500; i++) {
    tempi2 = get_rn_int(gen1);
    scanf("%d\n", &tempi);
    if (tempi != tempi2) {
      printf("%d. %d, %d\n", i, tempi, tempi2);
      result = correct = 0;
    }
  }
  if (correct == 0)
    printf("FAILED: Integer generator does not reproduce correct "
           "stream.\n\tArithmetic on this machine may not be compatible with "
           "this generator.\n");
  else
    ignore("PASSED: Integer generator passed the reproducibility test\n");
  correct = 1;
  for (i = 0; i < 500; i++) {
    tempf1 = get_rn_flt(gen1);
    scanf("%f\n", &tempf2);
    if ((((tempf1) > (tempf2)) ? ((tempf1) - (tempf2))
                               : ((tempf2) - (tempf1))) > 1.0e-6) {
      printf("%d. %8.6f %8.6f\n", i, tempf2, tempf1);
      result = correct = 0;
    }
  }
  if (correct == 0)
    printf("FAILED: Float generator does not reproduce correct "
           "stream\n\tArithmetic on this machine may not be compatible with "
           "this generator.\n");
  else
    ignore("PASSED: Float generator passed the reproducibility test\n");
  correct = 1;
  for (i = 0; i < 500; i++) {
    double tempd2;
    scanf("%lf\n", &tempd1);
    tempd2 = get_rn_dbl(gen1);
    if ((((tempd1) > (tempd2)) ? ((tempd1) - (tempd2))
                               : ((tempd2) - (tempd1))) > 1.0e-14) {
      printf("%d. %18.15f %18.15f\n", i, tempd1, tempd2);
      result = correct = 0;
    }
  }
  if (correct == 0)
    printf("FAILED: Double generator does not reproduce correct "
           "stream.\n\tArithmetic on this machine may not be compatible with "
           "this generator.\n");
  else
    ignore("PASSED: Double generator spawns correctly\n");
  nsp = 0;
  nsp += spawn_rng(gen2, 2, &newgen1, !1);
  nsp += spawn_rng(newgen1[1], 2, &newgen2, !1);
  if (nsp != 4) {
    result = 0;
    printf("FAILED: Generator was unable to spawn\n");
  }
  correct = 1;
  for (i = 0; i < 50; i++) {
    int irn;
    scanf("%d\n", &tempi);
    irn = get_rn_int(newgen2[1]);
    if (tempi != irn) {
      printf("%d. %x %x\n", i, tempi, irn);
      result = correct = 0;
    }
  }
  if (correct == 0)
    printf(
        "FAILED: Generator does not reproduce correct stream after "
        "spawning\n\tThis is probably an error in spawning the generators\n");
  else
    ignore("PASSED: Generator spawns correctly\n");
  size = pack_rng(newgen2[1], &s);
  if (size == 0) {
    result = 0;
    printf("FAILED: Generator was unable to pack\n");
  }
  gen4 = unpack_rng(s);
  correct = 1;
  for (i = 0; i < 50; i++) {
    scanf("%d\n", &tempi);
    if (tempi != get_rn_int(gen4))
      result = correct = 0;
  }
  if (correct == 0)
    printf("FAILED: Generator does not reproduce correct stream after packing "
           "and unpacking\n\tThis is probably an error in packing/unpacking "
           "the generators\n");
  else
    ignore("PASSED: Generator packs and unpacks stream correctly\n");
  correct = 1;
  spawn_rng(gen4, 1, &gen5, !1);
  for (i = 0; i < 50; i++) {
    scanf("%d\n", &tempi);
    if (tempi != get_rn_int(gen5[0]))
      result = correct = 0;
  }
  if (correct == 0)
    printf("FAILED: Generator does not spawn correct stream after packing and "
           "unpacking\n\tThis is probably an error in packing/unpacking the "
           "generators\n");
  else
    ignore(
        "PASSED: Generator packs and unpacks spawning information correctly\n");
  ignore("Checking free_sprng for integer generator ...\n");
  nsp = free_rng(gen1);
  nsp = free_rng(gen2);
  nsp = free_rng(gen3);
  if (nsp != 6) {
    result = 0;
    printf("FAILED: Free returns %d instead of %d\n", nsp, 6);
  }
  nsp = free_rng(gen4);
  nsp = free_rng(gen5[0]);
  nsp = free_rng(newgen1[0]);
  nsp = free_rng(newgen1[1]);
  nsp = free_rng(newgen2[0]);
  nsp = free_rng(newgen2[1]);
  if (nsp != 0) {
    result = 0;
    printf("FAILED: Free returns %d instead of %d\n", nsp, 0);
  }
  ignore("\n... Completed checking generator \n\n");
  return result;
}


x86 assembly (clang, -O0):
<check_gen>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x1,-0x58(%rbp)
movl   $0x3,-0x5c(%rbp)
movl   $0x3abcdef8,-0x60(%rbp)
mov    -0x5c(%rbp),%esi
mov    -0x60(%rbp),%edx
xor    %ecx,%ecx
mov    %ecx,%edi
call   1060 <init_rng@plt>
mov    %rax,-0x8(%rbp)
mov    -0x5c(%rbp),%esi
mov    -0x60(%rbp),%edx
mov    $0x1,%edi
xor    %ecx,%ecx
call   1060 <init_rng@plt>
mov    %rax,-0x10(%rbp)
mov    -0x5c(%rbp),%esi
mov    -0x60(%rbp),%edx
mov    $0x2,%edi
xor    %ecx,%ecx
call   1060 <init_rng@plt>
mov    %rax,-0x18(%rbp)
movl   $0x1,-0x54(%rbp)
movl   $0x0,-0x3c(%rbp)
cmpl   $0x1f4,-0x3c(%rbp)
jge    128c <check_gen+0xdc>
mov    -0x8(%rbp),%rdi
call   10a0 <get_rn_int@plt>
mov    %eax,-0x50(%rbp)
lea    0xddb(%rip),%rdi
lea    -0x4c(%rbp),%rsi
mov    $0x0,%al
call   1090 <scanf@plt>
mov    -0x4c(%rbp),%eax
cmp    -0x50(%rbp),%eax
je     1279 <check_gen+0xc9>
mov    -0x3c(%rbp),%esi
mov    -0x4c(%rbp),%edx
mov    -0x50(%rbp),%ecx
lea    0xdac(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x54(%rbp)
movl   $0x0,-0x58(%rbp)
jmp    127e <check_gen+0xce>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    121d <check_gen+0x6d>
cmpl   $0x0,-0x54(%rbp)
jne    12a9 <check_gen+0xf9>
lea    0xd7f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    12b5 <check_gen+0x105>
lea    0xdf1(%rip),%rdi
call   1040 <ignore@plt>
movl   $0x1,-0x54(%rbp)
movl   $0x0,-0x3c(%rbp)
cmpl   $0x1f4,-0x3c(%rbp)
jge    138a <check_gen+0x1da>
mov    -0x8(%rbp),%rdi
call   10d0 <get_rn_flt@plt>
movss  %xmm0,-0x68(%rbp)
lea    0xdf7(%rip),%rdi
lea    -0x6c(%rbp),%rsi
mov    $0x0,%al
call   1090 <scanf@plt>
movss  -0x68(%rbp),%xmm0
ucomiss -0x6c(%rbp),%xmm0
jbe    1316 <check_gen+0x166>
movss  -0x68(%rbp),%xmm0
subss  -0x6c(%rbp),%xmm0
movss  %xmm0,-0x88(%rbp)
ff
jmp    1328 <check_gen+0x178>
movss  -0x6c(%rbp),%xmm0
subss  -0x68(%rbp),%xmm0
movss  %xmm0,-0x88(%rbp)
ff
movss  -0x88(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
movsd  0xccc(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1377 <check_gen+0x1c7>
mov    -0x3c(%rbp),%esi
movss  -0x6c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x68(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xd7e(%rip),%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movl   $0x0,-0x54(%rbp)
movl   $0x0,-0x58(%rbp)
jmp    137c <check_gen+0x1cc>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    12c3 <check_gen+0x113>
cmpl   $0x0,-0x54(%rbp)
jne    13a7 <check_gen+0x1f7>
lea    0xd56(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    13b3 <check_gen+0x203>
lea    0xdc5(%rip),%rdi
call   1040 <ignore@plt>
movl   $0x1,-0x54(%rbp)
movl   $0x0,-0x3c(%rbp)
cmpl   $0x1f4,-0x3c(%rbp)
jge    147d <check_gen+0x2cd>
lea    0xdd7(%rip),%rdi
lea    -0x78(%rbp),%rsi
mov    $0x0,%al
call   1090 <scanf@plt>
mov    -0x8(%rbp),%rdi
call   10c0 <get_rn_dbl@plt>
movsd  %xmm0,-0x80(%rbp)
movsd  -0x78(%rbp),%xmm0
ucomisd -0x80(%rbp),%xmm0
jbe    1415 <check_gen+0x265>
movsd  -0x78(%rbp),%xmm0
subsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
jmp    1427 <check_gen+0x277>
movsd  -0x80(%rbp),%xmm0
subsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
movsd  0xbc9(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    146a <check_gen+0x2ba>
mov    -0x3c(%rbp),%esi
movsd  -0x78(%rbp),%xmm0
movsd  -0x80(%rbp),%xmm1
lea    0xd5c(%rip),%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movl   $0x0,-0x54(%rbp)
movl   $0x0,-0x58(%rbp)
jmp    146f <check_gen+0x2bf>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    13c1 <check_gen+0x211>
cmpl   $0x0,-0x54(%rbp)
jne    149a <check_gen+0x2ea>
lea    0xd38(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    14a6 <check_gen+0x2f6>
lea    0xda9(%rip),%rdi
call   1040 <ignore@plt>
movl   $0x0,-0x64(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2,%esi
lea    -0x30(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <spawn_rng@plt>
mov    %rax,%rcx
movslq -0x64(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x64(%rbp)
mov    -0x30(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x2,%esi
lea    -0x38(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <spawn_rng@plt>
mov    %rax,%rcx
movslq -0x64(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x64(%rbp)
cmpl   $0x4,-0x64(%rbp)
je     1512 <check_gen+0x362>
movl   $0x0,-0x58(%rbp)
lea    0xd6a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x54(%rbp)
movl   $0x0,-0x3c(%rbp)
cmpl   $0x32,-0x3c(%rbp)
jge    1599 <check_gen+0x3e9>
lea    0xae7(%rip),%rdi
lea    -0x4c(%rbp),%rsi
mov    $0x0,%al
call   1090 <scanf@plt>
mov    -0x38(%rbp),%rax
mov    0x8(%rax),%rdi
call   10a0 <get_rn_int@plt>
mov    %eax,-0x84(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x84(%rbp),%eax
je     1586 <check_gen+0x3d6>
mov    -0x3c(%rbp),%esi
mov    -0x4c(%rbp),%edx
mov    -0x84(%rbp),%ecx
lea    0xd2b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x54(%rbp)
movl   $0x0,-0x58(%rbp)
jmp    158b <check_gen+0x3db>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1520 <check_gen+0x370>
cmpl   $0x0,-0x54(%rbp)
jne    15b6 <check_gen+0x406>
lea    0xcfd(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    15c2 <check_gen+0x412>
lea    0xd64(%rip),%rdi
call   1040 <ignore@plt>
mov    -0x38(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x48(%rbp),%rsi
call   1080 <pack_rng@plt>
mov    %eax,-0x40(%rbp)
cmpl   $0x0,-0x40(%rbp)
jne    15f5 <check_gen+0x445>
movl   $0x0,-0x58(%rbp)
lea    0xd57(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x48(%rbp),%rdi
call   1070 <unpack_rng@plt>
mov    %rax,-0x20(%rbp)
movl   $0x1,-0x54(%rbp)
movl   $0x0,-0x3c(%rbp)
cmpl   $0x32,-0x3c(%rbp)
jge    166f <check_gen+0x4bf>
lea    0x9f7(%rip),%rdi
lea    -0x4c(%rbp),%rsi
mov    $0x0,%al
call   1090 <scanf@plt>
mov    -0x4c(%rbp),%eax
mov    %eax,-0x94(%rbp)
mov    -0x20(%rbp),%rdi
call   10a0 <get_rn_int@plt>
mov    %eax,%ecx
mov    -0x94(%rbp),%eax
cmp    %ecx,%eax
je     165c <check_gen+0x4ac>
movl   $0x0,-0x54(%rbp)
movl   $0x0,-0x58(%rbp)
jmp    1661 <check_gen+0x4b1>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1610 <check_gen+0x460>
cmpl   $0x0,-0x54(%rbp)
jne    168c <check_gen+0x4dc>
lea    0xceb(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1698 <check_gen+0x4e8>
lea    0xd68(%rip),%rdi
call   1040 <ignore@plt>
movl   $0x1,-0x54(%rbp)
mov    -0x20(%rbp),%rdi
mov    $0x1,%esi
lea    -0x28(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <spawn_rng@plt>
movl   $0x0,-0x3c(%rbp)
cmpl   $0x32,-0x3c(%rbp)
jge    171c <check_gen+0x56c>
lea    0x94d(%rip),%rdi
lea    -0x4c(%rbp),%rsi
mov    $0x0,%al
call   1090 <scanf@plt>
mov    -0x4c(%rbp),%eax
mov    %eax,-0x98(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%rdi
call   10a0 <get_rn_int@plt>
mov    %eax,%ecx
mov    -0x98(%rbp),%eax
cmp    %ecx,%eax
je     1709 <check_gen+0x559>
movl   $0x0,-0x54(%rbp)
movl   $0x0,-0x58(%rbp)
jmp    170e <check_gen+0x55e>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    16ba <check_gen+0x50a>
cmpl   $0x0,-0x54(%rbp)
jne    1739 <check_gen+0x589>
lea    0xd04(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1745 <check_gen+0x595>
lea    0xd7d(%rip),%rdi
call   1040 <ignore@plt>
lea    0xdb5(%rip),%rdi
call   1040 <ignore@plt>
mov    -0x8(%rbp),%rdi
call   10b0 <free_rng@plt>
mov    %eax,-0x64(%rbp)
mov    -0x10(%rbp),%rdi
call   10b0 <free_rng@plt>
mov    %eax,-0x64(%rbp)
mov    -0x18(%rbp),%rdi
call   10b0 <free_rng@plt>
mov    %eax,-0x64(%rbp)
cmpl   $0x6,-0x64(%rbp)
je     179c <check_gen+0x5ec>
movl   $0x0,-0x58(%rbp)
mov    -0x64(%rbp),%esi
lea    0xda0(%rip),%rdi
mov    $0x6,%edx
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x20(%rbp),%rdi
call   10b0 <free_rng@plt>
mov    %eax,-0x64(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%rdi
call   10b0 <free_rng@plt>
mov    %eax,-0x64(%rbp)
mov    -0x30(%rbp),%rax
mov    (%rax),%rdi
call   10b0 <free_rng@plt>
mov    %eax,-0x64(%rbp)
mov    -0x30(%rbp),%rax
mov    0x8(%rax),%rdi
call   10b0 <free_rng@plt>
mov    %eax,-0x64(%rbp)
mov    -0x38(%rbp),%rax
mov    (%rax),%rdi
call   10b0 <free_rng@plt>
mov    %eax,-0x64(%rbp)
mov    -0x38(%rbp),%rax
mov    0x8(%rax),%rdi
call   10b0 <free_rng@plt>
mov    %eax,-0x64(%rbp)
cmpl   $0x0,-0x64(%rbp)
je     1819 <check_gen+0x669>
movl   $0x0,-0x58(%rbp)
mov    -0x64(%rbp),%esi
lea    0xd20(%rip),%rdi
xor    %edx,%edx
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xd37(%rip),%rdi
call   1040 <ignore@plt>
mov    -0x58(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_gen>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
xor    %edi,%edi
mov    $0x3,%esi
mov    $0x3abcdef8,%edx
xor    %ecx,%ecx
call   1070 <init_rng@plt>
mov    %rax,0x20(%rsp)
mov    $0x1,%r13d
mov    $0x1,%edi
mov    $0x3,%esi
mov    $0x3abcdef8,%edx
xor    %ecx,%ecx
call   1070 <init_rng@plt>
mov    %rax,0x40(%rsp)
mov    $0x2,%edi
mov    $0x3,%esi
mov    $0x3abcdef8,%edx
xor    %ecx,%ecx
call   1070 <init_rng@plt>
mov    %rax,0x50(%rsp)
lea    0xdef(%rip),%r12
lea    0xc(%rsp),%rbp
xor    %eax,%eax
xor    %ecx,%ecx
mov    %ecx,0x1c(%rsp)
mov    %rax,0x10(%rsp)
lea    -0x1f4(%rax),%ebx
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    0x20(%rsp),%rdi
call   10b0 <get_rn_int@plt>
mov    %eax,%r15d
mov    %r12,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   10a0 <scanf@plt>
mov    0xc(%rsp),%edx
cmp    %r15d,%edx
jne    1280 <check_gen+0xc0>
add    $0xffffffff,%r14d
cmp    %r14d,%ebx
jne    1250 <check_gen+0x90>
jmp    12bc <check_gen+0xfc>
xchg   %ax,%ax
mov    0x10(%rsp),%rax
mov    %eax,%ebx
sub    %r14d,%ebx
xor    %r13d,%r13d
lea    0xd7c(%rip),%rdi
mov    %ebx,%esi
mov    %r15d,%ecx
xor    %eax,%eax
call   1060 <printf@plt>
add    $0x1,%ebx
mov    0x10(%rsp),%rax
add    $0xfffffe0d,%eax
mov    $0x1,%cl
cmp    %r14d,%eax
mov    %ebx,%eax
jne    1232 <check_gen+0x72>
jmp    12c3 <check_gen+0x103>
testb  $0x1,0x1c(%rsp)
je     12d1 <check_gen+0x111>
lea    0x1226(%rip),%rdi
call   1030 <puts@plt>
jmp    12dd <check_gen+0x11d>
lea    0xd44(%rip),%rdi
call   1050 <ignore@plt>
lea    0xd73(%rip),%rbx
lea    0x3c(%rsp),%r15
xor    %r12d,%r12d
xor    %eax,%eax
mov    %eax,0x1c(%rsp)
lea    -0x1f4(%r12),%r14d
ff
xor    %ebp,%ebp
nopl   0x0(%rax)
mov    0x20(%rsp),%rdi
call   10e0 <get_rn_flt@plt>
movss  %xmm0,0x10(%rsp)
mov    %rbx,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   10a0 <scanf@plt>
movss  0x10(%rsp),%xmm4
movss  0x3c(%rsp),%xmm0
movaps %xmm4,%xmm1
subss  %xmm0,%xmm1
movaps %xmm0,%xmm2
subss  %xmm4,%xmm2
movaps %xmm0,%xmm3
cmpltss %xmm4,%xmm3
andps  %xmm3,%xmm1
andnps %xmm2,%xmm3
orps   %xmm1,%xmm3
xorps  %xmm1,%xmm1
cvtss2sd %xmm3,%xmm1
ucomisd 0xca9(%rip),%xmm1
ja     1370 <check_gen+0x1b0>
add    $0xffffffff,%ebp
cmp    %ebp,%r14d
jne    1300 <check_gen+0x140>
jmp    13b0 <check_gen+0x1f0>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm4,%xmm1
mov    %r12d,%r14d
sub    %ebp,%r14d
lea    0xcd3(%rip),%rdi
mov    %r14d,%esi
mov    $0x2,%al
call   1060 <printf@plt>
add    $0x1,%r14d
add    $0xfffffe0d,%r12d
mov    $0x1,%al
xor    %r13d,%r13d
cmp    %ebp,%r12d
mov    %r14d,%r12d
jne    12ee <check_gen+0x12e>
jmp    13b7 <check_gen+0x1f7>
testb  $0x1,0x1c(%rsp)
je     13c5 <check_gen+0x205>
lea    0x10b1(%rip),%rdi
call   1030 <puts@plt>
jmp    13d1 <check_gen+0x211>
lea    0xca0(%rip),%rdi
call   1050 <ignore@plt>
lea    0xccd(%rip),%rbx
lea    0x58(%rsp),%r15
xor    %r12d,%r12d
xor    %eax,%eax
mov    %eax,0x10(%rsp)
lea    -0x1f4(%r12),%r14d
ff
xor    %ebp,%ebp
mov    %rbx,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   10a0 <scanf@plt>
mov    0x20(%rsp),%rdi
call   10d0 <get_rn_dbl@plt>
movaps %xmm0,%xmm1
movsd  0x58(%rsp),%xmm0
movapd %xmm0,%xmm2
subsd  %xmm1,%xmm2
movapd %xmm1,%xmm3
subsd  %xmm0,%xmm3
movapd %xmm1,%xmm4
cmpltsd %xmm0,%xmm4
andpd  %xmm4,%xmm2
andnpd %xmm3,%xmm4
orpd   %xmm2,%xmm4
ucomisd 0xbcb(%rip),%xmm4
ja     1450 <check_gen+0x290>
add    $0xffffffff,%ebp
cmp    %ebp,%r14d
jne    13f0 <check_gen+0x230>
jmp    1485 <check_gen+0x2c5>
nopl   0x0(%rax)
mov    %r12d,%r14d
sub    %ebp,%r14d
lea    0xc4d(%rip),%rdi
mov    %r14d,%esi
mov    $0x2,%al
call   1060 <printf@plt>
add    $0x1,%r14d
add    $0xfffffe0d,%r12d
mov    $0x1,%al
xor    %r13d,%r13d
cmp    %ebp,%r12d
mov    %r14d,%r12d
jne    13e2 <check_gen+0x222>
jmp    148c <check_gen+0x2cc>
testb  $0x1,0x10(%rsp)
je     149a <check_gen+0x2da>
lea    0xf59(%rip),%rdi
call   1030 <puts@plt>
jmp    14a6 <check_gen+0x2e6>
lea    0xc1e(%rip),%rdi
call   1050 <ignore@plt>
lea    0x30(%rsp),%rdx
mov    0x40(%rsp),%rdi
mov    $0x2,%esi
xor    %ecx,%ecx
call   1040 <spawn_rng@plt>
mov    %rax,%rbp
mov    0x30(%rsp),%rax
mov    0x8(%rax),%rdi
lea    0x28(%rsp),%rdx
mov    $0x2,%esi
xor    %ecx,%ecx
call   1040 <spawn_rng@plt>
add    %ebp,%eax
cmp    $0x4,%eax
je     14ef <check_gen+0x32f>
lea    0xedf(%rip),%rdi
call   1030 <puts@plt>
xor    %r13d,%r13d
lea    0xb22(%rip),%r12
lea    0xc(%rsp),%r14
xor    %r15d,%r15d
xor    %eax,%eax
mov    %eax,0x10(%rsp)
lea    -0x32(%r15),%ebx
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   10a0 <scanf@plt>
mov    0x28(%rsp),%rax
mov    0x8(%rax),%rdi
call   10b0 <get_rn_int@plt>
mov    0xc(%rsp),%edx
cmp    %eax,%edx
jne    1540 <check_gen+0x380>
add    $0xffffffff,%ebp
cmp    %ebp,%ebx
jne    1510 <check_gen+0x350>
jmp    156b <check_gen+0x3ab>
nopl   0x0(%rax)
mov    %r15,%rbx
sub    %ebp,%r15d
xor    %r13d,%r13d
lea    0xb9a(%rip),%rdi
mov    %r15d,%esi
mov    %eax,%ecx
xor    %eax,%eax
call   1060 <printf@plt>
add    $0x1,%r15d
add    $0xffffffcf,%ebx
mov    $0x1,%al
cmp    %ebp,%ebx
jne    1500 <check_gen+0x340>
jmp    1572 <check_gen+0x3b2>
testb  $0x1,0x10(%rsp)
je     1580 <check_gen+0x3c0>
lea    0xdd4(%rip),%rdi
call   1030 <puts@plt>
jmp    158c <check_gen+0x3cc>
lea    0xb6e(%rip),%rdi
call   1050 <ignore@plt>
mov    0x28(%rsp),%rax
mov    0x8(%rax),%rdi
lea    0x60(%rsp),%rsi
call   1090 <pack_rng@plt>
test   %eax,%eax
jne    15b2 <check_gen+0x3f2>
lea    0xd7e(%rip),%rdi
call   1030 <puts@plt>
xor    %r13d,%r13d
mov    0x60(%rsp),%rdi
call   1080 <unpack_rng@plt>
mov    %rax,%r14
mov    $0x1,%ebp
mov    $0x32,%ebx
xor    %r15d,%r15d
nopl   0x0(%rax)
lea    0xa41(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   10a0 <scanf@plt>
mov    0xc(%rsp),%r12d
mov    %r14,%rdi
call   10b0 <get_rn_int@plt>
cmp    %eax,%r12d
cmovne %r15d,%r13d
cmovne %r15d,%ebp
add    $0xffffffff,%ebx
jne    15d0 <check_gen+0x410>
mov    %r14,0x10(%rsp)
test   %ebp,%ebp
je     1617 <check_gen+0x457>
lea    0xb09(%rip),%rdi
call   1050 <ignore@plt>
jmp    1623 <check_gen+0x463>
lea    0xc7b(%rip),%rdi
call   1030 <puts@plt>
mov    0x10(%rsp),%rdi
mov    $0x1,%ebp
lea    0x48(%rsp),%rdx
xor    %r15d,%r15d
mov    $0x1,%esi
xor    %ecx,%ecx
call   1040 <spawn_rng@plt>
mov    $0x32,%ebx
lea    0xc(%rsp),%r14
nopl   0x0(%rax,%rax,1)
lea    0x9c1(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   10a0 <scanf@plt>
mov    0xc(%rsp),%r12d
mov    0x48(%rsp),%rax
mov    (%rax),%rdi
call   10b0 <get_rn_int@plt>
cmp    %eax,%r12d
cmovne %r15d,%r13d
cmovne %r15d,%ebp
add    $0xffffffff,%ebx
jne    1650 <check_gen+0x490>
test   %ebp,%ebp
je     1695 <check_gen+0x4d5>
lea    0xac1(%rip),%rdi
call   1050 <ignore@plt>
jmp    16a1 <check_gen+0x4e1>
lea    0xb72(%rip),%rdi
call   1030 <puts@plt>
mov    0x10(%rsp),%rbx
lea    0xae6(%rip),%rdi
call   1050 <ignore@plt>
mov    0x20(%rsp),%rdi
call   10c0 <free_rng@plt>
mov    0x40(%rsp),%rdi
call   10c0 <free_rng@plt>
mov    0x50(%rsp),%rdi
call   10c0 <free_rng@plt>
cmp    $0x6,%eax
je     16ed <check_gen+0x52d>
lea    0xae6(%rip),%rdi
xor    %r13d,%r13d
mov    %eax,%esi
mov    $0x6,%edx
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
call   10c0 <free_rng@plt>
mov    0x48(%rsp),%rax
mov    (%rax),%rdi
call   10c0 <free_rng@plt>
mov    0x30(%rsp),%rax
mov    (%rax),%rdi
call   10c0 <free_rng@plt>
mov    0x30(%rsp),%rax
mov    0x8(%rax),%rdi
call   10c0 <free_rng@plt>
mov    0x28(%rsp),%rax
mov    (%rax),%rdi
call   10c0 <free_rng@plt>
mov    0x28(%rsp),%rax
mov    0x8(%rax),%rdi
call   10c0 <free_rng@plt>
test   %eax,%eax
je     1751 <check_gen+0x591>
lea    0xa7f(%rip),%rdi
xor    %r13d,%r13d
mov    %eax,%esi
xor    %edx,%edx
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xa91(%rip),%rdi
call   1050 <ignore@plt>
mov    %r13d,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [12 x i8] c"%d. %d, %d\0A\00"
@.str.2 = [133 x i8] c"FAILED: Integer generator does not reproduce correct stream.\0A\09Arithmetic on this machine may not be compatible with this generator.\0A\00"
@.str.3 = [59 x i8] c"PASSED: Integer generator passed the reproducibility test\0A\00"
@.str.4 = [4 x i8] c"%f\0A\00"
@.str.5 = [17 x i8] c"%d. %8.6f %8.6f\0A\00"
@.str.6 = [130 x i8] c"FAILED: Float generator does not reproduce correct stream\0A\09Arithmetic on this machine may not be compatible with this generator.\0A\00"
@.str.7 = [57 x i8] c"PASSED: Float generator passed the reproducibility test\0A\00"
@.str.8 = [5 x i8] c"%lf\0A\00"
@.str.9 = [21 x i8] c"%d. %18.15f %18.15f\0A\00"
@.str.10 = [132 x i8] c"FAILED: Double generator does not reproduce correct stream.\0A\09Arithmetic on this machine may not be compatible with this generator.\0A\00"
@.str.11 = [43 x i8] c"PASSED: Double generator spawns correctly\0A\00"
@.str.12 = [39 x i8] c"FAILED: Generator was unable to spawn\0A\00"
@.str.13 = [11 x i8] c"%d. %x %x\0A\00"
@.str.14 = [122 x i8] c"FAILED: Generator does not reproduce correct stream after spawning\0A\09This is probably an error in spawning the generators\0A\00"
@.str.15 = [36 x i8] c"PASSED: Generator spawns correctly\0A\00"
@.str.16 = [38 x i8] c"FAILED: Generator was unable to pack\0A\00"
@.str.17 = [144 x i8] c"FAILED: Generator does not reproduce correct stream after packing and unpacking\0A\09This is probably an error in packing/unpacking the generators\0A\00"
@.str.18 = [54 x i8] c"PASSED: Generator packs and unpacks stream correctly\0A\00"
@.str.19 = [140 x i8] c"FAILED: Generator does not spawn correct stream after packing and unpacking\0A\09This is probably an error in packing/unpacking the generators\0A\00"
@.str.20 = [68 x i8] c"PASSED: Generator packs and unpacks spawning information correctly\0A\00"
@.str.21 = [47 x i8] c"Checking free_sprng for integer generator ...\0A\00"
@.str.22 = [39 x i8] c"FAILED: Free returns %d instead of %d\0A\00"
@.str.23 = [37 x i8] c"\0A... Completed checking generator \0A\0A\00"
define i32 @check_gen() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32**
%6 = alloca i32**
%7 = alloca i32**
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca float
%19 = alloca float
%20 = alloca double
%21 = alloca double
%22 = alloca i32
store i32 1, i32* %14
store i32 3, i32* %15
store i32 985456376, i32* %16
%23 = load i32, i32* %15
%24 = load i32, i32* %16
%25 = call i32* @init_rng(i32 0, i32 %23, i32 %24, i32 0)
store i32* %25, i32** %1
%26 = load i32, i32* %15
%27 = load i32, i32* %16
%28 = call i32* @init_rng(i32 1, i32 %26, i32 %27, i32 0)
store i32* %28, i32** %2
%29 = load i32, i32* %15
%30 = load i32, i32* %16
%31 = call i32* @init_rng(i32 2, i32 %29, i32 %30, i32 0)
store i32* %31, i32** %3
store i32 1, i32* %13
store i32 0, i32* %8
br label %32
32: ; preds = %48, %0
%33 = load i32, i32* %8
%34 = icmp slt i32 %33, 500
br i1 %34, label %35, label %51
35: ; preds = %32
%36 = load i32*, i32** %1
%37 = call i32 @get_rn_int(i32* %36)
store i32 %37, i32* %12
%38 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %11)
%39 = load i32, i32* %11
%40 = load i32, i32* %12
%41 = icmp ne i32 %39, %40
br i1 %41, label %42, label %47
42: ; preds = %35
%43 = load i32, i32* %8
%44 = load i32, i32* %11
%45 = load i32, i32* %12
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %43, i32 %44, i32 %45)
store i32 0, i32* %13
store i32 0, i32* %14
br label %47
47: ; preds = %42, %35
br label %48
48: ; preds = %47
%49 = load i32, i32* %8
%50 = add nsw i32 %49, 1
store i32 %50, i32* %8
br label %32
51: ; preds = %32
%52 = load i32, i32* %13
%53 = icmp eq i32 %52, 0
br i1 %53, label %54, label %56
54: ; preds = %51
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str.2, i64 0, i64 0))
br label %58
56: ; preds = %51
%57 = call i32 @ignore(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.3, i64 0, i64 0))
br label %58
58: ; preds = %56, %54
store i32 1, i32* %13
store i32 0, i32* %8
br label %59
59: ; preds = %89, %58
%60 = load i32, i32* %8
%61 = icmp slt i32 %60, 500
br i1 %61, label %62, label %92
62: ; preds = %59
%63 = load i32*, i32** %1
%64 = call float @get_rn_flt(i32* %63)
store float %64, float* %18
%65 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), float* %19)
%66 = load float, float* %18
%67 = load float, float* %19
%68 = fcmp ogt float %66, %67
br i1 %68, label %69, label %73
69: ; preds = %62
%70 = load float, float* %18
%71 = load float, float* %19
%72 = fsub float %70, %71
br label %77
73: ; preds = %62
%74 = load float, float* %19
%75 = load float, float* %18
%76 = fsub float %74, %75
br label %77
77: ; preds = %73, %69
%78 = phi float [ %72, %69 ], [ %76, %73 ]
%79 = fpext float %78 to double
%80 = fcmp ogt double %79, 0x3EB0C6F7A0B5ED8D
br i1 %80, label %81, label %88
81: ; preds = %77
%82 = load i32, i32* %8
%83 = load float, float* %19
%84 = fpext float %83 to double
%85 = load float, float* %18
%86 = fpext float %85 to double
%87 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), i32 %82, double %84, double %86)
store i32 0, i32* %13
store i32 0, i32* %14
br label %88
88: ; preds = %81, %77
br label %89
89: ; preds = %88
%90 = load i32, i32* %8
%91 = add nsw i32 %90, 1
store i32 %91, i32* %8
br label %59
92: ; preds = %59
%93 = load i32, i32* %13
%94 = icmp eq i32 %93, 0
br i1 %94, label %95, label %97
95: ; preds = %92
%96 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str.6, i64 0, i64 0))
br label %99
97: ; preds = %92
%98 = call i32 @ignore(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.7, i64 0, i64 0))
br label %99
99: ; preds = %97, %95
store i32 1, i32* %13
store i32 0, i32* %8
br label %100
100: ; preds = %127, %99
%101 = load i32, i32* %8
%102 = icmp slt i32 %101, 500
br i1 %102, label %103, label %130
103: ; preds = %100
%104 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), double* %20)
%105 = load i32*, i32** %1
%106 = call double @get_rn_dbl(i32* %105)
store double %106, double* %21
%107 = load double, double* %20
%108 = load double, double* %21
%109 = fcmp ogt double %107, %108
br i1 %109, label %110, label %114
110: ; preds = %103
%111 = load double, double* %20
%112 = load double, double* %21
%113 = fsub double %111, %112
br label %118
114: ; preds = %103
%115 = load double, double* %21
%116 = load double, double* %20
%117 = fsub double %115, %116
br label %118
118: ; preds = %114, %110
%119 = phi double [ %113, %110 ], [ %117, %114 ]
%120 = fcmp ogt double %119, 0x3D06849B86A12B9B
br i1 %120, label %121, label %126
121: ; preds = %118
%122 = load i32, i32* %8
%123 = load double, double* %20
%124 = load double, double* %21
%125 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0), i32 %122, double %123, double %124)
store i32 0, i32* %13
store i32 0, i32* %14
br label %126
126: ; preds = %121, %118
br label %127
127: ; preds = %126
%128 = load i32, i32* %8
%129 = add nsw i32 %128, 1
store i32 %129, i32* %8
br label %100
130: ; preds = %100
%131 = load i32, i32* %13
%132 = icmp eq i32 %131, 0
br i1 %132, label %133, label %135
133: ; preds = %130
%134 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([132 x i8], [132 x i8]* @.str.10, i64 0, i64 0))
br label %137
135: ; preds = %130
%136 = call i32 @ignore(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.11, i64 0, i64 0))
br label %137
137: ; preds = %135, %133
store i32 0, i32* %17
%138 = load i32*, i32** %2
%139 = call i64 @spawn_rng(i32* %138, i32 2, i32*** %6, i32 0)
%140 = load i32, i32* %17
%141 = sext i32 %140 to i64
%142 = add nsw i64 %141, %139
%143 = trunc i64 %142 to i32
store i32 %143, i32* %17
%144 = load i32**, i32*** %6
%145 = getelementptr inbounds i32*, i32** %144, i64 1
%146 = load i32*, i32** %145
%147 = call i64 @spawn_rng(i32* %146, i32 2, i32*** %7, i32 0)
%148 = load i32, i32* %17
%149 = sext i32 %148 to i64
%150 = add nsw i64 %149, %147
%151 = trunc i64 %150 to i32
store i32 %151, i32* %17
%152 = load i32, i32* %17
%153 = icmp ne i32 %152, 4
br i1 %153, label %154, label %156
154: ; preds = %137
store i32 0, i32* %14
%155 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.12, i64 0, i64 0))
br label %156
156: ; preds = %154, %137
store i32 1, i32* %13
store i32 0, i32* %8
br label %157
157: ; preds = %175, %156
%158 = load i32, i32* %8
%159 = icmp slt i32 %158, 50
br i1 %159, label %160, label %178
160: ; preds = %157
%161 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %11)
%162 = load i32**, i32*** %7
%163 = getelementptr inbounds i32*, i32** %162, i64 1
%164 = load i32*, i32** %163
%165 = call i32 @get_rn_int(i32* %164)
store i32 %165, i32* %22
%166 = load i32, i32* %11
%167 = load i32, i32* %22
%168 = icmp ne i32 %166, %167
br i1 %168, label %169, label %174
169: ; preds = %160
%170 = load i32, i32* %8
%171 = load i32, i32* %11
%172 = load i32, i32* %22
%173 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.13, i64 0, i64 0), i32 %170, i32 %171, i32 %172)
store i32 0, i32* %13
store i32 0, i32* %14
br label %174
174: ; preds = %169, %160
br label %175
175: ; preds = %174
%176 = load i32, i32* %8
%177 = add nsw i32 %176, 1
store i32 %177, i32* %8
br label %157
178: ; preds = %157
%179 = load i32, i32* %13
%180 = icmp eq i32 %179, 0
br i1 %180, label %181, label %183
181: ; preds = %178
%182 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([122 x i8], [122 x i8]* @.str.14, i64 0, i64 0))
br label %185
183: ; preds = %178
%184 = call i32 @ignore(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.15, i64 0, i64 0))
br label %185
185: ; preds = %183, %181
%186 = load i32**, i32*** %7
%187 = getelementptr inbounds i32*, i32** %186, i64 1
%188 = load i32*, i32** %187
%189 = call i32 @pack_rng(i32* %188, i8** %10)
store i32 %189, i32* %9
%190 = load i32, i32* %9
%191 = icmp eq i32 %190, 0
br i1 %191, label %192, label %194
192: ; preds = %185
store i32 0, i32* %14
%193 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.16, i64 0, i64 0))
br label %194
194: ; preds = %192, %185
%195 = load i8*, i8** %10
%196 = call i32* @unpack_rng(i8* %195)
store i32* %196, i32** %4
store i32 1, i32* %13
store i32 0, i32* %8
br label %197
197: ; preds = %208, %194
%198 = load i32, i32* %8
%199 = icmp slt i32 %198, 50
br i1 %199, label %200, label %211
200: ; preds = %197
%201 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %11)
%202 = load i32, i32* %11
%203 = load i32*, i32** %4
%204 = call i32 @get_rn_int(i32* %203)
%205 = icmp ne i32 %202, %204
br i1 %205, label %206, label %207
206: ; preds = %200
store i32 0, i32* %13
store i32 0, i32* %14
br label %207
207: ; preds = %206, %200
br label %208
208: ; preds = %207
%209 = load i32, i32* %8
%210 = add nsw i32 %209, 1
store i32 %210, i32* %8
br label %197
211: ; preds = %197
%212 = load i32, i32* %13
%213 = icmp eq i32 %212, 0
br i1 %213, label %214, label %216
214: ; preds = %211
%215 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str.17, i64 0, i64 0))
br label %218
216: ; preds = %211
%217 = call i32 @ignore(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.18, i64 0, i64 0))
br label %218
218: ; preds = %216, %214
store i32 1, i32* %13
%219 = load i32*, i32** %4
%220 = call i64 @spawn_rng(i32* %219, i32 1, i32*** %5, i32 0)
store i32 0, i32* %8
br label %221
221: ; preds = %234, %218
%222 = load i32, i32* %8
%223 = icmp slt i32 %222, 50
br i1 %223, label %224, label %237
224: ; preds = %221
%225 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %11)
%226 = load i32, i32* %11
%227 = load i32**, i32*** %5
%228 = getelementptr inbounds i32*, i32** %227, i64 0
%229 = load i32*, i32** %228
%230 = call i32 @get_rn_int(i32* %229)
%231 = icmp ne i32 %226, %230
br i1 %231, label %232, label %233
232: ; preds = %224
store i32 0, i32* %13
store i32 0, i32* %14
br label %233
233: ; preds = %232, %224
br label %234
234: ; preds = %233
%235 = load i32, i32* %8
%236 = add nsw i32 %235, 1
store i32 %236, i32* %8
br label %221
237: ; preds = %221
%238 = load i32, i32* %13
%239 = icmp eq i32 %238, 0
br i1 %239, label %240, label %242
240: ; preds = %237
%241 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.19, i64 0, i64 0))
br label %244
242: ; preds = %237
%243 = call i32 @ignore(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.20, i64 0, i64 0))
br label %244
244: ; preds = %242, %240
%245 = call i32 @ignore(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.21, i64 0, i64 0))
%246 = load i32*, i32** %1
%247 = call i32 @free_rng(i32* %246)
store i32 %247, i32* %17
%248 = load i32*, i32** %2
%249 = call i32 @free_rng(i32* %248)
store i32 %249, i32* %17
%250 = load i32*, i32** %3
%251 = call i32 @free_rng(i32* %250)
store i32 %251, i32* %17
%252 = load i32, i32* %17
%253 = icmp ne i32 %252, 6
br i1 %253, label %254, label %257
254: ; preds = %244
store i32 0, i32* %14
%255 = load i32, i32* %17
%256 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.22, i64 0, i64 0), i32 %255, i32 6)
br label %257
257: ; preds = %254, %244
%258 = load i32*, i32** %4
%259 = call i32 @free_rng(i32* %258)
store i32 %259, i32* %17
%260 = load i32**, i32*** %5
%261 = getelementptr inbounds i32*, i32** %260, i64 0
%262 = load i32*, i32** %261
%263 = call i32 @free_rng(i32* %262)
store i32 %263, i32* %17
%264 = load i32**, i32*** %6
%265 = getelementptr inbounds i32*, i32** %264, i64 0
%266 = load i32*, i32** %265
%267 = call i32 @free_rng(i32* %266)
store i32 %267, i32* %17
%268 = load i32**, i32*** %6
%269 = getelementptr inbounds i32*, i32** %268, i64 1
%270 = load i32*, i32** %269
%271 = call i32 @free_rng(i32* %270)
store i32 %271, i32* %17
%272 = load i32**, i32*** %7
%273 = getelementptr inbounds i32*, i32** %272, i64 0
%274 = load i32*, i32** %273
%275 = call i32 @free_rng(i32* %274)
store i32 %275, i32* %17
%276 = load i32**, i32*** %7
%277 = getelementptr inbounds i32*, i32** %276, i64 1
%278 = load i32*, i32** %277
%279 = call i32 @free_rng(i32* %278)
store i32 %279, i32* %17
%280 = load i32, i32* %17
%281 = icmp ne i32 %280, 0
br i1 %281, label %282, label %285
282: ; preds = %257
store i32 0, i32* %14
%283 = load i32, i32* %17
%284 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.22, i64 0, i64 0), i32 %283, i32 0)
br label %285
285: ; preds = %282, %257
%286 = call i32 @ignore(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.23, i64 0, i64 0))
%287 = load i32, i32* %14
ret i32 %287
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [12 x i8] c"%d. %d, %d\0A\00"
@.str.3 = [59 x i8] c"PASSED: Integer generator passed the reproducibility test\0A\00"
@.str.4 = [4 x i8] c"%f\0A\00"
@.str.5 = [17 x i8] c"%d. %8.6f %8.6f\0A\00"
@.str.7 = [57 x i8] c"PASSED: Float generator passed the reproducibility test\0A\00"
@.str.8 = [5 x i8] c"%lf\0A\00"
@.str.9 = [21 x i8] c"%d. %18.15f %18.15f\0A\00"
@.str.11 = [43 x i8] c"PASSED: Double generator spawns correctly\0A\00"
@.str.13 = [11 x i8] c"%d. %x %x\0A\00"
@.str.15 = [36 x i8] c"PASSED: Generator spawns correctly\0A\00"
@.str.18 = [54 x i8] c"PASSED: Generator packs and unpacks stream correctly\0A\00"
@.str.20 = [68 x i8] c"PASSED: Generator packs and unpacks spawning information correctly\0A\00"
@.str.21 = [47 x i8] c"Checking free_sprng for integer generator ...\0A\00"
@.str.22 = [39 x i8] c"FAILED: Free returns %d instead of %d\0A\00"
@.str.23 = [37 x i8] c"\0A... Completed checking generator \0A\0A\00"
@str = [139 x i8] c"FAILED: Generator does not spawn correct stream after packing and unpacking\0A\09This is probably an error in packing/unpacking the generators\00"
@str.24 = [143 x i8] c"FAILED: Generator does not reproduce correct stream after packing and unpacking\0A\09This is probably an error in packing/unpacking the generators\00"
@str.25 = [37 x i8] c"FAILED: Generator was unable to pack\00"
@str.26 = [121 x i8] c"FAILED: Generator does not reproduce correct stream after spawning\0A\09This is probably an error in spawning the generators\00"
@str.27 = [38 x i8] c"FAILED: Generator was unable to spawn\00"
@str.28 = [131 x i8] c"FAILED: Double generator does not reproduce correct stream.\0A\09Arithmetic on this machine may not be compatible with this generator.\00"
@str.29 = [129 x i8] c"FAILED: Float generator does not reproduce correct stream\0A\09Arithmetic on this machine may not be compatible with this generator.\00"
@str.30 = [132 x i8] c"FAILED: Integer generator does not reproduce correct stream.\0A\09Arithmetic on this machine may not be compatible with this generator.\00"
define i32 @check_gen() {
%1 = alloca i32**
%2 = alloca i32**
%3 = alloca i32**
%4 = alloca i8*
%5 = alloca i32
%6 = alloca float
%7 = alloca double
%8 = bitcast i32*** %1 to i8*
%9 = bitcast i32*** %2 to i8*
%10 = bitcast i32*** %3 to i8*
%11 = bitcast i8** %4 to i8*
%12 = bitcast i32* %5 to i8*
%13 = bitcast float* %6 to i8*
%14 = bitcast double* %7 to i8*
%15 = tail call i32* @init_rng(i32 0, i32 3, i32 985456376, i32 0)
%16 = tail call i32* @init_rng(i32 1, i32 3, i32 985456376, i32 0)
%17 = tail call i32* @init_rng(i32 2, i32 3, i32 985456376, i32 0)
br label %18
18: ; preds = %31, %0
%19 = phi i32 [ %33, %31 ], [ 0, %0 ]
%20 = phi i1 [ true, %31 ], [ false, %0 ]
%21 = phi i32 [ 0, %31 ], [ 1, %0 ]
br label %22
22: ; preds = %18, %28
%23 = phi i32 [ %29, %28 ], [ %19, %18 ]
%24 = call i32 @get_rn_int(i32* %15)
%25 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %5)
%26 = load i32, i32* %5
%27 = icmp eq i32 %26, %24
br i1 %27, label %28, label %31
28: ; preds = %22
%29 = add nuw nsw i32 %23, 1
%30 = icmp eq i32 %29, 500
br i1 %30, label %35, label %22
31: ; preds = %22
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %23, i32 %26, i32 %24)
%33 = add nuw nsw i32 %23, 1
%34 = icmp eq i32 %33, 500
br i1 %34, label %36, label %18
35: ; preds = %28
br i1 %20, label %36, label %39
36: ; preds = %31, %35
%37 = phi i32 [ %21, %35 ], [ 0, %31 ]
%38 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([132 x i8], [132 x i8]* @str.30, i64 0, i64 0))
br label %41
39: ; preds = %35
%40 = call i32 @ignore(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.3, i64 0, i64 0))
br label %41
41: ; preds = %39, %36
%42 = phi i32 [ %37, %36 ], [ %21, %39 ]
br label %43
43: ; preds = %41, %61
%44 = phi i32 [ %65, %61 ], [ 0, %41 ]
%45 = phi i1 [ true, %61 ], [ false, %41 ]
%46 = phi i32 [ 0, %61 ], [ %42, %41 ]
br label %47
47: ; preds = %43, %58
%48 = phi i32 [ %59, %58 ], [ %44, %43 ]
%49 = call float @get_rn_flt(i32* %15)
%50 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), float* %6)
%51 = load float, float* %6
%52 = fcmp ogt float %49, %51
%53 = fsub float %49, %51
%54 = fsub float %51, %49
%55 = select i1 %52, float %53, float %54
%56 = fpext float %55 to double
%57 = fcmp ogt double %56, 0x3EB0C6F7A0B5ED8D
br i1 %57, label %61, label %58
58: ; preds = %47
%59 = add nuw nsw i32 %48, 1
%60 = icmp eq i32 %59, 500
br i1 %60, label %67, label %47
61: ; preds = %47
%62 = fpext float %51 to double
%63 = fpext float %49 to double
%64 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), i32 %48, double %62, double %63)
%65 = add nuw nsw i32 %48, 1
%66 = icmp eq i32 %65, 500
br i1 %66, label %68, label %43
67: ; preds = %58
br i1 %45, label %68, label %71
68: ; preds = %61, %67
%69 = phi i32 [ %46, %67 ], [ 0, %61 ]
%70 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([129 x i8], [129 x i8]* @str.29, i64 0, i64 0))
br label %73
71: ; preds = %67
%72 = call i32 @ignore(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.7, i64 0, i64 0))
br label %73
73: ; preds = %71, %68
%74 = phi i32 [ %69, %68 ], [ %46, %71 ]
br label %75
75: ; preds = %73, %92
%76 = phi i32 [ %94, %92 ], [ 0, %73 ]
%77 = phi i1 [ true, %92 ], [ false, %73 ]
%78 = phi i32 [ 0, %92 ], [ %74, %73 ]
br label %79
79: ; preds = %75, %89
%80 = phi i32 [ %90, %89 ], [ %76, %75 ]
%81 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), double* %7)
%82 = call double @get_rn_dbl(i32* %15)
%83 = load double, double* %7
%84 = fcmp ogt double %83, %82
%85 = fsub double %83, %82
%86 = fsub double %82, %83
%87 = select i1 %84, double %85, double %86
%88 = fcmp ogt double %87, 0x3D06849B86A12B9B
br i1 %88, label %92, label %89
89: ; preds = %79
%90 = add nuw nsw i32 %80, 1
%91 = icmp eq i32 %90, 500
br i1 %91, label %96, label %79
92: ; preds = %79
%93 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0), i32 %80, double %83, double %82)
%94 = add nuw nsw i32 %80, 1
%95 = icmp eq i32 %94, 500
br i1 %95, label %97, label %75
96: ; preds = %89
br i1 %77, label %97, label %100
97: ; preds = %92, %96
%98 = phi i32 [ %78, %96 ], [ 0, %92 ]
%99 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([131 x i8], [131 x i8]* @str.28, i64 0, i64 0))
br label %102
100: ; preds = %96
%101 = call i32 @ignore(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.11, i64 0, i64 0))
br label %102
102: ; preds = %100, %97
%103 = phi i32 [ %78, %100 ], [ %98, %97 ]
%104 = call i64 @spawn_rng(i32* %16, i32 2, i32*** %2, i32 0)
%105 = load i32**, i32*** %2
%106 = getelementptr inbounds i32*, i32** %105, i64 1
%107 = load i32*, i32** %106
%108 = call i64 @spawn_rng(i32* %107, i32 2, i32*** %3, i32 0)
%109 = add i64 %108, %104
%110 = trunc i64 %109 to i32
%111 = icmp eq i32 %110, 4
br i1 %111, label %114, label %112
112: ; preds = %102
%113 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.27, i64 0, i64 0))
br label %114
114: ; preds = %112, %102
%115 = phi i32 [ %103, %102 ], [ 0, %112 ]
br label %116
116: ; preds = %114, %132
%117 = phi i32 [ %134, %132 ], [ 0, %114 ]
%118 = phi i1 [ true, %132 ], [ false, %114 ]
%119 = phi i32 [ 0, %132 ], [ %115, %114 ]
br label %120
120: ; preds = %116, %129
%121 = phi i32 [ %130, %129 ], [ %117, %116 ]
%122 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %5)
%123 = load i32**, i32*** %3
%124 = getelementptr inbounds i32*, i32** %123, i64 1
%125 = load i32*, i32** %124
%126 = call i32 @get_rn_int(i32* %125)
%127 = load i32, i32* %5
%128 = icmp eq i32 %127, %126
br i1 %128, label %129, label %132
129: ; preds = %120
%130 = add nuw nsw i32 %121, 1
%131 = icmp eq i32 %130, 50
br i1 %131, label %136, label %120
132: ; preds = %120
%133 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.13, i64 0, i64 0), i32 %121, i32 %127, i32 %126)
%134 = add nuw nsw i32 %121, 1
%135 = icmp eq i32 %134, 50
br i1 %135, label %137, label %116
136: ; preds = %129
br i1 %118, label %137, label %140
137: ; preds = %132, %136
%138 = phi i32 [ %119, %136 ], [ 0, %132 ]
%139 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([121 x i8], [121 x i8]* @str.26, i64 0, i64 0))
br label %142
140: ; preds = %136
%141 = call i32 @ignore(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.15, i64 0, i64 0))
br label %142
142: ; preds = %140, %137
%143 = phi i32 [ %119, %140 ], [ %138, %137 ]
%144 = load i32**, i32*** %3
%145 = getelementptr inbounds i32*, i32** %144, i64 1
%146 = load i32*, i32** %145
%147 = call i32 @pack_rng(i32* %146, i8** %4)
%148 = icmp eq i32 %147, 0
br i1 %148, label %149, label %151
149: ; preds = %142
%150 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.25, i64 0, i64 0))
br label %151
151: ; preds = %149, %142
%152 = phi i32 [ 0, %149 ], [ %143, %142 ]
%153 = load i8*, i8** %4
%154 = call i32* @unpack_rng(i8* %153)
br label %155
155: ; preds = %151, %155
%156 = phi i32 [ 0, %151 ], [ %165, %155 ]
%157 = phi i32 [ 1, %151 ], [ %164, %155 ]
%158 = phi i32 [ %152, %151 ], [ %163, %155 ]
%159 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %5)
%160 = load i32, i32* %5
%161 = call i32 @get_rn_int(i32* %154)
%162 = icmp eq i32 %160, %161
%163 = select i1 %162, i32 %158, i32 0
%164 = select i1 %162, i32 %157, i32 0
%165 = add nuw nsw i32 %156, 1
%166 = icmp eq i32 %165, 50
br i1 %166, label %167, label %155
167: ; preds = %155
%168 = icmp eq i32 %164, 0
br i1 %168, label %169, label %171
169: ; preds = %167
%170 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([143 x i8], [143 x i8]* @str.24, i64 0, i64 0))
br label %173
171: ; preds = %167
%172 = call i32 @ignore(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.18, i64 0, i64 0))
br label %173
173: ; preds = %171, %169
%174 = call i64 @spawn_rng(i32* %154, i32 1, i32*** %1, i32 0)
br label %175
175: ; preds = %173, %175
%176 = phi i32 [ 0, %173 ], [ %187, %175 ]
%177 = phi i32 [ 1, %173 ], [ %186, %175 ]
%178 = phi i32 [ %163, %173 ], [ %185, %175 ]
%179 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %5)
%180 = load i32, i32* %5
%181 = load i32**, i32*** %1
%182 = load i32*, i32** %181
%183 = call i32 @get_rn_int(i32* %182)
%184 = icmp eq i32 %180, %183
%185 = select i1 %184, i32 %178, i32 0
%186 = select i1 %184, i32 %177, i32 0
%187 = add nuw nsw i32 %176, 1
%188 = icmp eq i32 %187, 50
br i1 %188, label %189, label %175
189: ; preds = %175
%190 = icmp eq i32 %186, 0
br i1 %190, label %191, label %193
191: ; preds = %189
%192 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([139 x i8], [139 x i8]* @str, i64 0, i64 0))
br label %195
193: ; preds = %189
%194 = call i32 @ignore(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.20, i64 0, i64 0))
br label %195
195: ; preds = %193, %191
%196 = call i32 @ignore(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.21, i64 0, i64 0))
%197 = call i32 @free_rng(i32* %15)
%198 = call i32 @free_rng(i32* %16)
%199 = call i32 @free_rng(i32* %17)
%200 = icmp eq i32 %199, 6
br i1 %200, label %203, label %201
201: ; preds = %195
%202 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.22, i64 0, i64 0), i32 %199, i32 6)
br label %203
203: ; preds = %201, %195
%204 = phi i32 [ 0, %201 ], [ %185, %195 ]
%205 = call i32 @free_rng(i32* %154)
%206 = load i32**, i32*** %1
%207 = load i32*, i32** %206
%208 = call i32 @free_rng(i32* %207)
%209 = load i32**, i32*** %2
%210 = load i32*, i32** %209
%211 = call i32 @free_rng(i32* %210)
%212 = load i32**, i32*** %2
%213 = getelementptr inbounds i32*, i32** %212, i64 1
%214 = load i32*, i32** %213
%215 = call i32 @free_rng(i32* %214)
%216 = load i32**, i32*** %3
%217 = load i32*, i32** %216
%218 = call i32 @free_rng(i32* %217)
%219 = load i32**, i32*** %3
%220 = getelementptr inbounds i32*, i32** %219, i64 1
%221 = load i32*, i32** %220
%222 = call i32 @free_rng(i32* %221)
%223 = icmp eq i32 %222, 0
br i1 %223, label %226, label %224
224: ; preds = %203
%225 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.22, i64 0, i64 0), i32 %222, i32 0)
br label %226
226: ; preds = %224, %203
%227 = phi i32 [ 0, %224 ], [ %204, %203 ]
%228 = call i32 @ignore(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.23, i64 0, i64 0))
ret i32 %227
}