ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<elf_exec_memsz>:
  endbr64
  mov    (%rdi),%eax
  test   %eax,%eax
  jle    L9
  mov    D7(%rip),%rdx
  sub    $0x1,%eax
  mov    $0xffffffffffffffff,%rcx
  lea    (%rax,%rax,2),%rax
  mov    (%rdx),%r8
  lea    0x18(%rsi,%rax,8),%rdi
  xor    %eax,%eax
  nopl   0x0(%rax)
L16:
  cmp    %r8,(%rsi)
  jne    L25
  mov    0x10(%rsi),%rdx
  cmp    %rdx,%rcx
  cmovg  %rdx,%rcx
  add    0x8(%rsi),%rdx
  cmp    %rdx,%rax
  cmovl  %rdx,%rax
L25:
  add    $0x18,%rsi
  cmp    %rdi,%rsi
  jne    L16
  sub    %rcx,%rax
  ret
  nopl   0x0(%rax,%rax,1)
L9:
  mov    $0x1,%eax
  ret
```

assistant: ```c
uint64_t elf_exec_memsz(Elf64_Ehdr *ehdr, Elf64_Phdr *phdr) {
  uint64_t min, max, size;
  int i;
  max = 0;
  min = ~max;
  for (i = 0; i < ehdr->e_phnum; i++) {
    uint64_t start, end;
    if (phdr[i].p_type != PT_LOAD)
      continue;
    start = phdr[i].p_paddr;
    end = phdr[i].p_paddr + phdr[i].p_memsz;
    if (start < min)
      min = start;
    if (end > max)
      max = end;
  }
  size = max - min;
  return size;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<elf_exec_memsz>:
  endbr64
  mov    (%rdi),%eax
  test   %eax,%eax
  jle    L15
  mov    D8(%rip),%rdx
  sub    $0x1,%eax
  mov    $0xffffffffffffffff,%rcx
  lea    (%rax,%rax,2),%rax
  mov    (%rdx),%r8
  lea    0x18(%rsi,%rax,8),%rdi
  xor    %eax,%eax
  nopl   0x0(%rax)
L28:
  cmp    (%rsi),%r8
  jne    L9
  mov    0x10(%rsi),%rdx
  cmp    %rdx,%rcx
  cmovg  %rdx,%rcx
  add    0x8(%rsi),%rdx
  cmp    %rdx,%rax
  cmovl  %rdx,%rax
L9:
  add    $0x18,%rsi
  cmp    %rsi,%rdi
  jne    L28
  sub    %rcx,%rax
  ret
  nopl   0x0(%rax,%rax,1)
L15:
  mov    $0x1,%eax
  ret
```

assistant: ```c
uint64_t elf_exec_memsz(Elf64_Ehdr *ehdr, Elf64_Phdr *phdr) {
  uint64_t min, max, size;
  int i;
  max = 0;
  min = ~max;
  for (i = 0; i < ehdr->e_phnum; i++) {
    uint64_t start, end;
    if (phdr[i].p_type != PT_LOAD)
      continue;
    start = phdr[i].p_paddr;
    end = phdr[i].p_paddr + phdr[i].p_memsz;
    if (start < min)
      min = start;
    if (end > max)
      max = end;
  }
  size = max - min;
  return size;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<q1>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %edi,%eax
  mov    %al,-0x4(%rbp)
  cmpb   $0x61,-0x4(%rbp)
  jne    L9
  lea    D1(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x2,%eax
  jmp    L25
L9:
  cmpb   $0x62,-0x4(%rbp)
  jne    L25
  mov    $0x3,%eax
  jmp    L25
L25:
  leave
  ret
```

tool_calls: name: read_data
arguments: data_label: D1
type_infered: string

tool: D1: *** state 1 ***


assistant: ```c
int q1(char c) {
  if (c == 'a') {
    printf("*** state 1 ***\n");
    return 2;
  } else if (c == 'b') {
    return 3;
  }
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<q1>:
  endbr64
  cmp    $0x61,%dil
  je     L0
  mov    $0x3,%eax
  cmp    $0x62,%dil
  je     L5
  ret
L0:
  sub    $0x8,%rsp
  lea    D9(%rip),%rdi
  call   <printf@plt>
  mov    $0x2,%eax
  add    $0x8,%rsp
  ret
L5:
  ret
```

tool_calls: name: parse_data
arguments: label: D9
data_type: string

tool: D9: *** state 1 ***


assistant: ```c
int q1(char c) {
  if (c == 'a') {
    printf("*** state 1 ***\n");
    return 2;
  } else if (c == 'b') {
    return 3;
  }
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<q1>:
  endbr64
  cmp    $0x61,%dil
  je     L9
  mov    $0x3,%eax
  cmp    $0x62,%dil
  je     L16
  ret
  cs nopw 0x0(%rax,%rax,1)
L16:
  ret
  nopl   0x0(%rax)
L9:
  sub    $0x8,%rsp
  lea    D1(%rip),%rdi
  call   <printf@plt>
  mov    $0x2,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: retrieve_data
arguments: tag: D1
datatype: string

tool: D1: *** state 1 ***


assistant: ```c
int q1(char c) {
  if (c == 'a') {
    printf("*** state 1 ***\n");
    return 2;
  } else if (c == 'b') {
    return 3;
  }
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<q1>:
  endbr64
  cmp    $0x61,%dil
  je     L0
  mov    $0x3,%eax
  cmp    $0x62,%dil
  je     L7
  ret
  cs nopw 0x0(%rax,%rax,1)
L7:
  ret
  nopl   0x0(%rax)
L0:
  sub    $0x8,%rsp
  lea    D2(%rip),%rdi
  call   <printf@plt>
  mov    $0x2,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D2
type_infered: string

tool: D2: *** state 1 ***


assistant: ```c
int q1(char c) {
  if (c == 'a') {
    printf("*** state 1 ***\n");
    return 2;
  } else if (c == 'b') {
    return 3;
  }
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<sumvetsse>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %rcx,-0x40(%rbp)
  lea    D2(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    -0x40(%rbp),%rax
  cqto
  shr    $0x3e,%rdx
  add    %rdx,%rax
  and    $0x3,%eax
  sub    %rdx,%rax
  mov    %rax,%rdx
  mov    -0x40(%rbp),%rax
  sub    %rdx,%rax
  mov    %rax,-0x8(%rbp)
  movq   $0x0,-0x10(%rbp)
  jmp    L27
L22:
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,%rdi
  call   <_mm_load_ps@plt>
  mov    %eax,-0x18(%rbp)
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,%rdi
  call   <_mm_load_ps@plt>
  mov    %eax,-0x14(%rbp)
  mov    -0x14(%rbp),%edx
  mov    -0x18(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <_mm_add_ps@plt>
  mov    %eax,-0x14(%rbp)
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rax,%rdx
  mov    -0x14(%rbp),%eax
  mov    %eax,%esi
  mov    %rdx,%rdi
  call   <_mm_store_ps@plt>
  addq   $0x4,-0x10(%rbp)
L27:
  mov    -0x10(%rbp),%rax
  cmp    -0x40(%rbp),%rax
  jl     L22
  mov    -0x8(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  jmp    L3
L36:
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm1
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  addss  %xmm1,%xmm0
  movss  %xmm0,(%rax)
  addq   $0x1,-0x10(%rbp)
L3:
  mov    -0x10(%rbp),%rax
  cmp    -0x40(%rbp),%rax
  jl     L36
  nop
  nop
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D2
type: string

tool: D2: sumvetsse


assistant: ```c
void sumvetsse(float *a, float *b, float *c, long int nvec) {
  long int i, nvecsse;
  __m128 v1, v2;
  printf("sumvetsse\n");
  nvecsse = nvec - (nvec % 4);
  for (i = 0; i < nvec; i += 4) {
    v1 = _mm_load_ps(a + i);
    v2 = _mm_load_ps(b + i);
    v2 = _mm_add_ps(v1, v2);
    _mm_store_ps(c + i, v2);
  }
  for (i = nvecsse; i < nvec; i++)
    c[i] = a[i] + b[i];
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<sumvetsse>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,%r15
  mov    %rsi,%r13
  mov    %rsi,0x18(%rsp)
  mov    %rdx,%r12
  mov    %rdx,0x20(%rsp)
  mov    %rcx,%rbx
  mov    %rcx,0x10(%rsp)
  lea    D6(%rip),%rdi
  call   <printf@plt>
  mov    %rbx,%rax
  sar    $0x3f,%rax
  mov    %rax,%rdx
  shr    $0x3e,%rdx
  mov    %rbx,%rcx
  lea    (%rbx,%rdx,1),%rax
  and    $0x3,%eax
  sub    %rdx,%rax
  sub    %rax,%rbx
  test   %rcx,%rcx
  jle    L5
  mov    %rcx,%rax
  mov    %r15,%r14
  sub    $0x1,%rax
  and    $0xfffffffffffffffc,%rax
  add    $0x4,%rax
  mov    %rax,0x28(%rsp)
  mov    $0x0,%ebp
L26:
  mov    %r14,%rdi
  call   <_mm_load_ps@plt>
  mov    %eax,0xc(%rsp)
  mov    %r13,%rdi
  call   <_mm_load_ps@plt>
  mov    %eax,%esi
  mov    0xc(%rsp),%edi
  call   <_mm_add_ps@plt>
  mov    %eax,%esi
  mov    %r12,%rdi
  call   <_mm_store_ps@plt>
  add    $0x4,%rbp
  add    $0x10,%r14
  add    $0x10,%r13
  add    $0x10,%r12
  cmp    0x28(%rsp),%rbp
  jne    L26
L5:
  cmp    %rbx,0x10(%rsp)
  jle    L3
L36:
  movss  (%r15,%rbx,4),%xmm0
  mov    0x18(%rsp),%rax
  addss  (%rax,%rbx,4),%xmm0
  mov    0x20(%rsp),%rax
  movss  %xmm0,(%rax,%rbx,4)
  add    $0x1,%rbx
  cmp    %rbx,0x10(%rsp)
  jne    L36
L3:
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: retrieve_data
arguments: label: D6
type_infered: string

tool: D6: sumvetsse


assistant: ```c
void sumvetsse(float *a, float *b, float *c, long int nvec) {
  long int i, nvecsse;
  __m128 v1, v2;
  printf("sumvetsse\n");
  nvecsse = nvec - (nvec % 4);
  for (i = 0; i < nvec; i += 4) {
    v1 = _mm_load_ps(a + i);
    v2 = _mm_load_ps(b + i);
    v2 = _mm_add_ps(v1, v2);
    _mm_store_ps(c + i, v2);
  }
  for (i = nvecsse; i < nvec; i++)
    c[i] = a[i] + b[i];
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<sumvetsse>:
  endbr64
  push   %r15
  mov    %rcx,%r15
  push   %r14
  mov    %r15,%r14
  push   %r13
  mov    %rdi,%r13
  lea    D6(%rip),%rdi
  push   %r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %rdx,%rbx
  sub    $0x38,%rsp
  mov    %rdx,0x20(%rsp)
  mov    %rsi,0x18(%rsp)
  mov    %rcx,0x10(%rsp)
  call   <printf@plt>
  mov    %r15,%rax
  sar    $0x3f,%rax
  mov    %rax,%rdx
  shr    $0x3e,%rdx
  lea    (%r15,%rdx,1),%rax
  and    $0x3,%eax
  sub    %rdx,%rax
  sub    %rax,%r14
  test   %r15,%r15
  jle    L36
  mov    %r15,%rax
  mov    %r13,%r12
  xor    %r15d,%r15d
  sub    $0x1,%rax
  and    $0xfffffffffffffffc,%rax
  add    $0x4,%rax
  mov    %rax,0x28(%rsp)
  cs nopw 0x0(%rax,%rax,1)
L39:
  mov    %r12,%rdi
  add    $0x4,%r15
  add    $0x10,%r12
  call   <_mm_load_ps@plt>
  mov    %rbp,%rdi
  add    $0x10,%rbp
  mov    %eax,0xc(%rsp)
  call   <_mm_load_ps@plt>
  mov    0xc(%rsp),%edi
  mov    %eax,%esi
  call   <_mm_add_ps@plt>
  mov    %rbx,%rdi
  add    $0x10,%rbx
  mov    %eax,%esi
  call   <_mm_store_ps@plt>
  cmp    0x28(%rsp),%r15
  jne    L39
L36:
  cmp    %r14,0x10(%rsp)
  jle    L30
  nopw   0x0(%rax,%rax,1)
L20:
  mov    0x18(%rsp),%rax
  movss  0x0(%r13,%r14,4),%xmm0
  addss  (%rax,%r14,4),%xmm0
  mov    0x20(%rsp),%rax
  movss  %xmm0,(%rax,%r14,4)
  add    $0x1,%r14
  cmp    %r14,0x10(%rsp)
  jne    L20
L30:
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: retrieve_data
arguments: tag: D6
data_type: string

tool: D6: sumvetsse


assistant: ```c
void sumvetsse(float *a, float *b, float *c, long int nvec) {
  long int i, nvecsse;
  __m128 v1, v2;
  printf("sumvetsse\n");
  nvecsse = nvec - (nvec % 4);
  for (i = 0; i < nvec; i += 4) {
    v1 = _mm_load_ps(a + i);
    v2 = _mm_load_ps(b + i);
    v2 = _mm_add_ps(v1, v2);
    _mm_store_ps(c + i, v2);
  }
  for (i = nvecsse; i < nvec; i++)
    c[i] = a[i] + b[i];
}
```
user: Translate the below assembly code into C programming language:

```asm
<strmatch>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  movq   $0x0,-0x10(%rbp)
  movq   $0x0,-0x8(%rbp)
  jmp    L74
L21:
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0x16(%rbp)
  cmpb   $0x2a,-0x16(%rbp)
  jne    L205
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x10(%rbp)
L163:
  mov    -0x30(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  addq   $0x1,-0x30(%rbp)
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0x16(%rbp)
  cmpb   $0x2a,-0x16(%rbp)
  je     L163
  cmpb   $0x0,-0x16(%rbp)
  jne    L205
  mov    $0x1,%eax
  jmp    L23
L205:
  cmpb   $0x3f,-0x16(%rbp)
  je     L119
  cmpb   $0x5c,-0x16(%rbp)
  jne    L134
  addq   $0x1,-0x30(%rbp)
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0x16(%rbp)
L134:
  cmpb   $0x5b,-0x16(%rbp)
  jne    L162
  movl   $0x0,-0x14(%rbp)
  addq   $0x1,-0x30(%rbp)
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0x16(%rbp)
  jmp    L188
L39:
  movzbl -0x16(%rbp),%eax
  cmp    -0x15(%rbp),%al
  jne    L98
  movl   $0x1,-0x14(%rbp)
L98:
  addq   $0x1,-0x30(%rbp)
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0x16(%rbp)
L188:
  cmpb   $0x0,-0x16(%rbp)
  je     L19
  cmpb   $0x5d,-0x16(%rbp)
  jne    L39
L19:
  cmpl   $0x0,-0x14(%rbp)
  je     L172
  cmpb   $0x0,-0x16(%rbp)
  jne    L189
L172:
  mov    $0x0,%eax
  jmp    L23
L162:
  movzbl -0x16(%rbp),%eax
  cmp    -0x15(%rbp),%al
  je     L236
  cmpq   $0x0,-0x8(%rbp)
  jne    L45
  mov    $0x0,%eax
  jmp    L23
L45:
  mov    -0x8(%rbp),%rax
  mov    %rax,-0x30(%rbp)
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  mov    %rax,-0x28(%rbp)
  jmp    L110
L119:
  nop
  jmp    L110
L189:
  nop
  jmp    L110
L236:
  nop
L110:
  addq   $0x1,-0x28(%rbp)
  addq   $0x1,-0x30(%rbp)
L74:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0x15(%rbp)
  cmpb   $0x0,-0x15(%rbp)
  jne    L21
  jmp    L173
L164:
  addq   $0x1,-0x30(%rbp)
L173:
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2a,%al
  je     L164
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  sete   %al
  movzbl %al,%eax
L23:
  pop    %rbp
  ret
```

assistant: ```c
int strmatch(const char *string, const char *pattern) {
  const char *ssubstart = NULL, *psubstart = NULL;
  char sch, pch;
  for (; (sch = *string); string++, pattern++) {
    pch = *pattern;
    if (pch == '*') {
      ssubstart = string;
      do {
        psubstart = pattern;
        pch = *++pattern;
      } while (pch == '*');
      if (pch == '\0')
        return 1;
    }
    if (pch == '?')
      continue;
    if (pch == '\\')
      pch = *++pattern;
    if (pch == '[') {
      int match = 0;
      for (pch = *++pattern; pch && pch != ']'; pch = *++pattern)
        if (pch == sch)
          match = 1;
      if (!match || pch == '\0')
        return 0;
      continue;
    }
    if (pch == sch)
      continue;
    if (psubstart == NULL)
      return 0;
    pattern = psubstart;
    string = ssubstart++;
  }
  while (*pattern == '*')
    pattern++;
  return (*pattern == '\0');
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<strmatch>:
  endbr64
  movzbl (%rdi),%edx
  test   %dl,%dl
  je     L239
  mov    $0x0,%r8d
  mov    $0x0,%r9d
  mov    $0x1,%r10d
  jmp    L27
L85:
  mov    %rsi,%r8
  add    $0x1,%rsi
  movzbl (%rsi),%eax
  cmp    $0x2a,%al
  je     L85
  test   %al,%al
  je     L131
  mov    %rdi,%r9
  jmp    L141
L70:
  movzbl 0x1(%rsi),%eax
  lea    0x1(%rsi),%rsi
  jmp    L199
L22:
  lea    0x1(%rsi),%rcx
  movzbl 0x1(%rsi),%eax
  test   %al,%al
  je     L68
  cmp    $0x5d,%al
  je     L68
  mov    $0x0,%esi
L119:
  cmp    %dl,%al
  cmove  %r10d,%esi
  add    $0x1,%rcx
  movzbl (%rcx),%eax
  test   %al,%al
  je     L58
  cmp    $0x5d,%al
  jne    L119
L58:
  test   %esi,%esi
  je     L75
  test   %al,%al
  je     L75
  mov    %rcx,%rsi
  mov    %rdi,%rax
  jmp    L33
L11:
  mov    %rdi,%rax
L33:
  lea    0x1(%rax),%rdi
  add    $0x1,%rsi
  movzbl 0x1(%rax),%edx
  test   %dl,%dl
  je     L239
L27:
  movzbl (%rsi),%eax
  cmp    $0x2a,%al
  je     L85
L141:
  cmp    $0x3f,%al
  je     L11
  cmp    $0x5c,%al
  je     L70
L199:
  cmp    $0x5b,%al
  je     L22
  cmp    %dl,%al
  je     L211
  test   %r8,%r8
  je     L21
  mov    %r8,%rsi
  mov    %r9,%rax
  lea    0x1(%r9),%r9
  jmp    L33
L211:
  mov    %rdi,%rax
  jmp    L33
L239:
  movzbl (%rsi),%eax
  cmp    $0x2a,%al
  jne    L129
L56:
  add    $0x1,%rsi
  movzbl (%rsi),%eax
  cmp    $0x2a,%al
  je     L56
L129:
  test   %al,%al
  sete   %al
  movzbl %al,%eax
  ret
L131:
  mov    $0x1,%eax
  ret
L68:
  mov    $0x0,%eax
  ret
L75:
  mov    $0x0,%eax
  ret
L21:
  mov    $0x0,%eax
  ret
```

assistant: ```c
int strmatch(const char *string, const char *pattern) {
  const char *ssubstart = NULL, *psubstart = NULL;
  char sch, pch;
  for (; (sch = *string); string++, pattern++) {
    pch = *pattern;
    if (pch == '*') {
      ssubstart = string;
      do {
        psubstart = pattern;
        pch = *++pattern;
      } while (pch == '*');
      if (pch == '\0')
        return 1;
    }
    if (pch == '?')
      continue;
    if (pch == '\\')
      pch = *++pattern;
    if (pch == '[') {
      int match = 0;
      for (pch = *++pattern; pch && pch != ']'; pch = *++pattern)
        if (pch == sch)
          match = 1;
      if (!match || pch == '\0')
        return 0;
      continue;
    }
    if (pch == sch)
      continue;
    if (psubstart == NULL)
      return 0;
    pattern = psubstart;
    string = ssubstart++;
  }
  while (*pattern == '*')
    pattern++;
  return (*pattern == '\0');
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<strmatch>:
  endbr64
  movzbl (%rdi),%edx
  test   %dl,%dl
  je     L148
  xor    %r8d,%r8d
  xor    %r9d,%r9d
  mov    $0x1,%r10d
  jmp    L190
  nopl   (%rax)
L55:
  cmp    $0x5c,%al
  jne    L145
  movzbl 0x1(%rsi),%eax
  add    $0x1,%rsi
L145:
  cmp    $0x5b,%al
  je     L188
  cmp    %dl,%al
  je     L19
  test   %r8,%r8
  je     L18
  lea    0x1(%r9),%rdi
  mov    %r9,%rax
  mov    %r8,%rsi
  mov    %rdi,%r9
L76:
  movzbl 0x1(%rax),%edx
  add    $0x1,%rsi
  test   %dl,%dl
  je     L148
L190:
  movzbl (%rsi),%eax
  cmp    $0x2a,%al
  je     L173
L104:
  cmp    $0x3f,%al
  jne    L55
L19:
  mov    %rdi,%rax
  add    $0x1,%rdi
  jmp    L76
  nopw   0x0(%rax,%rax,1)
L173:
  mov    %rsi,%r8
  movzbl 0x1(%rsi),%eax
  add    $0x1,%rsi
  cmp    $0x2a,%al
  je     L173
  test   %al,%al
  je     L143
  mov    %rdi,%r9
  jmp    L104
  nopl   0x0(%rax,%rax,1)
L165:
  add    $0x1,%rsi
L148:
  movzbl (%rsi),%eax
  cmp    $0x2a,%al
  je     L165
  test   %al,%al
  sete   %al
  movzbl %al,%eax
  ret
  nopl   0x0(%rax)
L188:
  movzbl 0x1(%rsi),%eax
  lea    0x1(%rsi),%rcx
  test   %al,%al
  je     L18
  cmp    $0x5d,%al
  je     L18
  xor    %esi,%esi
  nopw   0x0(%rax,%rax,1)
L169:
  cmp    %al,%dl
  cmove  %r10d,%esi
  movzbl 0x1(%rcx),%eax
  add    $0x1,%rcx
  test   %al,%al
  je     L83
  cmp    $0x5d,%al
  jne    L169
L83:
  and    $0x1,%esi
  je     L18
  test   %al,%al
  je     L18
  mov    %rdi,%rax
  mov    %rcx,%rsi
  add    $0x1,%rdi
  jmp    L76
  xchg   %ax,%ax
L18:
  xor    %eax,%eax
  ret
L143:
  mov    $0x1,%eax
  ret
```

assistant: ```c
int strmatch(const char *string, const char *pattern) {
  const char *ssubstart = NULL, *psubstart = NULL;
  char sch, pch;
  for (; (sch = *string); string++, pattern++) {
    pch = *pattern;
    if (pch == '*') {
      ssubstart = string;
      do {
        psubstart = pattern;
        pch = *++pattern;
      } while (pch == '*');
      if (pch == '\0')
        return 1;
    }
    if (pch == '?')
      continue;
    if (pch == '\\')
      pch = *++pattern;
    if (pch == '[') {
      int match = 0;
      for (pch = *++pattern; pch && pch != ']'; pch = *++pattern)
        if (pch == sch)
          match = 1;
      if (!match || pch == '\0')
        return 0;
      continue;
    }
    if (pch == sch)
      continue;
    if (psubstart == NULL)
      return 0;
    pattern = psubstart;
    string = ssubstart++;
  }
  while (*pattern == '*')
    pattern++;
  return (*pattern == '\0');
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<strmatch>:
  endbr64
  movzbl (%rdi),%edx
  test   %dl,%dl
  je     L29
  xor    %r8d,%r8d
  xor    %r9d,%r9d
  mov    $0x1,%r10d
  jmp    L117
  nopl   (%rax)
L42:
  cmp    $0x5c,%al
  jne    L204
  movzbl 0x1(%rsi),%eax
  add    $0x1,%rsi
L204:
  cmp    $0x5b,%al
  je     L99
  cmp    %dl,%al
  je     L46
  test   %r8,%r8
  je     L12
  lea    0x1(%r9),%rdi
  mov    %r9,%rax
  mov    %r8,%rsi
  mov    %rdi,%r9
L91:
  movzbl 0x1(%rax),%edx
  add    $0x1,%rsi
  test   %dl,%dl
  je     L29
L117:
  movzbl (%rsi),%eax
  cmp    $0x2a,%al
  je     L92
L45:
  cmp    $0x3f,%al
  jne    L42
L46:
  mov    %rdi,%rax
  add    $0x1,%rdi
  jmp    L91
  nopw   0x0(%rax,%rax,1)
L92:
  mov    %rsi,%r8
  movzbl 0x1(%rsi),%eax
  add    $0x1,%rsi
  cmp    $0x2a,%al
  je     L92
  test   %al,%al
  je     L180
  mov    %rdi,%r9
  jmp    L45
  nopl   0x0(%rax,%rax,1)
L174:
  add    $0x1,%rsi
L29:
  movzbl (%rsi),%eax
  cmp    $0x2a,%al
  je     L174
  test   %al,%al
  sete   %al
  movzbl %al,%eax
  ret
  nopl   0x0(%rax)
L99:
  movzbl 0x1(%rsi),%eax
  lea    0x1(%rsi),%rcx
  test   %al,%al
  je     L12
  cmp    $0x5d,%al
  je     L12
  xor    %esi,%esi
  nopw   0x0(%rax,%rax,1)
L118:
  cmp    %al,%dl
  cmove  %r10d,%esi
  movzbl 0x1(%rcx),%eax
  add    $0x1,%rcx
  cmp    $0x5d,%al
  je     L198
  test   %al,%al
  jne    L118
L198:
  and    $0x1,%esi
  je     L12
  test   %al,%al
  je     L12
  mov    %rdi,%rax
  mov    %rcx,%rsi
  add    $0x1,%rdi
  jmp    L91
  xchg   %ax,%ax
L12:
  xor    %eax,%eax
  ret
L180:
  mov    $0x1,%eax
  ret
```

assistant: ```c
int strmatch(const char *string, const char *pattern) {
  const char *ssubstart = NULL, *psubstart = NULL;
  char sch, pch;
  for (; (sch = *string); string++, pattern++) {
    pch = *pattern;
    if (pch == '*') {
      ssubstart = string;
      do {
        psubstart = pattern;
        pch = *++pattern;
      } while (pch == '*');
      if (pch == '\0')
        return 1;
    }
    if (pch == '?')
      continue;
    if (pch == '\\')
      pch = *++pattern;
    if (pch == '[') {
      int match = 0;
      for (pch = *++pattern; pch && pch != ']'; pch = *++pattern)
        if (pch == sch)
          match = 1;
      if (!match || pch == '\0')
        return 0;
      continue;
    }
    if (pch == sch)
      continue;
    if (psubstart == NULL)
      return 0;
    pattern = psubstart;
    string = ssubstart++;
  }
  while (*pattern == '*')
    pattern++;
  return (*pattern == '\0');
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<PRStringConstructorInt>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %edi,-0x44(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movb   $0x0,-0x31(%rbp)
  movl   $0x0,-0x30(%rbp)
  movl   $0x0,-0x2c(%rbp)
  movl   $0x0,-0x28(%rbp)
  movl   $0x0,-0x24(%rbp)
  cmpl   $0x0,-0x44(%rbp)
  jns    L33
  movl   $0x1,-0x2c(%rbp)
  negl   -0x44(%rbp)
L33:
  cmpl   $0x0,-0x44(%rbp)
  jne    L67
  mov    -0x30(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x30(%rbp)
  cltq
  movb   $0x30,-0x20(%rbp,%rax,1)
  jmp    L54
L3:
  mov    -0x44(%rbp),%edx
  movslq %edx,%rax
  imul   $0x66666667,%rax,%rax
  shr    $0x20,%rax
  sar    $0x2,%eax
  mov    %edx,%esi
  sar    $0x1f,%esi
  sub    %esi,%eax
  mov    %eax,%ecx
  mov    %ecx,%eax
  shl    $0x2,%eax
  add    %ecx,%eax
  add    %eax,%eax
  mov    %edx,%ecx
  sub    %eax,%ecx
  mov    %ecx,%eax
  lea    0x30(%rax),%ecx
  mov    -0x30(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x30(%rbp)
  mov    %ecx,%edx
  cltq
  mov    %dl,-0x20(%rbp,%rax,1)
  mov    -0x44(%rbp),%eax
  movslq %eax,%rdx
  imul   $0x66666667,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x2,%edx
  sar    $0x1f,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    %eax,-0x44(%rbp)
L67:
  cmpl   $0x0,-0x44(%rbp)
  jg     L3
L54:
  cmpl   $0x0,-0x2c(%rbp)
  je     L32
  mov    -0x30(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x30(%rbp)
  cltq
  movb   $0x2d,-0x20(%rbp,%rax,1)
L32:
  movl   $0x0,-0x28(%rbp)
  mov    -0x30(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x24(%rbp)
  jmp    L21
L49:
  mov    -0x28(%rbp),%eax
  cltq
  movzbl -0x20(%rbp,%rax,1),%eax
  mov    %al,-0x31(%rbp)
  mov    -0x24(%rbp),%eax
  cltq
  movzbl -0x20(%rbp,%rax,1),%edx
  mov    -0x28(%rbp),%eax
  cltq
  mov    %dl,-0x20(%rbp,%rax,1)
  mov    -0x24(%rbp),%eax
  cltq
  movzbl -0x31(%rbp),%edx
  mov    %dl,-0x20(%rbp,%rax,1)
  addl   $0x1,-0x28(%rbp)
  subl   $0x1,-0x24(%rbp)
L21:
  mov    -0x28(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L49
  mov    -0x30(%rbp),%eax
  cltq
  movb   $0x0,-0x20(%rbp,%rax,1)
  lea    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <PRStringConstructorCStr@plt>
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L5
  call   <__stack_chk_fail@plt>
L5:
  leave
  ret
```

assistant: ```c
struct String *PRStringConstructorInt(int num) {
  char str[20], tmp = 0;
  int len = 0, isNeg = 0, i = 0, j = 0;
  ;
  if (num < 0) {
    isNeg = 1;
    num = -num;
  }
  if (num == 0) {
    str[len++] = '0';
  } else {
    while (num > 0) {
      str[len++] = (char)(num % 10) + '0';
      num /= 10;
    }
  }
  if (isNeg)
    str[len++] = '-';
  for (i = 0, j = len - 1; i < j; ++i, --j) {
    tmp = str[i];
    str[i] = str[j];
    str[j] = tmp;
  }
  str[len] = 0;
  ;
  return PRStringConstructorCStr((char *)str);
}
```