ylfeng/ReF-Decompile-dataset huggingface dataset:
user: Converte this assembly snippet into its equivalent C code:

```asm
<skip_over_curlies>:
  endbr64
  push   %rbx
  mov    $0x7b,%esi
  mov    %rdi,%rbx
  call   <strchr@plt>
  test   %rax,%rax
  je     L40
  lea    0x1(%rax),%rdi
  mov    $0x1,%ebx
L2:
  call   <skip_to_next_curly@plt>
  mov    %rax,%rdi
  test   %rax,%rax
  je     L31
  movzbl (%rax),%eax
  add    $0x1,%rdi
  cmp    $0x7b,%al
  je     L14
  cmp    $0x7d,%al
  jne    L2
  sub    $0x1,%ebx
  jne    L2
L31:
  mov    %rdi,%rax
  pop    %rbx
  ret
  cs nopw 0x0(%rax,%rax,1)
L14:
  add    $0x1,%ebx
  jmp    L2
  nopl   (%rax)
L40:
  mov    %rbx,%rdi
  pop    %rbx
  mov    %rdi,%rax
  ret
```

assistant: ```c
const char *skip_over_curlies(const char *buf) {
  const char *p;
  int opened;
  p = strchr(buf, '{');
  if (!p)
    return buf;
  ++p;
  opened = 1;
  while (opened) {
    p = skip_to_next_curly(p);
    if (!p)
      return 0;
    if (*p == '{')
      ++opened;
    else if (*p == '}')
      --opened;
    ++p;
  }
  return p;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<calendar_index>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %edi,%eax
  mov    %al,-0x4(%rbp)
  movsbl -0x4(%rbp),%eax
  sub    $0x44,%eax
  cmp    $0x2f,%eax
  ja     L56
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  lea    D4(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D4(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
  mov    $0x5,%eax
  jmp    L5
  mov    $0x4,%eax
  jmp    L5
  mov    $0x3,%eax
  jmp    L5
  mov    $0x2,%eax
  jmp    L5
  mov    $0x1,%eax
  jmp    L5
  mov    $0x0,%eax
  jmp    L5
L56:
  mov    $0x0,%edi
  call   <assert@plt>
  mov    $0x6,%eax
L5:
  leave
  ret
```

assistant: ```c
int calendar_index(char ind) {
  switch (ind) {
  case 'Y':
    return 5;
  case 'M':
    return 4;
  case 'D':
    return 3;
  case 'h':
    return 2;
  case 'm':
    return 1;
  case 's':
    return 0;
  default:
    assert(0);
    return 6;
  }
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<calendar_index>:
  endbr64
  sub    $0x44,%edi
  cmp    $0x2f,%dil
  ja     L6
  movzbl %dil,%edi
  lea    D9(%rip),%rdx
  movslq (%rdx,%rdi,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
  mov    $0x4,%eax
  ret
  mov    $0x3,%eax
  ret
  mov    $0x2,%eax
  ret
  mov    $0x1,%eax
  ret
  mov    $0x0,%eax
  ret
L6:
  sub    $0x8,%rsp
  mov    $0x0,%edi
  call   <assert@plt>
  mov    $0x6,%eax
  add    $0x8,%rsp
  ret
  mov    $0x5,%eax
  ret
```

assistant: ```c
int calendar_index(char ind) {
  switch (ind) {
  case 'Y':
    return 5;
  case 'M':
    return 4;
  case 'D':
    return 3;
  case 'h':
    return 2;
  case 'm':
    return 1;
  case 's':
    return 0;
  default:
    assert(0);
    return 6;
  }
}
```
user: What is the c source code of the assembly code below:

```asm
<calendar_index>:
  endbr64
  sub    $0x44,%edi
  cmp    $0x2f,%dil
  ja     L1
  lea    D3(%rip),%rdx
  movzbl %dil,%edi
  movslq (%rdx,%rdi,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
  nopw   0x0(%rax,%rax,1)
L1:
  sub    $0x8,%rsp
  xor    %edi,%edi
  call   <assert@plt>
  mov    $0x6,%eax
  add    $0x8,%rsp
  ret
  nopl   (%rax)
  mov    $0x3,%eax
  ret
  cs nopw 0x0(%rax,%rax,1)
  mov    $0x2,%eax
  ret
  cs nopw 0x0(%rax,%rax,1)
  mov    $0x1,%eax
  ret
  cs nopw 0x0(%rax,%rax,1)
  xor    %eax,%eax
  ret
  nopl   0x0(%rax,%rax,1)
  mov    $0x5,%eax
  ret
  xchg   %ax,%ax
  mov    $0x4,%eax
  ret
```

assistant: ```c
int calendar_index(char ind) {
  switch (ind) {
  case 'Y':
    return 5;
  case 'M':
    return 4;
  case 'D':
    return 3;
  case 'h':
    return 2;
  case 'm':
    return 1;
  case 's':
    return 0;
  default:
    assert(0);
    return 6;
  }
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<calendar_index>:
  endbr64
  sub    $0x44,%edi
  cmp    $0x2f,%dil
  ja     L2
  lea    D3(%rip),%rdx
  movzbl %dil,%edi
  movslq (%rdx,%rdi,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
  nopw   0x0(%rax,%rax,1)
L2:
  sub    $0x8,%rsp
  xor    %edi,%edi
  call   <assert@plt>
  mov    $0x6,%eax
  add    $0x8,%rsp
  ret
  nopl   (%rax)
  mov    $0x3,%eax
  ret
  cs nopw 0x0(%rax,%rax,1)
  mov    $0x2,%eax
  ret
  cs nopw 0x0(%rax,%rax,1)
  mov    $0x1,%eax
  ret
  cs nopw 0x0(%rax,%rax,1)
  xor    %eax,%eax
  ret
  nopl   0x0(%rax,%rax,1)
  mov    $0x5,%eax
  ret
  xchg   %ax,%ax
  mov    $0x4,%eax
  ret
```

assistant: ```c
int calendar_index(char ind) {
  switch (ind) {
  case 'Y':
    return 5;
  case 'M':
    return 4;
  case 'D':
    return 3;
  case 'h':
    return 2;
  case 'm':
    return 1;
  case 's':
    return 0;
  default:
    assert(0);
    return 6;
  }
}
```
user: Translate the below assembly code into C programming language:

```asm
<visiGeneCopyright>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x120,%rsp
  mov    %rdi,-0x118(%rbp)
  mov    %esi,-0x11c(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x11c(%rbp),%edx
  lea    -0x110(%rbp),%rax
  mov    %edx,%ecx
  lea    D4(%rip),%rdx
  mov    $0x100,%esi
  mov    %rax,%rdi
  call   <sqlSafef@plt>
  lea    -0x110(%rbp),%rdx
  mov    -0x118(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <sqlQuickString@plt>
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L3
  call   <__stack_chk_fail@plt>
L3:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D4
type: string

tool: D4: select copyright.notice from image,imageFile,submissionSet,copyright where image.id = %d and image.imageFile = imageFile.id and imageFile.submissionSet = submissionSet.id and submissionSet.copyright = copyright.id

assistant: ```c
char *visiGeneCopyright(struct sqlConnection *conn, int id) {
  char query[256];
  sqlSafef(query, sizeof(query),
           "select copyright.notice from image,imageFile,submissionSet,copyright "
           "where image.id = %d "
           "and image.imageFile = imageFile.id "
           "and imageFile.submissionSet = submissionSet.id "
           "and submissionSet.copyright = copyright.id",
           id);
  return sqlQuickString(conn, query);
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<visiGeneCopyright>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x118,%rsp
  mov    %rdi,%rbx
  mov    %esi,%ecx
  mov    %fs:0x28,%rax
  mov    %rax,0x108(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbp
  lea    D9(%rip),%rdx
  mov    $0x100,%esi
  mov    %rbp,%rdi
  call   <sqlSafef@plt>
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <sqlQuickString@plt>
  mov    0x108(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L7
  add    $0x118,%rsp
  pop    %rbx
  pop    %rbp
  ret
L7:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: tag: D9
type_infered: string

tool: D9: select copyright.notice from image,imageFile,submissionSet,copyright where image.id = %d and image.imageFile = imageFile.id and imageFile.submissionSet = submissionSet.id and submissionSet.copyright = copyright.id

assistant: ```c
char *visiGeneCopyright(struct sqlConnection *conn, int id) {
  char query[256];
  sqlSafef(query, sizeof(query),
           "select copyright.notice from image,imageFile,submissionSet,copyright "
           "where image.id = %d "
           "and image.imageFile = imageFile.id "
           "and imageFile.submissionSet = submissionSet.id "
           "and submissionSet.copyright = copyright.id",
           id);
  return sqlQuickString(conn, query);
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<visiGeneCopyright>:
  endbr64
  push   %r12
  mov    %esi,%ecx
  lea    D6(%rip),%rdx
  mov    $0x100,%esi
  push   %rbp
  mov    %rdi,%rbp
  sub    $0x118,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x108(%rsp)
  xor    %eax,%eax
  mov    %rsp,%r12
  mov    %r12,%rdi
  call   <sqlSafef@plt>
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <sqlQuickString@plt>
  mov    0x108(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L0
  add    $0x118,%rsp
  pop    %rbp
  pop    %r12
  ret
L0:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_label: D6
data_type: string

tool: D6: select copyright.notice from image,imageFile,submissionSet,copyright where image.id = %d and image.imageFile = imageFile.id and imageFile.submissionSet = submissionSet.id and submissionSet.copyright = copyright.id

assistant: ```c
char *visiGeneCopyright(struct sqlConnection *conn, int id) {
  char query[256];
  sqlSafef(query, sizeof(query),
           "select copyright.notice from image,imageFile,submissionSet,copyright "
           "where image.id = %d "
           "and image.imageFile = imageFile.id "
           "and imageFile.submissionSet = submissionSet.id "
           "and submissionSet.copyright = copyright.id",
           id);
  return sqlQuickString(conn, query);
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<visiGeneCopyright>:
  endbr64
  push   %r12
  mov    %esi,%ecx
  lea    D4(%rip),%rdx
  mov    $0x100,%esi
  push   %rbp
  mov    %rdi,%rbp
  sub    $0x118,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x108(%rsp)
  xor    %eax,%eax
  mov    %rsp,%r12
  mov    %r12,%rdi
  call   <sqlSafef@plt>
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <sqlQuickString@plt>
  mov    0x108(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L0
  add    $0x118,%rsp
  pop    %rbp
  pop    %r12
  ret
L0:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_label: D4
data_type: string

tool: D4: select copyright.notice from image,imageFile,submissionSet,copyright where image.id = %d and image.imageFile = imageFile.id and imageFile.submissionSet = submissionSet.id and submissionSet.copyright = copyright.id

assistant: ```c
char *visiGeneCopyright(struct sqlConnection *conn, int id) {
  char query[256];
  sqlSafef(query, sizeof(query),
           "select copyright.notice from image,imageFile,submissionSet,copyright "
           "where image.id = %d "
           "and image.imageFile = imageFile.id "
           "and imageFile.submissionSet = submissionSet.id "
           "and submissionSet.copyright = copyright.id",
           id);
  return sqlQuickString(conn, query);
}
```
user: What is the c source code of the assembly code below:

```asm
<WebRtcIsac_AllPoleFilter>:
  endbr64
  mov    %rsi,%r8
  mov    %rdx,%r9
  mov    %ecx,%r10d
  movsd  (%rsi),%xmm0
  comisd D22(%rip),%xmm0
  jbe    L79
  movsd  D26(%rip),%xmm1
  comisd %xmm0,%xmm1
  jbe    L79
  test   %rdx,%rdx
  je     L12
  lea    -0x18(%rdi),%rcx
  lea    -0x2(%r10),%eax
  shl    $0x3,%rax
  sub    %rax,%rcx
  mov    $0x0,%esi
L75:
  movsd  0x8(%r8),%xmm1
  mulsd  -0x8(%rdi),%xmm1
  cmp    $0x1,%r10d
  jle    L45
  lea    0x10(%r8),%rdx
  lea    -0x10(%rdi),%rax
L59:
  movsd  (%rdx),%xmm0
  mulsd  (%rax),%xmm0
  addsd  %xmm0,%xmm1
  add    $0x8,%rdx
  sub    $0x8,%rax
  cmp    %rax,%rcx
  jne    L59
L45:
  add    $0x8,%rdi
  movsd  -0x8(%rdi),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rdi)
  add    $0x1,%rsi
  add    $0x8,%rcx
  cmp    %rsi,%r9
  jne    L75
  ret
L79:
  movsd  D2(%rip),%xmm2
  divsd  %xmm0,%xmm2
  test   %r9,%r9
  je     L12
  lea    -0x1(%r10),%eax
  lea    0x10(%r8,%rax,8),%rcx
  mov    $0x0,%esi
L35:
  movapd %xmm2,%xmm0
  mulsd  (%rdi),%xmm0
  movsd  %xmm0,(%rdi)
  test   %r10d,%r10d
  jle    L64
  lea    0x8(%r8),%rax
  lea    -0x8(%rdi),%rdx
L87:
  movapd %xmm2,%xmm1
  mulsd  (%rax),%xmm1
  mulsd  (%rdx),%xmm1
  movsd  (%rdi),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,(%rdi)
  add    $0x8,%rax
  sub    $0x8,%rdx
  cmp    %rcx,%rax
  jne    L87
L64:
  add    $0x8,%rdi
  add    $0x1,%rsi
  cmp    %rsi,%r9
  jne    L35
L12:
  ret
```

tool_calls: name: disassemble_data
arguments: data_tag: D22
type_infered: f64[2]
name: disassemble_data
arguments: data_tag: D26
type_infered: f64
name: disassemble_data
arguments: data_tag: D2
type_infered: f64

tool: {"D22": [0.9999,1.0001]}

tool: D26: 1.0001

tool: D2: 1

assistant: ```c
void WebRtcIsac_AllPoleFilter(double *InOut, double *Coef, size_t lengthInOut, int orderCoef) {
  double scal;
  double sum;
  size_t n;
  int k;
  if ((Coef[0] > 0.9999) && (Coef[0] < 1.0001)) {
    for (n = 0; n < lengthInOut; n++) {
      sum = Coef[1] * InOut[-1];
      for (k = 2; k <= orderCoef; k++) {
        sum += Coef[k] * InOut[-k];
      }
      *InOut++ -= sum;
    }
  } else {
    scal = 1.0 / Coef[0];
    for (n = 0; n < lengthInOut; n++) {
      *InOut *= scal;
      for (k = 1; k <= orderCoef; k++) {
        *InOut -= scal * Coef[k] * InOut[-k];
      }
      InOut++;
    }
  }
}
```
user: Translate the below assembly code into C programming language:

```asm
<WebRtcIsac_AllPoleFilter>:
  endbr64
  movsd  (%rsi),%xmm0
  mov    %rsi,%r8
  mov    %rdx,%r9
  mov    %ecx,%r10d
  comisd D28(%rip),%xmm0
  jbe    L19
  movsd  D19(%rip),%xmm1
  comisd %xmm0,%xmm1
  jbe    L19
  test   %rdx,%rdx
  je     L86
  lea    -0x2(%r10),%eax
  lea    -0x18(%rdi),%rcx
  xor    %esi,%esi
  shl    $0x3,%rax
  sub    %rax,%rcx
  nopl   0x0(%rax,%rax,1)
L37:
  movsd  0x8(%r8),%xmm1
  mulsd  -0x8(%rdi),%xmm1
  cmp    $0x1,%r10d
  jle    L0
  lea    0x10(%r8),%rdx
  lea    -0x10(%rdi),%rax
  nopl   0x0(%rax)
L41:
  movsd  (%rdx),%xmm0
  mulsd  (%rax),%xmm0
  sub    $0x8,%rax
  add    $0x8,%rdx
  addsd  %xmm0,%xmm1
  cmp    %rax,%rcx
  jne    L41
L0:
  movsd  (%rdi),%xmm0
  add    $0x1,%rsi
  add    $0x8,%rdi
  add    $0x8,%rcx
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rdi)
  cmp    %rsi,%r9
  jne    L37
  ret
  nopl   0x0(%rax,%rax,1)
L19:
  movsd  D9(%rip),%xmm2
  divsd  %xmm0,%xmm2
  test   %r9,%r9
  je     L86
  lea    -0x1(%r10),%eax
  xor    %esi,%esi
  lea    0x10(%r8,%rax,8),%rcx
  nopl   0x0(%rax)
L84:
  movsd  (%rdi),%xmm1
  lea    0x8(%r8),%rax
  lea    -0x8(%rdi),%rdx
  mulsd  %xmm2,%xmm1
  movsd  %xmm1,(%rdi)
  test   %r10d,%r10d
  jle    L28
  nopl   0x0(%rax)
L33:
  movsd  (%rax),%xmm0
  add    $0x8,%rax
  sub    $0x8,%rdx
  mulsd  %xmm2,%xmm0
  mulsd  0x8(%rdx),%xmm0
  subsd  %xmm0,%xmm1
  movsd  %xmm1,(%rdi)
  cmp    %rcx,%rax
  jne    L33
L28:
  add    $0x1,%rsi
  add    $0x8,%rdi
  cmp    %rsi,%r9
  jne    L84
  ret
L86:
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D28
type_infered: f64[2]
name: unpack_data
arguments: data_label: D19
type_infered: f64
name: unpack_data
arguments: data_label: D9
type_infered: f64

tool: {"D28": [0.9999,1.0001]}

tool: D19: 1.0001

tool: D9: 1

assistant: ```c
void WebRtcIsac_AllPoleFilter(double *InOut, double *Coef, size_t lengthInOut, int orderCoef) {
  double scal;
  double sum;
  size_t n;
  int k;
  if ((Coef[0] > 0.9999) && (Coef[0] < 1.0001)) {
    for (n = 0; n < lengthInOut; n++) {
      sum = Coef[1] * InOut[-1];
      for (k = 2; k <= orderCoef; k++) {
        sum += Coef[k] * InOut[-k];
      }
      *InOut++ -= sum;
    }
  } else {
    scal = 1.0 / Coef[0];
    for (n = 0; n < lengthInOut; n++) {
      *InOut *= scal;
      for (k = 1; k <= orderCoef; k++) {
        *InOut -= scal * Coef[k] * InOut[-k];
      }
      InOut++;
    }
  }
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<WebRtcIsac_AllPoleFilter>:
  endbr64
  movsd  (%rsi),%xmm0
  comisd D15(%rip),%xmm0
  mov    %rdx,%r8
  mov    %ecx,%r9d
  jbe    L19
  movsd  D14(%rip),%xmm1
  comisd %xmm0,%xmm1
  jbe    L19
  test   %rdx,%rdx
  je     L42
  push   %r13
  mov    $0xffffffffffffffd8,%r11
  lea    -0x18(%rdi),%r10
  push   %r12
  push   %rbp
  push   %rbx
  lea    -0x1(%rcx),%ebx
  xor    %ecx,%ecx
  mov    %ebx,%eax
  mov    %ebx,%ebp
  shr    %eax
  and    $0xfffffffe,%ebp
  sub    $0x1,%eax
  lea    0x2(%rbp),%r12d
  shl    $0x4,%rax
  sub    %rax,%r11
  nopl   0x0(%rax)
L9:
  movsd  0x8(%rsi),%xmm1
  mulsd  -0x8(%rdi),%xmm1
  cmp    $0x1,%r9d
  jle    L37
  cmp    $0x2,%r9d
  je     L103
  lea    0x10(%rsi),%rdx
  lea    (%rdi,%r11,1),%r13
  mov    %r10,%rax
  nopl   (%rax)
L70:
  movupd (%rax),%xmm0
  movupd (%rdx),%xmm4
  sub    $0x10,%rax
  add    $0x10,%rdx
  shufpd $0x1,%xmm0,%xmm0
  mulpd  %xmm4,%xmm0
  addsd  %xmm0,%xmm1
  unpckhpd %xmm0,%xmm0
  addsd  %xmm0,%xmm1
  cmp    %rax,%r13
  jne    L70
  movslq %r12d,%rax
  cmp    %ebx,%ebp
  je     L37
L78:
  lea    0x0(,%rax,8),%r13
  mov    %rdi,%rdx
  sub    %r13,%rdx
  movsd  (%rdx),%xmm0
  mulsd  (%rsi,%rax,8),%xmm0
  addsd  %xmm0,%xmm1
L37:
  movsd  (%rdi),%xmm0
  add    $0x1,%rcx
  add    $0x8,%rdi
  add    $0x8,%r10
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rdi)
  cmp    %rcx,%r8
  jne    L9
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   (%rax)
L19:
  movsd  D21(%rip),%xmm2
  divsd  %xmm0,%xmm2
  test   %r8,%r8
  je     L42
  lea    -0x1(%r9),%eax
  xor    %r10d,%r10d
  lea    0x10(%rsi,%rax,8),%rcx
  nopl   (%rax)
L56:
  movsd  (%rdi),%xmm1
  lea    0x8(%rsi),%rax
  lea    -0x8(%rdi),%rdx
  mulsd  %xmm2,%xmm1
  movsd  %xmm1,(%rdi)
  test   %r9d,%r9d
  jle    L112
  nopl   0x0(%rax)
L92:
  movsd  (%rax),%xmm0
  add    $0x8,%rax
  sub    $0x8,%rdx
  mulsd  %xmm2,%xmm0
  mulsd  0x8(%rdx),%xmm0
  subsd  %xmm0,%xmm1
  movsd  %xmm1,(%rdi)
  cmp    %rcx,%rax
  jne    L92
L112:
  add    $0x1,%r10
  add    $0x8,%rdi
  cmp    %r10,%r8
  jne    L56
  ret
L103:
  mov    $0x2,%eax
  jmp    L78
L42:
  ret
```

tool_calls: name: disassemble_data
arguments: data_tag: D15
datatype: f64[2]
name: disassemble_data
arguments: data_tag: D14
datatype: f64
name: disassemble_data
arguments: data_tag: D21
datatype: f64

tool: {"D15": [0.9999,1.0001]}

tool: D14: 1.0001

tool: D21: 1

assistant: ```c
void WebRtcIsac_AllPoleFilter(double *InOut, double *Coef, size_t lengthInOut, int orderCoef) {
  double scal;
  double sum;
  size_t n;
  int k;
  if ((Coef[0] > 0.9999) && (Coef[0] < 1.0001)) {
    for (n = 0; n < lengthInOut; n++) {
      sum = Coef[1] * InOut[-1];
      for (k = 2; k <= orderCoef; k++) {
        sum += Coef[k] * InOut[-k];
      }
      *InOut++ -= sum;
    }
  } else {
    scal = 1.0 / Coef[0];
    for (n = 0; n < lengthInOut; n++) {
      *InOut *= scal;
      for (k = 1; k <= orderCoef; k++) {
        *InOut -= scal * Coef[k] * InOut[-k];
      }
      InOut++;
    }
  }
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<check_ext>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x18(%rbp)
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x14(%rbp)
  mov    -0x14(%rbp),%eax
  add    $0x1,%eax
  cmp    %eax,-0x18(%rbp)
  jg     L66
  mov    $0x0,%eax
  jmp    L14
L66:
  mov    -0x18(%rbp),%eax
  sub    -0x14(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  je     L148
  mov    $0x0,%eax
  jmp    L14
L148:
  movl   $0x0,-0x1c(%rbp)
  jmp    L84
L13:
  mov    -0x18(%rbp),%eax
  sub    -0x14(%rbp),%eax
  mov    %eax,%edx
  mov    -0x1c(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%ebx
  mov    -0x1c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <toupper@plt>
  cmp    %al,%bl
  jne    L103
  addl   $0x1,-0x1c(%rbp)
L84:
  mov    -0x1c(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jl     L13
  jmp    L53
L103:
  nop
L53:
  mov    -0x1c(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jne    L112
  mov    $0x1,%eax
  jmp    L14
L112:
  movl   $0x0,-0x1c(%rbp)
  jmp    L87
L155:
  mov    -0x18(%rbp),%eax
  sub    -0x14(%rbp),%eax
  mov    %eax,%edx
  mov    -0x1c(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%ebx
  mov    -0x1c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <tolower@plt>
  cmp    %al,%bl
  jne    L44
  addl   $0x1,-0x1c(%rbp)
L87:
  mov    -0x1c(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jl     L155
  jmp    L119
L44:
  nop
L119:
  mov    -0x1c(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jne    L100
  mov    $0x1,%eax
  jmp    L14
L100:
  mov    $0x0,%eax
L14:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
int check_ext(const char *filename, const char *ext) {
  int flen, elen;
  int i;
  flen = (int)strlen(filename);
  elen = (int)strlen(ext);
  if (flen <= elen + 1)
    return 0;
  if (filename[flen - elen - 1] != '.')
    return 0;
  for (i = 0; i < elen; i++)
    if (filename[flen - elen + i] != toupper(ext[i]))
      break;
  if (i == elen)
    return 1;
  for (i = 0; i < elen; i++)
    if (filename[flen - elen + i] != tolower(ext[i]))
      break;
  if (i == elen)
    return 1;
  return 0;
}
```
user: Translate the below assembly code into C programming language:

```asm
<check_ext>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%rbp
  mov    %rsi,%r12
  call   <strlen@plt>
  mov    %rax,%rbx
  mov    %r12,%rdi
  call   <strlen@plt>
  mov    %rax,%rcx
  mov    %rax,0x8(%rsp)
  add    $0x1,%eax
  mov    $0x0,%edx
  cmp    %ebx,%eax
  jge    L72
  sub    %ecx,%ebx
  movslq %ebx,%rax
  cmpb   $0x2e,-0x1(%rbp,%rax,1)
  jne    L72
  test   %ecx,%ecx
  jle    L18
  lea    -0x1(%rcx),%r14d
  mov    $0x0,%ebx
  add    %rax,%rbp
  jmp    L99
L87:
  mov    %rax,%rbx
L99:
  mov    %ebx,%r13d
  movzbl 0x0(%rbp,%rbx,1),%r15d
  movsbl (%r12,%rbx,1),%edi
  call   <toupper@plt>
  cmp    %al,%r15b
  jne    L57
  lea    0x1(%rbx),%r13d
  lea    0x1(%rbx),%rax
  cmp    %r14,%rbx
  jne    L87
L57:
  mov    $0x1,%edx
  mov    $0x0,%ebx
  cmp    0x8(%rsp),%r13d
  jne    L52
  jmp    L72
L103:
  mov    %rax,%rbx
L52:
  mov    %ebx,%r13d
  movzbl 0x0(%rbp,%rbx,1),%r15d
  movsbl (%r12,%rbx,1),%edi
  call   <tolower@plt>
  cmp    %al,%r15b
  jne    L98
  lea    0x1(%rbx),%r13d
  lea    0x1(%rbx),%rax
  cmp    %r14,%rbx
  jne    L103
L98:
  cmp    %r13d,0x8(%rsp)
  sete   %dl
  movzbl %dl,%edx
L72:
  mov    %edx,%eax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L18:
  mov    $0x1,%edx
  mov    $0x0,%r13d
  cmpl   $0x0,0x8(%rsp)
  jne    L98
  jmp    L72
```

assistant: ```c
int check_ext(const char *filename, const char *ext) {
  int flen, elen;
  int i;
  flen = (int)strlen(filename);
  elen = (int)strlen(ext);
  if (flen <= elen + 1)
    return 0;
  if (filename[flen - elen - 1] != '.')
    return 0;
  for (i = 0; i < elen; i++)
    if (filename[flen - elen + i] != toupper(ext[i]))
      break;
  if (i == elen)
    return 1;
  for (i = 0; i < elen; i++)
    if (filename[flen - elen + i] != tolower(ext[i]))
      break;
  if (i == elen)
    return 1;
  return 0;
}
```