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

```asm
<json_field>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %rcx,%r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rdi,%rbp
  mov    %rsi,%rdi
  push   %rbx
  sub    $0x28,%rsp
  mov    %edx,0xc(%rsp)
  call   <strlen@plt>
  test   %rbp,%rbp
  je     L309
  mov    %rbp,%rdi
  mov    %rax,%r14
  call   <strlen@plt>
  cmp    %r14,%rax
  jbe    L309
  xor    %ebx,%ebx
  cmpb   $0x0,0x0(%rbp,%r14,1)
  lea    0x0(%rbp,%r14,1),%r9
  jne    L305
  jmp    L309
  nopl   (%rax)
L164:
  lea    (%r14,%rdx,1),%rcx
  lea    0x0(%rbp,%rcx,1),%r15
  movzbl (%r15),%esi
  cmp    $0x22,%al
  je     L208
L242:
  mov    %rdx,%rbx
  cmpb   $0x0,(%r9,%rbx,1)
  je     L309
L305:
  movzbl 0x0(%rbp,%rbx,1),%eax
  lea    0x1(%rbx),%rdx
  cmp    $0x5c,%al
  jne    L164
  cmpb   $0x0,0x1(%rbp,%rbx,1)
  je     L242
L152:
  add    $0x2,%rbx
  cmpb   $0x0,(%r9,%rbx,1)
  jne    L305
  nopw   0x0(%rax,%rax,1)
L309:
  movq   $0x0,0x0(%r13)
L44:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L208:
  lea    0x0(%rbp,%rdx,1),%rdi
  cmpb   $0x3a,(%rdi)
  je     L242
  cmp    $0x22,%sil
  jne    L152
  movb   $0x0,(%r15)
  mov    %r12,%rsi
  mov    %r9,0x18(%rsp)
  mov    %rcx,0x10(%rsp)
  call   <strcmp@plt>
  movb   $0x22,(%r15)
  mov    0x10(%rsp),%rcx
  test   %rax,%rax
  mov    0x18(%rsp),%r9
  jne    L152
  cmpb   $0x3a,0x1(%rbp,%rcx,1)
  jne    L152
  cmpb   $0x0,0xc(%rsp)
  jne    L133
  lea    0x2(%rbp,%rcx,1),%rbp
  cmpb   $0x2d,0x0(%rbp)
  sete   %bl
  sete   %dl
  movzbl %bl,%ebx
  movzbl 0x0(%rbp,%rbx,1),%eax
  sub    $0x30,%eax
  cmp    $0x9,%al
  ja     L283
  nopl   0x0(%rax)
L298:
  add    $0x1,%rbx
  movzbl 0x2(%r15,%rbx,1),%eax
  sub    $0x30,%eax
  cmp    $0x9,%al
  jbe    L298
L283:
  test   %rbx,%rbx
  je     L309
  cmp    $0x1,%rbx
  jne    L37
  test   %dl,%dl
  jne    L309
L37:
  lea    0x1(%rbx),%edi
L223:
  call   <malloc@plt>
  mov    %rbx,%rdx
  mov    %rbp,%rsi
  mov    %rax,0x0(%r13)
  mov    %rax,%rdi
  call   <strncpy@plt>
  mov    0x0(%r13),%rax
  movb   $0x0,(%rax,%rbx,1)
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L133:
  cmpb   $0x1,0xc(%rsp)
  je     L73
  cmpb   $0x2,0xc(%rsp)
  jne    L44
  lea    0x2(%rcx),%r12
  xor    %eax,%eax
  xor    %ebx,%ebx
  jmp    L176
  nopl   0x0(%rax)
L168:
  cmp    $0x7d,%dl
  sete   %dl
  movzbl %dl,%edx
  sub    %rdx,%rax
L83:
  add    $0x1,%rbx
  test   %rax,%rax
  je     L95
L176:
  movzbl 0x2(%r15,%rbx,1),%edx
  cmp    $0x7b,%dl
  jne    L168
  add    $0x1,%rax
  jmp    L83
L73:
  cmpb   $0x22,0x2(%rbp,%rcx,1)
  jne    L309
  lea    0x3(%rbp,%rcx,1),%rbp
  movzbl 0x0(%rbp),%eax
  cmp    $0x22,%al
  je     L155
  xor    %ebx,%ebx
L56:
  cmp    $0x5c,%al
  sete   %al
  movzbl %al,%eax
  lea    0x1(%rbx,%rax,1),%rbx
  movzbl 0x0(%rbp,%rbx,1),%eax
  cmp    $0x22,%al
  jne    L56
  jmp    L37
L95:
  lea    0x1(%rbx),%edi
  call   <malloc@plt>
  lea    0x0(%rbp,%r12,1),%rsi
  mov    %rbx,%rdx
  mov    %rax,0x0(%r13)
  mov    %rax,%rdi
  call   <strncpy@plt>
  mov    0x0(%r13),%rax
  movb   $0x0,(%rax,%rbx,1)
  jmp    L44
L155:
  mov    $0x1,%edi
  xor    %ebx,%ebx
  jmp    L223
```

assistant: ```c
void json_field(char *full_message, const char *field, char type, char **value) {
  size_t i = 0, j = 0, nest_lv = 0, len = strlen(field);
  if (full_message == NULL || strlen(full_message) <= len) {
    *value = NULL;
    return;
  }
  for (i = 0; full_message[len + i] != '\0'; i++)
    if (full_message[i] == '\\' && full_message[i + 1] != '\0')
      i++;
    else if (full_message[i] == '"' && full_message[i + 1] != ':') {
      i++;
      if (full_message[len + i] == '"') {
        full_message[len + i] = '\0';
        if (strcmp(&full_message[i], field) != 0)
          full_message[len + i] = '"';
        else {
          full_message[len + i] = '"';
          if (full_message[len + i + 1] == ':')
            break;
        }
      }
    }
  if (full_message[len + i] == '\0')
    *value = NULL;
  else if (type == 0) {
    j = 0;
    if (full_message[len + i + 2] == '-')
      j++;
    while (1)
      if ((full_message[len + i + 2 + j] >= '0') && (full_message[len + i + 2 + j] <= '9'))
        j++;
      else
        break;
    if (j == 0 || (full_message[len + i + 2] == '-' && j == 1)) {
      *value = NULL;
      return;
    }
    *value = (char *)malloc(sizeof(char) * (j + 1));
    strncpy(*value, &full_message[len + i + 2], j);
    (*value)[j] = '\0';
  } else if (type == 1) {
    if (full_message[len + i + 2] != '"') {
      *value = NULL;
      return;
    }
    for (j = 0; full_message[len + i + j + 3] != '"'; j++)
      if (full_message[len + i + j + 3] == '\\')
        j++;
    *value = (char *)malloc(sizeof(char) * (j + 1));
    strncpy(*value, &full_message[len + i + 3], j);
    (*value)[j] = '\0';
  } else if (type == 2) {
    do {
      if (full_message[len + i + 2 + j] == '{')
        nest_lv++;
      else if (full_message[len + i + 2 + j] == '}')
        nest_lv--;
      j++;
    } while (nest_lv > 0);
    if (j == 0)
      *value = NULL;
    else {
      *value = malloc(sizeof(char) * (j + 1));
      strncpy(*value, &full_message[len + i + 2], j);
      (*value)[j] = '\0';
    }
  }
  return;
}
```