user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<mem_data_wr>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movq   $0x10000,-0x20(%rbp)
  mov    $0xa0,%esi
  lea    D4(%rip),%rax
  mov    %rax,%rdi
  call   <Mmc_Fat_Assign@plt>
  mov    $0x0,%eax
  call   <Mmc_Fat_Get_File_Size@plt>
  mov    %rax,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  cmp    -0x20(%rbp),%rax
  jae    L18
  mov    $0x0,%eax
  call   <Mmc_Fat_Append@plt>
  movl   $0x0,-0x3c(%rbp)
  jmp    L38
L5:
  mov    -0x3c(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,%eax
  imul   $0x10624dd3,%rax,%rax
  shr    $0x20,%rax
  shr    $0x6,%eax
  mov    %eax,-0x34(%rbp)
  mov    -0x3c(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,%edx
  imul   $0x10624dd3,%rdx,%rdx
  shr    $0x20,%rdx
  shr    $0x6,%edx
  mov    %edx,-0x30(%rbp)
  mov    -0x30(%rbp),%edx
  imul   $0x3e8,%edx,%edx
  sub    %edx,%eax
  mov    %eax,-0x30(%rbp)
  mov    -0x30(%rbp),%eax
  mov    %eax,%eax
  imul   $0x51eb851f,%rax,%rax
  shr    $0x20,%rax
  shr    $0x5,%eax
  mov    %eax,-0x2c(%rbp)
  mov    -0x30(%rbp),%eax
  mov    %eax,%edx
  imul   $0x51eb851f,%rdx,%rdx
  shr    $0x20,%rdx
  shr    $0x5,%edx
  imul   $0x64,%edx,%edx
  sub    %edx,%eax
  mov    %eax,-0x30(%rbp)
  mov    -0x30(%rbp),%eax
  mov    %eax,%edx
  mov    $0xcccccccd,%eax
  imul   %rdx,%rax
  shr    $0x20,%rax
  shr    $0x3,%eax
  mov    %eax,-0x28(%rbp)
  mov    -0x30(%rbp),%edx
  mov    %edx,%ecx
  mov    $0xcccccccd,%eax
  imul   %rcx,%rax
  shr    $0x20,%rax
  mov    %eax,%ecx
  shr    $0x3,%ecx
  mov    %ecx,%eax
  shl    $0x2,%eax
  add    %ecx,%eax
  add    %eax,%eax
  sub    %eax,%edx
  mov    %edx,-0x24(%rbp)
  mov    -0x34(%rbp),%eax
  add    $0x30,%eax
  mov    %al,-0xe(%rbp)
  mov    -0x2c(%rbp),%eax
  add    $0x30,%eax
  mov    %al,-0xd(%rbp)
  mov    -0x28(%rbp),%eax
  add    $0x30,%eax
  mov    %al,-0xc(%rbp)
  mov    -0x24(%rbp),%eax
  add    $0x30,%eax
  mov    %al,-0xb(%rbp)
  movb   $0xd,-0xa(%rbp)
  movb   $0xa,-0x9(%rbp)
  lea    -0xe(%rbp),%rax
  mov    $0x6,%esi
  mov    %rax,%rdi
  call   <Mmc_Fat_Write@plt>
  addl   $0x1,-0x3c(%rbp)
L38:
  cmpl   $0x7f,-0x3c(%rbp)
  jbe    L5
  movl   $0x1,-0x38(%rbp)
  jmp    L37
L18:
  movl   $0x0,-0x38(%rbp)
L37:
  mov    -0x38(%rbp),%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L44
  call   <__stack_chk_fail@plt>
L44:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: data_tag: D4
type_infered: string

tool: D4: te_value.txt

assistant: ```c
unsigned int mem_data_wr(unsigned int *ana_res) {
  unsigned int thousands, hundreds, tens, ones, temp, i;
  const unsigned long size = 65536;
  char holder[6];
  unsigned long mmc_size;
  unsigned int re;
  Mmc_Fat_Assign("te_value.txt", 0xA0);
  mmc_size = Mmc_Fat_Get_File_Size();
  if (mmc_size < size) {
    Mmc_Fat_Append();
    for (i = 0; i < 128; i++) {
      thousands = ana_res[i] / 1000;
      temp = ana_res[i] % 1000;
      hundreds = temp / 100;
      temp = temp % 100;
      tens = temp / 10;
      ones = temp % 10;
      holder[0] = thousands + 48;
      holder[1] = hundreds + 48;
      holder[2] = tens + 48;
      holder[3] = ones + 48;
      holder[4] = '\r';
      holder[5] = '\n';
      Mmc_Fat_Write(holder, 6);
    }
    re = 1;
  } else {
    re = 0;
  }
  return re;
}
```