ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 这段汇编代码用C语言表示是什么样的?

```asm
<isIn>:
  endbr64
  mov    (%rsi),%rax
  test   %rax,%rax
  je     L27
L26:
  cmp    %rax,%rdi
  je     L1
  jl     L15
  add    $0x8,%rsi
  mov    (%rsi),%rax
  test   %rax,%rax
  jne    L26
  ret
L27:
  mov    $0x0,%eax
  ret
L1:
  mov    $0x1,%eax
  ret
L15:
  mov    $0x0,%eax
  ret
```

assistant: ```c
int isIn(uint64_t sum, uint32_t *p) {
  for (; *p; p++) {
    if (sum == *p)
      return 1;
    if (sum < *p)
      return 0;
  }
  return 0;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<isIn>:
  endbr64
  mov    (%rsi),%rax
  test   %rax,%rax
  jne    L3
  jmp    L24
  xchg   %ax,%ax
L16:
  jl     L24
  mov    0x8(%rsi),%rax
  add    $0x8,%rsi
  test   %rax,%rax
  je     L26
L3:
  cmp    %rax,%rdi
  jne    L16
  mov    $0x1,%eax
  ret
  nopw   0x0(%rax,%rax,1)
L24:
  xor    %eax,%eax
  ret
  nopl   0x0(%rax,%rax,1)
L26:
  ret
```

assistant: ```c
int isIn(uint64_t sum, uint32_t *p) {
  for (; *p; p++) {
    if (sum == *p)
      return 1;
    if (sum < *p)
      return 0;
  }
  return 0;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<isIn>:
  endbr64
  mov    (%rsi),%rax
  test   %rax,%rax
  jne    L3
  jmp    L20
  xchg   %ax,%ax
L48:
  jl     L20
  mov    0x8(%rsi),%rax
  add    $0x8,%rsi
  test   %rax,%rax
  je     L46
L3:
  cmp    %rax,%rdi
  jne    L48
  mov    $0x1,%eax
  ret
  nopw   0x0(%rax,%rax,1)
L20:
  xor    %eax,%eax
  ret
  nopl   0x0(%rax,%rax,1)
L46:
  ret
```

assistant: ```c
int isIn(uint64_t sum, uint32_t *p) {
  for (; *p; p++) {
    if (sum == *p)
      return 1;
    if (sum < *p)
      return 0;
  }
  return 0;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<skip_node_separator>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  mov    %rdi,-0x10(%rbp)
  mov    $0x0,%ebx
  movslq %ebx,%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0xc,%al
  jne    L30
  add    $0x1,%ebx
L30:
  mov    %ebx,%eax
  lea    0x1(%rax),%ebx
  movslq %eax,%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x1f,%al
  je     L2
  mov    $0x0,%eax
  jmp    L55
L2:
  movslq %ebx,%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0xc,%al
  jne    L1
  add    $0x1,%ebx
L1:
  mov    %ebx,%eax
  lea    0x1(%rax),%ebx
  movslq %eax,%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0xa,%al
  je     L24
  mov    $0x0,%eax
  jmp    L55
L24:
  mov    %ebx,%eax
L55:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
int skip_node_separator(char *body) {
  register int i;
  i = 0;
  if (body[i] == '\014')
    i++;
  if (body[i++] != '\037')
    return (0);
  if (body[i] == '\014')
    i++;
  if (body[i++] != '\n')
    return (0);
  return (i);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<skip_node_separator>:
  endbr64
  cmpb   $0xc,(%rdi)
  sete   %dl
  sete   %cl
  movzbl %cl,%ecx
  mov    $0x0,%eax
  cmpb   $0x1f,(%rdi,%rcx,1)
  jne    L19
  movzbl %dl,%edx
  lea    0x1(%rdx),%ecx
  movslq %ecx,%rax
  cmpb   $0xc,(%rdi,%rax,1)
  je     L30
L1:
  movslq %ecx,%rdx
  mov    $0x0,%eax
  cmpb   $0xa,(%rdi,%rdx,1)
  jne    L19
  lea    0x1(%rcx),%eax
L19:
  ret
L30:
  lea    0x2(%rdx),%ecx
  jmp    L1
```

assistant: ```c
int skip_node_separator(char *body) {
  register int i;
  i = 0;
  if (body[i] == '\014')
    i++;
  if (body[i++] != '\037')
    return (0);
  if (body[i] == '\014')
    i++;
  if (body[i++] != '\n')
    return (0);
  return (i);
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<skip_node_separator>:
  endbr64
  cmpb   $0xc,(%rdi)
  sete   %cl
  sete   %dl
  xor    %eax,%eax
  movzbl %cl,%ecx
  cmpb   $0x1f,(%rdi,%rcx,1)
  jne    L14
  movzbl %dl,%edx
  lea    0x1(%rdx),%eax
  movslq %eax,%rcx
  movzbl (%rdi,%rcx,1),%ecx
  cmp    $0xc,%cl
  je     L15
  add    $0x1,%eax
  xor    %edx,%edx
  cmp    $0xa,%cl
  cmovne %edx,%eax
L14:
  ret
  cs nopw 0x0(%rax,%rax,1)
L15:
  lea    0x2(%rdx),%eax
  movslq %eax,%rdx
  add    $0x1,%eax
  movzbl (%rdi,%rdx,1),%ecx
  xor    %edx,%edx
  cmp    $0xa,%cl
  cmovne %edx,%eax
  jmp    L14
```

assistant: ```c
int skip_node_separator(char *body) {
  register int i;
  i = 0;
  if (body[i] == '\014')
    i++;
  if (body[i++] != '\037')
    return (0);
  if (body[i] == '\014')
    i++;
  if (body[i++] != '\n')
    return (0);
  return (i);
}
```
user: What is the c source code of the assembly code below?

```asm
<skip_node_separator>:
  endbr64
  cmpb   $0xc,(%rdi)
  sete   %cl
  sete   %dl
  xor    %eax,%eax
  movzbl %cl,%ecx
  cmpb   $0x1f,(%rdi,%rcx,1)
  jne    L20
  movzbl %dl,%edx
  lea    0x1(%rdx),%eax
  movslq %eax,%rcx
  movzbl (%rdi,%rcx,1),%ecx
  cmp    $0xc,%cl
  je     L5
  add    $0x1,%eax
  xor    %edx,%edx
  cmp    $0xa,%cl
  cmovne %edx,%eax
L20:
  ret
  cs nopw 0x0(%rax,%rax,1)
L5:
  lea    0x2(%rdx),%eax
  movslq %eax,%rdx
  add    $0x1,%eax
  movzbl (%rdi,%rdx,1),%ecx
  xor    %edx,%edx
  cmp    $0xa,%cl
  cmovne %edx,%eax
  jmp    L20
```

assistant: ```c
int skip_node_separator(char *body) {
  register int i;
  i = 0;
  if (body[i] == '\014')
    i++;
  if (body[i++] != '\037')
    return (0);
  if (body[i] == '\014')
    i++;
  if (body[i++] != '\n')
    return (0);
  return (i);
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<stampa>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  lea    D3(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  nop
  pop    %rbp
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D3
type_infered: string

tool: D3: Hello world!!!


assistant: ```c
void stampa() {
  printf("Hello world!!!\n");
  return;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<stampa>:
  endbr64
  sub    $0x8,%rsp
  lea    D6(%rip),%rdi
  call   <printf@plt>
  add    $0x8,%rsp
  ret
```

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

tool: D6: Hello world!!!


assistant: ```c
void stampa() {
  printf("Hello world!!!\n");
  return;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<stampa>:
  endbr64
  lea    D4(%rip),%rdi
  jmp    1050 <printf@plt>
```

tool_calls: name: disassemble_data
arguments: data_tag: D4
data_type: string

tool: D4: Hello world!!!


assistant: ```c
void stampa() {
  printf("Hello world!!!\n");
  return;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<stampa>:
  endbr64
  lea    D3(%rip),%rdi
  jmp    1050 <printf@plt>
```

tool_calls: name: retrieve_data
arguments: label: D3
datatype: string

tool: D3: Hello world!!!


assistant: ```c
void stampa() {
  printf("Hello world!!!\n");
  return;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<_strcmp>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x30(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  movq   $0x0,-0x18(%rbp)
  jmp    L2
L5:
  addq   $0x1,-0x18(%rbp)
L2:
  mov    -0x10(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    -0x8(%rbp),%rcx
  mov    -0x18(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rdx),%edx
  movzbl %dl,%edx
  sub    %edx,%eax
  mov    %eax,-0x1c(%rbp)
  cmpl   $0x0,-0x1c(%rbp)
  jne    L16
  mov    -0x10(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L5
L16:
  mov    -0x1c(%rbp),%eax
  pop    %rbp
  ret
```

assistant: ```c
int _strcmp(const void *str1, const void *str2) {
  const unsigned char *a = str1;
  const unsigned char *b = str2;
  size_t i;
  int r;
  for (i = 0; (r = (a[i] - b[i])) == 0 && a[i]; ++i)
    ;
  return r;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<_strcmp>:
  endbr64
  movzbl (%rdi),%edx
  movzbl %dl,%eax
  movzbl (%rsi),%ecx
  sub    %ecx,%eax
  test   %dl,%dl
  je     L35
  test   %eax,%eax
  jne    L35
  mov    $0x0,%edx
L33:
  add    $0x1,%rdx
  movzbl (%rdi,%rdx,1),%ecx
  movzbl %cl,%eax
  movzbl (%rsi,%rdx,1),%r8d
  sub    %r8d,%eax
  test   %cl,%cl
  je     L35
  test   %eax,%eax
  je     L33
L35:
  ret
```

assistant: ```c
int _strcmp(const void *str1, const void *str2) {
  const unsigned char *a = str1;
  const unsigned char *b = str2;
  size_t i;
  int r;
  for (i = 0; (r = (a[i] - b[i])) == 0 && a[i]; ++i)
    ;
  return r;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<_strcmp>:
  endbr64
  movzbl (%rdi),%eax
  movzbl (%rsi),%ecx
  xor    %edx,%edx
  mov    %eax,%r8d
  sub    %ecx,%eax
  je     L23
  jmp    L27
  nopl   (%rax)
L20:
  add    $0x1,%rdx
  movzbl (%rdi,%rdx,1),%ecx
  movzbl (%rsi,%rdx,1),%r9d
  mov    %ecx,%r8d
  sub    %r9d,%ecx
  jne    L11
L23:
  test   %r8b,%r8b
  jne    L20
  ret
  nopl   0x0(%rax,%rax,1)
L11:
  mov    %ecx,%eax
  ret
L27:
  ret
```

assistant: ```c
int _strcmp(const void *str1, const void *str2) {
  const unsigned char *a = str1;
  const unsigned char *b = str2;
  size_t i;
  int r;
  for (i = 0; (r = (a[i] - b[i])) == 0 && a[i]; ++i)
    ;
  return r;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<_strcmp>:
  endbr64
  movzbl (%rdi),%eax
  movzbl (%rsi),%ecx
  xor    %edx,%edx
  mov    %eax,%r8d
  sub    %ecx,%eax
  je     L4
  jmp    L11
  nopl   (%rax)
L6:
  add    $0x1,%rdx
  movzbl (%rdi,%rdx,1),%ecx
  movzbl (%rsi,%rdx,1),%r9d
  mov    %ecx,%r8d
  sub    %r9d,%ecx
  jne    L16
L4:
  test   %r8b,%r8b
  jne    L6
  ret
  nopl   0x0(%rax,%rax,1)
L16:
  mov    %ecx,%eax
  ret
L11:
  ret
```

assistant: ```c
int _strcmp(const void *str1, const void *str2) {
  const unsigned char *a = str1;
  const unsigned char *b = str2;
  size_t i;
  int r;
  for (i = 0; (r = (a[i] - b[i])) == 0 && a[i]; ++i)
    ;
  return r;
}
```
user: Translate the below assembly code into C programming language:

```asm
<_max>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x4(%rbp)
  mov    %esi,-0x8(%rbp)
  mov    -0x4(%rbp),%eax
  cmp    -0x8(%rbp),%eax
  jl     L4
  mov    -0x4(%rbp),%eax
  jmp    L14
L4:
  mov    -0x8(%rbp),%eax
L14:
  pop    %rbp
  ret
```

assistant: ```c
int _max(int a, int b) {
  if (a >= b)
    return (a);
  return (b);
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<_max>:
  endbr64
  cmp    %esi,%edi
  mov    %esi,%eax
  cmovge %edi,%eax
  ret
```

assistant: ```c
int _max(int a, int b) {
  if (a >= b)
    return (a);
  return (b);
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<_max>:
  endbr64
  cmp    %esi,%edi
  mov    %esi,%eax
  cmovge %edi,%eax
  ret
```

assistant: ```c
int _max(int a, int b) {
  if (a >= b)
    return (a);
  return (b);
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<_max>:
  endbr64
  cmp    %esi,%edi
  mov    %esi,%eax
  cmovge %edi,%eax
  ret
```

assistant: ```c
int _max(int a, int b) {
  if (a >= b)
    return (a);
  return (b);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<do_dtemap>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x4(%rbp)
  mov    %rsi,-0x10(%rbp)
  mov    %edx,-0x8(%rbp)
  nop
  pop    %rbp
  ret
```

assistant: ```c
void do_dtemap(int argc, char *argv[], int start) {
  (void)argc;
  (void)argv;
  (void)start;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<do_dtemap>:
  endbr64
  ret
```

assistant: ```c
void do_dtemap(int argc, char *argv[], int start) {
  (void)argc;
  (void)argv;
  (void)start;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<do_dtemap>:
  endbr64
  ret
```

assistant: ```c
void do_dtemap(int argc, char *argv[], int start) {
  (void)argc;
  (void)argv;
  (void)start;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<do_dtemap>:
  endbr64
  ret
```

assistant: ```c
void do_dtemap(int argc, char *argv[], int start) {
  (void)argc;
  (void)argv;
  (void)start;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x70,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x2,-0x6c(%rbp)
  lea    -0x6c(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  lea    -0x60(%rbp),%rax
  mov    $0x9,%esi
  mov    %rax,%rdi
  call   <get_elem_rec@plt>
  mov    %rax,-0x68(%rbp)
  mov    -0x68(%rbp),%rax
  mov    (%rax),%rax
  movl   $0x3,(%rax)
  mov    -0x6c(%rbp),%eax
  cmp    $0x3,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <test_assert@plt>
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L3
  call   <__stack_chk_fail@plt>
L3:
  leave
  ret
```

assistant: ```c
int main(void) {
  int b = 2;
  int *array[10];
  array[9] = &b;
  int **p = get_elem_rec(array, 9);
  **p = 3;
  test_assert(b == 3);
  return 0;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<main>:
  endbr64
  sub    $0x78,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x68(%rsp)
  xor    %eax,%eax
  movl   $0x2,0xc(%rsp)
  lea    0xc(%rsp),%rax
  mov    %rax,0x58(%rsp)
  lea    0x10(%rsp),%rdi
  mov    $0x9,%esi
  call   <get_elem_rec@plt>
  mov    (%rax),%rax
  movl   $0x3,(%rax)
  cmpl   $0x3,0xc(%rsp)
  sete   %dil
  movzbl %dil,%edi
  call   <test_assert@plt>
  mov    0x68(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L4
  mov    $0x0,%eax
  add    $0x78,%rsp
  ret
L4:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int main(void) {
  int b = 2;
  int *array[10];
  array[9] = &b;
  int **p = get_elem_rec(array, 9);
  **p = 3;
  test_assert(b == 3);
  return 0;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  sub    $0x78,%rsp
  mov    $0x9,%esi
  mov    %fs:0x28,%rax
  mov    %rax,0x68(%rsp)
  xor    %eax,%eax
  lea    0x10(%rsp),%rdi
  lea    0xc(%rsp),%rax
  movl   $0x2,0xc(%rsp)
  mov    %rax,0x58(%rsp)
  call   <get_elem_rec@plt>
  xor    %edi,%edi
  mov    (%rax),%rax
  movl   $0x3,(%rax)
  cmpl   $0x3,0xc(%rsp)
  sete   %dil
  call   <test_assert@plt>
  mov    0x68(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L8
  xor    %eax,%eax
  add    $0x78,%rsp
  ret
L8:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int main(void) {
  int b = 2;
  int *array[10];
  array[9] = &b;
  int **p = get_elem_rec(array, 9);
  **p = 3;
  test_assert(b == 3);
  return 0;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<main>:
  endbr64
  sub    $0x78,%rsp
  mov    $0x9,%esi
  mov    %fs:0x28,%rax
  mov    %rax,0x68(%rsp)
  xor    %eax,%eax
  lea    0x10(%rsp),%rdi
  lea    0xc(%rsp),%rax
  movl   $0x2,0xc(%rsp)
  mov    %rax,0x58(%rsp)
  call   <get_elem_rec@plt>
  xor    %edi,%edi
  mov    (%rax),%rax
  movl   $0x3,(%rax)
  cmpl   $0x3,0xc(%rsp)
  sete   %dil
  call   <test_assert@plt>
  mov    0x68(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L8
  xor    %eax,%eax
  add    $0x78,%rsp
  ret
L8:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int main(void) {
  int b = 2;
  int *array[10];
  array[9] = &b;
  int **p = get_elem_rec(array, 9);
  **p = 3;
  test_assert(b == 3);
  return 0;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<drv_Newhaven_display_on>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  movb   $0x41,-0x1(%rbp)
  movsbl -0x1(%rbp),%eax
  mov    $0x0,%edx
  mov    $0x0,%esi
  mov    %eax,%edi
  call   <drv_Newhaven_sendCommand@plt>
  nop
  leave
  ret
```

assistant: ```c
void drv_Newhaven_display_on(void) {
  char cmd;
  cmd = 0x41;
  drv_Newhaven_sendCommand(cmd, NULL, 0);
}
```
user: What is the c source code of the assembly code below?

```asm
<drv_Newhaven_display_on>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x0,%edx
  mov    $0x0,%esi
  mov    $0x41,%edi
  call   <drv_Newhaven_sendCommand@plt>
  add    $0x8,%rsp
  ret
```

assistant: ```c
void drv_Newhaven_display_on(void) {
  char cmd;
  cmd = 0x41;
  drv_Newhaven_sendCommand(cmd, NULL, 0);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<drv_Newhaven_display_on>:
  endbr64
  xor    %edx,%edx
  xor    %esi,%esi
  mov    $0x41,%edi
  jmp    1050 <drv_Newhaven_sendCommand@plt>
```

assistant: ```c
void drv_Newhaven_display_on(void) {
  char cmd;
  cmd = 0x41;
  drv_Newhaven_sendCommand(cmd, NULL, 0);
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<drv_Newhaven_display_on>:
  endbr64
  xor    %edx,%edx
  xor    %esi,%esi
  mov    $0x41,%edi
  jmp    1050 <drv_Newhaven_sendCommand@plt>
```

assistant: ```c
void drv_Newhaven_display_on(void) {
  char cmd;
  cmd = 0x41;
  drv_Newhaven_sendCommand(cmd, NULL, 0);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<GetVideoBkgrdInfo>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    %rcx,-0x30(%rbp)
  mov    %r8,-0x38(%rbp)
  cmpl   $0x2,-0x1c(%rbp)
  jle    L72
  cmpq   $0x0,-0x18(%rbp)
  jne    L63
L72:
  mov    $0x0,%eax
  jmp    L65
L63:
  movl   $0x0,-0x8(%rbp)
  jmp    L19
L57:
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0x9(%rbp)
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,-0x4(%rbp)
  addl   $0x2,-0x8(%rbp)
  cmpb   $0x7,-0x9(%rbp)
  jne    L41
  mov    -0x8(%rbp),%eax
  lea    0x2(%rax),%edx
  mov    -0x4(%rbp),%eax
  add    %edx,%eax
  cmp    %eax,-0x1c(%rbp)
  jl     L41
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x6,%eax
  mov    %eax,%ecx
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  shr    $0x2,%al
  movzbl %al,%eax
  or     %ecx,%eax
  mov    %eax,%edx
  mov    -0x28(%rbp),%rax
  mov    %dx,(%rax)
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0xc,%eax
  and    $0x3000,%ax
  mov    %eax,%edx
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x2(%rax),%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x4,%eax
  or     %eax,%edx
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x3(%rax),%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  shr    $0x4,%al
  movzbl %al,%eax
  or     %edx,%eax
  mov    %eax,%edx
  mov    -0x30(%rbp),%rax
  mov    %dx,(%rax)
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x3(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  and    $0xf,%eax
  mov    %eax,%edx
  mov    -0x38(%rbp),%rax
  mov    %dl,(%rax)
  mov    $0x1,%eax
  jmp    L65
L41:
  mov    -0x4(%rbp),%eax
  add    %eax,-0x8(%rbp)
L19:
  mov    -0x8(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jl     L57
  mov    $0x0,%eax
L65:
  pop    %rbp
  ret
```

assistant: ```c
int GetVideoBkgrdInfo(unsigned char *desc, int bytes, unsigned short *hor, unsigned short *ver, unsigned char *aspect) {
  unsigned char tag;
  int desc_bytes, i;
  if (bytes < 3 || desc == NULL)
    return 0;
  i = 0;
  while (i < bytes) {
    tag = desc[i];
    desc_bytes = (int)desc[i + 1];
    i += 2;
    if (tag == 0x07 && i + 2 + desc_bytes <= bytes) {
      *hor = (desc[i] << 6) | ((desc[i + 1] & 0xfc) >> 2);
      *ver = ((desc[i + 1] & 0x03) << 12) | (desc[i + 2] << 4) | ((desc[i + 3] & 0xf0) >> 4);
      *aspect = desc[i + 3] & 0x0f;
      return 1;
    }
    i += desc_bytes;
  }
  return 0;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<GetVideoBkgrdInfo>:
  endbr64
  mov    %esi,%r9d
  mov    %rdx,%r11
  mov    %rcx,%r10
  cmp    $0x2,%esi
  jle    L3
  test   %rdi,%rdi
  je     L3
  mov    $0x0,%eax
  jmp    L0
L51:
  lea    (%rcx,%rsi,1),%eax
  cmp    %eax,%r9d
  jle    L40
L0:
  movslq %eax,%rdx
  movzbl 0x1(%rdi,%rdx,1),%ecx
  lea    0x2(%rax),%esi
  cmpb   $0x7,(%rdi,%rdx,1)
  jne    L51
  lea    0x4(%rcx,%rax,1),%eax
  cmp    %r9d,%eax
  jg     L51
  movslq %esi,%rsi
  lea    0x1(%rdi,%rsi,1),%rcx
  movzbl (%rdi,%rsi,1),%edx
  shl    $0x6,%edx
  movzbl (%rcx),%eax
  shr    $0x2,%al
  movzbl %al,%eax
  or     %edx,%eax
  mov    %ax,(%r11)
  lea    0x3(%rdi,%rsi,1),%r9
  movzbl 0x2(%rdi,%rsi,1),%edx
  shl    $0x4,%edx
  movzbl (%r9),%eax
  shr    $0x4,%al
  movzbl %al,%eax
  or     %edx,%eax
  movzbl (%rcx),%edx
  shl    $0xc,%edx
  and    $0x3000,%dx
  or     %edx,%eax
  mov    %ax,(%r10)
  movzbl (%r9),%eax
  and    $0xf,%eax
  mov    %al,(%r8)
  mov    $0x1,%eax
  ret
L40:
  mov    $0x0,%eax
  ret
L3:
  mov    $0x0,%eax
  ret
```

assistant: ```c
int GetVideoBkgrdInfo(unsigned char *desc, int bytes, unsigned short *hor, unsigned short *ver, unsigned char *aspect) {
  unsigned char tag;
  int desc_bytes, i;
  if (bytes < 3 || desc == NULL)
    return 0;
  i = 0;
  while (i < bytes) {
    tag = desc[i];
    desc_bytes = (int)desc[i + 1];
    i += 2;
    if (tag == 0x07 && i + 2 + desc_bytes <= bytes) {
      *hor = (desc[i] << 6) | ((desc[i + 1] & 0xfc) >> 2);
      *ver = ((desc[i + 1] & 0x03) << 12) | (desc[i + 2] << 4) | ((desc[i + 3] & 0xf0) >> 4);
      *aspect = desc[i + 3] & 0x0f;
      return 1;
    }
    i += desc_bytes;
  }
  return 0;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<GetVideoBkgrdInfo>:
  endbr64
  mov    %esi,%r9d
  mov    %rdx,%r11
  mov    %rcx,%r10
  xor    %eax,%eax
  cmp    $0x2,%esi
  jle    L5
  test   %rdi,%rdi
  jne    L13
  jmp    L5
  nopw   0x0(%rax,%rax,1)
L11:
  lea    (%rcx,%rsi,1),%eax
  cmp    %eax,%r9d
  jle    L40
L13:
  movslq %eax,%rdx
  lea    0x2(%rax),%esi
  cmpb   $0x7,(%rdi,%rdx,1)
  movzbl 0x1(%rdi,%rdx,1),%ecx
  jne    L11
  lea    0x4(%rcx,%rax,1),%eax
  cmp    %r9d,%eax
  jg     L11
  movslq %esi,%rsi
  lea    0x1(%rdi,%rsi,1),%rcx
  movzbl (%rdi,%rsi,1),%edx
  lea    0x3(%rdi,%rsi,1),%r9
  movzbl (%rcx),%eax
  shl    $0x6,%edx
  shr    $0x2,%al
  movzbl %al,%eax
  or     %edx,%eax
  mov    %ax,(%r11)
  movzbl (%r9),%eax
  movzbl 0x2(%rdi,%rsi,1),%edx
  shr    $0x4,%al
  shl    $0x4,%edx
  movzbl %al,%eax
  or     %edx,%eax
  movzbl (%rcx),%edx
  shl    $0xc,%edx
  and    $0x3000,%dx
  or     %edx,%eax
  mov    %ax,(%r10)
  movzbl (%r9),%eax
  and    $0xf,%eax
  mov    %al,(%r8)
  mov    $0x1,%eax
  ret
  nopw   0x0(%rax,%rax,1)
L40:
  xor    %eax,%eax
  ret
  nopl   0x0(%rax,%rax,1)
L5:
  ret
```

assistant: ```c
int GetVideoBkgrdInfo(unsigned char *desc, int bytes, unsigned short *hor, unsigned short *ver, unsigned char *aspect) {
  unsigned char tag;
  int desc_bytes, i;
  if (bytes < 3 || desc == NULL)
    return 0;
  i = 0;
  while (i < bytes) {
    tag = desc[i];
    desc_bytes = (int)desc[i + 1];
    i += 2;
    if (tag == 0x07 && i + 2 + desc_bytes <= bytes) {
      *hor = (desc[i] << 6) | ((desc[i + 1] & 0xfc) >> 2);
      *ver = ((desc[i + 1] & 0x03) << 12) | (desc[i + 2] << 4) | ((desc[i + 3] & 0xf0) >> 4);
      *aspect = desc[i + 3] & 0x0f;
      return 1;
    }
    i += desc_bytes;
  }
  return 0;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<GetVideoBkgrdInfo>:
  endbr64
  mov    %esi,%r9d
  mov    %rdx,%r11
  mov    %rcx,%r10
  xor    %eax,%eax
  cmp    $0x2,%esi
  jle    L12
  test   %rdi,%rdi
  jne    L20
  jmp    L12
  nopw   0x0(%rax,%rax,1)
L14:
  lea    (%rcx,%rsi,1),%eax
  cmp    %eax,%r9d
  jle    L2
L20:
  movslq %eax,%rdx
  lea    0x2(%rax),%esi
  cmpb   $0x7,(%rdi,%rdx,1)
  movzbl 0x1(%rdi,%rdx,1),%ecx
  jne    L14
  lea    0x4(%rcx,%rax,1),%eax
  cmp    %r9d,%eax
  jg     L14
  movslq %esi,%rsi
  lea    0x1(%rdi,%rsi,1),%rcx
  movzbl (%rdi,%rsi,1),%edx
  lea    0x3(%rdi,%rsi,1),%r9
  movzbl (%rcx),%eax
  shl    $0x6,%edx
  shr    $0x2,%al
  movzbl %al,%eax
  or     %edx,%eax
  mov    %ax,(%r11)
  movzbl (%r9),%eax
  movzbl 0x2(%rdi,%rsi,1),%edx
  shr    $0x4,%al
  shl    $0x4,%edx
  movzbl %al,%eax
  or     %edx,%eax
  movzbl (%rcx),%edx
  shl    $0xc,%edx
  and    $0x3000,%dx
  or     %edx,%eax
  mov    %ax,(%r10)
  movzbl (%r9),%eax
  and    $0xf,%eax
  mov    %al,(%r8)
  mov    $0x1,%eax
  ret
  nopw   0x0(%rax,%rax,1)
L2:
  xor    %eax,%eax
  ret
  nopl   0x0(%rax,%rax,1)
L12:
  ret
```

assistant: ```c
int GetVideoBkgrdInfo(unsigned char *desc, int bytes, unsigned short *hor, unsigned short *ver, unsigned char *aspect) {
  unsigned char tag;
  int desc_bytes, i;
  if (bytes < 3 || desc == NULL)
    return 0;
  i = 0;
  while (i < bytes) {
    tag = desc[i];
    desc_bytes = (int)desc[i + 1];
    i += 2;
    if (tag == 0x07 && i + 2 + desc_bytes <= bytes) {
      *hor = (desc[i] << 6) | ((desc[i + 1] & 0xfc) >> 2);
      *ver = ((desc[i + 1] & 0x03) << 12) | (desc[i + 2] << 4) | ((desc[i + 3] & 0xf0) >> 4);
      *aspect = desc[i + 3] & 0x0f;
      return 1;
    }
    i += desc_bytes;
  }
  return 0;
}
```