user: Converte this assembly snippet into its equivalent C code:

```asm
<coins>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xb8,%rsp
  mov    %rdi,0xa8(%rsp)
  mov    %rdx,0x80(%rsp)
  movq   $0x1,0xa0(%rsp)
  test   %rdi,%rdi
  je     L308
  movq   $0x0,0xa0(%rsp)
  js     L308
  mov    %rsi,%r15
  cmp    $0x7,%rdx
  jg     L308
L35:
  mov    0x80(%rsp),%rdx
  mov    0xa8(%rsp),%rsi
  mov    (%r15,%rdx,8),%rax
  sub    %rax,%rsi
  mov    %rsi,0x90(%rsp)
  je     L332
  js     L395
  mov    %rdx,0x68(%rsp)
  movq   $0x0,0x98(%rsp)
L238:
  mov    0x90(%rsp),%rsi
  sub    %rax,%rsi
  mov    %rsi,0x78(%rsp)
  je     L193
  js     L264
  mov    0x78(%rsp),%rdx
  mov    0x68(%rsp),%rcx
  movq   $0x0,0x88(%rsp)
  sub    %rax,%rdx
  mov    %rcx,0x50(%rsp)
  mov    %rdx,0x60(%rsp)
  je     L333
L301:
  js     L420
  movq   $0x0,0x70(%rsp)
  mov    0x50(%rsp),%rcx
  mov    %rcx,0x38(%rsp)
  mov    0x60(%rsp),%rcx
  sub    %rax,%rcx
  mov    %rcx,0x48(%rsp)
  je     L166
L216:
  js     L210
  mov    0x48(%rsp),%rdx
  mov    0x38(%rsp),%rcx
  mov    %r15,%r14
  movq   $0x0,0x58(%rsp)
  sub    %rax,%rdx
  mov    %rcx,0x18(%rsp)
  mov    %rdx,0x30(%rsp)
  je     L360
L115:
  js     L33
  movq   $0x0,0x40(%rsp)
  mov    0x18(%rsp),%rcx
  mov    %rcx,0x8(%rsp)
  mov    0x30(%rsp),%rcx
  sub    %rax,%rcx
  mov    %rcx,0x10(%rsp)
  je     L259
L58:
  js     L110
  mov    0x10(%rsp),%rcx
  mov    0x8(%rsp),%rbp
  mov    %r14,%r15
  movq   $0x0,0x20(%rsp)
  sub    %rax,%rcx
  mov    %rcx,(%rsp)
  je     L197
L406:
  js     L68
  mov    (%rsp),%r13
  xor    %edx,%edx
  mov    %rbp,0x28(%rsp)
  mov    %rbp,%r14
  mov    %rdx,%rbp
  sub    %rax,%r13
  je     L230
L324:
  js     L182
  mov    %r14,%rbx
  xor    %r12d,%r12d
L244:
  mov    %rbx,%rdx
  mov    %r13,%rdi
  mov    %r15,%rsi
  sub    (%r15,%rbx,8),%rdi
  call   <coins>
  add    $0x1,%rbx
  add    %rax,%r12
  cmp    $0x8,%rbx
  jne    L244
  add    %r12,%rbp
L182:
  add    $0x1,%r14
  cmp    $0x8,%r14
  je     L298
L271:
  mov    (%r15,%r14,8),%rax
  mov    (%rsp),%r13
  sub    %rax,%r13
  jne    L324
L230:
  add    $0x1,%r14
  add    $0x1,%rbp
  cmp    $0x8,%r14
  jne    L271
L298:
  mov    %rbp,%rsi
  add    %rsi,0x20(%rsp)
  mov    0x28(%rsp),%rbp
L68:
  add    $0x1,%rbp
  cmp    $0x8,%rbp
  je     L175
L103:
  mov    (%r15,%rbp,8),%rax
  mov    0x10(%rsp),%rcx
  sub    %rax,%rcx
  mov    %rcx,(%rsp)
  jne    L406
L197:
  add    $0x1,%rbp
  addq   $0x1,0x20(%rsp)
  cmp    $0x8,%rbp
  jne    L103
L175:
  mov    0x20(%rsp),%rsi
  add    %rsi,0x40(%rsp)
  mov    %r15,%r14
L110:
  addq   $0x1,0x8(%rsp)
  mov    0x8(%rsp),%rax
  cmp    $0x8,%rax
  je     L273
  mov    (%r14,%rax,8),%rax
  mov    0x30(%rsp),%rcx
  sub    %rax,%rcx
  mov    %rcx,0x10(%rsp)
  jne    L58
L259:
  addq   $0x1,0x40(%rsp)
  jmp    L110
L185:
  mov    0x98(%rsp),%rcx
  add    %rcx,0xa0(%rsp)
L395:
  addq   $0x1,0x80(%rsp)
  mov    0x80(%rsp),%rax
  cmp    $0x8,%rax
  jne    L35
L308:
  mov    0xa0(%rsp),%rax
  add    $0xb8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L273:
  mov    0x40(%rsp),%rdx
  add    %rdx,0x58(%rsp)
L33:
  addq   $0x1,0x18(%rsp)
  mov    0x18(%rsp),%rax
  cmp    $0x8,%rax
  je     L52
  mov    (%r14,%rax,8),%rax
  mov    0x48(%rsp),%rdx
  sub    %rax,%rdx
  mov    %rdx,0x30(%rsp)
  jne    L115
L360:
  addq   $0x1,0x58(%rsp)
  jmp    L33
  nopw   0x0(%rax,%rax,1)
L52:
  mov    0x58(%rsp),%rdx
  add    %rdx,0x70(%rsp)
  mov    %r14,%r15
L210:
  addq   $0x1,0x38(%rsp)
  mov    0x38(%rsp),%rax
  cmp    $0x8,%rax
  je     L391
  mov    (%r15,%rax,8),%rax
  mov    0x60(%rsp),%rcx
  sub    %rax,%rcx
  mov    %rcx,0x48(%rsp)
  jne    L216
L166:
  addq   $0x1,0x70(%rsp)
  jmp    L210
  nopl   (%rax)
L391:
  mov    0x70(%rsp),%rsi
  add    %rsi,0x88(%rsp)
L420:
  addq   $0x1,0x50(%rsp)
  mov    0x50(%rsp),%rax
  cmp    $0x8,%rax
  je     L138
  mov    (%r15,%rax,8),%rax
  mov    0x78(%rsp),%rdx
  sub    %rax,%rdx
  mov    %rdx,0x60(%rsp)
  jne    L301
L333:
  addq   $0x1,0x88(%rsp)
  jmp    L420
L138:
  mov    0x88(%rsp),%rsi
  add    %rsi,0x98(%rsp)
L264:
  addq   $0x1,0x68(%rsp)
  mov    0x68(%rsp),%rax
  cmp    $0x8,%rax
  je     L185
  mov    (%r15,%rax,8),%rax
  jmp    L238
L193:
  addq   $0x1,0x98(%rsp)
  jmp    L264
L332:
  addq   $0x1,0xa0(%rsp)
  jmp    L395
```

assistant: ```c
long int coins(long int balance, long int *values, long int index) {
  if (0 == balance)
    return 1;
  if (balance < 0)
    return 0;
  long int sum = 0;
  for (long int i = index; i < 8; i++) {
    sum += coins(balance - values[i], values, i);
  }
  return sum;
}
```