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

```asm
<ifft4pt>:
  endbr64
  movss  (%rdi),%xmm2
  movss  0x4(%rdi),%xmm1
  movss  0x10(%rdi),%xmm9
  movss  0x14(%rdi),%xmm8
  movss  0x8(%rdi),%xmm6
  movss  0xc(%rdi),%xmm5
  movss  0x18(%rdi),%xmm10
  movss  0x1c(%rdi),%xmm7
  movaps %xmm2,%xmm4
  addss  %xmm9,%xmm4
  movaps %xmm1,%xmm3
  addss  %xmm8,%xmm3
  subss  %xmm9,%xmm2
  subss  %xmm8,%xmm1
  movaps %xmm6,%xmm8
  subss  %xmm10,%xmm8
  movaps %xmm5,%xmm9
  subss  %xmm7,%xmm9
  addss  %xmm10,%xmm6
  addss  %xmm7,%xmm5
  movaps %xmm4,%xmm7
  addss  %xmm6,%xmm7
  mulss  %xmm0,%xmm7
  movss  %xmm7,(%rdi)
  movaps %xmm3,%xmm7
  addss  %xmm5,%xmm7
  mulss  %xmm0,%xmm7
  movss  %xmm7,0x4(%rdi)
  movaps %xmm2,%xmm7
  subss  %xmm9,%xmm7
  mulss  %xmm0,%xmm7
  movss  %xmm7,0x8(%rdi)
  movaps %xmm1,%xmm7
  addss  %xmm8,%xmm7
  mulss  %xmm0,%xmm7
  movss  %xmm7,0xc(%rdi)
  subss  %xmm6,%xmm4
  mulss  %xmm0,%xmm4
  movss  %xmm4,0x10(%rdi)
  subss  %xmm5,%xmm3
  mulss  %xmm0,%xmm3
  movss  %xmm3,0x14(%rdi)
  addss  %xmm9,%xmm2
  mulss  %xmm0,%xmm2
  movss  %xmm2,0x18(%rdi)
  subss  %xmm8,%xmm1
  mulss  %xmm0,%xmm1
  movss  %xmm1,0x1c(%rdi)
  ret
```

assistant: ```c
void ifft4pt(float *ioptr, float scale) {
  float f0r, f0i, f1r, f1i, f2r, f2i, f3r, f3i;
  float t0r, t0i, t1r, t1i;
  f0r = ioptr[0];
  f0i = ioptr[1];
  f1r = ioptr[4];
  f1i = ioptr[5];
  f2r = ioptr[2];
  f2i = ioptr[3];
  f3r = ioptr[6];
  f3i = ioptr[7];
  t0r = f0r + f1r;
  t0i = f0i + f1i;
  f1r = f0r - f1r;
  f1i = f0i - f1i;
  t1r = f2r - f3r;
  t1i = f2i - f3i;
  f2r = f2r + f3r;
  f2i = f2i + f3i;
  f0r = t0r + f2r;
  f0i = t0i + f2i;
  f2r = t0r - f2r;
  f2i = t0i - f2i;
  f3r = f1r + t1i;
  f3i = f1i - t1r;
  f1r = f1r - t1i;
  f1i = f1i + t1r;
  ioptr[0] = scale * f0r;
  ioptr[1] = scale * f0i;
  ioptr[2] = scale * f1r;
  ioptr[3] = scale * f1i;
  ioptr[4] = scale * f2r;
  ioptr[5] = scale * f2i;
  ioptr[6] = scale * f3r;
  ioptr[7] = scale * f3i;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<ifft4pt>:
  endbr64
  movss  (%rdi),%xmm2
  movss  0x10(%rdi),%xmm9
  movss  0x4(%rdi),%xmm1
  movss  0x14(%rdi),%xmm8
  movss  0x8(%rdi),%xmm6
  movss  0x18(%rdi),%xmm10
  movaps %xmm2,%xmm4
  subss  %xmm9,%xmm2
  addss  %xmm9,%xmm4
  movss  0xc(%rdi),%xmm5
  movaps %xmm1,%xmm3
  movss  0x1c(%rdi),%xmm7
  addss  %xmm8,%xmm3
  subss  %xmm8,%xmm1
  movaps %xmm6,%xmm8
  addss  %xmm10,%xmm6
  movaps %xmm5,%xmm9
  addss  %xmm7,%xmm5
  subss  %xmm7,%xmm9
  movaps %xmm4,%xmm7
  subss  %xmm10,%xmm8
  addss  %xmm6,%xmm7
  subss  %xmm6,%xmm4
  mulss  %xmm0,%xmm7
  mulss  %xmm0,%xmm4
  movss  %xmm7,(%rdi)
  movaps %xmm3,%xmm7
  subss  %xmm5,%xmm3
  addss  %xmm5,%xmm7
  movss  %xmm4,0x10(%rdi)
  mulss  %xmm0,%xmm3
  mulss  %xmm0,%xmm7
  movss  %xmm3,0x14(%rdi)
  movss  %xmm7,0x4(%rdi)
  movaps %xmm2,%xmm7
  addss  %xmm9,%xmm2
  subss  %xmm9,%xmm7
  mulss  %xmm0,%xmm2
  mulss  %xmm0,%xmm7
  movss  %xmm2,0x18(%rdi)
  movss  %xmm7,0x8(%rdi)
  movaps %xmm1,%xmm7
  subss  %xmm8,%xmm1
  addss  %xmm8,%xmm7
  mulss  %xmm0,%xmm1
  mulss  %xmm0,%xmm7
  movss  %xmm1,0x1c(%rdi)
  movss  %xmm7,0xc(%rdi)
  ret
```

assistant: ```c
void ifft4pt(float *ioptr, float scale) {
  float f0r, f0i, f1r, f1i, f2r, f2i, f3r, f3i;
  float t0r, t0i, t1r, t1i;
  f0r = ioptr[0];
  f0i = ioptr[1];
  f1r = ioptr[4];
  f1i = ioptr[5];
  f2r = ioptr[2];
  f2i = ioptr[3];
  f3r = ioptr[6];
  f3i = ioptr[7];
  t0r = f0r + f1r;
  t0i = f0i + f1i;
  f1r = f0r - f1r;
  f1i = f0i - f1i;
  t1r = f2r - f3r;
  t1i = f2i - f3i;
  f2r = f2r + f3r;
  f2i = f2i + f3i;
  f0r = t0r + f2r;
  f0i = t0i + f2i;
  f2r = t0r - f2r;
  f2i = t0i - f2i;
  f3r = f1r + t1i;
  f3i = f1i - t1r;
  f1r = f1r - t1i;
  f1i = f1i + t1r;
  ioptr[0] = scale * f0r;
  ioptr[1] = scale * f0i;
  ioptr[2] = scale * f1r;
  ioptr[3] = scale * f1i;
  ioptr[4] = scale * f2r;
  ioptr[5] = scale * f2i;
  ioptr[6] = scale * f3r;
  ioptr[7] = scale * f3i;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<ifft4pt>:
  endbr64
  movss  (%rdi),%xmm1
  movss  0x4(%rdi),%xmm3
  movaps %xmm0,%xmm6
  movss  0x10(%rdi),%xmm10
  movss  0x14(%rdi),%xmm8
  shufps $0x0,%xmm6,%xmm6
  movss  0x8(%rdi),%xmm5
  movss  0xc(%rdi),%xmm4
  movaps %xmm1,%xmm0
  movaps %xmm3,%xmm7
  movss  0x18(%rdi),%xmm9
  movss  0x1c(%rdi),%xmm2
  addss  %xmm10,%xmm0
  addss  %xmm8,%xmm7
  subss  %xmm10,%xmm1
  subss  %xmm8,%xmm3
  movaps %xmm4,%xmm10
  movaps %xmm5,%xmm8
  subss  %xmm2,%xmm10
  addss  %xmm9,%xmm5
  subss  %xmm9,%xmm8
  addss  %xmm2,%xmm4
  movaps %xmm7,%xmm11
  movaps %xmm0,%xmm2
  movaps %xmm1,%xmm9
  movaps %xmm3,%xmm12
  addss  %xmm5,%xmm2
  subss  %xmm10,%xmm9
  addss  %xmm4,%xmm11
  addss  %xmm8,%xmm12
  subss  %xmm5,%xmm0
  subss  %xmm4,%xmm7
  addss  %xmm10,%xmm1
  subss  %xmm8,%xmm3
  unpcklps %xmm12,%xmm9
  unpcklps %xmm11,%xmm2
  unpcklps %xmm7,%xmm0
  movlhps %xmm9,%xmm2
  mulps  %xmm6,%xmm2
  unpcklps %xmm3,%xmm1
  movlhps %xmm1,%xmm0
  mulps  %xmm6,%xmm0
  movups %xmm2,(%rdi)
  movups %xmm0,0x10(%rdi)
  ret
```

assistant: ```c
void ifft4pt(float *ioptr, float scale) {
  float f0r, f0i, f1r, f1i, f2r, f2i, f3r, f3i;
  float t0r, t0i, t1r, t1i;
  f0r = ioptr[0];
  f0i = ioptr[1];
  f1r = ioptr[4];
  f1i = ioptr[5];
  f2r = ioptr[2];
  f2i = ioptr[3];
  f3r = ioptr[6];
  f3i = ioptr[7];
  t0r = f0r + f1r;
  t0i = f0i + f1i;
  f1r = f0r - f1r;
  f1i = f0i - f1i;
  t1r = f2r - f3r;
  t1i = f2i - f3i;
  f2r = f2r + f3r;
  f2i = f2i + f3i;
  f0r = t0r + f2r;
  f0i = t0i + f2i;
  f2r = t0r - f2r;
  f2i = t0i - f2i;
  f3r = f1r + t1i;
  f3i = f1i - t1r;
  f1r = f1r - t1i;
  f1i = f1i + t1r;
  ioptr[0] = scale * f0r;
  ioptr[1] = scale * f0i;
  ioptr[2] = scale * f1r;
  ioptr[3] = scale * f1i;
  ioptr[4] = scale * f2r;
  ioptr[5] = scale * f2i;
  ioptr[6] = scale * f3r;
  ioptr[7] = scale * f3i;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<main>:
  endbr64
  push   %rbx
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  lea    D43(%rip),%rdi
  call   <puts@plt>
  lea    D89(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    0x10(%rsp),%rsi
  lea    D48(%rip),%rbx
  mov    %rbx,%rdi
  call   <scanf@plt>
  lea    D87(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    0x14(%rsp),%rsi
  mov    %rbx,%rdi
  call   <scanf@plt>
  movss  0x14(%rsp),%xmm1
  movss  0x10(%rsp),%xmm0
  call   <berechne_nettopreis@plt>
  movss  0x14(%rsp),%xmm1
  movss  %xmm0,0x8(%rsp)
  call   <berechne_mehrwertsteuer@plt>
  movss  0x8(%rsp),%xmm2
  comiss D41(%rip),%xmm2
  jb     L24
  movss  %xmm0,0xc(%rsp)
  comiss D41(%rip),%xmm0
  jae    L12
L24:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L38
  mov    $0x0,%eax
  add    $0x20,%rsp
  pop    %rbx
  ret
L12:
  pxor   %xmm0,%xmm0
  cvtss2sd 0x10(%rsp),%xmm0
  lea    D21(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  pxor   %xmm0,%xmm0
  cvtss2sd 0x8(%rsp),%xmm0
  lea    D58(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  pxor   %xmm0,%xmm0
  cvtss2sd 0xc(%rsp),%xmm0
  lea    D84(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  jmp    L24
L38:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_label: D43
type: string
name: retrieve_data
arguments: data_label: D89
type: string
name: retrieve_data
arguments: data_label: D48
type: string
name: retrieve_data
arguments: data_label: D87
type: string
name: retrieve_data
arguments: data_label: D41
type: byte[4]
name: retrieve_data
arguments: data_label: D21
type: string
name: retrieve_data
arguments: data_label: D58
type: string
name: retrieve_data
arguments: data_label: D84
type: string

tool: D43: 
Programm zum Berechnen des Mehrwertsteueranteils von Preisen.

tool: D89: 
Eingabe Bruttopreis in Euro:        

tool: D48: %f

tool: D87: Eingabe Mehrwertsteuersatz in %%:    

tool: {"D41": [0x00,0x00,0x00,0x00]}

tool: D21: 
Bruttopreis:            %10.2f Euro

tool: D58: 
Nettopreis:             %10.2f Euro

tool: D84: 
Mehrwertsteueranteil:   %10.2f Euro



assistant: ```c
int main(void) {
  printf("\nProgramm zum Berechnen des Mehrwertsteueranteils"
         " von Preisen.\n");
  printf("\nEingabe Bruttopreis in Euro:        ");
  float bruttopreis;
  scanf("%f", &bruttopreis);
  printf("Eingabe Mehrwertsteuersatz in %%:    ");
  float mwst_satz;
  scanf("%f", &mwst_satz);
  float nettopreis;
  nettopreis = berechne_nettopreis(bruttopreis, mwst_satz);
  float mwst_anteil;
  mwst_anteil = berechne_mehrwertsteuer(nettopreis, mwst_satz);
  if (nettopreis >= 0 && mwst_anteil >= 0) {
    printf("\nBruttopreis:            %10.2f Euro", bruttopreis);
    printf("\nNettopreis:             %10.2f Euro", nettopreis);
    printf("\nMehrwertsteueranteil:   %10.2f Euro\n\n", mwst_anteil);
  }
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<main>:
  endbr64
  push   %rbp
  lea    D30(%rip),%rdi
  lea    D43(%rip),%rbp
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  call   <puts@plt>
  lea    D62(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    0x10(%rsp),%rsi
  mov    %rbp,%rdi
  call   <scanf@plt>
  lea    D57(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    0x14(%rsp),%rsi
  mov    %rbp,%rdi
  call   <scanf@plt>
  movss  0x14(%rsp),%xmm1
  movss  0x10(%rsp),%xmm0
  call   <berechne_nettopreis@plt>
  movss  0x14(%rsp),%xmm1
  movss  %xmm0,0x8(%rsp)
  call   <berechne_mehrwertsteuer@plt>
  movss  0x8(%rsp),%xmm2
  movaps %xmm0,%xmm1
  pxor   %xmm0,%xmm0
  comiss %xmm0,%xmm2
  jb     L6
  comiss %xmm0,%xmm1
  movss  %xmm1,0xc(%rsp)
  jae    L30
L6:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L22
  add    $0x20,%rsp
  xor    %eax,%eax
  pop    %rbp
  ret
L30:
  lea    D21(%rip),%rdi
  pxor   %xmm0,%xmm0
  mov    $0x1,%eax
  cvtss2sd 0x10(%rsp),%xmm0
  call   <printf@plt>
  pxor   %xmm0,%xmm0
  movss  0x8(%rsp),%xmm2
  lea    D42(%rip),%rdi
  mov    $0x1,%eax
  cvtss2sd %xmm2,%xmm0
  call   <printf@plt>
  movss  0xc(%rsp),%xmm1
  pxor   %xmm0,%xmm0
  lea    D55(%rip),%rdi
  mov    $0x1,%eax
  cvtss2sd %xmm1,%xmm0
  call   <printf@plt>
  jmp    L6
L22:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_tag: D30
type: string
name: read_data
arguments: data_tag: D43
type: string
name: read_data
arguments: data_tag: D62
type: string
name: read_data
arguments: data_tag: D57
type: string
name: read_data
arguments: data_tag: D21
type: string
name: read_data
arguments: data_tag: D42
type: string
name: read_data
arguments: data_tag: D55
type: string

tool: D30: 
Programm zum Berechnen des Mehrwertsteueranteils von Preisen.

tool: D43: %f

tool: D62: 
Eingabe Bruttopreis in Euro:        

tool: D57: Eingabe Mehrwertsteuersatz in %%:    

tool: D21: 
Bruttopreis:            %10.2f Euro

tool: D42: 
Nettopreis:             %10.2f Euro

tool: D55: 
Mehrwertsteueranteil:   %10.2f Euro



assistant: ```c
int main(void) {
  printf("\nProgramm zum Berechnen des Mehrwertsteueranteils"
         " von Preisen.\n");
  printf("\nEingabe Bruttopreis in Euro:        ");
  float bruttopreis;
  scanf("%f", &bruttopreis);
  printf("Eingabe Mehrwertsteuersatz in %%:    ");
  float mwst_satz;
  scanf("%f", &mwst_satz);
  float nettopreis;
  nettopreis = berechne_nettopreis(bruttopreis, mwst_satz);
  float mwst_anteil;
  mwst_anteil = berechne_mehrwertsteuer(nettopreis, mwst_satz);
  if (nettopreis >= 0 && mwst_anteil >= 0) {
    printf("\nBruttopreis:            %10.2f Euro", bruttopreis);
    printf("\nNettopreis:             %10.2f Euro", nettopreis);
    printf("\nMehrwertsteueranteil:   %10.2f Euro\n\n", mwst_anteil);
  }
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  push   %rbp
  lea    D36(%rip),%rdi
  lea    D21(%rip),%rbp
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  call   <puts@plt>
  lea    D1(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    0x10(%rsp),%rsi
  mov    %rbp,%rdi
  call   <scanf@plt>
  lea    D15(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    0x14(%rsp),%rsi
  mov    %rbp,%rdi
  call   <scanf@plt>
  movss  0x14(%rsp),%xmm1
  movss  0x10(%rsp),%xmm0
  call   <berechne_nettopreis@plt>
  movss  0x14(%rsp),%xmm1
  movss  %xmm0,0x8(%rsp)
  call   <berechne_mehrwertsteuer@plt>
  movss  0x8(%rsp),%xmm2
  movaps %xmm0,%xmm1
  pxor   %xmm0,%xmm0
  comiss %xmm0,%xmm2
  jb     L25
  comiss %xmm0,%xmm1
  movss  %xmm1,0xc(%rsp)
  jae    L33
L25:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L8
  add    $0x20,%rsp
  xor    %eax,%eax
  pop    %rbp
  ret
L33:
  lea    D66(%rip),%rdi
  pxor   %xmm0,%xmm0
  mov    $0x1,%eax
  cvtss2sd 0x10(%rsp),%xmm0
  call   <printf@plt>
  pxor   %xmm0,%xmm0
  movss  0x8(%rsp),%xmm2
  lea    D22(%rip),%rdi
  mov    $0x1,%eax
  cvtss2sd %xmm2,%xmm0
  call   <printf@plt>
  movss  0xc(%rsp),%xmm1
  pxor   %xmm0,%xmm0
  lea    D28(%rip),%rdi
  mov    $0x1,%eax
  cvtss2sd %xmm1,%xmm0
  call   <printf@plt>
  jmp    L25
L8:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: label: D36
type_guessed: string
name: unpack_data
arguments: label: D21
type_guessed: string
name: unpack_data
arguments: label: D1
type_guessed: string
name: unpack_data
arguments: label: D15
type_guessed: string
name: unpack_data
arguments: label: D66
type_guessed: string
name: unpack_data
arguments: label: D22
type_guessed: string
name: unpack_data
arguments: label: D28
type_guessed: string

tool: D36: 
Programm zum Berechnen des Mehrwertsteueranteils von Preisen.

tool: D21: %f

tool: D1: 
Eingabe Bruttopreis in Euro:        

tool: D15: Eingabe Mehrwertsteuersatz in %%:    

tool: D66: 
Bruttopreis:            %10.2f Euro

tool: D22: 
Nettopreis:             %10.2f Euro

tool: D28: 
Mehrwertsteueranteil:   %10.2f Euro



assistant: ```c
int main(void) {
  printf("\nProgramm zum Berechnen des Mehrwertsteueranteils"
         " von Preisen.\n");
  printf("\nEingabe Bruttopreis in Euro:        ");
  float bruttopreis;
  scanf("%f", &bruttopreis);
  printf("Eingabe Mehrwertsteuersatz in %%:    ");
  float mwst_satz;
  scanf("%f", &mwst_satz);
  float nettopreis;
  nettopreis = berechne_nettopreis(bruttopreis, mwst_satz);
  float mwst_anteil;
  mwst_anteil = berechne_mehrwertsteuer(nettopreis, mwst_satz);
  if (nettopreis >= 0 && mwst_anteil >= 0) {
    printf("\nBruttopreis:            %10.2f Euro", bruttopreis);
    printf("\nNettopreis:             %10.2f Euro", nettopreis);
    printf("\nMehrwertsteueranteil:   %10.2f Euro\n\n", mwst_anteil);
  }
}
```
user: What is the c source code of the assembly code below:

```asm
<waitfdtimed>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %edi,-0x24(%rbp)
  mov    %esi,-0x28(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  cmpl   $0x0,-0x24(%rbp)
  js     L128
  mov    D50(%rip),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x24(%rbp)
  jl     L114
L128:
  mov    D54(%rip),%rax
  mov    (%rax),%rdx
  mov    D11(%rip),%rax
  mov    %rdx,(%rax)
  mov    $0xffffffff,%eax
  jmp    L20
L114:
  lea    -0x14(%rbp),%rax
  mov    %rax,%rdi
  call   <FD_ZERO@plt>
  lea    -0x14(%rbp),%rdx
  mov    -0x24(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <FD_SET@plt>
  lea    -0x10(%rbp),%rdx
  mov    -0x28(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <gettimeout@plt>
  cmp    $0xffffffff,%eax
  jne    L27
  mov    $0xffffffff,%eax
  jmp    L20
L45:
  lea    -0x10(%rbp),%rdx
  mov    -0x28(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <gettimeout@plt>
  cmp    $0xffffffff,%eax
  jne    L95
  mov    $0xffffffff,%eax
  jmp    L20
L95:
  lea    -0x14(%rbp),%rax
  mov    %rax,%rdi
  call   <FD_ZERO@plt>
  lea    -0x14(%rbp),%rdx
  mov    -0x24(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <FD_SET@plt>
L27:
  mov    -0x24(%rbp),%eax
  lea    0x1(%rax),%edi
  lea    -0x10(%rbp),%rdx
  lea    -0x14(%rbp),%rax
  mov    %rdx,%r8
  mov    $0x0,%ecx
  mov    $0x0,%edx
  mov    %rax,%rsi
  call   <select@plt>
  mov    %eax,-0xc(%rbp)
  cmpl   $0xffffffff,-0xc(%rbp)
  jne    L104
  mov    D11(%rip),%rax
  mov    (%rax),%rdx
  mov    D26(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,%rdx
  je     L45
L104:
  cmpl   $0x0,-0xc(%rbp)
  jne    L89
  mov    D56(%rip),%rax
  mov    (%rax),%rdx
  mov    D11(%rip),%rax
  mov    %rdx,(%rax)
  mov    $0xffffffff,%eax
  jmp    L20
L89:
  cmpl   $0xffffffff,-0xc(%rbp)
  jne    L126
  mov    $0xffffffff,%eax
  jmp    L20
L126:
  mov    $0x0,%eax
L20:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L59
  call   <__stack_chk_fail@plt>
L59:
  leave
  ret
```

assistant: ```c
int waitfdtimed(int fd, struct timeval end) {
  fd_set readset;
  int retval;
  struct timeval timeout;
  if ((fd < 0) || (fd >= FD_SETSIZE)) {
    errno = EINVAL;
    return -1;
  }
  FD_ZERO(&readset);
  FD_SET(fd, &readset);
  if (gettimeout(end, &timeout) == -1)
    return -1;
  while (((retval = select(fd + 1, &readset, NULL, NULL, &timeout)) == -1) && (errno == EINTR)) {
    if (gettimeout(end, &timeout) == -1)
      return -1;
    FD_ZERO(&readset);
    FD_SET(fd, &readset);
  }
  if (retval == 0) {
    errno = ETIMEDOUT;
    return -1;
  }
  if (retval == -1)
    return -1;
  return 0;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<waitfdtimed>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  test   %edi,%edi
  js     L85
  mov    %edi,%ebx
  mov    %esi,%ebp
  mov    D12(%rip),%rax
  cmp    %edi,(%rax)
  jle    L85
  mov    %rsp,%r12
  mov    %r12,%rdi
  call   <FD_ZERO@plt>
  mov    %r12,%rsi
  mov    %ebx,%edi
  call   <FD_SET@plt>
  lea    0x4(%rsp),%rsi
  mov    %ebp,%edi
  call   <gettimeout@plt>
  cmp    $0xffffffff,%eax
  je     L88
  lea    0x4(%rsp),%r12
L67:
  mov    %rsp,%rsi
  lea    0x1(%rbx),%edi
  mov    %r12,%r8
  mov    $0x0,%ecx
  mov    $0x0,%edx
  call   <select@plt>
  cmp    $0xffffffff,%eax
  jne    L60
  mov    D30(%rip),%rcx
  mov    D19(%rip),%rdx
  mov    (%rdx),%rdx
  cmp    %rdx,(%rcx)
  jne    L47
  mov    %r12,%rsi
  mov    %ebp,%edi
  call   <gettimeout@plt>
  cmp    $0xffffffff,%eax
  je     L88
  mov    %rsp,%r13
  mov    %r13,%rdi
  call   <FD_ZERO@plt>
  mov    %r13,%rsi
  mov    %ebx,%edi
  call   <FD_SET@plt>
  jmp    L67
L85:
  mov    D46(%rip),%rax
  mov    (%rax),%rdx
  mov    D30(%rip),%rax
  mov    %rdx,(%rax)
  mov    $0xffffffff,%eax
  jmp    L88
L60:
  test   %eax,%eax
  je     L105
L47:
  cmp    $0xffffffff,%eax
  sete   %al
  movzbl %al,%eax
  neg    %eax
L88:
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L11
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L105:
  mov    D22(%rip),%rax
  mov    (%rax),%rdx
  mov    D30(%rip),%rax
  mov    %rdx,(%rax)
  mov    $0xffffffff,%eax
  jmp    L88
L11:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int waitfdtimed(int fd, struct timeval end) {
  fd_set readset;
  int retval;
  struct timeval timeout;
  if ((fd < 0) || (fd >= FD_SETSIZE)) {
    errno = EINVAL;
    return -1;
  }
  FD_ZERO(&readset);
  FD_SET(fd, &readset);
  if (gettimeout(end, &timeout) == -1)
    return -1;
  while (((retval = select(fd + 1, &readset, NULL, NULL, &timeout)) == -1) && (errno == EINTR)) {
    if (gettimeout(end, &timeout) == -1)
      return -1;
    FD_ZERO(&readset);
    FD_SET(fd, &readset);
  }
  if (retval == 0) {
    errno = ETIMEDOUT;
    return -1;
  }
  if (retval == -1)
    return -1;
  return 0;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<waitfdtimed>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  test   %edi,%edi
  js     L96
  mov    D54(%rip),%rax
  mov    %edi,%r12d
  cmp    %edi,(%rax)
  jle    L96
  mov    %rsp,%rbx
  mov    %esi,%r13d
  lea    0x4(%rsp),%rbp
  mov    %rbx,%rdi
  call   <FD_ZERO@plt>
  mov    %rbx,%rsi
  mov    %r12d,%edi
  call   <FD_SET@plt>
  mov    %rbp,%rsi
  mov    %r13d,%edi
  call   <gettimeout@plt>
  cmp    $0xffffffff,%eax
  je     L50
  lea    0x1(%r12),%r14d
  jmp    L60
  nop
L5:
  mov    D41(%rip),%rax
  mov    D44(%rip),%rdx
  mov    (%rax),%rax
  cmp    %rax,(%rdx)
  jne    L50
  mov    %rbp,%rsi
  mov    %r13d,%edi
  call   <gettimeout@plt>
  cmp    $0xffffffff,%eax
  je     L50
  mov    %rbx,%rdi
  call   <FD_ZERO@plt>
  mov    %rbx,%rsi
  mov    %r12d,%edi
  call   <FD_SET@plt>
L60:
  xor    %ecx,%ecx
  xor    %edx,%edx
  mov    %rbp,%r8
  mov    %rbx,%rsi
  mov    %r14d,%edi
  call   <select@plt>
  cmp    $0xffffffff,%eax
  je     L5
  test   %eax,%eax
  je     L103
  xor    %eax,%eax
  jmp    L65
L103:
  mov    D50(%rip),%rax
  mov    (%rax),%rdx
  mov    D44(%rip),%rax
  mov    %rdx,(%rax)
  nopl   0x0(%rax)
L50:
  mov    $0xffffffff,%eax
L65:
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L24
  add    $0x10,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L96:
  mov    D25(%rip),%rax
  mov    (%rax),%rdx
  mov    D44(%rip),%rax
  mov    %rdx,(%rax)
  mov    $0xffffffff,%eax
  jmp    L65
L24:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int waitfdtimed(int fd, struct timeval end) {
  fd_set readset;
  int retval;
  struct timeval timeout;
  if ((fd < 0) || (fd >= FD_SETSIZE)) {
    errno = EINVAL;
    return -1;
  }
  FD_ZERO(&readset);
  FD_SET(fd, &readset);
  if (gettimeout(end, &timeout) == -1)
    return -1;
  while (((retval = select(fd + 1, &readset, NULL, NULL, &timeout)) == -1) && (errno == EINTR)) {
    if (gettimeout(end, &timeout) == -1)
      return -1;
    FD_ZERO(&readset);
    FD_SET(fd, &readset);
  }
  if (retval == 0) {
    errno = ETIMEDOUT;
    return -1;
  }
  if (retval == -1)
    return -1;
  return 0;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<waitfdtimed>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  test   %edi,%edi
  js     L64
  mov    D45(%rip),%rax
  mov    %edi,%r12d
  cmp    %edi,(%rax)
  jle    L64
  mov    %rsp,%rbx
  mov    %esi,%r13d
  lea    0x4(%rsp),%rbp
  mov    %rbx,%rdi
  call   <FD_ZERO@plt>
  mov    %rbx,%rsi
  mov    %r12d,%edi
  call   <FD_SET@plt>
  mov    %rbp,%rsi
  mov    %r13d,%edi
  call   <gettimeout@plt>
  cmp    $0xffffffff,%eax
  je     L103
  lea    0x1(%r12),%r14d
  jmp    L91
  nop
L109:
  mov    D4(%rip),%rax
  mov    D62(%rip),%rdx
  mov    (%rax),%rax
  cmp    %rax,(%rdx)
  jne    L103
  mov    %rbp,%rsi
  mov    %r13d,%edi
  call   <gettimeout@plt>
  cmp    $0xffffffff,%eax
  je     L103
  mov    %rbx,%rdi
  call   <FD_ZERO@plt>
  mov    %rbx,%rsi
  mov    %r12d,%edi
  call   <FD_SET@plt>
L91:
  xor    %ecx,%ecx
  xor    %edx,%edx
  mov    %rbp,%r8
  mov    %rbx,%rsi
  mov    %r14d,%edi
  call   <select@plt>
  cmp    $0xffffffff,%eax
  je     L109
  test   %eax,%eax
  je     L30
  xor    %eax,%eax
  jmp    L80
L30:
  mov    D16(%rip),%rax
  mov    (%rax),%rdx
  mov    D62(%rip),%rax
  mov    %rdx,(%rax)
  nopl   0x0(%rax)
L103:
  mov    $0xffffffff,%eax
L80:
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L11
  add    $0x10,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L64:
  mov    D55(%rip),%rax
  mov    (%rax),%rdx
  mov    D62(%rip),%rax
  mov    %rdx,(%rax)
  mov    $0xffffffff,%eax
  jmp    L80
L11:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int waitfdtimed(int fd, struct timeval end) {
  fd_set readset;
  int retval;
  struct timeval timeout;
  if ((fd < 0) || (fd >= FD_SETSIZE)) {
    errno = EINVAL;
    return -1;
  }
  FD_ZERO(&readset);
  FD_SET(fd, &readset);
  if (gettimeout(end, &timeout) == -1)
    return -1;
  while (((retval = select(fd + 1, &readset, NULL, NULL, &timeout)) == -1) && (errno == EINTR)) {
    if (gettimeout(end, &timeout) == -1)
      return -1;
    FD_ZERO(&readset);
    FD_SET(fd, &readset);
  }
  if (retval == 0) {
    errno = ETIMEDOUT;
    return -1;
  }
  if (retval == -1)
    return -1;
  return 0;
}
```