ylfeng/ReF-Decompile-dataset huggingface dataset:
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<tower>:
  endbr64
  test   %edi,%edi
  jg     L9
  ret
L9:
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %esi,%r12d
  mov    %edx,%ebp
  mov    %ecx,%r13d
  lea    -0x1(%rdi),%ebx
  mov    %edx,%ecx
  mov    %r13d,%edx
  mov    %ebx,%edi
  call   <tower>
  mov    %ebp,%edx
  mov    %r12d,%esi
  lea    D1(%rip),%rdi
  call   <printf@plt>
  mov    %r12d,%ecx
  mov    %ebp,%edx
  mov    %r13d,%esi
  mov    %ebx,%edi
  call   <tower>
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

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

tool: D1: Moved top disk from %d to %d.


assistant: ```c
void tower(int num, int sourceTower, int destinationTower, int storageTower) {
  if (num > 0) {
    tower(num - 1, sourceTower, storageTower, destinationTower);
    printf("Moved top disk from %d to %d.\n", sourceTower, destinationTower);
    tower(num - 1, storageTower, destinationTower, sourceTower);
  }
}
```
user: Translate the below assembly code into C programming language:

```asm
<gencalr>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    $0x0,%eax
  call   <gentext@plt>
  mov    $0x0,%eax
  call   <commit@plt>
  mov    $0x0,%eax
  call   <cgcalr@plt>
  mov    $0x0,%eax
  call   <load@plt>
  nop
  pop    %rbp
  ret
```

assistant: ```c
void gencalr(void) {
  gentext();
  commit();
  cgcalr();
  load();
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<gencalr>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x0,%eax
  call   <gentext@plt>
  mov    $0x0,%eax
  call   <commit@plt>
  mov    $0x0,%eax
  call   <cgcalr@plt>
  mov    $0x0,%eax
  call   <load@plt>
  add    $0x8,%rsp
  ret
```

assistant: ```c
void gencalr(void) {
  gentext();
  commit();
  cgcalr();
  load();
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<gencalr>:
  endbr64
  sub    $0x8,%rsp
  xor    %eax,%eax
  call   <gentext@plt>
  xor    %eax,%eax
  call   <commit@plt>
  xor    %eax,%eax
  call   <cgcalr@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  jmp    10b0 <load@plt>
```

assistant: ```c
void gencalr(void) {
  gentext();
  commit();
  cgcalr();
  load();
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<gencalr>:
  endbr64
  sub    $0x8,%rsp
  xor    %eax,%eax
  call   <gentext@plt>
  xor    %eax,%eax
  call   <commit@plt>
  xor    %eax,%eax
  call   <cgcalr@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  jmp    10b0 <load@plt>
```

assistant: ```c
void gencalr(void) {
  gentext();
  commit();
  cgcalr();
  load();
}
```
user: Translate the below assembly code into C programming language:

```asm
<quaddobl_laursys_solver>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    $0x0,%eax
  call   <syscon_read_quaddobl_Laurent_system@plt>
  mov    %eax,-0xc(%rbp)
  lea    -0x24(%rbp),%rax
  mov    %rax,%rdi
  call   <syscon_number_of_quaddobl_Laurentials@plt>
  mov    %eax,-0xc(%rbp)
  mov    -0x24(%rbp),%eax
  mov    %eax,%esi
  lea    D3(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  lea    -0x10(%rbp),%rdi
  lea    -0x14(%rbp),%rcx
  lea    -0x18(%rbp),%rdx
  lea    -0x1c(%rbp),%rsi
  lea    -0x20(%rbp),%rax
  mov    %rdi,%r8
  mov    %rax,%rdi
  call   <read_solver_options@plt>
  lea    D18(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    -0x10(%rbp),%edi
  mov    -0x14(%rbp),%ecx
  mov    -0x18(%rbp),%edx
  mov    -0x1c(%rbp),%esi
  mov    -0x20(%rbp),%eax
  mov    %edi,%r8d
  mov    %eax,%edi
  call   <quaddobl_laursys_solve@plt>
  mov    %eax,-0xc(%rbp)
  mov    -0x1c(%rbp),%eax
  mov    %eax,%edi
  call   <quaddobl_laursys_write@plt>
  mov    %eax,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L8
  call   <__stack_chk_fail@plt>
L8:
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: label: D3
data_type: string
name: retrieve_data
arguments: label: D18
data_type: string

tool: D3: -> read %d polynomials


tool: D18: 
Calling the solver ...


assistant: ```c
int quaddobl_laursys_solver(void) {
  int fail, nbq, nbtasks, topdim, filter, factor, verbose;
  fail = syscon_read_quaddobl_Laurent_system();
  fail = syscon_number_of_quaddobl_Laurentials(&nbq);
  printf("-> read %d polynomials\n", nbq);
  printf("\n");
  read_solver_options(&nbtasks, &topdim, &filter, &factor, &verbose);
  printf("\nCalling the solver ...\n\n");
  fail = quaddobl_laursys_solve(nbtasks, topdim, filter, factor, verbose);
  fail = quaddobl_laursys_write(topdim);
  return fail;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<quaddobl_laursys_solver>:
  endbr64
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  call   <syscon_read_quaddobl_Laurent_system@plt>
  mov    %rsp,%rdi
  call   <syscon_number_of_quaddobl_Laurentials@plt>
  mov    (%rsp),%esi
  lea    D13(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  lea    0x10(%rsp),%rcx
  lea    0xc(%rsp),%rdx
  lea    0x8(%rsp),%rsi
  lea    0x4(%rsp),%rdi
  lea    0x14(%rsp),%r8
  call   <read_solver_options@plt>
  lea    D6(%rip),%rdi
  call   <puts@plt>
  mov    0x14(%rsp),%r8d
  mov    0x10(%rsp),%ecx
  mov    0xc(%rsp),%edx
  mov    0x8(%rsp),%esi
  mov    0x4(%rsp),%edi
  call   <quaddobl_laursys_solve@plt>
  mov    0x8(%rsp),%edi
  call   <quaddobl_laursys_write@plt>
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L4
  add    $0x28,%rsp
  ret
L4:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: tag: D13
data_type: string
name: disassemble_data
arguments: tag: D6
data_type: string

tool: D13: -> read %d polynomials


tool: D6: 
Calling the solver ...


assistant: ```c
int quaddobl_laursys_solver(void) {
  int fail, nbq, nbtasks, topdim, filter, factor, verbose;
  fail = syscon_read_quaddobl_Laurent_system();
  fail = syscon_number_of_quaddobl_Laurentials(&nbq);
  printf("-> read %d polynomials\n", nbq);
  printf("\n");
  read_solver_options(&nbtasks, &topdim, &filter, &factor, &verbose);
  printf("\nCalling the solver ...\n\n");
  fail = quaddobl_laursys_solve(nbtasks, topdim, filter, factor, verbose);
  fail = quaddobl_laursys_write(topdim);
  return fail;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<quaddobl_laursys_solver>:
  endbr64
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  call   <syscon_read_quaddobl_Laurent_system@plt>
  mov    %rsp,%rdi
  call   <syscon_number_of_quaddobl_Laurentials@plt>
  mov    (%rsp),%esi
  lea    D14(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  lea    0x10(%rsp),%rcx
  lea    0xc(%rsp),%rdx
  lea    0x8(%rsp),%rsi
  lea    0x14(%rsp),%r8
  lea    0x4(%rsp),%rdi
  call   <read_solver_options@plt>
  lea    D8(%rip),%rdi
  call   <puts@plt>
  mov    0xc(%rsp),%edx
  mov    0x4(%rsp),%edi
  mov    0x14(%rsp),%r8d
  mov    0x10(%rsp),%ecx
  mov    0x8(%rsp),%esi
  call   <quaddobl_laursys_solve@plt>
  mov    0x8(%rsp),%edi
  call   <quaddobl_laursys_write@plt>
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L3
  add    $0x28,%rsp
  ret
L3:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D14
datatype: string
name: extract_symbolic_data
arguments: data_tag: D8
datatype: string

tool: D14: -> read %d polynomials


tool: D8: 
Calling the solver ...


assistant: ```c
int quaddobl_laursys_solver(void) {
  int fail, nbq, nbtasks, topdim, filter, factor, verbose;
  fail = syscon_read_quaddobl_Laurent_system();
  fail = syscon_number_of_quaddobl_Laurentials(&nbq);
  printf("-> read %d polynomials\n", nbq);
  printf("\n");
  read_solver_options(&nbtasks, &topdim, &filter, &factor, &verbose);
  printf("\nCalling the solver ...\n\n");
  fail = quaddobl_laursys_solve(nbtasks, topdim, filter, factor, verbose);
  fail = quaddobl_laursys_write(topdim);
  return fail;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<quaddobl_laursys_solver>:
  endbr64
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  call   <syscon_read_quaddobl_Laurent_system@plt>
  mov    %rsp,%rdi
  call   <syscon_number_of_quaddobl_Laurentials@plt>
  mov    (%rsp),%esi
  lea    D12(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  lea    0x10(%rsp),%rcx
  lea    0xc(%rsp),%rdx
  lea    0x8(%rsp),%rsi
  lea    0x14(%rsp),%r8
  lea    0x4(%rsp),%rdi
  call   <read_solver_options@plt>
  lea    D16(%rip),%rdi
  call   <puts@plt>
  mov    0xc(%rsp),%edx
  mov    0x4(%rsp),%edi
  mov    0x14(%rsp),%r8d
  mov    0x10(%rsp),%ecx
  mov    0x8(%rsp),%esi
  call   <quaddobl_laursys_solve@plt>
  mov    0x8(%rsp),%edi
  call   <quaddobl_laursys_write@plt>
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L6
  add    $0x28,%rsp
  ret
L6:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D12
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D16
type_guessed: string

tool: D12: -> read %d polynomials


tool: D16: 
Calling the solver ...


assistant: ```c
int quaddobl_laursys_solver(void) {
  int fail, nbq, nbtasks, topdim, filter, factor, verbose;
  fail = syscon_read_quaddobl_Laurent_system();
  fail = syscon_number_of_quaddobl_Laurentials(&nbq);
  printf("-> read %d polynomials\n", nbq);
  printf("\n");
  read_solver_options(&nbtasks, &topdim, &filter, &factor, &verbose);
  printf("\nCalling the solver ...\n\n");
  fail = quaddobl_laursys_solve(nbtasks, topdim, filter, factor, verbose);
  fail = quaddobl_laursys_write(topdim);
  return fail;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<parseKey>:
  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,%edx
  mov    -0x18(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <BIO_new_mem_buf@plt>
  mov    %rax,-0x10(%rbp)
  mov    $0x0,%eax
  call   <OpenSSL_add_all_algorithms@plt>
  mov    -0x10(%rbp),%rax
  mov    $0x0,%ecx
  mov    $0x0,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <PEM_read_bio_PrivateKey@plt>
  mov    %rax,-0x8(%rbp)
  mov    $0x0,%eax
  call   <EVP_cleanup@plt>
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <BIO_vfree@plt>
  mov    -0x8(%rbp),%rax
  leave
  ret
```

assistant: ```c
EVP_PKEY *parseKey(const char *keyStr) {
  BIO *bio = BIO_new_mem_buf((char *)keyStr, strlen(keyStr));
  OpenSSL_add_all_algorithms();
  EVP_PKEY *key = PEM_read_bio_PrivateKey(bio, NULL, NULL, NULL);
  EVP_cleanup();
  BIO_vfree(bio);
  return key;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<parseKey>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbx
  call   <strlen@plt>
  mov    %eax,%esi
  mov    %rbx,%rdi
  call   <BIO_new_mem_buf@plt>
  mov    %rax,%rbx
  mov    $0x0,%eax
  call   <OpenSSL_add_all_algorithms@plt>
  mov    $0x0,%ecx
  mov    $0x0,%edx
  mov    $0x0,%esi
  mov    %rbx,%rdi
  call   <PEM_read_bio_PrivateKey@plt>
  mov    %rax,%rbp
  mov    $0x0,%eax
  call   <EVP_cleanup@plt>
  mov    %rbx,%rdi
  call   <BIO_vfree@plt>
  mov    %rbp,%rax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
EVP_PKEY *parseKey(const char *keyStr) {
  BIO *bio = BIO_new_mem_buf((char *)keyStr, strlen(keyStr));
  OpenSSL_add_all_algorithms();
  EVP_PKEY *key = PEM_read_bio_PrivateKey(bio, NULL, NULL, NULL);
  EVP_cleanup();
  BIO_vfree(bio);
  return key;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<parseKey>:
  endbr64
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  sub    $0x8,%rsp
  call   <strlen@plt>
  mov    %rbp,%rdi
  mov    %eax,%esi
  call   <BIO_new_mem_buf@plt>
  mov    %rax,%rbp
  xor    %eax,%eax
  call   <OpenSSL_add_all_algorithms@plt>
  mov    %rbp,%rdi
  xor    %ecx,%ecx
  xor    %edx,%edx
  xor    %esi,%esi
  call   <PEM_read_bio_PrivateKey@plt>
  mov    %rax,%r12
  xor    %eax,%eax
  call   <EVP_cleanup@plt>
  mov    %rbp,%rdi
  call   <BIO_vfree@plt>
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
EVP_PKEY *parseKey(const char *keyStr) {
  BIO *bio = BIO_new_mem_buf((char *)keyStr, strlen(keyStr));
  OpenSSL_add_all_algorithms();
  EVP_PKEY *key = PEM_read_bio_PrivateKey(bio, NULL, NULL, NULL);
  EVP_cleanup();
  BIO_vfree(bio);
  return key;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<parseKey>:
  endbr64
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  sub    $0x8,%rsp
  call   <strlen@plt>
  mov    %rbp,%rdi
  mov    %eax,%esi
  call   <BIO_new_mem_buf@plt>
  mov    %rax,%rbp
  xor    %eax,%eax
  call   <OpenSSL_add_all_algorithms@plt>
  mov    %rbp,%rdi
  xor    %ecx,%ecx
  xor    %edx,%edx
  xor    %esi,%esi
  call   <PEM_read_bio_PrivateKey@plt>
  mov    %rax,%r12
  xor    %eax,%eax
  call   <EVP_cleanup@plt>
  mov    %rbp,%rdi
  call   <BIO_vfree@plt>
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
EVP_PKEY *parseKey(const char *keyStr) {
  BIO *bio = BIO_new_mem_buf((char *)keyStr, strlen(keyStr));
  OpenSSL_add_all_algorithms();
  EVP_PKEY *key = PEM_read_bio_PrivateKey(bio, NULL, NULL, NULL);
  EVP_cleanup();
  BIO_vfree(bio);
  return key;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    $0x1,%edi
  call   <assert@plt>
  mov    $0x2,%edi
  call   <assert@plt>
  movl   $0x3,-0x10(%rbp)
  movl   $0x0,-0xc(%rbp)
  movl   $0x0,-0x8(%rbp)
  addl   $0x1,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  mov    %eax,%edi
  call   <assert@plt>
  addl   $0x1,-0x8(%rbp)
  mov    -0x8(%rbp),%eax
  mov    %eax,%edi
  call   <assert@plt>
  addl   $0x1,-0xc(%rbp)
  addl   $0x1,-0x8(%rbp)
  mov    -0xc(%rbp),%edx
  mov    -0x8(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%edx
  mov    -0x10(%rbp),%eax
  mov    %eax,%esi
  lea    D2(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: label: D2
datatype: string

tool: D2: 1 + 2 = %d, 1 + 1 = %d


assistant: ```c
int main(void) {
  int res;
  do {
    assert(1);
    assert(2);
    res = 1 + 2;
  } while (0);
  int i = 0;
  int j = 0;
  int res2;
  do {
    assert(++i);
    assert(++j);
    res2 = ++i + ++j;
  } while (0);
  printf("1 + 2 = %d, 1 + 1 = %d\n", res, res2);
}
```
user: Translate the below assembly code into C programming language:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x1,%edi
  call   <assert@plt>
  mov    $0x2,%edi
  call   <assert@plt>
  mov    $0x1,%edi
  call   <assert@plt>
  mov    $0x1,%edi
  call   <assert@plt>
  mov    $0x4,%edx
  mov    $0x3,%esi
  lea    D3(%rip),%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D3
datatype: string

tool: D3: 1 + 2 = %d, 1 + 1 = %d


assistant: ```c
int main(void) {
  int res;
  do {
    assert(1);
    assert(2);
    res = 1 + 2;
  } while (0);
  int i = 0;
  int j = 0;
  int res2;
  do {
    assert(++i);
    assert(++j);
    res2 = ++i + ++j;
  } while (0);
  printf("1 + 2 = %d, 1 + 1 = %d\n", res, res2);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x1,%edi
  call   <assert@plt>
  mov    $0x2,%edi
  call   <assert@plt>
  mov    $0x1,%edi
  call   <assert@plt>
  mov    $0x1,%edi
  call   <assert@plt>
  mov    $0x4,%edx
  mov    $0x3,%esi
  lea    D1(%rip),%rdi
  call   <printf@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: parse_data
arguments: data_tag: D1
type_guessed: string

tool: D1: 1 + 2 = %d, 1 + 1 = %d


assistant: ```c
int main(void) {
  int res;
  do {
    assert(1);
    assert(2);
    res = 1 + 2;
  } while (0);
  int i = 0;
  int j = 0;
  int res2;
  do {
    assert(++i);
    assert(++j);
    res2 = ++i + ++j;
  } while (0);
  printf("1 + 2 = %d, 1 + 1 = %d\n", res, res2);
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x1,%edi
  call   <assert@plt>
  mov    $0x2,%edi
  call   <assert@plt>
  mov    $0x1,%edi
  call   <assert@plt>
  mov    $0x1,%edi
  call   <assert@plt>
  mov    $0x4,%edx
  mov    $0x3,%esi
  lea    D8(%rip),%rdi
  call   <printf@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D8
type_infered: string

tool: D8: 1 + 2 = %d, 1 + 1 = %d


assistant: ```c
int main(void) {
  int res;
  do {
    assert(1);
    assert(2);
    res = 1 + 2;
  } while (0);
  int i = 0;
  int j = 0;
  int res2;
  do {
    assert(++i);
    assert(++j);
    res2 = ++i + ++j;
  } while (0);
  printf("1 + 2 = %d, 1 + 1 = %d\n", res, res2);
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<generate_cos_lut>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    -0x28(%rbp),%rax
  lea    D33(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <emit_text@plt>
  mov    -0x30(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <emit_text@plt>
  mov    -0x28(%rbp),%rax
  lea    D30(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <emit_text@plt>
  movl   $0x0,-0x14(%rbp)
  jmp    L39
L57:
  mov    -0x14(%rbp),%eax
  test   %rax,%rax
  js     L15
  pxor   %xmm1,%xmm1
  cvtsi2sd %rax,%xmm1
  movq   %xmm1,%rax
  jmp    L30
L15:
  mov    %rax,%rdx
  shr    %rdx
  and    $0x1,%eax
  or     %rax,%rdx
  pxor   %xmm0,%xmm0
  cvtsi2sd %rdx,%xmm0
  addsd  %xmm0,%xmm0
  movq   %xmm0,%rax
L30:
  movq   %rax,%xmm0
  call   <deg_to_rad@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x10(%rbp),%rax
  movq   %rax,%xmm0
  call   <cos@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x8(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  movq   %rdx,%xmm0
  lea    D18(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fprintf@plt>
  cmpl   $0x0,-0x14(%rbp)
  je     L29
  mov    -0x14(%rbp),%eax
  and    $0x7,%eax
  test   %eax,%eax
  jne    L29
  mov    -0x28(%rbp),%rax
  lea    D44(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <emit_text@plt>
L29:
  addl   $0x1,-0x14(%rbp)
L39:
  cmpl   $0x167,-0x14(%rbp)
  jbe    L57
  mov    -0x28(%rbp),%rax
  lea    D48(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <emit_text@plt>
  nop
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: label: D33
data_type: string
name: disassemble_data
arguments: label: D30
data_type: string
name: disassemble_data
arguments: label: D18
data_type: string
name: disassemble_data
arguments: label: D44
data_type: string
name: disassemble_data
arguments: label: D48
data_type: string

tool: D33: const double 

tool: D30: [] __attribute__ ((aligned (64)))  = {
	

tool: D18: %lf,

tool: D44: 
	

tool: D48: 
	};


assistant: ```c
void generate_cos_lut(FILE *f, const char *field) {
  uint32_t i;
  emit_text(f, "const double ");
  emit_text(f, field);
  emit_text(f, "[] __attribute__ ((aligned (64)))  = {\n\t");
  for (i = 0U; i < 360U; ++i) {
    const double rad = deg_to_rad((double)i);
    const double cosine = (double)cos(rad);
    fprintf(f, "%lf,", cosine);
    if (i && (!(i & 7))) {
      emit_text(f, "\n\t");
    }
  }
  emit_text(f, "\n\t};\n");
}
```
user: What is the c source code of the assembly code below?

```asm
<generate_cos_lut>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%r12
  mov    %rsi,%rbx
  lea    D5(%rip),%rsi
  call   <emit_text@plt>
  mov    %rbx,%rsi
  mov    %r12,%rdi
  call   <emit_text@plt>
  lea    D7(%rip),%rsi
  mov    %r12,%rdi
  call   <emit_text@plt>
  mov    $0x1,%ebp
  lea    D0(%rip),%r13
  lea    D36(%rip),%r14
  jmp    L25
L30:
  cmp    $0x167,%ebp
  ja     L35
L18:
  add    $0x1,%ebp
L25:
  lea    -0x1(%rbp),%ebx
  mov    %ebx,%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  call   <deg_to_rad@plt>
  call   <cos@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  mov    %r13,%rsi
  mov    %r12,%rdi
  call   <fprintf@plt>
  test   %ebx,%ebx
  je     L18
  test   $0x7,%bl
  jne    L30
  mov    %r14,%rsi
  mov    %r12,%rdi
  call   <emit_text@plt>
  jmp    L30
L35:
  lea    D46(%rip),%rsi
  mov    %r12,%rdi
  call   <emit_text@plt>
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

tool_calls: name: disassemble_data
arguments: tag: D5
data_type: string
name: disassemble_data
arguments: tag: D7
data_type: string
name: disassemble_data
arguments: tag: D0
data_type: string
name: disassemble_data
arguments: tag: D36
data_type: string
name: disassemble_data
arguments: tag: D46
data_type: string

tool: D5: const double 

tool: D7: [] __attribute__ ((aligned (64)))  = {
	

tool: D0: %lf,

tool: D36: 
	

tool: D46: 
	};


assistant: ```c
void generate_cos_lut(FILE *f, const char *field) {
  uint32_t i;
  emit_text(f, "const double ");
  emit_text(f, field);
  emit_text(f, "[] __attribute__ ((aligned (64)))  = {\n\t");
  for (i = 0U; i < 360U; ++i) {
    const double rad = deg_to_rad((double)i);
    const double cosine = (double)cos(rad);
    fprintf(f, "%lf,", cosine);
    if (i && (!(i & 7))) {
      emit_text(f, "\n\t");
    }
  }
  emit_text(f, "\n\t};\n");
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<generate_cos_lut>:
  endbr64
  push   %r14
  push   %r13
  lea    D29(%rip),%r13
  push   %r12
  mov    %rsi,%r12
  lea    D8(%rip),%rsi
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  xor    %ebx,%ebx
  call   <emit_text@plt>
  mov    %r12,%rsi
  mov    %rbp,%rdi
  lea    D44(%rip),%r12
  call   <emit_text@plt>
  lea    D0(%rip),%rsi
  mov    %rbp,%rdi
  call   <emit_text@plt>
  jmp    L7
  nopw   0x0(%rax,%rax,1)
L43:
  cmp    $0x168,%r14d
  je     L28
L6:
  mov    %r14d,%ebx
L7:
  pxor   %xmm0,%xmm0
  lea    0x1(%rbx),%r14d
  cvtsi2sd %ebx,%xmm0
  call   <deg_to_rad@plt>
  call   <cos@plt>
  pxor   %xmm0,%xmm0
  mov    %r12,%rsi
  mov    %rbp,%rdi
  cvtsi2sd %rax,%xmm0
  call   <fprintf@plt>
  test   %ebx,%ebx
  je     L6
  and    $0x7,%ebx
  jne    L43
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <emit_text@plt>
  cmp    $0x168,%r14d
  jne    L6
L28:
  pop    %rbx
  mov    %rbp,%rdi
  lea    D16(%rip),%rsi
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  jmp    10b0 <emit_text@plt>
```

tool_calls: name: read_data
arguments: tag: D29
type_infered: string
name: read_data
arguments: tag: D8
type_infered: string
name: read_data
arguments: tag: D44
type_infered: string
name: read_data
arguments: tag: D0
type_infered: string
name: read_data
arguments: tag: D16
type_infered: string

tool: D29: 
	

tool: D8: const double 

tool: D44: %lf,

tool: D0: [] __attribute__ ((aligned (64)))  = {
	

tool: D16: 
	};


assistant: ```c
void generate_cos_lut(FILE *f, const char *field) {
  uint32_t i;
  emit_text(f, "const double ");
  emit_text(f, field);
  emit_text(f, "[] __attribute__ ((aligned (64)))  = {\n\t");
  for (i = 0U; i < 360U; ++i) {
    const double rad = deg_to_rad((double)i);
    const double cosine = (double)cos(rad);
    fprintf(f, "%lf,", cosine);
    if (i && (!(i & 7))) {
      emit_text(f, "\n\t");
    }
  }
  emit_text(f, "\n\t};\n");
}
```