ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 下面的汇编指令对应的C源代码是什么：

```asm
<benchmark>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x28,%rsp
  mov    %edi,%r14d
  mov    %esi,-0x44(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  mov    %esi,%eax
  cltq
  shl    $0x3,%rax
  lea    0xf(%rax),%rdx
  mov    %rdx,%rsi
  and    $0xfffffffffffffff0,%rsi
  and    $0xfffffffffffff000,%rdx
  mov    %rsp,%rcx
  sub    %rdx,%rcx
L136:
  cmp    %rcx,%rsp
  je     L108
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L136
L108:
  mov    %rsi,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  je     L75
  orq    $0x0,-0x8(%rsp,%rdx,1)
L75:
  mov    %rsp,%r13
  add    $0xf,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffffff0,%rcx
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rdx
  sub    %rax,%rdx
L43:
  cmp    %rdx,%rsp
  je     L67
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L43
L67:
  mov    %rcx,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L105
  orq    $0x0,-0x8(%rsp,%rax,1)
L105:
  lea    0x7(%rsp),%r12
  mov    %r12,%rax
  shr    $0x3,%rax
  mov    %rax,-0x50(%rbp)
  and    $0xfffffffffffffff8,%r12
  mov    -0x44(%rbp),%eax
  test   %eax,%eax
  jle    L146
  mov    %eax,%r15d
  mov    $0x0,%ebx
L8:
  mov    D0(%rip),%rax
  movq   %rax,%xmm1
  pxor   %xmm0,%xmm0
  call   <rand_uniform@plt>
  movsd  %xmm0,0x0(%r13,%rbx,8)
  movq   $0x0,(%r12,%rbx,8)
  add    $0x1,%rbx
  cmp    %r15,%rbx
  jne    L8
L146:
  mov    $0x0,%eax
  call   <tic@plt>
  movq   %xmm0,%r15
  test   %r14d,%r14d
  jle    L144
  mov    $0x0,%ebx
L102:
  mov    $0x1,%r8d
  mov    %r12,%rcx
  mov    $0x1,%edx
  mov    %r13,%rsi
  mov    -0x44(%rbp),%edi
  call   <stdlib_strided_drsqrt@plt>
  movsd  (%r12),%xmm0
  ucomisd %xmm0,%xmm0
  jp     L1
  add    $0x1,%ebx
  cmp    %ebx,%r14d
  jne    L102
  jmp    L144
L1:
  lea    D14(%rip),%rdi
  call   <printf@plt>
L144:
  mov    $0x0,%eax
  call   <tic@plt>
  movq   %r15,%xmm2
  subsd  %xmm2,%xmm0
  movq   %xmm0,%rbx
  mov    -0x50(%rbp),%rax
  movsd  0x0(,%rax,8),%xmm0
  ucomisd %xmm0,%xmm0
  jp     L60
L64:
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L7
  movq   %rbx,%xmm0
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L60:
  lea    D14(%rip),%rdi
  call   <printf@plt>
  jmp    L64
L7:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: label: D0
type_guessed: f64
name: extract_symbolic_data
arguments: label: D14
type_guessed: string

tool: D0: 200

tool: D14: should not return NaN


assistant: ```c
double benchmark(int iterations, int len) {
  double elapsed;
  double x[len];
  double y[len];
  double t;
  int i;
  for (i = 0; i < len; i++) {
    x[i] = rand_uniform(0.0, 200.0);
    y[i] = 0.0;
  }
  t = tic();
  for (i = 0; i < iterations; i++) {
    stdlib_strided_drsqrt(len, x, 1, y, 1);
    if (y[0] != y[0]) {
      printf("should not return NaN\n");
      break;
    }
  }
  elapsed = tic() - t;
  if (y[0] != y[0]) {
    printf("should not return NaN\n");
  }
  return elapsed;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<zret>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  lea    D8(%rip),%rax
  mov    %rax,%rdi
  call   <ol@plt>
  mov    $0x0,%eax
  call   <nl@plt>
  mov    $0x0,%eax
  call   <nl@plt>
  nop
  pop    %rbp
  ret
```

tool_calls: name: disassemble_data
arguments: data_tag: D8
data_type: string

tool: D8: ret

assistant: ```c
void zret(void) {
  ol("ret");
  nl();
  nl();
}
```
user: Translate the below assembly code into C programming language:

```asm
<zret>:
  endbr64
  sub    $0x8,%rsp
  lea    D5(%rip),%rdi
  call   <ol@plt>
  mov    $0x0,%eax
  call   <nl@plt>
  mov    $0x0,%eax
  call   <nl@plt>
  add    $0x8,%rsp
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D5
datatype: string

tool: D5: ret

assistant: ```c
void zret(void) {
  ol("ret");
  nl();
  nl();
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<zret>:
  endbr64
  sub    $0x8,%rsp
  lea    D1(%rip),%rdi
  call   <ol@plt>
  xor    %eax,%eax
  call   <nl@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  jmp    1060 <nl@plt>
```

tool_calls: name: parse_data
arguments: label: D1
data_type: string

tool: D1: ret

assistant: ```c
void zret(void) {
  ol("ret");
  nl();
  nl();
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<zret>:
  endbr64
  sub    $0x8,%rsp
  lea    D6(%rip),%rdi
  call   <ol@plt>
  xor    %eax,%eax
  call   <nl@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  jmp    1060 <nl@plt>
```

tool_calls: name: disassemble_data
arguments: data_tag: D6
data_type: string

tool: D6: ret

assistant: ```c
void zret(void) {
  ol("ret");
  nl();
  nl();
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  movl   $0xffffffff,-0x8(%rbp)
L53:
  mov    $0x0,%eax
  call   <__VERIFIER_nondet_int@plt>
  mov    %eax,-0x4(%rbp)
  cmpl   $0x1,-0x4(%rbp)
  je     L69
  cmpl   $0x3,-0x4(%rbp)
  je     L69
  cmpl   $0x4,-0x4(%rbp)
  je     L69
  cmpl   $0x5,-0x4(%rbp)
  je     L69
  cmpl   $0x6,-0x4(%rbp)
  je     L69
  mov    $0xfffffffe,%eax
  jmp    L0
L69:
  mov    -0x4(%rbp),%eax
  mov    %eax,%edi
  call   <calculate_output@plt>
  mov    %eax,-0x8(%rbp)
  jmp    L53
L0:
  leave
  ret
```

assistant: ```c
int main() {
  int output = -1;
  while (1) {
    int input;
    input = __VERIFIER_nondet_int();
    if ((input != 1) && (input != 3) && (input != 4) && (input != 5) && (input != 6))
      return -2;
    output = calculate_output(input);
  }
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  jmp    L29
L23:
  call   <calculate_output@plt>
L29:
  mov    $0x0,%eax
  call   <__VERIFIER_nondet_int@plt>
  mov    %eax,%edi
  lea    -0x3(%rax),%eax
  cmp    $0x3,%eax
  jbe    L23
  cmp    $0x1,%edi
  je     L23
  mov    $0xfffffffe,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int main() {
  int output = -1;
  while (1) {
    int input;
    input = __VERIFIER_nondet_int();
    if ((input != 1) && (input != 3) && (input != 4) && (input != 5) && (input != 6))
      return -2;
    output = calculate_output(input);
  }
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  nopl   0x0(%rax,%rax,1)
L21:
  xor    %eax,%eax
  call   <__VERIFIER_nondet_int@plt>
  mov    %eax,%edi
  sub    $0x3,%eax
  cmp    $0x3,%eax
  jbe    L26
  cmp    $0x1,%edi
  je     L26
  mov    $0xfffffffe,%eax
  add    $0x8,%rsp
  ret
L26:
  call   <calculate_output@plt>
  jmp    L21
```

assistant: ```c
int main() {
  int output = -1;
  while (1) {
    int input;
    input = __VERIFIER_nondet_int();
    if ((input != 1) && (input != 3) && (input != 4) && (input != 5) && (input != 6))
      return -2;
    output = calculate_output(input);
  }
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  nopl   0x0(%rax,%rax,1)
L7:
  xor    %eax,%eax
  call   <__VERIFIER_nondet_int@plt>
  mov    %eax,%edi
  sub    $0x3,%eax
  cmp    $0x3,%eax
  jbe    L27
  cmp    $0x1,%edi
  je     L27
  mov    $0xfffffffe,%eax
  add    $0x8,%rsp
  ret
L27:
  call   <calculate_output@plt>
  jmp    L7
```

assistant: ```c
int main() {
  int output = -1;
  while (1) {
    int input;
    input = __VERIFIER_nondet_int();
    if ((input != 1) && (input != 3) && (input != 4) && (input != 5) && (input != 6))
      return -2;
    output = calculate_output(input);
  }
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    $0x0,%eax
  call   <helloWorld@plt>
  mov    $0x0,%eax
  pop    %rbp
  ret
```

assistant: ```c
int main(void) {
  helloWorld();
  return 0;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x0,%eax
  call   <helloWorld@plt>
  mov    $0x0,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int main(void) {
  helloWorld();
  return 0;
}
```
user: What is the c source code of the assembly code below:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  xor    %eax,%eax
  call   <helloWorld@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int main(void) {
  helloWorld();
  return 0;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  xor    %eax,%eax
  call   <helloWorld@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int main(void) {
  helloWorld();
  return 0;
}
```
user: What is the c source code of the assembly code below:

```asm
<fscanner>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  movl   $0x0,-0x10(%rbp)
  movl   $0x0,-0x8(%rbp)
  movl   $0x0,-0x4(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  sub    $0x1,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rsi
  lea    D9(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movl   $0x0,-0x10(%rbp)
  jmp    L28
L12:
  mov    -0x10(%rbp),%eax
  mov    %eax,-0xc(%rbp)
  jmp    L41
L16:
  mov    -0xc(%rbp),%eax
  cmp    -0x10(%rbp),%eax
  jl     L22
  mov    -0xc(%rbp),%edx
  mov    -0x10(%rbp),%ecx
  mov    -0x18(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <stringxy@plt>
L22:
  addl   $0x1,-0x8(%rbp)
  addl   $0x1,-0xc(%rbp)
L41:
  mov    -0xc(%rbp),%eax
  cmp    -0x4(%rbp),%eax
  jle    L16
  addl   $0x1,-0x10(%rbp)
L28:
  mov    -0x10(%rbp),%eax
  cmp    -0x4(%rbp),%eax
  jle    L12
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    -0x8(%rbp),%eax
  mov    %eax,%esi
  lea    D2(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%eax
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: tag: D9
type_infered: string
name: extract_symbolic_data
arguments: tag: D2
type_infered: string

tool: D9: 
forward scan %s

tool: D2: count = %d


assistant: ```c
int fscanner(char *string) {
  int i = 0, j, k, ctr = 0;
  int length = 0;
  length = strlen(string) - 1;
  printf("\nforward scan %s", string);
  for (i = 0; i <= length; i++)
    for (j = i; j <= length; j++) {
      if (j >= i)
        stringxy(string, i, j);
      ctr++;
    }
  printf("\n");
  printf("count = %d\n", ctr);
  return (0);
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<fscanner>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%r13
  call   <strlen@plt>
  mov    %eax,%r12d
  lea    -0x1(%rax),%r15d
  mov    %r13,%rsi
  lea    D6(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%r14d
  mov    $0x0,%ebp
  test   %r15d,%r15d
  jns    L43
L40:
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    %r14d,%esi
  lea    D1(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L45:
  add    $0x1,%ebx
  cmp    %ebx,%r12d
  je     L32
L27:
  cmp    %ebx,%ebp
  jg     L45
  mov    %ebx,%edx
  mov    %ebp,%esi
  mov    %r13,%rdi
  call   <stringxy@plt>
  jmp    L45
L32:
  add    %ebx,%r14d
  sub    %ebp,%r14d
L28:
  add    $0x1,%ebp
  cmp    %ebp,%r12d
  je     L40
L43:
  mov    %ebp,%ebx
  cmp    %ebp,%r15d
  jge    L27
  jmp    L28
```

tool_calls: name: retrieve_data
arguments: label: D6
type_guessed: string
name: retrieve_data
arguments: label: D1
type_guessed: string

tool: D6: 
forward scan %s

tool: D1: count = %d


assistant: ```c
int fscanner(char *string) {
  int i = 0, j, k, ctr = 0;
  int length = 0;
  length = strlen(string) - 1;
  printf("\nforward scan %s", string);
  for (i = 0; i <= length; i++)
    for (j = i; j <= length; j++) {
      if (j >= i)
        stringxy(string, i, j);
      ctr++;
    }
  printf("\n");
  printf("count = %d\n", ctr);
  return (0);
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<fscanner>:
  endbr64
  push   %r15
  push   %r14
  xor    %r14d,%r14d
  push   %r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  call   <strlen@plt>
  mov    %r12,%rsi
  lea    D18(%rip),%rdi
  mov    %eax,%r13d
  lea    -0x1(%rax),%ebp
  xor    %eax,%eax
  call   <printf@plt>
  test   %ebp,%ebp
  js     L20
  xor    %r15d,%r15d
  nopl   0x0(%rax,%rax,1)
L2:
  mov    %r15d,%ebx
  nopl   0x0(%rax,%rax,1)
L29:
  mov    %ebx,%edx
  mov    %r15d,%esi
  mov    %r12,%rdi
  add    $0x1,%ebx
  call   <stringxy@plt>
  cmp    %ebx,%ebp
  jge    L29
  mov    %ebp,%eax
  xor    %ecx,%ecx
  sub    %r15d,%eax
  cmp    %r15d,%r13d
  cmovle %ecx,%eax
  add    $0x1,%r15d
  lea    0x1(%r14,%rax,1),%r14d
  cmp    %r15d,%r13d
  jne    L2
L20:
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    %r14d,%esi
  lea    D0(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: disassemble_data
arguments: data_label: D18
data_type: string
name: disassemble_data
arguments: data_label: D0
data_type: string

tool: D18: 
forward scan %s

tool: D0: count = %d


assistant: ```c
int fscanner(char *string) {
  int i = 0, j, k, ctr = 0;
  int length = 0;
  length = strlen(string) - 1;
  printf("\nforward scan %s", string);
  for (i = 0; i <= length; i++)
    for (j = i; j <= length; j++) {
      if (j >= i)
        stringxy(string, i, j);
      ctr++;
    }
  printf("\n");
  printf("count = %d\n", ctr);
  return (0);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<fscanner>:
  endbr64
  push   %r15
  push   %r14
  xor    %r14d,%r14d
  push   %r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  call   <strlen@plt>
  mov    %r12,%rsi
  lea    D5(%rip),%rdi
  mov    %eax,%r13d
  lea    -0x1(%rax),%ebp
  xor    %eax,%eax
  call   <printf@plt>
  test   %ebp,%ebp
  js     L25
  xor    %r15d,%r15d
  nopl   0x0(%rax,%rax,1)
L12:
  mov    %r15d,%ebx
  nopl   0x0(%rax,%rax,1)
L28:
  mov    %ebx,%edx
  mov    %r15d,%esi
  mov    %r12,%rdi
  add    $0x1,%ebx
  call   <stringxy@plt>
  cmp    %ebx,%ebp
  jge    L28
  mov    %ebp,%eax
  xor    %ecx,%ecx
  sub    %r15d,%eax
  cmp    %r15d,%r13d
  cmovle %ecx,%eax
  add    $0x1,%r15d
  lea    0x1(%r14,%rax,1),%r14d
  cmp    %r15d,%r13d
  jne    L12
L25:
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    %r14d,%esi
  lea    D14(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D5
type_infered: string
name: retrieve_data
arguments: data_label: D14
type_infered: string

tool: D5: 
forward scan %s

tool: D14: count = %d


assistant: ```c
int fscanner(char *string) {
  int i = 0, j, k, ctr = 0;
  int length = 0;
  length = strlen(string) - 1;
  printf("\nforward scan %s", string);
  for (i = 0; i <= length; i++)
    for (j = i; j <= length; j++) {
      if (j >= i)
        stringxy(string, i, j);
      ctr++;
    }
  printf("\n");
  printf("count = %d\n", ctr);
  return (0);
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<fill_comm_schedule>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %esi,-0x2c(%rbp)
  mov    -0x2c(%rbp),%eax
  and    $0x1,%eax
  test   %eax,%eax
  jne    L38
  mov    -0x2c(%rbp),%eax
  mov    %eax,-0xc(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L6
L40:
  mov    -0x14(%rbp),%edx
  mov    -0x14(%rbp),%ecx
  mov    -0x28(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <add_pair_to_comm_schedule@plt>
  addl   $0x1,-0x14(%rbp)
L6:
  mov    -0x14(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jl     L40
  jmp    L5
L38:
  mov    -0x2c(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0xc(%rbp)
L5:
  movl   $0x0,-0x14(%rbp)
  jmp    L109
L46:
  mov    -0x2c(%rbp),%eax
  and    $0x1,%eax
  test   %eax,%eax
  jne    L96
  mov    -0x2c(%rbp),%eax
  sub    $0x1,%eax
  jmp    L11
L96:
  mov    -0x14(%rbp),%eax
L11:
  mov    -0x14(%rbp),%esi
  mov    -0x28(%rbp),%rcx
  mov    %eax,%edx
  mov    %rcx,%rdi
  call   <add_pair_to_comm_schedule@plt>
  movl   $0x1,-0x10(%rbp)
  jmp    L95
L16:
  mov    -0x14(%rbp),%eax
  sub    -0x10(%rbp),%eax
  mov    %eax,-0x8(%rbp)
  cmpl   $0x0,-0x8(%rbp)
  jns    L25
  mov    -0xc(%rbp),%eax
  sub    $0x1,%eax
  add    %eax,-0x8(%rbp)
L25:
  mov    -0x14(%rbp),%edx
  mov    -0x10(%rbp),%eax
  add    %edx,%eax
  mov    -0xc(%rbp),%edx
  lea    -0x1(%rdx),%ecx
  cltd
  idiv   %ecx
  mov    %edx,-0x4(%rbp)
  mov    -0x4(%rbp),%edx
  mov    -0x8(%rbp),%ecx
  mov    -0x28(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <add_pair_to_comm_schedule@plt>
  addl   $0x1,-0x10(%rbp)
L95:
  mov    -0xc(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  cmp    %eax,-0x10(%rbp)
  jl     L16
  addl   $0x1,-0x14(%rbp)
L109:
  mov    -0xc(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x14(%rbp)
  jl     L46
  nop
  nop
  leave
  ret
```

assistant: ```c
void fill_comm_schedule(int **sched, int npes) {
  int pe, i, n;
  if (npes % 2 == 0) {
    n = npes;
    for (pe = 0; pe < npes; ++pe)
      add_pair_to_comm_schedule(sched, pe, pe);
  } else
    n = npes + 1;
  for (pe = 0; pe < n - 1; ++pe) {
    add_pair_to_comm_schedule(sched, pe, npes % 2 == 0 ? npes - 1 : pe);
    for (i = 1; i < n / 2; ++i) {
      int pe_a, pe_b;
      pe_a = pe - i;
      if (pe_a < 0)
        pe_a += n - 1;
      pe_b = (pe + i) % (n - 1);
      add_pair_to_comm_schedule(sched, pe_a, pe_b);
    }
  }
}
```
user: What is the c source code of the assembly code below:

```asm
<fill_comm_schedule>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%r13
  mov    %esi,%ebx
  lea    0x1(%rsi),%eax
  mov    %eax,0x4(%rsp)
  mov    %esi,%eax
  and    $0x1,%eax
  mov    %eax,0x8(%rsp)
  jne    L26
  test   %esi,%esi
  jle    L35
  mov    $0x0,%ebp
L60:
  mov    %ebp,%edx
  mov    %ebp,%esi
  mov    %r13,%rdi
  call   <add_pair_to_comm_schedule@plt>
  add    $0x1,%ebp
  cmp    %ebp,%ebx
  jne    L60
  mov    %ebx,0x4(%rsp)
L26:
  mov    0x4(%rsp),%eax
  lea    -0x1(%rax),%r12d
  test   %r12d,%r12d
  jle    L39
  mov    %eax,%r15d
  shr    $0x1f,%r15d
  add    %eax,%r15d
  sar    %r15d
  mov    %r12d,%r14d
  mov    $0x0,%ebp
  lea    -0x1(%rbx),%eax
  mov    %eax,0xc(%rsp)
  jmp    L36
L35:
  mov    %esi,0x4(%rsp)
  jmp    L26
L25:
  lea    (%r14,%rbp,1),%eax
  sub    %ebx,%eax
  mov    %ebp,%esi
  sub    %ebx,%esi
  cmovs  %eax,%esi
  mov    (%rsp),%eax
  add    %ebx,%eax
  cltd
  idiv   %r12d
  mov    %r13,%rdi
  call   <add_pair_to_comm_schedule@plt>
  add    $0x1,%ebx
  cmp    %r15d,%ebx
  jl     L25
L58:
  add    $0x1,%ebp
  cmp    %r14d,%ebp
  je     L39
L36:
  cmpl   $0x0,0x8(%rsp)
  mov    0xc(%rsp),%edx
  cmovne %ebp,%edx
  mov    %ebp,%esi
  mov    %r13,%rdi
  call   <add_pair_to_comm_schedule@plt>
  cmpl   $0x3,0x4(%rsp)
  jle    L58
  mov    $0x1,%ebx
  mov    %ebp,(%rsp)
  jmp    L25
L39:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void fill_comm_schedule(int **sched, int npes) {
  int pe, i, n;
  if (npes % 2 == 0) {
    n = npes;
    for (pe = 0; pe < npes; ++pe)
      add_pair_to_comm_schedule(sched, pe, pe);
  } else
    n = npes + 1;
  for (pe = 0; pe < n - 1; ++pe) {
    add_pair_to_comm_schedule(sched, pe, npes % 2 == 0 ? npes - 1 : pe);
    for (i = 1; i < n / 2; ++i) {
      int pe_a, pe_b;
      pe_a = pe - i;
      if (pe_a < 0)
        pe_a += n - 1;
      pe_b = (pe + i) % (n - 1);
      add_pair_to_comm_schedule(sched, pe_a, pe_b);
    }
  }
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<fill_comm_schedule>:
  endbr64
  push   %r15
  mov    %esi,%ecx
  mov    %esi,%r15d
  push   %r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  and    $0x1,%ecx
  mov    %ecx,0x4(%rsp)
  jne    L52
  lea    -0x1(%rsi),%ebx
  test   %esi,%esi
  jle    L39
  xor    %ebp,%ebp
L7:
  mov    %ebp,%edx
  mov    %ebp,%esi
  mov    %r13,%rdi
  add    $0x1,%ebp
  call   <add_pair_to_comm_schedule@plt>
  cmp    %ebp,%r15d
  jne    L7
L39:
  mov    %r15d,%r14d
L11:
  test   %ebx,%ebx
  jle    L45
  lea    (%rbx,%rbx,1),%eax
  sar    %r14d
  xor    %r12d,%r12d
  mov    %eax,0x8(%rsp)
  mov    %r15d,%eax
  mov    %r14d,%ebp
  sub    $0x1,%eax
  neg    %ebp
  mov    %eax,0xc(%rsp)
  nopl   0x0(%rax,%rax,1)
L71:
  mov    0x4(%rsp),%eax
  mov    0xc(%rsp),%edx
  lea    0x0(%rbp,%r14,1),%esi
  mov    %r13,%rdi
  lea    -0x1(%r14,%rbp,1),%r15d
  test   %eax,%eax
  cmovne %esi,%edx
  call   <add_pair_to_comm_schedule@plt>
  cmp    $0x1,%r14d
  jle    L24
  nopl   (%rax)
L75:
  test   %r15d,%r15d
  lea    (%r15,%rbx,1),%esi
  mov    %r12d,%eax
  mov    %r13,%rdi
  cmovns %r15d,%esi
  sub    %r15d,%eax
  sub    $0x1,%r15d
  cltd
  idiv   %ebx
  call   <add_pair_to_comm_schedule@plt>
  cmp    %ebp,%r15d
  jne    L75
L24:
  add    $0x2,%r12d
  add    $0x1,%ebp
  cmp    0x8(%rsp),%r12d
  jne    L71
L45:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L52:
  mov    %esi,%ebx
  lea    0x1(%rsi),%r14d
  jmp    L11
```

assistant: ```c
void fill_comm_schedule(int **sched, int npes) {
  int pe, i, n;
  if (npes % 2 == 0) {
    n = npes;
    for (pe = 0; pe < npes; ++pe)
      add_pair_to_comm_schedule(sched, pe, pe);
  } else
    n = npes + 1;
  for (pe = 0; pe < n - 1; ++pe) {
    add_pair_to_comm_schedule(sched, pe, npes % 2 == 0 ? npes - 1 : pe);
    for (i = 1; i < n / 2; ++i) {
      int pe_a, pe_b;
      pe_a = pe - i;
      if (pe_a < 0)
        pe_a += n - 1;
      pe_b = (pe + i) % (n - 1);
      add_pair_to_comm_schedule(sched, pe_a, pe_b);
    }
  }
}
```