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

```asm
<ai_roadfromvert>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x68,%rsp
  mov    %edi,-0x64(%rbp)
  mov    %esi,-0x68(%rbp)
  mov    %rdx,-0x70(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x48(%rbp)
  movl   $0x0,-0x44(%rbp)
  lea    -0x30(%rbp),%rdx
  mov    -0x68(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <ai_surroundingverts@plt>
  movl   $0x0,-0x40(%rbp)
  movl   $0x0,-0x3c(%rbp)
  movl   $0x1,-0x54(%rbp)
  jmp    L155
L9:
  mov    -0x64(%rbp),%edx
  mov    -0x54(%rbp),%eax
  add    %edx,%eax
  cltd
  shr    $0x1e,%edx
  add    %edx,%eax
  and    $0x3,%eax
  sub    %edx,%eax
  mov    %eax,%edi
  call   <data_getroadlen@plt>
  cmp    %eax,-0x3c(%rbp)
  jge    L158
  mov    -0x64(%rbp),%edx
  mov    -0x54(%rbp),%eax
  add    %edx,%eax
  cltd
  shr    $0x1e,%edx
  add    %edx,%eax
  and    $0x3,%eax
  sub    %edx,%eax
  mov    %eax,%edi
  call   <data_getroadlen@plt>
  mov    %eax,-0x3c(%rbp)
L158:
  addl   $0x1,-0x54(%rbp)
L155:
  cmpl   $0x3,-0x54(%rbp)
  jle    L9
  mov    -0x68(%rbp),%eax
  mov    %eax,%edi
  call   <data_poslegal@plt>
  test   %rax,%rax
  je     L163
  mov    -0x68(%rbp),%edx
  mov    -0x64(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <ai_vertweight@plt>
  mov    %eax,-0x40(%rbp)
  mov    -0x40(%rbp),%eax
  imul   %eax,%eax
  mov    %eax,-0x40(%rbp)
L163:
  movl   $0x0,-0x58(%rbp)
  jmp    L133
L2:
  mov    -0x40(%rbp),%eax
  neg    %eax
  mov    %eax,-0x50(%rbp)
  mov    -0x58(%rbp),%eax
  cltq
  mov    -0x30(%rbp,%rax,4),%edx
  mov    -0x68(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <road_freeedge@plt>
  test   %rax,%rax
  je     L39
  mov    -0x70(%rbp),%rcx
  mov    -0x64(%rbp),%eax
  mov    $0x0,%edx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <data_hypotheticalroadlength@plt>
  mov    %eax,-0x38(%rbp)
  mov    -0x70(%rbp),%rax
  mov    -0x68(%rbp),%edx
  mov    %edx,(%rax)
  mov    -0x70(%rbp),%rax
  lea    0x4(%rax),%rdx
  mov    -0x58(%rbp),%eax
  cltq
  mov    -0x30(%rbp,%rax,4),%eax
  mov    %eax,(%rdx)
  mov    -0x70(%rbp),%rcx
  mov    -0x64(%rbp),%eax
  mov    $0x1,%edx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <data_hypotheticalroadlength@plt>
  mov    %eax,-0x34(%rbp)
  cmpl   $0x4,-0x34(%rbp)
  jle    L105
  mov    -0x34(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jle    L105
  mov    -0x34(%rbp),%eax
  cmp    -0x38(%rbp),%eax
  jle    L105
  addl   $0x5,-0x50(%rbp)
L105:
  mov    -0x58(%rbp),%eax
  cltq
  mov    -0x30(%rbp,%rax,4),%eax
  mov    %eax,%edi
  call   <data_poslegal@plt>
  test   %rax,%rax
  je     L161
  mov    -0x58(%rbp),%eax
  cltq
  mov    -0x30(%rbp,%rax,4),%edx
  mov    -0x64(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <ai_vertweight@plt>
  mov    %eax,%ebx
  mov    -0x58(%rbp),%eax
  cltq
  mov    -0x30(%rbp,%rax,4),%edx
  mov    -0x64(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <ai_vertweight@plt>
  imul   %ebx,%eax
  add    %eax,%eax
  add    %eax,-0x50(%rbp)
L161:
  mov    -0x58(%rbp),%eax
  cltq
  mov    -0x30(%rbp,%rax,4),%eax
  lea    -0x24(%rbp),%rdx
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <ai_surroundingverts@plt>
  movl   $0x0,-0x4c(%rbp)
  movl   $0x0,-0x54(%rbp)
  jmp    L164
L82:
  mov    -0x54(%rbp),%eax
  cltq
  mov    -0x24(%rbp,%rax,4),%edx
  mov    -0x58(%rbp),%eax
  cltq
  mov    -0x30(%rbp,%rax,4),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <road_freeedge@plt>
  test   %rax,%rax
  je     L101
  mov    -0x54(%rbp),%eax
  cltq
  mov    -0x24(%rbp,%rax,4),%eax
  mov    %eax,%edi
  call   <data_poslegal@plt>
  test   %rax,%rax
  je     L101
  mov    -0x54(%rbp),%eax
  cltq
  mov    -0x24(%rbp,%rax,4),%edx
  mov    -0x64(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <ai_vertweight@plt>
  cmp    %eax,-0x4c(%rbp)
  jge    L101
  mov    -0x54(%rbp),%eax
  cltq
  mov    -0x24(%rbp,%rax,4),%edx
  mov    -0x64(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <ai_vertweight@plt>
  mov    %eax,-0x4c(%rbp)
L101:
  addl   $0x1,-0x54(%rbp)
L164:
  cmpl   $0x2,-0x54(%rbp)
  jle    L82
  mov    -0x4c(%rbp),%eax
  imul   %eax,%eax
  add    %eax,-0x50(%rbp)
  mov    -0x50(%rbp),%eax
  cmp    -0x48(%rbp),%eax
  jle    L39
  mov    -0x50(%rbp),%eax
  mov    %eax,-0x48(%rbp)
  mov    -0x58(%rbp),%eax
  cltq
  mov    -0x30(%rbp,%rax,4),%eax
  mov    %eax,-0x44(%rbp)
L39:
  addl   $0x1,-0x58(%rbp)
L133:
  cmpl   $0x2,-0x58(%rbp)
  jle    L2
  mov    -0x70(%rbp),%rax
  mov    -0x44(%rbp),%edx
  mov    %edx,(%rax)
  mov    -0x70(%rbp),%rax
  lea    0x4(%rax),%rdx
  mov    -0x48(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x70(%rbp),%rax
  mov    -0x18(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L95
  call   <__stack_chk_fail@plt>
L95:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
int *ai_roadfromvert(int player, int vert, int ret[2]) {
  int i, j, weight, w;
  int maxweight = 0;
  int dest = 0;
  int sur[3];
  ai_surroundingverts(vert, sur);
  int handicap = 0;
  int roadlen, newroadlen, nextlongest;
  nextlongest = 0;
  for (j = 1; j < 4; j++) {
    if (data_getroadlen((player + j) % 4) > nextlongest) {
      nextlongest = data_getroadlen((player + j) % 4);
    }
  }
  if (data_poslegal(vert)) {
    handicap = ai_vertweight(player, vert);
    handicap *= handicap;
  }
  for (i = 0; i < 3; i++) {
    weight = handicap * -1;
    if (road_freeedge(vert, sur[i])) {
      roadlen = data_hypotheticalroadlength(player, ret, 0);
      ret[0] = vert;
      ret[1] = sur[i];
      newroadlen = data_hypotheticalroadlength(player, ret, 1);
      if (newroadlen >= 5 && newroadlen > nextlongest && newroadlen > roadlen) {
        weight += 5;
      }
      if (data_poslegal(sur[i]))
        weight += ai_vertweight(player, sur[i]) * ai_vertweight(player, sur[i]) * 2;
      int sur2[3];
      ai_surroundingverts(sur[i], sur2);
      w = 0;
      for (j = 0; j < 3; j++) {
        if (road_freeedge(sur[i], sur2[j]) && data_poslegal(sur2[j]))
          if (ai_vertweight(player, sur2[j]) > w)
            w = ai_vertweight(player, sur2[j]);
      }
      weight += w * w;
      if (weight > maxweight) {
        maxweight = weight;
        dest = sur[i];
      }
    }
  }
  ret[0] = dest;
  ret[1] = maxweight;
  return ret;
}
```