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

```asm
<lucas>:
  endbr64
  test   %edi,%edi
  je     L333
  mov    %edi,%eax
  cmp    $0x1,%edi
  je     L24
  push   %r15
  sub    $0x2,%eax
  xor    %r8d,%r8d
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %eax,0x8(%rsp)
  mov    0x8(%rsp),%edi
  mov    %r8d,(%rsp)
  mov    %edi,%eax
  add    $0x1,%eax
  je     L287
L437:
  cmp    $0x1,%eax
  je     L578
  lea    -0x1(%rdi),%eax
  xor    %ecx,%ecx
  mov    %eax,0xc(%rsp)
  mov    0xc(%rsp),%edi
  mov    %ecx,0x4(%rsp)
  mov    %edi,%eax
  add    $0x1,%eax
  je     L529
L318:
  cmp    $0x1,%eax
  je     L432
  lea    -0x1(%rdi),%eax
  xor    %edx,%edx
  mov    %eax,0x10(%rsp)
  mov    0x10(%rsp),%edi
  mov    %edi,%eax
  add    $0x1,%eax
  je     L96
L394:
  cmp    $0x1,%eax
  je     L496
  lea    -0x1(%rdi),%esi
  xor    %ecx,%ecx
  mov    %edx,0x14(%rsp)
  mov    %esi,%eax
  mov    %ecx,%r13d
  add    $0x1,%eax
  je     L180
L374:
  cmp    $0x1,%eax
  je     L30
  mov    %esi,0x1c(%rsp)
  lea    -0x1(%rsi),%r9d
  xor    %r8d,%r8d
  mov    %r13d,0x18(%rsp)
  mov    %r9d,%r14d
  mov    %r8d,%r13d
L27:
  mov    %r14d,%eax
  add    $0x1,%eax
  je     L554
  cmp    $0x1,%eax
  je     L170
  lea    -0x1(%r14),%ebp
  xor    %esi,%esi
  mov    %r13d,%ecx
  mov    %r14d,%r8d
L274:
  mov    %ebp,%eax
  add    $0x1,%eax
  je     L99
  cmp    $0x1,%eax
  je     L234
  lea    -0x1(%rbp),%ebx
  xor    %r12d,%r12d
  mov    %ebp,%r9d
L615:
  mov    %ebx,%eax
  add    $0x1,%eax
  je     L629
  cmp    $0x1,%eax
  je     L403
  mov    %ebx,%eax
  lea    -0x1(%rbx),%r15d
  xor    %r14d,%r14d
  mov    %ecx,%ebx
  mov    %r12d,%ecx
  mov    %esi,%r12d
  mov    %eax,%esi
L306:
  mov    %r15d,%ebp
  add    $0x1,%ebp
  je     L136
  cmp    $0x1,%ebp
  je     L485
  mov    %r15d,0x20(%rsp)
  xor    %r13d,%r13d
  mov    %r14d,%r15d
  mov    %ecx,%r14d
L196:
  lea    -0x1(%rbp),%edi
  mov    %esi,0x2c(%rsp)
  mov    %r9d,0x28(%rsp)
  mov    %r8d,0x24(%rsp)
  call   <lucas>
  mov    0x24(%rsp),%r8d
  mov    0x28(%rsp),%r9d
  add    %eax,%r13d
  sub    $0x2,%ebp
  mov    0x2c(%rsp),%esi
  je     L41
  cmp    $0x1,%ebp
  jne    L196
  mov    %r14d,%ecx
  mov    %r15d,%r14d
  mov    0x20(%rsp),%r15d
L103:
  add    %ebp,%r13d
  mov    %r15d,%edx
  add    %r13d,%r14d
  test   %r15d,%r15d
  je     L28
  cmp    $0x1,%r15d
  jne    L65
  mov    %esi,%eax
  mov    %r12d,%esi
  mov    %ecx,%r12d
  mov    %ebx,%ecx
  mov    %eax,%ebx
L483:
  add    %r14d,%edx
  mov    %ebx,%eax
  add    %edx,%r12d
  test   %ebx,%ebx
  je     L160
L258:
  cmp    $0x1,%ebx
  jne    L9
  mov    %r9d,%ebp
L456:
  add    %r12d,%eax
  mov    %ebp,%edx
  add    %eax,%esi
  test   %ebp,%ebp
  jne    L404
L312:
  mov    %ecx,%r13d
  mov    %r8d,%r14d
  mov    $0x2,%edx
L309:
  add    %esi,%edx
  mov    %r14d,%r10d
  add    %edx,%r13d
  test   %r14d,%r14d
  jne    L149
L127:
  mov    %r13d,%r8d
  mov    0x1c(%rsp),%esi
  mov    0x18(%rsp),%r13d
  mov    $0x2,%r10d
L602:
  add    %r8d,%r10d
  mov    %esi,%eax
  add    %r10d,%r13d
  test   %esi,%esi
  je     L291
L278:
  cmp    $0x1,%esi
  je     L277
L338:
  sub    $0x2,%esi
  mov    %esi,%eax
  add    $0x1,%eax
  jne    L374
L180:
  add    $0x2,%r13d
  jmp    L338
L629:
  add    $0x2,%r12d
L9:
  sub    $0x2,%ebx
  jmp    L615
  nopl   (%rax)
L136:
  add    $0x2,%r14d
L65:
  sub    $0x2,%r15d
  jmp    L306
L28:
  mov    %esi,%eax
  mov    $0x2,%edx
  mov    %r12d,%esi
  mov    %ecx,%r12d
  add    %r14d,%edx
  mov    %ebx,%ecx
  mov    %eax,%ebx
  mov    %ebx,%eax
  add    %edx,%r12d
  test   %ebx,%ebx
  jne    L258
L160:
  mov    $0x2,%eax
  mov    %r9d,%ebp
  add    %r12d,%eax
  mov    %ebp,%edx
  add    %eax,%esi
  test   %ebp,%ebp
  je     L312
L404:
  cmp    $0x1,%ebp
  jne    L313
  mov    %ecx,%r13d
  mov    %r8d,%r14d
  add    %esi,%edx
  mov    %r14d,%r10d
  add    %edx,%r13d
  test   %r14d,%r14d
  je     L127
L149:
  cmp    $0x1,%r14d
  jne    L360
  mov    %r13d,%r8d
  mov    0x1c(%rsp),%esi
  mov    0x18(%rsp),%r13d
  add    %r8d,%r10d
  mov    %esi,%eax
  add    %r10d,%r13d
  test   %esi,%esi
  jne    L278
L291:
  mov    0x14(%rsp),%edx
  mov    %r13d,%ecx
  mov    $0x2,%eax
  mov    0x10(%rsp),%esi
  add    %ecx,%eax
  add    %eax,%edx
  test   %esi,%esi
  jne    L392
L68:
  mov    $0x2,%esi
L50:
  mov    0xc(%rsp),%eax
  add    %edx,%esi
  add    %esi,0x4(%rsp)
  test   %eax,%eax
  je     L385
L60:
  cmpl   $0x1,0xc(%rsp)
  je     L19
L265:
  subl   $0x2,0xc(%rsp)
  mov    0xc(%rsp),%edi
  mov    %edi,%eax
  add    $0x1,%eax
  jne    L318
L529:
  addl   $0x2,0x4(%rsp)
  jmp    L265
L403:
  mov    %r9d,%ebp
  add    $0x1,%r12d
  mov    $0x2,%eax
  jmp    L456
L99:
  add    $0x2,%esi
L313:
  sub    $0x2,%ebp
  jmp    L274
L234:
  mov    %ecx,%r13d
  mov    %r8d,%r14d
  add    $0x1,%esi
  mov    $0x2,%edx
  jmp    L309
  nopl   0x0(%rax,%rax,1)
L41:
  mov    %r14d,%ecx
  mov    $0x2,%ebp
  mov    %r15d,%r14d
  mov    0x20(%rsp),%r15d
  jmp    L103
L170:
  mov    %r13d,%r8d
  mov    0x1c(%rsp),%esi
  mov    0x18(%rsp),%r13d
  mov    $0x2,%r10d
  add    $0x1,%r8d
  jmp    L602
L554:
  add    $0x2,%r13d
L360:
  sub    $0x2,%r14d
  jmp    L27
  nopl   (%rax)
L485:
  mov    %esi,%eax
  add    $0x1,%r14d
  mov    %r12d,%esi
  mov    $0x2,%edx
  mov    %ecx,%r12d
  mov    %ebx,%ecx
  mov    %eax,%ebx
  jmp    L483
L30:
  mov    %r13d,%ecx
  mov    0x14(%rsp),%edx
  mov    $0x2,%eax
  add    $0x1,%ecx
L623:
  mov    0x10(%rsp),%esi
  add    %ecx,%eax
  add    %eax,%edx
  test   %esi,%esi
  je     L68
L392:
  cmpl   $0x1,0x10(%rsp)
  je     L50
L618:
  subl   $0x2,0x10(%rsp)
  mov    0x10(%rsp),%edi
  mov    %edi,%eax
  add    $0x1,%eax
  jne    L394
L96:
  add    $0x2,%edx
  jmp    L618
L277:
  mov    0x14(%rsp),%edx
  mov    %r13d,%ecx
  jmp    L623
L19:
  mov    0x4(%rsp),%ecx
L498:
  add    %ecx,%eax
  add    %eax,(%rsp)
  mov    0x8(%rsp),%eax
  test   %eax,%eax
  je     L425
  cmpl   $0x1,0x8(%rsp)
  je     L600
L342:
  subl   $0x2,0x8(%rsp)
  mov    0x8(%rsp),%edi
  mov    %edi,%eax
  add    $0x1,%eax
  jne    L437
L287:
  addl   $0x2,(%rsp)
  jmp    L342
  nopl   0x0(%rax)
L496:
  mov    0xc(%rsp),%eax
  add    $0x1,%edx
  mov    $0x2,%esi
  add    %edx,%esi
  add    %esi,0x4(%rsp)
  test   %eax,%eax
  jne    L60
L385:
  mov    0x4(%rsp),%ecx
  mov    $0x2,%eax
  jmp    L498
L432:
  mov    0x4(%rsp),%ecx
  mov    $0x2,%eax
  add    $0x1,%ecx
  jmp    L498
L600:
  mov    (%rsp),%r8d
  lea    0x1(%r8),%eax
L168:
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L578:
  mov    (%rsp),%r8d
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  lea    0x3(%r8),%eax
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L333:
  mov    $0x2,%eax
  ret
L24:
  ret
L425:
  mov    (%rsp),%r8d
  lea    0x2(%r8),%eax
  jmp    L168
```

assistant: ```c
int lucas(int n) {
  if (n == 0) {
    return 2;
  }
  if (n == 1) {
    return 1;
  }
  return lucas(n - 1) + lucas(n - 2);
}
```