ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<floats_mat33_sym_solve>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x68,%rsp
  mov    %rdi,%r13
  mov    %edx,%r12d
  mov    %rcx,%rbp
  mov    %r8d,%r15d
  mov    %r9d,%r14d
  mov    0xa0(%rsp),%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x58(%rsp)
  xor    %eax,%eax
  cmp    %edx,%esi
  sete   %dil
  movzbl %dil,%edi
  call   <assert@plt>
  cmp    $0x3,%r12d
  sete   %dil
  movzbl %dil,%edi
  call   <assert@plt>
  cmp    $0x3,%r15d
  sete   %dil
  movzbl %dil,%edi
  call   <assert@plt>
  cmp    $0x1,%r14d
  sete   %dil
  movzbl %dil,%edi
  call   <assert@plt>
  cmpl   $0x3,0xa8(%rsp)
  sete   %dil
  movzbl %dil,%edi
  call   <assert@plt>
  cmpl   $0x1,0xb0(%rsp)
  sete   %dil
  movzbl %dil,%edi
  call   <assert@plt>
  mov    %rsp,%r12
  mov    $0x3,%r9d
  mov    $0x3,%r8d
  mov    %r12,%rcx
  mov    $0x3,%edx
  mov    $0x3,%esi
  mov    %r13,%rdi
  call   <floats_mat33_chol@plt>
  lea    0x30(%rsp),%rcx
  mov    $0x3,%r9d
  mov    $0x3,%r8d
  mov    $0x3,%edx
  mov    $0x3,%esi
  mov    %r12,%rdi
  call   <floats_mat33_lower_tri_inv@plt>
  movss  0x30(%rsp),%xmm9
  movss  0x0(%rbp),%xmm0
  movss  0x3c(%rsp),%xmm8
  movss  0x40(%rsp),%xmm1
  movss  0x4(%rbp),%xmm6
  movaps %xmm0,%xmm5
  mulss  %xmm8,%xmm5
  movaps %xmm1,%xmm2
  mulss  %xmm6,%xmm2
  addss  %xmm2,%xmm5
  cvtss2sd %xmm5,%xmm5
  movss  0x48(%rsp),%xmm7
  movss  0x4c(%rsp),%xmm3
  movss  0x50(%rsp),%xmm4
  movaps %xmm0,%xmm2
  mulss  %xmm7,%xmm2
  mulss  %xmm3,%xmm6
  addss  %xmm6,%xmm2
  movaps %xmm4,%xmm6
  mulss  0x8(%rbp),%xmm6
  addss  %xmm6,%xmm2
  pxor   %xmm6,%xmm6
  cvtss2sd %xmm2,%xmm6
  mulss  %xmm9,%xmm0
  cvtss2sd %xmm0,%xmm0
  cvtss2sd %xmm9,%xmm9
  mulsd  %xmm9,%xmm0
  cvtss2sd %xmm8,%xmm8
  mulsd  %xmm5,%xmm8
  addsd  %xmm8,%xmm0
  cvtss2sd %xmm7,%xmm7
  mulsd  %xmm6,%xmm7
  addsd  %xmm7,%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,(%rbx)
  cvtss2sd %xmm1,%xmm1
  mulsd  %xmm5,%xmm1
  cvtss2sd %xmm3,%xmm3
  mulsd  %xmm6,%xmm3
  addsd  %xmm3,%xmm1
  cvtsd2ss %xmm1,%xmm1
  movss  %xmm1,0x4(%rbx)
  mulss  %xmm2,%xmm4
  movss  %xmm4,0x8(%rbx)
  mov    0x58(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L5
  add    $0x68,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L5:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void floats_mat33_sym_solve(const float *A, int Arows, int Acols, const float *B, int Brows, int Bcols, float *R, int Rrows, int Rcols) {
  assert(Arows == Acols);
  assert(Acols == 3);
  assert(Brows == 3);
  assert(Bcols == 1);
  assert(Rrows == 3);
  assert(Rcols == 1);
  float L[9];
  floats_mat33_chol(A, 3, 3, L, 3, 3);
  float M[9];
  floats_mat33_lower_tri_inv(L, 3, 3, M, 3, 3);
  double tmp[3];
  tmp[0] = M[0] * B[0];
  tmp[1] = M[3] * B[0] + M[4] * B[1];
  tmp[2] = M[6] * B[0] + M[7] * B[1] + M[8] * B[2];
  R[0] = M[0] * tmp[0] + M[3] * tmp[1] + M[6] * tmp[2];
  R[1] = M[4] * tmp[1] + M[7] * tmp[2];
  R[2] = M[8] * tmp[2];
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<floats_mat33_sym_solve>:
  endbr64
  push   %r15
  mov    %r8d,%r15d
  push   %r14
  mov    %r9d,%r14d
  push   %r13
  mov    %rdi,%r13
  xor    %edi,%edi
  push   %r12
  mov    %edx,%r12d
  push   %rbp
  mov    %rcx,%rbp
  push   %rbx
  sub    $0x68,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x58(%rsp)
  xor    %eax,%eax
  cmp    %edx,%esi
  mov    0xa0(%rsp),%rbx
  sete   %dil
  call   <assert@plt>
  xor    %edi,%edi
  cmp    $0x3,%r12d
  mov    %rsp,%r12
  sete   %dil
  call   <assert@plt>
  xor    %edi,%edi
  cmp    $0x3,%r15d
  sete   %dil
  call   <assert@plt>
  xor    %edi,%edi
  cmp    $0x1,%r14d
  sete   %dil
  call   <assert@plt>
  xor    %edi,%edi
  cmpl   $0x3,0xa8(%rsp)
  sete   %dil
  call   <assert@plt>
  xor    %edi,%edi
  cmpl   $0x1,0xb0(%rsp)
  sete   %dil
  call   <assert@plt>
  mov    %r12,%rcx
  mov    $0x3,%edx
  mov    %r13,%rdi
  mov    $0x3,%r9d
  mov    $0x3,%r8d
  mov    $0x3,%esi
  call   <floats_mat33_chol@plt>
  lea    0x30(%rsp),%rcx
  mov    $0x3,%r9d
  mov    $0x3,%r8d
  mov    $0x3,%edx
  mov    $0x3,%esi
  mov    %r12,%rdi
  call   <floats_mat33_lower_tri_inv@plt>
  movss  0x0(%rbp),%xmm0
  movss  0x40(%rsp),%xmm1
  movss  0x4(%rbp),%xmm6
  movss  0x3c(%rsp),%xmm8
  movaps %xmm0,%xmm5
  movaps %xmm1,%xmm2
  movss  0x48(%rsp),%xmm7
  movss  0x4c(%rsp),%xmm3
  mulss  %xmm6,%xmm2
  movss  0x50(%rsp),%xmm4
  cvtss2sd %xmm1,%xmm1
  movss  0x30(%rsp),%xmm9
  mulss  %xmm8,%xmm5
  cvtss2sd %xmm8,%xmm8
  mulss  %xmm3,%xmm6
  cvtss2sd %xmm3,%xmm3
  addss  %xmm2,%xmm5
  movaps %xmm0,%xmm2
  mulss  %xmm7,%xmm2
  cvtss2sd %xmm7,%xmm7
  mulss  %xmm9,%xmm0
  cvtss2sd %xmm9,%xmm9
  cvtss2sd %xmm5,%xmm5
  mulsd  %xmm5,%xmm8
  mulsd  %xmm5,%xmm1
  addss  %xmm6,%xmm2
  movss  0x8(%rbp),%xmm6
  cvtss2sd %xmm0,%xmm0
  mulsd  %xmm9,%xmm0
  mulss  %xmm4,%xmm6
  addsd  %xmm8,%xmm0
  addss  %xmm6,%xmm2
  pxor   %xmm6,%xmm6
  cvtss2sd %xmm2,%xmm6
  mulsd  %xmm6,%xmm7
  mulsd  %xmm6,%xmm3
  mulss  %xmm2,%xmm4
  addsd  %xmm7,%xmm0
  addsd  %xmm3,%xmm1
  movss  %xmm4,0x8(%rbx)
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,(%rbx)
  cvtsd2ss %xmm1,%xmm1
  movss  %xmm1,0x4(%rbx)
  mov    0x58(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L9
  add    $0x68,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L9:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void floats_mat33_sym_solve(const float *A, int Arows, int Acols, const float *B, int Brows, int Bcols, float *R, int Rrows, int Rcols) {
  assert(Arows == Acols);
  assert(Acols == 3);
  assert(Brows == 3);
  assert(Bcols == 1);
  assert(Rrows == 3);
  assert(Rcols == 1);
  float L[9];
  floats_mat33_chol(A, 3, 3, L, 3, 3);
  float M[9];
  floats_mat33_lower_tri_inv(L, 3, 3, M, 3, 3);
  double tmp[3];
  tmp[0] = M[0] * B[0];
  tmp[1] = M[3] * B[0] + M[4] * B[1];
  tmp[2] = M[6] * B[0] + M[7] * B[1] + M[8] * B[2];
  R[0] = M[0] * tmp[0] + M[3] * tmp[1] + M[6] * tmp[2];
  R[1] = M[4] * tmp[1] + M[7] * tmp[2];
  R[2] = M[8] * tmp[2];
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<floats_mat33_sym_solve>:
  endbr64
  push   %r15
  mov    %r8d,%r15d
  push   %r14
  mov    %r9d,%r14d
  push   %r13
  mov    %rdi,%r13
  xor    %edi,%edi
  push   %r12
  mov    %edx,%r12d
  push   %rbp
  mov    %rcx,%rbp
  push   %rbx
  sub    $0x68,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x58(%rsp)
  xor    %eax,%eax
  cmp    %edx,%esi
  mov    0xa0(%rsp),%rbx
  sete   %dil
  call   <assert@plt>
  xor    %edi,%edi
  cmp    $0x3,%r12d
  mov    %rsp,%r12
  sete   %dil
  call   <assert@plt>
  xor    %edi,%edi
  cmp    $0x3,%r15d
  sete   %dil
  call   <assert@plt>
  xor    %edi,%edi
  cmp    $0x1,%r14d
  sete   %dil
  call   <assert@plt>
  xor    %edi,%edi
  cmpl   $0x3,0xa8(%rsp)
  sete   %dil
  call   <assert@plt>
  xor    %edi,%edi
  cmpl   $0x1,0xb0(%rsp)
  sete   %dil
  call   <assert@plt>
  mov    %r12,%rcx
  mov    $0x3,%edx
  mov    %r13,%rdi
  mov    $0x3,%r9d
  mov    $0x3,%r8d
  mov    $0x3,%esi
  call   <floats_mat33_chol@plt>
  lea    0x30(%rsp),%rcx
  mov    $0x3,%r9d
  mov    $0x3,%r8d
  mov    $0x3,%edx
  mov    $0x3,%esi
  mov    %r12,%rdi
  call   <floats_mat33_lower_tri_inv@plt>
  movss  0x0(%rbp),%xmm0
  movss  0x4(%rbp),%xmm6
  movss  0x48(%rsp),%xmm2
  movss  0x4c(%rsp),%xmm3
  movaps %xmm0,%xmm1
  movaps %xmm6,%xmm9
  movss  0x40(%rsp),%xmm7
  movss  0x50(%rsp),%xmm4
  mulss  %xmm3,%xmm9
  movss  0x3c(%rsp),%xmm5
  cvtss2sd %xmm3,%xmm3
  movss  0x30(%rsp),%xmm8
  mulss  %xmm2,%xmm1
  unpcklps %xmm7,%xmm2
  mulss  %xmm7,%xmm6
  cvtps2pd %xmm2,%xmm2
  addss  %xmm9,%xmm1
  movaps %xmm4,%xmm9
  unpcklps %xmm5,%xmm9
  cvtss2sd %xmm5,%xmm5
  unpcklps %xmm6,%xmm1
  movss  0x8(%rbp),%xmm6
  unpcklps %xmm0,%xmm6
  mulps  %xmm9,%xmm6
  mulss  %xmm8,%xmm0
  cvtss2sd %xmm8,%xmm8
  addps  %xmm6,%xmm1
  cvtss2sd %xmm0,%xmm0
  mulsd  %xmm8,%xmm0
  cvtps2pd %xmm1,%xmm6
  mulsd  %xmm6,%xmm3
  movapd %xmm6,%xmm10
  mulpd  %xmm6,%xmm2
  unpckhpd %xmm10,%xmm10
  mulsd  %xmm10,%xmm5
  mulss  %xmm4,%xmm1
  addsd  %xmm5,%xmm0
  movss  %xmm1,0x8(%rbx)
  unpcklpd %xmm3,%xmm0
  addpd  %xmm2,%xmm0
  cvtpd2ps %xmm0,%xmm0
  movlps %xmm0,(%rbx)
  mov    0x58(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L7
  add    $0x68,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L7:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void floats_mat33_sym_solve(const float *A, int Arows, int Acols, const float *B, int Brows, int Bcols, float *R, int Rrows, int Rcols) {
  assert(Arows == Acols);
  assert(Acols == 3);
  assert(Brows == 3);
  assert(Bcols == 1);
  assert(Rrows == 3);
  assert(Rcols == 1);
  float L[9];
  floats_mat33_chol(A, 3, 3, L, 3, 3);
  float M[9];
  floats_mat33_lower_tri_inv(L, 3, 3, M, 3, 3);
  double tmp[3];
  tmp[0] = M[0] * B[0];
  tmp[1] = M[3] * B[0] + M[4] * B[1];
  tmp[2] = M[6] * B[0] + M[7] * B[1] + M[8] * B[2];
  R[0] = M[0] * tmp[0] + M[3] * tmp[1] + M[6] * tmp[2];
  R[1] = M[4] * tmp[1] + M[7] * tmp[2];
  R[2] = M[8] * tmp[2];
}
```
user: What is the c source code of the assembly code below:

```asm
<eof_pos>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  movq   $0x0,-0x8(%rbp)
  jmp    L1
L37:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L30
  addq   $0x1,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  jmp    L33
L30:
  addq   $0x1,-0x18(%rbp)
  subq   $0x1,-0x20(%rbp)
L1:
  cmpq   $0x0,-0x20(%rbp)
  jne    L37
L33:
  mov    -0x8(%rbp),%rax
  pop    %rbp
  ret
```

assistant: ```c
char *eof_pos(char *src, size_t max) {
  char *ret = 0;
  while (max) {
    if (0 == *src) {
      src++;
      ret = src;
      break;
    }
    src++;
    max--;
  }
  return ret;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<eof_pos>:
  endbr64
  test   %rsi,%rsi
  je     L19
  add    %rdi,%rsi
L13:
  cmpb   $0x0,(%rdi)
  je     L4
  add    $0x1,%rdi
  cmp    %rdi,%rsi
  jne    L13
  mov    $0x0,%eax
  ret
L4:
  lea    0x1(%rdi),%rax
  ret
L19:
  mov    $0x0,%eax
  ret
```

assistant: ```c
char *eof_pos(char *src, size_t max) {
  char *ret = 0;
  while (max) {
    if (0 == *src) {
      src++;
      ret = src;
      break;
    }
    src++;
    max--;
  }
  return ret;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<eof_pos>:
  endbr64
  mov    %rdi,%rax
  test   %rsi,%rsi
  je     L33
  add    %rdi,%rsi
  jmp    L22
  nopl   0x0(%rax)
L1:
  cmp    %rsi,%rax
  je     L33
L22:
  movzbl (%rax),%edx
  add    $0x1,%rax
  test   %dl,%dl
  jne    L1
  ret
  nopl   0x0(%rax)
L33:
  xor    %eax,%eax
  ret
```

assistant: ```c
char *eof_pos(char *src, size_t max) {
  char *ret = 0;
  while (max) {
    if (0 == *src) {
      src++;
      ret = src;
      break;
    }
    src++;
    max--;
  }
  return ret;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<eof_pos>:
  endbr64
  mov    %rdi,%rax
  test   %rsi,%rsi
  je     L31
  add    %rdi,%rsi
  jmp    L6
  nopl   0x0(%rax)
L18:
  cmp    %rsi,%rax
  je     L31
L6:
  movzbl (%rax),%edx
  add    $0x1,%rax
  test   %dl,%dl
  jne    L18
  ret
  nopl   0x0(%rax)
L31:
  xor    %eax,%eax
  ret
```

assistant: ```c
char *eof_pos(char *src, size_t max) {
  char *ret = 0;
  while (max) {
    if (0 == *src) {
      src++;
      ret = src;
      break;
    }
    src++;
    max--;
  }
  return ret;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<handleClient>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %edi,%r12d
  mov    %esi,0x1c(%rsp)
  mov    %rdx,%rbx
  mov    %rcx,%r15
  mov    %r8,%r14
  mov    %r9,0x8(%rsp)
  movslq %esi,%rax
  mov    %rax,0x10(%rsp)
  jmp    L49
L59:
  mov    $0x2,%esi
  mov    %r12d,%edi
  call   <shutdown@plt>
  mov    %r12d,%edi
  call   <close@plt>
L5:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L6:
  mov    %ebp,%ecx
  mov    %r14,%rdx
  mov    0x8(%rsp),%rsi
  mov    %r15,%rdi
  call   <otp_decrypt@plt>
L47:
  mov    %ebp,%edx
  mov    %r15,%rsi
  mov    %rbx,%rdi
  call   <otp_decode@plt>
  mov    $0x0,%ecx
  mov    %rbp,%rdx
  mov    %rbx,%rsi
  mov    %r12d,%edi
  call   <send@plt>
  test   %eax,%eax
  je     L5
L49:
  mov    $0x0,%ecx
  mov    $0x10,%edx
  mov    %rbx,%rsi
  mov    %r12d,%edi
  call   <recv@plt>
  test   %eax,%eax
  je     L5
  mov    0x8(%rbx),%rbp
  mov    0x10(%rsp),%rax
  cmp    (%rbx),%rax
  jne    L59
  mov    %rbp,%rdx
  mov    %rbx,%rsi
  mov    %r12d,%edi
  call   <pullFromSocket@plt>
  lea    (%rbx,%rbp,1),%r13
  movb   $0x0,0x0(%r13)
  mov    %rbx,%rsi
  mov    %r14,%rdi
  call   <otp_encode@plt>
  mov    %rbp,%rdx
  mov    %rbx,%rsi
  mov    %r12d,%edi
  call   <pullFromSocket@plt>
  movb   $0x0,0x0(%r13)
  mov    %rbx,%rsi
  mov    0x8(%rsp),%r13
  mov    %r13,%rdi
  call   <otp_encode@plt>
  cmpl   $0x0,0x1c(%rsp)
  je     L6
  mov    %ebp,%ecx
  mov    %r14,%rdx
  mov    %r13,%rsi
  mov    %r15,%rdi
  call   <otp_encrypt@plt>
  jmp    L47
```

assistant: ```c
void handleClient(int clientFd, int encryptionMode, char *buffer, int *resultBuffer, int *keyBuffer, int *msgBuffer) {
  ssize_t receiveLength;
  ssize_t sendSuccess;
  size_t msgAndKeyLength;
  size_t isEncrypting;
  while (1) {
    receiveLength = recv(clientFd, buffer, sizeof(size_t) * 2, 0);
    if (!receiveLength)
      return;
    isEncrypting = ((size_t *)buffer)[0];
    msgAndKeyLength = ((size_t *)buffer)[1];
    if (isEncrypting != encryptionMode) {
      shutdown(clientFd, 2);
      close(clientFd);
      return;
    }
    pullFromSocket(clientFd, buffer, msgAndKeyLength);
    buffer[msgAndKeyLength] = '\0';
    otp_encode(keyBuffer, buffer);
    pullFromSocket(clientFd, buffer, msgAndKeyLength);
    buffer[msgAndKeyLength] = '\0';
    otp_encode(msgBuffer, buffer);
    if (encryptionMode)
      otp_encrypt(resultBuffer, msgBuffer, keyBuffer, (int)msgAndKeyLength);
    else
      otp_decrypt(resultBuffer, msgBuffer, keyBuffer, (int)msgAndKeyLength);
    otp_decode(buffer, resultBuffer, (int)msgAndKeyLength);
    sendSuccess = send(clientFd, buffer, msgAndKeyLength, 0);
    if (!sendSuccess)
      return;
  }
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<handleClient>:
  endbr64
  push   %r15
  movslq %esi,%rax
  mov    %rcx,%r15
  push   %r14
  mov    %r8,%r14
  push   %r13
  mov    %r9,%r13
  push   %r12
  push   %rbp
  mov    %edi,%ebp
  push   %rbx
  mov    %rdx,%rbx
  sub    $0x28,%rsp
  mov    %esi,0x1c(%rsp)
  mov    %rax,0x10(%rsp)
  jmp    L41
  xchg   %ax,%ax
L20:
  call   <otp_encrypt@plt>
  mov    0x8(%rsp),%r8d
L28:
  mov    %r8d,%edx
  mov    %r15,%rsi
  mov    %rbx,%rdi
  call   <otp_decode@plt>
  xor    %ecx,%ecx
  mov    %r12,%rdx
  mov    %rbx,%rsi
  mov    %ebp,%edi
  call   <send@plt>
  test   %eax,%eax
  je     L58
L41:
  xor    %ecx,%ecx
  mov    $0x10,%edx
  mov    %rbx,%rsi
  mov    %ebp,%edi
  call   <recv@plt>
  test   %eax,%eax
  je     L58
  mov    0x8(%rbx),%r12
  mov    0x10(%rsp),%rax
  cmp    (%rbx),%rax
  jne    L13
  mov    %r12,%rdx
  mov    %rbx,%rsi
  mov    %ebp,%edi
  call   <pullFromSocket@plt>
  lea    (%rbx,%r12,1),%rcx
  mov    %rbx,%rsi
  mov    %r14,%rdi
  movb   $0x0,(%rcx)
  mov    %rcx,0x8(%rsp)
  call   <otp_encode@plt>
  mov    %r12,%rdx
  mov    %rbx,%rsi
  mov    %ebp,%edi
  call   <pullFromSocket@plt>
  mov    0x8(%rsp),%rcx
  mov    %rbx,%rsi
  mov    %r13,%rdi
  movb   $0x0,(%rcx)
  call   <otp_encode@plt>
  mov    0x1c(%rsp),%eax
  mov    %r12d,%ecx
  mov    %r14,%rdx
  mov    %r12d,0x8(%rsp)
  mov    %r13,%rsi
  mov    %r15,%rdi
  test   %eax,%eax
  jne    L20
  call   <otp_decrypt@plt>
  mov    0x8(%rsp),%r8d
  jmp    L28
  nopw   0x0(%rax,%rax,1)
L58:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nop
L13:
  mov    %ebp,%edi
  mov    $0x2,%esi
  call   <shutdown@plt>
  add    $0x28,%rsp
  mov    %ebp,%edi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1130 <close@plt>
```

assistant: ```c
void handleClient(int clientFd, int encryptionMode, char *buffer, int *resultBuffer, int *keyBuffer, int *msgBuffer) {
  ssize_t receiveLength;
  ssize_t sendSuccess;
  size_t msgAndKeyLength;
  size_t isEncrypting;
  while (1) {
    receiveLength = recv(clientFd, buffer, sizeof(size_t) * 2, 0);
    if (!receiveLength)
      return;
    isEncrypting = ((size_t *)buffer)[0];
    msgAndKeyLength = ((size_t *)buffer)[1];
    if (isEncrypting != encryptionMode) {
      shutdown(clientFd, 2);
      close(clientFd);
      return;
    }
    pullFromSocket(clientFd, buffer, msgAndKeyLength);
    buffer[msgAndKeyLength] = '\0';
    otp_encode(keyBuffer, buffer);
    pullFromSocket(clientFd, buffer, msgAndKeyLength);
    buffer[msgAndKeyLength] = '\0';
    otp_encode(msgBuffer, buffer);
    if (encryptionMode)
      otp_encrypt(resultBuffer, msgBuffer, keyBuffer, (int)msgAndKeyLength);
    else
      otp_decrypt(resultBuffer, msgBuffer, keyBuffer, (int)msgAndKeyLength);
    otp_decode(buffer, resultBuffer, (int)msgAndKeyLength);
    sendSuccess = send(clientFd, buffer, msgAndKeyLength, 0);
    if (!sendSuccess)
      return;
  }
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<handleClient>:
  endbr64
  push   %r15
  movslq %esi,%rax
  mov    %rcx,%r15
  push   %r14
  mov    %r8,%r14
  push   %r13
  mov    %r9,%r13
  push   %r12
  push   %rbp
  mov    %edi,%ebp
  push   %rbx
  mov    %rdx,%rbx
  sub    $0x28,%rsp
  mov    %esi,0x1c(%rsp)
  mov    %rax,0x10(%rsp)
  jmp    L44
  xchg   %ax,%ax
L54:
  call   <otp_encrypt@plt>
L31:
  mov    0x8(%rsp),%edx
  mov    %r15,%rsi
  mov    %rbx,%rdi
  call   <otp_decode@plt>
  xor    %ecx,%ecx
  mov    %r12,%rdx
  mov    %rbx,%rsi
  mov    %ebp,%edi
  call   <send@plt>
  test   %eax,%eax
  je     L23
L44:
  xor    %ecx,%ecx
  mov    $0x10,%edx
  mov    %rbx,%rsi
  mov    %ebp,%edi
  call   <recv@plt>
  test   %eax,%eax
  je     L23
  mov    0x8(%rbx),%r12
  mov    0x10(%rsp),%rax
  cmp    (%rbx),%rax
  jne    L19
  mov    %r12,%rdx
  mov    %rbx,%rsi
  mov    %ebp,%edi
  call   <pullFromSocket@plt>
  lea    (%rbx,%r12,1),%rcx
  mov    %rbx,%rsi
  mov    %r14,%rdi
  movb   $0x0,(%rcx)
  mov    %rcx,0x8(%rsp)
  call   <otp_encode@plt>
  mov    %r12,%rdx
  mov    %rbx,%rsi
  mov    %ebp,%edi
  call   <pullFromSocket@plt>
  mov    0x8(%rsp),%rcx
  mov    %rbx,%rsi
  mov    %r13,%rdi
  movb   $0x0,(%rcx)
  call   <otp_encode@plt>
  mov    0x1c(%rsp),%eax
  mov    %r12d,%ecx
  mov    %r14,%rdx
  mov    %r12d,0x8(%rsp)
  mov    %r13,%rsi
  mov    %r15,%rdi
  test   %eax,%eax
  jne    L54
  call   <otp_decrypt@plt>
  jmp    L31
  nopl   (%rax)
L23:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nop
L19:
  mov    %ebp,%edi
  mov    $0x2,%esi
  call   <shutdown@plt>
  add    $0x28,%rsp
  mov    %ebp,%edi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1130 <close@plt>
```

assistant: ```c
void handleClient(int clientFd, int encryptionMode, char *buffer, int *resultBuffer, int *keyBuffer, int *msgBuffer) {
  ssize_t receiveLength;
  ssize_t sendSuccess;
  size_t msgAndKeyLength;
  size_t isEncrypting;
  while (1) {
    receiveLength = recv(clientFd, buffer, sizeof(size_t) * 2, 0);
    if (!receiveLength)
      return;
    isEncrypting = ((size_t *)buffer)[0];
    msgAndKeyLength = ((size_t *)buffer)[1];
    if (isEncrypting != encryptionMode) {
      shutdown(clientFd, 2);
      close(clientFd);
      return;
    }
    pullFromSocket(clientFd, buffer, msgAndKeyLength);
    buffer[msgAndKeyLength] = '\0';
    otp_encode(keyBuffer, buffer);
    pullFromSocket(clientFd, buffer, msgAndKeyLength);
    buffer[msgAndKeyLength] = '\0';
    otp_encode(msgBuffer, buffer);
    if (encryptionMode)
      otp_encrypt(resultBuffer, msgBuffer, keyBuffer, (int)msgAndKeyLength);
    else
      otp_decrypt(resultBuffer, msgBuffer, keyBuffer, (int)msgAndKeyLength);
    otp_decode(buffer, resultBuffer, (int)msgAndKeyLength);
    sendSuccess = send(clientFd, buffer, msgAndKeyLength, 0);
    if (!sendSuccess)
      return;
  }
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<host_to_dns_name>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  movl   $0x0,-0x8(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L32
L17:
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  je     L46
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L56
L46:
  mov    -0x8(%rbp),%eax
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  mov    %edx,%ecx
  sub    %eax,%ecx
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  mov    %ecx,%edx
  mov    %dl,(%rax)
  jmp    L43
L57:
  mov    -0x4(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x4(%rbp)
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  movzbl (%rcx),%edx
  mov    %dl,(%rax)
L43:
  mov    -0x4(%rbp),%eax
  cmp    -0x8(%rbp),%eax
  jl     L57
  addl   $0x1,-0x4(%rbp)
L56:
  addl   $0x1,-0x8(%rbp)
L32:
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cmp    %eax,-0x8(%rbp)
  jle    L17
  mov    -0x18(%rbp),%rax
  movb   $0x0,(%rax)
  nop
  leave
  ret
```

assistant: ```c
void host_to_dns_name(char *dns, char *host) {
  for (int i = 0, count = 0; i < strlen(host) + 1; i++) {
    if (host[i] == '.' || host[i] == '\0') {
      *dns++ = i - count;
      while (count < i)
        *dns++ = host[count++];
      count++;
    }
  }
  *dns = '\0';
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<host_to_dns_name>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%r12
  mov    %rsi,%rbp
  mov    $0x0,%ebx
  mov    $0x0,%r13d
  jmp    L46
L35:
  lea    0x1(%r12),%rsi
  mov    %ebx,%eax
  sub    %r13d,%eax
  mov    %al,(%r12)
  cmp    %ecx,%r13d
  jge    L51
  movslq %r13d,%rdx
  mov    %rdx,%rax
  sub    %rdx,%r12
L38:
  movzbl 0x0(%rbp,%rax,1),%edx
  mov    %dl,0x1(%r12,%rax,1)
  add    $0x1,%rax
  cmp    %eax,%ecx
  jg     L38
  mov    %r13d,%edx
  mov    %ebx,%r13d
  mov    %ebx,%eax
  sub    %edx,%eax
  lea    -0x1(%rax),%eax
  lea    0x1(%rsi,%rax,1),%r12
L17:
  add    $0x1,%r13d
L73:
  add    $0x1,%rbx
L46:
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    %ebx,%ecx
  cmp    %ebx,%eax
  jl     L21
  movzbl 0x0(%rbp,%rbx,1),%eax
  cmp    $0x2e,%al
  je     L35
  test   %al,%al
  jne    L73
  jmp    L35
L51:
  mov    %rsi,%r12
  jmp    L17
L21:
  movb   $0x0,(%r12)
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
void host_to_dns_name(char *dns, char *host) {
  for (int i = 0, count = 0; i < strlen(host) + 1; i++) {
    if (host[i] == '.' || host[i] == '\0') {
      *dns++ = i - count;
      while (count < i)
        *dns++ = host[count++];
      count++;
    }
  }
  *dns = '\0';
}
```