ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 请将以下的汇编代码转换成C语言代码：

```asm
<map>:
  endbr64
  mov    %edi,%eax
  push   %r15
  mov    %rdx,%rcx
  push   %r14
  imul   %esi,%eax
  mov    %edi,%r14d
  push   %r13
  mov    %esi,%r13d
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  test   %eax,%eax
  jle    L37
  mov    %rcx,%rdi
  movslq %eax,%rdx
  mov    $0x23,%esi
  call   <memset@plt>
  mov    %rax,%rcx
L37:
  test   %r14d,%r14d
  jle    L0
  movslq %r13d,%rax
  xor    %ebp,%ebp
  xor    %r12d,%r12d
  mov    %rax,(%rsp)
  lea    -0x1(%r13),%eax
  mov    %rax,0x8(%rsp)
  lea    0x1(%rcx,%rax,1),%rbx
  cs nopw 0x0(%rax,%rax,1)
L43:
  mov    $0xa,%edi
  add    $0x1,%r12d
  call   <putchar@plt>
  mov    %ebp,%eax
  add    %r13d,%ebp
  cmp    %ebp,%eax
  jge    L3
  mov    %rbx,%rdx
  sub    0x8(%rsp),%rdx
  lea    -0x1(%rdx),%r15
  nopl   0x0(%rax,%rax,1)
L36:
  movsbl (%r15),%edi
  add    $0x1,%r15
  call   <putchar@plt>
  cmp    %rbx,%r15
  jne    L36
L3:
  add    (%rsp),%rbx
  cmp    %r12d,%r14d
  jne    L43
L0:
  add    $0x18,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1090 <getch@plt>
```

assistant: ```c
void map(int order_r, int order_c, char matrix[]) {
  int p;
  p = (order_r * order_c) - 1;
  int i;
  int j;
  for (i = 0; i <= p; ++i) {
    matrix[i] = '#';
  }
  for (i = 0; i <= order_r - 1; ++i) {
    printf("\n");
    for (j = (i * order_c); j <= ((order_c) * (i + 1)) - 1; ++j) {
      printf("%c", matrix[j]);
    }
  }
  getch();
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<map>:
  endbr64
  mov    %edi,%eax
  push   %r15
  mov    %rdx,%rcx
  push   %r14
  imul   %esi,%eax
  mov    %edi,%r14d
  push   %r13
  mov    %esi,%r13d
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  test   %eax,%eax
  jle    L41
  mov    %rcx,%rdi
  movslq %eax,%rdx
  mov    $0x23,%esi
  call   <memset@plt>
  mov    %rax,%rcx
L41:
  test   %r14d,%r14d
  jle    L44
  movslq %r13d,%rax
  xor    %ebp,%ebp
  xor    %r12d,%r12d
  mov    %rax,(%rsp)
  lea    -0x1(%r13),%eax
  mov    %rax,0x8(%rsp)
  lea    0x1(%rcx,%rax,1),%rbx
  cs nopw 0x0(%rax,%rax,1)
L25:
  mov    $0xa,%edi
  add    $0x1,%r12d
  call   <putchar@plt>
  mov    %ebp,%eax
  add    %r13d,%ebp
  cmp    %ebp,%eax
  jge    L32
  mov    %rbx,%rdx
  sub    0x8(%rsp),%rdx
  lea    -0x1(%rdx),%r15
  nopl   0x0(%rax,%rax,1)
L20:
  movsbl (%r15),%edi
  add    $0x1,%r15
  call   <putchar@plt>
  cmp    %rbx,%r15
  jne    L20
L32:
  add    (%rsp),%rbx
  cmp    %r12d,%r14d
  jne    L25
L44:
  add    $0x18,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1090 <getch@plt>
```

assistant: ```c
void map(int order_r, int order_c, char matrix[]) {
  int p;
  p = (order_r * order_c) - 1;
  int i;
  int j;
  for (i = 0; i <= p; ++i) {
    matrix[i] = '#';
  }
  for (i = 0; i <= order_r - 1; ++i) {
    printf("\n");
    for (j = (i * order_c); j <= ((order_c) * (i + 1)) - 1; ++j) {
      printf("%c", matrix[j]);
    }
  }
  getch();
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<sentence_length_histogram>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  movl   $0x0,-0x14(%rbp)
  movl   $0x1,-0x10(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0xc(%rbp)
  mov    -0x30(%rbp),%rax
  mov    $0x400,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  movl   $0x0,-0x18(%rbp)
  jmp    L49
L52:
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  je     L53
  mov    -0xc(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x18(%rbp)
  jne    L14
L53:
  mov    -0x18(%rbp),%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x8(%rbp),%edx
  mov    -0x14(%rbp),%ecx
  mov    -0x28(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <words_count_region@plt>
  mov    %eax,-0x4(%rbp)
  cmpl   $0x0,-0x4(%rbp)
  jle    L40
  cmpl   $0xff,-0x4(%rbp)
  jg     L40
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm1
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movss  D4(%rip),%xmm0
  addss  %xmm1,%xmm0
  movss  %xmm0,(%rax)
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2ssl -0x10(%rbp),%xmm1
  comiss %xmm1,%xmm0
  jbe    L40
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  cvttss2si %xmm0,%eax
  mov    %eax,-0x10(%rbp)
L40:
  mov    -0x8(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x14(%rbp)
L14:
  addl   $0x1,-0x18(%rbp)
L49:
  mov    -0x18(%rbp),%eax
  cmp    -0xc(%rbp),%eax
  jl     L52
  movl   $0x0,-0x18(%rbp)
  jmp    L67
L55:
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2ssl -0x10(%rbp),%xmm1
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  divss  %xmm1,%xmm0
  movss  %xmm0,(%rax)
  addl   $0x1,-0x18(%rbp)
L67:
  cmpl   $0xff,-0x18(%rbp)
  jle    L55
  nop
  nop
  leave
  ret
```

tool_calls: name: unpack_data
arguments: label: D4
datatype: byte[4]

tool: {"D4": [0x00,0x00,0x80,0x3f]}

assistant: ```c
void sentence_length_histogram(char *text, float histogram[]) {
  int i, start_pos = 0, end_pos, words, max = 1;
  int length = strlen(text);
  memset((void *)histogram, '\0', 256 * sizeof(float));
  for (i = 0; i < length; i++) {
    if ((text[i] == '.') || (i == length - 1)) {
      end_pos = i;
      words = words_count_region(text, start_pos, end_pos);
      if ((words > 0) && (words < 256)) {
        histogram[words] = histogram[words] + 1;
        if (histogram[words] > max) {
          max = histogram[words];
        }
      }
      start_pos = end_pos + 1;
    }
  }
  for (i = 0; i < 256; i++) {
    histogram[i] /= max;
  }
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<sentence_length_histogram>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%r12
  mov    %rsi,%rbx
  call   <strlen@plt>
  mov    %eax,%r14d
  mov    $0x400,%edx
  mov    $0x0,%esi
  mov    %rbx,%rdi
  call   <memset@plt>
  test   %r14d,%r14d
  jle    L42
  mov    %r14d,%r15d
  mov    $0x0,%ebp
  movl   $0x1,0xc(%rsp)
  mov    $0x0,%esi
  jmp    L74
L11:
  lea    0x1(%r13),%esi
L86:
  add    $0x1,%rbp
  cmp    %r15,%rbp
  je     L65
L74:
  mov    %ebp,%r13d
  mov    %ebp,%edx
  cmpb   $0x2e,(%r12,%rbp,1)
  je     L75
  lea    -0x1(%r14),%eax
  cmp    %ebp,%eax
  jne    L86
L75:
  mov    %r12,%rdi
  call   <words_count_region@plt>
  lea    -0x1(%rax),%edx
  cmp    $0xfe,%edx
  ja     L11
  cltq
  lea    (%rbx,%rax,4),%rax
  movss  (%rax),%xmm0
  addss  D7(%rip),%xmm0
  movss  %xmm0,(%rax)
  pxor   %xmm1,%xmm1
  cvtsi2ssl 0xc(%rsp),%xmm1
  comiss %xmm1,%xmm0
  jbe    L11
  cvttss2si %xmm0,%eax
  mov    %eax,0xc(%rsp)
  jmp    L11
L42:
  movl   $0x1,0xc(%rsp)
L65:
  mov    %rbx,%rax
  add    $0x400,%rbx
  pxor   %xmm1,%xmm1
  cvtsi2ssl 0xc(%rsp),%xmm1
L32:
  movss  (%rax),%xmm0
  divss  %xmm1,%xmm0
  movss  %xmm0,(%rax)
  add    $0x4,%rax
  cmp    %rbx,%rax
  jne    L32
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D7
type_infered: byte[4]

tool: {"D7": [0x00,0x00,0x80,0x3f]}

assistant: ```c
void sentence_length_histogram(char *text, float histogram[]) {
  int i, start_pos = 0, end_pos, words, max = 1;
  int length = strlen(text);
  memset((void *)histogram, '\0', 256 * sizeof(float));
  for (i = 0; i < length; i++) {
    if ((text[i] == '.') || (i == length - 1)) {
      end_pos = i;
      words = words_count_region(text, start_pos, end_pos);
      if ((words > 0) && (words < 256)) {
        histogram[words] = histogram[words] + 1;
        if (histogram[words] > max) {
          max = histogram[words];
        }
      }
      start_pos = end_pos + 1;
    }
  }
  for (i = 0; i < 256; i++) {
    histogram[i] /= max;
  }
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<sentence_length_histogram>:
  endbr64
  push   %r15
  push   %r14
  mov    %rdi,%r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x18,%rsp
  call   <strlen@plt>
  xor    %esi,%esi
  mov    $0x400,%edx
  mov    %rbx,%rdi
  mov    %eax,%r12d
  call   <memset@plt>
  test   %r12d,%r12d
  jle    L59
  mov    $0x1,%eax
  pxor   %xmm4,%xmm4
  movslq %r12d,%r13
  xor    %ebp,%ebp
  cvtsi2ss %eax,%xmm4
  xor    %esi,%esi
  movss  %xmm4,0xc(%rsp)
  jmp    L10
  nopl   0x0(%rax)
L97:
  add    $0x1,%rbp
  cmp    %r13,%rbp
  je     L46
L10:
  cmpb   $0x2e,(%r14,%rbp,1)
  mov    %ebp,%edx
  lea    0x1(%rbp),%r15d
  je     L86
  lea    -0x1(%r12),%eax
  cmp    %ebp,%eax
  jne    L97
L86:
  mov    %r14,%rdi
  call   <words_count_region@plt>
  lea    -0x1(%rax),%edx
  cmp    $0xfe,%edx
  ja     L38
  cltq
  movss  D18(%rip),%xmm0
  lea    (%rbx,%rax,4),%rax
  addss  (%rax),%xmm0
  comiss 0xc(%rsp),%xmm0
  movss  %xmm0,(%rax)
  jbe    L38
  cvttss2si %xmm0,%eax
  pxor   %xmm3,%xmm3
  cvtsi2ss %eax,%xmm3
  movss  %xmm3,0xc(%rsp)
L38:
  add    $0x1,%rbp
  mov    %r15d,%esi
  cmp    %r13,%rbp
  jne    L10
L46:
  movss  0xc(%rsp),%xmm1
L94:
  mov    %rbx,%rax
  lea    0x400(%rbx),%rdx
  nopl   (%rax)
L8:
  movss  (%rax),%xmm0
  add    $0x4,%rax
  divss  %xmm1,%xmm0
  movss  %xmm0,-0x4(%rax)
  cmp    %rax,%rdx
  jne    L8
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L59:
  movss  D18(%rip),%xmm1
  jmp    L94
```

tool_calls: name: read_data
arguments: tag: D18
type_guessed: byte[4]

tool: {"D18": [0x00,0x00,0x80,0x3f]}

assistant: ```c
void sentence_length_histogram(char *text, float histogram[]) {
  int i, start_pos = 0, end_pos, words, max = 1;
  int length = strlen(text);
  memset((void *)histogram, '\0', 256 * sizeof(float));
  for (i = 0; i < length; i++) {
    if ((text[i] == '.') || (i == length - 1)) {
      end_pos = i;
      words = words_count_region(text, start_pos, end_pos);
      if ((words > 0) && (words < 256)) {
        histogram[words] = histogram[words] + 1;
        if (histogram[words] > max) {
          max = histogram[words];
        }
      }
      start_pos = end_pos + 1;
    }
  }
  for (i = 0; i < 256; i++) {
    histogram[i] /= max;
  }
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<sentence_length_histogram>:
  endbr64
  push   %r15
  push   %r14
  mov    %rdi,%r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x18,%rsp
  call   <strlen@plt>
  xor    %esi,%esi
  mov    $0x400,%edx
  mov    %rbx,%rdi
  mov    %eax,%r12d
  call   <memset@plt>
  test   %r12d,%r12d
  jle    L67
  mov    $0x1,%eax
  pxor   %xmm4,%xmm4
  movslq %r12d,%r13
  xor    %ebp,%ebp
  cvtsi2ss %eax,%xmm4
  xor    %esi,%esi
  movss  %xmm4,0xc(%rsp)
  jmp    L89
  nopl   0x0(%rax)
L44:
  add    $0x1,%rbp
  cmp    %rbp,%r13
  je     L20
L89:
  cmpb   $0x2e,(%r14,%rbp,1)
  mov    %ebp,%edx
  lea    0x1(%rbp),%r15d
  je     L80
  lea    -0x1(%r12),%eax
  cmp    %ebp,%eax
  jne    L44
L80:
  mov    %r14,%rdi
  call   <words_count_region@plt>
  lea    -0x1(%rax),%edx
  cmp    $0xfe,%edx
  ja     L24
  cltq
  movss  D19(%rip),%xmm0
  lea    (%rbx,%rax,4),%rax
  addss  (%rax),%xmm0
  comiss 0xc(%rsp),%xmm0
  movss  %xmm0,(%rax)
  jbe    L24
  cvttss2si %xmm0,%eax
  pxor   %xmm3,%xmm3
  cvtsi2ss %eax,%xmm3
  movss  %xmm3,0xc(%rsp)
L24:
  add    $0x1,%rbp
  mov    %r15d,%esi
  cmp    %rbp,%r13
  jne    L89
L20:
  movss  0xc(%rsp),%xmm1
L33:
  mov    %rbx,%rax
  lea    0x400(%rbx),%rdx
  shufps $0x0,%xmm1,%xmm1
  nopl   0x0(%rax)
L47:
  movups (%rax),%xmm0
  add    $0x10,%rax
  divps  %xmm1,%xmm0
  movups %xmm0,-0x10(%rax)
  cmp    %rax,%rdx
  jne    L47
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L67:
  movss  D19(%rip),%xmm1
  jmp    L33
```

tool_calls: name: unpack_data
arguments: tag: D19
datatype: byte[4]

tool: {"D19": [0x00,0x00,0x80,0x3f]}

assistant: ```c
void sentence_length_histogram(char *text, float histogram[]) {
  int i, start_pos = 0, end_pos, words, max = 1;
  int length = strlen(text);
  memset((void *)histogram, '\0', 256 * sizeof(float));
  for (i = 0; i < length; i++) {
    if ((text[i] == '.') || (i == length - 1)) {
      end_pos = i;
      words = words_count_region(text, start_pos, end_pos);
      if ((words > 0) && (words < 256)) {
        histogram[words] = histogram[words] + 1;
        if (histogram[words] > max) {
          max = histogram[words];
        }
      }
      start_pos = end_pos + 1;
    }
  }
  for (i = 0; i < 256; i++) {
    histogram[i] /= max;
  }
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<util4BitToHexchar>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x4(%rbp)
  cmpl   $0x9,-0x4(%rbp)
  jg     L26
  mov    -0x4(%rbp),%eax
  add    $0x30,%eax
  jmp    L34
L26:
  cmpl   $0xf,-0x4(%rbp)
  jg     L11
  mov    -0x4(%rbp),%eax
  add    $0x37,%eax
  jmp    L34
L11:
  mov    $0x0,%eax
L34:
  pop    %rbp
  ret
```

assistant: ```c
char util4BitToHexchar(const int n) {
  if (n < 10)
    return ('0' + n);
  if (n < 16)
    return ('A' - 10 + n);
  return ('\0');
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<util4BitToHexchar>:
  endbr64
  cmp    $0x9,%edi
  jle    L9
  lea    0x37(%rdi),%eax
  cmp    $0x10,%edi
  mov    $0x0,%edx
  cmovge %edx,%eax
  ret
L9:
  lea    0x30(%rdi),%eax
  ret
```

assistant: ```c
char util4BitToHexchar(const int n) {
  if (n < 10)
    return ('0' + n);
  if (n < 16)
    return ('A' - 10 + n);
  return ('\0');
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<util4BitToHexchar>:
  endbr64
  cmp    $0x9,%edi
  jle    L2
  xor    %edx,%edx
  lea    0x37(%rdi),%eax
  cmp    $0x10,%edi
  cmovge %edx,%eax
  ret
  nopl   (%rax)
L2:
  lea    0x30(%rdi),%eax
  ret
```

assistant: ```c
char util4BitToHexchar(const int n) {
  if (n < 10)
    return ('0' + n);
  if (n < 16)
    return ('A' - 10 + n);
  return ('\0');
}
```
user: What is the c source code of the assembly code below:

```asm
<util4BitToHexchar>:
  endbr64
  cmp    $0x9,%edi
  jle    L3
  xor    %edx,%edx
  lea    0x37(%rdi),%eax
  cmp    $0x10,%edi
  cmovge %edx,%eax
  ret
  nopl   (%rax)
L3:
  lea    0x30(%rdi),%eax
  ret
```

assistant: ```c
char util4BitToHexchar(const int n) {
  if (n < 10)
    return ('0' + n);
  if (n < 16)
    return ('A' - 10 + n);
  return ('\0');
}
```
user: Translate the below assembly code into C programming language:

```asm
<char2cstring>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,%eax
  mov    %al,-0x14(%rbp)
  mov    $0x2,%edi
  call   <malloc@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  movzbl -0x14(%rbp),%edx
  mov    %dl,(%rax)
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movb   $0x0,(%rax)
  mov    -0x8(%rbp),%rax
  leave
  ret
```

assistant: ```c
char *char2cstring(char c) {
  char *str = (char *)malloc(sizeof(char) * 2);
  str[0] = c;
  str[1] = '\0';
  return str;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<char2cstring>:
  endbr64
  push   %rbx
  mov    %edi,%ebx
  mov    $0x2,%edi
  call   <malloc@plt>
  mov    %bl,(%rax)
  movb   $0x0,0x1(%rax)
  pop    %rbx
  ret
```

assistant: ```c
char *char2cstring(char c) {
  char *str = (char *)malloc(sizeof(char) * 2);
  str[0] = c;
  str[1] = '\0';
  return str;
}
```
user: What is the c source code of the assembly code below:

```asm
<char2cstring>:
  endbr64
  push   %rbx
  mov    %edi,%ebx
  mov    $0x2,%edi
  call   <malloc@plt>
  mov    %bl,(%rax)
  movb   $0x0,0x1(%rax)
  pop    %rbx
  ret
```

assistant: ```c
char *char2cstring(char c) {
  char *str = (char *)malloc(sizeof(char) * 2);
  str[0] = c;
  str[1] = '\0';
  return str;
}
```
user: Translate the below assembly code into C programming language:

```asm
<char2cstring>:
  endbr64
  push   %rbx
  mov    %edi,%ebx
  mov    $0x2,%edi
  call   <malloc@plt>
  mov    %bl,(%rax)
  movb   $0x0,0x1(%rax)
  pop    %rbx
  ret
```

assistant: ```c
char *char2cstring(char c) {
  char *str = (char *)malloc(sizeof(char) * 2);
  str[0] = c;
  str[1] = '\0';
  return str;
}
```
user: What is the c source code of the assembly code below:

```asm
<getMode>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,%eax
  mov    %rsi,-0x10(%rbp)
  mov    %edx,-0x8(%rbp)
  mov    %ecx,-0x14(%rbp)
  mov    %r8d,-0x18(%rbp)
  mov    %r9d,-0x1c(%rbp)
  mov    %al,-0x4(%rbp)
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L24
  movsbl -0x4(%rbp),%eax
  mov    %eax,%edi
  call   <badMode@plt>
L24:
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  cmp    %al,-0x4(%rbp)
  jne    L43
  mov    -0x8(%rbp),%eax
  jmp    L30
L43:
  mov    -0x10(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L17
  movsbl -0x4(%rbp),%eax
  mov    %eax,%edi
  call   <badMode@plt>
L17:
  mov    -0x10(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    %al,-0x4(%rbp)
  jne    L12
  mov    -0x14(%rbp),%eax
  jmp    L30
L12:
  mov    -0x10(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L81
  movsbl -0x4(%rbp),%eax
  mov    %eax,%edi
  call   <badMode@plt>
L81:
  mov    -0x10(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  cmp    %al,-0x4(%rbp)
  jne    L73
  mov    -0x18(%rbp),%eax
  jmp    L30
L73:
  mov    -0x10(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L4
  movsbl -0x4(%rbp),%eax
  mov    %eax,%edi
  call   <badMode@plt>
L4:
  mov    -0x10(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  cmp    %al,-0x4(%rbp)
  jne    L114
  mov    -0x1c(%rbp),%eax
  jmp    L30
L114:
  movsbl -0x4(%rbp),%eax
  mov    %eax,%edi
  call   <badMode@plt>
  mov    $0x0,%eax
L30:
  leave
  ret
```

assistant: ```c
int getMode(char c, char *s, int m0, int m1, int m2, int m3) {
  if (s[0] == 0)
    badMode(c);
  if (c == s[0])
    return m0;
  if (s[1] == 0)
    badMode(c);
  if (c == s[1])
    return m1;
  if (s[2] == 0)
    badMode(c);
  if (c == s[2])
    return m2;
  if (s[3] == 0)
    badMode(c);
  if (c == s[3])
    return m3;
  badMode(c);
  return 0;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<getMode>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %edi,%ebp
  mov    %rsi,%rbx
  mov    %edx,%r15d
  mov    %ecx,%r12d
  mov    %r8d,%r13d
  mov    %r9d,%r14d
  cmpb   $0x0,(%rsi)
  je     L105
L31:
  mov    %r15d,%eax
  cmp    %bpl,(%rbx)
  je     L107
  cmpb   $0x0,0x1(%rbx)
  je     L44
L84:
  mov    %r12d,%eax
  cmp    %bpl,0x1(%rbx)
  je     L107
  cmpb   $0x0,0x2(%rbx)
  je     L117
L25:
  mov    %r13d,%eax
  cmp    %bpl,0x2(%rbx)
  je     L107
  cmpb   $0x0,0x3(%rbx)
  je     L86
L116:
  mov    %r14d,%eax
  cmp    %bpl,0x3(%rbx)
  je     L107
  movsbl %bpl,%edi
  call   <badMode@plt>
  mov    $0x0,%eax
L107:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L105:
  movsbl %dil,%edi
  call   <badMode@plt>
  jmp    L31
L44:
  movsbl %bpl,%edi
  call   <badMode@plt>
  jmp    L84
L117:
  movsbl %bpl,%edi
  call   <badMode@plt>
  jmp    L25
L86:
  movsbl %bpl,%edi
  call   <badMode@plt>
  jmp    L116
```

assistant: ```c
int getMode(char c, char *s, int m0, int m1, int m2, int m3) {
  if (s[0] == 0)
    badMode(c);
  if (c == s[0])
    return m0;
  if (s[1] == 0)
    badMode(c);
  if (c == s[1])
    return m1;
  if (s[2] == 0)
    badMode(c);
  if (c == s[2])
    return m2;
  if (s[3] == 0)
    badMode(c);
  if (c == s[3])
    return m3;
  badMode(c);
  return 0;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<getMode>:
  endbr64
  push   %r15
  mov    %ecx,%r15d
  push   %r14
  mov    %r9d,%r14d
  push   %r13
  mov    %r8d,%r13d
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %edi,%ebp
  push   %rbx
  mov    %edx,%ebx
  sub    $0x8,%rsp
  movzbl (%rsi),%edx
  test   %dl,%dl
  je     L7
L66:
  mov    %ebx,%eax
  cmp    %dl,%bpl
  je     L80
  movzbl 0x1(%r12),%edx
  test   %dl,%dl
  je     L19
L122:
  mov    %r15d,%eax
  cmp    %dl,%bpl
  je     L80
  movzbl 0x2(%r12),%edx
  test   %dl,%dl
  je     L93
  mov    %r13d,%eax
  cmp    %dl,%bpl
  je     L80
L97:
  movzbl 0x3(%r12),%edx
  test   %dl,%dl
  je     L120
L92:
  mov    %r14d,%eax
  cmp    %dl,%bpl
  je     L80
  movsbl %bpl,%edi
  call   <badMode@plt>
  xor    %eax,%eax
L80:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L93:
  movsbl %bpl,%edi
  call   <badMode@plt>
  movzbl 0x2(%r12),%edx
  mov    %r13d,%eax
  cmp    %dl,%bpl
  jne    L97
  jmp    L80
  nopl   0x0(%rax)
L7:
  movsbl %dil,%edi
  call   <badMode@plt>
  movzbl (%r12),%edx
  jmp    L66
  nopl   0x0(%rax,%rax,1)
L19:
  movsbl %bpl,%edi
  call   <badMode@plt>
  movzbl 0x1(%r12),%edx
  jmp    L122
  nopl   0x0(%rax)
L120:
  movsbl %bpl,%edi
  call   <badMode@plt>
  movzbl 0x3(%r12),%edx
  jmp    L92
```

assistant: ```c
int getMode(char c, char *s, int m0, int m1, int m2, int m3) {
  if (s[0] == 0)
    badMode(c);
  if (c == s[0])
    return m0;
  if (s[1] == 0)
    badMode(c);
  if (c == s[1])
    return m1;
  if (s[2] == 0)
    badMode(c);
  if (c == s[2])
    return m2;
  if (s[3] == 0)
    badMode(c);
  if (c == s[3])
    return m3;
  badMode(c);
  return 0;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<getMode>:
  endbr64
  push   %r15
  mov    %ecx,%r15d
  push   %r14
  mov    %r9d,%r14d
  push   %r13
  mov    %r8d,%r13d
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %edi,%ebp
  push   %rbx
  mov    %edx,%ebx
  sub    $0x8,%rsp
  movzbl (%rsi),%edx
  test   %dl,%dl
  je     L58
L128:
  mov    %ebx,%eax
  cmp    %dl,%bpl
  je     L35
  movzbl 0x1(%r12),%edx
  test   %dl,%dl
  je     L95
L33:
  mov    %r15d,%eax
  cmp    %dl,%bpl
  je     L35
  movzbl 0x2(%r12),%edx
  test   %dl,%dl
  je     L37
  mov    %r13d,%eax
  cmp    %dl,%bpl
  je     L35
L100:
  movzbl 0x3(%r12),%edx
  test   %dl,%dl
  je     L69
L111:
  mov    %r14d,%eax
  cmp    %dl,%bpl
  je     L35
  movsbl %bpl,%edi
  call   <badMode@plt>
  xor    %eax,%eax
L35:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L37:
  movsbl %bpl,%edi
  call   <badMode@plt>
  movzbl 0x2(%r12),%edx
  mov    %r13d,%eax
  cmp    %dl,%bpl
  jne    L100
  jmp    L35
  nopl   0x0(%rax)
L58:
  movsbl %dil,%edi
  call   <badMode@plt>
  movzbl (%r12),%edx
  jmp    L128
  nopl   0x0(%rax,%rax,1)
L95:
  movsbl %bpl,%edi
  call   <badMode@plt>
  movzbl 0x1(%r12),%edx
  jmp    L33
  nopl   0x0(%rax)
L69:
  movsbl %bpl,%edi
  call   <badMode@plt>
  movzbl 0x3(%r12),%edx
  jmp    L111
```

assistant: ```c
int getMode(char c, char *s, int m0, int m1, int m2, int m3) {
  if (s[0] == 0)
    badMode(c);
  if (c == s[0])
    return m0;
  if (s[1] == 0)
    badMode(c);
  if (c == s[1])
    return m1;
  if (s[2] == 0)
    badMode(c);
  if (c == s[2])
    return m2;
  if (s[3] == 0)
    badMode(c);
  if (c == s[3])
    return m3;
  badMode(c);
  return 0;
}
```