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

```asm
<random_bits>:
  endbr64
  push   %r15
  mov    %esi,%ecx
  push   %r14
  lea    0x7(%rsi),%r14d
  push   %r13
  mov    %rdi,%r13
  push   %r12
  push   %rbp
  mov    %edx,%ebp
  push   %rbx
  mov    %esi,%ebx
  sub    $0x8,%rsp
  and    $0x7,%ecx
  jne    L47
L7:
  test   %r14d,%r14d
  lea    0xe(%rbx),%eax
  cmovns %r14d,%eax
  sar    $0x3,%eax
  add    %ebp,%ebx
  lea    0x7(%rbx),%r12d
  cmovns %ebx,%r12d
  sar    $0x3,%r12d
  cmp    %r12d,%eax
  jge    L4
  movslq %eax,%rdx
  lea    0x1(%r13,%rdx,1),%rbp
  lea    0x0(%r13,%rdx,1),%r14
  lea    -0x1(%r12),%edx
  sub    %eax,%edx
  add    %rdx,%rbp
  nop
L3:
  xor    %eax,%eax
  add    $0x1,%r14
  call   <random@plt>
  movslq %eax,%rdx
  mov    %eax,%ecx
  imul   $0xffffffff80808081,%rdx,%rdx
  sar    $0x1f,%ecx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0x7,%edx
  sub    %ecx,%edx
  mov    %edx,%ecx
  shl    $0x8,%ecx
  sub    %edx,%ecx
  sub    %ecx,%eax
  mov    %al,-0x1(%r14)
  cmp    %rbp,%r14
  jne    L3
L4:
  and    $0x7,%ebx
  jne    L12
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L47:
  mov    $0xff,%r15d
  mov    %esi,%r12d
  sar    %cl,%r15d
  test   %esi,%esi
  cmovs  %r14d,%r12d
  mov    %r15d,%eax
  not    %eax
  sar    $0x3,%r12d
  movslq %r12d,%r12
  add    %rdi,%r12
  and    %al,(%r12)
  xor    %eax,%eax
  call   <random@plt>
  and    %eax,%r15d
  or     %r15b,(%r12)
  jmp    L7
  nopl   0x0(%rax,%rax,1)
L12:
  movslq %r12d,%r12
  mov    %ebx,%ecx
  mov    $0xff,%eax
  add    %r12,%r13
  sar    %cl,%eax
  and    %al,0x0(%r13)
  mov    %eax,%ebx
  xor    %eax,%eax
  not    %ebx
  call   <random@plt>
  and    %eax,%ebx
  or     %bl,0x0(%r13)
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void random_bits(unsigned char *buf, int first, int len) {
  int i;
  if (first % 8 != 0) {
    unsigned char mask = (0xFF >> (first % 8)) ^ 0xFF;
    buf[first / 8] &= mask;
    buf[first / 8] |= random() & (0xFF ^ mask);
  }
  for (i = (first + 7) / 8; i < (first + len) / 8; i++)
    buf[i] = random() % 0xFF;
  if ((first + len) % 8 != 0) {
    unsigned char mask = 0xFF >> ((first + len) % 8);
    buf[(first + len) / 8] &= mask;
    buf[(first + len) / 8] |= random() & (0xFF ^ mask);
  }
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<random_bits>:
  endbr64
  push   %r15
  mov    %esi,%ecx
  push   %r14
  lea    0x7(%rsi),%r14d
  push   %r13
  mov    %rdi,%r13
  push   %r12
  push   %rbp
  mov    %edx,%ebp
  push   %rbx
  mov    %esi,%ebx
  sub    $0x8,%rsp
  and    $0x7,%ecx
  jne    L21
L29:
  test   %r14d,%r14d
  lea    0xe(%rbx),%eax
  cmovns %r14d,%eax
  sar    $0x3,%eax
  add    %ebp,%ebx
  lea    0x7(%rbx),%r12d
  cmovns %ebx,%r12d
  sar    $0x3,%r12d
  cmp    %r12d,%eax
  jge    L47
  movslq %eax,%rdx
  lea    0x1(%r13,%rdx,1),%rbp
  lea    0x0(%r13,%rdx,1),%r14
  lea    -0x1(%r12),%edx
  sub    %eax,%edx
  add    %rdx,%rbp
  nop
L8:
  xor    %eax,%eax
  add    $0x1,%r14
  call   <random@plt>
  movslq %eax,%rdx
  mov    %eax,%ecx
  imul   $0xffffffff80808081,%rdx,%rdx
  sar    $0x1f,%ecx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0x7,%edx
  sub    %ecx,%edx
  mov    %edx,%ecx
  shl    $0x8,%ecx
  sub    %edx,%ecx
  sub    %ecx,%eax
  mov    %al,-0x1(%r14)
  cmp    %rbp,%r14
  jne    L8
L47:
  and    $0x7,%ebx
  jne    L7
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L21:
  mov    $0xff,%r15d
  mov    %esi,%r12d
  sar    %cl,%r15d
  test   %esi,%esi
  cmovs  %r14d,%r12d
  mov    %r15d,%eax
  not    %eax
  sar    $0x3,%r12d
  movslq %r12d,%r12
  add    %rdi,%r12
  and    %al,(%r12)
  xor    %eax,%eax
  call   <random@plt>
  and    %eax,%r15d
  or     %r15b,(%r12)
  jmp    L29
  nopl   0x0(%rax,%rax,1)
L7:
  movslq %r12d,%r12
  mov    %ebx,%ecx
  mov    $0xff,%eax
  add    %r12,%r13
  sar    %cl,%eax
  and    %al,0x0(%r13)
  mov    %eax,%ebx
  xor    %eax,%eax
  not    %ebx
  call   <random@plt>
  and    %eax,%ebx
  or     %bl,0x0(%r13)
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void random_bits(unsigned char *buf, int first, int len) {
  int i;
  if (first % 8 != 0) {
    unsigned char mask = (0xFF >> (first % 8)) ^ 0xFF;
    buf[first / 8] &= mask;
    buf[first / 8] |= random() & (0xFF ^ mask);
  }
  for (i = (first + 7) / 8; i < (first + len) / 8; i++)
    buf[i] = random() % 0xFF;
  if ((first + len) % 8 != 0) {
    unsigned char mask = 0xFF >> ((first + len) % 8);
    buf[(first + len) / 8] &= mask;
    buf[(first + len) / 8] |= random() & (0xFF ^ mask);
  }
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<exec_and_redirect_output>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x40,%rsp
  mov    %rdi,-0x2038(%rbp)
  mov    %rsi,-0x2040(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movq   $0x0,-0x2020(%rbp)
  movq   $0x0,-0x2030(%rbp)
  movq   $0x0,-0x2018(%rbp)
  mov    -0x2038(%rbp),%rax
  lea    D6(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <popen@plt>
  mov    %rax,-0x2018(%rbp)
  cmpq   $0x0,-0x2018(%rbp)
  jne    L34
  mov    $0x0,%eax
  jmp    L45
L34:
  movq   $0x0,-0x2028(%rbp)
  jmp    L61
L31:
  mov    -0x2018(%rbp),%rdx
  lea    -0x2010(%rbp),%rax
  mov    %rdx,%rcx
  mov    $0x2000,%edx
  mov    $0x1,%esi
  mov    %rax,%rdi
  call   <fread@plt>
  mov    %rax,-0x2020(%rbp)
  cmpq   $0x0,-0x2020(%rbp)
  je     L27
  mov    -0x2040(%rbp),%rdx
  mov    -0x2020(%rbp),%rsi
  lea    -0x2010(%rbp),%rax
  mov    %rdx,%rcx
  mov    $0x1,%edx
  mov    %rax,%rdi
  call   <fwrite@plt>
  add    %rax,-0x2030(%rbp)
  mov    -0x2020(%rbp),%rax
  add    %rax,-0x2028(%rbp)
L61:
  mov    -0x2018(%rbp),%rax
  mov    %rax,%rdi
  call   <feof@plt>
  test   %eax,%eax
  je     L31
  jmp    L7
L27:
  nop
L7:
  mov    -0x2018(%rbp),%rax
  mov    %rax,%rdi
  call   <pclose@plt>
  mov    -0x2030(%rbp),%rax
L45:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L49
  call   <__stack_chk_fail@plt>
L49:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: label: D6
type: string

tool: D6: r

assistant: ```c
size_t exec_and_redirect_output(char *command, FILE *output) {
  size_t r = 0, w = 0;
  FILE *pipe = NULL;
  if (!(pipe = popen(command, "r"))) {
    return 0;
  }
  size_t read = 0;
  char r_b[0x2000];
  while (!feof(pipe)) {
    if ((r = fread(r_b, 1, 0x2000, pipe)) <= 0) {
      break;
    }
    w += fwrite(r_b, r, 1, output);
    read += r;
  }
  pclose(pipe);
  return w;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<exec_and_redirect_output>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x18,%rsp
  mov    %rsi,%r13
  mov    %fs:0x28,%rax
  mov    %rax,0x2008(%rsp)
  xor    %eax,%eax
  lea    D4(%rip),%rsi
  call   <popen@plt>
  test   %rax,%rax
  je     L24
  mov    %rax,%rbx
  mov    $0x0,%ebp
  mov    %rsp,%r12
L39:
  mov    %rbx,%rdi
  call   <feof@plt>
  test   %eax,%eax
  jne    L41
  mov    %rbx,%rcx
  mov    $0x2000,%edx
  mov    $0x1,%esi
  mov    %r12,%rdi
  call   <fread@plt>
  mov    %rax,%rsi
  test   %rax,%rax
  je     L41
  mov    %r13,%rcx
  mov    $0x1,%edx
  mov    %r12,%rdi
  call   <fwrite@plt>
  add    %rax,%rbp
  jmp    L39
L41:
  mov    %rbx,%rdi
  call   <pclose@plt>
L38:
  mov    0x2008(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L11
  mov    %rbp,%rax
  add    $0x2018,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L24:
  mov    $0x0,%ebp
  jmp    L38
L11:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_tag: D4
type_infered: string

tool: D4: r

assistant: ```c
size_t exec_and_redirect_output(char *command, FILE *output) {
  size_t r = 0, w = 0;
  FILE *pipe = NULL;
  if (!(pipe = popen(command, "r"))) {
    return 0;
  }
  size_t read = 0;
  char r_b[0x2000];
  while (!feof(pipe)) {
    if ((r = fread(r_b, 1, 0x2000, pipe)) <= 0) {
      break;
    }
    w += fwrite(r_b, r, 1, output);
    read += r;
  }
  pclose(pipe);
  return w;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<exec_and_redirect_output>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x2008(%rsp)
  xor    %eax,%eax
  mov    %rsi,%r13
  lea    D7(%rip),%rsi
  call   <popen@plt>
  test   %rax,%rax
  je     L6
  mov    %rax,%rbp
  xor    %r12d,%r12d
  mov    %rsp,%rbx
  jmp    L54
  nopl   0x0(%rax)
L37:
  mov    $0x1,%esi
  mov    %rbp,%rcx
  mov    $0x2000,%edx
  mov    %rbx,%rdi
  call   <fread@plt>
  mov    %rax,%rsi
  test   %rax,%rax
  je     L17
  mov    %r13,%rcx
  mov    $0x1,%edx
  mov    %rbx,%rdi
  call   <fwrite@plt>
  add    %rax,%r12
L54:
  mov    %rbp,%rdi
  call   <feof@plt>
  test   %eax,%eax
  je     L37
L17:
  mov    %rbp,%rdi
  call   <pclose@plt>
L39:
  mov    0x2008(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L58
  add    $0x2018,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax,%rax,1)
L6:
  xor    %r12d,%r12d
  jmp    L39
L58:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_label: D7
datatype: string

tool: D7: r

assistant: ```c
size_t exec_and_redirect_output(char *command, FILE *output) {
  size_t r = 0, w = 0;
  FILE *pipe = NULL;
  if (!(pipe = popen(command, "r"))) {
    return 0;
  }
  size_t read = 0;
  char r_b[0x2000];
  while (!feof(pipe)) {
    if ((r = fread(r_b, 1, 0x2000, pipe)) <= 0) {
      break;
    }
    w += fwrite(r_b, r, 1, output);
    read += r;
  }
  pclose(pipe);
  return w;
}
```
user: What is the c source code of the assembly code below:

```asm
<exec_and_redirect_output>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x2008(%rsp)
  xor    %eax,%eax
  mov    %rsi,%r13
  lea    D4(%rip),%rsi
  call   <popen@plt>
  test   %rax,%rax
  je     L50
  mov    %rax,%rbp
  xor    %r12d,%r12d
  mov    %rsp,%rbx
  jmp    L41
  nopl   0x0(%rax)
L49:
  mov    $0x1,%esi
  mov    %rbp,%rcx
  mov    $0x2000,%edx
  mov    %rbx,%rdi
  call   <fread@plt>
  mov    %rax,%rsi
  test   %rax,%rax
  je     L32
  mov    %r13,%rcx
  mov    $0x1,%edx
  mov    %rbx,%rdi
  call   <fwrite@plt>
  add    %rax,%r12
L41:
  mov    %rbp,%rdi
  call   <feof@plt>
  test   %eax,%eax
  je     L49
L32:
  mov    %rbp,%rdi
  call   <pclose@plt>
L0:
  mov    0x2008(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L2
  add    $0x2018,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax,%rax,1)
L50:
  xor    %r12d,%r12d
  jmp    L0
L2:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: label: D4
type_guessed: string

tool: D4: r

assistant: ```c
size_t exec_and_redirect_output(char *command, FILE *output) {
  size_t r = 0, w = 0;
  FILE *pipe = NULL;
  if (!(pipe = popen(command, "r"))) {
    return 0;
  }
  size_t read = 0;
  char r_b[0x2000];
  while (!feof(pipe)) {
    if ((r = fread(r_b, 1, 0x2000, pipe)) <= 0) {
      break;
    }
    w += fwrite(r_b, r, 1, output);
    read += r;
  }
  pclose(pipe);
  return w;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<conv_h_errno>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x4(%rbp)
  cmpl   $0x83,-0x4(%rbp)
  je     L82
  cmpl   $0x83,-0x4(%rbp)
  jg     L73
  cmpl   $0x82,-0x4(%rbp)
  je     L100
  cmpl   $0x82,-0x4(%rbp)
  jg     L73
  cmpl   $0x80,-0x4(%rbp)
  je     L72
  cmpl   $0x81,-0x4(%rbp)
  je     L87
  jmp    L73
L82:
  mov    $0x60000084,%eax
  jmp    L34
L100:
  mov    $0x60000085,%eax
  jmp    L34
L87:
  mov    $0x60000086,%eax
  jmp    L34
L72:
  mov    $0x60000087,%eax
  jmp    L34
L73:
  mov    -0x4(%rbp),%eax
L34:
  pop    %rbp
  ret
```

assistant: ```c
int conv_h_errno(int herr) {
  switch (herr) {
  case HOST_NOT_FOUND:
    return ((4 | ((1 << 29) | (1 << 30))) | (1 << 7));
  case NO_ADDRESS:
    return ((5 | ((1 << 29) | (1 << 30))) | (1 << 7));
  case NO_RECOVERY:
    return ((6 | ((1 << 29) | (1 << 30))) | (1 << 7));
  case TRY_AGAIN:
    return ((7 | ((1 << 29) | (1 << 30))) | (1 << 7));
  default:
    return herr;
  }
}
```
user: What is the c source code of the assembly code below?

```asm
<conv_h_errno>:
  endbr64
  cmp    $0x82,%edi
  je     L13
  jg     L27
  mov    $0x60000087,%eax
  cmp    $0x80,%edi
  je     L16
  cmp    $0x81,%edi
  mov    $0x60000086,%eax
  cmovne %edi,%eax
  ret
L27:
  cmp    $0x83,%edi
  mov    $0x60000084,%eax
  cmovne %edi,%eax
  ret
L13:
  mov    $0x60000085,%eax
L16:
  ret
```

assistant: ```c
int conv_h_errno(int herr) {
  switch (herr) {
  case HOST_NOT_FOUND:
    return ((4 | ((1 << 29) | (1 << 30))) | (1 << 7));
  case NO_ADDRESS:
    return ((5 | ((1 << 29) | (1 << 30))) | (1 << 7));
  case NO_RECOVERY:
    return ((6 | ((1 << 29) | (1 << 30))) | (1 << 7));
  case TRY_AGAIN:
    return ((7 | ((1 << 29) | (1 << 30))) | (1 << 7));
  default:
    return herr;
  }
}
```
user: What is the c source code of the assembly code below?

```asm
<conv_h_errno>:
  endbr64
  lea    -0x80(%rdi),%ecx
  mov    $0x60000107,%edx
  mov    %edi,%eax
  sub    %edi,%edx
  cmp    $0x4,%ecx
  cmovb  %edx,%eax
  ret
```

assistant: ```c
int conv_h_errno(int herr) {
  switch (herr) {
  case HOST_NOT_FOUND:
    return ((4 | ((1 << 29) | (1 << 30))) | (1 << 7));
  case NO_ADDRESS:
    return ((5 | ((1 << 29) | (1 << 30))) | (1 << 7));
  case NO_RECOVERY:
    return ((6 | ((1 << 29) | (1 << 30))) | (1 << 7));
  case TRY_AGAIN:
    return ((7 | ((1 << 29) | (1 << 30))) | (1 << 7));
  default:
    return herr;
  }
}
```
user: What is the c source code of the assembly code below:

```asm
<conv_h_errno>:
  endbr64
  lea    -0x80(%rdi),%ecx
  mov    $0x60000107,%edx
  mov    %edi,%eax
  sub    %edi,%edx
  cmp    $0x4,%ecx
  cmovb  %edx,%eax
  ret
```

assistant: ```c
int conv_h_errno(int herr) {
  switch (herr) {
  case HOST_NOT_FOUND:
    return ((4 | ((1 << 29) | (1 << 30))) | (1 << 7));
  case NO_ADDRESS:
    return ((5 | ((1 << 29) | (1 << 30))) | (1 << 7));
  case NO_RECOVERY:
    return ((6 | ((1 << 29) | (1 << 30))) | (1 << 7));
  case TRY_AGAIN:
    return ((7 | ((1 << 29) | (1 << 30))) | (1 << 7));
  default:
    return herr;
  }
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<basConvBase>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  lea    D6(%rip),%rax
  mov    %rax,%rdi
  call   <notYet@plt>
  mov    $0x0,%edi
  call   <pushNumber@plt>
  nop
  pop    %rbp
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D6
type_infered: string

tool: D6: ConvBase

assistant: ```c
void basConvBase() {
  notYet("ConvBase");
  pushNumber(0);
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<basConvBase>:
  endbr64
  sub    $0x8,%rsp
  lea    D3(%rip),%rdi
  call   <notYet@plt>
  mov    $0x0,%edi
  call   <pushNumber@plt>
  add    $0x8,%rsp
  ret
```

tool_calls: name: read_data
arguments: data_label: D3
type_infered: string

tool: D3: ConvBase

assistant: ```c
void basConvBase() {
  notYet("ConvBase");
  pushNumber(0);
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<basConvBase>:
  endbr64
  sub    $0x8,%rsp
  lea    D0(%rip),%rdi
  call   <notYet@plt>
  xor    %edi,%edi
  add    $0x8,%rsp
  jmp    1070 <pushNumber@plt>
```

tool_calls: name: disassemble_data
arguments: label: D0
type: string

tool: D0: ConvBase

assistant: ```c
void basConvBase() {
  notYet("ConvBase");
  pushNumber(0);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<basConvBase>:
  endbr64
  sub    $0x8,%rsp
  lea    D1(%rip),%rdi
  call   <notYet@plt>
  xor    %edi,%edi
  add    $0x8,%rsp
  jmp    1070 <pushNumber@plt>
```

tool_calls: name: disassemble_data
arguments: tag: D1
type_infered: string

tool: D1: ConvBase

assistant: ```c
void basConvBase() {
  notYet("ConvBase");
  pushNumber(0);
}
```
user: What is the c source code of the assembly code below:

```asm
<tcp_send_vector>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %edi,-0x44(%rbp)
  mov    %rsi,-0x50(%rbp)
  mov    %rdx,-0x58(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movq   $0x0,-0x30(%rbp)
  mov    -0x58(%rbp),%rax
  mov    %rax,-0x20(%rbp)
  mov    -0x50(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  movq   $0x0,-0x28(%rbp)
  jmp    L64
L74:
  mov    -0x28(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  add    %rax,-0x30(%rbp)
  addq   $0x1,-0x28(%rbp)
L64:
  mov    -0x28(%rbp),%rax
  cmp    -0x58(%rbp),%rax
  jb     L74
L70:
  mov    D7(%rip),%rax
  mov    (%rax),%edx
  lea    -0x20(%rbp),%rcx
  mov    -0x44(%rbp),%eax
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <sendmsg@plt>
  mov    %eax,-0x3c(%rbp)
  cmpl   $0xffffffff,-0x3c(%rbp)
  jne    L28
  mov    D5(%rip),%rax
  mov    (%rax),%eax
  neg    %eax
  jmp    L57
L28:
  mov    -0x3c(%rbp),%eax
  cltq
  add    %rax,-0x38(%rbp)
  mov    -0x38(%rbp),%rax
  cmp    -0x30(%rbp),%rax
  jae    L11
  cmpl   $0x0,-0x3c(%rbp)
  jle    L11
  mov    -0x3c(%rbp),%edx
  lea    -0x20(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <shift_msghdr@plt>
  jmp    L70
L11:
  mov    -0x38(%rbp),%rax
L57:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L63
  call   <__stack_chk_fail@plt>
L63:
  leave
  ret
```

assistant: ```c
ssize_t tcp_send_vector(int sock, struct iovec *vec, size_t len) {
  ssize_t rv;
  size_t bsent, total = 0;
  struct msghdr hdr = {.msg_iov = vec, .msg_iovlen = len};
  for (size_t i = 0; i < len; i++)
    total += vec[i].iov_len;
  for (;;) {
    rv = sendmsg(sock, &hdr, MSG_NOSIGNAL);
    if (rv == -1)
      return -errno;
    bsent += rv;
    if (bsent < total && rv > 0)
      shift_msghdr(&hdr, rv);
    else
      break;
  }
  return bsent;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<tcp_send_vector>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %edi,%r12d
  mov    %rdx,%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    %rdx,(%rsp)
  mov    %rsi,0x8(%rsp)
  test   %rdx,%rdx
  je     L13
  mov    %rsi,%rax
  lea    (%rsi,%rdx,8),%rdx
  mov    $0x0,%ebx
L5:
  add    (%rax),%rbx
  add    $0x8,%rax
  cmp    %rdx,%rax
  jne    L5
L13:
  mov    D9(%rip),%r13
L38:
  mov    %rsp,%rsi
  mov    0x0(%r13),%edx
  mov    %r12d,%edi
  call   <sendmsg@plt>
  mov    %eax,%esi
  cmp    $0xffffffff,%eax
  je     L39
  cltq
  add    %rax,%rbp
  cmp    %rbx,%rbp
  jae    L25
  test   %esi,%esi
  jle    L25
  mov    %rsp,%rdi
  call   <shift_msghdr@plt>
  jmp    L38
L39:
  mov    D11(%rip),%rax
  mov    (%rax),%eax
  neg    %eax
L67:
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L18
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L25:
  mov    %ebp,%eax
  jmp    L67
L18:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
ssize_t tcp_send_vector(int sock, struct iovec *vec, size_t len) {
  ssize_t rv;
  size_t bsent, total = 0;
  struct msghdr hdr = {.msg_iov = vec, .msg_iovlen = len};
  for (size_t i = 0; i < len; i++)
    total += vec[i].iov_len;
  for (;;) {
    rv = sendmsg(sock, &hdr, MSG_NOSIGNAL);
    if (rv == -1)
      return -errno;
    bsent += rv;
    if (bsent < total && rv > 0)
      shift_msghdr(&hdr, rv);
    else
      break;
  }
  return bsent;
}
```
user: Translate the below assembly code into C programming language:

```asm
<tcp_send_vector>:
  endbr64
  push   %r14
  push   %r13
  mov    %edi,%r13d
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdx,%rbx
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    %rdx,(%rsp)
  mov    %rsi,0x8(%rsp)
  test   %rdx,%rdx
  je     L10
  lea    (%rsi,%rdx,8),%rax
  xor    %ebx,%ebx
  nopw   0x0(%rax,%rax,1)
L65:
  add    (%rsi),%rbx
  add    $0x8,%rsi
  cmp    %rax,%rsi
  jne    L65
L10:
  mov    D9(%rip),%r14
  mov    %rsp,%r12
  jmp    L47
  nopl   0x0(%rax,%rax,1)
L25:
  cltq
  add    %rax,%rbp
  cmp    %rbx,%rbp
  jae    L73
  test   %esi,%esi
  jle    L73
  mov    %r12,%rdi
  call   <shift_msghdr@plt>
L47:
  mov    (%r14),%edx
  mov    %r12,%rsi
  mov    %r13d,%edi
  call   <sendmsg@plt>
  mov    %eax,%esi
  cmp    $0xffffffff,%eax
  jne    L25
  mov    D4(%rip),%rax
  mov    (%rax),%eax
  neg    %eax
L77:
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L79
  add    $0x20,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax,%rax,1)
L73:
  mov    %ebp,%eax
  jmp    L77
L79:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
ssize_t tcp_send_vector(int sock, struct iovec *vec, size_t len) {
  ssize_t rv;
  size_t bsent, total = 0;
  struct msghdr hdr = {.msg_iov = vec, .msg_iovlen = len};
  for (size_t i = 0; i < len; i++)
    total += vec[i].iov_len;
  for (;;) {
    rv = sendmsg(sock, &hdr, MSG_NOSIGNAL);
    if (rv == -1)
      return -errno;
    bsent += rv;
    if (bsent < total && rv > 0)
      shift_msghdr(&hdr, rv);
    else
      break;
  }
  return bsent;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<tcp_send_vector>:
  endbr64
  push   %r14
  push   %r13
  mov    %edi,%r13d
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    %rdx,(%rsp)
  mov    %rsi,0x8(%rsp)
  test   %rdx,%rdx
  je     L33
  cmp    $0x1,%rdx
  je     L18
  mov    %rdx,%rcx
  mov    %rsi,%rax
  pxor   %xmm0,%xmm0
  shr    %rcx
  shl    $0x4,%rcx
  add    %rsi,%rcx
  nopl   0x0(%rax,%rax,1)
L104:
  movdqu (%rax),%xmm2
  add    $0x10,%rax
  paddq  %xmm2,%xmm0
  cmp    %rax,%rcx
  jne    L104
  movdqa %xmm0,%xmm1
  mov    %rdx,%rax
  psrldq $0x8,%xmm1
  and    $0xfffffffffffffffe,%rax
  and    $0x1,%edx
  paddq  %xmm1,%xmm0
  movq   %xmm0,%rbx
  je     L51
L73:
  add    (%rsi,%rax,8),%rbx
L51:
  mov    D2(%rip),%r14
  mov    %rsp,%r12
  jmp    L114
  nopw   0x0(%rax,%rax,1)
L1:
  cltq
  add    %rax,%rbp
  cmp    %rbx,%rbp
  jae    L116
  test   %esi,%esi
  jle    L116
  mov    %r12,%rdi
  call   <shift_msghdr@plt>
L114:
  mov    (%r14),%edx
  mov    %r12,%rsi
  mov    %r13d,%edi
  call   <sendmsg@plt>
  mov    %eax,%esi
  cmp    $0xffffffff,%eax
  jne    L1
  mov    D1(%rip),%rax
  mov    (%rax),%eax
  neg    %eax
L57:
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L10
  add    $0x20,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax,%rax,1)
L116:
  mov    %ebp,%eax
  jmp    L57
  nopl   0x0(%rax)
L33:
  xor    %ebx,%ebx
  jmp    L51
L18:
  xor    %eax,%eax
  xor    %ebx,%ebx
  jmp    L73
L10:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
ssize_t tcp_send_vector(int sock, struct iovec *vec, size_t len) {
  ssize_t rv;
  size_t bsent, total = 0;
  struct msghdr hdr = {.msg_iov = vec, .msg_iovlen = len};
  for (size_t i = 0; i < len; i++)
    total += vec[i].iov_len;
  for (;;) {
    rv = sendmsg(sock, &hdr, MSG_NOSIGNAL);
    if (rv == -1)
      return -errno;
    bsent += rv;
    if (bsent < total && rv > 0)
      shift_msghdr(&hdr, rv);
    else
      break;
  }
  return bsent;
}
```