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

```asm
<m_memrchr>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %edx,-0x20(%rbp)
  mov    -0x20(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x8(%rbp)
  jmp    L0
L10:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  cmp    %eax,-0x1c(%rbp)
  jne    L17
  mov    -0x8(%rbp),%rax
  jmp    L27
L17:
  subq   $0x1,-0x8(%rbp)
L0:
  mov    -0x8(%rbp),%rax
  cmp    -0x18(%rbp),%rax
  ja     L10
  mov    $0x0,%eax
L27:
  pop    %rbp
  ret
```

assistant: ```c
__attribute__((nonnull(1))) const char *m_memrchr(const char *s, int c, ssize_t len) {
  const char *pos = s + len - 1;
  while (pos > s) {
    if (*pos == c) {
      return pos;
    }
    --pos;
  }
  return NULL;
}
```
user: Translate the below assembly code into C programming language:

```asm
<m_memrchr>:
  endbr64
  movslq %edx,%rdx
  lea    -0x1(%rdi,%rdx,1),%rax
  cmp    %rax,%rdi
  jae    L1
L25:
  movsbl (%rax),%edx
  cmp    %esi,%edx
  je     L2
  sub    $0x1,%rax
  cmp    %rax,%rdi
  jne    L25
  mov    $0x0,%eax
  ret
L1:
  mov    $0x0,%eax
L2:
  ret
```

assistant: ```c
__attribute__((nonnull(1))) const char *m_memrchr(const char *s, int c, ssize_t len) {
  const char *pos = s + len - 1;
  while (pos > s) {
    if (*pos == c) {
      return pos;
    }
    --pos;
  }
  return NULL;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<m_memrchr>:
  endbr64
  movslq %edx,%rdx
  lea    -0x1(%rdi,%rdx,1),%rax
  cmp    %rax,%rdi
  jb     L19
  jmp    L15
  nopl   0x0(%rax,%rax,1)
L39:
  sub    $0x1,%rax
  cmp    %rax,%rdi
  je     L15
L19:
  movsbl (%rax),%edx
  cmp    %esi,%edx
  jne    L39
  ret
  nopl   0x0(%rax)
L15:
  xor    %eax,%eax
  ret
```

assistant: ```c
__attribute__((nonnull(1))) const char *m_memrchr(const char *s, int c, ssize_t len) {
  const char *pos = s + len - 1;
  while (pos > s) {
    if (*pos == c) {
      return pos;
    }
    --pos;
  }
  return NULL;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<m_memrchr>:
  endbr64
  movslq %edx,%rdx
  lea    -0x1(%rdi,%rdx,1),%rax
  cmp    %rax,%rdi
  jb     L12
  jmp    L28
  nopl   0x0(%rax,%rax,1)
L30:
  sub    $0x1,%rax
  cmp    %rax,%rdi
  je     L28
L12:
  movsbl (%rax),%edx
  cmp    %esi,%edx
  jne    L30
  ret
  nopl   0x0(%rax)
L28:
  xor    %eax,%eax
  ret
```

assistant: ```c
__attribute__((nonnull(1))) const char *m_memrchr(const char *s, int c, ssize_t len) {
  const char *pos = s + len - 1;
  while (pos > s) {
    if (*pos == c) {
      return pos;
    }
    --pos;
  }
  return NULL;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<wcsncpy>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r13
  push   %r12
  push   %rbx
  mov    %rdi,-0x20(%rbp)
  mov    %rsi,-0x28(%rbp)
  mov    %rdx,-0x30(%rbp)
  mov    -0x20(%rbp),%r12
  mov    -0x28(%rbp),%r13
  mov    -0x30(%rbp),%rbx
  jmp    L35
L3:
  nop
L35:
  sub    $0x1,%rbx
  test   %rbx,%rbx
  js     L44
  mov    %r13,%rdx
  lea    0x4(%rdx),%r13
  mov    %r12,%rax
  lea    0x4(%rax),%r12
  mov    (%rdx),%edx
  mov    %edx,(%rax)
  mov    (%rax),%eax
  test   %eax,%eax
  jne    L3
  jmp    L44
L14:
  mov    %r12,%rax
  lea    0x4(%rax),%r12
  movl   $0x0,(%rax)
L44:
  sub    $0x1,%rbx
  test   %rbx,%rbx
  jns    L14
  mov    -0x20(%rbp),%rax
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %rbp
  ret
```

assistant: ```c
wchar_t *wcsncpy(wchar_t *__restrict dst, const wchar_t *__restrict src, size_t n) {
  register wchar_t *dscan;
  register const wchar_t *sscan;
  register long count;
  dscan = dst;
  sscan = src;
  count = n;
  while (--count >= 0 && (*dscan++ = *sscan++) != L'\0')
    continue;
  while (--count >= 0)
    *dscan++ = L'\0';
  return (dst);
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<wcsncpy>:
  endbr64
  mov    %rdi,%rax
  mov    %rdi,%r8
L23:
  mov    %rdx,%rdi
  sub    $0x1,%rdi
  js     L4
  add    $0x4,%rsi
  add    $0x4,%r8
  mov    -0x4(%rsi),%ecx
  mov    %ecx,-0x4(%r8)
  test   %ecx,%ecx
  jne    L3
L4:
  lea    -0x1(%rdx),%rsi
  mov    $0x0,%ecx
  cmp    $0x1,%rdx
  jle    L22
L37:
  movl   $0x0,(%r8,%rcx,4)
  add    $0x1,%rcx
  cmp    %rsi,%rcx
  jne    L37
  ret
L3:
  mov    %rdi,%rdx
  jmp    L23
L22:
  ret
```

assistant: ```c
wchar_t *wcsncpy(wchar_t *__restrict dst, const wchar_t *__restrict src, size_t n) {
  register wchar_t *dscan;
  register const wchar_t *sscan;
  register long count;
  dscan = dst;
  sscan = src;
  count = n;
  while (--count >= 0 && (*dscan++ = *sscan++) != L'\0')
    continue;
  while (--count >= 0)
    *dscan++ = L'\0';
  return (dst);
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<wcsncpy>:
  endbr64
  push   %r12
  mov    %rdi,%r12
L32:
  mov    %rdx,%rax
  sub    $0x1,%rax
  js     L34
  mov    (%rsi),%ecx
  add    $0x4,%rsi
  add    $0x4,%rdi
  mov    %ecx,-0x4(%rdi)
  test   %ecx,%ecx
  jne    L1
L34:
  cmp    $0x1,%rdx
  jle    L25
  lea    0x0(,%rax,4),%rdx
  xor    %esi,%esi
  call   <memset@plt>
L25:
  mov    %r12,%rax
  pop    %r12
  ret
  xchg   %ax,%ax
L1:
  mov    %rax,%rdx
  jmp    L32
```

assistant: ```c
wchar_t *wcsncpy(wchar_t *__restrict dst, const wchar_t *__restrict src, size_t n) {
  register wchar_t *dscan;
  register const wchar_t *sscan;
  register long count;
  dscan = dst;
  sscan = src;
  count = n;
  while (--count >= 0 && (*dscan++ = *sscan++) != L'\0')
    continue;
  while (--count >= 0)
    *dscan++ = L'\0';
  return (dst);
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<wcsncpy>:
  endbr64
  push   %r12
  mov    %rdi,%r12
L25:
  mov    %rdx,%rax
  sub    $0x1,%rax
  js     L4
  mov    (%rsi),%ecx
  add    $0x4,%rsi
  add    $0x4,%rdi
  mov    %ecx,-0x4(%rdi)
  test   %ecx,%ecx
  jne    L0
L4:
  cmp    $0x1,%rdx
  jle    L27
  lea    0x0(,%rax,4),%rdx
  xor    %esi,%esi
  call   <memset@plt>
L27:
  mov    %r12,%rax
  pop    %r12
  ret
  xchg   %ax,%ax
L0:
  mov    %rax,%rdx
  jmp    L25
```

assistant: ```c
wchar_t *wcsncpy(wchar_t *__restrict dst, const wchar_t *__restrict src, size_t n) {
  register wchar_t *dscan;
  register const wchar_t *sscan;
  register long count;
  dscan = dst;
  sscan = src;
  count = n;
  while (--count >= 0 && (*dscan++ = *sscan++) != L'\0')
    continue;
  while (--count >= 0)
    *dscan++ = L'\0';
  return (dst);
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<binarySearch>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %edx,-0x20(%rbp)
  mov    %ecx,-0x24(%rbp)
  jmp    L36
L35:
  mov    -0x20(%rbp),%eax
  sub    -0x1c(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,%edx
  mov    -0x1c(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0x24(%rbp)
  jne    L27
  mov    -0x4(%rbp),%eax
  jmp    L23
L27:
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0x24(%rbp)
  jle    L51
  mov    -0x4(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x1c(%rbp)
  jmp    L36
L51:
  mov    -0x4(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x20(%rbp)
L36:
  mov    -0x1c(%rbp),%eax
  cmp    -0x20(%rbp),%eax
  jle    L35
  mov    $0xffffffff,%eax
L23:
  pop    %rbp
  ret
```

assistant: ```c
int binarySearch(int arr[], int l, int r, int x) {
  while (l <= r) {
    int mid = l + (r - l) / 2;
    if (arr[mid] == x)
      return mid;
    if (arr[mid] < x)
      l = mid + 1;
    else
      r = mid - 1;
  }
  return -1;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<binarySearch>:
  endbr64
  mov    %rdi,%r8
  cmp    %edx,%esi
  jle    L1
  mov    $0xffffffff,%eax
L37:
  ret
L15:
  lea    -0x1(%rax),%edx
L42:
  cmp    %edx,%esi
  jg     L49
L1:
  mov    %edx,%edi
  sub    %esi,%edi
  mov    %edi,%eax
  shr    $0x1f,%eax
  add    %edi,%eax
  sar    %eax
  add    %esi,%eax
  movslq %eax,%rdi
  mov    (%r8,%rdi,4),%edi
  cmp    %ecx,%edi
  je     L37
  jge    L15
  lea    0x1(%rax),%esi
  jmp    L42
L49:
  mov    $0xffffffff,%eax
  ret
```

assistant: ```c
int binarySearch(int arr[], int l, int r, int x) {
  while (l <= r) {
    int mid = l + (r - l) / 2;
    if (arr[mid] == x)
      return mid;
    if (arr[mid] < x)
      l = mid + 1;
    else
      r = mid - 1;
  }
  return -1;
}
```
user: Translate the below assembly code into C programming language:

```asm
<binarySearch>:
  endbr64
  cmp    %edx,%esi
  jle    L45
  jmp    L27
  nopw   0x0(%rax,%rax,1)
L21:
  lea    0x1(%rax),%esi
  cmp    %esi,%edx
  jl     L27
L45:
  mov    %edx,%eax
  sub    %esi,%eax
  sar    %eax
  add    %esi,%eax
  movslq %eax,%r8
  cmp    %ecx,(%rdi,%r8,4)
  je     L7
  jl     L21
  lea    -0x1(%rax),%edx
  cmp    %esi,%edx
  jge    L45
L27:
  mov    $0xffffffff,%eax
L7:
  ret
```

assistant: ```c
int binarySearch(int arr[], int l, int r, int x) {
  while (l <= r) {
    int mid = l + (r - l) / 2;
    if (arr[mid] == x)
      return mid;
    if (arr[mid] < x)
      l = mid + 1;
    else
      r = mid - 1;
  }
  return -1;
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<binarySearch>:
  endbr64
  cmp    %edx,%esi
  jg     L25
  nopl   0x0(%rax,%rax,1)
L53:
  mov    %edx,%eax
  sub    %esi,%eax
  sar    %eax
  add    %esi,%eax
  movslq %eax,%r8
  cmp    %ecx,(%rdi,%r8,4)
  je     L44
  jge    L3
  lea    0x1(%rax),%esi
  cmp    %edx,%esi
  jle    L53
L25:
  mov    $0xffffffff,%eax
L44:
  ret
L3:
  lea    -0x1(%rax),%edx
  cmp    %esi,%edx
  jge    L53
  mov    $0xffffffff,%eax
  jmp    L44
```

assistant: ```c
int binarySearch(int arr[], int l, int r, int x) {
  while (l <= r) {
    int mid = l + (r - l) / 2;
    if (arr[mid] == x)
      return mid;
    if (arr[mid] < x)
      l = mid + 1;
    else
      r = mid - 1;
  }
  return -1;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<__hsail_cvt_zeroi_sat_u8_f64>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  movq   %rax,%xmm0
  call   <isnan@plt>
  test   %rax,%rax
  je     L3
  mov    $0x0,%eax
  jmp    L32
L3:
  mov    D16(%rip),%rax
  mov    (%rax),%rax
  pxor   %xmm1,%xmm1
  cvtsi2sd %rax,%xmm1
  movsd  -0x8(%rbp),%xmm0
  comisd %xmm1,%xmm0
  jb     L49
  mov    D16(%rip),%rax
  mov    (%rax),%rax
  jmp    L32
L49:
  pxor   %xmm0,%xmm0
  comisd -0x8(%rbp),%xmm0
  jb     L52
  mov    $0x0,%eax
  jmp    L32
L52:
  movsd  -0x8(%rbp),%xmm0
  cvttsd2si %xmm0,%rax
L32:
  leave
  ret
```

assistant: ```c
uint8_t __hsail_cvt_zeroi_sat_u8_f64(double a) {
  if (isnan(a))
    return 0;
  if (a >= (double)UINT8_MAX)
    return UINT8_MAX;
  else if (a <= 0.0f)
    return 0;
  return (uint8_t)a;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<__hsail_cvt_zeroi_sat_u8_f64>:
  endbr64
  sub    $0x18,%rsp
  movsd  %xmm0,0x8(%rsp)
  call   <isnan@plt>
  mov    $0x0,%edx
  test   %rax,%rax
  jne    L10
  mov    D3(%rip),%rdx
  mov    (%rdx),%rdx
  pxor   %xmm0,%xmm0
  cvtsi2sd %rdx,%xmm0
  movsd  0x8(%rsp),%xmm1
  comisd %xmm0,%xmm1
  jae    L10
  mov    %rax,%rdx
  pxor   %xmm0,%xmm0
  comisd %xmm1,%xmm0
  jae    L10
  cvttsd2si %xmm1,%rdx
L10:
  mov    %rdx,%rax
  add    $0x18,%rsp
  ret
```

assistant: ```c
uint8_t __hsail_cvt_zeroi_sat_u8_f64(double a) {
  if (isnan(a))
    return 0;
  if (a >= (double)UINT8_MAX)
    return UINT8_MAX;
  else if (a <= 0.0f)
    return 0;
  return (uint8_t)a;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<__hsail_cvt_zeroi_sat_u8_f64>:
  endbr64
  sub    $0x18,%rsp
  movsd  %xmm0,0x8(%rsp)
  call   <isnan@plt>
  mov    %rax,%r8
  xor    %eax,%eax
  test   %r8,%r8
  jne    L28
  mov    D1(%rip),%rax
  pxor   %xmm1,%xmm1
  movsd  0x8(%rsp),%xmm0
  mov    (%rax),%rax
  cvtsi2sd %rax,%xmm1
  comisd %xmm1,%xmm0
  jae    L28
  pxor   %xmm1,%xmm1
  xor    %eax,%eax
  comisd %xmm0,%xmm1
  jae    L28
  cvttsd2si %xmm0,%rax
L28:
  add    $0x18,%rsp
  ret
```

assistant: ```c
uint8_t __hsail_cvt_zeroi_sat_u8_f64(double a) {
  if (isnan(a))
    return 0;
  if (a >= (double)UINT8_MAX)
    return UINT8_MAX;
  else if (a <= 0.0f)
    return 0;
  return (uint8_t)a;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<__hsail_cvt_zeroi_sat_u8_f64>:
  endbr64
  sub    $0x18,%rsp
  movsd  %xmm0,0x8(%rsp)
  call   <isnan@plt>
  mov    %rax,%r8
  xor    %eax,%eax
  test   %r8,%r8
  jne    L8
  mov    D7(%rip),%rax
  pxor   %xmm1,%xmm1
  movsd  0x8(%rsp),%xmm0
  mov    (%rax),%rax
  cvtsi2sd %rax,%xmm1
  comisd %xmm1,%xmm0
  jae    L8
  pxor   %xmm1,%xmm1
  xor    %eax,%eax
  comisd %xmm0,%xmm1
  jae    L8
  cvttsd2si %xmm0,%rax
L8:
  add    $0x18,%rsp
  ret
```

assistant: ```c
uint8_t __hsail_cvt_zeroi_sat_u8_f64(double a) {
  if (isnan(a))
    return 0;
  if (a >= (double)UINT8_MAX)
    return UINT8_MAX;
  else if (a <= 0.0f)
    return 0;
  return (uint8_t)a;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<thirdBits>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  movl   $0x2,-0x8(%rbp)
  movl   $0x49,-0x4(%rbp)
  mov    -0x8(%rbp),%eax
  shl    $0x8,%eax
  or     -0x4(%rbp),%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x8(%rbp),%eax
  shl    $0xc,%eax
  or     %eax,-0x8(%rbp)
  mov    -0x4(%rbp),%eax
  shl    $0x18,%eax
  or     %eax,-0x8(%rbp)
  mov    -0x8(%rbp),%eax
  pop    %rbp
  ret
```

assistant: ```c
int thirdBits(void) {
  int x = 2, y = 73;
  x = x << 8 | y;
  x = x << 12 | x;
  x = y << 24 | x;
  return x;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<thirdBits>:
  endbr64
  mov    $0x49249249,%eax
  ret
```

assistant: ```c
int thirdBits(void) {
  int x = 2, y = 73;
  x = x << 8 | y;
  x = x << 12 | x;
  x = y << 24 | x;
  return x;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<thirdBits>:
  endbr64
  mov    $0x49249249,%eax
  ret
```

assistant: ```c
int thirdBits(void) {
  int x = 2, y = 73;
  x = x << 8 | y;
  x = x << 12 | x;
  x = y << 24 | x;
  return x;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<adjust_mult_assign>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %esi,-0x18(%rbp)
  mov    %edx,-0x1c(%rbp)
  cmpl   $0x0,-0x18(%rbp)
  jns    L27
  mov    -0x18(%rbp),%eax
  not    %eax
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  sub    %edx,%eax
  mov    %eax,-0x4(%rbp)
  cmpl   $0x0,-0x4(%rbp)
  js     L40
  mov    -0x4(%rbp),%eax
  mov    %eax,%edi
  call   <code_byte@plt>
  jmp    L23
L40:
  mov    $0x0,%edi
  call   <code_byte@plt>
  mov    -0x1c(%rbp),%eax
  mov    %eax,%edi
  call   <lua_codeadjust@plt>
  jmp    L23
L27:
  mov    -0x14(%rbp),%eax
  cmp    -0x18(%rbp),%eax
  je     L23
  mov    -0x1c(%rbp),%eax
  mov    %eax,%edi
  call   <lua_codeadjust@plt>
L23:
  nop
  leave
  ret
```

assistant: ```c
void adjust_mult_assign(int vars, int exps, int temps) {
  if (exps < 0) {
    int r = vars - (-exps - 1);
    if (r >= 0)
      code_byte(r);
    else {
      code_byte(0);
      lua_codeadjust(temps);
    }
  } else if (vars != exps)
    lua_codeadjust(temps);
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<adjust_mult_assign>:
  endbr64
  push   %rbx
  mov    %edx,%ebx
  test   %esi,%esi
  js     L56
  cmp    %edi,%esi
  jne    L40
L45:
  pop    %rbx
  ret
L56:
  not    %esi
  sub    %esi,%edi
  js     L30
  call   <code_byte@plt>
  jmp    L45
L30:
  mov    $0x0,%edi
  call   <code_byte@plt>
  mov    %ebx,%edi
  call   <lua_codeadjust@plt>
  jmp    L45
L40:
  mov    %edx,%edi
  call   <lua_codeadjust@plt>
  jmp    L45
```

assistant: ```c
void adjust_mult_assign(int vars, int exps, int temps) {
  if (exps < 0) {
    int r = vars - (-exps - 1);
    if (r >= 0)
      code_byte(r);
    else {
      code_byte(0);
      lua_codeadjust(temps);
    }
  } else if (vars != exps)
    lua_codeadjust(temps);
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<adjust_mult_assign>:
  endbr64
  push   %rbp
  mov    %edx,%ebp
  test   %esi,%esi
  js     L7
  cmp    %edi,%esi
  jne    L13
  pop    %rbp
  ret
  nopl   0x0(%rax)
L13:
  mov    %edx,%edi
  pop    %rbp
  jmp    1060 <lua_codeadjust@plt>
L7:
  not    %esi
  sub    %esi,%edi
  js     L27
  pop    %rbp
  jmp    1070 <code_byte@plt>
  nopl   0x0(%rax)
L27:
  xor    %edi,%edi
  call   <code_byte@plt>
  mov    %ebp,%edi
  pop    %rbp
  jmp    1060 <lua_codeadjust@plt>
```

assistant: ```c
void adjust_mult_assign(int vars, int exps, int temps) {
  if (exps < 0) {
    int r = vars - (-exps - 1);
    if (r >= 0)
      code_byte(r);
    else {
      code_byte(0);
      lua_codeadjust(temps);
    }
  } else if (vars != exps)
    lua_codeadjust(temps);
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<adjust_mult_assign>:
  endbr64
  push   %rbp
  mov    %edx,%ebp
  test   %esi,%esi
  js     L18
  cmp    %edi,%esi
  jne    L6
  pop    %rbp
  ret
  nopl   0x0(%rax)
L6:
  mov    %edx,%edi
  pop    %rbp
  jmp    1060 <lua_codeadjust@plt>
L18:
  not    %esi
  sub    %esi,%edi
  js     L0
  pop    %rbp
  jmp    1070 <code_byte@plt>
  nopl   0x0(%rax)
L0:
  xor    %edi,%edi
  call   <code_byte@plt>
  mov    %ebp,%edi
  pop    %rbp
  jmp    1060 <lua_codeadjust@plt>
```

assistant: ```c
void adjust_mult_assign(int vars, int exps, int temps) {
  if (exps < 0) {
    int r = vars - (-exps - 1);
    if (r >= 0)
      code_byte(r);
    else {
      code_byte(0);
      lua_codeadjust(temps);
    }
  } else if (vars != exps)
    lua_codeadjust(temps);
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<plot_histogram>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %edx,-0x34(%rbp)
  mov    %rcx,-0x40(%rbp)
  mov    $0x0,%edi
  call   <tmpnam@plt>
  mov    %eax,%edi
  call   <strdup@plt>
  mov    %rax,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  lea    D3(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x10(%rbp)
  movl   $0x0,-0x1c(%rbp)
  jmp    L3
L18:
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x10(%rbp),%rax
  movq   %rdx,%xmm0
  lea    D12(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fprintf@plt>
  addl   $0x1,-0x1c(%rbp)
L3:
  mov    -0x1c(%rbp),%eax
  cmp    -0x34(%rbp),%eax
  jl     L18
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    $0x0,%eax
  call   <gnuplot@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <unlink@plt>
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  nop
  leave
  ret
```

tool_calls: name: parse_data
arguments: tag: D3
type: string
name: parse_data
arguments: tag: D12
type: string

tool: D3: w

tool: D12: %g


assistant: ```c
void plot_histogram(FILE *f, const char **opts, int sz, double d[]) {
  char *tmpfname = strdup(tmpnam(0));
  FILE *tmp = fopen(tmpfname, "w");
  int i;
  for (i = 0; i < sz; i++)
    fprintf(tmp, "%g\n", d[i]);
  fclose(tmp);
  FILE *gp = gnuplot();
  fclose(gp);
  unlink(tmpfname);
  free(tmpfname);
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<plot_histogram>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %edx,%r12d
  mov    %rcx,%r13
  mov    $0x0,%edi
  call   <tmpnam@plt>
  mov    %eax,%edi
  call   <strdup@plt>
  mov    %rax,%r14
  lea    D13(%rip),%rsi
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,%rbp
  test   %r12d,%r12d
  jle    L8
  mov    %r13,%rbx
  lea    -0x1(%r12),%eax
  lea    0x8(%r13,%rax,8),%r13
  lea    D11(%rip),%r12
L3:
  movsd  (%rbx),%xmm0
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <fprintf@plt>
  add    $0x8,%rbx
  cmp    %r13,%rbx
  jne    L3
L8:
  mov    %rbp,%rdi
  call   <fclose@plt>
  mov    $0x0,%eax
  call   <gnuplot@plt>
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    %r14,%rdi
  call   <unlink@plt>
  mov    %r14,%rdi
  call   <free@plt>
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D13
data_type: string
name: extract_symbolic_data
arguments: data_tag: D11
data_type: string

tool: D13: w

tool: D11: %g


assistant: ```c
void plot_histogram(FILE *f, const char **opts, int sz, double d[]) {
  char *tmpfname = strdup(tmpnam(0));
  FILE *tmp = fopen(tmpfname, "w");
  int i;
  for (i = 0; i < sz; i++)
    fprintf(tmp, "%g\n", d[i]);
  fclose(tmp);
  FILE *gp = gnuplot();
  fclose(gp);
  unlink(tmpfname);
  free(tmpfname);
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<plot_histogram>:
  endbr64
  push   %r14
  xor    %edi,%edi
  push   %r13
  push   %r12
  mov    %edx,%r12d
  push   %rbp
  push   %rbx
  mov    %rcx,%rbx
  call   <tmpnam@plt>
  mov    %eax,%edi
  call   <strdup@plt>
  lea    D6(%rip),%rsi
  mov    %rax,%rdi
  mov    %rax,%r13
  call   <fopen@plt>
  mov    %rax,%rbp
  test   %r12d,%r12d
  jle    L6
  lea    -0x1(%r12),%eax
  lea    D0(%rip),%r12
  lea    0x8(%rbx,%rax,8),%r14
  nopl   0x0(%rax,%rax,1)
L17:
  movsd  (%rbx),%xmm0
  mov    %r12,%rsi
  mov    %rbp,%rdi
  add    $0x8,%rbx
  call   <fprintf@plt>
  cmp    %r14,%rbx
  jne    L17
L6:
  mov    %rbp,%rdi
  call   <fclose@plt>
  xor    %eax,%eax
  call   <gnuplot@plt>
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    %r13,%rdi
  call   <unlink@plt>
  pop    %rbx
  mov    %r13,%rdi
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  jmp    10c0 <free@plt>
```

tool_calls: name: read_data
arguments: label: D6
type_guessed: string
name: read_data
arguments: label: D0
type_guessed: string

tool: D6: w

tool: D0: %g


assistant: ```c
void plot_histogram(FILE *f, const char **opts, int sz, double d[]) {
  char *tmpfname = strdup(tmpnam(0));
  FILE *tmp = fopen(tmpfname, "w");
  int i;
  for (i = 0; i < sz; i++)
    fprintf(tmp, "%g\n", d[i]);
  fclose(tmp);
  FILE *gp = gnuplot();
  fclose(gp);
  unlink(tmpfname);
  free(tmpfname);
}
```
user: Translate the below assembly code into C programming language:

```asm
<plot_histogram>:
  endbr64
  push   %r14
  xor    %edi,%edi
  push   %r13
  push   %r12
  mov    %edx,%r12d
  push   %rbp
  push   %rbx
  mov    %rcx,%rbx
  call   <tmpnam@plt>
  mov    %eax,%edi
  call   <strdup@plt>
  lea    D9(%rip),%rsi
  mov    %rax,%rdi
  mov    %rax,%r13
  call   <fopen@plt>
  mov    %rax,%rbp
  test   %r12d,%r12d
  jle    L5
  lea    -0x1(%r12),%eax
  lea    D0(%rip),%r12
  lea    0x8(%rbx,%rax,8),%r14
  nopl   0x0(%rax,%rax,1)
L19:
  movsd  (%rbx),%xmm0
  mov    %r12,%rsi
  mov    %rbp,%rdi
  add    $0x8,%rbx
  call   <fprintf@plt>
  cmp    %r14,%rbx
  jne    L19
L5:
  mov    %rbp,%rdi
  call   <fclose@plt>
  xor    %eax,%eax
  call   <gnuplot@plt>
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    %r13,%rdi
  call   <unlink@plt>
  pop    %rbx
  mov    %r13,%rdi
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  jmp    10c0 <free@plt>
```

tool_calls: name: parse_data
arguments: label: D9
type_infered: string
name: parse_data
arguments: label: D0
type_infered: string

tool: D9: w

tool: D0: %g


assistant: ```c
void plot_histogram(FILE *f, const char **opts, int sz, double d[]) {
  char *tmpfname = strdup(tmpnam(0));
  FILE *tmp = fopen(tmpfname, "w");
  int i;
  for (i = 0; i < sz; i++)
    fprintf(tmp, "%g\n", d[i]);
  fclose(tmp);
  FILE *gp = gnuplot();
  fclose(gp);
  unlink(tmpfname);
  free(tmpfname);
}
```