ylfeng/ReF-Decompile-dataset huggingface dataset:
user: What is the c source code of the assembly code below?

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x70,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x70(%rbp),%rax
  mov    %rax,%rsi
  lea    D9(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  movl   $0x1,-0x64(%rbp)
  jmp    L27
L70:
  lea    -0x60(%rbp),%rdx
  mov    -0x64(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    %rax,%rsi
  lea    D9(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  addl   $0x1,-0x64(%rbp)
L27:
  mov    -0x70(%rbp),%eax
  cmp    %eax,-0x64(%rbp)
  jle    L70
  movl   $0x0,-0x6c(%rbp)
  jmp    L17
L19:
  mov    -0x6c(%rbp),%eax
  mov    %eax,%esi
  lea    D9(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movl   $0x1,-0x68(%rbp)
  jmp    L32
L33:
  mov    -0x68(%rbp),%eax
  cltq
  mov    -0x60(%rbp,%rax,4),%eax
  cmp    %eax,-0x6c(%rbp)
  jne    L24
  mov    $0x2a,%edi
  call   <putchar@plt>
L24:
  addl   $0x1,-0x68(%rbp)
L32:
  mov    -0x70(%rbp),%eax
  cmp    %eax,-0x68(%rbp)
  jle    L33
  mov    $0xa,%edi
  call   <putchar@plt>
  addl   $0x1,-0x6c(%rbp)
L17:
  mov    -0x70(%rbp),%eax
  cmp    %eax,-0x6c(%rbp)
  jle    L19
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L40
  call   <__stack_chk_fail@plt>
L40:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: tag: D9
data_type: string

tool: D9: %d

assistant: ```c
int main() {
  int array[20];
  int count, c, length, i;
  scanf("%d", &length);
  for (i = 1; i <= length; i++) {
    scanf("%d", &array[i]);
  }
  for (count = 0; count <= length; count++) {
    printf("%d", count);
    for (c = 1; c <= length; c++) {
      if (array[c] == count) {
        printf("*");
      }
    }
    printf("\n");
  }
  return 0;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<main>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x78,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x68(%rsp)
  xor    %eax,%eax
  lea    0xc(%rsp),%rsi
  lea    D10(%rip),%rdi
  call   <scanf@plt>
  cmpl   $0x0,0xc(%rsp)
  jle    L43
  lea    0x14(%rsp),%rbp
  mov    $0x1,%ebx
  lea    D10(%rip),%r12
L21:
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <scanf@plt>
  add    $0x1,%ebx
  add    $0x4,%rbp
  cmp    %ebx,0xc(%rsp)
  jge    L21
L43:
  cmpl   $0x0,0xc(%rsp)
  js     L70
  mov    $0x0,%ebp
  lea    D10(%rip),%r13
  jmp    L88
L99:
  mov    $0x2a,%edi
  call   <putchar@plt>
L94:
  add    $0x1,%rbx
  cmp    %ebx,0xc(%rsp)
  jl     L17
L24:
  cmp    %ebp,(%r12,%rbx,4)
  jne    L94
  jmp    L99
L17:
  mov    $0xa,%edi
  call   <putchar@plt>
  add    $0x1,%ebp
  cmp    %ebp,0xc(%rsp)
  jl     L70
L88:
  mov    %ebp,%esi
  mov    %r13,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  cmpl   $0x0,0xc(%rsp)
  jle    L17
  mov    $0x1,%ebx
  lea    0x10(%rsp),%r12
  jmp    L24
L70:
  mov    0x68(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L38
  mov    $0x0,%eax
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L38:
  call   <__stack_chk_fail@plt>
```

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

tool: D10: %d

assistant: ```c
int main() {
  int array[20];
  int count, c, length, i;
  scanf("%d", &length);
  for (i = 1; i <= length; i++) {
    scanf("%d", &array[i]);
  }
  for (count = 0; count <= length; count++) {
    printf("%d", count);
    for (c = 1; c <= length; c++) {
      if (array[c] == count) {
        printf("*");
      }
    }
    printf("\n");
  }
  return 0;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<main>:
  endbr64
  push   %r13
  lea    D2(%rip),%r13
  push   %r12
  mov    %r13,%rdi
  push   %rbp
  push   %rbx
  sub    $0x78,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x68(%rsp)
  xor    %eax,%eax
  lea    0xc(%rsp),%rsi
  call   <scanf@plt>
  mov    0xc(%rsp),%eax
  test   %eax,%eax
  jle    L66
  lea    0x14(%rsp),%rbp
  mov    $0x1,%ebx
  nopl   0x0(%rax)
L30:
  mov    %rbp,%rsi
  mov    %r13,%rdi
  add    $0x1,%ebx
  add    $0x4,%rbp
  call   <scanf@plt>
  mov    0xc(%rsp),%eax
  cmp    %ebx,%eax
  jge    L30
L66:
  xor    %ebp,%ebp
  lea    0x10(%rsp),%r12
  test   %eax,%eax
  js     L88
  nopl   (%rax)
L44:
  mov    %ebp,%esi
  mov    %r13,%rdi
  xor    %eax,%eax
  mov    $0x1,%ebx
  call   <printf@plt>
  mov    0xc(%rsp),%eax
  test   %eax,%eax
  jg     L54
  jmp    L52
  nopl   0x0(%rax,%rax,1)
L72:
  add    $0x1,%rbx
  cmp    %ebx,0xc(%rsp)
  jl     L52
L54:
  cmp    %ebp,(%r12,%rbx,4)
  jne    L72
  mov    $0x2a,%edi
  add    $0x1,%rbx
  call   <putchar@plt>
  cmp    %ebx,0xc(%rsp)
  jge    L54
  nopl   0x0(%rax)
L52:
  mov    $0xa,%edi
  add    $0x1,%ebp
  call   <putchar@plt>
  cmp    %ebp,0xc(%rsp)
  jge    L44
L88:
  mov    0x68(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L38
  add    $0x78,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L38:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: label: D2
type_guessed: string

tool: D2: %d

assistant: ```c
int main() {
  int array[20];
  int count, c, length, i;
  scanf("%d", &length);
  for (i = 1; i <= length; i++) {
    scanf("%d", &array[i]);
  }
  for (count = 0; count <= length; count++) {
    printf("%d", count);
    for (c = 1; c <= length; c++) {
      if (array[c] == count) {
        printf("*");
      }
    }
    printf("\n");
  }
  return 0;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<main>:
  endbr64
  push   %r13
  lea    D9(%rip),%r13
  push   %r12
  mov    %r13,%rdi
  push   %rbp
  push   %rbx
  sub    $0x78,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x68(%rsp)
  xor    %eax,%eax
  lea    0xc(%rsp),%rsi
  call   <scanf@plt>
  mov    0xc(%rsp),%eax
  test   %eax,%eax
  jle    L4
  lea    0x14(%rsp),%rbp
  mov    $0x1,%ebx
  nopl   0x0(%rax)
L39:
  mov    %rbp,%rsi
  mov    %r13,%rdi
  add    $0x1,%ebx
  add    $0x4,%rbp
  call   <scanf@plt>
  mov    0xc(%rsp),%eax
  cmp    %ebx,%eax
  jge    L39
L4:
  xor    %ebp,%ebp
  lea    0x10(%rsp),%r12
  test   %eax,%eax
  js     L46
  nopl   (%rax)
L73:
  mov    %ebp,%esi
  mov    %r13,%rdi
  xor    %eax,%eax
  mov    $0x1,%ebx
  call   <printf@plt>
  mov    0xc(%rsp),%eax
  test   %eax,%eax
  jle    L57
  nopl   0x0(%rax)
L99:
  cmp    %ebp,(%r12,%rbx,4)
  je     L26
  add    $0x1,%rbx
  cmp    %ebx,%eax
  jge    L99
L57:
  mov    $0xa,%edi
  add    $0x1,%ebp
  call   <putchar@plt>
  cmp    %ebp,0xc(%rsp)
  jge    L73
L46:
  mov    0x68(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L59
  add    $0x78,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  xchg   %ax,%ax
L26:
  mov    $0x2a,%edi
  add    $0x1,%rbx
  call   <putchar@plt>
  mov    0xc(%rsp),%eax
  cmp    %ebx,%eax
  jge    L99
  jmp    L57
L59:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: tag: D9
type: string

tool: D9: %d

assistant: ```c
int main() {
  int array[20];
  int count, c, length, i;
  scanf("%d", &length);
  for (i = 1; i <= length; i++) {
    scanf("%d", &array[i]);
  }
  for (count = 0; count <= length; count++) {
    printf("%d", count);
    for (c = 1; c <= length; c++) {
      if (array[c] == count) {
        printf("*");
      }
    }
    printf("\n");
  }
  return 0;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<count_char>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,%eax
  mov    %al,-0x1c(%rbp)
  movl   $0x0,-0x8(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L9
L15:
  mov    -0x8(%rbp),%edx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    %al,-0x1c(%rbp)
  jne    L0
  addl   $0x1,-0x4(%rbp)
L0:
  addl   $0x1,-0x8(%rbp)
L9:
  mov    -0x8(%rbp),%edx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L15
  mov    -0x4(%rbp),%eax
  pop    %rbp
  ret
```

assistant: ```c
unsigned int count_char(const char *astring, const char achar) {
  unsigned int i = 0, j = 0;
  while (astring[i] != '\0') {
    if (astring[i] == achar)
      j++;
    i++;
  }
  return j;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<count_char>:
  endbr64
  movzbl (%rdi),%eax
  test   %al,%al
  je     L5
  mov    $0x0,%ecx
  mov    $0x0,%edx
L29:
  cmp    %al,%sil
  sete   %al
  movzbl %al,%eax
  add    %eax,%ecx
  add    $0x1,%edx
  mov    %edx,%eax
  movzbl (%rdi,%rax,1),%eax
  test   %al,%al
  jne    L29
L9:
  mov    %ecx,%eax
  ret
L5:
  mov    $0x0,%ecx
  jmp    L9
```

assistant: ```c
unsigned int count_char(const char *astring, const char achar) {
  unsigned int i = 0, j = 0;
  while (astring[i] != '\0') {
    if (astring[i] == achar)
      j++;
    i++;
  }
  return j;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<count_char>:
  endbr64
  movzbl (%rdi),%eax
  xor    %r8d,%r8d
  test   %al,%al
  je     L17
  xor    %edx,%edx
L18:
  cmp    %al,%sil
  sete   %al
  movzbl %al,%eax
  add    %eax,%r8d
  lea    0x1(%rdx),%eax
  mov    %rax,%rdx
  movzbl (%rdi,%rax,1),%eax
  test   %al,%al
  jne    L18
L17:
  mov    %r8d,%eax
  ret
```

assistant: ```c
unsigned int count_char(const char *astring, const char achar) {
  unsigned int i = 0, j = 0;
  while (astring[i] != '\0') {
    if (astring[i] == achar)
      j++;
    i++;
  }
  return j;
}
```
user: What is the c source code of the assembly code below:

```asm
<count_char>:
  endbr64
  movzbl (%rdi),%eax
  xor    %r8d,%r8d
  test   %al,%al
  je     L3
  xor    %edx,%edx
L6:
  cmp    %sil,%al
  sete   %al
  movzbl %al,%eax
  add    %eax,%r8d
  lea    0x1(%rdx),%eax
  mov    %rax,%rdx
  movzbl (%rdi,%rax,1),%eax
  test   %al,%al
  jne    L6
L3:
  mov    %r8d,%eax
  ret
```

assistant: ```c
unsigned int count_char(const char *astring, const char achar) {
  unsigned int i = 0, j = 0;
  while (astring[i] != '\0') {
    if (astring[i] == achar)
      j++;
    i++;
  }
  return j;
}
```
user: Translate the below assembly code into C programming language:

```asm
<HASH>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L7
L17:
  shll   -0x4(%rbp)
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  add    %eax,-0x4(%rbp)
  addq   $0x1,-0x18(%rbp)
L7:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L17
  mov    -0x4(%rbp),%eax
  movzbl %al,%eax
  pop    %rbp
  ret
```

assistant: ```c
int HASH(const char *str) {
  int idx = 0;
  while (*str) {
    idx = idx << 1;
    idx += *str;
    str++;
  }
  return (idx & (256 - 1));
}
```
user: What is the c source code of the assembly code below:

```asm
<HASH>:
  endbr64
  movzbl (%rdi),%edx
  test   %dl,%dl
  je     L20
  mov    $0x0,%eax
L13:
  movsbl %dl,%edx
  lea    (%rdx,%rax,2),%eax
  add    $0x1,%rdi
  movzbl (%rdi),%edx
  test   %dl,%dl
  jne    L13
L25:
  movzbl %al,%eax
  ret
L20:
  mov    $0x0,%eax
  jmp    L25
```

assistant: ```c
int HASH(const char *str) {
  int idx = 0;
  while (*str) {
    idx = idx << 1;
    idx += *str;
    str++;
  }
  return (idx & (256 - 1));
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<HASH>:
  endbr64
  movsbl (%rdi),%edx
  xor    %eax,%eax
  test   %dl,%dl
  je     L17
  nopl   (%rax)
L15:
  add    $0x1,%rdi
  lea    (%rdx,%rax,2),%eax
  movsbl (%rdi),%edx
  test   %dl,%dl
  jne    L15
  movzbl %al,%eax
  ret
  nopw   0x0(%rax,%rax,1)
L17:
  ret
```

assistant: ```c
int HASH(const char *str) {
  int idx = 0;
  while (*str) {
    idx = idx << 1;
    idx += *str;
    str++;
  }
  return (idx & (256 - 1));
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<HASH>:
  endbr64
  movsbl (%rdi),%edx
  xor    %eax,%eax
  test   %dl,%dl
  je     L15
  nopl   (%rax)
L16:
  add    $0x1,%rdi
  lea    (%rdx,%rax,2),%eax
  movsbl (%rdi),%edx
  test   %dl,%dl
  jne    L16
  movzbl %al,%eax
  ret
  nopw   0x0(%rax,%rax,1)
L15:
  ret
```

assistant: ```c
int HASH(const char *str) {
  int idx = 0;
  while (*str) {
    idx = idx << 1;
    idx += *str;
    str++;
  }
  return (idx & (256 - 1));
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<downcase_lithuanian>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x4(%rbp)
  mov    %rsi,-0x10(%rbp)
  mov    %rdx,-0x18(%rbp)
  mov    %rcx,-0x20(%rbp)
  cmpl   $0x12e,-0x4(%rbp)
  je     L152
  cmpl   $0x12e,-0x4(%rbp)
  jg     L127
  cmpl   $0x128,-0x4(%rbp)
  je     L90
  cmpl   $0x128,-0x4(%rbp)
  jg     L127
  cmpl   $0xcd,-0x4(%rbp)
  je     L121
  cmpl   $0xcd,-0x4(%rbp)
  jg     L127
  cmpl   $0x4a,-0x4(%rbp)
  jg     L116
  cmpl   $0x49,-0x4(%rbp)
  jge    L152
  jmp    L127
L116:
  cmpl   $0xcc,-0x4(%rbp)
  je     L169
  jmp    L127
L152:
  mov    -0x18(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <has_more_above@plt>
  test   %eax,%eax
  jne    L160
  mov    $0x0,%eax
  jmp    L94
L160:
  mov    -0x4(%rbp),%eax
  mov    %eax,%edi
  call   <u_char_downcase@plt>
  mov    %eax,%ecx
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdx
  mov    $0x0,%esi
  mov    %ecx,%edi
  call   <downcase_lithuanian_i@plt>
  jmp    L94
L169:
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdx
  mov    $0x300,%esi
  mov    $0x69,%edi
  call   <downcase_lithuanian_i@plt>
  jmp    L94
L121:
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdx
  mov    $0x301,%esi
  mov    $0x69,%edi
  call   <downcase_lithuanian_i@plt>
  jmp    L94
L90:
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdx
  mov    $0x303,%esi
  mov    $0x69,%edi
  call   <downcase_lithuanian_i@plt>
  jmp    L94
L127:
  mov    $0x0,%eax
L94:
  leave
  ret
```

assistant: ```c
bool downcase_lithuanian(uint32_t c, const char *q, const char *end, struct output *output) {
  switch (c) {
  case ((uint32_t)0x0049):
  case ((uint32_t)0x004a):
  case ((uint32_t)0x012e):
    if (!has_more_above(q, end))
      return false;
    return downcase_lithuanian_i(u_char_downcase(c), '\0', output);
  case ((uint32_t)0x00cc):
    return downcase_lithuanian_i(((uint32_t)0x0069), ((uint32_t)0x0300), output);
  case ((uint32_t)0x00cd):
    return downcase_lithuanian_i(((uint32_t)0x0069), ((uint32_t)0x0301), output);
  case ((uint32_t)0x0128):
    return downcase_lithuanian_i(((uint32_t)0x0069), ((uint32_t)0x0303), output);
  default:
    return false;
  }
}
```
user: Translate the below assembly code into C programming language:

```asm
<downcase_lithuanian>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %edi,%ebx
  mov    %rcx,%rbp
  cmp    $0xcd,%edi
  je     L51
  mov    %rsi,%rdi
  jg     L81
  cmp    $0x4a,%ebx
  jle    L74
  mov    $0x0,%eax
  cmp    $0xcc,%ebx
  jne    L11
  mov    %rcx,%rdx
  mov    $0x300,%esi
  mov    $0x69,%edi
  call   <downcase_lithuanian_i@plt>
  jmp    L11
L74:
  mov    $0x0,%eax
  cmp    $0x48,%ebx
  jg     L15
L11:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
L81:
  cmp    $0x128,%ebx
  je     L6
  cmp    $0x12e,%ebx
  jne    L60
L15:
  mov    %rdx,%rsi
  call   <has_more_above@plt>
  test   %eax,%eax
  je     L11
  mov    %ebx,%edi
  call   <u_char_downcase@plt>
  mov    %eax,%edi
  mov    %rbp,%rdx
  mov    $0x0,%esi
  call   <downcase_lithuanian_i@plt>
  jmp    L11
L51:
  mov    %rcx,%rdx
  mov    $0x301,%esi
  mov    $0x69,%edi
  call   <downcase_lithuanian_i@plt>
  jmp    L11
L6:
  mov    %rcx,%rdx
  mov    $0x303,%esi
  mov    $0x69,%edi
  call   <downcase_lithuanian_i@plt>
  jmp    L11
L60:
  mov    $0x0,%eax
  jmp    L11
```

assistant: ```c
bool downcase_lithuanian(uint32_t c, const char *q, const char *end, struct output *output) {
  switch (c) {
  case ((uint32_t)0x0049):
  case ((uint32_t)0x004a):
  case ((uint32_t)0x012e):
    if (!has_more_above(q, end))
      return false;
    return downcase_lithuanian_i(u_char_downcase(c), '\0', output);
  case ((uint32_t)0x00cc):
    return downcase_lithuanian_i(((uint32_t)0x0069), ((uint32_t)0x0300), output);
  case ((uint32_t)0x00cd):
    return downcase_lithuanian_i(((uint32_t)0x0069), ((uint32_t)0x0301), output);
  case ((uint32_t)0x0128):
    return downcase_lithuanian_i(((uint32_t)0x0069), ((uint32_t)0x0303), output);
  default:
    return false;
  }
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<downcase_lithuanian>:
  endbr64
  push   %r12
  mov    %rcx,%r12
  push   %rbp
  mov    %edi,%ebp
  sub    $0x8,%rsp
  cmp    $0xcd,%edi
  je     L47
  mov    %rsi,%rdi
  jg     L0
  cmp    $0x4a,%ebp
  jle    L92
  mov    %rcx,%rdx
  mov    $0x300,%esi
  cmp    $0xcc,%ebp
  jne    L64
L46:
  add    $0x8,%rsp
  mov    $0x69,%edi
  pop    %rbp
  pop    %r12
  jmp    1070 <downcase_lithuanian_i@plt>
  nopw   0x0(%rax,%rax,1)
L0:
  cmp    $0x128,%ebp
  jne    L63
  mov    %rcx,%rdx
  mov    $0x303,%esi
  jmp    L46
  nopw   0x0(%rax,%rax,1)
L92:
  cmp    $0x48,%ebp
  jg     L95
L64:
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  ret
  nopw   0x0(%rax,%rax,1)
L63:
  cmp    $0x12e,%ebp
  jne    L64
L95:
  mov    %rdx,%rsi
  call   <has_more_above@plt>
  test   %eax,%eax
  je     L64
  mov    %ebp,%edi
  call   <u_char_downcase@plt>
  add    $0x8,%rsp
  mov    %r12,%rdx
  xor    %esi,%esi
  pop    %rbp
  mov    %eax,%edi
  pop    %r12
  jmp    1070 <downcase_lithuanian_i@plt>
  xchg   %ax,%ax
L47:
  mov    %rcx,%rdx
  mov    $0x301,%esi
  jmp    L46
```

assistant: ```c
bool downcase_lithuanian(uint32_t c, const char *q, const char *end, struct output *output) {
  switch (c) {
  case ((uint32_t)0x0049):
  case ((uint32_t)0x004a):
  case ((uint32_t)0x012e):
    if (!has_more_above(q, end))
      return false;
    return downcase_lithuanian_i(u_char_downcase(c), '\0', output);
  case ((uint32_t)0x00cc):
    return downcase_lithuanian_i(((uint32_t)0x0069), ((uint32_t)0x0300), output);
  case ((uint32_t)0x00cd):
    return downcase_lithuanian_i(((uint32_t)0x0069), ((uint32_t)0x0301), output);
  case ((uint32_t)0x0128):
    return downcase_lithuanian_i(((uint32_t)0x0069), ((uint32_t)0x0303), output);
  default:
    return false;
  }
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<downcase_lithuanian>:
  endbr64
  push   %r12
  mov    %rcx,%r12
  push   %rbp
  mov    %edi,%ebp
  sub    $0x8,%rsp
  cmp    $0xcd,%edi
  je     L31
  mov    %rsi,%rdi
  jg     L98
  cmp    $0x4a,%ebp
  jle    L29
  mov    %rcx,%rdx
  mov    $0x300,%esi
  cmp    $0xcc,%ebp
  jne    L51
L97:
  add    $0x8,%rsp
  mov    $0x69,%edi
  pop    %rbp
  pop    %r12
  jmp    1070 <downcase_lithuanian_i@plt>
  nopw   0x0(%rax,%rax,1)
L98:
  cmp    $0x128,%ebp
  jne    L4
  mov    %rcx,%rdx
  mov    $0x303,%esi
  jmp    L97
  nopw   0x0(%rax,%rax,1)
L29:
  cmp    $0x48,%ebp
  jg     L53
L51:
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  ret
  nopw   0x0(%rax,%rax,1)
L4:
  cmp    $0x12e,%ebp
  jne    L51
L53:
  mov    %rdx,%rsi
  call   <has_more_above@plt>
  test   %eax,%eax
  je     L51
  mov    %ebp,%edi
  call   <u_char_downcase@plt>
  add    $0x8,%rsp
  mov    %r12,%rdx
  xor    %esi,%esi
  pop    %rbp
  mov    %eax,%edi
  pop    %r12
  jmp    1070 <downcase_lithuanian_i@plt>
  xchg   %ax,%ax
L31:
  mov    %rcx,%rdx
  mov    $0x301,%esi
  jmp    L97
```

assistant: ```c
bool downcase_lithuanian(uint32_t c, const char *q, const char *end, struct output *output) {
  switch (c) {
  case ((uint32_t)0x0049):
  case ((uint32_t)0x004a):
  case ((uint32_t)0x012e):
    if (!has_more_above(q, end))
      return false;
    return downcase_lithuanian_i(u_char_downcase(c), '\0', output);
  case ((uint32_t)0x00cc):
    return downcase_lithuanian_i(((uint32_t)0x0069), ((uint32_t)0x0300), output);
  case ((uint32_t)0x00cd):
    return downcase_lithuanian_i(((uint32_t)0x0069), ((uint32_t)0x0301), output);
  case ((uint32_t)0x0128):
    return downcase_lithuanian_i(((uint32_t)0x0069), ((uint32_t)0x0303), output);
  default:
    return false;
  }
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<yar_remap>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  movsd  %xmm0,-0x20(%rbp)
  mov    %rsi,-0x28(%rbp)
  mov    %rdx,-0x30(%rbp)
  mov    %rcx,-0x38(%rbp)
  mov    %r8,-0x40(%rbp)
  mov    %r9,-0x48(%rbp)
  movq   $0x0,-0x8(%rbp)
  jmp    L53
L33:
  mov    -0x8(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movsd  -0x20(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addq   $0x1,-0x8(%rbp)
L53:
  mov    -0x8(%rbp),%rax
  cmp    -0x28(%rbp),%rax
  jl     L33
  movq   $0x0,-0x8(%rbp)
  jmp    L37
L15:
  mov    -0x8(%rbp),%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  pxor   %xmm0,%xmm0
  movsd  %xmm0,(%rax)
  addq   $0x1,-0x8(%rbp)
L37:
  mov    -0x8(%rbp),%rax
  cmp    -0x30(%rbp),%rax
  jl     L15
  movq   $0x0,-0x8(%rbp)
  jmp    L13
L35:
  mov    -0x8(%rbp),%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x8(%rbp),%rax
  lea    0x0(,%rax,4),%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x18(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm2
  mov    -0x8(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm0
  mov    -0x8(%rbp),%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  addq   $0x1,-0x8(%rbp)
L13:
  mov    -0x8(%rbp),%rax
  cmp    -0x30(%rbp),%rax
  jl     L35
  nop
  nop
  pop    %rbp
  ret
```

assistant: ```c
void yar_remap(double *restrict dst_array, double missval, long dst_size, long num_links, double *restrict map_wts, long num_wts, const int *restrict dst_add, const int *restrict src_add, const double *restrict src_array) {
  long n;
  for (n = 0; n < dst_size; ++n)
    dst_array[n] = missval;
  for (n = 0; n < num_links; ++n)
    dst_array[dst_add[n]] = 0;
  for (n = 0; n < num_links; ++n) {
    dst_array[dst_add[n]] += src_array[src_add[n]] * map_wts[n];
  }
}
```
user: What is the c source code of the assembly code below?

```asm
<yar_remap>:
  endbr64
  push   %rbx
  mov    %rdx,%r8
  mov    %rcx,%r10
  mov    0x10(%rsp),%r11
  mov    0x18(%rsp),%rbx
  test   %rsi,%rsi
  jle    L0
  mov    %rdi,%rax
  lea    (%rdi,%rsi,8),%rdx
L17:
  movsd  %xmm0,(%rax)
  add    $0x8,%rax
  cmp    %rdx,%rax
  jne    L17
L0:
  test   %r8,%r8
  jle    L23
  mov    %r9,%rax
  lea    (%r9,%r8,4),%rcx
L8:
  movslq (%rax),%rdx
  movq   $0x0,(%rdi,%rdx,8)
  add    $0x4,%rax
  cmp    %rax,%rcx
  jne    L8
  mov    $0x0,%eax
L26:
  movslq (%r9,%rax,4),%rdx
  lea    (%rdi,%rdx,8),%rdx
  movslq (%r11,%rax,4),%rcx
  movsd  (%rbx,%rcx,8),%xmm0
  mulsd  (%r10,%rax,8),%xmm0
  addsd  (%rdx),%xmm0
  movsd  %xmm0,(%rdx)
  add    $0x1,%rax
  cmp    %rax,%r8
  jne    L26
L23:
  pop    %rbx
  ret
```

assistant: ```c
void yar_remap(double *restrict dst_array, double missval, long dst_size, long num_links, double *restrict map_wts, long num_wts, const int *restrict dst_add, const int *restrict src_add, const double *restrict src_array) {
  long n;
  for (n = 0; n < dst_size; ++n)
    dst_array[n] = missval;
  for (n = 0; n < num_links; ++n)
    dst_array[dst_add[n]] = 0;
  for (n = 0; n < num_links; ++n) {
    dst_array[dst_add[n]] += src_array[src_add[n]] * map_wts[n];
  }
}
```