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

```asm
<factorial>:
  endbr64
  mov    $0x1,%eax
  test   %edi,%edi
  jg     L2
  ret
L2:
  push   %rbx
  mov    %edi,%ebx
  lea    -0x1(%rdi),%edi
  call   <factorial>
  mov    %rax,%rdx
  movslq %ebx,%rax
  imul   %rdx,%rax
  pop    %rbx
  ret
```

assistant: ```c
long factorial(int n) {
  if (n <= 0)
    return 1;
  else
    return n * factorial(n - 1);
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<factorial>:
  endbr64
  mov    $0x1,%r8d
  test   %edi,%edi
  jle    L13
  movslq %edi,%rdx
  lea    -0x1(%rdi),%esi
  mov    $0x1,%r8d
  lea    -0x1(%rdx),%rax
  mov    %rax,%rcx
  sub    %rsi,%rcx
  jmp    L2
  cs nopw 0x0(%rax,%rax,1)
L21:
  sub    $0x1,%rax
L2:
  imul   %rdx,%r8
  mov    %rax,%rdx
  cmp    %rcx,%rax
  jne    L21
L13:
  mov    %r8,%rax
  ret
```

assistant: ```c
long factorial(int n) {
  if (n <= 0)
    return 1;
  else
    return n * factorial(n - 1);
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<factorial>:
  endbr64
  mov    $0x1,%r8d
  test   %edi,%edi
  jle    L18
  movslq %edi,%rdx
  lea    -0x1(%rdi),%esi
  mov    $0x1,%r8d
  lea    -0x1(%rdx),%rax
  mov    %rax,%rcx
  sub    %rsi,%rcx
  jmp    L2
  cs nopw 0x0(%rax,%rax,1)
L6:
  sub    $0x1,%rax
L2:
  imul   %rdx,%r8
  mov    %rax,%rdx
  cmp    %rcx,%rax
  jne    L6
L18:
  mov    %r8,%rax
  ret
```

assistant: ```c
long factorial(int n) {
  if (n <= 0)
    return 1;
  else
    return n * factorial(n - 1);
}
```
user: What is the c source code of the assembly code below?

```asm
<mm_sum>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,%esi
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <_mm_store_ps@plt>
  movss  -0x20(%rbp),%xmm1
  movss  -0x1c(%rbp),%xmm0
  addss  %xmm0,%xmm1
  movss  -0x18(%rbp),%xmm0
  addss  %xmm0,%xmm1
  movss  -0x14(%rbp),%xmm0
  addss  %xmm1,%xmm0
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L4
  call   <__stack_chk_fail@plt>
L4:
  leave
  ret
```

assistant: ```c
float mm_sum(register __m128 sum) {
  float f[4] __attribute__((aligned(16)));
  _mm_store_ps(f, sum);
  return (f[0] + f[1] + f[2] + f[3]);
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<mm_sum>:
  endbr64
  sub    $0x28,%rsp
  mov    %edi,%esi
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rdi
  call   <_mm_store_ps@plt>
  movss  (%rsp),%xmm0
  addss  0x4(%rsp),%xmm0
  addss  0x8(%rsp),%xmm0
  addss  0xc(%rsp),%xmm0
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L9
  add    $0x28,%rsp
  ret
L9:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
float mm_sum(register __m128 sum) {
  float f[4] __attribute__((aligned(16)));
  _mm_store_ps(f, sum);
  return (f[0] + f[1] + f[2] + f[3]);
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<mm_sum>:
  endbr64
  sub    $0x28,%rsp
  mov    %edi,%esi
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rdi
  call   <_mm_store_ps@plt>
  movss  (%rsp),%xmm0
  addss  0x4(%rsp),%xmm0
  addss  0x8(%rsp),%xmm0
  addss  0xc(%rsp),%xmm0
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L0
  add    $0x28,%rsp
  ret
L0:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
float mm_sum(register __m128 sum) {
  float f[4] __attribute__((aligned(16)));
  _mm_store_ps(f, sum);
  return (f[0] + f[1] + f[2] + f[3]);
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<mm_sum>:
  endbr64
  sub    $0x28,%rsp
  mov    %edi,%esi
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rdi
  call   <_mm_store_ps@plt>
  movss  (%rsp),%xmm0
  addss  0x4(%rsp),%xmm0
  addss  0x8(%rsp),%xmm0
  addss  0xc(%rsp),%xmm0
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L9
  add    $0x28,%rsp
  ret
L9:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
float mm_sum(register __m128 sum) {
  float f[4] __attribute__((aligned(16)));
  _mm_store_ps(f, sum);
  return (f[0] + f[1] + f[2] + f[3]);
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<splashScreen>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    $0x0,%edi
  call   <curs_set@plt>
  lea    D50(%rip),%rax
  mov    %rax,%rdx
  mov    $0x0,%esi
  mov    $0x3,%edi
  call   <mvprintw@plt>
  lea    D42(%rip),%rax
  mov    %rax,%rdx
  mov    $0x0,%esi
  mov    $0x4,%edi
  call   <mvprintw@plt>
  lea    D63(%rip),%rax
  mov    %rax,%rdx
  mov    $0x0,%esi
  mov    $0x5,%edi
  call   <mvprintw@plt>
  lea    D22(%rip),%rax
  mov    %rax,%rdx
  mov    $0x0,%esi
  mov    $0x6,%edi
  call   <mvprintw@plt>
  lea    D17(%rip),%rax
  mov    %rax,%rdx
  mov    $0x0,%esi
  mov    $0x7,%edi
  call   <mvprintw@plt>
  lea    D53(%rip),%rax
  mov    %rax,%rdx
  mov    $0x0,%esi
  mov    $0x8,%edi
  call   <mvprintw@plt>
  lea    D2(%rip),%rax
  mov    %rax,%rdx
  mov    $0x0,%esi
  mov    $0x9,%edi
  call   <mvprintw@plt>
  mov    $0x0,%eax
  call   <refresh@plt>
  mov    $0x7d0,%edi
  call   <delay@plt>
  mov    $0x1,%edi
  call   <curs_set@plt>
  nop
  pop    %rbp
  ret
```

tool_calls: name: parse_data
arguments: data_label: D50
type: string
name: parse_data
arguments: data_label: D42
type: string
name: parse_data
arguments: data_label: D63
type: string
name: parse_data
arguments: data_label: D22
type: string
name: parse_data
arguments: data_label: D17
type: string
name: parse_data
arguments: data_label: D53
type: string
name: parse_data
arguments: data_label: D2
type: string

tool: D50:       #                                      #     #                            

tool: D42:       #  ####   ####   ####   #####    ##    #     # ###### #      #    #   ##  

tool: D63:       # #    # #    # #    #  #    #  #  #   #     # #      #      #    #  #  # 

tool: D22:       # #    # #      #    #  #    # #    #  #     # #####  #      ###### #    #

tool: D17: #     # #    # #  ### #    #  #    # ######   #   #  #      #      #    # ######

tool: D53: #     # #    # #    # #    #  #    # #    #    # #   #      #      #    # #    #

tool: D2:  #####   ####   ####   ####   #####  #    #     #    ###### ###### #    # #    #

assistant: ```c
void splashScreen() {
  curs_set(0);
  mvprintw(3, 0, "      #                                      #     #                            ");
  mvprintw(4, 0, "      #  ####   ####   ####   #####    ##    #     # ###### #      #    #   ##  ");
  mvprintw(5, 0, "      # #    # #    # #    #  #    #  #  #   #     # #      #      #    #  #  # ");
  mvprintw(6, 0, "      # #    # #      #    #  #    # #    #  #     # #####  #      ###### #    #");
  mvprintw(7, 0, "#     # #    # #  ### #    #  #    # ######   #   #  #      #      #    # ######");
  mvprintw(8, 0, "#     # #    # #    # #    #  #    # #    #    # #   #      #      #    # #    #");
  mvprintw(9, 0, " #####   ####   ####   ####   #####  #    #     #    ###### ###### #    # #    #");
  refresh();
  delay(2000);
  curs_set(1);
}
```
user: Translate the below assembly code into C programming language:

```asm
<splashScreen>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x0,%edi
  call   <curs_set@plt>
  lea    D34(%rip),%rdx
  mov    $0x0,%esi
  mov    $0x3,%edi
  call   <mvprintw@plt>
  lea    D65(%rip),%rdx
  mov    $0x0,%esi
  mov    $0x4,%edi
  call   <mvprintw@plt>
  lea    D13(%rip),%rdx
  mov    $0x0,%esi
  mov    $0x5,%edi
  call   <mvprintw@plt>
  lea    D36(%rip),%rdx
  mov    $0x0,%esi
  mov    $0x6,%edi
  call   <mvprintw@plt>
  lea    D8(%rip),%rdx
  mov    $0x0,%esi
  mov    $0x7,%edi
  call   <mvprintw@plt>
  lea    D30(%rip),%rdx
  mov    $0x0,%esi
  mov    $0x8,%edi
  call   <mvprintw@plt>
  lea    D10(%rip),%rdx
  mov    $0x0,%esi
  mov    $0x9,%edi
  call   <mvprintw@plt>
  mov    $0x0,%eax
  call   <refresh@plt>
  mov    $0x7d0,%edi
  call   <delay@plt>
  mov    $0x1,%edi
  call   <curs_set@plt>
  add    $0x8,%rsp
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D34
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D65
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D13
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D36
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D8
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D30
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D10
type_guessed: string

tool: D34:       #                                      #     #                            

tool: D65:       #  ####   ####   ####   #####    ##    #     # ###### #      #    #   ##  

tool: D13:       # #    # #    # #    #  #    #  #  #   #     # #      #      #    #  #  # 

tool: D36:       # #    # #      #    #  #    # #    #  #     # #####  #      ###### #    #

tool: D8: #     # #    # #  ### #    #  #    # ######   #   #  #      #      #    # ######

tool: D30: #     # #    # #    # #    #  #    # #    #    # #   #      #      #    # #    #

tool: D10:  #####   ####   ####   ####   #####  #    #     #    ###### ###### #    # #    #

assistant: ```c
void splashScreen() {
  curs_set(0);
  mvprintw(3, 0, "      #                                      #     #                            ");
  mvprintw(4, 0, "      #  ####   ####   ####   #####    ##    #     # ###### #      #    #   ##  ");
  mvprintw(5, 0, "      # #    # #    # #    #  #    #  #  #   #     # #      #      #    #  #  # ");
  mvprintw(6, 0, "      # #    # #      #    #  #    # #    #  #     # #####  #      ###### #    #");
  mvprintw(7, 0, "#     # #    # #  ### #    #  #    # ######   #   #  #      #      #    # ######");
  mvprintw(8, 0, "#     # #    # #    # #    #  #    # #    #    # #   #      #      #    # #    #");
  mvprintw(9, 0, " #####   ####   ####   ####   #####  #    #     #    ###### ###### #    # #    #");
  refresh();
  delay(2000);
  curs_set(1);
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<splashScreen>:
  endbr64
  sub    $0x8,%rsp
  xor    %edi,%edi
  call   <curs_set@plt>
  lea    D69(%rip),%rdx
  xor    %esi,%esi
  mov    $0x3,%edi
  call   <mvprintw@plt>
  lea    D32(%rip),%rdx
  xor    %esi,%esi
  mov    $0x4,%edi
  call   <mvprintw@plt>
  lea    D0(%rip),%rdx
  xor    %esi,%esi
  mov    $0x5,%edi
  call   <mvprintw@plt>
  lea    D66(%rip),%rdx
  xor    %esi,%esi
  mov    $0x6,%edi
  call   <mvprintw@plt>
  lea    D17(%rip),%rdx
  xor    %esi,%esi
  mov    $0x7,%edi
  call   <mvprintw@plt>
  lea    D58(%rip),%rdx
  xor    %esi,%esi
  mov    $0x8,%edi
  call   <mvprintw@plt>
  lea    D36(%rip),%rdx
  xor    %esi,%esi
  mov    $0x9,%edi
  call   <mvprintw@plt>
  xor    %eax,%eax
  call   <refresh@plt>
  mov    $0x7d0,%edi
  call   <delay@plt>
  mov    $0x1,%edi
  add    $0x8,%rsp
  jmp    10b0 <curs_set@plt>
```

tool_calls: name: unpack_data
arguments: data_label: D69
type: string
name: unpack_data
arguments: data_label: D32
type: string
name: unpack_data
arguments: data_label: D0
type: string
name: unpack_data
arguments: data_label: D66
type: string
name: unpack_data
arguments: data_label: D17
type: string
name: unpack_data
arguments: data_label: D58
type: string
name: unpack_data
arguments: data_label: D36
type: string

tool: D69:       #                                      #     #                            

tool: D32:       #  ####   ####   ####   #####    ##    #     # ###### #      #    #   ##  

tool: D0:       # #    # #    # #    #  #    #  #  #   #     # #      #      #    #  #  # 

tool: D66:       # #    # #      #    #  #    # #    #  #     # #####  #      ###### #    #

tool: D17: #     # #    # #  ### #    #  #    # ######   #   #  #      #      #    # ######

tool: D58: #     # #    # #    # #    #  #    # #    #    # #   #      #      #    # #    #

tool: D36:  #####   ####   ####   ####   #####  #    #     #    ###### ###### #    # #    #

assistant: ```c
void splashScreen() {
  curs_set(0);
  mvprintw(3, 0, "      #                                      #     #                            ");
  mvprintw(4, 0, "      #  ####   ####   ####   #####    ##    #     # ###### #      #    #   ##  ");
  mvprintw(5, 0, "      # #    # #    # #    #  #    #  #  #   #     # #      #      #    #  #  # ");
  mvprintw(6, 0, "      # #    # #      #    #  #    # #    #  #     # #####  #      ###### #    #");
  mvprintw(7, 0, "#     # #    # #  ### #    #  #    # ######   #   #  #      #      #    # ######");
  mvprintw(8, 0, "#     # #    # #    # #    #  #    # #    #    # #   #      #      #    # #    #");
  mvprintw(9, 0, " #####   ####   ####   ####   #####  #    #     #    ###### ###### #    # #    #");
  refresh();
  delay(2000);
  curs_set(1);
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<splashScreen>:
  endbr64
  sub    $0x8,%rsp
  xor    %edi,%edi
  call   <curs_set@plt>
  lea    D48(%rip),%rdx
  xor    %esi,%esi
  mov    $0x3,%edi
  call   <mvprintw@plt>
  lea    D55(%rip),%rdx
  xor    %esi,%esi
  mov    $0x4,%edi
  call   <mvprintw@plt>
  lea    D0(%rip),%rdx
  xor    %esi,%esi
  mov    $0x5,%edi
  call   <mvprintw@plt>
  lea    D54(%rip),%rdx
  xor    %esi,%esi
  mov    $0x6,%edi
  call   <mvprintw@plt>
  lea    D37(%rip),%rdx
  xor    %esi,%esi
  mov    $0x7,%edi
  call   <mvprintw@plt>
  lea    D61(%rip),%rdx
  xor    %esi,%esi
  mov    $0x8,%edi
  call   <mvprintw@plt>
  lea    D24(%rip),%rdx
  xor    %esi,%esi
  mov    $0x9,%edi
  call   <mvprintw@plt>
  xor    %eax,%eax
  call   <refresh@plt>
  mov    $0x7d0,%edi
  call   <delay@plt>
  mov    $0x1,%edi
  add    $0x8,%rsp
  jmp    10b0 <curs_set@plt>
```

tool_calls: name: read_data
arguments: label: D48
data_type: string
name: read_data
arguments: label: D55
data_type: string
name: read_data
arguments: label: D0
data_type: string
name: read_data
arguments: label: D54
data_type: string
name: read_data
arguments: label: D37
data_type: string
name: read_data
arguments: label: D61
data_type: string
name: read_data
arguments: label: D24
data_type: string

tool: D48:       #                                      #     #                            

tool: D55:       #  ####   ####   ####   #####    ##    #     # ###### #      #    #   ##  

tool: D0:       # #    # #    # #    #  #    #  #  #   #     # #      #      #    #  #  # 

tool: D54:       # #    # #      #    #  #    # #    #  #     # #####  #      ###### #    #

tool: D37: #     # #    # #  ### #    #  #    # ######   #   #  #      #      #    # ######

tool: D61: #     # #    # #    # #    #  #    # #    #    # #   #      #      #    # #    #

tool: D24:  #####   ####   ####   ####   #####  #    #     #    ###### ###### #    # #    #

assistant: ```c
void splashScreen() {
  curs_set(0);
  mvprintw(3, 0, "      #                                      #     #                            ");
  mvprintw(4, 0, "      #  ####   ####   ####   #####    ##    #     # ###### #      #    #   ##  ");
  mvprintw(5, 0, "      # #    # #    # #    #  #    #  #  #   #     # #      #      #    #  #  # ");
  mvprintw(6, 0, "      # #    # #      #    #  #    # #    #  #     # #####  #      ###### #    #");
  mvprintw(7, 0, "#     # #    # #  ### #    #  #    # ######   #   #  #      #      #    # ######");
  mvprintw(8, 0, "#     # #    # #    # #    #  #    # #    #    # #   #      #      #    # #    #");
  mvprintw(9, 0, " #####   ####   ####   ####   #####  #    #     #    ###### ###### #    # #    #");
  refresh();
  delay(2000);
  curs_set(1);
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<score_strings>:
  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    %rax,-0x10(%rbp)
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x40,-0x10(%rbp)
  ja     L33
  cmpq   $0x40,-0x8(%rbp)
  jbe    L5
L33:
  mov    $0x0,%eax
  jmp    L75
L5:
  mov    -0x30(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <has_common_substring@plt>
  test   %rax,%rax
  jne    L30
  mov    $0x0,%eax
  jmp    L75
L30:
  mov    -0x8(%rbp),%rax
  mov    %eax,%ecx
  mov    -0x10(%rbp),%rax
  mov    %eax,%esi
  mov    -0x30(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <edit_distn@plt>
  mov    %eax,-0x14(%rbp)
  mov    -0x14(%rbp),%eax
  shl    $0x6,%eax
  cltq
  mov    -0x10(%rbp),%rcx
  mov    -0x8(%rbp),%rdx
  lea    (%rdx,%rcx,1),%rdi
  mov    $0x0,%edx
  div    %rdi
  mov    %eax,-0x14(%rbp)
  mov    -0x14(%rbp),%eax
  imul   $0x64,%eax,%eax
  lea    0x3f(%rax),%edx
  test   %eax,%eax
  cmovs  %edx,%eax
  sar    $0x6,%eax
  mov    %eax,-0x14(%rbp)
  cmpl   $0x63,-0x14(%rbp)
  jle    L7
  mov    $0x0,%eax
  jmp    L75
L7:
  mov    $0x64,%eax
  sub    -0x14(%rbp),%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x14(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x34(%rbp),%eax
  mov    %eax,%edx
  mov    $0xaaaaaaab,%eax
  imul   %rdx,%rax
  shr    $0x20,%rax
  shr    %eax
  mov    %eax,%esi
  mov    -0x8(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  cmp    %rax,%rdx
  cmovbe %rdx,%rax
  imul   %rsi,%rax
  cmp    %rax,%rcx
  jbe    L12
  mov    -0x34(%rbp),%eax
  mov    %eax,%edx
  mov    $0xaaaaaaab,%eax
  imul   %rdx,%rax
  shr    $0x20,%rax
  mov    %eax,%ecx
  shr    %ecx
  mov    -0x8(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  cmp    %rax,%rdx
  cmovbe %rdx,%rax
  imul   %ecx,%eax
  mov    %eax,-0x14(%rbp)
L12:
  mov    -0x14(%rbp),%eax
L75:
  leave
  ret
```

assistant: ```c
uint32_t score_strings(const char *s1, const char *s2, unsigned int block_size) {
  uint32_t score;
  size_t len1, len2;
  int edit_distn(const char *from, int from_len, const char *to, int to_len);
  len1 = strlen(s1);
  len2 = strlen(s2);
  if (len1 > 64 || len2 > 64) {
    return 0;
  }
  if (has_common_substring(s1, s2) == 0) {
    return 0;
  }
  score = edit_distn(s1, len1, s2, len2);
  score = (score * 64) / (len1 + len2);
  score = (100 * score) / 64;
  if (score >= 100)
    return 0;
  score = 100 - score;
  if (score > block_size / 3 * ((len1) < (len2) ? (len1) : (len2))) {
    score = block_size / 3 * ((len1) < (len2) ? (len1) : (len2));
  }
  return score;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<score_strings>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbp
  mov    %rsi,%r12
  mov    %edx,%r14d
  call   <strlen@plt>
  mov    %rax,%rbx
  mov    %r12,%rdi
  call   <strlen@plt>
  cmp    $0x40,%rbx
  ja     L3
  mov    %rax,%r13
  cmp    $0x40,%rax
  ja     L3
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <has_common_substring@plt>
  mov    $0x0,%edx
  test   %rax,%rax
  je     L46
  mov    %r13d,%ecx
  mov    %r12,%rdx
  mov    %ebx,%esi
  mov    %rbp,%rdi
  call   <edit_distn@plt>
  shl    $0x6,%eax
  cltq
  lea    (%rbx,%r13,1),%rcx
  mov    $0x0,%edx
  div    %rcx
  imul   $0x64,%eax,%eax
  mov    $0x0,%edx
  cmp    $0x18ff,%eax
  jg     L46
  lea    0x3f(%rax),%edx
  test   %eax,%eax
  cmovs  %edx,%eax
  sar    $0x6,%eax
  mov    $0x64,%edx
  sub    %eax,%edx
  mov    %r14d,%r14d
  mov    $0xaaaaaaab,%eax
  imul   %rax,%r14
  shr    $0x21,%r14
  cmp    %r13,%rbx
  cmova  %r13,%rbx
  movslq %edx,%rcx
  mov    %r14d,%eax
  imul   %rbx,%rax
  cmp    %rax,%rcx
  jbe    L46
  mov    %r14d,%edx
  imul   %ebx,%edx
  jmp    L46
L3:
  mov    $0x0,%edx
L46:
  mov    %edx,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

assistant: ```c
uint32_t score_strings(const char *s1, const char *s2, unsigned int block_size) {
  uint32_t score;
  size_t len1, len2;
  int edit_distn(const char *from, int from_len, const char *to, int to_len);
  len1 = strlen(s1);
  len2 = strlen(s2);
  if (len1 > 64 || len2 > 64) {
    return 0;
  }
  if (has_common_substring(s1, s2) == 0) {
    return 0;
  }
  score = edit_distn(s1, len1, s2, len2);
  score = (score * 64) / (len1 + len2);
  score = (100 * score) / 64;
  if (score >= 100)
    return 0;
  score = 100 - score;
  if (score > block_size / 3 * ((len1) < (len2) ? (len1) : (len2))) {
    score = block_size / 3 * ((len1) < (len2) ? (len1) : (len2));
  }
  return score;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<score_strings>:
  endbr64
  push   %r14
  mov    %edx,%r14d
  push   %r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  call   <strlen@plt>
  mov    %r12,%rdi
  mov    %rax,%rbx
  call   <strlen@plt>
  cmp    $0x40,%rbx
  ja     L14
  mov    %rax,%r13
  cmp    $0x40,%rax
  ja     L14
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <has_common_substring@plt>
  test   %rax,%rax
  je     L14
  mov    %r13d,%ecx
  mov    %r12,%rdx
  mov    %ebx,%esi
  mov    %rbp,%rdi
  call   <edit_distn@plt>
  lea    (%rbx,%r13,1),%rcx
  xor    %edx,%edx
  shl    $0x6,%eax
  cltq
  div    %rcx
  imul   $0x64,%eax,%eax
  cmp    $0x18ff,%eax
  jg     L14
  test   %eax,%eax
  lea    0x3f(%rax),%edx
  cmovns %eax,%edx
  mov    $0x64,%eax
  sar    $0x6,%edx
  sub    %edx,%eax
  mov    $0xaaaaaaab,%edx
  imul   %rdx,%r14
  movslq %eax,%rcx
  shr    $0x21,%r14
  cmp    %r13,%rbx
  cmova  %r13,%rbx
  mov    %r14d,%edx
  imul   %rbx,%rdx
  cmp    %rdx,%rcx
  jbe    L44
  mov    %r14d,%eax
  imul   %ebx,%eax
  jmp    L44
  nopl   (%rax)
L14:
  xor    %eax,%eax
L44:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

assistant: ```c
uint32_t score_strings(const char *s1, const char *s2, unsigned int block_size) {
  uint32_t score;
  size_t len1, len2;
  int edit_distn(const char *from, int from_len, const char *to, int to_len);
  len1 = strlen(s1);
  len2 = strlen(s2);
  if (len1 > 64 || len2 > 64) {
    return 0;
  }
  if (has_common_substring(s1, s2) == 0) {
    return 0;
  }
  score = edit_distn(s1, len1, s2, len2);
  score = (score * 64) / (len1 + len2);
  score = (100 * score) / 64;
  if (score >= 100)
    return 0;
  score = 100 - score;
  if (score > block_size / 3 * ((len1) < (len2) ? (len1) : (len2))) {
    score = block_size / 3 * ((len1) < (len2) ? (len1) : (len2));
  }
  return score;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<score_strings>:
  endbr64
  push   %r14
  mov    %edx,%r14d
  push   %r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  call   <strlen@plt>
  mov    %r12,%rdi
  mov    %rax,%rbx
  call   <strlen@plt>
  cmp    $0x40,%rbx
  ja     L22
  mov    %rax,%r13
  cmp    $0x40,%rax
  ja     L22
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <has_common_substring@plt>
  test   %rax,%rax
  je     L22
  mov    %r13d,%ecx
  mov    %r12,%rdx
  mov    %ebx,%esi
  mov    %rbp,%rdi
  call   <edit_distn@plt>
  lea    (%rbx,%r13,1),%rcx
  xor    %edx,%edx
  shl    $0x6,%eax
  cltq
  div    %rcx
  imul   $0x64,%eax,%eax
  cmp    $0x18ff,%eax
  jg     L22
  test   %eax,%eax
  lea    0x3f(%rax),%edx
  cmovns %eax,%edx
  mov    $0x64,%eax
  sar    $0x6,%edx
  sub    %edx,%eax
  mov    $0xaaaaaaab,%edx
  imul   %rdx,%r14
  movslq %eax,%rcx
  shr    $0x21,%r14
  cmp    %r13,%rbx
  cmova  %r13,%rbx
  mov    %r14d,%edx
  imul   %rbx,%rdx
  cmp    %rdx,%rcx
  jbe    L59
  mov    %r14d,%eax
  imul   %ebx,%eax
  jmp    L59
  nopl   (%rax)
L22:
  xor    %eax,%eax
L59:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

assistant: ```c
uint32_t score_strings(const char *s1, const char *s2, unsigned int block_size) {
  uint32_t score;
  size_t len1, len2;
  int edit_distn(const char *from, int from_len, const char *to, int to_len);
  len1 = strlen(s1);
  len2 = strlen(s2);
  if (len1 > 64 || len2 > 64) {
    return 0;
  }
  if (has_common_substring(s1, s2) == 0) {
    return 0;
  }
  score = edit_distn(s1, len1, s2, len2);
  score = (score * 64) / (len1 + len2);
  score = (100 * score) / 64;
  if (score >= 100)
    return 0;
  score = 100 - score;
  if (score > block_size / 3 * ((len1) < (len2) ? (len1) : (len2))) {
    score = block_size / 3 * ((len1) < (len2) ? (len1) : (len2));
  }
  return score;
}
```