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

```asm
<hash_str>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  movl   $0x1f,-0xc(%rbp)
  jmp    L8
L6:
  mov    -0xc(%rbp),%eax
  shl    $0x5,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  add    %eax,%edx
  mov    -0xc(%rbp),%eax
  shr    $0x2,%eax
  add    %edx,%eax
  xor    %eax,-0xc(%rbp)
  addq   $0x1,-0x8(%rbp)
L8:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L6
  mov    -0xc(%rbp),%eax
  and    $0x7fffffff,%eax
  pop    %rbp
  ret
```

assistant: ```c
unsigned hash_str(const void *key) {
  char *s = (char *)key;
  unsigned int h = 31;
  for (; *s; s++) {
    h ^= ((h << 5) + (*s) + (h >> 2));
  }
  return h & 0x7fffffff;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<hash_str>:
  endbr64
  movzbl (%rdi),%ecx
  test   %cl,%cl
  je     L23
  mov    $0x1f,%eax
L10:
  mov    %eax,%edx
  shl    $0x5,%edx
  mov    %eax,%esi
  shr    $0x2,%esi
  add    %esi,%edx
  movsbl %cl,%ecx
  add    %ecx,%edx
  xor    %edx,%eax
  add    $0x1,%rdi
  movzbl (%rdi),%ecx
  test   %cl,%cl
  jne    L10
L26:
  and    $0x7fffffff,%eax
  ret
L23:
  mov    $0x1f,%eax
  jmp    L26
```

assistant: ```c
unsigned hash_str(const void *key) {
  char *s = (char *)key;
  unsigned int h = 31;
  for (; *s; s++) {
    h ^= ((h << 5) + (*s) + (h >> 2));
  }
  return h & 0x7fffffff;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<hash_str>:
  endbr64
  movsbl (%rdi),%ecx
  mov    $0x1f,%eax
  test   %cl,%cl
  je     L14
L3:
  mov    %eax,%edx
  mov    %eax,%esi
  add    $0x1,%rdi
  shl    $0x5,%edx
  shr    $0x2,%esi
  add    %esi,%edx
  add    %ecx,%edx
  movsbl (%rdi),%ecx
  xor    %edx,%eax
  test   %cl,%cl
  jne    L3
  and    $0x7fffffff,%eax
  ret
  nopl   0x0(%rax)
L14:
  ret
```

assistant: ```c
unsigned hash_str(const void *key) {
  char *s = (char *)key;
  unsigned int h = 31;
  for (; *s; s++) {
    h ^= ((h << 5) + (*s) + (h >> 2));
  }
  return h & 0x7fffffff;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<hash_str>:
  endbr64
  movsbl (%rdi),%ecx
  mov    $0x1f,%eax
  test   %cl,%cl
  je     L11
L8:
  mov    %eax,%edx
  mov    %eax,%esi
  add    $0x1,%rdi
  shl    $0x5,%edx
  shr    $0x2,%esi
  add    %esi,%edx
  add    %ecx,%edx
  movsbl (%rdi),%ecx
  xor    %edx,%eax
  test   %cl,%cl
  jne    L8
  and    $0x7fffffff,%eax
  ret
  nopl   0x0(%rax)
L11:
  ret
```

assistant: ```c
unsigned hash_str(const void *key) {
  char *s = (char *)key;
  unsigned int h = 31;
  for (; *s; s++) {
    h ^= ((h << 5) + (*s) + (h >> 2));
  }
  return h & 0x7fffffff;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<read_sign>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  movsd  D15(%rip),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  cmp    $0x2b,%eax
  je     L3
  cmp    $0x2d,%eax
  jne    L15
  movsd  D14(%rip),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  lea    0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rdx,(%rax)
  jmp    L22
L3:
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  lea    0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rdx,(%rax)
  jmp    L22
L15:
  nop
L22:
  movsd  -0x8(%rbp),%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  pop    %rbp
  ret
```

tool_calls: name: retrieve_data
arguments: data_tag: D15
data_type: f64
name: retrieve_data
arguments: data_tag: D14
data_type: byte[8]

tool: D15: 1

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

assistant: ```c
double read_sign(const char **const sptr) {
  double sign = 1.0;
  switch (**sptr) {
  case '-':
    sign = -1.0;
    ++(*sptr);
    break;
  case '+':
    ++(*sptr);
    break;
  default:
    break;
  }
  return sign;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<read_sign>:
  endbr64
  mov    (%rdi),%rax
  movzbl (%rax),%edx
  cmp    $0x2b,%dl
  je     L15
  movsd  D20(%rip),%xmm0
  cmp    $0x2d,%dl
  jne    L2
  add    $0x1,%rax
  mov    %rax,(%rdi)
  movsd  D23(%rip),%xmm0
  ret
L15:
  add    $0x1,%rax
  mov    %rax,(%rdi)
  movsd  D20(%rip),%xmm0
L2:
  ret
```

tool_calls: name: retrieve_data
arguments: data_tag: D20
datatype: f64
name: retrieve_data
arguments: data_tag: D23
datatype: byte[8]

tool: D20: 1

tool: {"D23": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xbf]}

assistant: ```c
double read_sign(const char **const sptr) {
  double sign = 1.0;
  switch (**sptr) {
  case '-':
    sign = -1.0;
    ++(*sptr);
    break;
  case '+':
    ++(*sptr);
    break;
  default:
    break;
  }
  return sign;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<read_sign>:
  endbr64
  mov    (%rdi),%rax
  movzbl (%rax),%edx
  cmp    $0x2b,%dl
  je     L19
  movsd  D2(%rip),%xmm0
  cmp    $0x2d,%dl
  jne    L1
  add    $0x1,%rax
  movsd  D18(%rip),%xmm0
  mov    %rax,(%rdi)
  ret
  nopl   0x0(%rax)
L19:
  add    $0x1,%rax
  movsd  D2(%rip),%xmm0
  mov    %rax,(%rdi)
L1:
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D2
type: f64
name: extract_symbolic_data
arguments: data_tag: D18
type: byte[8]

tool: D2: 1

tool: {"D18": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xbf]}

assistant: ```c
double read_sign(const char **const sptr) {
  double sign = 1.0;
  switch (**sptr) {
  case '-':
    sign = -1.0;
    ++(*sptr);
    break;
  case '+':
    ++(*sptr);
    break;
  default:
    break;
  }
  return sign;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<read_sign>:
  endbr64
  mov    (%rdi),%rax
  movzbl (%rax),%edx
  cmp    $0x2b,%dl
  je     L8
  movsd  D6(%rip),%xmm0
  cmp    $0x2d,%dl
  jne    L7
  add    $0x1,%rax
  movsd  D22(%rip),%xmm0
  mov    %rax,(%rdi)
  ret
  nopl   0x0(%rax)
L8:
  add    $0x1,%rax
  movsd  D6(%rip),%xmm0
  mov    %rax,(%rdi)
L7:
  ret
```

tool_calls: name: parse_data
arguments: data_label: D6
type: f64
name: parse_data
arguments: data_label: D22
type: byte[8]

tool: D6: 1

tool: {"D22": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xbf]}

assistant: ```c
double read_sign(const char **const sptr) {
  double sign = 1.0;
  switch (**sptr) {
  case '-':
    sign = -1.0;
    ++(*sptr);
    break;
  case '+':
    ++(*sptr);
    break;
  default:
    break;
  }
  return sign;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<merge_decrease>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xfe0,%rsp
  mov    %rdi,-0xfd8(%rbp)
  mov    %rsi,-0xfe0(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0xfd8(%rbp),%rax
  cmp    -0xfe0(%rbp),%rax
  jae    L93
  mov    -0xfe0(%rbp),%rax
  sub    -0xfd8(%rbp),%rax
  sar    $0x2,%rax
  mov    %eax,-0xfcc(%rbp)
  mov    -0xfcc(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0xfd8(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0xfb8(%rbp)
  mov    -0xfb8(%rbp),%rdx
  mov    -0xfd8(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <merge_decrease>
  mov    -0xfb8(%rbp),%rax
  lea    0x4(%rax),%rdx
  mov    -0xfe0(%rbp),%rax
  mov    %rax,%rsi
  mov    %rdx,%rdi
  call   <merge_decrease>
  mov    -0xfd8(%rbp),%rax
  mov    %rax,-0xfc8(%rbp)
  mov    -0xfb8(%rbp),%rax
  add    $0x4,%rax
  mov    %rax,-0xfc0(%rbp)
  movl   $0x0,-0xfd0(%rbp)
  jmp    L76
L68:
  mov    -0xfc8(%rbp),%rax
  mov    (%rax),%edx
  mov    -0xfc0(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,%edx
  jle    L67
  mov    -0xfc8(%rbp),%rax
  cmp    -0xfb8(%rbp),%rax
  jbe    L74
L67:
  mov    -0xfc0(%rbp),%rax
  cmp    -0xfe0(%rbp),%rax
  jbe    L37
L74:
  mov    -0xfc8(%rbp),%rax
  mov    (%rax),%edx
  mov    -0xfd0(%rbp),%eax
  cltq
  mov    %edx,-0xfb0(%rbp,%rax,4)
  addq   $0x4,-0xfc8(%rbp)
  jmp    L14
L37:
  mov    -0xfc0(%rbp),%rax
  mov    (%rax),%edx
  mov    -0xfd0(%rbp),%eax
  cltq
  mov    %edx,-0xfb0(%rbp,%rax,4)
  addq   $0x4,-0xfc0(%rbp)
L14:
  addl   $0x1,-0xfd0(%rbp)
L76:
  mov    -0xfd0(%rbp),%eax
  cmp    -0xfcc(%rbp),%eax
  jle    L68
  movl   $0x0,-0xfd0(%rbp)
  jmp    L108
L83:
  mov    -0xfd0(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0xfd8(%rbp),%rax
  add    %rax,%rdx
  mov    -0xfd0(%rbp),%eax
  cltq
  mov    -0xfb0(%rbp,%rax,4),%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0xfd0(%rbp)
L108:
  mov    -0xfd0(%rbp),%eax
  cmp    -0xfcc(%rbp),%eax
  jle    L83
  jmp    L57
L93:
  nop
L57:
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L100
  call   <__stack_chk_fail@plt>
L100:
  leave
  ret
```

assistant: ```c
void merge_decrease(int *front, int *end) {
  if (front >= end)
    return;
  int size = end - front;
  int *mid = front + size / 2;
  merge_decrease(front, mid);
  merge_decrease(mid + 1, end);
  int *left = front;
  int *right = mid + 1;
  int tmp_sort[1000];
  int i;
  for (i = 0; i <= size; ++i) {
    if (*left > *right && left <= mid || right > end) {
      tmp_sort[i] = *left;
      left++;
    } else {
      tmp_sort[i] = *right;
      right++;
    }
  }
  for (i = 0; i <= size; ++i)
    *(front + i) = tmp_sort[i];
  return;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<merge_decrease>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xfb0,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0xfa8(%rsp)
  xor    %eax,%eax
  cmp    %rsi,%rdi
  jb     L92
L76:
  mov    0xfa8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L30
  add    $0xfb0,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L92:
  mov    %rdi,%rbp
  mov    %rsi,%r12
  mov    %rsi,%r14
  sub    %rdi,%r14
  sar    $0x2,%r14
  mov    %r14d,%eax
  shr    $0x1f,%eax
  add    %r14d,%eax
  sar    %eax
  cltq
  lea    (%rdi,%rax,4),%r13
  mov    %r13,%rsi
  call   <merge_decrease>
  lea    0x4(%r13),%rbx
  mov    %r12,%rsi
  mov    %rbx,%rdi
  call   <merge_decrease>
  test   %r14d,%r14d
  js     L76
  mov    %rsp,%rax
  mov    %r14d,%r14d
  lea    0x4(%rsp,%r14,4),%rdi
  mov    %rbp,%rdx
  jmp    L108
L74:
  add    $0x4,%rdx
L60:
  mov    %ecx,(%rax)
  add    $0x4,%rax
  cmp    %rdi,%rax
  je     L71
L108:
  mov    (%rdx),%ecx
  mov    (%rbx),%esi
  cmp    %rdx,%r13
  jb     L22
  cmp    %esi,%ecx
  jg     L74
L22:
  cmp    %rbx,%r12
  jb     L74
  add    $0x4,%rbx
  mov    %esi,%ecx
  jmp    L60
L71:
  lea    0x4(,%r14,4),%rcx
  mov    $0x0,%eax
L19:
  mov    (%rsp,%rax,1),%edx
  mov    %edx,0x0(%rbp,%rax,1)
  add    $0x4,%rax
  cmp    %rax,%rcx
  jne    L19
  jmp    L76
L30:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void merge_decrease(int *front, int *end) {
  if (front >= end)
    return;
  int size = end - front;
  int *mid = front + size / 2;
  merge_decrease(front, mid);
  merge_decrease(mid + 1, end);
  int *left = front;
  int *right = mid + 1;
  int tmp_sort[1000];
  int i;
  for (i = 0; i <= size; ++i) {
    if (*left > *right && left <= mid || right > end) {
      tmp_sort[i] = *left;
      left++;
    } else {
      tmp_sort[i] = *right;
      right++;
    }
  }
  for (i = 0; i <= size; ++i)
    *(front + i) = tmp_sort[i];
  return;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<merge_decrease>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xfb0,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0xfa8(%rsp)
  xor    %eax,%eax
  cmp    %rsi,%rdi
  jb     L5
L44:
  mov    0xfa8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L16
  add    $0xfb0,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopw   0x0(%rax,%rax,1)
L5:
  mov    %rsi,%r14
  mov    %rsi,%rbp
  mov    %rdi,%r12
  sub    %rdi,%r14
  sar    $0x2,%r14
  mov    %r14d,%eax
  shr    $0x1f,%eax
  add    %r14d,%eax
  sar    %eax
  cltq
  lea    (%rdi,%rax,4),%r13
  mov    %r13,%rsi
  lea    0x4(%r13),%rbx
  call   <merge_decrease>
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <merge_decrease>
  test   %r14d,%r14d
  js     L44
  mov    %rsp,%r8
  mov    %r14d,%r14d
  mov    %r12,%rdx
  mov    %r8,%rax
  lea    0x4(%rsp,%r14,4),%rdi
  jmp    L48
  nopl   0x0(%rax,%rax,1)
L81:
  mov    %esi,%ecx
  add    $0x4,%rax
  add    $0x4,%rbx
  mov    %ecx,-0x4(%rax)
  cmp    %rax,%rdi
  je     L26
L48:
  mov    (%rdx),%ecx
  mov    (%rbx),%esi
  cmp    %rdx,%r13
  jb     L63
  cmp    %esi,%ecx
  jg     L90
L63:
  cmp    %rbx,%rbp
  jae    L81
L90:
  mov    %ecx,(%rax)
  add    $0x4,%rax
  add    $0x4,%rdx
  cmp    %rax,%rdi
  jne    L48
L26:
  lea    0x4(,%r14,4),%rdx
  mov    %r8,%rsi
  mov    %r12,%rdi
  call   <memcpy@plt>
  jmp    L44
L16:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void merge_decrease(int *front, int *end) {
  if (front >= end)
    return;
  int size = end - front;
  int *mid = front + size / 2;
  merge_decrease(front, mid);
  merge_decrease(mid + 1, end);
  int *left = front;
  int *right = mid + 1;
  int tmp_sort[1000];
  int i;
  for (i = 0; i <= size; ++i) {
    if (*left > *right && left <= mid || right > end) {
      tmp_sort[i] = *left;
      left++;
    } else {
      tmp_sort[i] = *right;
      right++;
    }
  }
  for (i = 0; i <= size; ++i)
    *(front + i) = tmp_sort[i];
  return;
}
```
user: Translate the below assembly code into C programming language:

```asm
<merge_decrease>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xfb0,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0xfa8(%rsp)
  xor    %eax,%eax
  cmp    %rsi,%rdi
  jb     L48
L77:
  mov    0xfa8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L12
  add    $0xfb0,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopw   0x0(%rax,%rax,1)
L48:
  mov    %rsi,%r13
  mov    %rsi,%rbp
  mov    %rdi,%r12
  sub    %rdi,%r13
  sar    $0x2,%r13
  mov    %r13d,%eax
  shr    $0x1f,%eax
  add    %r13d,%eax
  sar    %eax
  cltq
  lea    (%rdi,%rax,4),%r14
  mov    %r14,%rsi
  lea    0x4(%r14),%rbx
  call   <merge_decrease>
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <merge_decrease>
  test   %r13d,%r13d
  js     L77
  mov    %rsp,%r8
  mov    %r13d,%r13d
  mov    %r12,%rcx
  mov    %r8,%rax
  lea    0x4(%rsp,%r13,4),%rdi
  jmp    L29
  nopl   0x0(%rax,%rax,1)
L33:
  mov    %esi,%edx
  add    $0x4,%rax
  add    $0x4,%rbx
  mov    %edx,-0x4(%rax)
  cmp    %rax,%rdi
  je     L4
L29:
  mov    (%rcx),%edx
  mov    (%rbx),%esi
  cmp    %edx,%esi
  jge    L46
  cmp    %rcx,%r14
  jae    L96
L46:
  cmp    %rbx,%rbp
  jae    L33
L96:
  mov    %edx,(%rax)
  add    $0x4,%rax
  add    $0x4,%rcx
  cmp    %rax,%rdi
  jne    L29
L4:
  lea    0x4(,%r13,4),%rdx
  mov    %r8,%rsi
  mov    %r12,%rdi
  call   <memcpy@plt>
  jmp    L77
L12:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void merge_decrease(int *front, int *end) {
  if (front >= end)
    return;
  int size = end - front;
  int *mid = front + size / 2;
  merge_decrease(front, mid);
  merge_decrease(mid + 1, end);
  int *left = front;
  int *right = mid + 1;
  int tmp_sort[1000];
  int i;
  for (i = 0; i <= size; ++i) {
    if (*left > *right && left <= mid || right > end) {
      tmp_sort[i] = *left;
      left++;
    } else {
      tmp_sort[i] = *right;
      right++;
    }
  }
  for (i = 0; i <= size; ++i)
    *(front + i) = tmp_sort[i];
  return;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<signals_handled>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  lea    D54(%rip),%rax
  mov    %rax,%rdi
  call   <sigemptyset@plt>
  mov    D4(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,%esi
  lea    D54(%rip),%rax
  mov    %rax,%rdi
  call   <sigaddset@plt>
  mov    D61(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,%esi
  lea    D54(%rip),%rax
  mov    %rax,%rdi
  call   <sigaddset@plt>
  mov    D65(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,%esi
  lea    D54(%rip),%rax
  mov    %rax,%rdi
  call   <sigaddset@plt>
  mov    D45(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,%esi
  lea    D54(%rip),%rax
  mov    %rax,%rdi
  call   <sigaddset@plt>
  lea    D54(%rip),%rax
  pop    %rbp
  ret
```

assistant: ```c
sigset_t *signals_handled(void) {
  static sigset_t sigs;
  sigemptyset(&sigs);
  sigaddset(&sigs, SIGHUP);
  sigaddset(&sigs, SIGTERM);
  sigaddset(&sigs, SIGQUIT);
  sigaddset(&sigs, SIGINT);
  return &sigs;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<signals_handled>:
  endbr64
  push   %rbx
  lea    D5(%rip),%rbx
  mov    %rbx,%rdi
  call   <sigemptyset@plt>
  mov    D25(%rip),%rax
  mov    (%rax),%esi
  mov    %rbx,%rdi
  call   <sigaddset@plt>
  mov    D21(%rip),%rax
  mov    (%rax),%esi
  mov    %rbx,%rdi
  call   <sigaddset@plt>
  mov    D37(%rip),%rax
  mov    (%rax),%esi
  mov    %rbx,%rdi
  call   <sigaddset@plt>
  mov    D46(%rip),%rax
  mov    (%rax),%esi
  mov    %rbx,%rdi
  call   <sigaddset@plt>
  mov    %rbx,%rax
  pop    %rbx
  ret
```

assistant: ```c
sigset_t *signals_handled(void) {
  static sigset_t sigs;
  sigemptyset(&sigs);
  sigaddset(&sigs, SIGHUP);
  sigaddset(&sigs, SIGTERM);
  sigaddset(&sigs, SIGQUIT);
  sigaddset(&sigs, SIGINT);
  return &sigs;
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<signals_handled>:
  endbr64
  push   %r12
  lea    D19(%rip),%r12
  mov    %r12,%rdi
  call   <sigemptyset@plt>
  mov    D21(%rip),%rax
  mov    %r12,%rdi
  mov    (%rax),%esi
  call   <sigaddset@plt>
  mov    D8(%rip),%rax
  mov    %r12,%rdi
  mov    (%rax),%esi
  call   <sigaddset@plt>
  mov    D9(%rip),%rax
  mov    %r12,%rdi
  mov    (%rax),%esi
  call   <sigaddset@plt>
  mov    D4(%rip),%rax
  mov    %r12,%rdi
  mov    (%rax),%esi
  call   <sigaddset@plt>
  mov    %r12,%rax
  pop    %r12
  ret
```

assistant: ```c
sigset_t *signals_handled(void) {
  static sigset_t sigs;
  sigemptyset(&sigs);
  sigaddset(&sigs, SIGHUP);
  sigaddset(&sigs, SIGTERM);
  sigaddset(&sigs, SIGQUIT);
  sigaddset(&sigs, SIGINT);
  return &sigs;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<signals_handled>:
  endbr64
  push   %r12
  lea    D4(%rip),%r12
  mov    %r12,%rdi
  call   <sigemptyset@plt>
  mov    D11(%rip),%rax
  mov    %r12,%rdi
  mov    (%rax),%esi
  call   <sigaddset@plt>
  mov    D43(%rip),%rax
  mov    %r12,%rdi
  mov    (%rax),%esi
  call   <sigaddset@plt>
  mov    D36(%rip),%rax
  mov    %r12,%rdi
  mov    (%rax),%esi
  call   <sigaddset@plt>
  mov    D6(%rip),%rax
  mov    %r12,%rdi
  mov    (%rax),%esi
  call   <sigaddset@plt>
  mov    %r12,%rax
  pop    %r12
  ret
```

assistant: ```c
sigset_t *signals_handled(void) {
  static sigset_t sigs;
  sigemptyset(&sigs);
  sigaddset(&sigs, SIGHUP);
  sigaddset(&sigs, SIGTERM);
  sigaddset(&sigs, SIGQUIT);
  sigaddset(&sigs, SIGINT);
  return &sigs;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<mjd_dayno>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  movsd  %xmm0,-0x28(%rbp)
  mov    %rdi,-0x30(%rbp)
  mov    %rsi,-0x38(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x10(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  mov    %rdx,%rdi
  movq   %rax,%xmm0
  call   <mjd_year@plt>
  movsd  -0x10(%rbp),%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,-0x18(%rbp)
  mov    -0x30(%rbp),%rax
  mov    -0x18(%rbp),%edx
  mov    %edx,(%rax)
  mov    -0x18(%rbp),%eax
  mov    %eax,%edi
  call   <isleapyear@plt>
  test   %rax,%rax
  je     L17
  mov    $0x16e,%eax
  jmp    L5
L17:
  mov    $0x16d,%eax
L5:
  mov    %eax,-0x14(%rbp)
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x14(%rbp),%xmm1
  movsd  -0x10(%rbp),%xmm0
  pxor   %xmm2,%xmm2
  cvtsi2sdl -0x18(%rbp),%xmm2
  subsd  %xmm2,%xmm0
  mulsd  %xmm1,%xmm0
  mov    -0x38(%rbp),%rax
  movsd  %xmm0,(%rax)
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L8
  call   <__stack_chk_fail@plt>
L8:
  leave
  ret
```

assistant: ```c
void mjd_dayno(double mj, int *yr, double *dy) {
  double yrd;
  int yri;
  int dpy;
  mjd_year(mj, &yrd);
  *yr = yri = (int)yrd;
  dpy = isleapyear(yri) ? 366 : 365;
  *dy = dpy * (yrd - yri);
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<mjd_dayno>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x10,%rsp
  mov    %rdi,%r12
  mov    %rsi,%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rdi
  call   <mjd_year@plt>
  cvttsd2si (%rsp),%ebp
  mov    %ebp,(%r12)
  mov    %ebp,%edi
  call   <isleapyear@plt>
  cmp    $0x1,%rax
  mov    $0x16d,%eax
  sbb    $0xffffffff,%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %ebp,%xmm1
  movsd  (%rsp),%xmm0
  subsd  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,(%rbx)
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L5
  add    $0x10,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L5:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void mjd_dayno(double mj, int *yr, double *dy) {
  double yrd;
  int yri;
  int dpy;
  mjd_year(mj, &yrd);
  *yr = yri = (int)yrd;
  dpy = isleapyear(yri) ? 366 : 365;
  *dy = dpy * (yrd - yri);
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<mjd_dayno>:
  endbr64
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rdi
  call   <mjd_year@plt>
  cvttsd2si (%rsp),%ebp
  mov    %ebp,(%r12)
  mov    %ebp,%edi
  call   <isleapyear@plt>
  movsd  D2(%rip),%xmm1
  test   %rax,%rax
  jne    L7
  movsd  D15(%rip),%xmm1
L7:
  pxor   %xmm2,%xmm2
  movsd  (%rsp),%xmm0
  cvtsi2sd %ebp,%xmm2
  subsd  %xmm2,%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,(%rbx)
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L10
  add    $0x10,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L10:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_tag: D2
data_type: byte[8]
name: disassemble_data
arguments: data_tag: D15
data_type: byte[8]

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

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

assistant: ```c
void mjd_dayno(double mj, int *yr, double *dy) {
  double yrd;
  int yri;
  int dpy;
  mjd_year(mj, &yrd);
  *yr = yri = (int)yrd;
  dpy = isleapyear(yri) ? 366 : 365;
  *dy = dpy * (yrd - yri);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<mjd_dayno>:
  endbr64
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rdi
  call   <mjd_year@plt>
  cvttsd2si (%rsp),%ebp
  mov    %ebp,(%r12)
  mov    %ebp,%edi
  call   <isleapyear@plt>
  movsd  D18(%rip),%xmm1
  test   %rax,%rax
  jne    L16
  movsd  D12(%rip),%xmm1
L16:
  pxor   %xmm2,%xmm2
  movsd  (%rsp),%xmm0
  cvtsi2sd %ebp,%xmm2
  subsd  %xmm2,%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,(%rbx)
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L12
  add    $0x10,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L12:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_label: D18
type_guessed: byte[8]
name: read_data
arguments: data_label: D12
type_guessed: byte[8]

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

tool: {"D12": [0x00,0x00,0x00,0x00,0x00,0xd0,0x76,0x40]}

assistant: ```c
void mjd_dayno(double mj, int *yr, double *dy) {
  double yrd;
  int yri;
  int dpy;
  mjd_year(mj, &yrd);
  *yr = yri = (int)yrd;
  dpy = isleapyear(yri) ? 366 : 365;
  *dy = dpy * (yrd - yri);
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<cec_ops_set_osd_string>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    -0x18(%rbp),%rax
  mov    (%rax),%eax
  mov    $0x3,%edx
  cmp    %edx,%eax
  cmovl  %edx,%eax
  sub    $0x3,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x18(%rbp),%rax
  mov    0x8(%rax),%rax
  mov    0x8(%rax),%edx
  mov    -0x20(%rbp),%rax
  mov    %edx,(%rax)
  cmpl   $0xd,-0x4(%rbp)
  jbe    L5
  movl   $0xd,-0x4(%rbp)
L5:
  mov    -0x18(%rbp),%rax
  mov    0x8(%rax),%rax
  lea    0xc(%rax),%rcx
  mov    -0x4(%rbp),%edx
  mov    -0x28(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  mov    -0x4(%rbp),%edx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  nop
  leave
  ret
```

assistant: ```c
void cec_ops_set_osd_string(const struct cec_msg *msg, __u8 *disp_ctl, char *osd) {
  unsigned int len = msg->len > 3 ? msg->len - 3 : 0;
  *disp_ctl = msg->msg[2];
  if (len > 13)
    len = 13;
  memcpy(osd, msg->msg + 3, len);
  osd[len] = '\0';
}
```