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

```asm
<smallhash_function>:
  endbr64
  mov    %rdi,%rax
  lea    0x6(%rdi),%r8
L19:
  cmpb   $0x63,(%rax)
  je     L26
  add    $0x1,%rax
  cmp    %r8,%rax
  jne    L19
  movsbl (%rdi),%eax
  lea    0x1(%rdi),%rcx
L5:
  movzbl (%rcx),%edx
  add    $0x1,%rcx
  mov    %edx,%esi
  sar    $0x7,%sil
  shr    $0x6,%sil
  add    %esi,%edx
  and    $0x3,%edx
  sub    %esi,%edx
  movsbl %dl,%edx
  lea    (%rdx,%rax,4),%edx
  movslq %edx,%rax
  mov    %edx,%esi
  imul   $0x68cb72fb,%rax,%rax
  sar    $0x1f,%esi
  sar    $0x2b,%rax
  sub    %esi,%eax
  imul   $0x138b,%eax,%esi
  mov    %edx,%eax
  sub    %esi,%eax
  cmp    %r8,%rcx
  jne    L5
  ret
  nopl   0x0(%rax,%rax,1)
L26:
  mov    $0xffffffff,%eax
  ret
```

assistant: ```c
int smallhash_function(char *lmer) {
  int x, ans;
  for (x = 0; x < 6; x++) {
    if (lmer[x] == 99)
      return -1;
  }
  ans = lmer[0];
  for (x = 1; x < 6; x++)
    ans = (4 * ans + (lmer[x] % 4)) % 5003;
  return ans;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<smallhash_function>:
  endbr64
  movsbl (%rdi),%r8d
  cmp    $0x63,%r8b
  je     L7
  movzbl 0x1(%rdi),%eax
  cmp    $0x63,%al
  je     L7
  movzbl 0x2(%rdi),%edx
  cmp    $0x63,%dl
  je     L7
  movzbl 0x3(%rdi),%ecx
  cmp    $0x63,%cl
  je     L7
  movzbl 0x4(%rdi),%esi
  cmp    $0x63,%sil
  je     L7
  movzbl 0x5(%rdi),%edi
  cmp    $0x63,%dil
  je     L7
  mov    %eax,%r9d
  sar    $0x7,%r9b
  shr    $0x6,%r9b
  add    %r9d,%eax
  and    $0x3,%eax
  sub    %r9d,%eax
  movsbl %al,%eax
  lea    (%rax,%r8,4),%r9d
  mov    %edx,%r8d
  sar    $0x7,%r8b
  shr    $0x6,%r8b
  lea    (%rdx,%r8,1),%eax
  mov    %ecx,%edx
  and    $0x3,%eax
  sar    $0x7,%dl
  sub    %r8d,%eax
  shr    $0x6,%dl
  movsbl %al,%eax
  lea    (%rax,%r9,4),%r8d
  lea    (%rcx,%rdx,1),%eax
  and    $0x3,%eax
  sub    %edx,%eax
  movsbl %al,%eax
  lea    (%rax,%r8,4),%edx
  movslq %edx,%rax
  mov    %edx,%ecx
  imul   $0x68cb72fb,%rax,%rax
  sar    $0x1f,%ecx
  sar    $0x2b,%rax
  sub    %ecx,%eax
  mov    %esi,%ecx
  imul   $0x138b,%eax,%eax
  sar    $0x7,%cl
  shr    $0x6,%cl
  sub    %eax,%edx
  lea    (%rsi,%rcx,1),%eax
  and    $0x3,%eax
  sub    %ecx,%eax
  movsbl %al,%eax
  lea    (%rax,%rdx,4),%edx
  movslq %edx,%rax
  mov    %edx,%ecx
  imul   $0x68cb72fb,%rax,%rax
  sar    $0x1f,%ecx
  sar    $0x2b,%rax
  sub    %ecx,%eax
  mov    %edi,%ecx
  imul   $0x138b,%eax,%eax
  sar    $0x7,%cl
  shr    $0x6,%cl
  sub    %eax,%edx
  lea    (%rdi,%rcx,1),%eax
  and    $0x3,%eax
  sub    %ecx,%eax
  movsbl %al,%eax
  lea    (%rax,%rdx,4),%edx
  movslq %edx,%rax
  mov    %edx,%ecx
  imul   $0x68cb72fb,%rax,%rax
  sar    $0x1f,%ecx
  sar    $0x2b,%rax
  sub    %ecx,%eax
  imul   $0x138b,%eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  ret
  nopl   0x0(%rax,%rax,1)
L7:
  mov    $0xffffffff,%eax
  ret
```

assistant: ```c
int smallhash_function(char *lmer) {
  int x, ans;
  for (x = 0; x < 6; x++) {
    if (lmer[x] == 99)
      return -1;
  }
  ans = lmer[0];
  for (x = 1; x < 6; x++)
    ans = (4 * ans + (lmer[x] % 4)) % 5003;
  return ans;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<OPB_BoolToInt>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,%eax
  mov    %al,-0x14(%rbp)
  cmpb   $0x0,-0x14(%rbp)
  je     L8
  movq   $0x1,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  jmp    L14
L8:
  movq   $0x0,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
L14:
  pop    %rbp
  ret
```

assistant: ```c
long long OPB_BoolToInt(char b) {
  long long _o_result;
  if (b) {
    _o_result = 1;
    return _o_result;
  } else {
    _o_result = 0;
    return _o_result;
  }
__retchk:
  Platform_Halt(-3);
  return 0;
  ;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<OPB_BoolToInt>:
  endbr64
  test   %dil,%dil
  setne  %al
  movzbl %al,%eax
  ret
```

assistant: ```c
long long OPB_BoolToInt(char b) {
  long long _o_result;
  if (b) {
    _o_result = 1;
    return _o_result;
  } else {
    _o_result = 0;
    return _o_result;
  }
__retchk:
  Platform_Halt(-3);
  return 0;
  ;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<OPB_BoolToInt>:
  endbr64
  xor    %eax,%eax
  test   %dil,%dil
  setne  %al
  ret
```

assistant: ```c
long long OPB_BoolToInt(char b) {
  long long _o_result;
  if (b) {
    _o_result = 1;
    return _o_result;
  } else {
    _o_result = 0;
    return _o_result;
  }
__retchk:
  Platform_Halt(-3);
  return 0;
  ;
}
```
user: What is the c source code of the assembly code below:

```asm
<OPB_BoolToInt>:
  endbr64
  xor    %eax,%eax
  test   %dil,%dil
  setne  %al
  ret
```

assistant: ```c
long long OPB_BoolToInt(char b) {
  long long _o_result;
  if (b) {
    _o_result = 1;
    return _o_result;
  } else {
    _o_result = 0;
    return _o_result;
  }
__retchk:
  Platform_Halt(-3);
  return 0;
  ;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<comment>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  movl   $0x0,-0x4(%rbp)
  mov    $0x0,%eax
  call   <next@plt>
  mov    %eax,-0x8(%rbp)
  jmp    L20
L65:
  mov    $0x0,%eax
  call   <next@plt>
  mov    %eax,-0x8(%rbp)
L11:
  mov    D19(%rip),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x8(%rbp)
  je     L61
  cmpl   $0x2a,-0x8(%rbp)
  jne    L65
L61:
  mov    D19(%rip),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x8(%rbp)
  jne    L30
  movl   $0x1,-0x4(%rbp)
  jmp    L20
L30:
  mov    $0x0,%eax
  call   <next@plt>
  mov    %eax,-0x8(%rbp)
  mov    D19(%rip),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x8(%rbp)
  je     L74
  cmpl   $0x2f,-0x8(%rbp)
  jne    L20
L74:
  movl   $0x1,-0x4(%rbp)
L20:
  cmpl   $0x1,-0x4(%rbp)
  jne    L11
  mov    -0x8(%rbp),%eax
  leave
  ret
```

assistant: ```c
int comment(void) {
  int c;
  int s;
  s = 0;
  c = next();
  while (s != 1) {
    while (c != EOF && c != '*')
      c = next();
    if (c == EOF)
      s = 1;
    else {
      c = next();
      if (c == EOF || c == '/')
        s = 1;
    }
  }
  return c;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<comment>:
  endbr64
  push   %rbx
  mov    $0x0,%eax
  call   <next@plt>
  mov    D18(%rip),%rbx
  jmp    L20
L80:
  cmp    %eax,%edx
  je     L13
  mov    $0x0,%eax
  call   <next@plt>
  mov    D18(%rip),%rdx
  cmp    %eax,(%rdx)
  je     L13
  cmp    $0x2f,%eax
  je     L13
L20:
  mov    (%rbx),%edx
  cmp    $0x2a,%eax
  je     L80
  cmp    %edx,%eax
  je     L80
L63:
  mov    $0x0,%eax
  call   <next@plt>
  mov    D18(%rip),%rdx
  mov    (%rdx),%edx
  cmp    $0x2a,%eax
  je     L80
  cmp    %eax,%edx
  jne    L63
  jmp    L80
L13:
  pop    %rbx
  ret
```

assistant: ```c
int comment(void) {
  int c;
  int s;
  s = 0;
  c = next();
  while (s != 1) {
    while (c != EOF && c != '*')
      c = next();
    if (c == EOF)
      s = 1;
    else {
      c = next();
      if (c == EOF || c == '/')
        s = 1;
    }
  }
  return c;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<comment>:
  endbr64
  push   %rbx
  xor    %eax,%eax
  call   <next@plt>
  mov    D0(%rip),%rbx
  mov    (%rbx),%edx
  nopl   (%rax)
L69:
  cmp    %edx,%eax
  jne    L66
  jmp    L64
  xchg   %ax,%ax
L49:
  xor    %eax,%eax
  call   <next@plt>
  mov    (%rbx),%edx
  cmp    %eax,%edx
  je     L64
L66:
  cmp    $0x2a,%eax
  jne    L49
  cmp    $0x2a,%edx
  je     L1
  xor    %eax,%eax
  call   <next@plt>
  mov    (%rbx),%edx
  cmp    %eax,%edx
  je     L64
  cmp    $0x2f,%eax
  jne    L69
L64:
  pop    %rbx
  ret
L1:
  mov    $0x2a,%eax
  pop    %rbx
  ret
```

assistant: ```c
int comment(void) {
  int c;
  int s;
  s = 0;
  c = next();
  while (s != 1) {
    while (c != EOF && c != '*')
      c = next();
    if (c == EOF)
      s = 1;
    else {
      c = next();
      if (c == EOF || c == '/')
        s = 1;
    }
  }
  return c;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<comment>:
  endbr64
  push   %rbx
  xor    %eax,%eax
  call   <next@plt>
  mov    D7(%rip),%rbx
  mov    (%rbx),%edx
  nopl   (%rax)
L46:
  cmp    %edx,%eax
  jne    L16
  jmp    L10
  xchg   %ax,%ax
L68:
  xor    %eax,%eax
  call   <next@plt>
  mov    (%rbx),%edx
  cmp    %eax,%edx
  je     L10
L16:
  cmp    $0x2a,%eax
  jne    L68
  cmp    $0x2a,%edx
  je     L15
  xor    %eax,%eax
  call   <next@plt>
  mov    (%rbx),%edx
  cmp    %eax,%edx
  je     L10
  cmp    $0x2f,%eax
  jne    L46
L10:
  pop    %rbx
  ret
L15:
  mov    $0x2a,%eax
  pop    %rbx
  ret
```

assistant: ```c
int comment(void) {
  int c;
  int s;
  s = 0;
  c = next();
  while (s != 1) {
    while (c != EOF && c != '*')
      c = next();
    if (c == EOF)
      s = 1;
    else {
      c = next();
      if (c == EOF || c == '/')
        s = 1;
    }
  }
  return c;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<decimalBinario>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x14(%rbp)
  mov    -0x14(%rbp),%eax
  shr    %eax
  mov    %eax,-0x8(%rbp)
  mov    -0x14(%rbp),%eax
  and    $0x1,%eax
  mov    %eax,-0x4(%rbp)
  cmpl   $0x1,-0x8(%rbp)
  jle    L11
  mov    -0x8(%rbp),%eax
  mov    %eax,%edi
  call   <decimalBinario>
  jmp    L1
L11:
  mov    -0x8(%rbp),%eax
  mov    %eax,%esi
  lea    D12(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L1:
  mov    -0x4(%rbp),%eax
  mov    %eax,%esi
  lea    D12(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  nop
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: data_tag: D12
data_type: string

tool: D12: %d

assistant: ```c
void decimalBinario(unsigned int num) {
  int resto;
  int cociente;
  cociente = num / 2;
  resto = num % 2;
  if (cociente > 1)
    decimalBinario(cociente);
  else
    printf("%d", cociente);
  printf("%d", resto);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<decimalBinario>:
  endbr64
  push   %rbx
  mov    %edi,%esi
  shr    %esi
  mov    %edi,%ebx
  and    $0x1,%ebx
  cmp    $0x3,%edi
  jbe    L0
  mov    %esi,%edi
  call   <decimalBinario>
L6:
  mov    %ebx,%esi
  lea    D17(%rip),%rdi
  call   <printf@plt>
  pop    %rbx
  ret
L0:
  lea    D17(%rip),%rdi
  call   <printf@plt>
  jmp    L6
```

tool_calls: name: unpack_data
arguments: data_tag: D17
data_type: string

tool: D17: %d

assistant: ```c
void decimalBinario(unsigned int num) {
  int resto;
  int cociente;
  cociente = num / 2;
  resto = num % 2;
  if (cociente > 1)
    decimalBinario(cociente);
  else
    printf("%d", cociente);
  printf("%d", resto);
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<decimalBinario>:
  endbr64
  push   %r15
  mov    %edi,%esi
  push   %r14
  shr    %esi
  push   %r13
  mov    %edi,%r13d
  push   %r12
  and    $0x1,%r13d
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  cmp    $0x3,%edi
  jbe    L51
  mov    %edi,%r12d
  and    $0x1,%esi
  shr    $0x2,%r12d
  mov    %esi,%ebp
  cmp    $0x1,%r12d
  je     L21
  mov    %edi,%r14d
  and    $0x1,%r12d
  shr    $0x3,%r14d
  cmp    $0x1,%r14d
  je     L67
  mov    %edi,%eax
  and    $0x1,%r14d
  shr    $0x4,%eax
  cmp    $0x1,%eax
  je     L24
  and    $0x1,%eax
  shr    $0x5,%edi
  mov    %eax,%ebx
  cmp    $0x1,%edi
  je     L20
  call   <decimalBinario>
  lea    D43(%rip),%r15
L88:
  mov    %ebx,%esi
  mov    %r15,%rdi
  call   <printf@plt>
L35:
  mov    %r14d,%esi
  mov    %r15,%rdi
  call   <printf@plt>
L76:
  mov    %r12d,%esi
  mov    %r15,%rdi
  call   <printf@plt>
  jmp    L56
  xchg   %ax,%ax
L21:
  lea    D43(%rip),%r15
  mov    $0x1,%esi
  mov    %r15,%rdi
  call   <printf@plt>
L56:
  mov    %ebp,%esi
  mov    %r15,%rdi
  call   <printf@plt>
L91:
  add    $0x8,%rsp
  mov    %r13d,%esi
  mov    %r15,%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1050 <printf@plt>
  nopw   0x0(%rax,%rax,1)
L51:
  lea    D43(%rip),%r15
  mov    %r15,%rdi
  call   <printf@plt>
  jmp    L91
  nopl   0x0(%rax)
L24:
  lea    D43(%rip),%r15
  mov    $0x1,%esi
  mov    %r15,%rdi
  call   <printf@plt>
  jmp    L35
  nopl   0x0(%rax)
L67:
  lea    D43(%rip),%r15
  mov    $0x1,%esi
  mov    %r15,%rdi
  call   <printf@plt>
  jmp    L76
  nopl   0x0(%rax)
L20:
  lea    D43(%rip),%r15
  mov    $0x1,%esi
  mov    %r15,%rdi
  call   <printf@plt>
  jmp    L88
```

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

tool: D43: %d

assistant: ```c
void decimalBinario(unsigned int num) {
  int resto;
  int cociente;
  cociente = num / 2;
  resto = num % 2;
  if (cociente > 1)
    decimalBinario(cociente);
  else
    printf("%d", cociente);
  printf("%d", resto);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<decimalBinario>:
  endbr64
  push   %r15
  mov    %edi,%esi
  push   %r14
  shr    %esi
  push   %r13
  mov    %edi,%r13d
  push   %r12
  and    $0x1,%r13d
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  cmp    $0x3,%edi
  jbe    L56
  mov    %edi,%r12d
  and    $0x1,%esi
  shr    $0x2,%r12d
  mov    %esi,%ebp
  cmp    $0x1,%r12d
  je     L10
  mov    %edi,%r14d
  and    $0x1,%r12d
  shr    $0x3,%r14d
  cmp    $0x1,%r14d
  je     L18
  mov    %edi,%eax
  and    $0x1,%r14d
  shr    $0x4,%eax
  cmp    $0x1,%eax
  je     L1
  and    $0x1,%eax
  shr    $0x5,%edi
  mov    %eax,%ebx
  cmp    $0x1,%edi
  je     L55
  call   <decimalBinario>
  lea    D58(%rip),%r15
L29:
  mov    %ebx,%esi
  mov    %r15,%rdi
  call   <printf@plt>
L3:
  mov    %r14d,%esi
  mov    %r15,%rdi
  call   <printf@plt>
L31:
  mov    %r12d,%esi
  mov    %r15,%rdi
  call   <printf@plt>
  jmp    L72
  xchg   %ax,%ax
L10:
  lea    D58(%rip),%r15
  mov    $0x1,%esi
  mov    %r15,%rdi
  call   <printf@plt>
L72:
  mov    %ebp,%esi
  mov    %r15,%rdi
  call   <printf@plt>
L94:
  add    $0x8,%rsp
  mov    %r13d,%esi
  mov    %r15,%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1050 <printf@plt>
  nopw   0x0(%rax,%rax,1)
L56:
  lea    D58(%rip),%r15
  mov    %r15,%rdi
  call   <printf@plt>
  jmp    L94
  nopl   0x0(%rax)
L1:
  lea    D58(%rip),%r15
  mov    $0x1,%esi
  mov    %r15,%rdi
  call   <printf@plt>
  jmp    L3
  nopl   0x0(%rax)
L18:
  lea    D58(%rip),%r15
  mov    $0x1,%esi
  mov    %r15,%rdi
  call   <printf@plt>
  jmp    L31
  nopl   0x0(%rax)
L55:
  lea    D58(%rip),%r15
  mov    $0x1,%esi
  mov    %r15,%rdi
  call   <printf@plt>
  jmp    L29
```

tool_calls: name: retrieve_data
arguments: data_tag: D58
datatype: string

tool: D58: %d

assistant: ```c
void decimalBinario(unsigned int num) {
  int resto;
  int cociente;
  cociente = num / 2;
  resto = num % 2;
  if (cociente > 1)
    decimalBinario(cociente);
  else
    printf("%d", cociente);
  printf("%d", resto);
}
```
user: Translate the below assembly code into C programming language:

```asm
<graph>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <graph_header@plt>
  movl   $0xa,-0x14(%rbp)
  movl   $0x0,-0x1c(%rbp)
  jmp    L36
L68:
  mov    -0x1c(%rbp),%eax
  add    $0x1,%eax
  imul   -0x14(%rbp),%eax
  mov    $0x64,%edx
  sub    %eax,%edx
  pxor   %xmm0,%xmm0
  cvtsi2sd %edx,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x14(%rbp),%xmm0
  addsd  -0x10(%rbp),%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  lea    D8(%rip),%rax
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  movl   $0x0,-0x18(%rbp)
  jmp    L78
L49:
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movsd  D29(%rip),%xmm0
  comisd -0x8(%rbp),%xmm0
  jbe    L12
  mov    $0x20,%edi
  call   <putchar@plt>
  jmp    L11
L12:
  movsd  -0x8(%rbp),%xmm0
  comisd -0x10(%rbp),%xmm0
  jb     L63
  mov    $0x2a,%edi
  call   <putchar@plt>
  jmp    L11
L63:
  mov    $0x20,%edi
  call   <putchar@plt>
L11:
  addl   $0x1,-0x18(%rbp)
L78:
  mov    -0x18(%rbp),%eax
  cltq
  cmp    %rax,-0x30(%rbp)
  jg     L49
  lea    D4(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  addl   $0x1,-0x1c(%rbp)
L36:
  mov    -0x1c(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jl     L68
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <graph_header@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  nop
  leave
  ret
```

tool_calls: name: unpack_data
arguments: label: D8
data_type: string
name: unpack_data
arguments: label: D29
data_type: f64
name: unpack_data
arguments: label: D4
data_type: string

tool: D8: %4.0f %% 

tool: D29: 1

tool: D4:  | 

assistant: ```c
void graph(double regions[], long nr_regions) {
  printf("\n");
  graph_header(nr_regions);
  int *ptr;
  int i, j;
  int perc_width = 10;
  for (i = 0; i < perc_width; ++i) {
    double perc_index = 100 - ((i + 1) * perc_width);
    printf("%4.0f %% ", perc_index + perc_width);
    for (j = 0; j < nr_regions; ++j) {
      double val = regions[j];
      if (val < 1) {
        printf(" ");
      } else if (val >= perc_index) {
        printf("*");
      } else {
        printf(" ");
      }
    }
    printf(" | \n");
  }
  graph_header(nr_regions);
  printf("\n");
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<graph>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%r12
  mov    %rsi,%rbp
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    %rbp,%rdi
  call   <graph_header@plt>
  mov    $0x5a,%r13d
  lea    D39(%rip),%r15
  lea    D26(%rip),%r14
  jmp    L20
L28:
  mov    $0x20,%edi
  call   <putchar@plt>
  jmp    L45
L35:
  mov    $0x20,%edi
  call   <putchar@plt>
L45:
  add    $0x1,%rbx
  cmp    %rbx,%rbp
  je     L58
L87:
  movsd  (%r12,%rbx,8),%xmm0
  movsd  D6(%rip),%xmm1
  comisd %xmm0,%xmm1
  ja     L28
  comisd 0x8(%rsp),%xmm0
  jb     L35
  mov    $0x2a,%edi
  call   <putchar@plt>
  jmp    L45
L58:
  mov    %r14,%rdi
  call   <puts@plt>
  sub    $0xa,%r13d
  cmp    $0xfffffff6,%r13d
  je     L38
L20:
  pxor   %xmm3,%xmm3
  cvtsi2sd %r13d,%xmm3
  movsd  %xmm3,0x8(%rsp)
  movsd  D7(%rip),%xmm0
  addsd  %xmm3,%xmm0
  mov    %r15,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  test   %rbp,%rbp
  jle    L58
  mov    $0x0,%ebx
  jmp    L87
L38:
  mov    %rbp,%rdi
  call   <graph_header@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D39
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D26
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D6
type_guessed: f64
name: extract_symbolic_data
arguments: data_tag: D7
type_guessed: byte[8]

tool: D39: %4.0f %% 

tool: D26:  | 

tool: D6: 1

tool: {"D7": [0x00,0x00,0x00,0x00,0x00,0x00,0x24,0x40]}

assistant: ```c
void graph(double regions[], long nr_regions) {
  printf("\n");
  graph_header(nr_regions);
  int *ptr;
  int i, j;
  int perc_width = 10;
  for (i = 0; i < perc_width; ++i) {
    double perc_index = 100 - ((i + 1) * perc_width);
    printf("%4.0f %% ", perc_index + perc_width);
    for (j = 0; j < nr_regions; ++j) {
      double val = regions[j];
      if (val < 1) {
        printf(" ");
      } else if (val >= perc_index) {
        printf("*");
      } else {
        printf(" ");
      }
    }
    printf(" | \n");
  }
  graph_header(nr_regions);
  printf("\n");
}
```
user: What is the c source code of the assembly code below?

```asm
<graph>:
  endbr64
  push   %r15
  lea    D12(%rip),%r15
  push   %r14
  lea    D9(%rip),%r14
  push   %r13
  mov    $0x5a,%r13d
  push   %r12
  mov    %rdi,%r12
  mov    $0xa,%edi
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  sub    $0x18,%rsp
  call   <putchar@plt>
  mov    %rbp,%rdi
  call   <graph_header@plt>
  xchg   %ax,%ax
L24:
  pxor   %xmm3,%xmm3
  movsd  D39(%rip),%xmm0
  mov    %r15,%rdi
  mov    $0x1,%eax
  cvtsi2sd %r13d,%xmm3
  addsd  %xmm3,%xmm0
  movsd  %xmm3,0x8(%rsp)
  call   <printf@plt>
  test   %rbp,%rbp
  jle    L18
  xor    %ebx,%ebx
  jmp    L46
  nopl   0x0(%rax)
L5:
  mov    $0x2a,%edi
  add    $0x1,%rbx
  call   <putchar@plt>
  cmp    %rbx,%rbp
  je     L18
L46:
  movsd  (%r12,%rbx,8),%xmm0
  movsd  D26(%rip),%xmm1
  comisd %xmm0,%xmm1
  ja     L56
  comisd 0x8(%rsp),%xmm0
  jae    L5
L56:
  mov    $0x20,%edi
  add    $0x1,%rbx
  call   <putchar@plt>
  cmp    %rbx,%rbp
  jne    L46
L18:
  mov    %r14,%rdi
  sub    $0xa,%r13d
  call   <puts@plt>
  cmp    $0xfffffff6,%r13d
  jne    L24
  mov    %rbp,%rdi
  call   <graph_header@plt>
  add    $0x18,%rsp
  mov    $0xa,%edi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1080 <putchar@plt>
```

tool_calls: name: unpack_data
arguments: data_label: D12
type_infered: string
name: unpack_data
arguments: data_label: D9
type_infered: string
name: unpack_data
arguments: data_label: D39
type_infered: byte[8]
name: unpack_data
arguments: data_label: D26
type_infered: f64

tool: D12: %4.0f %% 

tool: D9:  | 

tool: {"D39": [0x00,0x00,0x00,0x00,0x00,0x00,0x24,0x40]}

tool: D26: 1

assistant: ```c
void graph(double regions[], long nr_regions) {
  printf("\n");
  graph_header(nr_regions);
  int *ptr;
  int i, j;
  int perc_width = 10;
  for (i = 0; i < perc_width; ++i) {
    double perc_index = 100 - ((i + 1) * perc_width);
    printf("%4.0f %% ", perc_index + perc_width);
    for (j = 0; j < nr_regions; ++j) {
      double val = regions[j];
      if (val < 1) {
        printf(" ");
      } else if (val >= perc_index) {
        printf("*");
      } else {
        printf(" ");
      }
    }
    printf(" | \n");
  }
  graph_header(nr_regions);
  printf("\n");
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<graph>:
  endbr64
  push   %r15
  lea    D19(%rip),%r15
  push   %r14
  lea    D2(%rip),%r14
  push   %r13
  mov    $0x5a,%r13d
  push   %r12
  mov    %rdi,%r12
  mov    $0xa,%edi
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  sub    $0x18,%rsp
  call   <putchar@plt>
  mov    %rbp,%rdi
  call   <graph_header@plt>
  xchg   %ax,%ax
L2:
  pxor   %xmm3,%xmm3
  movsd  D14(%rip),%xmm0
  mov    %r15,%rdi
  mov    $0x1,%eax
  cvtsi2sd %r13d,%xmm3
  addsd  %xmm3,%xmm0
  movsd  %xmm3,0x8(%rsp)
  call   <printf@plt>
  test   %rbp,%rbp
  jle    L19
  xor    %ebx,%ebx
  jmp    L15
  nopl   0x0(%rax)
L44:
  mov    $0x2a,%edi
  add    $0x1,%rbx
  call   <putchar@plt>
  cmp    %rbx,%rbp
  je     L19
L15:
  movsd  (%r12,%rbx,8),%xmm0
  movsd  D7(%rip),%xmm1
  comisd %xmm0,%xmm1
  ja     L36
  comisd 0x8(%rsp),%xmm0
  jae    L44
L36:
  mov    $0x20,%edi
  add    $0x1,%rbx
  call   <putchar@plt>
  cmp    %rbx,%rbp
  jne    L15
L19:
  mov    %r14,%rdi
  sub    $0xa,%r13d
  call   <puts@plt>
  cmp    $0xfffffff6,%r13d
  jne    L2
  mov    %rbp,%rdi
  call   <graph_header@plt>
  add    $0x18,%rsp
  mov    $0xa,%edi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1080 <putchar@plt>
```

tool_calls: name: retrieve_data
arguments: tag: D19
type_infered: string
name: retrieve_data
arguments: tag: D2
type_infered: string
name: retrieve_data
arguments: tag: D14
type_infered: byte[8]
name: retrieve_data
arguments: tag: D7
type_infered: f64

tool: D19: %4.0f %% 

tool: D2:  | 

tool: {"D14": [0x00,0x00,0x00,0x00,0x00,0x00,0x24,0x40]}

tool: D7: 1

assistant: ```c
void graph(double regions[], long nr_regions) {
  printf("\n");
  graph_header(nr_regions);
  int *ptr;
  int i, j;
  int perc_width = 10;
  for (i = 0; i < perc_width; ++i) {
    double perc_index = 100 - ((i + 1) * perc_width);
    printf("%4.0f %% ", perc_index + perc_width);
    for (j = 0; j < nr_regions; ++j) {
      double val = regions[j];
      if (val < 1) {
        printf(" ");
      } else if (val >= perc_index) {
        printf("*");
      } else {
        printf(" ");
      }
    }
    printf(" | \n");
  }
  graph_header(nr_regions);
  printf("\n");
}
```