ylfeng/ReF-Decompile-dataset huggingface dataset:
user: What would the C source look like for the assembly code provided here?

```asm
<binsearch>:
  endbr64
  sub    $0x1,%edx
  mov    %edi,%eax
  xor    %r8d,%r8d
  mov    %edx,%ecx
  shr    $0x1f,%ecx
  add    %edx,%ecx
  sar    %ecx
  test   %edx,%edx
  jns    L13
  jmp    L36
  nopl   0x0(%rax,%rax,1)
L11:
  lea    -0x1(%rcx),%edx
L45:
  lea    (%r8,%rdx,1),%edi
  mov    %edi,%ecx
  shr    $0x1f,%ecx
  add    %edi,%ecx
  sar    %ecx
  cmp    %edx,%r8d
  jg     L36
L13:
  movslq %ecx,%rdi
  cmp    %eax,(%rsi,%rdi,4)
  je     L36
  jg     L11
  lea    0x1(%rcx),%r8d
  jmp    L45
  nopl   (%rax)
L36:
  cmp    %ecx,%eax
  mov    $0xffffffff,%edx
  cmovne %edx,%eax
  ret
```

assistant: ```c
int binsearch(int x, int v[], int n) {
  int low, high, mid;
  low = 0;
  high = n - 1;
  mid = (low + high) / 2;
  while (low <= high && x != v[mid]) {
    if (x < v[mid])
      high = mid - 1;
    else
      low = mid + 1;
    mid = (low + high) / 2;
  }
  if (x == mid)
    return mid;
  return -1;
}
```
user: What is the c source code of the assembly code below?

```asm
<binsearch>:
  endbr64
  sub    $0x1,%edx
  mov    %rsi,%r8
  mov    %edi,%eax
  xor    %esi,%esi
  mov    %edx,%ecx
  shr    $0x1f,%ecx
  add    %edx,%ecx
  sar    %ecx
  test   %edx,%edx
  js     L11
  nopl   0x0(%rax,%rax,1)
L38:
  movslq %ecx,%rdi
  cmp    %eax,(%r8,%rdi,4)
  je     L11
  jle    L29
  lea    -0x1(%rcx),%edx
  lea    (%rdx,%rsi,1),%edi
  mov    %edi,%ecx
  shr    $0x1f,%ecx
  add    %edi,%ecx
  sar    %ecx
  cmp    %esi,%edx
  jge    L38
L11:
  cmp    %ecx,%eax
  mov    $0xffffffff,%edx
  cmovne %edx,%eax
  ret
  nopl   0x0(%rax)
L29:
  lea    0x1(%rcx),%esi
  lea    (%rsi,%rdx,1),%edi
  mov    %edi,%ecx
  shr    $0x1f,%ecx
  add    %edi,%ecx
  sar    %ecx
  cmp    %edx,%esi
  jle    L38
  cmp    %ecx,%eax
  mov    $0xffffffff,%edx
  cmovne %edx,%eax
  ret
```

assistant: ```c
int binsearch(int x, int v[], int n) {
  int low, high, mid;
  low = 0;
  high = n - 1;
  mid = (low + high) / 2;
  while (low <= high && x != v[mid]) {
    if (x < v[mid])
      high = mid - 1;
    else
      low = mid + 1;
    mid = (low + high) / 2;
  }
  if (x == mid)
    return mid;
  return -1;
}
```
user: Translate the below assembly code into C programming language:

```asm
<write_data_as_json>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    %rsi,-0x10(%rbp)
  mov    %rdx,-0x18(%rbp)
  mov    %rcx,-0x20(%rbp)
  mov    %r8d,-0x24(%rbp)
  mov    -0x8(%rbp),%rax
  lea    D17(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fprintf@plt>
  mov    -0x24(%rbp),%ecx
  mov    -0x10(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  lea    D3(%rip),%rsi
  mov    %rax,%rdi
  call   <write_named_array_i32@plt>
  mov    -0x8(%rbp),%rax
  lea    D56(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fprintf@plt>
  mov    -0x24(%rbp),%ecx
  mov    -0x18(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  lea    D63(%rip),%rsi
  mov    %rax,%rdi
  call   <write_named_array_i32@plt>
  mov    -0x8(%rbp),%rax
  lea    D56(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fprintf@plt>
  mov    -0x24(%rbp),%ecx
  mov    -0x20(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  lea    D16(%rip),%rsi
  mov    %rax,%rdi
  call   <write_named_array_i32@plt>
  mov    -0x8(%rbp),%rax
  lea    D14(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fprintf@plt>
  nop
  leave
  ret
```

tool_calls: name: read_data
arguments: data_tag: D17
type: string
name: read_data
arguments: data_tag: D3
type: string
name: read_data
arguments: data_tag: D56
type: string
name: read_data
arguments: data_tag: D63
type: string
name: read_data
arguments: data_tag: D16
type: string
name: read_data
arguments: data_tag: D14
type: string

tool: D17: {

tool: D3: a

tool: D56: ,

tool: D63: b

tool: D16: expected

tool: D14: }

assistant: ```c
void write_data_as_json(FILE *f, const int *a, const int *b, const int *y, const unsigned int len) {
  fprintf(f, "{");
  write_named_array_i32(f, "a", a, len);
  fprintf(f, ",");
  write_named_array_i32(f, "b", b, len);
  fprintf(f, ",");
  write_named_array_i32(f, "expected", y, len);
  fprintf(f, "}");
}
```
user: Translate the below assembly code into C programming language:

```asm
<write_data_as_json>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  mov    %rsi,%r14
  mov    %rdx,%r13
  mov    %rcx,%r12
  mov    %r8d,%ebp
  lea    D24(%rip),%rsi
  call   <fprintf@plt>
  mov    %ebp,%ecx
  mov    %r14,%rdx
  lea    D38(%rip),%rsi
  mov    %rbx,%rdi
  call   <write_named_array_i32@plt>
  lea    D25(%rip),%r14
  mov    %r14,%rsi
  mov    %rbx,%rdi
  call   <fprintf@plt>
  mov    %ebp,%ecx
  mov    %r13,%rdx
  lea    D55(%rip),%rsi
  mov    %rbx,%rdi
  call   <write_named_array_i32@plt>
  mov    %r14,%rsi
  mov    %rbx,%rdi
  call   <fprintf@plt>
  mov    %ebp,%ecx
  mov    %r12,%rdx
  lea    D48(%rip),%rsi
  mov    %rbx,%rdi
  call   <write_named_array_i32@plt>
  lea    D31(%rip),%rsi
  mov    %rbx,%rdi
  call   <fprintf@plt>
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D24
data_type: string
name: unpack_data
arguments: data_label: D38
data_type: string
name: unpack_data
arguments: data_label: D25
data_type: string
name: unpack_data
arguments: data_label: D55
data_type: string
name: unpack_data
arguments: data_label: D48
data_type: string
name: unpack_data
arguments: data_label: D31
data_type: string

tool: D24: {

tool: D38: a

tool: D25: ,

tool: D55: b

tool: D48: expected

tool: D31: }

assistant: ```c
void write_data_as_json(FILE *f, const int *a, const int *b, const int *y, const unsigned int len) {
  fprintf(f, "{");
  write_named_array_i32(f, "a", a, len);
  fprintf(f, ",");
  write_named_array_i32(f, "b", b, len);
  fprintf(f, ",");
  write_named_array_i32(f, "expected", y, len);
  fprintf(f, "}");
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<write_data_as_json>:
  endbr64
  push   %r15
  mov    %rsi,%r15
  lea    D2(%rip),%rsi
  push   %r14
  mov    %rdx,%r14
  push   %r13
  mov    %rcx,%r13
  push   %r12
  mov    %r8d,%r12d
  push   %rbp
  mov    %rdi,%rbp
  call   <fprintf@plt>
  mov    %r12d,%ecx
  mov    %r15,%rdx
  mov    %rbp,%rdi
  lea    D4(%rip),%r15
  lea    D36(%rip),%rsi
  call   <write_named_array_i32@plt>
  mov    %r15,%rsi
  mov    %rbp,%rdi
  call   <fprintf@plt>
  mov    %r12d,%ecx
  mov    %r14,%rdx
  mov    %rbp,%rdi
  lea    D28(%rip),%rsi
  call   <write_named_array_i32@plt>
  mov    %r15,%rsi
  mov    %rbp,%rdi
  call   <fprintf@plt>
  mov    %rbp,%rdi
  mov    %r12d,%ecx
  mov    %r13,%rdx
  lea    D27(%rip),%rsi
  call   <write_named_array_i32@plt>
  mov    %rbp,%rdi
  lea    D33(%rip),%rsi
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1060 <fprintf@plt>
```

tool_calls: name: disassemble_data
arguments: data_tag: D2
type_guessed: string
name: disassemble_data
arguments: data_tag: D4
type_guessed: string
name: disassemble_data
arguments: data_tag: D36
type_guessed: string
name: disassemble_data
arguments: data_tag: D28
type_guessed: string
name: disassemble_data
arguments: data_tag: D27
type_guessed: string
name: disassemble_data
arguments: data_tag: D33
type_guessed: string

tool: D2: {

tool: D4: ,

tool: D36: a

tool: D28: b

tool: D27: expected

tool: D33: }

assistant: ```c
void write_data_as_json(FILE *f, const int *a, const int *b, const int *y, const unsigned int len) {
  fprintf(f, "{");
  write_named_array_i32(f, "a", a, len);
  fprintf(f, ",");
  write_named_array_i32(f, "b", b, len);
  fprintf(f, ",");
  write_named_array_i32(f, "expected", y, len);
  fprintf(f, "}");
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<write_data_as_json>:
  endbr64
  push   %r15
  mov    %rsi,%r15
  lea    D34(%rip),%rsi
  push   %r14
  mov    %rdx,%r14
  push   %r13
  mov    %rcx,%r13
  push   %r12
  mov    %r8d,%r12d
  push   %rbp
  mov    %rdi,%rbp
  call   <fprintf@plt>
  mov    %r12d,%ecx
  mov    %r15,%rdx
  mov    %rbp,%rdi
  lea    D42(%rip),%r15
  lea    D57(%rip),%rsi
  call   <write_named_array_i32@plt>
  mov    %r15,%rsi
  mov    %rbp,%rdi
  call   <fprintf@plt>
  mov    %r12d,%ecx
  mov    %r14,%rdx
  mov    %rbp,%rdi
  lea    D56(%rip),%rsi
  call   <write_named_array_i32@plt>
  mov    %r15,%rsi
  mov    %rbp,%rdi
  call   <fprintf@plt>
  mov    %rbp,%rdi
  mov    %r12d,%ecx
  mov    %r13,%rdx
  lea    D11(%rip),%rsi
  call   <write_named_array_i32@plt>
  mov    %rbp,%rdi
  lea    D26(%rip),%rsi
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1060 <fprintf@plt>
```

tool_calls: name: read_data
arguments: data_tag: D34
data_type: string
name: read_data
arguments: data_tag: D42
data_type: string
name: read_data
arguments: data_tag: D57
data_type: string
name: read_data
arguments: data_tag: D56
data_type: string
name: read_data
arguments: data_tag: D11
data_type: string
name: read_data
arguments: data_tag: D26
data_type: string

tool: D34: {

tool: D42: ,

tool: D57: a

tool: D56: b

tool: D11: expected

tool: D26: }

assistant: ```c
void write_data_as_json(FILE *f, const int *a, const int *b, const int *y, const unsigned int len) {
  fprintf(f, "{");
  write_named_array_i32(f, "a", a, len);
  fprintf(f, ",");
  write_named_array_i32(f, "b", b, len);
  fprintf(f, ",");
  write_named_array_i32(f, "expected", y, len);
  fprintf(f, "}");
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<is_valid>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  lea    D28(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L8
  mov    -0x8(%rbp),%rax
  lea    D2(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L8
  mov    -0x8(%rbp),%rax
  lea    D24(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L29
L8:
  mov    $0x1,%eax
  jmp    L25
L29:
  mov    $0x0,%eax
L25:
  leave
  ret
```

tool_calls: name: parse_data
arguments: label: D28
data_type: string
name: parse_data
arguments: label: D2
data_type: string
name: parse_data
arguments: label: D24
data_type: string

tool: D28:  

tool: D2: 


tool: D24: 	

assistant: ```c
int is_valid(char *word) {
  if (!strcmp(word, " ") || !strcmp(word, "\n") || !strcmp(word, "\t")) {
    return 1;
  }
  return 0;
}
```
user: Translate the below assembly code into C programming language:

```asm
<is_valid>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  lea    D8(%rip),%rsi
  call   <strcmp@plt>
  mov    %eax,%edx
  mov    $0x1,%eax
  test   %edx,%edx
  je     L16
  lea    D23(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  mov    %eax,%edx
  mov    $0x1,%eax
  test   %edx,%edx
  je     L16
  lea    D16(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  sete   %al
  movzbl %al,%eax
L16:
  pop    %rbx
  ret
```

tool_calls: name: retrieve_data
arguments: label: D8
datatype: string
name: retrieve_data
arguments: label: D23
datatype: string
name: retrieve_data
arguments: label: D16
datatype: string

tool: D8:  

tool: D23: 


tool: D16: 	

assistant: ```c
int is_valid(char *word) {
  if (!strcmp(word, " ") || !strcmp(word, "\n") || !strcmp(word, "\t")) {
    return 1;
  }
  return 0;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<is_valid>:
  endbr64
  movzbl (%rdi),%eax
  cmp    $0x20,%eax
  jne    L14
  cmpb   $0x0,0x1(%rdi)
  mov    $0x1,%r8d
  jne    L14
  mov    %r8d,%eax
  ret
  nopl   0x0(%rax)
L14:
  cmp    $0xa,%eax
  je     L7
L47:
  sub    $0x9,%eax
  jne    L8
  movzbl 0x1(%rdi),%eax
L8:
  xor    %r8d,%r8d
  test   %eax,%eax
  sete   %r8b
  mov    %r8d,%eax
  ret
  nopl   0x0(%rax,%rax,1)
L7:
  cmpb   $0x0,0x1(%rdi)
  mov    $0x1,%r8d
  jne    L47
  mov    %r8d,%eax
  ret
```

assistant: ```c
int is_valid(char *word) {
  if (!strcmp(word, " ") || !strcmp(word, "\n") || !strcmp(word, "\t")) {
    return 1;
  }
  return 0;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<is_valid>:
  endbr64
  movzbl (%rdi),%eax
  cmp    $0x20,%eax
  jne    L25
  cmpb   $0x0,0x1(%rdi)
  mov    $0x1,%r8d
  jne    L25
  mov    %r8d,%eax
  ret
  nopl   0x0(%rax)
L25:
  cmp    $0xa,%eax
  je     L44
L19:
  sub    $0x9,%eax
  jne    L22
  movzbl 0x1(%rdi),%eax
L22:
  xor    %r8d,%r8d
  test   %eax,%eax
  sete   %r8b
  mov    %r8d,%eax
  ret
  nopl   0x0(%rax,%rax,1)
L44:
  cmpb   $0x0,0x1(%rdi)
  mov    $0x1,%r8d
  jne    L19
  mov    %r8d,%eax
  ret
```

assistant: ```c
int is_valid(char *word) {
  if (!strcmp(word, " ") || !strcmp(word, "\n") || !strcmp(word, "\t")) {
    return 1;
  }
  return 0;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<fuzix_isxdigit>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x14(%rbp)
  mov    -0x14(%rbp),%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  mov    %eax,%edi
  call   <fuzix_isdigit@plt>
  test   %rax,%rax
  je     L39
  mov    $0x1,%eax
  jmp    L46
L39:
  orl    $0x20,-0x4(%rbp)
  cmpl   $0x60,-0x4(%rbp)
  jle    L22
  cmpl   $0x66,-0x4(%rbp)
  jg     L22
  mov    $0x1,%eax
  jmp    L46
L22:
  mov    $0x0,%eax
L46:
  leave
  ret
```

assistant: ```c
int fuzix_isxdigit(int c) {
  uint8_t bc = c;
  if (fuzix_isdigit(bc))
    return 1;
  bc |= 0x20;
  return ((bc >= 'a') && (bc <= 'f'));
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<fuzix_isxdigit>:
  endbr64
  push   %rbx
  mov    %edi,%ebx
  call   <fuzix_isdigit@plt>
  mov    %rax,%rdx
  mov    $0x1,%eax
  test   %rdx,%rdx
  jne    L5
  or     $0x20,%ebx
  sub    $0x61,%ebx
  cmp    $0x5,%ebx
  setbe  %al
  movzbl %al,%eax
L5:
  pop    %rbx
  ret
```

assistant: ```c
int fuzix_isxdigit(int c) {
  uint8_t bc = c;
  if (fuzix_isdigit(bc))
    return 1;
  bc |= 0x20;
  return ((bc >= 'a') && (bc <= 'f'));
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<fuzix_isxdigit>:
  endbr64
  push   %rbx
  mov    %edi,%ebx
  call   <fuzix_isdigit@plt>
  mov    %rax,%r8
  mov    $0x1,%eax
  test   %r8,%r8
  jne    L4
  or     $0x20,%ebx
  xor    %eax,%eax
  sub    $0x61,%ebx
  cmp    $0x5,%ebx
  setbe  %al
L4:
  pop    %rbx
  ret
```

assistant: ```c
int fuzix_isxdigit(int c) {
  uint8_t bc = c;
  if (fuzix_isdigit(bc))
    return 1;
  bc |= 0x20;
  return ((bc >= 'a') && (bc <= 'f'));
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<fuzix_isxdigit>:
  endbr64
  push   %rbx
  mov    %edi,%ebx
  call   <fuzix_isdigit@plt>
  mov    %rax,%r8
  mov    $0x1,%eax
  test   %r8,%r8
  jne    L1
  or     $0x20,%ebx
  xor    %eax,%eax
  sub    $0x61,%ebx
  cmp    $0x5,%ebx
  setbe  %al
L1:
  pop    %rbx
  ret
```

assistant: ```c
int fuzix_isxdigit(int c) {
  uint8_t bc = c;
  if (fuzix_isdigit(bc))
    return 1;
  bc |= 0x20;
  return ((bc >= 'a') && (bc <= 'f'));
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<calctime2>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  movsd  %xmm0,-0x8(%rbp)
  movsd  %xmm1,-0x10(%rbp)
  movsd  -0x10(%rbp),%xmm0
  movsd  D7(%rip),%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  movsd  -0x8(%rbp),%xmm0
  addsd  -0x10(%rbp),%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  pop    %rbp
  ret
```

tool_calls: name: read_data
arguments: label: D7
type_guessed: byte[8]

tool: {"D7": [0x00,0x00,0x00,0x00,0x80,0x84,0x2e,0x41]}

assistant: ```c
double calctime2(double tv_sec, double tv_usec) {
  tv_usec /= 1000000;
  return tv_sec + tv_usec;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<calctime2>:
  endbr64
  divsd  D0(%rip),%xmm1
  addsd  %xmm1,%xmm0
  ret
```

tool_calls: name: parse_data
arguments: data_label: D0
type: byte[8]

tool: {"D0": [0x00,0x00,0x00,0x00,0x80,0x84,0x2e,0x41]}

assistant: ```c
double calctime2(double tv_sec, double tv_usec) {
  tv_usec /= 1000000;
  return tv_sec + tv_usec;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<calctime2>:
  endbr64
  divsd  D8(%rip),%xmm1
  addsd  %xmm1,%xmm0
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D8
datatype: byte[8]

tool: {"D8": [0x00,0x00,0x00,0x00,0x80,0x84,0x2e,0x41]}

assistant: ```c
double calctime2(double tv_sec, double tv_usec) {
  tv_usec /= 1000000;
  return tv_sec + tv_usec;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<calctime2>:
  endbr64
  divsd  D1(%rip),%xmm1
  addsd  %xmm1,%xmm0
  ret
```

tool_calls: name: retrieve_data
arguments: data_tag: D1
type: byte[8]

tool: {"D1": [0x00,0x00,0x00,0x00,0x80,0x84,0x2e,0x41]}

assistant: ```c
double calctime2(double tv_sec, double tv_usec) {
  tv_usec /= 1000000;
  return tv_sec + tv_usec;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<mc_chroma_2xh>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %esi,%r13d
  mov    0x28(%rsp),%r12d
  mov    %r8d,%r11d
  and    $0x7,%r11d
  mov    %r9d,%eax
  and    $0x7,%eax
  mov    $0x8,%r10d
  mov    %r10d,%ebx
  sub    %r11d,%ebx
  sub    %eax,%r10d
  mov    %ebx,%ebp
  imul   %r10d,%ebp
  imul   %r11d,%r10d
  imul   %eax,%ebx
  imul   %eax,%r11d
  sar    $0x3,%r9d
  imul   %ecx,%r9d
  sar    $0x3,%r8d
  lea    (%r9,%r8,1),%eax
  cltq
  lea    (%rdx,%rax,4),%rax
  movslq %ecx,%rsi
  shl    $0x2,%rsi
  lea    (%rax,%rsi,1),%rdx
  test   %r12d,%r12d
  jle    L1
  movslq %r13d,%r9
  shl    $0x2,%r9
  mov    $0x0,%r8d
L11:
  mov    %ebp,%ecx
  imul   (%rax),%ecx
  mov    %r10d,%r13d
  imul   0x4(%rax),%r13d
  add    %r13d,%ecx
  mov    %ebx,%r13d
  imul   (%rdx),%r13d
  add    %r13d,%ecx
  mov    %r11d,%r13d
  imul   0x4(%rdx),%r13d
  lea    0x20(%rcx,%r13,1),%ecx
  sar    $0x6,%ecx
  mov    %ecx,(%rdi)
  mov    %ebp,%ecx
  imul   0x4(%rax),%ecx
  mov    %r10d,%r13d
  imul   0x8(%rax),%r13d
  add    %r13d,%ecx
  mov    %ebx,%r13d
  imul   0x4(%rdx),%r13d
  add    %r13d,%ecx
  mov    %r11d,%r13d
  imul   0x8(%rdx),%r13d
  lea    0x20(%rcx,%r13,1),%ecx
  sar    $0x6,%ecx
  mov    %ecx,0x4(%rdi)
  add    %rsi,%rax
  add    %rsi,%rdx
  add    %r9,%rdi
  add    $0x1,%r8d
  cmp    %r8d,%r12d
  jne    L11
L1:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
void mc_chroma_2xh(uint8_t *dst, int i_dst_stride, uint8_t *src, int i_src_stride, int mvx, int mvy, int i_height) {
  uint8_t *srcp;
  int d8x = mvx & 0x07;
  int d8y = mvy & 0x07;
  int cA = (8 - d8x) * (8 - d8y);
  int cB = d8x * (8 - d8y);
  int cC = (8 - d8x) * d8y;
  int cD = d8x * d8y;
  src += (mvy >> 3) * i_src_stride + (mvx >> 3);
  srcp = &src[i_src_stride];
  for (int y = 0; y < i_height; y++) {
    dst[0] = (cA * src[0] + cB * src[0 + 1] + cC * srcp[0] + cD * srcp[0 + 1] + 32) >> 6;
    dst[1] = (cA * src[1] + cB * src[1 + 1] + cC * srcp[1] + cD * srcp[1 + 1] + 32) >> 6;
    src += i_src_stride;
    srcp += i_src_stride;
    dst += i_dst_stride;
  }
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<mc_chroma_2xh>:
  endbr64
  mov    %r8d,%r11d
  mov    %r9d,%eax
  mov    $0x8,%r10d
  sar    $0x3,%r9d
  push   %r14
  and    $0x7,%r11d
  imul   %ecx,%r9d
  and    $0x7,%eax
  push   %r13
  sar    $0x3,%r8d
  mov    %esi,%r14d
  push   %r12
  push   %rbp
  push   %rbx
  mov    %r10d,%ebx
  sub    %eax,%r10d
  mov    0x30(%rsp),%r12d
  sub    %r11d,%ebx
  mov    %ebx,%ebp
  imul   %eax,%ebx
  imul   %r10d,%ebp
  imul   %r11d,%r10d
  imul   %eax,%r11d
  lea    (%r9,%r8,1),%eax
  movslq %ecx,%r8
  cltq
  shl    $0x2,%r8
  lea    (%rdx,%rax,4),%r13
  lea    0x0(%r13,%r8,1),%rsi
  test   %r12d,%r12d
  jle    L12
  movslq %r14d,%r9
  mov    %rsi,%rax
  xor    %ecx,%ecx
  shl    $0x2,%r9
  jmp    L20
  nopw   0x0(%rax,%rax,1)
L9:
  add    %r8,%rsi
L20:
  mov    0x0(%r13),%edx
  mov    0x4(%r13),%r14d
  add    $0x1,%ecx
  imul   %r10d,%r14d
  imul   %ebp,%edx
  add    %r14d,%edx
  mov    (%rax),%r14d
  imul   %ebx,%r14d
  add    %r14d,%edx
  mov    0x4(%rax),%r14d
  imul   %r11d,%r14d
  lea    0x20(%rdx,%r14,1),%edx
  sar    $0x6,%edx
  mov    %edx,(%rdi)
  mov    0x4(%r13),%edx
  mov    0x8(%r13),%r14d
  mov    0x4(%rax),%r13d
  imul   %ebp,%edx
  imul   %r10d,%r14d
  imul   %ebx,%r13d
  add    %r14d,%edx
  add    %r13d,%edx
  mov    0x8(%rax),%r13d
  add    %r8,%rax
  imul   %r11d,%r13d
  lea    0x20(%rdx,%r13,1),%edx
  mov    %rsi,%r13
  sar    $0x6,%edx
  mov    %edx,0x4(%rdi)
  add    %r9,%rdi
  cmp    %ecx,%r12d
  jne    L9
L12:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

assistant: ```c
void mc_chroma_2xh(uint8_t *dst, int i_dst_stride, uint8_t *src, int i_src_stride, int mvx, int mvy, int i_height) {
  uint8_t *srcp;
  int d8x = mvx & 0x07;
  int d8y = mvy & 0x07;
  int cA = (8 - d8x) * (8 - d8y);
  int cB = d8x * (8 - d8y);
  int cC = (8 - d8x) * d8y;
  int cD = d8x * d8y;
  src += (mvy >> 3) * i_src_stride + (mvx >> 3);
  srcp = &src[i_src_stride];
  for (int y = 0; y < i_height; y++) {
    dst[0] = (cA * src[0] + cB * src[0 + 1] + cC * srcp[0] + cD * srcp[0 + 1] + 32) >> 6;
    dst[1] = (cA * src[1] + cB * src[1 + 1] + cC * srcp[1] + cD * srcp[1 + 1] + 32) >> 6;
    src += i_src_stride;
    srcp += i_src_stride;
    dst += i_dst_stride;
  }
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<mc_chroma_2xh>:
  endbr64
  mov    %r8d,%r11d
  mov    %r9d,%eax
  mov    $0x8,%r10d
  sar    $0x3,%r9d
  push   %r14
  and    $0x7,%r11d
  imul   %ecx,%r9d
  and    $0x7,%eax
  push   %r13
  sar    $0x3,%r8d
  mov    %esi,%r14d
  push   %r12
  push   %rbp
  push   %rbx
  mov    %r10d,%ebx
  sub    %eax,%r10d
  mov    0x30(%rsp),%r12d
  sub    %r11d,%ebx
  mov    %ebx,%ebp
  imul   %eax,%ebx
  imul   %r10d,%ebp
  imul   %r11d,%r10d
  imul   %eax,%r11d
  lea    (%r9,%r8,1),%eax
  movslq %ecx,%r8
  cltq
  shl    $0x2,%r8
  lea    (%rdx,%rax,4),%r13
  lea    0x0(%r13,%r8,1),%rsi
  test   %r12d,%r12d
  jle    L8
  movslq %r14d,%r9
  mov    %rsi,%rax
  xor    %ecx,%ecx
  shl    $0x2,%r9
  jmp    L3
  nopw   0x0(%rax,%rax,1)
L16:
  add    %r8,%rsi
L3:
  mov    0x0(%r13),%edx
  mov    0x4(%r13),%r14d
  add    $0x1,%ecx
  imul   %r10d,%r14d
  imul   %ebp,%edx
  add    %r14d,%edx
  mov    (%rax),%r14d
  imul   %ebx,%r14d
  add    %r14d,%edx
  mov    0x4(%rax),%r14d
  imul   %r11d,%r14d
  lea    0x20(%rdx,%r14,1),%edx
  sar    $0x6,%edx
  mov    %edx,(%rdi)
  mov    0x4(%r13),%edx
  mov    0x8(%r13),%r14d
  mov    0x4(%rax),%r13d
  imul   %ebp,%edx
  imul   %r10d,%r14d
  imul   %ebx,%r13d
  add    %r14d,%edx
  add    %r13d,%edx
  mov    0x8(%rax),%r13d
  add    %r8,%rax
  imul   %r11d,%r13d
  lea    0x20(%rdx,%r13,1),%edx
  mov    %rsi,%r13
  sar    $0x6,%edx
  mov    %edx,0x4(%rdi)
  add    %r9,%rdi
  cmp    %ecx,%r12d
  jne    L16
L8:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

assistant: ```c
void mc_chroma_2xh(uint8_t *dst, int i_dst_stride, uint8_t *src, int i_src_stride, int mvx, int mvy, int i_height) {
  uint8_t *srcp;
  int d8x = mvx & 0x07;
  int d8y = mvy & 0x07;
  int cA = (8 - d8x) * (8 - d8y);
  int cB = d8x * (8 - d8y);
  int cC = (8 - d8x) * d8y;
  int cD = d8x * d8y;
  src += (mvy >> 3) * i_src_stride + (mvx >> 3);
  srcp = &src[i_src_stride];
  for (int y = 0; y < i_height; y++) {
    dst[0] = (cA * src[0] + cB * src[0 + 1] + cC * srcp[0] + cD * srcp[0 + 1] + 32) >> 6;
    dst[1] = (cA * src[1] + cB * src[1 + 1] + cC * srcp[1] + cD * srcp[1 + 1] + 32) >> 6;
    src += i_src_stride;
    srcp += i_src_stride;
    dst += i_dst_stride;
  }
}
```