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

```asm
<initialPurchase>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%r13
  mov    $0x1,%ebx
  mov    $0x2bc,%r12d
  lea    D27(%rip),%rbp
  lea    D18(%rip),%r15
  lea    D12(%rip),%r14
  jmp    L108
  lea    D5(%rip),%rdi
  call   <puts@plt>
L110:
  mov    $0x0,%edi
  call   <spendThisMuch@plt>
  lea    -0xc8(%rax),%edx
  cmp    $0x64,%edx
  ja     L110
  mov    %eax,0x0(%r13)
  sub    %eax,%r12d
L4:
  add    $0x1,%ebx
L108:
  lea    -0x1(%rbx),%eax
  cmp    $0x4,%eax
  ja     L72
  mov    %eax,%eax
  movslq 0x0(%rbp,%rax,4),%rax
  add    %rbp,%rax
  notrack jmp *%rax
  lea    D42(%rip),%rdi
  call   <puts@plt>
L8:
  mov    $0x1,%edi
  call   <spendThisMuch@plt>
  test   %eax,%eax
  js     L8
  mov    %eax,0x4(%r13)
  sub    %eax,%r12d
  jmp    L4
  mov    %r14,%rdi
  call   <puts@plt>
L34:
  mov    $0x2,%edi
  call   <spendThisMuch@plt>
  test   %eax,%eax
  js     L34
  mov    %eax,0x8(%r13)
  sub    %eax,%r12d
  jmp    L4
  mov    %r15,%rdi
  call   <puts@plt>
L82:
  mov    $0x3,%edi
  call   <spendThisMuch@plt>
  test   %eax,%eax
  js     L82
  mov    %eax,0xc(%r13)
  sub    %eax,%r12d
  jmp    L4
  lea    D44(%rip),%rdi
  call   <puts@plt>
L86:
  mov    $0x4,%edi
  call   <spendThisMuch@plt>
  test   %eax,%eax
  js     L86
  mov    %eax,0x10(%r13)
  sub    %eax,%r12d
L13:
  mov    %r12d,%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L72:
  cmp    $0x4,%ebx
  jle    L4
  jmp    L13
```

tool_calls: name: disassemble_data
arguments: data_label: D18
datatype: string
name: disassemble_data
arguments: data_label: D12
datatype: string
name: disassemble_data
arguments: data_label: D5
datatype: string
name: disassemble_data
arguments: data_label: D42
datatype: string
name: disassemble_data
arguments: data_label: D44
datatype: string

tool: D18: HOW MUCH DO YOU WANT TO SPEND ON FOOD

tool: D12: HOW MUCH DO YOU WANT TO SPEND ON CLOTHING

tool: D5: HOW MUCH DO YOU WANT TO SPEND ON YOUR OXEN TEAM

tool: D42: HOW MUCH DO YOU WANT TO SPEND ON AMMUNITION

tool: D44: HOW MUCH DO YOU WANT TO SPEND ON MISCELANEOUS SUPPLIES

assistant: ```c
int initialPurchase(int a[]) {
  int moneySpent;
  int money = 700;
  for (int supply = 0; supply <= 4; supply++) {
    switch (supply) {
    case 0:
      puts("HOW MUCH DO YOU WANT TO SPEND ON YOUR OXEN TEAM");
      do {
        moneySpent = spendThisMuch(0);
      } while (moneySpent < 200 || moneySpent > 300);
      a[0] = moneySpent;
      money -= moneySpent;
      break;
    case 1:
      puts("HOW MUCH DO YOU WANT TO SPEND ON AMMUNITION");
      do {
        moneySpent = spendThisMuch(1);
      } while (moneySpent < 0);
      a[1] = moneySpent;
      money -= moneySpent;
      break;
    case 2:
      puts("HOW MUCH DO YOU WANT TO SPEND ON CLOTHING");
      do {
        moneySpent = spendThisMuch(2);
      } while (moneySpent < 0);
      a[2] = moneySpent;
      money -= moneySpent;
      break;
    case 3:
      puts("HOW MUCH DO YOU WANT TO SPEND ON FOOD");
      do {
        moneySpent = spendThisMuch(3);
      } while (moneySpent < 0);
      a[3] = moneySpent;
      money -= moneySpent;
      break;
    case 4:
      puts("HOW MUCH DO YOU WANT TO SPEND ON MISCELANEOUS SUPPLIES");
      do {
        moneySpent = spendThisMuch(4);
      } while (moneySpent < 0);
      a[4] = moneySpent;
      money -= moneySpent;
      break;
    }
  }
  return money;
}
```