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

```asm
<vec2_round>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    -0x20(%rbp),%rax
  mov    (%rax),%eax
  movd   %eax,%xmm0
  call   <roundf@plt>
  movd   %xmm0,%eax
  mov    -0x18(%rbp),%rdx
  mov    %eax,(%rdx)
  mov    -0x20(%rbp),%rax
  add    $0x4,%rax
  mov    (%rax),%eax
  mov    -0x18(%rbp),%rdx
  lea    0x4(%rdx),%rbx
  movd   %eax,%xmm0
  call   <roundf@plt>
  movd   %xmm0,%eax
  mov    %eax,(%rbx)
  mov    -0x18(%rbp),%rax
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
float *vec2_round(float *result, float *a) {
  result[0] = roundf(a[0]);
  result[1] = roundf(a[1]);
  return result;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<vec2_round>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbx
  mov    %rsi,%rbp
  movss  (%rsi),%xmm0
  call   <roundf@plt>
  movss  %xmm0,(%rbx)
  movss  0x4(%rbp),%xmm0
  call   <roundf@plt>
  movss  %xmm0,0x4(%rbx)
  mov    %rbx,%rax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
float *vec2_round(float *result, float *a) {
  result[0] = roundf(a[0]);
  result[1] = roundf(a[1]);
  return result;
}
```
user: What is the c source code of the assembly code below:

```asm
<vec2_round>:
  endbr64
  push   %r12
  mov    %rdi,%r12
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x8,%rsp
  movss  (%rsi),%xmm0
  call   <roundf@plt>
  movss  %xmm0,(%r12)
  movss  0x4(%rbx),%xmm0
  call   <roundf@plt>
  mov    %r12,%rax
  movss  %xmm0,0x4(%r12)
  add    $0x8,%rsp
  pop    %rbx
  pop    %r12
  ret
```

assistant: ```c
float *vec2_round(float *result, float *a) {
  result[0] = roundf(a[0]);
  result[1] = roundf(a[1]);
  return result;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<vec2_round>:
  endbr64
  push   %r12
  mov    %rdi,%r12
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x8,%rsp
  movss  (%rsi),%xmm0
  call   <roundf@plt>
  movss  %xmm0,(%r12)
  movss  0x4(%rbx),%xmm0
  call   <roundf@plt>
  mov    %r12,%rax
  movss  %xmm0,0x4(%r12)
  add    $0x8,%rsp
  pop    %rbx
  pop    %r12
  ret
```

assistant: ```c
float *vec2_round(float *result, float *a) {
  result[0] = roundf(a[0]);
  result[1] = roundf(a[1]);
  return result;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<wypisz_tab>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L10
L12:
  mov    -0x4(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x4(%rbp)
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,%esi
  lea    D8(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L10:
  mov    -0x4(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jl     L12
  mov    $0xa,%edi
  call   <putchar@plt>
  nop
  leave
  ret
```

tool_calls: name: parse_data
arguments: tag: D8
data_type: string

tool: D8: %d 

assistant: ```c
void wypisz_tab(int tab[], int size) {
  int i;
  for (i = 0; i < size;)
    printf("%d ", tab[i++]);
  printf("\n");
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<wypisz_tab>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  test   %esi,%esi
  jle    L18
  mov    %rdi,%rbx
  lea    -0x1(%rsi),%eax
  lea    0x4(%rdi,%rax,4),%r12
  lea    D5(%rip),%rbp
L5:
  mov    (%rbx),%esi
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  add    $0x4,%rbx
  cmp    %r12,%rbx
  jne    L5
L18:
  mov    $0xa,%edi
  call   <putchar@plt>
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
```

tool_calls: name: extract_symbolic_data
arguments: tag: D5
type: string

tool: D5: %d 

assistant: ```c
void wypisz_tab(int tab[], int size) {
  int i;
  for (i = 0; i < size;)
    printf("%d ", tab[i++]);
  printf("\n");
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<wypisz_tab>:
  endbr64
  test   %esi,%esi
  jle    L14
  lea    -0x1(%rsi),%eax
  push   %r12
  lea    0x4(%rdi,%rax,4),%r12
  push   %rbp
  lea    D1(%rip),%rbp
  push   %rbx
  mov    %rdi,%rbx
  xchg   %ax,%ax
L7:
  mov    (%rbx),%esi
  mov    %rbp,%rdi
  xor    %eax,%eax
  add    $0x4,%rbx
  call   <printf@plt>
  cmp    %r12,%rbx
  jne    L7
  pop    %rbx
  mov    $0xa,%edi
  pop    %rbp
  pop    %r12
  jmp    1060 <putchar@plt>
  nopl   0x0(%rax,%rax,1)
L14:
  mov    $0xa,%edi
  jmp    1060 <putchar@plt>
```

tool_calls: name: unpack_data
arguments: tag: D1
datatype: string

tool: D1: %d 

assistant: ```c
void wypisz_tab(int tab[], int size) {
  int i;
  for (i = 0; i < size;)
    printf("%d ", tab[i++]);
  printf("\n");
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<wypisz_tab>:
  endbr64
  test   %esi,%esi
  jle    L15
  lea    -0x1(%rsi),%eax
  push   %r12
  lea    0x4(%rdi,%rax,4),%r12
  push   %rbp
  lea    D9(%rip),%rbp
  push   %rbx
  mov    %rdi,%rbx
  xchg   %ax,%ax
L9:
  mov    (%rbx),%esi
  mov    %rbp,%rdi
  xor    %eax,%eax
  add    $0x4,%rbx
  call   <printf@plt>
  cmp    %r12,%rbx
  jne    L9
  pop    %rbx
  mov    $0xa,%edi
  pop    %rbp
  pop    %r12
  jmp    1060 <putchar@plt>
  nopl   0x0(%rax,%rax,1)
L15:
  mov    $0xa,%edi
  jmp    1060 <putchar@plt>
```

tool_calls: name: read_data
arguments: label: D9
type: string

tool: D9: %d 

assistant: ```c
void wypisz_tab(int tab[], int size) {
  int i;
  for (i = 0; i < size;)
    printf("%d ", tab[i++]);
  printf("\n");
}
```
user: What is the c source code of the assembly code below:

```asm
<factorial>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  movl   $0x1,-0x4(%rbp)
  jmp    L3
L10:
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  imul   %edx,%eax
  mov    %eax,-0x4(%rbp)
L3:
  mov    -0x18(%rbp),%rax
  cmp    -0x20(%rbp),%rax
  jle    L10
  mov    -0x4(%rbp),%eax
  pop    %rbp
  ret
```

assistant: ```c
uint64_t factorial(uint16_t i, uint16_t n) {
  uint64_t f = 1;
  for (; i <= n; f *= i++)
    ;
  return f;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<factorial>:
  endbr64
  cmp    %rsi,%rdi
  jg     L9
  mov    $0x1,%eax
L15:
  imul   %edi,%eax
  mov    %rdi,%rdx
  add    $0x1,%rdi
  cmp    %rsi,%rdx
  jne    L15
  ret
L9:
  mov    $0x1,%eax
  ret
```

assistant: ```c
uint64_t factorial(uint16_t i, uint16_t n) {
  uint64_t f = 1;
  for (; i <= n; f *= i++)
    ;
  return f;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<factorial>:
  endbr64
  mov    $0x1,%eax
  cmp    %rsi,%rdi
  jg     L17
  xchg   %ax,%ax
L3:
  mov    %rdi,%rdx
  imul   %edi,%eax
  add    $0x1,%rdi
  cmp    %rsi,%rdx
  jne    L3
  ret
L17:
  ret
```

assistant: ```c
uint64_t factorial(uint16_t i, uint16_t n) {
  uint64_t f = 1;
  for (; i <= n; f *= i++)
    ;
  return f;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<factorial>:
  endbr64
  mov    $0x1,%eax
  cmp    %rsi,%rdi
  jg     L13
  xchg   %ax,%ax
L8:
  mov    %rdi,%rdx
  imul   %edi,%eax
  add    $0x1,%rdi
  cmp    %rdx,%rsi
  jne    L8
  ret
L13:
  ret
```

assistant: ```c
uint64_t factorial(uint16_t i, uint16_t n) {
  uint64_t f = 1;
  for (; i <= n; f *= i++)
    ;
  return f;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<fakeimage>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x840,%rsp
  mov    %rdi,-0x828(%rbp)
  mov    %rsi,-0x830(%rbp)
  mov    %rdx,-0x838(%rbp)
  mov    %rcx,-0x840(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x828(%rbp),%rdx
  lea    -0x810(%rbp),%rax
  lea    D1(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  lea    -0x810(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x64,%edi
  mov    $0x0,%eax
  call   <rt_ui_message@plt>
  mov    -0x830(%rbp),%rax
  movl   $0x4,(%rax)
  mov    -0x838(%rbp),%rax
  movl   $0x4,(%rax)
  mov    -0x830(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x838(%rbp),%rax
  mov    (%rax),%eax
  imul   %eax,%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  mov    %eax,-0x81c(%rbp)
  mov    -0x81c(%rbp),%eax
  cltq
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x818(%rbp)
  mov    -0x840(%rbp),%rax
  mov    -0x818(%rbp),%rdx
  mov    %rdx,(%rax)
  movl   $0x0,-0x820(%rbp)
  jmp    L6
L21:
  mov    -0x840(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x820(%rbp),%eax
  cltq
  add    %rdx,%rax
  movb   $0xff,(%rax)
  addl   $0x1,-0x820(%rbp)
L6:
  mov    -0x820(%rbp),%eax
  cmp    -0x81c(%rbp),%eax
  jl     L21
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L4
  call   <__stack_chk_fail@plt>
L4:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D1
datatype: string

tool: D1: Error loading image %s.  Faking it using solid gray.

assistant: ```c
signed int fakeimage(char *name, signed int *xres, signed int *yres, unsigned char **imgdata) {
  signed int i;
  signed int imgsize;
  char msgtxt[2048l];
  sprintf(msgtxt, "Error loading image %s.  Faking it using solid gray.", name);
  rt_ui_message(100, msgtxt);
  *xres = 4;
  *yres = 4;
  imgsize = 3 * *xres * *yres;
  void *return_value_malloc$1;
  return_value_malloc$1 = malloc((unsigned long int)imgsize);
  *imgdata = (unsigned char *)return_value_malloc$1;
  i = 0;
  while (!(i >= imgsize)) {
    (*imgdata)[(signed long int)i] = (unsigned char)255;
    i = i + 1;
  }
  return 0;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<fakeimage>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x818,%rsp
  mov    %rsi,%r12
  mov    %rdx,%rbp
  mov    %rcx,%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x808(%rsp)
  xor    %eax,%eax
  mov    %rsp,%r13
  mov    %rdi,%rdx
  lea    D1(%rip),%rsi
  mov    %r13,%rdi
  call   <sprintf@plt>
  mov    %r13,%rsi
  mov    $0x64,%edi
  mov    $0x0,%eax
  call   <rt_ui_message@plt>
  movl   $0x4,(%r12)
  movl   $0x4,0x0(%rbp)
  mov    $0x30,%edi
  call   <malloc@plt>
  mov    %rax,(%rbx)
  mov    $0x0,%eax
L0:
  mov    (%rbx),%rdx
  movb   $0xff,(%rdx,%rax,1)
  add    $0x1,%rax
  cmp    $0x30,%rax
  jne    L0
  mov    0x808(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L3
  mov    $0x0,%eax
  add    $0x818,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L3:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_label: D1
type: string

tool: D1: Error loading image %s.  Faking it using solid gray.

assistant: ```c
signed int fakeimage(char *name, signed int *xres, signed int *yres, unsigned char **imgdata) {
  signed int i;
  signed int imgsize;
  char msgtxt[2048l];
  sprintf(msgtxt, "Error loading image %s.  Faking it using solid gray.", name);
  rt_ui_message(100, msgtxt);
  *xres = 4;
  *yres = 4;
  imgsize = 3 * *xres * *yres;
  void *return_value_malloc$1;
  return_value_malloc$1 = malloc((unsigned long int)imgsize);
  *imgdata = (unsigned char *)return_value_malloc$1;
  i = 0;
  while (!(i >= imgsize)) {
    (*imgdata)[(signed long int)i] = (unsigned char)255;
    i = i + 1;
  }
  return 0;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<fakeimage>:
  endbr64
  push   %r13
  push   %r12
  mov    %rsi,%r12
  lea    D1(%rip),%rsi
  push   %rbp
  mov    %rdx,%rbp
  mov    %rdi,%rdx
  push   %rbx
  mov    %rcx,%rbx
  sub    $0x818,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x808(%rsp)
  xor    %eax,%eax
  mov    %rsp,%r13
  mov    %r13,%rdi
  call   <sprintf@plt>
  mov    %r13,%rsi
  mov    $0x64,%edi
  xor    %eax,%eax
  call   <rt_ui_message@plt>
  movl   $0x4,(%r12)
  mov    $0x30,%edi
  movl   $0x4,0x0(%rbp)
  call   <malloc@plt>
  xor    %edx,%edx
  mov    %rax,(%rbx)
  jmp    L26
  nopl   0x0(%rax)
L2:
  mov    (%rbx),%rax
L26:
  movb   $0xff,(%rax,%rdx,1)
  add    $0x1,%rdx
  cmp    $0x30,%rdx
  jne    L2
  mov    0x808(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L11
  add    $0x818,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L11:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_tag: D1
type_infered: string

tool: D1: Error loading image %s.  Faking it using solid gray.

assistant: ```c
signed int fakeimage(char *name, signed int *xres, signed int *yres, unsigned char **imgdata) {
  signed int i;
  signed int imgsize;
  char msgtxt[2048l];
  sprintf(msgtxt, "Error loading image %s.  Faking it using solid gray.", name);
  rt_ui_message(100, msgtxt);
  *xres = 4;
  *yres = 4;
  imgsize = 3 * *xres * *yres;
  void *return_value_malloc$1;
  return_value_malloc$1 = malloc((unsigned long int)imgsize);
  *imgdata = (unsigned char *)return_value_malloc$1;
  i = 0;
  while (!(i >= imgsize)) {
    (*imgdata)[(signed long int)i] = (unsigned char)255;
    i = i + 1;
  }
  return 0;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<fakeimage>:
  endbr64
  push   %r13
  push   %r12
  mov    %rsi,%r12
  lea    D2(%rip),%rsi
  push   %rbp
  mov    %rdx,%rbp
  mov    %rdi,%rdx
  push   %rbx
  mov    %rcx,%rbx
  sub    $0x818,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x808(%rsp)
  xor    %eax,%eax
  mov    %rsp,%r13
  mov    %r13,%rdi
  call   <sprintf@plt>
  mov    %r13,%rsi
  mov    $0x64,%edi
  xor    %eax,%eax
  call   <rt_ui_message@plt>
  movl   $0x4,(%r12)
  mov    $0x30,%edi
  movl   $0x4,0x0(%rbp)
  call   <malloc@plt>
  mov    %rax,(%rbx)
  movb   $0xff,(%rax)
  mov    $0x1,%eax
  nopl   (%rax)
L12:
  mov    (%rbx),%rdx
  movb   $0xff,(%rdx,%rax,1)
  add    $0x1,%rax
  cmp    $0x30,%rax
  jne    L12
  mov    0x808(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L4
  add    $0x818,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L4:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: label: D2
type: string

tool: D2: Error loading image %s.  Faking it using solid gray.

assistant: ```c
signed int fakeimage(char *name, signed int *xres, signed int *yres, unsigned char **imgdata) {
  signed int i;
  signed int imgsize;
  char msgtxt[2048l];
  sprintf(msgtxt, "Error loading image %s.  Faking it using solid gray.", name);
  rt_ui_message(100, msgtxt);
  *xres = 4;
  *yres = 4;
  imgsize = 3 * *xres * *yres;
  void *return_value_malloc$1;
  return_value_malloc$1 = malloc((unsigned long int)imgsize);
  *imgdata = (unsigned char *)return_value_malloc$1;
  i = 0;
  while (!(i >= imgsize)) {
    (*imgdata)[(signed long int)i] = (unsigned char)255;
    i = i + 1;
  }
  return 0;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<putsprite_blend_>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,0x8(%rsp)
  mov    %esi,0x2c(%rsp)
  mov    %rdx,0x10(%rsp)
  mov    %r9d,0x4(%rsp)
  test   %r8d,%r8d
  jle    L34
  mov    %rcx,%r15
  mov    %r9d,%eax
  cltq
  shl    $0x2,%rax
  mov    %rax,0x18(%rsp)
  mov    %r8d,%r8d
  lea    (%rdx,%r8,4),%rax
  mov    %rax,0x20(%rsp)
  jmp    L50
L78:
  movzbl %al,%eax
  add    %rax,%r12
  mov    %edx,%r14d
L95:
  cmp    0x4(%rsp),%r14d
  jge    L136
  movzbl (%r12),%eax
  cmp    $0xff,%eax
  je     L136
  add    %eax,%r14d
  cmp    %r14d,0x4(%rsp)
  jle    L136
  add    $0x2,%r12
  movzbl -0x1(%r12),%eax
  movzbl %al,%r13d
  test   %r13d,%r13d
  je     L95
  lea    (%r14,%r13,1),%edx
  test   %edx,%edx
  jle    L78
  test   %r14d,%r14d
  js     L61
L79:
  lea    (%r14,%r13,1),%eax
  mov    0x4(%rsp),%ecx
  cmp    %ecx,%eax
  jle    L73
  mov    %ecx,%r13d
  sub    %r14d,%r13d
  test   %r13d,%r13d
  jle    L95
L73:
  movslq %r14d,%rax
  mov    0x8(%rsp),%rcx
  lea    (%rcx,%rax,4),%rbp
  mov    %r12,%rbx
  mov    %r14d,0x28(%rsp)
  mov    0x70(%rsp),%r14
L63:
  add    $0x1,%rbx
  movzbl -0x1(%rbx),%eax
  mov    (%r15,%rax,4),%edi
  mov    0x0(%rbp),%esi
  call   *%r14
  mov    %eax,0x0(%rbp)
  add    $0x4,%rbp
  mov    %r12d,%eax
  sub    %ebx,%eax
  add    %r13d,%eax
  test   %eax,%eax
  jg     L63
  mov    0x28(%rsp),%r14d
  lea    -0x1(%r13),%eax
  add    $0x1,%rax
  test   %r13d,%r13d
  mov    $0x1,%edx
  cmovle %rdx,%rax
  add    %rax,%r12
  test   %r13d,%r13d
  mov    $0x1,%eax
  cmovle %eax,%r13d
  lea    (%r14,%r13,1),%r14d
  jmp    L95
L61:
  movslq %r14d,%r14
  sub    %r14,%r12
  mov    %edx,%r13d
  mov    $0x0,%r14d
  jmp    L79
L136:
  mov    0x18(%rsp),%rcx
  add    %rcx,0x8(%rsp)
  mov    0x20(%rsp),%rdx
  cmp    %rdx,0x10(%rsp)
  je     L34
L50:
  mov    0x10(%rsp),%rax
  movslq (%rax),%r12
  add    %rax,%r12
  add    $0x4,%rax
  mov    %rax,0x10(%rsp)
  mov    0x2c(%rsp),%r14d
  jmp    L95
L34:
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void putsprite_blend_(unsigned *dest, int x, int *linetab, unsigned *palette, int h, int screenwidth, unsigned (*blendfp)(unsigned, unsigned)) {
  for (; h > 0; h--, dest += screenwidth) {
    register int lx = x;
    unsigned char *data = ((unsigned char *)linetab) + (*linetab);
    linetab++;
    while (lx < screenwidth) {
      register int count = *data++;
      if (count == 0xFF)
        break;
      lx += count;
      if (lx >= screenwidth)
        break;
      count = *data++;
      if (!count)
        continue;
      if ((lx + count) <= 0) {
        lx += count;
        data += count;
        continue;
      }
      if (lx < 0) {
        count += lx;
        data -= lx;
        lx = 0;
      }
      if ((lx + count) > screenwidth) {
        count = screenwidth - lx;
      }
      for (; count > 0; count--, lx++) {
        dest[lx] = blendfp(palette[*data++], dest[lx]);
      }
    }
  }
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<putsprite_blend_>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,0x8(%rsp)
  mov    %esi,0x2c(%rsp)
  mov    %rdx,0x10(%rsp)
  mov    %r9d,0x4(%rsp)
  test   %r8d,%r8d
  jle    L100
  movslq %r9d,%rax
  movslq %r8d,%r8
  mov    %rcx,%rbx
  shl    $0x2,%rax
  mov    %rax,0x18(%rsp)
  lea    (%rdx,%r8,4),%rax
  mov    %rax,0x20(%rsp)
  nopl   0x0(%rax)
L26:
  mov    0x10(%rsp),%rax
  movslq (%rax),%r8
  lea    (%rax,%r8,1),%r14
  add    $0x4,%rax
  mov    %rax,0x10(%rsp)
  mov    0x2c(%rsp),%eax
  mov    %r14,%r15
  mov    %eax,%r14d
  nop
L96:
  cmp    0x4(%rsp),%r14d
  jge    L70
L59:
  movzbl (%r15),%eax
  cmp    $0xff,%eax
  je     L70
  add    %eax,%r14d
  cmp    %r14d,0x4(%rsp)
  jle    L70
  movzbl 0x1(%r15),%r13d
  add    $0x2,%r15
  test   %r13d,%r13d
  je     L96
  lea    (%r14,%r13,1),%esi
  test   %esi,%esi
  jg     L111
  add    %r13,%r15
  mov    %esi,%r14d
  cmp    0x4(%rsp),%r14d
  jl     L59
  nop
L70:
  mov    0x18(%rsp),%rcx
  add    %rcx,0x8(%rsp)
  mov    0x20(%rsp),%rcx
  cmp    %rcx,0x10(%rsp)
  jne    L26
L100:
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L111:
  test   %r14d,%r14d
  jns    L87
  movslq %r14d,%rdx
  mov    %esi,%r13d
  xor    %r14d,%r14d
  sub    %rdx,%r15
L87:
  mov    0x4(%rsp),%eax
  cmp    %eax,%esi
  jle    L102
  mov    %eax,%r13d
  sub    %r14d,%r13d
  test   %r13d,%r13d
  jle    L96
L102:
  mov    0x8(%rsp),%rcx
  movslq %r14d,%rax
  mov    0x70(%rsp),%rbp
  mov    %r14d,0x28(%rsp)
  mov    %r15,%r14
  lea    (%rcx,%rax,4),%r12
  nopl   0x0(%rax)
L54:
  movzbl (%r14),%eax
  mov    (%r12),%esi
  add    $0x1,%r14
  add    $0x4,%r12
  mov    (%rbx,%rax,4),%edi
  call   *%rbp
  mov    %eax,-0x4(%r12)
  mov    %r15d,%eax
  sub    %r14d,%eax
  add    %r13d,%eax
  test   %eax,%eax
  jg     L54
  test   %r13d,%r13d
  movslq %r13d,%rax
  mov    $0x1,%edx
  mov    0x28(%rsp),%r14d
  cmovle %rdx,%rax
  add    %r13d,%r14d
  add    %rax,%r15
  jmp    L96
```

assistant: ```c
void putsprite_blend_(unsigned *dest, int x, int *linetab, unsigned *palette, int h, int screenwidth, unsigned (*blendfp)(unsigned, unsigned)) {
  for (; h > 0; h--, dest += screenwidth) {
    register int lx = x;
    unsigned char *data = ((unsigned char *)linetab) + (*linetab);
    linetab++;
    while (lx < screenwidth) {
      register int count = *data++;
      if (count == 0xFF)
        break;
      lx += count;
      if (lx >= screenwidth)
        break;
      count = *data++;
      if (!count)
        continue;
      if ((lx + count) <= 0) {
        lx += count;
        data += count;
        continue;
      }
      if (lx < 0) {
        count += lx;
        data -= lx;
        lx = 0;
      }
      if ((lx + count) > screenwidth) {
        count = screenwidth - lx;
      }
      for (; count > 0; count--, lx++) {
        dest[lx] = blendfp(palette[*data++], dest[lx]);
      }
    }
  }
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<putsprite_blend_>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,0x8(%rsp)
  mov    %esi,0x2c(%rsp)
  mov    %rdx,0x10(%rsp)
  mov    %r9d,0x4(%rsp)
  test   %r8d,%r8d
  jle    L85
  movslq %r9d,%rax
  movslq %r8d,%r8
  mov    %rcx,%rbx
  shl    $0x2,%rax
  mov    %rax,0x18(%rsp)
  lea    (%rdx,%r8,4),%rax
  mov    %rax,0x20(%rsp)
  nopl   0x0(%rax)
L29:
  mov    0x10(%rsp),%rax
  movslq (%rax),%r8
  lea    (%rax,%r8,1),%r14
  add    $0x4,%rax
  mov    %rax,0x10(%rsp)
  mov    0x2c(%rsp),%eax
  mov    %r14,%r15
  mov    %eax,%r14d
  nop
L74:
  cmp    0x4(%rsp),%r14d
  jge    L67
L6:
  movzbl (%r15),%eax
  cmp    $0xff,%eax
  je     L67
  add    %eax,%r14d
  cmp    %r14d,0x4(%rsp)
  jle    L67
  movzbl 0x1(%r15),%r13d
  add    $0x2,%r15
  test   %r13d,%r13d
  je     L74
  lea    (%r14,%r13,1),%esi
  test   %esi,%esi
  jg     L45
  add    %r13,%r15
  mov    %esi,%r14d
  cmp    0x4(%rsp),%r14d
  jl     L6
  nop
L67:
  mov    0x18(%rsp),%rcx
  add    %rcx,0x8(%rsp)
  mov    0x10(%rsp),%rcx
  cmp    %rcx,0x20(%rsp)
  jne    L29
L85:
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L45:
  test   %r14d,%r14d
  jns    L2
  movslq %r14d,%rdx
  mov    %esi,%r13d
  xor    %r14d,%r14d
  sub    %rdx,%r15
L2:
  mov    0x4(%rsp),%eax
  cmp    %eax,%esi
  jle    L47
  mov    %eax,%r13d
  sub    %r14d,%r13d
  test   %r13d,%r13d
  jle    L74
L47:
  mov    0x8(%rsp),%rcx
  movslq %r14d,%rax
  mov    %r14d,0x28(%rsp)
  mov    %r15,%rbp
  lea    (%rcx,%rax,4),%r12
  mov    %r12,%r14
  mov    0x70(%rsp),%r12
  nopl   0x0(%rax)
L83:
  movzbl 0x0(%rbp),%eax
  mov    (%r14),%esi
  add    $0x1,%rbp
  add    $0x4,%r14
  mov    (%rbx,%rax,4),%edi
  call   *%r12
  mov    %eax,-0x4(%r14)
  mov    %r15d,%eax
  sub    %ebp,%eax
  add    %r13d,%eax
  test   %eax,%eax
  jg     L83
  test   %r13d,%r13d
  movslq %r13d,%rax
  mov    $0x1,%edx
  mov    0x28(%rsp),%r14d
  cmovle %rdx,%rax
  add    %r13d,%r14d
  add    %rax,%r15
  jmp    L74
```

assistant: ```c
void putsprite_blend_(unsigned *dest, int x, int *linetab, unsigned *palette, int h, int screenwidth, unsigned (*blendfp)(unsigned, unsigned)) {
  for (; h > 0; h--, dest += screenwidth) {
    register int lx = x;
    unsigned char *data = ((unsigned char *)linetab) + (*linetab);
    linetab++;
    while (lx < screenwidth) {
      register int count = *data++;
      if (count == 0xFF)
        break;
      lx += count;
      if (lx >= screenwidth)
        break;
      count = *data++;
      if (!count)
        continue;
      if ((lx + count) <= 0) {
        lx += count;
        data += count;
        continue;
      }
      if (lx < 0) {
        count += lx;
        data -= lx;
        lx = 0;
      }
      if ((lx + count) > screenwidth) {
        count = screenwidth - lx;
      }
      for (; count > 0; count--, lx++) {
        dest[lx] = blendfp(palette[*data++], dest[lx]);
      }
    }
  }
}
```