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

```asm
<k_quicksort>:
  endbr64
  push   %r15
  movslq %esi,%r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  cmp    $0x1,%r15d
  jle    L11
  mov    %rdi,%r14
  lea    0x4(%rdi),%rbx
  xor    %r13d,%r13d
  mov    $0x1,%r12d
  jmp    L25
  nopl   (%rax)
L6:
  mov    %eax,%r12d
L25:
  movslq %r13d,%rax
  mov    (%rbx),%esi
  lea    (%r14,%rax,4),%rbp
  mov    0x0(%rbp),%edi
  call   <k_quicksort_cmp@plt>
  test   %rax,%rax
  lea    0x1(%r12),%eax
  cmovs  %rbx,%rbp
  cmovs  %r12d,%r13d
  add    $0x4,%rbx
  cmp    %eax,%r15d
  jne    L6
  lea    -0x4(%r14,%r15,4),%rdi
  mov    %rbp,%rsi
  call   <k_quicksort_swap@plt>
  add    $0x8,%rsp
  lea    -0x1(%r12),%edx
  xor    %esi,%esi
  pop    %rbx
  mov    %r14,%rdi
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1070 <k_quicksort_t@plt>
  nopw   0x0(%rax,%rax,1)
L11:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void k_quicksort(int data[], int n) {
  int i = 0;
  int max = 0;
  if (2 > n) {
    return;
  }
  for (i = 1, max = 0; i < n; ++i) {
    if (0 > k_quicksort_cmp(data[max], data[i])) {
      max = i;
    }
  }
  k_quicksort_swap(&data[n - 1], &data[max]);
  k_quicksort_t(data, 0, n - 2);
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<reverse>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xa,%al
  jne    L18
  subq   $0x1,-0x8(%rbp)
  jmp    L18
L23:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0x9(%rbp)
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  mov    -0x8(%rbp),%rdx
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
  mov    -0x8(%rbp),%rax
  lea    -0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  movzbl -0x9(%rbp),%edx
  mov    %dl,(%rax)
L18:
  mov    -0x18(%rbp),%rax
  cmp    -0x8(%rbp),%rax
  jb     L23
  nop
  nop
  leave
  ret
```

assistant: ```c
void reverse(char *s) {
  char *send = s + strlen(s) - 1;
  if (*send == '\n')
    --send;
  while (s < send) {
    char temp;
    temp = *s;
    *s++ = *send;
    *send-- = temp;
  }
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<reverse>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  call   <strlen@plt>
  cltq
  lea    -0x1(%rbx,%rax,1),%rax
  cmpb   $0xa,(%rax)
  sete   %dl
  movzbl %dl,%edx
  sub    %rdx,%rax
  cmp    %rax,%rbx
  jae    L11
L4:
  movzbl (%rbx),%edx
  add    $0x1,%rbx
  movzbl (%rax),%ecx
  mov    %cl,-0x1(%rbx)
  sub    $0x1,%rax
  mov    %dl,0x1(%rax)
  cmp    %rax,%rbx
  jb     L4
L11:
  pop    %rbx
  ret
```

assistant: ```c
void reverse(char *s) {
  char *send = s + strlen(s) - 1;
  if (*send == '\n')
    --send;
  while (s < send) {
    char temp;
    temp = *s;
    *s++ = *send;
    *send-- = temp;
  }
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<reverse>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  call   <strlen@plt>
  xor    %edx,%edx
  cltq
  lea    -0x1(%rbx,%rax,1),%rax
  cmpb   $0xa,(%rax)
  sete   %dl
  sub    %rdx,%rax
  cmp    %rax,%rbx
  jae    L18
  nopl   0x0(%rax)
L4:
  movzbl (%rbx),%edx
  movzbl (%rax),%ecx
  add    $0x1,%rbx
  sub    $0x1,%rax
  mov    %cl,-0x1(%rbx)
  mov    %dl,0x1(%rax)
  cmp    %rax,%rbx
  jb     L4
L18:
  pop    %rbx
  ret
```

assistant: ```c
void reverse(char *s) {
  char *send = s + strlen(s) - 1;
  if (*send == '\n')
    --send;
  while (s < send) {
    char temp;
    temp = *s;
    *s++ = *send;
    *send-- = temp;
  }
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<reverse>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  call   <strlen@plt>
  xor    %edx,%edx
  cltq
  lea    -0x1(%rbx,%rax,1),%rax
  cmpb   $0xa,(%rax)
  sete   %dl
  sub    %rdx,%rax
  cmp    %rax,%rbx
  jae    L1
  nopl   0x0(%rax)
L12:
  movzbl (%rbx),%edx
  movzbl (%rax),%ecx
  add    $0x1,%rbx
  sub    $0x1,%rax
  mov    %cl,-0x1(%rbx)
  mov    %dl,0x1(%rax)
  cmp    %rax,%rbx
  jb     L12
L1:
  pop    %rbx
  ret
```

assistant: ```c
void reverse(char *s) {
  char *send = s + strlen(s) - 1;
  if (*send == '\n')
    --send;
  while (s < send) {
    char temp;
    temp = *s;
    *s++ = *send;
    *send-- = temp;
  }
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %rsi,-0x20(%rbp)
  movl   $0x0,-0x4(%rbp)
  movl   $0x0,-0x8(%rbp)
  movl   $0x0,-0xc(%rbp)
  jmp    L19
L6:
  mov    -0xc(%rbp),%eax
  add    %eax,-0x8(%rbp)
  addl   $0x1,-0xc(%rbp)
L19:
  cmpl   $0x14,-0xc(%rbp)
  jle    L6
  mov    -0x8(%rbp),%eax
  mov    %eax,%esi
  lea    D13(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    -0x8(%rbp),%eax
  add    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  mov    %eax,%esi
  lea    D17(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: data_tag: D13
type_guessed: string
name: disassemble_data
arguments: data_tag: D17
type_guessed: string

tool: D13: local sum: %d


tool: D17: total sum: %d


assistant: ```c
int main(int argc, char **argv) {
  int i, lsum, sum;
  sum = 0;
#pragma omp parallel private(i, lsum) reduction(+ : sum)
  {
    lsum = 0;
#pragma omp for
    for (i = 0; i < 21; i++) {
      lsum += i;
    }
    printf("local sum: %d\n", lsum);
    sum += lsum;
  }
  printf("total sum: %d\n", sum);
  return 0;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x15,%eax
L3:
  sub    $0x1,%eax
  jne    L3
  mov    $0xd2,%esi
  lea    D8(%rip),%rdi
  call   <printf@plt>
  mov    $0xd2,%esi
  lea    D5(%rip),%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: read_data
arguments: label: D8
datatype: string
name: read_data
arguments: label: D5
datatype: string

tool: D8: local sum: %d


tool: D5: total sum: %d


assistant: ```c
int main(int argc, char **argv) {
  int i, lsum, sum;
  sum = 0;
#pragma omp parallel private(i, lsum) reduction(+ : sum)
  {
    lsum = 0;
#pragma omp for
    for (i = 0; i < 21; i++) {
      lsum += i;
    }
    printf("local sum: %d\n", lsum);
    sum += lsum;
  }
  printf("total sum: %d\n", sum);
  return 0;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  mov    $0xd2,%esi
  lea    D0(%rip),%rdi
  call   <printf@plt>
  mov    $0xd2,%esi
  lea    D13(%rip),%rdi
  call   <printf@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D0
data_type: string
name: unpack_data
arguments: data_label: D13
data_type: string

tool: D0: local sum: %d


tool: D13: total sum: %d


assistant: ```c
int main(int argc, char **argv) {
  int i, lsum, sum;
  sum = 0;
#pragma omp parallel private(i, lsum) reduction(+ : sum)
  {
    lsum = 0;
#pragma omp for
    for (i = 0; i < 21; i++) {
      lsum += i;
    }
    printf("local sum: %d\n", lsum);
    sum += lsum;
  }
  printf("total sum: %d\n", sum);
  return 0;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  mov    $0xd2,%esi
  lea    D17(%rip),%rdi
  call   <printf@plt>
  mov    $0xd2,%esi
  lea    D2(%rip),%rdi
  call   <printf@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: read_data
arguments: tag: D17
datatype: string
name: read_data
arguments: tag: D2
datatype: string

tool: D17: local sum: %d


tool: D2: total sum: %d


assistant: ```c
int main(int argc, char **argv) {
  int i, lsum, sum;
  sum = 0;
#pragma omp parallel private(i, lsum) reduction(+ : sum)
  {
    lsum = 0;
#pragma omp for
    for (i = 0; i < 21; i++) {
      lsum += i;
    }
    printf("local sum: %d\n", lsum);
    sum += lsum;
  }
  printf("total sum: %d\n", sum);
  return 0;
}
```
user: Translate the below assembly code into C programming language:

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

tool_calls: name: read_data
arguments: label: D7
datatype: string
name: read_data
arguments: label: D12
datatype: string

tool: D7: spi-hdlc-adapter 0.07 (19:00:45 Mar 15 2022)


tool: D12: Copyright (c) 2017 The OpenThread Authors, All Rights Reserved


assistant: ```c
void print_version(void) {
  printf("spi-hdlc-adapter "
         "0.07"
         " ("
         "19:00:45"
         " "
         "Mar 15 2022"
         ")\n");
  printf("Copyright (c) 2017 The OpenThread Authors, All Rights Reserved\n");
}
```
user: Translate the below assembly code into C programming language:

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

tool_calls: name: retrieve_data
arguments: data_label: D1
type: string
name: retrieve_data
arguments: data_label: D12
type: string

tool: D1: spi-hdlc-adapter 0.07 (19:00:45 Mar 15 2022)


tool: D12: Copyright (c) 2017 The OpenThread Authors, All Rights Reserved


assistant: ```c
void print_version(void) {
  printf("spi-hdlc-adapter "
         "0.07"
         " ("
         "19:00:45"
         " "
         "Mar 15 2022"
         ")\n");
  printf("Copyright (c) 2017 The OpenThread Authors, All Rights Reserved\n");
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<print_version>:
  endbr64
  sub    $0x8,%rsp
  lea    D8(%rip),%rdi
  call   <printf@plt>
  lea    D11(%rip),%rdi
  add    $0x8,%rsp
  jmp    1050 <printf@plt>
```

tool_calls: name: extract_symbolic_data
arguments: label: D8
type_guessed: string
name: extract_symbolic_data
arguments: label: D11
type_guessed: string

tool: D8: spi-hdlc-adapter 0.07 (19:00:45 Mar 15 2022)


tool: D11: Copyright (c) 2017 The OpenThread Authors, All Rights Reserved


assistant: ```c
void print_version(void) {
  printf("spi-hdlc-adapter "
         "0.07"
         " ("
         "19:00:45"
         " "
         "Mar 15 2022"
         ")\n");
  printf("Copyright (c) 2017 The OpenThread Authors, All Rights Reserved\n");
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<print_version>:
  endbr64
  sub    $0x8,%rsp
  lea    D8(%rip),%rdi
  call   <printf@plt>
  lea    D16(%rip),%rdi
  add    $0x8,%rsp
  jmp    1050 <printf@plt>
```

tool_calls: name: extract_symbolic_data
arguments: label: D8
type_guessed: string
name: extract_symbolic_data
arguments: label: D16
type_guessed: string

tool: D8: spi-hdlc-adapter 0.07 (19:00:45 Mar 15 2022)


tool: D16: Copyright (c) 2017 The OpenThread Authors, All Rights Reserved


assistant: ```c
void print_version(void) {
  printf("spi-hdlc-adapter "
         "0.07"
         " ("
         "19:00:45"
         " "
         "Mar 15 2022"
         ")\n");
  printf("Copyright (c) 2017 The OpenThread Authors, All Rights Reserved\n");
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<read_uint32>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x4,%edi
  call   <read_msg@plt>
  mov    %eax,-0x4(%rbp)
  cmpl   $0xffffffff,-0x4(%rbp)
  je     L8
  mov    -0x18(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,%edi
  call   <ntohl@plt>
  mov    -0x18(%rbp),%rdx
  mov    %eax,(%rdx)
L8:
  mov    -0x4(%rbp),%eax
  leave
  ret
```

assistant: ```c
ssize_t read_uint32(uint32_t *data) {
  ssize_t r;
  r = read_msg(sizeof(uint32_t), data);
  if (r != -1)
    *data = ntohl(*data);
  return r;
}
```
user: Translate the below assembly code into C programming language:

```asm
<read_uint32>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbp
  mov    %rdi,%rsi
  mov    $0x4,%edi
  call   <read_msg@plt>
  mov    %eax,%ebx
  cmp    $0xffffffff,%eax
  jne    L15
L12:
  mov    %ebx,%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
L15:
  mov    0x0(%rbp),%edi
  call   <ntohl@plt>
  mov    %eax,0x0(%rbp)
  jmp    L12
```

assistant: ```c
ssize_t read_uint32(uint32_t *data) {
  ssize_t r;
  r = read_msg(sizeof(uint32_t), data);
  if (r != -1)
    *data = ntohl(*data);
  return r;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<read_uint32>:
  endbr64
  push   %r12
  mov    %rdi,%rsi
  push   %rbx
  mov    %rdi,%rbx
  mov    $0x4,%edi
  sub    $0x8,%rsp
  call   <read_msg@plt>
  mov    %eax,%r12d
  cmp    $0xffffffff,%eax
  je     L4
  mov    (%rbx),%edi
  call   <ntohl@plt>
  mov    %eax,(%rbx)
L4:
  add    $0x8,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %r12
  ret
```

assistant: ```c
ssize_t read_uint32(uint32_t *data) {
  ssize_t r;
  r = read_msg(sizeof(uint32_t), data);
  if (r != -1)
    *data = ntohl(*data);
  return r;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<read_uint32>:
  endbr64
  push   %r12
  mov    %rdi,%rsi
  push   %rbx
  mov    %rdi,%rbx
  mov    $0x4,%edi
  sub    $0x8,%rsp
  call   <read_msg@plt>
  mov    %eax,%r12d
  cmp    $0xffffffff,%eax
  je     L8
  mov    (%rbx),%edi
  call   <ntohl@plt>
  mov    %eax,(%rbx)
L8:
  add    $0x8,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %r12
  ret
```

assistant: ```c
ssize_t read_uint32(uint32_t *data) {
  ssize_t r;
  r = read_msg(sizeof(uint32_t), data);
  if (r != -1)
    *data = ntohl(*data);
  return r;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<WritePlane>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x34(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %rdx,-0x48(%rbp)
  mov    %ecx,-0x38(%rbp)
  mov    %r8d,-0x4c(%rbp)
  mov    %r9d,-0x50(%rbp)
  mov    -0x50(%rbp),%eax
  sub    -0x38(%rbp),%eax
  mov    %eax,-0x18(%rbp)
  mov    -0x38(%rbp),%eax
  imul   -0x4c(%rbp),%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x48(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x34(%rbp),%eax
  imul   -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x10(%rbp)
  movl   $0x0,-0x20(%rbp)
  jmp    L5
L44:
  movl   $0x0,-0x24(%rbp)
  jmp    L2
L35:
  mov    -0x8(%rbp),%rax
  movss  (%rax),%xmm0
  movss  %xmm0,-0x1c(%rbp)
  pxor   %xmm0,%xmm0
  comiss -0x1c(%rbp),%xmm0
  jbe    L7
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0x1c(%rbp)
L7:
  mov    -0x10(%rbp),%rax
  movss  -0x1c(%rbp),%xmm0
  movss  %xmm0,(%rax)
  addl   $0x1,-0x24(%rbp)
  addq   $0x4,-0x8(%rbp)
  addq   $0x4,-0x10(%rbp)
L2:
  mov    -0x24(%rbp),%eax
  cmp    -0x38(%rbp),%eax
  jl     L35
  addl   $0x1,-0x20(%rbp)
  mov    -0x18(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rax,-0x8(%rbp)
L5:
  mov    -0x20(%rbp),%eax
  cmp    -0x4c(%rbp),%eax
  jl     L44
  nop
  nop
  pop    %rbp
  ret
```

assistant: ```c
void WritePlane(int plane, float *dout, float *din, int w, int h, int indimx, int indimy) {
  int pls, i, j, deltx;
  float *outloc, fval;
  float *inloc;
  deltx = indimx - w;
  pls = w * h;
  inloc = din;
  outloc = dout + plane * pls;
  for (j = 0; j < h; j++, inloc += deltx)
    for (i = 0; i < w; i++, inloc++, outloc++) {
      fval = *inloc;
      if (fval < 0.0)
        fval = 0.0;
      *outloc = fval;
    }
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<WritePlane>:
  endbr64
  push   %rbp
  push   %rbx
  mov    %ecx,%ebx
  sub    %ecx,%r9d
  mov    %ecx,%eax
  imul   %r8d,%eax
  imul   %edi,%eax
  cltq
  lea    (%rsi,%rax,4),%rcx
  test   %r8d,%r8d
  jle    L38
  mov    %rdx,%rsi
  movslq %r9d,%r9
  lea    0x0(,%r9,4),%r11
  lea    -0x1(%rbx),%edi
  lea    0x4(,%rdi,4),%r10
  mov    $0x0,%r9d
  mov    $0x0,%ebp
  pxor   %xmm2,%xmm2
  movaps %xmm2,%xmm3
  jmp    L2
L57:
  mov    %rdx,%rax
L4:
  movss  (%rsi,%rax,4),%xmm0
  movaps %xmm0,%xmm1
  cmpnltss %xmm2,%xmm1
  andps  %xmm1,%xmm0
  andnps %xmm3,%xmm1
  orps   %xmm1,%xmm0
  movss  %xmm0,(%rcx,%rax,4)
  lea    0x1(%rax),%rdx
  cmp    %rax,%rdi
  jne    L57
  add    %r10,%rsi
  add    %r10,%rcx
L43:
  add    $0x1,%r9d
  add    %r11,%rsi
  cmp    %r9d,%r8d
  je     L38
L2:
  mov    %rbp,%rax
  test   %ebx,%ebx
  jg     L4
  jmp    L43
L38:
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
void WritePlane(int plane, float *dout, float *din, int w, int h, int indimx, int indimy) {
  int pls, i, j, deltx;
  float *outloc, fval;
  float *inloc;
  deltx = indimx - w;
  pls = w * h;
  inloc = din;
  outloc = dout + plane * pls;
  for (j = 0; j < h; j++, inloc += deltx)
    for (i = 0; i < w; i++, inloc++, outloc++) {
      fval = *inloc;
      if (fval < 0.0)
        fval = 0.0;
      *outloc = fval;
    }
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<WritePlane>:
  endbr64
  mov    %ecx,%eax
  push   %rbx
  sub    %ecx,%r9d
  mov    %ecx,%ebx
  imul   %r8d,%eax
  imul   %edi,%eax
  cltq
  lea    (%rsi,%rax,4),%rcx
  test   %r8d,%r8d
  jle    L23
  movslq %r9d,%r9
  lea    -0x1(%rbx),%edi
  pxor   %xmm1,%xmm1
  mov    %rdx,%rsi
  lea    0x0(,%r9,4),%r11
  lea    0x4(,%rdi,4),%r10
  xor    %r9d,%r9d
  xchg   %ax,%ax
L27:
  xor    %eax,%eax
  test   %ebx,%ebx
  jg     L25
  jmp    L21
  nopl   0x0(%rax,%rax,1)
L31:
  mov    %rdx,%rax
L25:
  movaps %xmm1,%xmm0
  maxss  (%rsi,%rax,4),%xmm0
  lea    0x1(%rax),%rdx
  movss  %xmm0,(%rcx,%rax,4)
  cmp    %rax,%rdi
  jne    L31
  add    %r10,%rcx
  add    %r10,%rsi
L21:
  add    $0x1,%r9d
  add    %r11,%rsi
  cmp    %r9d,%r8d
  jne    L27
L23:
  pop    %rbx
  ret
```

assistant: ```c
void WritePlane(int plane, float *dout, float *din, int w, int h, int indimx, int indimy) {
  int pls, i, j, deltx;
  float *outloc, fval;
  float *inloc;
  deltx = indimx - w;
  pls = w * h;
  inloc = din;
  outloc = dout + plane * pls;
  for (j = 0; j < h; j++, inloc += deltx)
    for (i = 0; i < w; i++, inloc++, outloc++) {
      fval = *inloc;
      if (fval < 0.0)
        fval = 0.0;
      *outloc = fval;
    }
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<WritePlane>:
  endbr64
  mov    %rdx,%rax
  mov    %ecx,%edx
  sub    %ecx,%r9d
  imul   %r8d,%edx
  imul   %edi,%edx
  movslq %edx,%rdx
  lea    (%rsi,%rdx,4),%rdx
  test   %r8d,%r8d
  jle    L56
  mov    %ecx,%esi
  movslq %r9d,%r9
  test   %ecx,%ecx
  jle    L56
  push   %r15
  lea    -0x1(%rcx),%r10d
  shr    $0x2,%ecx
  pxor   %xmm2,%xmm2
  push   %r14
  sub    $0x1,%ecx
  pxor   %xmm1,%xmm1
  push   %r13
  add    $0x1,%rcx
  mov    %r10,%r13
  push   %r12
  lea    0x1(%r9,%r10,1),%r12
  shl    $0x4,%rcx
  push   %rbp
  mov    %esi,%ebp
  shl    $0x2,%r12
  push   %rbx
  and    $0xfffffffc,%ebp
  mov    %r8d,%ebx
  mov    %esi,%r8d
  lea    0x2(%rbp),%edi
  mov    %ebp,%r11d
  lea    0x1(%rbp),%r15d
  shl    $0x2,%r11
  lea    0x0(,%r8,4),%r14
  mov    %edi,-0xc(%rsp)
  xor    %edi,%edi
  nopw   0x0(%rax,%rax,1)
L29:
  lea    0x4(%rax),%r10
  mov    %rdx,%r9
  sub    %r10,%r9
  cmp    $0x8,%r9
  mov    $0x0,%r9d
  jbe    L103
  cmp    $0x2,%r13d
  jbe    L103
  nopl   0x0(%rax)
L48:
  movups (%rax,%r9,1),%xmm0
  movups (%rax,%r9,1),%xmm3
  cmpltps %xmm1,%xmm0
  andnps %xmm3,%xmm0
  movups %xmm0,(%rdx,%r9,1)
  add    $0x10,%r9
  cmp    %rcx,%r9
  jne    L48
  lea    (%rdx,%r11,1),%r9
  lea    (%rax,%r11,1),%r10
  cmp    %ebp,%esi
  je     L60
  movaps %xmm2,%xmm0
  maxss  (%r10),%xmm0
  movss  %xmm0,(%r9)
  cmp    %r15d,%esi
  jle    L60
  movaps %xmm2,%xmm0
  maxss  0x4(%r10),%xmm0
  movss  %xmm0,0x4(%r9)
  cmp    -0xc(%rsp),%esi
  jle    L60
  movaps %xmm2,%xmm0
  maxss  0x8(%r10),%xmm0
  movss  %xmm0,0x8(%r9)
L60:
  add    $0x1,%edi
  add    %r14,%rdx
  add    %r12,%rax
  cmp    %edi,%ebx
  jne    L29
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L103:
  movaps %xmm2,%xmm0
  maxss  (%rax,%r9,4),%xmm0
  movss  %xmm0,(%rdx,%r9,4)
  add    $0x1,%r9
  cmp    %r9,%r8
  jne    L103
  jmp    L60
L56:
  ret
```

assistant: ```c
void WritePlane(int plane, float *dout, float *din, int w, int h, int indimx, int indimy) {
  int pls, i, j, deltx;
  float *outloc, fval;
  float *inloc;
  deltx = indimx - w;
  pls = w * h;
  inloc = din;
  outloc = dout + plane * pls;
  for (j = 0; j < h; j++, inloc += deltx)
    for (i = 0; i < w; i++, inloc++, outloc++) {
      fval = *inloc;
      if (fval < 0.0)
        fval = 0.0;
      *outloc = fval;
    }
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<_utstring_BuildTable>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  movq   $0x0,-0x10(%rbp)
  mov    -0x10(%rbp),%rax
  sub    $0x1,%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x8(%rbp),%rax
  mov    %rax,(%rdx)
  jmp    L37
L27:
  mov    -0x8(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,-0x8(%rbp)
L24:
  cmpq   $0x0,-0x8(%rbp)
  js     L11
  mov    -0x10(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x8(%rbp),%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  cmp    %al,%dl
  jne    L27
L11:
  addq   $0x1,-0x10(%rbp)
  addq   $0x1,-0x8(%rbp)
  mov    -0x20(%rbp),%rax
  cmp    %rax,-0x10(%rbp)
  jge    L16
  mov    -0x10(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x8(%rbp),%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  cmp    %al,%dl
  jne    L61
  mov    -0x8(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    -0x10(%rbp),%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x28(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%rax
  mov    %rax,(%rdx)
  jmp    L37
L61:
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x8(%rbp),%rax
  mov    %rax,(%rdx)
  jmp    L37
L16:
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x8(%rbp),%rax
  mov    %rax,(%rdx)
L37:
  mov    -0x20(%rbp),%rax
  cmp    %rax,-0x10(%rbp)
  jl     L24
  nop
  pop    %rbp
  ret
```

assistant: ```c
__attribute__((__unused__)) void _utstring_BuildTable(const char *P_Needle, size_t P_NeedleLen, long *P_KMP_Table) {
  long i, j;
  i = 0;
  j = i - 1;
  P_KMP_Table[i] = j;
  while (i < (long)P_NeedleLen) {
    while ((j > -1) && (P_Needle[i] != P_Needle[j])) {
      j = P_KMP_Table[j];
    }
    i++;
    j++;
    if (i < (long)P_NeedleLen) {
      if (P_Needle[i] == P_Needle[j]) {
        P_KMP_Table[i] = P_KMP_Table[j];
      } else {
        P_KMP_Table[i] = j;
      }
    } else {
      P_KMP_Table[i] = j;
    }
  }
  return;
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<_utstring_BuildTable>:
  endbr64
  movq   $0xffffffffffffffff,(%rdx)
  mov    $0x0,%r8d
  mov    $0xffffffffffffffff,%rax
  test   %rsi,%rsi
  jg     L32
  ret
L70:
  mov    (%rdx,%rax,8),%rcx
  mov    %rcx,(%rdx,%r8,8)
  jmp    L68
L3:
  mov    %rax,(%rdx,%r8,8)
  je     L80
L68:
  test   %rax,%rax
  js     L32
  movzbl (%rdi,%r8,1),%ecx
L83:
  cmp    (%rdi,%rax,1),%cl
  je     L32
  mov    (%rdx,%rax,8),%rax
  test   %rax,%rax
  jns    L83
L32:
  add    $0x1,%r8
  add    $0x1,%rax
  cmp    %rsi,%r8
  jge    L3
  movzbl (%rdi,%rax,1),%ecx
  cmp    %cl,(%rdi,%r8,1)
  je     L70
  mov    %rax,(%rdx,%r8,8)
  jmp    L68
L80:
  ret
```

assistant: ```c
__attribute__((__unused__)) void _utstring_BuildTable(const char *P_Needle, size_t P_NeedleLen, long *P_KMP_Table) {
  long i, j;
  i = 0;
  j = i - 1;
  P_KMP_Table[i] = j;
  while (i < (long)P_NeedleLen) {
    while ((j > -1) && (P_Needle[i] != P_Needle[j])) {
      j = P_KMP_Table[j];
    }
    i++;
    j++;
    if (i < (long)P_NeedleLen) {
      if (P_Needle[i] == P_Needle[j]) {
        P_KMP_Table[i] = P_KMP_Table[j];
      } else {
        P_KMP_Table[i] = j;
      }
    } else {
      P_KMP_Table[i] = j;
    }
  }
  return;
}
```