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

```asm
<match>:
  endbr64
  push   %r15
  mov    %rdi,%r15
  push   %r14
  push   %r13
  mov    %rsi,%r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %r15,%rbp
  push   %rbx
  mov    %r15,%rbx
  sub    $0x18,%rsp
  movzbl (%rdi),%edi
  movzbl (%rsi),%eax
  movl   $0x0,0xc(%rsp)
  nop
L172:
  cmp    $0x2a,%dil
  je     L178
L186:
  test   %dil,%dil
  je     L46
L113:
  test   %al,%al
  je     L70
L201:
  call   <tolower@plt>
  movzbl 0x0(%r13),%edi
  mov    %rax,%r14
  call   <tolower@plt>
  cmp    %rax,%r14
  je     L72
  cmpb   $0x3f,(%rbx)
  je     L59
  mov    0xc(%rsp),%eax
  test   %eax,%eax
  je     L70
  movzbl 0x0(%rbp),%edi
  lea    0x1(%r12),%r13
  movzbl 0x1(%r12),%eax
  mov    %rbp,%rbx
  mov    %r13,%r12
  cmp    $0x2a,%dil
  jne    L186
  xchg   %ax,%ax
L178:
  movzbl 0x1(%rbx),%edi
  add    $0x1,%rbx
  cmp    $0x2a,%dil
  je     L178
  movl   $0x1,0xc(%rsp)
  mov    %r13,%r12
  mov    %rbx,%rbp
  test   %dil,%dil
  jne    L113
  nopl   0x0(%rax)
L46:
  test   %al,%al
  je     L115
  lea    -0x1(%rbx),%rax
  cmp    %rax,%r15
  jb     L82
  jmp    L47
  nopl   0x0(%rax,%rax,1)
L196:
  sub    $0x1,%rax
  cmp    %rax,%r15
  je     L47
L82:
  movzbl (%rax),%edx
  cmp    $0x3f,%dl
  je     L196
  cmp    $0x2a,%dl
  jne    L47
  cmp    %rax,%r15
  jb     L115
L47:
  mov    0xc(%rsp),%edx
  test   %edx,%edx
  je     L70
  lea    0x1(%r12),%r13
  movzbl 0x0(%rbp),%edi
  mov    %rbp,%rbx
  mov    %r13,%r12
  jmp    L201
  nopw   0x0(%rax,%rax,1)
L72:
  movzbl (%rbx),%edi
  test   %dil,%dil
  jne    L59
L151:
  movzbl 0x0(%r13),%eax
  test   %al,%al
  je     L172
  movzbl 0x1(%r13),%eax
  add    $0x1,%r13
  jmp    L172
  nopl   0x0(%rax,%rax,1)
L59:
  movzbl 0x1(%rbx),%edi
  add    $0x1,%rbx
  jmp    L151
  nopw   0x0(%rax,%rax,1)
L70:
  add    $0x18,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L115:
  add    $0x18,%rsp
  mov    $0x1,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
int match(const char *mask, const char *name) {
  const unsigned char *m = (const unsigned char *)mask;
  const unsigned char *n = (const unsigned char *)name;
  const unsigned char *ma = (const unsigned char *)mask;
  const unsigned char *na = (const unsigned char *)name;
  int wild = 0;
loop:
  if (*m == '*') {
    while (*m == '*')
      m++;
    wild = 1;
    ma = m;
    na = n;
  }
  if (!*m) {
    if (!*n)
      return 1;
    for (m--; (m > (const unsigned char *)mask) && (*m == '?'); m--)
      ;
    if (*m == '*' && (m > (const unsigned char *)mask))
      return 1;
    if (!wild)
      return 0;
    m = ma;
    n = ++na;
  } else if (!*n) {
    while (*m == '*')
      m++;
    return (*m == 0);
  }
  if (tolower(*m) != tolower(*n) && *m != '?') {
    if (!wild)
      return 0;
    m = ma;
    n = ++na;
  } else {
    if (*m)
      m++;
    if (*n)
      n++;
  }
  goto loop;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<parse_size>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %esi,-0x3c(%rbp)
  mov    %rdx,-0x48(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x676d6b00,-0xf(%rbp)
  movw   $0x7074,-0xb(%rbp)
  movb   $0x65,-0x9(%rbp)
  lea    -0x28(%rbp),%rcx
  mov    -0x38(%rbp),%rax
  mov    $0x0,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strtoull@plt>
  mov    %rax,-0x18(%rbp)
  mov    D9(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,-0x18(%rbp)
  jne    L12
  mov    $0xffffffff,%eax
  jmp    L78
L12:
  mov    -0x18(%rbp),%rax
  mov    %eax,-0x30(%rbp)
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L23
  movl   $0x1,-0x2c(%rbp)
  movq   $0x0,-0x20(%rbp)
  jmp    L58
L17:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <tolower@plt>
  lea    -0xf(%rbp),%rcx
  mov    -0x20(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rdx),%edx
  cmp    %dl,%al
  jne    L0
  mov    -0x30(%rbp),%eax
  imul   -0x2c(%rbp),%eax
  mov    %eax,-0x30(%rbp)
  mov    -0x28(%rbp),%rax
  add    $0x1,%rax
  mov    %rax,-0x28(%rbp)
  jmp    L23
L0:
  mov    -0x2c(%rbp),%eax
  imul   -0x3c(%rbp),%eax
  mov    %eax,-0x2c(%rbp)
  addq   $0x1,-0x20(%rbp)
L58:
  cmpq   $0x6,-0x20(%rbp)
  jbe    L17
L23:
  mov    -0x28(%rbp),%rdx
  mov    -0x48(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0x30(%rbp),%eax
L78:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L62
  call   <__stack_chk_fail@plt>
L62:
  leave
  ret
```

assistant: ```c
off_t parse_size(const char *str, int base, char **suf) {
  char mul[] = {'\0', 'k', 'm', 'g', 't', 'p', 'e'};
  char *inv;
  off_t size;
  unsigned long long l = strtoull(str, &inv, 0);
  if (l == ULLONG_MAX)
    return -1;
  size = (off_t)l;
  if (*inv != '\0') {
    size_t i;
    off_t mn = 1;
    for (i = 0; i < sizeof(mul); i++) {
      if (tolower(*inv) == mul[i]) {
        size *= mn;
        inv++;
        break;
      }
      mn *= base;
    }
  }
  *suf = inv;
  return size;
}
```
user: What is the c source code of the assembly code below:

```asm
<parse_size>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %esi,%r12d
  mov    %rdx,%r14
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  movl   $0x676d6b00,0x21(%rsp)
  movw   $0x7074,0x25(%rsp)
  movb   $0x65,0x27(%rsp)
  lea    0x18(%rsp),%rsi
  mov    $0x0,%edx
  call   <strtoull@plt>
  mov    %rax,%r13
  mov    D4(%rip),%rax
  cmp    %r13,(%rax)
  je     L16
  mov    %r13d,0xc(%rsp)
  mov    0x18(%rsp),%rax
  cmpb   $0x0,(%rax)
  je     L13
  lea    0x21(%rsp),%rbx
  lea    0x28(%rsp),%r15
  mov    $0x1,%ebp
L15:
  mov    0x18(%rsp),%rax
  movsbl (%rax),%edi
  call   <tolower@plt>
  cmp    (%rbx),%al
  je     L6
  imul   %r12d,%ebp
  add    $0x1,%rbx
  cmp    %r15,%rbx
  jne    L15
L13:
  mov    0x18(%rsp),%rax
  mov    %rax,(%r14)
L45:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L36
  mov    0xc(%rsp),%eax
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L6:
  imul   %r13d,%ebp
  mov    %ebp,0xc(%rsp)
  addq   $0x1,0x18(%rsp)
  jmp    L13
L16:
  movl   $0xffffffff,0xc(%rsp)
  jmp    L45
L36:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
off_t parse_size(const char *str, int base, char **suf) {
  char mul[] = {'\0', 'k', 'm', 'g', 't', 'p', 'e'};
  char *inv;
  off_t size;
  unsigned long long l = strtoull(str, &inv, 0);
  if (l == ULLONG_MAX)
    return -1;
  size = (off_t)l;
  if (*inv != '\0') {
    size_t i;
    off_t mn = 1;
    for (i = 0; i < sizeof(mul); i++) {
      if (tolower(*inv) == mul[i]) {
        size *= mn;
        inv++;
        break;
      }
      mn *= base;
    }
  }
  *suf = inv;
  return size;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<parse_size>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %esi,%ebx
  sub    $0x38,%rsp
  mov    %rdx,0x8(%rsp)
  lea    0x18(%rsp),%rsi
  xor    %edx,%edx
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  mov    $0x7074,%eax
  movl   $0x676d6b00,0x21(%rsp)
  mov    %ax,0x25(%rsp)
  movb   $0x65,0x27(%rsp)
  call   <strtoull@plt>
  mov    %rax,%rbp
  mov    D6(%rip),%rax
  cmp    %rbp,(%rax)
  je     L30
  mov    0x18(%rsp),%rax
  mov    %ebp,%r14d
  movsbl (%rax),%edi
  test   %dil,%dil
  je     L18
  lea    0x21(%rsp),%r15
  lea    0x28(%rsp),%r13
  mov    $0x1,%r12d
  jmp    L0
  nopl   0x0(%rax)
L46:
  movsbl (%rax),%edi
L0:
  call   <tolower@plt>
  cmp    (%r15),%al
  je     L29
  add    $0x1,%r15
  imul   %ebx,%r12d
  mov    0x18(%rsp),%rax
  cmp    %r13,%r15
  jne    L46
L18:
  mov    0x8(%rsp),%rcx
  mov    %rax,(%rcx)
L31:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L17
  add    $0x38,%rsp
  mov    %r14d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L29:
  mov    0x18(%rsp),%rax
  mov    %r12d,%r14d
  imul   %ebp,%r14d
  add    $0x1,%rax
  jmp    L18
L30:
  mov    $0xffffffff,%r14d
  jmp    L31
L17:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
off_t parse_size(const char *str, int base, char **suf) {
  char mul[] = {'\0', 'k', 'm', 'g', 't', 'p', 'e'};
  char *inv;
  off_t size;
  unsigned long long l = strtoull(str, &inv, 0);
  if (l == ULLONG_MAX)
    return -1;
  size = (off_t)l;
  if (*inv != '\0') {
    size_t i;
    off_t mn = 1;
    for (i = 0; i < sizeof(mul); i++) {
      if (tolower(*inv) == mul[i]) {
        size *= mn;
        inv++;
        break;
      }
      mn *= base;
    }
  }
  *suf = inv;
  return size;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<parse_size>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %esi,%ebx
  sub    $0x38,%rsp
  mov    %rdx,0x8(%rsp)
  lea    0x18(%rsp),%rsi
  xor    %edx,%edx
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  mov    $0x7074,%eax
  movl   $0x676d6b00,0x21(%rsp)
  mov    %ax,0x25(%rsp)
  movb   $0x65,0x27(%rsp)
  call   <strtoull@plt>
  mov    %rax,%rbp
  mov    D5(%rip),%rax
  cmp    %rbp,(%rax)
  je     L47
  mov    0x18(%rsp),%rax
  mov    %ebp,%r14d
  movsbl (%rax),%edi
  test   %dil,%dil
  je     L63
  lea    0x21(%rsp),%r15
  lea    0x28(%rsp),%r13
  mov    $0x1,%r12d
  jmp    L53
  nopl   0x0(%rax)
L37:
  movsbl (%rax),%edi
L53:
  call   <tolower@plt>
  cmp    (%r15),%al
  je     L10
  add    $0x1,%r15
  imul   %ebx,%r12d
  mov    0x18(%rsp),%rax
  cmp    %r13,%r15
  jne    L37
L63:
  mov    0x8(%rsp),%rcx
  mov    %rax,(%rcx)
L67:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L30
  add    $0x38,%rsp
  mov    %r14d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L10:
  mov    0x18(%rsp),%rax
  mov    %r12d,%r14d
  imul   %ebp,%r14d
  add    $0x1,%rax
  jmp    L63
L47:
  mov    $0xffffffff,%r14d
  jmp    L67
L30:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
off_t parse_size(const char *str, int base, char **suf) {
  char mul[] = {'\0', 'k', 'm', 'g', 't', 'p', 'e'};
  char *inv;
  off_t size;
  unsigned long long l = strtoull(str, &inv, 0);
  if (l == ULLONG_MAX)
    return -1;
  size = (off_t)l;
  if (*inv != '\0') {
    size_t i;
    off_t mn = 1;
    for (i = 0; i < sizeof(mul); i++) {
      if (tolower(*inv) == mul[i]) {
        size *= mn;
        inv++;
        break;
      }
      mn *= base;
    }
  }
  *suf = inv;
  return size;
}
```
user: What would the C source look like for the assembly code provided here:

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

assistant: ```c
int gen_50(void) {
  handle_50(0);
  return 0;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

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

assistant: ```c
int gen_50(void) {
  handle_50(0);
  return 0;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

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

assistant: ```c
int gen_50(void) {
  handle_50(0);
  return 0;
}
```
user: Translate the below assembly code into C programming language:

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

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

```asm
<pputrast>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %ecx,-0x3c(%rbp)
  mov    %r8d,-0x40(%rbp)
  mov    %r9d,-0x44(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x28(%rbp),%rax
  mov    $0x180,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <creat@plt>
  mov    %eax,-0xc(%rbp)
  cmpl   $0x0,-0xc(%rbp)
  jle    L58
  mov    -0x30(%rbp),%rcx
  mov    -0xc(%rbp),%eax
  mov    $0x20,%edx
  mov    %rcx,%rsi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <write@plt>
  cmp    $0x20,%eax
  jne    L93
  movl   $0x0,-0x14(%rbp)
  jmp    L89
L76:
  movl   $0x0,-0x10(%rbp)
  jmp    L53
L94:
  mov    -0x44(%rbp),%eax
  imul   -0x14(%rbp),%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  cvttss2si %xmm0,%eax
  mov    %al,-0x15(%rbp)
  lea    -0x15(%rbp),%rcx
  mov    -0xc(%rbp),%eax
  mov    $0x1,%edx
  mov    %rcx,%rsi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <write@plt>
  cmp    $0x1,%eax
  je     L43
  mov    $0x8,%edi
  mov    $0x0,%eax
  call   <error@plt>
L43:
  addl   $0x1,-0x10(%rbp)
L53:
  mov    -0x10(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jl     L94
  addl   $0x1,-0x14(%rbp)
L89:
  mov    -0x14(%rbp),%eax
  cmp    -0x40(%rbp),%eax
  jl     L76
  jmp    L67
L93:
  mov    $0x9,%edi
  mov    $0x0,%eax
  call   <error@plt>
  jmp    L67
L58:
  mov    $0xa,%edi
  mov    $0x0,%eax
  call   <error@plt>
L67:
  mov    -0xc(%rbp),%eax
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <close@plt>
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L25
  call   <__stack_chk_fail@plt>
L25:
  leave
  ret
```

assistant: ```c
void pputrast(fn, hd, bf, sx, sy, r) char *fn;
unsigned char hd[32];
float bf[512 * 512];
int sx, sy, r;
{
  int fd, i, j;
  unsigned char c;
  if ((fd = creat(fn, 0600)) > 0) {
    ;
    if (write(fd, hd, 32) == 32) {
      for (i = 0; i < sy; i++) {
        for (j = 0; j < sx; j++) {
          c = (unsigned char)bf[r * i + j];
          if (write(fd, &c, sizeof(c)) != 1) {
            error(8);
          }
        }
      }
    } else {
      error(9);
    }
  } else {
    error(10);
  }
  close(fd);
}
```
user: Translate the below assembly code into C programming language:

```asm
<pputrast>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rsi,%rbx
  mov    %rdx,0x10(%rsp)
  mov    %ecx,%r12d
  mov    %ecx,0x8(%rsp)
  mov    %r8d,%r15d
  mov    %r8d,0xc(%rsp)
  mov    %r9d,0x18(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  mov    $0x180,%esi
  call   <creat@plt>
  mov    %eax,%ebp
  test   %eax,%eax
  jle    L67
  mov    $0x20,%edx
  mov    %rbx,%rsi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <write@plt>
  cmp    $0x20,%eax
  jne    L115
  test   %r15d,%r15d
  jle    L116
  mov    $0x0,%r15d
  mov    $0x0,%r14d
  lea    -0x1(%r12),%eax
  mov    %eax,0x1c(%rsp)
  jmp    L50
L37:
  add    $0x4,%rbx
  cmp    %r13,%rbx
  je     L45
L101:
  cvttss2si (%rbx),%eax
  mov    %al,0x27(%rsp)
  mov    $0x1,%edx
  mov    %r12,%rsi
  mov    %ebp,%edi
  mov    $0x0,%eax
  call   <write@plt>
  cmp    $0x1,%eax
  je     L37
  mov    $0x8,%edi
  mov    $0x0,%eax
  call   <error@plt>
  jmp    L37
L45:
  add    $0x1,%r14d
  add    0x18(%rsp),%r15d
  cmp    %r14d,0xc(%rsp)
  je     L116
L50:
  cmpl   $0x0,0x8(%rsp)
  jle    L45
  movslq %r15d,%rdx
  mov    0x10(%rsp),%rcx
  lea    (%rcx,%rdx,4),%rbx
  mov    0x1c(%rsp),%eax
  add    %rdx,%rax
  lea    0x4(%rcx,%rax,4),%r13
  lea    0x27(%rsp),%r12
  jmp    L101
L115:
  mov    $0x9,%edi
  mov    $0x0,%eax
  call   <error@plt>
  jmp    L116
L67:
  mov    $0xa,%edi
  mov    $0x0,%eax
  call   <error@plt>
L116:
  mov    %ebp,%edi
  mov    $0x0,%eax
  call   <close@plt>
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L59
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L59:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void pputrast(fn, hd, bf, sx, sy, r) char *fn;
unsigned char hd[32];
float bf[512 * 512];
int sx, sy, r;
{
  int fd, i, j;
  unsigned char c;
  if ((fd = creat(fn, 0600)) > 0) {
    ;
    if (write(fd, hd, 32) == 32) {
      for (i = 0; i < sy; i++) {
        for (j = 0; j < sx; j++) {
          c = (unsigned char)bf[r * i + j];
          if (write(fd, &c, sizeof(c)) != 1) {
            error(8);
          }
        }
      }
    } else {
      error(9);
    }
  } else {
    error(10);
  }
  close(fd);
}
```
user: What is the c source code of the assembly code below?

```asm
<pputrast>:
  endbr64
  push   %r15
  mov    %ecx,%r15d
  push   %r14
  push   %r13
  push   %r12
  mov    %rsi,%r12
  mov    $0x180,%esi
  push   %rbp
  push   %rbx
  mov    %r8d,%ebx
  sub    $0x38,%rsp
  mov    %rdx,0x10(%rsp)
  mov    %ecx,0x8(%rsp)
  mov    %r8d,0xc(%rsp)
  mov    %r9d,0x18(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  call   <creat@plt>
  mov    %eax,%ebp
  test   %eax,%eax
  jle    L53
  mov    %eax,%edi
  mov    $0x20,%edx
  xor    %eax,%eax
  mov    %r12,%rsi
  call   <write@plt>
  cmp    $0x20,%eax
  jne    L1
  test   %ebx,%ebx
  jle    L14
  lea    -0x1(%r15),%eax
  xor    %r14d,%r14d
  xor    %r13d,%r13d
  mov    %eax,0x1c(%rsp)
  nopw   0x0(%rax,%rax,1)
L38:
  mov    0x8(%rsp),%eax
  test   %eax,%eax
  jle    L39
  mov    0x1c(%rsp),%eax
  mov    0x10(%rsp),%rcx
  movslq %r14d,%rdx
  lea    0x27(%rsp),%rbx
  add    %rdx,%rax
  lea    (%rcx,%rdx,4),%r15
  lea    0x4(%rcx,%rax,4),%r12
  nopl   (%rax)
L62:
  cvttss2si (%r15),%eax
  mov    $0x1,%edx
  mov    %rbx,%rsi
  mov    %ebp,%edi
  mov    %al,0x27(%rsp)
  xor    %eax,%eax
  call   <write@plt>
  cmp    $0x1,%eax
  je     L68
  mov    $0x8,%edi
  xor    %eax,%eax
  call   <error@plt>
L68:
  add    $0x4,%r15
  cmp    %r12,%r15
  jne    L62
L39:
  add    $0x1,%r13d
  add    0x18(%rsp),%r14d
  cmp    %r13d,0xc(%rsp)
  jne    L38
  jmp    L14
  cs nopw 0x0(%rax,%rax,1)
L1:
  mov    $0x9,%edi
  xor    %eax,%eax
  call   <error@plt>
L14:
  xor    %eax,%eax
  mov    %ebp,%edi
  call   <close@plt>
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L55
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L53:
  mov    $0xa,%edi
  xor    %eax,%eax
  call   <error@plt>
  jmp    L14
L55:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void pputrast(fn, hd, bf, sx, sy, r) char *fn;
unsigned char hd[32];
float bf[512 * 512];
int sx, sy, r;
{
  int fd, i, j;
  unsigned char c;
  if ((fd = creat(fn, 0600)) > 0) {
    ;
    if (write(fd, hd, 32) == 32) {
      for (i = 0; i < sy; i++) {
        for (j = 0; j < sx; j++) {
          c = (unsigned char)bf[r * i + j];
          if (write(fd, &c, sizeof(c)) != 1) {
            error(8);
          }
        }
      }
    } else {
      error(9);
    }
  } else {
    error(10);
  }
  close(fd);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<pputrast>:
  endbr64
  push   %r15
  mov    %r8d,%r15d
  push   %r14
  mov    %rsi,%r14
  mov    $0x180,%esi
  push   %r13
  mov    %rdx,%r13
  push   %r12
  mov    %ecx,%r12d
  push   %rbp
  push   %rbx
  movslq %r9d,%rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  call   <creat@plt>
  mov    %eax,%ebp
  test   %eax,%eax
  jle    L71
  mov    %eax,%edi
  mov    $0x20,%edx
  xor    %eax,%eax
  mov    %r14,%rsi
  call   <write@plt>
  cmp    $0x20,%eax
  jne    L23
  test   %r15d,%r15d
  jle    L6
  test   %r12d,%r12d
  jle    L6
  lea    0x0(,%rbx,4),%rax
  mov    $0xfffffffffffffffc,%rdx
  mov    %rax,(%rsp)
  lea    -0x1(%r12),%eax
  lea    0x17(%rsp),%r12
  shl    $0x2,%rax
  sub    %rax,%rdx
  lea    0x4(%r13,%rax,1),%rbx
  xor    %r13d,%r13d
  mov    %rdx,0x8(%rsp)
  nopw   0x0(%rax,%rax,1)
L41:
  mov    0x8(%rsp),%rax
  lea    (%rax,%rbx,1),%r14
  nopl   0x0(%rax)
L24:
  cvttss2si (%r14),%eax
  mov    $0x1,%edx
  mov    %r12,%rsi
  mov    %ebp,%edi
  mov    %al,0x17(%rsp)
  xor    %eax,%eax
  call   <write@plt>
  cmp    $0x1,%eax
  je     L40
  mov    $0x8,%edi
  xor    %eax,%eax
  call   <error@plt>
L40:
  add    $0x4,%r14
  cmp    %r14,%rbx
  jne    L24
  add    $0x1,%r13d
  add    (%rsp),%rbx
  cmp    %r13d,%r15d
  jne    L41
  jmp    L6
  nopl   0x0(%rax,%rax,1)
L23:
  mov    $0x9,%edi
  xor    %eax,%eax
  call   <error@plt>
L6:
  xor    %eax,%eax
  mov    %ebp,%edi
  call   <close@plt>
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L76
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L71:
  mov    $0xa,%edi
  xor    %eax,%eax
  call   <error@plt>
  jmp    L6
L76:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void pputrast(fn, hd, bf, sx, sy, r) char *fn;
unsigned char hd[32];
float bf[512 * 512];
int sx, sy, r;
{
  int fd, i, j;
  unsigned char c;
  if ((fd = creat(fn, 0600)) > 0) {
    ;
    if (write(fd, hd, 32) == 32) {
      for (i = 0; i < sy; i++) {
        for (j = 0; j < sx; j++) {
          c = (unsigned char)bf[r * i + j];
          if (write(fd, &c, sizeof(c)) != 1) {
            error(8);
          }
        }
      }
    } else {
      error(9);
    }
  } else {
    error(10);
  }
  close(fd);
}
```
user: What is the c source code of the assembly code below?

```asm
<timespec_mul>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  movsd  %xmm0,-0x20(%rbp)
  mov    -0x18(%rbp),%rax
  movsd  (%rax),%xmm0
  movsd  -0x20(%rbp),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  mov    -0x10(%rbp),%rax
  movq   %rax,%xmm0
  call   <floor@plt>
  movsd  -0x10(%rbp),%xmm1
  subsd  %xmm0,%xmm1
  movsd  D2(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  mov    -0x18(%rbp),%rax
  movsd  0x8(%rax),%xmm0
  mulsd  -0x20(%rbp),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x10(%rbp),%rax
  movq   %rax,%xmm0
  call   <floor@plt>
  movq   %xmm0,%rax
  mov    -0x18(%rbp),%rdx
  mov    %rax,(%rdx)
  mov    -0x8(%rbp),%rax
  movq   %rax,%xmm0
  call   <floor@plt>
  movq   %xmm0,%rax
  mov    -0x18(%rbp),%rdx
  mov    %rax,0x8(%rdx)
  nop
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: tag: D2
type: f64

tool: D2: 1000000000

assistant: ```c
void timespec_mul(struct timespec *t1, double mul) {
  double sec = t1->tv_sec * mul;
  double nsec = (sec - floor(sec)) * 1000000000 + t1->tv_nsec * mul;
  t1->tv_sec = floor(sec);
  t1->tv_nsec = floor(nsec);
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<timespec_mul>:
  endbr64
  movapd %xmm0,%xmm1
  mulsd  (%rdi),%xmm1
  movapd %xmm1,%xmm3
  movsd  D47(%rip),%xmm4
  movapd %xmm1,%xmm2
  andpd  %xmm4,%xmm2
  movsd  D6(%rip),%xmm5
  ucomisd %xmm2,%xmm5
  jbe    L7
  cvttsd2si %xmm1,%rax
  pxor   %xmm2,%xmm2
  cvtsi2sd %rax,%xmm2
  movapd %xmm2,%xmm3
  cmpnlesd %xmm1,%xmm3
  movsd  D15(%rip),%xmm5
  andpd  %xmm5,%xmm3
  subsd  %xmm3,%xmm2
  andnpd %xmm1,%xmm4
  movapd %xmm2,%xmm3
  orpd   %xmm4,%xmm3
L7:
  subsd  %xmm3,%xmm1
  mulsd  D50(%rip),%xmm1
  mulsd  0x8(%rdi),%xmm0
  addsd  %xmm0,%xmm1
  movsd  %xmm3,(%rdi)
  movapd %xmm1,%xmm3
  movsd  D47(%rip),%xmm2
  movapd %xmm1,%xmm0
  andpd  %xmm2,%xmm0
  movsd  D6(%rip),%xmm4
  ucomisd %xmm0,%xmm4
  jbe    L17
  cvttsd2si %xmm1,%rax
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  movapd %xmm0,%xmm3
  cmpnlesd %xmm1,%xmm3
  movsd  D15(%rip),%xmm4
  andpd  %xmm4,%xmm3
  subsd  %xmm3,%xmm0
  andnpd %xmm1,%xmm2
  movapd %xmm0,%xmm3
  orpd   %xmm2,%xmm3
L17:
  movsd  %xmm3,0x8(%rdi)
  ret
```

tool_calls: name: extract_symbolic_data
arguments: tag: D47
type_guessed: byte[8]
name: extract_symbolic_data
arguments: tag: D6
type_guessed: byte[8]
name: extract_symbolic_data
arguments: tag: D15
type_guessed: byte[8]
name: extract_symbolic_data
arguments: tag: D50
type_guessed: f64

tool: {"D47": [0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f]}

tool: {"D6": [0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x43]}

tool: {"D15": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x3f]}

tool: D50: 1000000000

assistant: ```c
void timespec_mul(struct timespec *t1, double mul) {
  double sec = t1->tv_sec * mul;
  double nsec = (sec - floor(sec)) * 1000000000 + t1->tv_nsec * mul;
  t1->tv_sec = floor(sec);
  t1->tv_nsec = floor(nsec);
}
```