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

```asm
<initialPurchase>:
  endbr64
  push   %r15
  lea    D14(%rip),%r15
  push   %r14
  lea    D20(%rip),%r14
  push   %r13
  lea    D47(%rip),%r13
  push   %r12
  mov    $0x2bc,%r12d
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    $0x1,%ebx
  lea    -0x1(%rbx),%eax
  sub    $0x8,%rsp
  cmp    $0x3,%eax
  je     L58
L35:
  jg     L30
  cmp    $0x1,%eax
  je     L98
  cmp    $0x2,%eax
  jne    L75
  lea    D3(%rip),%rdi
  call   <puts@plt>
  nopl   (%rax)
L70:
  mov    $0x2,%edi
  call   <spendThisMuch@plt>
  test   %eax,%eax
  js     L70
  mov    %eax,0x8(%rbp)
  sub    %eax,%r12d
L148:
  add    $0x1,%ebx
  lea    -0x1(%rbx),%eax
  cmp    $0x3,%eax
  jne    L35
L58:
  mov    %r15,%rdi
  call   <puts@plt>
  nopw   0x0(%rax,%rax,1)
L86:
  mov    $0x3,%edi
  call   <spendThisMuch@plt>
  test   %eax,%eax
  js     L86
  mov    %eax,0xc(%rbp)
  sub    %eax,%r12d
  jmp    L148
  cs nopw 0x0(%rax,%rax,1)
L30:
  cmp    $0x4,%eax
  jne    L75
  lea    D42(%rip),%rdi
  call   <puts@plt>
  nopl   0x0(%rax)
L60:
  mov    $0x4,%edi
  call   <spendThisMuch@plt>
  test   %eax,%eax
  js     L60
  mov    %eax,0x10(%rbp)
  sub    %eax,%r12d
L13:
  add    $0x8,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  xchg   %ax,%ax
L75:
  mov    %r14,%rdi
  call   <puts@plt>
  nopl   0x0(%rax,%rax,1)
L106:
  xor    %edi,%edi
  call   <spendThisMuch@plt>
  lea    -0xc8(%rax),%edx
  cmp    $0x64,%edx
  ja     L106
  mov    %eax,0x0(%rbp)
  sub    %eax,%r12d
  cmp    $0x5,%ebx
  jne    L148
  jmp    L13
  nopl   0x0(%rax,%rax,1)
L98:
  mov    %r13,%rdi
  call   <puts@plt>
L139:
  mov    $0x1,%edi
  call   <spendThisMuch@plt>
  test   %eax,%eax
  js     L139
  mov    %eax,0x4(%rbp)
  sub    %eax,%r12d
  jmp    L148
```

tool_calls: name: disassemble_data
arguments: tag: D14
datatype: string
name: disassemble_data
arguments: tag: D20
datatype: string
name: disassemble_data
arguments: tag: D47
datatype: string
name: disassemble_data
arguments: tag: D3
datatype: string
name: disassemble_data
arguments: tag: D42
datatype: string

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

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

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

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

tool: D42: 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;
}
```