user: 请将以下的汇编代码转换成C语言代码:

```asm
<useitemcombat>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %rdx,-0x48(%rbp)
  mov    %rcx,-0x50(%rbp)
  mov    %r8,-0x58(%rbp)
  mov    %r9,-0x60(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0xffffffff,-0x24(%rbp)
  lea    D67(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    -0x24(%rbp),%rax
  mov    %rax,%rdi
  call   <getint@plt>
  mov    -0x24(%rbp),%eax
  test   %eax,%eax
  jne    L65
  lea    D12(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    -0x24(%rbp),%rax
  mov    %rax,%rdi
  call   <getint@plt>
  mov    -0x24(%rbp),%eax
  test   %eax,%eax
  js     L176
  mov    -0x24(%rbp),%eax
  cmp    $0x9,%eax
  jg     L176
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  jne    L134
L176:
  lea    D93(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  jmp    L108
L134:
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    $0xd,%eax
  jg     L79
  mov    -0x38(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x40(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,%edx
  jne    L97
  lea    D32(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  jmp    L108
L97:
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  lea    -0x20(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <nameitem@plt>
  lea    -0x20(%rbp),%rax
  mov    %rax,%rsi
  lea    D73(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x40(%rbp),%rax
  mov    (%rax),%esi
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  movslq %edx,%rax
  imul   $0x4ec4ec4f,%rax,%rax
  shr    $0x20,%rax
  sar    $0x2,%eax
  mov    %edx,%edi
  sar    $0x1f,%edi
  sub    %edi,%eax
  mov    %eax,%ecx
  mov    %ecx,%eax
  add    %eax,%eax
  add    %ecx,%eax
  shl    $0x2,%eax
  add    %ecx,%eax
  mov    %edx,%ecx
  sub    %eax,%ecx
  lea    (%rsi,%rcx,1),%eax
  lea    0x1(%rax),%edx
  mov    -0x38(%rbp),%rax
  mov    (%rax),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <min@plt>
  mov    -0x40(%rbp),%rdx
  mov    %eax,(%rdx)
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movl   $0x0,(%rax)
  jmp    L108
L79:
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    $0x1a,%eax
  jg     L12
  lea    D53(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  jmp    L108
L12:
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    $0x27,%eax
  jg     L51
  lea    D103(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  jmp    L108
L51:
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  lea    -0x20(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <nameitem@plt>
  lea    -0x20(%rbp),%rax
  mov    %rax,%rsi
  lea    D73(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x58(%rbp),%rax
  mov    (%rax),%esi
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  movslq %edx,%rax
  imul   $0x4ec4ec4f,%rax,%rax
  shr    $0x20,%rax
  sar    $0x2,%eax
  mov    %edx,%edi
  sar    $0x1f,%edi
  sub    %edi,%eax
  mov    %eax,%ecx
  mov    %ecx,%eax
  add    %eax,%eax
  add    %ecx,%eax
  shl    $0x2,%eax
  add    %ecx,%eax
  mov    %edx,%ecx
  sub    %eax,%ecx
  lea    (%rsi,%rcx,1),%eax
  lea    0x1(%rax),%edx
  mov    -0x58(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movl   $0x0,(%rax)
  jmp    L108
L65:
  mov    -0x24(%rbp),%eax
  cmp    $0x1,%eax
  jne    L22
  mov    -0x50(%rbp),%rax
  mov    %rax,%rdi
  call   <checkpositiveinv@plt>
  test   %eax,%eax
  jne    L27
  lea    D107(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  jmp    L108
L27:
  mov    -0x60(%rbp),%rax
  mov    (%rax),%eax
  lea    0x3(%rax),%edx
  mov    -0x60(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x50(%rbp),%rax
  mov    $0x1,%esi
  mov    %rax,%rdi
  call   <removeslave@plt>
  lea    D23(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  jmp    L108
L22:
  lea    D93(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
L108:
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L133
  call   <__stack_chk_fail@plt>
L133:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: tag: D67
data_type: string
name: unpack_data
arguments: tag: D12
data_type: string
name: unpack_data
arguments: tag: D93
data_type: string
name: unpack_data
arguments: tag: D32
data_type: string
name: unpack_data
arguments: tag: D73
data_type: string
name: unpack_data
arguments: tag: D53
data_type: string
name: unpack_data
arguments: tag: D103
data_type: string
name: unpack_data
arguments: tag: D107
data_type: string
name: unpack_data
arguments: tag: D23
data_type: string

tool: D67: Do you want to use an item or seek help from a prisoner?
[0]: Item
[1]: Prisoner

tool: D12: What item do you want to use?

tool: D93: Maybe you are a little too much excited for this fight!

tool: D32: Not really useful now...

tool: D73: You use %s!


tool: D53: Gems are nice, but not really useful in a fight!

tool: D103: If you want to do magic, maybe you have to cast a spell...

tool: D107: There aren't other adventures with you!

tool: D23: A prisoner join your fight for his freedom!

assistant: ```c
void useitemcombat(int *hpmax, int *hpnow, int *inv, int *slave, int *bonusnext, int *bonuscomb) {
  int k = -1;
  char s[20];
  printf("Do you want to use an item or seek help from a prisoner?\n[0]: Item\n[1]: Prisoner\n");
  getint(&k);
  if (k == 0) {
    printf("What item do you want to use?\n");
    getint(&k);
    if ((k < 0) || (k >= 10) || (*(inv + k) == 0)) {
      printf("Maybe you are a little too much excited for this fight!\n");
      return;
    } else if (*(inv + k) < 14) {
      if (*hpmax == *hpnow) {
        printf("Not really useful now...\n");
        return;
      }
      nameitem(s, *(inv + k));
      printf("You use %s!\n", s);
      *hpnow = min(*hpmax, *hpnow + (*(inv + k) % 13) + 1);
      *(inv + k) = 0;
    } else if (*(inv + k) < 27) {
      printf("Gems are nice, but not really useful in a fight!\n");
      return;
    } else if (*(inv + k) < 40) {
      printf("If you want to do magic, maybe you have to cast a spell...\n");
      return;
    } else {
      nameitem(s, *(inv + k));
      printf("You use %s!\n", s);
      *bonusnext = *bonusnext + (*(inv + k) % 13) + 1;
      *(inv + k) = 0;
    }
  } else if (k == 1) {
    if (!checkpositiveinv(slave)) {
      printf("There aren't other adventures with you!\n");
      return;
    } else {
      *bonuscomb = *bonuscomb + 3;
      removeslave(slave, 1);
      printf("A prisoner join your fight for his freedom!\n");
    }
  } else {
    printf("Maybe you are a little too much excited for this fight!\n");
  }
}
```