ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<AES_wrap_unwrap_test>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,%r13
  mov    %esi,%r14d
  mov    %rdx,(%rsp)
  mov    %rcx,0x10(%rsp)
  mov    %r8,0x8(%rsp)
  mov    %r9d,%ebx
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  lea    0x8(%r9),%edi
  call   <malloc@plt>
  mov    %rax,%rbp
  mov    %ebx,%edi
  call   <malloc@plt>
  test   %rbp,%rbp
  je     L64
  mov    %rax,%r12
  test   %rax,%rax
  je     L64
  lea    0x24(%rsp),%rdx
  mov    %r14d,%esi
  mov    %r13,%rdi
  call   <AES_set_encrypt_key@plt>
  mov    $0x0,%r15d
  test   %rax,%rax
  je     L42
L48:
  mov    %rbp,%rdi
  call   <free@plt>
  mov    %r12,%rdi
  call   <free@plt>
  jmp    L68
L42:
  lea    0x24(%rsp),%rdi
  mov    %ebx,%r8d
  mov    0x8(%rsp),%rcx
  mov    %rbp,%rdx
  mov    (%rsp),%rsi
  call   <AES_wrap_key@plt>
  mov    %eax,0x1c(%rsp)
  test   %eax,%eax
  jle    L48
  mov    0x10(%rsp),%rax
  test   %rax,%rax
  je     L45
  mov    %ebx,%edx
  mov    %rbp,%rsi
  mov    %rax,%rdi
  call   <memcmp@plt>
  test   %rax,%rax
  jne    L48
L45:
  lea    0x24(%rsp),%rdx
  mov    %r14d,%esi
  mov    %r13,%rdi
  call   <AES_set_decrypt_key@plt>
  mov    $0x0,%r15d
  test   %rax,%rax
  jne    L48
  lea    0x24(%rsp),%rdi
  mov    0x1c(%rsp),%r8d
  mov    %rbp,%rcx
  mov    %r12,%rdx
  mov    (%rsp),%rsi
  call   <AES_unwrap_key@plt>
  mov    %ebx,%edx
  mov    %r12,%rsi
  mov    0x8(%rsp),%rdi
  call   <memcmp@plt>
  test   %rax,%rax
  sete   %r15b
  movzbl %r15b,%r15d
  jmp    L48
L64:
  mov    $0x0,%r15d
L68:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L25
  mov    %r15d,%eax
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L25:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int AES_wrap_unwrap_test(const unsigned char *kek, int keybits, const unsigned char *iv, const unsigned char *eout, const unsigned char *key, int keylen) {
  unsigned char *otmp = NULL, *ptmp = NULL;
  int r, ret = 0;
  AES_KEY wctx;
  otmp = malloc(keylen + 8);
  ptmp = malloc(keylen);
  if (!otmp || !ptmp)
    return 0;
  if (AES_set_encrypt_key(kek, keybits, &wctx))
    goto err;
  r = AES_wrap_key(&wctx, iv, otmp, key, keylen);
  if (r <= 0)
    goto err;
  if (eout && memcmp(eout, otmp, keylen))
    goto err;
  if (AES_set_decrypt_key(kek, keybits, &wctx))
    goto err;
  r = AES_unwrap_key(&wctx, iv, ptmp, otmp, r);
  if (memcmp(key, ptmp, keylen))
    goto err;
  ret = 1;
err:
  free(otmp);
  free(ptmp);
  return ret;
}
```
user: Translate the below assembly code into C programming language:

```asm
<AES_wrap_unwrap_test>:
  endbr64
  push   %r15
  mov    %esi,%r15d
  push   %r14
  mov    %rdi,%r14
  lea    0x8(%r9),%edi
  push   %r13
  push   %r12
  mov    %r9d,%r12d
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdx,(%rsp)
  mov    %rcx,0x10(%rsp)
  mov    %r8,0x8(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  call   <malloc@plt>
  mov    %r12d,%edi
  mov    %rax,%rbp
  call   <malloc@plt>
  test   %rbp,%rbp
  je     L46
  mov    %rax,%r13
  test   %rax,%rax
  je     L46
  lea    0x24(%rsp),%rbx
  mov    %r15d,%esi
  mov    %r14,%rdi
  mov    %rbx,%rdx
  call   <AES_set_encrypt_key@plt>
  test   %rax,%rax
  jne    L16
  mov    0x8(%rsp),%rcx
  mov    (%rsp),%rsi
  mov    %r12d,%r8d
  mov    %rbp,%rdx
  mov    %rbx,%rdi
  call   <AES_wrap_key@plt>
  mov    %eax,%r8d
  test   %eax,%eax
  jle    L16
  cmpq   $0x0,0x10(%rsp)
  je     L6
  mov    0x10(%rsp),%rdi
  mov    %r12d,%edx
  mov    %rbp,%rsi
  mov    %eax,0x1c(%rsp)
  call   <memcmp@plt>
  mov    0x1c(%rsp),%r8d
  test   %rax,%rax
  jne    L16
L6:
  mov    %rbx,%rdx
  mov    %r15d,%esi
  mov    %r14,%rdi
  mov    %r8d,0x10(%rsp)
  call   <AES_set_decrypt_key@plt>
  test   %rax,%rax
  jne    L16
  mov    0x10(%rsp),%r8d
  mov    (%rsp),%rsi
  mov    %rbp,%rcx
  mov    %r13,%rdx
  mov    %rbx,%rdi
  call   <AES_unwrap_key@plt>
  mov    0x8(%rsp),%rdi
  mov    %r12d,%edx
  mov    %r13,%rsi
  xor    %r12d,%r12d
  call   <memcmp@plt>
  test   %rax,%rax
  sete   %r12b
  jmp    L62
  nopl   0x0(%rax)
L46:
  xor    %r12d,%r12d
L14:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L53
  add    $0x38,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L16:
  xor    %r12d,%r12d
L62:
  mov    %rbp,%rdi
  call   <free@plt>
  mov    %r13,%rdi
  call   <free@plt>
  jmp    L14
L53:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int AES_wrap_unwrap_test(const unsigned char *kek, int keybits, const unsigned char *iv, const unsigned char *eout, const unsigned char *key, int keylen) {
  unsigned char *otmp = NULL, *ptmp = NULL;
  int r, ret = 0;
  AES_KEY wctx;
  otmp = malloc(keylen + 8);
  ptmp = malloc(keylen);
  if (!otmp || !ptmp)
    return 0;
  if (AES_set_encrypt_key(kek, keybits, &wctx))
    goto err;
  r = AES_wrap_key(&wctx, iv, otmp, key, keylen);
  if (r <= 0)
    goto err;
  if (eout && memcmp(eout, otmp, keylen))
    goto err;
  if (AES_set_decrypt_key(kek, keybits, &wctx))
    goto err;
  r = AES_unwrap_key(&wctx, iv, ptmp, otmp, r);
  if (memcmp(key, ptmp, keylen))
    goto err;
  ret = 1;
err:
  free(otmp);
  free(ptmp);
  return ret;
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<AES_wrap_unwrap_test>:
  endbr64
  push   %r15
  mov    %esi,%r15d
  push   %r14
  mov    %rdi,%r14
  lea    0x8(%r9),%edi
  push   %r13
  push   %r12
  mov    %r9d,%r12d
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdx,(%rsp)
  mov    %rcx,0x10(%rsp)
  mov    %r8,0x8(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  call   <malloc@plt>
  mov    %r12d,%edi
  mov    %rax,%rbp
  call   <malloc@plt>
  test   %rbp,%rbp
  je     L88
  mov    %rax,%r13
  test   %rax,%rax
  je     L88
  lea    0x24(%rsp),%rbx
  mov    %r15d,%esi
  mov    %r14,%rdi
  mov    %rbx,%rdx
  call   <AES_set_encrypt_key@plt>
  test   %rax,%rax
  jne    L36
  mov    0x8(%rsp),%rcx
  mov    (%rsp),%rsi
  mov    %r12d,%r8d
  mov    %rbp,%rdx
  mov    %rbx,%rdi
  call   <AES_wrap_key@plt>
  mov    %eax,%r8d
  test   %eax,%eax
  jle    L36
  cmpq   $0x0,0x10(%rsp)
  je     L68
  mov    0x10(%rsp),%rdi
  mov    %r12d,%edx
  mov    %rbp,%rsi
  mov    %eax,0x1c(%rsp)
  call   <memcmp@plt>
  mov    0x1c(%rsp),%r8d
  test   %rax,%rax
  jne    L36
L68:
  mov    %rbx,%rdx
  mov    %r15d,%esi
  mov    %r14,%rdi
  mov    %r8d,0x10(%rsp)
  call   <AES_set_decrypt_key@plt>
  test   %rax,%rax
  jne    L36
  mov    0x10(%rsp),%r8d
  mov    (%rsp),%rsi
  mov    %rbp,%rcx
  mov    %r13,%rdx
  mov    %rbx,%rdi
  call   <AES_unwrap_key@plt>
  mov    0x8(%rsp),%rdi
  mov    %r12d,%edx
  mov    %r13,%rsi
  xor    %r12d,%r12d
  call   <memcmp@plt>
  test   %rax,%rax
  sete   %r12b
  jmp    L11
  nopl   0x0(%rax)
L88:
  xor    %r12d,%r12d
L90:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L93
  add    $0x38,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L36:
  xor    %r12d,%r12d
L11:
  mov    %rbp,%rdi
  call   <free@plt>
  mov    %r13,%rdi
  call   <free@plt>
  jmp    L90
L93:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int AES_wrap_unwrap_test(const unsigned char *kek, int keybits, const unsigned char *iv, const unsigned char *eout, const unsigned char *key, int keylen) {
  unsigned char *otmp = NULL, *ptmp = NULL;
  int r, ret = 0;
  AES_KEY wctx;
  otmp = malloc(keylen + 8);
  ptmp = malloc(keylen);
  if (!otmp || !ptmp)
    return 0;
  if (AES_set_encrypt_key(kek, keybits, &wctx))
    goto err;
  r = AES_wrap_key(&wctx, iv, otmp, key, keylen);
  if (r <= 0)
    goto err;
  if (eout && memcmp(eout, otmp, keylen))
    goto err;
  if (AES_set_decrypt_key(kek, keybits, &wctx))
    goto err;
  r = AES_unwrap_key(&wctx, iv, ptmp, otmp, r);
  if (memcmp(key, ptmp, keylen))
    goto err;
  ret = 1;
err:
  free(otmp);
  free(ptmp);
  return ret;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xd0,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movq   $0x0,-0xd0(%rbp)
  movq   $0x0,-0xc8(%rbp)
  movq   $0x0,-0xc0(%rbp)
  movq   $0x0,-0xb8(%rbp)
  movq   $0x0,-0xb0(%rbp)
  movq   $0x0,-0xa8(%rbp)
  movq   $0x0,-0xa0(%rbp)
  movq   $0x0,-0x98(%rbp)
  movq   $0x0,-0x90(%rbp)
  movq   $0x0,-0x88(%rbp)
  movq   $0x0,-0x80(%rbp)
  movq   $0x0,-0x78(%rbp)
  movq   $0x0,-0x70(%rbp)
  movq   $0x0,-0x68(%rbp)
  movq   $0x0,-0x60(%rbp)
  movq   $0x0,-0x58(%rbp)
  movq   $0x0,-0x50(%rbp)
  movq   $0x0,-0x48(%rbp)
  movq   $0x0,-0x40(%rbp)
  movq   $0x0,-0x38(%rbp)
  movq   $0x0,-0x30(%rbp)
  movq   $0x0,-0x28(%rbp)
  movq   $0x0,-0x20(%rbp)
  movq   $0x0,-0x18(%rbp)
  movq   $0x0,-0x10(%rbp)
  lea    -0xd0(%rbp),%rax
  mov    %rax,%rsi
  lea    D12(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  lea    -0xd0(%rbp),%rax
  mov    %rax,%rdi
  call   <hash@plt>
  mov    %eax,%esi
  lea    D14(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L1
  call   <__stack_chk_fail@plt>
L1:
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: data_tag: D12
datatype: string
name: retrieve_data
arguments: data_tag: D14
datatype: string

tool: D12: %s

tool: D14: %ld

assistant: ```c
int main() {
  char input[200] = {0};
  scanf("%s", input);
  printf("%ld", hash(input));
  return 0;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<main>:
  endbr64
  push   %rbx
  sub    $0xd0,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0xc8(%rsp)
  xor    %eax,%eax
  movq   $0x0,(%rsp)
  movq   $0x0,0x8(%rsp)
  movq   $0x0,0x10(%rsp)
  movq   $0x0,0x18(%rsp)
  movq   $0x0,0x20(%rsp)
  movq   $0x0,0x28(%rsp)
  movq   $0x0,0x30(%rsp)
  movq   $0x0,0x38(%rsp)
  movq   $0x0,0x40(%rsp)
  movq   $0x0,0x48(%rsp)
  movq   $0x0,0x50(%rsp)
  movq   $0x0,0x58(%rsp)
  movq   $0x0,0x60(%rsp)
  movq   $0x0,0x68(%rsp)
  movq   $0x0,0x70(%rsp)
  movq   $0x0,0x78(%rsp)
  movq   $0x0,0x80(%rsp)
  movq   $0x0,0x88(%rsp)
  movq   $0x0,0x90(%rsp)
  movq   $0x0,0x98(%rsp)
  movq   $0x0,0xa0(%rsp)
  movq   $0x0,0xa8(%rsp)
  movq   $0x0,0xb0(%rsp)
  movq   $0x0,0xb8(%rsp)
  movq   $0x0,0xc0(%rsp)
  mov    %rsp,%rbx
  mov    %rbx,%rsi
  lea    D0(%rip),%rdi
  call   <scanf@plt>
  mov    %rbx,%rdi
  call   <hash@plt>
  mov    %eax,%esi
  lea    D6(%rip),%rdi
  call   <printf@plt>
  mov    0xc8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L4
  mov    $0x0,%eax
  add    $0xd0,%rsp
  pop    %rbx
  ret
L4:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_label: D0
type: string
name: unpack_data
arguments: data_label: D6
type: string

tool: D0: %s

tool: D6: %ld

assistant: ```c
int main() {
  char input[200] = {0};
  scanf("%s", input);
  printf("%ld", hash(input));
  return 0;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  push   %rbp
  pxor   %xmm0,%xmm0
  lea    D17(%rip),%rdi
  sub    $0xd0,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0xc8(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbp
  movaps %xmm0,(%rsp)
  mov    %rbp,%rsi
  movaps %xmm0,0x10(%rsp)
  movaps %xmm0,0x20(%rsp)
  movaps %xmm0,0x30(%rsp)
  movaps %xmm0,0x40(%rsp)
  movaps %xmm0,0x50(%rsp)
  movaps %xmm0,0x60(%rsp)
  movaps %xmm0,0x70(%rsp)
  movaps %xmm0,0x80(%rsp)
  movaps %xmm0,0x90(%rsp)
  movaps %xmm0,0xa0(%rsp)
  movaps %xmm0,0xb0(%rsp)
  movq   $0x0,0xc0(%rsp)
  call   <scanf@plt>
  mov    %rbp,%rdi
  call   <hash@plt>
  lea    D19(%rip),%rdi
  mov    %eax,%esi
  call   <printf@plt>
  mov    0xc8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L6
  add    $0xd0,%rsp
  xor    %eax,%eax
  pop    %rbp
  ret
L6:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_tag: D17
type_guessed: string
name: parse_data
arguments: data_tag: D19
type_guessed: string

tool: D17: %s

tool: D19: %ld

assistant: ```c
int main() {
  char input[200] = {0};
  scanf("%s", input);
  printf("%ld", hash(input));
  return 0;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<main>:
  endbr64
  push   %rbp
  pxor   %xmm0,%xmm0
  lea    D13(%rip),%rdi
  sub    $0xd0,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0xc8(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbp
  movaps %xmm0,(%rsp)
  mov    %rbp,%rsi
  movaps %xmm0,0x10(%rsp)
  movaps %xmm0,0x20(%rsp)
  movaps %xmm0,0x30(%rsp)
  movaps %xmm0,0x40(%rsp)
  movaps %xmm0,0x50(%rsp)
  movaps %xmm0,0x60(%rsp)
  movaps %xmm0,0x70(%rsp)
  movaps %xmm0,0x80(%rsp)
  movaps %xmm0,0x90(%rsp)
  movaps %xmm0,0xa0(%rsp)
  movaps %xmm0,0xb0(%rsp)
  movq   $0x0,0xc0(%rsp)
  call   <scanf@plt>
  mov    %rbp,%rdi
  call   <hash@plt>
  lea    D2(%rip),%rdi
  mov    %eax,%esi
  call   <printf@plt>
  mov    0xc8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L8
  add    $0xd0,%rsp
  xor    %eax,%eax
  pop    %rbp
  ret
L8:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: tag: D13
type_infered: string
name: read_data
arguments: tag: D2
type_infered: string

tool: D13: %s

tool: D2: %ld

assistant: ```c
int main() {
  char input[200] = {0};
  scanf("%s", input);
  printf("%ld", hash(input));
  return 0;
}
```
user: What is the c source code of the assembly code below:

```asm
<math_gauss_quad>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x4(%rbp)
  mov    %rsi,-0x10(%rbp)
  mov    %rdx,-0x18(%rbp)
  cmpl   $0x0,-0x4(%rbp)
  jle    L8
  mov    D58(%rip),%rax
  test   %rax,%rax
  jne    L0
  lea    D35(%rip),%rax
  mov    %rax,%rdx
  lea    D58(%rip),%rax
  mov    %rax,%rsi
  mov    $0x6,%edi
  call   <math_gauss_quad_coefficients@plt>
L0:
  mov    -0x4(%rbp),%eax
  add    $0x5,%eax
  movslq %eax,%rdx
  imul   $0x2aaaaaab,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x1f,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    %eax,D111(%rip)
  movl   $0x0,D145(%rip)
  mov    D145(%rip),%eax
  mov    %eax,D39(%rip)
  mov    -0x18(%rbp),%rax
  movsd  (%rax),%xmm0
  mov    -0x10(%rbp),%rax
  movsd  (%rax),%xmm1
  movsd  %xmm1,D15(%rip)
  movsd  D15(%rip),%xmm1
  subsd  %xmm1,%xmm0
  mov    D111(%rip),%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,D266(%rip)
  mov    D111(%rip),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  add    %eax,%eax
  jmp    L28
L8:
  mov    D39(%rip),%edx
  mov    D111(%rip),%eax
  cmp    %eax,%edx
  jne    L45
  mov    $0x1,%eax
  jmp    L28
L45:
  mov    D58(%rip),%rdx
  mov    D145(%rip),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  movsd  D266(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  movsd  D15(%rip),%xmm0
  addsd  %xmm1,%xmm0
  mov    -0x10(%rbp),%rax
  movsd  %xmm0,(%rax)
  mov    D35(%rip),%rdx
  mov    D145(%rip),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  movsd  D266(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  mov    -0x18(%rbp),%rax
  movsd  %xmm0,(%rax)
  mov    D145(%rip),%eax
  add    $0x1,%eax
  mov    %eax,D200(%rip)
  mov    D200(%rip),%eax
  cmp    $0x6,%eax
  jne    L11
  mov    D39(%rip),%eax
  add    $0x1,%eax
  mov    %eax,D200(%rip)
  movl   $0x0,D200(%rip)
  movsd  D15(%rip),%xmm1
  movsd  D266(%rip),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,D200(%rip)
L11:
  mov    $0x0,%eax
L28:
  leave
  ret
```

assistant: ```c
int math_gauss_quad(int n, double *p1, double *p2) {
  static const double *xGQ = NULL;
  static const double *wGQ = NULL;
  static int i, j, n_itv;
  static double h;
  static double x0;
  if (n > 0) {
    if (xGQ == NULL)
      math_gauss_quad_coefficients(6, &xGQ, &wGQ);
    n_itv = (n + 6 - 1) / 6;
    i = j = 0;
    h = (*p2 - (x0 = *p1)) / n_itv;
    return 6 * n_itv;
  }
  if (i == n_itv)
    return 1;
  *p1 = x0 + xGQ[j] * h;
  *p2 = wGQ[j] * h;
  if (++j == 6) {
    i++;
    j = 0;
    x0 += h;
  }
  return 0;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<math_gauss_quad>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rsi,%r12
  mov    %rdx,%rbp
  test   %edi,%edi
  jg     L51
  mov    D167(%rip),%ecx
  mov    $0x1,%eax
  cmp    D59(%rip),%ecx
  je     L27
  mov    D112(%rip),%edx
  movslq %edx,%rax
  movsd  D45(%rip),%xmm0
  movsd  D8(%rip),%xmm2
  mov    D21(%rip),%rsi
  movapd %xmm0,%xmm1
  mulsd  (%rsi,%rax,8),%xmm1
  addsd  %xmm2,%xmm1
  movsd  %xmm1,(%r12)
  mov    D103(%rip),%rsi
  movapd %xmm0,%xmm1
  mulsd  (%rsi,%rax,8),%xmm1
  movsd  %xmm1,0x0(%rbp)
  add    $0x1,%edx
  mov    %edx,D20(%rip)
  mov    $0x0,%eax
  cmp    $0x6,%edx
  jne    L27
  add    $0x1,%ecx
  mov    %ecx,D20(%rip)
  movl   $0x0,D20(%rip)
  addsd  %xmm2,%xmm0
  movsd  %xmm0,D20(%rip)
  jmp    L27
L51:
  mov    %edi,%ebx
  cmpq   $0x0,D21(%rip)
  je     L4
L18:
  add    $0x5,%ebx
  movslq %ebx,%rax
  imul   $0x2aaaaaab,%rax,%rax
  shr    $0x20,%rax
  sar    $0x1f,%ebx
  sub    %ebx,%eax
  mov    %eax,D20(%rip)
  movl   $0x0,D20(%rip)
  movl   $0x0,D20(%rip)
  movsd  0x0(%rbp),%xmm0
  movsd  (%r12),%xmm1
  movsd  %xmm1,D20(%rip)
  subsd  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,D20(%rip)
  lea    (%rax,%rax,2),%eax
  add    %eax,%eax
L27:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L4:
  lea    D103(%rip),%rdx
  lea    D21(%rip),%rsi
  mov    $0x6,%edi
  call   <math_gauss_quad_coefficients@plt>
  jmp    L18
```

assistant: ```c
int math_gauss_quad(int n, double *p1, double *p2) {
  static const double *xGQ = NULL;
  static const double *wGQ = NULL;
  static int i, j, n_itv;
  static double h;
  static double x0;
  if (n > 0) {
    if (xGQ == NULL)
      math_gauss_quad_coefficients(6, &xGQ, &wGQ);
    n_itv = (n + 6 - 1) / 6;
    i = j = 0;
    h = (*p2 - (x0 = *p1)) / n_itv;
    return 6 * n_itv;
  }
  if (i == n_itv)
    return 1;
  *p1 = x0 + xGQ[j] * h;
  *p2 = wGQ[j] * h;
  if (++j == 6) {
    i++;
    j = 0;
    x0 += h;
  }
  return 0;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<math_gauss_quad>:
  endbr64
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rdx,%rbp
  push   %rbx
  test   %edi,%edi
  jg     L5
  mov    D2(%rip),%ecx
  cmp    D40(%rip),%ecx
  mov    $0x1,%eax
  je     L23
  movslq D50(%rip),%rax
  mov    D120(%rip),%rsi
  movsd  D179(%rip),%xmm0
  movsd  D94(%rip),%xmm2
  movsd  (%rsi,%rax,8),%xmm1
  mov    D156(%rip),%rsi
  mov    %rax,%rdx
  add    $0x1,%edx
  mulsd  %xmm0,%xmm1
  mov    %edx,D88(%rip)
  addsd  %xmm2,%xmm1
  movsd  %xmm1,(%r12)
  movsd  (%rsi,%rax,8),%xmm1
  xor    %eax,%eax
  mulsd  %xmm0,%xmm1
  movsd  %xmm1,0x0(%rbp)
  cmp    $0x6,%edx
  je     L14
L23:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopw   0x0(%rax,%rax,1)
L5:
  cmpq   $0x0,D120(%rip)
  mov    %edi,%ebx
  je     L30
L13:
  lea    0x5(%rbx),%eax
  mov    $0xaaaaaaab,%edx
  movsd  0x0(%rbp),%xmm0
  pop    %rbx
  imul   %rdx,%rax
  movsd  (%r12),%xmm1
  pop    %rbp
  movl   $0x0,D88(%rip)
  movl   $0x0,D2(%rip)
  pop    %r12
  subsd  %xmm1,%xmm0
  movsd  %xmm1,D88(%rip)
  pxor   %xmm1,%xmm1
  shr    $0x22,%rax
  cvtsi2sd %eax,%xmm1
  mov    %eax,D88(%rip)
  lea    (%rax,%rax,2),%eax
  add    %eax,%eax
  divsd  %xmm1,%xmm0
  movsd  %xmm0,D88(%rip)
  ret
  nop
L14:
  addsd  %xmm2,%xmm0
  add    $0x1,%ecx
  pop    %rbx
  pop    %rbp
  mov    %ecx,D88(%rip)
  pop    %r12
  movl   $0x0,D88(%rip)
  movsd  %xmm0,D88(%rip)
  ret
  nopl   0x0(%rax)
L30:
  lea    D156(%rip),%rdx
  lea    D120(%rip),%rsi
  mov    $0x6,%edi
  call   <math_gauss_quad_coefficients@plt>
  jmp    L13
```

assistant: ```c
int math_gauss_quad(int n, double *p1, double *p2) {
  static const double *xGQ = NULL;
  static const double *wGQ = NULL;
  static int i, j, n_itv;
  static double h;
  static double x0;
  if (n > 0) {
    if (xGQ == NULL)
      math_gauss_quad_coefficients(6, &xGQ, &wGQ);
    n_itv = (n + 6 - 1) / 6;
    i = j = 0;
    h = (*p2 - (x0 = *p1)) / n_itv;
    return 6 * n_itv;
  }
  if (i == n_itv)
    return 1;
  *p1 = x0 + xGQ[j] * h;
  *p2 = wGQ[j] * h;
  if (++j == 6) {
    i++;
    j = 0;
    x0 += h;
  }
  return 0;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<math_gauss_quad>:
  endbr64
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rdx,%rbp
  push   %rbx
  test   %edi,%edi
  jg     L7
  mov    D75(%rip),%ecx
  cmp    D14(%rip),%ecx
  mov    $0x1,%eax
  je     L5
  movslq D30(%rip),%rax
  mov    D49(%rip),%rsi
  movsd  D187(%rip),%xmm0
  movsd  D130(%rip),%xmm2
  movsd  (%rsi,%rax,8),%xmm1
  mov    D20(%rip),%rsi
  mov    %rax,%rdx
  add    $0x1,%edx
  mulsd  %xmm0,%xmm1
  mov    %edx,D85(%rip)
  addsd  %xmm2,%xmm1
  movsd  %xmm1,(%r12)
  movsd  (%rsi,%rax,8),%xmm1
  xor    %eax,%eax
  mulsd  %xmm0,%xmm1
  movsd  %xmm1,0x0(%rbp)
  cmp    $0x6,%edx
  je     L20
L5:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopw   0x0(%rax,%rax,1)
L7:
  cmpq   $0x0,D49(%rip)
  mov    %edi,%ebx
  je     L6
L43:
  lea    0x5(%rbx),%eax
  mov    $0xaaaaaaab,%edx
  movsd  0x0(%rbp),%xmm0
  pop    %rbx
  imul   %rdx,%rax
  movsd  (%r12),%xmm1
  pop    %rbp
  movl   $0x0,D85(%rip)
  movl   $0x0,D75(%rip)
  pop    %r12
  subsd  %xmm1,%xmm0
  movsd  %xmm1,D85(%rip)
  pxor   %xmm1,%xmm1
  shr    $0x22,%rax
  cvtsi2sd %eax,%xmm1
  mov    %eax,D85(%rip)
  lea    (%rax,%rax,2),%eax
  add    %eax,%eax
  divsd  %xmm1,%xmm0
  movsd  %xmm0,D85(%rip)
  ret
  nop
L20:
  addsd  %xmm2,%xmm0
  add    $0x1,%ecx
  pop    %rbx
  pop    %rbp
  mov    %ecx,D85(%rip)
  pop    %r12
  movl   $0x0,D85(%rip)
  movsd  %xmm0,D85(%rip)
  ret
  nopl   0x0(%rax)
L6:
  lea    D20(%rip),%rdx
  lea    D49(%rip),%rsi
  mov    $0x6,%edi
  call   <math_gauss_quad_coefficients@plt>
  jmp    L43
```

assistant: ```c
int math_gauss_quad(int n, double *p1, double *p2) {
  static const double *xGQ = NULL;
  static const double *wGQ = NULL;
  static int i, j, n_itv;
  static double h;
  static double x0;
  if (n > 0) {
    if (xGQ == NULL)
      math_gauss_quad_coefficients(6, &xGQ, &wGQ);
    n_itv = (n + 6 - 1) / 6;
    i = j = 0;
    h = (*p2 - (x0 = *p1)) / n_itv;
    return 6 * n_itv;
  }
  if (i == n_itv)
    return 1;
  *p1 = x0 + xGQ[j] * h;
  *p2 = wGQ[j] * h;
  if (++j == 6) {
    i++;
    j = 0;
    x0 += h;
  }
  return 0;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<UARTParityModeGet>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <UARTBaseValid@plt>
  test   %eax,%eax
  jne    L5
  mov    $0x83,%esi
  lea    D3(%rip),%rax
  mov    %rax,%rdi
  call   <AssertFailure@plt>
L5:
  mov    -0x8(%rbp),%rax
  add    $0x2c,%rax
  mov    (%rax),%rax
  and    $0x86,%eax
  leave
  ret
```

tool_calls: name: unpack_data
arguments: label: D3
data_type: string

tool: D3: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AmesianX/OpenBLT/refs/heads/master/Target/Demo/ARMCM3_LM3S_EK_LM3S8962_Crossworks/Boot/lib/driverlib/uartlib.c

assistant: ```c
unsigned long UARTParityModeGet(unsigned long ulBase) {
  {
    if (!(UARTBaseValid(ulBase))) {
      AssertFailure("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AmesianX/OpenBLT/refs/heads/master/Target/Demo/ARMCM3_LM3S_EK_LM3S8962_Crossworks/Boot/lib/driverlib/uartlib.c", 131);
    }
  };
  return ((*((volatile unsigned long *)(ulBase + 0x0000002C))) & (0x00000080 | 0x00000004 | 0x00000002));
}
```