// File: /workspace/github_c_makefile_star2_O1/silverneko[P]miku/isolate/isolate.c
// Function: get_run_time_ms
static int
get_run_time_ms(struct rusage *rus)
{
  if (cg_timing)
    return cg_get_run_time_ms();

  if (rus)
    {
      struct timeval total;
      timeradd(&rus->ru_utime, &rus->ru_stime, &total);
      return total.tv_sec*1000 + total.tv_usec/1000;
    }

  char buf[PROC_BUF_SIZE], *x;
  int utime, stime;
  static int proc_stat_fd;

  read_proc_file(buf, "stat", &proc_stat_fd);
  x = buf;
  while (*x && *x != ' ')
    x++;
  while (*x == ' ')
    x++;
  if (*x++ != '(')
    die("proc stat syntax error 1");
  while (*x && (*x != ')' || x[1] != ' '))
    x++;
  while (*x == ')' || *x == ' ')
    x++;
  if (sscanf(x, "%*c %*d %*d %*d %*d %*d %*d %*d %*d %*d %*d %d %d", &utime, &stime) != 2)
    die("proc stat syntax error 2");

  return (utime + stime) * 1000 / ticks_per_sec;
}

// Assembly:
pushq %rbx
subq $0x1010, %rsp           # imm = 0x1010
cmpb $0x1, 0x54fc(%rip)      # 0x931c
jne 0x3e6b
xorl %eax, %eax
cmpb $0x1, 0x54a5(%rip)      # 0x92d0
jne 0x3fc8
leaq 0x16b3(%rip), %rsi      # 0x54eb
leaq 0x10(%rsp), %rbx
movl $0x1, %edi
movq %rbx, %rdx
callq 0x4075
movq %rbx, %rdi
callq 0x22e0
movabsq $0x431bde82d7b634db, %rcx # imm = 0x431BDE82D7B634DB
mulq %rcx
movq %rdx, %rax
shrq $0x12, %rax
jmp 0x3fc8
testq %rdi, %rdi
je 0x3ec3
movl 0x10(%rdi), %ecx
addl (%rdi), %ecx
movq 0x8(%rdi), %rax
movq 0x18(%rdi), %rdx
leaq (%rdx,%rax), %rsi
xorl %edi, %edi
cmpq $0xf4240, %rsi          # imm = 0xF4240
setge %dil
leaq -0xf4240(%rdx,%rax), %rax
cmovlq %rsi, %rax
addl %ecx, %edi
imull $0x3e8, %edi, %ecx      # imm = 0x3E8
movabsq $0x20c49ba5e353f7cf, %rdx # imm = 0x20C49BA5E353F7CF
imulq %rdx
movq %rdx, %rax
shrq $0x3f, %rdx
shrq $0x7, %rax
addl %edx, %eax
addl %ecx, %eax
jmp 0x3fc8
cmpl $0x0, 0x5496(%rip)      # 0x9360
jne 0x3f09
movl 0x547e(%rip), %edx      # 0x9350
leaq 0x1685(%rip), %rsi      # 0x555e
leaq 0x15a2(%rip), %rcx      # 0x5482
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2460
movq %rbx, %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x2400
movl %eax, 0x545f(%rip)      # 0x9360
testl %eax, %eax
js 0x4006
movl 0x5451(%rip), %edi      # 0x9360
xorl %esi, %esi
xorl %edx, %edx
callq 0x2220
movl 0x5442(%rip), %edi      # 0x9360
leaq 0x10(%rsp), %rsi
movl $0xfff, %edx            # imm = 0xFFF
callq 0x22c0
testl %eax, %eax
js 0x3fdf
cmpl $0xfff, %eax            # imm = 0xFFF
jge 0x3fe8
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movb $0x0, 0x10(%rsp,%rax)
leaq 0x11(%rsp), %rdi
movzbl -0x1(%rdi), %eax
testb $-0x21, %al
je 0x3f5f
incq %rdi
jmp 0x3f4f
incq %rdi
movzbl -0x1(%rdi), %eax
cmpl $0x20, %eax
je 0x3f5c
cmpl $0x28, %eax
jne 0x3fd1
movzbl (%rdi), %eax
cmpl $0x29, %eax
je 0x3f7b
testl %eax, %eax
jne 0x3f81
jmp 0x3f89
cmpb $0x20, 0x1(%rdi)
je 0x3f89
incq %rdi
jmp 0x3f6d
incq %rdi
movzbl (%rdi), %eax
cmpl $0x29, %eax
je 0x3f86
cmpl $0x20, %eax
je 0x3f86
leaq 0x1503(%rip), %rsi      # 0x54a0
leaq 0xc(%rsp), %rdx
leaq 0x8(%rsp), %rcx
xorl %eax, %eax
callq 0x23a0
cmpl $0x2, %eax
jne 0x3ffd
movl 0x8(%rsp), %eax
addl 0xc(%rsp), %eax
imull $0x3e8, %eax, %eax      # imm = 0x3E8
cltd
idivl 0x539c(%rip)            # 0x9364
addq $0x1010, %rsp           # imm = 0x1010
popq %rbx
retq
leaq 0x14af(%rip), %rdi      # 0x5487
xorl %eax, %eax
callq 0x2de4
leaq 0x1591(%rip), %rdi      # 0x5577
jmp 0x3fef
leaq 0x15a2(%rip), %rdi      # 0x5591
leaq 0x148c(%rip), %rsi      # 0x5482
xorl %eax, %eax
callq 0x2de4
leaq 0x14ce(%rip), %rdi      # 0x54d2
jmp 0x3fd8
leaq 0x155d(%rip), %rdi      # 0x556a
leaq 0x10(%rsp), %rsi
jmp 0x3ff6