// File: Linkerist[P]xs/src/xs.cc
// Function: finish(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool)
void
finish(string result, bool retval)
{
 curs_set(1); // re-show cursor (FIXME: necessary?)
 clear();
 refresh();   // ..and make sure we really see the clean screen
 //resetty();   // ??
 endwin();    // finish the curses at all

 // only save if list was not filtered!
 if (!NeedleGiven)
  list_to_file();

 // is the result really a dir?
 if (!valid(result, PATH_IS_DIR)) {
  fprintf(stderr, "This is not a valid directory:\n%s\n", result.c_str());
  exit(-3);
 }

 string resfile = canonify_filename(string(DefaultResultfile));
 ofstream out(resfile.c_str());
 if (out) {
  out << result << endl;
  out.close();
 }

 if (!retval)
  exit(1);

 exit(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2d0, %rsp            # imm = 0x2D0
movq %rdi, -0x290(%rbp)
movb %sil, %al
movq %rdi, -0x8(%rbp)
andb $0x1, %al
movb %al, -0x9(%rbp)
movl $0x1, %edi
callq 0x4330
callq 0x4720
callq 0x4700
callq 0x44a0
testb $0x1, 0x12152(%rip)     # 0x17560
jne 0x5415
callq 0x7d20
movq -0x290(%rbp), %rsi
leaq -0x30(%rbp), %rdi
movq %rdi, -0x2a0(%rbp)
callq 0x41b0
movq -0x2a0(%rbp), %rdi
movl $0x1, %esi
callq 0x52a0
movb %al, -0x291(%rbp)
jmp 0x5445
movb -0x291(%rbp), %al
xorb $-0x1, %al
movb %al, -0x2a1(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x4828
movb -0x2a1(%rbp), %al
testb $0x1, %al
jne 0x5468
jmp 0x54c1
movq -0x290(%rbp), %rdi
movq 0x11b52(%rip), %rax     # 0x16fc8
movq (%rax), %rax
movq %rax, -0x2b0(%rbp)
callq 0x41a0
movq -0x2b0(%rbp), %rdi
movq %rax, %rdx
leaq 0xabd8(%rip), %rsi      # 0x1006e
movb $0x0, %al
callq 0x45d0
movl $0xfffffffd, %edi       # imm = 0xFFFFFFFD
callq 0x44d0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x4828
jmp 0x5627
movq 0x11f60(%rip), %rax     # 0x17428
movq %rax, -0x2c0(%rbp)
leaq -0x81(%rbp), %rdi
movq %rdi, -0x2b8(%rbp)
callq 0x4740
movq -0x2c0(%rbp), %rsi
movq -0x2b8(%rbp), %rdx
leaq -0x80(%rbp), %rdi
callq 0x5e40
jmp 0x54fb
leaq -0x60(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x4bd0
jmp 0x550a
leaq -0x80(%rbp), %rdi
callq 0x4828
leaq -0x81(%rbp), %rdi
callq 0x4450
leaq -0x60(%rbp), %rdi
callq 0x41a0
movq %rax, %rsi
leaq -0x288(%rbp), %rdi
movl $0x10, %edx
callq 0x4460
jmp 0x553e
movq -0x288(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x288(%rbp,%rax), %rdi
callq 0x4510
movb %al, -0x2c1(%rbp)
jmp 0x555e
movb -0x2c1(%rbp), %al
testb $0x1, %al
jne 0x556d
jmp 0x5607
movq -0x290(%rbp), %rsi
leaq -0x288(%rbp), %rdi
callq 0x4380
movq %rax, -0x2d0(%rbp)
jmp 0x5589
movq -0x2d0(%rbp), %rdi
movq 0x11a11(%rip), %rsi     # 0x16fa8
callq 0x4420
jmp 0x559e
leaq -0x288(%rbp), %rdi
callq 0x45c0
jmp 0x55ac
jmp 0x5607
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x55d1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x4828
leaq -0x81(%rbp), %rdi
callq 0x4450
jmp 0x5627
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x561e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x288(%rbp), %rdi
callq 0x4610
jmp 0x561e
testb $0x1, -0x9(%rbp)
jne 0x5617
movl $0x1, %edi
callq 0x44d0
xorl %edi, %edi
callq 0x44d0
leaq -0x60(%rbp), %rdi
callq 0x4828
movq -0x38(%rbp), %rdi
callq 0x4730