ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 下面的汇编指令对应的C源代码是什么：

```asm
<sm4Lt>:
  endbr64
  push   %r13
  push   %r12
  mov    %rdi,%r12
  shr    $0x18,%edi
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  call   <sm4Sbox@plt>
  mov    %r12,%rdi
  shr    $0x10,%rdi
  mov    %eax,%ebx
  movzbl %dil,%edi
  call   <sm4Sbox@plt>
  movzbl %al,%r13d
  mov    %r12d,%eax
  movzbl %ah,%edi
  shl    $0x10,%r13
  call   <sm4Sbox@plt>
  movzbl %r12b,%edi
  movzbl %al,%ebp
  call   <sm4Sbox@plt>
  movzbl %bl,%edx
  shl    $0x8,%rbp
  add    $0x8,%rsp
  shl    $0x18,%rdx
  movzbl %al,%eax
  pop    %rbx
  or     %r13,%rdx
  or     %rax,%rdx
  or     %rbp,%rdx
  pop    %rbp
  pop    %r12
  mov    %rdx,%rcx
  lea    0x0(,%rdx,4),%rax
  mov    %rdx,%rsi
  pop    %r13
  shr    $0x1e,%rcx
  shr    $0x16,%rsi
  or     %rcx,%rax
  mov    %rdx,%rcx
  shl    $0xa,%rcx
  or     %rsi,%rcx
  mov    %rdx,%rsi
  xor    %rcx,%rax
  mov    %rdx,%rcx
  shr    $0xe,%rsi
  shl    $0x12,%rcx
  xor    %rdx,%rax
  or     %rsi,%rcx
  xor    %rcx,%rax
  mov    %rdx,%rcx
  shr    $0x8,%rdx
  shl    $0x18,%rcx
  or     %rcx,%rdx
  xor    %rdx,%rax
  ret
```

assistant: ```c
unsigned long sm4Lt(unsigned long ka) {
  unsigned long bb = 0;
  unsigned long c = 0;
  unsigned char a[4];
  unsigned char b[4];
  {
    (a)[(0)] = (unsigned char)((ka) >> 24);
    (a)[(0) + 1] = (unsigned char)((ka) >> 16);
    (a)[(0) + 2] = (unsigned char)((ka) >> 8);
    (a)[(0) + 3] = (unsigned char)((ka));
  }
  b[0] = sm4Sbox(a[0]);
  b[1] = sm4Sbox(a[1]);
  b[2] = sm4Sbox(a[2]);
  b[3] = sm4Sbox(a[3]);
  { (bb) = ((unsigned long)(b)[(0)] << 24) | ((unsigned long)(b)[(0) + 1] << 16) | ((unsigned long)(b)[(0) + 2] << 8) | ((unsigned long)(b)[(0) + 3]); }
  c = bb ^ ((((((bb)) & 0xFFFFFFFF) << 2) | ((bb) >> (32 - 2)))) ^ ((((((bb)) & 0xFFFFFFFF) << 10) | ((bb) >> (32 - 10)))) ^ ((((((bb)) & 0xFFFFFFFF) << 18) | ((bb) >> (32 - 18)))) ^ ((((((bb)) & 0xFFFFFFFF) << 24) | ((bb) >> (32 - 24))));
  return c;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<sm4Lt>:
  endbr64
  push   %r13
  push   %r12
  mov    %rdi,%r12
  shr    $0x18,%edi
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  call   <sm4Sbox@plt>
  mov    %r12,%rdi
  shr    $0x10,%rdi
  mov    %eax,%ebx
  movzbl %dil,%edi
  call   <sm4Sbox@plt>
  movzbl %al,%r13d
  mov    %r12d,%eax
  movzbl %ah,%edi
  shl    $0x10,%r13
  call   <sm4Sbox@plt>
  movzbl %r12b,%edi
  movzbl %al,%ebp
  call   <sm4Sbox@plt>
  movzbl %bl,%edx
  shl    $0x8,%rbp
  add    $0x8,%rsp
  shl    $0x18,%rdx
  movzbl %al,%eax
  pop    %rbx
  or     %r13,%rdx
  or     %rax,%rdx
  or     %rbp,%rdx
  pop    %rbp
  pop    %r12
  mov    %rdx,%rcx
  lea    0x0(,%rdx,4),%rax
  mov    %rdx,%rsi
  pop    %r13
  shr    $0x1e,%rcx
  shr    $0x16,%rsi
  or     %rcx,%rax
  mov    %rdx,%rcx
  shl    $0xa,%rcx
  or     %rsi,%rcx
  mov    %rdx,%rsi
  xor    %rcx,%rax
  mov    %rdx,%rcx
  shr    $0xe,%rsi
  shl    $0x12,%rcx
  xor    %rdx,%rax
  or     %rsi,%rcx
  xor    %rcx,%rax
  mov    %rdx,%rcx
  shr    $0x8,%rdx
  shl    $0x18,%rcx
  or     %rcx,%rdx
  xor    %rdx,%rax
  ret
```

assistant: ```c
unsigned long sm4Lt(unsigned long ka) {
  unsigned long bb = 0;
  unsigned long c = 0;
  unsigned char a[4];
  unsigned char b[4];
  {
    (a)[(0)] = (unsigned char)((ka) >> 24);
    (a)[(0) + 1] = (unsigned char)((ka) >> 16);
    (a)[(0) + 2] = (unsigned char)((ka) >> 8);
    (a)[(0) + 3] = (unsigned char)((ka));
  }
  b[0] = sm4Sbox(a[0]);
  b[1] = sm4Sbox(a[1]);
  b[2] = sm4Sbox(a[2]);
  b[3] = sm4Sbox(a[3]);
  { (bb) = ((unsigned long)(b)[(0)] << 24) | ((unsigned long)(b)[(0) + 1] << 16) | ((unsigned long)(b)[(0) + 2] << 8) | ((unsigned long)(b)[(0) + 3]); }
  c = bb ^ ((((((bb)) & 0xFFFFFFFF) << 2) | ((bb) >> (32 - 2)))) ^ ((((((bb)) & 0xFFFFFFFF) << 10) | ((bb) >> (32 - 10)))) ^ ((((((bb)) & 0xFFFFFFFF) << 18) | ((bb) >> (32 - 18)))) ^ ((((((bb)) & 0xFFFFFFFF) << 24) | ((bb) >> (32 - 24))));
  return c;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<USBDevEndpointConfigGet>:
  endbr64
  mov    %rcx,%rax
  testl  $0x2000,(%rcx)
  je     L104
  movl   $0x2000,(%rcx)
  lea    -0x10(%rdi,%rsi,1),%ecx
  lea    0x110(%rcx),%esi
  movslq %esi,%rsi
  mov    (%rsi),%rsi
  mov    %esi,(%rdx)
  add    $0x113,%ecx
  movslq %ecx,%rcx
  mov    (%rcx),%rdx
  test   $0x80,%dl
  je     L19
  orl    $0x1,(%rax)
L19:
  test   $0x10,%dl
  je     L10
  test   $0x4,%dl
  je     L66
  orl    $0x10,(%rax)
L10:
  test   $0x40,%dl
  jne    L2
  orl    $0x100,(%rax)
  ret
L66:
  orl    $0x8,(%rax)
  jmp    L10
L104:
  movl   $0x0,(%rcx)
  lea    -0x10(%rdi,%rsi,1),%ecx
  lea    0x114(%rcx),%esi
  movslq %esi,%rsi
  mov    (%rsi),%rsi
  mov    %esi,(%rdx)
  add    $0x117,%ecx
  movslq %ecx,%rcx
  mov    (%rcx),%rdx
  test   $0x80,%dl
  je     L70
  orl    $0x4,(%rax)
L70:
  test   $0x20,%dl
  je     L64
  test   $0x8,%dl
  je     L7
  orl    $0x10,(%rax)
L64:
  test   $0x40,%dl
  jne    L2
  orl    $0x100,(%rax)
L2:
  ret
L7:
  orl    $0x8,(%rax)
  jmp    L64
```

assistant: ```c
void USBDevEndpointConfigGet(uint32_t ui32Base, uint32_t ui32Endpoint, uint32_t *pui32MaxPacketSize, uint32_t *pui32Flags) {
  uint32_t ui32Register;
  ;
  ;

  ;
  if (*pui32Flags & 0x00002000) {
    *pui32Flags = 0x00002000;
    *pui32MaxPacketSize = (uint32_t)(*((volatile uint16_t *)(ui32Base + (ui32Endpoint - 0x10) + 0x00000110)));
    ui32Register = (uint32_t)(*((volatile uint8_t *)(ui32Base + (ui32Endpoint - 0x10) + 0x00000113)));
    if (ui32Register & 0x00000080) {
      *pui32Flags |= 0x00000001;
    }
    if (ui32Register & 0x00000010) {
      if (ui32Register & 0x00000004) {
        *pui32Flags |= 0x00000010;
      } else {
        *pui32Flags |= 0x00000008;
      }
    }
    if (ui32Register & 0x00000040) {
      *pui32Flags |= 0x00000000;
    } else {
      *pui32Flags |= 0x00000100;
    }
  } else {
    *pui32Flags = 0x00000000;
    *pui32MaxPacketSize = (uint32_t)(*((volatile uint16_t *)(ui32Base + (ui32Endpoint - 0x10) + 0x00000114)));
    ui32Register = (uint32_t)(*((volatile uint8_t *)(ui32Base + (ui32Endpoint - 0x10) + 0x00000117)));
    if (ui32Register & 0x00000080) {
      *pui32Flags |= 0x00000004;
    }
    if (ui32Register & 0x00000020) {
      if (ui32Register & 0x00000008) {
        *pui32Flags |= 0x00000010;
      } else {
        *pui32Flags |= 0x00000008;
      }
    }
    if (ui32Register & 0x00000040) {
      *pui32Flags |= 0x00000000;
    } else {
      *pui32Flags |= 0x00000100;
    }
  }
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<USBDevEndpointConfigGet>:
  endbr64
  mov    %rcx,%rax
  lea    -0x10(%rdi,%rsi,1),%ecx
  testl  $0x2000,(%rax)
  je     L43
  lea    0x110(%rcx),%esi
  add    $0x113,%ecx
  movl   $0x2000,(%rax)
  movslq %esi,%rsi
  movslq %ecx,%rcx
  mov    (%rsi),%rsi
  mov    %esi,(%rdx)
  mov    (%rcx),%rdx
  test   $0x80,%dl
  je     L24
  orl    $0x1,(%rax)
L24:
  test   $0x10,%dl
  jne    L54
L36:
  and    $0x40,%edx
  jne    L44
  orl    $0x100,(%rax)
L44:
  ret
  nopl   0x0(%rax)
L43:
  lea    0x114(%rcx),%esi
  add    $0x117,%ecx
  movl   $0x0,(%rax)
  movslq %esi,%rsi
  movslq %ecx,%rcx
  mov    (%rsi),%rsi
  mov    %esi,(%rdx)
  mov    (%rcx),%rdx
  test   $0x80,%dl
  je     L75
  orl    $0x4,(%rax)
L75:
  test   $0x20,%dl
  je     L36
  mov    (%rax),%ecx
  mov    %ecx,%esi
  or     $0x10,%ecx
  or     $0x8,%esi
  test   $0x8,%dl
  cmove  %esi,%ecx
  mov    %ecx,(%rax)
  jmp    L36
  nopl   0x0(%rax)
L54:
  mov    (%rax),%ecx
  mov    %ecx,%esi
  or     $0x10,%ecx
  or     $0x8,%esi
  test   $0x4,%dl
  cmove  %esi,%ecx
  mov    %ecx,(%rax)
  jmp    L36
```

assistant: ```c
void USBDevEndpointConfigGet(uint32_t ui32Base, uint32_t ui32Endpoint, uint32_t *pui32MaxPacketSize, uint32_t *pui32Flags) {
  uint32_t ui32Register;
  ;
  ;

  ;
  if (*pui32Flags & 0x00002000) {
    *pui32Flags = 0x00002000;
    *pui32MaxPacketSize = (uint32_t)(*((volatile uint16_t *)(ui32Base + (ui32Endpoint - 0x10) + 0x00000110)));
    ui32Register = (uint32_t)(*((volatile uint8_t *)(ui32Base + (ui32Endpoint - 0x10) + 0x00000113)));
    if (ui32Register & 0x00000080) {
      *pui32Flags |= 0x00000001;
    }
    if (ui32Register & 0x00000010) {
      if (ui32Register & 0x00000004) {
        *pui32Flags |= 0x00000010;
      } else {
        *pui32Flags |= 0x00000008;
      }
    }
    if (ui32Register & 0x00000040) {
      *pui32Flags |= 0x00000000;
    } else {
      *pui32Flags |= 0x00000100;
    }
  } else {
    *pui32Flags = 0x00000000;
    *pui32MaxPacketSize = (uint32_t)(*((volatile uint16_t *)(ui32Base + (ui32Endpoint - 0x10) + 0x00000114)));
    ui32Register = (uint32_t)(*((volatile uint8_t *)(ui32Base + (ui32Endpoint - 0x10) + 0x00000117)));
    if (ui32Register & 0x00000080) {
      *pui32Flags |= 0x00000004;
    }
    if (ui32Register & 0x00000020) {
      if (ui32Register & 0x00000008) {
        *pui32Flags |= 0x00000010;
      } else {
        *pui32Flags |= 0x00000008;
      }
    }
    if (ui32Register & 0x00000040) {
      *pui32Flags |= 0x00000000;
    } else {
      *pui32Flags |= 0x00000100;
    }
  }
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<USBDevEndpointConfigGet>:
  endbr64
  mov    %rcx,%rax
  lea    -0x10(%rdi,%rsi,1),%ecx
  testl  $0x2000,(%rax)
  je     L40
  lea    0x110(%rcx),%esi
  add    $0x113,%ecx
  movl   $0x2000,(%rax)
  movslq %esi,%rsi
  movslq %ecx,%rcx
  mov    (%rsi),%rsi
  mov    %esi,(%rdx)
  mov    (%rcx),%rdx
  test   $0x80,%dl
  je     L43
  orl    $0x1,(%rax)
L43:
  test   $0x10,%dl
  jne    L63
L21:
  and    $0x40,%edx
  jne    L35
  orl    $0x100,(%rax)
L35:
  ret
  nopl   0x0(%rax)
L40:
  lea    0x114(%rcx),%esi
  add    $0x117,%ecx
  movl   $0x0,(%rax)
  movslq %esi,%rsi
  movslq %ecx,%rcx
  mov    (%rsi),%rsi
  mov    %esi,(%rdx)
  mov    (%rcx),%rdx
  test   $0x80,%dl
  je     L52
  orl    $0x4,(%rax)
L52:
  test   $0x20,%dl
  je     L21
  mov    (%rax),%ecx
  mov    %ecx,%esi
  or     $0x10,%ecx
  or     $0x8,%esi
  test   $0x8,%dl
  cmove  %esi,%ecx
  mov    %ecx,(%rax)
  jmp    L21
  nopl   0x0(%rax)
L63:
  mov    (%rax),%ecx
  mov    %ecx,%esi
  or     $0x10,%ecx
  or     $0x8,%esi
  test   $0x4,%dl
  cmove  %esi,%ecx
  mov    %ecx,(%rax)
  jmp    L21
```

assistant: ```c
void USBDevEndpointConfigGet(uint32_t ui32Base, uint32_t ui32Endpoint, uint32_t *pui32MaxPacketSize, uint32_t *pui32Flags) {
  uint32_t ui32Register;
  ;
  ;

  ;
  if (*pui32Flags & 0x00002000) {
    *pui32Flags = 0x00002000;
    *pui32MaxPacketSize = (uint32_t)(*((volatile uint16_t *)(ui32Base + (ui32Endpoint - 0x10) + 0x00000110)));
    ui32Register = (uint32_t)(*((volatile uint8_t *)(ui32Base + (ui32Endpoint - 0x10) + 0x00000113)));
    if (ui32Register & 0x00000080) {
      *pui32Flags |= 0x00000001;
    }
    if (ui32Register & 0x00000010) {
      if (ui32Register & 0x00000004) {
        *pui32Flags |= 0x00000010;
      } else {
        *pui32Flags |= 0x00000008;
      }
    }
    if (ui32Register & 0x00000040) {
      *pui32Flags |= 0x00000000;
    } else {
      *pui32Flags |= 0x00000100;
    }
  } else {
    *pui32Flags = 0x00000000;
    *pui32MaxPacketSize = (uint32_t)(*((volatile uint16_t *)(ui32Base + (ui32Endpoint - 0x10) + 0x00000114)));
    ui32Register = (uint32_t)(*((volatile uint8_t *)(ui32Base + (ui32Endpoint - 0x10) + 0x00000117)));
    if (ui32Register & 0x00000080) {
      *pui32Flags |= 0x00000004;
    }
    if (ui32Register & 0x00000020) {
      if (ui32Register & 0x00000008) {
        *pui32Flags |= 0x00000010;
      } else {
        *pui32Flags |= 0x00000008;
      }
    }
    if (ui32Register & 0x00000040) {
      *pui32Flags |= 0x00000000;
    } else {
      *pui32Flags |= 0x00000100;
    }
  }
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  movl   $0x2,-0x8(%rbp)
  movl   $0x1,-0x4(%rbp)
  jmp    L8
L5:
  mov    -0x8(%rbp),%eax
  mov    %eax,%edi
  call   <isPrime@plt>
  test   %rax,%rax
  je     L6
  addl   $0x1,-0x4(%rbp)
L6:
  addl   $0x1,-0x8(%rbp)
L8:
  cmpl   $0x2711,-0x4(%rbp)
  jle    L5
  subl   $0x1,-0x8(%rbp)
  mov    -0x8(%rbp),%eax
  mov    %eax,%esi
  lea    D2(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  nop
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: tag: D2
type_guessed: string

tool: D2: %d


assistant: ```c
void main(void) {
  int i, j;
  for (i = 2, j = 1; j <= 10001; ++i) {
    if (isPrime(i))
      ++j;
  }
  printf("%d\n", --i);
}
```
user: What is the c source code of the assembly code below?

```asm
<main>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    $0x1,%ebp
  mov    $0x2,%ebx
  jmp    L16
L14:
  mov    %eax,%ebx
L16:
  mov    %ebx,%edi
  call   <isPrime@plt>
  cmp    $0x1,%rax
  sbb    $0xffffffff,%ebp
  lea    0x1(%rbx),%eax
  cmp    $0x2711,%ebp
  jle    L14
  mov    %ebx,%esi
  lea    D8(%rip),%rdi
  call   <printf@plt>
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

tool_calls: name: unpack_data
arguments: tag: D8
type: string

tool: D8: %d


assistant: ```c
void main(void) {
  int i, j;
  for (i = 2, j = 1; j <= 10001; ++i) {
    if (isPrime(i))
      ++j;
  }
  printf("%d\n", --i);
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<main>:
  endbr64
  push   %rbp
  mov    $0x2,%ebp
  push   %rbx
  mov    $0x1,%ebx
  sub    $0x8,%rsp
  jmp    L16
  cs nopw 0x0(%rax,%rax,1)
L19:
  mov    %eax,%ebp
L16:
  mov    %ebp,%edi
  call   <isPrime@plt>
  cmp    $0x1,%rax
  lea    0x1(%rbp),%eax
  sbb    $0xffffffff,%ebx
  cmp    $0x2712,%ebx
  jne    L19
  add    $0x8,%rsp
  mov    %ebp,%esi
  lea    D5(%rip),%rdi
  pop    %rbx
  pop    %rbp
  jmp    1060 <printf@plt>
```

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

tool: D5: %d


assistant: ```c
void main(void) {
  int i, j;
  for (i = 2, j = 1; j <= 10001; ++i) {
    if (isPrime(i))
      ++j;
  }
  printf("%d\n", --i);
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<main>:
  endbr64
  push   %rbp
  mov    $0x2,%ebp
  push   %rbx
  mov    $0x1,%ebx
  sub    $0x8,%rsp
  jmp    L11
  cs nopw 0x0(%rax,%rax,1)
L2:
  mov    %eax,%ebp
L11:
  mov    %ebp,%edi
  call   <isPrime@plt>
  cmp    $0x1,%rax
  lea    0x1(%rbp),%eax
  sbb    $0xffffffff,%ebx
  cmp    $0x2712,%ebx
  jne    L2
  add    $0x8,%rsp
  mov    %ebp,%esi
  lea    D6(%rip),%rdi
  pop    %rbx
  pop    %rbp
  jmp    1060 <printf@plt>
```

tool_calls: name: parse_data
arguments: label: D6
type_infered: string

tool: D6: %d


assistant: ```c
void main(void) {
  int i, j;
  for (i = 2, j = 1; j <= 10001; ++i) {
    if (isPrime(i))
      ++j;
  }
  printf("%d\n", --i);
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<lcd_printf16>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %rdi,(%rsp)
  mov    %esi,0x8(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  test   %rdi,%rdi
  je     L175
  mov    %edx,%r13d
  mov    %rcx,%rbx
  test   %rcx,%rcx
  je     L175
  cmp    $0x1e0,%esi
  jg     L90
  cmp    $0x110,%edx
  jg     L90
  mov    $0x1e0,%eax
  sub    %esi,%eax
  lea    0x7(%rax),%edx
  cmovs  %edx,%eax
  sar    $0x3,%eax
  mov    %eax,0xc(%rsp)
  movzbl (%rcx),%ecx
  test   %cl,%cl
  je     L14
  mov    %eax,%r12d
  mov    %esi,%ebp
  mov    $0x2,%r14d
  lea    0x10(%rsp),%r15
  jmp    L5
L155:
  movzbl %cl,%ecx
  mov    %r13d,%edx
  mov    %ebp,%esi
  mov    (%rsp),%rdi
  call   <putc_lcd_asc16@plt>
  add    $0x1,%rbx
  add    $0x8,%ebp
  sub    $0x1,%r12d
L118:
  cmp    $0x2,%r12d
  jg     L82
  add    $0x10,%r13d
  sub    $0x1,%r14d
  je     L136
  mov    0xc(%rsp),%r12d
  mov    0x8(%rsp),%ebp
L82:
  movzbl (%rbx),%ecx
  test   %cl,%cl
  je     L141
L5:
  test   %cl,%cl
  jns    L155
  add    $0x60,%ecx
  movzbl 0x1(%rbx),%eax
  test   %al,%al
  jns    L0
  add    $0x2,%rbx
  movzbl %cl,%ecx
  sub    $0x1,%ecx
  imul   $0x5e,%ecx,%ecx
  add    $0x60,%eax
  movzbl %al,%eax
  lea    -0x1(%rcx,%rax,1),%edi
  shl    $0x5,%edi
  movslq %edi,%rdi
  mov    %r15,%rsi
  call   <get_hzk16_font@plt>
  mov    %r15,%rcx
  mov    %r13d,%edx
  mov    %ebp,%esi
  mov    (%rsp),%rdi
  call   <putc_lcd_hzk16@plt>
  add    $0x10,%ebp
  sub    $0x2,%r12d
  jmp    L118
L141:
  mov    $0x0,%eax
L81:
  mov    0x38(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L1
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L175:
  mov    $0xffffffff,%eax
  jmp    L81
L90:
  mov    $0xfffffffe,%eax
  jmp    L81
L14:
  mov    $0x0,%eax
  jmp    L81
L0:
  mov    $0xfffffffc,%eax
  jmp    L81
L136:
  mov    $0xfffffffd,%eax
  jmp    L81
L1:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int lcd_printf16(char *fb, int x, int y, unsigned char *font) {
  unsigned char inode[2];
  unsigned char *ft;
  unsigned long ftoft;
  unsigned char mat[16][2];
  int xnum, curx, line, xreg;
  if (!fb | !font)
    return -1;
  if (x > 480 || y > 272)
    return -2;
  ft = font;
  xreg = x;
  xnum = (480 - x) / 8;
  curx = xnum;
  line = 2;
  while (*ft != '\0') {
    if (*ft & 0x80) {
      inode[0] = *ft++ - 0xa0;
      if (*ft & 0x80)
        inode[1] = *ft++ - 0xa0;
      else
        return -4;
      ftoft = ((inode[0] - 1) * 94 + (inode[1] - 1)) * 32;
      get_hzk16_font(ftoft, (unsigned char *)mat);
      putc_lcd_hzk16(fb, x, y, (unsigned char *)mat);
      x += 16;
      curx -= 2;
    } else {
      putc_lcd_asc16(fb, x, y, *ft);
      ft++;
      x += 8;
      curx -= 1;
    }
    if (curx > 2)
      continue;
    else {
      line--;
      curx = xnum;
      y += 16;
      x = xreg;
    }
    if (line == 0)
      return -3;
  }
  return 0;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<lcd_printf16>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %esi,0x8(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  test   %rdi,%rdi
  je     L26
  mov    %rcx,%rbp
  test   %rcx,%rcx
  je     L26
  cmp    $0x1e0,%esi
  jg     L28
  mov    %edx,%ebx
  cmp    $0x110,%edx
  jg     L28
  mov    $0x1e0,%r15d
  movzbl (%rcx),%ecx
  mov    %rdi,%r12
  lea    0x10(%rsp),%r13
  sub    %esi,%r15d
  movl   $0x2,0x4(%rsp)
  sar    $0x3,%r15d
  mov    %r15d,0xc(%rsp)
  mov    %r15d,%r14d
  mov    %esi,%r15d
  test   %cl,%cl
  jne    L43
  jmp    L143
  nopl   (%rax)
L100:
  movzbl 0x1(%rbp),%eax
  add    $0x60,%ecx
  test   %al,%al
  jns    L41
  movzbl %cl,%ecx
  add    $0x60,%eax
  mov    %r13,%rsi
  add    $0x2,%rbp
  sub    $0x1,%ecx
  movzbl %al,%eax
  sub    $0x2,%r14d
  imul   $0x5e,%ecx,%ecx
  lea    -0x1(%rcx,%rax,1),%edi
  shl    $0x5,%edi
  movslq %edi,%rdi
  call   <get_hzk16_font@plt>
  mov    %r15d,%esi
  mov    %r13,%rcx
  mov    %ebx,%edx
  mov    %r12,%rdi
  add    $0x10,%r15d
  call   <putc_lcd_hzk16@plt>
L91:
  cmp    $0x2,%r14d
  jg     L126
  add    $0x10,%ebx
  cmpl   $0x1,0x4(%rsp)
  je     L17
  movl   $0x1,0x4(%rsp)
  mov    0xc(%rsp),%r14d
  mov    0x8(%rsp),%r15d
L126:
  movzbl 0x0(%rbp),%ecx
  test   %cl,%cl
  je     L143
L43:
  test   %cl,%cl
  js     L100
  mov    %r15d,%esi
  mov    %ebx,%edx
  mov    %r12,%rdi
  add    $0x1,%rbp
  call   <putc_lcd_asc16@plt>
  add    $0x8,%r15d
  sub    $0x1,%r14d
  jmp    L91
  nopl   (%rax)
L143:
  xor    %eax,%eax
L114:
  mov    0x38(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L54
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L17:
  mov    $0xfffffffd,%eax
  jmp    L114
  nopw   0x0(%rax,%rax,1)
L41:
  mov    $0xfffffffc,%eax
  jmp    L114
L26:
  mov    $0xffffffff,%eax
  jmp    L114
L28:
  mov    $0xfffffffe,%eax
  jmp    L114
L54:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int lcd_printf16(char *fb, int x, int y, unsigned char *font) {
  unsigned char inode[2];
  unsigned char *ft;
  unsigned long ftoft;
  unsigned char mat[16][2];
  int xnum, curx, line, xreg;
  if (!fb | !font)
    return -1;
  if (x > 480 || y > 272)
    return -2;
  ft = font;
  xreg = x;
  xnum = (480 - x) / 8;
  curx = xnum;
  line = 2;
  while (*ft != '\0') {
    if (*ft & 0x80) {
      inode[0] = *ft++ - 0xa0;
      if (*ft & 0x80)
        inode[1] = *ft++ - 0xa0;
      else
        return -4;
      ftoft = ((inode[0] - 1) * 94 + (inode[1] - 1)) * 32;
      get_hzk16_font(ftoft, (unsigned char *)mat);
      putc_lcd_hzk16(fb, x, y, (unsigned char *)mat);
      x += 16;
      curx -= 2;
    } else {
      putc_lcd_asc16(fb, x, y, *ft);
      ft++;
      x += 8;
      curx -= 1;
    }
    if (curx > 2)
      continue;
    else {
      line--;
      curx = xnum;
      y += 16;
      x = xreg;
    }
    if (line == 0)
      return -3;
  }
  return 0;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<lcd_printf16>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %esi,0x8(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  test   %rdi,%rdi
  je     L43
  mov    %rcx,%rbp
  test   %rcx,%rcx
  je     L43
  cmp    $0x1e0,%esi
  jg     L4
  mov    %edx,%ebx
  cmp    $0x110,%edx
  jg     L4
  mov    $0x1e0,%r15d
  movzbl (%rcx),%ecx
  mov    %rdi,%r12
  lea    0x10(%rsp),%r13
  sub    %esi,%r15d
  movl   $0x2,0x4(%rsp)
  sar    $0x3,%r15d
  mov    %r15d,0xc(%rsp)
  mov    %r15d,%r14d
  mov    %esi,%r15d
  test   %cl,%cl
  jne    L85
  jmp    L133
  nopl   (%rax)
L74:
  movzbl 0x1(%rbp),%eax
  add    $0x60,%ecx
  test   %al,%al
  jns    L23
  movzbl %cl,%ecx
  add    $0x60,%eax
  mov    %r13,%rsi
  add    $0x2,%rbp
  sub    $0x1,%ecx
  movzbl %al,%eax
  sub    $0x2,%r14d
  imul   $0x5e,%ecx,%ecx
  lea    -0x1(%rcx,%rax,1),%edi
  shl    $0x5,%edi
  movslq %edi,%rdi
  call   <get_hzk16_font@plt>
  mov    %r15d,%esi
  mov    %r13,%rcx
  mov    %ebx,%edx
  mov    %r12,%rdi
  add    $0x10,%r15d
  call   <putc_lcd_hzk16@plt>
L17:
  cmp    $0x2,%r14d
  jg     L81
  add    $0x10,%ebx
  cmpl   $0x1,0x4(%rsp)
  je     L70
  movl   $0x1,0x4(%rsp)
  mov    0xc(%rsp),%r14d
  mov    0x8(%rsp),%r15d
L81:
  movzbl 0x0(%rbp),%ecx
  test   %cl,%cl
  je     L133
L85:
  test   %cl,%cl
  js     L74
  mov    %r15d,%esi
  mov    %ebx,%edx
  mov    %r12,%rdi
  add    $0x1,%rbp
  call   <putc_lcd_asc16@plt>
  add    $0x8,%r15d
  sub    $0x1,%r14d
  jmp    L17
  nopl   (%rax)
L133:
  xor    %eax,%eax
L15:
  mov    0x38(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L2
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L70:
  mov    $0xfffffffd,%eax
  jmp    L15
  nopw   0x0(%rax,%rax,1)
L23:
  mov    $0xfffffffc,%eax
  jmp    L15
L43:
  mov    $0xffffffff,%eax
  jmp    L15
L4:
  mov    $0xfffffffe,%eax
  jmp    L15
L2:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int lcd_printf16(char *fb, int x, int y, unsigned char *font) {
  unsigned char inode[2];
  unsigned char *ft;
  unsigned long ftoft;
  unsigned char mat[16][2];
  int xnum, curx, line, xreg;
  if (!fb | !font)
    return -1;
  if (x > 480 || y > 272)
    return -2;
  ft = font;
  xreg = x;
  xnum = (480 - x) / 8;
  curx = xnum;
  line = 2;
  while (*ft != '\0') {
    if (*ft & 0x80) {
      inode[0] = *ft++ - 0xa0;
      if (*ft & 0x80)
        inode[1] = *ft++ - 0xa0;
      else
        return -4;
      ftoft = ((inode[0] - 1) * 94 + (inode[1] - 1)) * 32;
      get_hzk16_font(ftoft, (unsigned char *)mat);
      putc_lcd_hzk16(fb, x, y, (unsigned char *)mat);
      x += 16;
      curx -= 2;
    } else {
      putc_lcd_asc16(fb, x, y, *ft);
      ft++;
      x += 8;
      curx -= 1;
    }
    if (curx > 2)
      continue;
    else {
      line--;
      curx = xnum;
      y += 16;
      x = xreg;
    }
    if (line == 0)
      return -3;
  }
  return 0;
}
```