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

```asm
<alreadyhave>:
  endbr64
  cmp    %rsi,%rdi
  jae    L4
  movzbl (%rdx),%eax
  mov    %eax,%ecx
  mov    %eax,%r8d
  and    $0xe0,%ecx
  and    $0xf0,%r8d
  jmp    L65
L53:
  add    $0x1,%rdi
  cmp    %rdi,%rsi
  je     L4
L65:
  cmp    %al,(%rdi)
  jne    L53
  test   %al,%al
  jns    L0
  cmp    $0xc0,%ecx
  je     L24
  cmp    $0xe0,%r8d
  jne    L53
  movzbl 0x1(%rdx),%r10d
  cmp    %r10b,0x1(%rdi)
  jne    L53
  movzbl 0x2(%rdx),%r11d
  cmp    %r11b,0x2(%rdi)
  jne    L53
  mov    $0x3,%eax
  ret
  xchg   %ax,%ax
L24:
  movzbl 0x1(%rdx),%r9d
  cmp    %r9b,0x1(%rdi)
  jne    L53
  mov    $0x2,%eax
  ret
  nopl   0x0(%rax)
L4:
  xor    %eax,%eax
  ret
L0:
  mov    $0x1,%eax
  ret
```

assistant: ```c
int alreadyhave(char *buffer, char *end, char *ch) {
  while (buffer < end) {
    if (*buffer == *ch) {
      if (*ch & 0x80) {
        if ((*ch & 0xE0) == 0xC0) {
          if (*(buffer + 1) == *(ch + 1)) {
            return 2;
          }
        } else if ((*ch & 0xF0) == 0xE0) {
          if (*(buffer + 1) == *(ch + 1) && *(buffer + 2) == *(ch + 2)) {
            return 3;
          }
        }
      } else {
        return 1;
      }
    }
    buffer++;
  }
  return 0;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<alreadyhave>:
  endbr64
  cmp    %rsi,%rdi
  jae    L283
  movzbl (%rdx),%eax
  mov    %eax,%ecx
  mov    %eax,%r8d
  and    $0xf0,%ecx
  and    $0xe0,%r8d
  cmp    $0xe0,%ecx
  je     L172
  cmp    $0xc0,%r8d
  je     L310
  xor    %r8d,%r8d
  test   %al,%al
  jns    L73
L247:
  mov    %r8d,%eax
  ret
L177:
  add    $0x1,%rdi
  cmp    %rdi,%rsi
  je     L283
L73:
  cmp    (%rdi),%al
  jne    L177
L343:
  mov    $0x1,%r8d
  mov    %r8d,%eax
  ret
L310:
  test   %al,%al
  js     L29
  jmp    L201
  nopw   0x0(%rax,%rax,1)
L249:
  add    $0x1,%rdi
  cmp    %rdi,%rsi
  je     L283
L29:
  cmp    (%rdi),%al
  jne    L249
  movzbl 0x1(%rdx),%ecx
  cmp    %cl,0x1(%rdi)
  jne    L249
L83:
  mov    $0x2,%r8d
  jmp    L247
  xchg   %ax,%ax
L283:
  xor    %r8d,%r8d
  mov    %r8d,%eax
  ret
  nopw   0x0(%rax,%rax,1)
L172:
  cmp    $0xc0,%r8d
  je     L146
  test   %al,%al
  js     L236
  jmp    L133
  nop
L275:
  add    $0x1,%rdi
  cmp    %rdi,%rsi
  je     L283
L236:
  cmp    (%rdi),%al
  jne    L275
  movzbl 0x1(%rdx),%ecx
  cmp    %cl,0x1(%rdi)
  jne    L275
  movzbl 0x2(%rdx),%ecx
  cmp    %cl,0x2(%rdi)
  jne    L275
  mov    $0x3,%r8d
  jmp    L247
  nopw   0x0(%rax,%rax,1)
L113:
  add    $0x1,%rdi
  cmp    %rdi,%rsi
  je     L283
L201:
  cmp    (%rdi),%al
  jne    L113
  jmp    L343
L276:
  add    $0x1,%rdi
  cmp    %rdi,%rsi
  je     L283
L133:
  cmp    (%rdi),%al
  jne    L276
  jmp    L343
L146:
  test   %al,%al
  js     L64
  jmp    L33
  nopw   0x0(%rax,%rax,1)
L90:
  add    $0x1,%rdi
  cmp    %rdi,%rsi
  je     L283
L64:
  cmp    %al,(%rdi)
  jne    L90
  movzbl 0x1(%rdx),%ecx
  cmp    %cl,0x1(%rdi)
  jne    L90
  jmp    L83
L277:
  add    $0x1,%rdi
  cmp    %rdi,%rsi
  je     L283
L33:
  cmp    (%rdi),%al
  jne    L277
  jmp    L343
```

assistant: ```c
int alreadyhave(char *buffer, char *end, char *ch) {
  while (buffer < end) {
    if (*buffer == *ch) {
      if (*ch & 0x80) {
        if ((*ch & 0xE0) == 0xC0) {
          if (*(buffer + 1) == *(ch + 1)) {
            return 2;
          }
        } else if ((*ch & 0xF0) == 0xE0) {
          if (*(buffer + 1) == *(ch + 1) && *(buffer + 2) == *(ch + 2)) {
            return 3;
          }
        }
      } else {
        return 1;
      }
    }
    buffer++;
  }
  return 0;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<get_so_max_conn>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    $0x0,%eax
  call   <sapi_get_max_conn@plt>
  mov    %eax,-0x4(%rbp)
  cmpl   $0x0,-0x4(%rbp)
  jle    L6
  mov    -0x4(%rbp),%eax
  mov    %eax,%esi
  lea    D1(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  jmp    L16
L6:
  mov    $0xffffffff,%eax
L16:
  leave
  ret
```

tool_calls: name: parse_data
arguments: data_label: D1
datatype: string

tool: D1: maxconn %d


assistant: ```c
int get_so_max_conn() {
  int maxconn = sapi_get_max_conn();
  if (maxconn > 0) {
    printf("maxconn %d\n", maxconn);
    return 0;
  }
  return -1;
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<get_so_max_conn>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x0,%eax
  call   <sapi_get_max_conn@plt>
  test   %eax,%eax
  jle    L19
  mov    %eax,%esi
  lea    D2(%rip),%rdi
  call   <printf@plt>
  mov    $0x0,%eax
L10:
  add    $0x8,%rsp
  ret
L19:
  mov    $0xffffffff,%eax
  jmp    L10
```

tool_calls: name: extract_symbolic_data
arguments: label: D2
datatype: string

tool: D2: maxconn %d


assistant: ```c
int get_so_max_conn() {
  int maxconn = sapi_get_max_conn();
  if (maxconn > 0) {
    printf("maxconn %d\n", maxconn);
    return 0;
  }
  return -1;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<get_so_max_conn>:
  endbr64
  sub    $0x8,%rsp
  xor    %eax,%eax
  call   <sapi_get_max_conn@plt>
  test   %eax,%eax
  jle    L11
  mov    %eax,%esi
  lea    D4(%rip),%rdi
  call   <printf@plt>
  xor    %eax,%eax
L4:
  add    $0x8,%rsp
  ret
  nopl   0x0(%rax,%rax,1)
L11:
  mov    $0xffffffff,%eax
  jmp    L4
```

tool_calls: name: parse_data
arguments: tag: D4
type_infered: string

tool: D4: maxconn %d


assistant: ```c
int get_so_max_conn() {
  int maxconn = sapi_get_max_conn();
  if (maxconn > 0) {
    printf("maxconn %d\n", maxconn);
    return 0;
  }
  return -1;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<get_so_max_conn>:
  endbr64
  sub    $0x8,%rsp
  xor    %eax,%eax
  call   <sapi_get_max_conn@plt>
  test   %eax,%eax
  jle    L7
  mov    %eax,%esi
  lea    D4(%rip),%rdi
  call   <printf@plt>
  xor    %eax,%eax
L16:
  add    $0x8,%rsp
  ret
  nopl   0x0(%rax,%rax,1)
L7:
  mov    $0xffffffff,%eax
  jmp    L16
```

tool_calls: name: retrieve_data
arguments: data_tag: D4
type_guessed: string

tool: D4: maxconn %d


assistant: ```c
int get_so_max_conn() {
  int maxconn = sapi_get_max_conn();
  if (maxconn > 0) {
    printf("maxconn %d\n", maxconn);
    return 0;
  }
  return -1;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<log_init>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    %esi,-0xc(%rbp)
  mov    D2(%rip),%rax
  mov    (%rax),%edx
  mov    -0x8(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <openlog@plt>
  mov    -0xc(%rbp),%eax
  mov    %eax,%edi
  call   <logarea_init@plt>
  test   %rax,%rax
  je     L14
  mov    $0x1,%eax
  jmp    L13
L14:
  mov    $0x0,%eax
L13:
  leave
  ret
```

assistant: ```c
int log_init(char *program_name, int size) {
  do {
  } while (0);
  openlog(program_name, 0, LOG_DAEMON);
  if (logarea_init(size))
    return 1;
  return 0;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<log_init>:
  endbr64
  push   %rbx
  mov    %esi,%ebx
  mov    D5(%rip),%rax
  mov    (%rax),%edx
  mov    $0x0,%esi
  call   <openlog@plt>
  mov    %ebx,%edi
  call   <logarea_init@plt>
  test   %rax,%rax
  setne  %al
  movzbl %al,%eax
  pop    %rbx
  ret
```

assistant: ```c
int log_init(char *program_name, int size) {
  do {
  } while (0);
  openlog(program_name, 0, LOG_DAEMON);
  if (logarea_init(size))
    return 1;
  return 0;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<log_init>:
  endbr64
  mov    D5(%rip),%rax
  push   %rbp
  mov    %esi,%ebp
  xor    %esi,%esi
  mov    (%rax),%edx
  call   <openlog@plt>
  mov    %ebp,%edi
  call   <logarea_init@plt>
  pop    %rbp
  test   %rax,%rax
  setne  %al
  movzbl %al,%eax
  ret
```

assistant: ```c
int log_init(char *program_name, int size) {
  do {
  } while (0);
  openlog(program_name, 0, LOG_DAEMON);
  if (logarea_init(size))
    return 1;
  return 0;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<log_init>:
  endbr64
  mov    D7(%rip),%rax
  push   %rbp
  mov    %esi,%ebp
  xor    %esi,%esi
  mov    (%rax),%edx
  call   <openlog@plt>
  mov    %ebp,%edi
  call   <logarea_init@plt>
  pop    %rbp
  test   %rax,%rax
  setne  %al
  movzbl %al,%eax
  ret
```

assistant: ```c
int log_init(char *program_name, int size) {
  do {
  } while (0);
  openlog(program_name, 0, LOG_DAEMON);
  if (logarea_init(size))
    return 1;
  return 0;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<gui_set_menu_prev_next>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %edi,-0x4(%rbp)
  mov    %esi,-0x8(%rbp)
  cmpl   $0x0,-0x4(%rbp)
  jne    L2
  cmpl   $0x0,-0x8(%rbp)
  je     L2
  lea    D38(%rip),%rax
  mov    %rax,%rcx
  mov    $0xd,%edx
  mov    $0xe,%esi
  mov    $0x0,%edi
  call   <gui_set_status_text_part@plt>
  jmp    L22
L2:
  cmpl   $0x0,-0x4(%rbp)
  je     L79
  cmpl   $0x0,-0x8(%rbp)
  jne    L79
  lea    D11(%rip),%rax
  mov    %rax,%rcx
  mov    $0xd,%edx
  mov    $0xe,%esi
  mov    $0x0,%edi
  call   <gui_set_status_text_part@plt>
  jmp    L22
L79:
  cmpl   $0x0,-0x4(%rbp)
  je     L70
  cmpl   $0x0,-0x8(%rbp)
  je     L70
  lea    D32(%rip),%rax
  mov    %rax,%rcx
  mov    $0xd,%edx
  mov    $0xe,%esi
  mov    $0x0,%edi
  call   <gui_set_status_text_part@plt>
  jmp    L22
L70:
  lea    D12(%rip),%rax
  mov    %rax,%rcx
  mov    $0xd,%edx
  mov    $0xe,%esi
  mov    $0x0,%edi
  call   <gui_set_status_text_part@plt>
  nop
L22:
  nop
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D38
type_guessed: string
name: unpack_data
arguments: data_label: D11
type_guessed: string
name: unpack_data
arguments: data_label: D32
type_guessed: string
name: unpack_data
arguments: data_label: D12
type_guessed: string

tool: D38:             >

tool: D11:           <  

tool: D32:           < >

tool: D12:              

assistant: ```c
void gui_set_menu_prev_next(int prev, int next) {
  if (!prev && next) {
    gui_set_status_text_part(0, 14, 13, "            >");
  } else if (prev && !next) {
    gui_set_status_text_part(0, 14, 13, "          <  ");
  } else if (prev && next) {
    gui_set_status_text_part(0, 14, 13, "          < >");
  } else {
    gui_set_status_text_part(0, 14, 13, "             ");
  }
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<gui_set_menu_prev_next>:
  endbr64
  sub    $0x8,%rsp
  test   %esi,%esi
  setne  %al
  test   %edi,%edi
  jne    L22
  test   %al,%al
  jne    L24
L22:
  test   %edi,%edi
  setne  %dl
  test   %esi,%esi
  jne    L1
  test   %dl,%dl
  jne    L47
L1:
  test   %al,%al
  je     L69
  test   %dl,%dl
  je     L69
  lea    D14(%rip),%rcx
  mov    $0xd,%edx
  mov    $0xe,%esi
  mov    $0x0,%edi
  call   <gui_set_status_text_part@plt>
  jmp    L86
L24:
  lea    D38(%rip),%rcx
  mov    $0xd,%edx
  mov    $0xe,%esi
  call   <gui_set_status_text_part@plt>
L86:
  add    $0x8,%rsp
  ret
L47:
  lea    D25(%rip),%rcx
  mov    $0xd,%edx
  mov    $0xe,%esi
  mov    $0x0,%edi
  call   <gui_set_status_text_part@plt>
  jmp    L86
L69:
  lea    D24(%rip),%rcx
  mov    $0xd,%edx
  mov    $0xe,%esi
  mov    $0x0,%edi
  call   <gui_set_status_text_part@plt>
  jmp    L86
```

tool_calls: name: read_data
arguments: tag: D14
data_type: string
name: read_data
arguments: tag: D38
data_type: string
name: read_data
arguments: tag: D25
data_type: string
name: read_data
arguments: tag: D24
data_type: string

tool: D14:           < >

tool: D38:             >

tool: D25:           <  

tool: D24:              

assistant: ```c
void gui_set_menu_prev_next(int prev, int next) {
  if (!prev && next) {
    gui_set_status_text_part(0, 14, 13, "            >");
  } else if (prev && !next) {
    gui_set_status_text_part(0, 14, 13, "          <  ");
  } else if (prev && next) {
    gui_set_status_text_part(0, 14, 13, "          < >");
  } else {
    gui_set_status_text_part(0, 14, 13, "             ");
  }
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<gui_set_menu_prev_next>:
  endbr64
  test   %esi,%esi
  setne  %al
  test   %edi,%edi
  jne    L15
  test   %al,%al
  jne    L40
L15:
  test   %edi,%edi
  setne  %dl
  test   %esi,%esi
  jne    L14
  test   %dl,%dl
  je     L14
  lea    D1(%rip),%rcx
  mov    $0xd,%edx
  mov    $0xe,%esi
  xor    %edi,%edi
  jmp    1050 <gui_set_status_text_part@plt>
  cs nopw 0x0(%rax,%rax,1)
L40:
  lea    D36(%rip),%rcx
  mov    $0xd,%edx
  mov    $0xe,%esi
  jmp    1050 <gui_set_status_text_part@plt>
  cs nopw 0x0(%rax,%rax,1)
L14:
  test   %al,%al
  je     L34
  test   %dl,%dl
  je     L34
  lea    D21(%rip),%rcx
  mov    $0xd,%edx
  mov    $0xe,%esi
  xor    %edi,%edi
  jmp    1050 <gui_set_status_text_part@plt>
L34:
  lea    D7(%rip),%rcx
  mov    $0xd,%edx
  mov    $0xe,%esi
  xor    %edi,%edi
  jmp    1050 <gui_set_status_text_part@plt>
```

tool_calls: name: retrieve_data
arguments: data_label: D1
data_type: string
name: retrieve_data
arguments: data_label: D36
data_type: string
name: retrieve_data
arguments: data_label: D21
data_type: string
name: retrieve_data
arguments: data_label: D7
data_type: string

tool: D1:           <  

tool: D36:             >

tool: D21:           < >

tool: D7:              

assistant: ```c
void gui_set_menu_prev_next(int prev, int next) {
  if (!prev && next) {
    gui_set_status_text_part(0, 14, 13, "            >");
  } else if (prev && !next) {
    gui_set_status_text_part(0, 14, 13, "          <  ");
  } else if (prev && next) {
    gui_set_status_text_part(0, 14, 13, "          < >");
  } else {
    gui_set_status_text_part(0, 14, 13, "             ");
  }
}
```
user: Translate the below assembly code into C programming language:

```asm
<gui_set_menu_prev_next>:
  endbr64
  test   %esi,%esi
  setne  %al
  test   %edi,%edi
  jne    L51
  test   %al,%al
  jne    L37
L51:
  test   %edi,%edi
  setne  %dl
  test   %esi,%esi
  jne    L28
  test   %dl,%dl
  je     L28
  lea    D15(%rip),%rcx
  mov    $0xd,%edx
  mov    $0xe,%esi
  xor    %edi,%edi
  jmp    1050 <gui_set_status_text_part@plt>
  cs nopw 0x0(%rax,%rax,1)
L37:
  lea    D29(%rip),%rcx
  mov    $0xd,%edx
  mov    $0xe,%esi
  jmp    1050 <gui_set_status_text_part@plt>
  cs nopw 0x0(%rax,%rax,1)
L28:
  test   %al,%al
  je     L25
  test   %dl,%dl
  je     L25
  lea    D38(%rip),%rcx
  mov    $0xd,%edx
  mov    $0xe,%esi
  xor    %edi,%edi
  jmp    1050 <gui_set_status_text_part@plt>
L25:
  lea    D28(%rip),%rcx
  mov    $0xd,%edx
  mov    $0xe,%esi
  xor    %edi,%edi
  jmp    1050 <gui_set_status_text_part@plt>
```

tool_calls: name: unpack_data
arguments: data_label: D15
datatype: string
name: unpack_data
arguments: data_label: D29
datatype: string
name: unpack_data
arguments: data_label: D38
datatype: string
name: unpack_data
arguments: data_label: D28
datatype: string

tool: D15:           <  

tool: D29:             >

tool: D38:           < >

tool: D28:              

assistant: ```c
void gui_set_menu_prev_next(int prev, int next) {
  if (!prev && next) {
    gui_set_status_text_part(0, 14, 13, "            >");
  } else if (prev && !next) {
    gui_set_status_text_part(0, 14, 13, "          <  ");
  } else if (prev && next) {
    gui_set_status_text_part(0, 14, 13, "          < >");
  } else {
    gui_set_status_text_part(0, 14, 13, "             ");
  }
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<is_valid_card_value>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,%eax
  mov    %al,-0x4(%rbp)
  movsbl -0x4(%rbp),%eax
  sub    $0x32,%eax
  cmp    $0x22,%eax
  seta   %dl
  test   %dl,%dl
  jne    L5
  movabs $0x4830080ff,%rdx
  mov    %eax,%ecx
  shr    %cl,%rdx
  mov    %rdx,%rax
  and    $0x1,%eax
  test   %rax,%rax
  setne  %al
  test   %al,%al
  je     L5
  mov    $0x1,%eax
  jmp    L25
L5:
  mov    $0x0,%eax
L25:
  pop    %rbp
  ret
```

assistant: ```c
int is_valid_card_value(char c) {
  switch (c) {
  case 'A':
  case 'K':
  case 'Q':
  case 'J':
  case 'T':
  case '9':
  case '8':
  case '7':
  case '6':
  case '5':
  case '4':
  case '3':
  case '2':
    return 1;
  default:
    return 0;
  }
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<is_valid_card_value>:
  endbr64
  lea    -0x32(%rdi),%ecx
  cmp    $0x22,%cl
  ja     L7
  movabs $0x4830080ff,%rax
  shr    %cl,%rax
  and    $0x1,%eax
  ret
L7:
  mov    $0x0,%eax
  ret
```

assistant: ```c
int is_valid_card_value(char c) {
  switch (c) {
  case 'A':
  case 'K':
  case 'Q':
  case 'J':
  case 'T':
  case '9':
  case '8':
  case '7':
  case '6':
  case '5':
  case '4':
  case '3':
  case '2':
    return 1;
  default:
    return 0;
  }
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<is_valid_card_value>:
  endbr64
  lea    -0x32(%rdi),%ecx
  cmp    $0x22,%cl
  ja     L3
  movabs $0x4830080ff,%rax
  shr    %cl,%rax
  and    $0x1,%eax
  ret
  nopl   (%rax)
L3:
  xor    %eax,%eax
  ret
```

assistant: ```c
int is_valid_card_value(char c) {
  switch (c) {
  case 'A':
  case 'K':
  case 'Q':
  case 'J':
  case 'T':
  case '9':
  case '8':
  case '7':
  case '6':
  case '5':
  case '4':
  case '3':
  case '2':
    return 1;
  default:
    return 0;
  }
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<is_valid_card_value>:
  endbr64
  lea    -0x32(%rdi),%ecx
  cmp    $0x22,%cl
  ja     L9
  movabs $0x4830080ff,%rax
  shr    %cl,%rax
  and    $0x1,%eax
  ret
  nopl   (%rax)
L9:
  xor    %eax,%eax
  ret
```

assistant: ```c
int is_valid_card_value(char c) {
  switch (c) {
  case 'A':
  case 'K':
  case 'Q':
  case 'J':
  case 'T':
  case '9':
  case '8':
  case '7':
  case '6':
  case '5':
  case '4':
  case '3':
  case '2':
    return 1;
  default:
    return 0;
  }
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<c_convert_16_32>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    %ecx,%eax
  mov    %al,-0x20(%rbp)
  movl   $0x0,-0x8(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L46
L43:
  mov    -0x8(%rbp),%edx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzwl (%rax),%eax
  mov    %ax,-0xa(%rbp)
  addl   $0x2,-0x8(%rbp)
  cmpb   $0x0,-0x20(%rbp)
  jne    L39
  movzwl -0xa(%rbp),%eax
  shr    $0xb,%ax
  mov    %al,-0xf(%rbp)
  movzwl -0xa(%rbp),%eax
  and    $0x1f,%eax
  mov    %al,-0x10(%rbp)
  jmp    L62
L39:
  movzwl -0xa(%rbp),%eax
  shr    $0xb,%ax
  mov    %al,-0x10(%rbp)
  movzwl -0xa(%rbp),%eax
  and    $0x1f,%eax
  mov    %al,-0xf(%rbp)
L62:
  movzwl -0xa(%rbp),%eax
  sar    $0x5,%eax
  and    $0x3f,%eax
  mov    %al,-0xe(%rbp)
  movzbl -0x10(%rbp),%eax
  imul   $0x20f,%eax,%eax
  add    $0x17,%eax
  sar    $0x6,%eax
  mov    %al,-0xd(%rbp)
  movzbl -0xe(%rbp),%eax
  imul   $0x103,%eax,%eax
  add    $0x21,%eax
  sar    $0x6,%eax
  mov    %al,-0xc(%rbp)
  movzbl -0xf(%rbp),%eax
  imul   $0x20f,%eax,%eax
  add    $0x17,%eax
  sar    $0x6,%eax
  mov    %al,-0xb(%rbp)
  movzbl -0xd(%rbp),%edx
  movzbl -0xc(%rbp),%eax
  shl    $0x8,%eax
  or     %eax,%edx
  movzbl -0xb(%rbp),%eax
  shl    $0x10,%eax
  or     %eax,%edx
  mov    -0x4(%rbp),%ecx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  mov    %edx,(%rax)
  addl   $0x3,-0x4(%rbp)
  cmpb   $0x0,-0xd(%rbp)
  jne    L28
  cmpb   $0x0,-0xc(%rbp)
  jne    L28
  cmpb   $0x0,-0xb(%rbp)
  jne    L28
  mov    -0x4(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x4(%rbp)
  mov    %eax,%edx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  jmp    L46
L28:
  mov    -0x4(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x4(%rbp)
  mov    %eax,%edx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movb   $0xff,(%rax)
L46:
  mov    -0x8(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jb     L43
  nop
  nop
  pop    %rbp
  ret
```

assistant: ```c
void c_convert_16_32(char *buf16, unsigned int size16, char *buf32, unsigned char color_order) {
  unsigned int loc16 = 0;
  unsigned int loc32 = 0;
  unsigned char r5;
  unsigned char g6;
  unsigned char b5;
  while (loc16 < size16) {
    unsigned short rgb565 = *((unsigned short *)(buf16 + loc16));
    loc16 += 2;
    if (color_order == 0) {
      b5 = (rgb565 & 0xf800) >> 11;
      r5 = (rgb565 & 0x001f);
    } else {
      r5 = (rgb565 & 0xf800) >> 11;
      b5 = (rgb565 & 0x001f);
    }
    g6 = (rgb565 & 0x07e0) >> 5;
    unsigned char r8 = (r5 * 527 + 23) >> 6;
    unsigned char g8 = (g6 * 259 + 33) >> 6;
    unsigned char b8 = (b5 * 527 + 23) >> 6;
    *((unsigned int *)(buf32 + loc32)) = r8 | (g8 << 8) | (b8 << 16);
    loc32 += 3;
    if (r8 == 0 && g8 == 0 && b8 == 0) {
      *((unsigned char *)(buf32 + loc32++)) = 0;
    } else {
      *((unsigned char *)(buf32 + loc32++)) = 255;
    }
  }
}
```
user: What is the c source code of the assembly code below:

```asm
<c_convert_16_32>:
  endbr64
  test   %esi,%esi
  je     L53
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%r9
  mov    %esi,%r10d
  mov    %rdx,%r11
  mov    %ecx,%ebx
  mov    $0x4,%r8d
  mov    $0x0,%esi
  jmp    L11
L22:
  mov    %eax,%ecx
  shr    $0xb,%cx
  mov    %ecx,%edx
  mov    %eax,%ecx
  and    $0x1f,%ecx
  jmp    L67
L62:
  mov    %edi,%edi
  movb   $0xff,(%r11,%rdi,1)
L4:
  add    $0x4,%r8d
  cmp    %esi,%r10d
  jbe    L12
L11:
  lea    (%rsi,%rsi,1),%edi
  mov    %esi,%eax
  movzwl (%r9,%rax,1),%eax
  add    $0x2,%esi
  test   %bl,%bl
  jne    L22
  mov    %eax,%ecx
  shr    $0xb,%cx
  mov    %eax,%edx
  and    $0x1f,%edx
L67:
  movzbl %dl,%edx
  imul   $0x20f,%edx,%edx
  add    $0x17,%edx
  sar    $0x6,%edx
  shr    $0x5,%eax
  and    $0x3f,%eax
  imul   $0x103,%eax,%eax
  add    $0x21,%eax
  sar    $0x6,%eax
  movzbl %cl,%ecx
  imul   $0x20f,%ecx,%ecx
  add    $0x17,%ecx
  sar    $0x6,%ecx
  mov    %edi,%edi
  mov    %eax,%ebp
  shl    $0x8,%ebp
  or     %edx,%ebp
  mov    %ecx,%r12d
  shl    $0x10,%r12d
  or     %r12d,%ebp
  mov    %ebp,(%r11,%rdi,1)
  lea    -0x1(%r8),%edi
  or     %ecx,%edx
  or     %al,%dl
  jne    L62
  mov    %edi,%edi
  movb   $0x0,(%r11,%rdi,1)
  jmp    L4
L12:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L53:
  ret
```

assistant: ```c
void c_convert_16_32(char *buf16, unsigned int size16, char *buf32, unsigned char color_order) {
  unsigned int loc16 = 0;
  unsigned int loc32 = 0;
  unsigned char r5;
  unsigned char g6;
  unsigned char b5;
  while (loc16 < size16) {
    unsigned short rgb565 = *((unsigned short *)(buf16 + loc16));
    loc16 += 2;
    if (color_order == 0) {
      b5 = (rgb565 & 0xf800) >> 11;
      r5 = (rgb565 & 0x001f);
    } else {
      r5 = (rgb565 & 0xf800) >> 11;
      b5 = (rgb565 & 0x001f);
    }
    g6 = (rgb565 & 0x07e0) >> 5;
    unsigned char r8 = (r5 * 527 + 23) >> 6;
    unsigned char g8 = (g6 * 259 + 33) >> 6;
    unsigned char b8 = (b5 * 527 + 23) >> 6;
    *((unsigned int *)(buf32 + loc32)) = r8 | (g8 << 8) | (b8 << 16);
    loc32 += 3;
    if (r8 == 0 && g8 == 0 && b8 == 0) {
      *((unsigned char *)(buf32 + loc32++)) = 0;
    } else {
      *((unsigned char *)(buf32 + loc32++)) = 255;
    }
  }
}
```