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

```asm
<selectTrade>:
  endbr64
  push   %r15
  pxor   %xmm0,%xmm0
  push   %r14
  movdqa %xmm0,%xmm1
  push   %r13
  push   %r12
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x28,%rsp
  movdqu (%rdi),%xmm2
  movdqu 0x18(%rdi),%xmm3
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  movdqu 0x30(%rdi),%xmm4
  movdqu 0x48(%rdi),%xmm5
  psubd  %xmm2,%xmm1
  mov    0x14(%rdi),%eax
  negl   0x10(%rdi)
  movups %xmm1,(%rdi)
  movdqa %xmm0,%xmm1
  psubd  %xmm3,%xmm1
  negl   0x28(%rdi)
  movups %xmm1,0x18(%rdi)
  movdqa %xmm0,%xmm1
  psubd  %xmm5,%xmm0
  psubd  %xmm4,%xmm1
  negl   0x40(%rdi)
  negl   0x58(%rdi)
  movups %xmm1,0x30(%rdi)
  movups %xmm0,0x48(%rdi)
  cmp    $0x3,%eax
  je     L131
L195:
  mov    0x2c(%rbx),%edx
  movd   %eax,%xmm0
  mov    0x44(%rbx),%ecx
  movd   %edx,%xmm6
  punpckldq %xmm6,%xmm0
  cmp    $0x3,%edx
  je     L187
L137:
  cmp    $0x3,%ecx
  je     L95
L41:
  cmpl   $0x3,0x5c(%rbx)
  je     L61
L103:
  xor    %r13d,%r13d
  xor    %r15d,%r15d
  lea    0x8(%rsp),%r14
  mov    0x8(%rsp,%r13,4),%eax
  test   %eax,%eax
  jle    L99
L100:
  xor    %r12d,%r12d
  cmp    %ebp,%r15d
  setge  %r12b
  xor    %esi,%esi
  xor    %edi,%edi
  call   <trade_up@plt>
  add    %r15d,%r12d
  mov    %ebp,%esi
  movslq %r12d,%r12
  lea    (%r12,%r12,2),%rax
  lea    (%rbx,%rax,8),%rdi
  call   <setup@plt>
  mov    %ebp,%edi
  call   <data_refresh@plt>
  xor    %eax,%eax
  call   <trade_refresh@plt>
  xor    %edi,%edi
  call   <io_printmap@plt>
  xor    %eax,%eax
  call   <io_printtrade@plt>
L172:
  mov    %ebp,%edx
  mov    %r15d,%esi
  mov    %r14,%rdi
  call   <io_selectTrade@plt>
  xor    %eax,%eax
  call   <io_getkey@plt>
  cmp    $0x4,%eax
  je     L44
  jg     L198
  test   %eax,%eax
  je     L56
  cmp    $0x1,%eax
  jne    L151
  lea    0x1(%r15),%r8d
L53:
  mov    $0xaaaaaaab,%ecx
  mov    %r8,%rax
  imul   %rcx,%r8
  shr    $0x21,%r8
  lea    (%r8,%r8,2),%edx
  sub    %edx,%eax
  movslq %eax,%r13
  mov    %r13,%r15
L151:
  mov    %ebp,%edi
  call   <trade_down@plt>
  mov    0x8(%rsp,%r13,4),%eax
  test   %eax,%eax
  jg     L100
L99:
  mov    %ebp,%edi
  call   <trade_down@plt>
  xor    %edi,%edi
  call   <io_printmap@plt>
  jmp    L172
  nopl   0x0(%rax,%rax,1)
L198:
  cmp    $0x63,%eax
  jne    L162
  mov    $0xffffffff,%r15d
L90:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L142
  add    $0x28,%rsp
  mov    %r15d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L162:
  cmp    $0x74,%eax
  jne    L151
L44:
  xor    %eax,%eax
  cmp    %ebp,%r15d
  setge  %al
  add    %eax,%r15d
  jmp    L90
  nopw   0x0(%rax,%rax,1)
L56:
  lea    0x2(%r15),%r8d
  jmp    L53
L95:
  mov    0x5c(%rbx),%esi
  movq   %xmm0,0x8(%rsp)
  mov    %esi,0x10(%rsp)
  jmp    L41
L131:
  movq   0x2c(%rdi),%xmm0
  movq   0x44(%rdi),%xmm1
  mov    0x5c(%rdi),%edx
  punpckldq %xmm1,%xmm0
  mov    %edx,0x10(%rsp)
  movq   %xmm0,0x8(%rsp)
  jmp    L195
L187:
  mov    0x5c(%rbx),%esi
  movd   %eax,%xmm1
  movd   %ecx,%xmm7
  punpckldq %xmm7,%xmm1
  mov    %esi,0x10(%rsp)
  movq   %xmm1,0x8(%rsp)
  jmp    L137
L61:
  mov    %eax,0x8(%rsp)
  mov    %edx,0xc(%rsp)
  mov    %ecx,0x10(%rsp)
  jmp    L103
L142:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int selectTrade(int accepted[4][6], int player) {
  int cursor = 0;
  int i, j, accepted2[3];
  for (i = 0; i < 4; i++)
    for (j = 0; j < 5; j++) {
      accepted[i][j] *= -1;
    }
  for (i = 0; i < 4; i++)
    if (accepted[i][5] == 3) {
      for (j = 0; j < i; j++)
        accepted2[j] = accepted[j][5];
      for (j = i + 1; j < 4; j++)
        accepted2[j - 1] = accepted[j][5];
    }
  while (1) {
    if (accepted2[cursor] > 0) {
      int cursplayer;
      if (cursor >= player)
        cursplayer = cursor + 1;
      else
        cursplayer = cursor;
      trade_up(0, 0);
      setup(accepted[cursplayer], player);
      data_refresh(player);
      trade_refresh();
      io_printmap(0);
      io_printtrade();
    } else {
      trade_down(player);
      io_printmap(0);
    }
    io_selectTrade(accepted2, cursor, player);
    switch (io_getkey()) {
    case 0:
      cursor = (cursor + 2) % 3;
      break;
    case 1:
      cursor = (cursor + 1) % 3;
      break;
    case 4:
    case 't':
      if (cursor >= player)
        cursor++;
      return cursor;
      break;
    case 'c':
      return -1;
    default:
      break;
    }
    trade_down(player);
  }
}
```