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

```asm
<fib>:
  endbr64
  mov    (%rsi),%eax
  mov    %edi,%r8d
  add    $0x1,%eax
  mov    %eax,(%rsi)
  cmp    $0x1,%edi
  je     L370
  test   %edi,%edi
  je     L370
  push   %r15
  lea    -0x1(%rdi),%ecx
  xor    %r8d,%r8d
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x68,%rsp
  mov    %ecx,0x4c(%rsp)
  mov    %edi,0x10(%rsp)
  mov    %r8d,0x28(%rsp)
L45:
  mov    0x4c(%rsp),%edi
  lea    0x1(%rax),%edx
  add    $0x2,%eax
  mov    %edi,0x14(%rsp)
  cmp    $0x1,%edi
  je     L34
  subl   $0x2,0x10(%rsp)
  mov    0x10(%rsp),%ebx
  test   %edi,%edi
  je     L155
  mov    %ebx,0x50(%rsp)
  movl   $0x0,0x24(%rsp)
L74:
  mov    0x50(%rsp),%ebx
  lea    0x1(%rdx),%eax
  add    $0x2,%edx
  mov    %ebx,0x18(%rsp)
  cmp    $0x1,%ebx
  je     L148
  subl   $0x2,0x14(%rsp)
  mov    0x14(%rsp),%edi
  test   %ebx,%ebx
  je     L83
  xor    %r11d,%r11d
  mov    %edi,0x54(%rsp)
  mov    %r11d,0x2c(%rsp)
L311:
  mov    0x54(%rsp),%ebx
  lea    0x1(%rax),%edx
  add    $0x2,%eax
  mov    %ebx,0x1c(%rsp)
  cmp    $0x1,%ebx
  je     L55
  subl   $0x2,0x18(%rsp)
  mov    0x18(%rsp),%edi
  test   %ebx,%ebx
  je     L28
  xor    %r10d,%r10d
  mov    %edi,0x5c(%rsp)
  mov    %r10d,0x30(%rsp)
L299:
  mov    0x5c(%rsp),%edi
  lea    0x1(%rdx),%ecx
  add    $0x2,%edx
  mov    %edi,0xc(%rsp)
  cmp    $0x1,%edi
  je     L51
  subl   $0x2,0x1c(%rsp)
  mov    0x1c(%rsp),%eax
  test   %edi,%edi
  je     L419
  mov    %eax,0x58(%rsp)
  xor    %r8d,%r8d
  mov    %r8d,0x20(%rsp)
  mov    %rsi,%r8
L152:
  mov    0x58(%rsp),%edi
  lea    0x1(%rcx),%eax
  add    $0x2,%ecx
  mov    %edi,%r9d
  cmp    $0x1,%edi
  je     L91
  subl   $0x2,0xc(%rsp)
  mov    0xc(%rsp),%r14d
  test   %edi,%edi
  je     L301
  xor    %r10d,%r10d
  mov    %r14d,%edx
  mov    %r8,%rbp
L412:
  lea    0x1(%rax),%ecx
  mov    %edx,%r14d
  add    $0x2,%eax
  cmp    $0x1,%edx
  je     L489
  sub    $0x2,%r9d
  test   %edx,%edx
  je     L529
  mov    %r9d,%r15d
  xor    %r11d,%r11d
L29:
  lea    0x1(%rcx),%eax
  mov    %r15d,%r8d
  add    $0x2,%ecx
  cmp    $0x1,%r15d
  je     L68
  sub    $0x2,%r14d
  test   %r15d,%r15d
  je     L386
  mov    %r14d,%r12d
  xor    %ebx,%ebx
  mov    %r15d,%ecx
  mov    %r14d,%r15d
  mov    %ebx,%r14d
  mov    %r12d,%ebx
  mov    %r8d,%r12d
L362:
  mov    %ebx,%r13d
  lea    0x1(%rax),%esi
  cmp    $0x1,%ebx
  je     L376
  sub    $0x2,%r12d
  test   %ebx,%ebx
  je     L467
  mov    %esi,0x0(%rbp)
  xor    %r8d,%r8d
  mov    %r15d,0x34(%rsp)
  mov    %r14d,%r15d
  mov    %r11d,%r14d
  mov    %ebx,0x38(%rsp)
  mov    %r8d,%ebx
L93:
  lea    -0x1(%r13),%edi
  mov    %rbp,%rsi
  mov    %ecx,0x48(%rsp)
  sub    $0x2,%r13d
  mov    %edx,0x44(%rsp)
  mov    %r10d,0x40(%rsp)
  mov    %r9d,0x3c(%rsp)
  call   <fib>
  mov    0x3c(%rsp),%r9d
  mov    0x40(%rsp),%r10d
  add    %eax,%ebx
  mov    0x0(%rbp),%eax
  cmp    $0x1,%r13d
  mov    0x44(%rsp),%edx
  mov    0x48(%rsp),%ecx
  lea    0x1(%rax),%esi
  mov    %esi,0x0(%rbp)
  je     L356
  test   %r13d,%r13d
  jne    L93
  mov    %r14d,%r11d
  mov    %ebx,%r8d
  mov    %r15d,%r14d
  mov    0x38(%rsp),%ebx
  mov    0x34(%rsp),%r15d
L202:
  add    $0x2,%eax
  add    %r8d,%r14d
  mov    %eax,0x0(%rbp)
  cmp    $0x1,%r12d
  jne    L320
  mov    %r14d,%ebx
  mov    %r15d,%r14d
  mov    %ecx,%r15d
  add    $0x1,%ebx
L517:
  lea    0x1(%rax),%ecx
  add    %ebx,%r11d
  mov    %ecx,0x0(%rbp)
  cmp    $0x1,%r14d
  jne    L246
L68:
  mov    %r11d,%r12d
  add    $0x1,%r12d
L439:
  lea    0x1(%rcx),%eax
  add    %r12d,%r10d
  mov    %eax,0x0(%rbp)
  cmp    $0x1,%r9d
  jne    L157
L489:
  mov    %r10d,%r13d
  mov    %rbp,%r8
  add    $0x1,%r13d
L105:
  add    %r13d,0x20(%rsp)
  lea    0x1(%rax),%ecx
  cmpl   $0x1,0xc(%rsp)
  mov    %ecx,(%r8)
  mov    0x20(%rsp),%edi
  jne    L493
  mov    %r8,%rsi
  mov    %edi,%r8d
  add    $0x1,%r8d
L177:
  add    %r8d,0x30(%rsp)
  lea    0x1(%rcx),%edx
  cmpl   $0x1,0x1c(%rsp)
  mov    %edx,(%rsi)
  je     L51
  mov    0x1c(%rsp),%ecx
  test   %ecx,%ecx
  je     L337
L419:
  subl   $0x2,0x5c(%rsp)
  jmp    L299
L246:
  test   %r14d,%r14d
  je     L327
L386:
  sub    $0x2,%r15d
  jmp    L29
L157:
  test   %r9d,%r9d
  je     L528
L529:
  sub    $0x2,%edx
  jmp    L412
  nop
L356:
  mov    %ebx,%r8d
  mov    %r14d,%r11d
  mov    0x38(%rsp),%ebx
  mov    %r15d,%r14d
  add    $0x1,%r8d
  mov    0x34(%rsp),%r15d
  jmp    L202
  nopl   0x0(%rax,%rax,1)
L376:
  mov    %r14d,%ebx
  add    $0x2,%eax
  mov    %r15d,%r14d
  mov    %ecx,%r15d
  add    $0x1,%ebx
  jmp    L517
L91:
  mov    %r8,%rsi
  mov    0x20(%rsp),%r8d
  add    $0x1,%r8d
  jmp    L177
L51:
  mov    0x30(%rsp),%r10d
  add    $0x1,%r10d
L85:
  add    %r10d,0x2c(%rsp)
  lea    0x1(%rdx),%eax
  cmpl   $0x1,0x18(%rsp)
  mov    %eax,(%rsi)
  je     L55
  mov    0x18(%rsp),%edi
  test   %edi,%edi
  je     L352
L28:
  subl   $0x2,0x54(%rsp)
  jmp    L311
  nopl   (%rax)
L467:
  add    $0x2,%eax
  nopl   0x0(%rax,%rax,1)
L300:
  sub    $0x2,%ebx
  jmp    L362
L493:
  mov    0xc(%rsp),%eax
  test   %eax,%eax
  je     L496
L301:
  subl   $0x2,0x58(%rsp)
  jmp    L152
L55:
  mov    0x2c(%rsp),%r11d
  add    $0x1,%r11d
L281:
  add    %r11d,0x24(%rsp)
  lea    0x1(%rax),%edx
  cmpl   $0x1,0x14(%rsp)
  mov    %edx,(%rsi)
  je     L148
  mov    0x14(%rsp),%r8d
  test   %r8d,%r8d
  je     L249
L83:
  subl   $0x2,0x50(%rsp)
  jmp    L74
L327:
  mov    %r11d,%r12d
  jmp    L439
L320:
  test   %r12d,%r12d
  jne    L300
  mov    %r14d,%ebx
  mov    %r15d,%r14d
  mov    %ecx,%r15d
  jmp    L517
L148:
  addl   $0x1,0x24(%rsp)
L249:
  mov    0x24(%rsp),%ebx
  lea    0x1(%rdx),%eax
  add    %ebx,0x28(%rsp)
  cmpl   $0x1,0x10(%rsp)
  mov    %eax,(%rsi)
  je     L441
  mov    0x10(%rsp),%r9d
  test   %r9d,%r9d
  je     L117
L155:
  subl   $0x2,0x4c(%rsp)
  jmp    L45
L441:
  mov    0x28(%rsp),%r8d
  add    $0x1,%r8d
L350:
  add    $0x68,%rsp
  mov    %r8d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L34:
  mov    0x28(%rsp),%r8d
  mov    %eax,(%rsi)
  add    $0x1,%r8d
  jmp    L350
L370:
  mov    %r8d,%eax
  ret
L337:
  mov    0x30(%rsp),%r10d
  jmp    L85
L496:
  mov    %r8,%rsi
  mov    0x20(%rsp),%r8d
  jmp    L177
L117:
  mov    0x28(%rsp),%r8d
  jmp    L350
L352:
  mov    0x2c(%rsp),%r11d
  jmp    L281
L528:
  mov    %r10d,%r13d
  mov    %rbp,%r8
  jmp    L105
```

assistant: ```c
int fib(int n, int *ptr) {
  *ptr = *ptr + 1;
  if (n == 1) {
    return 1;
  }
  if (n == 0) {
    return 0;
  }
  return fib(n - 1, ptr) + fib(n - 2, ptr);
}
```