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

```asm
<readMatrix>:
  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    %rax,%rsi
  lea    D8(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    -0x20(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x18(%rbp),%rax
  mov    (%rax),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <allocMem@plt>
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0x10(%rbp)
  jmp    L23
L5:
  movl   $0x0,-0xc(%rbp)
  jmp    L33
L6:
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0xc(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    %rax,%rsi
  lea    D13(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  addl   $0x1,-0xc(%rbp)
L33:
  mov    -0x20(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,-0xc(%rbp)
  jl     L6
  addl   $0x1,-0x10(%rbp)
L23:
  mov    -0x18(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x10(%rbp)
  jl     L5
  mov    -0x8(%rbp),%rax
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D8
data_type: string
name: unpack_data
arguments: data_tag: D13
data_type: string

tool: D8: %d %d

tool: D13: %lf

assistant: ```c
double **readMatrix(int *m, int *n) {
  scanf("%d %d", m, n);
  double **A = allocMem(*m, *n);
  for (int i = 0; i < *m; i++)
    for (int j = 0; j < *n; j++) {
      scanf("%lf", (A[i] + j));
    }
  return A;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<readMatrix>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%r15
  mov    %rsi,%r12
  mov    %rsi,%rdx
  mov    %rdi,%rsi
  lea    D4(%rip),%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    (%r12),%esi
  mov    (%r15),%edi
  call   <allocMem@plt>
  mov    %rax,0x8(%rsp)
  cmpl   $0x0,(%r15)
  jle    L9
  mov    %rax,%rbp
  mov    $0x0,%r14d
  lea    D19(%rip),%r13
  jmp    L41
L14:
  mov    0x0(%rbp),%rax
  lea    (%rax,%rbx,8),%rsi
  mov    %r13,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  add    $0x1,%rbx
  cmp    %ebx,(%r12)
  jg     L14
L57:
  add    $0x1,%r14d
  add    $0x8,%rbp
  cmp    %r14d,(%r15)
  jle    L9
L41:
  mov    $0x0,%ebx
  cmpl   $0x0,(%r12)
  jg     L14
  jmp    L57
L9:
  mov    0x8(%rsp),%rax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D4
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D19
type_infered: string

tool: D4: %d %d

tool: D19: %lf

assistant: ```c
double **readMatrix(int *m, int *n) {
  scanf("%d %d", m, n);
  double **A = allocMem(*m, *n);
  for (int i = 0; i < *m; i++)
    for (int j = 0; j < *n; j++) {
      scanf("%lf", (A[i] + j));
    }
  return A;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<readMatrix>:
  endbr64
  push   %r15
  mov    %rsi,%rdx
  xor    %eax,%eax
  push   %r14
  mov    %rdi,%r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rsi,%rbp
  mov    %rdi,%rsi
  lea    D9(%rip),%rdi
  push   %rbx
  sub    $0x18,%rsp
  call   <scanf@plt>
  mov    0x0(%rbp),%esi
  mov    (%r14),%edi
  call   <allocMem@plt>
  mov    (%r14),%edx
  mov    %rax,0x8(%rsp)
  test   %edx,%edx
  jle    L39
  mov    %rax,%r15
  xor    %r13d,%r13d
  lea    D7(%rip),%r12
L13:
  mov    0x0(%rbp),%eax
  xor    %ebx,%ebx
  test   %eax,%eax
  jle    L34
  nopl   0x0(%rax)
L29:
  mov    (%r15),%rax
  mov    %r12,%rdi
  lea    (%rax,%rbx,8),%rsi
  xor    %eax,%eax
  add    $0x1,%rbx
  call   <scanf@plt>
  cmp    %ebx,0x0(%rbp)
  jg     L29
L34:
  add    $0x1,%r13d
  add    $0x8,%r15
  cmp    %r13d,(%r14)
  jg     L13
L39:
  mov    0x8(%rsp),%rax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: retrieve_data
arguments: label: D9
data_type: string
name: retrieve_data
arguments: label: D7
data_type: string

tool: D9: %d %d

tool: D7: %lf

assistant: ```c
double **readMatrix(int *m, int *n) {
  scanf("%d %d", m, n);
  double **A = allocMem(*m, *n);
  for (int i = 0; i < *m; i++)
    for (int j = 0; j < *n; j++) {
      scanf("%lf", (A[i] + j));
    }
  return A;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<readMatrix>:
  endbr64
  push   %r15
  mov    %rsi,%rdx
  xor    %eax,%eax
  push   %r14
  mov    %rdi,%r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rsi,%rbp
  mov    %rdi,%rsi
  lea    D0(%rip),%rdi
  push   %rbx
  sub    $0x18,%rsp
  call   <scanf@plt>
  mov    0x0(%rbp),%esi
  mov    (%r14),%edi
  call   <allocMem@plt>
  mov    (%r14),%edx
  mov    %rax,0x8(%rsp)
  test   %edx,%edx
  jle    L42
  mov    %rax,%r15
  mov    0x0(%rbp),%eax
  xor    %r13d,%r13d
  lea    D8(%rip),%r12
  test   %eax,%eax
  jle    L42
  nopw   0x0(%rax,%rax,1)
L10:
  xor    %ebx,%ebx
  nopw   0x0(%rax,%rax,1)
L5:
  mov    (%r15),%rax
  mov    %r12,%rdi
  lea    (%rax,%rbx,8),%rsi
  xor    %eax,%eax
  add    $0x1,%rbx
  call   <scanf@plt>
  mov    0x0(%rbp),%eax
  cmp    %ebx,%eax
  jg     L5
  add    $0x1,%r13d
  cmp    %r13d,(%r14)
  jle    L42
  add    $0x8,%r15
  test   %eax,%eax
  jg     L10
L42:
  mov    0x8(%rsp),%rax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: read_data
arguments: data_label: D0
type_guessed: string
name: read_data
arguments: data_label: D8
type_guessed: string

tool: D0: %d %d

tool: D8: %lf

assistant: ```c
double **readMatrix(int *m, int *n) {
  scanf("%d %d", m, n);
  double **A = allocMem(*m, *n);
  for (int i = 0; i < *m; i++)
    for (int j = 0; j < *n; j++) {
      scanf("%lf", (A[i] + j));
    }
  return A;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %edi,-0x24(%rbp)
  mov    %rsi,-0x30(%rbp)
  movsd  D22(%rip),%xmm0
  movsd  %xmm0,-0x18(%rbp)
  movsd  D31(%rip),%xmm0
  movsd  %xmm0,-0x10(%rbp)
  movsd  -0x18(%rbp),%xmm1
  movsd  D10(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  movsd  -0x10(%rbp),%xmm0
  divsd  %xmm1,%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <erf@plt>
  movsd  D46(%rip),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  movq   %rax,%xmm0
  lea    D12(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D22
type_infered: f64
name: retrieve_data
arguments: data_label: D31
type_infered: f64
name: retrieve_data
arguments: data_label: D10
type_infered: byte[8]
name: retrieve_data
arguments: data_label: D46
type_infered: f64
name: retrieve_data
arguments: data_label: D12
type_infered: string

tool: D22: 1

tool: D31: 1.125

tool: {"D10": [0xcd,0x3b,0x7f,0x66,0x9e,0xa0,0xf6,0x3f]}

tool: D46: 0.5

tool: D12: N(0,1) ~ P[0, 1.125] = %lf


assistant: ```c
int main(int argc, char const *argv[]) {
  double sigma = 1.0;
  double bound = 1.125;
  double probability = 0.5 * erf(bound / (sigma * sqrt(2.0)));
  printf("N(0,1) ~ P[0, 1.125] = %lf\n", probability);
  return 0;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  movsd  D16(%rip),%xmm0
  lea    D14(%rip),%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: disassemble_data
arguments: tag: D16
data_type: byte[8]
name: disassemble_data
arguments: tag: D14
data_type: string

tool: {"D16": [0xa4,0x27,0x83,0x2f,0x41,0xa9,0xd7,0x3f]}

tool: D14: N(0,1) ~ P[0, 1.125] = %lf


assistant: ```c
int main(int argc, char const *argv[]) {
  double sigma = 1.0;
  double bound = 1.125;
  double probability = 0.5 * erf(bound / (sigma * sqrt(2.0)));
  printf("N(0,1) ~ P[0, 1.125] = %lf\n", probability);
  return 0;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  movsd  D8(%rip),%xmm0
  lea    D6(%rip),%rdi
  call   <printf@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D8
data_type: byte[8]
name: unpack_data
arguments: data_label: D6
data_type: string

tool: {"D8": [0xa4,0x27,0x83,0x2f,0x41,0xa9,0xd7,0x3f]}

tool: D6: N(0,1) ~ P[0, 1.125] = %lf


assistant: ```c
int main(int argc, char const *argv[]) {
  double sigma = 1.0;
  double bound = 1.125;
  double probability = 0.5 * erf(bound / (sigma * sqrt(2.0)));
  printf("N(0,1) ~ P[0, 1.125] = %lf\n", probability);
  return 0;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  movsd  D15(%rip),%xmm0
  lea    D9(%rip),%rdi
  call   <printf@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: disassemble_data
arguments: label: D15
type_infered: byte[8]
name: disassemble_data
arguments: label: D9
type_infered: string

tool: {"D15": [0xa4,0x27,0x83,0x2f,0x41,0xa9,0xd7,0x3f]}

tool: D9: N(0,1) ~ P[0, 1.125] = %lf


assistant: ```c
int main(int argc, char const *argv[]) {
  double sigma = 1.0;
  double bound = 1.125;
  double probability = 0.5 * erf(bound / (sigma * sqrt(2.0)));
  printf("N(0,1) ~ P[0, 1.125] = %lf\n", probability);
  return 0;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<U_PMF_COMPRESSEDIMAGE_get>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    %rsi,-0x10(%rbp)
  mov    %rdx,-0x18(%rbp)
  mov    -0x8(%rbp),%rax
  test   %rax,%rax
  je     L6
  cmpq   $0x0,-0x10(%rbp)
  je     L6
  cmpq   $0x0,-0x18(%rbp)
  jne    L56
L6:
  mov    $0x0,%eax
  jmp    L22
L56:
  mov    -0x8(%rbp),%rax
  cmp    %rax,-0x18(%rbp)
  ja     L4
  mov    $0x0,%eax
  jmp    L22
L4:
  lea    -0x8(%rbp),%rcx
  mov    -0x10(%rbp),%rax
  mov    $0x0,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <U_PMF_PTRSAV_SHIFT@plt>
  mov    $0x1,%eax
L22:
  leave
  ret
```

assistant: ```c
int U_PMF_COMPRESSEDIMAGE_get(const char *contents, const char **Data, const char *blimit) {
  if (!contents || !Data || !blimit) {
    return (0);
  }
  if (contents >= blimit)
    return (0);
  U_PMF_PTRSAV_SHIFT(Data, &contents, 0);
  return (1);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<U_PMF_COMPRESSEDIMAGE_get>:
  endbr64
  sub    $0x18,%rsp
  mov    %rdi,0x8(%rsp)
  test   %rdx,%rdx
  sete   %al
  cmp    %rdx,%rdi
  setae  %dl
  or     %edx,%eax
  test   %rdi,%rdi
  sete   %dl
  or     %dl,%al
  jne    L15
  mov    %rsi,%rdi
  test   %rsi,%rsi
  jne    L7
L15:
  mov    $0x0,%eax
L22:
  add    $0x18,%rsp
  ret
L7:
  lea    0x8(%rsp),%rsi
  mov    $0x0,%edx
  call   <U_PMF_PTRSAV_SHIFT@plt>
  mov    $0x1,%eax
  jmp    L22
```

assistant: ```c
int U_PMF_COMPRESSEDIMAGE_get(const char *contents, const char **Data, const char *blimit) {
  if (!contents || !Data || !blimit) {
    return (0);
  }
  if (contents >= blimit)
    return (0);
  U_PMF_PTRSAV_SHIFT(Data, &contents, 0);
  return (1);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<U_PMF_COMPRESSEDIMAGE_get>:
  endbr64
  sub    $0x18,%rsp
  cmp    %rdx,%rdi
  setae  %al
  test   %rdx,%rdx
  mov    %rdi,0x8(%rsp)
  sete   %dl
  or     %edx,%eax
  test   %rdi,%rdi
  sete   %dl
  or     %dl,%al
  jne    L14
  mov    %rsi,%rdi
  test   %rsi,%rsi
  jne    L8
L14:
  xor    %eax,%eax
  add    $0x18,%rsp
  ret
  nopl   0x0(%rax)
L8:
  lea    0x8(%rsp),%rsi
  xor    %edx,%edx
  call   <U_PMF_PTRSAV_SHIFT@plt>
  mov    $0x1,%eax
  add    $0x18,%rsp
  ret
```

assistant: ```c
int U_PMF_COMPRESSEDIMAGE_get(const char *contents, const char **Data, const char *blimit) {
  if (!contents || !Data || !blimit) {
    return (0);
  }
  if (contents >= blimit)
    return (0);
  U_PMF_PTRSAV_SHIFT(Data, &contents, 0);
  return (1);
}
```
user: What is the c source code of the assembly code below?

```asm
<U_PMF_COMPRESSEDIMAGE_get>:
  endbr64
  sub    $0x18,%rsp
  cmp    %rdx,%rdi
  setae  %al
  test   %rdx,%rdx
  mov    %rdi,0x8(%rsp)
  sete   %dl
  or     %edx,%eax
  test   %rdi,%rdi
  sete   %dl
  or     %dl,%al
  jne    L11
  mov    %rsi,%rdi
  test   %rsi,%rsi
  jne    L19
L11:
  xor    %eax,%eax
  add    $0x18,%rsp
  ret
  nopl   0x0(%rax)
L19:
  lea    0x8(%rsp),%rsi
  xor    %edx,%edx
  call   <U_PMF_PTRSAV_SHIFT@plt>
  mov    $0x1,%eax
  add    $0x18,%rsp
  ret
```

assistant: ```c
int U_PMF_COMPRESSEDIMAGE_get(const char *contents, const char **Data, const char *blimit) {
  if (!contents || !Data || !blimit) {
    return (0);
  }
  if (contents >= blimit)
    return (0);
  U_PMF_PTRSAV_SHIFT(Data, &contents, 0);
  return (1);
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<url_to_file>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %edx,-0x24(%rbp)
  subl   $0x1,-0x24(%rbp)
  movl   $0x0,-0x4(%rbp)
  movl   $0x0,-0x8(%rbp)
  jmp    L12
L18:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isalnum@plt>
  test   %rax,%rax
  jne    L75
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2d,%al
  je     L75
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x5f,%al
  je     L75
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  je     L75
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x25,%al
  jne    L5
L75:
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rax,%rdx
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  movl   $0x0,-0x4(%rbp)
  jmp    L25
L5:
  cmpl   $0x0,-0x4(%rbp)
  jne    L40
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movb   $0x5f,(%rax)
L40:
  movl   $0x1,-0x4(%rbp)
L25:
  addq   $0x1,-0x18(%rbp)
L12:
  mov    -0x8(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jge    L8
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L18
L8:
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  nop
  leave
  ret
```

assistant: ```c
void url_to_file(const char *url, char *file, int filesize) {
  int i, skip;
  filesize--;
  skip = 0;
  for (i = 0; i < filesize && *url; url++) {
    if (isalnum(*url) || *url == '-' || *url == '_' || *url == '.' || *url == '%') {
      file[i++] = *url;
      skip = 0;
    } else {
      if (!skip)
        file[i++] = '_';
      skip = 1;
    }
  }
  file[i] = '\0';
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<url_to_file>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbx
  mov    %rsi,%r13
  lea    -0x1(%rdx),%r12d
  mov    $0x0,%r14d
  mov    $0x0,%ebp
  movabs $0x400000000000201,%r15
  test   %r12d,%r12d
  jg     L59
L62:
  movslq %ebp,%rbp
  movb   $0x0,0x0(%r13,%rbp,1)
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L42:
  movzbl (%rbx),%edx
  movslq %ebp,%rax
  mov    %dl,0x0(%r13,%rax,1)
  lea    0x1(%rbp),%ebp
  mov    $0x0,%r14d
L18:
  add    $0x1,%rbx
  cmp    %r12d,%ebp
  jge    L62
L59:
  movzbl (%rbx),%edi
  test   %dil,%dil
  je     L62
  movsbl %dil,%edi
  call   <isalnum@plt>
  test   %rax,%rax
  jne    L42
  movzbl (%rbx),%eax
  cmp    $0x2d,%al
  je     L42
  sub    $0x25,%eax
  cmp    $0x3a,%al
  ja     L73
  bt     %rax,%r15
  jb     L42
L73:
  test   %r14d,%r14d
  jne    L18
  movslq %ebp,%rax
  movb   $0x5f,0x0(%r13,%rax,1)
  lea    0x1(%rbp),%ebp
  mov    $0x1,%r14d
  jmp    L18
```

assistant: ```c
void url_to_file(const char *url, char *file, int filesize) {
  int i, skip;
  filesize--;
  skip = 0;
  for (i = 0; i < filesize && *url; url++) {
    if (isalnum(*url) || *url == '-' || *url == '_' || *url == '.' || *url == '%') {
      file[i++] = *url;
      skip = 0;
    } else {
      if (!skip)
        file[i++] = '_';
      skip = 1;
    }
  }
  file[i] = '\0';
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<url_to_file>:
  endbr64
  push   %r15
  lea    -0x1(%rdx),%eax
  push   %r14
  push   %r13
  mov    %rsi,%r13
  push   %r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %eax,0xc(%rsp)
  test   %eax,%eax
  jle    L24
  mov    %rdi,%r14
  xor    %r12d,%r12d
  xor    %r15d,%r15d
  xor    %ebx,%ebx
  jmp    L73
  nopl   0x0(%rax)
L60:
  cmp    $0x2d,%al
  je     L79
  lea    -0x25(%rax),%esi
  cmp    $0x3a,%sil
  ja     L15
  movabs $0x400000000000201,%rcx
  bt     %rsi,%rcx
  jb     L79
L15:
  test   %r12d,%r12d
  jne    L29
  movb   $0x5f,0x0(%r13)
  add    $0x1,%r15d
  mov    $0x1,%r12d
  movslq %r15d,%rbx
L29:
  add    $0x1,%r14
  cmp    0xc(%rsp),%r15d
  jge    L95
  nopw   0x0(%rax,%rax,1)
L73:
  movsbl (%r14),%edi
  lea    0x0(%rbp,%rbx,1),%r13
  test   %dil,%dil
  je     L24
  call   <isalnum@plt>
  test   %rax,%rax
  movzbl (%r14),%eax
  je     L60
L79:
  add    $0x1,%r15d
  mov    %al,0x0(%r13)
  xor    %r12d,%r12d
  add    $0x1,%r14
  movslq %r15d,%rbx
  cmp    0xc(%rsp),%r15d
  jl     L73
L95:
  lea    0x0(%rbp,%rbx,1),%r13
L24:
  movb   $0x0,0x0(%r13)
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void url_to_file(const char *url, char *file, int filesize) {
  int i, skip;
  filesize--;
  skip = 0;
  for (i = 0; i < filesize && *url; url++) {
    if (isalnum(*url) || *url == '-' || *url == '_' || *url == '.' || *url == '%') {
      file[i++] = *url;
      skip = 0;
    } else {
      if (!skip)
        file[i++] = '_';
      skip = 1;
    }
  }
  file[i] = '\0';
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<url_to_file>:
  endbr64
  push   %r15
  lea    -0x1(%rdx),%eax
  push   %r14
  push   %r13
  mov    %rsi,%r13
  push   %r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %eax,0xc(%rsp)
  test   %eax,%eax
  jle    L37
  mov    %rdi,%r14
  xor    %r12d,%r12d
  xor    %r15d,%r15d
  xor    %ebx,%ebx
  jmp    L41
  nopl   0x0(%rax)
L28:
  cmp    $0x2d,%al
  je     L82
  lea    -0x25(%rax),%esi
  cmp    $0x3a,%sil
  ja     L56
  movabs $0x400000000000201,%rcx
  bt     %rsi,%rcx
  jb     L82
L56:
  test   %r12d,%r12d
  jne    L1
  movb   $0x5f,0x0(%r13)
  add    $0x1,%r15d
  mov    $0x1,%r12d
  movslq %r15d,%rbx
L1:
  add    $0x1,%r14
  cmp    0xc(%rsp),%r15d
  jge    L53
  nopw   0x0(%rax,%rax,1)
L41:
  movsbl (%r14),%edi
  lea    0x0(%rbp,%rbx,1),%r13
  test   %dil,%dil
  je     L37
  call   <isalnum@plt>
  test   %rax,%rax
  movzbl (%r14),%eax
  je     L28
L82:
  add    $0x1,%r15d
  mov    %al,0x0(%r13)
  xor    %r12d,%r12d
  add    $0x1,%r14
  movslq %r15d,%rbx
  cmp    0xc(%rsp),%r15d
  jl     L41
L53:
  lea    0x0(%rbp,%rbx,1),%r13
L37:
  movb   $0x0,0x0(%r13)
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void url_to_file(const char *url, char *file, int filesize) {
  int i, skip;
  filesize--;
  skip = 0;
  for (i = 0; i < filesize && *url; url++) {
    if (isalnum(*url) || *url == '-' || *url == '_' || *url == '.' || *url == '%') {
      file[i++] = *url;
      skip = 0;
    } else {
      if (!skip)
        file[i++] = '_';
      skip = 1;
    }
  }
  file[i] = '\0';
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<upsample_component_line_linear>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %edx,-0x24(%rbp)
  mov    %ecx,-0x28(%rbp)
  mov    %r8d,-0x2c(%rbp)
  mov    %r9d,-0x30(%rbp)
  cmpl   $0x0,-0x28(%rbp)
  jle    L10
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%ecx
  mov    -0x28(%rbp),%edx
  mov    -0x20(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <memset@plt>
L10:
  movl   $0x0,-0x10(%rbp)
  jmp    L13
L45:
  mov    -0x10(%rbp),%eax
  imul   -0x2c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x28(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x8(%rbp)
  movl   $0x0,-0xc(%rbp)
  jmp    L21
L25:
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  pxor   %xmm1,%xmm1
  cvtsi2ss %eax,%xmm1
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  mulss  %xmm0,%xmm1
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  pxor   %xmm2,%xmm2
  cvtsi2ss %eax,%xmm2
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    0x18(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  mulss  %xmm2,%xmm0
  addss  %xmm1,%xmm0
  movss  %xmm0,-0x4(%rbp)
  mov    -0x8(%rbp),%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  cvttss2si -0x4(%rbp),%edx
  mov    %dl,(%rax)
  addl   $0x1,-0xc(%rbp)
L21:
  mov    -0xc(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jl     L25
  addl   $0x1,-0x10(%rbp)
L13:
  mov    -0x10(%rbp),%eax
  cmp    -0x30(%rbp),%eax
  jl     L45
  nop
  nop
  leave
  ret
```

assistant: ```c
void upsample_component_line_linear(unsigned char *x_in_buff, unsigned char *x_out_buff, const int width, const int xpos, const int xstep, const int compressed_width, const float *x_pixel_percent1, const float *x_pixel_percent2) {
  int i, k;
  int base_write_pos;
  float tpix;
  if (xpos > 0)
    memset(x_out_buff, *x_in_buff, xpos);
  for (i = 0; i < compressed_width; i++) {
    base_write_pos = (i * xstep) + xpos;
    for (k = 0; k < xstep; k++) {
      tpix = (x_in_buff[i] * x_pixel_percent1[k]) + (x_in_buff[i + 1] * x_pixel_percent2[k]);
      x_out_buff[base_write_pos + k] = (unsigned char)tpix;
    }
  }
}
```
user: What is the c source code of the assembly code below?

```asm
<upsample_component_line_linear>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%r13
  mov    %rsi,0x8(%rsp)
  mov    %ecx,%ebx
  mov    %r8d,%r14d
  mov    %r9d,%r15d
  mov    0x50(%rsp),%rbp
  mov    0x58(%rsp),%r12
  test   %ecx,%ecx
  jg     L19
L18:
  test   %r15d,%r15d
  jle    L56
  mov    %r13,%rdx
  movslq %r14d,%rdi
  movslq %ebx,%rsi
  add    0x8(%rsp),%rsi
  lea    -0x1(%r15),%eax
  add    %rax,%r13
  mov    %r14d,%r8d
  jmp    L35
L19:
  mov    %rsi,%rdi
  movzbl 0x0(%r13),%esi
  mov    %ecx,%edx
  call   <memset@plt>
  jmp    L18
L6:
  mov    %rax,%rdx
L35:
  test   %r14d,%r14d
  jle    L46
  mov    $0x0,%eax
L51:
  movzbl (%rdx),%ecx
  pxor   %xmm0,%xmm0
  cvtsi2ss %ecx,%xmm0
  mulss  0x0(%rbp,%rax,4),%xmm0
  movzbl 0x1(%rdx),%ecx
  pxor   %xmm1,%xmm1
  cvtsi2ss %ecx,%xmm1
  mulss  (%r12,%rax,4),%xmm1
  addss  %xmm1,%xmm0
  cvttss2si %xmm0,%ecx
  mov    %cl,(%rsi,%rax,1)
  add    $0x1,%rax
  cmp    %r8,%rax
  jne    L51
L46:
  lea    0x1(%rdx),%rax
  add    %rdi,%rsi
  cmp    %r13,%rdx
  jne    L6
L56:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void upsample_component_line_linear(unsigned char *x_in_buff, unsigned char *x_out_buff, const int width, const int xpos, const int xstep, const int compressed_width, const float *x_pixel_percent1, const float *x_pixel_percent2) {
  int i, k;
  int base_write_pos;
  float tpix;
  if (xpos > 0)
    memset(x_out_buff, *x_in_buff, xpos);
  for (i = 0; i < compressed_width; i++) {
    base_write_pos = (i * xstep) + xpos;
    for (k = 0; k < xstep; k++) {
      tpix = (x_in_buff[i] * x_pixel_percent1[k]) + (x_in_buff[i + 1] * x_pixel_percent2[k]);
      x_out_buff[base_write_pos + k] = (unsigned char)tpix;
    }
  }
}
```