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

```asm
<get_final_message>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %rdi,-0x48(%rbp)
  movl   $0x0,-0x40(%rbp)
  mov    -0x48(%rbp),%rax
  lea    D7(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strtok@plt>
  mov    %rax,-0x38(%rbp)
  jmp    L39
L100:
  cmpl   $0x0,-0x40(%rbp)
  jne    L54
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <strdup@plt>
  mov    %rax,-0x30(%rbp)
  jmp    L22
L54:
  cmpl   $0x1,-0x40(%rbp)
  jne    L22
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <strdup@plt>
  mov    %rax,-0x28(%rbp)
L22:
  addl   $0x1,-0x40(%rbp)
  lea    D7(%rip),%rax
  mov    %rax,%rsi
  mov    $0x0,%edi
  call   <strtok@plt>
  mov    %rax,-0x38(%rbp)
L39:
  cmpq   $0x0,-0x38(%rbp)
  jne    L100
  mov    -0x30(%rbp),%rax
  lea    D93(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L77
  lea    D64(%rip),%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,%ebx
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  add    %ebx,%eax
  add    $0x2,%eax
  mov    %eax,-0x3c(%rbp)
  mov    -0x3c(%rbp),%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x20(%rbp)
  mov    -0x28(%rbp),%rcx
  mov    -0x18(%rbp),%rdx
  mov    -0x20(%rbp),%rax
  lea    D95(%rip),%rsi
  mov    %rax,%rdi
  call   <sprintf@plt>
  jmp    L26
L77:
  mov    -0x30(%rbp),%rax
  lea    D23(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L26
  mov    -0x28(%rbp),%rax
  lea    D40(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L103
  lea    D24(%rip),%rax
  mov    %rax,-0x20(%rbp)
  jmp    L26
L103:
  mov    -0x28(%rbp),%rax
  lea    D72(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L26
  lea    D53(%rip),%rax
  mov    %rax,-0x20(%rbp)
L26:
  mov    -0x20(%rbp),%rax
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: parse_data
arguments: data_tag: D7
data_type: string
name: parse_data
arguments: data_tag: D93
data_type: string
name: parse_data
arguments: data_tag: D64
data_type: string
name: parse_data
arguments: data_tag: D95
data_type: string
name: parse_data
arguments: data_tag: D23
data_type: string
name: parse_data
arguments: data_tag: D40
data_type: string
name: parse_data
arguments: data_tag: D24
data_type: string
name: parse_data
arguments: data_tag: D72
data_type: string
name: parse_data
arguments: data_tag: D53
data_type: string

tool: D7:  

tool: D93: 0

tool: D64: Sucesso (0): Resultado =

tool: D95: %s %s

tool: D23: 1

tool: D40: ER1

tool: D24: Erro (1): Cod ER1 Divisao por zero

tool: D72: ER2

tool: D53: Erro (1): Cod ER2 Erro inesperado

assistant: ```c
char *get_final_message(char *bufin) {
  char *p;
  int i = 0;
  char *status;
  char *result;
  for (p = strtok(bufin, " "); p != NULL; p = strtok(NULL, " ")) {
    if (i == 0) {
      status = strdup(p);
    } else if (i == 1) {
      result = strdup(p);
    }
    i++;
  }
  char *final_message;
  if (!strcmp(status, "0")) {
    char *message = "Sucesso (0): Resultado =";
    int total_size = strlen(message) + strlen(result) + 2;
    final_message = malloc(total_size * sizeof(char));
    sprintf(final_message, "%s %s", message, result);
  } else if (!strcmp(status, "1")) {
    if (!strcmp(result, "ER1"))
      final_message = "Erro (1): Cod ER1 Divisao por zero";
    else if (!strcmp(result, "ER2"))
      final_message = "Erro (1): Cod ER2 Erro inesperado";
  }
  return final_message;
}
```