ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<ExpToBin>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %edi,%ebx
  cmp    $0x2,%esi
  sete   %r13b
  movzbl %r13b,%r13d
  lea    0x8(%r13,%r13,2),%r13d
  lea    0x1(%r13),%edi
  call   <malloc@plt>
  mov    %rax,%r12
  mov    $0x0,%ebp
  lea    D17(%rip),%r15
  lea    D9(%rip),%r14
  jmp    L0
L23:
  mov    %r15,%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
L11:
  mov    %ebx,%eax
  shr    $0x1f,%eax
  add    %ebx,%eax
  sar    %eax
  mov    %eax,%ebx
  add    $0x1,%ebp
  cmp    %ebp,%r13d
  je     L24
L0:
  test   $0x1,%bl
  je     L23
  mov    %r14,%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  jmp    L11
L24:
  mov    %r12,%rdi
  call   <InvString@plt>
  mov    %eax,%esi
  mov    %r12,%rdi
  call   <strcpy@plt>
  mov    %r12,%rax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: retrieve_data
arguments: tag: D17
type_guessed: string
name: retrieve_data
arguments: tag: D9
type_guessed: string

tool: D17: 0

tool: D9: 1

assistant: ```c
char *ExpToBin(int exp, int prec) {
  int i, max;
  char *bin;
  if (prec == 1) {
    max = 8;
  }
  if (prec == 2) {
    max = 11;
  }
  bin = malloc(sizeof(char) * (max + 1));
  for (i = 0; i < max; i++) {
    if (exp % 2)
      strcat(bin, "1");
    else
      strcat(bin, "0");
    exp = exp / 2;
  }
  strcpy(bin, InvString(bin));
  return bin;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<ExpToBin>:
  endbr64
  push   %r15
  push   %r14
  lea    D13(%rip),%r14
  push   %r13
  lea    D2(%rip),%r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %edi,%ebx
  xor    %edi,%edi
  sub    $0x8,%rsp
  cmp    $0x2,%esi
  sete   %dil
  sete   %r12b
  xor    %ebp,%ebp
  lea    0x9(%rdi,%rdi,2),%edi
  movzbl %r12b,%r12d
  call   <malloc@plt>
  lea    0x8(%r12,%r12,2),%r12d
  mov    %rax,%r15
  jmp    L25
  nopl   0x0(%rax,%rax,1)
L2:
  mov    %r13,%rsi
  mov    %r15,%rdi
  call   <strcat@plt>
L27:
  mov    %ebx,%eax
  add    $0x1,%ebp
  shr    $0x1f,%eax
  add    %eax,%ebx
  sar    %ebx
  cmp    %ebp,%r12d
  je     L38
L25:
  test   $0x1,%bl
  jne    L2
  mov    %r14,%rsi
  mov    %r15,%rdi
  call   <strcat@plt>
  jmp    L27
  xchg   %ax,%ax
L38:
  mov    %r15,%rdi
  call   <InvString@plt>
  mov    %r15,%rdi
  mov    %eax,%esi
  call   <strcpy@plt>
  add    $0x8,%rsp
  mov    %r15,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: parse_data
arguments: data_tag: D13
type_guessed: string
name: parse_data
arguments: data_tag: D2
type_guessed: string

tool: D13: 0

tool: D2: 1

assistant: ```c
char *ExpToBin(int exp, int prec) {
  int i, max;
  char *bin;
  if (prec == 1) {
    max = 8;
  }
  if (prec == 2) {
    max = 11;
  }
  bin = malloc(sizeof(char) * (max + 1));
  for (i = 0; i < max; i++) {
    if (exp % 2)
      strcat(bin, "1");
    else
      strcat(bin, "0");
    exp = exp / 2;
  }
  strcpy(bin, InvString(bin));
  return bin;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<ExpToBin>:
  endbr64
  push   %r15
  push   %r14
  lea    D16(%rip),%r14
  push   %r13
  lea    D19(%rip),%r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %edi,%ebx
  xor    %edi,%edi
  sub    $0x8,%rsp
  cmp    $0x2,%esi
  sete   %dil
  sete   %r12b
  xor    %ebp,%ebp
  lea    0x9(%rdi,%rdi,2),%edi
  movzbl %r12b,%r12d
  call   <malloc@plt>
  lea    0x8(%r12,%r12,2),%r12d
  mov    %rax,%r15
  jmp    L14
  nopl   0x0(%rax,%rax,1)
L23:
  mov    %r13,%rsi
  mov    %r15,%rdi
  call   <strcat@plt>
L32:
  mov    %ebx,%eax
  add    $0x1,%ebp
  shr    $0x1f,%eax
  add    %eax,%ebx
  sar    %ebx
  cmp    %ebp,%r12d
  je     L22
L14:
  test   $0x1,%bl
  jne    L23
  mov    %r14,%rsi
  mov    %r15,%rdi
  call   <strcat@plt>
  jmp    L32
  xchg   %ax,%ax
L22:
  mov    %r15,%rdi
  call   <InvString@plt>
  mov    %r15,%rdi
  mov    %eax,%esi
  call   <strcpy@plt>
  add    $0x8,%rsp
  mov    %r15,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D16
type_guessed: string
name: unpack_data
arguments: data_label: D19
type_guessed: string

tool: D16: 0

tool: D19: 1

assistant: ```c
char *ExpToBin(int exp, int prec) {
  int i, max;
  char *bin;
  if (prec == 1) {
    max = 8;
  }
  if (prec == 2) {
    max = 11;
  }
  bin = malloc(sizeof(char) * (max + 1));
  for (i = 0; i < max; i++) {
    if (exp % 2)
      strcat(bin, "1");
    else
      strcat(bin, "0");
    exp = exp / 2;
  }
  strcpy(bin, InvString(bin));
  return bin;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<code128a_ascii_to_code>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,%eax
  mov    %al,-0x4(%rbp)
  cmpb   $0x1f,-0x4(%rbp)
  jle    L24
  cmpb   $0x5f,-0x4(%rbp)
  jg     L24
  movzbl -0x4(%rbp),%eax
  sub    $0x20,%eax
  jmp    L133
L24:
  cmpb   $0x0,-0x4(%rbp)
  js     L100
  cmpb   $0x1f,-0x4(%rbp)
  jg     L100
  movzbl -0x4(%rbp),%eax
  add    $0x40,%eax
  jmp    L133
L100:
  cmpb   $0xf1,-0x4(%rbp)
  jne    L28
  mov    $0x66,%eax
  jmp    L133
L28:
  cmpb   $0xf2,-0x4(%rbp)
  jne    L75
  mov    $0x61,%eax
  jmp    L133
L75:
  cmpb   $0xf3,-0x4(%rbp)
  jne    L19
  mov    $0x60,%eax
  jmp    L133
L19:
  cmpb   $0xf4,-0x4(%rbp)
  jne    L46
  mov    $0x65,%eax
  jmp    L133
L46:
  mov    $0xffffffff,%eax
L133:
  pop    %rbp
  ret
```

assistant: ```c
signed char code128a_ascii_to_code(char value) {
  if (value >= ' ' && value <= '_')
    return value - ' ';
  else if (value >= 0 && value < ' ')
    return value + 64;
  else if (value == '\xf1')
    return 102;
  else if (value == '\xf2')
    return 97;
  else if (value == '\xf3')
    return 96;
  else if (value == '\xf4')
    return 101;
  else
    return -1;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<code128a_ascii_to_code>:
  endbr64
  lea    -0x20(%rdi),%eax
  cmp    $0x3f,%al
  jbe    L1
  lea    0xf(%rdi),%eax
  cmp    $0x2e,%al
  ja     L9
  movzbl %al,%eax
  lea    D4(%rip),%rdx
  movslq (%rdx,%rax,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
  mov    $0x61,%eax
  ret
  lea    0x40(%rdi),%eax
  ret
  mov    $0x60,%eax
  ret
  mov    $0x65,%eax
  ret
L9:
  mov    $0xffffffff,%eax
  ret
  mov    $0x66,%eax
L1:
  ret
```

assistant: ```c
signed char code128a_ascii_to_code(char value) {
  if (value >= ' ' && value <= '_')
    return value - ' ';
  else if (value >= 0 && value < ' ')
    return value + 64;
  else if (value == '\xf1')
    return 102;
  else if (value == '\xf2')
    return 97;
  else if (value == '\xf3')
    return 96;
  else if (value == '\xf4')
    return 101;
  else
    return -1;
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<code128a_ascii_to_code>:
  endbr64
  lea    -0x20(%rdi),%eax
  cmp    $0x3f,%al
  jbe    L17
  lea    0xf(%rdi),%eax
  cmp    $0x2e,%al
  ja     L16
  lea    D6(%rip),%rdx
  movzbl %al,%eax
  movslq (%rdx,%rax,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
  cs nopw 0x0(%rax,%rax,1)
  mov    $0x66,%eax
L17:
  ret
  cs nopw 0x0(%rax,%rax,1)
  lea    0x40(%rdi),%eax
  ret
  nopl   0x0(%rax)
L16:
  mov    $0xffffffff,%eax
  ret
  xchg   %ax,%ax
  mov    $0x65,%eax
  ret
  cs nopw 0x0(%rax,%rax,1)
  mov    $0x60,%eax
  ret
  cs nopw 0x0(%rax,%rax,1)
  mov    $0x61,%eax
  ret
```

assistant: ```c
signed char code128a_ascii_to_code(char value) {
  if (value >= ' ' && value <= '_')
    return value - ' ';
  else if (value >= 0 && value < ' ')
    return value + 64;
  else if (value == '\xf1')
    return 102;
  else if (value == '\xf2')
    return 97;
  else if (value == '\xf3')
    return 96;
  else if (value == '\xf4')
    return 101;
  else
    return -1;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<code128a_ascii_to_code>:
  endbr64
  lea    -0x20(%rdi),%eax
  cmp    $0x3f,%al
  jbe    L12
  lea    0xf(%rdi),%eax
  cmp    $0x2e,%al
  ja     L8
  lea    D0(%rip),%rdx
  movzbl %al,%eax
  movslq (%rdx,%rax,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
  cs nopw 0x0(%rax,%rax,1)
  mov    $0x66,%eax
L12:
  ret
  cs nopw 0x0(%rax,%rax,1)
  lea    0x40(%rdi),%eax
  ret
  nopl   0x0(%rax)
L8:
  mov    $0xffffffff,%eax
  ret
  xchg   %ax,%ax
  mov    $0x65,%eax
  ret
  cs nopw 0x0(%rax,%rax,1)
  mov    $0x60,%eax
  ret
  cs nopw 0x0(%rax,%rax,1)
  mov    $0x61,%eax
  ret
```

assistant: ```c
signed char code128a_ascii_to_code(char value) {
  if (value >= ' ' && value <= '_')
    return value - ' ';
  else if (value >= 0 && value < ' ')
    return value + 64;
  else if (value == '\xf1')
    return 102;
  else if (value == '\xf2')
    return 97;
  else if (value == '\xf3')
    return 96;
  else if (value == '\xf4')
    return 101;
  else
    return -1;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0xd,-0x30(%rbp)
  movl   $0x2,-0x2c(%rbp)
  movl   $0x4,-0x28(%rbp)
  movl   $0xf,-0x24(%rbp)
  movl   $0xc,-0x20(%rbp)
  movl   $0xa,-0x1c(%rbp)
  movl   $0x5,-0x18(%rbp)
  movl   $0x0,-0x40(%rbp)
  movl   $0x0,-0x3c(%rbp)
  movl   $0x0,-0x34(%rbp)
  movl   $0x0,-0x40(%rbp)
  jmp    L42
L3:
  mov    -0x40(%rbp),%eax
  cltq
  mov    -0x30(%rbp,%rax,4),%eax
  mov    %eax,-0x38(%rbp)
  movl   $0x0,-0x3c(%rbp)
  jmp    L46
L11:
  mov    -0x40(%rbp),%eax
  and    $0x1,%eax
  test   %eax,%eax
  jne    L4
  mov    -0x3c(%rbp),%eax
  cltq
  mov    -0x30(%rbp,%rax,4),%eax
  cmp    %eax,-0x38(%rbp)
  jge    L4
  mov    -0x3c(%rbp),%eax
  cltq
  mov    -0x30(%rbp,%rax,4),%eax
  mov    %eax,-0x38(%rbp)
L4:
  addl   $0x1,-0x3c(%rbp)
L46:
  cmpl   $0x6,-0x3c(%rbp)
  jle    L11
  mov    -0x40(%rbp),%eax
  and    $0x1,%eax
  test   %eax,%eax
  jne    L12
  mov    -0x38(%rbp),%eax
  mov    %eax,%esi
  lea    D6(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L12:
  addl   $0x1,-0x40(%rbp)
L42:
  cmpl   $0x6,-0x40(%rbp)
  jle    L3
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L31
  call   <__stack_chk_fail@plt>
L31:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D6
type_infered: string

tool: D6: %d


assistant: ```c
int main() {
  int a[] = {13, 2, 4, 15, 12, 10, 5};
  int answer[7];
  int i = 0;
  int j = 0;
  int prev = 0;
  for (i = 0; i < 7; i++) {
    int large = a[i];
    for (j = 0; j < 7; j++) {
      if (i % 2 == 0) {
        if (a[j] > large) {
          large = a[j];
        }
      }
    }
    if (i % 2 == 0)
      printf("%d\n", large);
  }
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<main>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  movl   $0xd,(%rsp)
  movl   $0x2,0x4(%rsp)
  movl   $0x4,0x8(%rsp)
  movl   $0xf,0xc(%rsp)
  movl   $0xc,0x10(%rsp)
  movl   $0xa,0x14(%rsp)
  movl   $0x5,0x18(%rsp)
  mov    $0x0,%ebx
  lea    D6(%rip),%rbp
  jmp    L3
L18:
  add    $0x4,%rax
  cmp    %rax,%rdi
  je     L6
L8:
  test   %ecx,%ecx
  jne    L18
  mov    (%rax),%edx
  cmp    %edx,%esi
  cmovl  %edx,%esi
  jmp    L18
L6:
  test   $0x1,%bl
  je     L12
L4:
  add    $0x1,%rbx
  cmp    $0x7,%rbx
  je     L71
L3:
  mov    %rsp,%rax
  mov    (%rax,%rbx,4),%esi
  lea    0x1c(%rsp),%rdi
  mov    %ebx,%ecx
  and    $0x1,%ecx
  jmp    L8
L12:
  mov    %rbp,%rdi
  call   <printf@plt>
  jmp    L4
L71:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L89
  mov    $0x0,%eax
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  ret
L89:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_label: D6
datatype: string

tool: D6: %d


assistant: ```c
int main() {
  int a[] = {13, 2, 4, 15, 12, 10, 5};
  int answer[7];
  int i = 0;
  int j = 0;
  int prev = 0;
  for (i = 0; i < 7; i++) {
    int large = a[i];
    for (j = 0; j < 7; j++) {
      if (i % 2 == 0) {
        if (a[j] > large) {
          large = a[j];
        }
      }
    }
    if (i % 2 == 0)
      printf("%d\n", large);
  }
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<main>:
  endbr64
  push   %r13
  mov    $0xd,%esi
  lea    D2(%rip),%r13
  push   %r12
  push   %rbp
  xor    %ebp,%ebp
  push   %rbx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  movabs $0x20000000d,%rax
  movl   $0x5,0x18(%rsp)
  mov    %rsp,%r12
  lea    0x1c(%rsp),%rbx
  mov    %rax,(%rsp)
  movabs $0xf00000004,%rax
  mov    %rax,0x8(%rsp)
  movabs $0xa0000000c,%rax
  mov    %rax,0x10(%rsp)
  cs nopw 0x0(%rax,%rax,1)
L6:
  mov    %ebp,%ecx
  mov    %r12,%rax
  and    $0x1,%ecx
  nopl   0x0(%rax,%rax,1)
L5:
  test   %ecx,%ecx
  jne    L36
  mov    (%rax),%edx
  cmp    %edx,%esi
  cmovl  %edx,%esi
L36:
  add    $0x4,%rax
  cmp    %rbx,%rax
  jne    L5
  test   %ecx,%ecx
  je     L42
  add    $0x1,%rbp
  cmp    $0x7,%rbp
  je     L23
L24:
  mov    (%r12,%rbp,4),%esi
  jmp    L6
  nopl   0x0(%rax,%rax,1)
L42:
  mov    %r13,%rdi
  add    $0x1,%rbp
  call   <printf@plt>
  cmp    $0x7,%rbp
  jne    L24
L23:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L9
  add    $0x38,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L9:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: label: D2
type_guessed: string

tool: D2: %d


assistant: ```c
int main() {
  int a[] = {13, 2, 4, 15, 12, 10, 5};
  int answer[7];
  int i = 0;
  int j = 0;
  int prev = 0;
  for (i = 0; i < 7; i++) {
    int large = a[i];
    for (j = 0; j < 7; j++) {
      if (i % 2 == 0) {
        if (a[j] > large) {
          large = a[j];
        }
      }
    }
    if (i % 2 == 0)
      printf("%d\n", large);
  }
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  push   %rbp
  lea    D9(%rip),%rbp
  push   %rbx
  xor    %ebx,%ebx
  sub    $0x38,%rsp
  movdqa D8(%rip),%xmm0
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  mov    D17(%rip),%rax
  movl   $0x5,0x18(%rsp)
  movaps %xmm0,(%rsp)
  mov    %rax,0x10(%rsp)
  nopl   0x0(%rax,%rax,1)
L21:
  test   $0x1,%bl
  jne    L17
  mov    (%rsp,%rbx,4),%esi
  mov    $0xf,%eax
  mov    %rbp,%rdi
  cmp    %eax,%esi
  cmovl  %eax,%esi
  call   <printf@plt>
L17:
  add    $0x1,%rbx
  cmp    $0x7,%rbx
  jne    L21
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L0
  add    $0x38,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  ret
L0:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: tag: D9
type: string
name: retrieve_data
arguments: tag: D8
type: byte[16]
name: retrieve_data
arguments: tag: D17
type: byte[8]

tool: D9: %d


tool: {"D8": [0x0d,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x0f,0x00,0x00,0x00]}

tool: {"D17": [0x0c,0x00,0x00,0x00,0x0a,0x00,0x00,0x00]}

assistant: ```c
int main() {
  int a[] = {13, 2, 4, 15, 12, 10, 5};
  int answer[7];
  int i = 0;
  int j = 0;
  int prev = 0;
  for (i = 0; i < 7; i++) {
    int large = a[i];
    for (j = 0; j < 7; j++) {
      if (i % 2 == 0) {
        if (a[j] > large) {
          large = a[j];
        }
      }
    }
    if (i % 2 == 0)
      printf("%d\n", large);
  }
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<sort>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x24(%rbp)
  mov    %rsi,-0x30(%rbp)
  cmpl   $0x0,-0x24(%rbp)
  je     L36
  cmpl   $0x1,-0x24(%rbp)
  je     L36
  mov    -0x24(%rbp),%eax
  sar    %eax
  add    $0x1,%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x24(%rbp),%eax
  mov    %eax,-0xc(%rbp)
L60:
  cmpl   $0x1,-0x14(%rbp)
  jle    L10
  subl   $0x1,-0x14(%rbp)
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x4(%rbp)
  jmp    L58
L10:
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x4(%rbp)
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rax,%rdx
  mov    -0x30(%rbp),%rax
  mov    0x4(%rax),%eax
  mov    %eax,(%rdx)
  subl   $0x1,-0xc(%rbp)
  cmpl   $0x1,-0xc(%rbp)
  jne    L58
  mov    -0x30(%rbp),%rax
  lea    0x4(%rax),%rdx
  mov    -0x4(%rbp),%eax
  mov    %eax,(%rdx)
  jmp    L104
L58:
  mov    -0x14(%rbp),%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x14(%rbp),%eax
  add    %eax,%eax
  mov    %eax,-0x10(%rbp)
  jmp    L48
L66:
  mov    -0x10(%rbp),%eax
  cmp    -0xc(%rbp),%eax
  jge    L34
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x10(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,4),%rcx
  mov    -0x30(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  cmp    %eax,%edx
  jge    L34
  addl   $0x1,-0x10(%rbp)
L34:
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0x4(%rbp)
  jge    L27
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    -0x8(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x30(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  mov    -0x10(%rbp),%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x8(%rbp),%eax
  add    %eax,-0x10(%rbp)
  jmp    L48
L27:
  mov    -0xc(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x10(%rbp)
L48:
  mov    -0x10(%rbp),%eax
  cmp    -0xc(%rbp),%eax
  jle    L66
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rax,%rdx
  mov    -0x4(%rbp),%eax
  mov    %eax,(%rdx)
  jmp    L60
L36:
  nop
L104:
  pop    %rbp
  ret
```

assistant: ```c
void sort(int n, int *ra) {
  int l, j, ir, i;
  int rra;
  if (n == 0 || n == 1)
    return;
  l = (n >> 1) + 1;
  ir = n;
  for (;;) {
    if (l > 1)
      rra = ra[--l];
    else {
      rra = ra[ir];
      ra[ir] = ra[1];
      if (--ir == 1) {
        ra[1] = rra;
        return;
      }
    }
    i = l;
    j = l << 1;
    while (j <= ir) {
      if (j < ir && ra[j] < ra[j + 1])
        ++j;
      if (rra < ra[j]) {
        ra[i] = ra[j];
        j += (i = j);
      } else
        j = ir + 1;
    }
    ra[i] = rra;
  }
}
```
user: What is the c source code of the assembly code below:

```asm
<sort>:
  endbr64
  mov    %edi,%edx
  mov    %rsi,%rcx
  cmp    $0x1,%edi
  jbe    L54
  mov    %edi,%r9d
  sar    %r9d
  add    $0x1,%r9d
  jmp    L55
L18:
  movslq %edx,%rax
  lea    (%rcx,%rax,4),%rax
  mov    (%rax),%r8d
  mov    0x4(%rcx),%esi
  mov    %esi,(%rax)
  sub    $0x1,%edx
  cmp    $0x1,%edx
  jne    L74
  mov    %r8d,0x4(%rcx)
  ret
L117:
  movslq %eax,%rsi
  mov    (%rcx,%rsi,4),%esi
  cmp    %r8d,%esi
  jle    L72
  movslq %edi,%rdi
  mov    %esi,(%rcx,%rdi,4)
  mov    %eax,%edi
  add    %eax,%eax
L52:
  cmp    %edx,%eax
  jg     L12
L32:
  cmp    %eax,%edx
  jle    L117
  movslq %eax,%rsi
  mov    0x4(%rcx,%rsi,4),%r10d
  cmp    %r10d,(%rcx,%rsi,4)
  jge    L117
  add    $0x1,%eax
  jmp    L117
L72:
  lea    0x1(%rdx),%eax
  jmp    L52
L73:
  mov    %r9d,%edi
L12:
  movslq %edi,%rdi
  mov    %r8d,(%rcx,%rdi,4)
L55:
  cmp    $0x1,%r9d
  jle    L18
  sub    $0x1,%r9d
  movslq %r9d,%rax
  mov    (%rcx,%rax,4),%r8d
L74:
  lea    (%r9,%r9,1),%eax
  cmp    %eax,%edx
  jl     L73
  mov    %r9d,%edi
  jmp    L32
L54:
  ret
```

assistant: ```c
void sort(int n, int *ra) {
  int l, j, ir, i;
  int rra;
  if (n == 0 || n == 1)
    return;
  l = (n >> 1) + 1;
  ir = n;
  for (;;) {
    if (l > 1)
      rra = ra[--l];
    else {
      rra = ra[ir];
      ra[ir] = ra[1];
      if (--ir == 1) {
        ra[1] = rra;
        return;
      }
    }
    i = l;
    j = l << 1;
    while (j <= ir) {
      if (j < ir && ra[j] < ra[j + 1])
        ++j;
      if (rra < ra[j]) {
        ra[i] = ra[j];
        j += (i = j);
      } else
        j = ir + 1;
    }
    ra[i] = rra;
  }
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<sort>:
  endbr64
  cmp    $0x1,%edi
  jbe    L119
  push   %rbx
  mov    %edi,%ebx
  mov    %rsi,%r8
  sar    %ebx
  add    $0x1,%ebx
  cmp    $0x1,%ebx
  jle    L20
  nopl   (%rax)
L97:
  sub    $0x1,%ebx
  movslq %ebx,%rax
  lea    (%r8,%rax,4),%rsi
  mov    (%rsi),%r10d
L29:
  lea    (%rbx,%rbx,1),%eax
  cmp    %eax,%edi
  jl     L87
  mov    %ebx,%r9d
  jmp    L26
  nopl   0x0(%rax)
L49:
  mov    %eax,%r9d
  add    %eax,%eax
  mov    %ecx,(%rdx)
  cmp    %edi,%eax
  jg     L87
L26:
  movslq %eax,%rdx
  shl    $0x2,%rdx
  lea    (%r8,%rdx,1),%rsi
  mov    (%rsi),%ecx
  cmp    %eax,%edi
  jle    L93
  lea    0x4(%r8,%rdx,1),%rdx
  mov    (%rdx),%r11d
  cmp    %ecx,%r11d
  jle    L93
  add    $0x1,%eax
  mov    %r11d,%ecx
  mov    %rdx,%rsi
L93:
  movslq %r9d,%rdx
  lea    (%r8,%rdx,4),%rdx
  cmp    %ecx,%r10d
  jl     L49
  lea    0x1(%rdi),%eax
  mov    %rdx,%rsi
  cmp    %edi,%eax
  jle    L26
L87:
  mov    %r10d,(%rsi)
  cmp    $0x1,%ebx
  jg     L97
L20:
  movslq %edi,%rax
  mov    0x4(%r8),%edx
  sub    $0x1,%edi
  lea    (%r8,%rax,4),%rax
  mov    (%rax),%r10d
  mov    %edx,(%rax)
  cmp    $0x1,%edi
  je     L101
  movslq %ebx,%rax
  lea    (%r8,%rax,4),%rsi
  jmp    L29
L101:
  mov    %r10d,0x4(%r8)
  pop    %rbx
  ret
L119:
  ret
```

assistant: ```c
void sort(int n, int *ra) {
  int l, j, ir, i;
  int rra;
  if (n == 0 || n == 1)
    return;
  l = (n >> 1) + 1;
  ir = n;
  for (;;) {
    if (l > 1)
      rra = ra[--l];
    else {
      rra = ra[ir];
      ra[ir] = ra[1];
      if (--ir == 1) {
        ra[1] = rra;
        return;
      }
    }
    i = l;
    j = l << 1;
    while (j <= ir) {
      if (j < ir && ra[j] < ra[j + 1])
        ++j;
      if (rra < ra[j]) {
        ra[i] = ra[j];
        j += (i = j);
      } else
        j = ir + 1;
    }
    ra[i] = rra;
  }
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<sort>:
  endbr64
  mov    %edi,%r9d
  cmp    $0x1,%edi
  jbe    L22
  mov    %r9d,%r11d
  push   %r14
  mov    %rsi,%rdi
  sar    %r11d
  push   %r13
  add    $0x1,%r11d
  push   %r12
  push   %rbp
  push   %rbx
  cmp    $0x1,%r11d
  jle    L20
  nop
L76:
  lea    -0x1(%r11),%ebx
  movslq %ebx,%rax
  lea    (%rbx,%rbx,1),%ebp
  mov    (%rdi,%rax,4),%r10d
  cmp    %ebp,%r9d
  jl     L17
L36:
  mov    %ebx,%ecx
  mov    %ebp,%edx
  nopl   0x0(%rax,%rax,1)
L79:
  movslq %edx,%rax
  shl    $0x2,%rax
  lea    (%rdi,%rax,1),%r8
  mov    (%r8),%esi
  cmp    %r9d,%edx
  jge    L105
  lea    0x4(%rdi,%rax,1),%rax
  mov    (%rax),%r12d
  cmp    %esi,%r12d
  jle    L105
  add    $0x1,%edx
  mov    %r12d,%esi
  mov    %rax,%r8
L105:
  movslq %ecx,%rax
  lea    (%rdi,%rax,4),%rax
  cmp    %esi,%r10d
  jl     L21
L94:
  mov    %r10d,(%rax)
  cmp    $0x1,%r11d
  jg     L17
L40:
  movslq %r9d,%rax
  mov    0x4(%rdi),%ecx
  lea    (%rdi,%rax,4),%rdx
  lea    -0x1(%r9),%eax
  mov    (%rdx),%r10d
  mov    %ecx,(%rdx)
  cmp    $0x2,%r9d
  jne    1040 <sort.cold>
L96:
  mov    %r10d,0x4(%rdi)
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax,%rax,1)
L21:
  mov    %esi,(%rax)
  lea    (%rdx,%rdx,1),%eax
  cmp    %r9d,%eax
  jg     L66
  mov    %edx,%ecx
  mov    %eax,%edx
  jmp    L79
L17:
  mov    %ebx,%r11d
  cmp    $0x1,%r11d
  jg     L76
L20:
  movslq %r9d,%rax
  mov    0x4(%rdi),%edx
  sub    $0x1,%r9d
  lea    (%rdi,%rax,4),%rax
  mov    (%rax),%r10d
  mov    %edx,(%rax)
  cmp    $0x1,%r9d
  je     L96
  movslq %r11d,%rax
  lea    (%r11,%r11,1),%ebp
  lea    (%rdi,%rax,4),%rax
  cmp    %r9d,%ebp
  jg     L14
  mov    %r11d,%ebx
  jmp    L36
  xchg   %ax,%ax
L66:
  mov    %r8,%rax
  jmp    L94
L14:
  mov    %r10d,(%rax)
  mov    %r11d,%ebx
  jmp    L40
L22:
  ret
```

assistant: ```c
void sort(int n, int *ra) {
  int l, j, ir, i;
  int rra;
  if (n == 0 || n == 1)
    return;
  l = (n >> 1) + 1;
  ir = n;
  for (;;) {
    if (l > 1)
      rra = ra[--l];
    else {
      rra = ra[ir];
      ra[ir] = ra[1];
      if (--ir == 1) {
        ra[1] = rra;
        return;
      }
    }
    i = l;
    j = l << 1;
    while (j <= ir) {
      if (j < ir && ra[j] < ra[j + 1])
        ++j;
      if (rra < ra[j]) {
        ra[i] = ra[j];
        j += (i = j);
      } else
        j = ir + 1;
    }
    ra[i] = rra;
  }
}
```