ylfeng/ReF-Decompile-dataset huggingface dataset:
user: Translate the below assembly code into C programming language:

```asm
<rgb482rgb>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r12
  push   %rbx
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    -0x28(%rbp),%rax
  lea    (%rax,%rax,1),%edx
  mov    -0x28(%rbp),%rax
  add    %edx,%eax
  add    %eax,%eax
  sub    $0x1,%eax
  mov    %eax,%ebx
  mov    -0x28(%rbp),%rax
  lea    (%rax,%rax,1),%edx
  mov    -0x28(%rbp),%rax
  add    %edx,%eax
  sub    $0x1,%eax
  mov    %eax,%r12d
  jmp    L19
L3:
  sub    $0x1,%ebx
  mov    %ebx,%eax
  lea    -0x1(%rax),%ebx
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    %r12d,%edx
  lea    -0x1(%rdx),%r12d
  movslq %edx,%rcx
  mov    -0x20(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  sub    $0x1,%ebx
  mov    %ebx,%eax
  lea    -0x1(%rax),%ebx
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    %r12d,%edx
  lea    -0x1(%rdx),%r12d
  movslq %edx,%rcx
  mov    -0x20(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  sub    $0x1,%ebx
  mov    %ebx,%eax
  lea    -0x1(%rax),%ebx
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    %r12d,%edx
  lea    -0x1(%rdx),%r12d
  movslq %edx,%rcx
  mov    -0x20(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
L19:
  test   %ebx,%ebx
  jg     L3
  nop
  nop
  pop    %rbx
  pop    %r12
  pop    %rbp
  ret
```

assistant: ```c
void rgb482rgb(unsigned char *src, unsigned char *dest, unsigned long long int NumPixels) {
  register int i = ((NumPixels + (NumPixels << 1)) << 1) - 1;
  register int j = NumPixels + (NumPixels << 1) - 1;
  while (i > 0) {
    i--;
    dest[j--] = src[i--];
    i--;
    dest[j--] = src[i--];
    i--;
    dest[j--] = src[i--];
  }
}
```
user: Translate the below assembly code into C programming language:

```asm
<rgb482rgb>:
  endbr64
  lea    (%rdx,%rdx,2),%edx
  lea    -0x1(%rdx,%rdx,1),%eax
  sub    $0x1,%edx
  test   %eax,%eax
  jle    L11
  cltq
  movslq %edx,%rdx
  add    %rdx,%rsi
L2:
  movzbl -0x1(%rdi,%rax,1),%edx
  mov    %dl,(%rsi)
  movzbl -0x3(%rdi,%rax,1),%edx
  mov    %dl,-0x1(%rsi)
  movzbl -0x5(%rdi,%rax,1),%edx
  mov    %dl,-0x2(%rsi)
  sub    $0x6,%rax
  sub    $0x3,%rsi
  test   %eax,%eax
  jg     L2
L11:
  ret
```

assistant: ```c
void rgb482rgb(unsigned char *src, unsigned char *dest, unsigned long long int NumPixels) {
  register int i = ((NumPixels + (NumPixels << 1)) << 1) - 1;
  register int j = NumPixels + (NumPixels << 1) - 1;
  while (i > 0) {
    i--;
    dest[j--] = src[i--];
    i--;
    dest[j--] = src[i--];
    i--;
    dest[j--] = src[i--];
  }
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<rgb482rgb>:
  endbr64
  lea    (%rdx,%rdx,2),%edx
  lea    -0x1(%rdx,%rdx,1),%eax
  sub    $0x1,%edx
  test   %eax,%eax
  jle    L9
  movslq %edx,%rdx
  cltq
  add    %rdx,%rsi
  nopw   0x0(%rax,%rax,1)
L16:
  movzbl -0x1(%rdi,%rax,1),%edx
  sub    $0x3,%rsi
  mov    %dl,0x3(%rsi)
  movzbl -0x3(%rdi,%rax,1),%edx
  mov    %dl,0x2(%rsi)
  movzbl -0x5(%rdi,%rax,1),%edx
  sub    $0x6,%rax
  mov    %dl,0x1(%rsi)
  test   %eax,%eax
  jg     L16
L9:
  ret
```

assistant: ```c
void rgb482rgb(unsigned char *src, unsigned char *dest, unsigned long long int NumPixels) {
  register int i = ((NumPixels + (NumPixels << 1)) << 1) - 1;
  register int j = NumPixels + (NumPixels << 1) - 1;
  while (i > 0) {
    i--;
    dest[j--] = src[i--];
    i--;
    dest[j--] = src[i--];
    i--;
    dest[j--] = src[i--];
  }
}
```
user: Translate the below assembly code into C programming language:

```asm
<rgb482rgb>:
  endbr64
  lea    (%rdx,%rdx,2),%edx
  lea    -0x1(%rdx,%rdx,1),%eax
  sub    $0x1,%edx
  test   %eax,%eax
  jle    L13
  movslq %edx,%rdx
  cltq
  add    %rdx,%rsi
  nopw   0x0(%rax,%rax,1)
L3:
  movzbl -0x1(%rdi,%rax,1),%edx
  sub    $0x3,%rsi
  mov    %dl,0x3(%rsi)
  movzbl -0x3(%rdi,%rax,1),%edx
  mov    %dl,0x2(%rsi)
  movzbl -0x5(%rdi,%rax,1),%edx
  sub    $0x6,%rax
  mov    %dl,0x1(%rsi)
  test   %eax,%eax
  jg     L3
L13:
  ret
```

assistant: ```c
void rgb482rgb(unsigned char *src, unsigned char *dest, unsigned long long int NumPixels) {
  register int i = ((NumPixels + (NumPixels << 1)) << 1) - 1;
  register int j = NumPixels + (NumPixels << 1) - 1;
  while (i > 0) {
    i--;
    dest[j--] = src[i--];
    i--;
    dest[j--] = src[i--];
    i--;
    dest[j--] = src[i--];
  }
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<integritaet_speziell>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  subq   $0x18,-0x10(%rbp)
  lea    D45(%rip),%rax
  mov    %rax,%rdi
  call   <nixtrace@plt>
  mov    -0x10(%rbp),%rax
  add    $0xc,%rax
  mov    $0xc,%edx
  lea    D31(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcmp@plt>
  test   %rax,%rax
  je     L16
  lea    D16(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  lea    D19(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x14,%edi
  call   <exit@plt>
L16:
  mov    -0x10(%rbp),%rax
  mov    0x8(%rax),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  lea    0x18(%rax),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    $0xc,%edx
  lea    D31(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcmp@plt>
  test   %rax,%rax
  je     L15
  lea    D16(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  lea    D48(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x14,%edi
  call   <exit@plt>
  nop
L15:
  nop
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: data_tag: D45
type_guessed: string
name: disassemble_data
arguments: data_tag: D31
type_guessed: string
name: disassemble_data
arguments: data_tag: D16
type_guessed: string
name: disassemble_data
arguments: data_tag: D19
type_guessed: string
name: disassemble_data
arguments: data_tag: D48
type_guessed: string

tool: D45: Pruefung der Integritaet


tool: D31: <0123456789>

tool: D16: integritaet_speziell - schrecklicher Speicherfehler


tool: D19: Bereich vor Datenblock zerstoert


tool: D48: Bereich nach Datenblock zerstoert


assistant: ```c
void integritaet_speziell(void *palt) {
  char *p;
  long size_lfd;
  p = palt;
  p -= 24;
  nixtrace("Pruefung der Integritaet\n");
  if (memcmp(p + 12, "<0123456789>", 12) != 0) {
    printf("integritaet_speziell - schrecklicher Speicherfehler\n");
    printf("Bereich vor Datenblock zerstoert\n");
    exit(20);
  }
  size_lfd = *((long *)(p + 8));
  if (memcmp(p + 24 + size_lfd, "<0123456789>", 12) != 0) {
    printf("integritaet_speziell - schrecklicher Speicherfehler\n");
    printf("Bereich nach Datenblock zerstoert\n");
    exit(20);
  }
  return;
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<integritaet_speziell>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  lea    D7(%rip),%rdi
  call   <nixtrace@plt>
  lea    -0xc(%rbx),%rdi
  mov    $0xc,%edx
  lea    D42(%rip),%rsi
  call   <memcmp@plt>
  test   %rax,%rax
  jne    L0
L15:
  add    -0x10(%rbx),%rbx
  mov    %rbx,%rdi
  mov    $0xc,%edx
  lea    D42(%rip),%rsi
  call   <memcmp@plt>
  test   %rax,%rax
  jne    L8
L9:
  pop    %rbx
  ret
L0:
  lea    D13(%rip),%rdi
  call   <printf@plt>
  lea    D32(%rip),%rdi
  call   <printf@plt>
  mov    $0x14,%edi
  call   <exit@plt>
  jmp    L15
L8:
  lea    D13(%rip),%rdi
  call   <printf@plt>
  lea    D12(%rip),%rdi
  call   <printf@plt>
  mov    $0x14,%edi
  call   <exit@plt>
  jmp    L9
```

tool_calls: name: unpack_data
arguments: data_label: D7
data_type: string
name: unpack_data
arguments: data_label: D42
data_type: string
name: unpack_data
arguments: data_label: D13
data_type: string
name: unpack_data
arguments: data_label: D32
data_type: string
name: unpack_data
arguments: data_label: D12
data_type: string

tool: D7: Pruefung der Integritaet


tool: D42: <0123456789>

tool: D13: integritaet_speziell - schrecklicher Speicherfehler


tool: D32: Bereich vor Datenblock zerstoert


tool: D12: Bereich nach Datenblock zerstoert


assistant: ```c
void integritaet_speziell(void *palt) {
  char *p;
  long size_lfd;
  p = palt;
  p -= 24;
  nixtrace("Pruefung der Integritaet\n");
  if (memcmp(p + 12, "<0123456789>", 12) != 0) {
    printf("integritaet_speziell - schrecklicher Speicherfehler\n");
    printf("Bereich vor Datenblock zerstoert\n");
    exit(20);
  }
  size_lfd = *((long *)(p + 8));
  if (memcmp(p + 24 + size_lfd, "<0123456789>", 12) != 0) {
    printf("integritaet_speziell - schrecklicher Speicherfehler\n");
    printf("Bereich nach Datenblock zerstoert\n");
    exit(20);
  }
  return;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<integritaet_speziell>:
  endbr64
  push   %rbp
  lea    D47(%rip),%rbp
  push   %rbx
  mov    %rdi,%rbx
  lea    D17(%rip),%rdi
  sub    $0x8,%rsp
  call   <nixtrace@plt>
  lea    -0xc(%rbx),%rdi
  mov    $0xc,%edx
  mov    %rbp,%rsi
  call   <memcmp@plt>
  test   %rax,%rax
  jne    L27
L17:
  add    -0x10(%rbx),%rbx
  mov    $0xc,%edx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <memcmp@plt>
  test   %rax,%rax
  jne    L23
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
  cs nopw 0x0(%rax,%rax,1)
L27:
  lea    D27(%rip),%rdi
  call   <printf@plt>
  lea    D14(%rip),%rdi
  call   <printf@plt>
  mov    $0x14,%edi
  call   <exit@plt>
  jmp    L17
  nopl   0x0(%rax)
L23:
  lea    D27(%rip),%rdi
  call   <printf@plt>
  lea    D39(%rip),%rdi
  call   <printf@plt>
  add    $0x8,%rsp
  mov    $0x14,%edi
  pop    %rbx
  pop    %rbp
  jmp    10a0 <exit@plt>
```

tool_calls: name: disassemble_data
arguments: data_label: D47
data_type: string
name: disassemble_data
arguments: data_label: D17
data_type: string
name: disassemble_data
arguments: data_label: D27
data_type: string
name: disassemble_data
arguments: data_label: D14
data_type: string
name: disassemble_data
arguments: data_label: D39
data_type: string

tool: D47: <0123456789>

tool: D17: Pruefung der Integritaet


tool: D27: integritaet_speziell - schrecklicher Speicherfehler


tool: D14: Bereich vor Datenblock zerstoert


tool: D39: Bereich nach Datenblock zerstoert


assistant: ```c
void integritaet_speziell(void *palt) {
  char *p;
  long size_lfd;
  p = palt;
  p -= 24;
  nixtrace("Pruefung der Integritaet\n");
  if (memcmp(p + 12, "<0123456789>", 12) != 0) {
    printf("integritaet_speziell - schrecklicher Speicherfehler\n");
    printf("Bereich vor Datenblock zerstoert\n");
    exit(20);
  }
  size_lfd = *((long *)(p + 8));
  if (memcmp(p + 24 + size_lfd, "<0123456789>", 12) != 0) {
    printf("integritaet_speziell - schrecklicher Speicherfehler\n");
    printf("Bereich nach Datenblock zerstoert\n");
    exit(20);
  }
  return;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<integritaet_speziell>:
  endbr64
  push   %rbp
  lea    D39(%rip),%rbp
  push   %rbx
  mov    %rdi,%rbx
  lea    D20(%rip),%rdi
  sub    $0x8,%rsp
  call   <nixtrace@plt>
  lea    -0xc(%rbx),%rdi
  mov    $0xc,%edx
  mov    %rbp,%rsi
  call   <memcmp@plt>
  test   %rax,%rax
  jne    L27
L12:
  add    -0x10(%rbx),%rbx
  mov    $0xc,%edx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <memcmp@plt>
  test   %rax,%rax
  jne    L25
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
  cs nopw 0x0(%rax,%rax,1)
L27:
  lea    D56(%rip),%rdi
  call   <printf@plt>
  lea    D40(%rip),%rdi
  call   <printf@plt>
  mov    $0x14,%edi
  call   <exit@plt>
  jmp    L12
  nopl   0x0(%rax)
L25:
  lea    D56(%rip),%rdi
  call   <printf@plt>
  lea    D49(%rip),%rdi
  call   <printf@plt>
  add    $0x8,%rsp
  mov    $0x14,%edi
  pop    %rbx
  pop    %rbp
  jmp    10a0 <exit@plt>
```

tool_calls: name: disassemble_data
arguments: label: D39
type: string
name: disassemble_data
arguments: label: D20
type: string
name: disassemble_data
arguments: label: D56
type: string
name: disassemble_data
arguments: label: D40
type: string
name: disassemble_data
arguments: label: D49
type: string

tool: D39: <0123456789>

tool: D20: Pruefung der Integritaet


tool: D56: integritaet_speziell - schrecklicher Speicherfehler


tool: D40: Bereich vor Datenblock zerstoert


tool: D49: Bereich nach Datenblock zerstoert


assistant: ```c
void integritaet_speziell(void *palt) {
  char *p;
  long size_lfd;
  p = palt;
  p -= 24;
  nixtrace("Pruefung der Integritaet\n");
  if (memcmp(p + 12, "<0123456789>", 12) != 0) {
    printf("integritaet_speziell - schrecklicher Speicherfehler\n");
    printf("Bereich vor Datenblock zerstoert\n");
    exit(20);
  }
  size_lfd = *((long *)(p + 8));
  if (memcmp(p + 24 + size_lfd, "<0123456789>", 12) != 0) {
    printf("integritaet_speziell - schrecklicher Speicherfehler\n");
    printf("Bereich nach Datenblock zerstoert\n");
    exit(20);
  }
  return;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<vp8_blit_line>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %edi,%ebx
  mov    %esi,%r13d
  mov    %edx,%r12d
  mov    %ecx,%eax
  mov    %r8,%r14
  mov    %r9d,%r15d
  mov    %ecx,%edx
  sub    %r12d,%edx
  mov    %edx,%edi
  neg    %edi
  cmovs  %edx,%edi
  mov    %esi,%ecx
  sub    %ebx,%ecx
  mov    %ecx,%edx
  neg    %edx
  cmovs  %ecx,%edx
  cmp    %edx,%edi
  jle    L6
  mov    %eax,%r13d
  mov    %esi,%eax
  mov    %ebx,%ecx
  mov    %r12d,%ebx
  mov    %ecx,%r12d
L6:
  cmp    %r13d,%ebx
  jle    L106
  mov    %r12d,%ecx
  mov    %eax,%r12d
  mov    %ecx,%eax
  mov    %ebx,%ecx
  mov    %r13d,%ebx
  mov    %ecx,%r13d
L106:
  mov    %r13d,%r10d
  sub    %ebx,%r10d
  mov    %r10d,0xc(%rsp)
  mov    %eax,%ecx
  sub    %r12d,%ecx
  mov    %ecx,%esi
  neg    %esi
  cmovns %esi,%ecx
  mov    %ecx,0x4(%rsp)
  mov    %r10d,%ebp
  shr    $0x1f,%ebp
  add    %r10d,%ebp
  sar    %ebp
  cmp    %eax,%r12d
  setl   %al
  movzbl %al,%eax
  lea    -0x1(%rax,%rax,1),%eax
  mov    %eax,0x8(%rsp)
  cmp    %edx,%edi
  jg     L16
  cmp    %r13d,%ebx
  jle    L85
L79:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L16:
  cmp    %r13d,%ebx
  jle    L100
  jmp    L79
L72:
  add    $0x1,%ebx
  cmp    %ebx,%r13d
  jl     L79
L100:
  mov    %r15d,%ecx
  mov    %r14,%rdx
  mov    %ebx,%esi
  mov    %r12d,%edi
  call   <plot@plt>
  sub    0x4(%rsp),%ebp
  jns    L72
  add    0x8(%rsp),%r12d
  add    0xc(%rsp),%ebp
  jmp    L72
L48:
  add    $0x1,%ebx
  cmp    %ebx,%r13d
  jl     L79
L85:
  mov    %r15d,%ecx
  mov    %r14,%rdx
  mov    %r12d,%esi
  mov    %ebx,%edi
  call   <plot@plt>
  sub    0x4(%rsp),%ebp
  jns    L48
  add    0x8(%rsp),%r12d
  add    0xc(%rsp),%ebp
  jmp    L48
```

assistant: ```c
void vp8_blit_line(int x0, int x1, int y0, int y1, unsigned char *image, const int pitch) {
  int steep = abs(y1 - y0) > abs(x1 - x0);
  int deltax, deltay;
  int error, ystep, y, x;
  if (steep) {
    int t;
    t = x0;
    x0 = y0;
    y0 = t;
    t = x1;
    x1 = y1;
    y1 = t;
  }
  if (x0 > x1) {
    int t;
    t = x0;
    x0 = x1;
    x1 = t;
    t = y0;
    y0 = y1;
    y1 = t;
  }
  deltax = x1 - x0;
  deltay = abs(y1 - y0);
  error = deltax / 2;
  y = y0;
  if (y0 < y1)
    ystep = 1;
  else
    ystep = -1;
  if (steep) {
    for (x = x0; x <= x1; x++) {
      plot(y, x, image, pitch);
      error = error - deltay;
      if (error < 0) {
        y = y + ystep;
        error = error + deltax;
      }
    }
  } else {
    for (x = x0; x <= x1; x++) {
      plot(x, y, image, pitch);
      error = error - deltay;
      if (error < 0) {
        y = y + ystep;
        error = error + deltax;
      }
    }
  }
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<vp8_blit_line>:
  endbr64
  push   %r15
  mov    %ecx,%eax
  mov    %edi,%r15d
  push   %r14
  push   %r13
  mov    %r9d,%r13d
  push   %r12
  mov    %r8,%r12
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  mov    %edx,%ebx
  mov    %ecx,%edx
  sub    %ebx,%edx
  mov    %edx,%ecx
  sub    $0x18,%rsp
  neg    %ecx
  cmovs  %edx,%ecx
  sub    %edi,%esi
  mov    %esi,%edx
  neg    %edx
  cmovs  %esi,%edx
  cmp    %edx,%ecx
  jle    L39
  mov    %ebp,%esi
  mov    %ebx,%r15d
  mov    %eax,%ebp
  mov    %edi,%ebx
  mov    %esi,%eax
L39:
  cmp    %ebp,%r15d
  jle    L18
  mov    %ebx,%esi
  mov    %eax,%ebx
  mov    %esi,%eax
  mov    %r15d,%esi
  mov    %ebp,%r15d
  mov    %esi,%ebp
L18:
  mov    %eax,%esi
  mov    %ebp,%r10d
  sub    %ebx,%esi
  sub    %r15d,%r10d
  mov    %esi,%edi
  mov    %r10d,%r8d
  mov    %r10d,0xc(%rsp)
  neg    %edi
  cmovns %edi,%esi
  shr    $0x1f,%r8d
  add    %r10d,%r8d
  sar    %r8d
  cmp    %eax,%ebx
  mov    %esi,0x4(%rsp)
  setl   %al
  mov    %r8d,%r14d
  movzbl %al,%eax
  lea    -0x1(%rax,%rax,1),%eax
  mov    %eax,0x8(%rsp)
  cmp    %edx,%ecx
  jg     L62
  cmp    %ebp,%r15d
  jg     L71
  nopw   0x0(%rax,%rax,1)
L32:
  mov    %r13d,%ecx
  mov    %r12,%rdx
  mov    %ebx,%esi
  mov    %r15d,%edi
  call   <plot@plt>
  sub    0x4(%rsp),%r14d
  jns    L26
  add    0x8(%rsp),%ebx
  add    0xc(%rsp),%r14d
L26:
  add    $0x1,%r15d
  cmp    %r15d,%ebp
  jge    L32
L71:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L62:
  cmp    %ebp,%r15d
  jg     L71
  nopl   (%rax)
L48:
  mov    %r13d,%ecx
  mov    %r12,%rdx
  mov    %r15d,%esi
  mov    %ebx,%edi
  call   <plot@plt>
  sub    0x4(%rsp),%r14d
  jns    L55
  add    0x8(%rsp),%ebx
  add    0xc(%rsp),%r14d
L55:
  add    $0x1,%r15d
  cmp    %r15d,%ebp
  jge    L48
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void vp8_blit_line(int x0, int x1, int y0, int y1, unsigned char *image, const int pitch) {
  int steep = abs(y1 - y0) > abs(x1 - x0);
  int deltax, deltay;
  int error, ystep, y, x;
  if (steep) {
    int t;
    t = x0;
    x0 = y0;
    y0 = t;
    t = x1;
    x1 = y1;
    y1 = t;
  }
  if (x0 > x1) {
    int t;
    t = x0;
    x0 = x1;
    x1 = t;
    t = y0;
    y0 = y1;
    y1 = t;
  }
  deltax = x1 - x0;
  deltay = abs(y1 - y0);
  error = deltax / 2;
  y = y0;
  if (y0 < y1)
    ystep = 1;
  else
    ystep = -1;
  if (steep) {
    for (x = x0; x <= x1; x++) {
      plot(y, x, image, pitch);
      error = error - deltay;
      if (error < 0) {
        y = y + ystep;
        error = error + deltax;
      }
    }
  } else {
    for (x = x0; x <= x1; x++) {
      plot(x, y, image, pitch);
      error = error - deltay;
      if (error < 0) {
        y = y + ystep;
        error = error + deltax;
      }
    }
  }
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<vp8_blit_line>:
  endbr64
  push   %r15
  mov    %edi,%r15d
  mov    %ecx,%eax
  push   %r14
  push   %r13
  mov    %r9d,%r13d
  push   %r12
  mov    %r8,%r12
  push   %rbp
  mov    %esi,%ebp
  mov    %ecx,%esi
  push   %rbx
  sub    %edx,%esi
  mov    %edx,%ebx
  mov    %ebp,%edi
  mov    %esi,%edx
  sub    $0x18,%rsp
  neg    %edx
  cmovs  %esi,%edx
  sub    %r15d,%edi
  mov    %edi,%ecx
  mov    %edi,0x8(%rsp)
  neg    %ecx
  mov    %edx,0x4(%rsp)
  cmovs  %edi,%ecx
  cmp    %ecx,%edx
  jle    L77
  mov    %esi,0x8(%rsp)
  mov    %ebp,%esi
  mov    %eax,%ebp
  mov    %ecx,0x4(%rsp)
  mov    %esi,%eax
  mov    %r15d,%esi
  mov    %ebx,%r15d
  mov    %esi,%ebx
L77:
  cmp    %ebp,%r15d
  jle    L10
  mov    %r15d,%edi
  mov    %ebx,%esi
  sub    %ebp,%edi
  sub    %eax,%esi
  mov    %edi,0x8(%rsp)
  mov    %esi,%edi
  neg    %edi
  cmovns %edi,%esi
  mov    %esi,0x4(%rsp)
  mov    %ebx,%esi
  mov    %eax,%ebx
  mov    %esi,%eax
  mov    %r15d,%esi
  mov    %ebp,%r15d
  mov    %esi,%ebp
L10:
  mov    0x8(%rsp),%esi
  mov    %esi,%r8d
  shr    $0x1f,%r8d
  add    %esi,%r8d
  sar    %r8d
  cmp    %eax,%ebx
  setl   %al
  mov    %r8d,%r14d
  movzbl %al,%eax
  lea    -0x1(%rax,%rax,1),%eax
  mov    %eax,0xc(%rsp)
  cmp    %ecx,%edx
  jg     L2
  cmp    %ebp,%r15d
  jg     L66
  nopw   0x0(%rax,%rax,1)
L41:
  mov    %r13d,%ecx
  mov    %r12,%rdx
  mov    %ebx,%esi
  mov    %r15d,%edi
  call   <plot@plt>
  sub    0x4(%rsp),%r14d
  jns    L18
  add    0xc(%rsp),%ebx
  add    0x8(%rsp),%r14d
L18:
  add    $0x1,%r15d
  cmp    %r15d,%ebp
  jge    L41
L66:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L2:
  cmp    %ebp,%r15d
  jg     L66
  nopl   (%rax)
L59:
  mov    %r13d,%ecx
  mov    %r12,%rdx
  mov    %r15d,%esi
  mov    %ebx,%edi
  call   <plot@plt>
  sub    0x4(%rsp),%r14d
  jns    L82
  add    0xc(%rsp),%ebx
  add    0x8(%rsp),%r14d
L82:
  add    $0x1,%r15d
  cmp    %r15d,%ebp
  jge    L59
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void vp8_blit_line(int x0, int x1, int y0, int y1, unsigned char *image, const int pitch) {
  int steep = abs(y1 - y0) > abs(x1 - x0);
  int deltax, deltay;
  int error, ystep, y, x;
  if (steep) {
    int t;
    t = x0;
    x0 = y0;
    y0 = t;
    t = x1;
    x1 = y1;
    y1 = t;
  }
  if (x0 > x1) {
    int t;
    t = x0;
    x0 = x1;
    x1 = t;
    t = y0;
    y0 = y1;
    y1 = t;
  }
  deltax = x1 - x0;
  deltay = abs(y1 - y0);
  error = deltax / 2;
  y = y0;
  if (y0 < y1)
    ystep = 1;
  else
    ystep = -1;
  if (steep) {
    for (x = x0; x <= x1; x++) {
      plot(y, x, image, pitch);
      error = error - deltay;
      if (error < 0) {
        y = y + ystep;
        error = error + deltax;
      }
    }
  } else {
    for (x = x0; x <= x1; x++) {
      plot(x, y, image, pitch);
      error = error - deltay;
      if (error < 0) {
        y = y + ystep;
        error = error + deltax;
      }
    }
  }
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<selecte>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %edx,-0x20(%rbp)
  mov    %ecx,-0x24(%rbp)
  mov    -0x1c(%rbp),%eax
  cmp    -0x20(%rbp),%eax
  jne    L33
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  jmp    L5
L33:
  mov    -0x20(%rbp),%edx
  mov    -0x1c(%rbp),%ecx
  mov    -0x18(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <part@plt>
  mov    %eax,-0x8(%rbp)
  mov    -0x8(%rbp),%eax
  sub    -0x1c(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%edx
  mov    -0x24(%rbp),%eax
  mov    %eax,%esi
  lea    D2(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    -0x24(%rbp),%eax
  cmp    -0x4(%rbp),%eax
  jg     L9
  mov    -0x24(%rbp),%ecx
  mov    -0x8(%rbp),%edx
  mov    -0x1c(%rbp),%esi
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <selecte>
  jmp    L5
L9:
  mov    -0x24(%rbp),%eax
  sub    -0x4(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%esi
  mov    -0x20(%rbp),%edx
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <selecte>
L5:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: label: D2
datatype: string

tool: D2: 
%d %d

assistant: ```c
int selecte(int *a, int p, int r, int i) {
  if (p == r)
    return *(a + p);
  int q = part(a, p, r);
  int k = q - p + 1;
  printf("\n%d %d", i, k);
  if (i <= k)
    return selecte(a, p, q, i);
  else
    return selecte(a, q + 1, r, i - k);
}
```