ylfeng/ReF-Decompile-dataset huggingface dataset:
user: Demonstrate the C code that generates the assembly output below:

```asm
<vprintf>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  add    $0xffffffffffffff80,%rsp
  mov    %rdi,-0x78(%rbp)
  mov    %esi,-0x7c(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movabs $0x3a632e6f69647473,%rax
  movabs $0x66746e6972707620,%rdx
  mov    %rax,-0x70(%rbp)
  mov    %rdx,-0x68(%rbp)
  movabs $0xa0d726f72726520,%rax
  mov    %rax,-0x60(%rbp)
  movb   $0x0,-0x58(%rbp)
  mov    -0x7c(%rbp),%edx
  mov    -0x78(%rbp),%rcx
  lea    -0x50(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <vsprintf@plt>
  cmp    $0x3f,%eax
  jle    L0
  lea    -0x70(%rbp),%rax
  mov    %rax,%rdi
  call   <writeStringToPrintfStream@plt>
  mov    $0x0,%eax
  jmp    L5
L0:
  lea    -0x50(%rbp),%rax
  mov    %rax,%rdi
  call   <writeStringToPrintfStream@plt>
L5:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L17
  call   <__stack_chk_fail@plt>
L17:
  leave
  ret
```

assistant: ```c
signed int vprintf(const char *pFormat, va_list ap) {
  char pStr[(64)];
  char pError[] = "stdio.c: vprintf error\r\n";
  if (vsprintf(pStr, pFormat, ap) >= (64)) {
    writeStringToPrintfStream(pError);
    return 0;
  }
  return writeStringToPrintfStream(pStr);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<vprintf>:
  endbr64
  sub    $0x78,%rsp
  mov    %esi,%edx
  mov    %fs:0x28,%rax
  mov    %rax,0x68(%rsp)
  xor    %eax,%eax
  movabs $0x3a632e6f69647473,%r8
  movabs $0x66746e6972707620,%r9
  mov    %r8,(%rsp)
  mov    %r9,0x8(%rsp)
  movabs $0xa0d726f72726520,%rax
  mov    %rax,0x10(%rsp)
  movb   $0x0,0x18(%rsp)
  lea    0x20(%rsp),%rax
  mov    %rdi,%rsi
  mov    %rax,%rdi
  call   <vsprintf@plt>
  cmp    $0x3f,%eax
  jg     L6
  lea    0x20(%rsp),%rdi
  call   <writeStringToPrintfStream@plt>
L13:
  mov    0x68(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L5
  add    $0x78,%rsp
  ret
L6:
  mov    %rsp,%rdi
  call   <writeStringToPrintfStream@plt>
  mov    $0x0,%eax
  jmp    L13
L5:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
signed int vprintf(const char *pFormat, va_list ap) {
  char pStr[(64)];
  char pError[] = "stdio.c: vprintf error\r\n";
  if (vsprintf(pStr, pFormat, ap) >= (64)) {
    writeStringToPrintfStream(pError);
    return 0;
  }
  return writeStringToPrintfStream(pStr);
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<vprintf>:
  endbr64
  push   %rbp
  mov    %esi,%edx
  mov    %rdi,%rsi
  sub    $0x70,%rsp
  movdqa D7(%rip),%xmm0
  mov    %fs:0x28,%rax
  mov    %rax,0x68(%rsp)
  xor    %eax,%eax
  lea    0x20(%rsp),%rbp
  movb   $0x0,0x18(%rsp)
  movabs $0xa0d726f72726520,%rax
  mov    %rbp,%rdi
  mov    %rax,0x10(%rsp)
  movaps %xmm0,(%rsp)
  call   <vsprintf@plt>
  cmp    $0x3f,%eax
  jg     L8
  mov    %rbp,%rdi
  call   <writeStringToPrintfStream@plt>
L7:
  mov    0x68(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L3
  add    $0x70,%rsp
  pop    %rbp
  ret
  xchg   %ax,%ax
L8:
  mov    %rsp,%rdi
  call   <writeStringToPrintfStream@plt>
  xor    %eax,%eax
  jmp    L7
L3:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: tag: D7
data_type: byte[16]

tool: {"D7": [0x73,0x74,0x64,0x69,0x6f,0x2e,0x63,0x3a,0x20,0x76,0x70,0x72,0x69,0x6e,0x74,0x66]}

assistant: ```c
signed int vprintf(const char *pFormat, va_list ap) {
  char pStr[(64)];
  char pError[] = "stdio.c: vprintf error\r\n";
  if (vsprintf(pStr, pFormat, ap) >= (64)) {
    writeStringToPrintfStream(pError);
    return 0;
  }
  return writeStringToPrintfStream(pStr);
}
```
user: What is the c source code of the assembly code below?

```asm
<vprintf>:
  endbr64
  push   %rbp
  mov    %esi,%edx
  mov    %rdi,%rsi
  sub    $0x70,%rsp
  movdqa D5(%rip),%xmm0
  mov    %fs:0x28,%rax
  mov    %rax,0x68(%rsp)
  xor    %eax,%eax
  lea    0x20(%rsp),%rbp
  movb   $0x0,0x18(%rsp)
  movabs $0xa0d726f72726520,%rax
  mov    %rbp,%rdi
  mov    %rax,0x10(%rsp)
  movaps %xmm0,(%rsp)
  call   <vsprintf@plt>
  cmp    $0x3f,%eax
  jg     L23
  mov    %rbp,%rdi
  call   <writeStringToPrintfStream@plt>
L21:
  mov    0x68(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L27
  add    $0x70,%rsp
  pop    %rbp
  ret
  xchg   %ax,%ax
L23:
  mov    %rsp,%rdi
  call   <writeStringToPrintfStream@plt>
  xor    %eax,%eax
  jmp    L21
L27:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D5
type: byte[16]

tool: {"D5": [0x73,0x74,0x64,0x69,0x6f,0x2e,0x63,0x3a,0x20,0x76,0x70,0x72,0x69,0x6e,0x74,0x66]}

assistant: ```c
signed int vprintf(const char *pFormat, va_list ap) {
  char pStr[(64)];
  char pError[] = "stdio.c: vprintf error\r\n";
  if (vsprintf(pStr, pFormat, ap) >= (64)) {
    writeStringToPrintfStream(pError);
    return 0;
  }
  return writeStringToPrintfStream(pStr);
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<makeAMsg>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    %rsi,-0x10(%rbp)
  mov    %edx,-0x14(%rbp)
  mov    -0x8(%rbp),%rax
  mov    $0x8,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  mov    -0x10(%rbp),%rcx
  mov    -0x14(%rbp),%edx
  mov    -0x8(%rbp),%rax
  mov    %rcx,%r8
  mov    %edx,%ecx
  lea    D4(%rip),%rdx
  mov    $0x8,%esi
  mov    %rax,%rdi
  call   <snprintf@plt>
  mov    $0x0,%eax
  leave
  ret
```

tool_calls: name: unpack_data
arguments: tag: D4
type_guessed: string

tool: D4: %04d%s

assistant: ```c
int makeAMsg(char *msg, char *buf, int msgType) {
  memset(msg, 0x00, sizeof(msg));
  snprintf(msg, sizeof(msg), "%04d%s", msgType, buf);
  return 0;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<makeAMsg>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  mov    %rsi,%r12
  mov    %edx,%ebp
  mov    $0x8,%edx
  mov    $0x0,%esi
  call   <memset@plt>
  mov    %r12,%r8
  mov    %ebp,%ecx
  lea    D0(%rip),%rdx
  mov    $0x8,%esi
  mov    %rbx,%rdi
  call   <snprintf@plt>
  mov    $0x0,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D0
type: string

tool: D0: %04d%s

assistant: ```c
int makeAMsg(char *msg, char *buf, int msgType) {
  memset(msg, 0x00, sizeof(msg));
  snprintf(msg, sizeof(msg), "%04d%s", msgType, buf);
  return 0;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<makeAMsg>:
  endbr64
  push   %r12
  mov    %edx,%r12d
  mov    $0x8,%edx
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %rsi,%rbx
  xor    %esi,%esi
  call   <memset@plt>
  mov    %rbx,%r8
  mov    %r12d,%ecx
  mov    %rbp,%rdi
  lea    D2(%rip),%rdx
  mov    $0x8,%esi
  call   <snprintf@plt>
  pop    %rbx
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  ret
```

tool_calls: name: disassemble_data
arguments: data_tag: D2
type_infered: string

tool: D2: %04d%s

assistant: ```c
int makeAMsg(char *msg, char *buf, int msgType) {
  memset(msg, 0x00, sizeof(msg));
  snprintf(msg, sizeof(msg), "%04d%s", msgType, buf);
  return 0;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<makeAMsg>:
  endbr64
  push   %r12
  mov    %edx,%r12d
  mov    $0x8,%edx
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %rsi,%rbx
  xor    %esi,%esi
  call   <memset@plt>
  mov    %rbx,%r8
  mov    %r12d,%ecx
  mov    %rbp,%rdi
  lea    D2(%rip),%rdx
  mov    $0x8,%esi
  call   <snprintf@plt>
  pop    %rbx
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  ret
```

tool_calls: name: disassemble_data
arguments: label: D2
data_type: string

tool: D2: %04d%s

assistant: ```c
int makeAMsg(char *msg, char *buf, int msgType) {
  memset(msg, 0x00, sizeof(msg));
  snprintf(msg, sizeof(msg), "%04d%s", msgType, buf);
  return 0;
}
```
user: What is the c source code of the assembly code below?

```asm
<ft_is_wht_spc>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,%eax
  mov    %al,-0x4(%rbp)
  cmpb   $0x20,-0x4(%rbp)
  je     L57
  cmpb   $0xc,-0x4(%rbp)
  je     L57
  cmpb   $0xa,-0x4(%rbp)
  je     L57
  cmpb   $0xd,-0x4(%rbp)
  je     L57
  cmpb   $0x9,-0x4(%rbp)
  je     L57
  cmpb   $0xb,-0x4(%rbp)
  jne    L67
L57:
  mov    $0x1,%eax
  jmp    L60
L67:
  mov    $0x0,%eax
L60:
  pop    %rbp
  ret
```

assistant: ```c
int ft_is_wht_spc(const char c) {
  if (c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' || c == '\v')
    return (1);
  return (0);
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<ft_is_wht_spc>:
  endbr64
  mov    $0x1,%eax
  cmp    $0x20,%dil
  je     L9
  sub    $0x9,%edi
  cmp    $0x4,%dil
  setbe  %al
  movzbl %al,%eax
L9:
  ret
```

assistant: ```c
int ft_is_wht_spc(const char c) {
  if (c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' || c == '\v')
    return (1);
  return (0);
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<ft_is_wht_spc>:
  endbr64
  mov    $0x1,%eax
  cmp    $0x20,%dil
  je     L1
  sub    $0x9,%edi
  xor    %eax,%eax
  cmp    $0x4,%dil
  setbe  %al
L1:
  ret
```

assistant: ```c
int ft_is_wht_spc(const char c) {
  if (c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' || c == '\v')
    return (1);
  return (0);
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<ft_is_wht_spc>:
  endbr64
  mov    $0x1,%eax
  cmp    $0x20,%dil
  je     L9
  sub    $0x9,%edi
  xor    %eax,%eax
  cmp    $0x4,%dil
  setbe  %al
L9:
  ret
```

assistant: ```c
int ft_is_wht_spc(const char c) {
  if (c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' || c == '\v')
    return (1);
  return (0);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<my_strncpy>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %edx,-0x24(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L10
L17:
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    -0x4(%rbp),%edx
  movslq %edx,%rcx
  mov    -0x18(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  addl   $0x1,-0x4(%rbp)
L10:
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L25
  mov    -0x4(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L17
L25:
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x18(%rbp),%rax
  pop    %rbp
  ret
```

assistant: ```c
char *my_strncpy(char *dest, char *src, int n) {
  int i;
  i = 0;
  while (src[i] != '\0' && i < n) {
    dest[i] = src[i];
    i++;
  }
  dest[i] = '\0';
  return (dest);
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<my_strncpy>:
  endbr64
  mov    %rdi,%rax
  movzbl (%rsi),%r8d
  test   %edx,%edx
  jle    L45
  test   %r8b,%r8b
  je     L45
  mov    $0x0,%ecx
L1:
  mov    %r8b,(%rax,%rcx,1)
  add    $0x1,%rcx
  movzbl (%rsi,%rcx,1),%r8d
  cmp    %ecx,%edx
  jle    L20
  test   %r8b,%r8b
  jne    L1
L20:
  movb   $0x0,(%rax,%rcx,1)
  ret
L45:
  mov    $0x0,%ecx
  jmp    L20
```

assistant: ```c
char *my_strncpy(char *dest, char *src, int n) {
  int i;
  i = 0;
  while (src[i] != '\0' && i < n) {
    dest[i] = src[i];
    i++;
  }
  dest[i] = '\0';
  return (dest);
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<my_strncpy>:
  endbr64
  movzbl (%rsi),%r8d
  mov    %rdi,%rax
  test   %edx,%edx
  jle    L38
  test   %r8b,%r8b
  je     L38
  xor    %ecx,%ecx
  jmp    L19
  nopl   0x0(%rax,%rax,1)
L33:
  test   %r8b,%r8b
  je     L30
L19:
  mov    %r8b,(%rax,%rcx,1)
  add    $0x1,%rcx
  movzbl (%rsi,%rcx,1),%r8d
  cmp    %ecx,%edx
  jg     L33
L30:
  add    %rax,%rcx
  movb   $0x0,(%rcx)
  ret
  nopl   (%rax)
L38:
  mov    %rax,%rcx
  movb   $0x0,(%rcx)
  ret
```

assistant: ```c
char *my_strncpy(char *dest, char *src, int n) {
  int i;
  i = 0;
  while (src[i] != '\0' && i < n) {
    dest[i] = src[i];
    i++;
  }
  dest[i] = '\0';
  return (dest);
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<my_strncpy>:
  endbr64
  movzbl (%rsi),%r8d
  mov    %rdi,%rax
  test   %edx,%edx
  jle    L15
  test   %r8b,%r8b
  je     L15
  xor    %ecx,%ecx
  jmp    L48
  nopl   0x0(%rax,%rax,1)
L27:
  test   %r8b,%r8b
  je     L22
L48:
  mov    %r8b,(%rax,%rcx,1)
  add    $0x1,%rcx
  movzbl (%rsi,%rcx,1),%r8d
  cmp    %ecx,%edx
  jg     L27
L22:
  add    %rax,%rcx
  movb   $0x0,(%rcx)
  ret
  nopl   (%rax)
L15:
  mov    %rax,%rcx
  movb   $0x0,(%rcx)
  ret
```

assistant: ```c
char *my_strncpy(char *dest, char *src, int n) {
  int i;
  i = 0;
  while (src[i] != '\0' && i < n) {
    dest[i] = src[i];
    i++;
  }
  dest[i] = '\0';
  return (dest);
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<ASN1_STRING_dup>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  jne    L24
  mov    $0x0,%eax
  jmp    L8
L24:
  mov    $0x0,%eax
  call   <ASN1_STRING_new@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  jne    L22
  mov    $0x0,%eax
  jmp    L8
L22:
  mov    -0x18(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <ASN1_STRING_copy@plt>
  test   %eax,%eax
  jne    L53
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <ASN1_STRING_free@plt>
  mov    $0x0,%eax
  jmp    L8
L53:
  mov    -0x8(%rbp),%rax
L8:
  leave
  ret
```

assistant: ```c
ASN1_STRING *ASN1_STRING_dup(const ASN1_STRING *str) {
  ASN1_STRING *ret;
  if (!str)
    return NULL;
  ret = ASN1_STRING_new();
  if (ret == NULL)
    return NULL;
  if (!ASN1_STRING_copy(ret, str)) {
    ASN1_STRING_free(ret);
    return NULL;
  }
  return ret;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<ASN1_STRING_dup>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbp
  test   %rdi,%rdi
  je     L7
  mov    $0x0,%eax
  call   <ASN1_STRING_new@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L21
  mov    %rbp,%rsi
  mov    %rax,%rdi
  call   <ASN1_STRING_copy@plt>
  test   %eax,%eax
  je     L45
L21:
  mov    %rbx,%rax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
L45:
  mov    %rbx,%rdi
  call   <ASN1_STRING_free@plt>
  mov    $0x0,%ebx
  jmp    L21
L7:
  mov    %rdi,%rbx
  jmp    L21
```

assistant: ```c
ASN1_STRING *ASN1_STRING_dup(const ASN1_STRING *str) {
  ASN1_STRING *ret;
  if (!str)
    return NULL;
  ret = ASN1_STRING_new();
  if (ret == NULL)
    return NULL;
  if (!ASN1_STRING_copy(ret, str)) {
    ASN1_STRING_free(ret);
    return NULL;
  }
  return ret;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<ASN1_STRING_dup>:
  endbr64
  push   %r12
  push   %rbp
  sub    $0x8,%rsp
  test   %rdi,%rdi
  je     L12
  xor    %eax,%eax
  mov    %rdi,%rbp
  call   <ASN1_STRING_new@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L12
  mov    %rbp,%rsi
  mov    %rax,%rdi
  call   <ASN1_STRING_copy@plt>
  test   %eax,%eax
  je     L11
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax)
L11:
  mov    %r12,%rdi
  call   <ASN1_STRING_free@plt>
L12:
  xor    %r12d,%r12d
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
ASN1_STRING *ASN1_STRING_dup(const ASN1_STRING *str) {
  ASN1_STRING *ret;
  if (!str)
    return NULL;
  ret = ASN1_STRING_new();
  if (ret == NULL)
    return NULL;
  if (!ASN1_STRING_copy(ret, str)) {
    ASN1_STRING_free(ret);
    return NULL;
  }
  return ret;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<ASN1_STRING_dup>:
  endbr64
  push   %r12
  push   %rbp
  sub    $0x8,%rsp
  test   %rdi,%rdi
  je     L3
  xor    %eax,%eax
  mov    %rdi,%rbp
  call   <ASN1_STRING_new@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L3
  mov    %rbp,%rsi
  mov    %rax,%rdi
  call   <ASN1_STRING_copy@plt>
  test   %eax,%eax
  je     L6
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax)
L6:
  mov    %r12,%rdi
  call   <ASN1_STRING_free@plt>
L3:
  xor    %r12d,%r12d
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
ASN1_STRING *ASN1_STRING_dup(const ASN1_STRING *str) {
  ASN1_STRING *ret;
  if (!str)
    return NULL;
  ret = ASN1_STRING_new();
  if (ret == NULL)
    return NULL;
  if (!ASN1_STRING_copy(ret, str)) {
    ASN1_STRING_free(ret);
    return NULL;
  }
  return ret;
}
```
user: Translate the below assembly code into C programming language:

```asm
<matchstar>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x4(%rbp)
  mov    %rsi,-0x10(%rbp)
  mov    %rdx,-0x18(%rbp)
L49:
  mov    -0x18(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <matchere@plt>
  test   %rax,%rax
  je     L1
  mov    $0x1,%eax
  jmp    L30
L1:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L21
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  movzbl (%rax),%eax
  movsbl %al,%eax
  cmp    %eax,-0x4(%rbp)
  je     L49
  cmpl   $0x2e,-0x4(%rbp)
  je     L49
L21:
  mov    $0x0,%eax
L30:
  leave
  ret
```

assistant: ```c
int matchstar(int c, char *regexp, char *text) {
  do {
    if (matchere(regexp, text))
      return 1;
  } while (*text != '\0' && (*text++ == c || c == '.'));
  return 0;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<matchstar>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %edi,%ebp
  mov    %rsi,%r12
  mov    %rdx,%rbx
L22:
  mov    %rbx,%rsi
  mov    %r12,%rdi
  call   <matchere@plt>
  test   %rax,%rax
  jne    L52
  movzbl (%rbx),%eax
  test   %al,%al
  je     L57
  add    $0x1,%rbx
  cmp    $0x2e,%ebp
  je     L22
  movsbl %al,%eax
  cmp    %ebp,%eax
  je     L22
  mov    $0x0,%eax
  jmp    L12
L52:
  mov    $0x1,%eax
L12:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L57:
  mov    $0x0,%eax
  jmp    L12
```

assistant: ```c
int matchstar(int c, char *regexp, char *text) {
  do {
    if (matchere(regexp, text))
      return 1;
  } while (*text != '\0' && (*text++ == c || c == '.'));
  return 0;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<matchstar>:
  endbr64
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %edi,%ebp
  push   %rbx
  mov    %rdx,%rbx
L4:
  mov    %rbx,%rsi
  mov    %r12,%rdi
  call   <matchere@plt>
  test   %rax,%rax
  jne    L5
  movsbl (%rbx),%eax
  test   %al,%al
  je     L8
  add    $0x1,%rbx
  cmp    %ebp,%eax
  je     L4
  cmp    $0x2e,%ebp
  je     L4
L8:
  pop    %rbx
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax,%rax,1)
L5:
  pop    %rbx
  mov    $0x1,%eax
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
int matchstar(int c, char *regexp, char *text) {
  do {
    if (matchere(regexp, text))
      return 1;
  } while (*text != '\0' && (*text++ == c || c == '.'));
  return 0;
}
```
user: What is the c source code of the assembly code below?

```asm
<matchstar>:
  endbr64
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %edi,%ebp
  push   %rbx
  mov    %rdx,%rbx
L35:
  mov    %rbx,%rsi
  mov    %r12,%rdi
  call   <matchere@plt>
  test   %rax,%rax
  jne    L34
  movsbl (%rbx),%eax
  test   %al,%al
  je     L19
  add    $0x1,%rbx
  cmp    %ebp,%eax
  je     L35
  cmp    $0x2e,%ebp
  je     L35
L19:
  pop    %rbx
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax,%rax,1)
L34:
  pop    %rbx
  mov    $0x1,%eax
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
int matchstar(int c, char *regexp, char *text) {
  do {
    if (matchere(regexp, text))
      return 1;
  } while (*text != '\0' && (*text++ == c || c == '.'));
  return 0;
}
```
user: Translate the below assembly code into C programming language:

```asm
<con_box>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %esi,-0x18(%rbp)
  mov    %edx,-0x1c(%rbp)
  mov    %rcx,-0x28(%rbp)
  mov    -0x18(%rbp),%edx
  mov    -0x14(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <con_xy@plt>
  mov    -0x1c(%rbp),%eax
  mov    %eax,%edi
  call   <con_color@plt>
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  jmp    L26
L10:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  cmp    $0x5d,%eax
  je     L42
  cmp    $0x5d,%eax
  jg     L77
  cmp    $0xa,%eax
  je     L34
  cmp    $0x5b,%eax
  je     L80
  jmp    L77
L34:
  addl   $0x1,-0x18(%rbp)
  mov    -0x18(%rbp),%edx
  mov    -0x14(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <con_xy@plt>
  jmp    L11
L80:
  mov    $0x0,%eax
  call   <con_bold@plt>
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <con_put_char@plt>
  jmp    L11
L42:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <con_put_char@plt>
  mov    $0x0,%eax
  call   <con_unbold@plt>
  jmp    L11
L77:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <con_put_char@plt>
L11:
  addq   $0x1,-0x8(%rbp)
L26:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L10
  mov    $0x0,%eax
  call   <con_uncol@plt>
  nop
  leave
  ret
```

assistant: ```c
void con_box(int x, int y, int color, char const *text) {
  con_xy(x, y);
  con_color(color);
  for (char const *i = text; *i; ++i)
    switch (*i) {
    case '\n':
      con_xy(x, ++y);
      break;
    case '[':
      con_bold();
      con_put_char(*i);
      break;
    case ']':
      con_put_char(*i);
      con_unbold();
      break;
    default:
      con_put_char(*i);
    }
  con_uncol();
}
```
user: What is the c source code of the assembly code below?

```asm
<con_box>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %edi,%r12d
  mov    %esi,%ebp
  mov    %edx,%r13d
  mov    %rcx,%rbx
  call   <con_xy@plt>
  mov    %r13d,%edi
  call   <con_color@plt>
  movzbl (%rbx),%edi
  test   %dil,%dil
  jne    L69
L9:
  mov    $0x0,%eax
  call   <con_uncol@plt>
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L55:
  add    $0x1,%ebp
  mov    %ebp,%esi
  mov    %r12d,%edi
  call   <con_xy@plt>
L23:
  add    $0x1,%rbx
  movzbl (%rbx),%edi
  test   %dil,%dil
  je     L9
L69:
  cmp    $0x5b,%dil
  je     L78
  cmp    $0x5d,%dil
  je     L3
  cmp    $0xa,%dil
  je     L55
  movsbl %dil,%edi
  call   <con_put_char@plt>
  jmp    L23
L78:
  mov    $0x0,%eax
  call   <con_bold@plt>
  movsbl (%rbx),%edi
  call   <con_put_char@plt>
  jmp    L23
L3:
  mov    $0x5d,%edi
  call   <con_put_char@plt>
  mov    $0x0,%eax
  call   <con_unbold@plt>
  jmp    L23
```

assistant: ```c
void con_box(int x, int y, int color, char const *text) {
  con_xy(x, y);
  con_color(color);
  for (char const *i = text; *i; ++i)
    switch (*i) {
    case '\n':
      con_xy(x, ++y);
      break;
    case '[':
      con_bold();
      con_put_char(*i);
      break;
    case ']':
      con_put_char(*i);
      con_unbold();
      break;
    default:
      con_put_char(*i);
    }
  con_uncol();
}
```
user: What is the c source code of the assembly code below:

```asm
<con_box>:
  endbr64
  push   %r13
  mov    %edx,%r13d
  push   %r12
  mov    %edi,%r12d
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  mov    %rcx,%rbx
  sub    $0x8,%rsp
  call   <con_xy@plt>
  mov    %r13d,%edi
  call   <con_color@plt>
  movsbl (%rbx),%edi
  test   %dil,%dil
  jne    L57
  jmp    L12
L36:
  cmp    $0xa,%dil
  je     L44
  call   <con_put_char@plt>
L40:
  movsbl 0x1(%rbx),%edi
  add    $0x1,%rbx
  test   %dil,%dil
  je     L12
L57:
  cmp    $0x5b,%dil
  je     L21
  cmp    $0x5d,%dil
  jne    L36
  mov    $0x5d,%edi
  add    $0x1,%rbx
  call   <con_put_char@plt>
  xor    %eax,%eax
  call   <con_unbold@plt>
  movsbl (%rbx),%edi
  test   %dil,%dil
  jne    L57
L12:
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  jmp    10b0 <con_uncol@plt>
  nopw   0x0(%rax,%rax,1)
L21:
  xor    %eax,%eax
  call   <con_bold@plt>
  movsbl (%rbx),%edi
  call   <con_put_char@plt>
  jmp    L40
  nopl   0x0(%rax)
L44:
  add    $0x1,%ebp
  mov    %r12d,%edi
  mov    %ebp,%esi
  call   <con_xy@plt>
  jmp    L40
```

assistant: ```c
void con_box(int x, int y, int color, char const *text) {
  con_xy(x, y);
  con_color(color);
  for (char const *i = text; *i; ++i)
    switch (*i) {
    case '\n':
      con_xy(x, ++y);
      break;
    case '[':
      con_bold();
      con_put_char(*i);
      break;
    case ']':
      con_put_char(*i);
      con_unbold();
      break;
    default:
      con_put_char(*i);
    }
  con_uncol();
}
```