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

```asm
<compal_get_lcd_brightness>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    D7(%rip),%rax
  mov    %rax,%rsi
  lea    D11(%rip),%rax
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x10(%rbp)
  cmpq   $0x0,-0x10(%rbp)
  jne    L42
  mov    $0xffffffff,%eax
  jmp    L46
L42:
  lea    -0x14(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  lea    D1(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <fscanf@plt>
  cmp    $0x1,%eax
  jne    L14
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    -0x14(%rbp),%eax
  jmp    L46
L14:
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    $0xffffffff,%eax
L46:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L9
  call   <__stack_chk_fail@plt>
L9:
  leave
  ret
```

tool_calls: name: read_data
arguments: data_label: D7
datatype: string
name: read_data
arguments: data_label: D11
datatype: string
name: read_data
arguments: data_label: D1
datatype: string

tool: D7: r

tool: D11: /proc/omnibook/lcd

tool: D1: %*s%*s%d

assistant: ```c
int compal_get_lcd_brightness(void) {
  FILE *fp = fopen("/proc/omnibook/lcd", "r");
  int brightness;
  if (!fp)
    return -1;
  if (fscanf(fp, "%*s%*s%d", &brightness) == 1) {
    fclose(fp);
    return brightness;
  }
  fclose(fp);
  return -1;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<compal_get_lcd_brightness>:
  endbr64
  push   %rbx
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    D23(%rip),%rsi
  lea    D28(%rip),%rdi
  call   <fopen@plt>
  test   %rax,%rax
  je     L8
  mov    %rax,%rbx
  lea    0x4(%rsp),%rdx
  lea    D20(%rip),%rsi
  mov    %rax,%rdi
  call   <fscanf@plt>
  cmp    $0x1,%eax
  jne    L47
  mov    %rbx,%rdi
  call   <fclose@plt>
  mov    0x4(%rsp),%eax
L36:
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L31
  add    $0x10,%rsp
  pop    %rbx
  ret
L47:
  mov    %rbx,%rdi
  call   <fclose@plt>
  mov    $0xffffffff,%eax
  jmp    L36
L8:
  mov    $0xffffffff,%eax
  jmp    L36
L31:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: label: D23
type_guessed: string
name: unpack_data
arguments: label: D28
type_guessed: string
name: unpack_data
arguments: label: D20
type_guessed: string

tool: D23: r

tool: D28: /proc/omnibook/lcd

tool: D20: %*s%*s%d

assistant: ```c
int compal_get_lcd_brightness(void) {
  FILE *fp = fopen("/proc/omnibook/lcd", "r");
  int brightness;
  if (!fp)
    return -1;
  if (fscanf(fp, "%*s%*s%d", &brightness) == 1) {
    fclose(fp);
    return brightness;
  }
  fclose(fp);
  return -1;
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<compal_get_lcd_brightness>:
  endbr64
  push   %rbp
  lea    D14(%rip),%rsi
  lea    D18(%rip),%rdi
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  call   <fopen@plt>
  test   %rax,%rax
  je     L30
  mov    %rax,%rdi
  lea    0x4(%rsp),%rdx
  lea    D4(%rip),%rsi
  mov    %rax,%rbp
  call   <fscanf@plt>
  mov    %rbp,%rdi
  cmp    $0x1,%eax
  jne    L24
  call   <fclose@plt>
  mov    0x4(%rsp),%eax
L21:
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L6
  add    $0x10,%rsp
  pop    %rbp
  ret
  nop
L24:
  call   <fclose@plt>
  mov    $0xffffffff,%eax
  jmp    L21
L30:
  mov    $0xffffffff,%eax
  jmp    L21
L6:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_tag: D14
type_guessed: string
name: unpack_data
arguments: data_tag: D18
type_guessed: string
name: unpack_data
arguments: data_tag: D4
type_guessed: string

tool: D14: r

tool: D18: /proc/omnibook/lcd

tool: D4: %*s%*s%d

assistant: ```c
int compal_get_lcd_brightness(void) {
  FILE *fp = fopen("/proc/omnibook/lcd", "r");
  int brightness;
  if (!fp)
    return -1;
  if (fscanf(fp, "%*s%*s%d", &brightness) == 1) {
    fclose(fp);
    return brightness;
  }
  fclose(fp);
  return -1;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<compal_get_lcd_brightness>:
  endbr64
  push   %rbp
  lea    D21(%rip),%rsi
  lea    D10(%rip),%rdi
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  call   <fopen@plt>
  test   %rax,%rax
  je     L42
  mov    %rax,%rdi
  lea    0x4(%rsp),%rdx
  lea    D16(%rip),%rsi
  mov    %rax,%rbp
  call   <fscanf@plt>
  mov    %rbp,%rdi
  cmp    $0x1,%eax
  jne    L13
  call   <fclose@plt>
  mov    0x4(%rsp),%eax
L20:
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L3
  add    $0x10,%rsp
  pop    %rbp
  ret
  nop
L13:
  call   <fclose@plt>
  mov    $0xffffffff,%eax
  jmp    L20
L42:
  mov    $0xffffffff,%eax
  jmp    L20
L3:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_label: D21
data_type: string
name: unpack_data
arguments: data_label: D10
data_type: string
name: unpack_data
arguments: data_label: D16
data_type: string

tool: D21: r

tool: D10: /proc/omnibook/lcd

tool: D16: %*s%*s%d

assistant: ```c
int compal_get_lcd_brightness(void) {
  FILE *fp = fopen("/proc/omnibook/lcd", "r");
  int brightness;
  if (!fp)
    return -1;
  if (fscanf(fp, "%*s%*s%d", &brightness) == 1) {
    fclose(fp);
    return brightness;
  }
  fclose(fp);
  return -1;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<InitScoreDirectory>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    $0x0,%eax
  call   <getCommonDataDir@plt>
  mov    %eax,%ecx
  mov    $0x1,%edx
  lea    D21(%rip),%rax
  mov    %rax,%rsi
  mov    %ecx,%edi
  call   <createDirectory@plt>
  mov    $0x0,%edi
  call   <getScoreDir@plt>
  mov    %eax,%ecx
  mov    $0x1,%edx
  lea    D23(%rip),%rax
  mov    %rax,%rsi
  mov    %ecx,%edi
  call   <createDirectory@plt>
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <getScoreDir@plt>
  mov    %eax,%ecx
  mov    $0x1,%edx
  lea    D3(%rip),%rax
  mov    %rax,%rsi
  mov    %ecx,%edi
  call   <createDirectory@plt>
  nop
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: data_label: D21
type: string
name: disassemble_data
arguments: data_label: D23
type: string
name: disassemble_data
arguments: data_label: D3
type: string

tool: D21: common data

tool: D23: main score

tool: D3: level score

assistant: ```c
void InitScoreDirectory(char *level_subdir) {
  createDirectory(getCommonDataDir(), "common data", 1);
  createDirectory(getScoreDir(NULL), "main score", 1);
  createDirectory(getScoreDir(level_subdir), "level score", 1);
}
```
user: What is the c source code of the assembly code below?

```asm
<InitScoreDirectory>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  mov    $0x0,%eax
  call   <getCommonDataDir@plt>
  mov    %eax,%edi
  mov    $0x1,%edx
  lea    D28(%rip),%rsi
  call   <createDirectory@plt>
  mov    $0x0,%edi
  call   <getScoreDir@plt>
  mov    %eax,%edi
  mov    $0x1,%edx
  lea    D19(%rip),%rsi
  call   <createDirectory@plt>
  mov    %rbx,%rdi
  call   <getScoreDir@plt>
  mov    %eax,%edi
  mov    $0x1,%edx
  lea    D11(%rip),%rsi
  call   <createDirectory@plt>
  pop    %rbx
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D28
datatype: string
name: unpack_data
arguments: data_tag: D19
datatype: string
name: unpack_data
arguments: data_tag: D11
datatype: string

tool: D28: common data

tool: D19: main score

tool: D11: level score

assistant: ```c
void InitScoreDirectory(char *level_subdir) {
  createDirectory(getCommonDataDir(), "common data", 1);
  createDirectory(getScoreDir(NULL), "main score", 1);
  createDirectory(getScoreDir(level_subdir), "level score", 1);
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<InitScoreDirectory>:
  endbr64
  push   %rbp
  xor    %eax,%eax
  mov    %rdi,%rbp
  call   <getCommonDataDir@plt>
  mov    $0x1,%edx
  lea    D15(%rip),%rsi
  mov    %eax,%edi
  call   <createDirectory@plt>
  xor    %edi,%edi
  call   <getScoreDir@plt>
  mov    $0x1,%edx
  lea    D7(%rip),%rsi
  mov    %eax,%edi
  call   <createDirectory@plt>
  mov    %rbp,%rdi
  call   <getScoreDir@plt>
  mov    $0x1,%edx
  lea    D13(%rip),%rsi
  pop    %rbp
  mov    %eax,%edi
  jmp    1080 <createDirectory@plt>
```

tool_calls: name: extract_symbolic_data
arguments: label: D15
datatype: string
name: extract_symbolic_data
arguments: label: D7
datatype: string
name: extract_symbolic_data
arguments: label: D13
datatype: string

tool: D15: common data

tool: D7: main score

tool: D13: level score

assistant: ```c
void InitScoreDirectory(char *level_subdir) {
  createDirectory(getCommonDataDir(), "common data", 1);
  createDirectory(getScoreDir(NULL), "main score", 1);
  createDirectory(getScoreDir(level_subdir), "level score", 1);
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<InitScoreDirectory>:
  endbr64
  push   %rbp
  xor    %eax,%eax
  mov    %rdi,%rbp
  call   <getCommonDataDir@plt>
  mov    $0x1,%edx
  lea    D10(%rip),%rsi
  mov    %eax,%edi
  call   <createDirectory@plt>
  xor    %edi,%edi
  call   <getScoreDir@plt>
  mov    $0x1,%edx
  lea    D13(%rip),%rsi
  mov    %eax,%edi
  call   <createDirectory@plt>
  mov    %rbp,%rdi
  call   <getScoreDir@plt>
  mov    $0x1,%edx
  lea    D19(%rip),%rsi
  pop    %rbp
  mov    %eax,%edi
  jmp    1080 <createDirectory@plt>
```

tool_calls: name: disassemble_data
arguments: data_label: D10
type: string
name: disassemble_data
arguments: data_label: D13
type: string
name: disassemble_data
arguments: data_label: D19
type: string

tool: D10: common data

tool: D13: main score

tool: D19: level score

assistant: ```c
void InitScoreDirectory(char *level_subdir) {
  createDirectory(getCommonDataDir(), "common data", 1);
  createDirectory(getScoreDir(NULL), "main score", 1);
  createDirectory(getScoreDir(level_subdir), "level score", 1);
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<imprimeTabuleiro>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbp
  lea    D68(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%ebx
  jmp    L97
L86:
  mov    $0x20,%edi
  call   <putchar@plt>
L124:
  add    $0x1,%ebx
  cmp    $0x14,%ebx
  je     L136
L97:
  test   $0x1,%bl
  jne    L86
  mov    %ebx,%edi
  shr    $0x1f,%edi
  add    %ebx,%edi
  sar    %edi
  add    $0x61,%edi
  call   <putchar@plt>
  jmp    L124
L136:
  lea    D6(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x13,%ebx
L82:
  mov    $0x2d,%edi
  call   <putchar@plt>
  sub    $0x1,%ebx
  jne    L82
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    $0x0,%r13d
  lea    D7(%rip),%r12
  lea    D22(%rip),%r15
  jmp    L117
L126:
  mov    %r14,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L51
L94:
  mov    %r15,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L51:
  add    $0x4,%rbx
  cmp    $0x28,%rbx
  je     L95
L10:
  mov    0x0(%rbp),%rax
  mov    (%rax,%rbx,1),%eax
  cmp    $0x1,%eax
  je     L126
  cmp    $0xffffffff,%eax
  je     L94
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L51
L95:
  lea    D66(%rip),%rdi
  call   <puts@plt>
  add    $0x8,%rbp
  cmp    $0xa,%r13d
  je     L62
L117:
  add    $0x1,%r13d
  mov    %r13d,%esi
  lea    D74(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%ebx
  lea    D2(%rip),%r14
  jmp    L10
L62:
  lea    D68(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x13,%ebx
L119:
  mov    $0x2d,%edi
  call   <putchar@plt>
  sub    $0x1,%ebx
  jne    L119
  mov    $0xa,%edi
  call   <putchar@plt>
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: unpack_data
arguments: label: D68
type: string
name: unpack_data
arguments: label: D6
type: string
name: unpack_data
arguments: label: D7
type: string
name: unpack_data
arguments: label: D22
type: string
name: unpack_data
arguments: label: D66
type: string
name: unpack_data
arguments: label: D74
type: string
name: unpack_data
arguments: label: D2
type: string

tool: D68:    

tool: D6: 
   

tool: D7:   

tool: D22: o 

tool: D66: |

tool: D74: %2d|

tool: D2: x 

assistant: ```c
void imprimeTabuleiro(int **tabuleiro) {
  printf("   ");
  for (int i = 0; i < (2 * 10); i++) {
    if (!(i % 2))
      printf("%c", ((i / 2) + 97));
    else
      printf(" ");
  }
  printf("\n   ");
  for (int i = 0; i < ((2 * 10) - 1); i++)
    printf("-");
  printf("\n");
  for (int i = 0; i < 10; i++) {
    printf("%2d|", (i + 1));
    for (int j = 0; j < 10; j++) {
      if (tabuleiro[i][j] == 1)
        printf("x ");
      else if (tabuleiro[i][j] == -1)
        printf("o ");
      else
        printf("  ");
    }
    printf("\b|\n");
  }
  printf("   ");
  for (int i = 0; i < ((2 * 10) - 1); i++)
    printf("-");
  printf("\n");
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<fraccompare>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r12
  push   %rbx
  mov    %rdi,%rdx
  mov    %rsi,%rax
  movzbl (%rdx),%ecx
  movsbl %cl,%ebx
  movzbl (%rax),%ecx
  movsbl %cl,%r12d
  cmp    $0x2e,%ebx
  jne    L174
  cmp    $0x2e,%r12d
  jne    L174
L142:
  add    $0x1,%rdx
  movzbl (%rdx),%ecx
  movsbl %cl,%ebx
  add    $0x1,%rax
  movzbl (%rax),%ecx
  movsbl %cl,%r12d
  cmp    %r12d,%ebx
  jne    L0
  mov    %ebx,%ecx
  sub    $0x30,%ecx
  cmp    $0x9,%ecx
  jbe    L142
L0:
  mov    %ebx,%ecx
  sub    $0x30,%ecx
  cmp    $0x9,%ecx
  ja     L94
  mov    %r12d,%ecx
  sub    $0x30,%ecx
  cmp    $0x9,%ecx
  ja     L94
  mov    %ebx,%eax
  sub    %r12d,%eax
  jmp    L163
L94:
  mov    %ebx,%ecx
  sub    $0x30,%ecx
  cmp    $0x9,%ecx
  ja     L136
  jmp    L212
L210:
  add    $0x1,%rdx
  movzbl (%rdx),%eax
  movsbl %al,%ebx
L212:
  cmp    $0x30,%ebx
  je     L210
  mov    %ebx,%eax
  sub    $0x30,%eax
  cmp    $0x9,%eax
  ja     L146
  mov    $0x1,%eax
  jmp    L163
L146:
  mov    $0x0,%eax
  jmp    L163
L136:
  mov    %r12d,%edx
  sub    $0x30,%edx
  cmp    $0x9,%edx
  ja     L97
  jmp    L43
L239:
  add    $0x1,%rax
  movzbl (%rax),%edx
  movsbl %dl,%r12d
L43:
  cmp    $0x30,%r12d
  je     L239
  mov    %r12d,%eax
  sub    $0x30,%eax
  cmp    $0x9,%eax
  ja     L70
  mov    $0xffffffff,%eax
  jmp    L163
L70:
  mov    $0x0,%eax
  jmp    L163
L97:
  mov    $0x0,%eax
  jmp    L163
L174:
  cmp    $0x2e,%ebx
  jne    L224
L99:
  add    $0x1,%rdx
  movzbl (%rdx),%eax
  movsbl %al,%ebx
  cmp    $0x30,%ebx
  je     L99
  mov    %ebx,%eax
  sub    $0x30,%eax
  cmp    $0x9,%eax
  ja     L288
  mov    $0x1,%eax
  jmp    L163
L288:
  mov    $0x0,%eax
  jmp    L163
L224:
  cmp    $0x2e,%r12d
  jne    L2
L172:
  add    $0x1,%rax
  movzbl (%rax),%edx
  movsbl %dl,%r12d
  cmp    $0x30,%r12d
  je     L172
  mov    %r12d,%eax
  sub    $0x30,%eax
  cmp    $0x9,%eax
  ja     L249
  mov    $0xffffffff,%eax
  jmp    L163
L249:
  mov    $0x0,%eax
  jmp    L163
L2:
  mov    $0x0,%eax
L163:
  pop    %rbx
  pop    %r12
  pop    %rbp
  ret
```

assistant: ```c
int fraccompare(register const char *a, register const char *b) {
  register int tmpa = *a;
  register int tmpb = *b;
  if (tmpa == '.' && tmpb == '.') {
    do
      tmpa = *++a, tmpb = *++b;
    while (tmpa == tmpb && ((unsigned)(tmpa) - '0' <= 9));
    if (((unsigned)(tmpa) - '0' <= 9) && ((unsigned)(tmpb) - '0' <= 9))
      return tmpa - tmpb;
    if (((unsigned)(tmpa) - '0' <= 9)) {
      while (tmpa == '0')
        tmpa = *++a;
      if (((unsigned)(tmpa) - '0' <= 9))
        return 1;
      return 0;
    }
    if (((unsigned)(tmpb) - '0' <= 9)) {
      while (tmpb == '0')
        tmpb = *++b;
      if (((unsigned)(tmpb) - '0' <= 9))
        return -1;
      return 0;
    }
    return 0;
  } else if (tmpa == '.') {
    do
      tmpa = *++a;
    while (tmpa == '0');
    if (((unsigned)(tmpa) - '0' <= 9))
      return 1;
    return 0;
  } else if (tmpb == '.') {
    do
      tmpb = *++b;
    while (tmpb == '0');
    if (((unsigned)(tmpb) - '0' <= 9))
      return -1;
    return 0;
  }
  return 0;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<fraccompare>:
  endbr64
  mov    %rdi,%rcx
  movzbl (%rdi),%eax
  movzbl (%rsi),%edx
  cmp    $0x2e,%al
  jne    L74
  cmp    $0x2e,%dl
  jne    L74
L8:
  add    $0x1,%rcx
  movzbl (%rcx),%edx
  movsbl %dl,%eax
  add    $0x1,%rsi
  movzbl (%rsi),%r8d
  movsbl %r8b,%edi
  cmp    %edi,%eax
  jne    L96
  mov    %eax,%edx
  sub    $0x30,%edx
  cmp    $0x9,%edx
  jbe    L8
  jmp    L147
L96:
  movsbl %dl,%edx
  sub    $0x30,%edx
  cmp    $0x9,%edx
  jbe    L20
L147:
  movsbl %r8b,%r8d
  sub    $0x30,%r8d
  mov    $0x0,%eax
  cmp    $0x9,%r8d
  ja     L115
  cmp    $0x30,%edi
  jne    L116
L48:
  add    $0x1,%rsi
  movsbl (%rsi),%edi
  cmp    $0x30,%edi
  je     L48
L116:
  sub    $0x30,%edi
  cmp    $0xa,%edi
  sbb    %eax,%eax
  ret
L20:
  movsbl %r8b,%r8d
  sub    $0x30,%r8d
  cmp    $0x9,%r8d
  jbe    L46
  cmp    $0x30,%eax
  jne    L19
L95:
  add    $0x1,%rcx
  movsbl (%rcx),%eax
  cmp    $0x30,%eax
  je     L95
L19:
  sub    $0x30,%eax
  cmp    $0x9,%eax
  setbe  %al
  movzbl %al,%eax
  ret
L46:
  sub    %edi,%eax
  ret
L74:
  cmp    $0x2e,%al
  je     L59
  mov    $0x0,%eax
  cmp    $0x2e,%dl
  je     L121
L115:
  ret
L59:
  add    $0x1,%rcx
  movzbl (%rcx),%eax
  cmp    $0x30,%al
  je     L59
  movsbl %al,%eax
  sub    $0x30,%eax
  cmp    $0x9,%eax
  setbe  %al
  movzbl %al,%eax
  ret
L121:
  add    $0x1,%rsi
  movzbl (%rsi),%eax
  cmp    $0x30,%al
  je     L121
  movsbl %al,%eax
  sub    $0x30,%eax
  cmp    $0xa,%eax
  sbb    %eax,%eax
  jmp    L115
```

assistant: ```c
int fraccompare(register const char *a, register const char *b) {
  register int tmpa = *a;
  register int tmpb = *b;
  if (tmpa == '.' && tmpb == '.') {
    do
      tmpa = *++a, tmpb = *++b;
    while (tmpa == tmpb && ((unsigned)(tmpa) - '0' <= 9));
    if (((unsigned)(tmpa) - '0' <= 9) && ((unsigned)(tmpb) - '0' <= 9))
      return tmpa - tmpb;
    if (((unsigned)(tmpa) - '0' <= 9)) {
      while (tmpa == '0')
        tmpa = *++a;
      if (((unsigned)(tmpa) - '0' <= 9))
        return 1;
      return 0;
    }
    if (((unsigned)(tmpb) - '0' <= 9)) {
      while (tmpb == '0')
        tmpb = *++b;
      if (((unsigned)(tmpb) - '0' <= 9))
        return -1;
      return 0;
    }
    return 0;
  } else if (tmpa == '.') {
    do
      tmpa = *++a;
    while (tmpa == '0');
    if (((unsigned)(tmpa) - '0' <= 9))
      return 1;
    return 0;
  } else if (tmpb == '.') {
    do
      tmpb = *++b;
    while (tmpb == '0');
    if (((unsigned)(tmpb) - '0' <= 9))
      return -1;
    return 0;
  }
  return 0;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<fraccompare>:
  endbr64
  movzbl (%rdi),%eax
  movzbl (%rsi),%edx
  cmp    $0x2e,%al
  jne    L111
  cmp    $0x2e,%dl
  je     L141
  jmp    L77
  nopl   (%rax)
L80:
  cmp    $0x9,%edx
  ja     L59
L141:
  movsbl 0x1(%rdi),%eax
  movsbl 0x1(%rsi),%ecx
  add    $0x1,%rdi
  add    $0x1,%rsi
  lea    -0x30(%rax),%edx
  cmp    %ecx,%eax
  je     L80
  lea    -0x30(%rcx),%r9d
  cmp    $0x9,%edx
  ja     L59
  mov    %eax,%r8d
  sub    %ecx,%r8d
  cmp    $0x9,%r9d
  jbe    L30
  cmp    $0x30,%eax
  jne    L116
  cs nopw 0x0(%rax,%rax,1)
L149:
  movsbl 0x1(%rdi),%edx
  add    $0x1,%rdi
  cmp    $0x30,%edx
  je     L149
  sub    $0x30,%edx
L116:
  xor    %r8d,%r8d
  cmp    $0x9,%edx
  setbe  %r8b
L30:
  mov    %r8d,%eax
  ret
  xchg   %ax,%ax
L77:
  cmp    $0x2e,%al
  je     L63
L111:
  xor    %r8d,%r8d
  cmp    $0x2e,%dl
  jne    L30
  nopl   0x0(%rax)
L137:
  movsbl 0x1(%rsi),%eax
  add    $0x1,%rsi
  cmp    $0x30,%al
  je     L137
L105:
  sub    $0x30,%eax
L161:
  cmp    $0xa,%eax
  sbb    %r8d,%r8d
  mov    %r8d,%eax
  ret
  nopl   0x0(%rax)
L63:
  movsbl 0x1(%rdi),%eax
  add    $0x1,%rdi
  cmp    $0x30,%al
  je     L63
  sub    $0x30,%eax
  xor    %r8d,%r8d
  cmp    $0x9,%eax
  setbe  %r8b
  mov    %r8d,%eax
  ret
  nopl   (%rax)
L59:
  lea    -0x30(%rcx),%eax
  xor    %r8d,%r8d
  cmp    $0x9,%eax
  ja     L30
  cmp    $0x30,%ecx
  jne    L161
L130:
  movsbl 0x1(%rsi),%eax
  add    $0x1,%rsi
  cmp    $0x30,%eax
  je     L130
  jmp    L105
```

assistant: ```c
int fraccompare(register const char *a, register const char *b) {
  register int tmpa = *a;
  register int tmpb = *b;
  if (tmpa == '.' && tmpb == '.') {
    do
      tmpa = *++a, tmpb = *++b;
    while (tmpa == tmpb && ((unsigned)(tmpa) - '0' <= 9));
    if (((unsigned)(tmpa) - '0' <= 9) && ((unsigned)(tmpb) - '0' <= 9))
      return tmpa - tmpb;
    if (((unsigned)(tmpa) - '0' <= 9)) {
      while (tmpa == '0')
        tmpa = *++a;
      if (((unsigned)(tmpa) - '0' <= 9))
        return 1;
      return 0;
    }
    if (((unsigned)(tmpb) - '0' <= 9)) {
      while (tmpb == '0')
        tmpb = *++b;
      if (((unsigned)(tmpb) - '0' <= 9))
        return -1;
      return 0;
    }
    return 0;
  } else if (tmpa == '.') {
    do
      tmpa = *++a;
    while (tmpa == '0');
    if (((unsigned)(tmpa) - '0' <= 9))
      return 1;
    return 0;
  } else if (tmpb == '.') {
    do
      tmpb = *++b;
    while (tmpb == '0');
    if (((unsigned)(tmpb) - '0' <= 9))
      return -1;
    return 0;
  }
  return 0;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<fraccompare>:
  endbr64
  movzbl (%rdi),%eax
  movzbl (%rsi),%edx
  cmp    $0x2e,%al
  jne    L157
  cmp    $0x2e,%dl
  je     L65
  jmp    L48
  nopl   (%rax)
L9:
  cmp    $0x9,%edx
  ja     L8
L65:
  movsbl 0x1(%rdi),%eax
  movsbl 0x1(%rsi),%ecx
  add    $0x1,%rdi
  add    $0x1,%rsi
  lea    -0x30(%rax),%edx
  cmp    %ecx,%eax
  je     L9
  lea    -0x30(%rcx),%r9d
  cmp    $0x9,%edx
  ja     L8
  mov    %eax,%r8d
  sub    %ecx,%r8d
  cmp    $0x9,%r9d
  jbe    L1
  cmp    $0x30,%eax
  jne    L145
  cs nopw 0x0(%rax,%rax,1)
L124:
  movsbl 0x1(%rdi),%edx
  add    $0x1,%rdi
  cmp    $0x30,%edx
  je     L124
  sub    $0x30,%edx
L145:
  xor    %r8d,%r8d
  cmp    $0x9,%edx
  setbe  %r8b
L1:
  mov    %r8d,%eax
  ret
  xchg   %ax,%ax
L48:
  cmp    $0x2e,%al
  je     L41
L157:
  xor    %r8d,%r8d
  cmp    $0x2e,%dl
  jne    L1
  nopl   0x0(%rax)
L94:
  movsbl 0x1(%rsi),%eax
  add    $0x1,%rsi
  cmp    $0x30,%al
  je     L94
L152:
  sub    $0x30,%eax
L138:
  cmp    $0xa,%eax
  sbb    %r8d,%r8d
  mov    %r8d,%eax
  ret
  nopl   0x0(%rax)
L41:
  movsbl 0x1(%rdi),%eax
  add    $0x1,%rdi
  cmp    $0x30,%al
  je     L41
  sub    $0x30,%eax
  xor    %r8d,%r8d
  cmp    $0x9,%eax
  setbe  %r8b
  mov    %r8d,%eax
  ret
  nopl   (%rax)
L8:
  lea    -0x30(%rcx),%eax
  xor    %r8d,%r8d
  cmp    $0x9,%eax
  ja     L1
  cmp    $0x30,%ecx
  jne    L138
L50:
  movsbl 0x1(%rsi),%eax
  add    $0x1,%rsi
  cmp    $0x30,%eax
  je     L50
  jmp    L152
```

assistant: ```c
int fraccompare(register const char *a, register const char *b) {
  register int tmpa = *a;
  register int tmpb = *b;
  if (tmpa == '.' && tmpb == '.') {
    do
      tmpa = *++a, tmpb = *++b;
    while (tmpa == tmpb && ((unsigned)(tmpa) - '0' <= 9));
    if (((unsigned)(tmpa) - '0' <= 9) && ((unsigned)(tmpb) - '0' <= 9))
      return tmpa - tmpb;
    if (((unsigned)(tmpa) - '0' <= 9)) {
      while (tmpa == '0')
        tmpa = *++a;
      if (((unsigned)(tmpa) - '0' <= 9))
        return 1;
      return 0;
    }
    if (((unsigned)(tmpb) - '0' <= 9)) {
      while (tmpb == '0')
        tmpb = *++b;
      if (((unsigned)(tmpb) - '0' <= 9))
        return -1;
      return 0;
    }
    return 0;
  } else if (tmpa == '.') {
    do
      tmpa = *++a;
    while (tmpa == '0');
    if (((unsigned)(tmpa) - '0' <= 9))
      return 1;
    return 0;
  } else if (tmpb == '.') {
    do
      tmpb = *++b;
    while (tmpb == '0');
    if (((unsigned)(tmpb) - '0' <= 9))
      return -1;
    return 0;
  }
  return 0;
}
```