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

```asm
<read_mosaic_contact>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x9c8,%rsp
  mov    0x2a00(%rsp),%rax
  mov    %rax,0x28(%rsp)
  mov    0x2a08(%rsp),%rax
  mov    %rdi,%r14
  mov    %rdi,0x8(%rsp)
  mov    %rax,0x30(%rsp)
  mov    0x2a10(%rsp),%rax
  mov    %rsi,0xb0(%rsp)
  lea    D62(%rip),%rsi
  mov    %rax,0x38(%rsp)
  mov    0x2a18(%rsp),%rax
  mov    %rdx,0xb8(%rsp)
  mov    %rax,0x40(%rsp)
  mov    0x2a20(%rsp),%rax
  mov    %rcx,0x70(%rsp)
  mov    %r8,0x78(%rsp)
  mov    %r9,0x20(%rsp)
  mov    %rax,0x48(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x29b8(%rsp)
  xor    %eax,%eax
  call   <get_dimlen@plt>
  movslq %eax,%rdi
  mov    %eax,0x14(%rsp)
  mov    %eax,%r13d
  mov    %rdi,%rbx
  shl    $0x3,%rdi
  call   <malloc@plt>
  movl   $0x0,0xc8(%rsp)
  mov    %rax,%rbp
  test   %ebx,%ebx
  jle    L221
  lea    0xc8(%rsp),%r15
  xor    %r12d,%r12d
  lea    D94(%rip),%rbx
  mov    %r15,0x18(%rsp)
  nopw   0x0(%rax,%rax,1)
L32:
  mov    $0xff,%edi
  movslq %r12d,%r12
  call   <malloc@plt>
  mov    %r15,%rcx
  mov    %rbx,%rsi
  mov    %r14,%rdi
  mov    %rax,0x0(%rbp,%r12,8)
  mov    %rax,%rdx
  xor    %eax,%eax
  call   <get_string_data_level@plt>
  mov    0xc8(%rsp),%eax
  lea    0x1(%rax),%r12d
  mov    %r12d,0xc8(%rsp)
  cmp    %r13d,%r12d
  jl     L32
  mov    0x8(%rsp),%rdi
  lea    D76(%rip),%rsi
  xor    %eax,%eax
  call   <get_dimlen@plt>
  movl   $0x0,0xc8(%rsp)
  mov    %eax,0xa8(%rsp)
  test   %eax,%eax
  jle    L177
L283:
  lea    0x28b0(%rsp),%rax
  lea    0x1cf(%rsp),%r12
  mov    %rax,0x58(%rsp)
  lea    0xcc(%rsp),%rax
  lea    D109(%rip),%rbx
  mov    %rax,0x50(%rsp)
  lea    0xd0(%rsp),%rax
  mov    %rax,(%rsp)
  lea    0x3cd(%rsp),%rax
  mov    %rax,0x68(%rsp)
  lea    0x2ce(%rsp),%rax
  mov    %rax,0x80(%rsp)
  lea    0x4cc(%rsp),%rax
  mov    %rax,0xa0(%rsp)
  lea    0x5cb(%rsp),%rax
  mov    %rax,0x98(%rsp)
  lea    0x6ca(%rsp),%rax
  mov    %rax,0x90(%rsp)
  lea    0x7c9(%rsp),%rax
  mov    %rax,0x88(%rsp)
  nopl   0x0(%rax)
L234:
  mov    0x58(%rsp),%r14
  mov    0x18(%rsp),%rcx
  lea    D45(%rip),%rsi
  xor    %eax,%eax
  mov    0x8(%rsp),%rdi
  mov    %r14,%rdx
  call   <get_string_data_level@plt>
  mov    0x50(%rsp),%r9
  mov    (%rsp),%r8
  xor    %eax,%eax
  mov    $0x28,%ecx
  mov    $0xff,%edx
  lea    D57(%rip),%rsi
  mov    %r14,%rdi
  call   <tokenize@plt>
  cmpl   $0x4,0xcc(%rsp)
  je     L55
  lea    D63(%rip),%rdi
  xor    %eax,%eax
  call   <error_handler@plt>
L55:
  mov    0x14(%rsp),%eax
  test   %eax,%eax
  jle    L197
  lea    0x1(%rax),%r14d
  mov    $0x1,%r15d
  jmp    L273
  nopl   0x0(%rax)
L243:
  add    $0x1,%r15
  cmp    %r15,%r14
  je     L83
L273:
  mov    -0x8(%rbp,%r15,8),%rdi
  mov    %r12,%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L243
  movslq 0xc8(%rsp),%rax
  mov    0xb0(%rsp),%rdx
  mov    %r15d,(%rdx,%rax,4)
L146:
  mov    %rbp,0x60(%rsp)
  mov    0x14(%rsp),%r15d
  xor    %r14d,%r14d
  mov    0x68(%rsp),%r13
  jmp    L158
  xchg   %ax,%ax
L287:
  add    $0x8,%rbp
  cmp    %r14d,%r15d
  jle    L282
L158:
  mov    0x0(%rbp),%rdi
  mov    %r13,%rsi
  add    $0x1,%r14d
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L287
  movslq 0xc8(%rsp),%rax
  mov    0xb8(%rsp),%rdx
  mov    0x60(%rsp),%rbp
  mov    %r14d,(%rdx,%rax,4)
L223:
  mov    0x58(%rsp),%r14
  mov    0x18(%rsp),%rcx
  lea    D68(%rip),%rsi
  xor    %eax,%eax
  mov    0x8(%rsp),%rdi
  mov    %r14,%rdx
  call   <get_string_data_level@plt>
  mov    0x50(%rsp),%r9
  mov    (%rsp),%r8
  xor    %eax,%eax
  mov    $0x28,%ecx
  mov    $0xff,%edx
  lea    D18(%rip),%rsi
  mov    %r14,%rdi
  call   <tokenize@plt>
  cmpl   $0x8,0xcc(%rsp)
  je     L317
  lea    D111(%rip),%rdi
  xor    %eax,%eax
  call   <error_handler@plt>
  mov    0xcc(%rsp),%edx
  test   %edx,%edx
  je     L58
L317:
  mov    (%rsp),%r13
  xor    %r14d,%r14d
  nopl   0x0(%rax,%rax,1)
L46:
  xor    %r15d,%r15d
  jmp    L310
  nopl   (%rax)
L313:
  add    $0x1,%r15
L310:
  mov    %r13,%rdi
  call   <strlen@plt>
  cmp    %r15,%rax
  jbe    L318
  movzbl 0x0(%r13,%r15,1),%eax
  sub    $0x30,%eax
  cmp    $0x9,%al
  jbe    L313
  mov    %rbx,%rdi
  xor    %eax,%eax
  call   <error_handler@plt>
  jmp    L313
  nopw   0x0(%rax,%rax,1)
L318:
  add    $0x1,%r14d
  add    $0xff,%r13
  cmp    %r14d,0xcc(%rsp)
  ja     L46
L58:
  mov    0x70(%rsp),%r15
  movslq 0xc8(%rsp),%rax
  mov    (%rsp),%rdi
  lea    (%r15,%rax,4),%r14
  xor    %eax,%eax
  call   <atoi@plt>
  mov    0x78(%rsp),%r13
  mov    %r12,%rdi
  mov    %eax,(%r14)
  movslq 0xc8(%rsp),%rax
  lea    0x0(%r13,%rax,4),%r14
  xor    %eax,%eax
  call   <atoi@plt>
  mov    0x20(%rsp),%rdx
  mov    0x80(%rsp),%rdi
  mov    %eax,(%r14)
  movslq 0xc8(%rsp),%rax
  lea    (%rdx,%rax,4),%r14
  xor    %eax,%eax
  call   <atoi@plt>
  mov    0x28(%rsp),%rcx
  mov    0x68(%rsp),%rdi
  mov    %eax,(%r14)
  movslq 0xc8(%rsp),%rax
  lea    (%rcx,%rax,4),%r14
  xor    %eax,%eax
  call   <atoi@plt>
  mov    0x30(%rsp),%rsi
  mov    0xa0(%rsp),%rdi
  mov    %eax,(%r14)
  movslq 0xc8(%rsp),%rax
  lea    (%rsi,%rax,4),%r14
  xor    %eax,%eax
  call   <atoi@plt>
  mov    0x38(%rsp),%rdi
  mov    %eax,(%r14)
  movslq 0xc8(%rsp),%rax
  lea    (%rdi,%rax,4),%r14
  mov    0x98(%rsp),%rdi
  xor    %eax,%eax
  call   <atoi@plt>
  mov    0x40(%rsp),%r10
  mov    0x90(%rsp),%rdi
  mov    %eax,(%r14)
  movslq 0xc8(%rsp),%rax
  lea    (%r10,%rax,4),%r14
  xor    %eax,%eax
  call   <atoi@plt>
  mov    0x48(%rsp),%r11
  mov    0x88(%rsp),%rdi
  mov    %eax,(%r14)
  movslq 0xc8(%rsp),%rax
  lea    (%r11,%rax,4),%r14
  xor    %eax,%eax
  call   <atoi@plt>
  mov    $0x2,%r8d
  mov    %eax,(%r14)
  movslq 0xc8(%rsp),%rax
  shl    $0x2,%rax
  lea    0x0(%r13,%rax,1),%rcx
  add    %r15,%rax
  mov    (%rcx),%esi
  mov    (%rax),%edi
  mov    %rax,%rdx
  xor    %eax,%eax
  call   <transfer_to_model_index@plt>
  mov    0x28(%rsp),%rcx
  mov    $0x2,%r8d
  mov    %eax,0x60(%rsp)
  mov    %eax,%r13d
  movslq 0xc8(%rsp),%rax
  shl    $0x2,%rax
  add    %rax,%rcx
  add    0x20(%rsp),%rax
  mov    (%rcx),%esi
  mov    (%rax),%edi
  mov    %rax,%rdx
  xor    %eax,%eax
  call   <transfer_to_model_index@plt>
  mov    0x38(%rsp),%rdi
  mov    $0x2,%r8d
  mov    %eax,%r15d
  movslq 0xc8(%rsp),%rax
  shl    $0x2,%rax
  lea    (%rdi,%rax,1),%rcx
  add    0x30(%rsp),%rax
  mov    (%rcx),%esi
  mov    (%rax),%edi
  mov    %rax,%rdx
  xor    %eax,%eax
  call   <transfer_to_model_index@plt>
  mov    0x48(%rsp),%r11
  mov    $0x2,%r8d
  mov    %eax,%r14d
  movslq 0xc8(%rsp),%rax
  shl    $0x2,%rax
  lea    (%r11,%rax,1),%rcx
  add    0x40(%rsp),%rax
  mov    (%rax),%edi
  mov    (%rcx),%esi
  mov    %rax,%rdx
  xor    %eax,%eax
  call   <transfer_to_model_index@plt>
  or     %r15d,%r13d
  mov    %eax,%edx
  je     L241
L135:
  mov    %r14d,%eax
  or     %edx,%eax
  je     L127
L226:
  mov    0x60(%rsp),%eax
  add    %edx,%r14d
  add    %r15d,%eax
  cmp    %r14d,%eax
  je     L250
  lea    D90(%rip),%rdi
  xor    %eax,%eax
  call   <error_handler@plt>
L250:
  mov    0xc8(%rsp),%eax
  add    $0x1,%eax
  mov    %eax,0xc8(%rsp)
  cmp    0xa8(%rsp),%eax
  jl     L234
  mov    0x14(%rsp),%eax
  test   %eax,%eax
  jle    L141
L177:
  mov    0x14(%rsp),%r12d
  xor    %ebx,%ebx
  nopl   0x0(%rax,%rax,1)
L22:
  mov    0x0(%rbp,%rbx,8),%rdi
  add    $0x1,%rbx
  call   <free@plt>
  cmp    %ebx,%r12d
  jg     L22
L141:
  mov    0x29b8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L137
  add    $0x29c8,%rsp
  mov    %rbp,%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1100 <free@plt>
L282:
  mov    0x60(%rsp),%rbp
L47:
  lea    D96(%rip),%rdi
  xor    %eax,%eax
  call   <error_handler@plt>
  jmp    L223
L83:
  lea    D86(%rip),%rdi
  xor    %eax,%eax
  call   <error_handler@plt>
  jmp    L146
L127:
  lea    D114(%rip),%rdi
  xor    %eax,%eax
  mov    %edx,0xac(%rsp)
  call   <error_handler@plt>
  mov    0xac(%rsp),%edx
  jmp    L226
L241:
  mov    %eax,0xac(%rsp)
  lea    D58(%rip),%rdi
  xor    %eax,%eax
  call   <error_handler@plt>
  mov    0xac(%rsp),%edx
  jmp    L135
L197:
  lea    D86(%rip),%rdi
  xor    %eax,%eax
  call   <error_handler@plt>
  jmp    L47
L221:
  mov    0x8(%rsp),%rdi
  lea    D76(%rip),%rsi
  xor    %eax,%eax
  call   <get_dimlen@plt>
  lea    0xc8(%rsp),%rdx
  movl   $0x0,0xc8(%rsp)
  mov    %eax,0xa8(%rsp)
  mov    %rdx,0x18(%rsp)
  test   %eax,%eax
  jg     L283
  jmp    L141
L137:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_tag: D62
type_guessed: string
name: unpack_data
arguments: data_tag: D94
type_guessed: string
name: unpack_data
arguments: data_tag: D76
type_guessed: string
name: unpack_data
arguments: data_tag: D109
type_guessed: string
name: unpack_data
arguments: data_tag: D45
type_guessed: string
name: unpack_data
arguments: data_tag: D57
type_guessed: string
name: unpack_data
arguments: data_tag: D63
type_guessed: string
name: unpack_data
arguments: data_tag: D68
type_guessed: string
name: unpack_data
arguments: data_tag: D18
type_guessed: string
name: unpack_data
arguments: data_tag: D111
type_guessed: string
name: unpack_data
arguments: data_tag: D90
type_guessed: string
name: unpack_data
arguments: data_tag: D96
type_guessed: string
name: unpack_data
arguments: data_tag: D86
type_guessed: string
name: unpack_data
arguments: data_tag: D114
type_guessed: string
name: unpack_data
arguments: data_tag: D58
type_guessed: string

tool: D62: ntiles

tool: D94: gridtiles

tool: D76: ncontact

tool: D109: Error from read_mosaic: some of the character in contact_indices except token is not digit number

tool: D45: contacts

tool: D57: :

tool: D63: Error from read_mosaic: number of elements in contact seperated by :/:: should be 4

tool: D68: contact_index

tool: D18: :,

tool: D111: Error from read_mosaic: number of elements in contact_index seperated by :/, should be 8

tool: D90: Error from read_mosaic_contact: It is not a line or overlap contact

tool: D96: error from read_mosaic: the second tile name specified in contact is not found in tile list

tool: D86: error from read_mosaic: the first tile name specified in contact is not found in tile list

tool: D114: Error from read_mosaic_contact:istart2==iend2 and jstart2==jend2

tool: D58: Error from read_mosaic_contact:istart1==iend1 and jstart1==jend1

assistant: ```c
void read_mosaic_contact(const char *mosaic_file, int *tile1, int *tile2, int *istart1, int *iend1, int *jstart1, int *jend1, int *istart2, int *iend2, int *jstart2, int *jend2) {
  char contacts[255];
  char **gridtiles;
  char pstring[40][255];
  int ntiles, ncontacts, n, m, l, found;
  unsigned int nstr;
  const int x_refine = 2, y_refine = 2;
  int i1_type, j1_type, i2_type, j2_type;
  ntiles = get_dimlen(mosaic_file, "ntiles");
  gridtiles = (char **)malloc(ntiles * sizeof(char *));
  for (n = 0; n < ntiles; n++) {
    gridtiles[n] = (char *)malloc(255 * sizeof(char));
    get_string_data_level(mosaic_file, "gridtiles", gridtiles[n], &n);
  }
  ncontacts = get_dimlen(mosaic_file, "ncontact");
  for (n = 0; n < ncontacts; n++) {
    get_string_data_level(mosaic_file, "contacts", contacts, &n);
    tokenize(contacts, ":", 255, 40, (char *)pstring, &nstr);
    if (nstr != 4)
      error_handler("Error from read_mosaic: number of elements "
                    "in contact seperated by :/:: should be 4");
    found = 0;
    for (m = 0; m < ntiles; m++) {
      if (strcmp(gridtiles[m], pstring[1]) == 0) {
        found = 1;
        tile1[n] = m + 1;
        break;
      }
    }
    if (!found)
      error_handler("error from read_mosaic: the first tile name specified "
                    "in contact is not found in tile list");
    found = 0;
    for (m = 0; m < ntiles; m++) {
      if (strcmp(gridtiles[m], pstring[3]) == 0) {
        found = 1;
        tile2[n] = m + 1;
        break;
      }
    }
    if (!found)
      error_handler("error from read_mosaic: the second tile name specified "
                    "in contact is not found in tile list");
    get_string_data_level(mosaic_file, "contact_index", contacts, &n);
    tokenize(contacts, ":,", 255, 40, (char *)pstring, &nstr);
    if (nstr != 8)
      error_handler("Error from read_mosaic: number of elements "
                    "in contact_index seperated by :/, should be 8");
    for (m = 0; m < nstr; m++)
      for (l = 0; l < strlen(pstring[m]); l++) {
        if (pstring[m][l] > '9' || pstring[m][l] < '0') {
          error_handler("Error from read_mosaic: some of the character in "
                        "contact_indices except token is not digit number");
        }
      }
    istart1[n] = atoi(pstring[0]);
    iend1[n] = atoi(pstring[1]);
    jstart1[n] = atoi(pstring[2]);
    jend1[n] = atoi(pstring[3]);
    istart2[n] = atoi(pstring[4]);
    iend2[n] = atoi(pstring[5]);
    jstart2[n] = atoi(pstring[6]);
    jend2[n] = atoi(pstring[7]);
    i1_type = transfer_to_model_index(istart1[n], iend1[n], istart1 + n, iend1 + n, x_refine);
    j1_type = transfer_to_model_index(jstart1[n], jend1[n], jstart1 + n, jend1 + n, y_refine);
    i2_type = transfer_to_model_index(istart2[n], iend2[n], istart2 + n, iend2 + n, x_refine);
    j2_type = transfer_to_model_index(jstart2[n], jend2[n], jstart2 + n, jend2 + n, y_refine);
    if (i1_type == 0 && j1_type == 0)
      error_handler("Error from read_mosaic_contact:istart1==iend1 and jstart1==jend1");
    if (i2_type == 0 && j2_type == 0)
      error_handler("Error from read_mosaic_contact:istart2==iend2 and jstart2==jend2");
    if (i1_type + j1_type != i2_type + j2_type)
      error_handler("Error from read_mosaic_contact: It is not a line or overlap contact");
  }
  for (m = 0; m < ntiles; m++) {
    free(gridtiles[m]);
  }
  free(gridtiles);
}
```