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

```asm
<print_usage>:
  endbr64
  sub    $0x8,%rsp
  lea    D28(%rip),%rdi
  call   <puts@plt>
  lea    D14(%rip),%rdi
  call   <puts@plt>
  mov    $0x400,%esi
  lea    D20(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x1,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D28
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D14
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D20
type_infered: string

tool: D28:  Usage: asp_sequence [options]

tool: D14:  Option:

tool: D20:  	[ -s <vector size> ] (default: %d)


assistant: ```c
int print_usage() {
  printf(" Usage: asp_sequence [options]\n");
  printf(" Option:\n");
  printf(" \t[ -s <vector size> ] (default: %d)\n", 1024);
  return 1;
}
```
user: What is the c source code of the assembly code below:

```asm
<print_usage>:
  endbr64
  sub    $0x8,%rsp
  lea    D14(%rip),%rdi
  call   <puts@plt>
  lea    D11(%rip),%rdi
  call   <puts@plt>
  mov    $0x400,%esi
  lea    D12(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0x1,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D14
type: string
name: retrieve_data
arguments: data_label: D11
type: string
name: retrieve_data
arguments: data_label: D12
type: string

tool: D14:  Usage: asp_sequence [options]

tool: D11:  Option:

tool: D12:  	[ -s <vector size> ] (default: %d)


assistant: ```c
int print_usage() {
  printf(" Usage: asp_sequence [options]\n");
  printf(" Option:\n");
  printf(" \t[ -s <vector size> ] (default: %d)\n", 1024);
  return 1;
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<print_usage>:
  endbr64
  sub    $0x8,%rsp
  lea    D12(%rip),%rdi
  call   <puts@plt>
  lea    D15(%rip),%rdi
  call   <puts@plt>
  mov    $0x400,%esi
  lea    D17(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0x1,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: retrieve_data
arguments: label: D12
datatype: string
name: retrieve_data
arguments: label: D15
datatype: string
name: retrieve_data
arguments: label: D17
datatype: string

tool: D12:  Usage: asp_sequence [options]

tool: D15:  Option:

tool: D17:  	[ -s <vector size> ] (default: %d)


assistant: ```c
int print_usage() {
  printf(" Usage: asp_sequence [options]\n");
  printf(" Option:\n");
  printf(" \t[ -s <vector size> ] (default: %d)\n", 1024);
  return 1;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<parab>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  movsd  %xmm0,-0x28(%rbp)
  movsd  %xmm1,-0x30(%rbp)
  movsd  D63(%rip),%xmm0
  mov    -0x28(%rbp),%rax
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  call   <fmod@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x18(%rbp)
  movsd  D82(%rip),%xmm0
  comisd -0x18(%rbp),%xmm0
  jbe    L19
  movsd  D22(%rip),%xmm0
  jmp    L0
L19:
  pxor   %xmm0,%xmm0
L0:
  movapd %xmm0,%xmm1
  addsd  %xmm0,%xmm1
  movsd  D64(%rip),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  movsd  -0x18(%rbp),%xmm0
  movsd  D60(%rip),%xmm1
  divsd  %xmm1,%xmm0
  subsd  -0x10(%rbp),%xmm0
  movq   D43(%rip),%xmm1
  andpd  %xmm1,%xmm0
  movq   %xmm0,%rax
  movsd  -0x30(%rbp),%xmm0
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  call   <pow@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x8(%rbp)
  movsd  D82(%rip),%xmm0
  comisd -0x18(%rbp),%xmm0
  jbe    L7
  movsd  D22(%rip),%xmm0
  subsd  -0x8(%rbp),%xmm0
  jmp    L39
L7:
  movsd  -0x8(%rbp),%xmm0
  movsd  D22(%rip),%xmm1
  subsd  %xmm1,%xmm0
L39:
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  leave
  ret
```

tool_calls: name: parse_data
arguments: data_tag: D63
type_infered: f64
name: parse_data
arguments: data_tag: D82
type_infered: f64
name: parse_data
arguments: data_tag: D22
type_infered: f64
name: parse_data
arguments: data_tag: D64
type_infered: f64
name: parse_data
arguments: data_tag: D60
type_infered: f64
name: parse_data
arguments: data_tag: D43
type_infered: qword

tool: D63: 6.283185307179586

tool: D82: 3.141592653589793

tool: D22: 1

tool: D64: 3

tool: D60: 1.5707963267948966

tool: D43: 9223372036854775807

assistant: ```c
double parab(double x, double n) {
  const double u = fmod(x, 6.28318530717958647693);
  const double temp0 = 3.0 - 2.0 * (u < 3.14159265358979323846);
  const double temp1 = fabs(pow(fabs(u / 1.57079632679489661923 - temp0), n));
  return (u < 3.14159265358979323846) ? 1.0 - temp1 : (temp1 - 1.0);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<parab>:
  endbr64
  push   %rbx
  sub    $0x10,%rsp
  movq   %xmm1,%rbx
  movsd  D104(%rip),%xmm1
  call   <fmod@plt>
  movapd %xmm0,%xmm2
  movsd  %xmm0,0x8(%rsp)
  movsd  D101(%rip),%xmm0
  comisd %xmm2,%xmm0
  ja     L11
  movapd %xmm2,%xmm0
  divsd  D66(%rip),%xmm0
  subsd  D7(%rip),%xmm0
  andpd  D57(%rip),%xmm0
  movq   %rbx,%xmm1
  call   <pow@plt>
  movsd  D101(%rip),%xmm1
  comisd 0x8(%rsp),%xmm1
  ja     L14
  movapd %xmm0,%xmm1
  subsd  D80(%rip),%xmm1
  jmp    L27
L11:
  movsd  0x8(%rsp),%xmm0
  divsd  D66(%rip),%xmm0
  subsd  D80(%rip),%xmm0
  andpd  D57(%rip),%xmm0
  movq   %rbx,%xmm1
  call   <pow@plt>
L14:
  movsd  D80(%rip),%xmm1
  subsd  %xmm0,%xmm1
L27:
  movapd %xmm1,%xmm0
  add    $0x10,%rsp
  pop    %rbx
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D104
type_infered: f64
name: extract_symbolic_data
arguments: data_label: D101
type_infered: f64
name: extract_symbolic_data
arguments: data_label: D66
type_infered: f64
name: extract_symbolic_data
arguments: data_label: D7
type_infered: f64
name: extract_symbolic_data
arguments: data_label: D57
type_infered: qword[2]
name: extract_symbolic_data
arguments: data_label: D80
type_infered: f64

tool: D104: 6.283185307179586

tool: D101: 3.141592653589793

tool: D66: 1.5707963267948966

tool: D7: 3

tool: {"D57": [0x7fffffffffffffff,0x0000000000000000]}

tool: D80: 1

assistant: ```c
double parab(double x, double n) {
  const double u = fmod(x, 6.28318530717958647693);
  const double temp0 = 3.0 - 2.0 * (u < 3.14159265358979323846);
  const double temp1 = fabs(pow(fabs(u / 1.57079632679489661923 - temp0), n));
  return (u < 3.14159265358979323846) ? 1.0 - temp1 : (temp1 - 1.0);
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<parab>:
  endbr64
  sub    $0x18,%rsp
  movsd  %xmm1,0x8(%rsp)
  movsd  D42(%rip),%xmm1
  call   <fmod@plt>
  movsd  D19(%rip),%xmm1
  movsd  0x8(%rsp),%xmm2
  comisd %xmm0,%xmm1
  divsd  D50(%rip),%xmm0
  ja     L3
  subsd  D47(%rip),%xmm0
  andpd  D9(%rip),%xmm0
  movapd %xmm2,%xmm1
  call   <pow@plt>
  subsd  D7(%rip),%xmm0
  add    $0x18,%rsp
  ret
  nopl   (%rax)
L3:
  subsd  D7(%rip),%xmm0
  andpd  D9(%rip),%xmm0
  movapd %xmm2,%xmm1
  call   <pow@plt>
  movapd %xmm0,%xmm1
  movsd  D7(%rip),%xmm0
  add    $0x18,%rsp
  subsd  %xmm1,%xmm0
  ret
```

tool_calls: name: extract_symbolic_data
arguments: tag: D42
data_type: f64
name: extract_symbolic_data
arguments: tag: D19
data_type: f64
name: extract_symbolic_data
arguments: tag: D50
data_type: f64
name: extract_symbolic_data
arguments: tag: D47
data_type: f64
name: extract_symbolic_data
arguments: tag: D9
data_type: qword[2]
name: extract_symbolic_data
arguments: tag: D7
data_type: f64

tool: D42: 6.283185307179586

tool: D19: 3.141592653589793

tool: D50: 1.5707963267948966

tool: D47: 3

tool: {"D9": [0x7fffffffffffffff,0x0000000000000000]}

tool: D7: 1

assistant: ```c
double parab(double x, double n) {
  const double u = fmod(x, 6.28318530717958647693);
  const double temp0 = 3.0 - 2.0 * (u < 3.14159265358979323846);
  const double temp1 = fabs(pow(fabs(u / 1.57079632679489661923 - temp0), n));
  return (u < 3.14159265358979323846) ? 1.0 - temp1 : (temp1 - 1.0);
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<parab>:
  endbr64
  sub    $0x18,%rsp
  movsd  %xmm1,0x8(%rsp)
  movsd  D58(%rip),%xmm1
  call   <fmod@plt>
  movsd  D62(%rip),%xmm1
  movsd  0x8(%rsp),%xmm2
  comisd %xmm0,%xmm1
  divsd  D12(%rip),%xmm0
  ja     L8
  subsd  D67(%rip),%xmm0
  andpd  D68(%rip),%xmm0
  movapd %xmm2,%xmm1
  call   <pow@plt>
  subsd  D65(%rip),%xmm0
  add    $0x18,%rsp
  ret
  nopl   (%rax)
L8:
  subsd  D65(%rip),%xmm0
  andpd  D68(%rip),%xmm0
  movapd %xmm2,%xmm1
  call   <pow@plt>
  movapd %xmm0,%xmm1
  movsd  D65(%rip),%xmm0
  add    $0x18,%rsp
  subsd  %xmm1,%xmm0
  ret
```

tool_calls: name: parse_data
arguments: data_label: D58
datatype: f64
name: parse_data
arguments: data_label: D62
datatype: f64
name: parse_data
arguments: data_label: D12
datatype: f64
name: parse_data
arguments: data_label: D67
datatype: f64
name: parse_data
arguments: data_label: D68
datatype: qword[2]
name: parse_data
arguments: data_label: D65
datatype: f64

tool: D58: 6.283185307179586

tool: D62: 3.141592653589793

tool: D12: 1.5707963267948966

tool: D67: 3

tool: {"D68": [0x7fffffffffffffff,0x0000000000000000]}

tool: D65: 1

assistant: ```c
double parab(double x, double n) {
  const double u = fmod(x, 6.28318530717958647693);
  const double temp0 = 3.0 - 2.0 * (u < 3.14159265358979323846);
  const double temp1 = fabs(pow(fabs(u / 1.57079632679489661923 - temp0), n));
  return (u < 3.14159265358979323846) ? 1.0 - temp1 : (temp1 - 1.0);
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<str_search_oneof>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x8(%rbp)
L15:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    -0x20(%rbp),%rdx
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <char_is_oneof@plt>
  test   %rax,%rax
  je     L26
  mov    -0x8(%rbp),%rax
  jmp    L18
L26:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L3
  addq   $0x1,-0x8(%rbp)
  jmp    L15
L3:
  nop
  mov    $0x0,%eax
L18:
  leave
  ret
```

assistant: ```c
const char *str_search_oneof(const char *str, const char *chars) {
  for (const char *ptr = str;; ptr++) {
    if (char_is_oneof(*ptr, chars))
      return ptr;
    if (*ptr == '\0')
      break;
  }
  return NULL;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<str_search_oneof>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbx
  mov    %rsi,%rbp
  jmp    L16
L10:
  add    $0x1,%rbx
L16:
  movsbl (%rbx),%edi
  mov    %rbp,%rsi
  call   <char_is_oneof@plt>
  test   %rax,%rax
  jne    L5
  cmpb   $0x0,(%rbx)
  jne    L10
  mov    $0x0,%ebx
L5:
  mov    %rbx,%rax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
const char *str_search_oneof(const char *str, const char *chars) {
  for (const char *ptr = str;; ptr++) {
    if (char_is_oneof(*ptr, chars))
      return ptr;
    if (*ptr == '\0')
      break;
  }
  return NULL;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<str_search_oneof>:
  endbr64
  push   %r12
  mov    %rdi,%r12
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x8,%rsp
  jmp    L29
  nopl   0x0(%rax,%rax,1)
L2:
  cmpb   $0x0,(%r12)
  je     L28
  add    $0x1,%r12
L29:
  movsbl (%r12),%edi
  mov    %rbx,%rsi
  call   <char_is_oneof@plt>
  test   %rax,%rax
  je     L2
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %r12
  ret
L28:
  xor    %r12d,%r12d
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %r12
  ret
```

assistant: ```c
const char *str_search_oneof(const char *str, const char *chars) {
  for (const char *ptr = str;; ptr++) {
    if (char_is_oneof(*ptr, chars))
      return ptr;
    if (*ptr == '\0')
      break;
  }
  return NULL;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<str_search_oneof>:
  endbr64
  push   %r12
  mov    %rdi,%r12
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x8,%rsp
  jmp    L8
  nopl   0x0(%rax,%rax,1)
L29:
  cmpb   $0x0,(%r12)
  je     L19
  add    $0x1,%r12
L8:
  movsbl (%r12),%edi
  mov    %rbx,%rsi
  call   <char_is_oneof@plt>
  test   %rax,%rax
  je     L29
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %r12
  ret
L19:
  xor    %r12d,%r12d
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %r12
  ret
```

assistant: ```c
const char *str_search_oneof(const char *str, const char *chars) {
  for (const char *ptr = str;; ptr++) {
    if (char_is_oneof(*ptr, chars))
      return ptr;
    if (*ptr == '\0')
      break;
  }
  return NULL;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<strcasestr>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x18(%rbp)
  mov    -0x40(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x14(%rbp)
  movl   $0x0,-0x24(%rbp)
  jmp    L83
L10:
  movl   $0x0,-0x1c(%rbp)
  movl   $0x0,-0x20(%rbp)
  jmp    L31
L3:
  mov    -0x24(%rbp),%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  cmp    %eax,-0x18(%rbp)
  jb     L75
  mov    -0x24(%rbp),%edx
  mov    -0x20(%rbp),%eax
  add    %edx,%eax
  mov    %eax,%edx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <tolower@plt>
  mov    %rax,%rbx
  mov    -0x20(%rbp),%edx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <tolower@plt>
  cmp    %rax,%rbx
  jne    L52
  addl   $0x1,-0x1c(%rbp)
L52:
  addl   $0x1,-0x20(%rbp)
L31:
  mov    -0x20(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jb     L3
  jmp    L72
L75:
  nop
L72:
  mov    -0x1c(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jne    L22
  mov    -0x24(%rbp),%edx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  jmp    L19
L22:
  addl   $0x1,-0x24(%rbp)
L83:
  mov    -0x24(%rbp),%eax
  cmp    -0x18(%rbp),%eax
  jb     L10
  mov    $0x0,%eax
L19:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
char *strcasestr(const char *haystack, const char *needle) {
  unsigned len_h = strlen(haystack);
  unsigned len_n = strlen(needle);
  unsigned i, j;
  for (i = 0; i < len_h; i++) {
    unsigned matches = 0;
    for (j = 0; j < len_n; j++) {
      if (i + len_n <= len_h) {
        if (tolower(haystack[i + j]) == tolower(needle[j]))
          matches++;
      } else
        break;
    }
    if (matches == len_n)
      return (char *)haystack + i;
  }
  return NULL;
}
```
user: What is the c source code of the assembly code below:

```asm
<strcasestr>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,%r15
  mov    %rsi,%rbx
  mov    %rsi,0x20(%rsp)
  call   <strlen@plt>
  mov    %eax,%r14d
  mov    %eax,0x18(%rsp)
  mov    %rbx,%rdi
  call   <strlen@plt>
  mov    %eax,0xc(%rsp)
  test   %r14d,%r14d
  je     L13
  mov    %r14d,%esi
  mov    %ebx,0x14(%rsp)
  mov    %ebx,%r13d
  neg    %r13d
  sub    %ebx,%esi
  mov    %esi,0x28(%rsp)
  mov    %eax,0x10(%rsp)
  sub    $0x1,%eax
  mov    %eax,0x2c(%rsp)
  jmp    L31
L18:
  add    $0x1,%rbx
L45:
  lea    0x0(%r13,%rbx,1),%eax
  movsbl (%r15,%rax,1),%edi
  call   <tolower@plt>
  mov    %rax,%rbp
  movsbl (%rbx),%edi
  call   <tolower@plt>
  cmp    %rax,%rbp
  sete   %al
  movzbl %al,%eax
  add    %eax,%r12d
  cmp    %r14,%rbx
  jne    L18
  cmp    0xc(%rsp),%r12d
  je     L87
L78:
  addl   $0x1,0x10(%rsp)
  add    $0x1,%r13d
  cmp    0x28(%rsp),%r13d
  je     L38
L31:
  mov    0x14(%rsp),%eax
  add    %r13d,%eax
  mov    %eax,0x1c(%rsp)
  cmpl   $0x0,0xc(%rsp)
  je     L87
  mov    0x10(%rsp),%edx
  cmp    %edx,0x18(%rsp)
  jb     L78
  mov    0x2c(%rsp),%r14d
  mov    0x20(%rsp),%rbx
  add    %rbx,%r14
  mov    $0x0,%r12d
  jmp    L45
L87:
  mov    0x1c(%rsp),%eax
  add    %r15,%rax
L71:
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L13:
  mov    $0x0,%eax
  jmp    L71
L38:
  mov    $0x0,%eax
  jmp    L71
```

assistant: ```c
char *strcasestr(const char *haystack, const char *needle) {
  unsigned len_h = strlen(haystack);
  unsigned len_n = strlen(needle);
  unsigned i, j;
  for (i = 0; i < len_h; i++) {
    unsigned matches = 0;
    for (j = 0; j < len_n; j++) {
      if (i + len_n <= len_h) {
        if (tolower(haystack[i + j]) == tolower(needle[j]))
          matches++;
      } else
        break;
    }
    if (matches == len_n)
      return (char *)haystack + i;
  }
  return NULL;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<strcasestr>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x28,%rsp
  mov    %rsi,0x10(%rsp)
  call   <strlen@plt>
  mov    %rbx,%rdi
  mov    %eax,0xc(%rsp)
  mov    %eax,%r14d
  call   <strlen@plt>
  mov    %eax,0x4(%rsp)
  test   %r14d,%r14d
  je     L18
  mov    %r14d,%ecx
  mov    %ebx,0x8(%rsp)
  mov    %ebx,%r12d
  sub    $0x1,%eax
  sub    %ebx,%ecx
  neg    %r12d
  lea    0x1(%rbx,%rax,1),%r14
  mov    %ecx,0x1c(%rsp)
  nopl   0x0(%rax)
L43:
  mov    0x8(%rsp),%edx
  lea    (%r12,%rdx,1),%eax
  mov    %eax,0x18(%rsp)
  mov    0x4(%rsp),%eax
  test   %eax,%eax
  je     L25
  add    %edx,%eax
  mov    0x10(%rsp),%r15
  xor    %ebp,%ebp
  add    %r12d,%eax
  cmp    %eax,0xc(%rsp)
  jb     L32
  cs nopw 0x0(%rax,%rax,1)
L36:
  lea    (%r12,%r15,1),%eax
  movsbl 0x0(%r13,%rax,1),%edi
  call   <tolower@plt>
  movsbl (%r15),%edi
  mov    %rax,%rbx
  call   <tolower@plt>
  cmp    %rax,%rbx
  sete   %al
  add    $0x1,%r15
  movzbl %al,%eax
  add    %eax,%ebp
  cmp    %r14,%r15
  jne    L36
  cmp    0x4(%rsp),%ebp
  je     L25
L32:
  add    $0x1,%r12d
  cmp    0x1c(%rsp),%r12d
  jne    L43
L18:
  add    $0x28,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L25:
  mov    0x18(%rsp),%eax
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  add    %r13,%rax
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
char *strcasestr(const char *haystack, const char *needle) {
  unsigned len_h = strlen(haystack);
  unsigned len_n = strlen(needle);
  unsigned i, j;
  for (i = 0; i < len_h; i++) {
    unsigned matches = 0;
    for (j = 0; j < len_n; j++) {
      if (i + len_n <= len_h) {
        if (tolower(haystack[i + j]) == tolower(needle[j]))
          matches++;
      } else
        break;
    }
    if (matches == len_n)
      return (char *)haystack + i;
  }
  return NULL;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<strcasestr>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x28,%rsp
  mov    %rsi,0x10(%rsp)
  call   <strlen@plt>
  mov    %rbx,%rdi
  mov    %eax,0xc(%rsp)
  mov    %eax,%r14d
  call   <strlen@plt>
  mov    %eax,0x4(%rsp)
  test   %r14d,%r14d
  je     L56
  mov    %r14d,%ecx
  mov    %ebx,0x8(%rsp)
  mov    %ebx,%r12d
  sub    $0x1,%eax
  sub    %ebx,%ecx
  neg    %r12d
  lea    0x1(%rbx,%rax,1),%r14
  mov    %ecx,0x1c(%rsp)
  nopl   0x0(%rax)
L6:
  mov    0x8(%rsp),%edx
  lea    (%r12,%rdx,1),%eax
  mov    %eax,0x18(%rsp)
  mov    0x4(%rsp),%eax
  test   %eax,%eax
  je     L14
  add    %edx,%eax
  mov    0x10(%rsp),%r15
  xor    %ebp,%ebp
  add    %r12d,%eax
  cmp    %eax,0xc(%rsp)
  jb     L37
  cs nopw 0x0(%rax,%rax,1)
L35:
  lea    (%r12,%r15,1),%eax
  movsbl 0x0(%r13,%rax,1),%edi
  call   <tolower@plt>
  movsbl (%r15),%edi
  mov    %rax,%rbx
  call   <tolower@plt>
  cmp    %rax,%rbx
  sete   %al
  add    $0x1,%r15
  movzbl %al,%eax
  add    %eax,%ebp
  cmp    %r14,%r15
  jne    L35
  cmp    0x4(%rsp),%ebp
  je     L14
L37:
  add    $0x1,%r12d
  cmp    0x1c(%rsp),%r12d
  jne    L6
L56:
  add    $0x28,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L14:
  mov    0x18(%rsp),%eax
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  add    %r13,%rax
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
char *strcasestr(const char *haystack, const char *needle) {
  unsigned len_h = strlen(haystack);
  unsigned len_n = strlen(needle);
  unsigned i, j;
  for (i = 0; i < len_h; i++) {
    unsigned matches = 0;
    for (j = 0; j < len_n; j++) {
      if (i + len_n <= len_h) {
        if (tolower(haystack[i + j]) == tolower(needle[j]))
          matches++;
      } else
        break;
    }
    if (matches == len_n)
      return (char *)haystack + i;
  }
  return NULL;
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<iupdrvGetFullSize>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    $0x0,%eax
  call   <iupdrvGetDisplay@plt>
  mov    %rax,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <XDefaultScreen@plt>
  mov    %eax,-0x20(%rbp)
  mov    -0x20(%rbp),%edx
  mov    -0x18(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <RootWindow@plt>
  mov    %eax,-0x1c(%rbp)
  lea    -0x10(%rbp),%rdx
  mov    -0x1c(%rbp),%ecx
  mov    -0x18(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <XGetWindowAttributes@plt>
  mov    -0x10(%rbp),%edx
  mov    -0x28(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0xc(%rbp),%edx
  mov    -0x30(%rbp),%rax
  mov    %edx,(%rax)
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L4
  call   <__stack_chk_fail@plt>
L4:
  leave
  ret
```

assistant: ```c
void iupdrvGetFullSize(int *width, int *height) {
  Display *display = (Display *)iupdrvGetDisplay();
  int screen = XDefaultScreen(display);
  Window root = RootWindow(display, screen);
  XWindowAttributes wa;
  XGetWindowAttributes(display, root, &wa);
  *width = wa.width;
  *height = wa.height;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<iupdrvGetFullSize>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x10,%rsp
  mov    %rdi,%r12
  mov    %rsi,%rbp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  call   <iupdrvGetDisplay@plt>
  mov    %rax,%rbx
  mov    %rax,%rdi
  call   <XDefaultScreen@plt>
  mov    %eax,%esi
  mov    %rbx,%rdi
  call   <RootWindow@plt>
  mov    %eax,%esi
  mov    %rsp,%rdx
  mov    %rbx,%rdi
  call   <XGetWindowAttributes@plt>
  mov    (%rsp),%eax
  mov    %eax,(%r12)
  mov    0x4(%rsp),%eax
  mov    %eax,0x0(%rbp)
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L6
  add    $0x10,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L6:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void iupdrvGetFullSize(int *width, int *height) {
  Display *display = (Display *)iupdrvGetDisplay();
  int screen = XDefaultScreen(display);
  Window root = RootWindow(display, screen);
  XWindowAttributes wa;
  XGetWindowAttributes(display, root, &wa);
  *width = wa.width;
  *height = wa.height;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<iupdrvGetFullSize>:
  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
  call   <iupdrvGetDisplay@plt>
  mov    %rax,%rdi
  mov    %rax,%rbp
  call   <XDefaultScreen@plt>
  mov    %rbp,%rdi
  mov    %eax,%esi
  call   <RootWindow@plt>
  mov    %rsp,%rdx
  mov    %rbp,%rdi
  mov    %eax,%esi
  call   <XGetWindowAttributes@plt>
  mov    (%rsp),%eax
  mov    %eax,(%r12)
  mov    0x4(%rsp),%eax
  mov    %eax,(%rbx)
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L0
  add    $0x10,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L0:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void iupdrvGetFullSize(int *width, int *height) {
  Display *display = (Display *)iupdrvGetDisplay();
  int screen = XDefaultScreen(display);
  Window root = RootWindow(display, screen);
  XWindowAttributes wa;
  XGetWindowAttributes(display, root, &wa);
  *width = wa.width;
  *height = wa.height;
}
```