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

```asm
<PrintEncode>:
  endbr64
  test   %esi,%esi
  jle    L19
  push   %r14
  lea    D4(%rip),%r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  mov    %rdx,%r12
  push   %rbp
  movslq %esi,%rbp
  push   %rbx
  mov    $0x1,%ebx
  jmp    L45
  nopw   0x0(%rax,%rax,1)
L11:
  add    $0x1,%rbx
L45:
  mov    -0x4(%r13,%rbx,4),%edi
  mov    %r12,%rsi
  call   <PrintBite@plt>
  cmp    %rbp,%rbx
  je     L48
  imul   $0xcccccccd,%ebx,%eax
  ror    $0x4,%eax
  cmp    $0x3333333,%eax
  ja     L11
  mov    %r14,%rsi
  mov    %r12,%rdi
  call   <fprintf@plt>
  jmp    L11
  nopl   0x0(%rax,%rax,1)
L48:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
L19:
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D4
type_guessed: string

tool: D4: 


assistant: ```c
void PrintEncode(int wt[20000 + 1], int B, FILE *f) {
  int i = 0;
  for (i = 0; i < B; i++) {
    if (i != 0 && i % 80 == 0) {
      fprintf(f, "\n");
    }
    PrintBite(wt[i], f);
  }
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<PrintEncode>:
  endbr64
  test   %esi,%esi
  jle    L37
  push   %r14
  lea    D2(%rip),%r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  mov    %rdx,%r12
  push   %rbp
  movslq %esi,%rbp
  push   %rbx
  mov    $0x1,%ebx
  jmp    L40
  nopw   0x0(%rax,%rax,1)
L29:
  add    $0x1,%rbx
L40:
  mov    -0x4(%r13,%rbx,4),%edi
  mov    %r12,%rsi
  call   <PrintBite@plt>
  cmp    %rbx,%rbp
  je     L42
  imul   $0xcccccccd,%ebx,%eax
  ror    $0x4,%eax
  cmp    $0x3333333,%eax
  ja     L29
  mov    %r14,%rsi
  mov    %r12,%rdi
  call   <fprintf@plt>
  jmp    L29
  nopl   0x0(%rax,%rax,1)
L42:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
L37:
  ret
```

tool_calls: name: read_data
arguments: data_tag: D2
type_infered: string

tool: D2: 


assistant: ```c
void PrintEncode(int wt[20000 + 1], int B, FILE *f) {
  int i = 0;
  for (i = 0; i < B; i++) {
    if (i != 0 && i % 80 == 0) {
      fprintf(f, "\n");
    }
    PrintBite(wt[i], f);
  }
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<sleep>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    $0x0,%eax
  call   <accel_sleep@plt>
  mov    $0x0,%eax
  call   <power_off_periph@plt>
  mov    $0x0,%eax
  call   <uc_sleep@plt>
  mov    $0x0,%eax
  call   <power_on_periph@plt>
  mov    $0x0,%eax
  call   <accel_run@plt>
  nop
  pop    %rbp
  ret
```

assistant: ```c
void sleep() {
  accel_sleep();
  power_off_periph();
  uc_sleep();
  power_on_periph();
  accel_run();
}
```
user: Translate the below assembly code into C programming language:

```asm
<sleep>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x0,%eax
  call   <accel_sleep@plt>
  mov    $0x0,%eax
  call   <power_off_periph@plt>
  mov    $0x0,%eax
  call   <uc_sleep@plt>
  mov    $0x0,%eax
  call   <power_on_periph@plt>
  mov    $0x0,%eax
  call   <accel_run@plt>
  add    $0x8,%rsp
  ret
```

assistant: ```c
void sleep() {
  accel_sleep();
  power_off_periph();
  uc_sleep();
  power_on_periph();
  accel_run();
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<sleep>:
  endbr64
  sub    $0x8,%rsp
  xor    %eax,%eax
  call   <accel_sleep@plt>
  xor    %eax,%eax
  call   <power_off_periph@plt>
  xor    %eax,%eax
  call   <uc_sleep@plt>
  xor    %eax,%eax
  call   <power_on_periph@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  jmp    10c0 <accel_run@plt>
```

assistant: ```c
void sleep() {
  accel_sleep();
  power_off_periph();
  uc_sleep();
  power_on_periph();
  accel_run();
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<sleep>:
  endbr64
  sub    $0x8,%rsp
  xor    %eax,%eax
  call   <accel_sleep@plt>
  xor    %eax,%eax
  call   <power_off_periph@plt>
  xor    %eax,%eax
  call   <uc_sleep@plt>
  xor    %eax,%eax
  call   <power_on_periph@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  jmp    10c0 <accel_run@plt>
```

assistant: ```c
void sleep() {
  accel_sleep();
  power_off_periph();
  uc_sleep();
  power_on_periph();
  accel_run();
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<constant_time_eq_8>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x14(%rbp)
  mov    %esi,-0x18(%rbp)
  mov    -0x14(%rbp),%eax
  xor    -0x18(%rbp),%eax
  mov    %eax,-0x4(%rbp)
  subl   $0x1,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  sar    $0x1f,%eax
  pop    %rbp
  ret
```

assistant: ```c
unsigned char constant_time_eq_8(unsigned a, unsigned b) {
  unsigned c = a ^ b;
  c--;
  return ((unsigned char)(((unsigned)((int)(c) >> (sizeof(int) * 8 - 1)))));
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<constant_time_eq_8>:
  endbr64
  xor    %esi,%edi
  lea    -0x1(%rdi),%eax
  sar    $0x1f,%eax
  ret
```

assistant: ```c
unsigned char constant_time_eq_8(unsigned a, unsigned b) {
  unsigned c = a ^ b;
  c--;
  return ((unsigned char)(((unsigned)((int)(c) >> (sizeof(int) * 8 - 1)))));
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<constant_time_eq_8>:
  endbr64
  xor    %esi,%edi
  lea    -0x1(%rdi),%eax
  sar    $0x1f,%eax
  ret
```

assistant: ```c
unsigned char constant_time_eq_8(unsigned a, unsigned b) {
  unsigned c = a ^ b;
  c--;
  return ((unsigned char)(((unsigned)((int)(c) >> (sizeof(int) * 8 - 1)))));
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<constant_time_eq_8>:
  endbr64
  xor    %esi,%edi
  lea    -0x1(%rdi),%eax
  sar    $0x1f,%eax
  ret
```

assistant: ```c
unsigned char constant_time_eq_8(unsigned a, unsigned b) {
  unsigned c = a ^ b;
  c--;
  return ((unsigned char)(((unsigned)((int)(c) >> (sizeof(int) * 8 - 1)))));
}
```
user: Translate the below assembly code into C programming language:

```asm
<lowc>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L9
L3:
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x40,%al
  jle    L1
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x5a,%al
  jg     L1
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  lea    0x20(%rax),%ecx
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    %ecx,%edx
  mov    %dl,(%rax)
L1:
  addl   $0x1,-0x4(%rbp)
L9:
  cmpq   $0x0,-0x18(%rbp)
  je     L31
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L3
L31:
  mov    -0x18(%rbp),%rax
  pop    %rbp
  ret
```

assistant: ```c
char *lowc(char *str) {
  int i;
  i = 0;
  while (str && str[i]) {
    if (str[i] >= 'A' && str[i] <= 'Z')
      str[i] += 32;
    i++;
  }
  return (str);
}
```
user: What is the c source code of the assembly code below:

```asm
<lowc>:
  endbr64
  mov    %rdi,%rax
  test   %rdi,%rdi
  je     L30
  mov    %rdi,%rcx
  jmp    L14
L25:
  add    $0x1,%rcx
L14:
  mov    %rcx,%r8
  movzbl (%rcx),%edx
  test   %dl,%dl
  je     L30
  lea    -0x41(%rdx),%esi
  cmp    $0x19,%sil
  ja     L25
  add    $0x20,%edx
  mov    %dl,(%r8)
  jmp    L25
L30:
  ret
```

assistant: ```c
char *lowc(char *str) {
  int i;
  i = 0;
  while (str && str[i]) {
    if (str[i] >= 'A' && str[i] <= 'Z')
      str[i] += 32;
    i++;
  }
  return (str);
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<lowc>:
  endbr64
  mov    %rdi,%rax
  test   %rdi,%rdi
  je     L23
  mov    %rdi,%rcx
  jmp    L25
  nopl   0x0(%rax)
L20:
  lea    -0x41(%rdx),%esi
  cmp    $0x19,%sil
  ja     L4
  add    $0x20,%edx
  mov    %dl,(%rcx)
L4:
  add    $0x1,%rcx
L25:
  movzbl (%rcx),%edx
  test   %dl,%dl
  jne    L20
L23:
  ret
```

assistant: ```c
char *lowc(char *str) {
  int i;
  i = 0;
  while (str && str[i]) {
    if (str[i] >= 'A' && str[i] <= 'Z')
      str[i] += 32;
    i++;
  }
  return (str);
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<lowc>:
  endbr64
  mov    %rdi,%rax
  test   %rdi,%rdi
  je     L45
  movzbl (%rdi),%edx
  mov    %rdi,%rcx
  test   %dl,%dl
  je     L45
  cs nopw 0x0(%rax,%rax,1)
L14:
  lea    -0x41(%rdx),%esi
  cmp    $0x19,%sil
  ja     L42
  add    $0x20,%edx
  add    $0x1,%rcx
  mov    %dl,-0x1(%rcx)
  movzbl (%rcx),%edx
  test   %dl,%dl
  jne    L14
  ret
  nopl   0x0(%rax,%rax,1)
L42:
  movzbl 0x1(%rcx),%edx
  add    $0x1,%rcx
  test   %dl,%dl
  jne    L14
L45:
  ret
```

assistant: ```c
char *lowc(char *str) {
  int i;
  i = 0;
  while (str && str[i]) {
    if (str[i] >= 'A' && str[i] <= 'Z')
      str[i] += 32;
    i++;
  }
  return (str);
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<maxfactor_checker>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %edi,-0x4(%rbp)
  mov    %esi,-0x8(%rbp)
  cmpl   $0x1,-0x4(%rbp)
  setg   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  cmpl   $0x0,-0x8(%rbp)
  setg   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x4(%rbp),%eax
  cltd
  idivl  -0x8(%rbp)
  mov    %edx,%eax
  test   %eax,%eax
  je     L5
  mov    -0x8(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    -0x4(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <maxfactor_checker>
  jmp    L9
L5:
  mov    -0x8(%rbp),%eax
L9:
  leave
  ret
```

assistant: ```c
int maxfactor_checker(int m, int n) {
  assert(m > 1);
  assert(n > 0);
  return ((m % n) == 0) ? n : maxfactor_checker(m, n - 1);
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<maxfactor_checker>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %edi,%ebp
  mov    %esi,%ebx
  cmp    $0x1,%edi
  setg   %dil
  movzbl %dil,%edi
  call   <assert@plt>
  test   %ebx,%ebx
  setg   %dil
  movzbl %dil,%edi
  call   <assert@plt>
  mov    %ebp,%eax
  cltd
  idiv   %ebx
  test   %edx,%edx
  jne    L6
L2:
  mov    %ebx,%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
L6:
  lea    -0x1(%rbx),%esi
  mov    %ebp,%edi
  call   <maxfactor_checker>
  mov    %eax,%ebx
  jmp    L2
```

assistant: ```c
int maxfactor_checker(int m, int n) {
  assert(m > 1);
  assert(n > 0);
  return ((m % n) == 0) ? n : maxfactor_checker(m, n - 1);
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<maxfactor_checker>:
  endbr64
  push   %r12
  mov    %esi,%r12d
  push   %rbp
  xor    %ebp,%ebp
  cmp    $0x1,%edi
  push   %rbx
  setg   %bpl
  mov    %edi,%ebx
  jmp    L18
  nopl   0x0(%rax,%rax,1)
L11:
  sub    $0x1,%r12d
L18:
  mov    %ebp,%edi
  call   <assert@plt>
  xor    %edi,%edi
  test   %r12d,%r12d
  setg   %dil
  call   <assert@plt>
  mov    %ebx,%eax
  cltd
  idiv   %r12d
  test   %edx,%edx
  jne    L11
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
int maxfactor_checker(int m, int n) {
  assert(m > 1);
  assert(n > 0);
  return ((m % n) == 0) ? n : maxfactor_checker(m, n - 1);
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<maxfactor_checker>:
  endbr64
  push   %r12
  mov    %esi,%r12d
  push   %rbp
  xor    %ebp,%ebp
  cmp    $0x1,%edi
  push   %rbx
  setg   %bpl
  mov    %edi,%ebx
  jmp    L8
  nopl   0x0(%rax,%rax,1)
L19:
  sub    $0x1,%r12d
L8:
  mov    %ebp,%edi
  call   <assert@plt>
  xor    %edi,%edi
  test   %r12d,%r12d
  setg   %dil
  call   <assert@plt>
  mov    %ebx,%eax
  cltd
  idiv   %r12d
  test   %edx,%edx
  jne    L19
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
int maxfactor_checker(int m, int n) {
  assert(m > 1);
  assert(n > 0);
  return ((m % n) == 0) ? n : maxfactor_checker(m, n - 1);
}
```
user: Translate the below assembly code into C programming language:

```asm
<fc8150_deinit>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  mov    $0x0,%edx
  mov    $0x1,%esi
  mov    %rax,%rdi
  call   <bbm_write@plt>
  mov    $0x0,%eax
  leave
  ret
```

assistant: ```c
int fc8150_deinit(void *hDevice) {
  bbm_write(hDevice, 0x0001, 0x00);
  return 0;
}
```
user: Translate the below assembly code into C programming language:

```asm
<fc8150_deinit>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x0,%edx
  mov    $0x1,%esi
  call   <bbm_write@plt>
  mov    $0x0,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int fc8150_deinit(void *hDevice) {
  bbm_write(hDevice, 0x0001, 0x00);
  return 0;
}
```
user: Translate the below assembly code into C programming language:

```asm
<fc8150_deinit>:
  endbr64
  sub    $0x8,%rsp
  xor    %edx,%edx
  mov    $0x1,%esi
  call   <bbm_write@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int fc8150_deinit(void *hDevice) {
  bbm_write(hDevice, 0x0001, 0x00);
  return 0;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<fc8150_deinit>:
  endbr64
  sub    $0x8,%rsp
  xor    %edx,%edx
  mov    $0x1,%esi
  call   <bbm_write@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int fc8150_deinit(void *hDevice) {
  bbm_write(hDevice, 0x0001, 0x00);
  return 0;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<reg_poly_winding_num>:
  endbr64
  push   %r14
  push   %r13
  lea    -0x1(%rdx),%r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x10,%rsp
  test   %r13,%r13
  jle    L118
  mov    %rdi,%r12
  movapd %xmm0,%xmm4
  movapd %xmm1,%xmm5
  mov    %rsi,%rbx
  xor    %ebp,%ebp
  xor    %r14d,%r14d
  jmp    L70
  nopw   0x0(%rax,%rax,1)
L83:
  movsd  (%rbx),%xmm2
  movsd  0x8(%rbx),%xmm1
L72:
  comisd %xmm2,%xmm5
  jb     L173
  comisd %xmm5,%xmm1
  jbe    L29
  pxor   %xmm6,%xmm6
  xor    %eax,%eax
  comisd %xmm6,%xmm0
  seta   %al
  add    %eax,%r14d
L29:
  add    $0x1,%rbp
  add    $0x8,%rbx
  cmp    %r13,%rbp
  je     L126
L70:
  movsd  (%r12,%rbp,8),%xmm0
  movsd  0x8(%rbx),%xmm3
  movsd  %xmm5,0x8(%rsp)
  movsd  0x8(%r12,%rbp,8),%xmm2
  movsd  (%rbx),%xmm1
  movsd  %xmm4,(%rsp)
  call   <reg_poly_is_left@plt>
  pxor   %xmm7,%xmm7
  movsd  (%rsp),%xmm4
  movsd  0x8(%rsp),%xmm5
  ucomisd %xmm7,%xmm0
  jp     L83
  jne    L83
  movsd  (%r12,%rbp,8),%xmm7
  movsd  0x8(%r12,%rbp,8),%xmm8
  comisd %xmm4,%xmm7
  jb     L162
  comisd %xmm8,%xmm4
  jb     L162
  movsd  0x8(%rbx),%xmm6
  movsd  (%rbx),%xmm3
L178:
  comisd %xmm5,%xmm3
  movapd %xmm3,%xmm2
  movapd %xmm6,%xmm1
  jb     L27
  comisd %xmm6,%xmm5
  jae    L107
L27:
  comisd %xmm5,%xmm6
  jb     L72
  comisd %xmm3,%xmm5
  jae    L107
L173:
  comisd %xmm1,%xmm5
  jb     L29
  pxor   %xmm6,%xmm6
  xor    %eax,%eax
  comisd %xmm0,%xmm6
  seta   %al
  add    $0x1,%rbp
  add    $0x8,%rbx
  sub    %eax,%r14d
  cmp    %r13,%rbp
  jne    L70
L126:
  add    $0x10,%rsp
  mov    %r14d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
L162:
  comisd %xmm4,%xmm8
  movsd  (%rbx),%xmm3
  movsd  0x8(%rbx),%xmm6
  movapd %xmm3,%xmm2
  movapd %xmm6,%xmm1
  jb     L72
  comisd %xmm7,%xmm4
  jb     L72
  jmp    L178
L107:
  add    $0x10,%rsp
  mov    $0x1,%r14d
  pop    %rbx
  mov    %r14d,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L118:
  xor    %r14d,%r14d
  jmp    L126
```

assistant: ```c
int reg_poly_winding_num(double *xpos, double *ypos, long nPoints, double x, double y) {
  int wn = 0;
  long ii;
  double isLeft;
  for (ii = 0; ii < nPoints - 1; ii++) {
    isLeft = reg_poly_is_left(xpos[ii], ypos[ii], xpos[ii + 1], ypos[ii + 1], x, y);
    if (isLeft == 0) {
      if (((x <= xpos[ii] && x >= xpos[ii + 1]) || (x <= xpos[ii + 1] && x >= xpos[ii])) && ((y <= ypos[ii] && y >= ypos[ii + 1]) || (y <= ypos[ii + 1] && y >= ypos[ii]))) {
        return 1;
      }
    }
    if (ypos[ii] <= y) {
      if (ypos[ii + 1] > y) {
        if (isLeft > 0) {
          wn++;
        }
      }
    } else {
      if (ypos[ii + 1] <= y) {
        if (isLeft < 0) {
          wn--;
        }
      }
    }
  }
  return wn;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<reg_poly_winding_num>:
  endbr64
  push   %r14
  push   %r13
  lea    -0x1(%rdx),%r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x10,%rsp
  test   %r13,%r13
  jle    L120
  mov    %rdi,%r12
  movapd %xmm0,%xmm4
  movapd %xmm1,%xmm5
  mov    %rsi,%rbx
  xor    %ebp,%ebp
  xor    %r14d,%r14d
  jmp    L77
  nopw   0x0(%rax,%rax,1)
L14:
  movsd  (%rbx),%xmm2
  movsd  0x8(%rbx),%xmm1
L122:
  comisd %xmm2,%xmm5
  jb     L28
  comisd %xmm5,%xmm1
  jbe    L25
  pxor   %xmm6,%xmm6
  xor    %eax,%eax
  comisd %xmm6,%xmm0
  seta   %al
  add    %eax,%r14d
L25:
  add    $0x1,%rbp
  add    $0x8,%rbx
  cmp    %r13,%rbp
  je     L140
L77:
  movsd  (%r12,%rbp,8),%xmm0
  movsd  0x8(%rbx),%xmm3
  movsd  %xmm5,0x8(%rsp)
  movsd  0x8(%r12,%rbp,8),%xmm2
  movsd  (%rbx),%xmm1
  movsd  %xmm4,(%rsp)
  call   <reg_poly_is_left@plt>
  pxor   %xmm7,%xmm7
  movsd  (%rsp),%xmm4
  movsd  0x8(%rsp),%xmm5
  ucomisd %xmm7,%xmm0
  jp     L14
  jne    L14
  movsd  (%r12,%rbp,8),%xmm7
  movsd  0x8(%r12,%rbp,8),%xmm8
  comisd %xmm4,%xmm7
  jb     L117
  comisd %xmm8,%xmm4
  jb     L117
  movsd  0x8(%rbx),%xmm6
  movsd  (%rbx),%xmm3
L185:
  comisd %xmm5,%xmm3
  movapd %xmm3,%xmm2
  movapd %xmm6,%xmm1
  jb     L131
  comisd %xmm6,%xmm5
  jae    L40
L131:
  comisd %xmm5,%xmm6
  jb     L122
  comisd %xmm3,%xmm5
  jae    L40
L28:
  comisd %xmm1,%xmm5
  jb     L25
  pxor   %xmm6,%xmm6
  xor    %eax,%eax
  comisd %xmm0,%xmm6
  seta   %al
  add    $0x1,%rbp
  add    $0x8,%rbx
  sub    %eax,%r14d
  cmp    %r13,%rbp
  jne    L77
L140:
  add    $0x10,%rsp
  mov    %r14d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
L117:
  comisd %xmm4,%xmm8
  movsd  (%rbx),%xmm3
  movsd  0x8(%rbx),%xmm6
  movapd %xmm3,%xmm2
  movapd %xmm6,%xmm1
  jb     L122
  comisd %xmm7,%xmm4
  jb     L122
  jmp    L185
L40:
  add    $0x10,%rsp
  mov    $0x1,%r14d
  pop    %rbx
  mov    %r14d,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L120:
  xor    %r14d,%r14d
  jmp    L140
```

assistant: ```c
int reg_poly_winding_num(double *xpos, double *ypos, long nPoints, double x, double y) {
  int wn = 0;
  long ii;
  double isLeft;
  for (ii = 0; ii < nPoints - 1; ii++) {
    isLeft = reg_poly_is_left(xpos[ii], ypos[ii], xpos[ii + 1], ypos[ii + 1], x, y);
    if (isLeft == 0) {
      if (((x <= xpos[ii] && x >= xpos[ii + 1]) || (x <= xpos[ii + 1] && x >= xpos[ii])) && ((y <= ypos[ii] && y >= ypos[ii + 1]) || (y <= ypos[ii + 1] && y >= ypos[ii]))) {
        return 1;
      }
    }
    if (ypos[ii] <= y) {
      if (ypos[ii + 1] > y) {
        if (isLeft > 0) {
          wn++;
        }
      }
    } else {
      if (ypos[ii + 1] <= y) {
        if (isLeft < 0) {
          wn--;
        }
      }
    }
  }
  return wn;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<main>:
  endbr64
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  lea    D34(%rip),%rdi
  call   <puts@plt>
  lea    0x8(%rsp),%rsi
  lea    D78(%rip),%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  lea    D20(%rip),%rdi
  call   <puts@plt>
  lea    0x10(%rsp),%rsi
  lea    0x18(%rsp),%rcx
  lea    0x14(%rsp),%rdx
  lea    0x20(%rsp),%r9
  lea    0x1c(%rsp),%r8
  lea    D48(%rip),%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  movss  0x10(%rsp),%xmm0
  addss  0x14(%rsp),%xmm0
  addss  0x18(%rsp),%xmm0
  addss  0x1c(%rsp),%xmm0
  addss  0x20(%rsp),%xmm0
  divss  D25(%rip),%xmm0
  comiss D17(%rip),%xmm0
  jbe    L8
  cvtss2sd %xmm0,%xmm0
  mov    0x8(%rsp),%rsi
  lea    D63(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
L10:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L19
  add    $0x38,%rsp
  ret
L8:
  cvtss2sd %xmm0,%xmm0
  mov    0x8(%rsp),%rsi
  lea    D6(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  jmp    L10
L19:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: label: D34
data_type: string
name: extract_symbolic_data
arguments: label: D78
data_type: string
name: extract_symbolic_data
arguments: label: D20
data_type: string
name: extract_symbolic_data
arguments: label: D48
data_type: string
name: extract_symbolic_data
arguments: label: D25
data_type: byte[4]
name: extract_symbolic_data
arguments: label: D17
data_type: byte[4]
name: extract_symbolic_data
arguments: label: D63
data_type: string
name: extract_symbolic_data
arguments: label: D6
data_type: string

tool: D34: Ingresa tu matricula

tool: D78: %ld

tool: D20: Ingresa la calificacion de 5 materias, separadas por un espacio

tool: D48: %f %f %f %f %f

tool: {"D25": [0x00,0x00,0xa0,0x40]}

tool: {"D17": [0x00,0x00,0xc0,0x40]}

tool: D63: Aprobado : %ld ::: %.1f 


tool: D6: %ld ::: %.1f 


assistant: ```c
void main() {
  long int matricula;
  float calf[5], promedio;
  printf("Ingresa tu matricula\n");
  scanf("%ld", &matricula);
  printf("Ingresa la calificacion de 5 materias, separadas por un espacio\n");
  scanf("%f %f %f %f %f", &calf[0], &calf[1], &calf[2], &calf[3], &calf[4]);
  promedio = (calf[0] + calf[1] + calf[2] + calf[3] + calf[4]) / 5;
  if (promedio > 6) {
    printf("Aprobado : %ld ::: %.1f \n", matricula, promedio);
  } else {
    printf("%ld ::: %.1f \n", matricula, promedio);
  }
  return;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<main>:
  endbr64
  sub    $0x38,%rsp
  lea    D11(%rip),%rdi
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  call   <puts@plt>
  lea    0x8(%rsp),%rsi
  lea    D34(%rip),%rdi
  xor    %eax,%eax
  call   <scanf@plt>
  lea    D22(%rip),%rdi
  call   <puts@plt>
  lea    0x10(%rsp),%rsi
  xor    %eax,%eax
  lea    0x18(%rsp),%rcx
  lea    0x14(%rsp),%rdx
  lea    0x20(%rsp),%r9
  lea    0x1c(%rsp),%r8
  lea    D23(%rip),%rdi
  call   <scanf@plt>
  movss  0x10(%rsp),%xmm0
  mov    0x8(%rsp),%rsi
  addss  0x14(%rsp),%xmm0
  addss  0x18(%rsp),%xmm0
  addss  0x1c(%rsp),%xmm0
  addss  0x20(%rsp),%xmm0
  divss  D35(%rip),%xmm0
  comiss D50(%rip),%xmm0
  cvtss2sd %xmm0,%xmm0
  jbe    L4
  lea    D41(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
L19:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L9
  add    $0x38,%rsp
  ret
L4:
  lea    D66(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  jmp    L19
L9:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_tag: D11
data_type: string
name: retrieve_data
arguments: data_tag: D34
data_type: string
name: retrieve_data
arguments: data_tag: D22
data_type: string
name: retrieve_data
arguments: data_tag: D23
data_type: string
name: retrieve_data
arguments: data_tag: D35
data_type: byte[4]
name: retrieve_data
arguments: data_tag: D50
data_type: byte[4]
name: retrieve_data
arguments: data_tag: D41
data_type: string
name: retrieve_data
arguments: data_tag: D66
data_type: string

tool: D11: Ingresa tu matricula

tool: D34: %ld

tool: D22: Ingresa la calificacion de 5 materias, separadas por un espacio

tool: D23: %f %f %f %f %f

tool: {"D35": [0x00,0x00,0xa0,0x40]}

tool: {"D50": [0x00,0x00,0xc0,0x40]}

tool: D41: Aprobado : %ld ::: %.1f 


tool: D66: %ld ::: %.1f 


assistant: ```c
void main() {
  long int matricula;
  float calf[5], promedio;
  printf("Ingresa tu matricula\n");
  scanf("%ld", &matricula);
  printf("Ingresa la calificacion de 5 materias, separadas por un espacio\n");
  scanf("%f %f %f %f %f", &calf[0], &calf[1], &calf[2], &calf[3], &calf[4]);
  promedio = (calf[0] + calf[1] + calf[2] + calf[3] + calf[4]) / 5;
  if (promedio > 6) {
    printf("Aprobado : %ld ::: %.1f \n", matricula, promedio);
  } else {
    printf("%ld ::: %.1f \n", matricula, promedio);
  }
  return;
}
```