user: 请从给定的汇编指令推导出C源代码：

```asm
<flush_large>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    %ecx,-0x2c(%rbp)
  mov    %r8,-0x38(%rbp)
  mov    %r9d,-0x30(%rbp)
  cmpl   $0x2,-0x2c(%rbp)
  jg     L33
  movl   $0x0,-0x8(%rbp)
  jmp    L51
L7:
  mov    0x18(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  mov    $0x2,%esi
  mov    %rax,%rdi
  call   <write_instruction@plt>
  mov    -0x8(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  lea    (%rdx,%rax,1),%rsi
  mov    0x18(%rbp),%rdi
  mov    -0x30(%rbp),%ecx
  mov    -0x38(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rdi,%r9
  mov    0x10(%rbp),%r8
  mov    %rax,%rdi
  call   <write_three_large@plt>
  addl   $0x1,-0x8(%rbp)
L51:
  mov    -0x8(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jl     L7
  jmp    L19
L33:
  mov    0x18(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  mov    $0x6,%esi
  mov    %rax,%rdi
  call   <write_instruction@plt>
  mov    -0x2c(%rbp),%eax
  lea    -0x3(%rax),%esi
  mov    0x18(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rdx,%rcx
  mov    $0x4,%edx
  mov    %rax,%rdi
  call   <Ptngc_writebits@plt>
  movl   $0x0,-0x8(%rbp)
  jmp    L67
L83:
  mov    -0x8(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  lea    (%rdx,%rax,1),%rsi
  mov    0x18(%rbp),%rdi
  mov    -0x30(%rbp),%ecx
  mov    -0x38(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rdi,%r9
  mov    0x10(%rbp),%r8
  mov    %rax,%rdi
  call   <write_three_large@plt>
  addl   $0x1,-0x8(%rbp)
L67:
  mov    -0x8(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jl     L83
L19:
  mov    -0x20(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x2c(%rbp)
  je     L41
  movl   $0x0,-0x8(%rbp)
  jmp    L13
L36:
  movl   $0x0,-0x4(%rbp)
  jmp    L54
L28:
  mov    -0x8(%rbp),%edx
  mov    -0x2c(%rbp),%eax
  add    %eax,%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x8(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    (%rcx),%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0x4(%rbp)
L54:
  cmpl   $0x2,-0x4(%rbp)
  jle    L28
  addl   $0x1,-0x8(%rbp)
L13:
  mov    -0x20(%rbp),%rax
  mov    (%rax),%eax
  sub    -0x2c(%rbp),%eax
  cmp    %eax,-0x8(%rbp)
  jl     L36
L41:
  mov    -0x20(%rbp),%rax
  mov    (%rax),%eax
  sub    -0x2c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x20(%rbp),%rax
  mov    %edx,(%rax)
  nop
  leave
  ret
```

assistant: ```c
void flush_large(struct coder *coder, int *has_large, int *has_large_ints, const int n, int *large_index, const int large_nbits, unsigned char *compress_buffer, unsigned char **output_ptr) {
  int i;
  if (n < 3) {
    for (i = 0; i < n; i++) {
      write_instruction(coder, 2, output_ptr);
      write_three_large(coder, has_large_ints + i * 3, large_index, large_nbits, compress_buffer, output_ptr);
    }
  } else {
    write_instruction(coder, 6, output_ptr);
    Ptngc_writebits(coder, n - 3, 4, output_ptr);
    for (i = 0; i < n; i++)
      write_three_large(coder, has_large_ints + i * 3, large_index, large_nbits, compress_buffer, output_ptr);
  }
  if (((*has_large) - n) != 0) {
    int j;
    for (i = 0; i < (*has_large) - n; i++)
      for (j = 0; j < 3; j++)
        has_large_ints[i * 3 + j] = has_large_ints[(i + n) * 3 + j];
  }
  *has_large = (*has_large) - n;
}
```