ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 下面的汇编指令对应的C源代码是什么：

```asm
<computer_move>:
  endbr64
  push   %r15
  mov    %rsi,%r8
  movsbl %dl,%r15d
  push   %r14
  mov    %rdi,%r14
  push   %r13
  push   %r12
  mov    $0x40,%r12d
  push   %rbp
  push   %rbx
  sub    $0xf8,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0xe8(%rsp)
  xor    %eax,%eax
  cmp    $0x4f,%dl
  mov    $0x4f,%eax
  lea    0x20(%rsp),%rbp
  movl   $0x64,0x14(%rsp)
  cmovne %eax,%r12d
  xor    %r13d,%r13d
  movl   $0x0,0x1c(%rsp)
  movl   $0x0,0x18(%rsp)
L47:
  xor    %ebx,%ebx
  jmp    L17
  nopl   0x0(%rax,%rax,1)
L45:
  add    $0x1,%rbx
  cmp    $0x6,%rbx
  je     L65
L17:
  mov    (%r8,%rbx,4),%eax
  mov    %ebx,%edx
  test   %eax,%eax
  je     L45
  movdqu (%r14),%xmm0
  mov    0x20(%r14),%eax
  mov    %r15d,%ecx
  mov    %r13d,%esi
  movdqu 0x10(%r14),%xmm1
  mov    %rbp,%rdi
  mov    %r8,0x8(%rsp)
  movaps %xmm0,0x20(%rsp)
  movaps %xmm1,0x30(%rsp)
  mov    %eax,0x40(%rsp)
  call   <make_move@plt>
  lea    0x50(%rsp),%rsi
  mov    %r12d,%edx
  mov    %rbp,%rdi
  mov    %rsi,(%rsp)
  call   <valid_moves@plt>
  mov    (%rsp),%rsi
  mov    %r12d,%edx
  mov    %rbp,%rdi
  call   <best_move@plt>
  cmp    0x14(%rsp),%eax
  mov    0x8(%rsp),%r8
  jge    L45
  mov    %ebx,0x1c(%rsp)
  add    $0x1,%rbx
  mov    %eax,0x14(%rsp)
  mov    %r13d,0x18(%rsp)
  cmp    $0x6,%rbx
  jne    L17
L65:
  add    $0x1,%r13d
  add    $0x18,%r8
  cmp    $0x6,%r13d
  jne    L47
  mov    0x1c(%rsp),%edx
  mov    0x18(%rsp),%esi
  mov    %r15d,%ecx
  mov    %r14,%rdi
  call   <make_move@plt>
  mov    0xe8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L64
  add    $0xf8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L64:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void computer_move(char board[][6], int moves[][6], char player) {
  int row = 0;
  int col = 0;
  int best_row = 0;
  int best_col = 0;
  int i = 0;
  int j = 0;
  int new_score = 0;
  int score = 100;
  char temp_board[6][6];
  int temp_moves[6][6];
  char opponent = (player == 'O') ? '@' : 'O';
  for (row = 0; row < 6; row++)
    for (col = 0; col < 6; col++) {
      if (moves[row][col] == 0)
        continue;
      for (i = 0; i < 6; i++)
        for (j = 0; j < 6; j++)
          temp_board[i][j] = board[i][j];
      make_move(temp_board, row, col, player);
      valid_moves(temp_board, temp_moves, opponent);
      new_score = best_move(temp_board, temp_moves, opponent);
      if (new_score < score) {
        score = new_score;
        best_row = row;
        best_col = col;
      }
    }
  make_move(board, best_row, best_col, player);
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<mapCharToCodeBIN>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    %rsi,-0x10(%rbp)
  mov    %edx,%eax
  mov    %al,-0x14(%rbp)
  movsbl -0x14(%rbp),%eax
  cmp    $0x4e,%eax
  je     L64
  cmp    $0x4e,%eax
  jg     L1
  cmp    $0x31,%eax
  je     L10
  cmp    $0x31,%eax
  jg     L1
  cmp    $0x2d,%eax
  je     L4
  cmp    $0x30,%eax
  jne    L1
  mov    -0x8(%rbp),%rax
  movl   $0x0,(%rax)
  mov    -0x10(%rbp),%rax
  movl   $0x1,(%rax)
  jmp    L61
L10:
  mov    -0x8(%rbp),%rax
  movl   $0x1,(%rax)
  mov    -0x10(%rbp),%rax
  movl   $0x1,(%rax)
  jmp    L61
L4:
  mov    -0x8(%rbp),%rax
  movl   $0x2,(%rax)
  mov    -0x10(%rbp),%rax
  movl   $0x0,(%rax)
  jmp    L61
L64:
  mov    -0x8(%rbp),%rax
  movl   $0x2,(%rax)
  mov    -0x10(%rbp),%rax
  movl   $0x0,(%rax)
  jmp    L61
L1:
  mov    $0x0,%edi
  call   <assert@plt>
  nop
L61:
  nop
  leave
  ret
```

assistant: ```c
void mapCharToCodeBIN(unsigned int *code, unsigned int *valid, char in) {
  switch (in) {
  case '0':
    *code = 0u;
    *valid = 1u;
    break;
  case '1':
    *code = 1u;
    *valid = 1u;
    break;
  case '-':
    *code = 2u;
    *valid = 0u;
    break;
  case 'N':
    *code = 2u;
    *valid = 0u;
    break;
  default:
    assert(0);
  }
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<mapCharToCodeBIN>:
  endbr64
  cmp    $0x31,%dl
  je     L24
  jg     L10
  cmp    $0x2d,%dl
  je     L5
  cmp    $0x30,%dl
  jne    L41
  movl   $0x0,(%rdi)
  movl   $0x1,(%rsi)
  ret
L10:
  cmp    $0x4e,%dl
  jne    L41
  movl   $0x2,(%rdi)
  movl   $0x0,(%rsi)
  ret
L24:
  movl   $0x1,(%rdi)
  movl   $0x1,(%rsi)
  ret
L5:
  movl   $0x2,(%rdi)
  movl   $0x0,(%rsi)
  ret
L41:
  sub    $0x8,%rsp
  mov    $0x0,%edi
  call   <assert@plt>
  add    $0x8,%rsp
  ret
```

assistant: ```c
void mapCharToCodeBIN(unsigned int *code, unsigned int *valid, char in) {
  switch (in) {
  case '0':
    *code = 0u;
    *valid = 1u;
    break;
  case '1':
    *code = 1u;
    *valid = 1u;
    break;
  case '-':
    *code = 2u;
    *valid = 0u;
    break;
  case 'N':
    *code = 2u;
    *valid = 0u;
    break;
  default:
    assert(0);
  }
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<mapCharToCodeBIN>:
  endbr64
  cmp    $0x31,%dl
  je     L15
  jg     L22
  cmp    $0x2d,%dl
  je     L10
  cmp    $0x30,%dl
  jne    L18
  movl   $0x0,(%rdi)
  movl   $0x1,(%rsi)
  ret
  nopw   0x0(%rax,%rax,1)
L22:
  cmp    $0x4e,%dl
  jne    L18
L10:
  movl   $0x2,(%rdi)
  movl   $0x0,(%rsi)
  ret
  nopw   0x0(%rax,%rax,1)
L15:
  movl   $0x1,(%rdi)
  movl   $0x1,(%rsi)
  ret
  nopl   (%rax)
L18:
  xor    %edi,%edi
  jmp    1050 <assert@plt>
```

assistant: ```c
void mapCharToCodeBIN(unsigned int *code, unsigned int *valid, char in) {
  switch (in) {
  case '0':
    *code = 0u;
    *valid = 1u;
    break;
  case '1':
    *code = 1u;
    *valid = 1u;
    break;
  case '-':
    *code = 2u;
    *valid = 0u;
    break;
  case 'N':
    *code = 2u;
    *valid = 0u;
    break;
  default:
    assert(0);
  }
}
```
user: Translate the below assembly code into C programming language:

```asm
<mapCharToCodeBIN>:
  endbr64
  cmp    $0x31,%dl
  je     L44
  jg     L27
  cmp    $0x2d,%dl
  je     L43
  cmp    $0x30,%dl
  jne    L48
  movl   $0x0,(%rdi)
  movl   $0x1,(%rsi)
  ret
  nopw   0x0(%rax,%rax,1)
L27:
  cmp    $0x4e,%dl
  jne    L48
L43:
  movl   $0x2,(%rdi)
  movl   $0x0,(%rsi)
  ret
  nopw   0x0(%rax,%rax,1)
L44:
  movl   $0x1,(%rdi)
  movl   $0x1,(%rsi)
  ret
  nopl   (%rax)
L48:
  xor    %edi,%edi
  jmp    1050 <assert@plt>
```

assistant: ```c
void mapCharToCodeBIN(unsigned int *code, unsigned int *valid, char in) {
  switch (in) {
  case '0':
    *code = 0u;
    *valid = 1u;
    break;
  case '1':
    *code = 1u;
    *valid = 1u;
    break;
  case '-':
    *code = 2u;
    *valid = 0u;
    break;
  case 'N':
    *code = 2u;
    *valid = 0u;
    break;
  default:
    assert(0);
  }
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x24(%rbp)
  movl   $0x0,-0x14(%rbp)
  movl   $0x64,-0x10(%rbp)
  movl   $0x3e8,-0xc(%rbp)
  movl   $0x2710,-0x8(%rbp)
  movl   $0x186a0,-0x4(%rbp)
  jmp    L64
L92:
  addl   $0x1,-0x14(%rbp)
L64:
  cmpl   $0x3e7,-0x14(%rbp)
  jle    L92
  jmp    L29
L80:
  mov    -0xc(%rbp),%eax
  add    %eax,-0x10(%rbp)
L29:
  cmpl   $0x3e7,-0x10(%rbp)
  jle    L80
  jmp    L56
L51:
  mov    -0x10(%rbp),%eax
  sub    %eax,-0xc(%rbp)
L56:
  cmpl   $0x64,-0xc(%rbp)
  jg     L51
  jmp    L60
L44:
  mov    -0xc(%rbp),%eax
  add    %eax,-0x8(%rbp)
L60:
  cmpl   $0x3e8,-0x8(%rbp)
  jg     L44
  jmp    L59
L98:
  mov    -0x8(%rbp),%eax
  sub    %eax,-0x4(%rbp)
L59:
  cmpl   $0x1,-0x4(%rbp)
  jg     L98
  mov    $0x0,%eax
  pop    %rbp
  ret
```

assistant: ```c
int main(int n) {
  int i, j, k, l, m;
  i = 0;
  j = 100;
  k = 1000;
  l = 10000;
  m = 100000;
  while (i < 1000)
    i = i + 1;
  while (j < 1000)
    j = j + k;
  while (k > 100)
    k = k - j;
  while (l > 1000)
    l = l + k;
  while (m > 1)
    m = m - l;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<main>:
  endbr64
  mov    $0x3e8,%eax
L23:
  sub    $0x1,%eax
  jne    L23
  mov    $0x5a,%eax
L10:
  sub    $0x1,%eax
  jne    L10
  mov    $0x186a0,%eax
L3:
  sub    $0x3e8,%eax
  jne    L3
  mov    $0x0,%eax
  ret
```

assistant: ```c
int main(int n) {
  int i, j, k, l, m;
  i = 0;
  j = 100;
  k = 1000;
  l = 10000;
  m = 100000;
  while (i < 1000)
    i = i + 1;
  while (j < 1000)
    j = j + k;
  while (k > 100)
    k = k - j;
  while (l > 1000)
    l = l + k;
  while (m > 1)
    m = m - l;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<main>:
  endbr64
  xor    %eax,%eax
  ret
```

assistant: ```c
int main(int n) {
  int i, j, k, l, m;
  i = 0;
  j = 100;
  k = 1000;
  l = 10000;
  m = 100000;
  while (i < 1000)
    i = i + 1;
  while (j < 1000)
    j = j + k;
  while (k > 100)
    k = k - j;
  while (l > 1000)
    l = l + k;
  while (m > 1)
    m = m - l;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<main>:
  endbr64
  xor    %eax,%eax
  ret
```

assistant: ```c
int main(int n) {
  int i, j, k, l, m;
  i = 0;
  j = 100;
  k = 1000;
  l = 10000;
  m = 100000;
  while (i < 1000)
    i = i + 1;
  while (j < 1000)
    j = j + k;
  while (k > 100)
    k = k - j;
  while (l > 1000)
    l = l + k;
  while (m > 1)
    m = m - l;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<getlinesize>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  movl   $0x0,-0x8(%rbp)
  jmp    L12
L47:
  mov    -0x8(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jge    L58
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    -0x4(%rbp),%edx
  mov    %dl,(%rax)
L58:
  addl   $0x1,-0x8(%rbp)
L12:
  mov    $0x0,%eax
  call   <getchar@plt>
  mov    %eax,-0x4(%rbp)
  mov    D0(%rip),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x4(%rbp)
  je     L15
  cmpl   $0xa,-0x4(%rbp)
  jne    L47
L15:
  cmpl   $0xa,-0x4(%rbp)
  jne    L16
  mov    -0x8(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jge    L55
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    -0x4(%rbp),%edx
  mov    %dl,(%rax)
L55:
  addl   $0x1,-0x8(%rbp)
L16:
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x8(%rbp),%eax
  leave
  ret
```

assistant: ```c
int getlinesize(char s[], int lim) {
  int c, i;
  for (i = 0; (c = getchar()) != EOF && c != '\n'; ++i) {
    if (i < lim) {
      s[i] = c;
    }
  }
  if (c == '\n') {
    if (i < lim) {
      s[i] = c;
    }
    ++i;
  }
  s[i] = '\0';
  return i;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<getlinesize>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%r13
  mov    %esi,%r12d
  mov    $0x0,%ebx
  jmp    L71
L52:
  add    $0x1,%rbx
L71:
  mov    %ebx,%ebp
  mov    $0x0,%eax
  call   <getchar@plt>
  mov    D6(%rip),%rdx
  cmp    %eax,(%rdx)
  je     L64
  cmp    $0xa,%eax
  je     L64
  cmp    %ebx,%r12d
  jle    L52
  mov    %al,0x0(%r13,%rbx,1)
  jmp    L52
L64:
  cmp    $0xa,%eax
  je     L79
L30:
  movslq %ebp,%rax
  movb   $0x0,0x0(%r13,%rax,1)
  mov    %ebp,%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L79:
  cmp    %r12d,%ebp
  jge    L27
  movslq %ebp,%rax
  movb   $0xa,0x0(%r13,%rax,1)
L27:
  add    $0x1,%ebp
  jmp    L30
```

assistant: ```c
int getlinesize(char s[], int lim) {
  int c, i;
  for (i = 0; (c = getchar()) != EOF && c != '\n'; ++i) {
    if (i < lim) {
      s[i] = c;
    }
  }
  if (c == '\n') {
    if (i < lim) {
      s[i] = c;
    }
    ++i;
  }
  s[i] = '\0';
  return i;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<getlinesize>:
  endbr64
  push   %r14
  xor    %r14d,%r14d
  push   %r13
  mov    %rdi,%r13
  push   %r12
  push   %rbp
  mov    D3(%rip),%rbp
  push   %rbx
  mov    %esi,%ebx
  jmp    L19
  nopl   (%rax)
L18:
  cmp    $0xa,%eax
  je     L63
  cmp    %r14d,%ebx
  jle    L42
  mov    %al,0x0(%r13,%r14,1)
L42:
  add    $0x1,%r14
L19:
  xor    %eax,%eax
  mov    %r14d,%r12d
  call   <getchar@plt>
  cmp    %eax,0x0(%rbp)
  jne    L18
  cmp    $0xa,%eax
  je     L63
L33:
  movslq %r12d,%rax
  pop    %rbx
  pop    %rbp
  movb   $0x0,0x0(%r13,%rax,1)
  mov    %r12d,%eax
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
L63:
  cmp    %ebx,%r12d
  jge    L13
  movslq %r12d,%rax
  movb   $0xa,0x0(%r13,%rax,1)
L13:
  add    $0x1,%r12d
  jmp    L33
```

assistant: ```c
int getlinesize(char s[], int lim) {
  int c, i;
  for (i = 0; (c = getchar()) != EOF && c != '\n'; ++i) {
    if (i < lim) {
      s[i] = c;
    }
  }
  if (c == '\n') {
    if (i < lim) {
      s[i] = c;
    }
    ++i;
  }
  s[i] = '\0';
  return i;
}
```
user: Translate the below assembly code into C programming language:

```asm
<getlinesize>:
  endbr64
  push   %r14
  xor    %r14d,%r14d
  push   %r13
  mov    %rdi,%r13
  push   %r12
  push   %rbp
  mov    D0(%rip),%rbp
  push   %rbx
  mov    %esi,%ebx
  jmp    L66
  nopl   (%rax)
L20:
  cmp    $0xa,%eax
  je     L51
  cmp    %r14d,%ebx
  jle    L31
  mov    %al,0x0(%r13,%r14,1)
L31:
  add    $0x1,%r14
L66:
  xor    %eax,%eax
  mov    %r14d,%r12d
  call   <getchar@plt>
  cmp    %eax,0x0(%rbp)
  jne    L20
  cmp    $0xa,%eax
  je     L51
L30:
  movslq %r12d,%rax
  pop    %rbx
  pop    %rbp
  movb   $0x0,0x0(%r13,%rax,1)
  mov    %r12d,%eax
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
L51:
  cmp    %ebx,%r12d
  jge    L13
  movslq %r12d,%rax
  movb   $0xa,0x0(%r13,%rax,1)
L13:
  add    $0x1,%r12d
  jmp    L30
```

assistant: ```c
int getlinesize(char s[], int lim) {
  int c, i;
  for (i = 0; (c = getchar()) != EOF && c != '\n'; ++i) {
    if (i < lim) {
      s[i] = c;
    }
  }
  if (c == '\n') {
    if (i < lim) {
      s[i] = c;
    }
    ++i;
  }
  s[i] = '\0';
  return i;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movq   $0x0,-0x30(%rbp)
  movq   $0x0,-0x28(%rbp)
  movq   $0x0,-0x20(%rbp)
  movq   $0x0,-0x18(%rbp)
  movq   $0x0,-0x10(%rbp)
  lea    D21(%rip),%rax
  mov    %rax,-0x30(%rbp)
  lea    D37(%rip),%rax
  mov    %rax,-0x28(%rbp)
  lea    D11(%rip),%rax
  mov    %rax,-0x20(%rbp)
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,%esi
  lea    D19(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L6
  call   <__stack_chk_fail@plt>
L6:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: data_label: D21
datatype: string
name: disassemble_data
arguments: data_label: D37
datatype: string
name: disassemble_data
arguments: data_label: D11
datatype: string
name: disassemble_data
arguments: data_label: D19
datatype: string

tool: D21: coffe

tool: D37: teasodawater

tool: D11: juice

tool: D19: %zd

assistant: ```c
int main() {
  char *lista[5] = {"coffe",
                    "tea"
                    "soda"
                    "water",
                    "juice"};
  printf("%zd", strlen(lista[0]));
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  lea    D4(%rip),%rdi
  call   <strlen@plt>
  mov    %eax,%esi
  lea    D6(%rip),%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: parse_data
arguments: data_label: D4
type: string
name: parse_data
arguments: data_label: D6
type: string

tool: D4: coffe

tool: D6: %zd

assistant: ```c
int main() {
  char *lista[5] = {"coffe",
                    "tea"
                    "soda"
                    "water",
                    "juice"};
  printf("%zd", strlen(lista[0]));
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  lea    D8(%rip),%rdi
  call   <strlen@plt>
  lea    D1(%rip),%rdi
  mov    %eax,%esi
  call   <printf@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: parse_data
arguments: data_label: D8
type_guessed: string
name: parse_data
arguments: data_label: D1
type_guessed: string

tool: D8: coffe

tool: D1: %zd

assistant: ```c
int main() {
  char *lista[5] = {"coffe",
                    "tea"
                    "soda"
                    "water",
                    "juice"};
  printf("%zd", strlen(lista[0]));
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  lea    D6(%rip),%rdi
  call   <strlen@plt>
  lea    D0(%rip),%rdi
  mov    %eax,%esi
  call   <printf@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D6
type_infered: string
name: extract_symbolic_data
arguments: data_label: D0
type_infered: string

tool: D6: coffe

tool: D0: %zd

assistant: ```c
int main() {
  char *lista[5] = {"coffe",
                    "tea"
                    "soda"
                    "water",
                    "juice"};
  printf("%zd", strlen(lista[0]));
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<mapTestsuiteRWDAdd>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %rcx,-0x40(%rbp)
  mov    %r8,-0x48(%rbp)
  mov    %r9d,-0x4c(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <mapGetKeySize@plt>
  mov    %eax,-0x20(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <mapGetValueSize@plt>
  mov    %eax,-0x1c(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <mapGetKeyCount@plt>
  mov    %rax,%rbx
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <mapGetMapSize@plt>
  cmp    %rax,%rbx
  setge  %al
  movzbl %al,%eax
  mov    %eax,-0x18(%rbp)
  mov    -0x4c(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rax,%rdx
  mov    -0x4c(%rbp),%eax
  imul   -0x20(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x30(%rbp),%rax
  add    %rax,%rcx
  mov    -0x28(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <mapAddReturnID@plt>
  mov    %eax,-0x14(%rbp)
  cmpl   $0x0,-0x14(%rbp)
  jns    L20
  mov    -0x4c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  jne    L52
  cmpl   $0x0,-0x18(%rbp)
  je     L71
L52:
  mov    $0x1,%eax
  jmp    L32
L71:
  mov    $0x0,%eax
  jmp    L32
L20:
  mov    -0x4c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  jne    L69
  cmpl   $0x0,-0x18(%rbp)
  je     L15
L69:
  mov    $0x0,%eax
  jmp    L32
L15:
  mov    -0x4c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movl   $0x1,(%rax)
  mov    -0x4c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rax,%rdx
  mov    -0x14(%rbp),%eax
  mov    %eax,(%rdx)
  mov    $0x1,%eax
L32:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
int mapTestsuiteRWDAdd(struct s_map *map, unsigned char *keys, unsigned char *values, int *states, int *keyids, int nr) {
  int key_size = mapGetKeySize(map);
  int value_size = mapGetValueSize(map);
  int toobig = (!(mapGetKeyCount(map) < mapGetMapSize(map)));
  int ret = mapAddReturnID(map, &keys[nr * key_size], &values[nr * value_size]);
  if (ret < 0) {
    if (states[nr] || toobig) {
      return 1;
    } else {
      return 0;
    }
  } else {
    if (states[nr] || toobig) {
      return 0;
    } else {
      states[nr] = 1;
      keyids[nr] = ret;
      return 1;
    }
  }
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<mapTestsuiteRWDAdd>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,%rbp
  mov    %rsi,0x8(%rsp)
  mov    %rdx,0x10(%rsp)
  mov    %rcx,%r14
  mov    %r8,0x18(%rsp)
  mov    %r9d,%ebx
  call   <mapGetKeySize@plt>
  mov    %eax,%r12d
  mov    %rbp,%rdi
  call   <mapGetValueSize@plt>
  mov    %eax,%r13d
  mov    %rbp,%rdi
  call   <mapGetKeyCount@plt>
  mov    %rax,%r15
  mov    %rbp,%rdi
  call   <mapGetMapSize@plt>
  cmp    %rax,%r15
  setge  %r15b
  movzbl %r15b,%r15d
  imul   %ebx,%r13d
  movslq %r13d,%r13
  mov    0x10(%rsp),%rdx
  add    %r13,%rdx
  imul   %ebx,%r12d
  movslq %r12d,%r12
  mov    0x8(%rsp),%rsi
  add    %r12,%rsi
  mov    %rbp,%rdi
  call   <mapAddReturnID@plt>
  test   %eax,%eax
  js     L25
  movslq %ebx,%rbx
  lea    (%r14,%rbx,4),%rcx
  mov    $0x0,%edx
  or     (%rcx),%r15d
  jne    L4
  movl   $0x1,(%rcx)
  mov    0x18(%rsp),%rcx
  mov    %eax,(%rcx,%rbx,4)
  mov    $0x1,%edx
  jmp    L4
L25:
  movslq %ebx,%rbx
  or     (%r14,%rbx,4),%r15d
  setne  %dl
  movzbl %dl,%edx
L4:
  mov    %edx,%eax
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
int mapTestsuiteRWDAdd(struct s_map *map, unsigned char *keys, unsigned char *values, int *states, int *keyids, int nr) {
  int key_size = mapGetKeySize(map);
  int value_size = mapGetValueSize(map);
  int toobig = (!(mapGetKeyCount(map) < mapGetMapSize(map)));
  int ret = mapAddReturnID(map, &keys[nr * key_size], &values[nr * value_size]);
  if (ret < 0) {
    if (states[nr] || toobig) {
      return 1;
    } else {
      return 0;
    }
  } else {
    if (states[nr] || toobig) {
      return 0;
    } else {
      states[nr] = 1;
      keyids[nr] = ret;
      return 1;
    }
  }
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<mapTestsuiteRWDAdd>:
  endbr64
  push   %r15
  mov    %rcx,%r15
  push   %r14
  push   %r13
  mov    %rdx,%r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  movslq %r9d,%rbx
  sub    $0x18,%rsp
  mov    %r8,0x8(%rsp)
  call   <mapGetKeySize@plt>
  mov    %rbp,%rdi
  mov    %eax,0x4(%rsp)
  call   <mapGetValueSize@plt>
  mov    %rbp,%rdi
  mov    %eax,(%rsp)
  call   <mapGetKeyCount@plt>
  mov    %rbp,%rdi
  mov    %rax,%r14
  call   <mapGetMapSize@plt>
  mov    (%rsp),%edx
  mov    0x4(%rsp),%ecx
  mov    %rbp,%rdi
  cmp    %rax,%r14
  setge  %r14b
  imul   %ebx,%edx
  imul   %ebx,%ecx
  movzbl %r14b,%r14d
  movslq %edx,%rdx
  movslq %ecx,%rcx
  add    %r13,%rdx
  lea    (%r12,%rcx,1),%rsi
  call   <mapAddReturnID@plt>
  lea    (%r15,%rbx,4),%rdx
  test   %eax,%eax
  js     L38
  xor    %r8d,%r8d
  or     (%rdx),%r14d
  je     L19
L21:
  add    $0x18,%rsp
  mov    %r8d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L19:
  mov    0x8(%rsp),%rsi
  movl   $0x1,(%rdx)
  mov    $0x1,%r8d
  mov    %eax,(%rsi,%rbx,4)
  jmp    L21
  cs nopw 0x0(%rax,%rax,1)
L38:
  xor    %r8d,%r8d
  or     (%rdx),%r14d
  setne  %r8b
  jmp    L21
```

assistant: ```c
int mapTestsuiteRWDAdd(struct s_map *map, unsigned char *keys, unsigned char *values, int *states, int *keyids, int nr) {
  int key_size = mapGetKeySize(map);
  int value_size = mapGetValueSize(map);
  int toobig = (!(mapGetKeyCount(map) < mapGetMapSize(map)));
  int ret = mapAddReturnID(map, &keys[nr * key_size], &values[nr * value_size]);
  if (ret < 0) {
    if (states[nr] || toobig) {
      return 1;
    } else {
      return 0;
    }
  } else {
    if (states[nr] || toobig) {
      return 0;
    } else {
      states[nr] = 1;
      keyids[nr] = ret;
      return 1;
    }
  }
}
```