ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 请将以下的汇编代码转换成C语言代码:

```asm
<very_simple_animation>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  movl   $0x140,-0x14(%rbp)
  movl   $0xf0,-0x10(%rbp)
  movl   $0x5,-0xc(%rbp)
  movl   $0x5,-0x8(%rbp)
  movl   $0x32,-0x4(%rbp)
  mov    $0xff,%edi
  call   <cng_current_color_index@plt>
  mov    $0x0,%eax
  call   <cng_clear_screen@plt>
  mov    $0x3,%edi
  call   <cng_current_color_index@plt>
  mov    $0x0,%ecx
  mov    $0x280,%edx
  mov    $0x0,%esi
  mov    $0x0,%edi
  call   <cng_line@plt>
  mov    $0x0,%eax
  call   <cng_start_clock@plt>
  movl   $0x0,-0x18(%rbp)
  jmp    L23
L26:
  mov    -0x14(%rbp),%edx
  mov    -0xc(%rbp),%eax
  add    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    %edx,%eax
  cmp    $0x280,%eax
  jg     L46
  mov    -0xc(%rbp),%eax
  mov    %eax,%edx
  neg    %edx
  cmovs  %eax,%edx
  mov    -0x14(%rbp),%eax
  sub    %edx,%eax
  sub    -0x4(%rbp),%eax
  test   %eax,%eax
  jns    L43
L46:
  negl   -0xc(%rbp)
L43:
  mov    -0x10(%rbp),%edx
  mov    -0x8(%rbp),%eax
  add    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    %edx,%eax
  cmp    $0x1e0,%eax
  jg     L2
  mov    -0x8(%rbp),%eax
  mov    %eax,%edx
  neg    %edx
  cmovs  %eax,%edx
  mov    -0x10(%rbp),%eax
  sub    %edx,%eax
  sub    -0x4(%rbp),%eax
  test   %eax,%eax
  jns    L10
L2:
  negl   -0x8(%rbp)
L10:
  mov    -0xc(%rbp),%eax
  add    %eax,-0x14(%rbp)
  mov    -0x8(%rbp),%eax
  add    %eax,-0x10(%rbp)
  mov    $0x3,%edi
  call   <cng_current_color_index@plt>
  mov    -0x4(%rbp),%edx
  mov    -0x10(%rbp),%ecx
  mov    -0x14(%rbp),%eax
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <cng_circle@plt>
  mov    $0xff,%edi
  call   <cng_current_color_index@plt>
  mov    $0x0,%eax
  call   <cng_clear_screen@plt>
  addl   $0x1,-0x18(%rbp)
L23:
  cmpl   $0x1f3,-0x18(%rbp)
  jle    L26
  mov    $0x0,%eax
  call   <cng_get_time@plt>
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  lea    D1(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x1f4,%edi
  call   <cng_delay@plt>
  mov    $0x0,%eax
  call   <menu@plt>
  nop
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: label: D1
type_infered: string

tool: D1: Temps : %f


assistant: ```c
int very_simple_animation() {
  int i;
  int cx = 640 / 2, cy = 480 / 2;
  int vx = 5, vy = 5;
  int cra = 50;
  cng_current_color_index(255);
  cng_clear_screen();
  cng_current_color_index(3);
  cng_line(0, 0, 640, 0);
  cng_start_clock();
  for (i = 0; i < 500; i++) {
    if ((cx + vx + cra > 640) || (cx - abs(vx) - cra < 0))
      vx = -vx;
    if ((cy + vy + cra > 480) || (cy - abs(vy) - cra < 0))
      vy = -vy;
    cx += vx;
    cy += vy;
    cng_current_color_index(3);
    cng_circle(cx, cy, cra);
    cng_current_color_index(255);
    cng_clear_screen();
  }
  printf("Temps : %f\n", cng_get_time());
  cng_delay(500);
  menu();
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<very_simple_animation>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    $0xff,%edi
  call   <cng_current_color_index@plt>
  mov    $0x0,%eax
  call   <cng_clear_screen@plt>
  mov    $0x3,%edi
  call   <cng_current_color_index@plt>
  mov    $0x0,%ecx
  mov    $0x280,%edx
  mov    $0x0,%esi
  mov    $0x0,%edi
  call   <cng_line@plt>
  mov    $0x0,%eax
  call   <cng_start_clock@plt>
  mov    $0x1f4,%r14d
  mov    $0x5,%ebp
  mov    $0x5,%ebx
  mov    $0xf0,%r13d
  mov    $0x140,%r12d
  jmp    L34
L13:
  neg    %ebx
L8:
  lea    0x0(%r13,%rbp,1),%eax
  cmp    $0x1ae,%eax
  jg     L39
  mov    %ebp,%eax
  neg    %eax
  cmovs  %ebp,%eax
  mov    %r13d,%edx
  sub    %eax,%edx
  cmp    $0x31,%edx
  jg     L0
L39:
  neg    %ebp
L0:
  add    %ebx,%r12d
  add    %ebp,%r13d
  mov    $0x3,%edi
  call   <cng_current_color_index@plt>
  mov    $0x32,%edx
  mov    %r13d,%esi
  mov    %r12d,%edi
  call   <cng_circle@plt>
  mov    $0xff,%edi
  call   <cng_current_color_index@plt>
  mov    $0x0,%eax
  call   <cng_clear_screen@plt>
  sub    $0x1,%r14d
  je     L4
L34:
  lea    (%r12,%rbx,1),%eax
  cmp    $0x24e,%eax
  jg     L13
  mov    %ebx,%eax
  neg    %eax
  cmovs  %ebx,%eax
  mov    %r12d,%edx
  sub    %eax,%edx
  cmp    $0x31,%edx
  jg     L8
  jmp    L13
L4:
  mov    $0x0,%eax
  call   <cng_get_time@plt>
  lea    D3(%rip),%rdi
  call   <printf@plt>
  mov    $0x1f4,%edi
  call   <cng_delay@plt>
  mov    $0x0,%eax
  call   <menu@plt>
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D3
type_guessed: string

tool: D3: Temps : %f


assistant: ```c
int very_simple_animation() {
  int i;
  int cx = 640 / 2, cy = 480 / 2;
  int vx = 5, vy = 5;
  int cra = 50;
  cng_current_color_index(255);
  cng_clear_screen();
  cng_current_color_index(3);
  cng_line(0, 0, 640, 0);
  cng_start_clock();
  for (i = 0; i < 500; i++) {
    if ((cx + vx + cra > 640) || (cx - abs(vx) - cra < 0))
      vx = -vx;
    if ((cy + vy + cra > 480) || (cy - abs(vy) - cra < 0))
      vy = -vy;
    cx += vx;
    cy += vy;
    cng_current_color_index(3);
    cng_circle(cx, cy, cra);
    cng_current_color_index(255);
    cng_clear_screen();
  }
  printf("Temps : %f\n", cng_get_time());
  cng_delay(500);
  menu();
}
```
user: What is the c source code of the assembly code below:

```asm
<very_simple_animation>:
  endbr64
  push   %r14
  mov    $0xff,%edi
  mov    $0x1f4,%r14d
  push   %r13
  mov    $0xf0,%r13d
  push   %r12
  mov    $0x140,%r12d
  push   %rbp
  mov    $0x5,%ebp
  push   %rbx
  mov    $0x5,%ebx
  call   <cng_current_color_index@plt>
  xor    %eax,%eax
  call   <cng_clear_screen@plt>
  mov    $0x3,%edi
  call   <cng_current_color_index@plt>
  xor    %ecx,%ecx
  mov    $0x280,%edx
  xor    %esi,%esi
  xor    %edi,%edi
  call   <cng_line@plt>
  xor    %eax,%eax
  call   <cng_start_clock@plt>
  jmp    L39
  nopl   0x0(%rax)
L0:
  mov    %ebx,%edx
  mov    %r12d,%ecx
  neg    %edx
  cmovs  %ebx,%edx
  sub    %edx,%ecx
  cmp    $0x31,%ecx
  jle    L63
  mov    %eax,%r12d
  lea    0x0(%r13,%rbp,1),%eax
  cmp    $0x1ae,%eax
  jg     L51
L34:
  mov    %ebp,%edx
  mov    %r13d,%ecx
  neg    %edx
  cmovs  %ebp,%edx
  sub    %edx,%ecx
  cmp    $0x31,%ecx
  jle    L51
  mov    %eax,%r13d
L67:
  mov    $0x3,%edi
  call   <cng_current_color_index@plt>
  mov    $0x32,%edx
  mov    %r13d,%esi
  mov    %r12d,%edi
  call   <cng_circle@plt>
  mov    $0xff,%edi
  call   <cng_current_color_index@plt>
  xor    %eax,%eax
  call   <cng_clear_screen@plt>
  sub    $0x1,%r14d
  je     L17
L39:
  lea    (%r12,%rbx,1),%eax
  cmp    $0x24e,%eax
  jle    L0
L63:
  lea    0x0(%r13,%rbp,1),%eax
  sub    %ebx,%r12d
  neg    %ebx
  cmp    $0x1ae,%eax
  jle    L34
L51:
  sub    %ebp,%r13d
  neg    %ebp
  jmp    L67
L17:
  xor    %eax,%eax
  call   <cng_get_time@plt>
  lea    D1(%rip),%rdi
  call   <printf@plt>
  mov    $0x1f4,%edi
  call   <cng_delay@plt>
  pop    %rbx
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  jmp    10d0 <menu@plt>
```

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

tool: D1: Temps : %f


assistant: ```c
int very_simple_animation() {
  int i;
  int cx = 640 / 2, cy = 480 / 2;
  int vx = 5, vy = 5;
  int cra = 50;
  cng_current_color_index(255);
  cng_clear_screen();
  cng_current_color_index(3);
  cng_line(0, 0, 640, 0);
  cng_start_clock();
  for (i = 0; i < 500; i++) {
    if ((cx + vx + cra > 640) || (cx - abs(vx) - cra < 0))
      vx = -vx;
    if ((cy + vy + cra > 480) || (cy - abs(vy) - cra < 0))
      vy = -vy;
    cx += vx;
    cy += vy;
    cng_current_color_index(3);
    cng_circle(cx, cy, cra);
    cng_current_color_index(255);
    cng_clear_screen();
  }
  printf("Temps : %f\n", cng_get_time());
  cng_delay(500);
  menu();
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<very_simple_animation>:
  endbr64
  push   %r14
  mov    $0xff,%edi
  mov    $0x1f4,%r14d
  push   %r13
  mov    $0xf0,%r13d
  push   %r12
  mov    $0x140,%r12d
  push   %rbp
  mov    $0x5,%ebp
  push   %rbx
  mov    $0x5,%ebx
  call   <cng_current_color_index@plt>
  xor    %eax,%eax
  call   <cng_clear_screen@plt>
  mov    $0x3,%edi
  call   <cng_current_color_index@plt>
  xor    %ecx,%ecx
  mov    $0x280,%edx
  xor    %esi,%esi
  xor    %edi,%edi
  call   <cng_line@plt>
  xor    %eax,%eax
  call   <cng_start_clock@plt>
  jmp    L55
  nopl   0x0(%rax)
L14:
  mov    %ebx,%edx
  mov    %r12d,%ecx
  neg    %edx
  cmovs  %ebx,%edx
  sub    %edx,%ecx
  cmp    $0x31,%ecx
  jle    L17
  mov    %eax,%r12d
  lea    0x0(%r13,%rbp,1),%eax
  cmp    $0x1ae,%eax
  jg     L50
L58:
  mov    %ebp,%edx
  mov    %r13d,%ecx
  neg    %edx
  cmovs  %ebp,%edx
  sub    %edx,%ecx
  cmp    $0x31,%ecx
  jle    L50
  mov    %eax,%r13d
L48:
  mov    $0x3,%edi
  call   <cng_current_color_index@plt>
  mov    $0x32,%edx
  mov    %r13d,%esi
  mov    %r12d,%edi
  call   <cng_circle@plt>
  mov    $0xff,%edi
  call   <cng_current_color_index@plt>
  xor    %eax,%eax
  call   <cng_clear_screen@plt>
  sub    $0x1,%r14d
  je     L28
L55:
  lea    (%r12,%rbx,1),%eax
  cmp    $0x24e,%eax
  jle    L14
L17:
  lea    0x0(%r13,%rbp,1),%eax
  sub    %ebx,%r12d
  neg    %ebx
  cmp    $0x1ae,%eax
  jle    L58
L50:
  sub    %ebp,%r13d
  neg    %ebp
  jmp    L48
L28:
  xor    %eax,%eax
  call   <cng_get_time@plt>
  lea    D3(%rip),%rdi
  call   <printf@plt>
  mov    $0x1f4,%edi
  call   <cng_delay@plt>
  pop    %rbx
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  jmp    10d0 <menu@plt>
```

tool_calls: name: read_data
arguments: data_label: D3
datatype: string

tool: D3: Temps : %f


assistant: ```c
int very_simple_animation() {
  int i;
  int cx = 640 / 2, cy = 480 / 2;
  int vx = 5, vy = 5;
  int cra = 50;
  cng_current_color_index(255);
  cng_clear_screen();
  cng_current_color_index(3);
  cng_line(0, 0, 640, 0);
  cng_start_clock();
  for (i = 0; i < 500; i++) {
    if ((cx + vx + cra > 640) || (cx - abs(vx) - cra < 0))
      vx = -vx;
    if ((cy + vy + cra > 480) || (cy - abs(vy) - cra < 0))
      vy = -vy;
    cx += vx;
    cy += vy;
    cng_current_color_index(3);
    cng_circle(cx, cy, cra);
    cng_current_color_index(255);
    cng_clear_screen();
  }
  printf("Temps : %f\n", cng_get_time());
  cng_delay(500);
  menu();
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<LinInterp2D>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x18(%rbp)
  movsd  %xmm0,-0x20(%rbp)
  movsd  %xmm1,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    -0x20(%rbp),%rax
  movq   %rax,%xmm0
  call   <floor@plt>
  mov    %rax,-0x10(%rbp)
  pxor   %xmm1,%xmm1
  cvtsi2sdq -0x10(%rbp),%xmm1
  movsd  -0x20(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  cmpq   $0x0,-0x10(%rbp)
  jns    L14
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  mov    -0x38(%rbp),%rcx
  mov    -0x28(%rbp),%rdx
  mov    %rcx,%rsi
  movq   %rdx,%xmm0
  mov    %rax,%rdi
  call   <LinInterp1D@plt>
  cvtsd2ss %xmm0,%xmm0
  jmp    L5
L14:
  mov    -0x30(%rbp),%rax
  sub    $0x1,%rax
  cmp    %rax,-0x10(%rbp)
  jl     L4
  mov    -0x30(%rbp),%rax
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    -0x38(%rbp),%rcx
  mov    -0x28(%rbp),%rdx
  mov    %rcx,%rsi
  movq   %rdx,%xmm0
  mov    %rax,%rdi
  call   <LinInterp1D@plt>
  cvtsd2ss %xmm0,%xmm0
  jmp    L5
L4:
  movsd  D16(%rip),%xmm0
  subsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,-0x40(%rbp)
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    -0x38(%rbp),%rcx
  mov    -0x28(%rbp),%rdx
  mov    %rcx,%rsi
  movq   %rdx,%xmm0
  mov    %rax,%rdi
  call   <LinInterp1D@plt>
  movapd %xmm0,%xmm3
  mulsd  -0x40(%rbp),%xmm3
  movsd  %xmm3,-0x40(%rbp)
  mov    -0x10(%rbp),%rax
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    -0x38(%rbp),%rcx
  mov    -0x28(%rbp),%rdx
  mov    %rcx,%rsi
  movq   %rdx,%xmm0
  mov    %rax,%rdi
  call   <LinInterp1D@plt>
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  mulsd  -0x8(%rbp),%xmm0
  addsd  -0x40(%rbp),%xmm0
  movsd  D11(%rip),%xmm1
  divsd  %xmm1,%xmm0
  cvtsd2ss %xmm0,%xmm0
L5:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D16
datatype: byte[8]
name: extract_symbolic_data
arguments: data_tag: D11
datatype: f64

tool: {"D16": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x3f]}

tool: D11: 2

assistant: ```c
float LinInterp2D(float **arr, double rowind, double colind, long nrow, long ncol) {
  long rowintpart;
  double rowfracpart;
  rowintpart = (long)floor(rowind);
  rowfracpart = rowind - rowintpart;
  if (rowintpart < 0) {
    return (LinInterp1D(arr[0], colind, ncol));
  } else if (rowintpart >= nrow - 1) {
    return (LinInterp1D(arr[nrow - 1], colind, ncol));
  } else {
    return (((1 - rowfracpart) * LinInterp1D(arr[rowintpart], colind, ncol) + rowfracpart * LinInterp1D(arr[rowintpart + 1], colind, ncol)) / 2.0);
  }
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<LinInterp2D>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x10,%rsp
  mov    %rdi,%r13
  movq   %xmm0,%rbx
  movq   %xmm1,%rbp
  mov    %rsi,%r14
  mov    %rdx,%r12
  call   <floor@plt>
  test   %rax,%rax
  js     L7
  lea    -0x1(%r14),%rdx
  cmp    %rax,%rdx
  jg     L19
  mov    -0x8(%r13,%r14,8),%rdi
  mov    %r12,%rsi
  movq   %rbp,%xmm0
  call   <LinInterp1D@plt>
  cvtsd2ss %xmm0,%xmm0
L1:
  add    $0x10,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L7:
  mov    %r12,%rsi
  movq   %rbp,%xmm0
  mov    0x0(%r13),%rdi
  call   <LinInterp1D@plt>
  cvtsd2ss %xmm0,%xmm0
  jmp    L1
L19:
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  movq   %rbx,%xmm2
  subsd  %xmm0,%xmm2
  movsd  %xmm2,(%rsp)
  lea    0x0(,%rax,8),%rbx
  mov    0x0(%r13,%rax,8),%rdi
  mov    %r12,%rsi
  movq   %rbp,%xmm0
  call   <LinInterp1D@plt>
  movapd %xmm0,%xmm1
  movsd  D1(%rip),%xmm0
  subsd  (%rsp),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,0x8(%rsp)
  mov    0x8(%r13,%rbx,1),%rdi
  mov    %r12,%rsi
  movq   %rbp,%xmm0
  call   <LinInterp1D@plt>
  mulsd  (%rsp),%xmm0
  addsd  0x8(%rsp),%xmm0
  mulsd  D2(%rip),%xmm0
  cvtsd2ss %xmm0,%xmm0
  jmp    L1
```

tool_calls: name: unpack_data
arguments: data_tag: D1
type: byte[8]
name: unpack_data
arguments: data_tag: D2
type: byte[8]

tool: {"D1": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x3f]}

tool: {"D2": [0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x3f]}

assistant: ```c
float LinInterp2D(float **arr, double rowind, double colind, long nrow, long ncol) {
  long rowintpart;
  double rowfracpart;
  rowintpart = (long)floor(rowind);
  rowfracpart = rowind - rowintpart;
  if (rowintpart < 0) {
    return (LinInterp1D(arr[0], colind, ncol));
  } else if (rowintpart >= nrow - 1) {
    return (LinInterp1D(arr[nrow - 1], colind, ncol));
  } else {
    return (((1 - rowfracpart) * LinInterp1D(arr[rowintpart], colind, ncol) + rowfracpart * LinInterp1D(arr[rowintpart + 1], colind, ncol)) / 2.0);
  }
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<LinInterp2D>:
  endbr64
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rdx,%rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x20,%rsp
  movsd  %xmm1,0x10(%rsp)
  movsd  %xmm0,0x8(%rsp)
  call   <floor@plt>
  movsd  0x8(%rsp),%xmm0
  movsd  0x10(%rsp),%xmm1
  test   %rax,%rax
  js     L2
  lea    -0x1(%r12),%rdx
  cmp    %rax,%rdx
  jle    L16
  pxor   %xmm2,%xmm2
  mov    (%rbx,%rax,8),%rdi
  mov    %rbp,%rsi
  lea    0x0(,%rax,8),%r12
  cvtsi2sd %rax,%xmm2
  movsd  %xmm1,0x18(%rsp)
  subsd  %xmm2,%xmm0
  movsd  %xmm0,0x8(%rsp)
  movapd %xmm1,%xmm0
  call   <LinInterp1D@plt>
  movsd  0x18(%rsp),%xmm1
  mov    0x8(%rbx,%r12,1),%rdi
  mov    %rbp,%rsi
  movapd %xmm0,%xmm2
  movsd  D14(%rip),%xmm0
  subsd  0x8(%rsp),%xmm0
  mulsd  %xmm2,%xmm0
  movsd  %xmm0,0x10(%rsp)
  movapd %xmm1,%xmm0
  call   <LinInterp1D@plt>
  mulsd  0x8(%rsp),%xmm0
  addsd  0x10(%rsp),%xmm0
  mulsd  D3(%rip),%xmm0
  add    $0x20,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  cvtsd2ss %xmm0,%xmm0
  ret
  xchg   %ax,%ax
L16:
  mov    -0x8(%rbx,%r12,8),%rdi
  mov    %rbp,%rsi
  movapd %xmm1,%xmm0
  call   <LinInterp1D@plt>
  add    $0x20,%rsp
  pop    %rbx
  cvtsd2ss %xmm0,%xmm0
  pop    %rbp
  pop    %r12
  ret
  xchg   %ax,%ax
L2:
  mov    (%rbx),%rdi
  mov    %rbp,%rsi
  movapd %xmm1,%xmm0
  call   <LinInterp1D@plt>
  add    $0x20,%rsp
  pop    %rbx
  cvtsd2ss %xmm0,%xmm0
  pop    %rbp
  pop    %r12
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D14
type_infered: byte[8]
name: unpack_data
arguments: data_tag: D3
type_infered: byte[8]

tool: {"D14": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x3f]}

tool: {"D3": [0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x3f]}

assistant: ```c
float LinInterp2D(float **arr, double rowind, double colind, long nrow, long ncol) {
  long rowintpart;
  double rowfracpart;
  rowintpart = (long)floor(rowind);
  rowfracpart = rowind - rowintpart;
  if (rowintpart < 0) {
    return (LinInterp1D(arr[0], colind, ncol));
  } else if (rowintpart >= nrow - 1) {
    return (LinInterp1D(arr[nrow - 1], colind, ncol));
  } else {
    return (((1 - rowfracpart) * LinInterp1D(arr[rowintpart], colind, ncol) + rowfracpart * LinInterp1D(arr[rowintpart + 1], colind, ncol)) / 2.0);
  }
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<LinInterp2D>:
  endbr64
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rdx,%rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x20,%rsp
  movsd  %xmm1,0x10(%rsp)
  movsd  %xmm0,0x8(%rsp)
  call   <floor@plt>
  movsd  0x8(%rsp),%xmm0
  movsd  0x10(%rsp),%xmm1
  test   %rax,%rax
  js     L18
  lea    -0x1(%r12),%rdx
  cmp    %rax,%rdx
  jle    L5
  pxor   %xmm2,%xmm2
  mov    (%rbx,%rax,8),%rdi
  mov    %rbp,%rsi
  lea    0x0(,%rax,8),%r12
  cvtsi2sd %rax,%xmm2
  movsd  %xmm1,0x18(%rsp)
  subsd  %xmm2,%xmm0
  movsd  %xmm0,0x8(%rsp)
  movapd %xmm1,%xmm0
  call   <LinInterp1D@plt>
  movsd  0x18(%rsp),%xmm1
  mov    0x8(%rbx,%r12,1),%rdi
  mov    %rbp,%rsi
  movapd %xmm0,%xmm2
  movsd  D2(%rip),%xmm0
  subsd  0x8(%rsp),%xmm0
  mulsd  %xmm2,%xmm0
  movsd  %xmm0,0x10(%rsp)
  movapd %xmm1,%xmm0
  call   <LinInterp1D@plt>
  mulsd  0x8(%rsp),%xmm0
  addsd  0x10(%rsp),%xmm0
  mulsd  D7(%rip),%xmm0
  add    $0x20,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  cvtsd2ss %xmm0,%xmm0
  ret
  xchg   %ax,%ax
L5:
  mov    -0x8(%rbx,%r12,8),%rdi
  mov    %rbp,%rsi
  movapd %xmm1,%xmm0
  call   <LinInterp1D@plt>
  add    $0x20,%rsp
  pop    %rbx
  cvtsd2ss %xmm0,%xmm0
  pop    %rbp
  pop    %r12
  ret
  xchg   %ax,%ax
L18:
  mov    (%rbx),%rdi
  mov    %rbp,%rsi
  movapd %xmm1,%xmm0
  call   <LinInterp1D@plt>
  add    $0x20,%rsp
  pop    %rbx
  cvtsd2ss %xmm0,%xmm0
  pop    %rbp
  pop    %r12
  ret
```

tool_calls: name: disassemble_data
arguments: tag: D2
type_infered: byte[8]
name: disassemble_data
arguments: tag: D7
type_infered: byte[8]

tool: {"D2": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x3f]}

tool: {"D7": [0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x3f]}

assistant: ```c
float LinInterp2D(float **arr, double rowind, double colind, long nrow, long ncol) {
  long rowintpart;
  double rowfracpart;
  rowintpart = (long)floor(rowind);
  rowfracpart = rowind - rowintpart;
  if (rowintpart < 0) {
    return (LinInterp1D(arr[0], colind, ncol));
  } else if (rowintpart >= nrow - 1) {
    return (LinInterp1D(arr[nrow - 1], colind, ncol));
  } else {
    return (((1 - rowfracpart) * LinInterp1D(arr[rowintpart], colind, ncol) + rowfracpart * LinInterp1D(arr[rowintpart + 1], colind, ncol)) / 2.0);
  }
}
```
user: Translate the below assembly code into C programming language:

```asm
<hash_pjw>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  movl   $0x0,-0x8(%rbp)
  jmp    L10
L29:
  mov    -0x8(%rbp),%eax
  lea    0x0(,%rax,4),%edx
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  add    %edx,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x8(%rbp),%eax
  and    $0xffffc000,%eax
  mov    %eax,-0x4(%rbp)
  cmpl   $0x0,-0x4(%rbp)
  je     L16
  mov    -0x4(%rbp),%eax
  shr    $0xc,%eax
  xor    -0x8(%rbp),%eax
  and    $0x3fff,%eax
  mov    %eax,-0x8(%rbp)
L16:
  addq   $0x1,-0x18(%rbp)
L10:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L29
  mov    -0x8(%rbp),%eax
  pop    %rbp
  ret
```

assistant: ```c
unsigned int hash_pjw(char *name) {
  unsigned int val = 0, i;
  for (; *name; ++name) {
    val = (val << 2) + *name;
    if (i = val & ~0x3fff)
      val = (val ^ (i >> 12)) & 0x3fff;
  }
  return val;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<hash_pjw>:
  endbr64
  movzbl (%rdi),%edx
  test   %dl,%dl
  je     L37
  mov    $0x0,%eax
  jmp    L36
L19:
  add    $0x1,%rdi
  movzbl (%rdi),%edx
  test   %dl,%dl
  je     L2
L36:
  movsbl %dl,%edx
  lea    (%rdx,%rax,4),%eax
  mov    %eax,%edx
  and    $0xffffc000,%edx
  je     L19
  shr    $0xc,%edx
  xor    %edx,%eax
  and    $0x3fff,%eax
  jmp    L19
L2:
  ret
L37:
  mov    $0x0,%eax
  ret
```

assistant: ```c
unsigned int hash_pjw(char *name) {
  unsigned int val = 0, i;
  for (; *name; ++name) {
    val = (val << 2) + *name;
    if (i = val & ~0x3fff)
      val = (val ^ (i >> 12)) & 0x3fff;
  }
  return val;
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<hash_pjw>:
  endbr64
  movsbl (%rdi),%edx
  xor    %eax,%eax
  test   %dl,%dl
  je     L3
  nopl   (%rax)
L6:
  lea    (%rdx,%rax,4),%eax
  mov    %eax,%edx
  and    $0xffffc000,%edx
  je     L19
  shr    $0xc,%edx
  xor    %edx,%eax
  and    $0x3fff,%eax
L19:
  movsbl 0x1(%rdi),%edx
  add    $0x1,%rdi
  test   %dl,%dl
  jne    L6
  ret
  nopl   0x0(%rax)
L3:
  ret
```

assistant: ```c
unsigned int hash_pjw(char *name) {
  unsigned int val = 0, i;
  for (; *name; ++name) {
    val = (val << 2) + *name;
    if (i = val & ~0x3fff)
      val = (val ^ (i >> 12)) & 0x3fff;
  }
  return val;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<hash_pjw>:
  endbr64
  movsbl (%rdi),%edx
  xor    %eax,%eax
  test   %dl,%dl
  je     L8
  nopl   (%rax)
L5:
  lea    (%rdx,%rax,4),%eax
  mov    %eax,%edx
  and    $0xffffc000,%edx
  je     L11
  shr    $0xc,%edx
  xor    %edx,%eax
  and    $0x3fff,%eax
L11:
  movsbl 0x1(%rdi),%edx
  add    $0x1,%rdi
  test   %dl,%dl
  jne    L5
  ret
  nopl   0x0(%rax)
L8:
  ret
```

assistant: ```c
unsigned int hash_pjw(char *name) {
  unsigned int val = 0, i;
  for (; *name; ++name) {
    val = (val << 2) + *name;
    if (i = val & ~0x3fff)
      val = (val ^ (i >> 12)) & 0x3fff;
  }
  return val;
}
```