ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<ems_facer_>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rsi,%rbx
  mov    %edx,%esi
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbp
  mov    %rbp,%rcx
  mov    $0xf,%edx
  call   <cnfImpn@plt>
  mov    (%rbx),%esi
  mov    %rbp,%rdi
  call   <emsFacer@plt>
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L9
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  ret
L9:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void ems_facer_(char *const token, int *const fstat, int token_length) {
  char ctok[15 + 1];

  cnfImpn(token, token_length, 15, ctok);
  emsFacer(ctok, *fstat);
  return;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<ems_facer_>:
  endbr64
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  mov    %edx,%esi
  mov    $0xf,%edx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbp
  mov    %rbp,%rcx
  call   <cnfImpn@plt>
  mov    (%rbx),%esi
  mov    %rbp,%rdi
  call   <emsFacer@plt>
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L4
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  ret
L4:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void ems_facer_(char *const token, int *const fstat, int token_length) {
  char ctok[15 + 1];

  cnfImpn(token, token_length, 15, ctok);
  emsFacer(ctok, *fstat);
  return;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<ems_facer_>:
  endbr64
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  mov    %edx,%esi
  mov    $0xf,%edx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbp
  mov    %rbp,%rcx
  call   <cnfImpn@plt>
  mov    (%rbx),%esi
  mov    %rbp,%rdi
  call   <emsFacer@plt>
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L8
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  ret
L8:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void ems_facer_(char *const token, int *const fstat, int token_length) {
  char ctok[15 + 1];

  cnfImpn(token, token_length, 15, ctok);
  emsFacer(ctok, *fstat);
  return;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<swapp>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  lea    D7(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    -0x20(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x18(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x20(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x18(%rbp),%rax
  mov    -0x4(%rbp),%edx
  mov    %edx,(%rax)
  mov    -0x20(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x18(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,%esi
  lea    D4(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  nop
  leave
  ret
```

tool_calls: name: parse_data
arguments: data_label: D7
type_guessed: string
name: parse_data
arguments: data_label: D4
type_guessed: string

tool: D7: Inside pointer based swap Function

tool: D4: Exiting pointer based swap Function x = %d, y = %d


assistant: ```c
void swapp(int *x, int *y) {
  int temp;
  printf("Inside pointer based swap Function\n");
  temp = *y;
  *y = *x;
  *x = temp;
  printf("Exiting pointer based swap Function x = %d, y = %d\n", *x, *y);
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<swapp>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbp
  mov    %rsi,%rbx
  lea    D2(%rip),%rdi
  call   <puts@plt>
  mov    (%rbx),%esi
  mov    0x0(%rbp),%eax
  mov    %eax,(%rbx)
  mov    %esi,0x0(%rbp)
  mov    (%rbx),%edx
  lea    D6(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

tool_calls: name: retrieve_data
arguments: tag: D2
datatype: string
name: retrieve_data
arguments: tag: D6
datatype: string

tool: D2: Inside pointer based swap Function

tool: D6: Exiting pointer based swap Function x = %d, y = %d


assistant: ```c
void swapp(int *x, int *y) {
  int temp;
  printf("Inside pointer based swap Function\n");
  temp = *y;
  *y = *x;
  *x = temp;
  printf("Exiting pointer based swap Function x = %d, y = %d\n", *x, *y);
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<swapp>:
  endbr64
  push   %rbp
  mov    %rdi,%rbp
  lea    D9(%rip),%rdi
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x8,%rsp
  call   <puts@plt>
  mov    0x0(%rbp),%eax
  mov    (%rbx),%esi
  lea    D2(%rip),%rdi
  mov    %eax,(%rbx)
  xor    %eax,%eax
  mov    %esi,0x0(%rbp)
  mov    (%rbx),%edx
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  jmp    1070 <printf@plt>
```

tool_calls: name: disassemble_data
arguments: data_label: D9
type: string
name: disassemble_data
arguments: data_label: D2
type: string

tool: D9: Inside pointer based swap Function

tool: D2: Exiting pointer based swap Function x = %d, y = %d


assistant: ```c
void swapp(int *x, int *y) {
  int temp;
  printf("Inside pointer based swap Function\n");
  temp = *y;
  *y = *x;
  *x = temp;
  printf("Exiting pointer based swap Function x = %d, y = %d\n", *x, *y);
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<swapp>:
  endbr64
  push   %rbp
  mov    %rdi,%rbp
  lea    D5(%rip),%rdi
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x8,%rsp
  call   <puts@plt>
  mov    0x0(%rbp),%eax
  mov    (%rbx),%esi
  lea    D12(%rip),%rdi
  mov    %eax,(%rbx)
  xor    %eax,%eax
  mov    %esi,0x0(%rbp)
  mov    (%rbx),%edx
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  jmp    1070 <printf@plt>
```

tool_calls: name: disassemble_data
arguments: tag: D5
type_guessed: string
name: disassemble_data
arguments: tag: D12
type_guessed: string

tool: D5: Inside pointer based swap Function

tool: D12: Exiting pointer based swap Function x = %d, y = %d


assistant: ```c
void swapp(int *x, int *y) {
  int temp;
  printf("Inside pointer based swap Function\n");
  temp = *y;
  *y = *x;
  *x = temp;
  printf("Exiting pointer based swap Function x = %d, y = %d\n", *x, *y);
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x148,%rsp
  mov    %edi,-0x144(%rbp)
  mov    %rsi,-0x150(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  lea    D14(%rip),%rax
  mov    %rax,-0x138(%rbp)
  lea    D16(%rip),%rax
  mov    %rax,-0x130(%rbp)
  mov    -0x130(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,%ebx
  mov    -0x138(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,%edi
  mov    -0x130(%rbp),%rdx
  lea    -0x120(%rbp),%rsi
  mov    -0x138(%rbp),%rax
  mov    %ebx,%r8d
  mov    %rdx,%rcx
  mov    %edi,%edx
  mov    %rax,%rdi
  call   <kmp@plt>
  mov    %rax,-0x128(%rbp)
  cmpq   $0x8,-0x128(%rbp)
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    $0x0,%eax
  mov    -0x18(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L7
  call   <__stack_chk_fail@plt>
L7:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D14
data_type: string
name: retrieve_data
arguments: data_label: D16
data_type: string

tool: D14: a

tool: D16: this is a test

assistant: ```c
int main(int argc, char *argv[]) {
  size_t table[32];
  size_t rc;
  char *key = "a";
  char *str = "this is a test";
  rc = kmp(key, table, strlen(key), str, strlen(str));
  assert(rc == 8);
  return 0;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<main>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x110,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x108(%rsp)
  xor    %eax,%eax
  lea    D13(%rip),%r12
  mov    %r12,%rdi
  call   <strlen@plt>
  mov    %eax,%ebx
  lea    D4(%rip),%rbp
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  mov    %rsp,%rsi
  mov    %ebx,%r8d
  mov    %r12,%rcx
  mov    %rbp,%rdi
  call   <kmp@plt>
  cmp    $0x8,%rax
  sete   %dil
  movzbl %dil,%edi
  call   <assert@plt>
  mov    0x108(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L4
  mov    $0x0,%eax
  add    $0x110,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L4:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_tag: D13
type_infered: string
name: unpack_data
arguments: data_tag: D4
type_infered: string

tool: D13: this is a test

tool: D4: a

assistant: ```c
int main(int argc, char *argv[]) {
  size_t table[32];
  size_t rc;
  char *key = "a";
  char *str = "this is a test";
  rc = kmp(key, table, strlen(key), str, strlen(str));
  assert(rc == 8);
  return 0;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  push   %r12
  lea    D7(%rip),%r12
  push   %rbp
  mov    %r12,%rdi
  lea    D13(%rip),%rbp
  push   %rbx
  sub    $0x110,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x108(%rsp)
  xor    %eax,%eax
  call   <strlen@plt>
  mov    %rbp,%rdi
  mov    %eax,%ebx
  call   <strlen@plt>
  mov    %rbp,%rdi
  mov    %rsp,%rsi
  mov    %ebx,%r8d
  mov    %eax,%edx
  mov    %r12,%rcx
  call   <kmp@plt>
  xor    %edi,%edi
  cmp    $0x8,%rax
  sete   %dil
  call   <assert@plt>
  mov    0x108(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L5
  add    $0x110,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L5:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: tag: D7
datatype: string
name: unpack_data
arguments: tag: D13
datatype: string

tool: D7: this is a test

tool: D13: a

assistant: ```c
int main(int argc, char *argv[]) {
  size_t table[32];
  size_t rc;
  char *key = "a";
  char *str = "this is a test";
  rc = kmp(key, table, strlen(key), str, strlen(str));
  assert(rc == 8);
  return 0;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<main>:
  endbr64
  push   %r12
  lea    D13(%rip),%r12
  push   %rbp
  mov    %r12,%rdi
  lea    D16(%rip),%rbp
  push   %rbx
  sub    $0x110,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x108(%rsp)
  xor    %eax,%eax
  call   <strlen@plt>
  mov    %rbp,%rdi
  mov    %eax,%ebx
  call   <strlen@plt>
  mov    %rbp,%rdi
  mov    %rsp,%rsi
  mov    %ebx,%r8d
  mov    %eax,%edx
  mov    %r12,%rcx
  call   <kmp@plt>
  xor    %edi,%edi
  cmp    $0x8,%rax
  sete   %dil
  call   <assert@plt>
  mov    0x108(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L2
  add    $0x110,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L2:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D13
type_infered: string
name: extract_symbolic_data
arguments: data_label: D16
type_infered: string

tool: D13: this is a test

tool: D16: a

assistant: ```c
int main(int argc, char *argv[]) {
  size_t table[32];
  size_t rc;
  char *key = "a";
  char *str = "this is a test";
  rc = kmp(key, table, strlen(key), str, strlen(str));
  assert(rc == 8);
  return 0;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<reduce_fraction>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    -0x20(%rbp),%rax
  mov    (%rax),%eax
  test   %eax,%eax
  je     L35
  mov    -0x18(%rbp),%rax
  mov    (%rax),%eax
  test   %eax,%eax
  je     L35
  mov    -0x18(%rbp),%rax
  mov    (%rax),%eax
  cmp    $0x1,%eax
  je     L35
  mov    -0x20(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x18(%rbp),%rax
  mov    (%rax),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <gcd@plt>
  mov    %eax,-0x4(%rbp)
  mov    -0x18(%rbp),%rax
  mov    (%rax),%eax
  cltd
  idivl  -0x4(%rbp)
  mov    %eax,%edx
  mov    -0x18(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x20(%rbp),%rax
  mov    (%rax),%eax
  cltd
  idivl  -0x4(%rbp)
  mov    %eax,%edx
  mov    -0x20(%rbp),%rax
  mov    %edx,(%rax)
  jmp    L32
L35:
  nop
L32:
  leave
  ret
```

assistant: ```c
void reduce_fraction(int *numerator, int *denominator) {
  int xgcd;
  if (*denominator == 0 || *numerator == 0 || *numerator == 1)
    return;
  xgcd = gcd(*numerator, *denominator);
  *numerator = *numerator / xgcd;
  *denominator = *denominator / xgcd;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<reduce_fraction>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rsi,%rbx
  mov    (%rsi),%esi
  test   %esi,%esi
  je     L3
  mov    %rdi,%rbp
  mov    (%rdi),%edi
  cmp    $0x1,%edi
  ja     L26
L3:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
L26:
  call   <gcd@plt>
  mov    %eax,%ecx
  mov    0x0(%rbp),%eax
  cltd
  idiv   %ecx
  mov    %eax,0x0(%rbp)
  mov    (%rbx),%eax
  cltd
  idiv   %ecx
  mov    %eax,(%rbx)
  jmp    L3
```

assistant: ```c
void reduce_fraction(int *numerator, int *denominator) {
  int xgcd;
  if (*denominator == 0 || *numerator == 0 || *numerator == 1)
    return;
  xgcd = gcd(*numerator, *denominator);
  *numerator = *numerator / xgcd;
  *denominator = *denominator / xgcd;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<reduce_fraction>:
  endbr64
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x8,%rsp
  mov    (%rsi),%esi
  test   %esi,%esi
  je     L10
  mov    %rdi,%rbp
  mov    (%rdi),%edi
  cmp    $0x1,%edi
  ja     L19
L10:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
  nopl   0x0(%rax)
L19:
  call   <gcd@plt>
  mov    %eax,%ecx
  mov    0x0(%rbp),%eax
  cltd
  idiv   %ecx
  mov    %eax,0x0(%rbp)
  mov    (%rbx),%eax
  cltd
  idiv   %ecx
  mov    %eax,(%rbx)
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
void reduce_fraction(int *numerator, int *denominator) {
  int xgcd;
  if (*denominator == 0 || *numerator == 0 || *numerator == 1)
    return;
  xgcd = gcd(*numerator, *denominator);
  *numerator = *numerator / xgcd;
  *denominator = *denominator / xgcd;
}
```
user: What is the c source code of the assembly code below?

```asm
<reduce_fraction>:
  endbr64
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x8,%rsp
  mov    (%rsi),%esi
  test   %esi,%esi
  je     L8
  mov    %rdi,%rbp
  mov    (%rdi),%edi
  cmp    $0x1,%edi
  ja     L12
L8:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
  nopl   0x0(%rax)
L12:
  call   <gcd@plt>
  mov    %eax,%ecx
  mov    0x0(%rbp),%eax
  cltd
  idiv   %ecx
  mov    %eax,0x0(%rbp)
  mov    (%rbx),%eax
  cltd
  idiv   %ecx
  mov    %eax,(%rbx)
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
void reduce_fraction(int *numerator, int *denominator) {
  int xgcd;
  if (*denominator == 0 || *numerator == 0 || *numerator == 1)
    return;
  xgcd = gcd(*numerator, *denominator);
  *numerator = *numerator / xgcd;
  *denominator = *denominator / xgcd;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<copy_init_n>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    -0x20(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x1,%edi
  call   <calloc@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x20(%rbp),%rdx
  mov    -0x18(%rbp),%rcx
  mov    -0x8(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncpy@plt>
  mov    -0x8(%rbp),%rax
  leave
  ret
```

assistant: ```c
char *copy_init_n(char *str, size_t len) {
  char *ret;
  ret = calloc(1, len);
  ret[0] = '\0';
  strncpy(ret, str, len);
  return ret;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<copy_init_n>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%r12
  mov    %rsi,%rbp
  mov    $0x1,%edi
  call   <calloc@plt>
  mov    %rax,%rbx
  movb   $0x0,(%rax)
  mov    %rbp,%rdx
  mov    %r12,%rsi
  mov    %rax,%rdi
  call   <strncpy@plt>
  mov    %rbx,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
char *copy_init_n(char *str, size_t len) {
  char *ret;
  ret = calloc(1, len);
  ret[0] = '\0';
  strncpy(ret, str, len);
  return ret;
}
```
user: Translate the below assembly code into C programming language:

```asm
<copy_init_n>:
  endbr64
  push   %r13
  mov    %rsi,%r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  mov    $0x1,%edi
  call   <calloc@plt>
  mov    %r13,%rdx
  mov    %rbp,%rsi
  movb   $0x0,(%rax)
  mov    %rax,%r12
  mov    %rax,%rdi
  call   <strncpy@plt>
  mov    %r12,%rax
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
char *copy_init_n(char *str, size_t len) {
  char *ret;
  ret = calloc(1, len);
  ret[0] = '\0';
  strncpy(ret, str, len);
  return ret;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<copy_init_n>:
  endbr64
  push   %r13
  mov    %rsi,%r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  mov    $0x1,%edi
  call   <calloc@plt>
  mov    %r13,%rdx
  mov    %rbp,%rsi
  movb   $0x0,(%rax)
  mov    %rax,%r12
  mov    %rax,%rdi
  call   <strncpy@plt>
  mov    %r12,%rax
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
char *copy_init_n(char *str, size_t len) {
  char *ret;
  ret = calloc(1, len);
  ret[0] = '\0';
  strncpy(ret, str, len);
  return ret;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<format_readable_mask>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %esi,-0x2c(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %rcx,-0x40(%rbp)
  movl   $0x1,-0x18(%rbp)
  movl   $0x0,-0x14(%rbp)
  movl   $0x1,-0x10(%rbp)
  movl   $0x0,-0xc(%rbp)
  mov    -0x38(%rbp),%rax
  movb   $0x0,(%rax)
  movl   $0x0,-0x8(%rbp)
  jmp    L1
L87:
  mov    -0x8(%rbp),%edx
  mov    -0x28(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <test_mask_bit@plt>
  mov    %eax,-0x4(%rbp)
  cmpl   $0x0,-0x4(%rbp)
  je     L99
  cmpl   $0x0,-0x14(%rbp)
  jne    L99
  movl   $0x1,-0x14(%rbp)
  mov    -0x8(%rbp),%eax
  mov    %eax,-0xc(%rbp)
  jmp    L11
L99:
  cmpl   $0x0,-0x4(%rbp)
  jne    L11
  cmpl   $0x0,-0x14(%rbp)
  je     L11
  mov    -0x8(%rbp),%eax
  lea    -0x1(%rax),%ecx
  mov    -0x10(%rbp),%edi
  mov    -0xc(%rbp),%edx
  lea    -0x40(%rbp),%rsi
  lea    -0x38(%rbp),%rax
  mov    %edi,%r8d
  mov    %rax,%rdi
  call   <write_range@plt>
  mov    %eax,-0x18(%rbp)
  movl   $0x0,-0x14(%rbp)
  movl   $0x0,-0x10(%rbp)
L11:
  addl   $0x1,-0x8(%rbp)
L1:
  cmpl   $0x0,-0x18(%rbp)
  je     L85
  mov    -0x8(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jb     L87
L85:
  cmpl   $0x0,-0x18(%rbp)
  je     L35
  cmpl   $0x0,-0x14(%rbp)
  je     L35
  mov    -0x2c(%rbp),%eax
  lea    -0x1(%rax),%ecx
  mov    -0x10(%rbp),%edi
  mov    -0xc(%rbp),%edx
  lea    -0x40(%rbp),%rsi
  lea    -0x38(%rbp),%rax
  mov    %edi,%r8d
  mov    %rax,%rdi
  call   <write_range@plt>
  mov    %eax,-0x18(%rbp)
L35:
  mov    -0x18(%rbp),%eax
  leave
  ret
```

assistant: ```c
bool format_readable_mask(const struct filter_mask *mask, unsigned int fa_entry_count, char *string, size_t length) {
  bool ok = true;
  bool in_range = false;
  bool first = true;
  unsigned int range_start = 0;
  *string = '\0';
  for (unsigned int id = 0; ok && id < fa_entry_count; id++) {
    bool set = test_mask_bit(mask, id);
    if (set && !in_range) {
      in_range = true;
      range_start = id;
    } else if (!set && in_range) {
      ok = write_range(&string, &length, range_start, id - 1, first);
      in_range = false;
      first = false;
    }
  }
  if (ok && in_range)
    ok = write_range(&string, &length, range_start, fa_entry_count - 1, first);
  return ok;
}
```
user: What is the c source code of the assembly code below:

```asm
<format_readable_mask>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdx,0x18(%rsp)
  mov    %rcx,0x10(%rsp)
  movb   $0x0,(%rdx)
  test   %esi,%esi
  je     L55
  mov    %rdi,%r14
  mov    %esi,%r13d
  mov    $0x0,%ebx
  mov    $0x0,%r15d
  movl   $0x1,0x4(%rsp)
  mov    $0x0,%ebp
  mov    $0x1,%r12d
  lea    0x10(%rsp),%rax
  mov    %rax,0x8(%rsp)
  jmp    L81
L0:
  mov    %ebx,%r15d
  mov    $0x1,%ebp
L116:
  add    $0x1,%ebx
  test   %r12d,%r12d
  setne  %al
  cmp    %ebx,%r13d
  jbe    L66
  test   %al,%al
  je     L66
L81:
  mov    %ebx,%esi
  mov    %r14,%rdi
  call   <test_mask_bit@plt>
  test   %eax,%eax
  je     L14
  test   %ebp,%ebp
  je     L0
L14:
  test   %eax,%eax
  jne    L116
  test   %ebp,%ebp
  je     L116
  lea    -0x1(%rbx),%ecx
  lea    0x18(%rsp),%rdi
  mov    0x4(%rsp),%r8d
  mov    %r15d,%edx
  mov    0x8(%rsp),%rsi
  call   <write_range@plt>
  mov    %eax,%r12d
  movl   $0x0,0x4(%rsp)
  mov    $0x0,%ebp
  jmp    L116
L66:
  test   %ebp,%ebp
  je     L33
  test   %al,%al
  je     L33
  lea    -0x1(%r13),%ecx
  lea    0x10(%rsp),%rsi
  lea    0x18(%rsp),%rdi
  mov    0x4(%rsp),%r8d
  mov    %r15d,%edx
  call   <write_range@plt>
  mov    %eax,%r12d
L33:
  mov    %r12d,%eax
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L55:
  mov    $0x1,%r12d
  jmp    L33
```

assistant: ```c
bool format_readable_mask(const struct filter_mask *mask, unsigned int fa_entry_count, char *string, size_t length) {
  bool ok = true;
  bool in_range = false;
  bool first = true;
  unsigned int range_start = 0;
  *string = '\0';
  for (unsigned int id = 0; ok && id < fa_entry_count; id++) {
    bool set = test_mask_bit(mask, id);
    if (set && !in_range) {
      in_range = true;
      range_start = id;
    } else if (!set && in_range) {
      ok = write_range(&string, &length, range_start, id - 1, first);
      in_range = false;
      first = false;
    }
  }
  if (ok && in_range)
    ok = write_range(&string, &length, range_start, fa_entry_count - 1, first);
  return ok;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<format_readable_mask>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdx,0x18(%rsp)
  mov    %rcx,0x10(%rsp)
  movb   $0x0,(%rdx)
  test   %esi,%esi
  je     L7
  lea    0x10(%rsp),%rax
  mov    %rdi,%r13
  mov    %esi,%ebp
  xor    %r15d,%r15d
  mov    %rax,0x8(%rsp)
  xor    %r14d,%r14d
  xor    %ebx,%ebx
  mov    $0x1,%r12d
  movl   $0x1,0x4(%rsp)
  jmp    L95
  xchg   %ax,%ax
L45:
  mov    %r15d,%r14d
  mov    $0x1,%ebx
L38:
  add    $0x1,%r15d
  test   %r12d,%r12d
  setne  %al
  cmp    %r15d,%ebp
  jbe    L2
L62:
  test   %al,%al
  je     L2
L95:
  mov    %r15d,%esi
  mov    %r13,%rdi
  call   <test_mask_bit@plt>
  test   %eax,%eax
  je     L37
  test   %ebx,%ebx
  je     L45
  test   %eax,%eax
  jne    L38
L37:
  test   %ebx,%ebx
  je     L38
  mov    0x4(%rsp),%r8d
  mov    0x8(%rsp),%rsi
  lea    -0x1(%r15),%ecx
  xor    %ebx,%ebx
  lea    0x18(%rsp),%rdi
  mov    %r14d,%edx
  add    $0x1,%r15d
  call   <write_range@plt>
  movl   $0x0,0x4(%rsp)
  mov    %eax,%r12d
  test   %r12d,%r12d
  setne  %al
  cmp    %r15d,%ebp
  ja     L62
  nopl   (%rax)
L2:
  test   %ebx,%ebx
  je     L4
  test   %al,%al
  je     L4
  mov    0x4(%rsp),%r8d
  lea    -0x1(%rbp),%ecx
  lea    0x10(%rsp),%rsi
  mov    %r14d,%edx
  lea    0x18(%rsp),%rdi
  call   <write_range@plt>
  mov    %eax,%r12d
L4:
  add    $0x28,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L7:
  mov    $0x1,%r12d
  jmp    L4
```

assistant: ```c
bool format_readable_mask(const struct filter_mask *mask, unsigned int fa_entry_count, char *string, size_t length) {
  bool ok = true;
  bool in_range = false;
  bool first = true;
  unsigned int range_start = 0;
  *string = '\0';
  for (unsigned int id = 0; ok && id < fa_entry_count; id++) {
    bool set = test_mask_bit(mask, id);
    if (set && !in_range) {
      in_range = true;
      range_start = id;
    } else if (!set && in_range) {
      ok = write_range(&string, &length, range_start, id - 1, first);
      in_range = false;
      first = false;
    }
  }
  if (ok && in_range)
    ok = write_range(&string, &length, range_start, fa_entry_count - 1, first);
  return ok;
}
```