user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<flush_large>:
  endbr64
  push   %r15
  mov    %rsi,%r15
  push   %r14
  mov    %ecx,%r14d
  push   %r13
  mov    %r9d,%r13d
  push   %r12
  mov    %r8,%r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdx,0x8(%rsp)
  cmp    $0x2,%ecx
  jg     L37
  test   %ecx,%ecx
  jle    L60
  mov    0x68(%rsp),%rdx
  mov    $0x2,%esi
  call   <write_instruction@plt>
  mov    0x8(%rsp),%rbx
  mov    %r13d,%ecx
  mov    %r12,%rdx
  mov    0x68(%rsp),%r9
  mov    0x60(%rsp),%r8
  mov    %rbp,%rdi
  mov    %rbx,%rsi
  call   <write_three_large@plt>
  cmp    $0x2,%r14d
  jne    L60
  mov    0x68(%rsp),%rdx
  mov    $0x2,%esi
  mov    %rbp,%rdi
  call   <write_instruction@plt>
  mov    0x68(%rsp),%r9
  mov    %r13d,%ecx
  mov    %r12,%rdx
  mov    0x60(%rsp),%r8
  lea    0xc(%rbx),%rsi
  mov    %rbp,%rdi
  call   <write_three_large@plt>
L60:
  mov    (%r15),%edx
  mov    %edx,%eax
  sub    %r14d,%eax
  cmp    %r14d,%edx
  je     L53
  test   %eax,%eax
  jle    L53
  movslq %r14d,%rax
  mov    0x8(%rsp),%rbx
  xor    %ecx,%ecx
  lea    (%rax,%rax,2),%rdx
  shl    $0x2,%rdx
  nopl   0x0(%rax)
L15:
  mov    (%rbx,%rdx,1),%eax
  add    $0x1,%ecx
  add    $0xc,%rbx
  mov    %eax,-0xc(%rbx)
  mov    -0x8(%rbx,%rdx,1),%eax
  mov    %eax,-0x8(%rbx)
  mov    -0x4(%rbx,%rdx,1),%eax
  mov    %eax,-0x4(%rbx)
  mov    (%r15),%eax
  sub    %r14d,%eax
  cmp    %ecx,%eax
  jg     L15
L53:
  mov    %eax,(%r15)
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L37:
  mov    0x68(%rsp),%rdx
  mov    $0x6,%esi
  call   <write_instruction@plt>
  mov    0x68(%rsp),%rcx
  lea    -0x3(%r14),%esi
  mov    %rbp,%rdi
  mov    $0x4,%edx
  call   <Ptngc_writebits@plt>
  mov    0x8(%rsp),%rdi
  lea    -0x1(%r14),%eax
  mov    %r15,0x10(%rsp)
  lea    (%rax,%rax,2),%rax
  mov    0x60(%rsp),%r15
  mov    0x68(%rsp),%rbx
  mov    %r14d,0x1c(%rsp)
  lea    0xc(%rdi,%rax,4),%rax
  mov    %rdi,%r14
  mov    %rax,(%rsp)
  nopw   0x0(%rax,%rax,1)
L69:
  mov    %r14,%rsi
  mov    %rbx,%r9
  mov    %r15,%r8
  mov    %r13d,%ecx
  mov    %r12,%rdx
  mov    %rbp,%rdi
  add    $0xc,%r14
  call   <write_three_large@plt>
  cmp    (%rsp),%r14
  jne    L69
  mov    0x10(%rsp),%r15
  mov    0x1c(%rsp),%r14d
  jmp    L60
```

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;
}
```