user: 请将以下的汇编代码转换成C语言代码：

```asm
<ran2>:
  endbr64
  mov    (%rdi),%edx
  mov    %rdi,%r9
  test   %edx,%edx
  jle    L56
  movslq D31(%rip),%rax
  lea    D2(%rip),%rdi
  mov    %rax,%rcx
  imul   $0x4f7a09cd,%rax,%rax
  mov    %ecx,%esi
  sar    $0x1f,%esi
  sar    $0x2e,%rax
  sub    %esi,%eax
  imul   $0xffff31da,%eax,%r8d
  imul   $0xfffff131,%eax,%eax
  add    %ecx,%r8d
  mov    D23(%rip),%ecx
  imul   $0x9ef4,%r8d,%r8d
  add    %eax,%r8d
L74:
  movslq %edx,%rax
  mov    %edx,%esi
  imul   $0x1389c755,%rax,%rax
  sar    $0x1f,%esi
  sar    $0x2c,%rax
  sub    %esi,%eax
  imul   $0xffff2e5c,%eax,%esi
  imul   $0xffffd04d,%eax,%eax
  add    %esi,%edx
  imul   $0x9c4e,%edx,%edx
  add    %eax,%edx
  jns    L44
  add    $0x7fffffab,%edx
L44:
  mov    %edx,(%r9)
  test   %r8d,%r8d
  jns    L69
  add    $0x7fffff07,%r8d
L69:
  movslq %ecx,%rax
  mov    %r8d,D47(%rip)
  imul   $0xffffffff80000041,%rax,%rax
  shr    $0x20,%rax
  add    %ecx,%eax
  sar    $0x1f,%ecx
  sar    $0x19,%eax
  sub    %ecx,%eax
  cltq
  mov    (%rdi,%rax,4),%ecx
  mov    %edx,(%rdi,%rax,4)
  sub    %r8d,%ecx
  mov    %ecx,D47(%rip)
  test   %ecx,%ecx
  jg     L3
  add    $0x7fffffaa,%ecx
  mov    %ecx,D47(%rip)
L3:
  pxor   %xmm0,%xmm0
  movsd  D47(%rip),%xmm1
  cvtsi2sd %ecx,%xmm0
  mulsd  D5(%rip),%xmm0
  minsd  %xmm0,%xmm1
  movapd %xmm1,%xmm0
  ret
  nopw   0x0(%rax,%rax,1)
L56:
  je     L19
  mov    %edx,%ecx
  mov    $0x9ef41399,%esi
  neg    %ecx
  mov    %ecx,%eax
  imul   %rsi,%rax
  shr    $0x2f,%rax
  imul   $0xffff31da,%eax,%r8d
  imul   $0xfffff131,%eax,%eax
  sub    %edx,%r8d
  mov    %ecx,%edx
  imul   $0x9ef4,%r8d,%r8d
  add    %eax,%r8d
L78:
  mov    $0x27,%esi
  lea    D2(%rip),%rdi
  nopl   0x0(%rax)
L87:
  movslq %edx,%rax
  mov    %edx,%ecx
  imul   $0x1389c755,%rax,%rax
  sar    $0x1f,%ecx
  sar    $0x2c,%rax
  sub    %ecx,%eax
  imul   $0xffff2e5c,%eax,%ecx
  imul   $0xffffd04d,%eax,%eax
  add    %ecx,%edx
  imul   $0x9c4e,%edx,%edx
  add    %eax,%edx
  lea    0x7fffffab(%rdx),%eax
  cmovs  %eax,%edx
  cmp    $0x1f,%rsi
  ja     L72
  mov    %edx,(%rdi,%rsi,4)
L72:
  sub    $0x1,%rsi
  jae    L87
  mov    %edx,(%r9)
  mov    D2(%rip),%ecx
  jmp    L74
  nopl   0x0(%rax)
L19:
  mov    $0x9ef4,%r8d
  mov    $0x1,%edx
  jmp    L78
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D47
type_infered: byte[8]
name: extract_symbolic_data
arguments: data_label: D5
type_infered: byte[8]

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

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

assistant: ```c
double ran2(int *idum) {
  int j;
  int k;
  static int idum2 = 123456789;
  static int iy = 0;
  static int iv[32];
  double tempran;
  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 ((tempran = (1.0 / 2147483563) * iy) > (1.0 - 1.2e-7)) {
    return (1.0 - 1.2e-7);
  } else
    return tempran;
}
```