// File: /workspace/github_c_makefile_star2_O2/sTeeLM[P]dwipe/isaac_rand.c
// Function: randinit
void randinit(ctx, flag)
randctx *ctx;
word     flag;
{
   word i;
   ub4 a,b,c,d,e,f,g,h;
   ub4 *m,*r;
   ctx->randa = ctx->randb = ctx->randc = 0;
   m=ctx->randmem;
   r=ctx->randrsl;
   a=b=c=d=e=f=g=h=0x9e3779b9;  /* the golden ratio */

   for (i=0; i<4; ++i)          /* scramble it */
   {
     mix(a,b,c,d,e,f,g,h);
   }

   if (flag) 
   {
     /* initialize using the contents of r[] as the seed */
     for (i=0; i<RANDSIZ; i+=8)
     {
       a+=r[i  ]; b+=r[i+1]; c+=r[i+2]; d+=r[i+3];
       e+=r[i+4]; f+=r[i+5]; g+=r[i+6]; h+=r[i+7];
       mix(a,b,c,d,e,f,g,h);
       m[i  ]=a; m[i+1]=b; m[i+2]=c; m[i+3]=d;
       m[i+4]=e; m[i+5]=f; m[i+6]=g; m[i+7]=h;
     }
     /* do a second pass to make all of the seed affect all of m */
     for (i=0; i<RANDSIZ; i+=8)
     {
       a+=m[i  ]; b+=m[i+1]; c+=m[i+2]; d+=m[i+3];
       e+=m[i+4]; f+=m[i+5]; g+=m[i+6]; h+=m[i+7];
       mix(a,b,c,d,e,f,g,h);
       m[i  ]=a; m[i+1]=b; m[i+2]=c; m[i+3]=d;
       m[i+4]=e; m[i+5]=f; m[i+6]=g; m[i+7]=h;
     }
   }
   else
   {
     /* fill in m[] with messy stuff */
     for (i=0; i<RANDSIZ; i+=8)
     {
       mix(a,b,c,d,e,f,g,h);
       m[i  ]=a; m[i+1]=b; m[i+2]=c; m[i+3]=d;
       m[i+4]=e; m[i+5]=f; m[i+6]=g; m[i+7]=h;
     }
   }

   isaac(ctx);            /* fill in the first set of results */
   ctx->randcnt=RANDSIZ;  /* prepare to use the first set of results */
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movabsq $-0x106c410289b2f2b, %r10 # imm = 0xFEF93BEFD764D0D5
movabsq $-0x2b5a485ed29776f, %rax # imm = 0xFD4A5B7A12D68891
movabsq $-0x150260e318e1fbcf, %rcx # imm = 0xEAFD9F1CE71E0431
movabsq $-0x166dcb44fd103bef, %r11 # imm = 0xE99234BB02EFC411
movabsq $-0x1f5781ab9372a63f, %rdx # imm = 0xE0A87E546C8D59C1
movabsq $-0x6d7b57e648c3f511, %r8 # imm = 0x9284A819B73C0AEF
movabsq $-0x6f24f755e54b3af6, %rdi # imm = 0x90DB08AA1AB4C50A
andq $0x0, 0x1018(%rbx)
movabsq $0x272406f55f701ff1, %r9 # imm = 0x272406F55F701FF1
xorps %xmm0, %xmm0
movups %xmm0, 0x1008(%rbx)
testl %esi, %esi
je 0x72b9
xorl %esi, %esi
cmpq $0x100, %rsi            # imm = 0x100
jae 0x7199
addq 0x8(%rbx,%rsi,8), %r11
addq 0x10(%rbx,%rsi,8), %r10
addq 0x18(%rbx,%rsi,8), %rcx
addq 0x20(%rbx,%rsi,8), %rdx
addq 0x28(%rbx,%rsi,8), %r9
addq 0x30(%rbx,%rsi,8), %rdi
addq 0x38(%rbx,%rsi,8), %r8
addq 0x40(%rbx,%rsi,8), %rax
leaq (%rcx,%r10), %r14
shlq $0xb, %r10
xorq %r11, %r10
addq %r10, %rdx
leaq (%rdx,%rcx), %r11
shrq $0x2, %rcx
xorq %r14, %rcx
addq %rcx, %r9
leaq (%r9,%rdx), %r14
shlq $0x8, %rdx
xorq %r11, %rdx
addq %rdx, %rdi
leaq (%rdi,%r9), %r11
shrq $0x10, %r9
xorq %r14, %r9
addq %r9, %r8
leaq (%r8,%rdi), %r14
shlq $0xa, %rdi
xorq %r11, %rdi
addq %rdi, %rax
leaq (%rax,%r8), %r11
shrq $0x4, %r8
xorq %r14, %r8
addq %r8, %r10
leaq (%r10,%rax), %r14
shlq $0x8, %rax
xorq %r11, %rax
addq %rax, %rcx
leaq (%rcx,%r10), %r11
shrq $0x9, %r10
movq %r10, %r15
xorq %r14, %r15
addq %r15, %rdx
movq %r11, 0x808(%rbx,%rsi,8)
movq %rcx, 0x810(%rbx,%rsi,8)
movq %rdx, 0x818(%rbx,%rsi,8)
movq %r9, 0x820(%rbx,%rsi,8)
movq %rdi, 0x828(%rbx,%rsi,8)
movq %r8, 0x830(%rbx,%rsi,8)
movq %rax, 0x838(%rbx,%rsi,8)
movq %r15, 0x840(%rbx,%rsi,8)
addq $0x8, %rsi
movq %rcx, %r10
movq %rdx, %rcx
movq %r9, %rdx
movq %rdi, %r9
movq %r8, %rdi
movq %rax, %r8
movq %r15, %rax
jmp 0x7093
xorl %esi, %esi
cmpq $0xff, %rsi
ja 0x7390
addq 0x808(%rbx,%rsi,8), %r11
addq 0x810(%rbx,%rsi,8), %r10
addq 0x818(%rbx,%rsi,8), %rcx
addq 0x820(%rbx,%rsi,8), %rdx
addq 0x828(%rbx,%rsi,8), %r9
addq 0x830(%rbx,%rsi,8), %rdi
addq 0x838(%rbx,%rsi,8), %r8
addq 0x840(%rbx,%rsi,8), %rax
leaq (%rcx,%r10), %r14
shlq $0xb, %r10
xorq %r11, %r10
addq %r10, %rdx
leaq (%rdx,%rcx), %r11
shrq $0x2, %rcx
xorq %r14, %rcx
addq %rcx, %r9
leaq (%r9,%rdx), %r14
shlq $0x8, %rdx
xorq %r11, %rdx
addq %rdx, %rdi
leaq (%rdi,%r9), %r11
shrq $0x10, %r9
xorq %r14, %r9
addq %r9, %r8
leaq (%r8,%rdi), %r14
shlq $0xa, %rdi
xorq %r11, %rdi
addq %rdi, %rax
leaq (%rax,%r8), %r11
shrq $0x4, %r8
xorq %r14, %r8
addq %r8, %r10
leaq (%r10,%rax), %r14
shlq $0x8, %rax
xorq %r11, %rax
addq %rax, %rcx
leaq (%rcx,%r10), %r11
shrq $0x9, %r10
movq %r10, %r15
xorq %r14, %r15
addq %r15, %rdx
movq %r11, 0x808(%rbx,%rsi,8)
movq %rcx, 0x810(%rbx,%rsi,8)
movq %rdx, 0x818(%rbx,%rsi,8)
movq %r9, 0x820(%rbx,%rsi,8)
movq %rdi, 0x828(%rbx,%rsi,8)
movq %r8, 0x830(%rbx,%rsi,8)
movq %rax, 0x838(%rbx,%rsi,8)
movq %r15, 0x840(%rbx,%rsi,8)
addq $0x8, %rsi
movq %rcx, %r10
movq %rdx, %rcx
movq %r9, %rdx
movq %rdi, %r9
movq %r8, %rdi
movq %rax, %r8
movq %r15, %rax
jmp 0x719b
xorl %esi, %esi
cmpq $0xff, %rsi
ja 0x7390
leaq (%rcx,%r10), %r14
shlq $0xb, %r10
xorq %r10, %r11
addq %r11, %rdx
leaq (%rdx,%rcx), %r10
shrq $0x2, %rcx
xorq %r14, %rcx
addq %rcx, %r9
movq %rdx, %r14
shlq $0x8, %r14
xorq %r10, %r14
addq %r14, %rdi
addq %r9, %rdx
leaq (%rdi,%r9), %r10
shrq $0x10, %r9
xorq %r9, %rdx
addq %rdx, %r8
movq %rdi, %r9
shlq $0xa, %r9
xorq %r10, %r9
addq %r9, %rax
addq %r8, %rdi
leaq (%rax,%r8), %r10
shrq $0x4, %r8
xorq %r8, %rdi
addq %rdi, %r11
movq %rax, %r8
shlq $0x8, %r8
xorq %r10, %r8
addq %r8, %rcx
addq %r11, %rax
leaq (%rcx,%r11), %r15
shrq $0x9, %r11
xorq %r11, %rax
addq %rax, %r14
movq %r15, 0x808(%rbx,%rsi,8)
movq %rcx, 0x810(%rbx,%rsi,8)
movq %r14, 0x818(%rbx,%rsi,8)
movq %rdx, 0x820(%rbx,%rsi,8)
movq %r9, 0x828(%rbx,%rsi,8)
movq %rdi, 0x830(%rbx,%rsi,8)
movq %r8, 0x838(%rbx,%rsi,8)
movq %rax, 0x840(%rbx,%rsi,8)
addq $0x8, %rsi
movq %rcx, %r10
movq %r14, %rcx
movq %r15, %r11
jmp 0x72bb
movq %rbx, %rdi
callq 0x6d88
movq $0x100, (%rbx)          # imm = 0x100
popq %rbx
popq %r14
popq %r15
retq
nopl (%rax)