user: What would the C source look like for the assembly code provided here:

```asm
<rng_spawn>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xd98,%rsp
  mov    %rdi,%r13
  mov    %rsi,%r12
  mov    %fs:0x28,%rax
  mov    %rax,0xd88(%rsp)
  xor    %eax,%eax
  mov    (%rdi),%r14d
  mov    0x4(%rdi),%ebx
  lea    0x9(%rbx),%eax
  cltq
  lea    -0x4(,%rax,4),%rax
  mov    %rax,0x8(%rsp)
  mov    0x20(%rdi),%ebp
  lea    -0x2(%rbx,%rbp,1),%eax
  sub    $0x1,%ebp
  cmovs  %eax,%ebp
  movslq %ebp,%rax
  lea    0x24(%rdi,%rax,4),%r15
  cmpl   $0x0,(%r15)
  js     L51
L16:
  shll   (%r15)
  mov    %ebp,0x20(%r13)
  sub    %ebx,%r14d
  test   %r14d,%r14d
  jle    L62
  mov    %r14d,%ecx
  mov    $0x0,%eax
L31:
  mov    0x0(%r13,%rax,4),%edx
  mov    %edx,(%r12,%rax,4)
  add    $0x1,%rax
  cmp    %rcx,%rax
  jne    L31
L62:
  addl   $0x2,(%r15)
  mov    0x8(%rsp),%rdx
  add    %r12,%rdx
  lea    -0x1(%rbx),%esi
  test   %esi,%esi
  jle    L125
  mov    %rdx,%rax
  lea    -0x2(%rbx),%ecx
  lea    0x4(%rdx,%rcx,4),%r8
  mov    $0x0,%edi
L167:
  movslq %ebp,%rcx
  mov    0x24(%r12,%rcx,4),%ecx
  mov    %ecx,(%rax)
  add    $0x1,%ebp
  cmp    %esi,%ebp
  cmove  %edi,%ebp
  add    $0x4,%rax
  cmp    %r8,%rax
  jne    L167
L125:
  movslq 0x10(%r12),%rax
  addl   $0x1,(%rdx,%rax,4)
  mov    0x8(%r12),%eax
  xor    %eax,(%rdx)
  movslq %ebx,%rax
  shl    $0x2,%rax
  movl   $0x0,-0x4(%rdx,%rax,1)
  mov    0x4(%r12),%edi
  lea    -0x1(%rdi),%ecx
  mov    %ecx,0x18(%r12)
  mov    0xc(%r12),%esi
  lea    -0x1(%rsi),%ecx
  mov    %ecx,0x1c(%r12)
  cmpl   $0x0,0x14(%r12)
  jle    L157
  movslq %esi,%r9
  mov    %r9,%r8
  neg    %r8
  shl    $0x2,%r8
  add    %r8,%rax
  lea    (%rdx,%rax,1),%rdi
  add    %rdx,%r8
  mov    $0x0,%r11d
  mov    %esi,%r10d
  jmp    L174
L51:
  lea    D6(%rip),%rdi
  call   <printf@plt>
  mov    $0x0,%edi
  call   <exit@plt>
  jmp    L16
L48:
  cmp    %ebx,%esi
  jge    L146
L120:
  mov    %r9,%rax
L145:
  mov    (%r8,%rax,4),%ecx
  mov    %ecx,(%rdx,%rax,4)
  add    $0x1,%rax
  cmp    %eax,%ebx
  jg     L145
  test   %esi,%esi
  jle    L146
L39:
  mov    $0x0,%eax
L165:
  mov    0x10(%rsp,%rax,4),%ecx
  add    %ecx,(%rdx,%rax,4)
  add    $0x1,%rax
  cmp    %eax,%esi
  jg     L165
L146:
  add    %esi,%r11d
  cmp    %r11d,0x14(%r12)
  jle    L157
L174:
  mov    $0x0,%eax
  test   %esi,%esi
  jle    L48
L142:
  mov    (%rdi,%rax,4),%ecx
  mov    %ecx,0x10(%rsp,%rax,4)
  add    $0x1,%rax
  cmp    %rax,%r10
  jne    L142
  cmp    %ebx,%esi
  jl     L120
  jmp    L39
L157:
  mov    0xd88(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L136
  add    $0xd98,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L136:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: tag: D6
type_infered: string

tool: D6: 

ALFG:  node limit exceeded



assistant: ```c
void rng_spawn(int *mystate, int *newstate, int spawnNumber) {
  int i, j, l, k, zp, state_size, tmp[861];
  int *reg, *node;
  state_size = mystate[0];
  l = mystate[1];
  node = &(mystate[9]);
  reg = &(mystate[(9 + l - 1)]);
  zp = mystate[8];
  zp = zp - 1;
  if (zp < 0)
    zp += (l - 1);
  if (node[zp] & 0x80000000) {
    printf("\n\nALFG:  node limit exceeded\n\n");
    exit(0);
  }
  node[zp] <<= 1;
  mystate[8] = zp;
  for (i = 0; i < state_size - l; i++)
    newstate[i] = mystate[i];
  node[zp] += 2;
  node = &(newstate[9]);
  reg = &(newstate[(9 + l - 1)]);
  j = zp;
  for (i = 0; i < l - 1; i++) {
    reg[i] = node[j];
    if (++j == (l - 1))
      j = 0;
  }
  reg[newstate[4]] += 1;
  reg[0] ^= newstate[2];
  reg[l - 1] = 0;
  newstate[6] = newstate[1] - 1;
  newstate[7] = newstate[3] - 1;
  k = newstate[3];
  for (j = 0; j < newstate[5]; j += k) {
    for (i = 0; i < k; i++)
      tmp[i] = reg[i + l - k];
    for (i = k; i < l; i++)
      reg[i] = reg[i - k];
    for (i = 0; i < k; i++)
      reg[i] += tmp[i];
  }
}
```