ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<help>:
  endbr64
  push   %rbp
  mov    %rdi,%rsi
  mov    %rdi,%rbp
  lea    D4(%rip),%rdi
  call   <printf@plt>
  mov    %rbp,%rsi
  lea    D10(%rip),%rdi
  pop    %rbp
  jmp    1050 <printf@plt>
```

tool_calls: name: unpack_data
arguments: data_label: D4
type_guessed: string
name: unpack_data
arguments: data_label: D10
type_guessed: string

tool: D4: %s - BINARY to Intel HEX file convertor version 1.00
(c)BCL Vysoke Myto 2001 (benedikt@lphard.cz)



tool: D10: Usage: %s [-option] binfile hexfile
 -l  Bytes to read from binary file
 -i  Binary file starting offset
 -o  Output file offset (where HEX data starts)
 -t  Exclude EOF record
 -a  Append to end of existing HEX file
 -q  Quiet mode (no statistics are printed)


assistant: ```c
void help(char *name) {
  printf("%s - BINARY to Intel HEX file convertor version 1.00\n"
         "(c)BCL Vysoke Myto 2001 (benedikt@lphard.cz)\n\n",
         name);
  printf("Usage: %s [-option] binfile hexfile\n"
         " -l  Bytes to read from binary file\n"
         " -i  Binary file starting offset\n"
         " -o  Output file offset (where HEX data starts)\n"
         " -t  Exclude EOF record\n"
         " -a  Append to end of existing HEX file\n"
         " -q  Quiet mode (no statistics are printed)\n",
         name);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movsd  D65(%rip),%xmm0
  movsd  %xmm0,-0x30(%rbp)
  movsd  D22(%rip),%xmm0
  movsd  %xmm0,-0x28(%rbp)
  movsd  D23(%rip),%xmm0
  movsd  %xmm0,-0x20(%rbp)
  movsd  D18(%rip),%xmm0
  movsd  %xmm0,-0x18(%rbp)
  movsd  D52(%rip),%xmm0
  movsd  %xmm0,-0x10(%rbp)
  lea    -0x34(%rbp),%rdx
  lea    -0x38(%rbp),%rax
  mov    %rax,%rsi
  lea    D13(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  mov    -0x38(%rbp),%eax
  sub    $0x1,%eax
  cltq
  movsd  -0x30(%rbp,%rax,8),%xmm1
  mov    -0x34(%rbp),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mulsd  %xmm0,%xmm1
  movq   %xmm1,%rax
  movq   %rax,%xmm0
  lea    D35(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L0
  call   <__stack_chk_fail@plt>
L0:
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D65
data_type: byte[8]
name: retrieve_data
arguments: data_label: D22
data_type: f64
name: retrieve_data
arguments: data_label: D23
data_type: byte[8]
name: retrieve_data
arguments: data_label: D18
data_type: byte[8]
name: retrieve_data
arguments: data_label: D52
data_type: f64
name: retrieve_data
arguments: data_label: D13
data_type: string
name: retrieve_data
arguments: data_label: D35
data_type: string

tool: {"D65": [0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x40]}

tool: D22: 4.5

tool: {"D23": [0x00,0x00,0x00,0x00,0x00,0x00,0x14,0x40]}

tool: {"D18": [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40]}

tool: D52: 1.5

tool: D13: %d %d

tool: D35: Total: R$ %.2f


assistant: ```c
int main(void) {
  double valores[] = {4, 4.5, 5, 2, 1.5};
  int codigo, quantidade;
  scanf("%d %d", &codigo, &quantidade);
  printf("Total: R$ %.2f\n", valores[codigo - 1] * quantidade);
  return 0;
}
```
user: What is the c source code of the assembly code below:

```asm
<main>:
  endbr64
  sub    $0x48,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  mov    D17(%rip),%rax
  mov    %rax,0x10(%rsp)
  mov    D4(%rip),%rax
  mov    %rax,0x18(%rsp)
  mov    D15(%rip),%rax
  mov    %rax,0x20(%rsp)
  mov    D47(%rip),%rax
  mov    %rax,0x28(%rsp)
  mov    D0(%rip),%rax
  mov    %rax,0x30(%rsp)
  lea    0xc(%rsp),%rdx
  lea    0x8(%rsp),%rsi
  lea    D42(%rip),%rdi
  call   <scanf@plt>
  mov    0x8(%rsp),%eax
  sub    $0x1,%eax
  cltq
  pxor   %xmm0,%xmm0
  cvtsi2sdl 0xc(%rsp),%xmm0
  mulsd  0x10(%rsp,%rax,8),%xmm0
  lea    D40(%rip),%rdi
  call   <printf@plt>
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L0
  mov    $0x0,%eax
  add    $0x48,%rsp
  ret
L0:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D17
type: byte[8]
name: extract_symbolic_data
arguments: data_label: D4
type: f64
name: extract_symbolic_data
arguments: data_label: D15
type: byte[8]
name: extract_symbolic_data
arguments: data_label: D47
type: byte[8]
name: extract_symbolic_data
arguments: data_label: D0
type: f64
name: extract_symbolic_data
arguments: data_label: D42
type: string
name: extract_symbolic_data
arguments: data_label: D40
type: string

tool: {"D17": [0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x40]}

tool: D4: 4.5

tool: {"D15": [0x00,0x00,0x00,0x00,0x00,0x00,0x14,0x40]}

tool: {"D47": [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40]}

tool: D0: 1.5

tool: D42: %d %d

tool: D40: Total: R$ %.2f


assistant: ```c
int main(void) {
  double valores[] = {4, 4.5, 5, 2, 1.5};
  int codigo, quantidade;
  scanf("%d %d", &codigo, &quantidade);
  printf("Total: R$ %.2f\n", valores[codigo - 1] * quantidade);
  return 0;
}
```
user: What is the c source code of the assembly code below?

```asm
<main>:
  endbr64
  sub    $0x48,%rsp
  lea    D33(%rip),%rdi
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  mov    D14(%rip),%rax
  lea    0xc(%rsp),%rdx
  lea    0x8(%rsp),%rsi
  mov    %rax,0x10(%rsp)
  mov    D39(%rip),%rax
  mov    %rax,0x18(%rsp)
  mov    D43(%rip),%rax
  mov    %rax,0x20(%rsp)
  mov    D9(%rip),%rax
  mov    %rax,0x28(%rsp)
  mov    D31(%rip),%rax
  mov    %rax,0x30(%rsp)
  call   <scanf@plt>
  mov    0x8(%rsp),%eax
  pxor   %xmm0,%xmm0
  lea    D55(%rip),%rdi
  cvtsi2sdl 0xc(%rsp),%xmm0
  sub    $0x1,%eax
  cltq
  mulsd  0x10(%rsp,%rax,8),%xmm0
  call   <printf@plt>
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L3
  xor    %eax,%eax
  add    $0x48,%rsp
  ret
L3:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_tag: D33
type_infered: string
name: retrieve_data
arguments: data_tag: D14
type_infered: byte[8]
name: retrieve_data
arguments: data_tag: D39
type_infered: f64
name: retrieve_data
arguments: data_tag: D43
type_infered: byte[8]
name: retrieve_data
arguments: data_tag: D9
type_infered: byte[8]
name: retrieve_data
arguments: data_tag: D31
type_infered: f64
name: retrieve_data
arguments: data_tag: D55
type_infered: string

tool: D33: %d %d

tool: {"D14": [0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x40]}

tool: D39: 4.5

tool: {"D43": [0x00,0x00,0x00,0x00,0x00,0x00,0x14,0x40]}

tool: {"D9": [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40]}

tool: D31: 1.5

tool: D55: Total: R$ %.2f


assistant: ```c
int main(void) {
  double valores[] = {4, 4.5, 5, 2, 1.5};
  int codigo, quantidade;
  scanf("%d %d", &codigo, &quantidade);
  printf("Total: R$ %.2f\n", valores[codigo - 1] * quantidade);
  return 0;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  sub    $0x48,%rsp
  movapd D4(%rip),%xmm0
  lea    D5(%rip),%rdi
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  mov    D7(%rip),%rax
  lea    0xc(%rsp),%rdx
  lea    0x8(%rsp),%rsi
  movaps %xmm0,0x10(%rsp)
  movapd D11(%rip),%xmm0
  mov    %rax,0x30(%rsp)
  movaps %xmm0,0x20(%rsp)
  call   <scanf@plt>
  mov    0x8(%rsp),%eax
  pxor   %xmm0,%xmm0
  lea    D29(%rip),%rdi
  cvtsi2sdl 0xc(%rsp),%xmm0
  sub    $0x1,%eax
  cltq
  mulsd  0x10(%rsp,%rax,8),%xmm0
  call   <printf@plt>
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L3
  xor    %eax,%eax
  add    $0x48,%rsp
  ret
L3:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_label: D4
type: byte[16]
name: unpack_data
arguments: data_label: D5
type: string
name: unpack_data
arguments: data_label: D7
type: f64
name: unpack_data
arguments: data_label: D11
type: byte[16]
name: unpack_data
arguments: data_label: D29
type: string

tool: {"D4": [0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x12,0x40]}

tool: D5: %d %d

tool: D7: 1.5

tool: {"D11": [0x00,0x00,0x00,0x00,0x00,0x00,0x14,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40]}

tool: D29: Total: R$ %.2f


assistant: ```c
int main(void) {
  double valores[] = {4, 4.5, 5, 2, 1.5};
  int codigo, quantidade;
  scanf("%d %d", &codigo, &quantidade);
  printf("Total: R$ %.2f\n", valores[codigo - 1] * quantidade);
  return 0;
}
```
user: What is the c source code of the assembly code below:

```asm
<min>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %rsi,-0x20(%rbp)
  cmpl   $0x1,-0x14(%rbp)
  jne    L5
  mov    -0x14(%rbp),%eax
  cltq
  shl    $0x2,%rax
  lea    -0x4(%rax),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  jmp    L8
L5:
  mov    -0x14(%rbp),%eax
  cltq
  shl    $0x2,%rax
  lea    -0x4(%rax),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x14(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    -0x20(%rbp),%rax
  mov    %rax,%rsi
  mov    %edx,%edi
  call   <min>
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%edx
  mov    -0x8(%rbp),%eax
  cmp    %eax,%edx
  cmovle %edx,%eax
L8:
  leave
  ret
```

assistant: ```c
int min(int n, int *v) {
  if (n == 1)
    return v[n - 1];
  int a = v[n - 1], b = min(n - 1, v);
  return (a < b) ? a : b;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<min>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rsi,%rbp
  cmp    $0x1,%edi
  je     L5
  mov    %edi,%ebx
  lea    -0x1(%rdi),%edi
  call   <min>
  movslq %ebx,%rbx
  mov    -0x4(%rbp,%rbx,4),%edx
  cmp    %edx,%eax
  cmovg  %edx,%eax
L19:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
L5:
  mov    (%rsi),%eax
  jmp    L19
```

assistant: ```c
int min(int n, int *v) {
  if (n == 1)
    return v[n - 1];
  int a = v[n - 1], b = min(n - 1, v);
  return (a < b) ? a : b;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<min>:
  endbr64
  cmp    $0x1,%edi
  je     L63
  push   %r15
  movslq %edi,%rax
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    -0x4(%rsi,%rax,4),%ebp
  lea    -0x1(%rdi),%eax
  cmp    $0x2,%edi
  je     L19
  cltq
  mov    -0x4(%rsi,%rax,4),%r12d
  lea    -0x2(%rdi),%eax
  cmp    $0x3,%edi
  je     L55
  cltq
  mov    -0x4(%rsi,%rax,4),%ebx
  lea    -0x3(%rdi),%eax
  cmp    $0x4,%edi
  je     L39
  cltq
  mov    -0x4(%rsi,%rax,4),%r13d
  lea    -0x4(%rdi),%eax
  cmp    $0x5,%edi
  je     L68
  cltq
  lea    -0x5(%rdi),%r15d
  mov    -0x4(%rsi,%rax,4),%r14d
  cmp    $0x6,%edi
  je     L88
  sub    $0x6,%edi
  mov    %rsi,0x8(%rsp)
  movslq %r15d,%r15
  call   <min>
  mov    0x8(%rsp),%rsi
  mov    -0x4(%rsi,%r15,4),%edx
  cmp    %edx,%eax
  cmovg  %edx,%eax
L71:
  cmp    %eax,%r14d
  cmovle %r14d,%eax
L31:
  cmp    %eax,%r13d
  cmovle %r13d,%eax
L25:
  cmp    %eax,%ebx
  cmovle %ebx,%eax
L12:
  cmp    %eax,%r12d
  cmovle %r12d,%eax
  jmp    L29
  nopl   (%rax)
L19:
  mov    (%rsi),%eax
L29:
  cmp    %eax,%ebp
  cmovle %ebp,%eax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  xchg   %ax,%ax
L63:
  mov    (%rsi),%eax
  ret
  nopl   0x0(%rax,%rax,1)
L39:
  mov    (%rsi),%eax
  jmp    L25
  nopl   0x0(%rax)
L55:
  mov    (%rsi),%eax
  jmp    L12
  nopl   0x0(%rax)
L68:
  mov    (%rsi),%eax
  jmp    L31
  nopl   0x0(%rax)
L88:
  mov    (%rsi),%eax
  jmp    L71
```

assistant: ```c
int min(int n, int *v) {
  if (n == 1)
    return v[n - 1];
  int a = v[n - 1], b = min(n - 1, v);
  return (a < b) ? a : b;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<min>:
  endbr64
  cmp    $0x1,%edi
  je     L23
  push   %r15
  movslq %edi,%rax
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    -0x4(%rsi,%rax,4),%ebp
  lea    -0x1(%rdi),%eax
  cmp    $0x2,%edi
  je     L21
  cltq
  mov    -0x4(%rsi,%rax,4),%r12d
  lea    -0x2(%rdi),%eax
  cmp    $0x3,%edi
  je     L0
  cltq
  mov    -0x4(%rsi,%rax,4),%ebx
  lea    -0x3(%rdi),%eax
  cmp    $0x4,%edi
  je     L60
  cltq
  mov    -0x4(%rsi,%rax,4),%r13d
  lea    -0x4(%rdi),%eax
  cmp    $0x5,%edi
  je     L30
  cltq
  lea    -0x5(%rdi),%r15d
  mov    -0x4(%rsi,%rax,4),%r14d
  cmp    $0x6,%edi
  je     L34
  sub    $0x6,%edi
  mov    %rsi,0x8(%rsp)
  movslq %r15d,%r15
  call   <min>
  mov    0x8(%rsp),%rsi
  mov    -0x4(%rsi,%r15,4),%edx
  cmp    %edx,%eax
  cmovg  %edx,%eax
L22:
  cmp    %eax,%r14d
  cmovle %r14d,%eax
L43:
  cmp    %eax,%r13d
  cmovle %r13d,%eax
L41:
  cmp    %eax,%ebx
  cmovle %ebx,%eax
L32:
  cmp    %eax,%r12d
  cmovle %r12d,%eax
  jmp    L90
  nopl   (%rax)
L21:
  mov    (%rsi),%eax
L90:
  cmp    %eax,%ebp
  cmovle %ebp,%eax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  xchg   %ax,%ax
L23:
  mov    (%rsi),%eax
  ret
  nopl   0x0(%rax,%rax,1)
L60:
  mov    (%rsi),%eax
  jmp    L41
  nopl   0x0(%rax)
L0:
  mov    (%rsi),%eax
  jmp    L32
  nopl   0x0(%rax)
L30:
  mov    (%rsi),%eax
  jmp    L43
  nopl   0x0(%rax)
L34:
  mov    (%rsi),%eax
  jmp    L22
```

assistant: ```c
int min(int n, int *v) {
  if (n == 1)
    return v[n - 1];
  int a = v[n - 1], b = min(n - 1, v);
  return (a < b) ? a : b;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<scanline_col32cb16blend_c>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x38(%rbp)
  mov    %esi,-0x3c(%rbp)
  mov    %rdx,-0x48(%rbp)
  mov    -0x3c(%rbp),%eax
  sar    $0x18,%eax
  mov    %eax,-0x24(%rbp)
  mov    -0x24(%rbp),%eax
  sar    $0x7,%eax
  mov    %eax,%edx
  mov    -0x24(%rbp),%eax
  add    %eax,%edx
  mov    $0x100,%eax
  sub    %edx,%eax
  mov    %eax,-0x20(%rbp)
  jmp    L13
L14:
  mov    -0x38(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x1c(%rbp),%eax
  sar    $0xb,%eax
  and    $0x1f,%eax
  mov    %eax,-0x18(%rbp)
  mov    -0x1c(%rbp),%eax
  sar    $0x5,%eax
  and    $0x3f,%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x1c(%rbp),%eax
  and    $0x1f,%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x3c(%rbp),%eax
  sar    $0x3,%eax
  and    $0x1f,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x3c(%rbp),%eax
  sar    $0xa,%eax
  and    $0x3f,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x3c(%rbp),%eax
  sar    $0x13,%eax
  and    $0x1f,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x20(%rbp),%eax
  imul   -0x18(%rbp),%eax
  sar    $0x8,%eax
  add    %eax,-0xc(%rbp)
  mov    -0x20(%rbp),%eax
  imul   -0x14(%rbp),%eax
  sar    $0x8,%eax
  add    %eax,-0x8(%rbp)
  mov    -0x20(%rbp),%eax
  imul   -0x10(%rbp),%eax
  sar    $0x8,%eax
  add    %eax,-0x4(%rbp)
  mov    -0xc(%rbp),%eax
  shl    $0xb,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%eax
  shl    $0x5,%eax
  mov    %edx,%ecx
  or     %eax,%ecx
  mov    -0x38(%rbp),%rax
  lea    0x4(%rax),%rdx
  mov    %rdx,-0x38(%rbp)
  or     -0x4(%rbp),%ecx
  mov    %ecx,%edx
  mov    %edx,(%rax)
L13:
  mov    -0x48(%rbp),%rax
  lea    -0x1(%rax),%rdx
  mov    %rdx,-0x48(%rbp)
  test   %rax,%rax
  jne    L14
  nop
  nop
  pop    %rbp
  ret
```

assistant: ```c
void scanline_col32cb16blend_c(uint16_t *dst, uint32_t src, size_t count) {
  uint32_t srcAlpha = (src >> 24);
  uint32_t f = 0x100 - (srcAlpha + (srcAlpha >> 7));
  while (count--) {
    uint16_t d = *dst;
    int dstR = (d >> 11) & 0x1f;
    int dstG = (d >> 5) & 0x3f;
    int dstB = (d)&0x1f;
    int srcR = (src >> (3)) & 0x1F;
    int srcG = (src >> (8 + 2)) & 0x3F;
    int srcB = (src >> (16 + 3)) & 0x1F;
    srcR += (f * dstR) >> 8;
    srcG += (f * dstG) >> 8;
    srcB += (f * dstB) >> 8;
    *dst++ = (uint16_t)((srcR << 11) | (srcG << 5) | srcB);
  }
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<scanline_col32cb16blend_c>:
  endbr64
  mov    %rdi,%rcx
  mov    %esi,%eax
  sar    $0x1f,%eax
  mov    %esi,%edi
  sar    $0x18,%edi
  add    %edi,%eax
  mov    $0x100,%edi
  sub    %eax,%edi
  lea    -0x1(%rdx),%r8
  test   %rdx,%rdx
  je     L16
  mov    %esi,%r10d
  sar    $0x3,%r10d
  and    $0x1f,%r10d
  mov    %esi,%r9d
  sar    $0xa,%r9d
  and    $0x3f,%r9d
  sar    $0x13,%esi
  and    $0x1f,%esi
L14:
  mov    (%rcx),%edx
  add    $0x4,%rcx
  mov    %edx,%eax
  sar    $0xb,%eax
  and    $0x1f,%eax
  imul   %edi,%eax
  sar    $0x8,%eax
  add    %r10d,%eax
  shl    $0xb,%eax
  mov    %edx,%r11d
  sar    $0x5,%r11d
  and    $0x3f,%r11d
  imul   %edi,%r11d
  sar    $0x8,%r11d
  add    %r9d,%r11d
  shl    $0x5,%r11d
  or     %r11d,%eax
  and    $0x1f,%edx
  imul   %edi,%edx
  sar    $0x8,%edx
  add    %esi,%edx
  or     %edx,%eax
  mov    %eax,-0x4(%rcx)
  sub    $0x1,%r8
  cmp    $0xffffffffffffffff,%r8
  jne    L14
L16:
  ret
```

assistant: ```c
void scanline_col32cb16blend_c(uint16_t *dst, uint32_t src, size_t count) {
  uint32_t srcAlpha = (src >> 24);
  uint32_t f = 0x100 - (srcAlpha + (srcAlpha >> 7));
  while (count--) {
    uint16_t d = *dst;
    int dstR = (d >> 11) & 0x1f;
    int dstG = (d >> 5) & 0x3f;
    int dstB = (d)&0x1f;
    int srcR = (src >> (3)) & 0x1F;
    int srcG = (src >> (8 + 2)) & 0x3F;
    int srcB = (src >> (16 + 3)) & 0x1F;
    srcR += (f * dstR) >> 8;
    srcG += (f * dstG) >> 8;
    srcB += (f * dstB) >> 8;
    *dst++ = (uint16_t)((srcR << 11) | (srcG << 5) | srcB);
  }
}
```
user: What is the c source code of the assembly code below?

```asm
<scanline_col32cb16blend_c>:
  endbr64
  mov    %rdi,%rcx
  mov    %esi,%eax
  lea    -0x1(%rdx),%r8
  mov    %esi,%edi
  sar    $0x18,%edi
  sar    $0x1f,%eax
  add    %edi,%eax
  mov    $0x100,%edi
  sub    %eax,%edi
  test   %rdx,%rdx
  je     L16
  mov    %esi,%r10d
  mov    %esi,%r9d
  sar    $0x13,%esi
  sar    $0x3,%r10d
  sar    $0xa,%r9d
  and    $0x1f,%esi
  and    $0x1f,%r10d
  and    $0x3f,%r9d
  nop
L10:
  mov    (%rcx),%edx
  add    $0x4,%rcx
  mov    %edx,%eax
  mov    %edx,%r11d
  and    $0x1f,%edx
  sar    $0xb,%eax
  sar    $0x5,%r11d
  imul   %edi,%edx
  and    $0x1f,%eax
  and    $0x3f,%r11d
  imul   %edi,%eax
  imul   %edi,%r11d
  sar    $0x8,%edx
  add    %esi,%edx
  sar    $0x8,%eax
  sar    $0x8,%r11d
  add    %r10d,%eax
  add    %r9d,%r11d
  shl    $0xb,%eax
  shl    $0x5,%r11d
  or     %r11d,%eax
  or     %edx,%eax
  mov    %eax,-0x4(%rcx)
  sub    $0x1,%r8
  jae    L10
L16:
  ret
```

assistant: ```c
void scanline_col32cb16blend_c(uint16_t *dst, uint32_t src, size_t count) {
  uint32_t srcAlpha = (src >> 24);
  uint32_t f = 0x100 - (srcAlpha + (srcAlpha >> 7));
  while (count--) {
    uint16_t d = *dst;
    int dstR = (d >> 11) & 0x1f;
    int dstG = (d >> 5) & 0x3f;
    int dstB = (d)&0x1f;
    int srcR = (src >> (3)) & 0x1F;
    int srcG = (src >> (8 + 2)) & 0x3F;
    int srcB = (src >> (16 + 3)) & 0x1F;
    srcR += (f * dstR) >> 8;
    srcG += (f * dstG) >> 8;
    srcB += (f * dstB) >> 8;
    *dst++ = (uint16_t)((srcR << 11) | (srcG << 5) | srcB);
  }
}
```
user: What is the c source code of the assembly code below:

```asm
<json_parse_pair>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    %rcx,-0x30(%rbp)
  mov    %r8,-0x38(%rbp)
  movq   $0x0,-0x10(%rbp)
  mov    -0x28(%rbp),%rdx
  mov    -0x20(%rbp),%rcx
  mov    -0x18(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <json_parse_string@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  jne    L52
  mov    $0x0,%eax
  jmp    L44
L52:
  mov    -0x8(%rbp),%rax
  add    %rax,-0x10(%rbp)
  mov    -0x8(%rbp),%rax
  add    %rax,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    $0x3a,%esi
  mov    %rax,%rdi
  call   <json_parse_sep@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  jne    L37
  mov    $0x0,%eax
  jmp    L44
L37:
  mov    -0x8(%rbp),%rax
  add    %rax,-0x10(%rbp)
  mov    -0x8(%rbp),%rax
  add    %rax,-0x18(%rbp)
  mov    -0x38(%rbp),%rdx
  mov    -0x30(%rbp),%rcx
  mov    -0x18(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <json_parse_value@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  jne    L30
  mov    $0x0,%eax
  jmp    L44
L30:
  mov    -0x8(%rbp),%rax
  add    %rax,-0x10(%rbp)
  mov    -0x10(%rbp),%rax
L44:
  leave
  ret
```

assistant: ```c
size_t json_parse_pair(const char *str, char *name, size_t namesiz, char *val, size_t valsiz) {
  size_t pair_len = 0;
  size_t len;
  len = json_parse_string(str, name, namesiz);
  if (!len)
    return 0;
  pair_len += len;
  str += len;
  len = json_parse_sep(str, ':');
  if (!len)
    return 0;
  pair_len += len;
  str += len;
  len = json_parse_value(str, val, valsiz);
  if (!len)
    return 0;
  pair_len += len;
  return pair_len;
}
```
user: Translate the below assembly code into C programming language:

```asm
<json_parse_pair>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbp
  mov    %rcx,%r12
  mov    %r8,%r13
  call   <json_parse_string@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  jne    L12
L7:
  mov    %rbx,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L12:
  add    %rax,%rbp
  mov    $0x3a,%esi
  mov    %rbp,%rdi
  call   <json_parse_sep@plt>
  mov    %rax,%r14
  test   %rax,%rax
  jne    L25
  mov    %rax,%rbx
  jmp    L7
L25:
  lea    0x0(%rbp,%rax,1),%rdi
  mov    %r13,%rdx
  mov    %r12,%rsi
  call   <json_parse_value@plt>
  add    %rbx,%r14
  add    %rax,%r14
  test   %rax,%rax
  cmovne %r14,%rax
  mov    %rax,%rbx
  jmp    L7
```

assistant: ```c
size_t json_parse_pair(const char *str, char *name, size_t namesiz, char *val, size_t valsiz) {
  size_t pair_len = 0;
  size_t len;
  len = json_parse_string(str, name, namesiz);
  if (!len)
    return 0;
  pair_len += len;
  str += len;
  len = json_parse_sep(str, ':');
  if (!len)
    return 0;
  pair_len += len;
  str += len;
  len = json_parse_value(str, val, valsiz);
  if (!len)
    return 0;
  pair_len += len;
  return pair_len;
}
```
user: What is the c source code of the assembly code below:

```asm
<json_parse_pair>:
  endbr64
  push   %r14
  push   %r13
  mov    %r8,%r13
  push   %r12
  mov    %rcx,%r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  call   <json_parse_string@plt>
  test   %rax,%rax
  jne    L22
L21:
  pop    %rbx
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopw   0x0(%rax,%rax,1)
L22:
  add    %rax,%rbp
  mov    $0x3a,%esi
  mov    %rax,%rbx
  mov    %rbp,%rdi
  call   <json_parse_sep@plt>
  mov    %rax,%r14
  test   %rax,%rax
  je     L21
  lea    0x0(%rbp,%rax,1),%rdi
  mov    %r13,%rdx
  mov    %r12,%rsi
  call   <json_parse_value@plt>
  test   %rax,%rax
  je     L21
  add    %r14,%rbx
  add    %rbx,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

assistant: ```c
size_t json_parse_pair(const char *str, char *name, size_t namesiz, char *val, size_t valsiz) {
  size_t pair_len = 0;
  size_t len;
  len = json_parse_string(str, name, namesiz);
  if (!len)
    return 0;
  pair_len += len;
  str += len;
  len = json_parse_sep(str, ':');
  if (!len)
    return 0;
  pair_len += len;
  str += len;
  len = json_parse_value(str, val, valsiz);
  if (!len)
    return 0;
  pair_len += len;
  return pair_len;
}
```