user: Demonstrate the C code that generates the assembly output below:

```asm
<ways>:
  endbr64
  test   %edx,%edx
  je     L212
  mov    %esi,%eax
  test   %esi,%esi
  jle    L311
  mov    %edx,%r9d
  test   %edx,%edx
  js     L311
  push   %r15
  lea    -0x8(%rax),%edx
  lea    -0x6(%rax),%r11d
  push   %r14
  lea    -0x7(%rax),%r14d
  lea    -0x5(%rax),%r10d
  push   %r13
  lea    -0x4(%rax),%r8d
  lea    -0x1(%rsi),%ecx
  push   %r12
  push   %rbp
  push   %rbx
  lea    -0x2(%rsi),%ebx
  lea    -0x3(%rsi),%esi
  sub    $0xb8,%rsp
  mov    %edx,0x9c(%rsp)
  movslq %edx,%rdx
  lea    (%rdi,%rdx,4),%rdx
  mov    %ebx,0x6c(%rsp)
  mov    %rdx,0x58(%rsp)
  movslq %r14d,%rdx
  lea    (%rdi,%rdx,4),%rdx
  mov    %r8d,0x84(%rsp)
  mov    %rdx,0xa0(%rsp)
  movslq %r11d,%rdx
  lea    (%rdi,%rdx,4),%rdx
  mov    %r10d,0x98(%rsp)
  mov    %rdx,0x50(%rsp)
  movslq %r10d,%rdx
  lea    (%rdi,%rdx,4),%rdx
  mov    %r11d,0x48(%rsp)
  mov    %rdx,0x40(%rsp)
  movslq %r8d,%rdx
  lea    (%rdi,%rdx,4),%rdx
  mov    %r14d,0x4c(%rsp)
  mov    %rdx,0x90(%rsp)
  movslq %esi,%rdx
  lea    (%rdi,%rdx,4),%rdx
  mov    %r9d,0x68(%rsp)
  mov    %rdx,0x88(%rsp)
  movslq %ebx,%rdx
  lea    (%rdi,%rdx,4),%rbx
  movslq %ecx,%rdx
  mov    %esi,0x80(%rsp)
  lea    -0x9(%rax),%esi
  shl    $0x2,%rdx
  test   %ecx,%ecx
  mov    %rbx,0x78(%rsp)
  setle  0xab(%rsp)
  lea    (%rdi,%rdx,1),%rbx
  xor    %r8d,%r8d
  lea    0x4(%rdi,%rdx,1),%rdx
  mov    %rbx,0x70(%rsp)
  mov    %rdx,0x60(%rsp)
  mov    %r8d,0x1c(%rsp)
L102:
  mov    0x68(%rsp),%eax
  xor    %r11d,%r11d
  mov    %r11d,0x10(%rsp)
  mov    %eax,0x34(%rsp)
L282:
  mov    0x34(%rsp),%eax
  test   %eax,%eax
  js     L140
  cmpb   $0x0,0xab(%rsp)
  jne    L140
  mov    0x6c(%rsp),%r9d
  mov    %eax,0x38(%rsp)
  mov    %rdi,%r15
  mov    %esi,%r14d
  test   %r9d,%r9d
  setle  0xac(%rsp)
  xor    %r9d,%r9d
  mov    %r9d,0x14(%rsp)
L239:
  mov    0x38(%rsp),%eax
  test   %eax,%eax
  js     L63
  cmpb   $0x0,0xac(%rsp)
  jne    L63
  mov    0x80(%rsp),%r8d
  mov    %eax,0x3c(%rsp)
  mov    %r15,%r12
  mov    %r14d,%r13d
  test   %r8d,%r8d
  setle  0xad(%rsp)
  xor    %r11d,%r11d
  mov    %r11d,0x18(%rsp)
L247:
  mov    0x3c(%rsp),%r14d
  test   %r14d,%r14d
  js     L242
  cmpb   $0x0,0xad(%rsp)
  jne    L242
  mov    0x84(%rsp),%edi
  test   %edi,%edi
  setle  0xae(%rsp)
  xor    %r15d,%r15d
  mov    %r15d,0xc(%rsp)
  mov    %r13d,%r15d
  mov    %r14d,%r13d
  mov    %r12,%r14
L52:
  test   %r13d,%r13d
  js     L7
  cmpb   $0x0,0xae(%rsp)
  jne    L7
  mov    0x98(%rsp),%esi
  mov    %r14,%rdi
  mov    %r13d,%r14d
  test   %esi,%esi
  mov    %r15d,%esi
  setle  0xaf(%rsp)
  xor    %ebp,%ebp
  mov    %ebp,%r15d
  mov    %r13d,%ebp
L56:
  test   %ebp,%ebp
  js     L69
  cmpb   $0x0,0xaf(%rsp)
  jne    L69
  mov    0x48(%rsp),%ecx
  mov    %r15d,%r10d
  mov    %ebp,%ebx
  mov    %ebp,%r9d
  mov    %r14d,%r15d
  test   %ecx,%ecx
  setle  0xa8(%rsp)
  xor    %r12d,%r12d
  mov    %r12d,%ecx
L207:
  test   %ebx,%ebx
  js     L86
  cmpb   $0x0,0xa8(%rsp)
  jne    L86
  mov    0x4c(%rsp),%edx
  mov    %ebx,%r14d
  mov    %ebx,%r11d
  mov    %r15d,%ebx
  mov    %rdi,%r15
  test   %edx,%edx
  setle  0xa9(%rsp)
  xor    %ebp,%ebp
L121:
  test   %r14d,%r14d
  js     L12
  cmpb   $0x0,0xa9(%rsp)
  jne    L12
  mov    0x9c(%rsp),%eax
  mov    %r14d,%r12d
  test   %eax,%eax
  setle  0xaa(%rsp)
  xor    %r13d,%r13d
L6:
  test   %r12d,%r12d
  js     L191
  cmpb   $0x0,0xaa(%rsp)
  jne    L191
  mov    %r12d,%edx
  mov    %r15,%rdi
  mov    %ecx,0x30(%rsp)
  mov    %r10d,0x2c(%rsp)
  mov    %r11d,0x28(%rsp)
  mov    %r9d,0x24(%rsp)
  mov    %esi,0x20(%rsp)
  call   <ways>
  mov    0x20(%rsp),%esi
  mov    0x24(%rsp),%r9d
  add    %eax,%r13d
  mov    0x58(%rsp),%rax
  mov    0x28(%rsp),%r11d
  mov    0x2c(%rsp),%r10d
  mov    0x30(%rsp),%ecx
  sub    (%rax),%r12d
  jne    L6
  add    $0x1,%r13d
L191:
  mov    0xa0(%rsp),%rax
  add    %r13d,%ebp
  sub    (%rax),%r14d
  jne    L121
  mov    %r15,%rdi
  add    $0x1,%ebp
  mov    %ebx,%r15d
  mov    %r11d,%ebx
L238:
  mov    0x50(%rsp),%rax
  add    %ebp,%ecx
  sub    (%rax),%ebx
  jne    L207
  mov    %ecx,%r12d
  mov    %r15d,%r14d
  mov    %r9d,%ebp
  mov    %r10d,%r15d
  add    $0x1,%r12d
L200:
  mov    0x40(%rsp),%rax
  add    %r12d,%r15d
  sub    (%rax),%ebp
  jne    L56
  mov    %r15d,%ebp
  mov    %r14d,%r13d
  mov    %esi,%r15d
  mov    %rdi,%r14
  add    $0x1,%ebp
L304:
  mov    0x90(%rsp),%rcx
  add    %ebp,0xc(%rsp)
  mov    0xc(%rsp),%eax
  sub    (%rcx),%r13d
  jne    L52
  mov    %r15d,%r13d
  mov    %eax,%r15d
  mov    %r14,%r12
  add    $0x1,%r15d
L243:
  mov    0x88(%rsp),%rbx
  add    %r15d,0x18(%rsp)
  mov    (%rbx),%edx
  sub    %edx,0x3c(%rsp)
  jne    L247
  mov    0x18(%rsp),%r11d
  mov    %r12,%r15
  mov    %r13d,%r14d
  add    $0x1,%r11d
L321:
  mov    0x78(%rsp),%rcx
  add    %r11d,0x14(%rsp)
  mov    (%rcx),%ebx
  sub    %ebx,0x38(%rsp)
  jne    L239
  mov    0x14(%rsp),%r9d
  mov    %r15,%rdi
  mov    %r14d,%esi
  add    $0x1,%r9d
L343:
  mov    0x70(%rsp),%rdx
  add    %r9d,0x10(%rsp)
  mov    (%rdx),%ecx
  sub    %ecx,0x34(%rsp)
  jne    L282
  mov    0x10(%rsp),%r11d
  add    $0x1,%r11d
  jmp    L185
  nopl   (%rax)
L12:
  mov    %r15,%rdi
  mov    %ebx,%r15d
  mov    %r11d,%ebx
  jmp    L238
L69:
  mov    %r14d,%r13d
  mov    %r15d,%ebp
  mov    %rdi,%r14
  mov    %esi,%r15d
  jmp    L304
L86:
  mov    %r15d,%r14d
  mov    %r9d,%ebp
  mov    %r10d,%r15d
  mov    %ecx,%r12d
  jmp    L200
L7:
  mov    %r15d,%r13d
  mov    %r14,%r12
  mov    0xc(%rsp),%r15d
  jmp    L243
L242:
  mov    0x18(%rsp),%r11d
  mov    %r12,%r15
  mov    %r13d,%r14d
  jmp    L321
L63:
  mov    0x14(%rsp),%r9d
  mov    %r15,%rdi
  mov    %r14d,%esi
  jmp    L343
L140:
  mov    0x10(%rsp),%r11d
L185:
  mov    0x60(%rsp),%rbx
  add    %r11d,0x1c(%rsp)
  mov    (%rbx),%edx
  sub    %edx,0x68(%rsp)
  je     L78
  jns    L102
  mov    0x1c(%rsp),%r8d
L79:
  add    $0xb8,%rsp
  mov    %r8d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L78:
  mov    0x1c(%rsp),%r8d
  add    $0x1,%r8d
  jmp    L79
L212:
  mov    $0x1,%r8d
L31:
  mov    %r8d,%eax
  ret
L311:
  xor    %r8d,%r8d
  jmp    L31
```

assistant: ```c
int ways(int coins[], int m, int sum) {
  if (sum == 0) {
    return 1;
  }
  if (m <= 0 || sum < 0) {
    return 0;
  }
  return ways(coins, m - 1, sum) + ways(coins, m, sum - coins[m]);
}
```