// File: /workspace/github_c_makefile_star2_O1/AlxHnr[P]nano-backup/src/nb.c
// Function: main
int main(const int arg_count, const char **arg_list)
{
  CR_Region *r = CR_RegionNew();
  setbuf(stdout, NULL);
  setbuf(stderr, NULL);

  if(arg_count < 2)
  {
    die("no repository specified");
  }

  StringView path_to_repo = str(arg_list[1]);
  if(!sPathExists(path_to_repo))
  {
    die("repository doesn't exist: \"%s\"", arg_list[1]);
  }
  else if(!S_ISDIR(sStat(path_to_repo).st_mode))
  {
    die("not a directory: \"%s\"", arg_list[1]);
  }

  if(arg_count == 2)
  {
    backup(r, path_to_repo);
  }
  else if(strcmp(arg_list[2], "gc") == 0)
  {
    if(arg_count > 3)
    {
      die("too many arguments for gc command");
    }

    runGC(metadataLoadFromRepo(r, path_to_repo, RLH_readwrite),
          path_to_repo, false);
  }
  else if(strcmp(arg_list[2], "integrity") == 0)
  {
    if(arg_count > 3)
    {
      die("too many arguments for integrity command");
    }

    runIntegrityCheck(metadataLoadFromRepo(r, path_to_repo, RLH_readonly),
                      path_to_repo);
  }
  else if(sRegexIsMatching(
            sRegexCompile(r, str("^[0-9]+$"), str(__FILE__), __LINE__),
            str(arg_list[2])))
  {
    if(arg_count > 4)
    {
      die("too many paths to restore");
    }

    restore(r, path_to_repo, sStringToSize(str(arg_list[2])),
            arg_count == 4 ? str(arg_list[3]) : str("/"));
  }
  else
  {
    die("invalid arguments");
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2b8, %rsp            # imm = 0x2B8
movq %rsi, %r14
movl %edi, %ebp
callq 0xdc7c
movq %rax, %r13
movq 0xc8bb(%rip), %rbx      # 0x12fd0
movq (%rbx), %rdi
xorl %esi, %esi
callq 0x2140
movq 0xc8d2(%rip), %rax      # 0x12ff8
movq (%rax), %rdi
xorl %esi, %esi
callq 0x2140
cmpl $0x1, %ebp
jle 0x7048
movq 0x8(%r14), %rsi
leaq 0x58(%rsp), %r15
movq %r15, %rdi
callq 0xaf28
movq 0x10(%r15), %rax
movq %rax, 0x10(%rsp)
movups (%r15), %xmm0
movups %xmm0, (%rsp)
callq 0x90a4
testb %al, %al
je 0x7056
movq 0x68(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x58(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0x228(%rsp), %r15
movq %r15, %rdi
callq 0x9142
movl $0xf000, %eax           # imm = 0xF000
andl 0x18(%r15), %eax
cmpl $0x4000, %eax           # imm = 0x4000
jne 0x7063
cmpl $0x2, %ebp
jne 0x6988
movups 0x58(%rsp), %xmm0
movaps %xmm0, 0x90(%rsp)
movq 0x68(%rsp), %rax
movq %rax, 0xa0(%rsp)
movq %r13, %rdi
callq 0x28cc
movq %rax, %r14
movq 0xa0(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x90(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0xf0(%rsp), %r15
movq %r15, %rdi
callq 0xb064
leaq 0x79e5(%rip), %rsi      # 0xe1e2
leaq 0xd0(%rsp), %r12
movq %r12, %rdi
callq 0xaf28
movq 0x10(%r12), %rax
movq %rax, 0x28(%rsp)
movups (%r12), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x10(%r15), %rax
movq %rax, 0x10(%rsp)
movups (%r15), %xmm0
movups %xmm0, (%rsp)
leaq 0xb0(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0xb2df
leaq 0x799d(%rip), %rsi      # 0xe1e9
movq %r13, %rbx
leaq 0x110(%rsp), %r13
movq %r13, %rdi
callq 0xaf28
movq 0x10(%r13), %rax
movq %rax, 0x28(%rsp)
movups (%r13), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x10(%r15), %rax
movq %rax, 0x10(%rsp)
movups (%r15), %xmm0
movups %xmm0, (%rsp)
leaq 0x70(%rsp), %rdi
movq %r14, %rsi
callq 0xb2df
leaq 0x7e07(%rip), %rsi      # 0xe69e
leaq 0x210(%rsp), %r13
movq %r13, %rdi
callq 0xaf28
movq 0x10(%r13), %rax
movq %rax, 0x28(%rsp)
movups (%r13), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x10(%r15), %rax
movq %rax, 0x10(%rsp)
movups (%r15), %xmm0
movups %xmm0, (%rsp)
leaq 0x130(%rsp), %rdi
movq %r14, %rsi
callq 0xb2df
movq 0x10(%r12), %rax
movq %rax, 0x10(%rsp)
movups (%r12), %xmm0
movups %xmm0, (%rsp)
callq 0x90a4
testb %al, %al
je 0x7075
movq 0x100(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0xf0(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x7e91
movq 0xc0(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0xb0(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
callq 0xa830
movq %rax, %r15
movq 0x80(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x70(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x90a4
testb %al, %al
je 0x6a9c
movq 0x80(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x70(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
callq 0x56bb
jmp 0x6aa4
movq 0x10(%r14), %r15
leaq 0x7c7f(%rip), %rsi      # 0xe612
movq %r15, %rdi
callq 0x2230
testl %eax, %eax
je 0x6c4e
leaq 0x7e37(%rip), %rsi      # 0xe7e1
movq %r15, %rdi
callq 0x2230
testl %eax, %eax
je 0x6c96
leaq 0x7c9f(%rip), %rsi      # 0xe660
leaq 0x1f8(%rsp), %r15
movq %r15, %rdi
callq 0xaf28
leaq 0x7c91(%rip), %rsi      # 0xe669
leaq 0x1e0(%rsp), %r12
movq %r12, %rdi
callq 0xaf28
movq 0x10(%r12), %rax
movq %rax, 0x28(%rsp)
movups (%r12), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x10(%r15), %rax
movq %rax, 0x10(%rsp)
movups (%r15), %xmm0
movups %xmm0, (%rsp)
movl $0x196, %esi            # imm = 0x196
movq %r13, %rdi
callq 0x9e25
movq %rax, %r15
movq 0x10(%r14), %rsi
leaq 0x1c8(%rsp), %r12
movq %r12, %rdi
callq 0xaf28
movq 0x10(%r12), %rax
movq %rax, 0x10(%rsp)
movups (%r12), %xmm0
movups %xmm0, (%rsp)
movq %r15, %rdi
callq 0x9f28
testb %al, %al
je 0x7092
cmpl $0x5, %ebp
jge 0x709b
movq 0x10(%r14), %rsi
leaq 0x1b0(%rsp), %r15
movq %r15, %rdi
callq 0xaf28
movq 0x10(%r15), %rax
movq %rax, 0x10(%rsp)
movups (%r15), %xmm0
movups %xmm0, (%rsp)
callq 0x9bcc
movq %rax, %r15
cmpl $0x4, %ebp
jne 0x6da4
movq 0x18(%r14), %rsi
jmp 0x6dab
movq %rbx, %rdi
callq 0x5674
movq %rax, %r14
movq %rax, %rdi
movq %r15, %rsi
callq 0x2c08
movq 0x58(%r15), %rax
movq (%rax), %rdx
leaq 0x160(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x4619
movq %r15, %rdi
callq 0x456b
movq %r12, %rdi
callq 0x4a7d
testb %al, %al
je 0x7034
movl $0xa, %edi
callq 0x2050
movb $0x0, 0x57(%rsp)
movq 0x160(%rsp), %rdx
testq %rdx, %rdx
je 0x6b1e
movq 0x168(%rsp), %rcx
leaq 0x7bbe(%rip), %rdi      # 0xe6cd
leaq 0x57(%rsp), %r8
movl $0x5, %esi
callq 0x7295
movq 0x170(%rsp), %rdx
testq %rdx, %rdx
je 0x6b49
movq 0x178(%rsp), %rcx
leaq 0x7b97(%rip), %rdi      # 0xe6d1
leaq 0x57(%rsp), %r8
movl $0x3, %esi
callq 0x7295
movq 0x180(%rsp), %rdx
testq %rdx, %rdx
je 0x6b74
movq 0x188(%rsp), %rcx
leaq 0x7b74(%rip), %rdi      # 0xe6d9
leaq 0x57(%rsp), %r8
movl $0x9, %esi
callq 0x7295
cmpb $0x1, 0x57(%rsp)
jne 0x6b87
leaq 0x7c1f(%rip), %rdi      # 0xe7a1
callq 0x20a0
movq %rbx, %rdi
callq 0x28e6
leaq 0x7b48(%rip), %rdi      # 0xe6de
movq %rax, %rsi
callq 0x7319
movq 0x140(%rsp), %rax
movq %rax, 0x28(%rsp)
movups 0x130(%rsp), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0xa0(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x90(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %r14, %rdi
callq 0x3349
movq 0x80(%rsp), %rax
movq %rax, 0x40(%rsp)
movups 0x70(%rsp), %xmm0
movups %xmm0, 0x30(%rsp)
movq 0x140(%rsp), %rax
movq %rax, 0x28(%rsp)
movups 0x130(%rsp), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0xa0(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x90(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %r14, %rdi
callq 0x5d04
movq 0xa0(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x90(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %r14, %rdi
movl $0x1, %esi
jmp 0x6c8c
cmpl $0x4, %ebp
jge 0x70a4
movq 0x68(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x58(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %r13, %rdi
xorl %esi, %esi
callq 0x7198
movq 0x68(%rsp), %rcx
movq %rcx, 0x10(%rsp)
movups 0x58(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %rax, %rdi
xorl %esi, %esi
callq 0x70e7
jmp 0x7034
cmpl $0x4, %ebp
jge 0x70ad
movq 0x68(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x58(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %r13, %rdi
movl $0x1, %esi
callq 0x7198
movq %rax, %r14
movq 0x68(%rsp), %rax
movq %rax, 0x170(%rsp)
movups 0x58(%rsp), %xmm0
movaps %xmm0, 0x160(%rsp)
callq 0xdc7c
movq %rax, %r12
movq (%rbx), %rdi
callq 0x9b8f
testb %al, %al
je 0x6d18
movl $0xa, %edi
callq 0x2050
leaq 0x7ad7(%rip), %r8       # 0xe7d8
leaq 0x7ae3(%rip), %r9       # 0xe7eb
movl $0x64, %edx
xorl %edi, %edi
xorl %esi, %esi
xorl %ecx, %ecx
callq 0x753c
xorps %xmm0, %xmm0
leaq 0xf0(%rsp), %r15
movaps %xmm0, (%r15)
movq 0x170(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x160(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0x907(%rip), %rdx       # 0x764e
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rcx
callq 0x52a0
movq %rax, %r14
movq (%r15), %rcx
leaq 0x7a76(%rip), %r8       # 0xe7d8
leaq 0x7a82(%rip), %r9       # 0xe7eb
movl $0x1, %edi
movq %rcx, %rsi
movq %rcx, %rdx
callq 0x753c
leaq 0x79f6(%rip), %rdi      # 0xe776
xorl %eax, %eax
callq 0x2150
movq (%rbx), %rdi
testq %r14, %r14
je 0x6fa0
leaq 0x79fc(%rip), %rdx      # 0xe796
movl $0x3, %esi
jmp 0x6fac
leaq 0x769d(%rip), %rsi      # 0xe448
leaq 0x148(%rsp), %rdi
callq 0xaf28
movups 0x148(%rsp), %xmm0
movaps %xmm0, 0x70(%rsp)
movq 0x158(%rsp), %rax
movq %rax, 0x80(%rsp)
movups 0x58(%rsp), %xmm0
movaps %xmm0, 0x110(%rsp)
movq 0x68(%rsp), %rax
movq %rax, 0x120(%rsp)
movq 0x68(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x58(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %r13, %rdi
movl $0x1, %esi
callq 0x7198
movq %rax, %r14
movq %r13, %rdi
callq 0x28cc
movq %rax, %r12
movaps 0x70(%rsp), %xmm0
movaps %xmm0, 0xb0(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0xc0(%rsp)
movq 0xb0(%rsp), %rax
cmpb $0x2f, (%rax)
jne 0x6e66
movq 0x80(%rsp), %rax
movq %rax, 0xe0(%rsp)
movaps 0x70(%rsp), %xmm0
movaps %xmm0, 0xd0(%rsp)
jmp 0x6edd
movq %r13, %rbx
leaq 0x160(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x98d8
movq 0x10(%r13), %rax
movq %rax, 0x10(%rsp)
movups (%r13), %xmm0
movups %xmm0, (%rsp)
leaq 0xf0(%rsp), %r13
movq %r13, %rdi
callq 0xb064
movq 0xc0(%rsp), %rax
movq %rax, 0x28(%rsp)
movaps 0xb0(%rsp), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x10(%r13), %rax
movq %rax, 0x10(%rsp)
movups (%r13), %xmm0
movq %rbx, %r13
movups %xmm0, (%rsp)
leaq 0xd0(%rsp), %rdi
movq %r12, %rsi
callq 0xb2df
movq 0xe0(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0xd0(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0xf0(%rsp), %r12
movq %r12, %rdi
callq 0xb064
movq 0x10(%r12), %rax
movq %rax, 0x10(%rsp)
movups (%r12), %xmm0
movups %xmm0, (%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x8020
leaq 0x160(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x4619
movq %r12, %rdi
callq 0x4a7d
testb %al, %al
je 0x7034
leaq 0x7851(%rip), %rdi      # 0xe7a1
xorl %eax, %eax
callq 0x2150
cmpl $0x1, %eax
jne 0x7034
movq %r13, %rdi
callq 0x28e6
leaq 0x7886(%rip), %rdi      # 0xe7f5
movq %rax, %rsi
callq 0x7319
movq 0x120(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x110(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x8403
jmp 0x7034
leaq 0x77e6(%rip), %rdx      # 0xe78d
movl $0x5, %esi
xorl %eax, %eax
callq 0x3cd8
movq %r12, 0x108(%rsp)
testq %r14, %r14
je 0x701b
leaq 0x7373(%rip), %r12      # 0xe33a
leaq 0x77d5(%rip), %r13      # 0xe7a3
leaq 0x7829(%rip), %rbp      # 0xe7fe
xorl %r15d, %r15d
movq (%rbx), %rdi
movl $0x3, %esi
movq %r12, %rdx
xorl %eax, %eax
callq 0x3cd8
movq (%rbx), %rdi
movq (%r14), %rax
movl 0x8(%rax), %ecx
movq (%rax), %r8
movl $0x2, %esi
movq %r13, %rdx
xorl %eax, %eax
callq 0x3cd8
movq %rbp, %rdi
callq 0x20a0
incq %r15
movq 0x8(%r14), %r14
testq %r14, %r14
jne 0x6fd8
jmp 0x701e
xorl %r15d, %r15d
movq 0x108(%rsp), %rdi
callq 0xde6a
testq %r15, %r15
jne 0x70b6
xorl %eax, %eax
addq $0x2b8, %rsp            # imm = 0x2B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x7576(%rip), %rdi      # 0xe5c5
xorl %eax, %eax
callq 0x3dc4
movq 0x8(%r14), %rsi
leaq 0x757c(%rip), %rdi      # 0xe5dd
jmp 0x706e
movq 0x8(%r14), %rsi
leaq 0x758e(%rip), %rdi      # 0xe5fc
xorl %eax, %eax
callq 0x3dc4
movl 0x98(%rsp), %esi
movq 0x90(%rsp), %rdx
leaq 0x761c(%rip), %rdi      # 0xe6a7
xorl %eax, %eax
callq 0x3dc4
leaq 0x75f3(%rip), %rdi      # 0xe68c
jmp 0x704f
leaq 0x75d0(%rip), %rdi      # 0xe672
jmp 0x704f
leaq 0x756a(%rip), %rdi      # 0xe615
jmp 0x704f
leaq 0x7583(%rip), %rdi      # 0xe637
jmp 0x704f
movl $0xa, %edi
callq 0x2050
cmpq $0x1, %r15
leaq 0x76d7(%rip), %rax      # 0xe7a2
leaq 0x738b(%rip), %rdx      # 0xe45d
cmoveq %rax, %rdx
leaq 0x76cc(%rip), %rdi      # 0xe7a9
movq %r15, %rsi
xorl %eax, %eax
callq 0x3dc4