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

```asm
<unquote>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbp
  movzbl (%rdx),%eax
  test   %al,%al
  je     L10
  mov    %rsi,%r14
  mov    %rdx,%rbx
  mov    $0x0,%r12d
  mov    $0x20,%r13d
  jmp    L48
L70:
  movb   $0x0,0x0(%rbp)
  add    $0x1,%rbx
  mov    %r14,%rbp
  mov    $0x1,%r12d
  jmp    L125
L110:
  cmp    $0x25,%al
  je     L43
L37:
  movzbl (%rbx),%edx
L84:
  mov    %dl,0x0(%rbp)
  add    $0x1,%rbp
  add    $0x1,%rbx
L125:
  movzbl (%rbx),%eax
  test   %al,%al
  je     L10
L48:
  cmp    $0x3f,%al
  jne    L11
  test   %r12d,%r12d
  je     L70
L11:
  cmp    $0x2b,%al
  jne    L110
  mov    %r13d,%edx
  test   %r12d,%r12d
  je     L110
  jmp    L84
L43:
  movzbl 0x1(%rbx),%edi
  call   <isxdigit@plt>
  test   %rax,%rax
  je     L37
  movzbl 0x2(%rbx),%edi
  call   <isxdigit@plt>
  test   %rax,%rax
  je     L37
  movzbl 0x1(%rbx),%edi
  call   <unhex@plt>
  mov    %eax,%r15d
  movzbl 0x2(%rbx),%edi
  call   <unhex@plt>
  mov    %r15d,%edx
  shl    $0x4,%edx
  or     %eax,%edx
  add    $0x2,%rbx
  jmp    L84
L10:
  movb   $0x0,0x0(%rbp)
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void unquote(unsigned char *path, unsigned char *qs, unsigned char *src) {
  int q;
  unsigned char *dst;
  q = 0;
  dst = path;
  while (src[0] != 0) {
    if (!q && *src == '?') {
      q = 1;
      *dst = 0;
      dst = qs;
      src++;
      continue;
    }
    if (q && *src == '+') {
      *dst = ' ';
    } else if ((*src == '%') && isxdigit(src[1]) && isxdigit(src[2])) {
      *dst = (unhex(src[1]) << 4) | unhex(src[2]);
      src += 2;
    } else {
      *dst = *src;
    }
    dst++;
    src++;
  }
  *dst = 0;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<unquote>:
  endbr64
  push   %r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  push   %rbp
  push   %rbx
  movzbl (%rdx),%eax
  test   %al,%al
  je     L91
  mov    %rsi,%r12
  mov    %rdx,%rbx
  xor    %ebp,%ebp
  jmp    L73
L110:
  cmp    $0x3f,%al
  je     L83
L36:
  cmp    $0x25,%al
  je     L50
L108:
  movzbl (%rbx),%eax
  mov    %al,0x0(%r13)
  mov    %rbx,%rax
L75:
  lea    0x1(%rax),%rbx
  movzbl 0x1(%rax),%eax
  add    $0x1,%r13
  test   %al,%al
  je     L91
L73:
  test   %ebp,%ebp
  je     L110
  mov    $0x1,%ebp
  cmp    $0x2b,%al
  jne    L36
L27:
  mov    %rbx,%rax
  movb   $0x20,0x0(%r13)
  mov    $0x1,%ebp
  add    $0x1,%r13
  lea    0x1(%rax),%rbx
  movzbl 0x1(%rax),%eax
  test   %al,%al
  jne    L73
L91:
  movb   $0x0,0x0(%r13)
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  xchg   %ax,%ax
L50:
  movzbl 0x1(%rbx),%edi
  call   <isxdigit@plt>
  test   %rax,%rax
  je     L108
  movzbl 0x2(%rbx),%edi
  call   <isxdigit@plt>
  test   %rax,%rax
  je     L108
  movzbl 0x1(%rbx),%edi
  call   <unhex@plt>
  movzbl 0x2(%rbx),%edi
  mov    %eax,%r14d
  call   <unhex@plt>
  shl    $0x4,%r14d
  or     %eax,%r14d
  lea    0x2(%rbx),%rax
  mov    %r14b,0x0(%r13)
  jmp    L75
  nopl   (%rax)
L83:
  movb   $0x0,0x0(%r13)
  movzbl 0x1(%rbx),%eax
  lea    0x1(%rbx),%rdx
  mov    %r12,%r13
  test   %al,%al
  je     L91
  mov    %rdx,%rbx
  mov    $0x1,%ebp
  cmp    $0x2b,%al
  jne    L36
  jmp    L27
```

assistant: ```c
void unquote(unsigned char *path, unsigned char *qs, unsigned char *src) {
  int q;
  unsigned char *dst;
  q = 0;
  dst = path;
  while (src[0] != 0) {
    if (!q && *src == '?') {
      q = 1;
      *dst = 0;
      dst = qs;
      src++;
      continue;
    }
    if (q && *src == '+') {
      *dst = ' ';
    } else if ((*src == '%') && isxdigit(src[1]) && isxdigit(src[2])) {
      *dst = (unhex(src[1]) << 4) | unhex(src[2]);
      src += 2;
    } else {
      *dst = *src;
    }
    dst++;
    src++;
  }
  *dst = 0;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<unquote>:
  endbr64
  push   %r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  push   %rbp
  push   %rbx
  movzbl (%rdx),%eax
  test   %al,%al
  je     L95
  mov    %rsi,%r12
  mov    %rdx,%rbx
  xor    %ebp,%ebp
  jmp    L84
L109:
  cmp    $0x3f,%al
  je     L107
L52:
  cmp    $0x25,%al
  je     L22
L48:
  movzbl (%rbx),%eax
  mov    %al,0x0(%r13)
  mov    %rbx,%rax
L38:
  lea    0x1(%rax),%rbx
  movzbl 0x1(%rax),%eax
  add    $0x1,%r13
  test   %al,%al
  je     L95
L84:
  test   %ebp,%ebp
  je     L109
  mov    $0x1,%ebp
  cmp    $0x2b,%al
  jne    L52
L94:
  mov    %rbx,%rax
  movb   $0x20,0x0(%r13)
  mov    $0x1,%ebp
  add    $0x1,%r13
  lea    0x1(%rax),%rbx
  movzbl 0x1(%rax),%eax
  test   %al,%al
  jne    L84
L95:
  movb   $0x0,0x0(%r13)
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  xchg   %ax,%ax
L22:
  movzbl 0x1(%rbx),%edi
  call   <isxdigit@plt>
  test   %rax,%rax
  je     L48
  movzbl 0x2(%rbx),%edi
  call   <isxdigit@plt>
  test   %rax,%rax
  je     L48
  movzbl 0x1(%rbx),%edi
  call   <unhex@plt>
  movzbl 0x2(%rbx),%edi
  mov    %eax,%r14d
  call   <unhex@plt>
  shl    $0x4,%r14d
  or     %eax,%r14d
  lea    0x2(%rbx),%rax
  mov    %r14b,0x0(%r13)
  jmp    L38
  nopl   (%rax)
L107:
  movb   $0x0,0x0(%r13)
  movzbl 0x1(%rbx),%eax
  lea    0x1(%rbx),%rdx
  mov    %r12,%r13
  test   %al,%al
  je     L95
  mov    %rdx,%rbx
  mov    $0x1,%ebp
  cmp    $0x2b,%al
  jne    L52
  jmp    L94
```

assistant: ```c
void unquote(unsigned char *path, unsigned char *qs, unsigned char *src) {
  int q;
  unsigned char *dst;
  q = 0;
  dst = path;
  while (src[0] != 0) {
    if (!q && *src == '?') {
      q = 1;
      *dst = 0;
      dst = qs;
      src++;
      continue;
    }
    if (q && *src == '+') {
      *dst = ' ';
    } else if ((*src == '%') && isxdigit(src[1]) && isxdigit(src[2])) {
      *dst = (unhex(src[1]) << 4) | unhex(src[2]);
      src += 2;
    } else {
      *dst = *src;
    }
    dst++;
    src++;
  }
  *dst = 0;
}
```
user: What is the c source code of the assembly code below:

```asm
<uniformfloatrand>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    $0x0,%eax
  call   <rand@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  sub    $0x40000000,%rax
  sar    $0x6,%rax
  pxor   %xmm0,%xmm0
  cvtsi2ss %rax,%xmm0
  movss  %xmm0,-0xc(%rbp)
  movss  -0xc(%rbp),%xmm0
  leave
  ret
```

assistant: ```c
float uniformfloatrand() {
  float result;
  long a;
  a = rand();
  result = (float)((a - 1073741824) >> 6);
  return result;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<uniformfloatrand>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x0,%eax
  call   <rand@plt>
  sub    $0x40000000,%rax
  sar    $0x6,%rax
  pxor   %xmm0,%xmm0
  cvtsi2ss %rax,%xmm0
  add    $0x8,%rsp
  ret
```

assistant: ```c
float uniformfloatrand() {
  float result;
  long a;
  a = rand();
  result = (float)((a - 1073741824) >> 6);
  return result;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<uniformfloatrand>:
  endbr64
  sub    $0x8,%rsp
  xor    %eax,%eax
  call   <rand@plt>
  pxor   %xmm0,%xmm0
  add    $0x8,%rsp
  sub    $0x40000000,%rax
  sar    $0x6,%rax
  cvtsi2ss %rax,%xmm0
  ret
```

assistant: ```c
float uniformfloatrand() {
  float result;
  long a;
  a = rand();
  result = (float)((a - 1073741824) >> 6);
  return result;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<uniformfloatrand>:
  endbr64
  sub    $0x8,%rsp
  xor    %eax,%eax
  call   <rand@plt>
  pxor   %xmm0,%xmm0
  add    $0x8,%rsp
  sub    $0x40000000,%rax
  sar    $0x6,%rax
  cvtsi2ss %rax,%xmm0
  ret
```

assistant: ```c
float uniformfloatrand() {
  float result;
  long a;
  a = rand();
  result = (float)((a - 1073741824) >> 6);
  return result;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<rdtsc>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  rdtsc
  mov    %rax,-0x10(%rbp)
  mov    %rdx,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  shl    $0x20,%rax
  mov    %rax,%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  pop    %rbp
  ret
```

assistant: ```c
unsigned long rdtsc(void) {
  unsigned long th, tl;
  asm volatile("rdtsc" : "=a"(tl), "=d"(th));
  return (th << 32) + tl;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<rdtsc>:
  endbr64
  rdtsc
  shl    $0x20,%rdx
  add    %rdx,%rax
  ret
```

assistant: ```c
unsigned long rdtsc(void) {
  unsigned long th, tl;
  asm volatile("rdtsc" : "=a"(tl), "=d"(th));
  return (th << 32) + tl;
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<rdtsc>:
  endbr64
  rdtsc
  shl    $0x20,%rdx
  add    %rdx,%rax
  ret
```

assistant: ```c
unsigned long rdtsc(void) {
  unsigned long th, tl;
  asm volatile("rdtsc" : "=a"(tl), "=d"(th));
  return (th << 32) + tl;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<rdtsc>:
  endbr64
  rdtsc
  shl    $0x20,%rdx
  add    %rdx,%rax
  ret
```

assistant: ```c
unsigned long rdtsc(void) {
  unsigned long th, tl;
  asm volatile("rdtsc" : "=a"(tl), "=d"(th));
  return (th << 32) + tl;
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  movsd  D28(%rip),%xmm0
  movsd  %xmm0,-0x10(%rbp)
  mov    D28(%rip),%rax
  movq   %rax,%xmm0
  call   <sindg@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x8(%rbp)
  movsd  -0x8(%rbp),%xmm0
  mov    -0x10(%rbp),%rax
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  lea    D1(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  leave
  ret
```

tool_calls: name: read_data
arguments: data_label: D28
type: f64
name: read_data
arguments: data_label: D1
type: string

tool: D28: 30

tool: D1: sin( %lf ) = %lf


assistant: ```c
int main() {
  double x;
  double y;
  x = 30.0;
  y = sindg(30.0);
  printf("sin( %lf ) = %lf\n", x, y);
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  mov    D13(%rip),%rax
  movq   %rax,%xmm0
  call   <sindg@plt>
  movapd %xmm0,%xmm1
  mov    D13(%rip),%rax
  movq   %rax,%xmm0
  lea    D7(%rip),%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: extract_symbolic_data
arguments: label: D13
type_infered: f64
name: extract_symbolic_data
arguments: label: D7
type_infered: string

tool: D13: 30

tool: D7: sin( %lf ) = %lf


assistant: ```c
int main() {
  double x;
  double y;
  x = 30.0;
  y = sindg(30.0);
  printf("sin( %lf ) = %lf\n", x, y);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  movsd  D1(%rip),%xmm2
  movapd %xmm2,%xmm0
  call   <sindg@plt>
  mov    D1(%rip),%rax
  lea    D25(%rip),%rdi
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  call   <printf@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: extract_symbolic_data
arguments: label: D1
type_guessed: f64
name: extract_symbolic_data
arguments: label: D25
type_guessed: string

tool: D1: 30

tool: D25: sin( %lf ) = %lf


assistant: ```c
int main() {
  double x;
  double y;
  x = 30.0;
  y = sindg(30.0);
  printf("sin( %lf ) = %lf\n", x, y);
}
```
user: What is the c source code of the assembly code below?

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  movsd  D24(%rip),%xmm2
  movapd %xmm2,%xmm0
  call   <sindg@plt>
  mov    D24(%rip),%rax
  lea    D10(%rip),%rdi
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  call   <printf@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D24
type_infered: f64
name: unpack_data
arguments: data_label: D10
type_infered: string

tool: D24: 30

tool: D10: sin( %lf ) = %lf


assistant: ```c
int main() {
  double x;
  double y;
  x = 30.0;
  y = sindg(30.0);
  printf("sin( %lf ) = %lf\n", x, y);
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<catalan>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %edi,-0x14(%rbp)
  cmpl   $0x0,-0x14(%rbp)
  jne    L2
  mov    $0x1,%eax
  jmp    L3
L2:
  mov    -0x14(%rbp),%eax
  add    %eax,%eax
  lea    -0x1(%rax),%ebx
  mov    -0x14(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,%edi
  call   <catalan>
  imul   %ebx,%eax
  add    %eax,%eax
  mov    -0x14(%rbp),%edx
  lea    0x1(%rdx),%ecx
  cltd
  idiv   %ecx
L3:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
int catalan(int n) {
  if (n == 0)
    return 1;
  return 2 * (2 * n - 1) * catalan(n - 1) / (n + 1);
}
```
user: Translate the below assembly code into C programming language:

```asm
<catalan>:
  endbr64
  mov    $0x1,%eax
  test   %edi,%edi
  jne    L8
  ret
L8:
  push   %rbx
  mov    %edi,%ebx
  lea    -0x1(%rdi),%edi
  call   <catalan>
  mov    %eax,%edx
  lea    -0x1(%rbx,%rbx,1),%eax
  imul   %edx,%eax
  add    %eax,%eax
  add    $0x1,%ebx
  cltd
  idiv   %ebx
  pop    %rbx
  ret
```

assistant: ```c
int catalan(int n) {
  if (n == 0)
    return 1;
  return 2 * (2 * n - 1) * catalan(n - 1) / (n + 1);
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<catalan>:
  endbr64
  test   %edi,%edi
  jne    L6
  mov    $0x1,%eax
  ret
  xchg   %ax,%ax
L6:
  push   %r15
  mov    %edi,%r15d
  push   %r14
  push   %r13
  push   %r12
  lea    (%rdi,%rdi,1),%r12d
  push   %rbp
  lea    -0x1(%r12),%ebp
  push   %rbx
  mov    %edi,%ebx
  sub    $0x18,%rsp
  sub    $0x1,%r15d
  je     L38
  mov    %edi,%ecx
  lea    -0x3(%r12),%r13d
  sub    $0x2,%ecx
  mov    %ecx,0xc(%rsp)
  jne    L19
L15:
  lea    0x0(%r13,%r13,1),%eax
  cltd
  idiv   %ebx
  imul   %eax,%ebp
L38:
  lea    0x0(%rbp,%rbp,1),%eax
  add    $0x18,%rsp
  add    $0x1,%ebx
  cltd
  idiv   %ebx
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  cs nopw 0x0(%rax,%rax,1)
L19:
  lea    -0x5(%r12),%r14d
  cmp    $0x3,%edi
  je     L2
  lea    -0x4(%rdi),%edi
  sub    $0x7,%r12d
  call   <catalan>
  mov    0xc(%rsp),%ecx
  imul   %eax,%r12d
  lea    (%r12,%r12,1),%eax
  cltd
  idiv   %ecx
  imul   %eax,%r14d
L2:
  lea    (%r14,%r14,1),%eax
  cltd
  idiv   %r15d
  imul   %eax,%r13d
  jmp    L15
```

assistant: ```c
int catalan(int n) {
  if (n == 0)
    return 1;
  return 2 * (2 * n - 1) * catalan(n - 1) / (n + 1);
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<catalan>:
  endbr64
  test   %edi,%edi
  jne    L4
  mov    $0x1,%eax
  ret
  xchg   %ax,%ax
L4:
  push   %r15
  mov    %edi,%r15d
  push   %r14
  push   %r13
  push   %r12
  lea    (%rdi,%rdi,1),%r12d
  push   %rbp
  lea    -0x1(%r12),%ebp
  push   %rbx
  mov    %edi,%ebx
  sub    $0x18,%rsp
  sub    $0x1,%r15d
  je     L25
  mov    %edi,%ecx
  lea    -0x3(%r12),%r13d
  sub    $0x2,%ecx
  mov    %ecx,0xc(%rsp)
  jne    L39
L43:
  lea    0x0(%r13,%r13,1),%eax
  cltd
  idiv   %ebx
  imul   %eax,%ebp
L25:
  lea    0x0(%rbp,%rbp,1),%eax
  add    $0x18,%rsp
  add    $0x1,%ebx
  cltd
  idiv   %ebx
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  cs nopw 0x0(%rax,%rax,1)
L39:
  lea    -0x5(%r12),%r14d
  cmp    $0x3,%edi
  je     L19
  lea    -0x4(%rdi),%edi
  sub    $0x7,%r12d
  call   <catalan>
  mov    0xc(%rsp),%ecx
  imul   %eax,%r12d
  lea    (%r12,%r12,1),%eax
  cltd
  idiv   %ecx
  imul   %eax,%r14d
L19:
  lea    (%r14,%r14,1),%eax
  cltd
  idiv   %r15d
  imul   %eax,%r13d
  jmp    L43
```

assistant: ```c
int catalan(int n) {
  if (n == 0)
    return 1;
  return 2 * (2 * n - 1) * catalan(n - 1) / (n + 1);
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<scale1d_2t1_ps>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %edx,-0x20(%rbp)
  mov    %ecx,-0x24(%rbp)
  mov    %r8,-0x30(%rbp)
  mov    %r9d,-0x28(%rbp)
  shll   -0x1c(%rbp)
  movl   $0x0,-0x4(%rbp)
  movl   $0x0,-0x8(%rbp)
  jmp    L15
L8:
  mov    -0x4(%rbp),%edx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    -0x8(%rbp),%ecx
  mov    -0x30(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  mov    -0x28(%rbp),%eax
  add    %eax,-0x8(%rbp)
  mov    -0x1c(%rbp),%eax
  add    %eax,-0x4(%rbp)
L15:
  mov    -0x28(%rbp),%eax
  imul   0x18(%rbp),%eax
  cmp    %eax,-0x8(%rbp)
  jb     L8
  nop
  nop
  pop    %rbp
  ret
```

assistant: ```c
void scale1d_2t1_ps(const unsigned char *source, int source_step, unsigned int source_scale, unsigned int source_length, unsigned char *dest, int dest_step, unsigned int dest_scale, unsigned int dest_length) {
  unsigned int i, j;
  (void)source_length;
  (void)source_scale;
  (void)dest_scale;
  source_step *= 2;
  j = 0;
  for (i = 0; i < dest_length * dest_step; i += dest_step, j += source_step)
    dest[i] = source[j];
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<scale1d_2t1_ps>:
  endbr64
  mov    %rdi,%r10
  add    %esi,%esi
  mov    %r9d,%r11d
  imul   0x10(%rsp),%r11d
  test   %r11d,%r11d
  je     L4
  mov    $0x0,%edx
  mov    $0x0,%eax
L18:
  mov    %edx,%ecx
  movzbl (%r10,%rcx,1),%edi
  mov    %eax,%ecx
  mov    %dil,(%r8,%rcx,1)
  add    %r9d,%eax
  add    %esi,%edx
  cmp    %r11d,%eax
  jb     L18
L4:
  ret
```

assistant: ```c
void scale1d_2t1_ps(const unsigned char *source, int source_step, unsigned int source_scale, unsigned int source_length, unsigned char *dest, int dest_step, unsigned int dest_scale, unsigned int dest_length) {
  unsigned int i, j;
  (void)source_length;
  (void)source_scale;
  (void)dest_scale;
  source_step *= 2;
  j = 0;
  for (i = 0; i < dest_length * dest_step; i += dest_step, j += source_step)
    dest[i] = source[j];
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<scale1d_2t1_ps>:
  endbr64
  mov    0x10(%rsp),%r11d
  mov    %rdi,%r10
  add    %esi,%esi
  xor    %edx,%edx
  xor    %eax,%eax
  imul   %r9d,%r11d
  test   %r11d,%r11d
  je     L14
  nopl   0x0(%rax,%rax,1)
L16:
  mov    %edx,%ecx
  add    %esi,%edx
  movzbl (%r10,%rcx,1),%edi
  mov    %eax,%ecx
  add    %r9d,%eax
  mov    %dil,(%r8,%rcx,1)
  cmp    %r11d,%eax
  jb     L16
L14:
  ret
```

assistant: ```c
void scale1d_2t1_ps(const unsigned char *source, int source_step, unsigned int source_scale, unsigned int source_length, unsigned char *dest, int dest_step, unsigned int dest_scale, unsigned int dest_length) {
  unsigned int i, j;
  (void)source_length;
  (void)source_scale;
  (void)dest_scale;
  source_step *= 2;
  j = 0;
  for (i = 0; i < dest_length * dest_step; i += dest_step, j += source_step)
    dest[i] = source[j];
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<scale1d_2t1_ps>:
  endbr64
  mov    0x10(%rsp),%r11d
  mov    %rdi,%r10
  add    %esi,%esi
  imul   %r9d,%r11d
  test   %r11d,%r11d
  je     L21
  xor    %edx,%edx
  xor    %eax,%eax
  cmp    $0x1,%r9d
  jne    L30
  nopl   0x0(%rax)
L15:
  mov    %edx,%ecx
  add    %esi,%edx
  movzbl (%r10,%rcx,1),%edi
  mov    %eax,%ecx
  add    $0x1,%eax
  mov    %dil,(%r8,%rcx,1)
  cmp    %eax,%r11d
  ja     L15
L21:
  ret
L30:
  mov    %edx,%ecx
  add    %esi,%edx
  movzbl (%r10,%rcx,1),%edi
  mov    %eax,%ecx
  add    %r9d,%eax
  mov    %dil,(%r8,%rcx,1)
  cmp    %r11d,%eax
  jb     L30
  ret
```

assistant: ```c
void scale1d_2t1_ps(const unsigned char *source, int source_step, unsigned int source_scale, unsigned int source_length, unsigned char *dest, int dest_step, unsigned int dest_scale, unsigned int dest_length) {
  unsigned int i, j;
  (void)source_length;
  (void)source_scale;
  (void)dest_scale;
  source_step *= 2;
  j = 0;
  for (i = 0; i < dest_length * dest_step; i += dest_step, j += source_step)
    dest[i] = source[j];
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<wait_on_bit_lock>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    %esi,-0xc(%rbp)
  mov    %rdx,-0x18(%rbp)
  mov    %ecx,-0x10(%rbp)
  mov    -0x8(%rbp),%rdx
  mov    -0xc(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <test_and_set_bit@plt>
  test   %eax,%eax
  jne    L4
  mov    $0x0,%eax
  jmp    L15
L4:
  mov    -0x10(%rbp),%ecx
  mov    -0x18(%rbp),%rdx
  mov    -0xc(%rbp),%esi
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <out_of_line_wait_on_bit_lock@plt>
L15:
  leave
  ret
```

assistant: ```c
__attribute__((always_)) int wait_on_bit_lock(void *word, int bit, int (*action)(void *), unsigned mode) {
  if (!test_and_set_bit(bit, word))
    return 0;
  return out_of_line_wait_on_bit_lock(word, bit, action, mode);
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<wait_on_bit_lock>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbx
  mov    %esi,%ebp
  mov    %rdx,%r12
  mov    %ecx,%r13d
  mov    %rdi,%rsi
  mov    %ebp,%edi
  call   <test_and_set_bit@plt>
  test   %eax,%eax
  jne    L18
L13:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L18:
  mov    %r13d,%ecx
  mov    %r12,%rdx
  mov    %ebp,%esi
  mov    %rbx,%rdi
  call   <out_of_line_wait_on_bit_lock@plt>
  jmp    L13
```

assistant: ```c
__attribute__((always_)) int wait_on_bit_lock(void *word, int bit, int (*action)(void *), unsigned mode) {
  if (!test_and_set_bit(bit, word))
    return 0;
  return out_of_line_wait_on_bit_lock(word, bit, action, mode);
}
```
user: What is the c source code of the assembly code below:

```asm
<wait_on_bit_lock>:
  endbr64
  push   %r14
  mov    %ecx,%r14d
  push   %r13
  mov    %rdx,%r13
  push   %r12
  mov    %esi,%r12d
  mov    %rdi,%rsi
  push   %rbp
  mov    %rdi,%rbp
  mov    %r12d,%edi
  sub    $0x8,%rsp
  call   <test_and_set_bit@plt>
  test   %eax,%eax
  jne    L6
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax,%rax,1)
L6:
  add    $0x8,%rsp
  mov    %r14d,%ecx
  mov    %r13,%rdx
  mov    %r12d,%esi
  mov    %rbp,%rdi
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  jmp    1070 <out_of_line_wait_on_bit_lock@plt>
```

assistant: ```c
__attribute__((always_)) int wait_on_bit_lock(void *word, int bit, int (*action)(void *), unsigned mode) {
  if (!test_and_set_bit(bit, word))
    return 0;
  return out_of_line_wait_on_bit_lock(word, bit, action, mode);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<wait_on_bit_lock>:
  endbr64
  push   %r14
  mov    %ecx,%r14d
  push   %r13
  mov    %rdx,%r13
  push   %r12
  mov    %esi,%r12d
  mov    %rdi,%rsi
  push   %rbp
  mov    %rdi,%rbp
  mov    %r12d,%edi
  sub    $0x8,%rsp
  call   <test_and_set_bit@plt>
  test   %eax,%eax
  jne    L9
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax,%rax,1)
L9:
  add    $0x8,%rsp
  mov    %r14d,%ecx
  mov    %r13,%rdx
  mov    %r12d,%esi
  mov    %rbp,%rdi
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  jmp    1070 <out_of_line_wait_on_bit_lock@plt>
```

assistant: ```c
__attribute__((always_)) int wait_on_bit_lock(void *word, int bit, int (*action)(void *), unsigned mode) {
  if (!test_and_set_bit(bit, word))
    return 0;
  return out_of_line_wait_on_bit_lock(word, bit, action, mode);
}
```