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

```asm
<write_sfix7>:
  endbr64
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    %rsp,%r10
  mov    %r10,%rsi
  test   %edi,%edi
  jns    L167
  movb   $0x2d,(%rsp)
  neg    %edi
  lea    0x1(%rsp),%rsi
L167:
  imul   $0xcccccccd,%edi,%eax
  ror    %eax
  cmp    $0x19999999,%eax
  ja     L79
  mov    %edi,%edi
  mov    $0xcccccccd,%edx
  imul   %rdx,%rdi
  shr    $0x23,%rdi
  imul   $0xcccccccd,%edi,%eax
  ror    %eax
  cmp    $0x19999999,%eax
  ja     L176
  mov    %edi,%eax
  imul   %rdx,%rax
  shr    $0x23,%rax
  imul   $0xcccccccd,%eax,%ecx
  mov    %eax,%edi
  ror    %ecx
  cmp    $0x19999999,%ecx
  ja     L12
  mov    %eax,%eax
  imul   %rdx,%rax
  shr    $0x23,%rax
  imul   $0xcccccccd,%eax,%ecx
  mov    %eax,%edi
  ror    %ecx
  cmp    $0x19999999,%ecx
  ja     L98
  mov    %eax,%eax
  imul   %rdx,%rax
  shr    $0x23,%rax
  imul   $0xcccccccd,%eax,%ecx
  mov    %eax,%edi
  ror    %ecx
  cmp    $0x19999999,%ecx
  ja     L172
  mov    %eax,%eax
  imul   %rdx,%rax
  shr    $0x23,%rax
  mov    %eax,%r8d
  mov    %r8,%rdi
  imul   %rdx,%r8
  shr    $0x23,%r8
  mov    %r8d,%ecx
  mov    %edi,%r8d
  lea    (%rcx,%rcx,4),%eax
  add    %eax,%eax
  sub    %eax,%r8d
  jne    L169
  imul   $0xcccccccd,%ecx,%eax
  ror    %eax
  cmp    $0x19999999,%eax
  ja     L142
  imul   %rdx,%rcx
  mov    %rsi,%rax
  shr    $0x23,%rcx
L10:
  movb   $0x2e,(%rax)
  lea    0x1(%rax),%r9
  mov    $0xcccccccd,%r11d
  nopl   0x0(%rax)
L44:
  mov    %ecx,%eax
  mov    %ecx,%edi
  mov    %r9,%rdx
  imul   %r11,%rax
  lea    0x1(%r9),%r9
  shr    $0x23,%rax
  lea    (%rax,%rax,4),%r8d
  add    %r8d,%r8d
  sub    %r8d,%edi
  add    $0x30,%edi
  mov    %dil,-0x1(%r9)
  mov    %ecx,%edi
  mov    %eax,%ecx
  cmp    $0x9,%edi
  jg     L44
  movb   $0x0,(%r9)
  cmp    %rdx,%rsi
  jae    L207
  cs nopw 0x0(%rax,%rax,1)
L16:
  movzbl (%rsi),%eax
  movzbl (%rdx),%ecx
  add    $0x1,%rsi
  sub    $0x1,%rdx
  mov    %cl,-0x1(%rsi)
  mov    %al,0x1(%rdx)
  cmp    %rdx,%rsi
  jb     L16
L207:
  mov    %r10,%rdi
  call   <write_str@plt>
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L171
  add    $0x28,%rsp
  ret
L79:
  mov    $0xcccccccd,%r9d
  mov    %edi,%r8d
  lea    0x2(%rsi),%rdx
  imul   %r9,%r8
  shr    $0x23,%r8
  mov    %r8d,%ecx
  lea    (%r8,%r8,4),%eax
  imul   %r9,%rcx
  add    %eax,%eax
  mov    $0x4,%r9d
  sub    %eax,%edi
  lea    0x30(%rdi),%eax
  shr    $0x23,%rcx
  mov    %al,(%rsi)
  lea    (%rcx,%rcx,4),%eax
  add    %eax,%eax
  sub    %eax,%r8d
  lea    0x30(%r8),%eax
  mov    $0x6,%r8d
  mov    %al,0x1(%rsi)
  nopw   0x0(%rax,%rax,1)
L104:
  mov    %ecx,%eax
  mov    $0xcccccccd,%edi
  imul   %rdi,%rax
  shr    $0x23,%rax
  lea    (%rax,%rax,4),%r11d
  add    %r11d,%r11d
  sub    %r11d,%ecx
  add    $0x30,%ecx
  mov    %cl,(%rdx)
  mov    %eax,%ecx
  test   %r9d,%r9d
  je     L111
  mov    %eax,%eax
  imul   %rdi,%rax
  shr    $0x23,%rax
  lea    (%rax,%rax,4),%r11d
  add    %r11d,%r11d
  sub    %r11d,%ecx
  add    $0x30,%ecx
  mov    %cl,0x1(%rdx)
  mov    %eax,%ecx
  cmp    $0x1,%r9d
  je     L111
  mov    %eax,%eax
  imul   %rdi,%rax
  shr    $0x23,%rax
  lea    (%rax,%rax,4),%r11d
  add    %r11d,%r11d
  sub    %r11d,%ecx
  add    $0x30,%ecx
  mov    %cl,0x2(%rdx)
  mov    %eax,%ecx
  cmp    $0x2,%r9d
  je     L111
  mov    %eax,%eax
  imul   %rdi,%rax
  shr    $0x23,%rax
  lea    (%rax,%rax,4),%r11d
  add    %r11d,%r11d
  sub    %r11d,%ecx
  add    $0x30,%ecx
  mov    %cl,0x3(%rdx)
  mov    %eax,%ecx
  cmp    $0x3,%r9d
  je     L111
  mov    %eax,%eax
  imul   %rdi,%rax
  shr    $0x23,%rax
  lea    (%rax,%rax,4),%edi
  add    %edi,%edi
  sub    %edi,%ecx
  add    $0x30,%ecx
  mov    %cl,0x4(%rdx)
  mov    %eax,%ecx
L111:
  lea    0x1(%r8),%eax
  cltq
  add    %rsi,%rax
  jmp    L10
L176:
  mov    $0x7,%r11d
L49:
  mov    $0xcccccccd,%r9d
  mov    %edi,%eax
  lea    -0x2(%r11),%r8d
  imul   %r9,%rax
  shr    $0x23,%rax
  mov    %eax,%ecx
  lea    (%rax,%rax,4),%edx
  imul   %r9,%rcx
  add    %edx,%edx
  lea    -0x4(%r11),%r9d
  sub    %edx,%edi
  lea    0x2(%rsi),%rdx
  add    $0x30,%edi
  shr    $0x23,%rcx
  mov    %dil,(%rsi)
  lea    (%rcx,%rcx,4),%edi
  add    %edi,%edi
  sub    %edi,%eax
  add    $0x30,%eax
  mov    %al,0x1(%rsi)
  cmp    $0x3,%r11d
  jne    L104
  jmp    L111
L12:
  mov    $0x6,%r11d
  jmp    L49
L98:
  mov    $0x5,%r11d
  jmp    L49
L172:
  mov    $0x4,%r11d
  jmp    L49
L169:
  mov    $0x3,%r11d
  jmp    L49
L142:
  mov    %ecx,%eax
  imul   %rax,%rdx
  mov    %ecx,%eax
  shr    $0x23,%rdx
  lea    (%rdx,%rdx,4),%edi
  mov    %edx,%ecx
  add    %edi,%edi
  sub    %edi,%eax
  add    $0x30,%eax
  mov    %al,(%rsi)
  jmp    L111
L171:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void write_sfix7(int32_t v) {
  char s[20], *s1, *s2, c;
  int i;
  s1 = s;
  if (v < 0) {
    *s1++ = '-';
    v = -v;
  }
  s2 = s1;
  i = 7;
  while ((v % 10) == 0 && i > 0) {
    v /= 10;
    i--;
  }
  while (--i >= 0) {
    *s2++ = (v % 10) + '0';
    v /= 10;
  }
  *s2++ = '.';
  do {
    *s2++ = (v % 10) + '0';
    v /= 10;
  } while (v > 0);
  *s2-- = 0;
  while (s2 > s1) {
    c = *s1;
    *s1 = *s2;
    *s2 = c;
    s1++;
    s2--;
  }
  write_str(s);
}
```