ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 下面的汇编指令对应的C源代码是什么:

```asm
<maxofarr>:
  endbr64
  mov    (%rdi),%eax
  mov    %rdi,%rdx
  mov    %esi,%ecx
  cmp    $0x1,%esi
  jle    L28
  lea    -0x1(%rsi),%edi
  lea    -0x2(%rsi),%esi
  cmp    $0x2,%esi
  jbe    L49
  mov    %edi,%esi
  movd   %eax,%xmm3
  lea    0x4(%rdx),%rax
  shr    $0x2,%esi
  pshufd $0x0,%xmm3,%xmm0
  sub    $0x1,%esi
  shl    $0x4,%rsi
  lea    0x14(%rdx,%rsi,1),%rsi
  nopl   0x0(%rax)
L23:
  movdqu (%rax),%xmm1
  add    $0x10,%rax
  movdqa %xmm1,%xmm2
  pcmpgtd %xmm0,%xmm2
  pand   %xmm2,%xmm1
  pandn  %xmm0,%xmm2
  movdqa %xmm2,%xmm0
  por    %xmm1,%xmm0
  cmp    %rsi,%rax
  jne    L23
  movdqa %xmm0,%xmm2
  mov    %edi,%r8d
  psrldq $0x8,%xmm2
  and    $0xfffffffc,%r8d
  movdqa %xmm2,%xmm1
  lea    0x1(%r8),%esi
  pcmpgtd %xmm0,%xmm1
  pand   %xmm1,%xmm2
  pandn  %xmm0,%xmm1
  por    %xmm2,%xmm1
  movdqa %xmm1,%xmm2
  psrldq $0x4,%xmm2
  movdqa %xmm2,%xmm0
  pcmpgtd %xmm1,%xmm0
  pand   %xmm0,%xmm2
  pandn  %xmm1,%xmm0
  por    %xmm2,%xmm0
  movd   %xmm0,%eax
  cmp    %r8d,%edi
  je     L29
L3:
  movslq %esi,%rdi
  lea    0x0(,%rdi,4),%r8
  mov    (%rdx,%rdi,4),%edi
  cmp    %edi,%eax
  cmovl  %edi,%eax
  lea    0x1(%rsi),%edi
  cmp    %edi,%ecx
  jle    L28
  mov    0x4(%rdx,%r8,1),%edi
  cmp    %edi,%eax
  cmovl  %edi,%eax
  add    $0x2,%esi
  cmp    %esi,%ecx
  jle    L28
  mov    0x8(%rdx,%r8,1),%edx
  cmp    %edx,%eax
  cmovl  %edx,%eax
L28:
  ret
  nopl   0x0(%rax)
L29:
  ret
L49:
  mov    $0x1,%esi
  jmp    L3
```

assistant: ```c
int maxofarr(int *ar, int n) {
  int max = ar[0];
  for (int i = 1; i < n; i++)
    max = ar[i] > max ? ar[i] : max;
  return max;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<SUB_HOST_REG_W>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %edi,-0x4(%rbp)
  mov    %esi,-0x8(%rbp)
  mov    -0x4(%rbp),%eax
  and    -0x8(%rbp),%eax
  and    $0x8,%eax
  test   %eax,%eax
  je     L34
  mov    $0x66,%edi
  call   <addbyte@plt>
  mov    $0x45,%edi
  call   <addbyte@plt>
  mov    $0x29,%edi
  call   <addbyte@plt>
  mov    -0x4(%rbp),%eax
  and    $0x7,%eax
  or     $0xc0,%al
  mov    %eax,%edx
  mov    -0x8(%rbp),%eax
  shl    $0x3,%eax
  and    $0x38,%eax
  or     %edx,%eax
  mov    %eax,%edi
  call   <addbyte@plt>
  jmp    L59
L34:
  mov    -0x4(%rbp),%eax
  and    $0x8,%eax
  test   %eax,%eax
  je     L2
  mov    $0x66,%edi
  call   <addbyte@plt>
  mov    $0x41,%edi
  call   <addbyte@plt>
  mov    $0x29,%edi
  call   <addbyte@plt>
  mov    -0x4(%rbp),%eax
  and    $0x7,%eax
  or     $0xc0,%al
  mov    %eax,%edx
  mov    -0x8(%rbp),%eax
  shl    $0x3,%eax
  and    $0x38,%eax
  or     %edx,%eax
  mov    %eax,%edi
  call   <addbyte@plt>
  jmp    L59
L2:
  mov    -0x8(%rbp),%eax
  and    $0x8,%eax
  test   %eax,%eax
  je     L37
  mov    $0x66,%edi
  call   <addbyte@plt>
  mov    $0x44,%edi
  call   <addbyte@plt>
  mov    $0x29,%edi
  call   <addbyte@plt>
  mov    -0x4(%rbp),%eax
  and    $0x7,%eax
  or     $0xc0,%al
  mov    %eax,%edx
  mov    -0x8(%rbp),%eax
  shl    $0x3,%eax
  and    $0x38,%eax
  or     %edx,%eax
  mov    %eax,%edi
  call   <addbyte@plt>
  jmp    L59
L37:
  mov    $0x66,%edi
  call   <addbyte@plt>
  mov    $0x29,%edi
  call   <addbyte@plt>
  mov    -0x4(%rbp),%eax
  and    $0x7,%eax
  or     $0xc0,%al
  mov    %eax,%edx
  mov    -0x8(%rbp),%eax
  shl    $0x3,%eax
  and    $0x38,%eax
  or     %edx,%eax
  mov    %eax,%edi
  call   <addbyte@plt>
L59:
  nop
  leave
  ret
```

assistant: ```c
void SUB_HOST_REG_W(int dst_reg, int src_reg) {
  if (dst_reg & src_reg & 8) {
    addbyte(0x66);
    addbyte(0x45);
    addbyte(0x29);
    addbyte(0xc0 | (dst_reg & 7) | ((src_reg & 7) << 3));
  } else if (dst_reg & 8) {
    addbyte(0x66);
    addbyte(0x41);
    addbyte(0x29);
    addbyte(0xc0 | (dst_reg & 7) | ((src_reg & 7) << 3));
  } else if (src_reg & 8) {
    addbyte(0x66);
    addbyte(0x44);
    addbyte(0x29);
    addbyte(0xc0 | (dst_reg & 7) | ((src_reg & 7) << 3));
  } else {
    addbyte(0x66);
    addbyte(0x29);
    addbyte(0xc0 | (dst_reg & 7) | ((src_reg & 7) << 3));
  }
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<SUB_HOST_REG_W>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %edi,%ebp
  mov    %esi,%ebx
  mov    %edi,%eax
  and    %esi,%eax
  test   $0x8,%al
  jne    L48
  test   $0x8,%dil
  jne    L22
  test   $0x8,%sil
  je     L11
  mov    $0x66,%edi
  call   <addbyte@plt>
  mov    $0x44,%edi
  call   <addbyte@plt>
  mov    $0x29,%edi
  call   <addbyte@plt>
  lea    0x0(,%rbx,8),%edi
  and    $0x38,%edi
  and    $0x7,%ebp
  or     %ebp,%edi
  or     $0xc0,%dil
  call   <addbyte@plt>
  jmp    L49
L48:
  mov    $0x66,%edi
  call   <addbyte@plt>
  mov    $0x45,%edi
  call   <addbyte@plt>
  mov    $0x29,%edi
  call   <addbyte@plt>
  lea    0x0(,%rbx,8),%edi
  and    $0x38,%edi
  and    $0x7,%ebp
  or     %ebp,%edi
  or     $0xc0,%dil
  call   <addbyte@plt>
L49:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
L22:
  mov    $0x66,%edi
  call   <addbyte@plt>
  mov    $0x41,%edi
  call   <addbyte@plt>
  mov    $0x29,%edi
  call   <addbyte@plt>
  lea    0x0(,%rbx,8),%edi
  and    $0x38,%edi
  and    $0x7,%ebp
  or     %ebp,%edi
  or     $0xc0,%dil
  call   <addbyte@plt>
  jmp    L49
L11:
  mov    $0x66,%edi
  call   <addbyte@plt>
  mov    $0x29,%edi
  call   <addbyte@plt>
  lea    0x0(,%rbx,8),%edi
  and    $0x38,%edi
  and    $0x7,%ebp
  or     %ebp,%edi
  or     $0xc0,%dil
  call   <addbyte@plt>
  jmp    L49
```

assistant: ```c
void SUB_HOST_REG_W(int dst_reg, int src_reg) {
  if (dst_reg & src_reg & 8) {
    addbyte(0x66);
    addbyte(0x45);
    addbyte(0x29);
    addbyte(0xc0 | (dst_reg & 7) | ((src_reg & 7) << 3));
  } else if (dst_reg & 8) {
    addbyte(0x66);
    addbyte(0x41);
    addbyte(0x29);
    addbyte(0xc0 | (dst_reg & 7) | ((src_reg & 7) << 3));
  } else if (src_reg & 8) {
    addbyte(0x66);
    addbyte(0x44);
    addbyte(0x29);
    addbyte(0xc0 | (dst_reg & 7) | ((src_reg & 7) << 3));
  } else {
    addbyte(0x66);
    addbyte(0x29);
    addbyte(0xc0 | (dst_reg & 7) | ((src_reg & 7) << 3));
  }
}
```
user: What is the c source code of the assembly code below?

```asm
<SUB_HOST_REG_W>:
  endbr64
  lea    0x0(,%rsi,8),%eax
  mov    %edi,%edx
  push   %rbp
  and    $0x38,%eax
  and    $0x7,%edx
  or     %edx,%eax
  or     $0xc0,%al
  mov    %eax,%ebp
  mov    %edi,%eax
  and    %esi,%eax
  test   $0x8,%al
  jne    L37
  and    $0x8,%edi
  mov    $0x66,%edi
  jne    L27
  and    $0x8,%esi
  je     L3
  call   <addbyte@plt>
  mov    $0x44,%edi
L3:
  call   <addbyte@plt>
  mov    $0x29,%edi
  call   <addbyte@plt>
  mov    %ebp,%edi
  pop    %rbp
  jmp    1050 <addbyte@plt>
  nopw   0x0(%rax,%rax,1)
L27:
  call   <addbyte@plt>
  mov    $0x41,%edi
  jmp    L3
  nopl   0x0(%rax)
L37:
  mov    $0x66,%edi
  call   <addbyte@plt>
  mov    $0x45,%edi
  jmp    L3
```

assistant: ```c
void SUB_HOST_REG_W(int dst_reg, int src_reg) {
  if (dst_reg & src_reg & 8) {
    addbyte(0x66);
    addbyte(0x45);
    addbyte(0x29);
    addbyte(0xc0 | (dst_reg & 7) | ((src_reg & 7) << 3));
  } else if (dst_reg & 8) {
    addbyte(0x66);
    addbyte(0x41);
    addbyte(0x29);
    addbyte(0xc0 | (dst_reg & 7) | ((src_reg & 7) << 3));
  } else if (src_reg & 8) {
    addbyte(0x66);
    addbyte(0x44);
    addbyte(0x29);
    addbyte(0xc0 | (dst_reg & 7) | ((src_reg & 7) << 3));
  } else {
    addbyte(0x66);
    addbyte(0x29);
    addbyte(0xc0 | (dst_reg & 7) | ((src_reg & 7) << 3));
  }
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<SUB_HOST_REG_W>:
  endbr64
  lea    0x0(,%rsi,8),%eax
  mov    %edi,%edx
  push   %rbp
  and    $0x38,%eax
  and    $0x7,%edx
  or     %edx,%eax
  or     $0xc0,%al
  mov    %eax,%ebp
  mov    %edi,%eax
  and    %esi,%eax
  test   $0x8,%al
  jne    L3
  and    $0x8,%edi
  mov    $0x66,%edi
  jne    L23
  and    $0x8,%esi
  je     L49
  call   <addbyte@plt>
  mov    $0x44,%edi
L49:
  call   <addbyte@plt>
  mov    $0x29,%edi
  call   <addbyte@plt>
  mov    %ebp,%edi
  pop    %rbp
  jmp    1050 <addbyte@plt>
  nopw   0x0(%rax,%rax,1)
L23:
  call   <addbyte@plt>
  mov    $0x41,%edi
  jmp    L49
  nopl   0x0(%rax)
L3:
  mov    $0x66,%edi
  call   <addbyte@plt>
  mov    $0x45,%edi
  jmp    L49
```

assistant: ```c
void SUB_HOST_REG_W(int dst_reg, int src_reg) {
  if (dst_reg & src_reg & 8) {
    addbyte(0x66);
    addbyte(0x45);
    addbyte(0x29);
    addbyte(0xc0 | (dst_reg & 7) | ((src_reg & 7) << 3));
  } else if (dst_reg & 8) {
    addbyte(0x66);
    addbyte(0x41);
    addbyte(0x29);
    addbyte(0xc0 | (dst_reg & 7) | ((src_reg & 7) << 3));
  } else if (src_reg & 8) {
    addbyte(0x66);
    addbyte(0x44);
    addbyte(0x29);
    addbyte(0xc0 | (dst_reg & 7) | ((src_reg & 7) << 3));
  } else {
    addbyte(0x66);
    addbyte(0x29);
    addbyte(0xc0 | (dst_reg & 7) | ((src_reg & 7) << 3));
  }
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    $0x0,%eax
  call   <domain_init@plt>
  mov    $0x0,%eax
  call   <solver_init@plt>
  mov    $0x0,%eax
  call   <solver_bfs@plt>
  mov    $0x0,%eax
  pop    %rbp
  ret
```

assistant: ```c
int main() {
  domain_init();
  solver_init();
  solver_bfs();
  return 0;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x0,%eax
  call   <domain_init@plt>
  mov    $0x0,%eax
  call   <solver_init@plt>
  mov    $0x0,%eax
  call   <solver_bfs@plt>
  mov    $0x0,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int main() {
  domain_init();
  solver_init();
  solver_bfs();
  return 0;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  xor    %eax,%eax
  call   <domain_init@plt>
  xor    %eax,%eax
  call   <solver_init@plt>
  xor    %eax,%eax
  call   <solver_bfs@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int main() {
  domain_init();
  solver_init();
  solver_bfs();
  return 0;
}
```
user: Translate the below assembly code into C programming language:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  xor    %eax,%eax
  call   <domain_init@plt>
  xor    %eax,%eax
  call   <solver_init@plt>
  xor    %eax,%eax
  call   <solver_bfs@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int main() {
  domain_init();
  solver_init();
  solver_bfs();
  return 0;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<f6>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x14(%rbp)
  mov    %esi,-0x18(%rbp)
  mov    -0x18(%rbp),%edx
  mov    -0x14(%rbp),%eax
  sub    %edx,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%edx
  mov    -0x18(%rbp),%eax
  add    %edx,%eax
  pop    %rbp
  ret
```

assistant: ```c
unsigned f6(int x, unsigned y) {
  unsigned a = x - (int)y;
  return a + y;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<f6>:
  endbr64
  mov    %edi,%eax
  ret
```

assistant: ```c
unsigned f6(int x, unsigned y) {
  unsigned a = x - (int)y;
  return a + y;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<f6>:
  endbr64
  mov    %edi,%eax
  ret
```

assistant: ```c
unsigned f6(int x, unsigned y) {
  unsigned a = x - (int)y;
  return a + y;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<f6>:
  endbr64
  mov    %edi,%eax
  ret
```

assistant: ```c
unsigned f6(int x, unsigned y) {
  unsigned a = x - (int)y;
  return a + y;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<DayNum>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %edi,-0x34(%rbp)
  mov    %esi,-0x38(%rbp)
  mov    %edx,-0x3c(%rbp)
  cmpl   $0x2,-0x34(%rbp)
  jg     L14
  subl   $0x1,-0x3c(%rbp)
  addl   $0xc,-0x34(%rbp)
L14:
  cmpl   $0x38,-0x3c(%rbp)
  jg     L1
  addl   $0x64,-0x3c(%rbp)
L1:
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x3c(%rbp),%xmm0
  movsd  %xmm0,-0x28(%rbp)
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x34(%rbp),%xmm0
  movsd  %xmm0,-0x20(%rbp)
  movsd  -0x28(%rbp),%xmm0
  movsd  D47(%rip),%xmm2
  movapd %xmm0,%xmm1
  subsd  %xmm2,%xmm1
  movsd  D77(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  movq   %xmm1,%rax
  movq   %rax,%xmm0
  call   <floor@plt>
  movq   %xmm0,%rbx
  movsd  -0x28(%rbp),%xmm0
  movsd  D65(%rip),%xmm2
  movapd %xmm0,%xmm1
  divsd  %xmm2,%xmm1
  movsd  D13(%rip),%xmm0
  addsd  %xmm0,%xmm1
  movq   %xmm1,%rax
  movq   %rax,%xmm0
  call   <floor@plt>
  movq   %rbx,%xmm3
  subsd  %xmm0,%xmm3
  movsd  %xmm3,-0x48(%rbp)
  movsd  -0x28(%rbp),%xmm0
  movsd  D27(%rip),%xmm2
  movapd %xmm0,%xmm1
  divsd  %xmm2,%xmm1
  movsd  D17(%rip),%xmm0
  addsd  %xmm0,%xmm1
  movq   %xmm1,%rax
  movq   %rax,%xmm0
  call   <floor@plt>
  addsd  -0x48(%rbp),%xmm0
  movsd  D29(%rip),%xmm1
  subsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x34(%rbp),%eax
  imul   $0x1e,%eax,%edx
  mov    -0x38(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rbx
  movsd  -0x20(%rbp),%xmm1
  movsd  D44(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  D78(%rip),%xmm1
  subsd  %xmm1,%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <floor@plt>
  cvttsd2si %xmm0,%rax
  add    %rbx,%rax
  add    %rax,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D47
data_type: f64
name: unpack_data
arguments: data_label: D77
data_type: f64
name: unpack_data
arguments: data_label: D65
data_type: f64
name: unpack_data
arguments: data_label: D13
data_type: f64
name: unpack_data
arguments: data_label: D27
data_type: f64
name: unpack_data
arguments: data_label: D17
data_type: f64
name: unpack_data
arguments: data_label: D29
data_type: f64
name: unpack_data
arguments: data_label: D44
data_type: f64
name: unpack_data
arguments: data_label: D78
data_type: f64

tool: D47: 80

tool: D77: 365.25

tool: D65: 100

tool: D13: 19

tool: D27: 400

tool: D17: 4.75

tool: D29: 16

tool: D44: 0.6

tool: D78: 0.3

assistant: ```c
long DayNum(m, d, y)
int m, d, y;
{
  long dn;
  double mm, yy;
  if (m < 3) {
    y--;
    m += 12;
  }
  if (y < 57)
    y += 100;
  yy = (double)y;
  mm = (double)m;
  dn = (long)(floor(365.25 * (yy - 80.0)) - floor(19.0 + yy / 100.0) + floor(4.75 + yy / 400.0) - 16.0);
  dn += d + 30 * m + (long)floor(0.6 * mm - 0.3);
  return dn;
}
```
user: Translate the below assembly code into C programming language:

```asm
<put_salinity>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    %esi,-0xc(%rbp)
  mov    %rdx,-0x18(%rbp)
  mov    %rcx,-0x20(%rbp)
  cmpl   $0x0,-0xc(%rbp)
  je     L0
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  imul   $0x66666667,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x2,%edx
  sar    $0x1f,%eax
  mov    %edx,%ecx
  sub    %eax,%ecx
  mov    -0x20(%rbp),%rsi
  mov    -0x18(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  mov    %rsi,%r8
  lea    D2(%rip),%rsi
  mov    %rax,%rdi
  call   <put_format@plt>
L0:
  nop
  leave
  ret
```

tool_calls: name: read_data
arguments: tag: D2
type_guessed: string

tool: D2: %s%d%s

assistant: ```c
void put_salinity(struct membuffer *b, int salinity, const char *pre, const char *post) {
  if (salinity)
    put_format(b, "%s%d%s", pre, salinity / 10, post);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<put_salinity>:
  endbr64
  test   %esi,%esi
  jne    L2
  ret
L2:
  sub    $0x8,%rsp
  movslq %esi,%rax
  imul   $0x66666667,%rax,%rax
  sar    $0x22,%rax
  sar    $0x1f,%esi
  sub    %esi,%eax
  mov    %rcx,%r8
  mov    %eax,%ecx
  lea    D6(%rip),%rsi
  call   <put_format@plt>
  add    $0x8,%rsp
  ret
```

tool_calls: name: unpack_data
arguments: label: D6
type_guessed: string

tool: D6: %s%d%s

assistant: ```c
void put_salinity(struct membuffer *b, int salinity, const char *pre, const char *post) {
  if (salinity)
    put_format(b, "%s%d%s", pre, salinity / 10, post);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<put_salinity>:
  endbr64
  test   %esi,%esi
  jne    L2
  ret
  nopl   0x0(%rax)
L2:
  movslq %esi,%r9
  sar    $0x1f,%esi
  mov    %rcx,%r8
  imul   $0x66666667,%r9,%r9
  sar    $0x22,%r9
  sub    %esi,%r9d
  lea    D0(%rip),%rsi
  mov    %r9d,%ecx
  jmp    1050 <put_format@plt>
```

tool_calls: name: read_data
arguments: label: D0
data_type: string

tool: D0: %s%d%s

assistant: ```c
void put_salinity(struct membuffer *b, int salinity, const char *pre, const char *post) {
  if (salinity)
    put_format(b, "%s%d%s", pre, salinity / 10, post);
}
```
user: Translate the below assembly code into C programming language:

```asm
<put_salinity>:
  endbr64
  test   %esi,%esi
  jne    L9
  ret
  nopl   0x0(%rax)
L9:
  movslq %esi,%r9
  sar    $0x1f,%esi
  mov    %rcx,%r8
  imul   $0x66666667,%r9,%r9
  sar    $0x22,%r9
  sub    %esi,%r9d
  lea    D4(%rip),%rsi
  mov    %r9d,%ecx
  jmp    1050 <put_format@plt>
```

tool_calls: name: parse_data
arguments: data_label: D4
type: string

tool: D4: %s%d%s

assistant: ```c
void put_salinity(struct membuffer *b, int salinity, const char *pre, const char *post) {
  if (salinity)
    put_format(b, "%s%d%s", pre, salinity / 10, post);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<smprintf>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xe0,%rsp
  mov    %rdi,-0xd8(%rbp)
  mov    %rsi,-0xa8(%rbp)
  mov    %rdx,-0xa0(%rbp)
  mov    %rcx,-0x98(%rbp)
  mov    %r8,-0x90(%rbp)
  mov    %r9,-0x88(%rbp)
  test   %al,%al
  je     L33
  movaps %xmm0,-0x80(%rbp)
  movaps %xmm1,-0x70(%rbp)
  movaps %xmm2,-0x60(%rbp)
  movaps %xmm3,-0x50(%rbp)
  movaps %xmm4,-0x40(%rbp)
  movaps %xmm5,-0x30(%rbp)
  movaps %xmm6,-0x20(%rbp)
  movaps %xmm7,-0x10(%rbp)
L33:
  mov    -0xd8(%rbp),%rdx
  mov    -0xc4(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <va_start@plt>
  mov    -0xc4(%rbp),%edx
  mov    -0xd8(%rbp),%rax
  mov    %edx,%ecx
  mov    %rax,%rdx
  mov    $0x0,%esi
  mov    $0x0,%edi
  call   <vsnprintf@plt>
  mov    %eax,-0xc0(%rbp)
  mov    -0xc4(%rbp),%eax
  mov    %eax,%edi
  call   <va_end@plt>
  addl   $0x1,-0xc0(%rbp)
  mov    -0xc0(%rbp),%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0xb8(%rbp)
  cmpq   $0x0,-0xb8(%rbp)
  jne    L23
  mov    $0x0,%eax
  jmp    L28
L23:
  mov    -0xd8(%rbp),%rdx
  mov    -0xc4(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <va_start@plt>
  mov    -0xc4(%rbp),%ecx
  mov    -0xd8(%rbp),%rdx
  mov    -0xc0(%rbp),%esi
  mov    -0xb8(%rbp),%rax
  mov    %rax,%rdi
  call   <vsnprintf@plt>
  mov    %eax,-0xbc(%rbp)
  mov    -0xc4(%rbp),%eax
  mov    %eax,%edi
  call   <va_end@plt>
  mov    -0xbc(%rbp),%eax
  cmp    -0xc0(%rbp),%eax
  jl     L30
  mov    -0xc0(%rbp),%eax
  sub    $0x1,%eax
  jmp    L25
L30:
  mov    -0xbc(%rbp),%eax
L25:
  mov    %eax,-0xbc(%rbp)
  mov    -0xbc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0xb8(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0xb8(%rbp),%rax
L28:
  leave
  ret
```

assistant: ```c
char *smprintf(char *fmt, ...) {
  va_list va;
  char *buf;
  int len, cap;
  va_start(va, fmt);
  cap = vsnprintf(NULL, 0, fmt, va);
  va_end(va);
  cap += 1;
  buf = malloc(cap);
  if (buf == NULL)
    return NULL;
  va_start(va, fmt);
  len = vsnprintf(buf, cap, fmt, va);
  va_end(va);
  len = len < cap ? len : cap - 1;
  buf[len] = '\0';
  return buf;
}
```
user: What is the c source code of the assembly code below:

```asm
<smprintf>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbp
  mov    %rdi,%rsi
  mov    $0x0,%r12d
  mov    %r12d,%edi
  call   <va_start@plt>
  mov    %r12d,%ecx
  mov    %rbp,%rdx
  mov    $0x0,%esi
  mov    $0x0,%edi
  call   <vsnprintf@plt>
  mov    %eax,%ebx
  mov    %r12d,%edi
  call   <va_end@plt>
  lea    0x1(%rbx),%r14d
  mov    %r14d,%edi
  call   <malloc@plt>
  mov    %rax,%r13
  test   %rax,%rax
  je     L3
  mov    %rbp,%rsi
  mov    %r12d,%edi
  call   <va_start@plt>
  mov    %r12d,%ecx
  mov    %rbp,%rdx
  mov    %r14d,%esi
  mov    %r13,%rdi
  call   <vsnprintf@plt>
  mov    %eax,%ebp
  mov    %r12d,%edi
  call   <va_end@plt>
  cmp    %ebp,%r14d
  cmovg  %ebp,%ebx
  movslq %ebx,%rbx
  movb   $0x0,0x0(%r13,%rbx,1)
L3:
  mov    %r13,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

assistant: ```c
char *smprintf(char *fmt, ...) {
  va_list va;
  char *buf;
  int len, cap;
  va_start(va, fmt);
  cap = vsnprintf(NULL, 0, fmt, va);
  va_end(va);
  cap += 1;
  buf = malloc(cap);
  if (buf == NULL)
    return NULL;
  va_start(va, fmt);
  len = vsnprintf(buf, cap, fmt, va);
  va_end(va);
  len = len < cap ? len : cap - 1;
  buf[len] = '\0';
  return buf;
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<smprintf>:
  endbr64
  push   %r14
  mov    %rdi,%rsi
  push   %r13
  mov    %rdi,%r13
  push   %r12
  push   %rbp
  xor    %ebp,%ebp
  push   %rbx
  mov    %ebp,%edi
  call   <va_start@plt>
  mov    %ebp,%ecx
  mov    %r13,%rdx
  xor    %esi,%esi
  xor    %edi,%edi
  call   <vsnprintf@plt>
  mov    %ebp,%edi
  movslq %eax,%rbx
  call   <va_end@plt>
  lea    0x1(%rbx),%r14d
  mov    %r14d,%edi
  call   <malloc@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L5
  mov    %r13,%rsi
  mov    %ebp,%edi
  call   <va_start@plt>
  mov    %r13,%rdx
  mov    %ebp,%ecx
  mov    %r14d,%esi
  mov    %r12,%rdi
  call   <vsnprintf@plt>
  mov    %ebp,%edi
  movslq %eax,%r13
  call   <va_end@plt>
  cmp    %r13d,%r14d
  cmovg  %r13,%rbx
  movb   $0x0,(%r12,%rbx,1)
L5:
  pop    %rbx
  mov    %r12,%rax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

assistant: ```c
char *smprintf(char *fmt, ...) {
  va_list va;
  char *buf;
  int len, cap;
  va_start(va, fmt);
  cap = vsnprintf(NULL, 0, fmt, va);
  va_end(va);
  cap += 1;
  buf = malloc(cap);
  if (buf == NULL)
    return NULL;
  va_start(va, fmt);
  len = vsnprintf(buf, cap, fmt, va);
  va_end(va);
  len = len < cap ? len : cap - 1;
  buf[len] = '\0';
  return buf;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<smprintf>:
  endbr64
  push   %r14
  mov    %rdi,%rsi
  push   %r13
  mov    %rdi,%r13
  push   %r12
  push   %rbp
  xor    %ebp,%ebp
  push   %rbx
  mov    %ebp,%edi
  call   <va_start@plt>
  mov    %ebp,%ecx
  mov    %r13,%rdx
  xor    %esi,%esi
  xor    %edi,%edi
  call   <vsnprintf@plt>
  mov    %ebp,%edi
  movslq %eax,%rbx
  call   <va_end@plt>
  lea    0x1(%rbx),%r14d
  mov    %r14d,%edi
  call   <malloc@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L3
  mov    %r13,%rsi
  mov    %ebp,%edi
  call   <va_start@plt>
  mov    %r13,%rdx
  mov    %ebp,%ecx
  mov    %r14d,%esi
  mov    %r12,%rdi
  call   <vsnprintf@plt>
  mov    %ebp,%edi
  movslq %eax,%r13
  call   <va_end@plt>
  cmp    %r13d,%r14d
  cmovg  %r13,%rbx
  movb   $0x0,(%r12,%rbx,1)
L3:
  pop    %rbx
  mov    %r12,%rax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

assistant: ```c
char *smprintf(char *fmt, ...) {
  va_list va;
  char *buf;
  int len, cap;
  va_start(va, fmt);
  cap = vsnprintf(NULL, 0, fmt, va);
  va_end(va);
  cap += 1;
  buf = malloc(cap);
  if (buf == NULL)
    return NULL;
  va_start(va, fmt);
  len = vsnprintf(buf, cap, fmt, va);
  va_end(va);
  len = len < cap ? len : cap - 1;
  buf[len] = '\0';
  return buf;
}
```