ylfeng/ReF-Decompile-dataset huggingface dataset:
user: Translate the below assembly code into C programming language:

```asm
<float_twice>:
  endbr64
  mov    %edi,%edx
  and    $0x7f800000,%edx
  jne    L1
  lea    (%rdi,%rdi,1),%eax
  and    $0x80000000,%edi
  and    $0xfffffe,%eax
  or     %edi,%eax
  ret
  nop
L1:
  lea    0x800000(%rdi),%eax
  cmp    $0x7f800000,%edx
  cmove  %edi,%eax
  ret
```

assistant: ```c
unsigned float_twice(unsigned uf) {
  unsigned f = uf;
  if ((f & 0x7F800000) == 0) {
    f = ((f & 0x007FFFFF) << 1) | (0x80000000 & f);
  } else if ((f & 0x7F800000) != 0x7F800000) {
    f = f + 0x00800000;
  }
  return f;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<krocllvm_make_namedlabel>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  call   <strlen@plt>
  mov    %eax,%r12d
  lea    0x5(%rax),%edi
  call   <smalloc@plt>
  mov    %rax,%rbp
  mov    $0x2,%edx
  lea    D11(%rip),%rsi
  mov    %rbx,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L48
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  call   <strcpy@plt>
  mov    $0x2,%eax
L98:
  cltq
  add    %rbp,%rax
  movzbl (%rax),%edx
  test   %dl,%dl
  jne    L104
L2:
  mov    %rbp,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L48:
  mov    $0x4,%edx
  lea    D36(%rip),%rsi
  mov    %rbx,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L64
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  call   <strcpy@plt>
  mov    $0x4,%eax
  jmp    L98
L64:
  mov    $0x2,%edx
  lea    D9(%rip),%rsi
  mov    %rbx,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L107
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  call   <strcpy@plt>
  mov    $0x2,%eax
  jmp    L98
L107:
  mov    $0x3,%edx
  lea    D24(%rip),%rsi
  mov    %rbx,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L95
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  call   <strcpy@plt>
  mov    $0x3,%eax
  jmp    L98
L95:
  lea    D14(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcpy@plt>
  lea    0x1(%r12),%edx
  lea    0x2(%rbp),%rdi
  mov    %rbx,%rsi
  call   <memcpy@plt>
  mov    $0x2,%eax
  jmp    L98
L0:
  add    $0x1,%rax
  movzbl (%rax),%edx
  test   %dl,%dl
  je     L2
L104:
  cmp    $0x2e,%dl
  jne    L0
  movb   $0x5f,(%rax)
  jmp    L0
```

tool_calls: name: read_data
arguments: data_tag: D11
type_guessed: string
name: read_data
arguments: data_tag: D36
type_guessed: string
name: read_data
arguments: data_tag: D9
type_guessed: string
name: read_data
arguments: data_tag: D24
type_guessed: string
name: read_data
arguments: data_tag: D14
type_guessed: string

tool: D11: C.

tool: D36: CIF.

tool: D9: B.

tool: D24: BX.

tool: D14: O_

assistant: ```c
char *krocllvm_make_namedlabel(const char *lbl) {
  int lbl_len = strlen(lbl);
  char *belbl = (char *)smalloc(lbl_len + 5);
  char *ch;
  int offs = 0;
  if (!strncmp(lbl, "C.", 2)) {
    strcpy(belbl, lbl);
    offs = 2;
  } else if (!strncmp(lbl, "CIF.", 4)) {
    strcpy(belbl, lbl);
    offs = 4;
  } else if (!strncmp(lbl, "B.", 2)) {
    strcpy(belbl, lbl);
    offs = 2;
  } else if (!strncmp(lbl, "BX.", 3)) {
    strcpy(belbl, lbl);
    offs = 3;
  } else {
    strcpy(belbl, "O_");
    memcpy(belbl + 2, lbl, lbl_len + 1);
    offs = 2;
  }
  for (ch = belbl + offs; *ch != '\0'; ch++) {
    switch (*ch) {
    case '.':
      *ch = '_';
      break;
    }
  }
  return belbl;
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<krocllvm_make_namedlabel>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x8,%rsp
  call   <strlen@plt>
  lea    0x5(%rax),%edi
  mov    %eax,%r13d
  call   <smalloc@plt>
  mov    $0x2,%edx
  lea    D1(%rip),%rsi
  mov    %rbp,%rdi
  mov    %rax,%r12
  call   <strncmp@plt>
  test   %eax,%eax
  je     L57
  mov    $0x4,%edx
  lea    D39(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L60
  mov    %rbp,%rsi
  mov    %r12,%rdi
  lea    0x4(%r12),%rbx
  call   <strcpy@plt>
  movzbl (%rbx),%eax
  test   %al,%al
  jne    L50
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L60:
  mov    $0x2,%edx
  lea    D28(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L49
L57:
  mov    %rbp,%rsi
  mov    %r12,%rdi
  lea    0x2(%r12),%rbx
  call   <strcpy@plt>
  jmp    L30
  nopw   0x0(%rax,%rax,1)
L50:
  cmp    $0x2e,%al
  jne    L8
  movb   $0x5f,(%rbx)
L8:
  add    $0x1,%rbx
L30:
  movzbl (%rbx),%eax
  test   %al,%al
  jne    L50
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L49:
  mov    $0x3,%edx
  lea    D19(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L96
  mov    %rbp,%rsi
  mov    %r12,%rdi
  lea    0x3(%r12),%rbx
  call   <strcpy@plt>
  jmp    L30
L96:
  mov    %r12,%rdi
  lea    D38(%rip),%rsi
  lea    0x2(%r12),%rbx
  call   <strcpy@plt>
  lea    0x1(%r13),%edx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <memcpy@plt>
  jmp    L30
```

tool_calls: name: extract_symbolic_data
arguments: label: D1
data_type: string
name: extract_symbolic_data
arguments: label: D39
data_type: string
name: extract_symbolic_data
arguments: label: D28
data_type: string
name: extract_symbolic_data
arguments: label: D19
data_type: string
name: extract_symbolic_data
arguments: label: D38
data_type: string

tool: D1: C.

tool: D39: CIF.

tool: D28: B.

tool: D19: BX.

tool: D38: O_

assistant: ```c
char *krocllvm_make_namedlabel(const char *lbl) {
  int lbl_len = strlen(lbl);
  char *belbl = (char *)smalloc(lbl_len + 5);
  char *ch;
  int offs = 0;
  if (!strncmp(lbl, "C.", 2)) {
    strcpy(belbl, lbl);
    offs = 2;
  } else if (!strncmp(lbl, "CIF.", 4)) {
    strcpy(belbl, lbl);
    offs = 4;
  } else if (!strncmp(lbl, "B.", 2)) {
    strcpy(belbl, lbl);
    offs = 2;
  } else if (!strncmp(lbl, "BX.", 3)) {
    strcpy(belbl, lbl);
    offs = 3;
  } else {
    strcpy(belbl, "O_");
    memcpy(belbl + 2, lbl, lbl_len + 1);
    offs = 2;
  }
  for (ch = belbl + offs; *ch != '\0'; ch++) {
    switch (*ch) {
    case '.':
      *ch = '_';
      break;
    }
  }
  return belbl;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<krocllvm_make_namedlabel>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x8,%rsp
  call   <strlen@plt>
  lea    0x5(%rax),%edi
  mov    %eax,%r13d
  call   <smalloc@plt>
  mov    $0x2,%edx
  lea    D40(%rip),%rsi
  mov    %rbp,%rdi
  mov    %rax,%r12
  call   <strncmp@plt>
  test   %eax,%eax
  je     L68
  mov    $0x4,%edx
  lea    D15(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L90
  mov    %rbp,%rsi
  mov    %r12,%rdi
  lea    0x4(%r12),%rbx
  call   <strcpy@plt>
  movzbl (%rbx),%eax
  test   %al,%al
  jne    L31
L107:
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L90:
  mov    $0x2,%edx
  lea    D5(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L79
L68:
  mov    %rbp,%rsi
  mov    %r12,%rdi
  lea    0x2(%r12),%rbx
  call   <strcpy@plt>
  jmp    L102
  nopw   0x0(%rax,%rax,1)
L69:
  add    $0x1,%rbx
L102:
  movzbl (%rbx),%eax
  test   %al,%al
  je     L107
L31:
  cmp    $0x2e,%al
  jne    L69
  movb   $0x5f,(%rbx)
  movzbl 0x1(%rbx),%eax
  add    $0x1,%rbx
  test   %al,%al
  jne    L31
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L79:
  mov    $0x3,%edx
  lea    D20(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L1
  mov    %rbp,%rsi
  mov    %r12,%rdi
  lea    0x3(%r12),%rbx
  call   <strcpy@plt>
  jmp    L102
L1:
  mov    %r12,%rdi
  lea    D17(%rip),%rsi
  lea    0x2(%r12),%rbx
  call   <strcpy@plt>
  lea    0x1(%r13),%edx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <memcpy@plt>
  jmp    L102
```

tool_calls: name: parse_data
arguments: tag: D40
type_guessed: string
name: parse_data
arguments: tag: D15
type_guessed: string
name: parse_data
arguments: tag: D5
type_guessed: string
name: parse_data
arguments: tag: D20
type_guessed: string
name: parse_data
arguments: tag: D17
type_guessed: string

tool: D40: C.

tool: D15: CIF.

tool: D5: B.

tool: D20: BX.

tool: D17: O_

assistant: ```c
char *krocllvm_make_namedlabel(const char *lbl) {
  int lbl_len = strlen(lbl);
  char *belbl = (char *)smalloc(lbl_len + 5);
  char *ch;
  int offs = 0;
  if (!strncmp(lbl, "C.", 2)) {
    strcpy(belbl, lbl);
    offs = 2;
  } else if (!strncmp(lbl, "CIF.", 4)) {
    strcpy(belbl, lbl);
    offs = 4;
  } else if (!strncmp(lbl, "B.", 2)) {
    strcpy(belbl, lbl);
    offs = 2;
  } else if (!strncmp(lbl, "BX.", 3)) {
    strcpy(belbl, lbl);
    offs = 3;
  } else {
    strcpy(belbl, "O_");
    memcpy(belbl + 2, lbl, lbl_len + 1);
    offs = 2;
  }
  for (ch = belbl + offs; *ch != '\0'; ch++) {
    switch (*ch) {
    case '.':
      *ch = '_';
      break;
    }
  }
  return belbl;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<to_565_raw>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  jmp    L20
L14:
  movzbl -0xb(%rbp),%eax
  shr    $0x3,%al
  movzbl %al,%eax
  shl    $0xb,%eax
  mov    %eax,%edx
  movzbl -0xa(%rbp),%eax
  shr    $0x2,%al
  movzbl %al,%eax
  shl    $0x5,%eax
  or     %eax,%edx
  movzbl -0x9(%rbp),%eax
  shr    $0x3,%al
  movzbl %al,%eax
  or     %edx,%eax
  mov    %ax,-0xe(%rbp)
  lea    -0xe(%rbp),%rax
  mov    $0x2,%edx
  mov    %rax,%rsi
  mov    $0x1,%edi
  call   <write@plt>
L20:
  lea    -0xb(%rbp),%rax
  mov    $0x3,%edx
  mov    %rax,%rsi
  mov    $0x0,%edi
  call   <read@plt>
  cmp    $0x3,%eax
  je     L14
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L1
  call   <__stack_chk_fail@plt>
L1:
  leave
  ret
```

assistant: ```c
void to_565_raw(void) {
  unsigned char in[3];
  unsigned short out;
  while (read(0, in, 3) == 3) {
    out = ((((in[0]) >> 3) << 11) | (((in[1]) >> 2) << 5) | ((in[2]) >> 3));
    write(1, &out, 2);
  }
  return;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<to_565_raw>:
  endbr64
  push   %rbx
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x5(%rsp),%rbx
  jmp    L8
L27:
  movzbl 0x5(%rsp),%eax
  shr    $0x3,%al
  shl    $0xb,%eax
  movzbl 0x6(%rsp),%edx
  shr    $0x2,%dl
  movzbl %dl,%edx
  shl    $0x5,%edx
  or     %edx,%eax
  movzbl 0x7(%rsp),%edx
  shr    $0x3,%dl
  movzbl %dl,%edx
  or     %edx,%eax
  mov    %ax,0x2(%rsp)
  lea    0x2(%rsp),%rsi
  mov    $0x2,%edx
  mov    $0x1,%edi
  call   <write@plt>
L8:
  mov    $0x3,%edx
  mov    %rbx,%rsi
  mov    $0x0,%edi
  call   <read@plt>
  cmp    $0x3,%eax
  je     L27
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L5
  add    $0x10,%rsp
  pop    %rbx
  ret
L5:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void to_565_raw(void) {
  unsigned char in[3];
  unsigned short out;
  while (read(0, in, 3) == 3) {
    out = ((((in[0]) >> 3) << 11) | (((in[1]) >> 2) << 5) | ((in[2]) >> 3));
    write(1, &out, 2);
  }
  return;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<to_565_raw>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x5(%rsp),%rbx
  lea    0x2(%rsp),%rbp
  jmp    L4
  cs nopw 0x0(%rax,%rax,1)
L0:
  movzbl 0x6(%rsp),%edx
  movzbl 0x5(%rsp),%eax
  mov    %rbp,%rsi
  mov    $0x1,%edi
  shr    $0x2,%dl
  shr    $0x3,%al
  movzbl %dl,%edx
  shl    $0xb,%eax
  shl    $0x5,%edx
  or     %edx,%eax
  movzbl 0x7(%rsp),%edx
  shr    $0x3,%dl
  movzbl %dl,%edx
  or     %edx,%eax
  mov    $0x2,%edx
  mov    %ax,0x2(%rsp)
  call   <write@plt>
L4:
  xor    %edi,%edi
  mov    $0x3,%edx
  mov    %rbx,%rsi
  call   <read@plt>
  cmp    $0x3,%eax
  je     L0
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L8
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  ret
L8:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void to_565_raw(void) {
  unsigned char in[3];
  unsigned short out;
  while (read(0, in, 3) == 3) {
    out = ((((in[0]) >> 3) << 11) | (((in[1]) >> 2) << 5) | ((in[2]) >> 3));
    write(1, &out, 2);
  }
  return;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<to_565_raw>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x5(%rsp),%rbx
  lea    0x2(%rsp),%rbp
  jmp    L0
  cs nopw 0x0(%rax,%rax,1)
L9:
  movzbl 0x6(%rsp),%edx
  movzbl 0x5(%rsp),%eax
  mov    %rbp,%rsi
  mov    $0x1,%edi
  shr    $0x2,%dl
  shr    $0x3,%al
  movzbl %dl,%edx
  shl    $0xb,%eax
  shl    $0x5,%edx
  or     %edx,%eax
  movzbl 0x7(%rsp),%edx
  shr    $0x3,%dl
  movzbl %dl,%edx
  or     %edx,%eax
  mov    $0x2,%edx
  mov    %ax,0x2(%rsp)
  call   <write@plt>
L0:
  xor    %edi,%edi
  mov    $0x3,%edx
  mov    %rbx,%rsi
  call   <read@plt>
  cmp    $0x3,%eax
  je     L9
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L20
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  ret
L20:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void to_565_raw(void) {
  unsigned char in[3];
  unsigned short out;
  while (read(0, in, 3) == 3) {
    out = ((((in[0]) >> 3) << 11) | (((in[1]) >> 2) << 5) | ((in[2]) >> 3));
    write(1, &out, 2);
  }
  return;
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<match>:
  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    D1(%rip),%rax
  mov    (%rax),%edx
  mov    -0x30(%rbp),%rcx
  lea    -0x14(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <regcomp@plt>
  mov    %eax,-0xc(%rbp)
  cmpl   $0x0,-0xc(%rbp)
  je     L21
  mov    $0x0,%eax
  jmp    L46
L21:
  lea    -0x10(%rbp),%rdx
  mov    -0x28(%rbp),%rsi
  lea    -0x14(%rbp),%rax
  mov    $0x0,%r8d
  mov    %rdx,%rcx
  mov    $0x0,%edx
  mov    %rax,%rdi
  call   <regexec@plt>
  mov    %eax,-0xc(%rbp)
  cmpl   $0x0,-0xc(%rbp)
  je     L18
  lea    -0x14(%rbp),%rax
  mov    %rax,%rdi
  call   <regfree@plt>
  mov    $0x0,%eax
  jmp    L46
L18:
  lea    -0x14(%rbp),%rax
  mov    %rax,%rdi
  call   <regfree@plt>
  mov    $0x1,%eax
L46:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L44
  call   <__stack_chk_fail@plt>
L44:
  leave
  ret
```

assistant: ```c
int match(const char *string, const char *pattern) {
  int r;
  regex_t expr;
  regmatch_t rm;
  if ((r = regcomp(&expr, pattern, REG_EXTENDED)) != 0)
    return 0;
  if ((r = regexec(&expr, string, 0, &rm, 0)) != 0) {
    regfree(&expr);
    return 0;
  }
  regfree(&expr);
  return 1;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<match>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%rbp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rdi
  mov    D8(%rip),%rax
  mov    (%rax),%edx
  call   <regcomp@plt>
  mov    $0x0,%ebx
  test   %eax,%eax
  je     L44
L34:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L18
  mov    %ebx,%eax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  ret
L44:
  mov    %eax,%ebx
  lea    0x4(%rsp),%rcx
  mov    %rsp,%rdi
  mov    $0x0,%r8d
  mov    $0x0,%edx
  mov    %rbp,%rsi
  call   <regexec@plt>
  test   %eax,%eax
  jne    L46
  mov    %rsp,%rdi
  call   <regfree@plt>
  mov    $0x1,%ebx
  jmp    L34
L46:
  mov    %rsp,%rdi
  call   <regfree@plt>
  jmp    L34
L18:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int match(const char *string, const char *pattern) {
  int r;
  regex_t expr;
  regmatch_t rm;
  if ((r = regcomp(&expr, pattern, REG_EXTENDED)) != 0)
    return 0;
  if ((r = regexec(&expr, string, 0, &rm, 0)) != 0) {
    regfree(&expr);
    return 0;
  }
  regfree(&expr);
  return 1;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<match>:
  endbr64
  push   %r13
  push   %r12
  xor    %r12d,%r12d
  push   %rbp
  mov    %rdi,%rbp
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  mov    D5(%rip),%rax
  mov    %rsp,%r13
  mov    %r13,%rdi
  mov    (%rax),%edx
  call   <regcomp@plt>
  test   %eax,%eax
  je     L22
L41:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L27
  add    $0x10,%rsp
  mov    %r12d,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax,%rax,1)
L22:
  mov    %r13,%rdi
  lea    0x4(%rsp),%rcx
  xor    %r8d,%r8d
  xor    %edx,%edx
  mov    %rbp,%rsi
  mov    %eax,%r12d
  call   <regexec@plt>
  mov    %r13,%rdi
  test   %eax,%eax
  jne    L30
  call   <regfree@plt>
  mov    $0x1,%r12d
  jmp    L41
  nopl   0x0(%rax)
L30:
  call   <regfree@plt>
  jmp    L41
L27:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int match(const char *string, const char *pattern) {
  int r;
  regex_t expr;
  regmatch_t rm;
  if ((r = regcomp(&expr, pattern, REG_EXTENDED)) != 0)
    return 0;
  if ((r = regexec(&expr, string, 0, &rm, 0)) != 0) {
    regfree(&expr);
    return 0;
  }
  regfree(&expr);
  return 1;
}
```
user: Translate the below assembly code into C programming language:

```asm
<match>:
  endbr64
  push   %r13
  push   %r12
  xor    %r12d,%r12d
  push   %rbp
  mov    %rdi,%rbp
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  mov    D3(%rip),%rax
  mov    %rsp,%r13
  mov    %r13,%rdi
  mov    (%rax),%edx
  call   <regcomp@plt>
  test   %eax,%eax
  je     L46
L35:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L0
  add    $0x10,%rsp
  mov    %r12d,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax,%rax,1)
L46:
  mov    %r13,%rdi
  lea    0x4(%rsp),%rcx
  xor    %r8d,%r8d
  xor    %edx,%edx
  mov    %rbp,%rsi
  mov    %eax,%r12d
  call   <regexec@plt>
  mov    %r13,%rdi
  test   %eax,%eax
  jne    L5
  call   <regfree@plt>
  mov    $0x1,%r12d
  jmp    L35
  nopl   0x0(%rax)
L5:
  call   <regfree@plt>
  jmp    L35
L0:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int match(const char *string, const char *pattern) {
  int r;
  regex_t expr;
  regmatch_t rm;
  if ((r = regcomp(&expr, pattern, REG_EXTENDED)) != 0)
    return 0;
  if ((r = regexec(&expr, string, 0, &rm, 0)) != 0) {
    regfree(&expr);
    return 0;
  }
  regfree(&expr);
  return 1;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<SKP_Silk_bwexpander>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %edx,-0x20(%rbp)
  mov    -0x20(%rbp),%eax
  sub    $0x10000,%eax
  mov    %eax,-0x4(%rbp)
  movl   $0x0,-0x8(%rbp)
  jmp    L9
L5:
  mov    -0x8(%rbp),%eax
  cltq
  lea    (%rax,%rax,1),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzwl (%rax),%eax
  cwtl
  imul   -0x20(%rbp),%eax
  sar    $0xf,%eax
  add    $0x1,%eax
  sar    %eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%eax
  cltq
  lea    (%rax,%rax,1),%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  mov    %dx,(%rax)
  mov    -0x20(%rbp),%eax
  imul   -0x4(%rbp),%eax
  sar    $0xf,%eax
  add    $0x1,%eax
  sar    %eax
  add    %eax,-0x20(%rbp)
  addl   $0x1,-0x8(%rbp)
L9:
  mov    -0x1c(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x8(%rbp)
  jl     L5
  mov    -0x1c(%rbp),%eax
  cltq
  add    %rax,%rax
  lea    -0x2(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzwl (%rax),%eax
  cwtl
  imul   -0x20(%rbp),%eax
  sar    $0xf,%eax
  add    $0x1,%eax
  sar    %eax
  mov    %eax,%edx
  mov    -0x1c(%rbp),%eax
  cltq
  add    %rax,%rax
  lea    -0x2(%rax),%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  mov    %dx,(%rax)
  nop
  pop    %rbp
  ret
```

assistant: ```c
void SKP_Silk_bwexpander(short *ar, const int d, int chirp_Q16) {
  int i;
  int chirp_minus_one_Q16;
  chirp_minus_one_Q16 = chirp_Q16 - 65536;
  for (i = 0; i < d - 1; i++) {
    ar[i] = (short)((16) == 1 ? ((((chirp_Q16) * (ar[i]))) >> 1) + ((((chirp_Q16) * (ar[i]))) & 1) : (((((chirp_Q16) * (ar[i]))) >> ((16) - 1)) + 1) >> 1);
    chirp_Q16 += ((16) == 1 ? ((((chirp_Q16) * (chirp_minus_one_Q16))) >> 1) + ((((chirp_Q16) * (chirp_minus_one_Q16))) & 1) : (((((chirp_Q16) * (chirp_minus_one_Q16))) >> ((16) - 1)) + 1) >> 1);
  }
  ar[d - 1] = (short)((16) == 1 ? ((((chirp_Q16) * (ar[d - 1]))) >> 1) + ((((chirp_Q16) * (ar[d - 1]))) & 1) : (((((chirp_Q16) * (ar[d - 1]))) >> ((16) - 1)) + 1) >> 1);
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<SKP_Silk_bwexpander>:
  endbr64
  mov    %esi,%r8d
  mov    %edx,%ecx
  lea    -0x10000(%rdx),%esi
  cmp    $0x1,%r8d
  jle    L15
  mov    %rdi,%rdx
  lea    -0x2(%r8),%eax
  lea    0x2(%rdi,%rax,2),%r9
L17:
  movswl (%rdx),%eax
  imul   %ecx,%eax
  sar    $0xf,%eax
  add    $0x1,%eax
  sar    %eax
  mov    %ax,(%rdx)
  mov    %esi,%eax
  imul   %ecx,%eax
  sar    $0xf,%eax
  add    $0x1,%eax
  sar    %eax
  add    %eax,%ecx
  add    $0x2,%rdx
  cmp    %r9,%rdx
  jne    L17
L15:
  movslq %r8d,%r8
  lea    -0x2(%rdi,%r8,2),%rdx
  movswl (%rdx),%eax
  imul   %ecx,%eax
  sar    $0xf,%eax
  add    $0x1,%eax
  sar    %eax
  mov    %ax,(%rdx)
  ret
```

assistant: ```c
void SKP_Silk_bwexpander(short *ar, const int d, int chirp_Q16) {
  int i;
  int chirp_minus_one_Q16;
  chirp_minus_one_Q16 = chirp_Q16 - 65536;
  for (i = 0; i < d - 1; i++) {
    ar[i] = (short)((16) == 1 ? ((((chirp_Q16) * (ar[i]))) >> 1) + ((((chirp_Q16) * (ar[i]))) & 1) : (((((chirp_Q16) * (ar[i]))) >> ((16) - 1)) + 1) >> 1);
    chirp_Q16 += ((16) == 1 ? ((((chirp_Q16) * (chirp_minus_one_Q16))) >> 1) + ((((chirp_Q16) * (chirp_minus_one_Q16))) & 1) : (((((chirp_Q16) * (chirp_minus_one_Q16))) >> ((16) - 1)) + 1) >> 1);
  }
  ar[d - 1] = (short)((16) == 1 ? ((((chirp_Q16) * (ar[d - 1]))) >> 1) + ((((chirp_Q16) * (ar[d - 1]))) & 1) : (((((chirp_Q16) * (ar[d - 1]))) >> ((16) - 1)) + 1) >> 1);
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<SKP_Silk_bwexpander>:
  endbr64
  movslq %esi,%r8
  mov    %edx,%ecx
  lea    -0x10000(%rdx),%esi
  cmp    $0x1,%r8d
  jle    L14
  lea    -0x2(%r8),%eax
  mov    %rdi,%rdx
  lea    0x2(%rdi,%rax,2),%r9
  nopl   0x0(%rax)
L2:
  movswl (%rdx),%eax
  add    $0x2,%rdx
  imul   %ecx,%eax
  sar    $0xf,%eax
  add    $0x1,%eax
  sar    %eax
  mov    %ax,-0x2(%rdx)
  mov    %esi,%eax
  imul   %ecx,%eax
  sar    $0xf,%eax
  add    $0x1,%eax
  sar    %eax
  add    %eax,%ecx
  cmp    %rdx,%r9
  jne    L2
L14:
  lea    -0x2(%rdi,%r8,2),%rdx
  movswl (%rdx),%eax
  imul   %ecx,%eax
  sar    $0xf,%eax
  add    $0x1,%eax
  sar    %eax
  mov    %ax,(%rdx)
  ret
```

assistant: ```c
void SKP_Silk_bwexpander(short *ar, const int d, int chirp_Q16) {
  int i;
  int chirp_minus_one_Q16;
  chirp_minus_one_Q16 = chirp_Q16 - 65536;
  for (i = 0; i < d - 1; i++) {
    ar[i] = (short)((16) == 1 ? ((((chirp_Q16) * (ar[i]))) >> 1) + ((((chirp_Q16) * (ar[i]))) & 1) : (((((chirp_Q16) * (ar[i]))) >> ((16) - 1)) + 1) >> 1);
    chirp_Q16 += ((16) == 1 ? ((((chirp_Q16) * (chirp_minus_one_Q16))) >> 1) + ((((chirp_Q16) * (chirp_minus_one_Q16))) & 1) : (((((chirp_Q16) * (chirp_minus_one_Q16))) >> ((16) - 1)) + 1) >> 1);
  }
  ar[d - 1] = (short)((16) == 1 ? ((((chirp_Q16) * (ar[d - 1]))) >> 1) + ((((chirp_Q16) * (ar[d - 1]))) & 1) : (((((chirp_Q16) * (ar[d - 1]))) >> ((16) - 1)) + 1) >> 1);
}
```