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

```asm
<urlp_parse>:
  endbr64
  sub    $0x8,%rsp
  call   <scan@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int urlp_parse(char *url, struct struct_parts *uobj) {
  scan(url, uobj);
  return 0;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<urlp_parse>:
  endbr64
  sub    $0x8,%rsp
  call   <scan@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int urlp_parse(char *url, struct struct_parts *uobj) {
  scan(url, uobj);
  return 0;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<pci_config_read_word>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %esi,%eax
  mov    %edx,-0x1c(%rbp)
  mov    %ecx,-0x20(%rbp)
  mov    %edi,%edx
  mov    %dl,-0x14(%rbp)
  mov    %al,-0x18(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movzbl -0x18(%rbp),%eax
  shl    $0x3,%eax
  movzbl %al,%esi
  movzbl -0x14(%rbp),%eax
  lea    -0x10(%rbp),%rcx
  mov    -0x20(%rbp),%edx
  mov    %rcx,%r8
  mov    $0x2,%ecx
  mov    %eax,%edi
  call   <pciconfig_read@plt>
  mov    -0x10(%rbp),%rax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L6
  call   <__stack_chk_fail@plt>
L6:
  leave
  ret
```

assistant: ```c
long pci_config_read_word(unsigned char bus, unsigned char dev, int func, unsigned cmd) {
  unsigned long retval;
  pciconfig_read(bus, dev << 3, cmd, 2, &retval);
  return retval;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<pci_config_read_word>:
  endbr64
  sub    $0x18,%rsp
  mov    %ecx,%edx
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  shl    $0x3,%esi
  movzbl %sil,%esi
  movzbl %dil,%edi
  mov    %rsp,%r8
  mov    $0x2,%ecx
  call   <pciconfig_read@plt>
  mov    (%rsp),%rax
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L3
  add    $0x18,%rsp
  ret
L3:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
long pci_config_read_word(unsigned char bus, unsigned char dev, int func, unsigned cmd) {
  unsigned long retval;
  pciconfig_read(bus, dev << 3, cmd, 2, &retval);
  return retval;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<pci_config_read_word>:
  endbr64
  sub    $0x18,%rsp
  shl    $0x3,%esi
  mov    %ecx,%edx
  movzbl %dil,%edi
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  movzbl %sil,%esi
  mov    %rsp,%r8
  mov    $0x2,%ecx
  call   <pciconfig_read@plt>
  mov    (%rsp),%rax
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L1
  add    $0x18,%rsp
  ret
L1:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
long pci_config_read_word(unsigned char bus, unsigned char dev, int func, unsigned cmd) {
  unsigned long retval;
  pciconfig_read(bus, dev << 3, cmd, 2, &retval);
  return retval;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<pci_config_read_word>:
  endbr64
  sub    $0x18,%rsp
  shl    $0x3,%esi
  mov    %ecx,%edx
  movzbl %dil,%edi
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  movzbl %sil,%esi
  mov    %rsp,%r8
  mov    $0x2,%ecx
  call   <pciconfig_read@plt>
  mov    (%rsp),%rax
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L0
  add    $0x18,%rsp
  ret
L0:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
long pci_config_read_word(unsigned char bus, unsigned char dev, int func, unsigned cmd) {
  unsigned long retval;
  pciconfig_read(bus, dev << 3, cmd, 2, &retval);
  return retval;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<swapcase>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %edi,%eax
  mov    %al,-0x4(%rbp)
  movsbl -0x4(%rbp),%eax
  mov    %eax,%edi
  call   <isupper@plt>
  test   %rax,%rax
  je     L15
  movsbl -0x4(%rbp),%eax
  mov    %eax,%edi
  call   <tolower@plt>
  jmp    L1
L15:
  movsbl -0x4(%rbp),%eax
  mov    %eax,%edi
  call   <islower@plt>
  test   %rax,%rax
  je     L31
  movsbl -0x4(%rbp),%eax
  mov    %eax,%edi
  call   <toupper@plt>
  jmp    L1
L31:
  movzbl -0x4(%rbp),%eax
L1:
  leave
  ret
```

assistant: ```c
char swapcase(char c) {
  if (isupper(c))
    return tolower(c);
  if (islower(c))
    return toupper(c);
  return c;
}
```
user: Translate the below assembly code into C programming language:

```asm
<swapcase>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %edi,%ebp
  movsbl %dil,%ebx
  mov    %ebx,%edi
  call   <isupper@plt>
  test   %rax,%rax
  jne    L10
  mov    %ebx,%edi
  call   <islower@plt>
  test   %rax,%rax
  jne    L35
L4:
  mov    %ebp,%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
L10:
  mov    %ebx,%edi
  call   <tolower@plt>
  mov    %eax,%ebp
  jmp    L4
L35:
  mov    %ebx,%edi
  call   <toupper@plt>
  mov    %eax,%ebp
  jmp    L4
```

assistant: ```c
char swapcase(char c) {
  if (isupper(c))
    return tolower(c);
  if (islower(c))
    return toupper(c);
  return c;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<swapcase>:
  endbr64
  push   %r12
  mov    %edi,%r12d
  push   %rbp
  movsbl %dil,%ebp
  mov    %ebp,%edi
  sub    $0x8,%rsp
  call   <isupper@plt>
  mov    %ebp,%edi
  test   %rax,%rax
  jne    L14
  call   <islower@plt>
  test   %rax,%rax
  jne    L10
  add    $0x8,%rsp
  mov    %r12d,%eax
  pop    %rbp
  pop    %r12
  ret
  nopl   (%rax)
L14:
  add    $0x8,%rsp
  pop    %rbp
  pop    %r12
  jmp    10a0 <tolower@plt>
  nopl   0x0(%rax)
L10:
  add    $0x8,%rsp
  mov    %ebp,%edi
  pop    %rbp
  pop    %r12
  jmp    1090 <toupper@plt>
```

assistant: ```c
char swapcase(char c) {
  if (isupper(c))
    return tolower(c);
  if (islower(c))
    return toupper(c);
  return c;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<swapcase>:
  endbr64
  push   %r12
  mov    %edi,%r12d
  push   %rbp
  movsbl %dil,%ebp
  mov    %ebp,%edi
  sub    $0x8,%rsp
  call   <isupper@plt>
  mov    %ebp,%edi
  test   %rax,%rax
  jne    L18
  call   <islower@plt>
  test   %rax,%rax
  jne    L10
  add    $0x8,%rsp
  mov    %r12d,%eax
  pop    %rbp
  pop    %r12
  ret
  nopl   (%rax)
L18:
  add    $0x8,%rsp
  pop    %rbp
  pop    %r12
  jmp    10a0 <tolower@plt>
  nopl   0x0(%rax)
L10:
  add    $0x8,%rsp
  mov    %ebp,%edi
  pop    %rbp
  pop    %r12
  jmp    1090 <toupper@plt>
```

assistant: ```c
char swapcase(char c) {
  if (isupper(c))
    return tolower(c);
  if (islower(c))
    return toupper(c);
  return c;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<get_hex>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L27
L98:
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <getc@plt>
  mov    %eax,-0x8(%rbp)
  mov    D5(%rip),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x8(%rbp)
  jne    L33
  mov    $0xffffffff,%eax
  jmp    L137
L33:
  cmpl   $0x2f,-0x8(%rbp)
  jle    L68
  cmpl   $0x39,-0x8(%rbp)
  jg     L68
  subl   $0x30,-0x8(%rbp)
  jmp    L118
L68:
  cmpl   $0x40,-0x8(%rbp)
  jle    L19
  cmpl   $0x46,-0x8(%rbp)
  jg     L19
  subl   $0x37,-0x8(%rbp)
  jmp    L118
L19:
  cmpl   $0x60,-0x8(%rbp)
  jle    L86
  cmpl   $0x66,-0x8(%rbp)
  jg     L86
  subl   $0x57,-0x8(%rbp)
  jmp    L118
L86:
  mov    $0xfffffffe,%eax
  jmp    L137
L118:
  mov    -0x4(%rbp),%eax
  shl    $0x4,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x4(%rbp)
  subl   $0x1,-0x1c(%rbp)
L27:
  cmpl   $0x0,-0x1c(%rbp)
  jg     L98
  mov    -0x4(%rbp),%eax
L137:
  leave
  ret
```

assistant: ```c
int get_hex(FILE *in, int len) {
  int ch;
  int n = 0;
  while (len > 0) {
    ch = getc(in);
    if (ch == EOF)
      return -1;
    if (ch >= '0' && ch <= '9')
      ch -= '0';
    else if (ch >= 'A' && ch <= 'F')
      ch = (ch - 'A') + 10;
    else if (ch >= 'a' && ch <= 'f')
      ch = (ch - 'a') + 10;
    else {
      return -2;
    }
    n = (n << 4) + ch;
    len--;
  }
  return n;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<get_hex>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  test   %esi,%esi
  jle    L47
  mov    %rdi,%r12
  mov    %esi,%ebp
  mov    $0x0,%ebx
  jmp    L12
L39:
  lea    -0x41(%rax),%edx
  cmp    $0x5,%edx
  ja     L36
  sub    $0x37,%eax
L21:
  shl    $0x4,%ebx
  add    %eax,%ebx
  sub    $0x1,%ebp
  je     L34
L12:
  mov    %r12,%rdi
  call   <getc@plt>
  mov    D8(%rip),%rdx
  cmp    %eax,(%rdx)
  je     L55
  lea    -0x30(%rax),%edx
  cmp    $0x9,%edx
  ja     L39
  mov    %edx,%eax
  jmp    L21
L36:
  lea    -0x61(%rax),%edx
  cmp    $0x5,%edx
  ja     L85
  sub    $0x57,%eax
  jmp    L21
L47:
  mov    $0x0,%ebx
  jmp    L34
L55:
  mov    $0xffffffff,%ebx
L34:
  mov    %ebx,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L85:
  mov    $0xfffffffe,%ebx
  jmp    L34
```

assistant: ```c
int get_hex(FILE *in, int len) {
  int ch;
  int n = 0;
  while (len > 0) {
    ch = getc(in);
    if (ch == EOF)
      return -1;
    if (ch >= '0' && ch <= '9')
      ch -= '0';
    else if (ch >= 'A' && ch <= 'F')
      ch = (ch - 'A') + 10;
    else if (ch >= 'a' && ch <= 'f')
      ch = (ch - 'a') + 10;
    else {
      return -2;
    }
    n = (n << 4) + ch;
    len--;
  }
  return n;
}
```
user: Translate the below assembly code into C programming language:

```asm
<get_hex>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  test   %esi,%esi
  jle    L86
  mov    D6(%rip),%r13
  mov    %rdi,%rbp
  mov    %esi,%ebx
  xor    %r12d,%r12d
  jmp    L10
  nopw   0x0(%rax,%rax,1)
L85:
  lea    -0x37(%rax),%edx
L0:
  shl    $0x4,%r12d
  add    %edx,%r12d
  sub    $0x1,%ebx
  je     L64
L10:
  mov    %rbp,%rdi
  call   <getc@plt>
  cmp    %eax,0x0(%r13)
  je     L1
  lea    -0x30(%rax),%edx
  cmp    $0x9,%edx
  jbe    L0
  lea    -0x41(%rax),%edx
  cmp    $0x5,%edx
  jbe    L85
  lea    -0x61(%rax),%edx
  cmp    $0x5,%edx
  ja     L35
  lea    -0x57(%rax),%edx
  shl    $0x4,%r12d
  add    %edx,%r12d
  sub    $0x1,%ebx
  jne    L10
L64:
  add    $0x8,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopw   0x0(%rax,%rax,1)
L1:
  add    $0x8,%rsp
  mov    $0xffffffff,%r12d
  pop    %rbx
  mov    %r12d,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L35:
  add    $0x8,%rsp
  mov    $0xfffffffe,%r12d
  pop    %rbx
  mov    %r12d,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L86:
  xor    %r12d,%r12d
  jmp    L64
```

assistant: ```c
int get_hex(FILE *in, int len) {
  int ch;
  int n = 0;
  while (len > 0) {
    ch = getc(in);
    if (ch == EOF)
      return -1;
    if (ch >= '0' && ch <= '9')
      ch -= '0';
    else if (ch >= 'A' && ch <= 'F')
      ch = (ch - 'A') + 10;
    else if (ch >= 'a' && ch <= 'f')
      ch = (ch - 'a') + 10;
    else {
      return -2;
    }
    n = (n << 4) + ch;
    len--;
  }
  return n;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<get_hex>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  test   %esi,%esi
  jle    L23
  mov    D5(%rip),%r13
  mov    %rdi,%rbp
  mov    %esi,%ebx
  xor    %r12d,%r12d
  jmp    L67
  nopw   0x0(%rax,%rax,1)
L85:
  lea    -0x37(%rax),%edx
L62:
  shl    $0x4,%r12d
  add    %edx,%r12d
  sub    $0x1,%ebx
  je     L0
L67:
  mov    %rbp,%rdi
  call   <getc@plt>
  cmp    %eax,0x0(%r13)
  je     L59
  lea    -0x30(%rax),%edx
  cmp    $0x9,%edx
  jbe    L62
  lea    -0x41(%rax),%edx
  cmp    $0x5,%edx
  jbe    L85
  lea    -0x61(%rax),%edx
  cmp    $0x5,%edx
  ja     L16
  lea    -0x57(%rax),%edx
  shl    $0x4,%r12d
  add    %edx,%r12d
  sub    $0x1,%ebx
  jne    L67
L0:
  add    $0x8,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopw   0x0(%rax,%rax,1)
L59:
  add    $0x8,%rsp
  mov    $0xffffffff,%r12d
  pop    %rbx
  mov    %r12d,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L16:
  add    $0x8,%rsp
  mov    $0xfffffffe,%r12d
  pop    %rbx
  mov    %r12d,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L23:
  xor    %r12d,%r12d
  jmp    L0
```

assistant: ```c
int get_hex(FILE *in, int len) {
  int ch;
  int n = 0;
  while (len > 0) {
    ch = getc(in);
    if (ch == EOF)
      return -1;
    if (ch >= '0' && ch <= '9')
      ch -= '0';
    else if (ch >= 'A' && ch <= 'F')
      ch = (ch - 'A') + 10;
    else if (ch >= 'a' && ch <= 'f')
      ch = (ch - 'a') + 10;
    else {
      return -2;
    }
    n = (n << 4) + ch;
    len--;
  }
  return n;
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<mi_atoi>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  movl   $0x0,-0x8(%rbp)
L24:
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  mov    %eax,-0x4(%rbp)
  cmpl   $0x0,-0x4(%rbp)
  js     L29
  cmpl   $0x9,-0x4(%rbp)
  jg     L29
  mov    -0x8(%rbp),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x4(%rbp),%eax
  add    %eax,-0x8(%rbp)
  jmp    L24
L29:
  mov    -0x8(%rbp),%eax
  pop    %rbp
  ret
```

assistant: ```c
int mi_atoi(char *StringToInteger) {
  unsigned int v = 0;
  for (;;) {
    int c = *StringToInteger++ - '0';
    if (c < 0 || c > 9)
      break;
    v *= 10;
    v += c;
  }
  return (int)v;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<mi_atoi>:
  endbr64
  lea    0x1(%rdi),%rcx
  movsbl (%rdi),%eax
  sub    $0x30,%eax
  cmp    $0x9,%eax
  ja     L26
  mov    $0x0,%edx
L4:
  lea    (%rdx,%rdx,4),%edx
  lea    (%rax,%rdx,2),%edx
  add    $0x1,%rcx
  movsbl -0x1(%rcx),%eax
  sub    $0x30,%eax
  cmp    $0x9,%eax
  jbe    L4
L14:
  mov    %edx,%eax
  ret
L26:
  mov    $0x0,%edx
  jmp    L14
```

assistant: ```c
int mi_atoi(char *StringToInteger) {
  unsigned int v = 0;
  for (;;) {
    int c = *StringToInteger++ - '0';
    if (c < 0 || c > 9)
      break;
    v *= 10;
    v += c;
  }
  return (int)v;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<mi_atoi>:
  endbr64
  movsbl (%rdi),%edx
  lea    0x1(%rdi),%rcx
  xor    %eax,%eax
  sub    $0x30,%edx
  cmp    $0x9,%edx
  ja     L14
  nopl   (%rax)
L11:
  lea    (%rax,%rax,4),%eax
  add    $0x1,%rcx
  lea    (%rdx,%rax,2),%eax
  movsbl -0x1(%rcx),%edx
  sub    $0x30,%edx
  cmp    $0x9,%edx
  jbe    L11
  ret
  nop
L14:
  ret
```

assistant: ```c
int mi_atoi(char *StringToInteger) {
  unsigned int v = 0;
  for (;;) {
    int c = *StringToInteger++ - '0';
    if (c < 0 || c > 9)
      break;
    v *= 10;
    v += c;
  }
  return (int)v;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<mi_atoi>:
  endbr64
  movsbl (%rdi),%edx
  lea    0x1(%rdi),%rcx
  xor    %eax,%eax
  sub    $0x30,%edx
  cmp    $0x9,%edx
  ja     L16
  nopl   (%rax)
L4:
  lea    (%rax,%rax,4),%eax
  add    $0x1,%rcx
  lea    (%rdx,%rax,2),%eax
  movsbl -0x1(%rcx),%edx
  sub    $0x30,%edx
  cmp    $0x9,%edx
  jbe    L4
  ret
  nop
L16:
  ret
```

assistant: ```c
int mi_atoi(char *StringToInteger) {
  unsigned int v = 0;
  for (;;) {
    int c = *StringToInteger++ - '0';
    if (c < 0 || c > 9)
      break;
    v *= 10;
    v += c;
  }
  return (int)v;
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<stdlib_strided_ssumkbn2>:
  endbr64
  test   %rdi,%rdi
  jle    L36
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,%r14
  cmp    $0x1,%rdi
  je     L59
  test   %rdx,%rdx
  je     L59
  mov    $0x0,%eax
  js     L100
L39:
  lea    0x0(,%rdx,4),%r13
  lea    (%rsi,%rax,4),%r12
  pxor   %xmm6,%xmm6
  movss  %xmm6,0xc(%rsp)
  movss  %xmm6,0x1c(%rsp)
  movss  %xmm6,0x14(%rsp)
  mov    $0x0,%ebp
  jmp    L44
L59:
  movss  (%rsi),%xmm0
  jmp    L104
L100:
  mov    $0x1,%eax
  sub    %rdi,%rax
  imul   %rdx,%rax
  jmp    L39
L71:
  movd   %ebx,%xmm0
  subss  0x14(%rsp),%xmm0
  addss  0x10(%rsp),%xmm0
  movss  %xmm0,0x10(%rsp)
  jmp    L119
L82:
  movss  0x10(%rsp),%xmm0
  subss  0x18(%rsp),%xmm0
  addss  0xc(%rsp),%xmm0
L86:
  addss  0x1c(%rsp),%xmm0
  movss  %xmm0,0x1c(%rsp)
  add    $0x1,%rbp
  add    %r13,%r12
  cmp    %rbp,%r14
  je     L18
  movss  0x18(%rsp),%xmm4
  movss  %xmm4,0xc(%rsp)
L44:
  mov    (%r12),%ebx
  movss  0x14(%rsp),%xmm2
  movd   %ebx,%xmm6
  addss  %xmm2,%xmm6
  movss  %xmm6,0x14(%rsp)
  movss  %xmm2,0x10(%rsp)
  movaps %xmm2,%xmm0
  call   <fabsf@plt>
  mov    %rax,%r15
  movd   %ebx,%xmm0
  call   <fabsf@plt>
  cmp    %rax,%r15
  jl     L71
  movss  0x10(%rsp),%xmm0
  subss  0x14(%rsp),%xmm0
  movd   %ebx,%xmm7
  addss  %xmm0,%xmm7
  movss  %xmm7,0x10(%rsp)
L119:
  movss  0x10(%rsp),%xmm3
  movss  0xc(%rsp),%xmm5
  addss  %xmm5,%xmm3
  movss  %xmm3,0x18(%rsp)
  movaps %xmm5,%xmm0
  call   <fabsf@plt>
  mov    %rax,%rbx
  movss  0x10(%rsp),%xmm0
  call   <fabsf@plt>
  cmp    %rax,%rbx
  jl     L82
  movss  0xc(%rsp),%xmm5
  subss  0x18(%rsp),%xmm5
  movaps %xmm5,%xmm0
  addss  0x10(%rsp),%xmm0
  jmp    L86
L18:
  movss  0x14(%rsp),%xmm0
  addss  0x18(%rsp),%xmm0
  addss  0x1c(%rsp),%xmm0
L104:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L36:
  pxor   %xmm0,%xmm0
  ret
```

assistant: ```c
float stdlib_strided_ssumkbn2(const int64_t N, const float *X, const int64_t stride) {
  int64_t ix;
  int64_t i;
  float sum;
  float ccs;
  float cs;
  float cc;
  float v;
  float t;
  float c;
  if (N <= 0) {
    return 0.0f;
  }
  if (N == 1 || stride == 0) {
    return X[0];
  }
  if (stride < 0) {
    ix = (1 - N) * stride;
  } else {
    ix = 0;
  }
  sum = 0.0f;
  ccs = 0.0f;
  cs = 0.0f;
  for (i = 0; i < N; i++) {
    v = X[ix];
    t = sum + v;
    if (fabsf(sum) >= fabsf(v)) {
      c = (sum - t) + v;
    } else {
      c = (v - t) + sum;
    }
    sum = t;
    t = cs + c;
    if (fabsf(cs) >= fabsf(c)) {
      cc = (cs - t) + c;
    } else {
      cc = (c - t) + cs;
    }
    cs = t;
    ccs += cc;
    ix += stride;
  }
  return sum + cs + ccs;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<stdlib_strided_ssumkbn2>:
  endbr64
  test   %rdi,%rdi
  jle    L19
  push   %r14
  mov    %rdi,%r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x20,%rsp
  cmp    $0x1,%rdi
  je     L12
  test   %rdx,%rdx
  je     L12
  mov    $0x0,%eax
  jns    L47
  mov    $0x1,%eax
  sub    %rdi,%rax
  imul   %rdx,%rax
L47:
  pxor   %xmm2,%xmm2
  lea    0x0(,%rdx,4),%r13
  lea    (%rsi,%rax,4),%r12
  xor    %ebp,%ebp
  movss  %xmm2,0xc(%rsp)
  movaps %xmm2,%xmm3
  jmp    L29
  nopw   0x0(%rax,%rax,1)
L14:
  subss  %xmm3,%xmm4
  addss  %xmm4,%xmm1
L63:
  movaps %xmm1,%xmm4
  movaps %xmm2,%xmm0
  movss  %xmm3,0x1c(%rsp)
  addss  %xmm2,%xmm4
  movss  %xmm2,0x14(%rsp)
  movss  %xmm1,0x10(%rsp)
  movss  %xmm4,0x18(%rsp)
  call   <fabsf@plt>
  movss  0x10(%rsp),%xmm1
  mov    %rax,%rbx
  movaps %xmm1,%xmm0
  call   <fabsf@plt>
  movss  0x10(%rsp),%xmm1
  movss  0x14(%rsp),%xmm2
  cmp    %rax,%rbx
  movss  0x18(%rsp),%xmm4
  movss  0x1c(%rsp),%xmm3
  jl     L80
  subss  %xmm4,%xmm2
  addss  %xmm2,%xmm1
L42:
  addss  0xc(%rsp),%xmm1
  add    $0x1,%rbp
  add    %r13,%r12
  movss  %xmm1,0xc(%rsp)
  cmp    %rbp,%r14
  je     L15
  movaps %xmm4,%xmm2
L29:
  movss  (%r12),%xmm1
  movaps %xmm3,%xmm4
  movss  %xmm2,0x1c(%rsp)
  movaps %xmm4,%xmm0
  movss  %xmm4,0x14(%rsp)
  addss  %xmm1,%xmm3
  movss  %xmm1,0x10(%rsp)
  movss  %xmm3,0x18(%rsp)
  call   <fabsf@plt>
  movss  0x10(%rsp),%xmm1
  mov    %rax,%rbx
  movaps %xmm1,%xmm0
  call   <fabsf@plt>
  movss  0x10(%rsp),%xmm1
  movss  0x14(%rsp),%xmm4
  cmp    %rax,%rbx
  movss  0x18(%rsp),%xmm3
  movss  0x1c(%rsp),%xmm2
  jge    L14
  subss  %xmm3,%xmm1
  addss  %xmm4,%xmm1
  jmp    L63
  nopl   0x0(%rax)
L12:
  movss  (%rsi),%xmm0
  add    $0x20,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
L80:
  subss  %xmm4,%xmm1
  addss  %xmm2,%xmm1
  jmp    L42
  nopl   (%rax)
L15:
  movaps %xmm3,%xmm0
  add    $0x20,%rsp
  addss  %xmm4,%xmm0
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  addss  %xmm1,%xmm0
  ret
L19:
  pxor   %xmm0,%xmm0
  ret
```

assistant: ```c
float stdlib_strided_ssumkbn2(const int64_t N, const float *X, const int64_t stride) {
  int64_t ix;
  int64_t i;
  float sum;
  float ccs;
  float cs;
  float cc;
  float v;
  float t;
  float c;
  if (N <= 0) {
    return 0.0f;
  }
  if (N == 1 || stride == 0) {
    return X[0];
  }
  if (stride < 0) {
    ix = (1 - N) * stride;
  } else {
    ix = 0;
  }
  sum = 0.0f;
  ccs = 0.0f;
  cs = 0.0f;
  for (i = 0; i < N; i++) {
    v = X[ix];
    t = sum + v;
    if (fabsf(sum) >= fabsf(v)) {
      c = (sum - t) + v;
    } else {
      c = (v - t) + sum;
    }
    sum = t;
    t = cs + c;
    if (fabsf(cs) >= fabsf(c)) {
      cc = (cs - t) + c;
    } else {
      cc = (c - t) + cs;
    }
    cs = t;
    ccs += cc;
    ix += stride;
  }
  return sum + cs + ccs;
}
```
user: What is the c source code of the assembly code below?

```asm
<stdlib_strided_ssumkbn2>:
  endbr64
  test   %rdi,%rdi
  jle    L28
  push   %r14
  mov    %rdi,%r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x20,%rsp
  cmp    $0x1,%rdi
  je     L74
  test   %rdx,%rdx
  je     L74
  mov    $0x0,%eax
  jns    L91
  mov    $0x1,%eax
  sub    %rdi,%rax
  imul   %rdx,%rax
L91:
  pxor   %xmm2,%xmm2
  lea    0x0(,%rdx,4),%r13
  lea    (%rsi,%rax,4),%r12
  xor    %ebp,%ebp
  movss  %xmm2,0x10(%rsp)
  movaps %xmm2,%xmm3
  jmp    L56
  nopw   0x0(%rax,%rax,1)
L93:
  subss  0xc(%rsp),%xmm3
  addss  %xmm3,%xmm1
L18:
  movaps %xmm1,%xmm3
  movaps %xmm2,%xmm0
  movss  %xmm2,0x18(%rsp)
  addss  %xmm2,%xmm3
  movss  %xmm1,0x14(%rsp)
  movss  %xmm3,0x1c(%rsp)
  call   <fabsf@plt>
  movss  0x14(%rsp),%xmm1
  mov    %rax,%rbx
  movaps %xmm1,%xmm0
  call   <fabsf@plt>
  movss  0x14(%rsp),%xmm1
  movss  0x18(%rsp),%xmm2
  cmp    %rax,%rbx
  movss  0x1c(%rsp),%xmm3
  jl     L71
  subss  %xmm3,%xmm2
  add    $0x1,%rbp
  add    %r13,%r12
  addss  %xmm1,%xmm2
  addss  0x10(%rsp),%xmm2
  movss  %xmm2,0x10(%rsp)
  cmp    %rbp,%r14
  je     L46
L26:
  movaps %xmm3,%xmm2
  movss  0xc(%rsp),%xmm3
L56:
  movss  (%r12),%xmm1
  movaps %xmm3,%xmm0
  movss  %xmm2,0x1c(%rsp)
  movss  %xmm3,0x18(%rsp)
  movaps %xmm1,%xmm4
  movss  %xmm1,0x14(%rsp)
  addss  %xmm3,%xmm4
  movss  %xmm4,0xc(%rsp)
  call   <fabsf@plt>
  movss  0x14(%rsp),%xmm1
  mov    %rax,%rbx
  movaps %xmm1,%xmm0
  call   <fabsf@plt>
  movss  0x14(%rsp),%xmm1
  movss  0x18(%rsp),%xmm3
  cmp    %rax,%rbx
  movss  0x1c(%rsp),%xmm2
  jge    L93
  subss  0xc(%rsp),%xmm1
  addss  %xmm3,%xmm1
  jmp    L18
  nopl   0x0(%rax)
L74:
  movss  (%rsi),%xmm0
  add    $0x20,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
L71:
  subss  %xmm3,%xmm1
  add    $0x1,%rbp
  add    %r13,%r12
  addss  %xmm2,%xmm1
  addss  0x10(%rsp),%xmm1
  movss  %xmm1,0x10(%rsp)
  cmp    %rbp,%r14
  jne    L26
L46:
  movss  0xc(%rsp),%xmm0
  addss  %xmm3,%xmm0
  addss  0x10(%rsp),%xmm0
  add    $0x20,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
L28:
  pxor   %xmm0,%xmm0
  ret
```

assistant: ```c
float stdlib_strided_ssumkbn2(const int64_t N, const float *X, const int64_t stride) {
  int64_t ix;
  int64_t i;
  float sum;
  float ccs;
  float cs;
  float cc;
  float v;
  float t;
  float c;
  if (N <= 0) {
    return 0.0f;
  }
  if (N == 1 || stride == 0) {
    return X[0];
  }
  if (stride < 0) {
    ix = (1 - N) * stride;
  } else {
    ix = 0;
  }
  sum = 0.0f;
  ccs = 0.0f;
  cs = 0.0f;
  for (i = 0; i < N; i++) {
    v = X[ix];
    t = sum + v;
    if (fabsf(sum) >= fabsf(v)) {
      c = (sum - t) + v;
    } else {
      c = (v - t) + sum;
    }
    sum = t;
    t = cs + c;
    if (fabsf(cs) >= fabsf(c)) {
      cc = (cs - t) + c;
    } else {
      cc = (c - t) + cs;
    }
    cs = t;
    ccs += cc;
    ix += stride;
  }
  return sum + cs + ccs;
}
```