ylfeng/ReF-Decompile-dataset huggingface dataset:
user: What is the c source code of the assembly code below?

```asm
<main>:
  endbr64
  push   %r13
  lea    D29(%rip),%rdi
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  lea    0x18(%rsp),%rsi
  call   <scanf@plt>
  mov    0x18(%rsp),%eax
  test   %eax,%eax
  jle    L64
  pxor   %xmm6,%xmm6
  lea    0x20(%rsp),%r13
  lea    0x1c(%rsp),%r12
  xor    %ebx,%ebx
  movsd  %xmm6,0x8(%rsp)
  lea    D3(%rip),%rbp
  movsd  %xmm6,(%rsp)
  jmp    L57
  nop
L46:
  cmp    $0x1,%eax
  je     L52
L41:
  add    $0x1,%ebx
  cmp    %ebx,0x18(%rsp)
  jle    L94
L57:
  mov    %r13,%rdx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  xor    %eax,%eax
  call   <scanf@plt>
  mov    0x1c(%rsp),%eax
  cmp    $0x2,%eax
  je     L63
  cmp    $0x3,%eax
  jne    L46
  movsd  (%rsp),%xmm4
  movsd  0x8(%rsp),%xmm5
  add    $0x1,%ebx
  movsd  0x20(%rsp),%xmm1
  movapd %xmm4,%xmm0
  movapd %xmm4,%xmm2
  addsd  %xmm5,%xmm0
  mulsd  %xmm1,%xmm4
  mulsd  %xmm5,%xmm1
  mulsd  %xmm0,%xmm2
  subsd  %xmm4,%xmm2
  divsd  %xmm0,%xmm2
  movsd  %xmm2,(%rsp)
  movapd %xmm5,%xmm2
  mulsd  %xmm0,%xmm2
  subsd  %xmm1,%xmm2
  divsd  %xmm0,%xmm2
  movsd  %xmm2,0x8(%rsp)
  cmp    %ebx,0x18(%rsp)
  jg     L57
L94:
  movsd  0x8(%rsp),%xmm3
  movsd  D5(%rip),%xmm0
  movsd  (%rsp),%xmm1
  mulsd  %xmm3,%xmm0
  addsd  %xmm3,%xmm1
  divsd  %xmm1,%xmm0
  call   <floor@plt>
  lea    D25(%rip),%rdi
  mov    %eax,%esi
  call   <printf@plt>
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L76
  add    $0x38,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax,%rax,1)
L63:
  movsd  0x8(%rsp),%xmm7
  addsd  0x20(%rsp),%xmm7
  movsd  %xmm7,0x8(%rsp)
  jmp    L41
  nopw   0x0(%rax,%rax,1)
L52:
  movsd  (%rsp),%xmm6
  addsd  0x20(%rsp),%xmm6
  movsd  %xmm6,(%rsp)
  jmp    L41
L64:
  pxor   %xmm7,%xmm7
  movsd  %xmm7,0x8(%rsp)
  movsd  %xmm7,(%rsp)
  jmp    L94
L76:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_label: D29
data_type: string
name: disassemble_data
arguments: data_label: D3
data_type: string
name: disassemble_data
arguments: data_label: D5
data_type: f64
name: disassemble_data
arguments: data_label: D25
data_type: string

tool: D29: %d

tool: D3: %d %lf

tool: D5: 100

tool: D25: %d


assistant: ```c
int main(void) {
  int n, i, t, ans;
  double w, c, s, wc;
  scanf("%d", &n);
  w = 0.0;
  c = 0.0;
  for (i = 0; i < n; i++) {
    scanf("%d %lf", &t, &s);
    switch (t) {
    case 1:
      w += s;
      break;
    case 2:
      c += s;
      break;
    case 3:
      wc = w + c;
      w = (w * wc - s * w) / wc;
      c = (c * wc - s * c) / wc;
      break;
    }
  }
  ans = (int)floor(100.0 * c / (w + c));
  printf("%d\n", ans);
  return 0;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<dispUserInterface>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %rdi,-0x8(%rbp)
  lea    D33(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  lea    D51(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  lea    D34(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  lea    D7(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  lea    D58(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  lea    D16(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    -0x8(%rbp),%rax
  mov    %rax,%rsi
  lea    D13(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  nop
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: label: D33
type_infered: string
name: extract_symbolic_data
arguments: label: D51
type_infered: string
name: extract_symbolic_data
arguments: label: D34
type_infered: string
name: extract_symbolic_data
arguments: label: D7
type_infered: string
name: extract_symbolic_data
arguments: label: D58
type_infered: string
name: extract_symbolic_data
arguments: label: D16
type_infered: string
name: extract_symbolic_data
arguments: label: D13
type_infered: string

tool: D33: 

Database of Student Using Files


tool: D51: 1.Add a new record


tool: D34: 2.Delete a record


tool: D7: 3.Display all records


tool: D58: 4.Quit the program


tool: D16: Enter ur choice


tool: D13: %d

assistant: ```c
void dispUserInterface(char *ch) {
  printf("\n\nDatabase of Student Using Files\n");
  printf("1.Add a new record\n");
  printf("2.Delete a record\n");
  printf("3.Display all records\n");
  printf("4.Quit the program\n");
  printf("Enter ur choice\n");
  scanf("%d", ch);
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<dispUserInterface>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  lea    D5(%rip),%rdi
  call   <printf@plt>
  lea    D59(%rip),%rdi
  call   <printf@plt>
  lea    D57(%rip),%rdi
  call   <printf@plt>
  lea    D52(%rip),%rdi
  call   <printf@plt>
  lea    D50(%rip),%rdi
  call   <printf@plt>
  lea    D41(%rip),%rdi
  call   <printf@plt>
  mov    %rbx,%rsi
  lea    D56(%rip),%rdi
  call   <scanf@plt>
  pop    %rbx
  ret
```

tool_calls: name: disassemble_data
arguments: tag: D5
type: string
name: disassemble_data
arguments: tag: D59
type: string
name: disassemble_data
arguments: tag: D57
type: string
name: disassemble_data
arguments: tag: D52
type: string
name: disassemble_data
arguments: tag: D50
type: string
name: disassemble_data
arguments: tag: D41
type: string
name: disassemble_data
arguments: tag: D56
type: string

tool: D5: 

Database of Student Using Files


tool: D59: 1.Add a new record


tool: D57: 2.Delete a record


tool: D52: 3.Display all records


tool: D50: 4.Quit the program


tool: D41: Enter ur choice


tool: D56: %d

assistant: ```c
void dispUserInterface(char *ch) {
  printf("\n\nDatabase of Student Using Files\n");
  printf("1.Add a new record\n");
  printf("2.Delete a record\n");
  printf("3.Display all records\n");
  printf("4.Quit the program\n");
  printf("Enter ur choice\n");
  scanf("%d", ch);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<dispUserInterface>:
  endbr64
  push   %rbp
  mov    %rdi,%rbp
  lea    D21(%rip),%rdi
  call   <printf@plt>
  lea    D69(%rip),%rdi
  call   <printf@plt>
  lea    D55(%rip),%rdi
  call   <printf@plt>
  lea    D36(%rip),%rdi
  call   <printf@plt>
  lea    D67(%rip),%rdi
  call   <printf@plt>
  lea    D63(%rip),%rdi
  call   <printf@plt>
  mov    %rbp,%rsi
  lea    D65(%rip),%rdi
  pop    %rbp
  jmp    1070 <scanf@plt>
```

tool_calls: name: retrieve_data
arguments: label: D21
type: string
name: retrieve_data
arguments: label: D69
type: string
name: retrieve_data
arguments: label: D55
type: string
name: retrieve_data
arguments: label: D36
type: string
name: retrieve_data
arguments: label: D67
type: string
name: retrieve_data
arguments: label: D63
type: string
name: retrieve_data
arguments: label: D65
type: string

tool: D21: 

Database of Student Using Files


tool: D69: 1.Add a new record


tool: D55: 2.Delete a record


tool: D36: 3.Display all records


tool: D67: 4.Quit the program


tool: D63: Enter ur choice


tool: D65: %d

assistant: ```c
void dispUserInterface(char *ch) {
  printf("\n\nDatabase of Student Using Files\n");
  printf("1.Add a new record\n");
  printf("2.Delete a record\n");
  printf("3.Display all records\n");
  printf("4.Quit the program\n");
  printf("Enter ur choice\n");
  scanf("%d", ch);
}
```
user: Translate the below assembly code into C programming language:

```asm
<dispUserInterface>:
  endbr64
  push   %rbp
  mov    %rdi,%rbp
  lea    D7(%rip),%rdi
  call   <printf@plt>
  lea    D25(%rip),%rdi
  call   <printf@plt>
  lea    D11(%rip),%rdi
  call   <printf@plt>
  lea    D45(%rip),%rdi
  call   <printf@plt>
  lea    D59(%rip),%rdi
  call   <printf@plt>
  lea    D56(%rip),%rdi
  call   <printf@plt>
  mov    %rbp,%rsi
  lea    D53(%rip),%rdi
  pop    %rbp
  jmp    1070 <scanf@plt>
```

tool_calls: name: retrieve_data
arguments: label: D7
datatype: string
name: retrieve_data
arguments: label: D25
datatype: string
name: retrieve_data
arguments: label: D11
datatype: string
name: retrieve_data
arguments: label: D45
datatype: string
name: retrieve_data
arguments: label: D59
datatype: string
name: retrieve_data
arguments: label: D56
datatype: string
name: retrieve_data
arguments: label: D53
datatype: string

tool: D7: 

Database of Student Using Files


tool: D25: 1.Add a new record


tool: D11: 2.Delete a record


tool: D45: 3.Display all records


tool: D59: 4.Quit the program


tool: D56: Enter ur choice


tool: D53: %d

assistant: ```c
void dispUserInterface(char *ch) {
  printf("\n\nDatabase of Student Using Files\n");
  printf("1.Add a new record\n");
  printf("2.Delete a record\n");
  printf("3.Display all records\n");
  printf("4.Quit the program\n");
  printf("Enter ur choice\n");
  scanf("%d", ch);
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<parseStr>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  movl   $0x1,-0x8(%rbp)
  movl   $0x0,-0x4(%rbp)
  movb   $0x0,-0xa(%rbp)
  jmp    L72
L14:
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0x9(%rbp)
  cmpb   $0x0,-0xa(%rbp)
  jne    L95
  cmpb   $0x22,-0x9(%rbp)
  je     L3
  cmpb   $0x5c,-0x9(%rbp)
  je     L3
L95:
  mov    -0x4(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x4(%rbp)
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x9(%rbp),%eax
  mov    %al,(%rdx)
L3:
  cmpb   $0x22,-0x9(%rbp)
  jne    L75
  cmpb   $0x0,-0xa(%rbp)
  jne    L75
  mov    -0x4(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x4(%rbp)
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  jmp    L31
L75:
  cmpb   $0x5c,-0x9(%rbp)
  jne    L36
  cmpb   $0x0,-0xa(%rbp)
  jne    L36
  movb   $0x1,-0xa(%rbp)
  jmp    L72
L36:
  movb   $0x0,-0xa(%rbp)
L72:
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L14
L31:
  pop    %rbp
  ret
```

assistant: ```c
void parseStr(char *expr) {
  int rPos = 1;
  int wPos = 0;
  char escape = 0;
  while (expr[rPos] != 0) {
    char c = expr[rPos++];
    if (escape || (c != '"' && c != '\\')) {
      expr[wPos++] = c;
    }
    if (c == '"' && !escape) {
      expr[wPos++] = 0;
      return;
    }
    if (c == '\\' && !escape) {
      escape = 1;
    } else {
      escape = 0;
    }
  }
}
```
user: What is the c source code of the assembly code below?

```asm
<parseStr>:
  endbr64
  movzbl 0x1(%rdi),%eax
  test   %al,%al
  je     L1
  lea    0x2(%rdi),%rcx
  mov    $0x0,%edx
  mov    $0x0,%esi
  jmp    L64
L27:
  movslq %esi,%r8
  mov    %al,(%rdi,%r8,1)
  lea    0x1(%rsi),%esi
L24:
  xor    $0x1,%edx
  cmp    $0x22,%al
  jne    L7
  test   %dl,%dl
  jne    L89
L7:
  cmp    $0x5c,%al
  sete   %al
  and    %eax,%edx
  add    $0x1,%rcx
  movzbl -0x1(%rcx),%eax
  test   %al,%al
  je     L1
L64:
  test   %dl,%dl
  jne    L27
  cmp    $0x22,%al
  je     L24
  cmp    $0x5c,%al
  jne    L27
  jmp    L24
L89:
  movslq %esi,%rsi
  movb   $0x0,(%rdi,%rsi,1)
  ret
L1:
  ret
```

assistant: ```c
void parseStr(char *expr) {
  int rPos = 1;
  int wPos = 0;
  char escape = 0;
  while (expr[rPos] != 0) {
    char c = expr[rPos++];
    if (escape || (c != '"' && c != '\\')) {
      expr[wPos++] = c;
    }
    if (c == '"' && !escape) {
      expr[wPos++] = 0;
      return;
    }
    if (c == '\\' && !escape) {
      escape = 1;
    } else {
      escape = 0;
    }
  }
}
```
user: Translate the below assembly code into C programming language:

```asm
<parseStr>:
  endbr64
  movzbl 0x1(%rdi),%eax
  test   %al,%al
  je     L13
  lea    0x2(%rdi),%rcx
  xor    %edx,%edx
  xor    %esi,%esi
  jmp    L10
  cs nopw 0x0(%rax,%rax,1)
L64:
  cmp    $0x5c,%al
  sete   %al
  add    $0x1,%rcx
  and    %eax,%edx
  movzbl -0x1(%rcx),%eax
  test   %al,%al
  je     L13
L10:
  test   %dl,%dl
  jne    L37
  cmp    $0x22,%al
  je     L1
  cmp    $0x5c,%al
  je     L1
L37:
  movslq %esi,%r8
  add    $0x1,%esi
  mov    %al,(%rdi,%r8,1)
L1:
  xor    $0x1,%edx
  cmp    $0x22,%al
  jne    L64
  test   %dl,%dl
  je     L64
  movslq %esi,%rsi
  movb   $0x0,(%rdi,%rsi,1)
  ret
  nopl   0x0(%rax)
L13:
  ret
```

assistant: ```c
void parseStr(char *expr) {
  int rPos = 1;
  int wPos = 0;
  char escape = 0;
  while (expr[rPos] != 0) {
    char c = expr[rPos++];
    if (escape || (c != '"' && c != '\\')) {
      expr[wPos++] = c;
    }
    if (c == '"' && !escape) {
      expr[wPos++] = 0;
      return;
    }
    if (c == '\\' && !escape) {
      escape = 1;
    } else {
      escape = 0;
    }
  }
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<parseStr>:
  endbr64
  movzbl 0x1(%rdi),%eax
  test   %al,%al
  je     L45
  lea    0x2(%rdi),%rcx
  xor    %edx,%edx
  xor    %esi,%esi
  jmp    L58
  cs nopw 0x0(%rax,%rax,1)
L79:
  cmp    $0x5c,%al
  sete   %al
  add    $0x1,%rcx
  and    %eax,%edx
  movzbl -0x1(%rcx),%eax
  test   %al,%al
  je     L45
L58:
  test   %dl,%dl
  jne    L32
  cmp    $0x22,%al
  je     L42
  cmp    $0x5c,%al
  je     L42
L32:
  movslq %esi,%r8
  add    $0x1,%esi
  mov    %al,(%rdi,%r8,1)
L42:
  xor    $0x1,%edx
  cmp    $0x22,%al
  jne    L79
  test   %dl,%dl
  je     L79
  movslq %esi,%rsi
  movb   $0x0,(%rdi,%rsi,1)
  ret
  nopl   0x0(%rax)
L45:
  ret
```

assistant: ```c
void parseStr(char *expr) {
  int rPos = 1;
  int wPos = 0;
  char escape = 0;
  while (expr[rPos] != 0) {
    char c = expr[rPos++];
    if (escape || (c != '"' && c != '\\')) {
      expr[wPos++] = c;
    }
    if (c == '"' && !escape) {
      expr[wPos++] = 0;
      return;
    }
    if (c == '\\' && !escape) {
      escape = 1;
    } else {
      escape = 0;
    }
  }
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<bubbleSort>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  movl   $0x1,-0xc(%rbp)
  jmp    L13
L22:
  movl   $0x0,-0x8(%rbp)
  jmp    L6
L39:
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x8(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,4),%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  cmp    %eax,%edx
  jle    L4
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x8(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    -0x8(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x18(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  mov    -0x8(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x4(%rbp),%eax
  mov    %eax,(%rdx)
L4:
  addl   $0x1,-0xc(%rbp)
L6:
  cmpl   $0x62,-0x8(%rbp)
  jle    L39
  addl   $0x1,-0xc(%rbp)
L13:
  cmpl   $0x62,-0xc(%rbp)
  jle    L22
  nop
  nop
  pop    %rbp
  ret
```

assistant: ```c
void bubbleSort(int a[]) {
  int pass;
  int j;
  int hold;
  for (pass = 1; pass < 99; pass++) {
    for (j = 0; j < 99; pass++) {
      if (a[j] > a[j + 1]) {
        hold = a[j];
        a[j] = a[j + 1];
        a[j + 1] = hold;
      }
    }
  }
}
```
user: What is the c source code of the assembly code below:

```asm
<bubbleSort>:
  endbr64
  jmp    L6
L20:
  mov    %eax,(%rdi)
  mov    %edx,0x4(%rdi)
L6:
  mov    (%rdi),%edx
  mov    0x4(%rdi),%eax
L10:
  cmp    %eax,%edx
  jg     L20
  jmp    L10
```

assistant: ```c
void bubbleSort(int a[]) {
  int pass;
  int j;
  int hold;
  for (pass = 1; pass < 99; pass++) {
    for (j = 0; j < 99; pass++) {
      if (a[j] > a[j + 1]) {
        hold = a[j];
        a[j] = a[j + 1];
        a[j + 1] = hold;
      }
    }
  }
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<bubbleSort>:
  endbr64
  mov    (%rdi),%edx
  mov    0x4(%rdi),%eax
  nopl   0x0(%rax)
L12:
  cmp    %eax,%edx
  jle    L12
L22:
  mov    %edx,%ecx
  mov    %eax,(%rdi)
  mov    %edx,0x4(%rdi)
  mov    %eax,%edx
  mov    %ecx,%eax
  cmp    %eax,%edx
  jg     L22
  jmp    L12
```

assistant: ```c
void bubbleSort(int a[]) {
  int pass;
  int j;
  int hold;
  for (pass = 1; pass < 99; pass++) {
    for (j = 0; j < 99; pass++) {
      if (a[j] > a[j + 1]) {
        hold = a[j];
        a[j] = a[j + 1];
        a[j + 1] = hold;
      }
    }
  }
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<bubbleSort>:
  endbr64
  mov    (%rdi),%eax
  mov    0x4(%rdi),%edx
  cmp    %edx,%eax
  jg     L19
L18:
  jmp    L18
  nop
L19:
  mov    %edx,(%rdi)
  mov    %eax,0x4(%rdi)
  jmp    L18
```

assistant: ```c
void bubbleSort(int a[]) {
  int pass;
  int j;
  int hold;
  for (pass = 1; pass < 99; pass++) {
    for (j = 0; j < 99; pass++) {
      if (a[j] > a[j + 1]) {
        hold = a[j];
        a[j] = a[j + 1];
        a[j + 1] = hold;
      }
    }
  }
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<str_contains>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  cmpq   $0x0,-0x38(%rbp)
  je     L26
  cmpq   $0x0,-0x40(%rbp)
  jne    L7
L26:
  mov    $0xffffffff,%eax
  jmp    L61
L7:
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x28(%rbp)
  mov    -0x40(%rbp),%rax
  mov    %rax,-0x20(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <str_len@plt>
  mov    %eax,%ebx
  mov    -0x40(%rbp),%rax
  mov    %rax,%rdi
  call   <str_len@plt>
  lea    -0x1(%rax),%edx
  mov    %ebx,%eax
  sub    %edx,%eax
  cltq
  mov    %rax,-0x18(%rbp)
  movl   $0x0,-0x2c(%rbp)
  jmp    L59
L82:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%edx
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  cmp    %al,%dl
  jne    L11
  jmp    L107
L25:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%edx
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  cmp    %al,%dl
  je     L116
  mov    -0x40(%rbp),%rax
  mov    %rax,-0x20(%rbp)
  jmp    L105
L116:
  addq   $0x1,-0x28(%rbp)
  addq   $0x1,-0x20(%rbp)
  addl   $0x1,-0x2c(%rbp)
L107:
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L25
L105:
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L11
  mov    -0x40(%rbp),%rax
  mov    %rax,%rdi
  call   <str_len@plt>
  mov    %eax,%edx
  mov    -0x2c(%rbp),%eax
  sub    %edx,%eax
  jmp    L61
L11:
  addq   $0x1,-0x28(%rbp)
  addl   $0x1,-0x2c(%rbp)
L59:
  mov    -0x2c(%rbp),%eax
  cltq
  cmp    %rax,-0x18(%rbp)
  ja     L82
  mov    $0xffffffff,%eax
L61:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
int str_contains(const char *str, const char *str1) {
  if (str == NULL || str1 == NULL)
    return -1;
  char *it;
  it = str;
  char *it1;
  it1 = str1;
  int i;
  size_t sz = str_len(str) - (str_len(str1) - 1);
  for (i = 0; i < sz; i++) {
    if (*it == *it1) {
      while (*it1 != '\0') {
        if (*it != *it1) {
          it1 = str1;
          break;
        }
        it++;
        it1++;
        i++;
      }
      if (*it1 == '\0') {
        return i - str_len(str1);
      }
    }
    it++;
  }
  return -1;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<str_contains>:
  endbr64
  test   %rdi,%rdi
  je     L37
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  mov    %rsi,%rbp
  test   %rsi,%rsi
  je     L108
  call   <str_len@plt>
  mov    %eax,%r12d
  mov    %rbp,%rdi
  call   <str_len@plt>
  sub    $0x1,%eax
  sub    %eax,%r12d
  movslq %r12d,%rsi
  test   %rsi,%rsi
  je     L104
  movzbl 0x0(%rbp),%edi
  mov    $0x0,%edx
  jmp    L90
L35:
  mov    %edx,%r12d
L125:
  mov    %rbp,%rdi
  call   <str_len@plt>
  mov    %eax,%edx
  mov    %r12d,%eax
  sub    %edx,%eax
  jmp    L8
L30:
  add    $0x1,%rbx
  add    $0x1,%edx
  movslq %edx,%rax
  cmp    %rsi,%rax
  jae    L120
L90:
  cmp    %dil,(%rbx)
  jne    L30
  test   %dil,%dil
  je     L35
  mov    %rbp,%rax
L56:
  add    $0x1,%rbx
  add    $0x1,%rax
  mov    %eax,%ecx
  sub    %ebp,%ecx
  lea    (%rcx,%rdx,1),%r12d
  movzbl (%rax),%ecx
  test   %cl,%cl
  je     L125
  cmp    %cl,(%rbx)
  je     L56
  mov    %r12d,%edx
  jmp    L30
L120:
  mov    $0xffffffff,%eax
L8:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L108:
  mov    $0xffffffff,%eax
  jmp    L8
L104:
  mov    $0xffffffff,%eax
  jmp    L8
L37:
  mov    $0xffffffff,%eax
  ret
```

assistant: ```c
int str_contains(const char *str, const char *str1) {
  if (str == NULL || str1 == NULL)
    return -1;
  char *it;
  it = str;
  char *it1;
  it1 = str1;
  int i;
  size_t sz = str_len(str) - (str_len(str1) - 1);
  for (i = 0; i < sz; i++) {
    if (*it == *it1) {
      while (*it1 != '\0') {
        if (*it != *it1) {
          it1 = str1;
          break;
        }
        it++;
        it1++;
        i++;
      }
      if (*it1 == '\0') {
        return i - str_len(str1);
      }
    }
    it++;
  }
  return -1;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<str_contains>:
  endbr64
  test   %rdi,%rdi
  je     L98
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  push   %rbx
  test   %rsi,%rsi
  je     L37
  mov    %rdi,%rbx
  call   <str_len@plt>
  mov    %r12,%rdi
  mov    %eax,%ebp
  call   <str_len@plt>
  sub    $0x1,%eax
  sub    %eax,%ebp
  movslq %ebp,%rsi
  test   %rsi,%rsi
  je     L37
  movzbl (%r12),%edi
  xor    %ecx,%ecx
  jmp    L28
  nopl   0x0(%rax)
L43:
  add    $0x1,%ecx
  add    $0x1,%rbx
  movslq %ecx,%rax
  cmp    %rsi,%rax
  jae    L37
L28:
  cmp    %dil,(%rbx)
  jne    L43
  test   %dil,%dil
  je     L85
  mov    %r12,%rdx
  nopl   0x0(%rax)
L51:
  add    $0x1,%rdx
  add    $0x1,%rbx
  mov    %edx,%eax
  sub    %r12d,%eax
  lea    (%rax,%rcx,1),%ebp
  movzbl (%rdx),%eax
  test   %al,%al
  je     L71
  cmp    %al,(%rbx)
  je     L51
  mov    %ebp,%ecx
  add    $0x1,%rbx
  add    $0x1,%ecx
  movslq %ecx,%rax
  cmp    %rsi,%rax
  jb     L28
L37:
  pop    %rbx
  mov    $0xffffffff,%eax
  pop    %rbp
  pop    %r12
  ret
L85:
  mov    %ecx,%ebp
L71:
  mov    %r12,%rdi
  call   <str_len@plt>
  pop    %rbx
  mov    %eax,%r8d
  mov    %ebp,%eax
  pop    %rbp
  pop    %r12
  sub    %r8d,%eax
  ret
L98:
  mov    $0xffffffff,%eax
  ret
```

assistant: ```c
int str_contains(const char *str, const char *str1) {
  if (str == NULL || str1 == NULL)
    return -1;
  char *it;
  it = str;
  char *it1;
  it1 = str1;
  int i;
  size_t sz = str_len(str) - (str_len(str1) - 1);
  for (i = 0; i < sz; i++) {
    if (*it == *it1) {
      while (*it1 != '\0') {
        if (*it != *it1) {
          it1 = str1;
          break;
        }
        it++;
        it1++;
        i++;
      }
      if (*it1 == '\0') {
        return i - str_len(str1);
      }
    }
    it++;
  }
  return -1;
}
```