ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<isUppercaseLetter>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,%eax
  mov    %al,-0x4(%rbp)
  cmpb   $0x40,-0x4(%rbp)
  jle    L25
  cmpb   $0x5a,-0x4(%rbp)
  jg     L25
  mov    $0x1,%eax
  jmp    L24
L25:
  mov    $0x0,%eax
L24:
  pop    %rbp
  ret
```

assistant: ```c
int isUppercaseLetter(char c) {
  if ('A' <= c && c <= 'Z') {
    return 1;
  } else {
    return 0;
  }
}
```
user: What is the c source code of the assembly code below?

```asm
<isUppercaseLetter>:
  endbr64
  sub    $0x41,%edi
  cmp    $0x19,%dil
  setbe  %al
  movzbl %al,%eax
  ret
```

assistant: ```c
int isUppercaseLetter(char c) {
  if ('A' <= c && c <= 'Z') {
    return 1;
  } else {
    return 0;
  }
}
```
user: Translate the below assembly code into C programming language:

```asm
<isUppercaseLetter>:
  endbr64
  sub    $0x41,%edi
  xor    %eax,%eax
  cmp    $0x19,%dil
  setbe  %al
  ret
```

assistant: ```c
int isUppercaseLetter(char c) {
  if ('A' <= c && c <= 'Z') {
    return 1;
  } else {
    return 0;
  }
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<isUppercaseLetter>:
  endbr64
  sub    $0x41,%edi
  xor    %eax,%eax
  cmp    $0x19,%dil
  setbe  %al
  ret
```

assistant: ```c
int isUppercaseLetter(char c) {
  if ('A' <= c && c <= 'Z') {
    return 1;
  } else {
    return 0;
  }
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<_check_times>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %esi,-0x18(%rbp)
  mov    -0x14(%rbp),%edx
  mov    -0x18(%rbp),%eax
  imul   %rdx,%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %eax,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  cmp    %rax,-0x8(%rbp)
  ja     L3
  cmpl   $0x10000000,-0xc(%rbp)
  jbe    L16
L3:
  mov    $0x11c,%esi
  lea    D6(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <_throw_badalloc_fn@plt>
L16:
  mov    -0xc(%rbp),%eax
  leave
  ret
```

tool_calls: name: unpack_data
arguments: label: D6
type: string

tool: D6: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/formatstr.c

assistant: ```c
unsigned int _check_times(unsigned x, unsigned y) {
  unsigned long long whole_ans = ((unsigned long long)x) * ((unsigned long long)y);
  unsigned word_ans = (unsigned)whole_ans;
  if (word_ans < whole_ans || word_ans > (1 << 28))
    (_throw_badalloc_fn("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/formatstr.c", 284));
  return word_ans;
}
```
user: Translate the below assembly code into C programming language:

```asm
<_check_times>:
  endbr64
  push   %rbx
  mov    %edi,%edi
  mov    %esi,%esi
  imul   %rsi,%rdi
  mov    %edi,%ebx
  mov    %edi,%eax
  cmp    %rax,%rdi
  ja     L19
  cmp    $0x10000000,%edi
  jbe    L6
L19:
  mov    $0x11c,%esi
  lea    D2(%rip),%rdi
  mov    $0x0,%eax
  call   <_throw_badalloc_fn@plt>
L6:
  mov    %ebx,%eax
  pop    %rbx
  ret
```

tool_calls: name: read_data
arguments: data_tag: D2
type: string

tool: D2: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/formatstr.c

assistant: ```c
unsigned int _check_times(unsigned x, unsigned y) {
  unsigned long long whole_ans = ((unsigned long long)x) * ((unsigned long long)y);
  unsigned word_ans = (unsigned)whole_ans;
  if (word_ans < whole_ans || word_ans > (1 << 28))
    (_throw_badalloc_fn("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/formatstr.c", 284));
  return word_ans;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<_check_times>:
  endbr64
  mov    %edi,%edi
  mov    %esi,%esi
  push   %r12
  imul   %rsi,%rdi
  mov    %edi,%eax
  mov    %edi,%r12d
  cmp    %rax,%rdi
  ja     L2
  cmp    $0x10000000,%edi
  ja     L2
  mov    %r12d,%eax
  pop    %r12
  ret
  cs nopw 0x0(%rax,%rax,1)
L2:
  mov    $0x11c,%esi
  lea    D9(%rip),%rdi
  xor    %eax,%eax
  call   <_throw_badalloc_fn@plt>
  mov    %r12d,%eax
  pop    %r12
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D9
type_infered: string

tool: D9: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/formatstr.c

assistant: ```c
unsigned int _check_times(unsigned x, unsigned y) {
  unsigned long long whole_ans = ((unsigned long long)x) * ((unsigned long long)y);
  unsigned word_ans = (unsigned)whole_ans;
  if (word_ans < whole_ans || word_ans > (1 << 28))
    (_throw_badalloc_fn("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/formatstr.c", 284));
  return word_ans;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<_check_times>:
  endbr64
  mov    %edi,%edi
  mov    %esi,%esi
  push   %r12
  imul   %rsi,%rdi
  mov    %edi,%eax
  mov    %edi,%r12d
  cmp    %rax,%rdi
  ja     L7
  cmp    $0x10000000,%edi
  ja     L7
  mov    %r12d,%eax
  pop    %r12
  ret
  cs nopw 0x0(%rax,%rax,1)
L7:
  mov    $0x11c,%esi
  lea    D2(%rip),%rdi
  xor    %eax,%eax
  call   <_throw_badalloc_fn@plt>
  mov    %r12d,%eax
  pop    %r12
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D2
data_type: string

tool: D2: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/formatstr.c

assistant: ```c
unsigned int _check_times(unsigned x, unsigned y) {
  unsigned long long whole_ans = ((unsigned long long)x) * ((unsigned long long)y);
  unsigned word_ans = (unsigned)whole_ans;
  if (word_ans < whole_ans || word_ans > (1 << 28))
    (_throw_badalloc_fn("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/formatstr.c", 284));
  return word_ans;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<errata_20>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    $0xff0130,%eax
  mov    (%rax),%eax
  cmp    $0x9,%eax
  jne    L11
  mov    $0xff0134,%eax
  mov    (%rax),%eax
  cmp    $0x2,%eax
  jne    L11
  mov    $0x1,%eax
  jmp    L17
L11:
  mov    $0x0,%eax
L17:
  pop    %rbp
  ret
```

assistant: ```c
bool errata_20() {
  if (*(uint32_t *)0x00FF0130 == 0x9ul) {
    if (*(uint32_t *)0x00FF0134 == 0x02ul) {
      return true;
    }
  }
  return false;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<errata_20>:
  endbr64
  mov    $0x0,%eax
  cmpl   $0x9,0xff0130
  je     L15
L4:
  ret
L15:
  cmpl   $0x2,0xff0134
  sete   %al
  movzbl %al,%eax
  jmp    L4
```

assistant: ```c
bool errata_20() {
  if (*(uint32_t *)0x00FF0130 == 0x9ul) {
    if (*(uint32_t *)0x00FF0134 == 0x02ul) {
      return true;
    }
  }
  return false;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<errata_20>:
  endbr64
  xor    %eax,%eax
  cmpl   $0x9,0xff0130
  je     L9
  ret
  nopl   0x0(%rax)
L9:
  xor    %eax,%eax
  cmpl   $0x2,0xff0134
  sete   %al
  ret
```

assistant: ```c
bool errata_20() {
  if (*(uint32_t *)0x00FF0130 == 0x9ul) {
    if (*(uint32_t *)0x00FF0134 == 0x02ul) {
      return true;
    }
  }
  return false;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<errata_20>:
  endbr64
  xor    %eax,%eax
  cmpl   $0x9,0xff0130
  je     L0
  ret
  nopl   0x0(%rax)
L0:
  xor    %eax,%eax
  cmpl   $0x2,0xff0134
  sete   %al
  ret
```

assistant: ```c
bool errata_20() {
  if (*(uint32_t *)0x00FF0130 == 0x9ul) {
    if (*(uint32_t *)0x00FF0134 == 0x02ul) {
      return true;
    }
  }
  return false;
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<randto>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x14(%rbp)
  mov    D8(%rip),%rax
  mov    (%rax),%eax
  cltd
  idivl  -0x14(%rbp)
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  imul   %edx,%eax
  mov    %eax,-0x8(%rbp)
L6:
  mov    $0x0,%eax
  call   <rand@plt>
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  cmp    -0x8(%rbp),%eax
  jge    L6
  mov    -0x4(%rbp),%eax
  cltd
  idivl  -0x14(%rbp)
  mov    %edx,%eax
  leave
  ret
```

assistant: ```c
int randto(int n) {
  int r;
  int maxrand = (RAND_MAX / n) * n;
  do
    r = rand();
  while (r >= maxrand);
  return r % n;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<randto>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %edi,%ebp
  mov    D0(%rip),%rax
  mov    (%rax),%eax
  cltd
  idiv   %edi
  imul   %edi,%eax
  mov    %eax,%ebx
L8:
  mov    $0x0,%eax
  call   <rand@plt>
  cmp    %eax,%ebx
  jle    L8
  cltd
  idiv   %ebp
  mov    %edx,%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
int randto(int n) {
  int r;
  int maxrand = (RAND_MAX / n) * n;
  do
    r = rand();
  while (r >= maxrand);
  return r % n;
}
```
user: Translate the below assembly code into C programming language:

```asm
<randto>:
  endbr64
  push   %rbp
  mov    %edi,%ebp
  push   %rbx
  sub    $0x8,%rsp
  mov    D4(%rip),%rax
  mov    (%rax),%eax
  cltd
  idiv   %edi
  imul   %edi,%eax
  mov    %eax,%ebx
  nopl   (%rax)
L8:
  xor    %eax,%eax
  call   <rand@plt>
  cmp    %eax,%ebx
  jle    L8
  cltd
  add    $0x8,%rsp
  idiv   %ebp
  pop    %rbx
  pop    %rbp
  mov    %edx,%eax
  ret
```

assistant: ```c
int randto(int n) {
  int r;
  int maxrand = (RAND_MAX / n) * n;
  do
    r = rand();
  while (r >= maxrand);
  return r % n;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<randto>:
  endbr64
  push   %rbp
  mov    %edi,%ebp
  push   %rbx
  sub    $0x8,%rsp
  mov    D4(%rip),%rax
  mov    (%rax),%eax
  cltd
  idiv   %edi
  imul   %edi,%eax
  mov    %eax,%ebx
  nopl   (%rax)
L1:
  xor    %eax,%eax
  call   <rand@plt>
  cmp    %eax,%ebx
  jle    L1
  cltd
  add    $0x8,%rsp
  idiv   %ebp
  pop    %rbx
  pop    %rbp
  mov    %edx,%eax
  ret
```

assistant: ```c
int randto(int n) {
  int r;
  int maxrand = (RAND_MAX / n) * n;
  do
    r = rand();
  while (r >= maxrand);
  return r % n;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<IsIdentifier>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x4(%rbp)
  movl   $0x0,-0xc(%rbp)
  cmpl   $0x1,-0x4(%rbp)
  jg     L131
  movl   $0x1,-0xc(%rbp)
L131:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x60,%al
  jle    L18
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x7a,%al
  jle    L31
L18:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x40,%al
  jle    L114
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x5a,%al
  jle    L31
L114:
  movl   $0x1,-0xc(%rbp)
L31:
  movl   $0x1,-0x8(%rbp)
  jmp    L79
L47:
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x60,%al
  jle    L93
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x7a,%al
  jle    L120
L93:
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x40,%al
  jle    L51
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x5a,%al
  jle    L120
L51:
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jle    L98
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x39,%al
  jle    L120
L98:
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x5f,%al
  je     L120
  movl   $0x1,-0xc(%rbp)
L120:
  addl   $0x1,-0x8(%rbp)
L79:
  mov    -0x8(%rbp),%eax
  cmp    -0x4(%rbp),%eax
  jl     L47
  cmpl   $0x0,-0xc(%rbp)
  sete   %al
  movzbl %al,%eax
  leave
  ret
```

assistant: ```c
IsIdentifier(str) char *str;
{
  int slen = strlen(str);
  int not_ident = 0;
  int i;
  if (slen < 2)
    not_ident = 1;
  if (!(str[0] >= 'a' && str[0] <= 'z') && !(str[0] >= 'A' && str[0] <= 'Z'))
    not_ident = 1;
  for (i = 1; i < slen; i++) {
    if (!(str[i] >= 'a' && str[i] <= 'z') && !(str[i] >= 'A' && str[i] <= 'Z') && !(str[i] >= '0' && str[i] <= '9') && !(str[i] == '_'))
      not_ident = 1;
  }
  return (!not_ident);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<IsIdentifier>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  call   <strlen@plt>
  movzbl (%rbx),%edx
  and    $0xffffffdf,%edx
  sub    $0x41,%edx
  mov    $0x1,%edi
  cmp    $0x19,%dl
  ja     L67
  cmp    $0x1,%eax
  setle  %dil
  movzbl %dil,%edi
L67:
  cmp    $0x1,%eax
  jle    L68
  lea    0x1(%rbx),%rdx
  lea    -0x2(%rax),%eax
  lea    0x2(%rbx,%rax,1),%rsi
  mov    $0x1,%r8d
  jmp    L28
L51:
  add    $0x1,%rdx
  cmp    %rsi,%rdx
  je     L68
L28:
  movzbl (%rdx),%ecx
  mov    %ecx,%eax
  and    $0xffffffdf,%eax
  sub    $0x41,%eax
  cmp    $0x19,%al
  jbe    L51
  lea    -0x30(%rcx),%eax
  cmp    $0x9,%al
  jbe    L51
  cmp    $0x5f,%cl
  cmovne %r8d,%edi
  jmp    L51
L68:
  test   %edi,%edi
  sete   %al
  movzbl %al,%eax
  pop    %rbx
  ret
```

assistant: ```c
IsIdentifier(str) char *str;
{
  int slen = strlen(str);
  int not_ident = 0;
  int i;
  if (slen < 2)
    not_ident = 1;
  if (!(str[0] >= 'a' && str[0] <= 'z') && !(str[0] >= 'A' && str[0] <= 'Z'))
    not_ident = 1;
  for (i = 1; i < slen; i++) {
    if (!(str[i] >= 'a' && str[i] <= 'z') && !(str[i] >= 'A' && str[i] <= 'Z') && !(str[i] >= '0' && str[i] <= '9') && !(str[i] == '_'))
      not_ident = 1;
  }
  return (!not_ident);
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<IsIdentifier>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  call   <strlen@plt>
  movzbl (%rbx),%edx
  mov    $0x1,%r8d
  and    $0xffffffdf,%edx
  sub    $0x41,%edx
  cmp    $0x19,%dl
  ja     L13
  xor    %r8d,%r8d
  cmp    $0x1,%eax
  setle  %r8b
L13:
  cmp    $0x1,%eax
  jle    L26
  sub    $0x2,%eax
  lea    0x1(%rbx),%rdx
  mov    $0x1,%edi
  lea    0x2(%rbx,%rax,1),%rax
  nopl   0x0(%rax)
L4:
  movzbl (%rdx),%esi
  mov    %esi,%ecx
  and    $0xffffffdf,%ecx
  sub    $0x41,%ecx
  cmp    $0x19,%cl
  jbe    L47
  lea    -0x30(%rsi),%ecx
  cmp    $0x9,%cl
  jbe    L47
  cmp    $0x5f,%sil
  cmovne %edi,%r8d
L47:
  add    $0x1,%rdx
  cmp    %rdx,%rax
  jne    L4
L26:
  mov    %r8d,%eax
  pop    %rbx
  xor    $0x1,%eax
  ret
```

assistant: ```c
IsIdentifier(str) char *str;
{
  int slen = strlen(str);
  int not_ident = 0;
  int i;
  if (slen < 2)
    not_ident = 1;
  if (!(str[0] >= 'a' && str[0] <= 'z') && !(str[0] >= 'A' && str[0] <= 'Z'))
    not_ident = 1;
  for (i = 1; i < slen; i++) {
    if (!(str[i] >= 'a' && str[i] <= 'z') && !(str[i] >= 'A' && str[i] <= 'Z') && !(str[i] >= '0' && str[i] <= '9') && !(str[i] == '_'))
      not_ident = 1;
  }
  return (!not_ident);
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<IsIdentifier>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  call   <strlen@plt>
  movzbl (%rbx),%edx
  mov    $0x1,%r8d
  and    $0xffffffdf,%edx
  sub    $0x41,%edx
  cmp    $0x19,%dl
  ja     L4
  xor    %r8d,%r8d
  cmp    $0x1,%eax
  setle  %r8b
L4:
  cmp    $0x1,%eax
  jle    L32
  sub    $0x2,%eax
  lea    0x1(%rbx),%rdx
  mov    $0x1,%edi
  lea    0x2(%rbx,%rax,1),%rax
  nopl   0x0(%rax)
L29:
  movzbl (%rdx),%esi
  mov    %esi,%ecx
  and    $0xffffffdf,%ecx
  sub    $0x41,%ecx
  cmp    $0x19,%cl
  jbe    L48
  lea    -0x30(%rsi),%ecx
  cmp    $0x9,%cl
  jbe    L48
  cmp    $0x5f,%sil
  cmovne %edi,%r8d
L48:
  add    $0x1,%rdx
  cmp    %rdx,%rax
  jne    L29
L32:
  mov    %r8d,%eax
  pop    %rbx
  xor    $0x1,%eax
  ret
```

assistant: ```c
IsIdentifier(str) char *str;
{
  int slen = strlen(str);
  int not_ident = 0;
  int i;
  if (slen < 2)
    not_ident = 1;
  if (!(str[0] >= 'a' && str[0] <= 'z') && !(str[0] >= 'A' && str[0] <= 'Z'))
    not_ident = 1;
  for (i = 1; i < slen; i++) {
    if (!(str[i] >= 'a' && str[i] <= 'z') && !(str[i] >= 'A' && str[i] <= 'Z') && !(str[i] >= '0' && str[i] <= '9') && !(str[i] == '_'))
      not_ident = 1;
  }
  return (!not_ident);
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<gfx_i2c_read>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %ecx,%eax
  mov    %r8,-0x38(%rbp)
  mov    %edi,%ecx
  mov    %cl,-0x24(%rbp)
  mov    %esi,%ecx
  mov    %cl,-0x28(%rbp)
  mov    %dl,-0x2c(%rbp)
  mov    %al,-0x30(%rbp)
  movl   $0x0,-0x14(%rbp)
  cmpq   $0x0,-0x38(%rbp)
  jne    L23
  mov    $0x1,%eax
  jmp    L12
L10:
  mov    $0x0,%eax
  call   <SendI2CStart@plt>
  movzbl -0x28(%rbp),%eax
  add    %eax,%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <SendI2CData@plt>
  mov    $0x0,%eax
  call   <ReceiveI2CAck@plt>
  test   %eax,%eax
  jne    L85
  mov    $0x0,%eax
  call   <SendI2CStop@plt>
  mov    $0xa,%edi
  call   <gfx_delay_milliseconds@plt>
  jmp    L23
L85:
  movzbl -0x2c(%rbp),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <SendI2CData@plt>
  mov    $0x0,%eax
  call   <SendI2CNack@plt>
  mov    $0x0,%eax
  call   <SendI2CStart@plt>
  movzbl -0x28(%rbp),%eax
  add    %eax,%eax
  or     $0x1,%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <SendI2CData@plt>
  mov    $0x0,%eax
  call   <ReceiveI2CAck@plt>
  test   %eax,%eax
  jne    L41
  mov    $0x0,%eax
  call   <SendI2CStop@plt>
  mov    $0xa,%edi
  call   <gfx_delay_milliseconds@plt>
  jmp    L23
L41:
  mov    $0x0,%eax
  call   <ReceiveI2CData@plt>
  mov    -0x38(%rbp),%rdx
  mov    %al,(%rdx)
  cmpb   $0x2,-0x30(%rbp)
  jne    L9
  mov    $0x0,%eax
  call   <SendI2CAck@plt>
  mov    -0x38(%rbp),%rax
  lea    0x1(%rax),%rbx
  mov    $0x0,%eax
  call   <ReceiveI2CData@plt>
  mov    %al,(%rbx)
L9:
  mov    $0x0,%eax
  call   <SendI2CNack@plt>
  mov    $0x0,%eax
  call   <SendI2CStop@plt>
  mov    $0x0,%eax
  jmp    L12
L23:
  mov    -0x14(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x14(%rbp)
  cmp    $0x4,%eax
  jle    L10
  mov    $0x1,%eax
L12:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
int gfx_i2c_read(unsigned char busnum, unsigned char address, unsigned char reg, unsigned char bytes, unsigned char *p_value) {
  int restart_count = 0;
  if (!p_value)
    return (1);
  while (restart_count++ < 5) {
    SendI2CStart();
    SendI2CData((char)((address << 1) | 0x00));
    if (!ReceiveI2CAck()) {
      SendI2CStop();
      gfx_delay_milliseconds(10);
      continue;
    }
    SendI2CData((unsigned char)(reg & 0xFF));
    SendI2CNack();
    SendI2CStart();
    SendI2CData((char)((address << 1) | 0x01));
    if (!ReceiveI2CAck()) {
      SendI2CStop();
      gfx_delay_milliseconds(10);
      continue;
    }
    *p_value = ReceiveI2CData();
    if (bytes == 2) {
      SendI2CAck();
      *(p_value + 1) = ReceiveI2CData();
    }
    SendI2CNack();
    SendI2CStop();
    return 0;
  }
  return (1);
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<gfx_i2c_read>:
  endbr64
  test   %r8,%r8
  je     L44
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %ecx,%r12d
  mov    %r8,%rbp
  movzbl %sil,%esi
  add    %esi,%esi
  movsbl %sil,%r13d
  or     $0x1,%esi
  movsbl %sil,%ebx
  mov    $0x5,%r14d
  movsbl %dl,%r15d
L9:
  mov    $0x0,%eax
  call   <SendI2CStart@plt>
  mov    %r13d,%edi
  call   <SendI2CData@plt>
  mov    $0x0,%eax
  call   <ReceiveI2CAck@plt>
  test   %eax,%eax
  je     L65
  mov    %r15d,%edi
  call   <SendI2CData@plt>
  mov    $0x0,%eax
  call   <SendI2CNack@plt>
  mov    $0x0,%eax
  call   <SendI2CStart@plt>
  mov    %ebx,%edi
  call   <SendI2CData@plt>
  mov    $0x0,%eax
  call   <ReceiveI2CAck@plt>
  test   %eax,%eax
  je     L54
  mov    $0x0,%eax
  call   <ReceiveI2CData@plt>
  mov    %al,0x0(%rbp)
  cmp    $0x2,%r12b
  je     L50
L74:
  mov    $0x0,%eax
  call   <SendI2CNack@plt>
  mov    $0x0,%eax
  call   <SendI2CStop@plt>
  mov    $0x0,%eax
L38:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L65:
  call   <SendI2CStop@plt>
  mov    $0xa,%edi
  call   <gfx_delay_milliseconds@plt>
L79:
  sub    $0x1,%r14d
  jne    L9
  mov    $0x1,%eax
  jmp    L38
L54:
  call   <SendI2CStop@plt>
  mov    $0xa,%edi
  call   <gfx_delay_milliseconds@plt>
  jmp    L79
L50:
  mov    $0x0,%eax
  call   <SendI2CAck@plt>
  mov    $0x0,%eax
  call   <ReceiveI2CData@plt>
  mov    %al,0x1(%rbp)
  jmp    L74
L44:
  mov    $0x1,%eax
  ret
```

assistant: ```c
int gfx_i2c_read(unsigned char busnum, unsigned char address, unsigned char reg, unsigned char bytes, unsigned char *p_value) {
  int restart_count = 0;
  if (!p_value)
    return (1);
  while (restart_count++ < 5) {
    SendI2CStart();
    SendI2CData((char)((address << 1) | 0x00));
    if (!ReceiveI2CAck()) {
      SendI2CStop();
      gfx_delay_milliseconds(10);
      continue;
    }
    SendI2CData((unsigned char)(reg & 0xFF));
    SendI2CNack();
    SendI2CStart();
    SendI2CData((char)((address << 1) | 0x01));
    if (!ReceiveI2CAck()) {
      SendI2CStop();
      gfx_delay_milliseconds(10);
      continue;
    }
    *p_value = ReceiveI2CData();
    if (bytes == 2) {
      SendI2CAck();
      *(p_value + 1) = ReceiveI2CData();
    }
    SendI2CNack();
    SendI2CStop();
    return 0;
  }
  return (1);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<gfx_i2c_read>:
  endbr64
  test   %r8,%r8
  je     L33
  push   %r15
  movzbl %sil,%esi
  movsbl %dl,%r15d
  push   %r14
  add    %esi,%esi
  mov    $0x5,%r14d
  push   %r13
  movsbl %sil,%r13d
  or     $0x1,%esi
  push   %r12
  mov    %ecx,%r12d
  push   %rbp
  mov    %r8,%rbp
  push   %rbx
  movsbl %sil,%ebx
  sub    $0x8,%rsp
L57:
  xor    %eax,%eax
  call   <SendI2CStart@plt>
  mov    %r13d,%edi
  call   <SendI2CData@plt>
  xor    %eax,%eax
  call   <ReceiveI2CAck@plt>
  test   %eax,%eax
  je     L27
  mov    %r15d,%edi
  call   <SendI2CData@plt>
  xor    %eax,%eax
  call   <SendI2CNack@plt>
  xor    %eax,%eax
  call   <SendI2CStart@plt>
  mov    %ebx,%edi
  call   <SendI2CData@plt>
  xor    %eax,%eax
  call   <ReceiveI2CAck@plt>
  test   %eax,%eax
  je     L27
  xor    %eax,%eax
  call   <ReceiveI2CData@plt>
  mov    %al,0x0(%rbp)
  cmp    $0x2,%r12b
  je     L14
L58:
  xor    %eax,%eax
  call   <SendI2CNack@plt>
  xor    %eax,%eax
  call   <SendI2CStop@plt>
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L27:
  xor    %eax,%eax
  call   <SendI2CStop@plt>
  mov    $0xa,%edi
  call   <gfx_delay_milliseconds@plt>
  sub    $0x1,%r14d
  jne    L57
  add    $0x8,%rsp
  mov    $0x1,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nop
L14:
  xor    %eax,%eax
  call   <SendI2CAck@plt>
  xor    %eax,%eax
  call   <ReceiveI2CData@plt>
  mov    %al,0x1(%rbp)
  jmp    L58
  nopl   0x0(%rax,%rax,1)
L33:
  mov    $0x1,%eax
  ret
```

assistant: ```c
int gfx_i2c_read(unsigned char busnum, unsigned char address, unsigned char reg, unsigned char bytes, unsigned char *p_value) {
  int restart_count = 0;
  if (!p_value)
    return (1);
  while (restart_count++ < 5) {
    SendI2CStart();
    SendI2CData((char)((address << 1) | 0x00));
    if (!ReceiveI2CAck()) {
      SendI2CStop();
      gfx_delay_milliseconds(10);
      continue;
    }
    SendI2CData((unsigned char)(reg & 0xFF));
    SendI2CNack();
    SendI2CStart();
    SendI2CData((char)((address << 1) | 0x01));
    if (!ReceiveI2CAck()) {
      SendI2CStop();
      gfx_delay_milliseconds(10);
      continue;
    }
    *p_value = ReceiveI2CData();
    if (bytes == 2) {
      SendI2CAck();
      *(p_value + 1) = ReceiveI2CData();
    }
    SendI2CNack();
    SendI2CStop();
    return 0;
  }
  return (1);
}
```