ylfeng/ReF-Decompile-dataset huggingface dataset:
user: Translate the below assembly code into C programming language:

```asm
<main>:
  endbr64
  push   %r12
  xor    %esi,%esi
  xor    %edi,%edi
  push   %rbp
  push   %rbx
  call   <xcb_connect@plt>
  mov    %rax,%rdi
  mov    %rax,%rbp
  call   <xcb_get_setup@plt>
  mov    %rax,%rdi
  call   <xcb_setup_roots_iterator@plt>
  mov    %rbp,%rdi
  mov    %rax,%rbx
  call   <xcb_generate_id@plt>
  sub    $0x8,%rsp
  mov    0x4(%rbx),%ecx
  xor    %r9d,%r9d
  push   $0x0
  mov    %eax,%r12d
  xor    %r8d,%r8d
  mov    %rbp,%rdi
  push   $0x0
  mov    (%rbx),%eax
  mov    %r12d,%edx
  push   %rax
  mov    D7(%rip),%rax
  mov    (%rax),%eax
  push   %rax
  mov    D4(%rip),%rax
  push   $0xa
  push   $0x96
  push   $0x96
  mov    (%rax),%esi
  call   <xcb_create_window@plt>
  add    $0x40,%rsp
  mov    %r12d,%esi
  mov    %rbp,%rdi
  call   <xcb_map_window@plt>
  mov    %rbp,%rdi
  call   <xcb_flush@plt>
  mov    %rbp,%rdi
  call   <xcb_disconnect@plt>
  pop    %rbx
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
int main() {
  xcb_connection_t *connection = xcb_connect(NULL, NULL);
  const xcb_setup_t *setup = xcb_get_setup(connection);
  xcb_screen_iterator_t iter = xcb_setup_roots_iterator(setup);
  xcb_screen_t *screen = iter.data;
  xcb_window_t window = xcb_generate_id(connection);
  xcb_create_window(connection, XCB_COPY_FROM_PARENT, window, screen->root, 0, 0, 150, 150, 10, XCB_WINDOW_CLASS_INPUT_OUTPUT, screen->root_visual, 0, NULL);
  xcb_map_window(connection, window);
  xcb_flush(connection);
  xcb_disconnect(connection);
  return 0;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<copy>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %edx,-0x24(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L3
L13:
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    -0x4(%rbp),%edx
  movslq %edx,%rcx
  mov    -0x20(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  addl   $0x1,-0x4(%rbp)
L3:
  mov    -0x4(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jg     L11
  cmpl   $0x3e7,-0x4(%rbp)
  jle    L13
L11:
  mov    -0x20(%rbp),%rax
  add    $0x3e8,%rax
  movb   $0x0,(%rax)
  nop
  pop    %rbp
  ret
```

assistant: ```c
void copy(char *from, char *to, int size) {
  for (int i = 0; i <= size && i < 1001 - 1; ++i) {
    to[i] = from[i];
  }
  to[1001 - 1] = 0;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<copy>:
  endbr64
  mov    $0x3e7,%ecx
  cmp    %ecx,%edx
  cmovle %edx,%ecx
  test   %edx,%edx
  js     L14
  mov    $0x0,%eax
L6:
  movzbl (%rdi,%rax,1),%edx
  mov    %dl,(%rsi,%rax,1)
  add    $0x1,%rax
  cmp    %eax,%ecx
  jge    L6
L14:
  movb   $0x0,0x3e8(%rsi)
  ret
```

assistant: ```c
void copy(char *from, char *to, int size) {
  for (int i = 0; i <= size && i < 1001 - 1; ++i) {
    to[i] = from[i];
  }
  to[1001 - 1] = 0;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<copy>:
  endbr64
  mov    $0x3e7,%ecx
  cmp    %ecx,%edx
  cmovle %edx,%ecx
  test   %edx,%edx
  js     L4
  xor    %eax,%eax
  nopl   0x0(%rax)
L5:
  movzbl (%rdi,%rax,1),%edx
  mov    %dl,(%rsi,%rax,1)
  add    $0x1,%rax
  cmp    %eax,%ecx
  jge    L5
L4:
  movb   $0x0,0x3e8(%rsi)
  ret
```

assistant: ```c
void copy(char *from, char *to, int size) {
  for (int i = 0; i <= size && i < 1001 - 1; ++i) {
    to[i] = from[i];
  }
  to[1001 - 1] = 0;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<copy>:
  endbr64
  mov    %rsi,%rcx
  mov    $0x3e7,%esi
  cmp    %esi,%edx
  cmovle %edx,%esi
  test   %edx,%edx
  js     L11
  xor    %r8d,%r8d
  lea    0x1(%rdi),%rdx
  test   %esi,%esi
  mov    %rcx,%rax
  cmovns %esi,%r8d
  sub    %rdx,%rax
  cmp    $0xe,%rax
  jbe    L98
  cmp    $0x6,%r8d
  jbe    L98
  lea    0x1(%r8),%r9d
  cmp    $0xe,%r8d
  jbe    L29
  mov    %r9d,%edx
  xor    %eax,%eax
  shr    $0x4,%edx
  shl    $0x4,%rdx
  nopw   0x0(%rax,%rax,1)
L2:
  movdqu (%rdi,%rax,1),%xmm0
  movups %xmm0,(%rcx,%rax,1)
  add    $0x10,%rax
  cmp    %rdx,%rax
  jne    L2
  mov    %r9d,%edx
  and    $0xfffffff0,%edx
  mov    %edx,%eax
  cmp    %edx,%r9d
  je     L11
  sub    %edx,%r8d
  lea    0x1(%r8),%r9d
  cmp    $0x6,%r8d
  jbe    L155
L137:
  mov    (%rdi,%rdx,1),%r8
  mov    %r8,(%rcx,%rdx,1)
  mov    %r9d,%edx
  and    $0xfffffff8,%edx
  add    %edx,%eax
  cmp    %edx,%r9d
  je     L11
L155:
  movslq %eax,%rdx
  movzbl (%rdi,%rdx,1),%r8d
  mov    %r8b,(%rcx,%rdx,1)
  lea    0x1(%rax),%edx
  cmp    %edx,%esi
  jl     L11
  movslq %edx,%rdx
  movzbl (%rdi,%rdx,1),%r8d
  mov    %r8b,(%rcx,%rdx,1)
  lea    0x2(%rax),%edx
  cmp    %edx,%esi
  jl     L11
  movslq %edx,%rdx
  movzbl (%rdi,%rdx,1),%r8d
  mov    %r8b,(%rcx,%rdx,1)
  lea    0x3(%rax),%edx
  cmp    %edx,%esi
  jl     L11
  movslq %edx,%rdx
  movzbl (%rdi,%rdx,1),%r8d
  mov    %r8b,(%rcx,%rdx,1)
  lea    0x4(%rax),%edx
  cmp    %edx,%esi
  jl     L11
  movslq %edx,%rdx
  movzbl (%rdi,%rdx,1),%r8d
  mov    %r8b,(%rcx,%rdx,1)
  lea    0x5(%rax),%edx
  cmp    %edx,%esi
  jl     L11
  movslq %edx,%rdx
  add    $0x6,%eax
  movzbl (%rdi,%rdx,1),%r8d
  mov    %r8b,(%rcx,%rdx,1)
  cmp    %eax,%esi
  jl     L11
  cltq
  movzbl (%rdi,%rax,1),%edx
  mov    %dl,(%rcx,%rax,1)
L11:
  movb   $0x0,0x3e8(%rcx)
  ret
  nopl   0x0(%rax,%rax,1)
L98:
  xor    %eax,%eax
  nopw   0x0(%rax,%rax,1)
L120:
  movzbl (%rdi,%rax,1),%edx
  mov    %dl,(%rcx,%rax,1)
  add    $0x1,%rax
  cmp    %eax,%esi
  jge    L120
  movb   $0x0,0x3e8(%rcx)
  ret
L29:
  xor    %edx,%edx
  xor    %eax,%eax
  jmp    L137
```

assistant: ```c
void copy(char *from, char *to, int size) {
  for (int i = 0; i <= size && i < 1001 - 1; ++i) {
    to[i] = from[i];
  }
  to[1001 - 1] = 0;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<reverse>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  movq   $0x0,-0x8(%rbp)
  jmp    L1
L8:
  mov    -0x1c(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x18(%rbp),%rax
  cqto
  idiv   %rcx
  mov    %rdx,%rax
  mov    %eax,-0xc(%rbp)
  mov    -0x1c(%rbp),%eax
  movslq %eax,%rsi
  mov    -0x18(%rbp),%rax
  cqto
  idiv   %rsi
  mov    %rax,-0x18(%rbp)
  mov    -0x1c(%rbp),%eax
  cltq
  mov    -0x8(%rbp),%rdx
  imul   %rdx,%rax
  mov    %rax,-0x8(%rbp)
  mov    -0xc(%rbp),%eax
  cltq
  add    %rax,-0x8(%rbp)
L1:
  cmpq   $0x0,-0x18(%rbp)
  jg     L8
  mov    -0x8(%rbp),%rax
  pop    %rbp
  ret
```

assistant: ```c
long reverse(long num, int base) {
  long rev = 0;
  while (num > 0) {
    int digit = num % base;
    num /= base;
    rev *= base;
    rev += digit;
  }
  return rev;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<reverse>:
  endbr64
  test   %rdi,%rdi
  jle    L6
  mov    $0x0,%ecx
  movslq %esi,%rsi
L9:
  mov    %rdi,%rax
  cqto
  idiv   %rsi
  mov    %rax,%rdi
  imul   %rsi,%rcx
  movslq %edx,%rdx
  add    %rdx,%rcx
  test   %rax,%rax
  jg     L9
L1:
  mov    %rcx,%rax
  ret
L6:
  mov    $0x0,%ecx
  jmp    L1
```

assistant: ```c
long reverse(long num, int base) {
  long rev = 0;
  while (num > 0) {
    int digit = num % base;
    num /= base;
    rev *= base;
    rev += digit;
  }
  return rev;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<reverse>:
  endbr64
  mov    %rdi,%rax
  test   %rdi,%rdi
  jle    L5
  movslq %esi,%rsi
  xor    %r8d,%r8d
  nopw   0x0(%rax,%rax,1)
L16:
  cqto
  imul   %rsi,%r8
  idiv   %rsi
  add    %rdx,%r8
  test   %rax,%rax
  jg     L16
  mov    %r8,%rax
  ret
  nopl   (%rax)
L5:
  xor    %r8d,%r8d
  mov    %r8,%rax
  ret
```

assistant: ```c
long reverse(long num, int base) {
  long rev = 0;
  while (num > 0) {
    int digit = num % base;
    num /= base;
    rev *= base;
    rev += digit;
  }
  return rev;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<reverse>:
  endbr64
  mov    %rdi,%rax
  test   %rdi,%rdi
  jle    L17
  movslq %esi,%rsi
  xor    %r8d,%r8d
  nopw   0x0(%rax,%rax,1)
L3:
  cqto
  imul   %rsi,%r8
  idiv   %rsi
  add    %rdx,%r8
  test   %rax,%rax
  jg     L3
  mov    %r8,%rax
  ret
  nopl   (%rax)
L17:
  xor    %r8d,%r8d
  mov    %r8,%rax
  ret
```

assistant: ```c
long reverse(long num, int base) {
  long rev = 0;
  while (num > 0) {
    int digit = num % base;
    num /= base;
    rev *= base;
    rev += digit;
  }
  return rev;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<init_tty_raw>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %edi,-0x24(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x30(%rbp),%rcx
  lea    -0x20(%rbp),%rax
  mov    $0x18,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  mov    -0x20(%rbp),%edx
  mov    D89(%rip),%rax
  mov    (%rax),%ecx
  mov    D44(%rip),%rax
  mov    (%rax),%eax
  or     %eax,%ecx
  mov    D9(%rip),%rax
  mov    (%rax),%eax
  or     %eax,%ecx
  mov    D24(%rip),%rax
  mov    (%rax),%eax
  or     %ecx,%eax
  not    %eax
  and    %edx,%eax
  mov    %eax,-0x20(%rbp)
  mov    -0x1c(%rbp),%edx
  mov    D96(%rip),%rax
  mov    (%rax),%ecx
  mov    D7(%rip),%rax
  mov    (%rax),%eax
  or     %eax,%ecx
  mov    D151(%rip),%rax
  mov    (%rax),%eax
  or     %eax,%ecx
  mov    D161(%rip),%rax
  mov    (%rax),%eax
  or     %eax,%ecx
  mov    D147(%rip),%rax
  mov    (%rax),%eax
  or     %eax,%ecx
  mov    D42(%rip),%rax
  mov    (%rax),%eax
  or     %eax,%ecx
  mov    D3(%rip),%rax
  mov    (%rax),%eax
  or     %eax,%ecx
  mov    D72(%rip),%rax
  mov    (%rax),%eax
  or     %eax,%ecx
  mov    D68(%rip),%rax
  mov    (%rax),%eax
  or     %ecx,%eax
  not    %eax
  and    %edx,%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x10(%rbp),%edx
  mov    D105(%rip),%rax
  mov    (%rax),%eax
  not    %eax
  and    %edx,%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x18(%rbp),%rdx
  mov    D87(%rip),%rax
  mov    (%rax),%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  movl   $0x1,(%rax)
  mov    -0x18(%rbp),%rdx
  mov    D31(%rip),%rax
  mov    (%rax),%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  movl   $0x0,(%rax)
  mov    D106(%rip),%rax
  mov    (%rax),%ecx
  lea    -0x20(%rbp),%rdx
  mov    -0x24(%rbp),%eax
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <tcsetattr@plt>
  cmp    $0xffffffff,%eax
  jne    L5
  mov    $0xffffffff,%eax
  jmp    L3
L5:
  mov    $0x0,%eax
L3:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L4
  call   <__stack_chk_fail@plt>
L4:
  leave
  ret
```

assistant: ```c
int init_tty_raw(int fd, struct termios *tty_base_attrs) {
  struct termios tty_raw_attrs;
  memcpy(&tty_raw_attrs, tty_base_attrs, sizeof(struct termios));
  tty_raw_attrs.c_lflag &= ~(ICANON | ISIG | IEXTEN | ECHO);
  tty_raw_attrs.c_iflag &= ~(BRKINT | ICRNL | IGNBRK | IGNCR | INLCR | INPCK | ISTRIP | IXON | PARMRK);
  tty_raw_attrs.c_oflag &= ~OPOST;
  tty_raw_attrs.c_cc[VMIN] = 1;
  tty_raw_attrs.c_cc[VTIME] = 0;
  if (tcsetattr(fd, TCSADRAIN, &tty_raw_attrs) == -1)
    return -1;
  return 0;
}
```
user: What is the c source code of the assembly code below?

```asm
<init_tty_raw>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %edi,%ebx
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbp
  mov    $0x18,%edx
  mov    %rbp,%rdi
  call   <memcpy@plt>
  mov    D39(%rip),%rax
  mov    (%rax),%eax
  mov    D45(%rip),%rdx
  or     (%rdx),%eax
  mov    D99(%rip),%rdx
  or     (%rdx),%eax
  mov    D15(%rip),%rdx
  or     (%rdx),%eax
  not    %eax
  and    %eax,(%rsp)
  mov    D88(%rip),%rax
  mov    (%rax),%eax
  mov    D159(%rip),%rdx
  or     (%rdx),%eax
  mov    D54(%rip),%rdx
  or     (%rdx),%eax
  mov    D147(%rip),%rdx
  or     (%rdx),%eax
  mov    D57(%rip),%rdx
  or     (%rdx),%eax
  mov    D142(%rip),%rdx
  or     (%rdx),%eax
  mov    D118(%rip),%rdx
  or     (%rdx),%eax
  mov    D23(%rip),%rdx
  or     (%rdx),%eax
  mov    D102(%rip),%rdx
  or     (%rdx),%eax
  not    %eax
  and    %eax,0x4(%rsp)
  mov    D97(%rip),%rax
  mov    (%rax),%eax
  not    %eax
  and    %eax,0x10(%rsp)
  mov    D77(%rip),%rax
  mov    (%rax),%rdx
  mov    0x8(%rsp),%rax
  movl   $0x1,(%rax,%rdx,4)
  mov    D11(%rip),%rax
  mov    (%rax),%rdx
  mov    0x8(%rsp),%rax
  movl   $0x0,(%rax,%rdx,4)
  mov    %rbp,%rdx
  mov    D58(%rip),%rax
  mov    (%rax),%esi
  mov    %ebx,%edi
  call   <tcsetattr@plt>
  cmp    $0xffffffff,%eax
  sete   %al
  movzbl %al,%eax
  neg    %eax
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L3
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  ret
L3:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int init_tty_raw(int fd, struct termios *tty_base_attrs) {
  struct termios tty_raw_attrs;
  memcpy(&tty_raw_attrs, tty_base_attrs, sizeof(struct termios));
  tty_raw_attrs.c_lflag &= ~(ICANON | ISIG | IEXTEN | ECHO);
  tty_raw_attrs.c_iflag &= ~(BRKINT | ICRNL | IGNBRK | IGNCR | INLCR | INPCK | ISTRIP | IXON | PARMRK);
  tty_raw_attrs.c_oflag &= ~OPOST;
  tty_raw_attrs.c_cc[VMIN] = 1;
  tty_raw_attrs.c_cc[VTIME] = 0;
  if (tcsetattr(fd, TCSADRAIN, &tty_raw_attrs) == -1)
    return -1;
  return 0;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<init_tty_raw>:
  endbr64
  push   %r12
  mov    $0x18,%edx
  push   %rbp
  mov    %edi,%ebp
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    %rsp,%r12
  mov    %r12,%rdi
  call   <memcpy@plt>
  mov    D106(%rip),%rdx
  mov    D74(%rip),%rax
  mov    %ebp,%edi
  mov    (%rax),%eax
  or     (%rdx),%eax
  mov    D38(%rip),%rdx
  or     (%rdx),%eax
  mov    D89(%rip),%rdx
  or     (%rdx),%eax
  mov    D40(%rip),%rdx
  not    %eax
  and    %eax,(%rsp)
  mov    D78(%rip),%rax
  mov    (%rax),%eax
  or     (%rdx),%eax
  mov    D73(%rip),%rdx
  or     (%rdx),%eax
  mov    D2(%rip),%rdx
  or     (%rdx),%eax
  mov    D58(%rip),%rdx
  or     (%rdx),%eax
  mov    D119(%rip),%rdx
  or     (%rdx),%eax
  mov    D167(%rip),%rdx
  or     (%rdx),%eax
  mov    D28(%rip),%rdx
  or     (%rdx),%eax
  mov    D7(%rip),%rdx
  or     (%rdx),%eax
  not    %eax
  and    %eax,0x4(%rsp)
  mov    D49(%rip),%rax
  mov    (%rax),%eax
  not    %eax
  and    %eax,0x10(%rsp)
  mov    D3(%rip),%rdx
  mov    0x8(%rsp),%rax
  mov    (%rdx),%rdx
  movl   $0x1,(%rax,%rdx,4)
  mov    D18(%rip),%rdx
  mov    (%rdx),%rdx
  movl   $0x0,(%rax,%rdx,4)
  mov    D50(%rip),%rax
  mov    %r12,%rdx
  mov    (%rax),%esi
  call   <tcsetattr@plt>
  cmp    $0xffffffff,%eax
  sete   %al
  movzbl %al,%eax
  neg    %eax
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L7
  add    $0x28,%rsp
  pop    %rbp
  pop    %r12
  ret
L7:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int init_tty_raw(int fd, struct termios *tty_base_attrs) {
  struct termios tty_raw_attrs;
  memcpy(&tty_raw_attrs, tty_base_attrs, sizeof(struct termios));
  tty_raw_attrs.c_lflag &= ~(ICANON | ISIG | IEXTEN | ECHO);
  tty_raw_attrs.c_iflag &= ~(BRKINT | ICRNL | IGNBRK | IGNCR | INLCR | INPCK | ISTRIP | IXON | PARMRK);
  tty_raw_attrs.c_oflag &= ~OPOST;
  tty_raw_attrs.c_cc[VMIN] = 1;
  tty_raw_attrs.c_cc[VTIME] = 0;
  if (tcsetattr(fd, TCSADRAIN, &tty_raw_attrs) == -1)
    return -1;
  return 0;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<init_tty_raw>:
  endbr64
  push   %r12
  mov    $0x18,%edx
  push   %rbp
  mov    %edi,%ebp
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    %rsp,%r12
  mov    %r12,%rdi
  call   <memcpy@plt>
  mov    D143(%rip),%rdx
  mov    D103(%rip),%rax
  mov    %ebp,%edi
  movq   (%rsp),%xmm1
  mov    (%rax),%eax
  or     (%rdx),%eax
  mov    D94(%rip),%rdx
  or     (%rdx),%eax
  mov    D105(%rip),%rdx
  or     (%rdx),%eax
  mov    D134(%rip),%rdx
  movd   %eax,%xmm0
  mov    D104(%rip),%rax
  mov    (%rax),%eax
  or     (%rdx),%eax
  mov    D141(%rip),%rdx
  or     (%rdx),%eax
  mov    D8(%rip),%rdx
  or     (%rdx),%eax
  mov    D117(%rip),%rdx
  or     (%rdx),%eax
  mov    D53(%rip),%rdx
  or     (%rdx),%eax
  mov    D100(%rip),%rdx
  or     (%rdx),%eax
  mov    D6(%rip),%rdx
  or     (%rdx),%eax
  mov    D72(%rip),%rdx
  or     (%rdx),%eax
  movd   %eax,%xmm2
  mov    D12(%rip),%rax
  punpckldq %xmm2,%xmm0
  mov    (%rax),%eax
  pandn  %xmm1,%xmm0
  movq   %xmm0,(%rsp)
  not    %eax
  and    %eax,0x10(%rsp)
  mov    0x8(%rsp),%rax
  mov    D91(%rip),%rdx
  mov    (%rdx),%rdx
  movl   $0x1,(%rax,%rdx,4)
  mov    D56(%rip),%rdx
  mov    (%rdx),%rdx
  movl   $0x0,(%rax,%rdx,4)
  mov    D138(%rip),%rax
  mov    %r12,%rdx
  mov    (%rax),%esi
  call   <tcsetattr@plt>
  cmp    $0xffffffff,%eax
  sete   %al
  movzbl %al,%eax
  neg    %eax
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L3
  add    $0x28,%rsp
  pop    %rbp
  pop    %r12
  ret
L3:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int init_tty_raw(int fd, struct termios *tty_base_attrs) {
  struct termios tty_raw_attrs;
  memcpy(&tty_raw_attrs, tty_base_attrs, sizeof(struct termios));
  tty_raw_attrs.c_lflag &= ~(ICANON | ISIG | IEXTEN | ECHO);
  tty_raw_attrs.c_iflag &= ~(BRKINT | ICRNL | IGNBRK | IGNCR | INLCR | INPCK | ISTRIP | IXON | PARMRK);
  tty_raw_attrs.c_oflag &= ~OPOST;
  tty_raw_attrs.c_cc[VMIN] = 1;
  tty_raw_attrs.c_cc[VTIME] = 0;
  if (tcsetattr(fd, TCSADRAIN, &tty_raw_attrs) == -1)
    return -1;
  return 0;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<CM_PREPROC_is_html>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x1f0,%rsp
  mov    %rdi,-0x1e8(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movq   $0x0,-0x70(%rbp)
  movq   $0x0,-0x68(%rbp)
  movq   $0x0,-0x60(%rbp)
  movq   $0x0,-0x58(%rbp)
  movq   $0x0,-0x50(%rbp)
  movq   $0x0,-0x48(%rbp)
  movq   $0x0,-0x40(%rbp)
  movq   $0x0,-0x38(%rbp)
  movq   $0x0,-0x30(%rbp)
  movq   $0x0,-0x28(%rbp)
  movq   $0x0,-0x20(%rbp)
  movq   $0x0,-0x18(%rbp)
  movl   $0x0,-0x10(%rbp)
  lea    -0x1c0(%rbp),%rax
  lea    D8(%rip),%rdx
  mov    $0x29,%ecx
  mov    %rax,%rdi
  mov    %rdx,%rsi
  rep movsq %ds:(%rsi),%es:(%rdi)
  cmpq   $0x0,-0x1e8(%rbp)
  je     L51
  mov    -0x1e8(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L123
L51:
  mov    $0x0,%eax
  jmp    L73
L123:
  mov    -0x1e8(%rbp),%rax
  mov    $0x3c,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  mov    %rax,-0x1e8(%rbp)
  jmp    L104
L87:
  lea    -0x70(%rbp),%rcx
  mov    -0x1e8(%rbp),%rax
  mov    $0x64,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <CM_PREPROC_parse_html_tag_tolower@plt>
  mov    %rax,-0x1d0(%rbp)
  cmpq   $0x0,-0x1d0(%rbp)
  je     L127
  lea    -0x1c0(%rbp),%rax
  mov    %rax,-0x1d8(%rbp)
  jmp    L29
L101:
  mov    -0x1d8(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,-0x1c8(%rbp)
  mov    -0x1c8(%rbp),%rax
  movzbl (%rax),%edx
  movzbl -0x70(%rbp),%eax
  cmp    %al,%dl
  jne    L37
  mov    -0x1c8(%rbp),%rdx
  lea    -0x70(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L37
  mov    $0x1,%eax
  jmp    L73
L37:
  addq   $0x8,-0x1d8(%rbp)
L29:
  mov    -0x1d8(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  jne    L101
  mov    -0x1d0(%rbp),%rax
  mov    %rax,-0x1e8(%rbp)
  jmp    L1
L127:
  nop
L1:
  mov    -0x1e8(%rbp),%rax
  add    $0x1,%rax
  mov    $0x3c,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  mov    %rax,-0x1e8(%rbp)
L104:
  cmpq   $0x0,-0x1e8(%rbp)
  jne    L87
  mov    $0x0,%eax
L73:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L84
  call   <__stack_chk_fail@plt>
L84:
  leave
  ret
```

assistant: ```c
int CM_PREPROC_is_html(const char *body) {
  char tagname[100] = {0};
  const char *ppHtmlSubsetLowerCase[] = {"html", "body", "a", "font", "table", "head", "base", "meta", "td", "tr", "style", "img", "object", "br", "b", "i", "span", "div", "form", "input", "button", "frame", "iframe", "tbody", "col", "th", "hr", "xml", "script", "pre", "param", "applet", "center", "area", "map", "em", "embed", "xmp", "sub", "sup", NULL};
  if ((body == NULL) || (*body == '\0'))
    return 0;
  for (body = strchr(body, '<'); body != NULL; body = strchr(body + 1, '<')) {
    const char *pTagEnd = CM_PREPROC_parse_html_tag_tolower(body, tagname, sizeof(tagname));
    const char **ppCurTag;
    if (pTagEnd == NULL)
      continue;
    for (ppCurTag = ppHtmlSubsetLowerCase; *ppCurTag != NULL; ppCurTag++) {
      const char *pCurTag = *ppCurTag;
      if ((*pCurTag == *tagname) && (strcmp(tagname, pCurTag) == 0))
        return 1;
    }
    body = pTagEnd;
  }
  return 0;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<CM_PREPROC_is_html>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x1c0,%rsp
  mov    %rdi,%rax
  mov    %fs:0x28,%rdx
  mov    %rdx,0x1b8(%rsp)
  xor    %edx,%edx
  movq   $0x0,0x150(%rsp)
  movq   $0x0,0x158(%rsp)
  movq   $0x0,0x160(%rsp)
  movq   $0x0,0x168(%rsp)
  movq   $0x0,0x170(%rsp)
  movq   $0x0,0x178(%rsp)
  movq   $0x0,0x180(%rsp)
  movq   $0x0,0x188(%rsp)
  movq   $0x0,0x190(%rsp)
  movq   $0x0,0x198(%rsp)
  movq   $0x0,0x1a0(%rsp)
  movq   $0x0,0x1a8(%rsp)
  movl   $0x0,0x1b0(%rsp)
  mov    %rsp,%rdi
  lea    D0(%rip),%rsi
  mov    $0x29,%ecx
  rep movsq %ds:(%rsi),%es:(%rdi)
  test   %rax,%rax
  je     L158
  cmpb   $0x0,(%rax)
  jne    L32
L49:
  mov    0x1b8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L93
  mov    %edx,%eax
  add    $0x1c0,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L32:
  mov    $0x3c,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L3
  lea    0x150(%rsp),%r12
  jmp    L71
L97:
  add    $0x8,%rbx
  mov    (%rbx),%rsi
  test   %rsi,%rsi
  je     L121
L98:
  movzbl 0x150(%rsp),%eax
  cmp    %al,(%rsi)
  jne    L97
  mov    %r12,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L97
  mov    $0x1,%edx
  jmp    L49
L147:
  mov    %rbx,%rbp
L121:
  lea    0x1(%rbp),%rdi
  mov    $0x3c,%esi
  call   <strchr@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L60
L71:
  mov    $0x64,%edx
  mov    %r12,%rsi
  mov    %rbx,%rdi
  call   <CM_PREPROC_parse_html_tag_tolower@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L147
  mov    (%rsp),%rsi
  test   %rsi,%rsi
  je     L121
  mov    %rsp,%rbx
  jmp    L98
L60:
  mov    $0x0,%edx
  jmp    L49
L158:
  mov    $0x0,%edx
  jmp    L49
L3:
  mov    $0x0,%edx
  jmp    L49
L93:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int CM_PREPROC_is_html(const char *body) {
  char tagname[100] = {0};
  const char *ppHtmlSubsetLowerCase[] = {"html", "body", "a", "font", "table", "head", "base", "meta", "td", "tr", "style", "img", "object", "br", "b", "i", "span", "div", "form", "input", "button", "frame", "iframe", "tbody", "col", "th", "hr", "xml", "script", "pre", "param", "applet", "center", "area", "map", "em", "embed", "xmp", "sub", "sup", NULL};
  if ((body == NULL) || (*body == '\0'))
    return 0;
  for (body = strchr(body, '<'); body != NULL; body = strchr(body + 1, '<')) {
    const char *pTagEnd = CM_PREPROC_parse_html_tag_tolower(body, tagname, sizeof(tagname));
    const char **ppCurTag;
    if (pTagEnd == NULL)
      continue;
    for (ppCurTag = ppHtmlSubsetLowerCase; *ppCurTag != NULL; ppCurTag++) {
      const char *pCurTag = *ppCurTag;
      if ((*pCurTag == *tagname) && (strcmp(tagname, pCurTag) == 0))
        return 1;
    }
    body = pTagEnd;
  }
  return 0;
}
```