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

```asm
<trie_insert>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %rdx,-0x48(%rbp)
  movw   $0x0,-0x24(%rbp)
  mov    -0x40(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %ax,-0x22(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <trie_root@plt>
  mov    %rax,-0x20(%rbp)
  cmpq   $0x0,-0x20(%rbp)
  jne    L31
  mov    -0x40(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <tolower@plt>
  movsbl %al,%eax
  mov    %eax,%edi
  call   <trienode_alloc@plt>
  mov    %rax,-0x20(%rbp)
  mov    -0x20(%rbp),%rdx
  mov    -0x38(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <trie_set_root@plt>
L31:
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <trienode_key@plt>
  mov    %rax,%rbx
  movzwl -0x24(%rbp),%edx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <tolower@plt>
  cmp    %rax,%rbx
  jne    L26
  movzwl -0x24(%rbp),%eax
  add    $0x1,%eax
  mov    %ax,-0x24(%rbp)
  movzwl -0x24(%rbp),%eax
  cmp    -0x22(%rbp),%ax
  jae    L79
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <trienode_next@plt>
  test   %rax,%rax
  jne    L68
  movzwl -0x24(%rbp),%edx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <trienode_alloc@plt>
  mov    %rax,%rdx
  mov    -0x20(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <trienode_set_next@plt>
L68:
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <trienode_next@plt>
  mov    %rax,-0x20(%rbp)
  jmp    L31
L26:
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <trienode_sibling@plt>
  test   %rax,%rax
  jne    L53
  movzwl -0x24(%rbp),%edx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <trienode_alloc@plt>
  mov    %rax,%rdx
  mov    -0x20(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <trienode_set_sibling@plt>
L53:
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <trienode_sibling@plt>
  mov    %rax,-0x20(%rbp)
  jmp    L31
L79:
  nop
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <trienode_values@plt>
  test   %eax,%eax
  jne    L55
  mov    D5(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,%edi
  call   <list_alloc@plt>
  mov    %eax,%edx
  mov    -0x20(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <trienode_set_values@plt>
L55:
  mov    -0x48(%rbp),%rax
  mov    %rax,%rdi
  call   <strdup@plt>
  mov    %eax,%edi
  call   <listnode_alloc@plt>
  mov    %rax,-0x18(%rbp)
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <trienode_values@plt>
  mov    %eax,%edx
  mov    -0x18(%rbp),%rax
  mov    %rax,%rsi
  mov    %edx,%edi
  call   <list_append@plt>
  nop
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
void trie_insert(struct Trie *trie, char *keys, char *value) {
  unsigned short key_idx = 0;
  unsigned short key_len = strlen(keys);
  struct TrieNode *node = trie_root(trie);
  if (!node) {
    node = trienode_alloc(tolower(keys[0]));
    trie_set_root(trie, node);
  }
  for (;;) {
    if (trienode_key(node) == tolower(keys[key_idx])) {
      key_idx++;
      if (key_idx >= key_len)
        break;
      else {
        if (!trienode_next(node))
          trienode_set_next(node, trienode_alloc(keys[key_idx]));
        node = trienode_next(node);
      }
    } else {
      if (!trienode_sibling(node))
        trienode_set_sibling(node, trienode_alloc(keys[key_idx]));
      node = trienode_sibling(node);
    }
  }
  if (!trienode_values(node))
    trienode_set_values(node, list_alloc(free));
  struct ListNode *new_value = listnode_alloc(strdup(value));
  list_append(trienode_values(node), new_value);
  return;
}
```