ylfeng/ReF-Decompile-dataset huggingface dataset:
user: What would the C source look like for the assembly code provided here:

```asm
<find_sigmas>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%r14
  mov    %esi,%r12d
  mov    %edx,%r13d
  mov    %esi,%edi
  call   <vector@plt>
  mov    %rax,%rbp
  lea    0x0(,%r12,4),%r15d
  mov    %r15d,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  mov    %r12d,%edi
  call   <vector@plt>
  mov    %rax,%rbx
  mov    %r15d,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  test   %r12d,%r12d
  jle    L77
  mov    %r14,%rdi
  mov    %rbx,%rdx
  mov    %rbp,%rcx
  mov    %r12d,%eax
  lea    (%rbx,%rax,4),%r9
  lea    -0x1(%r13),%eax
  lea    0x4(,%rax,4),%r8
  jmp    L78
L53:
  mov    (%rdi),%rsi
  movss  (%rsi,%rax,1),%xmm0
  movaps %xmm0,%xmm1
  addss  (%rdx),%xmm1
  movss  %xmm1,(%rdx)
  mulss  %xmm0,%xmm0
  addss  (%rcx),%xmm0
  movss  %xmm0,(%rcx)
  add    $0x4,%rax
  cmp    %r8,%rax
  jne    L53
L27:
  add    $0x8,%rdi
  add    $0x4,%rdx
  add    $0x4,%rcx
  cmp    %r9,%rdx
  je     L56
L78:
  mov    $0x0,%eax
  test   %r13d,%r13d
  jg     L53
  jmp    L27
L56:
  mov    %r12d,%edi
  call   <vector@plt>
  mov    %rax,%r15
  mov    %r12d,%r12d
  mov    $0x0,%r14d
  pxor   %xmm3,%xmm3
  cvtsi2ss %r13d,%xmm3
  movss  %xmm3,0xc(%rsp)
L71:
  movss  (%rbx,%r14,4),%xmm0
  movss  0xc(%rsp),%xmm2
  divss  %xmm2,%xmm0
  movss  %xmm0,(%rbx,%r14,4)
  movss  0x0(%rbp,%r14,4),%xmm0
  divss  %xmm2,%xmm0
  movss  %xmm0,0x0(%rbp,%r14,4)
  movss  (%rbx,%r14,4),%xmm1
  mulss  %xmm1,%xmm1
  subss  %xmm1,%xmm0
  call   <sqrt@plt>
  movss  %xmm0,(%r15,%r14,4)
  add    $0x1,%r14
  cmp    %r14,%r12
  jne    L71
L44:
  mov    %rbx,%rdi
  call   <free@plt>
  mov    %rbp,%rdi
  call   <free@plt>
  mov    %r15,%rax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L77:
  mov    %r12d,%edi
  call   <vector@plt>
  mov    %rax,%r15
  jmp    L44
```

assistant: ```c
float *find_sigmas(float **mat, int n, int m) {
  float *totsqr = vector(n);
  memset(totsqr, 0, sizeof(totsqr[0]) * n);
  float *tot = vector(n);
  memset(tot, 0, sizeof(tot[0]) * n);
#pragma omp parallel for shared(mat, n, m, totsqr, tot) default(none)
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) {
      float val = mat[i][j];
      tot[i] += val;
      totsqr[i] += val * val;
    }
  float *sigs = vector(n);
  for (int i = 0; i < n; i++) {
    tot[i] /= m;
    totsqr[i] /= m;
    sigs[i] = sqrt(totsqr[i] - tot[i] * tot[i]);
  }
  free(tot);
  free(totsqr);
  return sigs;
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<find_sigmas>:
  endbr64
  push   %r15
  push   %r14
  mov    %esi,%r14d
  push   %r13
  lea    0x0(,%r14,4),%r15d
  mov    %edx,%r13d
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  mov    %esi,%edi
  sub    $0x18,%rsp
  call   <vector@plt>
  xor    %esi,%esi
  mov    %r15d,%edx
  mov    %rax,%rdi
  mov    %rax,%r12
  call   <memset@plt>
  mov    %r14d,%edi
  call   <vector@plt>
  xor    %esi,%esi
  mov    %r15d,%edx
  mov    %rax,%rdi
  mov    %rax,%rbp
  call   <memset@plt>
  test   %r14d,%r14d
  jle    L56
  mov    %rbx,%rdi
  lea    -0x1(%r13),%eax
  mov    %r14d,%ebx
  mov    %rbp,%rdx
  mov    %r12,%rcx
  lea    0x0(%rbp,%rbx,4),%r8
  lea    0x4(,%rax,4),%r9
  nopl   0x0(%rax,%rax,1)
L17:
  test   %r13d,%r13d
  jle    L12
  mov    (%rdi),%rax
  lea    (%r9,%rax,1),%rsi
  nopl   0x0(%rax)
L16:
  movss  (%rax),%xmm0
  movss  (%rdx),%xmm1
  add    $0x4,%rax
  addss  %xmm0,%xmm1
  mulss  %xmm0,%xmm0
  movss  %xmm1,(%rdx)
  addss  (%rcx),%xmm0
  movss  %xmm0,(%rcx)
  cmp    %rsi,%rax
  jne    L16
L12:
  add    $0x4,%rdx
  add    $0x4,%rcx
  add    $0x8,%rdi
  cmp    %r8,%rdx
  jne    L17
  mov    %r14d,%edi
  call   <vector@plt>
  pxor   %xmm3,%xmm3
  cvtsi2ss %r13d,%xmm3
  mov    %rax,%r14
  xor    %r13d,%r13d
  movss  %xmm3,0xc(%rsp)
  nopl   0x0(%rax,%rax,1)
L13:
  movss  0x0(%rbp,%r13,4),%xmm0
  movss  0xc(%rsp),%xmm2
  divss  %xmm2,%xmm0
  movss  %xmm0,0x0(%rbp,%r13,4)
  movss  (%r12,%r13,4),%xmm0
  divss  %xmm2,%xmm0
  movss  %xmm0,(%r12,%r13,4)
  movss  0x0(%rbp,%r13,4),%xmm1
  mulss  %xmm1,%xmm1
  subss  %xmm1,%xmm0
  call   <sqrt@plt>
  movss  %xmm0,(%r14,%r13,4)
  add    $0x1,%r13
  cmp    %r13,%rbx
  jne    L13
L40:
  mov    %rbp,%rdi
  call   <free@plt>
  mov    %r12,%rdi
  call   <free@plt>
  add    $0x18,%rsp
  mov    %r14,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L56:
  mov    %r14d,%edi
  call   <vector@plt>
  mov    %rax,%r14
  jmp    L40
```

assistant: ```c
float *find_sigmas(float **mat, int n, int m) {
  float *totsqr = vector(n);
  memset(totsqr, 0, sizeof(totsqr[0]) * n);
  float *tot = vector(n);
  memset(tot, 0, sizeof(tot[0]) * n);
#pragma omp parallel for shared(mat, n, m, totsqr, tot) default(none)
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) {
      float val = mat[i][j];
      tot[i] += val;
      totsqr[i] += val * val;
    }
  float *sigs = vector(n);
  for (int i = 0; i < n; i++) {
    tot[i] /= m;
    totsqr[i] /= m;
    sigs[i] = sqrt(totsqr[i] - tot[i] * tot[i]);
  }
  free(tot);
  free(totsqr);
  return sigs;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<find_sigmas>:
  endbr64
  push   %r15
  push   %r14
  mov    %rdi,%r14
  mov    %esi,%edi
  push   %r13
  mov    %esi,%r13d
  push   %r12
  lea    0x0(,%r13,4),%r15d
  push   %rbp
  push   %rbx
  mov    %edx,%ebx
  sub    $0x18,%rsp
  call   <vector@plt>
  xor    %esi,%esi
  mov    %r15d,%edx
  mov    %rax,%rdi
  mov    %rax,%r12
  call   <memset@plt>
  mov    %r13d,%edi
  call   <vector@plt>
  xor    %esi,%esi
  mov    %r15d,%edx
  mov    %rax,%rdi
  mov    %rax,%rbp
  call   <memset@plt>
  test   %r13d,%r13d
  jle    L45
  test   %ebx,%ebx
  jle    L15
  mov    %r13d,%eax
  mov    %ebx,%r8d
  mov    %r14,%rdi
  mov    %rbp,%rdx
  mov    %r12,%rcx
  lea    0x0(%rbp,%rax,4),%r9
  shl    $0x2,%r8
  cs nopw 0x0(%rax,%rax,1)
L48:
  mov    (%rdi),%rax
  lea    (%r8,%rax,1),%rsi
  nopw   0x0(%rax,%rax,1)
L0:
  movss  (%rax),%xmm0
  movss  (%rdx),%xmm1
  add    $0x4,%rax
  addss  %xmm0,%xmm1
  mulss  %xmm0,%xmm0
  movss  %xmm1,(%rdx)
  addss  (%rcx),%xmm0
  movss  %xmm0,(%rcx)
  cmp    %rax,%rsi
  jne    L0
  add    $0x4,%rdx
  add    $0x8,%rdi
  add    $0x4,%rcx
  cmp    %r9,%rdx
  jne    L48
L15:
  mov    %r13d,%edi
  movslq %r13d,%r13
  call   <vector@plt>
  pxor   %xmm3,%xmm3
  cvtsi2ss %ebx,%xmm3
  mov    %rax,%r14
  xor    %ebx,%ebx
  movss  %xmm3,0xc(%rsp)
  nopl   0x0(%rax)
L20:
  movss  0x0(%rbp,%rbx,4),%xmm0
  movss  0xc(%rsp),%xmm2
  divss  %xmm2,%xmm0
  movss  %xmm0,0x0(%rbp,%rbx,4)
  movss  (%r12,%rbx,4),%xmm0
  divss  %xmm2,%xmm0
  movss  %xmm0,(%r12,%rbx,4)
  movss  0x0(%rbp,%rbx,4),%xmm1
  mulss  %xmm1,%xmm1
  subss  %xmm1,%xmm0
  call   <sqrt@plt>
  movss  %xmm0,(%r14,%rbx,4)
  add    $0x1,%rbx
  cmp    %rbx,%r13
  jne    L20
L36:
  mov    %rbp,%rdi
  call   <free@plt>
  mov    %r12,%rdi
  call   <free@plt>
  add    $0x18,%rsp
  mov    %r14,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L45:
  mov    %r13d,%edi
  call   <vector@plt>
  mov    %rax,%r14
  jmp    L36
```

assistant: ```c
float *find_sigmas(float **mat, int n, int m) {
  float *totsqr = vector(n);
  memset(totsqr, 0, sizeof(totsqr[0]) * n);
  float *tot = vector(n);
  memset(tot, 0, sizeof(tot[0]) * n);
#pragma omp parallel for shared(mat, n, m, totsqr, tot) default(none)
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) {
      float val = mat[i][j];
      tot[i] += val;
      totsqr[i] += val * val;
    }
  float *sigs = vector(n);
  for (int i = 0; i < n; i++) {
    tot[i] /= m;
    totsqr[i] /= m;
    sigs[i] = sqrt(totsqr[i] - tot[i] * tot[i]);
  }
  free(tot);
  free(totsqr);
  return sigs;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x340,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x33c(%rbp),%rax
  mov    %rax,%rsi
  lea    D3(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  jmp    L3
L33:
  mov    -0x33c(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x33c(%rbp)
  lea    -0x340(%rbp),%rax
  mov    %rax,%rsi
  lea    D3(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  movl   $0x1,-0x338(%rbp)
  movl   $0x1,-0x330(%rbp)
  movl   $0x2,-0x334(%rbp)
  jmp    L24
L10:
  mov    -0x338(%rbp),%edx
  mov    -0x334(%rbp),%ecx
  lea    -0x330(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <multiply@plt>
  mov    %eax,-0x338(%rbp)
  addl   $0x1,-0x334(%rbp)
L24:
  mov    -0x340(%rbp),%eax
  cmp    %eax,-0x334(%rbp)
  jle    L10
  mov    -0x338(%rbp),%edx
  lea    -0x330(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <print_int@plt>
  lea    D7(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L3:
  mov    -0x33c(%rbp),%eax
  test   %eax,%eax
  jg     L33
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L47
  call   <__stack_chk_fail@plt>
L47:
  leave
  ret
```

tool_calls: name: read_data
arguments: label: D3
data_type: string
name: read_data
arguments: label: D7
data_type: string

tool: D3: %d

tool: D7: 


assistant: ```c
int main() {
  int result[200], m, i, n, t;
  scanf("%d", &t);
  while (t > 0) {
    t--;
    scanf("%d", &n);
    m = 1;
    result[0] = 1;
    for (i = 2; i <= n; i++)
      m = multiply(result, i, m);
    print_int(result, m);
    printf("\n");
  }
  return 0;
}
```
user: Translate the below assembly code into C programming language:

```asm
<main>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x340,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x338(%rsp)
  xor    %eax,%eax
  lea    0xc(%rsp),%rsi
  lea    D25(%rip),%rdi
  call   <scanf@plt>
  mov    0xc(%rsp),%eax
  test   %eax,%eax
  jle    L20
  lea    0x8(%rsp),%r14
  lea    D25(%rip),%r13
  lea    0x10(%rsp),%rbp
  lea    D4(%rip),%r12
L31:
  sub    $0x1,%eax
  mov    %eax,0xc(%rsp)
  mov    %r14,%rsi
  mov    %r13,%rdi
  call   <scanf@plt>
  movl   $0x1,0x10(%rsp)
  cmpl   $0x1,0x8(%rsp)
  jle    L3
  mov    $0x2,%ebx
  mov    $0x1,%edx
L0:
  mov    %ebx,%esi
  mov    %rbp,%rdi
  call   <multiply@plt>
  mov    %eax,%edx
  add    $0x1,%ebx
  cmp    %ebx,0x8(%rsp)
  jge    L0
L11:
  mov    %edx,%esi
  mov    %rbp,%rdi
  call   <print_int@plt>
  mov    %r12,%rdi
  call   <printf@plt>
  mov    0xc(%rsp),%eax
  test   %eax,%eax
  jg     L31
L20:
  mov    0x338(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L32
  mov    $0x0,%eax
  add    $0x340,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L3:
  mov    $0x1,%edx
  jmp    L11
L32:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D25
data_type: string
name: extract_symbolic_data
arguments: data_label: D4
data_type: string

tool: D25: %d

tool: D4: 


assistant: ```c
int main() {
  int result[200], m, i, n, t;
  scanf("%d", &t);
  while (t > 0) {
    t--;
    scanf("%d", &n);
    m = 1;
    result[0] = 1;
    for (i = 2; i <= n; i++)
      m = multiply(result, i, m);
    print_int(result, m);
    printf("\n");
  }
  return 0;
}
```
user: Translate the below assembly code into C programming language:

```asm
<main>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  lea    D6(%rip),%rbp
  push   %rbx
  mov    %rbp,%rdi
  sub    $0x340,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x338(%rsp)
  xor    %eax,%eax
  lea    0xc(%rsp),%rsi
  call   <scanf@plt>
  mov    0xc(%rsp),%eax
  test   %eax,%eax
  jle    L30
  lea    0x8(%rsp),%r13
  lea    0x10(%rsp),%rbx
  lea    D19(%rip),%r12
  nopl   0x0(%rax,%rax,1)
L36:
  sub    $0x1,%eax
  mov    %r13,%rsi
  mov    %rbp,%rdi
  mov    %eax,0xc(%rsp)
  call   <scanf@plt>
  cmpl   $0x1,0x8(%rsp)
  movl   $0x1,0x10(%rsp)
  jle    L35
  mov    $0x2,%r14d
  mov    $0x1,%edx
  nopl   0x0(%rax)
L10:
  mov    %r14d,%esi
  mov    %rbx,%rdi
  add    $0x1,%r14d
  call   <multiply@plt>
  mov    %eax,%edx
  cmp    %r14d,0x8(%rsp)
  jge    L10
L1:
  mov    %edx,%esi
  mov    %rbx,%rdi
  call   <print_int@plt>
  mov    %r12,%rdi
  call   <printf@plt>
  mov    0xc(%rsp),%eax
  test   %eax,%eax
  jg     L36
L30:
  mov    0x338(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L28
  add    $0x340,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nop
L35:
  mov    $0x1,%edx
  jmp    L1
L28:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_tag: D6
data_type: string
name: retrieve_data
arguments: data_tag: D19
data_type: string

tool: D6: %d

tool: D19: 


assistant: ```c
int main() {
  int result[200], m, i, n, t;
  scanf("%d", &t);
  while (t > 0) {
    t--;
    scanf("%d", &n);
    m = 1;
    result[0] = 1;
    for (i = 2; i <= n; i++)
      m = multiply(result, i, m);
    print_int(result, m);
    printf("\n");
  }
  return 0;
}
```
user: Translate the below assembly code into C programming language:

```asm
<main>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  lea    D11(%rip),%rbp
  push   %rbx
  mov    %rbp,%rdi
  sub    $0x340,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x338(%rsp)
  xor    %eax,%eax
  lea    0xc(%rsp),%rsi
  call   <scanf@plt>
  mov    0xc(%rsp),%eax
  test   %eax,%eax
  jle    L16
  lea    0x8(%rsp),%r13
  lea    0x10(%rsp),%rbx
  lea    D15(%rip),%r12
  nopl   0x0(%rax,%rax,1)
L45:
  sub    $0x1,%eax
  mov    %r13,%rsi
  mov    %rbp,%rdi
  mov    %eax,0xc(%rsp)
  call   <scanf@plt>
  cmpl   $0x1,0x8(%rsp)
  movl   $0x1,0x10(%rsp)
  jle    L32
  mov    $0x2,%r14d
  mov    $0x1,%edx
  nopl   0x0(%rax)
L33:
  mov    %r14d,%esi
  mov    %rbx,%rdi
  add    $0x1,%r14d
  call   <multiply@plt>
  mov    %eax,%edx
  cmp    %r14d,0x8(%rsp)
  jge    L33
L24:
  mov    %edx,%esi
  mov    %rbx,%rdi
  call   <print_int@plt>
  mov    %r12,%rdi
  call   <printf@plt>
  mov    0xc(%rsp),%eax
  test   %eax,%eax
  jg     L45
L16:
  mov    0x338(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L47
  add    $0x340,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nop
L32:
  mov    $0x1,%edx
  jmp    L24
L47:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_label: D11
data_type: string
name: disassemble_data
arguments: data_label: D15
data_type: string

tool: D11: %d

tool: D15: 


assistant: ```c
int main() {
  int result[200], m, i, n, t;
  scanf("%d", &t);
  while (t > 0) {
    t--;
    scanf("%d", &n);
    m = 1;
    result[0] = 1;
    for (i = 2; i <= n; i++)
      m = multiply(result, i, m);
    print_int(result, m);
    printf("\n");
  }
  return 0;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<strcasestr>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %rsi,-0x50(%rbp)
  mov    -0x48(%rbp),%rax
  mov    %rax,-0x30(%rbp)
  mov    -0x50(%rbp),%rax
  mov    %rax,-0x28(%rbp)
  movl   $0x1,-0x34(%rbp)
  jmp    L64
L69:
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,%edi
  call   <isupper@plt>
  test   %rax,%rax
  je     L46
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,%edi
  call   <tolower@plt>
  movzbl %al,%ebx
  jmp    L92
L46:
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%ebx
L92:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,%edi
  call   <isupper@plt>
  test   %rax,%rax
  je     L126
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,%edi
  call   <tolower@plt>
  movzbl %al,%eax
  jmp    L97
L126:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
L97:
  cmp    %eax,%ebx
  sete   %al
  movzbl %al,%eax
  and    %eax,-0x34(%rbp)
  addq   $0x1,-0x30(%rbp)
  addq   $0x1,-0x28(%rbp)
L64:
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L91
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L69
L91:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L71
  mov    $0x0,%eax
  jmp    L39
L71:
  cmpl   $0x0,-0x34(%rbp)
  je     L118
  mov    -0x48(%rbp),%rax
  jmp    L39
L118:
  mov    -0x28(%rbp),%rax
  sub    -0x50(%rbp),%rax
  mov    %rax,-0x20(%rbp)
  mov    -0x48(%rbp),%rax
  add    $0x1,%rax
  mov    %rax,-0x30(%rbp)
  mov    -0x20(%rbp),%rax
  sub    $0x1,%rax
  mov    %rax,-0x18(%rbp)
  cmpq   $0x1f,-0x20(%rbp)
  ja     L17
  mov    -0x20(%rbp),%rcx
  mov    -0x50(%rbp),%rdx
  mov    -0x18(%rbp),%rsi
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <two_way_short_needle@plt>
  jmp    L39
L17:
  mov    -0x20(%rbp),%rcx
  mov    -0x50(%rbp),%rdx
  mov    -0x18(%rbp),%rsi
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <two_way_long_needle@plt>
L39:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
char *strcasestr(const char *haystack_start, const char *needle_start) {
  const char *haystack = haystack_start;
  const char *needle = needle_start;
  size_t needle_len;
  size_t haystack_len;
  bool ok = true;
  while (*haystack && *needle) {
    ok &= ((isupper((unsigned char)*haystack) ? tolower((unsigned char)*haystack) : ((unsigned char)*haystack)) == (isupper((unsigned char)*needle) ? tolower((unsigned char)*needle) : ((unsigned char)*needle)));
    haystack++;
    needle++;
  }
  if (*needle)
    return NULL;
  if (ok)
    return (char *)haystack_start;
  needle_len = needle - needle_start;
  haystack = haystack_start + 1;
  haystack_len = needle_len - 1;
  if (needle_len < 32U)
    return two_way_short_needle((const unsigned char *)haystack, haystack_len, (const unsigned char *)needle_start, needle_len);
  return two_way_long_needle((const unsigned char *)haystack, haystack_len, (const unsigned char *)needle_start, needle_len);
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<strcasestr>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%r12
  mov    %rsi,%r13
  movzbl (%rdi),%edi
  mov    %rsi,%rbx
  mov    %r12,%rbp
  mov    $0x1,%r14d
  test   %dil,%dil
  jne    L35
L88:
  mov    $0x0,%eax
  cmpb   $0x0,(%rbx)
  jne    L73
L108:
  mov    %r12,%rax
  test   %r14d,%r14d
  jne    L73
  mov    %rbx,%rcx
  sub    %r13,%rcx
  lea    0x1(%r12),%rdi
  lea    -0x1(%rcx),%rsi
  cmp    $0x1f,%rcx
  jbe    L89
  mov    %r13,%rdx
  call   <two_way_long_needle@plt>
L73:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L37:
  movzbl 0x0(%rbp),%edi
  call   <tolower@plt>
  movzbl %al,%r15d
  jmp    L78
L94:
  movzbl (%rbx),%edi
  call   <tolower@plt>
  movzbl %al,%eax
L17:
  cmp    %eax,%r15d
  sete   %al
  movzbl %al,%eax
  and    %eax,%r14d
  add    $0x1,%rbp
  add    $0x1,%rbx
  movzbl 0x0(%rbp),%edi
  test   %dil,%dil
  je     L88
L35:
  cmpb   $0x0,(%rbx)
  je     L108
  movzbl %dil,%edi
  call   <isupper@plt>
  test   %rax,%rax
  jne    L37
  movzbl 0x0(%rbp),%r15d
L78:
  movzbl (%rbx),%edi
  call   <isupper@plt>
  test   %rax,%rax
  jne    L94
  movzbl (%rbx),%eax
  jmp    L17
L89:
  mov    %r13,%rdx
  call   <two_way_short_needle@plt>
  jmp    L73
```

assistant: ```c
char *strcasestr(const char *haystack_start, const char *needle_start) {
  const char *haystack = haystack_start;
  const char *needle = needle_start;
  size_t needle_len;
  size_t haystack_len;
  bool ok = true;
  while (*haystack && *needle) {
    ok &= ((isupper((unsigned char)*haystack) ? tolower((unsigned char)*haystack) : ((unsigned char)*haystack)) == (isupper((unsigned char)*needle) ? tolower((unsigned char)*needle) : ((unsigned char)*needle)));
    haystack++;
    needle++;
  }
  if (*needle)
    return NULL;
  if (ok)
    return (char *)haystack_start;
  needle_len = needle - needle_start;
  haystack = haystack_start + 1;
  haystack_len = needle_len - 1;
  if (needle_len < 32U)
    return two_way_short_needle((const unsigned char *)haystack, haystack_len, (const unsigned char *)needle_start, needle_len);
  return two_way_long_needle((const unsigned char *)haystack, haystack_len, (const unsigned char *)needle_start, needle_len);
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<strcasestr>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  movzbl (%rdi),%edi
  movzbl (%rsi),%eax
  test   %dil,%dil
  je     L100
  mov    %rsi,%r13
  mov    %rsi,%rbx
  mov    %r12,%rbp
  mov    $0x1,%r14d
  jmp    L74
  nopl   (%rax)
L6:
  movzbl (%rbx),%edi
  movzbl 0x0(%rbp),%r15d
  call   <isupper@plt>
  test   %rax,%rax
  jne    L51
L83:
  movzbl (%rbx),%eax
L89:
  cmp    %eax,%r15d
  sete   %al
  movzbl 0x1(%rbp),%edi
  add    $0x1,%rbp
  add    $0x1,%rbx
  movzbl %al,%eax
  and    %eax,%r14d
  test   %dil,%dil
  je     L15
L74:
  cmpb   $0x0,(%rbx)
  je     L114
  call   <isupper@plt>
  test   %rax,%rax
  je     L6
  movzbl 0x0(%rbp),%edi
  call   <tolower@plt>
  movzbl (%rbx),%edi
  movzbl %al,%r15d
  call   <isupper@plt>
  test   %rax,%rax
  je     L83
L51:
  movzbl (%rbx),%edi
  call   <tolower@plt>
  movzbl %al,%eax
  jmp    L89
L15:
  cmpb   $0x0,(%rbx)
  jne    L5
L114:
  test   %r14d,%r14d
  jne    L18
  mov    %rbx,%rcx
  lea    0x1(%r12),%rdi
  mov    %r13,%rdx
  sub    %r13,%rcx
  lea    -0x1(%rcx),%rsi
  cmp    $0x1f,%rcx
  jbe    L107
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    10a0 <two_way_long_needle@plt>
L100:
  test   %al,%al
  jne    L5
L18:
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L107:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    10b0 <two_way_short_needle@plt>
  nopl   0x0(%rax,%rax,1)
L5:
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
char *strcasestr(const char *haystack_start, const char *needle_start) {
  const char *haystack = haystack_start;
  const char *needle = needle_start;
  size_t needle_len;
  size_t haystack_len;
  bool ok = true;
  while (*haystack && *needle) {
    ok &= ((isupper((unsigned char)*haystack) ? tolower((unsigned char)*haystack) : ((unsigned char)*haystack)) == (isupper((unsigned char)*needle) ? tolower((unsigned char)*needle) : ((unsigned char)*needle)));
    haystack++;
    needle++;
  }
  if (*needle)
    return NULL;
  if (ok)
    return (char *)haystack_start;
  needle_len = needle - needle_start;
  haystack = haystack_start + 1;
  haystack_len = needle_len - 1;
  if (needle_len < 32U)
    return two_way_short_needle((const unsigned char *)haystack, haystack_len, (const unsigned char *)needle_start, needle_len);
  return two_way_long_needle((const unsigned char *)haystack, haystack_len, (const unsigned char *)needle_start, needle_len);
}
```