user: Please show me the C implementation that matches the assembly code listed below:

```asm
<fun>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x68,%rsp
  mov    %edi,0x34(%rsp)
  movl   $0x1,0x2c(%rsp)
  cmp    $0x3,%edi
  jle    L146
  lea    -0x2(%rdi),%r11d
  mov    0x34(%rsp),%edi
  mov    %edi,%eax
  sub    %r11d,%eax
  cmp    %eax,%edi
  jl     L146
L451:
  cmp    $0x3,%eax
  jle    L104
  lea    0x1(%r11),%eax
  cmp    $0x3,%eax
  jle    L401
  lea    -0x1(%r11),%eax
  mov    %r11d,0x24(%rsp)
  mov    0x24(%rsp),%edi
  mov    %eax,0x30(%rsp)
  mov    %eax,0xc(%rsp)
  movl   $0x1,0x8(%rsp)
  movl   $0x1,0x28(%rsp)
  cmp    %edi,0x8(%rsp)
  jg     L427
L415:
  addl   $0x1,0x8(%rsp)
  mov    0x8(%rsp),%ebx
  cmp    $0x3,%ebx
  jle    L431
  mov    0xc(%rsp),%eax
  movl   $0x1,0x20(%rsp)
  add    $0x1,%eax
  cmp    $0x3,%eax
  jle    L183
  mov    0x24(%rsp),%r10d
  mov    $0x1,%r11d
  sub    %ebx,%r10d
  cmp    %r11d,0xc(%rsp)
  jl     L183
L232:
  add    $0x1,%r11d
  cmp    $0x3,%r11d
  jle    L243
  lea    0x1(%r10),%eax
  movl   $0x1,0x1c(%rsp)
  cmp    $0x3,%eax
  jle    L293
  mov    0xc(%rsp),%r8d
  mov    $0x1,%r9d
  mov    %r11d,0x5c(%rsp)
  mov    %r10d,0x14(%rsp)
  sub    %r11d,%r8d
  mov    %r9d,%r11d
  mov    %r8d,%r10d
  cmp    0x14(%rsp),%r11d
  jg     L197
L424:
  add    $0x1,%r11d
  cmp    $0x3,%r11d
  jle    L386
  lea    0x1(%r10),%eax
  movl   $0x1,0x18(%rsp)
  cmp    $0x3,%eax
  jle    L372
  mov    0x14(%rsp),%r9d
  mov    %r11d,0x3c(%rsp)
  mov    $0x1,%ecx
  mov    %r10d,0x10(%rsp)
  sub    %r11d,%r9d
  cmp    %ecx,0x10(%rsp)
  jl     L315
L285:
  add    $0x1,%ecx
  cmp    $0x3,%ecx
  jle    L128
  lea    0x1(%r9),%eax
  mov    $0x1,%r11d
  cmp    $0x3,%eax
  jle    L269
  mov    0x10(%rsp),%r15d
  mov    $0x1,%r14d
  mov    %ecx,0x38(%rsp)
  sub    %ecx,%r15d
  mov    %r15d,%edx
  mov    %r14d,%r15d
  cmp    %r9d,%r15d
  jg     L274
L201:
  add    $0x1,%r15d
  cmp    $0x3,%r15d
  jle    L362
  lea    0x1(%rdx),%eax
  mov    $0x1,%esi
  cmp    $0x3,%eax
  jle    L41
  mov    %r9d,%r14d
  mov    $0x1,%r13d
  mov    %r15d,%r8d
  sub    %r15d,%r14d
  cmp    %r13d,%edx
  jl     L193
L422:
  add    $0x1,%r13d
  cmp    $0x3,%r13d
  jle    L156
  lea    0x1(%r14),%eax
  mov    $0x1,%r15d
  cmp    $0x3,%eax
  jle    L288
  mov    %edx,%ebp
  mov    $0x1,%r12d
  mov    %r13d,%ecx
  sub    %r13d,%ebp
  cmp    %r14d,%r12d
  jg     L299
L314:
  add    $0x1,%r12d
  cmp    $0x3,%r12d
  jle    L60
  lea    0x1(%rbp),%eax
  mov    $0x1,%r13d
  cmp    $0x3,%eax
  jle    L208
  mov    $0x1,%ebx
  lea    0x2(%rbp),%r10d
L151:
  cmp    %ebp,%ebx
  jg     L208
L2:
  add    $0x1,%ebx
  cmp    $0x3,%ebx
  jle    L159
  mov    %r10d,%edi
  mov    %edx,0x58(%rsp)
  sub    %ebx,%edi
  mov    %r9d,0x54(%rsp)
  mov    %esi,0x50(%rsp)
  mov    %ecx,0x4c(%rsp)
  mov    %r11d,0x48(%rsp)
  mov    %r8d,0x44(%rsp)
  mov    %r10d,0x40(%rsp)
  call   <fun>
  mov    0x40(%rsp),%r10d
  mov    0x44(%rsp),%r8d
  mov    0x48(%rsp),%r11d
  mov    0x4c(%rsp),%ecx
  add    %eax,%r13d
  mov    0x50(%rsp),%esi
  mov    0x54(%rsp),%r9d
  mov    0x58(%rsp),%edx
  cmp    %ebp,%ebx
  jle    L2
  nopl   0x0(%rax)
L208:
  add    %r13d,%r15d
L435:
  sub    $0x1,%ebp
  cmp    %r14d,%r12d
  jle    L314
L299:
  mov    %ecx,%r13d
L288:
  add    %r15d,%esi
L265:
  sub    $0x1,%r14d
  cmp    %r13d,%edx
  jge    L422
L193:
  mov    %r8d,%r15d
L41:
  add    %esi,%r11d
L278:
  sub    $0x1,%edx
  cmp    %r9d,%r15d
  jle    L201
L274:
  mov    0x38(%rsp),%ecx
L269:
  add    %r11d,0x18(%rsp)
L404:
  sub    $0x1,%r9d
  cmp    %ecx,0x10(%rsp)
  jge    L285
L315:
  mov    0x3c(%rsp),%r11d
  mov    0x10(%rsp),%r10d
L372:
  mov    0x18(%rsp),%edi
  add    %edi,0x1c(%rsp)
L212:
  sub    $0x1,%r10d
  cmp    0x14(%rsp),%r11d
  jle    L424
L197:
  mov    0x5c(%rsp),%r11d
  mov    0x14(%rsp),%r10d
L293:
  mov    0x1c(%rsp),%esi
  add    %esi,0x20(%rsp)
L118:
  sub    $0x1,%r10d
  cmp    %r11d,0xc(%rsp)
  jge    L232
L183:
  mov    0x20(%rsp),%ecx
  add    %ecx,0x28(%rsp)
L301:
  subl   $0x1,0xc(%rsp)
  mov    0x24(%rsp),%edi
  cmp    %edi,0x8(%rsp)
  jle    L415
L427:
  mov    0x28(%rsp),%esi
  add    %esi,0x2c(%rsp)
L253:
  mov    0x34(%rsp),%edi
  mov    0x30(%rsp),%r11d
  mov    %edi,%eax
  sub    %r11d,%eax
  cmp    %eax,%edi
  jge    L451
L146:
  mov    0x2c(%rsp),%eax
  add    $0x68,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L159:
  mov    $0x1,%r13d
  jmp    L151
  nopl   0x0(%rax,%rax,1)
L60:
  mov    $0x1,%r15d
  jmp    L435
  nopl   0x0(%rax,%rax,1)
L156:
  mov    $0x1,%esi
  jmp    L265
  nopw   0x0(%rax,%rax,1)
L362:
  mov    $0x1,%r11d
  jmp    L278
  nopl   0x0(%rax,%rax,1)
L128:
  movl   $0x1,0x18(%rsp)
  jmp    L404
  nopl   (%rax)
L386:
  movl   $0x1,0x1c(%rsp)
  jmp    L212
  nopl   (%rax)
L243:
  movl   $0x1,0x20(%rsp)
  jmp    L118
  nopl   (%rax)
L431:
  movl   $0x1,0x28(%rsp)
  jmp    L301
  nopl   (%rax)
L104:
  lea    -0x1(%r11),%eax
  movl   $0x1,0x2c(%rsp)
  mov    %eax,0x30(%rsp)
  jmp    L253
  nopl   (%rax)
L401:
  lea    -0x1(%r11),%eax
  movl   $0x1,0x28(%rsp)
  mov    %eax,0x30(%rsp)
  jmp    L427
```

assistant: ```c
int fun(int n) {
  int sum = 0, i;
  if (n < 4)
    return 1;
  for (i = 1; i <= n; i++) {
    if (i < 4)
      sum = 1;
    else
      sum = sum + fun(n - i + 1);
  }
  return sum;
}
```