ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 请从给定的汇编指令推导出C源代码：

```asm
<dump_smbus_registers>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  lea    D42(%rip),%rax
  mov    %rax,%rdi
  call   <print_debug@plt>
  movl   $0x1,-0xc(%rbp)
  jmp    L67
L2:
  mov    -0xc(%rbp),%eax
  mov    $0x0,%esi
  mov    %eax,%edi
  call   <smbus_read_byte@plt>
  test   %eax,%eax
  js     L47
  lea    D20(%rip),%rax
  mov    %rax,%rdi
  call   <print_debug@plt>
  mov    -0xc(%rbp),%eax
  movzbl %al,%eax
  mov    %eax,%edi
  call   <print_debug_hex8@plt>
  movl   $0x0,-0x8(%rbp)
  jmp    L25
L29:
  mov    -0x8(%rbp),%edx
  mov    -0xc(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <smbus_read_byte@plt>
  mov    %eax,-0x4(%rbp)
  cmpl   $0x0,-0x4(%rbp)
  js     L58
  mov    -0x8(%rbp),%eax
  and    $0xf,%eax
  test   %eax,%eax
  jne    L62
  lea    D42(%rip),%rax
  mov    %rax,%rdi
  call   <print_debug@plt>
  mov    -0x8(%rbp),%eax
  movzbl %al,%eax
  mov    %eax,%edi
  call   <print_debug_hex8@plt>
  lea    D12(%rip),%rax
  mov    %rax,%rdi
  call   <print_debug@plt>
L62:
  mov    -0x4(%rbp),%eax
  mov    %al,-0xd(%rbp)
  movzbl -0xd(%rbp),%eax
  mov    %eax,%edi
  call   <print_debug_hex8@plt>
  mov    $0x20,%edi
  call   <print_debug_char@plt>
  addl   $0x1,-0x8(%rbp)
L25:
  cmpl   $0xff,-0x8(%rbp)
  jle    L29
  jmp    L5
L58:
  nop
L5:
  lea    D42(%rip),%rax
  mov    %rax,%rdi
  call   <print_debug@plt>
  jmp    L74
L47:
  nop
L74:
  addl   $0x1,-0xc(%rbp)
L67:
  cmpl   $0x7f,-0xc(%rbp)
  jbe    L2
  nop
  nop
  leave
  ret
```

tool_calls: name: read_data
arguments: label: D42
type_infered: string
name: read_data
arguments: label: D20
type_infered: string
name: read_data
arguments: label: D12
type_infered: string

tool: D42: 


tool: D20: smbus: 

tool: D12: : 

assistant: ```c
void dump_smbus_registers(void) {
  unsigned device;
  print_debug("\n");
  for (device = 1; device < 0x80; device++) {
    int j;
    if (smbus_read_byte(device, 0) < 0)
      continue;
    print_debug("smbus: ");
    print_debug_hex8(device);
    for (j = 0; j < 256; j++) {
      int status;
      unsigned char byte;
      status = smbus_read_byte(device, j);
      if (status < 0) {
        break;
      }
      if ((j & 0xf) == 0) {
        print_debug("\n");
        print_debug_hex8(j);
        print_debug(": ");
      }
      byte = status & 0xff;
      print_debug_hex8(byte);
      print_debug_char(' ');
    }
    print_debug("\n");
  }
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<dump_smbus_registers>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  lea    D30(%rip),%rdi
  call   <print_debug@plt>
  mov    $0x1,%r12d
  lea    D7(%rip),%r15
  lea    D30(%rip),%r13
  lea    D9(%rip),%r14
  jmp    L22
L5:
  movzbl %bl,%edi
  call   <print_debug_hex8@plt>
  mov    $0x20,%edi
  call   <print_debug_char@plt>
  add    $0x1,%ebp
  cmp    $0x100,%ebp
  je     L2
L27:
  mov    %ebp,%esi
  mov    %r12d,%edi
  call   <smbus_read_byte@plt>
  mov    %eax,%ebx
  test   %eax,%eax
  js     L2
  test   $0xf,%bpl
  jne    L5
  mov    %r13,%rdi
  call   <print_debug@plt>
  movzbl %bpl,%edi
  call   <print_debug_hex8@plt>
  mov    %r14,%rdi
  call   <print_debug@plt>
  jmp    L5
L2:
  mov    %r13,%rdi
  call   <print_debug@plt>
L21:
  add    $0x1,%r12d
  cmp    $0x80,%r12d
  je     L18
L22:
  mov    $0x0,%esi
  mov    %r12d,%edi
  call   <smbus_read_byte@plt>
  test   %eax,%eax
  js     L21
  mov    %r15,%rdi
  call   <print_debug@plt>
  mov    %r12d,%edi
  call   <print_debug_hex8@plt>
  mov    $0x0,%ebp
  jmp    L27
L18:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: retrieve_data
arguments: label: D30
data_type: string
name: retrieve_data
arguments: label: D7
data_type: string
name: retrieve_data
arguments: label: D9
data_type: string

tool: D30: 


tool: D7: smbus: 

tool: D9: : 

assistant: ```c
void dump_smbus_registers(void) {
  unsigned device;
  print_debug("\n");
  for (device = 1; device < 0x80; device++) {
    int j;
    if (smbus_read_byte(device, 0) < 0)
      continue;
    print_debug("smbus: ");
    print_debug_hex8(device);
    for (j = 0; j < 256; j++) {
      int status;
      unsigned char byte;
      status = smbus_read_byte(device, j);
      if (status < 0) {
        break;
      }
      if ((j & 0xf) == 0) {
        print_debug("\n");
        print_debug_hex8(j);
        print_debug(": ");
      }
      byte = status & 0xff;
      print_debug_hex8(byte);
      print_debug_char(' ');
    }
    print_debug("\n");
  }
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<dump_smbus_registers>:
  endbr64
  push   %r15
  push   %r14
  lea    D15(%rip),%r14
  push   %r13
  lea    D22(%rip),%r13
  push   %r12
  lea    D17(%rip),%r12
  push   %rbp
  mov    %r12,%rdi
  mov    $0x1,%ebp
  push   %rbx
  sub    $0x8,%rsp
  call   <print_debug@plt>
  jmp    L10
  cs nopw 0x0(%rax,%rax,1)
L41:
  add    $0x1,%ebp
  cmp    $0x80,%ebp
  je     L13
L10:
  xor    %esi,%esi
  mov    %ebp,%edi
  call   <smbus_read_byte@plt>
  test   %eax,%eax
  js     L41
  mov    %r14,%rdi
  xor    %r15d,%r15d
  call   <print_debug@plt>
  mov    %ebp,%edi
  call   <print_debug_hex8@plt>
  jmp    L64
L28:
  movzbl %bl,%edi
  add    $0x1,%r15d
  call   <print_debug_hex8@plt>
  mov    $0x20,%edi
  call   <print_debug_char@plt>
  cmp    $0x100,%r15d
  je     L52
L64:
  mov    %r15d,%esi
  mov    %ebp,%edi
  call   <smbus_read_byte@plt>
  mov    %eax,%ebx
  test   %eax,%eax
  js     L52
  test   $0xf,%r15b
  jne    L28
  mov    %r12,%rdi
  call   <print_debug@plt>
  mov    %r15d,%edi
  call   <print_debug_hex8@plt>
  mov    %r13,%rdi
  call   <print_debug@plt>
  jmp    L28
  nop
L52:
  mov    %r12,%rdi
  add    $0x1,%ebp
  call   <print_debug@plt>
  cmp    $0x80,%ebp
  jne    L10
L13:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: parse_data
arguments: data_tag: D15
data_type: string
name: parse_data
arguments: data_tag: D22
data_type: string
name: parse_data
arguments: data_tag: D17
data_type: string

tool: D15: smbus: 

tool: D22: : 

tool: D17: 


assistant: ```c
void dump_smbus_registers(void) {
  unsigned device;
  print_debug("\n");
  for (device = 1; device < 0x80; device++) {
    int j;
    if (smbus_read_byte(device, 0) < 0)
      continue;
    print_debug("smbus: ");
    print_debug_hex8(device);
    for (j = 0; j < 256; j++) {
      int status;
      unsigned char byte;
      status = smbus_read_byte(device, j);
      if (status < 0) {
        break;
      }
      if ((j & 0xf) == 0) {
        print_debug("\n");
        print_debug_hex8(j);
        print_debug(": ");
      }
      byte = status & 0xff;
      print_debug_hex8(byte);
      print_debug_char(' ');
    }
    print_debug("\n");
  }
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<dump_smbus_registers>:
  endbr64
  push   %r15
  push   %r14
  lea    D19(%rip),%r14
  push   %r13
  lea    D8(%rip),%r13
  push   %r12
  lea    D16(%rip),%r12
  push   %rbp
  mov    %r12,%rdi
  mov    $0x1,%ebp
  push   %rbx
  sub    $0x8,%rsp
  call   <print_debug@plt>
  jmp    L84
  cs nopw 0x0(%rax,%rax,1)
L80:
  add    $0x1,%ebp
  cmp    $0x80,%ebp
  je     L13
L84:
  xor    %esi,%esi
  mov    %ebp,%edi
  call   <smbus_read_byte@plt>
  test   %eax,%eax
  js     L80
  mov    %r14,%rdi
  xor    %r15d,%r15d
  call   <print_debug@plt>
  mov    %ebp,%edi
  call   <print_debug_hex8@plt>
  jmp    L55
L88:
  movzbl %bl,%edi
  add    $0x1,%r15d
  call   <print_debug_hex8@plt>
  mov    $0x20,%edi
  call   <print_debug_char@plt>
  cmp    $0x100,%r15d
  je     L1
L55:
  mov    %r15d,%esi
  mov    %ebp,%edi
  call   <smbus_read_byte@plt>
  mov    %eax,%ebx
  test   %eax,%eax
  js     L1
  test   $0xf,%r15b
  jne    L88
  mov    %r12,%rdi
  call   <print_debug@plt>
  mov    %r15d,%edi
  call   <print_debug_hex8@plt>
  mov    %r13,%rdi
  call   <print_debug@plt>
  jmp    L88
  nop
L1:
  mov    %r12,%rdi
  add    $0x1,%ebp
  call   <print_debug@plt>
  cmp    $0x80,%ebp
  jne    L84
L13:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: extract_symbolic_data
arguments: tag: D19
type: string
name: extract_symbolic_data
arguments: tag: D8
type: string
name: extract_symbolic_data
arguments: tag: D16
type: string

tool: D19: smbus: 

tool: D8: : 

tool: D16: 


assistant: ```c
void dump_smbus_registers(void) {
  unsigned device;
  print_debug("\n");
  for (device = 1; device < 0x80; device++) {
    int j;
    if (smbus_read_byte(device, 0) < 0)
      continue;
    print_debug("smbus: ");
    print_debug_hex8(device);
    for (j = 0; j < 256; j++) {
      int status;
      unsigned char byte;
      status = smbus_read_byte(device, j);
      if (status < 0) {
        break;
      }
      if ((j & 0xf) == 0) {
        print_debug("\n");
        print_debug_hex8(j);
        print_debug(": ");
      }
      byte = status & 0xff;
      print_debug_hex8(byte);
      print_debug_char(' ');
    }
    print_debug("\n");
  }
}
```
user: Translate the below assembly code into C programming language:

```asm
<glmQuaternionFromVectorAndScalarf>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x8(%rbp)
  mov    %rsi,-0x10(%rbp)
  movss  %xmm0,-0x14(%rbp)
  mov    -0x8(%rbp),%rax
  movss  -0x14(%rbp),%xmm0
  movss  %xmm0,(%rax)
  mov    -0x8(%rbp),%rax
  lea    0x4(%rax),%rdx
  mov    -0x10(%rbp),%rax
  movss  (%rax),%xmm0
  movss  %xmm0,(%rdx)
  mov    -0x10(%rbp),%rax
  lea    0x4(%rax),%rdx
  mov    -0x8(%rbp),%rax
  add    $0x8,%rax
  movss  (%rdx),%xmm0
  movss  %xmm0,(%rax)
  mov    -0x10(%rbp),%rax
  lea    0x8(%rax),%rdx
  mov    -0x8(%rbp),%rax
  add    $0xc,%rax
  movss  (%rdx),%xmm0
  movss  %xmm0,(%rax)
  nop
  pop    %rbp
  ret
```

assistant: ```c
void glmQuaternionFromVectorAndScalarf(float q[4], const float v[3], const float w) {
  q[0] = w;
  q[1] = v[0];
  q[2] = v[1];
  q[3] = v[2];
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<glmQuaternionFromVectorAndScalarf>:
  endbr64
  movss  %xmm0,(%rdi)
  movss  (%rsi),%xmm0
  movss  %xmm0,0x4(%rdi)
  movss  0x4(%rsi),%xmm0
  movss  %xmm0,0x8(%rdi)
  movss  0x8(%rsi),%xmm0
  movss  %xmm0,0xc(%rdi)
  ret
```

assistant: ```c
void glmQuaternionFromVectorAndScalarf(float q[4], const float v[3], const float w) {
  q[0] = w;
  q[1] = v[0];
  q[2] = v[1];
  q[3] = v[2];
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<glmQuaternionFromVectorAndScalarf>:
  endbr64
  movss  %xmm0,(%rdi)
  movss  (%rsi),%xmm0
  movss  %xmm0,0x4(%rdi)
  movss  0x4(%rsi),%xmm0
  movss  %xmm0,0x8(%rdi)
  movss  0x8(%rsi),%xmm0
  movss  %xmm0,0xc(%rdi)
  ret
```

assistant: ```c
void glmQuaternionFromVectorAndScalarf(float q[4], const float v[3], const float w) {
  q[0] = w;
  q[1] = v[0];
  q[2] = v[1];
  q[3] = v[2];
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<glmQuaternionFromVectorAndScalarf>:
  endbr64
  movss  %xmm0,(%rdi)
  movss  (%rsi),%xmm0
  movss  %xmm0,0x4(%rdi)
  movss  0x4(%rsi),%xmm0
  movss  %xmm0,0x8(%rdi)
  movss  0x8(%rsi),%xmm0
  movss  %xmm0,0xc(%rdi)
  ret
```

assistant: ```c
void glmQuaternionFromVectorAndScalarf(float q[4], const float v[3], const float w) {
  q[0] = w;
  q[1] = v[0];
  q[2] = v[1];
  q[3] = v[2];
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<pkey_to_pub_string>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  movq   $0x0,-0x8(%rbp)
  movq   $0x0,-0x10(%rbp)
  mov    $0x0,%eax
  call   <BIO_s_mem@plt>
  mov    %eax,%edi
  call   <BIO_new@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  jne    L23
  mov    $0x0,%eax
  jmp    L14
L23:
  mov    -0x18(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <PEM_write_bio_PUBKEY@plt>
  cmp    $0x1,%eax
  jne    L2
  mov    -0x28(%rbp),%rdx
  mov    -0x20(%rbp),%rcx
  mov    -0x8(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <BIO_read@plt>
  mov    %rax,-0x10(%rbp)
L2:
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <BIO_free@plt>
  mov    -0x10(%rbp),%rax
L14:
  leave
  ret
```

assistant: ```c
size_t pkey_to_pub_string(EVP_PKEY *key, unsigned char **string, size_t len) {
  BIO *bo = NULL;
  size_t actual_len = 0;
  if ((bo = BIO_new(BIO_s_mem())) == NULL)
    return 0;
  if (PEM_write_bio_PUBKEY(bo, key) == 1)
    actual_len = BIO_read(bo, string, len);
  BIO_free(bo);
  return actual_len;
}
```
user: What is the c source code of the assembly code below:

```asm
<pkey_to_pub_string>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbp
  mov    %rsi,%r12
  mov    %rdx,%r13
  mov    $0x0,%eax
  call   <BIO_s_mem@plt>
  mov    %eax,%edi
  call   <BIO_new@plt>
  mov    $0x0,%r14d
  test   %rax,%rax
  je     L22
  mov    %rax,%rbx
  mov    %rbp,%rsi
  mov    %rax,%rdi
  call   <PEM_write_bio_PUBKEY@plt>
  cmp    $0x1,%eax
  je     L16
L14:
  mov    %rbx,%rdi
  call   <BIO_free@plt>
L22:
  mov    %r14,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L16:
  mov    %r13,%rdx
  mov    %r12,%rsi
  mov    %rbx,%rdi
  call   <BIO_read@plt>
  mov    %rax,%r14
  jmp    L14
```

assistant: ```c
size_t pkey_to_pub_string(EVP_PKEY *key, unsigned char **string, size_t len) {
  BIO *bo = NULL;
  size_t actual_len = 0;
  if ((bo = BIO_new(BIO_s_mem())) == NULL)
    return 0;
  if (PEM_write_bio_PUBKEY(bo, key) == 1)
    actual_len = BIO_read(bo, string, len);
  BIO_free(bo);
  return actual_len;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<pkey_to_pub_string>:
  endbr64
  push   %r15
  xor    %eax,%eax
  xor    %r15d,%r15d
  push   %r14
  mov    %rdi,%r14
  push   %r13
  mov    %rdx,%r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  call   <BIO_s_mem@plt>
  mov    %eax,%edi
  call   <BIO_new@plt>
  test   %rax,%rax
  je     L0
  mov    %r14,%rsi
  mov    %rax,%rdi
  mov    %rax,%rbp
  call   <PEM_write_bio_PUBKEY@plt>
  cmp    $0x1,%eax
  je     L10
L21:
  mov    %rbp,%rdi
  call   <BIO_free@plt>
L0:
  pop    %rbp
  mov    %r15,%rax
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L10:
  mov    %r13,%rdx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <BIO_read@plt>
  mov    %rax,%r15
  jmp    L21
```

assistant: ```c
size_t pkey_to_pub_string(EVP_PKEY *key, unsigned char **string, size_t len) {
  BIO *bo = NULL;
  size_t actual_len = 0;
  if ((bo = BIO_new(BIO_s_mem())) == NULL)
    return 0;
  if (PEM_write_bio_PUBKEY(bo, key) == 1)
    actual_len = BIO_read(bo, string, len);
  BIO_free(bo);
  return actual_len;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<pkey_to_pub_string>:
  endbr64
  push   %r15
  xor    %eax,%eax
  xor    %r15d,%r15d
  push   %r14
  mov    %rdi,%r14
  push   %r13
  mov    %rdx,%r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  call   <BIO_s_mem@plt>
  mov    %eax,%edi
  call   <BIO_new@plt>
  test   %rax,%rax
  je     L1
  mov    %r14,%rsi
  mov    %rax,%rdi
  mov    %rax,%rbp
  call   <PEM_write_bio_PUBKEY@plt>
  cmp    $0x1,%eax
  je     L4
L19:
  mov    %rbp,%rdi
  call   <BIO_free@plt>
L1:
  pop    %rbp
  mov    %r15,%rax
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L4:
  mov    %r13,%rdx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <BIO_read@plt>
  mov    %rax,%r15
  jmp    L19
```

assistant: ```c
size_t pkey_to_pub_string(EVP_PKEY *key, unsigned char **string, size_t len) {
  BIO *bo = NULL;
  size_t actual_len = 0;
  if ((bo = BIO_new(BIO_s_mem())) == NULL)
    return 0;
  if (PEM_write_bio_PUBKEY(bo, key) == 1)
    actual_len = BIO_read(bo, string, len);
  BIO_free(bo);
  return actual_len;
}
```
user: Translate the below assembly code into C programming language:

```asm
<kmemmem>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbp
  mov    %esi,%r14d
  mov    %rdx,%rbx
  mov    %ecx,%r12d
  mov    %r8,%r13
  test   %r8,%r8
  je     L33
  mov    (%r8),%rdi
  test   %rdi,%rdi
  je     L95
L48:
  movslq %r12d,%r9
  sub    %r12d,%r14d
  mov    $0x0,%eax
  js     L53
L34:
  mov    $0x0,%esi
  lea    -0x1(%r12),%r8d
  jmp    L26
L75:
  test   %eax,%eax
  js     L8
  lea    (%rax,%rsi,1),%eax
  cltq
  movzbl 0x0(%rbp,%rax,1),%eax
  add    %r9,%rax
  mov    (%rdi,%rax,4),%eax
  sub    %r12d,%eax
  lea    0x1(%rdx,%rax,1),%eax
  movslq %edx,%rdx
  mov    (%rdi,%rdx,4),%edx
  cmp    %edx,%eax
  cmovl  %edx,%eax
  add    %eax,%esi
  cmp    %r14d,%esi
  jg     L83
L26:
  test   %r8d,%r8d
  js     L8
  movslq %r8d,%rax
  movslq %esi,%rcx
  add    %rbp,%rcx
L5:
  mov    %eax,%edx
  movzbl (%rcx,%rax,1),%r10d
  cmp    %r10b,(%rbx,%rax,1)
  jne    L75
  sub    $0x1,%rax
  test   %eax,%eax
  jns    L5
L8:
  movslq %esi,%rsi
  lea    0x0(%rbp,%rsi,1),%rax
L53:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L83:
  mov    $0x0,%eax
  test   %r13,%r13
  jne    L53
L79:
  call   <free@plt>
  mov    $0x0,%eax
  jmp    L53
L33:
  mov    %ecx,%esi
  mov    %rdx,%rdi
  call   <ksBM_prep@plt>
  mov    %rax,%rdi
  movslq %r12d,%r9
  sub    %r12d,%r14d
  jns    L34
  jmp    L79
L95:
  mov    %ecx,%esi
  mov    %rdx,%rdi
  call   <ksBM_prep@plt>
  mov    %rax,%rdi
  cmpq   $0x0,0x0(%r13)
  jne    L48
  mov    %rdi,0x0(%r13)
  jmp    L48
```

assistant: ```c
void *kmemmem(const void *_str, int n, const void *_pat, int m, int **_prep) {
  int i, j;
  int *prep = 0;
  int *bmGs;
  int *bmBc;
  const unsigned char *str;
  const unsigned char *pat;
  str = (const unsigned char *)_str;
  pat = (const unsigned char *)_pat;
  prep = ((_prep == 0) || (*_prep == 0)) ? ksBM_prep(pat, m) : *_prep;
  if (_prep && (*_prep == 0))
    *_prep = prep;
  bmGs = prep;
  bmBc = prep + m;
  j = 0;
  while (j <= (n - m)) {
    for (i = m - 1; (i >= 0) && (pat[i] == str[i + j]); --i)
      ;
    if (i >= 0) {
      int max = bmBc[str[i + j]] - m + 1 + i;
      if (max < bmGs[i])
        max = bmGs[i];
      j += max;
    } else
      return (void *)(str + j);
  }
  if (_prep == 0)
    free(prep);
  return 0;
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<kmemmem>:
  endbr64
  push   %r15
  mov    %r8,%r15
  push   %r14
  movslq %ecx,%r14
  push   %r13
  sub    %r14d,%esi
  push   %r12
  mov    %esi,%r13d
  mov    %rdi,%r12
  push   %rbp
  mov    %r14,%rbp
  push   %rbx
  mov    %rdx,%rbx
  sub    $0x8,%rsp
  test   %r8,%r8
  je     L9
  mov    (%r8),%r8
  test   %r8,%r8
  je     L124
L46:
  test   %r13d,%r13d
  js     L94
L5:
  lea    -0x1(%rbp),%r9d
  xor    %edi,%edi
  nopw   0x0(%rax,%rax,1)
L68:
  test   %r9d,%r9d
  js     L121
  movslq %edi,%r10
  movslq %r9d,%rax
  lea    (%r12,%r10,1),%rsi
  jmp    L23
  nopl   0x0(%rax)
L84:
  sub    $0x1,%rax
  cmp    $0xffffffff,%eax
  je     L76
L23:
  movzbl (%rsi,%rax,1),%edx
  cmp    %dl,(%rbx,%rax,1)
  je     L84
  add    %r14,%rdx
  mov    (%r8,%rdx,4),%edx
  sub    %ebp,%edx
  lea    0x1(%rax,%rdx,1),%edx
  mov    (%r8,%rax,4),%eax
  cmp    %eax,%edx
  cmovl  %eax,%edx
  add    %edx,%edi
  cmp    %r13d,%edi
  jle    L68
  test   %r15,%r15
  je     L20
L94:
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L121:
  movslq %edi,%r10
L76:
  add    $0x8,%rsp
  lea    (%r12,%r10,1),%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L9:
  mov    %r14d,%esi
  mov    %rdx,%rdi
  call   <ksBM_prep@plt>
  mov    %rax,%r8
  test   %r13d,%r13d
  jns    L5
L20:
  mov    %r8,%rdi
  call   <free@plt>
  jmp    L94
L124:
  mov    %r14d,%esi
  mov    %rdx,%rdi
  call   <ksBM_prep@plt>
  cmpq   $0x0,(%r15)
  mov    %rax,%r8
  jne    L46
  mov    %r8,(%r15)
  jmp    L46
```

assistant: ```c
void *kmemmem(const void *_str, int n, const void *_pat, int m, int **_prep) {
  int i, j;
  int *prep = 0;
  int *bmGs;
  int *bmBc;
  const unsigned char *str;
  const unsigned char *pat;
  str = (const unsigned char *)_str;
  pat = (const unsigned char *)_pat;
  prep = ((_prep == 0) || (*_prep == 0)) ? ksBM_prep(pat, m) : *_prep;
  if (_prep && (*_prep == 0))
    *_prep = prep;
  bmGs = prep;
  bmBc = prep + m;
  j = 0;
  while (j <= (n - m)) {
    for (i = m - 1; (i >= 0) && (pat[i] == str[i + j]); --i)
      ;
    if (i >= 0) {
      int max = bmBc[str[i + j]] - m + 1 + i;
      if (max < bmGs[i])
        max = bmGs[i];
      j += max;
    } else
      return (void *)(str + j);
  }
  if (_prep == 0)
    free(prep);
  return 0;
}
```
user: What is the c source code of the assembly code below:

```asm
<kmemmem>:
  endbr64
  push   %r15
  mov    %r8,%r15
  push   %r14
  movslq %ecx,%r14
  push   %r13
  sub    %r14d,%esi
  push   %r12
  mov    %esi,%r13d
  mov    %rdi,%r12
  push   %rbp
  mov    %r14,%rbp
  push   %rbx
  mov    %rdx,%rbx
  sub    $0x8,%rsp
  test   %r8,%r8
  je     L73
  mov    (%r8),%r8
  test   %r8,%r8
  je     L109
L117:
  test   %r13d,%r13d
  js     L61
L81:
  lea    -0x1(%rbp),%r9d
  xor    %edi,%edi
  nopw   0x0(%rax,%rax,1)
L114:
  test   %r9d,%r9d
  js     L115
  movslq %edi,%r10
  movslq %r9d,%rax
  lea    (%r12,%r10,1),%rsi
  jmp    L14
  nopl   0x0(%rax)
L16:
  sub    $0x1,%rax
  cmp    $0xffffffff,%eax
  je     L110
L14:
  movzbl (%rsi,%rax,1),%edx
  cmp    %dl,(%rbx,%rax,1)
  je     L16
  add    %r14,%rdx
  mov    (%r8,%rdx,4),%edx
  sub    %ebp,%edx
  lea    0x1(%rax,%rdx,1),%edx
  mov    (%r8,%rax,4),%eax
  cmp    %eax,%edx
  cmovl  %eax,%edx
  add    %edx,%edi
  cmp    %r13d,%edi
  jle    L114
  test   %r15,%r15
  je     L62
L61:
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L115:
  movslq %edi,%r10
L110:
  add    $0x8,%rsp
  lea    (%r12,%r10,1),%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L73:
  mov    %r14d,%esi
  mov    %rdx,%rdi
  call   <ksBM_prep@plt>
  mov    %rax,%r8
  test   %r13d,%r13d
  jns    L81
L62:
  mov    %r8,%rdi
  call   <free@plt>
  jmp    L61
L109:
  mov    %r14d,%esi
  mov    %rdx,%rdi
  call   <ksBM_prep@plt>
  cmpq   $0x0,(%r15)
  mov    %rax,%r8
  jne    L117
  mov    %r8,(%r15)
  jmp    L117
```

assistant: ```c
void *kmemmem(const void *_str, int n, const void *_pat, int m, int **_prep) {
  int i, j;
  int *prep = 0;
  int *bmGs;
  int *bmBc;
  const unsigned char *str;
  const unsigned char *pat;
  str = (const unsigned char *)_str;
  pat = (const unsigned char *)_pat;
  prep = ((_prep == 0) || (*_prep == 0)) ? ksBM_prep(pat, m) : *_prep;
  if (_prep && (*_prep == 0))
    *_prep = prep;
  bmGs = prep;
  bmBc = prep + m;
  j = 0;
  while (j <= (n - m)) {
    for (i = m - 1; (i >= 0) && (pat[i] == str[i + j]); --i)
      ;
    if (i >= 0) {
      int max = bmBc[str[i + j]] - m + 1 + i;
      if (max < bmGs[i])
        max = bmGs[i];
      j += max;
    } else
      return (void *)(str + j);
  }
  if (_prep == 0)
    free(prep);
  return 0;
}
```