ylfeng/ReF-Decompile-dataset huggingface dataset:
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<getListenSocket>:
  endbr64
  push   %r14
  xor    %edx,%edx
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x30,%rsp
  mov    D24(%rip),%rbp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  mov    D8(%rip),%rax
  mov    0x0(%rbp),%rdi
  mov    (%rax),%esi
  call   <socket@plt>
  test   %eax,%eax
  js     L48
  mov    %eax,%r12d
  mov    D27(%rip),%rax
  lea    0xc(%rsp),%rcx
  mov    $0x4,%r8d
  mov    %r12d,%edi
  movl   $0x1,0xc(%rsp)
  mov    (%rax),%edx
  mov    D56(%rip),%rax
  mov    (%rax),%esi
  call   <setsockopt@plt>
  mov    (%rbx),%edi
  test   %edi,%edi
  jne    L37
  mov    D21(%rip),%r14
  lea    0x10(%rsp),%r13
  jmp    L34
  xchg   %ax,%ax
L76:
  mov    0xc(%rsp),%edi
  cmp    $0x9,%edi
  jg     L48
  add    $0x1,%edi
L34:
  mov    0x0(%rbp),%rax
  mov    %edi,0xc(%rsp)
  mov    %rax,0x20(%rsp)
  xor    %eax,%eax
  call   <random@plt>
  movslq %eax,%rdx
  mov    %eax,%ecx
  imul   $0xffffffff82082083,%rdx,%rdx
  sar    $0x1f,%ecx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0xf,%edx
  sub    %ecx,%edx
  imul   $0xfc00,%edx,%edx
  sub    %edx,%eax
  lea    0x400(%rax),%edi
  mov    %edi,(%rbx)
  call   <htons@plt>
  mov    (%r14),%edi
  mov    %rax,0x18(%rsp)
  call   <htonl@plt>
  mov    $0x18,%edx
  mov    %r13,%rsi
  mov    %r12d,%edi
  mov    %rax,0x10(%rsp)
  call   <bind@plt>
  test   %rax,%rax
  js     L76
L28:
  mov    $0x8,%esi
  mov    %r12d,%edi
  call   <listen@plt>
  test   %rax,%rax
  js     L48
L69:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L29
  add    $0x30,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
L37:
  mov    0x0(%rbp),%rax
  mov    %rax,0x20(%rsp)
  call   <htons@plt>
  mov    %rax,0x18(%rsp)
  mov    D21(%rip),%rax
  mov    (%rax),%edi
  call   <htonl@plt>
  lea    0x10(%rsp),%rsi
  mov    $0x18,%edx
  mov    %r12d,%edi
  mov    %rax,0x10(%rsp)
  call   <bind@plt>
  test   %rax,%rax
  jns    L28
  nopl   (%rax)
L48:
  mov    $0xffffffff,%r12d
  jmp    L69
L29:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int getListenSocket(uint16_t *desiredPort) {
  int sock, t;
  struct sockaddr_in addr;
  if ((sock = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
    return -1;
  }
  t = 1;
  setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &t, sizeof(int));
  if (*desiredPort != 0) {
    addr.sin_family = AF_INET;
    addr.sin_port = htons(*desiredPort);
    addr.sin_addr.s_addr = htonl(INADDR_ANY);
    if (bind(sock, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
      return -1;
    }
  } else {
    t = 0;
    while (1) {
      addr.sin_family = AF_INET;
      *desiredPort = (random() % 64512) + 1024;
      addr.sin_port = htons(*desiredPort);
      addr.sin_addr.s_addr = htonl(INADDR_ANY);
      if (bind(sock, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
        if (t < 10) {
          ++t;
          continue;
        } else {
          return -1;
        }
      }
      break;
    }
  }
  if (listen(sock, 8) < 0) {
    return -1;
  }
  return sock;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<getListenSocket>:
  endbr64
  push   %r14
  xor    %edx,%edx
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x30,%rsp
  mov    D36(%rip),%rbp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  mov    D13(%rip),%rax
  mov    0x0(%rbp),%rdi
  mov    (%rax),%esi
  call   <socket@plt>
  test   %eax,%eax
  js     L20
  mov    %eax,%r12d
  mov    D27(%rip),%rax
  lea    0xc(%rsp),%rcx
  mov    $0x4,%r8d
  mov    %r12d,%edi
  movl   $0x1,0xc(%rsp)
  mov    (%rax),%edx
  mov    D17(%rip),%rax
  mov    (%rax),%esi
  call   <setsockopt@plt>
  mov    (%rbx),%edi
  test   %edi,%edi
  jne    L61
  mov    D34(%rip),%r14
  lea    0x10(%rsp),%r13
  jmp    L0
  xchg   %ax,%ax
L31:
  mov    0xc(%rsp),%edi
  cmp    $0x9,%edi
  jg     L20
  add    $0x1,%edi
L0:
  mov    0x0(%rbp),%rax
  mov    %edi,0xc(%rsp)
  mov    %rax,0x20(%rsp)
  xor    %eax,%eax
  call   <random@plt>
  movslq %eax,%rdx
  mov    %eax,%ecx
  imul   $0xffffffff82082083,%rdx,%rdx
  sar    $0x1f,%ecx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0xf,%edx
  sub    %ecx,%edx
  imul   $0xfc00,%edx,%edx
  sub    %edx,%eax
  lea    0x400(%rax),%edi
  mov    %edi,(%rbx)
  call   <htons@plt>
  mov    (%r14),%edi
  mov    %rax,0x18(%rsp)
  call   <htonl@plt>
  mov    $0x18,%edx
  mov    %r13,%rsi
  mov    %r12d,%edi
  mov    %rax,0x10(%rsp)
  call   <bind@plt>
  test   %rax,%rax
  js     L31
L60:
  mov    $0x8,%esi
  mov    %r12d,%edi
  call   <listen@plt>
  test   %rax,%rax
  js     L20
L25:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L2
  add    $0x30,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
L61:
  mov    0x0(%rbp),%rax
  mov    %rax,0x20(%rsp)
  call   <htons@plt>
  mov    %rax,0x18(%rsp)
  mov    D34(%rip),%rax
  mov    (%rax),%edi
  call   <htonl@plt>
  lea    0x10(%rsp),%rsi
  mov    $0x18,%edx
  mov    %r12d,%edi
  mov    %rax,0x10(%rsp)
  call   <bind@plt>
  test   %rax,%rax
  jns    L60
  nopl   (%rax)
L20:
  mov    $0xffffffff,%r12d
  jmp    L25
L2:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int getListenSocket(uint16_t *desiredPort) {
  int sock, t;
  struct sockaddr_in addr;
  if ((sock = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
    return -1;
  }
  t = 1;
  setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &t, sizeof(int));
  if (*desiredPort != 0) {
    addr.sin_family = AF_INET;
    addr.sin_port = htons(*desiredPort);
    addr.sin_addr.s_addr = htonl(INADDR_ANY);
    if (bind(sock, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
      return -1;
    }
  } else {
    t = 0;
    while (1) {
      addr.sin_family = AF_INET;
      *desiredPort = (random() % 64512) + 1024;
      addr.sin_port = htons(*desiredPort);
      addr.sin_addr.s_addr = htonl(INADDR_ANY);
      if (bind(sock, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
        if (t < 10) {
          ++t;
          continue;
        } else {
          return -1;
        }
      }
      break;
    }
  }
  if (listen(sock, 8) < 0) {
    return -1;
  }
  return sock;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<VIM_HIF_SetReg8>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,%eax
  mov    %al,-0x1c(%rbp)
  mov    $0x8000000,%edx
  mov    -0x18(%rbp),%rax
  mov    %ax,(%rdx)
  mov    $0x8000100,%eax
  movzwl (%rax),%eax
  mov    %ax,-0x2(%rbp)
  mov    -0x18(%rbp),%rax
  and    $0x1,%eax
  test   %rax,%rax
  jne    L4
  movzwl -0x2(%rbp),%eax
  mov    $0x0,%al
  mov    %eax,%edx
  movzbl -0x1c(%rbp),%eax
  or     %edx,%eax
  mov    $0x8000100,%edx
  mov    %ax,(%rdx)
  jmp    L12
L4:
  movzwl -0x2(%rbp),%eax
  movzbl %al,%edx
  movzbl -0x1c(%rbp),%eax
  shl    $0x8,%eax
  or     %edx,%eax
  mov    $0x8000100,%edx
  mov    %ax,(%rdx)
L12:
  nop
  pop    %rbp
  ret
```

assistant: ```c
void VIM_HIF_SetReg8(unsigned long adr, unsigned char val) {
  unsigned short uTemp;
  ;
  *(volatile unsigned short *)(0x8000000) = (unsigned short)adr;
  ;
  uTemp = *(volatile unsigned short *)(0x8000100);
  if ((adr & 0x1) == 0) {
    *(volatile unsigned short *)(0x8000100) = (uTemp & 0xff00) | val;
  } else {
    *(volatile unsigned short *)(0x8000100) = (uTemp & 0xff) | (val << 8);
  }
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<VIM_HIF_SetReg8>:
  endbr64
  mov    %di,0x8000000
  movzwl 0x8000100,%eax
  test   $0x1,%dil
  jne    L2
  mov    $0x0,%al
  movzbl %sil,%esi
  or     %esi,%eax
  mov    %ax,0x8000100
  ret
L2:
  movzbl %al,%eax
  shl    $0x8,%esi
  or     %eax,%esi
  mov    %si,0x8000100
  ret
```

assistant: ```c
void VIM_HIF_SetReg8(unsigned long adr, unsigned char val) {
  unsigned short uTemp;
  ;
  *(volatile unsigned short *)(0x8000000) = (unsigned short)adr;
  ;
  uTemp = *(volatile unsigned short *)(0x8000100);
  if ((adr & 0x1) == 0) {
    *(volatile unsigned short *)(0x8000100) = (uTemp & 0xff00) | val;
  } else {
    *(volatile unsigned short *)(0x8000100) = (uTemp & 0xff) | (val << 8);
  }
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<VIM_HIF_SetReg8>:
  endbr64
  mov    %di,0x8000000
  and    $0x1,%edi
  movzwl 0x8000100,%eax
  jne    L9
  xor    %al,%al
  movzbl %sil,%esi
  or     %esi,%eax
  mov    %ax,0x8000100
  ret
  nopw   0x0(%rax,%rax,1)
L9:
  movzbl %al,%eax
  shl    $0x8,%esi
  or     %eax,%esi
  mov    %si,0x8000100
  ret
```

assistant: ```c
void VIM_HIF_SetReg8(unsigned long adr, unsigned char val) {
  unsigned short uTemp;
  ;
  *(volatile unsigned short *)(0x8000000) = (unsigned short)adr;
  ;
  uTemp = *(volatile unsigned short *)(0x8000100);
  if ((adr & 0x1) == 0) {
    *(volatile unsigned short *)(0x8000100) = (uTemp & 0xff00) | val;
  } else {
    *(volatile unsigned short *)(0x8000100) = (uTemp & 0xff) | (val << 8);
  }
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<VIM_HIF_SetReg8>:
  endbr64
  mov    %di,0x8000000
  and    $0x1,%edi
  movzwl 0x8000100,%eax
  jne    L6
  xor    %al,%al
  movzbl %sil,%esi
  or     %esi,%eax
  mov    %ax,0x8000100
  ret
  nopw   0x0(%rax,%rax,1)
L6:
  movzbl %al,%eax
  shl    $0x8,%esi
  or     %eax,%esi
  mov    %si,0x8000100
  ret
```

assistant: ```c
void VIM_HIF_SetReg8(unsigned long adr, unsigned char val) {
  unsigned short uTemp;
  ;
  *(volatile unsigned short *)(0x8000000) = (unsigned short)adr;
  ;
  uTemp = *(volatile unsigned short *)(0x8000100);
  if ((adr & 0x1) == 0) {
    *(volatile unsigned short *)(0x8000100) = (uTemp & 0xff00) | val;
  } else {
    *(volatile unsigned short *)(0x8000100) = (uTemp & 0xff) | (val << 8);
  }
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<print_error_and_quit>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %edi,%eax
  mov    %al,-0x4(%rbp)
  lea    D17(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  movsbl -0x4(%rbp),%eax
  cmp    $0x64,%eax
  je     L10
  cmp    $0x66,%eax
  je     L18
  jmp    L38
L10:
  lea    D13(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L38
L18:
  lea    D21(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  nop
L38:
  mov    $0xffffffff,%edi
  call   <exit@plt>
  nop
  leave
  ret
```

tool_calls: name: read_data
arguments: label: D17
datatype: string
name: read_data
arguments: label: D13
datatype: string
name: read_data
arguments: label: D21
datatype: string

tool: D17: tcc_service : 

tool: D13: Failed to open the device. Quitting.


tool: D21: Failed to open file. Quitting.


assistant: ```c
void print_error_and_quit(char mode) {
  printf("tcc_service : ");
  switch (mode) {
  case 'd': {
    printf("Failed to open the device. Quitting.\n");
    break;
  }
  case 'f': {
    printf("Failed to open file. Quitting.\n");
    break;
  }
  }
  exit(-1);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<print_error_and_quit>:
  endbr64
  push   %rbx
  mov    %edi,%ebx
  lea    D14(%rip),%rdi
  call   <printf@plt>
  cmp    $0x64,%bl
  je     L5
  cmp    $0x66,%bl
  je     L12
L19:
  mov    $0xffffffff,%edi
  call   <exit@plt>
  pop    %rbx
  ret
L5:
  lea    D18(%rip),%rdi
  call   <printf@plt>
  jmp    L19
L12:
  lea    D6(%rip),%rdi
  call   <printf@plt>
  jmp    L19
```

tool_calls: name: parse_data
arguments: data_tag: D14
data_type: string
name: parse_data
arguments: data_tag: D18
data_type: string
name: parse_data
arguments: data_tag: D6
data_type: string

tool: D14: tcc_service : 

tool: D18: Failed to open the device. Quitting.


tool: D6: Failed to open file. Quitting.


assistant: ```c
void print_error_and_quit(char mode) {
  printf("tcc_service : ");
  switch (mode) {
  case 'd': {
    printf("Failed to open the device. Quitting.\n");
    break;
  }
  case 'f': {
    printf("Failed to open file. Quitting.\n");
    break;
  }
  }
  exit(-1);
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<print_error_and_quit>:
  endbr64
  push   %rbx
  mov    %edi,%ebx
  lea    D1(%rip),%rdi
  call   <printf@plt>
  cmp    $0x64,%bl
  je     L5
  cmp    $0x66,%bl
  jne    L3
  lea    D24(%rip),%rdi
  call   <printf@plt>
L3:
  mov    $0xffffffff,%edi
  pop    %rbx
  jmp    1070 <exit@plt>
  nopl   0x0(%rax)
L5:
  lea    D26(%rip),%rdi
  call   <printf@plt>
  mov    $0xffffffff,%edi
  pop    %rbx
  jmp    1070 <exit@plt>
```

tool_calls: name: retrieve_data
arguments: tag: D1
data_type: string
name: retrieve_data
arguments: tag: D24
data_type: string
name: retrieve_data
arguments: tag: D26
data_type: string

tool: D1: tcc_service : 

tool: D24: Failed to open file. Quitting.


tool: D26: Failed to open the device. Quitting.


assistant: ```c
void print_error_and_quit(char mode) {
  printf("tcc_service : ");
  switch (mode) {
  case 'd': {
    printf("Failed to open the device. Quitting.\n");
    break;
  }
  case 'f': {
    printf("Failed to open file. Quitting.\n");
    break;
  }
  }
  exit(-1);
}
```
user: What is the c source code of the assembly code below:

```asm
<print_error_and_quit>:
  endbr64
  push   %rbx
  mov    %edi,%ebx
  lea    D5(%rip),%rdi
  call   <printf@plt>
  cmp    $0x64,%bl
  je     L8
  cmp    $0x66,%bl
  jne    L14
  lea    D12(%rip),%rdi
  call   <printf@plt>
L14:
  mov    $0xffffffff,%edi
  pop    %rbx
  jmp    1070 <exit@plt>
  nopl   0x0(%rax)
L8:
  lea    D16(%rip),%rdi
  call   <printf@plt>
  mov    $0xffffffff,%edi
  pop    %rbx
  jmp    1070 <exit@plt>
```

tool_calls: name: parse_data
arguments: tag: D5
datatype: string
name: parse_data
arguments: tag: D12
datatype: string
name: parse_data
arguments: tag: D16
datatype: string

tool: D5: tcc_service : 

tool: D12: Failed to open file. Quitting.


tool: D16: Failed to open the device. Quitting.


assistant: ```c
void print_error_and_quit(char mode) {
  printf("tcc_service : ");
  switch (mode) {
  case 'd': {
    printf("Failed to open the device. Quitting.\n");
    break;
  }
  case 'f': {
    printf("Failed to open file. Quitting.\n");
    break;
  }
  }
  exit(-1);
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<Action_Delay>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x10(%rbp),%rax
  lea    D15(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <Strstr@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  je     L28
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <Action_Delay_Ms@plt>
  jmp    L10
L28:
  mov    -0x10(%rbp),%rax
  lea    D7(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <Strstr@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  je     L10
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <Action_Delay_S@plt>
  nop
L10:
  leave
  ret
```

tool_calls: name: parse_data
arguments: data_tag: D15
type_guessed: string
name: parse_data
arguments: data_tag: D7
type_guessed: string

tool: D15: ms

tool: D7: s

assistant: ```c
void Action_Delay(char *Str) {
  char *P = Str, *T;
  T = Strstr(P, "ms");
  if (T) {
    Action_Delay_Ms(T);
    return;
  }
  T = Strstr(P, "s");
  if (T) {
    Action_Delay_S(T);
    return;
  }
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<Action_Delay>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  lea    D11(%rip),%rsi
  call   <Strstr@plt>
  test   %rax,%rax
  je     L4
  mov    %rax,%rdi
  call   <Action_Delay_Ms@plt>
L28:
  pop    %rbx
  ret
L4:
  lea    D16(%rip),%rsi
  mov    %rbx,%rdi
  call   <Strstr@plt>
  test   %rax,%rax
  je     L28
  mov    %rax,%rdi
  call   <Action_Delay_S@plt>
  jmp    L28
```

tool_calls: name: read_data
arguments: data_label: D11
type_infered: string
name: read_data
arguments: data_label: D16
type_infered: string

tool: D11: ms

tool: D16: s

assistant: ```c
void Action_Delay(char *Str) {
  char *P = Str, *T;
  T = Strstr(P, "ms");
  if (T) {
    Action_Delay_Ms(T);
    return;
  }
  T = Strstr(P, "s");
  if (T) {
    Action_Delay_S(T);
    return;
  }
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<Action_Delay>:
  endbr64
  push   %rbp
  lea    D7(%rip),%rsi
  mov    %rdi,%rbp
  call   <Strstr@plt>
  test   %rax,%rax
  je     L9
  mov    %rax,%rdi
  pop    %rbp
  jmp    1080 <Action_Delay_Ms@plt>
  nopw   0x0(%rax,%rax,1)
L9:
  lea    D19(%rip),%rsi
  mov    %rbp,%rdi
  call   <Strstr@plt>
  test   %rax,%rax
  jne    L16
  pop    %rbp
  ret
  xchg   %ax,%ax
L16:
  mov    %rax,%rdi
  pop    %rbp
  jmp    1090 <Action_Delay_S@plt>
```

tool_calls: name: disassemble_data
arguments: data_label: D7
data_type: string
name: disassemble_data
arguments: data_label: D19
data_type: string

tool: D7: ms

tool: D19: s

assistant: ```c
void Action_Delay(char *Str) {
  char *P = Str, *T;
  T = Strstr(P, "ms");
  if (T) {
    Action_Delay_Ms(T);
    return;
  }
  T = Strstr(P, "s");
  if (T) {
    Action_Delay_S(T);
    return;
  }
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<Action_Delay>:
  endbr64
  push   %rbp
  lea    D11(%rip),%rsi
  mov    %rdi,%rbp
  call   <Strstr@plt>
  test   %rax,%rax
  je     L19
  mov    %rax,%rdi
  pop    %rbp
  jmp    1080 <Action_Delay_Ms@plt>
  nopw   0x0(%rax,%rax,1)
L19:
  lea    D5(%rip),%rsi
  mov    %rbp,%rdi
  call   <Strstr@plt>
  test   %rax,%rax
  jne    L5
  pop    %rbp
  ret
  xchg   %ax,%ax
L5:
  mov    %rax,%rdi
  pop    %rbp
  jmp    1090 <Action_Delay_S@plt>
```

tool_calls: name: read_data
arguments: label: D11
data_type: string
name: read_data
arguments: label: D5
data_type: string

tool: D11: ms

tool: D5: s

assistant: ```c
void Action_Delay(char *Str) {
  char *P = Str, *T;
  T = Strstr(P, "ms");
  if (T) {
    Action_Delay_Ms(T);
    return;
  }
  T = Strstr(P, "s");
  if (T) {
    Action_Delay_S(T);
    return;
  }
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<draw_line>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %esi,-0x18(%rbp)
  mov    %edx,-0x1c(%rbp)
  mov    %ecx,-0x20(%rbp)
  mov    %r8d,%edx
  mov    %r9d,%ecx
  mov    0x10(%rbp),%eax
  mov    %dl,-0x24(%rbp)
  mov    %ecx,%edx
  mov    %dl,-0x28(%rbp)
  mov    %al,-0x2c(%rbp)
  mov    -0x14(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jne    L110
  mov    -0x18(%rbp),%eax
  cmp    -0x20(%rbp),%eax
  jge    L18
  mov    -0x18(%rbp),%eax
  mov    %eax,-0x4(%rbp)
  jmp    L51
L125:
  movsbl -0x2c(%rbp),%edi
  movsbl -0x28(%rbp),%ecx
  movsbl -0x24(%rbp),%edx
  mov    0x18(%rbp),%r8d
  mov    -0x4(%rbp),%esi
  mov    -0x14(%rbp),%eax
  mov    %r8d,%r9d
  mov    %edi,%r8d
  mov    %eax,%edi
  call   <draw_pixel@plt>
  addl   $0x1,-0x4(%rbp)
L51:
  mov    -0x4(%rbp),%eax
  cmp    -0x20(%rbp),%eax
  jl     L125
  jmp    L22
L18:
  mov    -0x20(%rbp),%eax
  mov    %eax,-0x4(%rbp)
  jmp    L70
L41:
  movsbl -0x2c(%rbp),%edi
  movsbl -0x28(%rbp),%ecx
  movsbl -0x24(%rbp),%edx
  mov    0x18(%rbp),%r8d
  mov    -0x4(%rbp),%esi
  mov    -0x14(%rbp),%eax
  mov    %r8d,%r9d
  mov    %edi,%r8d
  mov    %eax,%edi
  call   <draw_pixel@plt>
  addl   $0x1,-0x4(%rbp)
L70:
  mov    -0x4(%rbp),%eax
  cmp    -0x18(%rbp),%eax
  jl     L41
  jmp    L22
L110:
  mov    -0x14(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jge    L106
  mov    -0x14(%rbp),%eax
  mov    %eax,-0x8(%rbp)
  jmp    L44
L96:
  movsbl -0x2c(%rbp),%edi
  movsbl -0x28(%rbp),%ecx
  movsbl -0x24(%rbp),%edx
  mov    0x18(%rbp),%r8d
  mov    -0x18(%rbp),%esi
  mov    -0x8(%rbp),%eax
  mov    %r8d,%r9d
  mov    %edi,%r8d
  mov    %eax,%edi
  call   <draw_pixel@plt>
  addl   $0x1,-0x8(%rbp)
L44:
  mov    -0x8(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jl     L96
  jmp    L22
L106:
  mov    -0x1c(%rbp),%eax
  mov    %eax,-0x8(%rbp)
  jmp    L76
L139:
  movsbl -0x2c(%rbp),%edi
  movsbl -0x28(%rbp),%ecx
  movsbl -0x24(%rbp),%edx
  mov    0x18(%rbp),%r8d
  mov    -0x18(%rbp),%esi
  mov    -0x8(%rbp),%eax
  mov    %r8d,%r9d
  mov    %edi,%r8d
  mov    %eax,%edi
  call   <draw_pixel@plt>
  addl   $0x1,-0x8(%rbp)
L76:
  mov    -0x8(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jl     L139
L22:
  nop
  leave
  ret
```

assistant: ```c
void draw_line(int x1, int y1, int x2, int y2, char r, char g, char b, int screen) {
  int x, y;
  if (x1 == x2) {
    if (y1 < y2)
      for (y = y1; y < y2; y++)
        draw_pixel(x1, y, r, g, b, screen);
    else
      for (y = y2; y < y1; y++)
        draw_pixel(x1, y, r, g, b, screen);
  } else {
    if (x1 < x2)
      for (x = x1; x < x2; x++)
        draw_pixel(x, y1, r, g, b, screen);
    else
      for (x = x2; x < x1; x++)
        draw_pixel(x, y1, r, g, b, screen);
  }
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<draw_line>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %edi,%ebx
  mov    %esi,%r12d
  mov    %r8d,%r13d
  mov    %r9d,%r14d
  movzbl 0x40(%rsp),%eax
  cmp    %edx,%edi
  je     L44
  mov    %edx,%ebp
  movsbl %al,%r15d
  jl     L112
  movsbl %al,%r15d
  jle    L100
L10:
  movsbl %r14b,%ecx
  movsbl %r13b,%edx
  mov    0x48(%rsp),%r9d
  mov    %r15d,%r8d
  mov    %r12d,%esi
  mov    %ebp,%edi
  call   <draw_pixel@plt>
  add    $0x1,%ebp
  cmp    %ebp,%ebx
  jne    L10
  jmp    L100
L44:
  mov    %ecx,%r15d
  movsbl %al,%ebp
  cmp    %ecx,%esi
  jl     L49
  movsbl %al,%ebp
  jle    L100
L42:
  movsbl %r14b,%ecx
  movsbl %r13b,%edx
  mov    0x48(%rsp),%r9d
  mov    %ebp,%r8d
  mov    %r15d,%esi
  mov    %ebx,%edi
  call   <draw_pixel@plt>
  add    $0x1,%r15d
  cmp    %r15d,%r12d
  jne    L42
  jmp    L100
L49:
  movsbl %r14b,%ecx
  movsbl %r13b,%edx
  mov    0x48(%rsp),%r9d
  mov    %ebp,%r8d
  mov    %r12d,%esi
  mov    %ebx,%edi
  call   <draw_pixel@plt>
  add    $0x1,%r12d
  cmp    %r12d,%r15d
  jne    L49
  jmp    L100
L112:
  movsbl %r14b,%ecx
  movsbl %r13b,%edx
  mov    0x48(%rsp),%r9d
  mov    %r15d,%r8d
  mov    %r12d,%esi
  mov    %ebx,%edi
  call   <draw_pixel@plt>
  add    $0x1,%ebx
  cmp    %ebx,%ebp
  jne    L112
L100:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void draw_line(int x1, int y1, int x2, int y2, char r, char g, char b, int screen) {
  int x, y;
  if (x1 == x2) {
    if (y1 < y2)
      for (y = y1; y < y2; y++)
        draw_pixel(x1, y, r, g, b, screen);
    else
      for (y = y2; y < y1; y++)
        draw_pixel(x1, y, r, g, b, screen);
  } else {
    if (x1 < x2)
      for (x = x1; x < x2; x++)
        draw_pixel(x, y1, r, g, b, screen);
    else
      for (x = x2; x < x1; x++)
        draw_pixel(x, y1, r, g, b, screen);
  }
}
```