ylfeng/ReF-Decompile-dataset huggingface dataset:
user: What is the c source code of the assembly code below?

```asm
<PrintVisible>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x68,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x58(%rsp)
  xor    %eax,%eax
  cmpb   $0x0,(%rdi)
  jne    L76
  movb   $0x0,D2(%rip)
L79:
  mov    0x58(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L66
  add    $0x68,%rsp
  pop    %rbx
  pop    %rbp
  ret
L76:
  mov    %rdi,%rbx
  mov    %rdi,%rsi
  lea    D2(%rip),%rdi
  call   <strcat@plt>
  mov    $0x0,%eax
  cmpb   $0xa,(%rbx)
  jne    L79
  movzbl D2(%rip),%esi
  test   %sil,%sil
  je     L111
  lea    D29(%rip),%rbx
  mov    %rbx,%rdx
  mov    %esi,%eax
  mov    $0x0,%ecx
  mov    $0x0,%edi
  jmp    L144
L84:
  add    $0x1,%edi
  jmp    L101
L30:
  add    $0x1,%rdx
  movzbl -0x1(%rdx),%eax
  test   %al,%al
  je     L85
L144:
  cmp    $0x2b,%al
  je     L84
  lea    0x1(%rcx),%r8d
  cmp    $0x2a,%al
  cmove  %r8d,%ecx
L101:
  cmp    $0x3,%dil
  jg     L93
  jne    L30
  cmp    $0x2,%cl
  jle    L30
  mov    $0x0,%edx
  jmp    L94
L85:
  mov    $0x0,%eax
  jmp    L44
L93:
  mov    $0x0,%edx
L94:
  mov    $0x0,%ebp
L75:
  movslq %edx,%rax
  mov    %sil,(%rsp,%rax,1)
  cmp    $0xa,%sil
  je     L109
  add    $0x1,%edx
  mov    %ebp,%eax
L73:
  movzbl (%rbx),%esi
  add    $0x1,%rbx
  test   %eax,%eax
  jne    L44
  test   %sil,%sil
  jne    L75
L44:
  movb   $0x0,D2(%rip)
  jmp    L79
L109:
  add    $0x1,%edx
  movslq %edx,%rdx
  movb   $0x0,(%rsp,%rdx,1)
  mov    %rsp,%rdi
  mov    $0x76,%esi
  mov    $0x0,%eax
  call   <Print@plt>
  movb   $0x0,(%rsp)
  mov    $0x0,%edx
  jmp    L73
L111:
  mov    $0x0,%eax
  jmp    L44
L66:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int PrintVisible(string)
char *string;
{
  static char buffer[10000];
  char line[80], plus, asterisk, visible;
  int x, y, quit = 0;
  if (string[0] == 0)
    buffer[0] = 0;
  else {
    strcat(buffer, string);
    if (string[0] == '\n') {
      plus = 0;
      visible = 0;
      asterisk = 0;
      for (x = 0; buffer[x] != 0 && visible == 0; x++) {
        if (buffer[x] == '+')
          plus++;
        if (buffer[x] == '*')
          asterisk++;
        if ((plus > 3) || (plus > 2 && asterisk > 2))
          visible = 1;
      }
      if (visible) {
        for (x = 0, y = 0; buffer[x] != 0 && quit == 0; x++) {
          line[y] = buffer[x];
          if (line[y] == '\n') {
            line[y + 1] = 0;
            quit = Print(line, 'v');
            line[0] = 0;
            y = 0;
          } else
            y++;
        }
      }
      buffer[0] = 0;
    }
  }
  return quit;
}
```
user: What is the c source code of the assembly code below:

```asm
<PrintVisible>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x68,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x58(%rsp)
  xor    %eax,%eax
  cmpb   $0x0,(%rdi)
  jne    L18
L34:
  movb   $0x0,D10(%rip)
L72:
  mov    0x58(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L137
  add    $0x68,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L18:
  lea    D10(%rip),%rbp
  mov    %rdi,%rbx
  mov    %rdi,%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  xor    %eax,%eax
  cmpb   $0xa,(%rbx)
  jne    L72
  movzbl D10(%rip),%edx
  test   %dl,%dl
  je     L166
  lea    D2(%rip),%r8
  mov    %edx,%ecx
  xor    %eax,%eax
  xor    %esi,%esi
L167:
  cmp    $0x2b,%cl
  je     L154
  lea    0x1(%rax),%edi
  cmp    $0x2a,%cl
  cmove  %edi,%eax
L36:
  cmp    $0x3,%sil
  jg     L96
  jne    L148
  cmp    $0x2,%al
  jle    L148
L96:
  xor    %ecx,%ecx
  mov    %rsp,%r12
  lea    -0x1(%rsp),%rbx
L87:
  movslq %ecx,%rdi
  mov    $0x1,%eax
  add    %rbp,%rdi
L100:
  mov    %dl,(%rbx,%rax,1)
  movslq %eax,%rsi
  lea    (%rcx,%rax,1),%r13d
  cmp    $0xa,%dl
  je     L98
  add    $0x1,%rax
  movzbl -0x1(%rdi,%rax,1),%edx
  test   %dl,%dl
  jne    L100
L166:
  xor    %eax,%eax
  jmp    L34
  cs nopw 0x0(%rax,%rax,1)
L154:
  add    $0x1,%esi
  jmp    L36
  nopl   (%rax)
L148:
  movzbl (%r8),%ecx
  add    $0x1,%r8
  test   %cl,%cl
  jne    L167
  xor    %eax,%eax
  jmp    L34
  nopl   0x0(%rax,%rax,1)
L98:
  movb   $0x0,(%rsp,%rsi,1)
  mov    %r12,%rdi
  mov    $0x76,%esi
  xor    %eax,%eax
  call   <Print@plt>
  movslq %r13d,%rdx
  movb   $0x0,(%rsp)
  movzbl 0x0(%rbp,%rdx,1),%edx
  test   %dl,%dl
  je     L34
  test   %eax,%eax
  jne    L34
  mov    %r13d,%ecx
  jmp    L87
L137:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int PrintVisible(string)
char *string;
{
  static char buffer[10000];
  char line[80], plus, asterisk, visible;
  int x, y, quit = 0;
  if (string[0] == 0)
    buffer[0] = 0;
  else {
    strcat(buffer, string);
    if (string[0] == '\n') {
      plus = 0;
      visible = 0;
      asterisk = 0;
      for (x = 0; buffer[x] != 0 && visible == 0; x++) {
        if (buffer[x] == '+')
          plus++;
        if (buffer[x] == '*')
          asterisk++;
        if ((plus > 3) || (plus > 2 && asterisk > 2))
          visible = 1;
      }
      if (visible) {
        for (x = 0, y = 0; buffer[x] != 0 && quit == 0; x++) {
          line[y] = buffer[x];
          if (line[y] == '\n') {
            line[y + 1] = 0;
            quit = Print(line, 'v');
            line[0] = 0;
            y = 0;
          } else
            y++;
        }
      }
      buffer[0] = 0;
    }
  }
  return quit;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<PrintVisible>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x68,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x58(%rsp)
  xor    %eax,%eax
  cmpb   $0x0,(%rdi)
  jne    L139
L145:
  movb   $0x0,D35(%rip)
L156:
  mov    0x58(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L163
  add    $0x68,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L139:
  lea    D35(%rip),%rbp
  mov    %rdi,%rbx
  mov    %rdi,%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  xor    %eax,%eax
  cmpb   $0xa,(%rbx)
  jne    L156
  movzbl D35(%rip),%edx
  test   %dl,%dl
  je     L12
  lea    D8(%rip),%r8
  mov    %edx,%ecx
  xor    %eax,%eax
  xor    %esi,%esi
L56:
  cmp    $0x2b,%cl
  je     L146
  lea    0x1(%rax),%edi
  cmp    $0x2a,%cl
  cmove  %edi,%eax
L99:
  cmp    $0x3,%sil
  jg     L45
  jne    L52
  cmp    $0x2,%al
  jle    L52
L45:
  xor    %ecx,%ecx
  mov    %rsp,%r12
  lea    -0x1(%rsp),%rbx
L121:
  movslq %ecx,%rdi
  mov    $0x1,%eax
  add    %rbp,%rdi
L158:
  mov    %dl,(%rbx,%rax,1)
  movslq %eax,%rsi
  lea    (%rcx,%rax,1),%r13d
  cmp    $0xa,%dl
  je     L162
  add    $0x1,%rax
  movzbl -0x1(%rdi,%rax,1),%edx
  test   %dl,%dl
  jne    L158
L12:
  xor    %eax,%eax
  jmp    L145
  cs nopw 0x0(%rax,%rax,1)
L146:
  add    $0x1,%esi
  jmp    L99
  nopl   (%rax)
L52:
  movzbl (%r8),%ecx
  add    $0x1,%r8
  test   %cl,%cl
  jne    L56
  xor    %eax,%eax
  jmp    L145
  nopl   0x0(%rax,%rax,1)
L162:
  movb   $0x0,(%rsp,%rsi,1)
  mov    %r12,%rdi
  mov    $0x76,%esi
  xor    %eax,%eax
  call   <Print@plt>
  movslq %r13d,%rdx
  movb   $0x0,(%rsp)
  movzbl 0x0(%rbp,%rdx,1),%edx
  test   %dl,%dl
  je     L145
  test   %eax,%eax
  jne    L145
  mov    %r13d,%ecx
  jmp    L121
L163:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int PrintVisible(string)
char *string;
{
  static char buffer[10000];
  char line[80], plus, asterisk, visible;
  int x, y, quit = 0;
  if (string[0] == 0)
    buffer[0] = 0;
  else {
    strcat(buffer, string);
    if (string[0] == '\n') {
      plus = 0;
      visible = 0;
      asterisk = 0;
      for (x = 0; buffer[x] != 0 && visible == 0; x++) {
        if (buffer[x] == '+')
          plus++;
        if (buffer[x] == '*')
          asterisk++;
        if ((plus > 3) || (plus > 2 && asterisk > 2))
          visible = 1;
      }
      if (visible) {
        for (x = 0, y = 0; buffer[x] != 0 && quit == 0; x++) {
          line[y] = buffer[x];
          if (line[y] == '\n') {
            line[y + 1] = 0;
            quit = Print(line, 'v');
            line[0] = 0;
            y = 0;
          } else
            y++;
        }
      }
      buffer[0] = 0;
    }
  }
  return quit;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<get_dip>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  movss  %xmm0,-0x34(%rbp)
  movss  %xmm1,-0x38(%rbp)
  movss  %xmm2,-0x3c(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movss  -0x34(%rbp),%xmm0
  movss  %xmm0,-0x20(%rbp)
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0x1c(%rbp)
  movss  -0x3c(%rbp),%xmm0
  movss  %xmm0,-0x18(%rbp)
  lea    -0x20(%rbp),%rax
  mov    $0x3,%esi
  mov    %rax,%rdi
  call   <to_unit_vector@plt>
  movss  -0x34(%rbp),%xmm0
  movss  %xmm0,-0x14(%rbp)
  movss  -0x38(%rbp),%xmm0
  movss  %xmm0,-0x10(%rbp)
  movss  -0x3c(%rbp),%xmm0
  movss  %xmm0,-0xc(%rbp)
  lea    -0x14(%rbp),%rax
  mov    $0x3,%esi
  mov    %rax,%rdi
  call   <to_unit_vector@plt>
  movss  -0x14(%rbp),%xmm1
  movss  -0x20(%rbp),%xmm0
  mulss  %xmm0,%xmm1
  movss  -0xc(%rbp),%xmm2
  movss  -0x18(%rbp),%xmm0
  mulss  %xmm2,%xmm0
  addss  %xmm1,%xmm0
  movss  %xmm0,-0x28(%rbp)
  mov    -0x28(%rbp),%eax
  movd   %eax,%xmm0
  call   <acos@plt>
  movsd  D22(%rip),%xmm1
  mulsd  %xmm1,%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,-0x24(%rbp)
  movss  -0x38(%rbp),%xmm0
  pxor   %xmm1,%xmm1
  comiss %xmm1,%xmm0
  jbe    L2
  movss  -0x24(%rbp),%xmm1
  movss  D5(%rip),%xmm0
  addss  %xmm1,%xmm0
  movss  %xmm0,-0x2c(%rbp)
  jmp    L25
L2:
  pxor   %xmm0,%xmm0
  comiss -0x38(%rbp),%xmm0
  jb     L25
  movss  D5(%rip),%xmm0
  subss  -0x24(%rbp),%xmm0
  movss  %xmm0,-0x2c(%rbp)
L25:
  movss  -0x2c(%rbp),%xmm0
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L4
  call   <__stack_chk_fail@plt>
L4:
  leave
  ret
```

tool_calls: name: read_data
arguments: label: D22
type_infered: f64
name: read_data
arguments: label: D5
type_infered: byte[4]

tool: D22: 57.2957795131

tool: {"D5": [0x00,0x00,0xb4,0x42]}

assistant: ```c
float get_dip(float nhat1, float nhat2, float nhat3) {
  float dip;
  int i, j;
  float nproj[3], n[3];
  float scaling;
  float arg;
  float theta;
  nproj[0] = nhat1;
  nproj[1] = 0;
  nproj[2] = nhat3;
  to_unit_vector(nproj, 3);
  n[0] = nhat1;
  n[1] = nhat2;
  n[2] = nhat3;
  to_unit_vector(n, 3);
  arg = (n[0] * nproj[0] + n[2] * nproj[2]);
  theta = acos(arg) * 57.2957795131;
  if (nhat2 > 0) {
    dip = 90 + theta;
  } else if (nhat2 <= 0) {
    dip = 90 - theta;
  }
  return dip;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<get_dip>:
  endbr64
  push   %r14
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  movd   %xmm0,%r12d
  movd   %xmm1,%ebx
  movd   %xmm2,%ebp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  movss  %xmm0,(%rsp)
  movl   $0x0,0x4(%rsp)
  movss  %xmm2,0x8(%rsp)
  mov    %rsp,%rdi
  mov    $0x3,%esi
  call   <to_unit_vector@plt>
  mov    %r12d,0xc(%rsp)
  mov    %ebx,0x10(%rsp)
  mov    %ebp,0x14(%rsp)
  lea    0xc(%rsp),%rdi
  mov    $0x3,%esi
  call   <to_unit_vector@plt>
  movss  0xc(%rsp),%xmm0
  mulss  (%rsp),%xmm0
  movss  0x14(%rsp),%xmm1
  mulss  0x8(%rsp),%xmm1
  addss  %xmm1,%xmm0
  call   <acos@plt>
  mulsd  D32(%rip),%xmm0
  cvtsd2ss %xmm0,%xmm0
  movd   %ebx,%xmm3
  comiss D36(%rip),%xmm3
  jbe    L29
  addss  D34(%rip),%xmm0
  movd   %xmm0,%r14d
L11:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L7
  movd   %r14d,%xmm0
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r14
  ret
L29:
  pxor   %xmm1,%xmm1
  comiss %xmm3,%xmm1
  jb     L11
  movss  D34(%rip),%xmm1
  subss  %xmm0,%xmm1
  movd   %xmm1,%r14d
  jmp    L11
L7:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: label: D32
datatype: f64
name: extract_symbolic_data
arguments: label: D36
datatype: byte[4]
name: extract_symbolic_data
arguments: label: D34
datatype: byte[4]

tool: D32: 57.2957795131

tool: {"D36": [0x00,0x00,0x00,0x00]}

tool: {"D34": [0x00,0x00,0xb4,0x42]}

assistant: ```c
float get_dip(float nhat1, float nhat2, float nhat3) {
  float dip;
  int i, j;
  float nproj[3], n[3];
  float scaling;
  float arg;
  float theta;
  nproj[0] = nhat1;
  nproj[1] = 0;
  nproj[2] = nhat3;
  to_unit_vector(nproj, 3);
  n[0] = nhat1;
  n[1] = nhat2;
  n[2] = nhat3;
  to_unit_vector(n, 3);
  arg = (n[0] * nproj[0] + n[2] * nproj[2]);
  theta = acos(arg) * 57.2957795131;
  if (nhat2 > 0) {
    dip = 90 + theta;
  } else if (nhat2 <= 0) {
    dip = 90 - theta;
  }
  return dip;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<get_dip>:
  endbr64
  sub    $0x38,%rsp
  mov    $0x3,%esi
  movss  %xmm3,0xc(%rsp)
  lea    0x10(%rsp),%rdi
  movss  %xmm1,(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  movss  %xmm0,0x10(%rsp)
  movss  %xmm0,0x8(%rsp)
  movss  %xmm2,0x18(%rsp)
  movss  %xmm2,0x4(%rsp)
  movl   $0x0,0x14(%rsp)
  call   <to_unit_vector@plt>
  movss  (%rsp),%xmm4
  movss  0x8(%rsp),%xmm0
  lea    0x1c(%rsp),%rdi
  movss  0x4(%rsp),%xmm2
  mov    $0x3,%esi
  movss  %xmm4,0x20(%rsp)
  movss  %xmm0,0x1c(%rsp)
  movss  %xmm2,0x24(%rsp)
  call   <to_unit_vector@plt>
  movss  0x1c(%rsp),%xmm0
  movss  0x24(%rsp),%xmm1
  mulss  0x10(%rsp),%xmm0
  mulss  0x18(%rsp),%xmm1
  addss  %xmm1,%xmm0
  call   <acos@plt>
  movss  (%rsp),%xmm4
  pxor   %xmm5,%xmm5
  movss  0xc(%rsp),%xmm3
  mulsd  D6(%rip),%xmm0
  comiss %xmm5,%xmm4
  cvtsd2ss %xmm0,%xmm0
  jbe    L13
  movss  D0(%rip),%xmm3
  addss  %xmm0,%xmm3
L31:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L12
  movaps %xmm3,%xmm0
  add    $0x38,%rsp
  ret
  nopl   0x0(%rax)
L13:
  pxor   %xmm6,%xmm6
  comiss (%rsp),%xmm6
  jb     L31
  movss  D0(%rip),%xmm3
  subss  %xmm0,%xmm3
  jmp    L31
L12:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_label: D6
type: f64
name: read_data
arguments: data_label: D0
type: byte[4]

tool: D6: 57.2957795131

tool: {"D0": [0x00,0x00,0xb4,0x42]}

assistant: ```c
float get_dip(float nhat1, float nhat2, float nhat3) {
  float dip;
  int i, j;
  float nproj[3], n[3];
  float scaling;
  float arg;
  float theta;
  nproj[0] = nhat1;
  nproj[1] = 0;
  nproj[2] = nhat3;
  to_unit_vector(nproj, 3);
  n[0] = nhat1;
  n[1] = nhat2;
  n[2] = nhat3;
  to_unit_vector(n, 3);
  arg = (n[0] * nproj[0] + n[2] * nproj[2]);
  theta = acos(arg) * 57.2957795131;
  if (nhat2 > 0) {
    dip = 90 + theta;
  } else if (nhat2 <= 0) {
    dip = 90 - theta;
  }
  return dip;
}
```
user: Translate the below assembly code into C programming language:

```asm
<get_dip>:
  endbr64
  sub    $0x48,%rsp
  movaps %xmm0,%xmm4
  mov    $0x3,%esi
  unpcklps %xmm1,%xmm4
  movss  %xmm3,0x1c(%rsp)
  lea    0x2c(%rsp),%rdi
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  movss  %xmm1,0x18(%rsp)
  movss  %xmm0,0x2c(%rsp)
  movlps %xmm4,0x10(%rsp)
  movss  %xmm2,0x34(%rsp)
  movss  %xmm2,0xc(%rsp)
  movl   $0x0,0x30(%rsp)
  call   <to_unit_vector@plt>
  movss  0xc(%rsp),%xmm2
  lea    0x20(%rsp),%rdi
  movq   0x10(%rsp),%xmm4
  mov    $0x3,%esi
  movlps %xmm4,0x20(%rsp)
  movss  %xmm2,0x28(%rsp)
  call   <to_unit_vector@plt>
  movss  0x20(%rsp),%xmm0
  movss  0x28(%rsp),%xmm2
  mulss  0x2c(%rsp),%xmm0
  mulss  0x34(%rsp),%xmm2
  addss  %xmm2,%xmm0
  call   <acos@plt>
  movss  0x18(%rsp),%xmm1
  pxor   %xmm5,%xmm5
  movss  0x1c(%rsp),%xmm3
  mulsd  D28(%rip),%xmm0
  comiss %xmm5,%xmm1
  cvtsd2ss %xmm0,%xmm0
  jbe    L35
  movss  D26(%rip),%xmm3
  addss  %xmm0,%xmm3
L6:
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L34
  movaps %xmm3,%xmm0
  add    $0x48,%rsp
  ret
  nopl   0x0(%rax)
L35:
  comiss %xmm1,%xmm5
  jb     L6
  movss  D26(%rip),%xmm3
  subss  %xmm0,%xmm3
  jmp    L6
L34:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_label: D28
type: f64
name: read_data
arguments: data_label: D26
type: byte[4]

tool: D28: 57.2957795131

tool: {"D26": [0x00,0x00,0xb4,0x42]}

assistant: ```c
float get_dip(float nhat1, float nhat2, float nhat3) {
  float dip;
  int i, j;
  float nproj[3], n[3];
  float scaling;
  float arg;
  float theta;
  nproj[0] = nhat1;
  nproj[1] = 0;
  nproj[2] = nhat3;
  to_unit_vector(nproj, 3);
  n[0] = nhat1;
  n[1] = nhat2;
  n[2] = nhat3;
  to_unit_vector(n, 3);
  arg = (n[0] * nproj[0] + n[2] * nproj[2]);
  theta = acos(arg) * 57.2957795131;
  if (nhat2 > 0) {
    dip = 90 + theta;
  } else if (nhat2 <= 0) {
    dip = 90 - theta;
  }
  return dip;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<eigen>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %edi,-0x4(%rbp)
  mov    %rsi,-0x10(%rbp)
  mov    %rdx,-0x18(%rbp)
  mov    %rcx,-0x20(%rbp)
  mov    %r8,-0x28(%rbp)
  mov    -0x20(%rbp),%rsi
  mov    -0x10(%rbp),%rcx
  mov    -0x4(%rbp),%edx
  mov    -0x4(%rbp),%eax
  mov    %rsi,%r8
  mov    $0x1,%esi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <orthesx@plt>
  mov    -0x28(%rbp),%rdi
  mov    -0x18(%rbp),%rsi
  mov    -0x10(%rbp),%rcx
  mov    -0x4(%rbp),%edx
  mov    -0x4(%rbp),%eax
  mov    %rdi,%r9
  mov    %rsi,%r8
  mov    $0x1,%esi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <hqrx@plt>
  nop
  leave
  ret
```

assistant: ```c
void eigen(n, a, ev, work, ierr) int n, *ierr;
double *a, *ev, *work;
{
  orthesx(n, 1, n, a, work);
  hqrx(n, 1, n, a, ev, ierr);
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<eigen>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %edi,%ebx
  mov    %rsi,%rbp
  mov    %rdx,%r12
  mov    %r8,%r13
  mov    %rcx,%r8
  mov    %rsi,%rcx
  mov    %edi,%edx
  mov    $0x1,%esi
  mov    $0x0,%eax
  call   <orthesx@plt>
  mov    %r13,%r9
  mov    %r12,%r8
  mov    %rbp,%rcx
  mov    %ebx,%edx
  mov    $0x1,%esi
  mov    %ebx,%edi
  mov    $0x0,%eax
  call   <hqrx@plt>
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
void eigen(n, a, ev, work, ierr) int n, *ierr;
double *a, *ev, *work;
{
  orthesx(n, 1, n, a, work);
  hqrx(n, 1, n, a, ev, ierr);
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<eigen>:
  endbr64
  push   %r13
  xor    %eax,%eax
  mov    %r8,%r13
  mov    %rcx,%r8
  push   %r12
  mov    %rsi,%rcx
  mov    %rsi,%r12
  mov    $0x1,%esi
  push   %rbp
  mov    %edi,%ebp
  push   %rbx
  mov    %rdx,%rbx
  mov    %edi,%edx
  sub    $0x8,%rsp
  call   <orthesx@plt>
  add    $0x8,%rsp
  mov    %r13,%r9
  mov    %rbx,%r8
  mov    %r12,%rcx
  pop    %rbx
  mov    %ebp,%edx
  mov    %ebp,%edi
  mov    $0x1,%esi
  pop    %rbp
  xor    %eax,%eax
  pop    %r12
  pop    %r13
  jmp    1070 <hqrx@plt>
```

assistant: ```c
void eigen(n, a, ev, work, ierr) int n, *ierr;
double *a, *ev, *work;
{
  orthesx(n, 1, n, a, work);
  hqrx(n, 1, n, a, ev, ierr);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<eigen>:
  endbr64
  push   %r13
  xor    %eax,%eax
  mov    %r8,%r13
  mov    %rcx,%r8
  push   %r12
  mov    %rsi,%rcx
  mov    %rsi,%r12
  mov    $0x1,%esi
  push   %rbp
  mov    %edi,%ebp
  push   %rbx
  mov    %rdx,%rbx
  mov    %edi,%edx
  sub    $0x8,%rsp
  call   <orthesx@plt>
  add    $0x8,%rsp
  mov    %r13,%r9
  mov    %rbx,%r8
  mov    %r12,%rcx
  pop    %rbx
  mov    %ebp,%edx
  mov    %ebp,%edi
  mov    $0x1,%esi
  pop    %rbp
  xor    %eax,%eax
  pop    %r12
  pop    %r13
  jmp    1070 <hqrx@plt>
```

assistant: ```c
void eigen(n, a, ev, work, ierr) int n, *ierr;
double *a, *ev, *work;
{
  orthesx(n, 1, n, a, work);
  hqrx(n, 1, n, a, ev, ierr);
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<selection_sort>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  movl   $0x0,-0xc(%rbp)
  jmp    L34
L47:
  mov    -0xc(%rbp),%eax
  mov    %eax,-0x8(%rbp)
  mov    -0xc(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x4(%rbp)
  jmp    L41
L40:
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  cmp    %eax,%edx
  jge    L49
  mov    -0x4(%rbp),%eax
  mov    %eax,-0x8(%rbp)
L49:
  addl   $0x1,-0x4(%rbp)
L41:
  mov    -0x4(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jl     L40
  mov    -0x8(%rbp),%edx
  mov    -0xc(%rbp),%ecx
  mov    -0x18(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <u_swap@plt>
  addl   $0x1,-0xc(%rbp)
L34:
  mov    -0x1c(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0xc(%rbp)
  jl     L47
  nop
  nop
  leave
  ret
```

assistant: ```c
void selection_sort(int *items, int size) {
  for (int i = 0; i < size - 1; i++) {
    int min = i;
    for (int j = i + 1; j < size; j++) {
      if (items[j] < items[min]) {
        min = j;
      }
    }
    u_swap(items, i, min);
  }
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<selection_sort>:
  endbr64
  cmp    $0x1,%esi
  jle    L39
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbx
  mov    %esi,%ebp
  lea    -0x2(%rsi),%r13d
  add    $0x2,%r13
  mov    $0x1,%r12d
L48:
  lea    -0x1(%r12),%esi
  cmp    %r12d,%ebp
  jle    L22
  mov    %r12,%rax
  mov    %esi,%edx
L13:
  movslq %edx,%rcx
  mov    (%rbx,%rcx,4),%edi
  cmp    %edi,(%rbx,%rax,4)
  cmovl  %eax,%edx
  add    $0x1,%rax
  cmp    %eax,%ebp
  jg     L13
L28:
  mov    %rbx,%rdi
  call   <u_swap@plt>
  add    $0x1,%r12
  cmp    %r13,%r12
  jne    L48
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L22:
  mov    %esi,%edx
  jmp    L28
L39:
  ret
```

assistant: ```c
void selection_sort(int *items, int size) {
  for (int i = 0; i < size - 1; i++) {
    int min = i;
    for (int j = i + 1; j < size; j++) {
      if (items[j] < items[min]) {
        min = j;
      }
    }
    u_swap(items, i, min);
  }
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<selection_sort>:
  endbr64
  cmp    $0x1,%esi
  jle    L46
  push   %r13
  mov    $0x1,%r13d
  push   %r12
  lea    -0x2(%rsi),%r12d
  push   %rbp
  add    $0x2,%r12
  mov    %esi,%ebp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x8,%rsp
  cs nopw 0x0(%rax,%rax,1)
L35:
  lea    -0x1(%r13),%esi
  cmp    %r13d,%ebp
  jle    L40
  mov    %r13,%rax
  mov    %esi,%edx
  xchg   %ax,%ax
L16:
  movslq %edx,%rcx
  mov    (%rbx,%rcx,4),%edi
  cmp    %edi,(%rbx,%rax,4)
  cmovl  %eax,%edx
  add    $0x1,%rax
  cmp    %eax,%ebp
  jg     L16
L17:
  mov    %rbx,%rdi
  add    $0x1,%r13
  call   <u_swap@plt>
  cmp    %r12,%r13
  jne    L35
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L40:
  mov    %esi,%edx
  jmp    L17
L46:
  ret
```

assistant: ```c
void selection_sort(int *items, int size) {
  for (int i = 0; i < size - 1; i++) {
    int min = i;
    for (int j = i + 1; j < size; j++) {
      if (items[j] < items[min]) {
        min = j;
      }
    }
    u_swap(items, i, min);
  }
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<selection_sort>:
  endbr64
  cmp    $0x1,%esi
  jle    L36
  push   %r13
  mov    $0x1,%r13d
  push   %r12
  lea    -0x2(%rsi),%r12d
  push   %rbp
  add    $0x2,%r12
  mov    %esi,%ebp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x8,%rsp
  cs nopw 0x0(%rax,%rax,1)
L20:
  lea    -0x1(%r13),%esi
  cmp    %r13d,%ebp
  jle    L6
  mov    -0x4(%rbx,%r13,4),%ecx
  mov    %r13,%rax
  mov    %esi,%r8d
  nopl   0x0(%rax)
L51:
  mov    (%rbx,%rax,4),%edx
  cmp    %ecx,%edx
  jge    L7
  mov    %edx,%ecx
  mov    %eax,%r8d
L7:
  add    $0x1,%rax
  cmp    %eax,%ebp
  jg     L51
L25:
  mov    %r8d,%edx
  mov    %rbx,%rdi
  add    $0x1,%r13
  call   <u_swap@plt>
  cmp    %r12,%r13
  jne    L20
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax,%rax,1)
L6:
  mov    %esi,%r8d
  jmp    L25
L36:
  ret
```

assistant: ```c
void selection_sort(int *items, int size) {
  for (int i = 0; i < size - 1; i++) {
    int min = i;
    for (int j = i + 1; j < size; j++) {
      if (items[j] < items[min]) {
        min = j;
      }
    }
    u_swap(items, i, min);
  }
}
```