ylfeng/ReF-Decompile-dataset huggingface dataset:
user: What would the C source look like for the assembly code provided here?

```asm
<__string_decode_array_cleanup>:
  endbr64
  test   %esi,%esi
  jle    L6
  push   %rbp
  lea    -0x1(%rsi),%eax
  push   %rbx
  lea    0x8(%rdi,%rax,8),%rbp
  mov    %rdi,%rbx
  sub    $0x8,%rsp
  nopl   0x0(%rax)
L15:
  mov    (%rbx),%rdi
  add    $0x8,%rbx
  call   <free@plt>
  cmp    %rbp,%rbx
  jne    L15
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  ret
  nopw   0x0(%rax,%rax,1)
L6:
  xor    %eax,%eax
  ret
```

assistant: ```c
int __string_decode_array_cleanup(char **s, int elements) {
  int element;
  for (element = 0; element < elements; element++)
    free(s[element]);
  return 0;
}
```
user: What is the c source code of the assembly code below:

```asm
<__string_decode_array_cleanup>:
  endbr64
  test   %esi,%esi
  jle    L1
  push   %rbp
  lea    -0x1(%rsi),%eax
  push   %rbx
  lea    0x8(%rdi,%rax,8),%rbp
  mov    %rdi,%rbx
  sub    $0x8,%rsp
  nopl   0x0(%rax)
L16:
  mov    (%rbx),%rdi
  add    $0x8,%rbx
  call   <free@plt>
  cmp    %rbp,%rbx
  jne    L16
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  ret
  nopw   0x0(%rax,%rax,1)
L1:
  xor    %eax,%eax
  ret
```

assistant: ```c
int __string_decode_array_cleanup(char **s, int elements) {
  int element;
  for (element = 0; element < elements; element++)
    free(s[element]);
  return 0;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<show_value>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %edx,-0x24(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  jne    L54
  mov    $0xfffffffb,%eax
  jmp    L40
L54:
  mov    -0x20(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  jmp    L48
L71:
  mov    -0x8(%rbp),%rax
  mov    $0x4,%edx
  lea    D8(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L76
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x5e,(%rax)
  addq   $0x4,-0x8(%rbp)
  jmp    L48
L76:
  mov    -0x8(%rbp),%rax
  mov    $0x4,%edx
  lea    D15(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L5
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x7c,(%rax)
  addq   $0x4,-0x8(%rbp)
  jmp    L48
L5:
  mov    -0x8(%rbp),%rdx
  lea    0x1(%rdx),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rcx
  mov    %rcx,-0x10(%rbp)
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
L48:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L71
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
L40:
  leave
  ret
```

tool_calls: name: read_data
arguments: tag: D8
type_guessed: string
name: read_data
arguments: tag: D15
type_guessed: string

tool: D8: 0x5E

tool: D15: 0x7C

assistant: ```c
int show_value(char *val, char *buf, int bsize) {
  if (!val) {
    return -5;
  }
  char *dest = buf;
  char *ptr = val;
  while ('\0' != *ptr) {
    if (!strncmp(ptr, "0x5E", 4)) {
      *dest++ = '^';
      ptr += 4;
    } else if (!strncmp(ptr, "0x7C", 4)) {
      *dest++ = '|';
      ptr += 4;
    } else {
      *dest++ = *ptr++;
    }
  }
  return strlen(buf);
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<show_value>:
  endbr64
  test   %rdi,%rdi
  je     L1
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbx
  mov    %rsi,%r14
  cmpb   $0x0,(%rdi)
  je     L42
  lea    0x1(%rsi),%rbp
  lea    D18(%rip),%r12
  lea    D11(%rip),%r15
  mov    $0x5e,%r13d
  jmp    L17
L13:
  add    $0x4,%rbx
  mov    %r13d,%eax
L23:
  mov    %al,-0x1(%rbp)
  add    $0x1,%rbp
  cmpb   $0x0,(%rbx)
  je     L42
L17:
  mov    $0x4,%edx
  mov    %r12,%rsi
  mov    %rbx,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  je     L13
  mov    $0x4,%edx
  mov    %r15,%rsi
  mov    %rbx,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L78
  add    $0x4,%rbx
  mov    $0x7c,%eax
  jmp    L23
L78:
  movzbl (%rbx),%eax
  lea    0x1(%rbx),%rbx
  jmp    L23
L42:
  mov    %r14,%rdi
  call   <strlen@plt>
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L1:
  mov    $0xfffffffb,%eax
  ret
```

tool_calls: name: read_data
arguments: data_label: D18
datatype: string
name: read_data
arguments: data_label: D11
datatype: string

tool: D18: 0x5E

tool: D11: 0x7C

assistant: ```c
int show_value(char *val, char *buf, int bsize) {
  if (!val) {
    return -5;
  }
  char *dest = buf;
  char *ptr = val;
  while ('\0' != *ptr) {
    if (!strncmp(ptr, "0x5E", 4)) {
      *dest++ = '^';
      ptr += 4;
    } else if (!strncmp(ptr, "0x7C", 4)) {
      *dest++ = '|';
      ptr += 4;
    } else {
      *dest++ = *ptr++;
    }
  }
  return strlen(buf);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<show_value>:
  endbr64
  test   %rdi,%rdi
  je     L16
  push   %r14
  lea    D7(%rip),%r14
  push   %r13
  mov    %rsi,%r13
  push   %r12
  lea    D19(%rip),%r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  cmpb   $0x0,(%rdi)
  mov    %rdi,%rbx
  jne    L56
  jmp    L53
  nopl   0x0(%rax,%rax,1)
L58:
  add    $0x4,%rbx
  mov    $0x5e,%eax
L46:
  mov    %al,-0x1(%rbp)
  cmpb   $0x0,(%rbx)
  je     L53
L56:
  mov    $0x4,%edx
  mov    %r12,%rsi
  mov    %rbx,%rdi
  add    $0x1,%rbp
  call   <strncmp@plt>
  test   %eax,%eax
  je     L58
  mov    $0x4,%edx
  mov    %r14,%rsi
  mov    %rbx,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L50
  add    $0x4,%rbx
  mov    $0x7c,%eax
  mov    %al,-0x1(%rbp)
  cmpb   $0x0,(%rbx)
  jne    L56
L53:
  pop    %rbx
  mov    %r13,%rdi
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  jmp    1070 <strlen@plt>
  cs nopw 0x0(%rax,%rax,1)
L50:
  movzbl (%rbx),%eax
  add    $0x1,%rbx
  jmp    L46
L16:
  mov    $0xfffffffb,%eax
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D7
datatype: string
name: extract_symbolic_data
arguments: data_tag: D19
datatype: string

tool: D7: 0x7C

tool: D19: 0x5E

assistant: ```c
int show_value(char *val, char *buf, int bsize) {
  if (!val) {
    return -5;
  }
  char *dest = buf;
  char *ptr = val;
  while ('\0' != *ptr) {
    if (!strncmp(ptr, "0x5E", 4)) {
      *dest++ = '^';
      ptr += 4;
    } else if (!strncmp(ptr, "0x7C", 4)) {
      *dest++ = '|';
      ptr += 4;
    } else {
      *dest++ = *ptr++;
    }
  }
  return strlen(buf);
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<show_value>:
  endbr64
  test   %rdi,%rdi
  je     L34
  push   %r14
  lea    D8(%rip),%r14
  push   %r13
  mov    %rsi,%r13
  push   %r12
  lea    D18(%rip),%r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  cmpb   $0x0,(%rdi)
  mov    %rdi,%rbx
  jne    L54
  jmp    L15
  nopl   0x0(%rax,%rax,1)
L20:
  add    $0x4,%rbx
  mov    $0x5e,%eax
L77:
  mov    %al,-0x1(%rbp)
  cmpb   $0x0,(%rbx)
  je     L15
L54:
  mov    $0x4,%edx
  mov    %r12,%rsi
  mov    %rbx,%rdi
  add    $0x1,%rbp
  call   <strncmp@plt>
  test   %eax,%eax
  je     L20
  mov    $0x4,%edx
  mov    %r14,%rsi
  mov    %rbx,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L35
  add    $0x4,%rbx
  mov    $0x7c,%eax
  mov    %al,-0x1(%rbp)
  cmpb   $0x0,(%rbx)
  jne    L54
L15:
  pop    %rbx
  mov    %r13,%rdi
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  jmp    1070 <strlen@plt>
  cs nopw 0x0(%rax,%rax,1)
L35:
  movzbl (%rbx),%eax
  add    $0x1,%rbx
  jmp    L77
L34:
  mov    $0xfffffffb,%eax
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D8
type: string
name: extract_symbolic_data
arguments: data_label: D18
type: string

tool: D8: 0x7C

tool: D18: 0x5E

assistant: ```c
int show_value(char *val, char *buf, int bsize) {
  if (!val) {
    return -5;
  }
  char *dest = buf;
  char *ptr = val;
  while ('\0' != *ptr) {
    if (!strncmp(ptr, "0x5E", 4)) {
      *dest++ = '^';
      ptr += 4;
    } else if (!strncmp(ptr, "0x7C", 4)) {
      *dest++ = '|';
      ptr += 4;
    } else {
      *dest++ = *ptr++;
    }
  }
  return strlen(buf);
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<SASCompareSwap>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    -0x28(%rbp),%rdx
  mov    -0x20(%rbp),%rcx
  mov    -0x18(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <compare_and_swap@plt>
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  leave
  ret
```

assistant: ```c
int SASCompareSwap(volatile long int *wordptr, long int match, long int replace) {
  int temp;
  temp = compare_and_swap(wordptr, match, replace);
  return temp;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<SASCompareSwap>:
  endbr64
  sub    $0x8,%rsp
  call   <compare_and_swap@plt>
  add    $0x8,%rsp
  ret
```

assistant: ```c
int SASCompareSwap(volatile long int *wordptr, long int match, long int replace) {
  int temp;
  temp = compare_and_swap(wordptr, match, replace);
  return temp;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<SASCompareSwap>:
  endbr64
  jmp    1050 <compare_and_swap@plt>
```

assistant: ```c
int SASCompareSwap(volatile long int *wordptr, long int match, long int replace) {
  int temp;
  temp = compare_and_swap(wordptr, match, replace);
  return temp;
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<SASCompareSwap>:
  endbr64
  jmp    1050 <compare_and_swap@plt>
```

assistant: ```c
int SASCompareSwap(volatile long int *wordptr, long int match, long int replace) {
  int temp;
  temp = compare_and_swap(wordptr, match, replace);
  return temp;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<sasutil_extract_name>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  je     L13
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L27
L13:
  mov    $0x0,%eax
  jmp    L74
L27:
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x8(%rbp)
  jmp    L75
L44:
  subq   $0x1,-0x8(%rbp)
L75:
  mov    -0x18(%rbp),%rax
  cmp    -0x8(%rbp),%rax
  ja     L60
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jne    L44
L60:
  mov    -0x8(%rbp),%rax
  cmp    -0x18(%rbp),%rax
  jb     L62
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  jmp    L74
L62:
  mov    -0x18(%rbp),%rax
L74:
  leave
  ret
```

assistant: ```c
const char *sasutil_extract_name(const char *cmdline) {
  const char *slash;
  if (!cmdline || !*cmdline)
    return NULL;
  slash = cmdline + strlen(cmdline);
  while (cmdline <= slash && (*slash != '/'))
    slash--;
  if (slash >= cmdline)
    return slash + 1;
  return cmdline;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<sasutil_extract_name>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  test   %rdi,%rdi
  je     L31
  cmpb   $0x0,(%rdi)
  je     L12
  call   <strlen@plt>
  cltq
  add    %rbx,%rax
  jb     L31
L2:
  cmpb   $0x2f,(%rax)
  je     L56
  sub    $0x1,%rax
  cmp    %rax,%rbx
  jbe    L2
  jmp    L31
L56:
  lea    0x1(%rax),%rdx
  cmp    %rax,%rbx
  cmovbe %rdx,%rbx
L31:
  mov    %rbx,%rax
  pop    %rbx
  ret
L12:
  mov    $0x0,%ebx
  jmp    L31
```

assistant: ```c
const char *sasutil_extract_name(const char *cmdline) {
  const char *slash;
  if (!cmdline || !*cmdline)
    return NULL;
  slash = cmdline + strlen(cmdline);
  while (cmdline <= slash && (*slash != '/'))
    slash--;
  if (slash >= cmdline)
    return slash + 1;
  return cmdline;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<sasutil_extract_name>:
  endbr64
  push   %r12
  mov    %rdi,%r12
  test   %rdi,%rdi
  je     L51
  cmpb   $0x0,(%rdi)
  je     L9
  call   <strlen@plt>
  cltq
  add    %r12,%rax
  jae    L54
  jmp    L51
  nopl   0x0(%rax)
L4:
  sub    $0x1,%rax
  cmp    %rax,%r12
  ja     L51
L54:
  cmpb   $0x2f,(%rax)
  jne    L4
  lea    0x1(%rax),%rdx
  cmp    %rax,%r12
  cmovbe %rdx,%r12
L51:
  mov    %r12,%rax
  pop    %r12
  ret
  nopw   0x0(%rax,%rax,1)
L9:
  xor    %r12d,%r12d
  mov    %r12,%rax
  pop    %r12
  ret
```

assistant: ```c
const char *sasutil_extract_name(const char *cmdline) {
  const char *slash;
  if (!cmdline || !*cmdline)
    return NULL;
  slash = cmdline + strlen(cmdline);
  while (cmdline <= slash && (*slash != '/'))
    slash--;
  if (slash >= cmdline)
    return slash + 1;
  return cmdline;
}
```
user: What is the c source code of the assembly code below?

```asm
<sasutil_extract_name>:
  endbr64
  push   %r12
  mov    %rdi,%r12
  test   %rdi,%rdi
  je     L5
  cmpb   $0x0,(%rdi)
  je     L57
  call   <strlen@plt>
  cltq
  add    %r12,%rax
  jae    L49
  jmp    L5
  nopl   0x0(%rax)
L40:
  sub    $0x1,%rax
  cmp    %rax,%r12
  ja     L5
L49:
  cmpb   $0x2f,(%rax)
  jne    L40
  lea    0x1(%rax),%rdx
  cmp    %rax,%r12
  cmovbe %rdx,%r12
L5:
  mov    %r12,%rax
  pop    %r12
  ret
  nopw   0x0(%rax,%rax,1)
L57:
  xor    %r12d,%r12d
  mov    %r12,%rax
  pop    %r12
  ret
```

assistant: ```c
const char *sasutil_extract_name(const char *cmdline) {
  const char *slash;
  if (!cmdline || !*cmdline)
    return NULL;
  slash = cmdline + strlen(cmdline);
  while (cmdline <= slash && (*slash != '/'))
    slash--;
  if (slash >= cmdline)
    return slash + 1;
  return cmdline;
}
```
user: Translate the below assembly code into C programming language:

```asm
<ft_str_alphawash>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  jne    L32
  mov    $0x0,%eax
  jmp    L47
L32:
  movq   $0xffffffffffffffff,-0x8(%rbp)
  jmp    L34
L55:
  mov    -0x18(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <ft_isdigit@plt>
  test   %eax,%eax
  jne    L34
  mov    -0x18(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2d,%al
  je     L34
  mov    -0x18(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movb   $0x20,(%rax)
L34:
  addq   $0x1,-0x8(%rbp)
  mov    -0x18(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L55
  mov    -0x8(%rbp),%rax
L47:
  leave
  ret
```

assistant: ```c
size_t ft_str_alphawash(char *str) {
  size_t i;
  if (!str)
    return (0);
  i = -1;
  while (str[++i]) {
    if (!ft_isdigit(str[i]) && str[i] != '-')
      str[i] = ' ';
  }
  return (i);
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<ft_str_alphawash>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  test   %rdi,%rdi
  je     L19
  mov    %rdi,%rbp
  movzbl (%rdi),%edi
  test   %dil,%dil
  je     L36
  mov    $0x0,%ebx
  jmp    L16
L13:
  movb   $0x20,0x0(%rbp,%rbx,1)
L1:
  add    $0x1,%rbx
  movzbl 0x0(%rbp,%rbx,1),%edi
  test   %dil,%dil
  je     L69
L16:
  movsbl %dil,%edi
  call   <ft_isdigit@plt>
  test   %eax,%eax
  jne    L1
  cmpb   $0x2d,0x0(%rbp,%rbx,1)
  jne    L13
  jmp    L1
L19:
  mov    $0x0,%ebx
L69:
  mov    %rbx,%rax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
L36:
  mov    $0x0,%ebx
  jmp    L69
```

assistant: ```c
size_t ft_str_alphawash(char *str) {
  size_t i;
  if (!str)
    return (0);
  i = -1;
  while (str[++i]) {
    if (!ft_isdigit(str[i]) && str[i] != '-')
      str[i] = ' ';
  }
  return (i);
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<ft_str_alphawash>:
  endbr64
  push   %r12
  push   %rbx
  sub    $0x8,%rsp
  test   %rdi,%rdi
  je     L27
  mov    %rdi,%rbx
  movsbl (%rdi),%edi
  xor    %r12d,%r12d
  test   %dil,%dil
  je     L11
  xchg   %ax,%ax
L7:
  call   <ft_isdigit@plt>
  test   %eax,%eax
  jne    L5
  cmpb   $0x2d,(%rbx,%r12,1)
  je     L5
  movb   $0x20,(%rbx,%r12,1)
L5:
  add    $0x1,%r12
  movsbl (%rbx,%r12,1),%edi
  test   %dil,%dil
  jne    L7
L11:
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %r12
  ret
  xchg   %ax,%ax
L27:
  xor    %r12d,%r12d
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %r12
  ret
```

assistant: ```c
size_t ft_str_alphawash(char *str) {
  size_t i;
  if (!str)
    return (0);
  i = -1;
  while (str[++i]) {
    if (!ft_isdigit(str[i]) && str[i] != '-')
      str[i] = ' ';
  }
  return (i);
}
```
user: What is the c source code of the assembly code below?

```asm
<ft_str_alphawash>:
  endbr64
  push   %r12
  push   %rbx
  sub    $0x8,%rsp
  test   %rdi,%rdi
  je     L1
  mov    %rdi,%rbx
  movsbl (%rdi),%edi
  xor    %r12d,%r12d
  test   %dil,%dil
  je     L37
  xchg   %ax,%ax
L3:
  call   <ft_isdigit@plt>
  test   %eax,%eax
  jne    L17
  cmpb   $0x2d,(%rbx,%r12,1)
  je     L17
  movb   $0x20,(%rbx,%r12,1)
L17:
  add    $0x1,%r12
  movsbl (%rbx,%r12,1),%edi
  test   %dil,%dil
  jne    L3
L37:
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %r12
  ret
  xchg   %ax,%ax
L1:
  xor    %r12d,%r12d
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %r12
  ret
```

assistant: ```c
size_t ft_str_alphawash(char *str) {
  size_t i;
  if (!str)
    return (0);
  i = -1;
  while (str[++i]) {
    if (!ft_isdigit(str[i]) && str[i] != '-')
      str[i] = ' ';
  }
  return (i);
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<compute_transition_function>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %edx,-0x34(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x4(%rbp)
  movl   $0x0,-0x10(%rbp)
  jmp    L78
L4:
  movl   $0x0,-0xc(%rbp)
  jmp    L33
L50:
  mov    -0x10(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    -0x4(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <min@plt>
  mov    %eax,-0x8(%rbp)
  jmp    L69
L54:
  mov    -0xc(%rbp),%eax
  add    $0x61,%eax
  mov    %al,-0x11(%rbp)
  movsbl -0x11(%rbp),%ecx
  mov    -0x10(%rbp),%edx
  mov    -0x8(%rbp),%esi
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <suffix@plt>
  test   %rax,%rax
  jne    L46
  subl   $0x1,-0x8(%rbp)
L69:
  cmpl   $0x0,-0x8(%rbp)
  jne    L54
  jmp    L51
L46:
  nop
L51:
  mov    -0x10(%rbp),%eax
  imul   -0x34(%rbp),%eax
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rax,%rdx
  mov    -0x8(%rbp),%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0xc(%rbp)
L33:
  mov    -0xc(%rbp),%eax
  cmp    -0x34(%rbp),%eax
  jl     L50
  addl   $0x1,-0x10(%rbp)
L78:
  mov    -0x10(%rbp),%eax
  cmp    -0x4(%rbp),%eax
  jle    L4
  nop
  nop
  leave
  ret
```

assistant: ```c
void compute_transition_function(char *pattern, int *array, int numchars) {
  int m = strlen(pattern);
  int q;
  for (q = 0; q <= m; q++) {
    int chars;
    for (chars = 0; chars < numchars; chars++) {
      int k = min(m, q + 1);
      while (k) {
        char ch = 'a' + chars;
        if (suffix(pattern, k, q, ch))
          break;
        k--;
      }
      array[q * numchars + chars] = k;
    }
  }
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<compute_transition_function>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,%r13
  mov    %rsi,0x20(%rsp)
  mov    %edx,%ebx
  mov    %edx,0x1c(%rsp)
  call   <strlen@plt>
  mov    %eax,0xc(%rsp)
  test   %eax,%eax
  js     L41
  movl   $0x0,0x28(%rsp)
  mov    $0x0,%r12d
  lea    -0x1(%rbx),%eax
  mov    %eax,0x2c(%rsp)
  jmp    L65
L56:
  mov    %ebx,(%r14)
  add    $0x4,%r14
  add    $0x1,%r15d
  cmp    0x10(%rsp),%r14
  je     L13
L50:
  mov    0x18(%rsp),%esi
  mov    0xc(%rsp),%edi
  call   <min@plt>
  mov    %eax,%ebx
  test   %eax,%eax
  je     L56
  movsbl %r15b,%ebp
L44:
  mov    %ebp,%ecx
  mov    %r12d,%edx
  mov    %ebx,%esi
  mov    %r13,%rdi
  call   <suffix@plt>
  test   %rax,%rax
  jne    L56
  sub    $0x1,%ebx
  jne    L44
  jmp    L56
L13:
  add    $0x1,%r12d
  mov    0x1c(%rsp),%edx
  add    %edx,0x28(%rsp)
  cmp    %r12d,0xc(%rsp)
  jl     L41
L65:
  cmpl   $0x0,0x1c(%rsp)
  jle    L13
  movslq 0x28(%rsp),%rdx
  mov    0x20(%rsp),%rcx
  lea    (%rcx,%rdx,4),%r14
  mov    0x2c(%rsp),%eax
  add    %rdx,%rax
  lea    0x4(%rcx,%rax,4),%rax
  mov    %rax,0x10(%rsp)
  mov    $0x61,%r15d
  lea    0x1(%r12),%eax
  mov    %eax,0x18(%rsp)
  jmp    L50
L41:
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void compute_transition_function(char *pattern, int *array, int numchars) {
  int m = strlen(pattern);
  int q;
  for (q = 0; q <= m; q++) {
    int chars;
    for (chars = 0; chars < numchars; chars++) {
      int k = min(m, q + 1);
      while (k) {
        char ch = 'a' + chars;
        if (suffix(pattern, k, q, ch))
          break;
        k--;
      }
      array[q * numchars + chars] = k;
    }
  }
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<compute_transition_function>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  push   %rbx
  mov    %edx,%ebx
  sub    $0x38,%rsp
  mov    %rsi,0x20(%rsp)
  mov    %edx,0x1c(%rsp)
  call   <strlen@plt>
  mov    %eax,0x18(%rsp)
  test   %eax,%eax
  js     L47
  lea    -0x1(%rbx),%eax
  movl   $0x0,0x28(%rsp)
  xor    %r15d,%r15d
  mov    %eax,0x2c(%rsp)
  nopl   0x0(%rax,%rax,1)
L42:
  mov    0x1c(%rsp),%eax
  mov    %r15d,%ebp
  add    $0x1,%r15d
  test   %eax,%eax
  jle    L83
  mov    0x2c(%rsp),%eax
  mov    0x20(%rsp),%rdx
  xor    %r13d,%r13d
  mov    %rax,0x8(%rsp)
  movslq 0x28(%rsp),%rax
  lea    (%rdx,%rax,4),%rax
  mov    %rax,0x10(%rsp)
  nopw   0x0(%rax,%rax,1)
L24:
  mov    0x18(%rsp),%edi
  mov    %r15d,%esi
  lea    0x61(%r13),%ebx
  movsbl %bl,%ebx
  call   <min@plt>
  mov    %eax,%r14d
  test   %eax,%eax
  jne    L41
  jmp    L27
  nopl   0x0(%rax)
L65:
  sub    $0x1,%r14d
  je     L27
L41:
  mov    %ebx,%ecx
  mov    %ebp,%edx
  mov    %r14d,%esi
  mov    %r12,%rdi
  call   <suffix@plt>
  test   %rax,%rax
  je     L65
L64:
  mov    0x10(%rsp),%rax
  mov    %r14d,(%rax,%r13,4)
  lea    0x1(%r13),%rax
  cmp    %r13,0x8(%rsp)
  je     L83
  mov    %rax,%r13
  jmp    L24
  nopl   0x0(%rax,%rax,1)
L27:
  xor    %r14d,%r14d
  jmp    L64
  nopl   (%rax)
L83:
  mov    0x1c(%rsp),%edx
  add    %edx,0x28(%rsp)
  cmp    %r15d,0x18(%rsp)
  jge    L42
L47:
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void compute_transition_function(char *pattern, int *array, int numchars) {
  int m = strlen(pattern);
  int q;
  for (q = 0; q <= m; q++) {
    int chars;
    for (chars = 0; chars < numchars; chars++) {
      int k = min(m, q + 1);
      while (k) {
        char ch = 'a' + chars;
        if (suffix(pattern, k, q, ch))
          break;
        k--;
      }
      array[q * numchars + chars] = k;
    }
  }
}
```