user: What would the C source look like for the assembly code provided here?

```asm
<useitemcombat>:
  endbr64
  push   %r15
  push   %r14
  mov    %rdi,%r14
  lea    D89(%rip),%rdi
  push   %r13
  mov    %rsi,%r13
  push   %r12
  mov    %r9,%r12
  push   %rbp
  mov    %rcx,%rbp
  push   %rbx
  mov    %rdx,%rbx
  sub    $0x48,%rsp
  mov    %r8,0x8(%rsp)
  lea    0x1c(%rsp),%r15
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  movl   $0xffffffff,0x1c(%rsp)
  call   <puts@plt>
  mov    %r15,%rdi
  call   <getint@plt>
  mov    0x1c(%rsp),%eax
  test   %eax,%eax
  je     L72
  cmp    $0x1,%eax
  je     L110
L35:
  lea    D46(%rip),%rdi
  call   <puts@plt>
L44:
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L10
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L110:
  mov    %rbp,%rdi
  call   <checkpositiveinv@plt>
  test   %eax,%eax
  je     L150
  addl   $0x3,(%r12)
  mov    %rbp,%rdi
  mov    $0x1,%esi
  call   <removeslave@plt>
  lea    D28(%rip),%rdi
  call   <puts@plt>
  jmp    L44
  nopl   0x0(%rax,%rax,1)
L72:
  lea    D18(%rip),%rdi
  call   <puts@plt>
  mov    %r15,%rdi
  call   <getint@plt>
  movslq 0x1c(%rsp),%rax
  cmp    $0x9,%eax
  ja     L35
  mov    (%rbx,%rax,4),%esi
  test   %esi,%esi
  je     L35
  cmp    $0xd,%esi
  jg     L95
  mov    0x0(%r13),%eax
  cmp    %eax,(%r14)
  je     L25
  lea    0x20(%rsp),%rbp
  mov    %rbp,%rdi
  call   <nameitem@plt>
  mov    %rbp,%rsi
  lea    D79(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  movslq 0x1c(%rsp),%rax
  mov    (%r14),%edi
  movslq (%rbx,%rax,4),%rax
  mov    %rax,%rsi
  imul   $0x4ec4ec4f,%rax,%rax
  mov    %esi,%edx
  sar    $0x1f,%edx
  sar    $0x22,%rax
  sub    %edx,%eax
  lea    (%rax,%rax,2),%edx
  lea    (%rax,%rdx,4),%eax
  sub    %eax,%esi
  add    0x0(%r13),%esi
  add    $0x1,%esi
  call   <min@plt>
  mov    %eax,0x0(%r13)
  movslq 0x1c(%rsp),%rax
  movl   $0x0,(%rbx,%rax,4)
  jmp    L44
  nopl   0x0(%rax,%rax,1)
L150:
  lea    D13(%rip),%rdi
  call   <puts@plt>
  jmp    L44
  nopl   0x0(%rax)
L95:
  cmp    $0x1a,%esi
  jle    L55
  cmp    $0x27,%esi
  jle    L61
  lea    0x20(%rsp),%rbp
  mov    %rbp,%rdi
  call   <nameitem@plt>
  mov    %rbp,%rsi
  lea    D79(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  movslq 0x1c(%rsp),%rax
  lea    (%rbx,%rax,4),%rcx
  mov    0x8(%rsp),%rbx
  movslq (%rcx),%rdx
  mov    %rdx,%rax
  imul   $0x4ec4ec4f,%rdx,%rdx
  mov    %eax,%esi
  sar    $0x1f,%esi
  sar    $0x22,%rdx
  sub    %esi,%edx
  lea    (%rdx,%rdx,2),%esi
  lea    (%rdx,%rsi,4),%edx
  sub    %edx,%eax
  add    (%rbx),%eax
  add    $0x1,%eax
  mov    %eax,(%rbx)
  movl   $0x0,(%rcx)
  jmp    L44
  nopl   0x0(%rax)
L61:
  lea    D26(%rip),%rdi
  call   <puts@plt>
  jmp    L44
  nopl   0x0(%rax)
L25:
  lea    D53(%rip),%rdi
  call   <puts@plt>
  jmp    L44
  nopl   0x0(%rax)
L55:
  lea    D70(%rip),%rdi
  call   <puts@plt>
  jmp    L44
L10:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_label: D89
type_guessed: string
name: unpack_data
arguments: data_label: D46
type_guessed: string
name: unpack_data
arguments: data_label: D28
type_guessed: string
name: unpack_data
arguments: data_label: D18
type_guessed: string
name: unpack_data
arguments: data_label: D79
type_guessed: string
name: unpack_data
arguments: data_label: D13
type_guessed: string
name: unpack_data
arguments: data_label: D26
type_guessed: string
name: unpack_data
arguments: data_label: D53
type_guessed: string
name: unpack_data
arguments: data_label: D70
type_guessed: string

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

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

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

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

tool: D79: You use %s!


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

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

tool: D53: Not really useful now...

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

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");
  }
}
```