user: 请将以下的汇编代码转换成C语言代码：

```asm
<threeSumClosest>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %esi,%r13d
  push   %r12
  push   %rbp
  mov    %edx,%ebp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x18,%rsp
  call   <bubblesort@plt>
  mov    0x8(%rbx),%r12d
  mov    0x4(%rbx),%eax
  add    (%rbx),%eax
  add    %eax,%r12d
  cmp    %ebp,%r12d
  jge    L72
  movslq %r13d,%rdx
  shl    $0x2,%rdx
  mov    -0x4(%rbx,%rdx,1),%esi
  mov    -0x8(%rbx,%rdx,1),%r14d
  add    %esi,%r14d
  add    -0xc(%rbx,%rdx,1),%r14d
  cmp    %ebp,%r14d
  jle    L211
  add    %esi,%eax
  lea    -0x2(%r13),%r15d
  cmp    %eax,%ebp
  jle    L158
  test   %r15d,%r15d
  jle    L155
  lea    -0x3(%r13),%edi
  xor    %edx,%edx
  jmp    L125
  nopl   0x0(%rax)
L2:
  lea    0x1(%rdx),%rax
  cmp    %rdi,%rdx
  je     L136
  mov    %rax,%rdx
L125:
  mov    0x8(%rbx,%rdx,4),%eax
  add    0x4(%rbx,%rdx,4),%eax
  mov    %edx,%ecx
  add    %esi,%eax
  cmp    %eax,%ebp
  jg     L2
L136:
  mov    %r12d,%edx
  mov    %r14d,%esi
  lea    D7(%rip),%rdi
  mov    %ecx,0xc(%rsp)
  call   <printf@plt>
  mov    0xc(%rsp),%ecx
  cmp    %r15d,%ecx
  jge    L195
  lea    -0x1(%r13),%r9d
  movslq %ecx,%rdi
  mov    %r12d,%esi
L108:
  lea    0x1(%rcx),%r8d
  cmp    %r9d,%r8d
  jge    L56
  mov    %r15d,%eax
  add    $0x2,%ecx
  sub    %r8d,%eax
  lea    0x3(%rdi,%rax,1),%r10
L197:
  cmp    %ecx,%r13d
  jle    L12
  mov    -0x4(%rbx,%rcx,4),%edx
  movslq %ecx,%rax
  add    (%rbx,%rdi,4),%edx
  jmp    L109
  nopl   0x0(%rax)
L101:
  mov    %r12d,%esi
L115:
  add    $0x1,%rax
  cmp    %eax,%r13d
  jle    L12
L109:
  mov    (%rbx,%rax,4),%r12d
  add    %edx,%r12d
  cmp    %r12d,%ebp
  je     L72
  jle    L113
  cmp    %esi,%r12d
  jg     L101
L113:
  cmp    %r12d,%ebp
  jge    L115
  cmp    %r12d,%r14d
  cmovg  %r12d,%r14d
L12:
  add    $0x1,%rcx
  cmp    %rcx,%r10
  jne    L197
L56:
  add    $0x1,%rdi
  cmp    %r15d,%r8d
  je     L39
  mov    %r8d,%ecx
  jmp    L108
  nopw   0x0(%rax,%rax,1)
L211:
  mov    %r14d,%r12d
L72:
  add    $0x18,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L155:
  mov    %r14d,%esi
  mov    %r12d,%edx
  lea    D7(%rip),%rdi
  call   <printf@plt>
  mov    %r12d,%esi
L39:
  lea    (%rsi,%r14,1),%eax
  add    %ebp,%ebp
  cmp    %ebp,%eax
  cmovle %r14d,%esi
  mov    %esi,%r12d
  jmp    L72
L158:
  xor    %ecx,%ecx
  jmp    L136
L195:
  mov    %r12d,%esi
  jmp    L39
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D7
type_infered: string

tool: D7: max:%d min:%d 


assistant: ```c
int threeSumClosest(int *A, int n, int target) {
  int i = 0, j = 0, k = 0;
  bubblesort(A, n);
  int min = A[0] + A[1] + A[2];
  int max = A[n - 1] + A[n - 2] + A[n - 3];
  if (min >= target)
    return min;
  if (max <= target)
    return max;
  int sum = A[0] + A[1] + A[n - 1];
  while (sum < target && i < n - 2) {
    i++;
    sum = A[i] + A[i + 1] + A[n - 1];
  }
  if (i > 0)
    i--;
  printf("max:%d min:%d \n", max, min);
  for (; i < n - 2; i++) {
    for (j = i + 1; j < n - 1; j++) {
      for (k = j + 1; k < n; k++) {
        sum = A[i] + A[j] + A[k];
        if (sum == target) {
          return target;
        }
        if (sum < target && sum > min)
          min = sum;
        if (sum > target) {
          if (sum < max)
            max = sum;
          break;
        }
      }
    }
  }
  if (max + min > target * 2)
    return min;
  return max;
}
```