// File: /workspace/github_c_makefile_star2_O1/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 %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movabsq $-0x106c410289b2f2b, %r8 # imm = 0xFEF93BEFD764D0D5
movabsq $-0x2b5a485ed29776f, %rdi # imm = 0xFD4A5B7A12D68891
movabsq $-0x150260e318e1fbcf, %r10 # imm = 0xEAFD9F1CE71E0431
movabsq $-0x166dcb44fd103bef, %r11 # imm = 0xE99234BB02EFC411
movabsq $-0x1f5781ab9372a63f, %r9 # imm = 0xE0A87E546C8D59C1
movabsq $-0x6d7b57e648c3f511, %rcx # imm = 0x9284A819B73C0AEF
movabsq $-0x6f24f755e54b3af6, %rax # imm = 0x90DB08AA1AB4C50A
movabsq $0x272406f55f701ff1, %rdx # imm = 0x272406F55F701FF1
xorps %xmm0, %xmm0
movups %xmm0, 0x1008(%rbx)
movq $0x0, 0x1018(%rbx)
testl %esi, %esi
je 0x7906
movq $-0x8, %rsi
addq 0x48(%rbx,%rsi,8), %r11
addq 0x50(%rbx,%rsi,8), %r8
addq 0x58(%rbx,%rsi,8), %r10
addq 0x60(%rbx,%rsi,8), %r9
addq 0x68(%rbx,%rsi,8), %rdx
addq 0x70(%rbx,%rsi,8), %rax
addq 0x78(%rbx,%rsi,8), %rcx
addq 0x80(%rbx,%rsi,8), %rdi
leaq (%r10,%r8), %r15
shlq $0xb, %r8
xorq %r11, %r8
addq %r8, %r9
leaq (%r9,%r10), %r14
shrq $0x2, %r10
xorq %r15, %r10
addq %r10, %rdx
leaq (%rdx,%r9), %r11
shlq $0x8, %r9
movq %r8, %r15
movq %r10, %r8
xorq %r14, %r9
addq %r9, %rax
leaq (%rax,%rdx), %r14
shrq $0x10, %rdx
movq %r9, %r10
movq %rdx, %r9
xorq %r11, %r9
addq %r9, %rcx
leaq (%rcx,%rax), %r11
shlq $0xa, %rax
movq %rax, %rdx
xorq %r14, %rdx
addq %rdx, %rdi
leaq (%rdi,%rcx), %r14
shrq $0x4, %rcx
movq %rcx, %rax
xorq %r11, %rax
addq %rax, %r15
leaq (%r15,%rdi), %r12
shlq $0x8, %rdi
movq %rdi, %rcx
xorq %r14, %rcx
addq %rcx, %r8
leaq (%r8,%r15), %r11
shrq $0x9, %r15
movq %r15, %rdi
xorq %r12, %rdi
addq %rdi, %r10
movq %r11, 0x848(%rbx,%rsi,8)
movq %r8, 0x850(%rbx,%rsi,8)
movq %r10, 0x858(%rbx,%rsi,8)
movq %r9, 0x860(%rbx,%rsi,8)
movq %rdx, 0x868(%rbx,%rsi,8)
movq %rax, 0x870(%rbx,%rsi,8)
movq %rcx, 0x878(%rbx,%rsi,8)
movq %rdi, 0x880(%rbx,%rsi,8)
addq $0x8, %rsi
cmpq $0xf8, %rsi
jb 0x76dd
movq $-0x8, %rsi
addq 0x848(%rbx,%rsi,8), %r11
addq 0x850(%rbx,%rsi,8), %r8
addq 0x858(%rbx,%rsi,8), %r10
addq 0x860(%rbx,%rsi,8), %r9
addq 0x868(%rbx,%rsi,8), %rdx
addq 0x870(%rbx,%rsi,8), %rax
addq 0x878(%rbx,%rsi,8), %rcx
addq 0x880(%rbx,%rsi,8), %rdi
leaq (%r10,%r8), %r14
shlq $0xb, %r8
xorq %r11, %r8
addq %r8, %r9
leaq (%r9,%r10), %r15
shrq $0x2, %r10
xorq %r14, %r10
addq %r10, %rdx
leaq (%rdx,%r9), %r11
shlq $0x8, %r9
xorq %r15, %r9
addq %r9, %rax
leaq (%rax,%rdx), %r15
shrq $0x10, %rdx
movq %r10, %r14
movq %r9, %r10
movq %rdx, %r9
xorq %r11, %r9
addq %r9, %rcx
leaq (%rcx,%rax), %r11
shlq $0xa, %rax
movq %rax, %rdx
xorq %r15, %rdx
addq %rdx, %rdi
leaq (%rdi,%rcx), %r15
shrq $0x4, %rcx
movq %rcx, %rax
xorq %r11, %rax
addq %rax, %r8
leaq (%r8,%rdi), %r12
shlq $0x8, %rdi
movq %rdi, %rcx
xorq %r15, %rcx
addq %rcx, %r14
leaq (%r14,%r8), %r11
shrq $0x9, %r8
xorq %r12, %r8
addq %r8, %r10
movq %r11, 0x848(%rbx,%rsi,8)
movq %r14, 0x850(%rbx,%rsi,8)
movq %r10, 0x858(%rbx,%rsi,8)
movq %r9, 0x860(%rbx,%rsi,8)
movq %rdx, 0x868(%rbx,%rsi,8)
movq %rax, 0x870(%rbx,%rsi,8)
movq %rcx, 0x878(%rbx,%rsi,8)
movq %r8, 0x880(%rbx,%rsi,8)
addq $0x8, %rsi
movq %r8, %rdi
movq %r14, %r8
cmpq $0xf8, %rsi
jb 0x77e8
jmp 0x79da
movq $-0x8, %rsi
leaq (%r10,%r8), %r14
shlq $0xb, %r8
xorq %r11, %r8
addq %r8, %r9
leaq (%r9,%r10), %r11
shrq $0x2, %r10
xorq %r14, %r10
addq %r10, %rdx
movq %r9, %r14
shlq $0x8, %r14
xorq %r11, %r14
addq %r14, %rax
addq %rdx, %r9
leaq (%rax,%rdx), %r11
shrq $0x10, %rdx
xorq %rdx, %r9
addq %r9, %rcx
movq %rax, %rdx
shlq $0xa, %rdx
xorq %r11, %rdx
addq %rdx, %rdi
addq %rcx, %rax
leaq (%rdi,%rcx), %r11
shrq $0x4, %rcx
xorq %rcx, %rax
addq %rax, %r8
movq %rdi, %rcx
shlq $0x8, %rcx
xorq %r11, %rcx
addq %rcx, %r10
addq %r8, %rdi
leaq (%r10,%r8), %r11
shrq $0x9, %r8
xorq %r8, %rdi
addq %rdi, %r14
movq %r11, 0x848(%rbx,%rsi,8)
movq %r10, 0x850(%rbx,%rsi,8)
movq %r14, 0x858(%rbx,%rsi,8)
movq %r9, 0x860(%rbx,%rsi,8)
movq %rdx, 0x868(%rbx,%rsi,8)
movq %rax, 0x870(%rbx,%rsi,8)
movq %rcx, 0x878(%rbx,%rsi,8)
movq %rdi, 0x880(%rbx,%rsi,8)
addq $0x8, %rsi
movq %r10, %r8
movq %r14, %r10
cmpq $0xf8, %rsi
jb 0x790d
movq %rbx, %rdi
callq 0x73d4
movq $0x100, (%rbx)          # imm = 0x100
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nopl (%rax)