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

```asm
<start_irssi>:
  endbr64
  push   %rbp
  pxor   %xmm0,%xmm0
  mov    %rdi,%rcx
  lea    D9(%rip),%rdx
  mov    $0x64,%esi
  sub    $0x70,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x68(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbp
  movaps %xmm0,(%rsp)
  mov    %rbp,%rdi
  movaps %xmm0,0x10(%rsp)
  movaps %xmm0,0x20(%rsp)
  movaps %xmm0,0x30(%rsp)
  movaps %xmm0,0x40(%rsp)
  movaps %xmm0,0x50(%rsp)
  movl   $0x0,0x60(%rsp)
  call   <snprintf@plt>
  lea    D18(%rip),%rdi
  mov    %rbp,%rsi
  call   <printf@plt>
  mov    %rbp,%rdi
  call   <system@plt>
  mov    0x68(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L5
  add    $0x70,%rsp
  pop    %rbp
  ret
L5:
  call   <__stack_chk_fail@plt>
```

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

tool: D9: su --command='screen -dmS irc_logger irssi' %s


tool: D18: %s

assistant: ```c
void start_irssi(char nickname[]) {
  char chaine[100] = {0};
  snprintf(chaine, 100, "su --command='screen -dmS irc_logger irssi' %s\n", nickname);
  printf("%s", chaine);
  system(chaine);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<start_irssi>:
  endbr64
  push   %rbp
  pxor   %xmm0,%xmm0
  mov    %rdi,%rcx
  lea    D14(%rip),%rdx
  mov    $0x64,%esi
  sub    $0x70,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x68(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbp
  movaps %xmm0,(%rsp)
  mov    %rbp,%rdi
  movaps %xmm0,0x10(%rsp)
  movaps %xmm0,0x20(%rsp)
  movaps %xmm0,0x30(%rsp)
  movaps %xmm0,0x40(%rsp)
  movaps %xmm0,0x50(%rsp)
  movl   $0x0,0x60(%rsp)
  call   <snprintf@plt>
  lea    D13(%rip),%rdi
  mov    %rbp,%rsi
  call   <printf@plt>
  mov    %rbp,%rdi
  call   <system@plt>
  mov    0x68(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L1
  add    $0x70,%rsp
  pop    %rbp
  ret
L1:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_tag: D14
type: string
name: parse_data
arguments: data_tag: D13
type: string

tool: D14: su --command='screen -dmS irc_logger irssi' %s


tool: D13: %s

assistant: ```c
void start_irssi(char nickname[]) {
  char chaine[100] = {0};
  snprintf(chaine, 100, "su --command='screen -dmS irc_logger irssi' %s\n", nickname);
  printf("%s", chaine);
  system(chaine);
}
```
user: Translate the below assembly code into C programming language:

```asm
<SzFreeTemp>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    %rsi,-0x10(%rbp)
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  nop
  leave
  ret
```

assistant: ```c
void SzFreeTemp(void *p, void *address) {
  p = p;
  free(address);
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<SzFreeTemp>:
  endbr64
  sub    $0x8,%rsp
  mov    %rsi,%rdi
  call   <free@plt>
  add    $0x8,%rsp
  ret
```

assistant: ```c
void SzFreeTemp(void *p, void *address) {
  p = p;
  free(address);
}
```
user: Translate the below assembly code into C programming language:

```asm
<SzFreeTemp>:
  endbr64
  mov    %rsi,%rdi
  jmp    1050 <free@plt>
```

assistant: ```c
void SzFreeTemp(void *p, void *address) {
  p = p;
  free(address);
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<SzFreeTemp>:
  endbr64
  mov    %rsi,%rdi
  jmp    1050 <free@plt>
```

assistant: ```c
void SzFreeTemp(void *p, void *address) {
  p = p;
  free(address);
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<max_array>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  movl   $0xffffffff,-0x4(%rbp)
  movl   $0x0,-0x8(%rbp)
  jmp    L28
L22:
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0x4(%rbp)
  jge    L17
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x4(%rbp)
L17:
  addl   $0x1,-0x8(%rbp)
L28:
  mov    -0x8(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jl     L22
  mov    -0x4(%rbp),%eax
  pop    %rbp
  ret
```

assistant: ```c
uint8_t max_array(uint8_t a[], int num_elements) {
  int i, max = -1;
  for (i = 0; i < num_elements; i++) {
    if (a[i] > max)
      max = a[i];
  }
  return max;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<max_array>:
  endbr64
  test   %esi,%esi
  jle    L0
  mov    %rdi,%rax
  lea    -0x1(%rsi),%edx
  lea    0x4(%rdi,%rdx,4),%rsi
  mov    $0xffffffff,%edx
L27:
  mov    (%rax),%ecx
  cmp    %ecx,%edx
  cmovl  %ecx,%edx
  add    $0x4,%rax
  cmp    %rsi,%rax
  jne    L27
L28:
  mov    %edx,%eax
  ret
L0:
  mov    $0xffffffff,%edx
  jmp    L28
```

assistant: ```c
uint8_t max_array(uint8_t a[], int num_elements) {
  int i, max = -1;
  for (i = 0; i < num_elements; i++) {
    if (a[i] > max)
      max = a[i];
  }
  return max;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<max_array>:
  endbr64
  test   %esi,%esi
  jle    L15
  lea    -0x1(%rsi),%eax
  lea    0x4(%rdi,%rax,4),%rcx
  mov    $0xffffffff,%eax
  nopl   (%rax)
L18:
  mov    (%rdi),%edx
  cmp    %edx,%eax
  cmovl  %edx,%eax
  add    $0x4,%rdi
  cmp    %rcx,%rdi
  jne    L18
  ret
  nopl   0x0(%rax)
L15:
  mov    $0xffffffff,%eax
  ret
```

assistant: ```c
uint8_t max_array(uint8_t a[], int num_elements) {
  int i, max = -1;
  for (i = 0; i < num_elements; i++) {
    if (a[i] > max)
      max = a[i];
  }
  return max;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<max_array>:
  endbr64
  mov    %esi,%edx
  test   %esi,%esi
  jle    L42
  lea    -0x1(%rsi),%eax
  cmp    $0x2,%eax
  jbe    L27
  mov    %esi,%ecx
  mov    %rdi,%rax
  pcmpeqd %xmm2,%xmm2
  shr    $0x2,%ecx
  sub    $0x1,%ecx
  shl    $0x4,%rcx
  lea    0x10(%rdi,%rcx,1),%rcx
  nopw   0x0(%rax,%rax,1)
L60:
  movdqu (%rax),%xmm0
  add    $0x10,%rax
  movdqa %xmm0,%xmm1
  pcmpgtd %xmm2,%xmm1
  pand   %xmm1,%xmm0
  pandn  %xmm2,%xmm1
  movdqa %xmm1,%xmm2
  por    %xmm0,%xmm2
  cmp    %rcx,%rax
  jne    L60
  movdqa %xmm2,%xmm0
  mov    %edx,%ecx
  psrldq $0x8,%xmm0
  and    $0xfffffffc,%ecx
  movdqa %xmm0,%xmm1
  pcmpgtd %xmm2,%xmm1
  pand   %xmm1,%xmm0
  pandn  %xmm2,%xmm1
  por    %xmm0,%xmm1
  movdqa %xmm1,%xmm2
  psrldq $0x4,%xmm2
  movdqa %xmm2,%xmm0
  pcmpgtd %xmm1,%xmm0
  pand   %xmm0,%xmm2
  pandn  %xmm1,%xmm0
  por    %xmm2,%xmm0
  movd   %xmm0,%eax
  test   $0x3,%dl
  je     L12
L29:
  movslq %ecx,%rsi
  lea    0x0(,%rsi,4),%r8
  mov    (%rdi,%rsi,4),%esi
  cmp    %esi,%eax
  cmovl  %esi,%eax
  lea    0x1(%rcx),%esi
  cmp    %esi,%edx
  jle    L2
  mov    0x4(%rdi,%r8,1),%esi
  cmp    %esi,%eax
  cmovl  %esi,%eax
  add    $0x2,%ecx
  cmp    %ecx,%edx
  jle    L2
  mov    0x8(%rdi,%r8,1),%edx
  cmp    %edx,%eax
  cmovl  %edx,%eax
  ret
  nopl   0x0(%rax,%rax,1)
L42:
  mov    $0xffffffff,%eax
L2:
  ret
  cs nopw 0x0(%rax,%rax,1)
L12:
  ret
L27:
  mov    $0xffffffff,%eax
  xor    %ecx,%ecx
  jmp    L29
```

assistant: ```c
uint8_t max_array(uint8_t a[], int num_elements) {
  int i, max = -1;
  for (i = 0; i < num_elements; i++) {
    if (a[i] > max)
      max = a[i];
  }
  return max;
}
```
user: Translate the below assembly code into C programming language:

```asm
<strstr>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %rax,-0x10(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0x10(%rbp),%rax
  cmp    -0x8(%rbp),%rax
  jbe    L41
  mov    $0x0,%eax
  jmp    L27
L41:
  mov    -0x8(%rbp),%rax
  mov    %eax,%edx
  mov    -0x10(%rbp),%rax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  add    $0x1,%eax
  mov    %eax,-0x14(%rbp)
  jmp    L53
L38:
  mov    -0x10(%rbp),%rdx
  mov    -0x30(%rbp),%rcx
  mov    -0x28(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcmp@plt>
  test   %eax,%eax
  jne    L52
  mov    -0x28(%rbp),%rax
  jmp    L27
L52:
  addq   $0x1,-0x28(%rbp)
  subl   $0x1,-0x14(%rbp)
L53:
  cmpl   $0x0,-0x14(%rbp)
  jne    L38
  mov    $0x0,%eax
L27:
  leave
  ret
```

assistant: ```c
char *strstr(const char *haystack, const char *needle) {
  size_t nl = strlen(needle);
  size_t hl = strlen(haystack);
  int i;
  if (nl > hl)
    return 0;
  for (i = hl - nl + 1; i; --i) {
    if (!memcmp(haystack, needle, nl))
      return (char *)haystack;
    ++haystack;
  }
  return 0;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<strstr>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbx
  mov    %rsi,%r12
  mov    %rsi,%rdi
  call   <strlen@plt>
  mov    %rax,%rbp
  mov    %rbx,%rdi
  call   <strlen@plt>
  cmp    %rax,%rbp
  ja     L50
  add    $0x1,%eax
  sub    %ebp,%eax
  je     L7
  lea    -0x1(%rax),%eax
  lea    0x1(%rbx,%rax,1),%r13
L41:
  mov    %rbp,%rdx
  mov    %r12,%rsi
  mov    %rbx,%rdi
  call   <memcmp@plt>
  test   %eax,%eax
  je     L4
  add    $0x1,%rbx
  cmp    %r13,%rbx
  jne    L41
  mov    $0x0,%ebx
L4:
  mov    %rbx,%rax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L50:
  mov    $0x0,%ebx
  jmp    L4
L7:
  mov    $0x0,%ebx
  jmp    L4
```

assistant: ```c
char *strstr(const char *haystack, const char *needle) {
  size_t nl = strlen(needle);
  size_t hl = strlen(haystack);
  int i;
  if (nl > hl)
    return 0;
  for (i = hl - nl + 1; i; --i) {
    if (!memcmp(haystack, needle, nl))
      return (char *)haystack;
    ++haystack;
  }
  return 0;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<strstr>:
  endbr64
  push   %r13
  push   %r12
  mov    %rdi,%r12
  mov    %rsi,%rdi
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  sub    $0x8,%rsp
  call   <strlen@plt>
  mov    %r12,%rdi
  mov    %rax,%rbx
  call   <strlen@plt>
  cmp    %rax,%rbx
  ja     L23
  add    $0x1,%eax
  sub    %ebx,%eax
  je     L23
  sub    $0x1,%eax
  lea    0x1(%r12,%rax,1),%r13
  jmp    L22
  nopl   (%rax)
L21:
  add    $0x1,%r12
  cmp    %r13,%r12
  je     L23
L22:
  mov    %rbx,%rdx
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <memcmp@plt>
  test   %eax,%eax
  jne    L21
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L23:
  add    $0x8,%rsp
  xor    %r12d,%r12d
  pop    %rbx
  mov    %r12,%rax
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
char *strstr(const char *haystack, const char *needle) {
  size_t nl = strlen(needle);
  size_t hl = strlen(haystack);
  int i;
  if (nl > hl)
    return 0;
  for (i = hl - nl + 1; i; --i) {
    if (!memcmp(haystack, needle, nl))
      return (char *)haystack;
    ++haystack;
  }
  return 0;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<strstr>:
  endbr64
  push   %r13
  push   %r12
  mov    %rdi,%r12
  mov    %rsi,%rdi
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  sub    $0x8,%rsp
  call   <strlen@plt>
  mov    %r12,%rdi
  mov    %rax,%rbx
  call   <strlen@plt>
  cmp    %rax,%rbx
  ja     L16
  add    $0x1,%eax
  sub    %ebx,%eax
  je     L16
  sub    $0x1,%eax
  lea    0x1(%r12,%rax,1),%r13
  jmp    L20
  nopl   (%rax)
L15:
  add    $0x1,%r12
  cmp    %r13,%r12
  je     L16
L20:
  mov    %rbx,%rdx
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <memcmp@plt>
  test   %eax,%eax
  jne    L15
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L16:
  add    $0x8,%rsp
  xor    %r12d,%r12d
  pop    %rbx
  mov    %r12,%rax
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
char *strstr(const char *haystack, const char *needle) {
  size_t nl = strlen(needle);
  size_t hl = strlen(haystack);
  int i;
  if (nl > hl)
    return 0;
  for (i = hl - nl + 1; i; --i) {
    if (!memcmp(haystack, needle, nl))
      return (char *)haystack;
    ++haystack;
  }
  return 0;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<setOffSet>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %esi,-0x18(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L15
L8:
  mov    -0x4(%rbp),%edx
  mov    -0x14(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <setBit@plt>
  mov    %eax,-0x14(%rbp)
  addl   $0x1,-0x4(%rbp)
L15:
  mov    -0x4(%rbp),%eax
  cmp    -0x18(%rbp),%eax
  jl     L8
  mov    -0x14(%rbp),%eax
  leave
  ret
```

assistant: ```c
int setOffSet(int mask, int offset) {
  for (int i = 0; i < offset; i++) {
    mask = setBit(mask, i);
  }
  return mask;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<setOffSet>:
  endbr64
  test   %esi,%esi
  jle    L17
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %esi,%ebp
  mov    $0x0,%ebx
L7:
  mov    %ebx,%esi
  call   <setBit@plt>
  mov    %eax,%edi
  add    $0x1,%ebx
  cmp    %ebx,%ebp
  jne    L7
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
L17:
  mov    %edi,%eax
  ret
```

assistant: ```c
int setOffSet(int mask, int offset) {
  for (int i = 0; i < offset; i++) {
    mask = setBit(mask, i);
  }
  return mask;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<setOffSet>:
  endbr64
  test   %esi,%esi
  jle    L5
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  xor    %ebx,%ebx
  sub    $0x8,%rsp
  nopw   0x0(%rax,%rax,1)
L8:
  mov    %ebx,%esi
  add    $0x1,%ebx
  call   <setBit@plt>
  mov    %eax,%edi
  cmp    %ebx,%ebp
  jne    L8
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
  nop
L5:
  mov    %edi,%eax
  ret
```

assistant: ```c
int setOffSet(int mask, int offset) {
  for (int i = 0; i < offset; i++) {
    mask = setBit(mask, i);
  }
  return mask;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<setOffSet>:
  endbr64
  test   %esi,%esi
  jle    L4
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  xor    %ebx,%ebx
  sub    $0x8,%rsp
  nopw   0x0(%rax,%rax,1)
L10:
  mov    %ebx,%esi
  add    $0x1,%ebx
  call   <setBit@plt>
  mov    %eax,%edi
  cmp    %ebx,%ebp
  jne    L10
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
  nop
L4:
  mov    %edi,%eax
  ret
```

assistant: ```c
int setOffSet(int mask, int offset) {
  for (int i = 0; i < offset; i++) {
    mask = setBit(mask, i);
  }
  return mask;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<nand_read_ll>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %edx,-0x24(%rbp)
  mov    -0x20(%rbp),%rax
  and    $0x7ff,%eax
  test   %rax,%rax
  jne    L74
  mov    -0x24(%rbp),%eax
  and    $0x7ff,%eax
  test   %eax,%eax
  je     L76
L74:
  mov    $0xffffffff,%eax
  jmp    L64
L76:
  mov    $0x4e000004,%eax
  mov    (%rax),%eax
  mov    $0x4e000004,%edx
  and    $0xfffffffd,%eax
  mov    %eax,(%rdx)
  mov    -0x20(%rbp),%rax
  mov    %eax,-0x8(%rbp)
  jmp    L16
L68:
  mov    $0x4e000020,%eax
  movzbl (%rax),%eax
  mov    $0x4e000020,%edx
  or     $0x4,%eax
  mov    %al,(%rdx)
  mov    $0x4e000008,%eax
  movb   $0x0,(%rax)
  mov    $0x4e00000c,%eax
  movb   $0x0,(%rax)
  mov    $0x4e00000c,%eax
  movb   $0x0,(%rax)
  mov    -0x8(%rbp),%eax
  sar    $0xb,%eax
  mov    %eax,%edx
  mov    $0x4e00000c,%eax
  mov    %dl,(%rax)
  mov    -0x8(%rbp),%eax
  sar    $0x13,%eax
  mov    %eax,%edx
  mov    $0x4e00000c,%eax
  mov    %dl,(%rax)
  mov    -0x8(%rbp),%eax
  sar    $0x1b,%eax
  mov    %eax,%edx
  mov    $0x4e00000c,%eax
  mov    %dl,(%rax)
  mov    $0x4e000008,%eax
  movb   $0x30,(%rax)
  nop
L46:
  mov    $0x4e000020,%eax
  movzbl (%rax),%eax
  movzbl %al,%eax
  and    $0x4,%eax
  test   %eax,%eax
  je     L46
  movl   $0x0,-0x4(%rbp)
  jmp    L47
L14:
  mov    $0x4e000010,%eax
  movzbl (%rax),%edx
  mov    -0x18(%rbp),%rax
  mov    %dl,(%rax)
  addq   $0x1,-0x18(%rbp)
  addl   $0x1,-0x4(%rbp)
  addl   $0x1,-0x8(%rbp)
L47:
  cmpl   $0x7ff,-0x4(%rbp)
  jle    L14
L16:
  mov    -0x8(%rbp),%eax
  cltq
  mov    -0x24(%rbp),%edx
  movslq %edx,%rcx
  mov    -0x20(%rbp),%rdx
  add    %rcx,%rdx
  cmp    %rdx,%rax
  jb     L68
  mov    $0x4e000004,%eax
  mov    (%rax),%eax
  mov    $0x4e000004,%edx
  or     $0x2,%eax
  mov    %eax,(%rdx)
  mov    $0x0,%eax
L64:
  pop    %rbp
  ret
```

assistant: ```c
int nand_read_ll(unsigned char *buf, unsigned long start_addr, int size) {
  int i, j;
  if ((start_addr & (2048 - 1)) || (size & (2048 - 1))) {
    return -1;
  }
  ((*(volatile unsigned int *)(0x4E000000 + 0x04)) &= ~(1 << 1));
  for (i = start_addr; i < (start_addr + size);) {
    ((*(volatile unsigned char *)(0x4E000000 + 0x20)) |= (1 << 2));
    (*(volatile unsigned char *)(0x4E000000 + 0x08)) = 0;
    (*(volatile unsigned char *)(0x4E000000 + 0x0C)) = 0;
    (*(volatile unsigned char *)(0x4E000000 + 0x0C)) = 0;
    (*(volatile unsigned char *)(0x4E000000 + 0x0C)) = (i >> 11) & 0xff;
    (*(volatile unsigned char *)(0x4E000000 + 0x0C)) = (i >> 19) & 0xff;
    (*(volatile unsigned char *)(0x4E000000 + 0x0C)) = (i >> 27) & 0xff;
    (*(volatile unsigned char *)(0x4E000000 + 0x08)) = 0x30;
    {
      while (!((*(volatile unsigned char *)(0x4E000000 + 0x20)) & (1 << 2)))
        ;
    };
    for (j = 0; j < 2048; j++, i++) {
      *buf = ((*(volatile unsigned char *)(0x4E000000 + 0x10)) & 0xff);
      buf++;
    }
  }
  ((*(volatile unsigned int *)(0x4E000000 + 0x04)) |= (1 << 1));
  return 0;
}
```
user: What is the c source code of the assembly code below?

```asm
<nand_read_ll>:
  endbr64
  mov    %rdi,%r8
  mov    %rsi,%rax
  test   $0x7ff,%esi
  jne    L34
  mov    %edx,%r10d
  and    $0x7ff,%r10d
  jne    L60
  mov    0x4e000004,%ecx
  and    $0xfffffffd,%ecx
  mov    %ecx,0x4e000004
  movslq %esi,%rsi
  movslq %edx,%rdx
  lea    (%rdx,%rax,1),%rdi
  cmp    %rdi,%rsi
  jae    L38
  lea    0x800(%r8),%rcx
  sub    %r8d,%eax
  lea    -0x800(%rax),%r9d
  sub    %r8,%rsi
  lea    -0x800(%rsi),%r8
L53:
  lea    -0x800(%rcx),%rax
  lea    (%r9,%rcx,1),%edx
  movzbl 0x4e000020,%esi
  or     $0x4,%esi
  mov    %sil,0x4e000020
  movb   $0x0,0x4e000008
  movb   $0x0,0x4e00000c
  movb   $0x0,0x4e00000c
  mov    %edx,%esi
  sar    $0xb,%esi
  mov    %sil,0x4e00000c
  mov    %edx,%esi
  sar    $0x13,%esi
  mov    %sil,0x4e00000c
  sar    $0x1b,%edx
  mov    %dl,0x4e00000c
  movb   $0x30,0x4e000008
L48:
  movzbl 0x4e000020,%edx
  test   $0x4,%dl
  je     L48
L45:
  movzbl 0x4e000010,%edx
  mov    %dl,(%rax)
  add    $0x1,%rax
  cmp    %rcx,%rax
  jne    L45
  add    $0x800,%rcx
  lea    (%r8,%rcx,1),%rax
  cmp    %rax,%rdi
  ja     L53
L38:
  mov    0x4e000004,%eax
  or     $0x2,%eax
  mov    %eax,0x4e000004
L44:
  mov    %r10d,%eax
  ret
L34:
  mov    $0xffffffff,%r10d
  jmp    L44
L60:
  mov    $0xffffffff,%r10d
  jmp    L44
```

assistant: ```c
int nand_read_ll(unsigned char *buf, unsigned long start_addr, int size) {
  int i, j;
  if ((start_addr & (2048 - 1)) || (size & (2048 - 1))) {
    return -1;
  }
  ((*(volatile unsigned int *)(0x4E000000 + 0x04)) &= ~(1 << 1));
  for (i = start_addr; i < (start_addr + size);) {
    ((*(volatile unsigned char *)(0x4E000000 + 0x20)) |= (1 << 2));
    (*(volatile unsigned char *)(0x4E000000 + 0x08)) = 0;
    (*(volatile unsigned char *)(0x4E000000 + 0x0C)) = 0;
    (*(volatile unsigned char *)(0x4E000000 + 0x0C)) = 0;
    (*(volatile unsigned char *)(0x4E000000 + 0x0C)) = (i >> 11) & 0xff;
    (*(volatile unsigned char *)(0x4E000000 + 0x0C)) = (i >> 19) & 0xff;
    (*(volatile unsigned char *)(0x4E000000 + 0x0C)) = (i >> 27) & 0xff;
    (*(volatile unsigned char *)(0x4E000000 + 0x08)) = 0x30;
    {
      while (!((*(volatile unsigned char *)(0x4E000000 + 0x20)) & (1 << 2)))
        ;
    };
    for (j = 0; j < 2048; j++, i++) {
      *buf = ((*(volatile unsigned char *)(0x4E000000 + 0x10)) & 0xff);
      buf++;
    }
  }
  ((*(volatile unsigned int *)(0x4E000000 + 0x04)) |= (1 << 1));
  return 0;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<nand_read_ll>:
  endbr64
  mov    %rdi,%r8
  mov    %rsi,%rax
  test   $0x7ff,%esi
  jne    L29
  mov    %edx,%r10d
  and    $0x7ff,%r10d
  jne    L29
  mov    0x4e000004,%ecx
  movslq %edx,%rdx
  movslq %esi,%rsi
  lea    (%rdx,%rax,1),%rdi
  and    $0xfffffffd,%ecx
  mov    %ecx,0x4e000004
  cmp    %rdi,%rsi
  jae    L63
  sub    %r8d,%eax
  sub    %r8,%rsi
  lea    0x800(%r8),%rcx
  lea    -0x800(%rax),%r9d
  lea    -0x800(%rsi),%r8
L40:
  movzbl 0x4e000020,%esi
  lea    (%r9,%rcx,1),%edx
  lea    -0x800(%rcx),%rax
  or     $0x4,%esi
  mov    %sil,0x4e000020
  mov    %edx,%esi
  sar    $0xb,%esi
  movb   $0x0,0x4e000008
  movb   $0x0,0x4e00000c
  movb   $0x0,0x4e00000c
  mov    %sil,0x4e00000c
  mov    %edx,%esi
  sar    $0x1b,%edx
  sar    $0x13,%esi
  mov    %sil,0x4e00000c
  mov    %dl,0x4e00000c
  movb   $0x30,0x4e000008
  nopw   0x0(%rax,%rax,1)
L4:
  movzbl 0x4e000020,%edx
  and    $0x4,%edx
  je     L4
  nopl   (%rax)
L23:
  movzbl 0x4e000010,%edx
  add    $0x1,%rax
  mov    %dl,-0x1(%rax)
  cmp    %rcx,%rax
  jne    L23
  add    $0x800,%rcx
  lea    (%r8,%rcx,1),%rax
  cmp    %rax,%rdi
  ja     L40
L63:
  mov    0x4e000004,%eax
  or     $0x2,%eax
  mov    %eax,0x4e000004
L68:
  mov    %r10d,%eax
  ret
L29:
  mov    $0xffffffff,%r10d
  jmp    L68
```

assistant: ```c
int nand_read_ll(unsigned char *buf, unsigned long start_addr, int size) {
  int i, j;
  if ((start_addr & (2048 - 1)) || (size & (2048 - 1))) {
    return -1;
  }
  ((*(volatile unsigned int *)(0x4E000000 + 0x04)) &= ~(1 << 1));
  for (i = start_addr; i < (start_addr + size);) {
    ((*(volatile unsigned char *)(0x4E000000 + 0x20)) |= (1 << 2));
    (*(volatile unsigned char *)(0x4E000000 + 0x08)) = 0;
    (*(volatile unsigned char *)(0x4E000000 + 0x0C)) = 0;
    (*(volatile unsigned char *)(0x4E000000 + 0x0C)) = 0;
    (*(volatile unsigned char *)(0x4E000000 + 0x0C)) = (i >> 11) & 0xff;
    (*(volatile unsigned char *)(0x4E000000 + 0x0C)) = (i >> 19) & 0xff;
    (*(volatile unsigned char *)(0x4E000000 + 0x0C)) = (i >> 27) & 0xff;
    (*(volatile unsigned char *)(0x4E000000 + 0x08)) = 0x30;
    {
      while (!((*(volatile unsigned char *)(0x4E000000 + 0x20)) & (1 << 2)))
        ;
    };
    for (j = 0; j < 2048; j++, i++) {
      *buf = ((*(volatile unsigned char *)(0x4E000000 + 0x10)) & 0xff);
      buf++;
    }
  }
  ((*(volatile unsigned int *)(0x4E000000 + 0x04)) |= (1 << 1));
  return 0;
}
```