ylfeng/ReF-Decompile-dataset huggingface dataset:
user: Demonstrate the C code that generates the assembly output below:

```asm
<chiedi_secondo_fattore>:
  endbr64
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    D17(%rip),%rdi
  call   <printf@plt>
  lea    0x4(%rsp),%rsi
  lea    D2(%rip),%rdi
  call   <scanf@plt>
  mov    0x4(%rsp),%eax
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L5
  add    $0x18,%rsp
  ret
L5:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: label: D17
type: string
name: disassemble_data
arguments: label: D2
type: string

tool: D17: Inserisci il secondo fattore
> 

tool: D2: %d

assistant: ```c
int chiedi_secondo_fattore() {
  int y;
  printf("Inserisci il secondo fattore\n> ");
  scanf("%d", &y);
  return y;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<chiedi_secondo_fattore>:
  endbr64
  sub    $0x18,%rsp
  lea    D1(%rip),%rdi
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  call   <printf@plt>
  lea    0x4(%rsp),%rsi
  lea    D5(%rip),%rdi
  call   <scanf@plt>
  mov    0x4(%rsp),%eax
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L2
  add    $0x18,%rsp
  ret
L2:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_tag: D1
data_type: string
name: disassemble_data
arguments: data_tag: D5
data_type: string

tool: D1: Inserisci il secondo fattore
> 

tool: D5: %d

assistant: ```c
int chiedi_secondo_fattore() {
  int y;
  printf("Inserisci il secondo fattore\n> ");
  scanf("%d", &y);
  return y;
}
```
user: Translate the below assembly code into C programming language:

```asm
<chiedi_secondo_fattore>:
  endbr64
  sub    $0x18,%rsp
  lea    D11(%rip),%rdi
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  call   <printf@plt>
  lea    0x4(%rsp),%rsi
  lea    D0(%rip),%rdi
  call   <scanf@plt>
  mov    0x4(%rsp),%eax
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L8
  add    $0x18,%rsp
  ret
L8:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: label: D11
type_infered: string
name: parse_data
arguments: label: D0
type_infered: string

tool: D11: Inserisci il secondo fattore
> 

tool: D0: %d

assistant: ```c
int chiedi_secondo_fattore() {
  int y;
  printf("Inserisci il secondo fattore\n> ");
  scanf("%d", &y);
  return y;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<main>:
  endbr64
  sub    $0x28,%rsp
  lea    D55(%rip),%rdi
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  call   <printf@plt>
  lea    D75(%rip),%rdi
  call   <printf@plt>
  lea    0xc(%rsp),%rcx
  lea    0x8(%rsp),%rdx
  xor    %eax,%eax
  lea    0x4(%rsp),%rsi
  lea    0x10(%rsp),%r8
  lea    D73(%rip),%rdi
  call   <scanf@plt>
  lea    D67(%rip),%rdi
  call   <printf@plt>
  xor    %eax,%eax
  lea    0x14(%rsp),%rsi
  lea    D51(%rip),%rdi
  call   <scanf@plt>
  movss  0x14(%rsp),%xmm0
  movss  0x4(%rsp),%xmm1
  comiss %xmm1,%xmm0
  jae    L68
  movss  0x8(%rsp),%xmm2
  comiss %xmm2,%xmm0
  jb     L25
  comiss %xmm0,%xmm1
  ja     L33
L25:
  movss  0xc(%rsp),%xmm1
  comiss %xmm1,%xmm0
  jae    L14
L118:
  comiss 0x10(%rsp),%xmm0
  jb     L97
  comiss %xmm0,%xmm1
  ja     L6
L97:
  lea    D21(%rip),%rdi
  call   <printf@plt>
L8:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L31
  xor    %eax,%eax
  add    $0x28,%rsp
  ret
L14:
  comiss %xmm0,%xmm2
  jbe    L118
  lea    D90(%rip),%rdi
  call   <printf@plt>
  jmp    L8
L68:
  lea    D54(%rip),%rdi
  call   <printf@plt>
  jmp    L8
L33:
  lea    D16(%rip),%rdi
  call   <printf@plt>
  jmp    L8
L6:
  lea    D60(%rip),%rdi
  call   <printf@plt>
  jmp    L8
L31:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_tag: D55
type_guessed: string
name: retrieve_data
arguments: data_tag: D75
type_guessed: string
name: retrieve_data
arguments: data_tag: D73
type_guessed: string
name: retrieve_data
arguments: data_tag: D67
type_guessed: string
name: retrieve_data
arguments: data_tag: D51
type_guessed: string
name: retrieve_data
arguments: data_tag: D21
type_guessed: string
name: retrieve_data
arguments: data_tag: D90
type_guessed: string
name: retrieve_data
arguments: data_tag: D54
type_guessed: string
name: retrieve_data
arguments: data_tag: D16
type_guessed: string
name: retrieve_data
arguments: data_tag: D60
type_guessed: string

tool: D55: Enter thresholds for A, B, C, D


tool: D75: in that order, decreasing percentages > 

tool: D73: %f %f %f %f

tool: D67: Thank you. Now enter student score (percent) > 

tool: D51: %f

tool: D21: Student has failed the course


tool: D90: Student has an C grade


tool: D54: Student has an A grade


tool: D16: Student has an B grade


tool: D60: Student has an D grade


assistant: ```c
int main() {
  float grade1, grade2, grade3, grade4, score;
  printf("Enter thresholds for A, B, C, D\n");
  printf("in that order, decreasing percentages > ");
  scanf("%f %f %f %f", &grade1, &grade2, &grade3, &grade4);
  printf("Thank you. Now enter student score (percent) > ");
  scanf("%f", &score);
  if (score >= grade1)
    printf("Student has an A grade\n");
  else if (score >= grade2 && score < grade1)
    printf("Student has an B grade\n");
  else if (score >= grade3 && score < grade2)
    printf("Student has an C grade\n");
  else if (score >= grade4 && score < grade3)
    printf("Student has an D grade\n");
  else
    printf("Student has failed the course\n");
  return 0;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<main>:
  endbr64
  sub    $0x28,%rsp
  lea    D78(%rip),%rdi
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  call   <printf@plt>
  lea    D8(%rip),%rdi
  call   <printf@plt>
  lea    0xc(%rsp),%rcx
  lea    0x8(%rsp),%rdx
  xor    %eax,%eax
  lea    0x4(%rsp),%rsi
  lea    0x10(%rsp),%r8
  lea    D13(%rip),%rdi
  call   <scanf@plt>
  lea    D91(%rip),%rdi
  call   <printf@plt>
  xor    %eax,%eax
  lea    0x14(%rsp),%rsi
  lea    D86(%rip),%rdi
  call   <scanf@plt>
  movss  0x14(%rsp),%xmm0
  movss  0x4(%rsp),%xmm1
  comiss %xmm1,%xmm0
  jae    L62
  movss  0x8(%rsp),%xmm2
  comiss %xmm2,%xmm0
  jb     L95
  comiss %xmm0,%xmm1
  ja     L45
L95:
  movss  0xc(%rsp),%xmm1
  comiss %xmm1,%xmm0
  jae    L0
L22:
  comiss 0x10(%rsp),%xmm0
  jb     L56
  comiss %xmm0,%xmm1
  ja     L103
L56:
  lea    D77(%rip),%rdi
  call   <printf@plt>
L82:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L35
  xor    %eax,%eax
  add    $0x28,%rsp
  ret
L0:
  comiss %xmm0,%xmm2
  jbe    L22
  lea    D29(%rip),%rdi
  call   <printf@plt>
  jmp    L82
L62:
  lea    D46(%rip),%rdi
  call   <printf@plt>
  jmp    L82
L45:
  lea    D39(%rip),%rdi
  call   <printf@plt>
  jmp    L82
L103:
  lea    D42(%rip),%rdi
  call   <printf@plt>
  jmp    L82
L35:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_tag: D78
datatype: string
name: parse_data
arguments: data_tag: D8
datatype: string
name: parse_data
arguments: data_tag: D13
datatype: string
name: parse_data
arguments: data_tag: D91
datatype: string
name: parse_data
arguments: data_tag: D86
datatype: string
name: parse_data
arguments: data_tag: D77
datatype: string
name: parse_data
arguments: data_tag: D29
datatype: string
name: parse_data
arguments: data_tag: D46
datatype: string
name: parse_data
arguments: data_tag: D39
datatype: string
name: parse_data
arguments: data_tag: D42
datatype: string

tool: D78: Enter thresholds for A, B, C, D


tool: D8: in that order, decreasing percentages > 

tool: D13: %f %f %f %f

tool: D91: Thank you. Now enter student score (percent) > 

tool: D86: %f

tool: D77: Student has failed the course


tool: D29: Student has an C grade


tool: D46: Student has an A grade


tool: D39: Student has an B grade


tool: D42: Student has an D grade


assistant: ```c
int main() {
  float grade1, grade2, grade3, grade4, score;
  printf("Enter thresholds for A, B, C, D\n");
  printf("in that order, decreasing percentages > ");
  scanf("%f %f %f %f", &grade1, &grade2, &grade3, &grade4);
  printf("Thank you. Now enter student score (percent) > ");
  scanf("%f", &score);
  if (score >= grade1)
    printf("Student has an A grade\n");
  else if (score >= grade2 && score < grade1)
    printf("Student has an B grade\n");
  else if (score >= grade3 && score < grade2)
    printf("Student has an C grade\n");
  else if (score >= grade4 && score < grade3)
    printf("Student has an D grade\n");
  else
    printf("Student has failed the course\n");
  return 0;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<errorExit3>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %edi,-0x4(%rbp)
  mov    %rsi,-0x10(%rbp)
  cmpl   $0x4,-0x4(%rbp)
  je     L72
  cmpl   $0x4,-0x4(%rbp)
  jg     L32
  cmpl   $0x3,-0x4(%rbp)
  je     L69
  cmpl   $0x3,-0x4(%rbp)
  jg     L32
  cmpl   $0x1,-0x4(%rbp)
  je     L33
  cmpl   $0x2,-0x4(%rbp)
  je     L42
  jmp    L32
L33:
  lea    D34(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  jmp    L32
L42:
  lea    D35(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  jmp    L32
L69:
  lea    D42(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  jmp    L32
L72:
  lea    D8(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  nop
L32:
  mov    -0x10(%rbp),%rax
  mov    %rax,%rsi
  lea    D33(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  nop
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: data_tag: D34
datatype: string
name: retrieve_data
arguments: data_tag: D35
datatype: string
name: retrieve_data
arguments: data_tag: D42
datatype: string
name: retrieve_data
arguments: data_tag: D8
datatype: string
name: retrieve_data
arguments: data_tag: D33
datatype: string

tool: D34: 
Out  of  memory!

tool: D35: 
Critical  error  in  program!

tool: D42: 
Error  in  function  of  user!

tool: D8: 
Tempoparal  error!

tool: D33: 


%s


assistant: ```c
void errorExit3(int group, char *number) {
  switch (group) {
  case 1:
    printf("\nOut  of  memory!\n");
    break;
  case 2:
    printf("\nCritical  error  in  program!\n");
    break;
  case 3:
    printf("\nError  in  function  of  user!\n");
    break;
  case 4:
    printf("\nTempoparal  error!\n");
    break;
  }
  printf("\n\n\n%s\n", number);
  exit(1);
  return;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<errorExit3>:
  endbr64
  push   %rbx
  mov    %rsi,%rbx
  cmp    $0x3,%edi
  je     L7
  jg     L26
  cmp    $0x1,%edi
  je     L12
  cmp    $0x2,%edi
  jne    L15
  lea    D36(%rip),%rdi
  call   <puts@plt>
  jmp    L15
L26:
  cmp    $0x4,%edi
  jne    L15
  lea    D16(%rip),%rdi
  call   <puts@plt>
  jmp    L15
L12:
  lea    D13(%rip),%rdi
  call   <puts@plt>
L15:
  mov    %rbx,%rsi
  lea    D32(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  pop    %rbx
  ret
L7:
  lea    D42(%rip),%rdi
  call   <puts@plt>
  jmp    L15
```

tool_calls: name: read_data
arguments: tag: D36
datatype: string
name: read_data
arguments: tag: D16
datatype: string
name: read_data
arguments: tag: D13
datatype: string
name: read_data
arguments: tag: D32
datatype: string
name: read_data
arguments: tag: D42
datatype: string

tool: D36: 
Critical  error  in  program!

tool: D16: 
Tempoparal  error!

tool: D13: 
Out  of  memory!

tool: D32: 


%s


tool: D42: 
Error  in  function  of  user!

assistant: ```c
void errorExit3(int group, char *number) {
  switch (group) {
  case 1:
    printf("\nOut  of  memory!\n");
    break;
  case 2:
    printf("\nCritical  error  in  program!\n");
    break;
  case 3:
    printf("\nError  in  function  of  user!\n");
    break;
  case 4:
    printf("\nTempoparal  error!\n");
    break;
  }
  printf("\n\n\n%s\n", number);
  exit(1);
  return;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<errorExit3>:
  endbr64
  push   %rbp
  mov    %rsi,%rbp
  cmp    $0x3,%edi
  je     L47
  jg     L57
  cmp    $0x1,%edi
  je     L10
  cmp    $0x2,%edi
  jne    L18
  lea    D48(%rip),%rdi
  call   <puts@plt>
L18:
  mov    %rbp,%rsi
  lea    D1(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0x1,%edi
  pop    %rbp
  jmp    1090 <exit@plt>
  nopl   0x0(%rax)
L57:
  cmp    $0x4,%edi
  jne    L18
  lea    D10(%rip),%rdi
  call   <puts@plt>
  jmp    L18
  nopl   0x0(%rax,%rax,1)
L47:
  lea    D18(%rip),%rdi
  call   <puts@plt>
  jmp    L18
  xchg   %ax,%ax
L10:
  lea    D49(%rip),%rdi
  call   <puts@plt>
  jmp    L18
```

tool_calls: name: retrieve_data
arguments: label: D48
type_guessed: string
name: retrieve_data
arguments: label: D1
type_guessed: string
name: retrieve_data
arguments: label: D10
type_guessed: string
name: retrieve_data
arguments: label: D18
type_guessed: string
name: retrieve_data
arguments: label: D49
type_guessed: string

tool: D48: 
Critical  error  in  program!

tool: D1: 


%s


tool: D10: 
Tempoparal  error!

tool: D18: 
Error  in  function  of  user!

tool: D49: 
Out  of  memory!

assistant: ```c
void errorExit3(int group, char *number) {
  switch (group) {
  case 1:
    printf("\nOut  of  memory!\n");
    break;
  case 2:
    printf("\nCritical  error  in  program!\n");
    break;
  case 3:
    printf("\nError  in  function  of  user!\n");
    break;
  case 4:
    printf("\nTempoparal  error!\n");
    break;
  }
  printf("\n\n\n%s\n", number);
  exit(1);
  return;
}
```
user: Translate the below assembly code into C programming language:

```asm
<errorExit3>:
  endbr64
  push   %rbp
  mov    %rsi,%rbp
  cmp    $0x3,%edi
  je     L36
  jg     L12
  cmp    $0x1,%edi
  je     L51
  cmp    $0x2,%edi
  jne    L68
  lea    D45(%rip),%rdi
  call   <puts@plt>
L68:
  mov    %rbp,%rsi
  lea    D25(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0x1,%edi
  pop    %rbp
  jmp    1090 <exit@plt>
  nopl   0x0(%rax)
L12:
  cmp    $0x4,%edi
  jne    L68
  lea    D30(%rip),%rdi
  call   <puts@plt>
  jmp    L68
  nopl   0x0(%rax,%rax,1)
L36:
  lea    D1(%rip),%rdi
  call   <puts@plt>
  jmp    L68
  xchg   %ax,%ax
L51:
  lea    D44(%rip),%rdi
  call   <puts@plt>
  jmp    L68
```

tool_calls: name: parse_data
arguments: label: D45
datatype: string
name: parse_data
arguments: label: D25
datatype: string
name: parse_data
arguments: label: D30
datatype: string
name: parse_data
arguments: label: D1
datatype: string
name: parse_data
arguments: label: D44
datatype: string

tool: D45: 
Critical  error  in  program!

tool: D25: 


%s


tool: D30: 
Tempoparal  error!

tool: D1: 
Error  in  function  of  user!

tool: D44: 
Out  of  memory!

assistant: ```c
void errorExit3(int group, char *number) {
  switch (group) {
  case 1:
    printf("\nOut  of  memory!\n");
    break;
  case 2:
    printf("\nCritical  error  in  program!\n");
    break;
  case 3:
    printf("\nError  in  function  of  user!\n");
    break;
  case 4:
    printf("\nTempoparal  error!\n");
    break;
  }
  printf("\n\n\n%s\n", number);
  exit(1);
  return;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<sleep_us>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  imul   $0x431bde83,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x12,%edx
  sar    $0x1f,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x14(%rbp),%edx
  movslq %edx,%rax
  imul   $0x431bde83,%rax,%rax
  shr    $0x20,%rax
  sar    $0x12,%eax
  mov    %edx,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%eax
  imul   $0xf4240,%eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    %eax,-0xc(%rbp)
  lea    -0x10(%rbp),%rax
  mov    %rax,%r8
  mov    $0x0,%ecx
  mov    $0x0,%edx
  mov    $0x0,%esi
  mov    $0x0,%edi
  call   <select@plt>
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L8
  call   <__stack_chk_fail@plt>
L8:
  leave
  ret
```

assistant: ```c
int sleep_us(int us) {
  struct timeval val;
  val.tv_sec = us / 1000000;
  val.tv_usec = us % 1000000;
  return select(0, NULL, NULL, NULL, &val);
}
```
user: What is the c source code of the assembly code below?

```asm
<sleep_us>:
  endbr64
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  movslq %edi,%rax
  imul   $0x431bde83,%rax,%rax
  sar    $0x32,%rax
  mov    %edi,%edx
  sar    $0x1f,%edx
  sub    %edx,%eax
  mov    %eax,(%rsp)
  imul   $0xf4240,%eax,%eax
  sub    %eax,%edi
  mov    %edi,0x4(%rsp)
  mov    %rsp,%r8
  mov    $0x0,%ecx
  mov    $0x0,%edx
  mov    $0x0,%esi
  mov    $0x0,%edi
  call   <select@plt>
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L7
  add    $0x18,%rsp
  ret
L7:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int sleep_us(int us) {
  struct timeval val;
  val.tv_sec = us / 1000000;
  val.tv_usec = us % 1000000;
  return select(0, NULL, NULL, NULL, &val);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<sleep_us>:
  endbr64
  sub    $0x18,%rsp
  mov    %edi,%edx
  xor    %ecx,%ecx
  xor    %esi,%esi
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  movslq %edi,%rax
  sar    $0x1f,%edx
  mov    %rsp,%r8
  imul   $0x431bde83,%rax,%rax
  sar    $0x32,%rax
  sub    %edx,%eax
  xor    %edx,%edx
  mov    %eax,(%rsp)
  imul   $0xf4240,%eax,%eax
  sub    %eax,%edi
  mov    %edi,0x4(%rsp)
  xor    %edi,%edi
  call   <select@plt>
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L6
  add    $0x18,%rsp
  ret
L6:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int sleep_us(int us) {
  struct timeval val;
  val.tv_sec = us / 1000000;
  val.tv_usec = us % 1000000;
  return select(0, NULL, NULL, NULL, &val);
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<sleep_us>:
  endbr64
  sub    $0x18,%rsp
  mov    %edi,%edx
  xor    %ecx,%ecx
  xor    %esi,%esi
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  movslq %edi,%rax
  sar    $0x1f,%edx
  mov    %rsp,%r8
  imul   $0x431bde83,%rax,%rax
  sar    $0x32,%rax
  sub    %edx,%eax
  imul   $0xf4240,%eax,%edx
  movd   %eax,%xmm0
  sub    %edx,%edi
  xor    %edx,%edx
  movd   %edi,%xmm1
  xor    %edi,%edi
  punpckldq %xmm1,%xmm0
  movq   %xmm0,(%rsp)
  call   <select@plt>
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L1
  add    $0x18,%rsp
  ret
L1:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int sleep_us(int us) {
  struct timeval val;
  val.tv_sec = us / 1000000;
  val.tv_usec = us % 1000000;
  return select(0, NULL, NULL, NULL, &val);
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<vstr>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xe0,%rsp
  mov    %rdi,-0xd8(%rbp)
  mov    %rsi,-0xa8(%rbp)
  mov    %rdx,-0xa0(%rbp)
  mov    %rcx,-0x98(%rbp)
  mov    %r8,-0x90(%rbp)
  mov    %r9,-0x88(%rbp)
  test   %al,%al
  je     L62
  movaps %xmm0,-0x80(%rbp)
  movaps %xmm1,-0x70(%rbp)
  movaps %xmm2,-0x60(%rbp)
  movaps %xmm3,-0x50(%rbp)
  movaps %xmm4,-0x40(%rbp)
  movaps %xmm5,-0x30(%rbp)
  movaps %xmm6,-0x20(%rbp)
  movaps %xmm7,-0x10(%rbp)
L62:
  movl   $0x80,-0xc4(%rbp)
  mov    -0xc4(%rbp),%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0xb8(%rbp)
  cmpq   $0x0,-0xb8(%rbp)
  jne    L29
  mov    $0x0,%eax
  jmp    L13
L29:
  mov    -0xd8(%rbp),%rdx
  mov    -0xc0(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <va_start@plt>
  mov    -0xc0(%rbp),%ecx
  mov    -0xd8(%rbp),%rdx
  mov    -0xc4(%rbp),%esi
  mov    -0xb8(%rbp),%rax
  mov    %rax,%rdi
  call   <vsnprintf@plt>
  mov    %eax,-0xbc(%rbp)
  mov    -0xc0(%rbp),%eax
  mov    %eax,%edi
  call   <va_end@plt>
  cmpl   $0x0,-0xbc(%rbp)
  js     L81
  mov    -0xbc(%rbp),%eax
  cmp    -0xc4(%rbp),%eax
  jge    L81
  mov    -0xb8(%rbp),%rax
  jmp    L13
L81:
  cmpl   $0x0,-0xbc(%rbp)
  js     L6
  mov    -0xbc(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0xc4(%rbp)
  jmp    L49
L6:
  shll   -0xc4(%rbp)
L49:
  mov    -0xc4(%rbp),%edx
  mov    -0xb8(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <realloc@plt>
  mov    %rax,-0xb8(%rbp)
  cmpq   $0x0,-0xb8(%rbp)
  jne    L29
  mov    $0x0,%eax
L13:
  leave
  ret
```

assistant: ```c
char *vstr(char *fmt, ...) {
  int n, size = 128;
  char *str;
  va_list ap;
  if ((str = malloc(size)) == NULL) {
    return NULL;
  }
  while (1) {
    va_start(ap, fmt);
    n = vsnprintf(str, size, fmt, ap);
    va_end(ap);
    if (n > -1 && n < size) {
      return str;
    }
    if (n > -1) {
      size = n + 1;
    } else {
      size *= 2;
    }
    if ((str = realloc(str, size)) == NULL) {
      return NULL;
    }
  }
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<vstr>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%r14
  mov    $0x80,%edi
  call   <malloc@plt>
  mov    %rax,%r13
  test   %rax,%rax
  je     L42
  mov    $0x80,%r12d
  jmp    L13
L35:
  lea    0x1(%rbx),%eax
  add    %r12d,%r12d
  test   %ebx,%ebx
  cmovns %eax,%r12d
  mov    %r12d,%esi
  mov    %r13,%rdi
  call   <realloc@plt>
  mov    %rax,%r13
  test   %rax,%rax
  je     L42
L13:
  mov    %r14,%rsi
  mov    $0x0,%ebp
  mov    %ebp,%edi
  call   <va_start@plt>
  mov    %ebp,%ecx
  mov    %r14,%rdx
  mov    %r12d,%esi
  mov    %r13,%rdi
  call   <vsnprintf@plt>
  mov    %eax,%ebx
  mov    %ebp,%edi
  call   <va_end@plt>
  test   %ebx,%ebx
  js     L35
  cmp    %ebx,%r12d
  jle    L35
L42:
  mov    %r13,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

assistant: ```c
char *vstr(char *fmt, ...) {
  int n, size = 128;
  char *str;
  va_list ap;
  if ((str = malloc(size)) == NULL) {
    return NULL;
  }
  while (1) {
    va_start(ap, fmt);
    n = vsnprintf(str, size, fmt, ap);
    va_end(ap);
    if (n > -1 && n < size) {
      return str;
    }
    if (n > -1) {
      size = n + 1;
    } else {
      size *= 2;
    }
    if ((str = realloc(str, size)) == NULL) {
      return NULL;
    }
  }
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<vstr>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  mov    %rdi,%r12
  mov    $0x80,%edi
  push   %rbp
  push   %rbx
  call   <malloc@plt>
  test   %rax,%rax
  je     L26
  mov    %rax,%rbp
  mov    $0x80,%ebx
  jmp    L1
  nopl   0x0(%rax,%rax,1)
L25:
  lea    0x1(%r13),%eax
  add    %ebx,%ebx
  test   %r13d,%r13d
  mov    %rbp,%rdi
  cmovns %eax,%ebx
  mov    %ebx,%esi
  call   <realloc@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L26
L1:
  xor    %r14d,%r14d
  mov    %r12,%rsi
  mov    %r14d,%edi
  call   <va_start@plt>
  mov    %rbp,%rdi
  mov    %r14d,%ecx
  mov    %r12,%rdx
  mov    %ebx,%esi
  call   <vsnprintf@plt>
  mov    %r14d,%edi
  mov    %eax,%r13d
  call   <va_end@plt>
  cmp    %ebx,%r13d
  jae    L25
  pop    %rbx
  mov    %rbp,%rax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax,%rax,1)
L26:
  xor    %ebp,%ebp
  pop    %rbx
  mov    %rbp,%rax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

assistant: ```c
char *vstr(char *fmt, ...) {
  int n, size = 128;
  char *str;
  va_list ap;
  if ((str = malloc(size)) == NULL) {
    return NULL;
  }
  while (1) {
    va_start(ap, fmt);
    n = vsnprintf(str, size, fmt, ap);
    va_end(ap);
    if (n > -1 && n < size) {
      return str;
    }
    if (n > -1) {
      size = n + 1;
    } else {
      size *= 2;
    }
    if ((str = realloc(str, size)) == NULL) {
      return NULL;
    }
  }
}
```