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

```asm
<_http_trim>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  movl   $0x0,-0x8(%rbp)
  jmp    L85
L15:
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x9,%al
  jne    L178
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movb   $0x20,(%rax)
L178:
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0xd,%al
  je     L122
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0xa,%al
  jne    L166
L122:
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
L166:
  addl   $0x1,-0x8(%rbp)
L85:
  mov    -0x8(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jge    L116
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L15
L116:
  movl   $0x0,-0x8(%rbp)
  jmp    L120
L50:
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  jne    L59
  addl   $0x1,-0x8(%rbp)
L120:
  mov    -0x8(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jge    L128
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L50
  jmp    L128
L59:
  nop
L128:
  movl   $0x0,-0x4(%rbp)
  jmp    L179
L174:
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    -0x4(%rbp),%edx
  movslq %edx,%rcx
  mov    -0x18(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  addl   $0x1,-0x8(%rbp)
  addl   $0x1,-0x4(%rbp)
L179:
  mov    -0x8(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jge    L24
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L174
L24:
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  subl   $0x1,-0x8(%rbp)
  jmp    L163
L105:
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  jne    L71
  subl   $0x1,-0x8(%rbp)
L163:
  cmpl   $0x0,-0x8(%rbp)
  jg     L105
  jmp    L46
L71:
  nop
L46:
  addl   $0x1,-0x8(%rbp)
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  nop
  pop    %rbp
  ret
```

assistant: ```c
void _http_trim(char *string, const int max_len) {
  int i, j;
  for (i = 0; i < max_len && string[i] != '\0'; ++i) {
    if (string[i] == '\t') {
      string[i] = ' ';
    }
    if (string[i] == '\r' || string[i] == '\n') {
      string[i] = '\0';
    }
  }
  for (i = 0; i < max_len && string[i] != '\0'; ++i) {
    if (!(string[i] == ' '))
      break;
  }
  for (j = 0; i < max_len && string[i] != '\0'; ++i, j++) {
    string[j] = string[i];
  }
  string[j] = '\0';
  for (--i; i > 0; --i) {
    if (!(string[i] == ' '))
      break;
  }
  string[++i] = '\0';
}
```