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

```asm
<wait>:
  endbr64
  push   %r12
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  call   <getpid@plt>
  lea    D3(%rip),%rdi
  mov    %eax,%esi
  xor    %eax,%eax
  call   <printf@plt>
  xor    %edx,%edx
  lea    0x4(%rsp),%rsi
  mov    $0x5,%edi
  call   <syscall@plt>
  mov    %eax,%r12d
  xor    %eax,%eax
  call   <getpid@plt>
  mov    %r12d,%edx
  lea    D17(%rip),%rdi
  mov    %eax,%esi
  xor    %eax,%eax
  call   <printf@plt>
  test   %r12d,%r12d
  js     L12
  mov    0x4(%rsp),%esi
  lea    D27(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
L12:
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L16
  add    $0x10,%rsp
  mov    %r12d,%eax
  pop    %r12
  ret
L16:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: label: D3
type_guessed: string
name: read_data
arguments: label: D17
type_guessed: string
name: read_data
arguments: label: D27
type_guessed: string

tool: D3: proc %d enter Kernel to wait for a child to die


tool: D17: proc %d back from wait, dead child=%d

tool: D27: exitValue=%d

assistant: ```c
int wait() {
  int child, exitValue;
  printf("proc %d enter Kernel to wait for a child to die\n", getpid());
  child = syscall(5, &exitValue, 0);
  printf("proc %d back from wait, dead child=%d", getpid(), child);
  if (child >= 0) {
    printf("exitValue=%d", exitValue);
  }
  printf("\n");
  return child;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<wait>:
  endbr64
  push   %r12
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  call   <getpid@plt>
  lea    D12(%rip),%rdi
  mov    %eax,%esi
  xor    %eax,%eax
  call   <printf@plt>
  xor    %edx,%edx
  lea    0x4(%rsp),%rsi
  mov    $0x5,%edi
  call   <syscall@plt>
  mov    %eax,%r12d
  xor    %eax,%eax
  call   <getpid@plt>
  mov    %r12d,%edx
  lea    D5(%rip),%rdi
  mov    %eax,%esi
  xor    %eax,%eax
  call   <printf@plt>
  test   %r12d,%r12d
  js     L5
  mov    0x4(%rsp),%esi
  lea    D11(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
L5:
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L10
  add    $0x10,%rsp
  mov    %r12d,%eax
  pop    %r12
  ret
L10:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_tag: D12
type_infered: string
name: disassemble_data
arguments: data_tag: D5
type_infered: string
name: disassemble_data
arguments: data_tag: D11
type_infered: string

tool: D12: proc %d enter Kernel to wait for a child to die


tool: D5: proc %d back from wait, dead child=%d

tool: D11: exitValue=%d

assistant: ```c
int wait() {
  int child, exitValue;
  printf("proc %d enter Kernel to wait for a child to die\n", getpid());
  child = syscall(5, &exitValue, 0);
  printf("proc %d back from wait, dead child=%d", getpid(), child);
  if (child >= 0) {
    printf("exitValue=%d", exitValue);
  }
  printf("\n");
  return child;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<mean>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  movl   $0x0,-0x4(%rbp)
  lea    D24(%rip),%rax
  mov    %rax,%rcx
  lea    D41(%rip),%rax
  mov    %rax,%rdx
  lea    D24(%rip),%rax
  mov    %rax,%rsi
  lea    D48(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movl   $0x0,-0x8(%rbp)
  jmp    L11
L10:
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  add    %eax,-0x4(%rbp)
  addl   $0x1,-0x8(%rbp)
L11:
  cmpl   $0x62,-0x8(%rbp)
  jle    L10
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x4(%rbp),%xmm0
  movsd  D9(%rip),%xmm1
  divsd  %xmm1,%xmm0
  movq   %xmm0,%rdx
  mov    -0x4(%rbp),%eax
  movq   %rdx,%xmm0
  mov    $0x63,%ecx
  mov    %eax,%edx
  mov    $0x63,%esi
  lea    D15(%rip),%rax
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  nop
  leave
  ret
```

tool_calls: name: parse_data
arguments: data_label: D24
type_guessed: string
name: parse_data
arguments: data_label: D41
type_guessed: string
name: parse_data
arguments: data_label: D48
type_guessed: string
name: parse_data
arguments: data_label: D9
type_guessed: byte[8]
name: parse_data
arguments: data_label: D15
type_guessed: string

tool: D24: ***************

tool: D41:      Mean

tool: D48: %s
%s
%s


tool: {"D9": [0x00,0x00,0x00,0x00,0x00,0xc0,0x58,0x40]}

tool: D15: The mean is the average value of the data
items. The mean is equal to the total of
all the data items (%d). The mean value for
this run is: %d / %d = %.4f



assistant: ```c
void mean(const int answer[]) {
  int j;
  int total = 0;
  printf("%s\n%s\n%s\n", "***************", "     Mean", "***************");
  for (j = 0; j < 99; j++) {
    total += answer[j];
  }
  printf("The mean is the average value of the data\n"
         "items. The mean is equal to the total of\n"
         "all the data items (%d). The mean value for\n"
         "this run is: %d / %d = %.4f\n\n",
         99, total, 99, (double)total / 99);
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<mean>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  lea    D3(%rip),%rsi
  mov    %rsi,%rcx
  lea    D5(%rip),%rdx
  lea    D36(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %rbx,%rax
  lea    0x18c(%rbx),%rcx
  mov    $0x0,%edx
L9:
  add    (%rax),%edx
  add    $0x4,%rax
  cmp    %rcx,%rax
  jne    L9
  pxor   %xmm0,%xmm0
  cvtsi2sd %edx,%xmm0
  divsd  D16(%rip),%xmm0
  mov    $0x63,%ecx
  mov    $0x63,%esi
  lea    D4(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  pop    %rbx
  ret
```

tool_calls: name: retrieve_data
arguments: data_tag: D3
datatype: string
name: retrieve_data
arguments: data_tag: D5
datatype: string
name: retrieve_data
arguments: data_tag: D36
datatype: string
name: retrieve_data
arguments: data_tag: D16
datatype: byte[8]
name: retrieve_data
arguments: data_tag: D4
datatype: string

tool: D3: ***************

tool: D5:      Mean

tool: D36: %s
%s
%s


tool: {"D16": [0x00,0x00,0x00,0x00,0x00,0xc0,0x58,0x40]}

tool: D4: The mean is the average value of the data
items. The mean is equal to the total of
all the data items (%d). The mean value for
this run is: %d / %d = %.4f



assistant: ```c
void mean(const int answer[]) {
  int j;
  int total = 0;
  printf("%s\n%s\n%s\n", "***************", "     Mean", "***************");
  for (j = 0; j < 99; j++) {
    total += answer[j];
  }
  printf("The mean is the average value of the data\n"
         "items. The mean is equal to the total of\n"
         "all the data items (%d). The mean value for\n"
         "this run is: %d / %d = %.4f\n\n",
         99, total, 99, (double)total / 99);
}
```
user: What is the c source code of the assembly code below:

```asm
<mean>:
  endbr64
  push   %rbx
  lea    D22(%rip),%rsi
  mov    %rdi,%rbx
  xor    %eax,%eax
  lea    D33(%rip),%rdx
  lea    D47(%rip),%rdi
  mov    %rsi,%rcx
  call   <printf@plt>
  mov    %rbx,%rdi
  lea    0x18c(%rbx),%rax
  xor    %edx,%edx
  nopl   0x0(%rax,%rax,1)
L4:
  add    (%rdi),%edx
  add    $0x4,%rdi
  cmp    %rax,%rdi
  jne    L4
  pxor   %xmm0,%xmm0
  mov    $0x63,%ecx
  mov    $0x63,%esi
  pop    %rbx
  mov    $0x1,%eax
  cvtsi2sd %edx,%xmm0
  lea    D26(%rip),%rdi
  divsd  D42(%rip),%xmm0
  jmp    1050 <printf@plt>
```

tool_calls: name: retrieve_data
arguments: data_label: D22
type_infered: string
name: retrieve_data
arguments: data_label: D33
type_infered: string
name: retrieve_data
arguments: data_label: D47
type_infered: string
name: retrieve_data
arguments: data_label: D26
type_infered: string
name: retrieve_data
arguments: data_label: D42
type_infered: byte[8]

tool: D22: ***************

tool: D33:      Mean

tool: D47: %s
%s
%s


tool: D26: The mean is the average value of the data
items. The mean is equal to the total of
all the data items (%d). The mean value for
this run is: %d / %d = %.4f



tool: {"D42": [0x00,0x00,0x00,0x00,0x00,0xc0,0x58,0x40]}

assistant: ```c
void mean(const int answer[]) {
  int j;
  int total = 0;
  printf("%s\n%s\n%s\n", "***************", "     Mean", "***************");
  for (j = 0; j < 99; j++) {
    total += answer[j];
  }
  printf("The mean is the average value of the data\n"
         "items. The mean is equal to the total of\n"
         "all the data items (%d). The mean value for\n"
         "this run is: %d / %d = %.4f\n\n",
         99, total, 99, (double)total / 99);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<mean>:
  endbr64
  push   %rbx
  lea    D42(%rip),%rsi
  mov    %rdi,%rbx
  xor    %eax,%eax
  lea    D21(%rip),%rdx
  mov    %rsi,%rcx
  lea    D25(%rip),%rdi
  call   <printf@plt>
  mov    %rbx,%rax
  lea    0x180(%rbx),%rdx
  pxor   %xmm0,%xmm0
  nopl   (%rax)
L0:
  movdqu (%rax),%xmm2
  add    $0x10,%rax
  paddd  %xmm2,%xmm0
  cmp    %rdx,%rax
  jne    L0
  movdqa %xmm0,%xmm1
  mov    $0x63,%ecx
  mov    $0x63,%esi
  mov    $0x1,%eax
  psrldq $0x8,%xmm1
  lea    D29(%rip),%rdi
  paddd  %xmm1,%xmm0
  movdqa %xmm0,%xmm1
  psrldq $0x4,%xmm1
  paddd  %xmm1,%xmm0
  movd   %xmm0,%edx
  pxor   %xmm0,%xmm0
  add    0x180(%rbx),%edx
  add    0x184(%rbx),%edx
  add    0x188(%rbx),%edx
  pop    %rbx
  cvtsi2sd %edx,%xmm0
  divsd  D47(%rip),%xmm0
  jmp    1050 <printf@plt>
```

tool_calls: name: unpack_data
arguments: label: D42
type: string
name: unpack_data
arguments: label: D21
type: string
name: unpack_data
arguments: label: D25
type: string
name: unpack_data
arguments: label: D29
type: string
name: unpack_data
arguments: label: D47
type: byte[8]

tool: D42: ***************

tool: D21:      Mean

tool: D25: %s
%s
%s


tool: D29: The mean is the average value of the data
items. The mean is equal to the total of
all the data items (%d). The mean value for
this run is: %d / %d = %.4f



tool: {"D47": [0x00,0x00,0x00,0x00,0x00,0xc0,0x58,0x40]}

assistant: ```c
void mean(const int answer[]) {
  int j;
  int total = 0;
  printf("%s\n%s\n%s\n", "***************", "     Mean", "***************");
  for (j = 0; j < 99; j++) {
    total += answer[j];
  }
  printf("The mean is the average value of the data\n"
         "items. The mean is equal to the total of\n"
         "all the data items (%d). The mean value for\n"
         "this run is: %d / %d = %.4f\n\n",
         99, total, 99, (double)total / 99);
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<dec_to_bin>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %edx,-0x20(%rbp)
  mov    -0x20(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x20(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x4(%rbp)
  jmp    L16
L9:
  mov    -0x1c(%rbp),%eax
  and    $0x1,%eax
  lea    0x30(%rax),%ecx
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    %ecx,%edx
  mov    %dl,(%rax)
  subl   $0x1,-0x4(%rbp)
  sarl   -0x1c(%rbp)
L16:
  cmpl   $0x0,-0x4(%rbp)
  jns    L9
  mov    -0x18(%rbp),%rax
  pop    %rbp
  ret
```

assistant: ```c
char *dec_to_bin(char *bin, int dec, int nbr_bits) {
  int i;
  bin[nbr_bits] = '\0';
  for (i = nbr_bits - 1; i >= 0; --i, dec >>= 1) {
    bin[i] = (dec & 1) + '0';
  }
  return bin;
}
```
user: Translate the below assembly code into C programming language:

```asm
<dec_to_bin>:
  endbr64
  movslq %edx,%rcx
  movb   $0x0,(%rdi,%rcx,1)
  mov    %edx,%eax
  sub    $0x1,%eax
  js     L10
  cltq
  add    %rdi,%rax
  lea    -0x2(%rdi,%rcx,1),%rcx
  lea    -0x1(%rdx),%edx
  sub    %rdx,%rcx
L13:
  mov    %esi,%edx
  and    $0x1,%edx
  add    $0x30,%edx
  mov    %dl,(%rax)
  sar    %esi
  sub    $0x1,%rax
  cmp    %rcx,%rax
  jne    L13
L10:
  mov    %rdi,%rax
  ret
```

assistant: ```c
char *dec_to_bin(char *bin, int dec, int nbr_bits) {
  int i;
  bin[nbr_bits] = '\0';
  for (i = nbr_bits - 1; i >= 0; --i, dec >>= 1) {
    bin[i] = (dec & 1) + '0';
  }
  return bin;
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<dec_to_bin>:
  endbr64
  movslq %edx,%rcx
  mov    %rdi,%r8
  movb   $0x0,(%rdi,%rcx,1)
  sub    $0x1,%edx
  js     L3
  movslq %edx,%rax
  lea    -0x2(%rdi,%rcx,1),%rcx
  mov    %edx,%edx
  add    %rdi,%rax
  sub    %rdx,%rcx
  nopl   0x0(%rax,%rax,1)
L4:
  mov    %esi,%edx
  sub    $0x1,%rax
  sar    %esi
  and    $0x1,%edx
  add    $0x30,%edx
  mov    %dl,0x1(%rax)
  cmp    %rcx,%rax
  jne    L4
L3:
  mov    %r8,%rax
  ret
```

assistant: ```c
char *dec_to_bin(char *bin, int dec, int nbr_bits) {
  int i;
  bin[nbr_bits] = '\0';
  for (i = nbr_bits - 1; i >= 0; --i, dec >>= 1) {
    bin[i] = (dec & 1) + '0';
  }
  return bin;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<dec_to_bin>:
  endbr64
  movslq %edx,%rcx
  mov    %rdi,%r8
  movb   $0x0,(%rdi,%rcx,1)
  sub    $0x1,%edx
  js     L15
  movslq %edx,%rax
  lea    -0x2(%rdi,%rcx,1),%rcx
  mov    %edx,%edx
  add    %rdi,%rax
  sub    %rdx,%rcx
  nopl   0x0(%rax,%rax,1)
L10:
  mov    %esi,%edx
  sub    $0x1,%rax
  sar    %esi
  and    $0x1,%edx
  add    $0x30,%edx
  mov    %dl,0x1(%rax)
  cmp    %rax,%rcx
  jne    L10
L15:
  mov    %r8,%rax
  ret
```

assistant: ```c
char *dec_to_bin(char *bin, int dec, int nbr_bits) {
  int i;
  bin[nbr_bits] = '\0';
  for (i = nbr_bits - 1; i >= 0; --i, dec >>= 1) {
    bin[i] = (dec & 1) + '0';
  }
  return bin;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<print_variants>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  lea    D30(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  lea    D21(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  lea    D14(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  lea    D6(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  lea    D31(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  lea    D8(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  lea    D30(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  nop
  pop    %rbp
  ret
```

tool_calls: name: read_data
arguments: data_tag: D30
datatype: string
name: read_data
arguments: data_tag: D21
datatype: string
name: read_data
arguments: data_tag: D14
datatype: string
name: read_data
arguments: data_tag: D6
datatype: string
name: read_data
arguments: data_tag: D31
datatype: string
name: read_data
arguments: data_tag: D8
datatype: string

tool: D30: ---============================---


tool: D21: Choose what you want to do, please.


tool: D14: You may do it by inputing wariants:


tool: D6: 'a' allows you to get day of year after input month and day of month.


tool: D31: 'b' may help you to know month and day from day of year.


tool: D8: 'q' - quit from program.


assistant: ```c
void print_variants() {
  printf("---============================---\n");
  printf("Choose what you want to do, please.\n");
  printf("You may do it by inputing wariants:\n");
  printf("'a' allows you to get day of year after input month and day of month.\n");
  printf("'b' may help you to know month and day from day of year.\n");
  printf("'q' - quit from program.\n");
  printf("---============================---\n");
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<print_variants>:
  endbr64
  push   %rbx
  lea    D56(%rip),%rbx
  mov    %rbx,%rdi
  call   <printf@plt>
  lea    D25(%rip),%rdi
  call   <printf@plt>
  lea    D1(%rip),%rdi
  call   <printf@plt>
  lea    D20(%rip),%rdi
  call   <printf@plt>
  lea    D31(%rip),%rdi
  call   <printf@plt>
  lea    D39(%rip),%rdi
  call   <printf@plt>
  mov    %rbx,%rdi
  call   <printf@plt>
  pop    %rbx
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D56
data_type: string
name: retrieve_data
arguments: data_label: D25
data_type: string
name: retrieve_data
arguments: data_label: D1
data_type: string
name: retrieve_data
arguments: data_label: D20
data_type: string
name: retrieve_data
arguments: data_label: D31
data_type: string
name: retrieve_data
arguments: data_label: D39
data_type: string

tool: D56: ---============================---


tool: D25: Choose what you want to do, please.


tool: D1: You may do it by inputing wariants:


tool: D20: 'a' allows you to get day of year after input month and day of month.


tool: D31: 'b' may help you to know month and day from day of year.


tool: D39: 'q' - quit from program.


assistant: ```c
void print_variants() {
  printf("---============================---\n");
  printf("Choose what you want to do, please.\n");
  printf("You may do it by inputing wariants:\n");
  printf("'a' allows you to get day of year after input month and day of month.\n");
  printf("'b' may help you to know month and day from day of year.\n");
  printf("'q' - quit from program.\n");
  printf("---============================---\n");
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<print_variants>:
  endbr64
  push   %rbp
  lea    D19(%rip),%rbp
  mov    %rbp,%rdi
  call   <printf@plt>
  lea    D57(%rip),%rdi
  call   <printf@plt>
  lea    D22(%rip),%rdi
  call   <printf@plt>
  lea    D41(%rip),%rdi
  call   <printf@plt>
  lea    D24(%rip),%rdi
  call   <printf@plt>
  lea    D44(%rip),%rdi
  call   <printf@plt>
  mov    %rbp,%rdi
  pop    %rbp
  jmp    1050 <printf@plt>
```

tool_calls: name: retrieve_data
arguments: data_tag: D19
data_type: string
name: retrieve_data
arguments: data_tag: D57
data_type: string
name: retrieve_data
arguments: data_tag: D22
data_type: string
name: retrieve_data
arguments: data_tag: D41
data_type: string
name: retrieve_data
arguments: data_tag: D24
data_type: string
name: retrieve_data
arguments: data_tag: D44
data_type: string

tool: D19: ---============================---


tool: D57: Choose what you want to do, please.


tool: D22: You may do it by inputing wariants:


tool: D41: 'a' allows you to get day of year after input month and day of month.


tool: D24: 'b' may help you to know month and day from day of year.


tool: D44: 'q' - quit from program.


assistant: ```c
void print_variants() {
  printf("---============================---\n");
  printf("Choose what you want to do, please.\n");
  printf("You may do it by inputing wariants:\n");
  printf("'a' allows you to get day of year after input month and day of month.\n");
  printf("'b' may help you to know month and day from day of year.\n");
  printf("'q' - quit from program.\n");
  printf("---============================---\n");
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<print_variants>:
  endbr64
  push   %rbp
  lea    D29(%rip),%rbp
  mov    %rbp,%rdi
  call   <printf@plt>
  lea    D53(%rip),%rdi
  call   <printf@plt>
  lea    D48(%rip),%rdi
  call   <printf@plt>
  lea    D35(%rip),%rdi
  call   <printf@plt>
  lea    D0(%rip),%rdi
  call   <printf@plt>
  lea    D3(%rip),%rdi
  call   <printf@plt>
  mov    %rbp,%rdi
  pop    %rbp
  jmp    1050 <printf@plt>
```

tool_calls: name: extract_symbolic_data
arguments: tag: D29
data_type: string
name: extract_symbolic_data
arguments: tag: D53
data_type: string
name: extract_symbolic_data
arguments: tag: D48
data_type: string
name: extract_symbolic_data
arguments: tag: D35
data_type: string
name: extract_symbolic_data
arguments: tag: D0
data_type: string
name: extract_symbolic_data
arguments: tag: D3
data_type: string

tool: D29: ---============================---


tool: D53: Choose what you want to do, please.


tool: D48: You may do it by inputing wariants:


tool: D35: 'a' allows you to get day of year after input month and day of month.


tool: D0: 'b' may help you to know month and day from day of year.


tool: D3: 'q' - quit from program.


assistant: ```c
void print_variants() {
  printf("---============================---\n");
  printf("Choose what you want to do, please.\n");
  printf("You may do it by inputing wariants:\n");
  printf("'a' allows you to get day of year after input month and day of month.\n");
  printf("'b' may help you to know month and day from day of year.\n");
  printf("'q' - quit from program.\n");
  printf("---============================---\n");
}
```
user: What is the c source code of the assembly code below:

```asm
<parse_line>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbp
  mov    %rsi,%rbx
  call   <strlen@plt>
  test   %eax,%eax
  jle    L69
  mov    %rbp,%rdx
  lea    -0x1(%rax),%eax
  lea    0x1(%rbp,%rax,1),%rdi
  mov    $0x0,%r10d
  mov    $0x0,%eax
  mov    $0x0,%esi
  mov    $0x1,%r9d
  mov    $0x0,%r11d
  jmp    L103
L150:
  test   %r10d,%r10d
  jne    L68
  movb   $0x0,(%rdx)
  sub    $0x1,%esi
L68:
  mov    %esi,%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
L176:
  movb   $0x0,(%rdx)
  mov    %r11d,%eax
  jmp    L197
L202:
  movb   $0x0,(%rdx)
  mov    %r11d,%eax
  jmp    L197
L7:
  movb   $0x0,(%rdx)
  mov    %r9d,%eax
L197:
  add    $0x1,%rdx
  cmp    %rdi,%rdx
  je     L68
L103:
  test   %eax,%eax
  jne    L204
  movzbl (%rdx),%ecx
  cmp    $0x9,%cl
  je     L197
  cmp    $0x20,%cl
  je     L197
  cmp    $0xa,%cl
  je     L68
  movslq %esi,%rax
  mov    %rdx,(%rbx,%rax,8)
  add    $0x1,%esi
L204:
  movzbl (%rdx),%eax
  cmp    $0x23,%al
  je     L150
  cmp    $0x3d,%al
  je     L176
  cmp    $0x2c,%al
  je     L202
  cmp    $0xa,%al
  je     L7
  cmp    $0x22,%al
  je     L199
  cmp    $0x20,%al
  sete   %r8b
  cmp    $0x9,%al
  sete   %al
  or     %al,%r8b
  je     L96
  test   %r10d,%r10d
  je     L57
L96:
  mov    %r9d,%eax
  jmp    L197
L199:
  xor    $0x1,%r10d
  mov    %r9d,%eax
  jmp    L197
L57:
  movb   $0x0,(%rdx)
  mov    %r11d,%eax
  jmp    L197
L69:
  mov    $0x0,%esi
  jmp    L68
```

assistant: ```c
int parse_line(char *line, char *args[]) {
  int arg_num = 0;
  int is_start = 0;
  int is_quote = 0;
  int length = 0;
  int i = 0;
  arg_num = 0;
  length = strlen(line);
  is_start = 0;
  is_quote = 0;
  for (i = 0; i < length; i++) {
    if (is_start == 0) {
      if (line[i] == ' ') {
        continue;
      } else if (line[i] == '\t') {
        continue;
      } else if (line[i] == '\n') {
        break;
      } else {
        is_start = 1;
        args[arg_num] = &line[i];
        arg_num++;
      }
    }
    if (is_start == 1) {
      if (line[i] == '#') {
        if (is_quote == 0) {
          line[i] = '\0';
          arg_num--;
        }
        break;
      }
      if (line[i] == '=') {
        line[i] = '\0';
        is_start = 0;
        continue;
      }
      if (line[i] == ',') {
        line[i] = '\0';
        is_start = 0;
        continue;
      }
      if ((line[i] == ',') && (is_quote == 0)) {
        line[i] = ' ';
        continue;
      }
    }
    if (line[i] == '\n') {
      line[i] = '\0';
    }
    if (line[i] == '"') {
      is_quote = (is_quote == 1) ? 0 : 1;
      continue;
    }
    if (((line[i] == ' ') || (line[i] == '\t')) && (is_quote == 0)) {
      line[i] = '\0';
      is_start = 0;
      continue;
    }
  }
  return arg_num;
}
```