ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 下面的汇编指令对应的C源代码是什么：

```asm
<FileIO_setFileContent>:
  endbr64
  push   %r12
  mov    %rsi,%r12
  lea    D6(%rip),%rsi
  push   %rbp
  sub    $0x8,%rsp
  call   <fopen@plt>
  mov    %r12,%rdi
  mov    %rax,%rsi
  mov    %rax,%rbp
  call   <fputs@plt>
  add    $0x8,%rsp
  mov    %rbp,%rdi
  pop    %rbp
  pop    %r12
  jmp    1070 <fclose@plt>
```

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

tool: D6: w+

assistant: ```c
void FileIO_setFileContent(char *file_path, char *file_content) {
  FILE *fp;
  fp = fopen(file_path, "w+");
  fputs(file_content, fp);
  fclose(fp);
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<FileIO_setFileContent>:
  endbr64
  push   %r12
  mov    %rsi,%r12
  lea    D3(%rip),%rsi
  push   %rbp
  sub    $0x8,%rsp
  call   <fopen@plt>
  mov    %r12,%rdi
  mov    %rax,%rsi
  mov    %rax,%rbp
  call   <fputs@plt>
  add    $0x8,%rsp
  mov    %rbp,%rdi
  pop    %rbp
  pop    %r12
  jmp    1070 <fclose@plt>
```

tool_calls: name: retrieve_data
arguments: data_label: D3
type_guessed: string

tool: D3: w+

assistant: ```c
void FileIO_setFileContent(char *file_path, char *file_content) {
  FILE *fp;
  fp = fopen(file_path, "w+");
  fputs(file_content, fp);
  fclose(fp);
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<utf8cpy>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x20(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  jmp    L7
L2:
  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)
L7:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L2
  mov    -0x10(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x18(%rbp),%rax
  pop    %rbp
  ret
```

assistant: ```c
void *utf8cpy(void *__restrict__ dst, const void *__restrict__ src) {
  char *d = (char *)dst;
  const char *s = (const char *)src;
  while ('\0' != *s) {
    *d++ = *s++;
  }
  *d = '\0';
  return dst;
}
```
user: What is the c source code of the assembly code below?

```asm
<utf8cpy>:
  endbr64
  mov    %rdi,%rax
  movzbl (%rsi),%edx
  test   %dl,%dl
  je     L12
  mov    %rdi,%rcx
L4:
  add    $0x1,%rsi
  add    $0x1,%rcx
  mov    %dl,-0x1(%rcx)
  movzbl (%rsi),%edx
  test   %dl,%dl
  jne    L4
L14:
  movb   $0x0,(%rcx)
  ret
L12:
  mov    %rdi,%rcx
  jmp    L14
```

assistant: ```c
void *utf8cpy(void *__restrict__ dst, const void *__restrict__ src) {
  char *d = (char *)dst;
  const char *s = (const char *)src;
  while ('\0' != *s) {
    *d++ = *s++;
  }
  *d = '\0';
  return dst;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<utf8cpy>:
  endbr64
  movzbl (%rsi),%edx
  mov    %rdi,%rax
  mov    %rdi,%rcx
  test   %dl,%dl
  je     L6
  nopl   0x0(%rax)
L18:
  add    $0x1,%rsi
  mov    %dl,(%rcx)
  add    $0x1,%rcx
  movzbl (%rsi),%edx
  test   %dl,%dl
  jne    L18
L6:
  movb   $0x0,(%rcx)
  ret
```

assistant: ```c
void *utf8cpy(void *__restrict__ dst, const void *__restrict__ src) {
  char *d = (char *)dst;
  const char *s = (const char *)src;
  while ('\0' != *s) {
    *d++ = *s++;
  }
  *d = '\0';
  return dst;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<utf8cpy>:
  endbr64
  movzbl (%rsi),%edx
  mov    %rdi,%rax
  mov    %rdi,%rcx
  test   %dl,%dl
  je     L17
  nopl   0x0(%rax)
L18:
  add    $0x1,%rsi
  mov    %dl,(%rcx)
  add    $0x1,%rcx
  movzbl (%rsi),%edx
  test   %dl,%dl
  jne    L18
L17:
  movb   $0x0,(%rcx)
  ret
```

assistant: ```c
void *utf8cpy(void *__restrict__ dst, const void *__restrict__ src) {
  char *d = (char *)dst;
  const char *s = (const char *)src;
  while ('\0' != *s) {
    *d++ = *s++;
  }
  *d = '\0';
  return dst;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    $0x30,%edi
  call   <isascii@plt>
  mov    %eax,%edi
  call   <assert@plt>
  mov    $0x62,%edi
  call   <isascii@plt>
  mov    %eax,%edi
  call   <assert@plt>
  mov    $0x5b,%edi
  call   <__isascii@plt>
  mov    %eax,%edi
  call   <assert@plt>
  mov    $0x1,%edi
  call   <assert@plt>
  mov    $0x1,%edi
  call   <assert@plt>
  mov    $0x1,%edi
  call   <assert@plt>
  mov    $0x0,%eax
  pop    %rbp
  ret
```

assistant: ```c
int main() {
  assert(isascii('0'));
  assert(isascii('b'));
  assert(__isascii('['));
  assert((((125) & ~0x7f) == 0));
  assert((((127) & ~0x7f) == 0));
  assert(!(((128) & ~0x7f) == 0));
  return 0;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x30,%edi
  call   <isascii@plt>
  mov    %eax,%edi
  call   <assert@plt>
  mov    $0x62,%edi
  call   <isascii@plt>
  mov    %eax,%edi
  call   <assert@plt>
  mov    $0x5b,%edi
  call   <__isascii@plt>
  mov    %eax,%edi
  call   <assert@plt>
  mov    $0x1,%edi
  call   <assert@plt>
  mov    $0x1,%edi
  call   <assert@plt>
  mov    $0x1,%edi
  call   <assert@plt>
  mov    $0x0,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int main() {
  assert(isascii('0'));
  assert(isascii('b'));
  assert(__isascii('['));
  assert((((125) & ~0x7f) == 0));
  assert((((127) & ~0x7f) == 0));
  assert(!(((128) & ~0x7f) == 0));
  return 0;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x30,%edi
  call   <isascii@plt>
  mov    %eax,%edi
  call   <assert@plt>
  mov    $0x62,%edi
  call   <isascii@plt>
  mov    %eax,%edi
  call   <assert@plt>
  mov    $0x5b,%edi
  call   <__isascii@plt>
  mov    %eax,%edi
  call   <assert@plt>
  mov    $0x1,%edi
  call   <assert@plt>
  mov    $0x1,%edi
  call   <assert@plt>
  mov    $0x1,%edi
  call   <assert@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int main() {
  assert(isascii('0'));
  assert(isascii('b'));
  assert(__isascii('['));
  assert((((125) & ~0x7f) == 0));
  assert((((127) & ~0x7f) == 0));
  assert(!(((128) & ~0x7f) == 0));
  return 0;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x30,%edi
  call   <isascii@plt>
  mov    %eax,%edi
  call   <assert@plt>
  mov    $0x62,%edi
  call   <isascii@plt>
  mov    %eax,%edi
  call   <assert@plt>
  mov    $0x5b,%edi
  call   <__isascii@plt>
  mov    %eax,%edi
  call   <assert@plt>
  mov    $0x1,%edi
  call   <assert@plt>
  mov    $0x1,%edi
  call   <assert@plt>
  mov    $0x1,%edi
  call   <assert@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int main() {
  assert(isascii('0'));
  assert(isascii('b'));
  assert(__isascii('['));
  assert((((125) & ~0x7f) == 0));
  assert((((127) & ~0x7f) == 0));
  assert(!(((128) & ~0x7f) == 0));
  return 0;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<wcsncpy>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  jmp    L1
L13:
  subq   $0x1,-0x28(%rbp)
  mov    -0x20(%rbp),%rdx
  lea    0x8(%rdx),%rax
  mov    %rax,-0x20(%rbp)
  mov    -0x18(%rbp),%rax
  lea    0x8(%rax),%rcx
  mov    %rcx,-0x18(%rbp)
  mov    (%rdx),%rdx
  mov    %rdx,(%rax)
L1:
  cmpq   $0x0,-0x28(%rbp)
  je     L14
  mov    -0x20(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  jne    L13
L14:
  mov    -0x28(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <wmemset@plt>
  mov    -0x8(%rbp),%rax
  leave
  ret
```

assistant: ```c
wchar_t *wcsncpy(wchar_t *restrict d, const wchar_t *restrict s, size_t n) {
  wchar_t *a = d;
  while (n && *s)
    n--, *d++ = *s++;
  wmemset(d, 0, n);
  return a;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<wcsncpy>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  test   %rdx,%rdx
  je     L16
L9:
  mov    (%rsi),%rax
  test   %rax,%rax
  je     L16
  add    $0x8,%rsi
  add    $0x8,%rdi
  mov    %rax,-0x8(%rdi)
  sub    $0x1,%rdx
  jne    L9
L16:
  mov    $0x0,%esi
  call   <wmemset@plt>
  mov    %rbx,%rax
  pop    %rbx
  ret
```

assistant: ```c
wchar_t *wcsncpy(wchar_t *restrict d, const wchar_t *restrict s, size_t n) {
  wchar_t *a = d;
  while (n && *s)
    n--, *d++ = *s++;
  wmemset(d, 0, n);
  return a;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<wcsncpy>:
  endbr64
  push   %r12
  mov    %rdi,%r12
  test   %rdx,%rdx
  jne    L16
  jmp    L22
L14:
  add    $0x8,%rdi
  add    $0x8,%rsi
  mov    %rax,-0x8(%rdi)
  sub    $0x1,%rdx
  je     L22
L16:
  mov    (%rsi),%rax
  test   %rax,%rax
  jne    L14
L22:
  xor    %esi,%esi
  call   <wmemset@plt>
  mov    %r12,%rax
  pop    %r12
  ret
```

assistant: ```c
wchar_t *wcsncpy(wchar_t *restrict d, const wchar_t *restrict s, size_t n) {
  wchar_t *a = d;
  while (n && *s)
    n--, *d++ = *s++;
  wmemset(d, 0, n);
  return a;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<wcsncpy>:
  endbr64
  push   %r12
  mov    %rdi,%r12
  test   %rdx,%rdx
  jne    L14
  jmp    L39
L22:
  add    $0x8,%rdi
  add    $0x8,%rsi
  mov    %rax,-0x8(%rdi)
  sub    $0x1,%rdx
  je     L39
L14:
  mov    (%rsi),%rax
  test   %rax,%rax
  jne    L22
L39:
  xor    %esi,%esi
  call   <wmemset@plt>
  mov    %r12,%rax
  pop    %r12
  ret
```

assistant: ```c
wchar_t *wcsncpy(wchar_t *restrict d, const wchar_t *restrict s, size_t n) {
  wchar_t *a = d;
  while (n && *s)
    n--, *d++ = *s++;
  wmemset(d, 0, n);
  return a;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<cl_rand_from_interval>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %esi,-0x18(%rbp)
  mov    $0x0,%eax
  call   <get_next_random@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0x14(%rbp),%eax
  movslq %eax,%rsi
  mov    -0x18(%rbp),%eax
  sub    -0x14(%rbp),%eax
  cltq
  imul   -0x8(%rbp),%rax
  mov    %rax,%rdx
  mov    D19(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,%ecx
  shr    $0x1f,%ecx
  add    %ecx,%eax
  sar    %eax
  cltq
  lea    (%rdx,%rax,1),%rcx
  mov    D19(%rip),%rax
  mov    (%rax),%eax
  movslq %eax,%rdi
  mov    %rcx,%rax
  cqto
  idiv   %rdi
  add    %rsi,%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  leave
  ret
```

assistant: ```c
int cl_rand_from_interval(const int a, const int b) {
  long long r = get_next_random();
  r = a + (r * (b - a) + RAND_MAX / 2) / RAND_MAX;
  return r;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<cl_rand_from_interval>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %edi,%ebp
  mov    %esi,%ebx
  mov    $0x0,%eax
  call   <get_next_random@plt>
  mov    %rax,%rdx
  mov    D8(%rip),%rax
  mov    (%rax),%ecx
  sub    %ebp,%ebx
  movslq %ebx,%rax
  imul   %rdx,%rax
  mov    %ecx,%edx
  shr    $0x1f,%edx
  add    %ecx,%edx
  sar    %edx
  movslq %edx,%rdx
  add    %rdx,%rax
  movslq %ecx,%rcx
  cqto
  idiv   %rcx
  lea    0x0(%rbp,%rax,1),%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
int cl_rand_from_interval(const int a, const int b) {
  long long r = get_next_random();
  r = a + (r * (b - a) + RAND_MAX / 2) / RAND_MAX;
  return r;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<cl_rand_from_interval>:
  endbr64
  push   %rbp
  xor    %eax,%eax
  mov    %edi,%ebp
  push   %rbx
  mov    %esi,%ebx
  sub    %ebp,%ebx
  sub    $0x8,%rsp
  call   <get_next_random@plt>
  mov    %rax,%r8
  mov    D9(%rip),%rax
  movslq (%rax),%rcx
  movslq %ebx,%rax
  add    $0x8,%rsp
  imul   %r8,%rax
  pop    %rbx
  mov    %ecx,%edx
  shr    $0x1f,%edx
  add    %ecx,%edx
  sar    %edx
  movslq %edx,%rdx
  add    %rdx,%rax
  cqto
  idiv   %rcx
  add    %ebp,%eax
  pop    %rbp
  ret
```

assistant: ```c
int cl_rand_from_interval(const int a, const int b) {
  long long r = get_next_random();
  r = a + (r * (b - a) + RAND_MAX / 2) / RAND_MAX;
  return r;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<cl_rand_from_interval>:
  endbr64
  push   %rbp
  xor    %eax,%eax
  mov    %edi,%ebp
  push   %rbx
  mov    %esi,%ebx
  sub    %ebp,%ebx
  sub    $0x8,%rsp
  call   <get_next_random@plt>
  mov    %rax,%r8
  mov    D3(%rip),%rax
  movslq (%rax),%rcx
  movslq %ebx,%rax
  add    $0x8,%rsp
  imul   %r8,%rax
  pop    %rbx
  mov    %ecx,%edx
  shr    $0x1f,%edx
  add    %ecx,%edx
  sar    %edx
  movslq %edx,%rdx
  add    %rdx,%rax
  cqto
  idiv   %rcx
  add    %ebp,%eax
  pop    %rbp
  ret
```

assistant: ```c
int cl_rand_from_interval(const int a, const int b) {
  long long r = get_next_random();
  r = a + (r * (b - a) + RAND_MAX / 2) / RAND_MAX;
  return r;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<next_ptr>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x14(%rbp)
  mov    %esi,-0x18(%rbp)
  mov    %edx,-0x1c(%rbp)
  mov    -0x1c(%rbp),%eax
  mov    $0x1,%edx
  mov    %eax,%ecx
  shl    %cl,%edx
  mov    %edx,%eax
  sub    $0x1,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x14(%rbp),%edx
  mov    -0x18(%rbp),%eax
  add    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    %eax,%edx
  mov    -0x4(%rbp),%eax
  not    %eax
  and    %edx,%eax
  pop    %rbp
  ret
```

assistant: ```c
uint32_t next_ptr(uint32_t ptr, uint32_t size, uint32_t alignment_bits) {
  uint32_t a = (1 << alignment_bits) - 1;
  return (ptr + size + a) & ~a;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<next_ptr>:
  endbr64
  mov    %edx,%ecx
  mov    $0x1,%edx
  shl    %cl,%edx
  add    %esi,%edi
  lea    -0x1(%rdx,%rdi,1),%eax
  neg    %edx
  and    %edx,%eax
  ret
```

assistant: ```c
uint32_t next_ptr(uint32_t ptr, uint32_t size, uint32_t alignment_bits) {
  uint32_t a = (1 << alignment_bits) - 1;
  return (ptr + size + a) & ~a;
}
```
user: Translate the below assembly code into C programming language:

```asm
<next_ptr>:
  endbr64
  mov    %edx,%ecx
  mov    $0x1,%eax
  add    %esi,%edi
  shl    %cl,%eax
  mov    %eax,%edx
  lea    -0x1(%rax,%rdi,1),%eax
  neg    %edx
  and    %edx,%eax
  ret
```

assistant: ```c
uint32_t next_ptr(uint32_t ptr, uint32_t size, uint32_t alignment_bits) {
  uint32_t a = (1 << alignment_bits) - 1;
  return (ptr + size + a) & ~a;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<next_ptr>:
  endbr64
  mov    %edx,%ecx
  mov    $0x1,%eax
  add    %esi,%edi
  shl    %cl,%eax
  mov    %eax,%edx
  lea    -0x1(%rax,%rdi,1),%eax
  neg    %edx
  and    %edx,%eax
  ret
```

assistant: ```c
uint32_t next_ptr(uint32_t ptr, uint32_t size, uint32_t alignment_bits) {
  uint32_t a = (1 << alignment_bits) - 1;
  return (ptr + size + a) & ~a;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<get_short>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  lea    0x4(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  mov    (%rax),%eax
  mov    %eax,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  shl    $0x8,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  mov    (%rax),%eax
  or     %edx,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  pop    %rbp
  ret
```

assistant: ```c
uint16_t get_short(const void *ptr) {
  const uint8_t *cp = (const uint8_t *)ptr;
  uint16_t sh;
  sh = *cp++;
  sh = (sh << 8) | *cp;
  return (sh);
}
```
user: Translate the below assembly code into C programming language:

```asm
<get_short>:
  endbr64
  mov    (%rdi),%eax
  shl    $0x8,%eax
  or     0x4(%rdi),%eax
  ret
```

assistant: ```c
uint16_t get_short(const void *ptr) {
  const uint8_t *cp = (const uint8_t *)ptr;
  uint16_t sh;
  sh = *cp++;
  sh = (sh << 8) | *cp;
  return (sh);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<get_short>:
  endbr64
  mov    (%rdi),%eax
  shl    $0x8,%eax
  or     0x4(%rdi),%eax
  ret
```

assistant: ```c
uint16_t get_short(const void *ptr) {
  const uint8_t *cp = (const uint8_t *)ptr;
  uint16_t sh;
  sh = *cp++;
  sh = (sh << 8) | *cp;
  return (sh);
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<get_short>:
  endbr64
  mov    (%rdi),%eax
  shl    $0x8,%eax
  or     0x4(%rdi),%eax
  ret
```

assistant: ```c
uint16_t get_short(const void *ptr) {
  const uint8_t *cp = (const uint8_t *)ptr;
  uint16_t sh;
  sh = *cp++;
  sh = (sh << 8) | *cp;
  return (sh);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<add_zero_pad>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x28(%rbp)
  mov    %esi,-0x2c(%rbp)
  mov    %edx,-0x30(%rbp)
  mov    %ecx,-0x34(%rbp)
  mov    %r8d,-0x38(%rbp)
  mov    %r9,-0x40(%rbp)
  mov    -0x2c(%rbp),%edx
  mov    -0x34(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x30(%rbp),%edx
  mov    -0x38(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
  movl   $0x0,-0x18(%rbp)
  jmp    L84
L97:
  mov    -0x18(%rbp),%eax
  imul   -0xc(%rbp),%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x18(%rbp),%eax
  imul   -0x30(%rbp),%eax
  mov    %eax,-0x4(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L48
L31:
  mov    -0x4(%rbp),%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x8(%rbp),%ecx
  mov    -0x14(%rbp),%eax
  add    %ecx,%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x40(%rbp),%rax
  add    %rcx,%rax
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x14(%rbp)
L48:
  mov    -0x14(%rbp),%eax
  cmp    -0x30(%rbp),%eax
  jl     L31
  mov    -0x30(%rbp),%eax
  mov    %eax,-0x14(%rbp)
  jmp    L49
L58:
  mov    -0x8(%rbp),%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  pxor   %xmm0,%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x14(%rbp)
L49:
  mov    -0x14(%rbp),%eax
  cmp    -0xc(%rbp),%eax
  jl     L58
  addl   $0x1,-0x18(%rbp)
L84:
  mov    -0x18(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jl     L97
  mov    -0x2c(%rbp),%eax
  mov    %eax,-0x18(%rbp)
  jmp    L83
L91:
  mov    -0x18(%rbp),%eax
  imul   -0xc(%rbp),%eax
  mov    %eax,-0x8(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L44
L14:
  mov    -0x8(%rbp),%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  pxor   %xmm0,%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x14(%rbp)
L44:
  mov    -0x14(%rbp),%eax
  cmp    -0xc(%rbp),%eax
  jl     L14
  addl   $0x1,-0x18(%rbp)
L83:
  mov    -0x18(%rbp),%eax
  cmp    -0x10(%rbp),%eax
  jl     L91
  nop
  nop
  pop    %rbp
  ret
```

assistant: ```c
void add_zero_pad(double *X, int rows, int cols, int zrow, int zcol, double *Y) {
  int r, c, i, j, u, v;
  r = rows + zrow;
  c = cols + zcol;
  for (i = 0; i < rows; ++i) {
    u = i * c;
    v = i * cols;
    for (j = 0; j < cols; ++j) {
      Y[u + j] = X[v + j];
    }
    for (j = cols; j < c; ++j) {
      Y[u + j] = 0.;
    }
  }
  for (i = rows; i < r; ++i) {
    u = i * c;
    for (j = 0; j < c; ++j) {
      Y[u + j] = 0.;
    }
  }
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<add_zero_pad>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %esi,%r10d
  mov    %r9,%r13
  lea    (%rsi,%rcx,1),%r12d
  lea    (%rdx,%r8,1),%r9d
  test   %esi,%esi
  jle    L70
  mov    %edx,%r11d
  movslq %edx,%rsi
  lea    0x0(,%rsi,8),%rbp
  mov    %rdi,%rcx
  movslq %r9d,%rbx
  shl    $0x3,%rbx
  mov    %r13,%rdx
  lea    -0x1(%r8),%eax
  add    %rsi,%rax
  lea    0x8(%r13,%rax,8),%rsi
  mov    $0x0,%r8d
  mov    %r11d,%edi
L66:
  test   %r11d,%r11d
  jle    L29
  mov    $0x0,%eax
L94:
  movsd  (%rcx,%rax,8),%xmm0
  movsd  %xmm0,(%rdx,%rax,8)
  add    $0x1,%rax
  cmp    %rdi,%rax
  jne    L94
L29:
  cmp    %r9d,%r11d
  jge    L40
  lea    0x0(%rbp,%rdx,1),%rax
L50:
  movq   $0x0,(%rax)
  add    $0x8,%rax
  cmp    %rsi,%rax
  jne    L50
L40:
  add    $0x1,%r8d
  add    %rbp,%rcx
  add    %rbx,%rdx
  add    %rbx,%rsi
  cmp    %r8d,%r10d
  jne    L66
L70:
  cmp    %r12d,%r10d
  jge    L51
  movslq %r9d,%rsi
  shl    $0x3,%rsi
  lea    -0x1(%r9),%ecx
  mov    %r10d,%eax
  imul   %r9d,%eax
  cltq
  add    %rcx,%rax
  lea    0x8(%r13,%rax,8),%rdx
  not    %rcx
  shl    $0x3,%rcx
L45:
  test   %r9d,%r9d
  jle    L48
  lea    (%rcx,%rdx,1),%rax
L53:
  movq   $0x0,(%rax)
  add    $0x8,%rax
  cmp    %rdx,%rax
  jne    L53
L48:
  add    $0x1,%r10d
  add    %rsi,%rdx
  cmp    %r10d,%r12d
  jne    L45
L51:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
void add_zero_pad(double *X, int rows, int cols, int zrow, int zcol, double *Y) {
  int r, c, i, j, u, v;
  r = rows + zrow;
  c = cols + zcol;
  for (i = 0; i < rows; ++i) {
    u = i * c;
    v = i * cols;
    for (j = 0; j < cols; ++j) {
      Y[u + j] = X[v + j];
    }
    for (j = cols; j < c; ++j) {
      Y[u + j] = 0.;
    }
  }
  for (i = rows; i < r; ++i) {
    u = i * c;
    for (j = 0; j < c; ++j) {
      Y[u + j] = 0.;
    }
  }
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<add_zero_pad>:
  endbr64
  push   %r15
  add    %esi,%ecx
  push   %r14
  mov    %esi,%r14d
  push   %r13
  push   %r12
  push   %rbp
  lea    (%rdx,%r8,1),%ebp
  push   %rbx
  sub    $0x38,%rsp
  mov    %r9,0x28(%rsp)
  mov    %ecx,0x20(%rsp)
  test   %esi,%esi
  jle    L67
  movslq %ebp,%r13
  mov    %r9,%rbx
  movslq %edx,%r9
  mov    %edx,%r12d
  lea    0x0(,%r13,8),%rax
  shl    $0x3,%r9
  mov    %rdi,%r15
  xor    %r13d,%r13d
  mov    %rax,0x10(%rsp)
  lea    -0x1(%r8),%eax
  lea    0x8(,%rax,8),%rax
  mov    %rax,0x18(%rsp)
  lea    -0x1(%rdx),%eax
  mov    %eax,0x24(%rsp)
  nopw   0x0(%rax,%rax,1)
L34:
  test   %r12d,%r12d
  jle    L70
  mov    0x24(%rsp),%esi
  xor    %eax,%eax
  nopl   0x0(%rax,%rax,1)
L56:
  movsd  (%r15,%rax,8),%xmm0
  mov    %rax,%rdx
  movsd  %xmm0,(%rbx,%rax,8)
  add    $0x1,%rax
  cmp    %rdx,%rsi
  jne    L56
L70:
  cmp    %ebp,%r12d
  jge    L55
  mov    0x18(%rsp),%rdx
  lea    (%r9,%rbx,1),%rdi
  xor    %esi,%esi
  mov    %r9,0x8(%rsp)
  call   <memset@plt>
  mov    0x8(%rsp),%r9
L55:
  add    $0x1,%r13d
  add    %r9,%r15
  add    0x10(%rsp),%rbx
  cmp    %r13d,%r14d
  jne    L34
L67:
  cmp    0x20(%rsp),%r14d
  jge    L45
  mov    %r14d,%eax
  mov    0x28(%rsp),%rcx
  movslq %ebp,%rbx
  imul   %ebp,%eax
  shl    $0x3,%rbx
  cltq
  lea    (%rcx,%rax,8),%rcx
  lea    -0x1(%rbp),%eax
  lea    0x8(,%rax,8),%r13
  nopl   0x0(%rax)
L78:
  test   %ebp,%ebp
  jle    L60
  mov    %rcx,%rdi
  mov    %r13,%rdx
  xor    %esi,%esi
  call   <memset@plt>
  mov    %rax,%rcx
L60:
  add    $0x1,%r14d
  add    %rbx,%rcx
  cmp    %r14d,0x20(%rsp)
  jne    L78
L45:
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void add_zero_pad(double *X, int rows, int cols, int zrow, int zcol, double *Y) {
  int r, c, i, j, u, v;
  r = rows + zrow;
  c = cols + zcol;
  for (i = 0; i < rows; ++i) {
    u = i * c;
    v = i * cols;
    for (j = 0; j < cols; ++j) {
      Y[u + j] = X[v + j];
    }
    for (j = cols; j < c; ++j) {
      Y[u + j] = 0.;
    }
  }
  for (i = rows; i < r; ++i) {
    u = i * c;
    for (j = 0; j < c; ++j) {
      Y[u + j] = 0.;
    }
  }
}
```