user: Converte this assembly snippet into its equivalent C code:

```asm
<gdb_cmd_delete_breakpoint>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x28(%rbp)
  xor    %eax,%eax
  mov    %rsp,%r14
  test   %esi,%esi
  jle    L45
  mov    %rdi,%rbx
  cmpb   $0x2c,(%rdi)
  sete   %al
  movzbl %al,%eax
  add    %rax,%rbx
  lea    -0x40(%rbp),%r12
  mov    $0x10,%ecx
  mov    $0x2c,%edx
  mov    %rbx,%rsi
  mov    %r12,%rdi
  call   <util_cpy_substr@plt>
  cltq
  lea    0x1(%rbx,%rax,1),%r13
  mov    %r12,%rdi
  call   <util_hex_to_word@plt>
  mov    %eax,%ebx
  mov    %r13,%rdi
  call   <util_hex_to_word@plt>
  cmp    $0x2,%eax
  je     L98
  cmp    $0x4,%eax
  je     L112
  mov    $0x0,%eax
  call   <gdb_response_not_supported@plt>
L38:
  mov    %r14,%rsp
L51:
  mov    -0x28(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L145
  lea    -0x20(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %rbp
  ret
L45:
  lea    D36(%rip),%rbx
  mov    %rbx,%rdi
  call   <util_str_len@plt>
  mov    %eax,%esi
  mov    %rbx,%rdi
  call   <gdb_send_packet@plt>
  mov    %r14,%rsp
  jmp    L51
L98:
  movslq %ebx,%rdi
  mov    $0x2,%esi
  call   <dgb_unset_trap@plt>
  test   %eax,%eax
  je     L34
  lea    D60(%rip),%rbx
  cmp    $0x2,%eax
  je     L147
  lea    D59(%rip),%rbx
  cmp    $0x3,%eax
  je     L147
  cmp    $0x1,%eax
  lea    D26(%rip),%rbx
  lea    D36(%rip),%rax
  cmove  %rax,%rbx
L147:
  mov    %rbx,%rdi
  call   <util_str_len@plt>
  mov    %eax,%esi
  mov    %rbx,%rdi
  call   <gdb_send_packet@plt>
  jmp    L38
L34:
  lea    D98(%rip),%rbx
  mov    %rbx,%rdi
  call   <util_str_len@plt>
  mov    %eax,%esi
  mov    %rbx,%rdi
  call   <gdb_send_packet@plt>
  jmp    L38
L112:
  movslq %ebx,%rdi
  mov    $0x1,%esi
  call   <dgb_unset_trap@plt>
  test   %eax,%eax
  je     L40
  lea    D60(%rip),%rbx
  cmp    $0x2,%eax
  je     L90
  lea    D59(%rip),%rbx
  cmp    $0x3,%eax
  je     L90
  cmp    $0x1,%eax
  lea    D26(%rip),%rbx
  lea    D36(%rip),%rax
  cmove  %rax,%rbx
L90:
  mov    %rbx,%rdi
  call   <util_str_len@plt>
  mov    %eax,%esi
  mov    %rbx,%rdi
  call   <gdb_send_packet@plt>
  jmp    L38
L40:
  lea    D98(%rip),%rbx
  mov    %rbx,%rdi
  call   <util_str_len@plt>
  mov    %eax,%esi
  mov    %rbx,%rdi
  call   <gdb_send_packet@plt>
  jmp    L38
L145:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_tag: D36
datatype: string
name: parse_data
arguments: data_tag: D60
datatype: string
name: parse_data
arguments: data_tag: D59
datatype: string
name: parse_data
arguments: data_tag: D26
datatype: string
name: parse_data
arguments: data_tag: D98
datatype: string

tool: D36: E01

tool: D60: E02

tool: D59: E03

tool: D26: E04

tool: D98: OK

assistant: ```c
void gdb_cmd_delete_breakpoint(char *gdb_in_packet, int packet_len) {
  int len;
  uint32_t addr;
  uint32_t kind;
  uint32_t errval;
  char *err = "E01";
  char *okresp = "OK";
  const int scratch_len = 16;
  char scratchpad[scratch_len];
  if (packet_len < 1) {
    gdb_send_packet(err, util_str_len(err));
    return;
  }
  if (*gdb_in_packet == ',')
    gdb_in_packet++;
  len = util_cpy_substr(scratchpad, (char *)gdb_in_packet, ',', scratch_len);
  gdb_in_packet += len + 1;
  addr = util_hex_to_word(scratchpad);
  kind = util_hex_to_word((char *)gdb_in_packet);
  if (kind == 2) {
    if ((errval = dgb_unset_trap((void *)addr, 2)) != 0) {
      if (errval == 1)
        err = "E01";
      else if (errval == 2)
        err = "E02";
      else if (errval == 3)
        err = "E03";
      else
        err = "E04";
      gdb_send_packet(err, util_str_len(err));
    } else {
      gdb_send_packet(okresp, util_str_len(okresp));
    }
  } else if (kind == 4) {
    if ((errval = dgb_unset_trap((void *)addr, 1)) != 0) {
      if (errval == 1)
        err = "E01";
      else if (errval == 2)
        err = "E02";
      else if (errval == 3)
        err = "E03";
      else
        err = "E04";
      gdb_send_packet(err, util_str_len(err));
    } else {
      gdb_send_packet(okresp, util_str_len(okresp));
    }
  } else {
    gdb_response_not_supported();
  }
}
```