user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<ran2>:
  endbr64
  mov    (%rdi),%rcx
  mov    %rdi,%r10
  test   %rcx,%rcx
  jle    L19
  mov    D14(%rip),%rsi
  lea    D85(%rip),%r8
  movabs $0x4f7a09cc7bd54605,%rdx
  mov    %rsi,%rax
  imul   %rdx
  mov    %rsi,%rax
  sar    $0x3f,%rax
  sar    $0xe,%rdx
  sub    %rax,%rdx
  imul   $0xffffffffffff31da,%rdx,%r9
  imul   $0xfffffffffffff131,%rdx,%rdx
  add    %rsi,%r9
  mov    D6(%rip),%rsi
  imul   $0x9ef4,%r9,%r9
  add    %rdx,%r9
L0:
  movabs $0x9c4e3aa71ae25487,%rdx
  mov    %rcx,%rax
  imul   %rdx
  mov    %rcx,%rax
  sar    $0x3f,%rax
  add    %rcx,%rdx
  sar    $0xf,%rdx
  sub    %rax,%rdx
  imul   $0xffffffffffff2e5c,%rdx,%rax
  imul   $0xffffffffffffd04d,%rdx,%rdx
  add    %rax,%rcx
  imul   $0x9c4e,%rcx,%rcx
  add    %rdx,%rcx
  jns    L37
  add    $0x7fffffab,%rcx
L37:
  mov    %rcx,(%r10)
  test   %r9,%r9
  jns    L23
  add    $0x7fffff07,%r9
L23:
  mov    %rsi,%rax
  mov    %r9,D36(%rip)
  movabs $0x8000004000002001,%rdx
  imul   %rdx
  add    %rsi,%rdx
  sar    $0x3f,%rsi
  sar    $0x19,%rdx
  sub    %rsi,%rdx
  movslq %edx,%rax
  mov    (%r8,%rax,8),%rdx
  mov    %rcx,(%r8,%rax,8)
  sub    %r9,%rdx
  mov    %rdx,D36(%rip)
  test   %rdx,%rdx
  jg     L69
  add    $0x7fffffaa,%rdx
  mov    %rdx,D36(%rip)
L69:
  pxor   %xmm0,%xmm0
  movsd  D36(%rip),%xmm1
  cvtsi2sd %rdx,%xmm0
  mulsd  D59(%rip),%xmm0
  minsd  %xmm0,%xmm1
  movapd %xmm1,%xmm0
  ret
  nopl   0x0(%rax)
L19:
  je     L35
  movabs $0x9ef41398f7aa8c09,%rdx
  mov    %rcx,%rsi
  neg    %rsi
  mov    %rsi,%rax
  mul    %rdx
  shr    $0xf,%rdx
  imul   $0xffffffffffff31da,%rdx,%r9
  imul   $0xfffffffffffff131,%rdx,%rdx
  sub    %rcx,%r9
  mov    %rsi,%rcx
  imul   $0x9ef4,%r9,%r9
  add    %rdx,%r9
L15:
  mov    $0x27,%esi
  lea    D85(%rip),%r8
  movabs $0x9c4e3aa71ae25487,%rdi
  nopl   0x0(%rax)
L79:
  mov    %rcx,%rax
  imul   %rdi
  mov    %rcx,%rax
  sar    $0x3f,%rax
  add    %rcx,%rdx
  sar    $0xf,%rdx
  sub    %rax,%rdx
  imul   $0xffffffffffff2e5c,%rdx,%rax
  imul   $0xffffffffffffd04d,%rdx,%rdx
  add    %rcx,%rax
  imul   $0x9c4e,%rax,%rax
  lea    (%rax,%rdx,1),%rcx
  lea    0x7fffffab(%rcx),%rax
  test   %rcx,%rcx
  cmovs  %rax,%rcx
  cmp    $0x1f,%rsi
  ja     L4
  mov    %rcx,(%r8,%rsi,8)
L4:
  sub    $0x1,%rsi
  jae    L79
  mov    %rcx,(%r10)
  mov    D85(%rip),%rsi
  jmp    L0
L35:
  mov    $0x9ef4,%r9d
  mov    $0x1,%ecx
  jmp    L15
```

tool_calls: name: unpack_data
arguments: tag: D36
data_type: byte[8]
name: unpack_data
arguments: tag: D59
data_type: byte[8]

tool: {"D36": [0x59,0x53,0x93,0xbf,0xff,0xff,0xef,0x3f]}

tool: {"D59": [0x07,0x00,0xa0,0x0a,0x00,0x00,0x00,0x3e]}

assistant: ```c
double ran2(idum)
long *idum;
{
  int j;
  long k;
  static long idum2 = 123456789;
  static long iy = 0;
  static long iv[32];
  double temp;
  if (*idum <= 0) {
    if (-(*idum) < 1)
      *idum = 1;
    else
      *idum = -(*idum);
    idum2 = (*idum);
    for (j = 32 + 7; j >= 0; j--) {
      k = (*idum) / 53668;
      *idum = 40014 * (*idum - k * 53668) - k * 12211;
      if (*idum < 0)
        *idum += 2147483563;
      if (j < 32)
        iv[j] = *idum;
    }
    iy = iv[0];
  }
  k = (*idum) / 53668;
  *idum = 40014 * (*idum - k * 53668) - k * 12211;
  if (*idum < 0)
    *idum += 2147483563;
  k = idum2 / 52774;
  idum2 = 40692 * (idum2 - k * 52774) - k * 3791;
  if (idum2 < 0)
    idum2 += 2147483399;
  j = iy / (1 + (2147483563 - 1) / 32);
  iy = iv[j] - idum2;
  iv[j] = *idum;
  if (iy < 1)
    iy += (2147483563 - 1);
  if ((temp = (1.0 / 2147483563) * iy) > (1.0 - 1.2e-7))
    return (1.0 - 1.2e-7);
  else
    return temp;
}
```