// File: /workspace/github_c_makefile_star2_O3/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 0xd89c
movq %rax, %r13
movq 0xca83(%rip), %rbx      # 0x12fd0
movq (%rbx), %rdi
xorl %esi, %esi
callq 0x2140
movq 0xca9a(%rip), %rax      # 0x12ff8
movq (%rax), %rdi
xorl %esi, %esi
callq 0x2140
cmpl $0x1, %ebp
jle 0x6ea4
movq 0x8(%r14), %rsi
leaq 0x58(%rsp), %r15
movq %r15, %rdi
callq 0xab5c
movq 0x10(%r15), %rax
movq %rax, 0x10(%rsp)
movups (%r15), %xmm0
movups %xmm0, (%rsp)
callq 0x8ed6
testb %al, %al
je 0x6ead
movq 0x68(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x58(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0x228(%rsp), %r15
movq %r15, %rdi
callq 0x8f5d
movl $0xf000, %eax           # imm = 0xF000
andl 0x18(%r15), %eax
cmpl $0x4000, %eax           # imm = 0x4000
jne 0x6eba
cmpl $0x2, %ebp
jne 0x67c0
movups 0x58(%rsp), %xmm0
movaps %xmm0, 0x90(%rsp)
movq 0x68(%rsp), %rax
movq %rax, 0xa0(%rsp)
movq %r13, %rdi
callq 0x2828
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 0xac98
leaq 0x7bad(%rip), %rsi      # 0xe1e2
leaq 0xd0(%rsp), %r12
movq %r12, %rdi
callq 0xab5c
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 0xaf03
leaq 0x7b65(%rip), %rsi      # 0xe1e9
movq %r13, %rbx
leaq 0x110(%rsp), %r13
movq %r13, %rdi
callq 0xab5c
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 0xaf03
leaq 0x7fcc(%rip), %rsi      # 0xe69b
leaq 0x210(%rsp), %r13
movq %r13, %rdi
callq 0xab5c
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 0xaf03
movq 0x10(%r12), %rax
movq %rax, 0x10(%rsp)
movups (%r12), %xmm0
movups %xmm0, (%rsp)
callq 0x8ed6
testb %al, %al
je 0x6ecc
movq 0x100(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0xf0(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x7cb2
movq 0xc0(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0xb0(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
callq 0xa471
movq %rax, %r15
movq 0x80(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x70(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x8ed6
testb %al, %al
je 0x68cf
movq 0x80(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x70(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
callq 0x566b
jmp 0x68d7
movq 0x10(%r14), %rdi
cmpb $0x67, (%rdi)
jne 0x67d9
cmpb $0x63, 0x1(%rdi)
jne 0x67d9
cmpb $0x0, 0x2(%rdi)
je 0x6e61
leaq 0x7ffe(%rip), %rsi      # 0xe7de
callq 0x2230
testl %eax, %eax
je 0x6a89
leaq 0x7e69(%rip), %rsi      # 0xe65d
leaq 0x1f8(%rsp), %r15
movq %r15, %rdi
callq 0xab5c
leaq 0x7e5b(%rip), %rsi      # 0xe666
leaq 0x1e0(%rsp), %r12
movq %r12, %rdi
callq 0xab5c
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 0x9a9e
movq %rax, %r15
movq 0x10(%r14), %rsi
leaq 0x1c8(%rsp), %r12
movq %r12, %rdi
callq 0xab5c
movq 0x10(%r12), %rax
movq %rax, 0x10(%rsp)
movups (%r12), %xmm0
movups %xmm0, (%rsp)
movq %r15, %rdi
callq 0x9b87
testb %al, %al
je 0x6ee9
cmpl $0x5, %ebp
jae 0x6ef2
movq 0x10(%r14), %rsi
leaq 0x1b0(%rsp), %r15
movq %r15, %rdi
callq 0xab5c
movq 0x10(%r15), %rax
movq %rax, 0x10(%rsp)
movups (%r15), %xmm0
movups %xmm0, (%rsp)
callq 0x9855
movq %rax, %r15
cmpl $0x4, %ebp
jne 0x6c41
movq 0x18(%r14), %rsi
jmp 0x6c48
movq %rbx, %rdi
callq 0x5624
movq %rax, %r14
movq %rax, %rdi
movq %r15, %rsi
callq 0x2b64
movq 0x58(%r15), %rax
movq (%rax), %rdx
leaq 0x160(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x44f4
movq %r15, %rdi
callq 0x4446
movq %r12, %rdi
callq 0x49a7
testb %al, %al
je 0x6e4d
movl $0xa, %edi
callq 0x2050
movb $0x0, 0x57(%rsp)
movq 0x160(%rsp), %rdx
testq %rdx, %rdx
je 0x6951
movq 0x168(%rsp), %rcx
leaq 0x7d88(%rip), %rdi      # 0xe6ca
leaq 0x57(%rsp), %r8
movl $0x5, %esi
callq 0x70c0
movq 0x170(%rsp), %rdx
testq %rdx, %rdx
je 0x697c
movq 0x178(%rsp), %rcx
leaq 0x7d61(%rip), %rdi      # 0xe6ce
leaq 0x57(%rsp), %r8
movl $0x3, %esi
callq 0x70c0
movq 0x180(%rsp), %rdx
testq %rdx, %rdx
je 0x69a7
movq 0x188(%rsp), %rcx
leaq 0x7d3e(%rip), %rdi      # 0xe6d6
leaq 0x57(%rsp), %r8
movl $0x9, %esi
callq 0x70c0
cmpb $0x1, 0x57(%rsp)
jne 0x69ba
leaq 0x7de9(%rip), %rdi      # 0xe79e
callq 0x20a0
movq %rbx, %rdi
callq 0x2842
leaq 0x7d12(%rip), %rdi      # 0xe6db
movq %rax, %rsi
callq 0x7144
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 0x3251
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 0x5c94
movq 0xa0(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x90(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %r14, %rdi
movl $0x1, %esi
callq 0x6f12
jmp 0x6e4d
cmpl $0x4, %ebp
jae 0x6efb
movq 0x68(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x58(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %r13, %rdi
movl $0x1, %esi
callq 0x6fc3
movq %rax, %r14
movq 0x68(%rsp), %rax
movq %rax, 0x170(%rsp)
movups 0x58(%rsp), %xmm0
movaps %xmm0, 0x160(%rsp)
callq 0xd89c
movq %rax, %r12
movq (%rbx), %rdi
callq 0x9818
testb %al, %al
je 0x6b0b
movl $0xa, %edi
callq 0x2050
leaq 0x7ce1(%rip), %r8       # 0xe7d5
leaq 0x7ced(%rip), %r9       # 0xe7e8
movl $0x64, %edx
xorl %edi, %edi
xorl %esi, %esi
xorl %ecx, %ecx
callq 0x7367
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 0x93f(%rip), %rdx       # 0x7479
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rcx
callq 0x5254
movq %rax, %r14
movq (%r15), %rcx
leaq 0x7c80(%rip), %r8       # 0xe7d5
leaq 0x7c8c(%rip), %r9       # 0xe7e8
movl $0x1, %edi
movq %rcx, %rsi
movq %rcx, %rdx
callq 0x7367
leaq 0x7c00(%rip), %rdi      # 0xe773
xorl %eax, %eax
callq 0x2150
movq (%rbx), %rdi
testq %r14, %r14
je 0x6e32
movq %r12, 0x108(%rsp)
leaq 0x7bfe(%rip), %rdx      # 0xe793
movl $0x3, %esi
xorl %eax, %eax
callq 0x3bbc
leaq 0x7792(%rip), %r12      # 0xe33a
leaq 0x7bf1(%rip), %r13      # 0xe7a0
leaq 0x7c45(%rip), %rbp      # 0xe7fb
xorl %r15d, %r15d
movq (%rbx), %rdi
movl $0x3, %esi
movq %r12, %rdx
xorl %eax, %eax
callq 0x3bbc
movq (%rbx), %rdi
movq (%r14), %rax
movl 0x8(%rax), %ecx
movq (%rax), %r8
movl $0x2, %esi
movq %r13, %rdx
xorl %eax, %eax
callq 0x3bbc
movq %rbp, %rdi
callq 0x20a0
incq %r15
movq 0x8(%r14), %r14
testq %r14, %r14
jne 0x6bb9
movq 0x108(%rsp), %rdi
callq 0xda8a
testq %r15, %r15
je 0x6e4d
movl $0xa, %edi
callq 0x2050
cmpq $0x1, %r15
leaq 0x7b7a(%rip), %rax      # 0xe79f
leaq 0x7831(%rip), %rdx      # 0xe45d
cmoveq %rax, %rdx
leaq 0x7b6f(%rip), %rdi      # 0xe7a6
movq %r15, %rsi
xorl %eax, %eax
callq 0x3ca8
leaq 0x7800(%rip), %rsi      # 0xe448
leaq 0x148(%rsp), %rdi
callq 0xab5c
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 0x6fc3
movq %rax, %r14
movq %r13, %rdi
callq 0x2828
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 0x6d03
movq 0x80(%rsp), %rax
movq %rax, 0xe0(%rsp)
movaps 0x70(%rsp), %xmm0
movaps %xmm0, 0xd0(%rsp)
jmp 0x6d7a
movq %r13, %rbx
leaq 0x160(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x95e2
movq 0x10(%r13), %rax
movq %rax, 0x10(%rsp)
movups (%r13), %xmm0
movups %xmm0, (%rsp)
leaq 0xf0(%rsp), %r13
movq %r13, %rdi
callq 0xac98
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 0xaf03
movq 0xe0(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0xd0(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0xf0(%rsp), %r12
movq %r12, %rdi
callq 0xac98
movq 0x10(%r12), %rax
movq %rax, 0x10(%rsp)
movups (%r12), %xmm0
movups %xmm0, (%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x7e40
leaq 0x160(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x44f4
movq %r12, %rdi
callq 0x49a7
testb %al, %al
je 0x6e4d
leaq 0x79b5(%rip), %rdi      # 0xe79e
xorl %eax, %eax
callq 0x2150
cmpl $0x1, %eax
jne 0x6e4d
movq %r13, %rdi
callq 0x2842
leaq 0x79ee(%rip), %rdi      # 0xe7f2
movq %rax, %rsi
callq 0x7144
movq 0x120(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x110(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x820f
jmp 0x6e4d
leaq 0x7951(%rip), %rdx      # 0xe78a
movl $0x5, %esi
xorl %eax, %eax
callq 0x3bbc
movq %r12, %rdi
callq 0xda8a
xorl %eax, %eax
addq $0x2b8, %rsp            # imm = 0x2B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x4, %ebp
jae 0x6f04
movq 0x68(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x58(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %r13, %rdi
xorl %esi, %esi
callq 0x6fc3
movq 0x68(%rsp), %rcx
movq %rcx, 0x10(%rsp)
movups 0x58(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %rax, %rdi
xorl %esi, %esi
jmp 0x6a7f
leaq 0x771a(%rip), %rdi      # 0xe5c5
jmp 0x6f0b
movq 0x8(%r14), %rsi
leaq 0x7725(%rip), %rdi      # 0xe5dd
jmp 0x6ec5
movq 0x8(%r14), %rsi
leaq 0x7737(%rip), %rdi      # 0xe5fc
xorl %eax, %eax
callq 0x3ca8
movl 0x98(%rsp), %esi
movq 0x90(%rsp), %rdx
leaq 0x77c2(%rip), %rdi      # 0xe6a4
xorl %eax, %eax
callq 0x3ca8
leaq 0x7799(%rip), %rdi      # 0xe689
jmp 0x6f0b
leaq 0x7776(%rip), %rdi      # 0xe66f
jmp 0x6f0b
leaq 0x7732(%rip), %rdi      # 0xe634
jmp 0x6f0b
leaq 0x7707(%rip), %rdi      # 0xe612
xorl %eax, %eax
callq 0x3ca8