user: Translate the below assembly code into C programming language:

```asm
<getbranchtime>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x30,%rsp
  mov    %rdi,%rbp
  mov    %rsi,%r12
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  call   <strlen@plt>
  mov    %eax,%ebx
  lea    0x10(%rsp),%rdi
  mov    $0x18,%edx
  mov    $0x0,%esi
  call   <memset@plt>
  and    $0xfffffff6,%ebx
  mov    $0x0,%eax
  cmp    $0x4,%ebx
  jne    L93
  lea    0x10(%rsp),%rdx
  lea    0x14(%rsp),%rcx
  sub    $0x8,%rsp
  lea    0x28(%rsp),%rax
  push   %rax
  lea    0x2c(%rsp),%r9
  lea    0x28(%rsp),%r8
  lea    D34(%rip),%rsi
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <sscanf@plt>
  add    $0x10,%rsp
  cmp    $0x5,%eax
  jne    L85
L71:
  mov    0x10(%rsp),%eax
  lea    -0x76c(%rax),%edx
  mov    %edx,0x10(%rsp)
  mov    0x14(%rsp),%eax
  sub    $0x1,%eax
  mov    %eax,0x14(%rsp)
  cmp    $0xb,%eax
  ja     L73
  cmp    $0x63,%edx
  jg     L148
L73:
  mov    $0x0,%eax
L93:
  mov    0x28(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L92
  add    $0x30,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L85:
  lea    0x10(%rsp),%rdx
  lea    0x14(%rsp),%rcx
  sub    $0x8,%rsp
  lea    0x28(%rsp),%rax
  push   %rax
  lea    0x2c(%rsp),%r9
  lea    0x28(%rsp),%r8
  lea    D35(%rip),%rsi
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <sscanf@plt>
  add    $0x10,%rsp
  cmp    $0x5,%eax
  je     L71
  lea    0xc(%rsp),%rcx
  lea    0x8(%rsp),%rdx
  lea    D27(%rip),%rsi
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <sscanf@plt>
  cmp    $0x2,%eax
  jne    L82
L146:
  mov    0x8(%rsp),%edx
  mov    $0x0,%eax
  cmp    $0x17,%edx
  ja     L93
  mov    0xc(%rsp),%ecx
  cmp    $0x3b,%ecx
  ja     L93
  mov    (%r12),%edi
  cmp    $0x15180,%edi
  jg     L116
  imul   $0xe10,%edx,%edx
  imul   $0x3c,%ecx,%ecx
  add    %ecx,%edx
  mov    %edx,(%r12)
  mov    $0x1,%eax
  jmp    L93
L148:
  mov    0x18(%rsp),%eax
  lea    -0x1(%rax),%edx
  mov    $0x0,%eax
  cmp    $0x1e,%edx
  ja     L93
  cmpl   $0x17,0x1c(%rsp)
  ja     L93
  cmpl   $0x3b,0x20(%rsp)
  ja     L93
  movl   $0xffffffff,0x24(%rsp)
  lea    0x10(%rsp),%rdi
  call   <mktime@plt>
  mov    %eax,%edx
  mov    $0x0,%eax
  cmp    $0xffffffff,%edx
  je     L93
  mov    %edx,(%r12)
  mov    $0x1,%eax
  jmp    L93
L82:
  lea    0xc(%rsp),%rcx
  lea    0x8(%rsp),%rdx
  lea    D7(%rip),%rsi
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <sscanf@plt>
  mov    %eax,%edx
  mov    $0x0,%eax
  cmp    $0x2,%edx
  jne    L93
  jmp    L146
L116:
  imul   $0xe10,%edx,%edx
  imul   $0x3c,%ecx,%ecx
  lea    (%rdx,%rcx,1),%esi
  call   <normalize_epoch@plt>
  mov    %eax,(%r12)
  mov    $0x1,%eax
  jmp    L93
L92:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: tag: D34
datatype: string
name: unpack_data
arguments: tag: D35
datatype: string
name: unpack_data
arguments: tag: D27
datatype: string
name: unpack_data
arguments: tag: D7
datatype: string

tool: D34: %4d%2d%2d%2d:%2d

tool: D35: %4d%2d%2d%2d%2d

tool: D27: %2d:%2d

tool: D7: %2d%2d

assistant: ```c
int getbranchtime(char *itim, time_t *newtime) {
  register int ilen = strlen(itim);
  int hours, minutes;
  time_t epoch;
  struct tm tm;
  memset(&tm, 0, sizeof tm);
  if (ilen != 4 && ilen != 5 && ilen != 12 && ilen != 13)
    return 0;
  if (sscanf(itim, "%4d%2d%2d%2d:%2d", &tm.tm_year, &tm.tm_mon, &tm.tm_mday, &tm.tm_hour, &tm.tm_min) == 5 || sscanf(itim, "%4d%2d%2d%2d%2d", &tm.tm_year, &tm.tm_mon, &tm.tm_mday, &tm.tm_hour, &tm.tm_min) == 5) {
    tm.tm_year -= 1900;
    tm.tm_mon -= 1;
    if (tm.tm_year < 100 || tm.tm_mon < 0 || tm.tm_mon > 11 || tm.tm_mday < 1 || tm.tm_mday > 31 || tm.tm_hour < 0 || tm.tm_hour > 23 || tm.tm_min < 0 || tm.tm_min > 59) {
      return 0;
    }
    tm.tm_isdst = -1;
    if ((epoch = mktime(&tm)) == -1)
      return 0;
    *newtime = epoch;
    return 1;
  }
  if (sscanf(itim, "%2d:%2d", &hours, &minutes) == 2 || sscanf(itim, "%2d%2d", &hours, &minutes) == 2) {
    if (hours < 0 || hours > 23 || minutes < 0 || minutes > 59)
      return 0;
    if (*newtime <= 86400) {
      *newtime = (hours * 3600) + (minutes * 60);
      if (*newtime >= 86400)
        *newtime = 86400 - 1;
      return 1;
    } else {
      *newtime = normalize_epoch(*newtime, (hours * 3600) + (minutes * 60));
      return 1;
    }
  }
  return 0;
}
```