user: 下面的汇编指令对应的C源代码是什么：

```asm
<charts_fixmax>:
  endbr64
  mov    %rdi,%rax
  mov    %rdx,%rdi
  movabs $0xdcef33a6f838000,%rdx
  cmp    %rdx,%rax
  jbe    L118
  movabs $0x6f05b59d3b1ffff,%rdx
  movabs $0x49c97747490f,%r8
  add    %rax,%rdx
  shr    $0x11,%rdx
  mov    %rdx,%rax
  mul    %r8
  movabs $0x6f05b59d3b20000,%rax
  shr    $0x18,%rdx
  mov    %rdx,(%rcx)
  imul   %rax,%rdx
  test   %rdx,%rdx
  js     L96
  pxor   %xmm0,%xmm0
  movl   $0x1,(%rdi)
  cvtsi2sd %rdx,%xmm0
  addl   $0x6,(%rsi)
  ret
  nopl   0x0(%rax,%rax,1)
L118:
  movabs $0x1617eb90b26c000,%rdx
  cmp    %rdx,%rax
  jbe    L62
  movabs $0x11c37937e07fff,%rdx
  pxor   %xmm0,%xmm0
  movabs $0x39a5652fb1137857,%r8
  add    %rdx,%rax
  mul    %r8
  movabs $0x11c37937e08000,%rax
  shr    $0x32,%rdx
  mov    %rdx,(%rcx)
  imul   %rax,%rdx
  movl   $0x0,(%rdi)
  addl   $0x5,(%rsi)
  cvtsi2sd %rdx,%xmm0
  ret
  nopl   0x0(%rax)
L62:
  movabs $0x388f27d8d3000,%rdx
  cmp    %rdx,%rax
  ja     L55
  movabs $0x5a7ea627b800,%rdx
  cmp    %rdx,%rax
  jbe    L43
  movabs $0x48c27394fff,%rdx
  pxor   %xmm0,%xmm0
  movabs $0x384b84d092ed0385,%r8
  add    %rdx,%rax
  mul    %r8
  movabs $0x48c27395000,%rax
  shr    $0x28,%rdx
  mov    %rdx,(%rcx)
  imul   %rax,%rdx
  movl   $0x0,(%rdi)
  addl   $0x4,(%rsi)
  cvtsi2sd %rdx,%xmm0
  ret
  nopl   0x0(%rax)
L96:
  shr    %rdx
  pxor   %xmm0,%xmm0
  movl   $0x1,(%rdi)
  cvtsi2sd %rdx,%xmm0
  addl   $0x6,(%rsi)
  addsd  %xmm0,%xmm0
  ret
  nopw   0x0(%rax,%rax,1)
L55:
  movabs $0x1c6bf52633fff,%rdx
  pxor   %xmm0,%xmm0
  movabs $0x24075f3dceac3,%r8
  add    %rax,%rdx
  shr    $0xe,%rdx
  mov    %rdx,%rax
  mul    %r8
  movabs $0x1c6bf52634000,%rax
  shr    $0x14,%rdx
  mov    %rdx,(%rcx)
  imul   %rax,%rdx
  movl   $0x1,(%rdi)
  addl   $0x5,(%rsi)
  cvtsi2sd %rdx,%xmm0
  ret
  nopl   0x0(%rax)
L43:
  movabs $0xe7aa9f1e00,%rdx
  cmp    %rdx,%rax
  ja     L31
  movabs $0x172aa98300,%rdx
  cmp    %rdx,%rax
  jbe    L88
  movabs $0x12a05f1ff,%rdx
  pxor   %xmm0,%xmm0
  movabs $0xdbe6fecebdedd5bf,%r8
  add    %rdx,%rax
  mul    %r8
  movabs $0x12a05f200,%rax
  shr    $0x20,%rdx
  mov    %rdx,(%rcx)
  imul   %rax,%rdx
  movl   $0x0,(%rdi)
  addl   $0x3,(%rsi)
  cvtsi2sd %rdx,%xmm0
  ret
  nopl   0x0(%rax)
L31:
  movabs $0x746a5287ff,%rdx
  pxor   %xmm0,%xmm0
  movabs $0x232f33025bd42233,%r8
  add    %rdx,%rax
  mul    %r8
  movabs $0x746a528800,%rax
  shr    $0x24,%rdx
  mov    %rdx,(%rcx)
  imul   %rax,%rdx
  movl   $0x1,(%rdi)
  addl   $0x4,(%rsi)
  cvtsi2sd %rdx,%xmm0
  ret
  nopw   0x0(%rax,%rax,1)
L88:
  cmp    $0x3b4e7ec0,%rax
  jbe    L46
  lea    0x1dcd64ff(%rax),%rdx
  pxor   %xmm0,%xmm0
  movabs $0x44b82fa09b5a53,%r8
  shr    $0x8,%rdx
  mov    %rdx,%rax
  mul    %r8
  shr    $0xb,%rdx
  mov    %rdx,(%rcx)
  imul   $0x1dcd6500,%rdx,%rdx
  movl   $0x1,(%rdi)
  addl   $0x3,(%rsi)
  cvtsi2sd %rdx,%xmm0
  ret
L46:
  cmp    $0x5ee3fe0,%rax
  jbe    L21
  lea    0x4c4b3f(%rax),%rdx
  pxor   %xmm0,%xmm0
  movabs $0xd6bf94d5e57a42bd,%r8
  mov    %rdx,%rax
  mul    %r8
  shr    $0x16,%rdx
  mov    %rdx,(%rcx)
  imul   $0x4c4b40,%rdx,%rdx
  movl   $0x0,(%rdi)
  addl   $0x2,(%rsi)
  cvtsi2sd %rdx,%xmm0
  ret
L21:
  cmp    $0xf2eb8,%rax
  jbe    L34
  lea    0x7a11f(%rax),%rdx
  pxor   %xmm0,%xmm0
  movabs $0x431bde82d7b634db,%r8
  mov    %rdx,%rax
  mul    %r8
  shr    $0x11,%rdx
  mov    %rdx,(%rcx)
  imul   $0x7a120,%rdx,%rdx
  movl   $0x1,(%rdi)
  addl   $0x2,(%rsi)
  cvtsi2sd %rdx,%xmm0
  ret
L34:
  cmp    $0x184ac,%rax
  jbe    L37
  add    $0x1387,%rax
  mov    $0x1388,%r8d
  pxor   %xmm0,%xmm0
  xor    %edx,%edx
  div    %r8
  mov    %rax,(%rcx)
  imul   $0x1388,%rax,%rax
  movl   $0x0,(%rdi)
  addl   $0x1,(%rsi)
  cvtsi2sd %rax,%xmm0
  ret
L37:
  cmp    $0x3e3,%rax
  jbe    L40
  add    $0x1f3,%rax
  mov    $0x1f4,%r8d
  pxor   %xmm0,%xmm0
  xor    %edx,%edx
  div    %r8
  mov    %rax,(%rcx)
  imul   $0x1f4,%rax,%rax
  movl   $0x1,(%rdi)
  addl   $0x1,(%rsi)
  cvtsi2sd %rax,%xmm0
  ret
L40:
  cmp    $0x63,%rax
  jbe    L56
  add    $0x4,%rax
  mov    $0x5,%esi
  pxor   %xmm0,%xmm0
  xor    %edx,%edx
  div    %rsi
  mov    %rax,(%rcx)
  lea    (%rax,%rax,4),%rax
  cvtsi2sd %rax,%xmm0
  movl   $0x0,(%rdi)
  ret
L56:
  test   %rax,%rax
  mov    $0x1,%edx
  pxor   %xmm0,%xmm0
  cmove  %rdx,%rax
  lea    (%rax,%rax,1),%rdx
  imul   $0xa,%rax,%rax
  mov    %rdx,(%rcx)
  movl   $0x1,(%rdi)
  cvtsi2sd %rax,%xmm0
  divsd  D7(%rip),%xmm0
  ret
```

tool_calls: name: disassemble_data
arguments: tag: D7
type: f64

tool: D7: 10

assistant: ```c
double charts_fixmax(uint64_t max, uint8_t *scale, uint8_t *mode, uint16_t *base) {
  double rmax;
  if (max > 995000000000000000ULL) {
    (*base) = (max + 499999999999999999ULL) / 500000000000000000ULL;
    rmax = (*base) * 500000000000000000ULL;
    (*mode) = 1;
    (*scale) += 6;
  } else if (max > 99500000000000000ULL) {
    (*base) = (max + 4999999999999999ULL) / 5000000000000000ULL;
    rmax = (*base) * 5000000000000000ULL;
    (*mode) = 0;
    (*scale) += 5;
  } else if (max > 995000000000000ULL) {
    (*base) = (max + 499999999999999ULL) / 500000000000000ULL;
    rmax = (*base) * 500000000000000ULL;
    (*mode) = 1;
    (*scale) += 5;
  } else if (max > 99500000000000ULL) {
    (*base) = (max + 4999999999999ULL) / 5000000000000ULL;
    rmax = (*base) * 5000000000000ULL;
    (*mode) = 0;
    (*scale) += 4;
  } else if (max > 995000000000ULL) {
    (*base) = (max + 499999999999ULL) / 500000000000ULL;
    rmax = (*base) * 500000000000ULL;
    (*mode) = 1;
    (*scale) += 4;
  } else if (max > 99500000000ULL) {
    (*base) = (max + 4999999999ULL) / 5000000000ULL;
    rmax = (*base) * 5000000000ULL;
    (*mode) = 0;
    (*scale) += 3;
  } else if (max > 995000000ULL) {
    (*base) = (max + 499999999ULL) / 500000000ULL;
    rmax = (*base) * 500000000ULL;
    (*mode) = 1;
    (*scale) += 3;
  } else if (max > 99500000ULL) {
    (*base) = (max + 4999999ULL) / 5000000ULL;
    rmax = (*base) * 5000000ULL;
    (*mode) = 0;
    (*scale) += 2;
  } else if (max > 995000ULL) {
    (*base) = (max + 499999ULL) / 500000ULL;
    rmax = (*base) * 500000ULL;
    (*mode) = 1;
    (*scale) += 2;
  } else if (max > 99500ULL) {
    (*base) = (max + 4999ULL) / 5000ULL;
    rmax = (*base) * 5000ULL;
    (*mode) = 0;
    (*scale) += 1;
  } else if (max > 995ULL) {
    (*base) = (max + 499ULL) / 500ULL;
    rmax = (*base) * 500ULL;
    (*mode) = 1;
    (*scale) += 1;
  } else if (max > 99ULL) {
    (*base) = (max + 4ULL) / 5ULL;
    rmax = (*base) * 5ULL;
    (*mode) = 0;
  } else {
    if (max == 0) {
      max = 1;
    }
    (*base) = max * 2;
    rmax = ((*base) * 5) / 10.0;
    (*mode) = 1;
  }
  return rmax;
}
```