ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<fline>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  cmpq   $0x0,-0x30(%rbp)
  je     L122
  mov    -0x30(%rbp),%rax
  movl   $0x0,(%rax)
L122:
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <feof@plt>
  test   %rax,%rax
  jne    L46
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <ferror@plt>
  test   %rax,%rax
  je     L86
L46:
  mov    $0x0,%eax
  jmp    L130
L86:
  movl   $0x0,-0x1c(%rbp)
  movl   $0xa,-0x18(%rbp)
  mov    -0x18(%rbp),%eax
  mov    %eax,%edi
  call   <umalloc@plt>
  mov    %rax,-0x10(%rbp)
L97:
  mov    D15(%rip),%rax
  movq   $0x0,(%rax)
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <fgetc@plt>
  mov    %eax,-0x14(%rbp)
  mov    D25(%rip),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x14(%rbp)
  jne    L91
  mov    D15(%rip),%rax
  mov    (%rax),%rdx
  mov    D35(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,%rdx
  je     L24
  cmpl   $0x0,-0x1c(%rbp)
  je     L8
  mov    -0x10(%rbp),%rax
  jmp    L130
L8:
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0x0,%eax
  jmp    L130
L91:
  mov    -0x1c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x1c(%rbp)
  movslq %eax,%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    -0x14(%rbp),%edx
  mov    %dl,(%rax)
  mov    -0x1c(%rbp),%eax
  cmp    -0x18(%rbp),%eax
  jne    L71
  mov    -0x18(%rbp),%eax
  cltq
  mov    %rax,-0x8(%rbp)
  shll   -0x18(%rbp)
  mov    -0x8(%rbp),%rdx
  mov    -0x18(%rbp),%ecx
  mov    -0x10(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <urealloc@plt>
  mov    %rax,-0x10(%rbp)
  mov    -0x1c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
L71:
  cmpl   $0xa,-0x14(%rbp)
  jne    L97
  cmpq   $0x0,-0x30(%rbp)
  je     L37
  mov    -0x30(%rbp),%rax
  movl   $0x1,(%rax)
L37:
  mov    -0x1c(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x10(%rbp),%rax
  jmp    L130
L24:
  nop
  jmp    L97
L130:
  leave
  ret
```

assistant: ```c
char *fline(FILE *f, int *const newline) {
  int c, pos, len;
  char *line;
  if (newline)
    *newline = 0;
  if (feof(f) || ferror(f))
    return NULL;
  pos = 0;
  len = 10;
  line = umalloc(len);
  do {
    errno = 0;
    if ((c = fgetc(f)) == EOF) {
      if (errno == EINTR)
        continue;
      if (pos)
        return line;
      free(line);
      return NULL;
    }
    line[pos++] = c;
    if (pos == len) {
      const size_t old = len;
      len *= 2;
      line = urealloc(line, len, old);
      line[pos] = '\0';
    }
    if (c == '\n') {
      if (newline)
        *newline = 1;
      line[pos - 1] = '\0';
      return line;
    }
  } while (1);
}
```
user: What is the c source code of the assembly code below?

```asm
<fline>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%r13
  mov    %rsi,%r14
  test   %rsi,%rsi
  je     L32
  movl   $0x0,(%rsi)
L32:
  mov    %r13,%rdi
  call   <feof@plt>
  mov    $0x0,%ebp
  test   %rax,%rax
  jne    L12
  mov    %r13,%rdi
  call   <ferror@plt>
  test   %rax,%rax
  jne    L12
  mov    $0xa,%edi
  call   <umalloc@plt>
  mov    %rax,%rbp
  movl   $0xa,0xc(%rsp)
  mov    $0x0,%r12d
  jmp    L6
L20:
  mov    %r12d,%r15d
  jmp    L116
L0:
  mov    D22(%rip),%rdx
  mov    D20(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,(%rdx)
  je     L20
  test   %r12d,%r12d
  je     L132
L12:
  mov    %rbp,%rax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L132:
  mov    %rbp,%rdi
  call   <free@plt>
  mov    $0x0,%ebp
  jmp    L12
L115:
  cmp    $0xa,%ebx
  je     L113
L116:
  mov    %r15d,%r12d
L6:
  mov    D22(%rip),%rax
  movq   $0x0,(%rax)
  mov    %r13,%rdi
  call   <fgetc@plt>
  mov    %eax,%ebx
  mov    D23(%rip),%rax
  cmp    %ebx,(%rax)
  je     L0
  lea    0x1(%r12),%r15d
  movslq %r12d,%r12
  mov    %bl,0x0(%rbp,%r12,1)
  cmp    %r15d,0xc(%rsp)
  jne    L115
  mov    0xc(%rsp),%eax
  movslq %eax,%rdx
  add    %eax,%eax
  mov    %eax,0xc(%rsp)
  mov    %eax,%esi
  mov    %rbp,%rdi
  call   <urealloc@plt>
  mov    %rax,%rbp
  movslq %r15d,%rax
  movb   $0x0,0x0(%rbp,%rax,1)
  jmp    L115
L113:
  test   %r14,%r14
  je     L78
  movl   $0x1,(%r14)
L78:
  movb   $0x0,0x0(%rbp,%r12,1)
  jmp    L12
```

assistant: ```c
char *fline(FILE *f, int *const newline) {
  int c, pos, len;
  char *line;
  if (newline)
    *newline = 0;
  if (feof(f) || ferror(f))
    return NULL;
  pos = 0;
  len = 10;
  line = umalloc(len);
  do {
    errno = 0;
    if ((c = fgetc(f)) == EOF) {
      if (errno == EINTR)
        continue;
      if (pos)
        return line;
      free(line);
      return NULL;
    }
    line[pos++] = c;
    if (pos == len) {
      const size_t old = len;
      len *= 2;
      line = urealloc(line, len, old);
      line[pos] = '\0';
    }
    if (c == '\n') {
      if (newline)
        *newline = 1;
      line[pos - 1] = '\0';
      return line;
    }
  } while (1);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<fline>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x18,%rsp
  test   %rsi,%rsi
  je     L69
  movl   $0x0,(%rsi)
L69:
  mov    %rbp,%rdi
  call   <feof@plt>
  test   %rax,%rax
  jne    L55
  mov    %rbp,%rdi
  call   <ferror@plt>
  test   %rax,%rax
  jne    L55
  mov    $0xa,%edi
  mov    $0xa,%r14d
  xor    %r13d,%r13d
  call   <umalloc@plt>
  mov    %rax,%r15
L112:
  mov    D32(%rip),%rax
  mov    %rbp,%rdi
  movq   $0x0,(%rax)
  call   <fgetc@plt>
  mov    %eax,%ebx
  mov    D34(%rip),%rax
  cmp    %ebx,(%rax)
  je     L78
  movslq %r13d,%rcx
  lea    0x1(%r13),%r8d
  mov    %bl,(%r15,%rcx,1)
  cmp    %r8d,%r14d
  je     L87
L4:
  cmp    $0xa,%ebx
  je     L36
L24:
  mov    %r8d,%r13d
  jmp    L112
  nopl   0x0(%rax)
L78:
  mov    D6(%rip),%rax
  mov    D32(%rip),%rdx
  mov    (%rax),%rax
  cmp    %rax,(%rdx)
  je     L88
  test   %r13d,%r13d
  jne    L15
  mov    %r15,%rdi
  call   <free@plt>
  nopl   0x0(%rax,%rax,1)
L55:
  xor    %r15d,%r15d
L15:
  add    $0x18,%rsp
  mov    %r15,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L87:
  movslq %r14d,%rdx
  add    %r14d,%r14d
  mov    %r15,%rdi
  mov    %r8d,0xc(%rsp)
  mov    %r14d,%esi
  mov    %rcx,(%rsp)
  call   <urealloc@plt>
  mov    (%rsp),%rcx
  mov    %rax,%r15
  movslq 0xc(%rsp),%rax
  movb   $0x0,(%r15,%rax,1)
  mov    %rax,%r8
  jmp    L4
  nopl   0x0(%rax,%rax,1)
L88:
  mov    %r13d,%r8d
  jmp    L24
L36:
  test   %r12,%r12
  je     L46
  movl   $0x1,(%r12)
L46:
  movb   $0x0,(%r15,%rcx,1)
  jmp    L15
```

assistant: ```c
char *fline(FILE *f, int *const newline) {
  int c, pos, len;
  char *line;
  if (newline)
    *newline = 0;
  if (feof(f) || ferror(f))
    return NULL;
  pos = 0;
  len = 10;
  line = umalloc(len);
  do {
    errno = 0;
    if ((c = fgetc(f)) == EOF) {
      if (errno == EINTR)
        continue;
      if (pos)
        return line;
      free(line);
      return NULL;
    }
    line[pos++] = c;
    if (pos == len) {
      const size_t old = len;
      len *= 2;
      line = urealloc(line, len, old);
      line[pos] = '\0';
    }
    if (c == '\n') {
      if (newline)
        *newline = 1;
      line[pos - 1] = '\0';
      return line;
    }
  } while (1);
}
```
user: Translate the below assembly code into C programming language:

```asm
<fline>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x18,%rsp
  test   %rsi,%rsi
  je     L27
  movl   $0x0,(%rsi)
L27:
  mov    %rbp,%rdi
  call   <feof@plt>
  test   %rax,%rax
  jne    L66
  mov    %rbp,%rdi
  call   <ferror@plt>
  test   %rax,%rax
  jne    L66
  mov    $0xa,%edi
  mov    $0xa,%r14d
  xor    %r13d,%r13d
  call   <umalloc@plt>
  mov    %rax,%r15
L16:
  mov    D28(%rip),%rax
  mov    %rbp,%rdi
  movq   $0x0,(%rax)
  call   <fgetc@plt>
  mov    %eax,%ebx
  mov    D5(%rip),%rax
  cmp    %ebx,(%rax)
  je     L118
  movslq %r13d,%rcx
  lea    0x1(%r13),%r8d
  mov    %bl,(%r15,%rcx,1)
  cmp    %r8d,%r14d
  je     L1
L82:
  cmp    $0xa,%ebx
  je     L52
L61:
  mov    %r8d,%r13d
  jmp    L16
  nopl   0x0(%rax)
L118:
  mov    D8(%rip),%rax
  mov    D28(%rip),%rdx
  mov    (%rax),%rax
  cmp    %rax,(%rdx)
  je     L64
  test   %r13d,%r13d
  jne    L111
  mov    %r15,%rdi
  call   <free@plt>
  nopl   0x0(%rax,%rax,1)
L66:
  xor    %r15d,%r15d
L111:
  add    $0x18,%rsp
  mov    %r15,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L1:
  movslq %r14d,%rdx
  add    %r14d,%r14d
  mov    %r15,%rdi
  mov    %r8d,0xc(%rsp)
  mov    %r14d,%esi
  mov    %rcx,(%rsp)
  call   <urealloc@plt>
  mov    (%rsp),%rcx
  mov    %rax,%r15
  movslq 0xc(%rsp),%rax
  movb   $0x0,(%r15,%rax,1)
  mov    %rax,%r8
  jmp    L82
  nopl   0x0(%rax,%rax,1)
L64:
  mov    %r13d,%r8d
  jmp    L61
L52:
  test   %r12,%r12
  je     L53
  movl   $0x1,(%r12)
L53:
  movb   $0x0,(%r15,%rcx,1)
  jmp    L111
```

assistant: ```c
char *fline(FILE *f, int *const newline) {
  int c, pos, len;
  char *line;
  if (newline)
    *newline = 0;
  if (feof(f) || ferror(f))
    return NULL;
  pos = 0;
  len = 10;
  line = umalloc(len);
  do {
    errno = 0;
    if ((c = fgetc(f)) == EOF) {
      if (errno == EINTR)
        continue;
      if (pos)
        return line;
      free(line);
      return NULL;
    }
    line[pos++] = c;
    if (pos == len) {
      const size_t old = len;
      len *= 2;
      line = urealloc(line, len, old);
      line[pos] = '\0';
    }
    if (c == '\n') {
      if (newline)
        *newline = 1;
      line[pos - 1] = '\0';
      return line;
    }
  } while (1);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<abs>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x4(%rbp)
  cmpl   $0x0,-0x4(%rbp)
  jns    L1
  mov    -0x4(%rbp),%eax
  neg    %eax
  jmp    L9
L1:
  mov    -0x4(%rbp),%eax
L9:
  pop    %rbp
  ret
```

assistant: ```c
unsigned int abs(signed int value) {
  if (value < 0) {
    return -value;
  } else {
    return value;
  }
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<abs>:
  endbr64
  mov    %edi,%eax
  neg    %eax
  cmovs  %edi,%eax
  ret
```

assistant: ```c
unsigned int abs(signed int value) {
  if (value < 0) {
    return -value;
  } else {
    return value;
  }
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<abs>:
  endbr64
  mov    %edi,%eax
  neg    %eax
  cmovs  %edi,%eax
  ret
```

assistant: ```c
unsigned int abs(signed int value) {
  if (value < 0) {
    return -value;
  } else {
    return value;
  }
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<abs>:
  endbr64
  mov    %edi,%eax
  neg    %eax
  cmovs  %edi,%eax
  ret
```

assistant: ```c
unsigned int abs(signed int value) {
  if (value < 0) {
    return -value;
  } else {
    return value;
  }
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<str_is_string>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %rdi,-0x8(%rbp)
  jmp    L30
L29:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isalpha@plt>
  test   %eax,%eax
  jne    L19
  mov    $0x1,%eax
  jmp    L39
L19:
  addq   $0x1,-0x8(%rbp)
L30:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L29
  mov    $0x1,%eax
L39:
  leave
  ret
```

assistant: ```c
int str_is_string(char *input) {
  while (*input) {
    if (!isalpha(*input))
      return 1;
    input++;
  }
  return 1;
}
```
user: What is the c source code of the assembly code below?

```asm
<str_is_string>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  movzbl (%rdi),%edi
  test   %dil,%dil
  je     L28
L4:
  movsbl %dil,%edi
  call   <isalpha@plt>
  test   %eax,%eax
  je     L28
  add    $0x1,%rbx
  movzbl (%rbx),%edi
  test   %dil,%dil
  jne    L4
L28:
  mov    $0x1,%eax
  pop    %rbx
  ret
```

assistant: ```c
int str_is_string(char *input) {
  while (*input) {
    if (!isalpha(*input))
      return 1;
    input++;
  }
  return 1;
}
```
user: What is the c source code of the assembly code below:

```asm
<str_is_string>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  movsbl (%rdi),%edi
  test   %dil,%dil
  jne    L7
  jmp    L12
  nopw   0x0(%rax,%rax,1)
L29:
  movsbl 0x1(%rbx),%edi
  add    $0x1,%rbx
  test   %dil,%dil
  je     L12
L7:
  call   <isalpha@plt>
  test   %eax,%eax
  jne    L29
L12:
  mov    $0x1,%eax
  pop    %rbx
  ret
```

assistant: ```c
int str_is_string(char *input) {
  while (*input) {
    if (!isalpha(*input))
      return 1;
    input++;
  }
  return 1;
}
```
user: What is the c source code of the assembly code below?

```asm
<str_is_string>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  movsbl (%rdi),%edi
  test   %dil,%dil
  jne    L23
  jmp    L4
  nopw   0x0(%rax,%rax,1)
L32:
  movsbl 0x1(%rbx),%edi
  add    $0x1,%rbx
  test   %dil,%dil
  je     L4
L23:
  call   <isalpha@plt>
  test   %eax,%eax
  jne    L32
L4:
  mov    $0x1,%eax
  pop    %rbx
  ret
```

assistant: ```c
int str_is_string(char *input) {
  while (*input) {
    if (!isalpha(*input))
      return 1;
    input++;
  }
  return 1;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<blankskip>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbx
  jmp    L26
L4:
  add    $0x1,%rbx
L26:
  movzbl (%rbx),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isspace@plt>
  test   %rax,%rax
  je     L3
  movzbl (%rbx),%eax
  test   %al,%al
  jne    L4
L3:
  mov    %rbx,%rax
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
char *blankskip(register char *s) {
  while (isspace(*s) && *s)
    ++s;
  return (s);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<blankskip>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  jmp    L20
L24:
  add    $0x1,%rbx
L20:
  movsbl (%rbx),%edi
  call   <isspace@plt>
  test   %rax,%rax
  je     L10
  cmpb   $0x0,(%rbx)
  jne    L24
L10:
  mov    %rbx,%rax
  pop    %rbx
  ret
```

assistant: ```c
char *blankskip(register char *s) {
  while (isspace(*s) && *s)
    ++s;
  return (s);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<blankskip>:
  endbr64
  push   %r12
  mov    %rdi,%r12
  jmp    L14
  nopl   0x0(%rax,%rax,1)
L18:
  cmpb   $0x0,(%r12)
  je     L11
  add    $0x1,%r12
L14:
  movsbl (%r12),%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L18
L11:
  mov    %r12,%rax
  pop    %r12
  ret
```

assistant: ```c
char *blankskip(register char *s) {
  while (isspace(*s) && *s)
    ++s;
  return (s);
}
```
user: What is the c source code of the assembly code below?

```asm
<blankskip>:
  endbr64
  push   %r12
  mov    %rdi,%r12
  jmp    L17
  nopl   0x0(%rax,%rax,1)
L27:
  cmpb   $0x0,(%r12)
  je     L5
  add    $0x1,%r12
L17:
  movsbl (%r12),%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L27
L5:
  mov    %r12,%rax
  pop    %r12
  ret
```

assistant: ```c
char *blankskip(register char *s) {
  while (isspace(*s) && *s)
    ++s;
  return (s);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<get_secs>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0xc(%rbp),%rsi
  mov    -0x18(%rbp),%rax
  mov    $0xa7,%ecx
  mov    $0x0,%edx
  mov    %rax,%rdi
  call   <get_num@plt>
  mov    %rax,-0x18(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  jne    L86
  mov    $0x0,%eax
  jmp    L21
L86:
  mov    -0xc(%rbp),%eax
  cltq
  imul   $0xe10,%rax,%rdx
  mov    -0x20(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x3a,%al
  jne    L45
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdi
  lea    -0xc(%rbp),%rax
  mov    $0x3b,%ecx
  mov    $0x0,%edx
  mov    %rax,%rsi
  call   <get_num@plt>
  mov    %rax,-0x18(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  jne    L61
  mov    $0x0,%eax
  jmp    L21
L61:
  mov    -0x20(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0xc(%rbp),%eax
  imul   $0x3c,%eax,%eax
  cltq
  add    %rax,%rdx
  mov    -0x20(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x3a,%al
  jne    L45
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdi
  lea    -0xc(%rbp),%rax
  mov    $0x3c,%ecx
  mov    $0x0,%edx
  mov    %rax,%rsi
  call   <get_num@plt>
  mov    %rax,-0x18(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  jne    L58
  mov    $0x0,%eax
  jmp    L21
L58:
  mov    -0x20(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0xc(%rbp),%eax
  cltq
  add    %rax,%rdx
  mov    -0x20(%rbp),%rax
  mov    %rdx,(%rax)
L45:
  mov    -0x18(%rbp),%rax
L21:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L73
  call   <__stack_chk_fail@plt>
L73:
  leave
  ret
```

assistant: ```c
const char *get_secs(const char *strp, long int *const secsp) {
  int num;
  strp = get_num(strp, &num, 0, 24 * 7 - 1);
  if (strp == NULL)
    return NULL;
  *secsp = num * (long int)(60 * 60);
  if (*strp == ':') {
    strp = get_num(strp + 1, &num, 0, 60 - 1);
    if (strp == NULL)
      return NULL;
    *secsp += num * 60;
    if (*strp == ':') {
      strp = get_num(strp + 1, &num, 0, 60);
      if (strp == NULL)
        return NULL;
      *secsp += num;
    }
  }
  return strp;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<get_secs>:
  endbr64
  push   %rbx
  sub    $0x10,%rsp
  mov    %rsi,%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x4(%rsp),%rsi
  mov    $0xa7,%ecx
  mov    $0x0,%edx
  call   <get_num@plt>
  test   %rax,%rax
  je     L30
  movslq 0x4(%rsp),%rdx
  imul   $0xe10,%rdx,%rdx
  mov    %rdx,(%rbx)
  cmpb   $0x3a,(%rax)
  je     L12
L30:
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L11
  add    $0x10,%rsp
  pop    %rbx
  ret
L12:
  lea    0x1(%rax),%rdi
  lea    0x4(%rsp),%rsi
  mov    $0x3b,%ecx
  mov    $0x0,%edx
  call   <get_num@plt>
  test   %rax,%rax
  je     L30
  imul   $0x3c,0x4(%rsp),%edx
  movslq %edx,%rdx
  add    %rdx,(%rbx)
  cmpb   $0x3a,(%rax)
  jne    L30
  lea    0x1(%rax),%rdi
  lea    0x4(%rsp),%rsi
  mov    $0x3c,%ecx
  mov    $0x0,%edx
  call   <get_num@plt>
  test   %rax,%rax
  je     L30
  movslq 0x4(%rsp),%rdx
  add    %rdx,(%rbx)
  jmp    L30
L11:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
const char *get_secs(const char *strp, long int *const secsp) {
  int num;
  strp = get_num(strp, &num, 0, 24 * 7 - 1);
  if (strp == NULL)
    return NULL;
  *secsp = num * (long int)(60 * 60);
  if (*strp == ':') {
    strp = get_num(strp + 1, &num, 0, 60 - 1);
    if (strp == NULL)
      return NULL;
    *secsp += num * 60;
    if (*strp == ':') {
      strp = get_num(strp + 1, &num, 0, 60);
      if (strp == NULL)
        return NULL;
      *secsp += num;
    }
  }
  return strp;
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<get_secs>:
  endbr64
  push   %rbp
  xor    %edx,%edx
  mov    $0xa7,%ecx
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x4(%rsp),%rbp
  mov    %rbp,%rsi
  call   <get_num@plt>
  test   %rax,%rax
  je     L34
  movslq 0x4(%rsp),%rdx
  imul   $0xe10,%rdx,%rdx
  mov    %rdx,(%rbx)
  cmpb   $0x3a,(%rax)
  je     L53
L20:
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L41
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  ret
  nopl   (%rax)
L53:
  xor    %edx,%edx
  lea    0x1(%rax),%rdi
  mov    $0x3b,%ecx
  mov    %rbp,%rsi
  call   <get_num@plt>
  test   %rax,%rax
  je     L34
  imul   $0x3c,0x4(%rsp),%edx
  movslq %edx,%rdx
  add    %rdx,(%rbx)
  cmpb   $0x3a,(%rax)
  jne    L20
  xor    %edx,%edx
  lea    0x1(%rax),%rdi
  mov    $0x3c,%ecx
  mov    %rbp,%rsi
  call   <get_num@plt>
  test   %rax,%rax
  je     L20
  movslq 0x4(%rsp),%rdx
  add    %rdx,(%rbx)
  jmp    L20
  nopw   0x0(%rax,%rax,1)
L34:
  xor    %eax,%eax
  jmp    L20
L41:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
const char *get_secs(const char *strp, long int *const secsp) {
  int num;
  strp = get_num(strp, &num, 0, 24 * 7 - 1);
  if (strp == NULL)
    return NULL;
  *secsp = num * (long int)(60 * 60);
  if (*strp == ':') {
    strp = get_num(strp + 1, &num, 0, 60 - 1);
    if (strp == NULL)
      return NULL;
    *secsp += num * 60;
    if (*strp == ':') {
      strp = get_num(strp + 1, &num, 0, 60);
      if (strp == NULL)
        return NULL;
      *secsp += num;
    }
  }
  return strp;
}
```
user: What is the c source code of the assembly code below?

```asm
<get_secs>:
  endbr64
  push   %rbp
  xor    %edx,%edx
  mov    $0xa7,%ecx
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x4(%rsp),%rbp
  mov    %rbp,%rsi
  call   <get_num@plt>
  test   %rax,%rax
  je     L46
  movslq 0x4(%rsp),%rdx
  imul   $0xe10,%rdx,%rdx
  mov    %rdx,(%rbx)
  cmpb   $0x3a,(%rax)
  je     L2
L25:
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L9
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  ret
  nopl   (%rax)
L2:
  xor    %edx,%edx
  lea    0x1(%rax),%rdi
  mov    $0x3b,%ecx
  mov    %rbp,%rsi
  call   <get_num@plt>
  test   %rax,%rax
  je     L46
  imul   $0x3c,0x4(%rsp),%edx
  movslq %edx,%rdx
  add    %rdx,(%rbx)
  cmpb   $0x3a,(%rax)
  jne    L25
  xor    %edx,%edx
  lea    0x1(%rax),%rdi
  mov    $0x3c,%ecx
  mov    %rbp,%rsi
  call   <get_num@plt>
  test   %rax,%rax
  je     L25
  movslq 0x4(%rsp),%rdx
  add    %rdx,(%rbx)
  jmp    L25
  nopw   0x0(%rax,%rax,1)
L46:
  xor    %eax,%eax
  jmp    L25
L9:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
const char *get_secs(const char *strp, long int *const secsp) {
  int num;
  strp = get_num(strp, &num, 0, 24 * 7 - 1);
  if (strp == NULL)
    return NULL;
  *secsp = num * (long int)(60 * 60);
  if (*strp == ':') {
    strp = get_num(strp + 1, &num, 0, 60 - 1);
    if (strp == NULL)
      return NULL;
    *secsp += num * 60;
    if (*strp == ':') {
      strp = get_num(strp + 1, &num, 0, 60);
      if (strp == NULL)
        return NULL;
      *secsp += num;
    }
  }
  return strp;
}
```