ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 请从给定的汇编指令推导出C源代码:

```asm
<sorti>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %edx,-0x20(%rbp)
  mov    -0x1c(%rbp),%eax
  mov    %eax,-0x8(%rbp)
  jmp    L36
L37:
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x20(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x1c(%rbp)
  jmp    L39
L51:
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0x10(%rbp)
  jle    L13
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x1c(%rbp),%eax
  mov    %eax,-0xc(%rbp)
L13:
  addl   $0x1,-0x1c(%rbp)
L39:
  mov    -0x1c(%rbp),%eax
  cmp    -0x8(%rbp),%eax
  jl     L51
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0x10(%rbp)
  je     L34
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x4(%rbp)
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    -0x20(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x18(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x4(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    0x4(%rax),%eax
  mov    %eax,-0x4(%rbp)
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    -0x20(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x18(%rbp),%rdx
  add    %rcx,%rdx
  mov    0x4(%rax),%eax
  mov    %eax,0x4(%rdx)
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x4(%rbp),%eax
  mov    %eax,0x4(%rdx)
L34:
  addl   $0x1,-0x20(%rbp)
L36:
  mov    -0x20(%rbp),%eax
  cmp    -0x8(%rbp),%eax
  jl     L37
  nop
  pop    %rbp
  ret
```

assistant: ```c
int sorti(int arr[][2], int j, int i) {
  int temp, min, pos, n;
  n = j;
  for (; i < n; i++) {
    min = arr[i][0];
    for (j = i + 1; j < n; j++) {
      if (arr[j][0] < min) {
        min = arr[j][0];
        pos = j;
      }
    }
    if (min != arr[i][0]) {
      temp = arr[i][0];
      arr[i][0] = arr[pos][0];
      arr[pos][0] = temp;
      temp = arr[i][1];
      arr[i][1] = arr[pos][1];
      arr[pos][1] = temp;
    }
  }
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<sorti>:
  endbr64
  cmp    %edx,%esi
  jle    L26
  add    $0x1,%edx
  movslq %edx,%r8
  jmp    L10
L41:
  add    $0x1,%rax
  cmp    %eax,%esi
  jle    L27
L40:
  mov    (%rdi,%rax,8),%edx
  cmp    %ecx,%edx
  jge    L41
  mov    %eax,%r9d
  mov    %edx,%ecx
  jmp    L41
L27:
  cmp    %r10d,%ecx
  je     L39
  movslq %r9d,%rax
  lea    (%rdi,%rax,8),%rax
  mov    (%rax),%edx
  mov    %edx,-0x8(%rdi,%r8,8)
  mov    %r10d,(%rax)
  mov    -0x4(%rdi,%r8,8),%edx
  mov    0x4(%rax),%ecx
  mov    %ecx,-0x4(%rdi,%r8,8)
  mov    %edx,0x4(%rax)
L39:
  add    $0x1,%r8
L10:
  mov    -0x8(%rdi,%r8,8),%r10d
  cmp    %r8d,%esi
  jle    L26
  movslq %r8d,%rax
  mov    %r10d,%ecx
  jmp    L40
L26:
  mov    $0x0,%eax
  ret
```

assistant: ```c
int sorti(int arr[][2], int j, int i) {
  int temp, min, pos, n;
  n = j;
  for (; i < n; i++) {
    min = arr[i][0];
    for (j = i + 1; j < n; j++) {
      if (arr[j][0] < min) {
        min = arr[j][0];
        pos = j;
      }
    }
    if (min != arr[i][0]) {
      temp = arr[i][0];
      arr[i][0] = arr[pos][0];
      arr[pos][0] = temp;
      temp = arr[i][1];
      arr[i][1] = arr[pos][1];
      arr[pos][1] = temp;
    }
  }
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<sorti>:
  endbr64
  cmp    %edx,%esi
  jle    L48
  add    $0x1,%edx
  movslq %edx,%r8
  mov    -0x8(%rdi,%r8,8),%r10d
  cmp    %esi,%r8d
  jge    L48
  nopl   0x0(%rax,%rax,1)
L28:
  movslq %r8d,%rax
  mov    %r10d,%ecx
  cs nopw 0x0(%rax,%rax,1)
L9:
  mov    (%rdi,%rax,8),%edx
  cmp    %ecx,%edx
  jge    L16
  mov    %eax,%r9d
  mov    %edx,%ecx
L16:
  add    $0x1,%rax
  cmp    %eax,%esi
  jg     L9
  cmp    %r10d,%ecx
  je     L31
  movslq %r9d,%rax
  lea    (%rdi,%rax,8),%rax
  mov    (%rax),%edx
  mov    %edx,-0x8(%rdi,%r8,8)
  mov    0x4(%rax),%ecx
  mov    %r10d,(%rax)
  mov    -0x4(%rdi,%r8,8),%edx
  mov    %ecx,-0x4(%rdi,%r8,8)
  mov    %edx,0x4(%rax)
L31:
  add    $0x1,%r8
  mov    -0x8(%rdi,%r8,8),%r10d
  cmp    %esi,%r8d
  jl     L28
L48:
  xor    %eax,%eax
  ret
```

assistant: ```c
int sorti(int arr[][2], int j, int i) {
  int temp, min, pos, n;
  n = j;
  for (; i < n; i++) {
    min = arr[i][0];
    for (j = i + 1; j < n; j++) {
      if (arr[j][0] < min) {
        min = arr[j][0];
        pos = j;
      }
    }
    if (min != arr[i][0]) {
      temp = arr[i][0];
      arr[i][0] = arr[pos][0];
      arr[pos][0] = temp;
      temp = arr[i][1];
      arr[i][1] = arr[pos][1];
      arr[pos][1] = temp;
    }
  }
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<sorti>:
  endbr64
  cmp    %edx,%esi
  jle    L52
  add    $0x1,%edx
  movslq %edx,%r8
  mov    -0x8(%rdi,%r8,8),%r10d
  cmp    %r8d,%esi
  jle    L52
  nopl   0x0(%rax,%rax,1)
L6:
  movslq %r8d,%rax
  mov    %r10d,%ecx
  cs nopw 0x0(%rax,%rax,1)
L57:
  mov    (%rdi,%rax,8),%edx
  cmp    %ecx,%edx
  jge    L7
  mov    %eax,%r9d
  mov    %edx,%ecx
L7:
  add    $0x1,%rax
  cmp    %eax,%esi
  jg     L57
  cmp    %r10d,%ecx
  je     L37
  movslq %r9d,%rax
  lea    (%rdi,%rax,8),%rax
  mov    (%rax),%edx
  mov    %edx,-0x8(%rdi,%r8,8)
  mov    0x4(%rax),%ecx
  mov    %r10d,(%rax)
  mov    -0x4(%rdi,%r8,8),%edx
  mov    %ecx,-0x4(%rdi,%r8,8)
  mov    %edx,0x4(%rax)
L37:
  add    $0x1,%r8
  mov    -0x8(%rdi,%r8,8),%r10d
  cmp    %r8d,%esi
  jg     L6
L52:
  xor    %eax,%eax
  ret
```

assistant: ```c
int sorti(int arr[][2], int j, int i) {
  int temp, min, pos, n;
  n = j;
  for (; i < n; i++) {
    min = arr[i][0];
    for (j = i + 1; j < n; j++) {
      if (arr[j][0] < min) {
        min = arr[j][0];
        pos = j;
      }
    }
    if (min != arr[i][0]) {
      temp = arr[i][0];
      arr[i][0] = arr[pos][0];
      arr[pos][0] = temp;
      temp = arr[i][1];
      arr[i][1] = arr[pos][1];
      arr[pos][1] = temp;
    }
  }
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<strtok_r>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  jne    L2
  mov    -0x28(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,-0x18(%rbp)
L2:
  mov    -0x20(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strspn@plt>
  cltq
  add    %rax,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L19
  mov    -0x28(%rbp),%rax
  mov    -0x18(%rbp),%rdx
  mov    %rdx,(%rax)
  mov    $0x0,%eax
  jmp    L43
L19:
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x20(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strpbrk@plt>
  mov    %rax,-0x18(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  jne    L39
  mov    -0x8(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  mov    -0x28(%rbp),%rdx
  mov    %rax,(%rdx)
  jmp    L5
L39:
  mov    -0x18(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    -0x28(%rbp),%rax
  mov    %rdx,(%rax)
L5:
  mov    -0x8(%rbp),%rax
L43:
  leave
  ret
```

assistant: ```c
char *strtok_r(char *s, const char *delim, char **save_ptr) {
  char *token;
  if (s == NULL)
    s = *save_ptr;
  s += strspn(s, delim);
  if (*s == '\0') {
    *save_ptr = s;
    return NULL;
  }
  token = s;
  s = strpbrk(token, delim);
  if (s == NULL)
    *save_ptr = strchr(token, '\0');
  else {
    *s = '\0';
    *save_ptr = s + 1;
  }
  return (token);
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<strtok_r>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  mov    %rsi,%r12
  mov    %rdx,%rbp
  test   %rdi,%rdi
  je     L35
L15:
  mov    %r12,%rsi
  mov    %rbx,%rdi
  call   <strspn@plt>
  cltq
  add    %rax,%rbx
  cmpb   $0x0,(%rbx)
  je     L33
  mov    %r12,%rsi
  mov    %rbx,%rdi
  call   <strpbrk@plt>
  test   %rax,%rax
  je     L7
  movb   $0x0,(%rax)
  add    $0x1,%rax
L14:
  mov    %rax,0x0(%rbp)
  mov    %rbx,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L35:
  mov    (%rdx),%rbx
  jmp    L15
L7:
  mov    $0x0,%esi
  mov    %rbx,%rdi
  call   <strchr@plt>
  jmp    L14
L33:
  mov    %rbx,%rax
  mov    $0x0,%ebx
  jmp    L14
```

assistant: ```c
char *strtok_r(char *s, const char *delim, char **save_ptr) {
  char *token;
  if (s == NULL)
    s = *save_ptr;
  s += strspn(s, delim);
  if (*s == '\0') {
    *save_ptr = s;
    return NULL;
  }
  token = s;
  s = strpbrk(token, delim);
  if (s == NULL)
    *save_ptr = strchr(token, '\0');
  else {
    *s = '\0';
    *save_ptr = s + 1;
  }
  return (token);
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<strtok_r>:
  endbr64
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %rdx,%rbx
  test   %rdi,%rdi
  je     L31
L28:
  mov    %r12,%rdi
  mov    %rbp,%rsi
  call   <strspn@plt>
  cltq
  add    %rax,%r12
  cmpb   $0x0,(%r12)
  je     L6
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <strpbrk@plt>
  test   %rax,%rax
  je     L33
  movb   $0x0,(%rax)
  add    $0x1,%rax
  mov    %rax,(%rbx)
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nop
L31:
  mov    (%rdx),%r12
  jmp    L28
  nopl   (%rax)
L6:
  mov    %r12,%rax
  xor    %r12d,%r12d
  mov    %rax,(%rbx)
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax)
L33:
  mov    %r12,%rdi
  xor    %esi,%esi
  call   <strchr@plt>
  mov    %rax,(%rbx)
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
char *strtok_r(char *s, const char *delim, char **save_ptr) {
  char *token;
  if (s == NULL)
    s = *save_ptr;
  s += strspn(s, delim);
  if (*s == '\0') {
    *save_ptr = s;
    return NULL;
  }
  token = s;
  s = strpbrk(token, delim);
  if (s == NULL)
    *save_ptr = strchr(token, '\0');
  else {
    *s = '\0';
    *save_ptr = s + 1;
  }
  return (token);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<strtok_r>:
  endbr64
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %rdx,%rbx
  test   %rdi,%rdi
  je     L14
L22:
  mov    %r12,%rdi
  mov    %rbp,%rsi
  call   <strspn@plt>
  cltq
  add    %rax,%r12
  cmpb   $0x0,(%r12)
  je     L23
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <strpbrk@plt>
  test   %rax,%rax
  je     L35
  movb   $0x0,(%rax)
  add    $0x1,%rax
  mov    %rax,(%rbx)
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nop
L14:
  mov    (%rdx),%r12
  jmp    L22
  nopl   (%rax)
L23:
  mov    %r12,%rax
  xor    %r12d,%r12d
  mov    %rax,(%rbx)
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax)
L35:
  mov    %r12,%rdi
  xor    %esi,%esi
  call   <strchr@plt>
  mov    %rax,(%rbx)
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
char *strtok_r(char *s, const char *delim, char **save_ptr) {
  char *token;
  if (s == NULL)
    s = *save_ptr;
  s += strspn(s, delim);
  if (*s == '\0') {
    *save_ptr = s;
    return NULL;
  }
  token = s;
  s = strpbrk(token, delim);
  if (s == NULL)
    *save_ptr = strchr(token, '\0');
  else {
    *s = '\0';
    *save_ptr = s + 1;
  }
  return (token);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<daysFrom>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %edi,-0x54(%rbp)
  mov    %esi,-0x58(%rbp)
  mov    %edx,-0x5c(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x40(%rbp)
  movl   $0x1f,-0x3c(%rbp)
  movl   $0x1c,-0x38(%rbp)
  movl   $0x1f,-0x34(%rbp)
  movl   $0x1e,-0x30(%rbp)
  movl   $0x1f,-0x2c(%rbp)
  movl   $0x1e,-0x28(%rbp)
  movl   $0x1f,-0x24(%rbp)
  movl   $0x1f,-0x20(%rbp)
  movl   $0x1e,-0x1c(%rbp)
  movl   $0x1f,-0x18(%rbp)
  movl   $0x1e,-0x14(%rbp)
  movl   $0x1f,-0x10(%rbp)
  movl   $0x0,-0x48(%rbp)
  movl   $0x0,-0x44(%rbp)
  movl   $0x1,-0x48(%rbp)
  jmp    L8
L37:
  mov    -0x48(%rbp),%eax
  cltq
  mov    -0x40(%rbp,%rax,4),%eax
  add    %eax,-0x44(%rbp)
  addl   $0x1,-0x48(%rbp)
L8:
  mov    -0x48(%rbp),%eax
  cmp    -0x58(%rbp),%eax
  jl     L37
  cmpl   $0x2,-0x58(%rbp)
  jle    L40
  mov    -0x54(%rbp),%eax
  and    $0x3,%eax
  test   %eax,%eax
  jne    L64
  mov    -0x54(%rbp),%edx
  movslq %edx,%rax
  imul   $0x51eb851f,%rax,%rax
  shr    $0x20,%rax
  sar    $0x5,%eax
  mov    %edx,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%eax
  imul   $0x64,%eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  test   %eax,%eax
  jne    L2
L64:
  mov    -0x54(%rbp),%edx
  movslq %edx,%rax
  imul   $0x51eb851f,%rax,%rax
  shr    $0x20,%rax
  sar    $0x7,%eax
  mov    %edx,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%eax
  imul   $0x190,%eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  test   %eax,%eax
  jne    L40
L2:
  addl   $0x1,-0x44(%rbp)
L40:
  mov    -0x5c(%rbp),%eax
  add    %eax,-0x44(%rbp)
  mov    -0x44(%rbp),%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L12
  call   <__stack_chk_fail@plt>
L12:
  leave
  ret
```

assistant: ```c
int daysFrom(int year, int month, int day) {
  int monthDays[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  int i = 0;
  int sum = 0;
  for (i = 1; i < month; i++)
    sum += monthDays[i];
  if (month > 2)
    if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0))
      sum += 1;
  sum += day;
  return sum;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<daysFrom>:
  endbr64
  sub    $0x48,%rsp
  mov    %edx,%r8d
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  movl   $0x0,(%rsp)
  movl   $0x1f,0x4(%rsp)
  movl   $0x1c,0x8(%rsp)
  movl   $0x1f,0xc(%rsp)
  movl   $0x1e,0x10(%rsp)
  movl   $0x1f,0x14(%rsp)
  movl   $0x1e,0x18(%rsp)
  movl   $0x1f,0x1c(%rsp)
  movl   $0x1f,0x20(%rsp)
  movl   $0x1e,0x24(%rsp)
  movl   $0x1f,0x28(%rsp)
  movl   $0x1e,0x2c(%rsp)
  movl   $0x1f,0x30(%rsp)
  cmp    $0x1,%esi
  jle    L7
  lea    0x4(%rsp),%rdx
  lea    -0x2(%rsi),%eax
  lea    0x8(%rsp,%rax,4),%rcx
  mov    $0x0,%eax
L34:
  add    (%rdx),%eax
  add    $0x4,%rdx
  cmp    %rcx,%rdx
  jne    L34
L48:
  cmp    $0x2,%esi
  jle    L14
  test   $0x3,%dil
  jne    L26
  movslq %edi,%rdx
  imul   $0x51eb851f,%rdx,%rdx
  sar    $0x25,%rdx
  mov    %edi,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%edx
  imul   $0x64,%edx,%edx
  cmp    %edx,%edi
  jne    L72
L26:
  movslq %edi,%rdx
  imul   $0x51eb851f,%rdx,%rdx
  sar    $0x27,%rdx
  mov    %edi,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%edx
  imul   $0x190,%edx,%edx
  cmp    %edx,%edi
  jne    L14
L72:
  add    $0x1,%eax
L14:
  add    %r8d,%eax
  mov    0x38(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L16
  add    $0x48,%rsp
  ret
L7:
  mov    $0x0,%eax
  jmp    L48
L16:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int daysFrom(int year, int month, int day) {
  int monthDays[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  int i = 0;
  int sum = 0;
  for (i = 1; i < month; i++)
    sum += monthDays[i];
  if (month > 2)
    if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0))
      sum += 1;
  sum += day;
  return sum;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<daysFrom>:
  endbr64
  sub    $0x48,%rsp
  mov    %edx,%r9d
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  movabs $0x1f0000001c,%rax
  movl   $0x1f,0x30(%rsp)
  mov    %rax,0x8(%rsp)
  add    $0x2,%rax
  mov    %rax,0x10(%rsp)
  mov    %rax,0x18(%rsp)
  movabs $0x1e0000001f,%rax
  mov    %rax,0x20(%rsp)
  mov    %rax,0x28(%rsp)
  cmp    $0x1,%esi
  jle    L52
  lea    -0x2(%rsi),%eax
  lea    0x8(%rsp),%rdx
  mov    %edi,%r8d
  mov    $0x1f,%ecx
  lea    (%rdx,%rax,4),%rdi
  xor    %eax,%eax
  jmp    L92
  nopl   0x0(%rax,%rax,1)
L68:
  mov    (%rdx),%ecx
  add    $0x4,%rdx
L92:
  add    %ecx,%eax
  cmp    %rdi,%rdx
  jne    L68
  cmp    $0x2,%esi
  jle    L35
  test   $0x3,%r8b
  jne    L1
  imul   $0xc28f5c29,%r8d,%edx
  add    $0x51eb850,%edx
  ror    $0x2,%edx
  cmp    $0x28f5c28,%edx
  jbe    L1
  add    $0x1,%eax
  nopl   0x0(%rax,%rax,1)
L35:
  add    %r9d,%eax
  mov    0x38(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L72
  add    $0x48,%rsp
  ret
  nopl   0x0(%rax,%rax,1)
L1:
  imul   $0xc28f5c29,%r8d,%r8d
  add    $0x51eb850,%r8d
  ror    $0x4,%r8d
  cmp    $0xa3d70a,%r8d
  ja     L35
  add    $0x1,%eax
  jmp    L35
L52:
  xor    %eax,%eax
  jmp    L35
L72:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int daysFrom(int year, int month, int day) {
  int monthDays[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  int i = 0;
  int sum = 0;
  for (i = 1; i < month; i++)
    sum += monthDays[i];
  if (month > 2)
    if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0))
      sum += 1;
  sum += day;
  return sum;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<daysFrom>:
  endbr64
  sub    $0x48,%rsp
  movdqa D2(%rip),%xmm1
  movdqa D25(%rip),%xmm0
  mov    %edx,%r9d
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  movups %xmm1,0x14(%rsp)
  movdqa D27(%rip),%xmm1
  movups %xmm0,0x4(%rsp)
  movups %xmm1,0x24(%rsp)
  cmp    $0x1,%esi
  jle    L88
  mov    %esi,%ecx
  mov    %edi,%r8d
  lea    -0x1(%rsi),%esi
  lea    -0x2(%rcx),%eax
  cmp    $0x2,%eax
  jbe    L84
  mov    %esi,%eax
  shr    $0x2,%eax
  cmp    $0x1,%eax
  je     L76
  cmp    $0x2,%eax
  je     L98
  movdqa D37(%rip),%xmm0
L76:
  movdqa %xmm0,%xmm1
  mov    %esi,%edi
  psrldq $0x8,%xmm1
  and    $0xfffffffc,%edi
  paddd  %xmm1,%xmm0
  lea    0x1(%rdi),%edx
  movdqa %xmm0,%xmm1
  psrldq $0x4,%xmm1
  paddd  %xmm1,%xmm0
  movd   %xmm0,%eax
  cmp    %edi,%esi
  je     L163
L2:
  movslq %edx,%rsi
  add    (%rsp,%rsi,4),%eax
  lea    0x1(%rdx),%esi
  cmp    %esi,%ecx
  jle    L45
  movslq %esi,%rsi
  add    $0x2,%edx
  add    (%rsp,%rsi,4),%eax
  cmp    %edx,%ecx
  jle    L163
  movslq %edx,%rdx
  add    (%rsp,%rdx,4),%eax
L163:
  test   $0x3,%r8b
  jne    L112
  imul   $0xc28f5c29,%r8d,%edx
  add    $0x51eb850,%edx
  ror    $0x2,%edx
  cmp    $0x28f5c28,%edx
  jbe    L112
  add    $0x1,%eax
  nopl   (%rax)
L59:
  add    %r9d,%eax
  mov    0x38(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L68
  add    $0x48,%rsp
  ret
L112:
  imul   $0xc28f5c29,%r8d,%edx
  add    $0x51eb850,%edx
  ror    $0x4,%edx
  cmp    $0xa3d70a,%edx
  ja     L59
  add    $0x1,%eax
  jmp    L59
L45:
  cmp    $0x2,%ecx
  jle    L59
  jmp    L163
  nopl   0x0(%rax)
L98:
  movdqa D30(%rip),%xmm0
  jmp    L76
  nopl   (%rax)
L88:
  xor    %eax,%eax
  jmp    L59
L84:
  xor    %eax,%eax
  mov    $0x1,%edx
  jmp    L2
L68:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_label: D2
type_infered: byte[16]
name: disassemble_data
arguments: data_label: D25
type_infered: byte[16]
name: disassemble_data
arguments: data_label: D27
type_infered: byte[16]
name: disassemble_data
arguments: data_label: D37
type_infered: byte[16]
name: disassemble_data
arguments: data_label: D30
type_infered: byte[16]

tool: {"D2": [0x1f,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,0x1f,0x00,0x00,0x00,0x1f,0x00,0x00,0x00]}

tool: {"D25": [0x1f,0x00,0x00,0x00,0x1c,0x00,0x00,0x00,0x1f,0x00,0x00,0x00,0x1e,0x00,0x00,0x00]}

tool: {"D27": [0x1e,0x00,0x00,0x00,0x1f,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,0x1f,0x00,0x00,0x00]}

tool: {"D37": [0x5c,0x00,0x00,0x00,0x59,0x00,0x00,0x00,0x5c,0x00,0x00,0x00,0x5c,0x00,0x00,0x00]}

tool: {"D30": [0x3e,0x00,0x00,0x00,0x3a,0x00,0x00,0x00,0x3e,0x00,0x00,0x00,0x3d,0x00,0x00,0x00]}

assistant: ```c
int daysFrom(int year, int month, int day) {
  int monthDays[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  int i = 0;
  int sum = 0;
  for (i = 1; i < month; i++)
    sum += monthDays[i];
  if (month > 2)
    if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0))
      sum += 1;
  sum += day;
  return sum;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<dump_frame>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %rdi,-0x58(%rbp)
  mov    %esi,-0x5c(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x44(%rbp)
  jmp    L13
L30:
  mov    -0x44(%rbp),%eax
  mov    %eax,-0x4c(%rbp)
  movl   $0x0,-0x48(%rbp)
  jmp    L42
L5:
  mov    -0x4c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  lea    -0x40(%rbp),%rcx
  mov    -0x48(%rbp),%edx
  movslq %edx,%rdx
  add    %rdx,%rcx
  mov    %eax,%edx
  lea    D12(%rip),%rax
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <sprintf@plt>
  addl   $0x1,-0x4c(%rbp)
  addl   $0x3,-0x48(%rbp)
L42:
  mov    -0x44(%rbp),%eax
  add    $0xf,%eax
  cmp    %eax,-0x4c(%rbp)
  jg     L47
  mov    -0x4c(%rbp),%eax
  cmp    -0x5c(%rbp),%eax
  jl     L5
L47:
  mov    -0x48(%rbp),%eax
  cltq
  movb   $0x0,-0x40(%rbp,%rax,1)
  lea    -0x40(%rbp),%rax
  mov    %rax,%rsi
  lea    D15(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  addl   $0x10,-0x44(%rbp)
L13:
  mov    -0x44(%rbp),%eax
  cmp    -0x5c(%rbp),%eax
  jl     L30
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L39
  call   <__stack_chk_fail@plt>
L39:
  leave
  ret
```

tool_calls: name: parse_data
arguments: data_label: D12
type_infered: string
name: parse_data
arguments: data_label: D15
type_infered: string

tool: D12: %02X 

tool: D15: %s

assistant: ```c
void dump_frame(unsigned char *data, int len) {
  int i, j, k;
  unsigned char buf[50];
  for (k = 0; k < len; k += 16) {
    for (i = k, j = 0; (i < (k + 16)) && (i < len); i++, j += 3)
      sprintf((char *)&buf[j], "%02X ", data[i]);
    buf[j] = '\0';
    printf("%s", buf);
  }
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<dump_frame>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  test   %esi,%esi
  jle    L42
  mov    %rdi,%r14
  mov    %esi,%r13d
  lea    -0x1(%rsi),%eax
  and    $0xfffffff0,%eax
  add    $0x1f,%eax
  mov    %eax,0xc(%rsp)
  mov    $0xf,%r12d
  lea    0x10(%rsp),%rcx
  mov    %rcx,(%rsp)
  lea    D9(%rip),%r15
  mov    $0x3,%eax
  sub    %ecx,%eax
  mov    %eax,0x8(%rsp)
  jmp    L58
L70:
  movslq %edx,%rdx
  movb   $0x0,0x10(%rsp,%rdx,1)
  mov    (%rsp),%rsi
  lea    D1(%rip),%rdi
  call   <printf@plt>
  add    $0x10,%r12d
  cmp    0xc(%rsp),%r12d
  je     L42
L58:
  lea    -0xf(%r12),%eax
  lea    -0xe(%r12),%ebx
  movslq %ebx,%rbx
  mov    (%rsp),%rbp
  mov    $0x0,%edx
  cmp    %eax,%r13d
  jle    L70
L17:
  movzbl -0x1(%r14,%rbx,1),%edx
  mov    %r15,%rsi
  mov    %rbp,%rdi
  call   <sprintf@plt>
  mov    0x8(%rsp),%eax
  lea    (%rax,%rbp,1),%edx
  mov    %ebx,%eax
  add    $0x1,%rbx
  add    $0x3,%rbp
  cmp    %eax,%r13d
  jle    L70
  cmp    %r12d,%eax
  jle    L17
  jmp    L70
L42:
  mov    0x48(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L32
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L32:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_tag: D9
data_type: string
name: read_data
arguments: data_tag: D1
data_type: string

tool: D9: %02X 

tool: D1: %s

assistant: ```c
void dump_frame(unsigned char *data, int len) {
  int i, j, k;
  unsigned char buf[50];
  for (k = 0; k < len; k += 16) {
    for (i = k, j = 0; (i < (k + 16)) && (i < len); i++, j += 3)
      sprintf((char *)&buf[j], "%02X ", data[i]);
    buf[j] = '\0';
    printf("%s", buf);
  }
}
```