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

```asm
<remove_trailing_zeros>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
L176:
  mov    %rbx,%rdi
  call   <strlen@plt>
  movslq %eax,%r9
  test   %r9d,%r9d
  jle    L189
  mov    %rbx,%rcx
  xor    %edi,%edi
  xor    %r10d,%r10d
  xor    %r8d,%r8d
  xor    %eax,%eax
  jmp    L50
  nopl   0x0(%rax,%rax,1)
L226:
  test   %edi,%edi
  jne    L34
  cmp    $0x2e,%dl
  je     L43
  xor    %r10d,%r10d
  xor    %r8d,%r8d
L206:
  add    $0x1,%eax
  add    $0x1,%rcx
  cmp    %eax,%r9d
  je     L7
L50:
  movzbl (%rcx),%edx
  lea    -0x30(%rdx),%esi
  cmp    $0x9,%sil
  ja     L226
  cmp    $0x30,%dl
  je     L65
  add    $0x1,%eax
  mov    $0x1,%r8d
  xor    %edi,%edi
  add    $0x1,%rcx
  cmp    %eax,%r9d
  jne    L50
L7:
  test   %edi,%edi
  je     L127
  mov    %r9d,%edx
  sub    %edi,%edx
  movslq %edx,%rdx
  cmpb   $0x2e,-0x1(%rbx,%rdx,1)
  je     L122
L147:
  movslq %edi,%rdi
  mov    %rbx,%rsi
  movslq %eax,%rdx
  sub    %rdi,%rsi
  nopl   0x0(%rax,%rax,1)
L210:
  movzbl (%rbx,%rdx,1),%ecx
  mov    %cl,(%rsi,%rdx,1)
  add    $0x1,%rdx
  cmp    %edx,%eax
  jge    L210
L127:
  cmp    $0x1,%r9d
  jle    L189
  cmpb   $0x2f,-0x2(%rbx,%r9,1)
  jle    L189
  cltq
  cmpb   $0x39,(%rbx,%rax,1)
  jg     L189
  lea    -0x1(%rbx,%r9,1),%rax
  cmpb   $0x2e,(%rax)
  jne    L189
  movb   $0x0,(%rax)
L189:
  pop    %rbx
  ret
  nopl   0x0(%rax)
L65:
  mov    $0x1,%r8d
  test   %r10d,%r10d
  je     L206
  add    $0x1,%edi
  mov    %r10d,%r8d
  jmp    L206
  nopw   0x0(%rax,%rax,1)
L43:
  test   %r8d,%r8d
  cmovne %r8d,%r10d
  jmp    L206
  nopl   0x0(%rax)
L34:
  mov    %eax,%ecx
  sub    %edi,%ecx
  movslq %ecx,%rcx
  cmpb   $0x2e,-0x1(%rbx,%rcx,1)
  jne    L94
  add    $0x1,%edi
L94:
  movslq %edi,%rdi
  mov    %rbx,%rcx
  cltq
  sub    %rdi,%rcx
  jmp    L20
  cs nopw 0x0(%rax,%rax,1)
L162:
  movzbl (%rbx,%rax,1),%edx
L20:
  mov    %dl,(%rcx,%rax,1)
  add    $0x1,%rax
  cmp    %eax,%r9d
  jge    L162
  jmp    L176
L122:
  add    $0x1,%edi
  jmp    L147
```

assistant: ```c
void remove_trailing_zeros(char *str) {
  int i, j, len, numberfound, dotfound, decimalzerofound, trailingzerofound = 1;
  while (trailingzerofound) {
    numberfound = 0;
    dotfound = 0;
    decimalzerofound = 0;
    trailingzerofound = 0;
    len = strlen(str);
    for (i = 0; i < len; i++) {
      if ((str[i] < '0') || (str[i] > '9')) {
        if (decimalzerofound) {
          if (str[i - decimalzerofound - 1] == '.') {
            decimalzerofound++;
          }
          for (j = i; j < (len + 1); j++) {
            str[j - decimalzerofound] = str[j];
          }
          trailingzerofound = 1;
          break;
        }
        if (str[i] != '.') {
          numberfound = 0;
          dotfound = 0;
          decimalzerofound = 0;
        }
      } else {
        numberfound = 1;
        if (str[i] > '0') {
          decimalzerofound = 0;
        }
      }
      if ((str[i] == '.') && numberfound) {
        dotfound = 1;
      }
      if ((str[i] == '0') && dotfound) {
        decimalzerofound++;
      }
    }
  }
  if (decimalzerofound) {
    if (str[i - decimalzerofound - 1] == '.') {
      decimalzerofound++;
    }
    for (j = i; j < (len + 1); j++) {
      str[j - decimalzerofound] = str[j];
    }
  }
  if (len > 1) {
    if (!((str[len - 2] < '0') || (str[i] > '9'))) {
      if (str[len - 1] == '.') {
        str[len - 1] = 0;
      }
    }
  }
}
```