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

```asm
<djb2_hash>:
  endbr64
  lea    0x1(%rdi),%rcx
  movzbl (%rdi),%edx
  test   %dl,%dl
  je     L17
  mov    $0x1505,%eax
L6:
  mov    %rax,%rsi
  shl    $0x5,%rsi
  add    %rsi,%rax
  movsbq %dl,%rdx
  add    %rdx,%rax
  add    $0x1,%rcx
  movzbl -0x1(%rcx),%edx
  test   %dl,%dl
  jne    L6
  ret
L17:
  mov    $0x1505,%eax
  ret
```

assistant: ```c
unsigned long djb2_hash(unsigned char *str) {
  unsigned long hash = ((unsigned long)5381);
  char c;
  while ((c = *str++))
    hash = ((hash << 5) + hash) + c;
  return hash;
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<djb2_hash>:
  endbr64
  movsbq (%rdi),%rdx
  lea    0x1(%rdi),%rcx
  mov    $0x1505,%eax
  test   %dl,%dl
  je     L19
  nopl   (%rax)
L1:
  mov    %rax,%rsi
  add    $0x1,%rcx
  shl    $0x5,%rsi
  add    %rsi,%rax
  add    %rdx,%rax
  movsbq -0x1(%rcx),%rdx
  test   %dl,%dl
  jne    L1
  ret
  nopl   0x0(%rax,%rax,1)
L19:
  ret
```

assistant: ```c
unsigned long djb2_hash(unsigned char *str) {
  unsigned long hash = ((unsigned long)5381);
  char c;
  while ((c = *str++))
    hash = ((hash << 5) + hash) + c;
  return hash;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<djb2_hash>:
  endbr64
  movsbq (%rdi),%rdx
  lea    0x1(%rdi),%rcx
  mov    $0x1505,%eax
  test   %dl,%dl
  je     L17
  nopl   (%rax)
L11:
  mov    %rax,%rsi
  add    $0x1,%rcx
  shl    $0x5,%rsi
  add    %rsi,%rax
  add    %rdx,%rax
  movsbq -0x1(%rcx),%rdx
  test   %dl,%dl
  jne    L11
  ret
  nopl   0x0(%rax,%rax,1)
L17:
  ret
```

assistant: ```c
unsigned long djb2_hash(unsigned char *str) {
  unsigned long hash = ((unsigned long)5381);
  char c;
  while ((c = *str++))
    hash = ((hash << 5) + hash) + c;
  return hash;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<hertz>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movq   $0x0,-0x28(%rbp)
  movl   $0x1,-0x30(%rbp)
  movq   $0x0,-0x18(%rbp)
  movq   $0x0,-0x20(%rbp)
  mov    D19(%rip),%rax
  mov    (%rax),%eax
  lea    -0x30(%rbp),%rcx
  mov    $0x0,%edx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <setitimer@plt>
  mov    D19(%rip),%rax
  mov    (%rax),%eax
  lea    -0x30(%rbp),%rdx
  mov    $0x0,%esi
  mov    %eax,%edi
  call   <setitimer@plt>
  mov    -0x30(%rbp),%eax
  cmp    $0x1,%eax
  jg     L14
  mov    $0x0,%eax
  jmp    L15
L14:
  mov    -0x30(%rbp),%ecx
  mov    $0xf4240,%eax
  cltd
  idiv   %ecx
L15:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L20
  call   <__stack_chk_fail@plt>
L20:
  leave
  ret
```

assistant: ```c
uint32_t hertz(void) {
  struct itimerval tim;
  tim.it_interval.tv_sec = 0;
  tim.it_interval.tv_usec = 1;
  tim.it_value.tv_sec = 0;
  tim.it_value.tv_usec = 0;
  setitimer(ITIMER_REAL, &tim, 0);
  setitimer(ITIMER_REAL, 0, &tim);
  if (tim.it_interval.tv_usec < 2)
    return (0);
  return (1000000 / tim.it_interval.tv_usec);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<hertz>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  movq   $0x0,0x8(%rsp)
  movl   $0x1,(%rsp)
  movq   $0x0,0x18(%rsp)
  movq   $0x0,0x10(%rsp)
  mov    %rsp,%rbp
  mov    D8(%rip),%rbx
  mov    $0x0,%edx
  mov    %rbp,%rsi
  mov    (%rbx),%edi
  call   <setitimer@plt>
  mov    %rbp,%rdx
  mov    $0x0,%esi
  mov    (%rbx),%edi
  call   <setitimer@plt>
  mov    (%rsp),%ecx
  mov    $0x0,%eax
  cmp    $0x1,%ecx
  jle    L7
  mov    $0xf4240,%eax
  cltd
  idiv   %ecx
L7:
  mov    0x28(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L8
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  ret
L8:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
uint32_t hertz(void) {
  struct itimerval tim;
  tim.it_interval.tv_sec = 0;
  tim.it_interval.tv_usec = 1;
  tim.it_value.tv_sec = 0;
  tim.it_value.tv_usec = 0;
  setitimer(ITIMER_REAL, &tim, 0);
  setitimer(ITIMER_REAL, 0, &tim);
  if (tim.it_interval.tv_usec < 2)
    return (0);
  return (1000000 / tim.it_interval.tv_usec);
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<hertz>:
  endbr64
  push   %r12
  xor    %edx,%edx
  push   %rbx
  sub    $0x38,%rsp
  mov    D2(%rip),%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  mov    %rsp,%r12
  movl   $0x1,(%rsp)
  movq   $0x0,0x8(%rsp)
  mov    (%rbx),%edi
  mov    %r12,%rsi
  movq   $0x0,0x18(%rsp)
  movq   $0x0,0x10(%rsp)
  call   <setitimer@plt>
  mov    (%rbx),%edi
  mov    %r12,%rdx
  xor    %esi,%esi
  call   <setitimer@plt>
  mov    (%rsp),%ecx
  xor    %eax,%eax
  cmp    $0x1,%ecx
  jle    L14
  mov    $0xf4240,%eax
  cltd
  idiv   %ecx
L14:
  mov    0x28(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L4
  add    $0x38,%rsp
  pop    %rbx
  pop    %r12
  ret
L4:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
uint32_t hertz(void) {
  struct itimerval tim;
  tim.it_interval.tv_sec = 0;
  tim.it_interval.tv_usec = 1;
  tim.it_value.tv_sec = 0;
  tim.it_value.tv_usec = 0;
  setitimer(ITIMER_REAL, &tim, 0);
  setitimer(ITIMER_REAL, 0, &tim);
  if (tim.it_interval.tv_usec < 2)
    return (0);
  return (1000000 / tim.it_interval.tv_usec);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<hertz>:
  endbr64
  push   %r12
  pxor   %xmm0,%xmm0
  xor    %edx,%edx
  push   %rbx
  sub    $0x38,%rsp
  mov    D4(%rip),%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  mov    %rsp,%r12
  movups %xmm0,0x8(%rsp)
  mov    (%rbx),%edi
  mov    %r12,%rsi
  movl   $0x1,(%rsp)
  movq   $0x0,0x18(%rsp)
  call   <setitimer@plt>
  mov    (%rbx),%edi
  mov    %r12,%rdx
  xor    %esi,%esi
  call   <setitimer@plt>
  mov    (%rsp),%ecx
  xor    %eax,%eax
  cmp    $0x1,%ecx
  jle    L18
  mov    $0xf4240,%eax
  cltd
  idiv   %ecx
L18:
  mov    0x28(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L12
  add    $0x38,%rsp
  pop    %rbx
  pop    %r12
  ret
L12:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
uint32_t hertz(void) {
  struct itimerval tim;
  tim.it_interval.tv_sec = 0;
  tim.it_interval.tv_usec = 1;
  tim.it_value.tv_sec = 0;
  tim.it_value.tv_usec = 0;
  setitimer(ITIMER_REAL, &tim, 0);
  setitimer(ITIMER_REAL, 0, &tim);
  if (tim.it_interval.tv_usec < 2)
    return (0);
  return (1000000 / tim.it_interval.tv_usec);
}
```
user: Translate the below assembly code into C programming language:

```asm
<lseek>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x4(%rbp)
  mov    %esi,-0x8(%rbp)
  mov    %edx,-0xc(%rbp)
  mov    D29(%rip),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x4(%rbp)
  je     L38
  mov    D3(%rip),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x4(%rbp)
  je     L38
  mov    D11(%rip),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x4(%rbp)
  jne    L7
L38:
  mov    $0xffffffff,%eax
  jmp    L16
L7:
  mov    $0xffffffff,%eax
L16:
  pop    %rbp
  ret
```

assistant: ```c
off_t lseek(int fd, off_t offset, int _whence) {
  if ((STDIN_FILENO == fd) || (STDOUT_FILENO == fd) || (STDERR_FILENO == fd)) {
    return ((off_t)-1);
  }
  return ((off_t)-1);
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<lseek>:
  endbr64
  mov    $0xffffffff,%eax
  ret
```

assistant: ```c
off_t lseek(int fd, off_t offset, int _whence) {
  if ((STDIN_FILENO == fd) || (STDOUT_FILENO == fd) || (STDERR_FILENO == fd)) {
    return ((off_t)-1);
  }
  return ((off_t)-1);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<lseek>:
  endbr64
  mov    $0xffffffff,%eax
  ret
```

assistant: ```c
off_t lseek(int fd, off_t offset, int _whence) {
  if ((STDIN_FILENO == fd) || (STDOUT_FILENO == fd) || (STDERR_FILENO == fd)) {
    return ((off_t)-1);
  }
  return ((off_t)-1);
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<lseek>:
  endbr64
  mov    $0xffffffff,%eax
  ret
```

assistant: ```c
off_t lseek(int fd, off_t offset, int _whence) {
  if ((STDIN_FILENO == fd) || (STDOUT_FILENO == fd) || (STDERR_FILENO == fd)) {
    return ((off_t)-1);
  }
  return ((off_t)-1);
}
```
user: Translate the below assembly code into C programming language:

```asm
<nowhite_strcmp>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  jmp    L35
L28:
  addq   $0x1,-0x18(%rbp)
L35:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <iswhite@plt>
  test   %rax,%rax
  jne    L28
  jmp    L16
L65:
  addq   $0x1,-0x20(%rbp)
L16:
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <iswhite@plt>
  test   %rax,%rax
  jne    L65
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L20
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L9
L20:
  mov    -0x20(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  jmp    L60
L9:
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x8(%rbp)
  jmp    L85
L55:
  mov    -0x8(%rbp),%rax
  lea    -0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  movb   $0x0,(%rax)
L85:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <iswhite@plt>
  test   %rax,%rax
  jne    L55
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x8(%rbp)
  jmp    L31
L23:
  mov    -0x8(%rbp),%rax
  lea    -0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  movb   $0x0,(%rax)
L31:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <iswhite@plt>
  test   %rax,%rax
  jne    L23
  mov    -0x20(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
L60:
  leave
  ret
```

assistant: ```c
int nowhite_strcmp(char *s, char *t) {
  char *p;
  while (iswhite(*s))
    s++;
  while (iswhite(*t))
    t++;
  if ((*s == 0) || (*t == 0))
    return strcmp(s, t);
  p = s + strlen(s) - 1;
  while (iswhite(*p))
    *(p--) = 0;
  p = t + strlen(t) - 1;
  while (iswhite(*p))
    *(p--) = 0;
  return strcmp(s, t);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<nowhite_strcmp>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  mov    %rsi,%rbp
  jmp    L26
L42:
  add    $0x1,%rbx
L26:
  movsbl (%rbx),%edi
  call   <iswhite@plt>
  test   %rax,%rax
  jne    L42
  jmp    L84
L50:
  add    $0x1,%rbp
L84:
  movsbl 0x0(%rbp),%edi
  call   <iswhite@plt>
  test   %rax,%rax
  jne    L50
  cmpb   $0x0,(%rbx)
  je     L71
  cmpb   $0x0,0x0(%rbp)
  jne    L39
L71:
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
L12:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L39:
  mov    %rbx,%rdi
  call   <strlen@plt>
  cltq
  lea    -0x1(%rbx,%rax,1),%r12
  jmp    L104
L58:
  sub    $0x1,%r12
  movb   $0x0,0x1(%r12)
L104:
  movsbl (%r12),%edi
  call   <iswhite@plt>
  test   %rax,%rax
  jne    L58
  mov    %rbp,%rdi
  call   <strlen@plt>
  cltq
  lea    -0x1(%rbp,%rax,1),%r12
  jmp    L53
L105:
  sub    $0x1,%r12
  movb   $0x0,0x1(%r12)
L53:
  movsbl (%r12),%edi
  call   <iswhite@plt>
  test   %rax,%rax
  jne    L105
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  jmp    L12
```

assistant: ```c
int nowhite_strcmp(char *s, char *t) {
  char *p;
  while (iswhite(*s))
    s++;
  while (iswhite(*t))
    t++;
  if ((*s == 0) || (*t == 0))
    return strcmp(s, t);
  p = s + strlen(s) - 1;
  while (iswhite(*p))
    *(p--) = 0;
  p = t + strlen(t) - 1;
  while (iswhite(*p))
    *(p--) = 0;
  return strcmp(s, t);
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<nowhite_strcmp>:
  endbr64
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  jmp    L43
L50:
  add    $0x1,%rbp
L43:
  movsbl 0x0(%rbp),%edi
  call   <iswhite@plt>
  test   %rax,%rax
  jne    L50
  movsbl (%r12),%edi
  call   <iswhite@plt>
  test   %rax,%rax
  je     L12
  nopl   0x0(%rax)
L99:
  movsbl 0x1(%r12),%edi
  add    $0x1,%r12
  call   <iswhite@plt>
  test   %rax,%rax
  jne    L99
L12:
  cmpb   $0x0,0x0(%rbp)
  je     L23
  cmpb   $0x0,(%r12)
  jne    L84
L23:
  pop    %rbx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  pop    %rbp
  pop    %r12
  jmp    1080 <strcmp@plt>
  nopl   0x0(%rax,%rax,1)
L84:
  mov    %rbp,%rdi
  call   <strlen@plt>
  cltq
  lea    -0x1(%rbp,%rax,1),%rbx
  jmp    L34
  nopl   0x0(%rax)
L26:
  movb   $0x0,(%rbx)
  sub    $0x1,%rbx
L34:
  movsbl (%rbx),%edi
  call   <iswhite@plt>
  test   %rax,%rax
  jne    L26
  mov    %r12,%rdi
  call   <strlen@plt>
  cltq
  lea    -0x1(%r12,%rax,1),%rbx
  jmp    L54
  nopl   (%rax)
L81:
  movb   $0x0,(%rbx)
  sub    $0x1,%rbx
L54:
  movsbl (%rbx),%edi
  call   <iswhite@plt>
  test   %rax,%rax
  jne    L81
  pop    %rbx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  pop    %rbp
  pop    %r12
  jmp    1080 <strcmp@plt>
```

assistant: ```c
int nowhite_strcmp(char *s, char *t) {
  char *p;
  while (iswhite(*s))
    s++;
  while (iswhite(*t))
    t++;
  if ((*s == 0) || (*t == 0))
    return strcmp(s, t);
  p = s + strlen(s) - 1;
  while (iswhite(*p))
    *(p--) = 0;
  p = t + strlen(t) - 1;
  while (iswhite(*p))
    *(p--) = 0;
  return strcmp(s, t);
}
```
user: What is the c source code of the assembly code below?

```asm
<nowhite_strcmp>:
  endbr64
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  jmp    L20
L87:
  add    $0x1,%rbp
L20:
  movsbl 0x0(%rbp),%edi
  call   <iswhite@plt>
  test   %rax,%rax
  jne    L87
  movsbl (%r12),%edi
  call   <iswhite@plt>
  test   %rax,%rax
  je     L30
  nopl   0x0(%rax)
L51:
  movsbl 0x1(%r12),%edi
  add    $0x1,%r12
  call   <iswhite@plt>
  test   %rax,%rax
  jne    L51
L30:
  cmpb   $0x0,0x0(%rbp)
  je     L70
  cmpb   $0x0,(%r12)
  jne    L83
L70:
  pop    %rbx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  pop    %rbp
  pop    %r12
  jmp    1080 <strcmp@plt>
  nopl   0x0(%rax,%rax,1)
L83:
  mov    %rbp,%rdi
  call   <strlen@plt>
  cltq
  lea    -0x1(%rbp,%rax,1),%rbx
  jmp    L75
  nopl   0x0(%rax)
L64:
  movb   $0x0,(%rbx)
  sub    $0x1,%rbx
L75:
  movsbl (%rbx),%edi
  call   <iswhite@plt>
  test   %rax,%rax
  jne    L64
  mov    %r12,%rdi
  call   <strlen@plt>
  cltq
  lea    -0x1(%r12,%rax,1),%rbx
  jmp    L95
  nopl   (%rax)
L25:
  movb   $0x0,(%rbx)
  sub    $0x1,%rbx
L95:
  movsbl (%rbx),%edi
  call   <iswhite@plt>
  test   %rax,%rax
  jne    L25
  pop    %rbx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  pop    %rbp
  pop    %r12
  jmp    1080 <strcmp@plt>
```

assistant: ```c
int nowhite_strcmp(char *s, char *t) {
  char *p;
  while (iswhite(*s))
    s++;
  while (iswhite(*t))
    t++;
  if ((*s == 0) || (*t == 0))
    return strcmp(s, t);
  p = s + strlen(s) - 1;
  while (iswhite(*p))
    *(p--) = 0;
  p = t + strlen(t) - 1;
  while (iswhite(*p))
    *(p--) = 0;
  return strcmp(s, t);
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<strip_scale_rgb>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,%rbp
  mov    %esi,%r15d
  mov    %edx,0x1c(%rsp)
  mov    %rcx,%r14
  mov    %r8,%rbx
  mov    $0x0,%r13d
  mov    %esi,%r12d
  test   %edx,%edx
  jg     L39
L2:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L33:
  lea    0x0(,%r13,4),%rcx
  lea    0x4(%rcx),%rdi
  lea    0x8(%rcx),%rsi
  mov    $0x0,%eax
  pxor   %xmm5,%xmm5
  movsd  %xmm5,0x10(%rsp)
  movapd %xmm5,%xmm2
  movsd  %xmm5,0x8(%rsp)
L9:
  movss  (%rbx,%rax,4),%xmm0
  mov    0x0(%rbp,%rax,8),%rdx
  movaps %xmm0,%xmm1
  mulss  (%rdx,%rcx,1),%xmm1
  cvtss2sd %xmm1,%xmm1
  addsd  %xmm1,%xmm2
  movaps %xmm0,%xmm1
  mulss  (%rdx,%rdi,1),%xmm1
  cvtss2sd %xmm1,%xmm1
  addsd  0x8(%rsp),%xmm1
  movsd  %xmm1,0x8(%rsp)
  mulss  (%rdx,%rsi,1),%xmm0
  cvtss2sd %xmm0,%xmm0
  addsd  0x10(%rsp),%xmm0
  movsd  %xmm0,0x10(%rsp)
  add    $0x1,%rax
  cmp    %rax,%r12
  jne    L9
L35:
  movapd %xmm2,%xmm0
  call   <linear_sample_to_srgb@plt>
  mov    %al,(%r14,%r13,1)
  movsd  0x8(%rsp),%xmm0
  call   <linear_sample_to_srgb@plt>
  mov    %al,0x1(%r14,%r13,1)
  movsd  0x10(%rsp),%xmm0
  call   <linear_sample_to_srgb@plt>
  mov    %al,0x2(%r14,%r13,1)
  add    $0x3,%r13
  cmp    %r13d,0x1c(%rsp)
  jle    L2
L39:
  test   %r15d,%r15d
  jg     L33
  pxor   %xmm6,%xmm6
  movsd  %xmm6,0x10(%rsp)
  movapd %xmm6,%xmm2
  movsd  %xmm6,0x8(%rsp)
  jmp    L35
```

assistant: ```c
void strip_scale_rgb(float **in, int strip_height, int len, unsigned char *out, float *coeffs) {
  int i, j;
  double sum[3];
  for (i = 0; i < len; i += 3) {
    sum[0] = sum[1] = sum[2] = 0;
    for (j = 0; j < strip_height; j++) {
      sum[0] += coeffs[j] * in[j][i];
      sum[1] += coeffs[j] * in[j][i + 1];
      sum[2] += coeffs[j] * in[j][i + 2];
    }
    out[0] = linear_sample_to_srgb(sum[0]);
    out[1] = linear_sample_to_srgb(sum[1]);
    out[2] = linear_sample_to_srgb(sum[2]);
    out += 3;
  }
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<strip_scale_rgb>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %edx,0x1c(%rsp)
  test   %edx,%edx
  jle    L9
  movslq %esi,%r15
  mov    %rdi,%r13
  mov    %rcx,%rbx
  mov    %r8,%r14
  mov    %r15,%r12
  xor    %ebp,%ebp
  pxor   %xmm5,%xmm5
  nopl   0x0(%rax,%rax,1)
L25:
  movapd %xmm5,%xmm4
  movapd %xmm5,%xmm3
  movapd %xmm5,%xmm2
  test   %r12d,%r12d
  jle    L23
  movapd %xmm5,%xmm4
  movapd %xmm5,%xmm3
  movapd %xmm5,%xmm2
  xor    %eax,%eax
  lea    0x0(,%rbp,4),%rcx
  lea    0x4(%rcx),%r8
  lea    0x8(%rcx),%rsi
  nopw   0x0(%rax,%rax,1)
L11:
  mov    0x0(%r13,%rax,8),%rdx
  movss  (%r14,%rax,4),%xmm0
  add    $0x1,%rax
  movss  (%rdx,%rcx,1),%xmm1
  mulss  %xmm0,%xmm1
  cvtss2sd %xmm1,%xmm1
  addsd  %xmm1,%xmm3
  movss  (%rdx,%r8,1),%xmm1
  mulss  %xmm0,%xmm1
  mulss  (%rdx,%rsi,1),%xmm0
  cvtss2sd %xmm1,%xmm1
  addsd  %xmm1,%xmm2
  cvtss2sd %xmm0,%xmm0
  addsd  %xmm0,%xmm4
  cmp    %rax,%r15
  jne    L11
L23:
  movapd %xmm3,%xmm0
  movsd  %xmm4,0x10(%rsp)
  movsd  %xmm2,0x8(%rsp)
  call   <linear_sample_to_srgb@plt>
  movsd  0x8(%rsp),%xmm2
  mov    %al,(%rbx,%rbp,1)
  movapd %xmm2,%xmm0
  call   <linear_sample_to_srgb@plt>
  movsd  0x10(%rsp),%xmm4
  mov    %al,0x1(%rbx,%rbp,1)
  movapd %xmm4,%xmm0
  call   <linear_sample_to_srgb@plt>
  pxor   %xmm5,%xmm5
  mov    %al,0x2(%rbx,%rbp,1)
  add    $0x3,%rbp
  cmp    %ebp,0x1c(%rsp)
  jg     L25
L9:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void strip_scale_rgb(float **in, int strip_height, int len, unsigned char *out, float *coeffs) {
  int i, j;
  double sum[3];
  for (i = 0; i < len; i += 3) {
    sum[0] = sum[1] = sum[2] = 0;
    for (j = 0; j < strip_height; j++) {
      sum[0] += coeffs[j] * in[j][i];
      sum[1] += coeffs[j] * in[j][i + 1];
      sum[2] += coeffs[j] * in[j][i + 2];
    }
    out[0] = linear_sample_to_srgb(sum[0]);
    out[1] = linear_sample_to_srgb(sum[1]);
    out[2] = linear_sample_to_srgb(sum[2]);
    out += 3;
  }
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<strip_scale_rgb>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %edx,0x1c(%rsp)
  test   %edx,%edx
  jle    L0
  movslq %esi,%r15
  mov    %rdi,%r13
  mov    %rcx,%rbx
  mov    %r8,%r14
  mov    %r15,%r12
  xor    %ebp,%ebp
  pxor   %xmm5,%xmm5
  nopl   0x0(%rax,%rax,1)
L17:
  movapd %xmm5,%xmm4
  movapd %xmm5,%xmm3
  movapd %xmm5,%xmm2
  test   %r12d,%r12d
  jle    L32
  movapd %xmm5,%xmm4
  movapd %xmm5,%xmm3
  movapd %xmm5,%xmm2
  xor    %eax,%eax
  lea    0x0(,%rbp,4),%rcx
  lea    0x4(%rcx),%r8
  lea    0x8(%rcx),%rsi
  nopw   0x0(%rax,%rax,1)
L12:
  mov    0x0(%r13,%rax,8),%rdx
  movss  (%r14,%rax,4),%xmm0
  add    $0x1,%rax
  movss  (%rdx,%rcx,1),%xmm1
  mulss  %xmm0,%xmm1
  cvtss2sd %xmm1,%xmm1
  addsd  %xmm1,%xmm3
  movss  (%rdx,%r8,1),%xmm1
  mulss  %xmm0,%xmm1
  mulss  (%rdx,%rsi,1),%xmm0
  cvtss2sd %xmm1,%xmm1
  addsd  %xmm1,%xmm2
  cvtss2sd %xmm0,%xmm0
  addsd  %xmm0,%xmm4
  cmp    %rax,%r15
  jne    L12
L32:
  movapd %xmm3,%xmm0
  movsd  %xmm4,0x10(%rsp)
  movsd  %xmm2,0x8(%rsp)
  call   <linear_sample_to_srgb@plt>
  movsd  0x8(%rsp),%xmm2
  mov    %al,(%rbx,%rbp,1)
  movapd %xmm2,%xmm0
  call   <linear_sample_to_srgb@plt>
  movsd  0x10(%rsp),%xmm4
  mov    %al,0x1(%rbx,%rbp,1)
  movapd %xmm4,%xmm0
  call   <linear_sample_to_srgb@plt>
  pxor   %xmm5,%xmm5
  mov    %al,0x2(%rbx,%rbp,1)
  add    $0x3,%rbp
  cmp    %ebp,0x1c(%rsp)
  jg     L17
L0:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void strip_scale_rgb(float **in, int strip_height, int len, unsigned char *out, float *coeffs) {
  int i, j;
  double sum[3];
  for (i = 0; i < len; i += 3) {
    sum[0] = sum[1] = sum[2] = 0;
    for (j = 0; j < strip_height; j++) {
      sum[0] += coeffs[j] * in[j][i];
      sum[1] += coeffs[j] * in[j][i + 1];
      sum[2] += coeffs[j] * in[j][i + 2];
    }
    out[0] = linear_sample_to_srgb(sum[0]);
    out[1] = linear_sample_to_srgb(sum[1]);
    out[2] = linear_sample_to_srgb(sum[2]);
    out += 3;
  }
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<mu__match>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    -0x20(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strstr@plt>
  mov    %rax,-0x10(%rbp)
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x10(%rbp)
  je     L43
  mov    -0x10(%rbp),%rax
  cmp    -0x18(%rbp),%rax
  je     L11
  mov    -0x10(%rbp),%rax
  sub    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x3a,%al
  jne    L43
L11:
  mov    -0x10(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L30
  mov    -0x10(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x3a,%al
  jne    L43
L30:
  mov    $0x1,%eax
  jmp    L51
L43:
  mov    $0x0,%eax
L51:
  leave
  ret
```

assistant: ```c
bool mu__match(const char *list, const char *name) {
  const char *m = strstr(list, name);
  size_t n = strlen(name);
  return m && (m == list || m[-1] == ':') && (m[n] == '\0' || m[n] == ':');
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<mu__match>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbp
  mov    %rsi,%r12
  call   <strstr@plt>
  mov    %rax,%rbx
  mov    $0x0,%eax
  test   %rbx,%rbx
  je     L11
  cmp    %rbx,%rbp
  je     L14
  cmpb   $0x3a,-0x1(%rbx)
  jne    L11
L14:
  mov    %r12,%rdi
  call   <strlen@plt>
  movzbl (%rbx,%rax,1),%edx
  test   %dl,%dl
  sete   %al
  cmp    $0x3a,%dl
  sete   %dl
  or     %edx,%eax
  movzbl %al,%eax
L11:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
bool mu__match(const char *list, const char *name) {
  const char *m = strstr(list, name);
  size_t n = strlen(name);
  return m && (m == list || m[-1] == ':') && (m[n] == '\0' || m[n] == ':');
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<mu__match>:
  endbr64
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  call   <strstr@plt>
  mov    %rax,%rbx
  xor    %eax,%eax
  test   %rbx,%rbx
  je     L6
  cmp    %rbx,%rbp
  je     L2
  cmpb   $0x3a,-0x1(%rbx)
  je     L2
L6:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   (%rax)
L2:
  mov    %r12,%rdi
  call   <strlen@plt>
  movzbl (%rbx,%rax,1),%edx
  pop    %rbx
  pop    %rbp
  pop    %r12
  test   %dl,%dl
  sete   %al
  cmp    $0x3a,%dl
  sete   %dl
  or     %edx,%eax
  movzbl %al,%eax
  ret
```

assistant: ```c
bool mu__match(const char *list, const char *name) {
  const char *m = strstr(list, name);
  size_t n = strlen(name);
  return m && (m == list || m[-1] == ':') && (m[n] == '\0' || m[n] == ':');
}
```