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

```asm
<fix_answer>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  jmp    L7
L51:
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <tolower@plt>
  mov    -0x10(%rbp),%rdx
  mov    %al,(%rdx)
  addq   $0x1,-0x10(%rbp)
L7:
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L51
  jmp    L36
L11:
  subq   $0x1,-0x10(%rbp)
L36:
  mov    -0x10(%rbp),%rax
  cmp    -0x18(%rbp),%rax
  jb     L27
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L11
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  je     L11
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x9,%al
  je     L11
L27:
  mov    -0x10(%rbp),%rax
  add    $0x1,%rax
  movb   $0x0,(%rax)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  jmp    L80
L13:
  addq   $0x1,-0x10(%rbp)
L80:
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  je     L13
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x9,%al
  je     L13
  mov    -0x10(%rbp),%rax
  cmp    -0x18(%rbp),%rax
  je     L111
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  jmp    L106
L33:
  mov    -0x10(%rbp),%rdx
  lea    0x1(%rdx),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rcx
  mov    %rcx,-0x8(%rbp)
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
L106:
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L33
  mov    -0x8(%rbp),%rax
  movb   $0x0,(%rax)
L111:
  nop
  leave
  ret
```

assistant: ```c
void fix_answer(char *s) {
  char *t, *p;
  for (t = s; *t != 0; t++)
    *t = tolower(*t);
  for (; t >= s && (*t == 0 || ((*t) == ' ' || (*t) == '\t')); t--)
    ;
  *(t + 1) = 0;
  for (t = s; ((*t) == ' ' || (*t) == '\t'); t++)
    ;
  if (t != s) {
    for (p = s; *t != 0;)
      *(p++) = *(t++);
    *p = 0;
  }
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<fix_answer>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbp
  movzbl (%rdi),%edi
  test   %dil,%dil
  je     L16
  mov    %rbp,%rbx
L13:
  movsbl %dil,%edi
  call   <tolower@plt>
  mov    %al,(%rbx)
  add    $0x1,%rbx
  movzbl (%rbx),%edi
  test   %dil,%dil
  jne    L13
  cmp    %rbx,%rbp
  jbe    L43
  jmp    L40
L78:
  sub    $0x1,%rbx
  cmp    %rbx,%rbp
  ja     L40
L43:
  movzbl (%rbx),%eax
  test   $0xdf,%al
  je     L78
  cmp    $0x9,%al
  je     L78
L40:
  movb   $0x0,0x1(%rbx)
  movzbl 0x0(%rbp),%eax
  cmp    $0x20,%al
  je     L45
  cmp    $0x9,%al
  jne    L90
L45:
  mov    %rbp,%rax
L142:
  add    $0x1,%rax
  movzbl (%rax),%edx
  cmp    $0x20,%dl
  je     L142
  cmp    $0x9,%dl
  je     L142
  cmp    %rax,%rbp
  je     L90
  test   %dl,%dl
  je     L72
L107:
  add    $0x1,%rax
  add    $0x1,%rbp
  mov    %dl,-0x1(%rbp)
  movzbl (%rax),%edx
  test   %dl,%dl
  jne    L107
L72:
  movb   $0x0,0x0(%rbp)
L90:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
L16:
  mov    %rbp,%rbx
  jmp    L43
```

assistant: ```c
void fix_answer(char *s) {
  char *t, *p;
  for (t = s; *t != 0; t++)
    *t = tolower(*t);
  for (; t >= s && (*t == 0 || ((*t) == ' ' || (*t) == '\t')); t--)
    ;
  *(t + 1) = 0;
  for (t = s; ((*t) == ' ' || (*t) == '\t'); t++)
    ;
  if (t != s) {
    for (p = s; *t != 0;)
      *(p++) = *(t++);
    *p = 0;
  }
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<fix_answer>:
  endbr64
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %rbp,%rbx
  sub    $0x8,%rsp
  movsbl (%rdi),%edi
  test   %dil,%dil
  je     L107
  nopl   0x0(%rax,%rax,1)
L31:
  call   <tolower@plt>
  add    $0x1,%rbx
  mov    %al,-0x1(%rbx)
  movsbl (%rbx),%edi
  test   %dil,%dil
  jne    L31
L107:
  xor    %eax,%eax
  jmp    L40
  nopl   0x0(%rax,%rax,1)
L45:
  movzbl (%rbx),%eax
L40:
  test   $0xdf,%al
  je     L12
  cmp    $0x9,%al
  jne    L83
L12:
  sub    $0x1,%rbx
  cmp    %rbx,%rbp
  jbe    L45
L83:
  movb   $0x0,0x1(%rbx)
  movzbl 0x0(%rbp),%eax
  cmp    $0x20,%al
  je     L90
  cmp    $0x9,%al
  jne    L71
L90:
  mov    %rbp,%rax
  nopw   0x0(%rax,%rax,1)
L115:
  movzbl 0x1(%rax),%edx
  add    $0x1,%rax
  cmp    $0x20,%dl
  je     L115
  cmp    $0x9,%dl
  je     L115
  cmp    %rax,%rbp
  jne    L8
  jmp    L71
  nopl   0x0(%rax)
L98:
  add    $0x1,%rax
  mov    %dl,0x0(%rbp)
  add    $0x1,%rbp
  movzbl (%rax),%edx
L8:
  test   %dl,%dl
  jne    L98
  movb   $0x0,0x0(%rbp)
L71:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
void fix_answer(char *s) {
  char *t, *p;
  for (t = s; *t != 0; t++)
    *t = tolower(*t);
  for (; t >= s && (*t == 0 || ((*t) == ' ' || (*t) == '\t')); t--)
    ;
  *(t + 1) = 0;
  for (t = s; ((*t) == ' ' || (*t) == '\t'); t++)
    ;
  if (t != s) {
    for (p = s; *t != 0;)
      *(p++) = *(t++);
    *p = 0;
  }
}
```
user: What is the c source code of the assembly code below?

```asm
<fix_answer>:
  endbr64
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %rbp,%rbx
  sub    $0x8,%rsp
  movsbl (%rdi),%edi
  test   %dil,%dil
  je     L117
  nopl   0x0(%rax,%rax,1)
L88:
  call   <tolower@plt>
  add    $0x1,%rbx
  mov    %al,-0x1(%rbx)
  movsbl (%rbx),%edi
  test   %dil,%dil
  jne    L88
  nopl   0x0(%rax)
L117:
  movzbl (%rbx),%eax
  test   $0xdf,%al
  je     L20
  cmp    $0x9,%al
  jne    L82
L20:
  sub    $0x1,%rbx
  cmp    %rbx,%rbp
  jbe    L117
L82:
  movb   $0x0,0x1(%rbx)
  movzbl 0x0(%rbp),%eax
  cmp    $0x20,%al
  je     L113
  cmp    $0x9,%al
  jne    L55
L113:
  mov    %rbp,%rax
  nop
L110:
  movzbl 0x1(%rax),%edx
  add    $0x1,%rax
  cmp    $0x20,%dl
  je     L110
  cmp    $0x9,%dl
  je     L110
  cmp    %rax,%rbp
  jne    L100
  jmp    L55
  nopl   0x0(%rax)
L90:
  add    $0x1,%rax
  mov    %dl,0x0(%rbp)
  add    $0x1,%rbp
  movzbl (%rax),%edx
L100:
  test   %dl,%dl
  jne    L90
  movb   $0x0,0x0(%rbp)
L55:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
void fix_answer(char *s) {
  char *t, *p;
  for (t = s; *t != 0; t++)
    *t = tolower(*t);
  for (; t >= s && (*t == 0 || ((*t) == ' ' || (*t) == '\t')); t--)
    ;
  *(t + 1) = 0;
  for (t = s; ((*t) == ' ' || (*t) == '\t'); t++)
    ;
  if (t != s) {
    for (p = s; *t != 0;)
      *(p++) = *(t++);
    *p = 0;
  }
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<relaxed_body_canon_line>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  movl   $0x0,-0x4(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <rtrim@plt>
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x4(%rbp)
  movl   $0x0,-0x8(%rbp)
  movl   $0x0,-0xc(%rbp)
  jmp    L2
L24:
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x9,%al
  jne    L55
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movb   $0x20,(%rax)
L55:
  cmpl   $0x0,-0xc(%rbp)
  jle    L64
  mov    -0xc(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  jne    L68
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  je     L45
L68:
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  movzbl (%rcx),%eax
  mov    %al,(%rdx)
  jmp    L45
L64:
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  movzbl (%rcx),%eax
  mov    %al,(%rdx)
L45:
  addl   $0x1,-0xc(%rbp)
L2:
  mov    -0xc(%rbp),%eax
  cmp    -0x4(%rbp),%eax
  jl     L24
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x18(%rbp),%rax
  leave
  ret
```

assistant: ```c
char *relaxed_body_canon_line(char *line) {
  int line_len = 0;
  int i;
  rtrim(line);
  line_len = strlen(line);
  int new_len = 0;
  for (i = 0; i < line_len; ++i) {
    if (line[i] == '\t') {
      line[i] = ' ';
    }
    if (i > 0) {
      if (!(line[i - 1] == ' ' && line[i] == ' ')) {
        line[new_len++] = line[i];
      }
    } else {
      line[new_len++] = line[i];
    }
  }
  line[new_len] = '\0';
  return line;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<relaxed_body_canon_line>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  call   <rtrim@plt>
  mov    %rbx,%rdi
  call   <strlen@plt>
  test   %eax,%eax
  jle    L6
  mov    %rbx,%rdx
  mov    $0x0,%esi
  mov    $0x0,%ecx
  jmp    L19
L69:
  movb   $0x20,(%rdx)
  jmp    L95
L75:
  movzbl (%rdi),%r8d
  movslq %esi,%rdi
  mov    %r8b,(%rbx,%rdi,1)
  lea    0x1(%rsi),%esi
L66:
  add    $0x1,%ecx
  add    $0x1,%rdx
  cmp    %ecx,%eax
  je     L78
L19:
  mov    %rdx,%rdi
  cmpb   $0x9,(%rdx)
  je     L69
L95:
  test   %ecx,%ecx
  jle    L14
  cmpb   $0x20,-0x1(%rdi)
  jne    L75
  cmpb   $0x20,(%rdi)
  jne    L75
  jmp    L66
L14:
  movzbl (%rdi),%r8d
  movslq %esi,%rdi
  mov    %r8b,(%rbx,%rdi,1)
  lea    0x1(%rsi),%esi
  jmp    L66
L6:
  mov    $0x0,%esi
L78:
  movslq %esi,%rsi
  movb   $0x0,(%rbx,%rsi,1)
  mov    %rbx,%rax
  pop    %rbx
  ret
```

assistant: ```c
char *relaxed_body_canon_line(char *line) {
  int line_len = 0;
  int i;
  rtrim(line);
  line_len = strlen(line);
  int new_len = 0;
  for (i = 0; i < line_len; ++i) {
    if (line[i] == '\t') {
      line[i] = ' ';
    }
    if (i > 0) {
      if (!(line[i - 1] == ' ' && line[i] == ' ')) {
        line[new_len++] = line[i];
      }
    } else {
      line[new_len++] = line[i];
    }
  }
  line[new_len] = '\0';
  return line;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<relaxed_body_canon_line>:
  endbr64
  push   %r12
  mov    %rdi,%r12
  call   <rtrim@plt>
  mov    %r12,%rdi
  call   <strlen@plt>
  test   %eax,%eax
  jle    L80
  cltq
  xor    %edx,%edx
  xor    %esi,%esi
  xor    %edi,%edi
  jmp    L68
  nopl   0x0(%rax)
L24:
  lea    (%r12,%rdi,1),%r8
  test   %rdx,%rdx
  je     L42
  cmpb   $0x20,-0x1(%r12,%rdx,1)
  je     L78
L42:
  mov    %cl,(%r8)
  add    $0x1,%esi
  movslq %esi,%rdi
L77:
  add    $0x1,%rdx
  cmp    %rax,%rdx
  je     L17
L68:
  movzbl (%r12,%rdx,1),%ecx
  cmp    $0x9,%cl
  jne    L24
  movb   $0x20,(%r12,%rdx,1)
  lea    (%r12,%rdi,1),%r8
  mov    $0x20,%ecx
  test   %rdx,%rdx
  je     L42
  cmpb   $0x20,-0x1(%r12,%rdx,1)
  jne    L42
  add    $0x1,%rdx
  cmp    %rax,%rdx
  jne    L68
L17:
  add    %r12,%rdi
  mov    %r12,%rax
  movb   $0x0,(%rdi)
  pop    %r12
  ret
  nopl   (%rax)
L78:
  cmp    $0x20,%cl
  jne    L42
  jmp    L77
  nop
L80:
  mov    %r12,%rdi
  mov    %r12,%rax
  movb   $0x0,(%rdi)
  pop    %r12
  ret
```

assistant: ```c
char *relaxed_body_canon_line(char *line) {
  int line_len = 0;
  int i;
  rtrim(line);
  line_len = strlen(line);
  int new_len = 0;
  for (i = 0; i < line_len; ++i) {
    if (line[i] == '\t') {
      line[i] = ' ';
    }
    if (i > 0) {
      if (!(line[i - 1] == ' ' && line[i] == ' ')) {
        line[new_len++] = line[i];
      }
    } else {
      line[new_len++] = line[i];
    }
  }
  line[new_len] = '\0';
  return line;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<relaxed_body_canon_line>:
  endbr64
  push   %r12
  mov    %rdi,%r12
  call   <rtrim@plt>
  mov    %r12,%rdi
  call   <strlen@plt>
  test   %eax,%eax
  jle    L33
  cltq
  xor    %edx,%edx
  xor    %esi,%esi
  xor    %edi,%edi
  jmp    L77
  nopl   0x0(%rax)
L43:
  lea    (%r12,%rdi,1),%r8
  test   %rdx,%rdx
  je     L51
  cmpb   $0x20,-0x1(%r12,%rdx,1)
  je     L71
L51:
  mov    %cl,(%r8)
  add    $0x1,%esi
  movslq %esi,%rdi
L17:
  add    $0x1,%rdx
  cmp    %rax,%rdx
  je     L64
L77:
  movzbl (%r12,%rdx,1),%ecx
  cmp    $0x9,%cl
  jne    L43
  movb   $0x20,(%r12,%rdx,1)
  lea    (%r12,%rdi,1),%r8
  mov    $0x20,%ecx
  test   %rdx,%rdx
  je     L51
  cmpb   $0x20,-0x1(%r12,%rdx,1)
  jne    L51
  add    $0x1,%rdx
  cmp    %rax,%rdx
  jne    L77
L64:
  add    %r12,%rdi
  mov    %r12,%rax
  movb   $0x0,(%rdi)
  pop    %r12
  ret
  nopl   (%rax)
L71:
  cmp    $0x20,%cl
  jne    L51
  jmp    L17
  nop
L33:
  mov    %r12,%rdi
  mov    %r12,%rax
  movb   $0x0,(%rdi)
  pop    %r12
  ret
```

assistant: ```c
char *relaxed_body_canon_line(char *line) {
  int line_len = 0;
  int i;
  rtrim(line);
  line_len = strlen(line);
  int new_len = 0;
  for (i = 0; i < line_len; ++i) {
    if (line[i] == '\t') {
      line[i] = ' ';
    }
    if (i > 0) {
      if (!(line[i - 1] == ' ' && line[i] == ' ')) {
        line[new_len++] = line[i];
      }
    } else {
      line[new_len++] = line[i];
    }
  }
  line[new_len] = '\0';
  return line;
}
```
user: Translate the below assembly code into C programming language:

```asm
<OLED_init>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    $0x1,%edi
  call   <OLED_wrcmd@plt>
  mov    $0x2,%edi
  call   <CMT1_delay_ms@plt>
  mov    $0x2,%edi
  call   <OLED_wrcmd@plt>
  mov    $0x2,%edi
  call   <CMT1_delay_ms@plt>
  mov    $0xc,%edi
  call   <OLED_wrcmd@plt>
  mov    $0x4,%edi
  call   <CMT1_delay_10us@plt>
  mov    $0x6,%edi
  call   <OLED_wrcmd@plt>
  mov    $0x4,%edi
  call   <CMT1_delay_10us@plt>
  mov    $0x7f,%edi
  call   <OLED_contrast@plt>
  nop
  pop    %rbp
  ret
```

assistant: ```c
void OLED_init(void) {
  OLED_wrcmd(0x01);
  CMT1_delay_ms(2);
  OLED_wrcmd(0x02);
  CMT1_delay_ms(2);
  OLED_wrcmd(0x0C);
  CMT1_delay_10us(4);
  OLED_wrcmd(0x06);
  CMT1_delay_10us(4);
  OLED_contrast(0x7F);
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<OLED_init>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x1,%edi
  call   <OLED_wrcmd@plt>
  mov    $0x2,%edi
  call   <CMT1_delay_ms@plt>
  mov    $0x2,%edi
  call   <OLED_wrcmd@plt>
  mov    $0x2,%edi
  call   <CMT1_delay_ms@plt>
  mov    $0xc,%edi
  call   <OLED_wrcmd@plt>
  mov    $0x4,%edi
  call   <CMT1_delay_10us@plt>
  mov    $0x6,%edi
  call   <OLED_wrcmd@plt>
  mov    $0x4,%edi
  call   <CMT1_delay_10us@plt>
  mov    $0x7f,%edi
  call   <OLED_contrast@plt>
  add    $0x8,%rsp
  ret
```

assistant: ```c
void OLED_init(void) {
  OLED_wrcmd(0x01);
  CMT1_delay_ms(2);
  OLED_wrcmd(0x02);
  CMT1_delay_ms(2);
  OLED_wrcmd(0x0C);
  CMT1_delay_10us(4);
  OLED_wrcmd(0x06);
  CMT1_delay_10us(4);
  OLED_contrast(0x7F);
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<OLED_init>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x1,%edi
  call   <OLED_wrcmd@plt>
  mov    $0x2,%edi
  call   <CMT1_delay_ms@plt>
  mov    $0x2,%edi
  call   <OLED_wrcmd@plt>
  mov    $0x2,%edi
  call   <CMT1_delay_ms@plt>
  mov    $0xc,%edi
  call   <OLED_wrcmd@plt>
  mov    $0x4,%edi
  call   <CMT1_delay_10us@plt>
  mov    $0x6,%edi
  call   <OLED_wrcmd@plt>
  mov    $0x4,%edi
  call   <CMT1_delay_10us@plt>
  mov    $0x7f,%edi
  add    $0x8,%rsp
  jmp    10a0 <OLED_contrast@plt>
```

assistant: ```c
void OLED_init(void) {
  OLED_wrcmd(0x01);
  CMT1_delay_ms(2);
  OLED_wrcmd(0x02);
  CMT1_delay_ms(2);
  OLED_wrcmd(0x0C);
  CMT1_delay_10us(4);
  OLED_wrcmd(0x06);
  CMT1_delay_10us(4);
  OLED_contrast(0x7F);
}
```
user: Translate the below assembly code into C programming language:

```asm
<OLED_init>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x1,%edi
  call   <OLED_wrcmd@plt>
  mov    $0x2,%edi
  call   <CMT1_delay_ms@plt>
  mov    $0x2,%edi
  call   <OLED_wrcmd@plt>
  mov    $0x2,%edi
  call   <CMT1_delay_ms@plt>
  mov    $0xc,%edi
  call   <OLED_wrcmd@plt>
  mov    $0x4,%edi
  call   <CMT1_delay_10us@plt>
  mov    $0x6,%edi
  call   <OLED_wrcmd@plt>
  mov    $0x4,%edi
  call   <CMT1_delay_10us@plt>
  mov    $0x7f,%edi
  add    $0x8,%rsp
  jmp    10a0 <OLED_contrast@plt>
```

assistant: ```c
void OLED_init(void) {
  OLED_wrcmd(0x01);
  CMT1_delay_ms(2);
  OLED_wrcmd(0x02);
  CMT1_delay_ms(2);
  OLED_wrcmd(0x0C);
  CMT1_delay_10us(4);
  OLED_wrcmd(0x06);
  CMT1_delay_10us(4);
  OLED_contrast(0x7F);
}
```
user: What is the c source code of the assembly code below?

```asm
<LCDRasterFrameBufferSet>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x4(%rbp)
  mov    %esi,-0x8(%rbp)
  mov    %rdx,-0x10(%rbp)
  mov    %ecx,-0x14(%rbp)
  cmpl   $0x44050000,-0x4(%rbp)
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <ASSERT@plt>
  mov    -0x10(%rbp),%rax
  and    $0x3,%eax
  test   %eax,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <ASSERT@plt>
  mov    -0x14(%rbp),%eax
  and    $0x3,%eax
  test   %eax,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <ASSERT@plt>
  cmpl   $0x1,-0x8(%rbp)
  setle  %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <ASSERT@plt>
  cmpl   $0x0,-0x8(%rbp)
  jne    L15
  mov    -0x10(%rbp),%rax
  mov    -0x4(%rbp),%edx
  add    $0x44,%edx
  movslq %edx,%rdx
  mov    %eax,(%rdx)
  mov    -0x10(%rbp),%rax
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  add    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    $0x48,%eax
  cltq
  mov    %rax,%rcx
  lea    -0x4(%rdx),%eax
  mov    %eax,(%rcx)
  jmp    L18
L15:
  mov    -0x10(%rbp),%rax
  mov    -0x4(%rbp),%edx
  add    $0x4c,%edx
  movslq %edx,%rdx
  mov    %eax,(%rdx)
  mov    -0x10(%rbp),%rax
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  add    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    $0x50,%eax
  cltq
  mov    %rax,%rcx
  lea    -0x4(%rdx),%eax
  mov    %eax,(%rcx)
L18:
  nop
  leave
  ret
```

assistant: ```c
void LCDRasterFrameBufferSet(uint32_t ui32Base, uint8_t ui8Buffer, uint32_t *pui32Addr, uint32_t ui32NumBytes) {
  ASSERT(ui32Base == 0x44050000);
  ASSERT(!((uint32_t)pui32Addr & 3));
  ASSERT(!(ui32NumBytes & 3));
  ASSERT(ui8Buffer < 2);
  if (!ui8Buffer) {
    (*((volatile uint32_t *)(ui32Base + 0x00000044))) = (uint32_t)pui32Addr;
    (*((volatile uint32_t *)(ui32Base + 0x00000048))) = (uint32_t)pui32Addr + ui32NumBytes - 4;
  } else {
    (*((volatile uint32_t *)(ui32Base + 0x0000004C))) = (uint32_t)pui32Addr;
    (*((volatile uint32_t *)(ui32Base + 0x00000050))) = (uint32_t)pui32Addr + ui32NumBytes - 4;
  }
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<LCDRasterFrameBufferSet>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %edi,%ebx
  mov    %esi,%r13d
  mov    %rdx,%rbp
  mov    %ecx,%r12d
  cmp    $0x44050000,%edi
  sete   %dil
  movzbl %dil,%edi
  call   <ASSERT@plt>
  test   $0x3,%bpl
  sete   %dil
  movzbl %dil,%edi
  call   <ASSERT@plt>
  test   $0x3,%r12b
  sete   %dil
  movzbl %dil,%edi
  call   <ASSERT@plt>
  cmp    $0x1,%r13d
  setle  %dil
  movzbl %dil,%edi
  call   <ASSERT@plt>
  test   %r13d,%r13d
  jne    L5
  lea    0x44(%rbx),%eax
  cltq
  mov    %ebp,(%rax)
  add    $0x48,%ebx
  movslq %ebx,%rbx
  lea    -0x4(%r12,%rbp,1),%eax
  mov    %eax,(%rbx)
L8:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L5:
  lea    0x4c(%rbx),%eax
  cltq
  mov    %ebp,(%rax)
  add    $0x50,%ebx
  movslq %ebx,%rbx
  lea    -0x4(%r12,%rbp,1),%eax
  mov    %eax,(%rbx)
  jmp    L8
```

assistant: ```c
void LCDRasterFrameBufferSet(uint32_t ui32Base, uint8_t ui8Buffer, uint32_t *pui32Addr, uint32_t ui32NumBytes) {
  ASSERT(ui32Base == 0x44050000);
  ASSERT(!((uint32_t)pui32Addr & 3));
  ASSERT(!(ui32NumBytes & 3));
  ASSERT(ui8Buffer < 2);
  if (!ui8Buffer) {
    (*((volatile uint32_t *)(ui32Base + 0x00000044))) = (uint32_t)pui32Addr;
    (*((volatile uint32_t *)(ui32Base + 0x00000048))) = (uint32_t)pui32Addr + ui32NumBytes - 4;
  } else {
    (*((volatile uint32_t *)(ui32Base + 0x0000004C))) = (uint32_t)pui32Addr;
    (*((volatile uint32_t *)(ui32Base + 0x00000050))) = (uint32_t)pui32Addr + ui32NumBytes - 4;
  }
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<LCDRasterFrameBufferSet>:
  endbr64
  push   %r13
  mov    %esi,%r13d
  push   %r12
  mov    %rdx,%r12
  push   %rbp
  mov    %ecx,%ebp
  push   %rbx
  mov    %edi,%ebx
  sub    $0x8,%rsp
  cmp    $0x44050000,%edi
  sete   %dil
  movzbl %dil,%edi
  call   <ASSERT@plt>
  xor    %edi,%edi
  test   $0x3,%r12b
  sete   %dil
  call   <ASSERT@plt>
  xor    %edi,%edi
  test   $0x3,%bpl
  sete   %dil
  call   <ASSERT@plt>
  xor    %edi,%edi
  cmp    $0x1,%r13d
  setle  %dil
  call   <ASSERT@plt>
  lea    -0x4(%rbp,%r12,1),%eax
  test   %r13d,%r13d
  jne    L9
  lea    0x44(%rbx),%edx
  add    $0x48,%ebx
  movslq %ebx,%rbx
  movslq %edx,%rdx
  mov    %r12d,(%rdx)
  mov    %eax,(%rbx)
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  xchg   %ax,%ax
L9:
  lea    0x4c(%rbx),%edx
  add    $0x50,%ebx
  movslq %ebx,%rbx
  movslq %edx,%rdx
  mov    %r12d,(%rdx)
  mov    %eax,(%rbx)
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
void LCDRasterFrameBufferSet(uint32_t ui32Base, uint8_t ui8Buffer, uint32_t *pui32Addr, uint32_t ui32NumBytes) {
  ASSERT(ui32Base == 0x44050000);
  ASSERT(!((uint32_t)pui32Addr & 3));
  ASSERT(!(ui32NumBytes & 3));
  ASSERT(ui8Buffer < 2);
  if (!ui8Buffer) {
    (*((volatile uint32_t *)(ui32Base + 0x00000044))) = (uint32_t)pui32Addr;
    (*((volatile uint32_t *)(ui32Base + 0x00000048))) = (uint32_t)pui32Addr + ui32NumBytes - 4;
  } else {
    (*((volatile uint32_t *)(ui32Base + 0x0000004C))) = (uint32_t)pui32Addr;
    (*((volatile uint32_t *)(ui32Base + 0x00000050))) = (uint32_t)pui32Addr + ui32NumBytes - 4;
  }
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<LCDRasterFrameBufferSet>:
  endbr64
  push   %r13
  mov    %esi,%r13d
  push   %r12
  mov    %rdx,%r12
  push   %rbp
  mov    %ecx,%ebp
  push   %rbx
  mov    %edi,%ebx
  sub    $0x8,%rsp
  cmp    $0x44050000,%edi
  sete   %dil
  movzbl %dil,%edi
  call   <ASSERT@plt>
  xor    %edi,%edi
  test   $0x3,%r12b
  sete   %dil
  call   <ASSERT@plt>
  xor    %edi,%edi
  test   $0x3,%bpl
  sete   %dil
  call   <ASSERT@plt>
  xor    %edi,%edi
  cmp    $0x1,%r13d
  setle  %dil
  call   <ASSERT@plt>
  lea    -0x4(%rbp,%r12,1),%eax
  test   %r13d,%r13d
  jne    L1
  lea    0x44(%rbx),%edx
  add    $0x48,%ebx
  movslq %ebx,%rbx
  movslq %edx,%rdx
  mov    %r12d,(%rdx)
  mov    %eax,(%rbx)
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  xchg   %ax,%ax
L1:
  lea    0x4c(%rbx),%edx
  add    $0x50,%ebx
  movslq %ebx,%rbx
  movslq %edx,%rdx
  mov    %r12d,(%rdx)
  mov    %eax,(%rbx)
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
void LCDRasterFrameBufferSet(uint32_t ui32Base, uint8_t ui8Buffer, uint32_t *pui32Addr, uint32_t ui32NumBytes) {
  ASSERT(ui32Base == 0x44050000);
  ASSERT(!((uint32_t)pui32Addr & 3));
  ASSERT(!(ui32NumBytes & 3));
  ASSERT(ui8Buffer < 2);
  if (!ui8Buffer) {
    (*((volatile uint32_t *)(ui32Base + 0x00000044))) = (uint32_t)pui32Addr;
    (*((volatile uint32_t *)(ui32Base + 0x00000048))) = (uint32_t)pui32Addr + ui32NumBytes - 4;
  } else {
    (*((volatile uint32_t *)(ui32Base + 0x0000004C))) = (uint32_t)pui32Addr;
    (*((volatile uint32_t *)(ui32Base + 0x00000050))) = (uint32_t)pui32Addr + ui32NumBytes - 4;
  }
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<write_doubles_to_defined_output_file>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    -0x20(%rbp),%rcx
  mov    -0x8(%rbp),%rdx
  lea    -0x14(%rbp),%rax
  mov    $0x0,%r8d
  mov    %rax,%rsi
  mov    $0xa0,%edi
  call   <_ada_use_c2phc@plt>
  mov    %eax,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  leave
  ret
```

assistant: ```c
int write_doubles_to_defined_output_file(int n, double *a) {
  int i, *b, fail;
  fail = _ada_use_c2phc(160, &n, b, a, 0);
  return fail;
}
```
user: Translate the below assembly code into C programming language:

```asm
<write_doubles_to_defined_output_file>:
  endbr64
  sub    $0x18,%rsp
  mov    %edi,0xc(%rsp)
  mov    %rsi,%rcx
  lea    0xc(%rsp),%rsi
  mov    $0x0,%r8d
  mov    $0x0,%edx
  mov    $0xa0,%edi
  call   <_ada_use_c2phc@plt>
  add    $0x18,%rsp
  ret
```

assistant: ```c
int write_doubles_to_defined_output_file(int n, double *a) {
  int i, *b, fail;
  fail = _ada_use_c2phc(160, &n, b, a, 0);
  return fail;
}
```