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

```asm
<btr>:
  endbr64
  push   %r15
  push   %r14
  mov    %edx,%r14d
  push   %r13
  push   %r12
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  sub    $0x38,%rsp
  mov    %ecx,0x8(%rsp)
  mov    %r8d,0xc(%rsp)
  cmp    $0x4,%edi
  je     L60
  mov    0x78(%rsp),%edx
  test   %edx,%edx
  js     L20
  mov    %r8d,%eax
  add    %eax,%eax
  mov    %eax,0x24(%rsp)
  js     L20
  mov    0x70(%rsp),%esi
  add    $0x1,%eax
  add    0x70(%rsp),%r9d
  mov    %edi,%r13d
  mov    0x80(%rsp),%ecx
  mov    %eax,0x2c(%rsp)
  mov    %r14d,%r12d
  mov    0x90(%rsp),%eax
  add    0x88(%rsp),%eax
  mov    %r9d,0x18(%rsp)
  lea    (%rsi,%rcx,2),%esi
  mov    %eax,0x14(%rsp)
  mov    0xa0(%rsp),%eax
  mov    %esi,0x28(%rsp)
  add    0x98(%rsp),%eax
  lea    0x0(,%r14,4),%esi
  mov    %esi,0x10(%rsp)
  movl   $0x0,0x20(%rsp)
  mov    %eax,0x1c(%rsp)
  nopl   (%rax)
L56:
  mov    0x20(%rsp),%eax
  mov    0x24(%rsp),%r15d
  xor    %ebx,%ebx
  mov    0x28(%rsp),%r14d
  sub    %eax,%r15d
  add    %eax,%r14d
  mov    0x90(%rsp),%eax
  test   %eax,%eax
  js     L112
  mov    %r12d,%eax
  mov    %r14d,%r12d
  mov    %eax,%r14d
  jmp    L37
  nopl   0x0(%rax,%rax,1)
L121:
  test   $0x3,%r12b
  je     L98
  mov    %r12d,%edx
  sar    $0x1f,%edx
  shr    $0x1e,%edx
  lea    (%r12,%rdx,1),%ecx
  and    $0x3,%ecx
  sub    %ecx,%edx
  add    $0x4,%edx
  cmp    0xa0(%rsp),%edx
  jle    L29
L98:
  mov    0xa8(%rsp),%esi
  mov    %r14d,%r8d
  mov    %r12d,%edx
  mov    %r13d,%edi
  push   %rsi
  mov    0x24(%rsp),%ecx
  mov    %ebp,%esi
  push   %rcx
  mov    %r15d,%ecx
  push   $0x0
  push   %rax
  push   %rbx
  mov    0xa8(%rsp),%eax
  push   %rax
  mov    0xa8(%rsp),%eax
  push   %rax
  mov    0x50(%rsp),%eax
  push   %rax
  push   $0x0
  mov    0x54(%rsp),%eax
  push   %rax
  mov    0x58(%rsp),%r9d
  call   <buy@plt>
  add    $0x50,%rsp
L33:
  add    $0x1,%ebx
  add    $0x1,%r12d
  cmp    %ebx,0x90(%rsp)
  jl     L31
L37:
  mov    0xa0(%rsp),%edx
  mov    0x14(%rsp),%eax
  add    %r12d,%edx
  sub    %ebx,%eax
  cmp    %edx,0x10(%rsp)
  jg     L121
  mov    0xa8(%rsp),%esi
  mov    %r14d,%r8d
  mov    %r15d,%ecx
  add    $0x1,%r12d
  push   %rsi
  mov    0xa0(%rsp),%edi
  mov    %ebp,%esi
  push   %rdi
  mov    %r13d,%edi
  push   $0x0
  push   %rax
  push   %rbx
  mov    0xa8(%rsp),%eax
  add    $0x1,%ebx
  push   %rax
  mov    0xa8(%rsp),%eax
  push   %rax
  mov    0x50(%rsp),%eax
  push   %rax
  push   $0x0
  mov    0x54(%rsp),%eax
  push   %rax
  mov    0x58(%rsp),%r9d
  call   <buy@plt>
  add    $0x50,%rsp
  cmp    %ebx,0x90(%rsp)
  jge    L37
L31:
  mov    %r14d,%r12d
L112:
  addl   $0x1,0x20(%rsp)
  mov    0x20(%rsp),%eax
  cmp    %eax,0x78(%rsp)
  jl     L20
  mov    0x2c(%rsp),%esi
  cmp    %esi,%eax
  jne    L56
L20:
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L29:
  mov    %r12d,%ecx
  lea    0x6(%r12),%esi
  mov    %r14d,%r8d
  mov    %r13d,%edi
  add    $0x3,%ecx
  cmovns %ecx,%esi
  mov    0xa8(%rsp),%ecx
  push   %rcx
  mov    0x24(%rsp),%ecx
  and    $0xfffffffc,%esi
  sub    %edx,%ecx
  mov    %esi,%edx
  mov    %ebp,%esi
  push   %rcx
  mov    %r15d,%ecx
  push   $0x0
  push   %rax
  push   %rbx
  mov    0xa8(%rsp),%eax
  push   %rax
  mov    0xa8(%rsp),%eax
  push   %rax
  mov    0x50(%rsp),%eax
  push   %rax
  push   $0x0
  mov    0x54(%rsp),%eax
  push   %rax
  mov    0x58(%rsp),%r9d
  call   <buy@plt>
  add    $0x50,%rsp
  jmp    L33
L60:
  mov    0x70(%rsp),%eax
  mov    0x80(%rsp),%esi
  mov    %r14d,%r8d
  mov    $0x4,%edi
  lea    (%rax,%rsi,2),%edx
  mov    0xc(%rsp),%esi
  lea    (%rsi,%rsi,1),%eax
  cmp    0x78(%rsp),%eax
  cmovg  0x78(%rsp),%eax
  xor    %ecx,%ecx
  add    %eax,%edx
  add    0x90(%rsp),%edx
  add    0xa0(%rsp),%edx
  push   $0x0
  push   $0x0
  push   $0x0
  push   $0x0
  push   $0x0
  push   $0x0
  push   $0x0
  push   $0x0
  push   $0x0
  push   %rsi
  mov    0x58(%rsp),%r9d
  mov    %ebp,%esi
  call   <buy@plt>
  add    $0x50,%rsp
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void btr(int turn, int gold, int shield, int bomb, int animus, int tarsierw, int tarsier, int perforator, int shadowfang, int immolitew, int immolite, int nitrocybew, int nitrocybe, int nsup) {
  if (turn == 4) {
    int perf = perforator < animus * 2 ? perforator : animus * 2;
    buy(turn, gold, tarsier + shadowfang * 2 + perf + immolite + nitrocybe, 0, shield, bomb, animus, 0, 0, 0, 0, 0, 0, 0, 0, 0);
  } else {
    for (int perf = 0; perf <= perforator && perf <= animus * 2; perf++) {
      for (int immo = 0; immo <= immolite; immo++) {
        int attack = tarsier + shadowfang * 2 + perf + immo;
        int red = animus * 2 - perf;
        if (shield * 4 > attack + nitrocybe && attack % 4 != 0 && nitrocybe >= (4 - attack % 4)) {
          buy(turn, gold, (attack + 3) / 4 * 4, red, shield, bomb, animus, 0, tarsierw + tarsier, perforator, shadowfang, immo, immolitew + immolite - immo, 0, nitrocybew + nitrocybe - (4 - attack % 4), nsup);
        } else if (shield * 4 > attack + nitrocybe) {
          buy(turn, gold, attack, red, shield, bomb, animus, 0, tarsierw + tarsier, perforator, shadowfang, immo, immolitew + immolite - immo, 0, nitrocybew + nitrocybe, nsup);
        } else {
          buy(turn, gold, attack + nitrocybe, red, shield, bomb, animus, 0, tarsierw + tarsier, perforator, shadowfang, immo, immolitew + immolite - immo, 0, nitrocybew, nsup);
        }
      }
    }
  }
}
```