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

```asm
<attach_mkap_conn_filter>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x88,%rsp
  mov    D168(%rip),%rbp
  mov    D307(%rip),%r14
  mov    %edi,0x8(%rsp)
  mov    %esi,0x4(%rsp)
  mov    0x0(%rbp),%edi
  xor    %esi,%esi
  mov    %fs:0x28,%rax
  mov    %rax,0x78(%rsp)
  xor    %eax,%eax
  mov    D260(%rip),%rax
  or     (%rax),%edi
  or     (%r14),%edi
  call   <BPF_STMT@plt>
  mov    0x0(%rbp),%edi
  mov    $0xe,%esi
  mov    %eax,0xc(%rsp)
  mov    D260(%rip),%rax
  or     (%rax),%edi
  or     (%r14),%edi
  call   <BPF_STMT@plt>
  mov    D132(%rip),%r13
  mov    $0xc,%esi
  mov    D169(%rip),%r15
  mov    %eax,0x20(%rsp)
  mov    D268(%rip),%rax
  mov    0x0(%r13),%edi
  or     (%rax),%edi
  or     (%r15),%edi
  call   <BPF_STMT@plt>
  mov    D46(%rip),%rbx
  xor    %edx,%edx
  mov    D178(%rip),%r12
  mov    %eax,0x24(%rsp)
  mov    D245(%rip),%rax
  mov    $0x2,%ecx
  mov    $0x8100,%esi
  mov    (%r12),%edi
  or     (%rax),%edi
  or     (%rbx),%edi
  call   <BPF_JUMP@plt>
  mov    0x0(%rbp),%edi
  mov    $0x12,%esi
  mov    %eax,0x28(%rsp)
  mov    D260(%rip),%rax
  or     (%rax),%edi
  or     (%r14),%edi
  call   <BPF_STMT@plt>
  mov    0x0(%r13),%edi
  mov    $0x10,%esi
  mov    %eax,0x2c(%rsp)
  mov    D268(%rip),%rax
  or     (%rax),%edi
  or     (%r15),%edi
  call   <BPF_STMT@plt>
  mov    (%r12),%edi
  xor    %edx,%edx
  mov    $0xc,%ecx
  mov    %eax,0x30(%rsp)
  mov    D245(%rip),%rax
  or     (%rax),%edi
  mov    D208(%rip),%rax
  or     (%rbx),%edi
  mov    (%rax),%esi
  call   <BPF_JUMP@plt>
  mov    D185(%rip),%r14
  mov    0x0(%r13),%edi
  mov    $0x9,%esi
  mov    D140(%rip),%r15
  mov    %eax,0x34(%rsp)
  or     (%r15),%edi
  or     (%r14),%edi
  call   <BPF_STMT@plt>
  mov    (%r12),%edi
  mov    $0xa,%ecx
  xor    %edx,%edx
  mov    %eax,0x38(%rsp)
  mov    D245(%rip),%rax
  or     (%rax),%edi
  mov    D261(%rip),%rax
  or     (%rbx),%edi
  mov    (%rax),%esi
  call   <BPF_JUMP@plt>
  xor    %esi,%esi
  mov    0x0(%r13),%edi
  or     (%r15),%edi
  or     (%r14),%edi
  mov    %eax,0x3c(%rsp)
  call   <BPF_STMT@plt>
  mov    D0(%rip),%r15
  mov    $0xf,%esi
  mov    %eax,0x40(%rsp)
  mov    D314(%rip),%rax
  mov    (%r15),%edi
  or     (%rax),%edi
  or     (%rbx),%edi
  call   <BPF_STMT@plt>
  mov    (%r15),%edi
  mov    $0x4,%esi
  mov    %eax,0x44(%rsp)
  mov    D325(%rip),%rax
  or     (%rax),%edi
  or     (%rbx),%edi
  call   <BPF_STMT@plt>
  mov    (%r15),%edi
  xor    %esi,%esi
  mov    %eax,0x48(%rsp)
  mov    D94(%rip),%rax
  or     (%rax),%edi
  mov    D121(%rip),%rax
  or     (%rax),%edi
  call   <BPF_STMT@plt>
  xor    %esi,%esi
  mov    %eax,0x4c(%rsp)
  mov    D150(%rip),%rax
  mov    (%rax),%edi
  call   <BPF_STMT@plt>
  mov    0x0(%rbp),%edi
  xor    %esi,%esi
  mov    %eax,0x50(%rsp)
  mov    D260(%rip),%rax
  or     (%rax),%edi
  mov    D285(%rip),%rax
  or     (%rax),%edi
  call   <BPF_STMT@plt>
  xor    %esi,%esi
  mov    0x0(%r13),%edi
  mov    %eax,0x54(%rsp)
  mov    D268(%rip),%rax
  or     (%rax),%edi
  or     (%r14),%edi
  call   <BPF_STMT@plt>
  xor    %ecx,%ecx
  mov    (%r12),%edi
  mov    $0x3,%edx
  mov    %eax,0x58(%rsp)
  mov    D245(%rip),%rax
  mov    $0xd431,%esi
  or     (%rax),%edi
  or     (%rbx),%edi
  call   <BPF_JUMP@plt>
  mov    0x0(%r13),%edi
  mov    $0x2,%esi
  mov    %eax,0x5c(%rsp)
  mov    D268(%rip),%rax
  or     (%rax),%edi
  or     (%r14),%edi
  call   <BPF_STMT@plt>
  mov    $0x1,%edx
  mov    (%r12),%edi
  mov    $0xd431,%esi
  mov    %eax,0x60(%rsp)
  mov    D245(%rip),%rax
  lea    0x10(%rsp),%r12
  or     (%rax),%edi
  xor    %ecx,%ecx
  or     (%rbx),%edi
  call   <BPF_JUMP@plt>
  mov    D159(%rip),%rbp
  mov    $0xffffff,%esi
  mov    %eax,0x64(%rsp)
  mov    0x0(%rbp),%edi
  or     (%rbx),%edi
  call   <BPF_STMT@plt>
  xor    %esi,%esi
  mov    0x0(%rbp),%edi
  or     (%rbx),%edi
  mov    %eax,0x68(%rsp)
  call   <BPF_STMT@plt>
  xor    %esi,%esi
  mov    $0x10,%edx
  mov    %r12,%rdi
  mov    %eax,0x6c(%rsp)
  call   <memset@plt>
  lea    0x20(%rsp),%rax
  cmpl   $0xc,0x4(%rsp)
  movl   $0x14,0x10(%rsp)
  mov    %rax,0x18(%rsp)
  mov    0x8(%rsp),%r9d
  jne    L6
  mov    0xc(%rsp),%eax
  movl   $0xf,0x10(%rsp)
  mov    %eax,0x34(%rsp)
  lea    0x34(%rsp),%rax
  mov    %rax,0x18(%rsp)
L6:
  mov    D105(%rip),%rax
  mov    $0x10,%r8d
  mov    %r12,%rcx
  mov    %r9d,%edi
  mov    (%rax),%edx
  mov    D149(%rip),%rax
  mov    (%rax),%esi
  call   <setsockopt@plt>
  mov    0x78(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L11
  add    $0x88,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L11:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int attach_mkap_conn_filter(int sock, unsigned int linktype) {
  struct sock_filter raw_ip_patch = BPF_STMT(BPF_LDX | BPF_W | BPF_IMM, 0);
  struct sock_filter filter_instr[] = {
      BPF_STMT(BPF_LDX | BPF_W | BPF_IMM, 14), BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 12), BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 0x8100, 0, 2), BPF_STMT(BPF_LDX | BPF_W | BPF_IMM, 18), BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 16), BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, ETH_P_IP, 0, 12), BPF_STMT(BPF_LD | BPF_B | BPF_IND, 9), BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, IPPROTO_TCP, 0, 10), BPF_STMT(BPF_LD | BPF_B | BPF_IND, 0), BPF_STMT(BPF_ALU | BPF_AND | BPF_K, 0x0F), BPF_STMT(BPF_ALU | BPF_MUL | BPF_K, 4), BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0), BPF_STMT(BPF_ST, 0), BPF_STMT(BPF_LDX | BPF_W | BPF_MEM, 0), BPF_STMT(BPF_LD | BPF_H | BPF_IND, 0), BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 54321, 3, 0), BPF_STMT(BPF_LD | BPF_H | BPF_IND, 2), BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 54321, 1, 0), BPF_STMT(BPF_RET | BPF_K, 0x00FFFFFF), BPF_STMT(BPF_RET | BPF_K, 0),
  };
  struct sock_fprog filter_prog;
  memset(&filter_prog, 0, sizeof(filter_prog));
  filter_prog.len = sizeof(filter_instr) / sizeof(filter_instr[0]);
  filter_prog.filter = filter_instr;
  if (linktype == 12) {
    filter_instr[5] = raw_ip_patch;
    filter_prog.len -= 5;
    filter_prog.filter = &filter_instr[5];
  }
  return setsockopt(sock, SOL_SOCKET, SO_ATTACH_FILTER, &filter_prog, sizeof(filter_prog));
}
```