// File: /workspace/github_c_makefile_star2_O0/jarun[P]nnn/src/nnn.c
// Function: show_help
static void show_help(const char *path)
{
	static const char helpstr[] = {
	"2|V\\_\n"
	"2/. \\\\\n"
	"1(;^; ||\n"
	"3/___3\n"
	"2(___n))\n"
	"0\n"
	"1NAVIGATION\n"
	       "9Up k  Up%16PgUp ^U  Page up\n"
	       "9Dn j  Down%14PgDn ^D  Page down\n"
	       "9Lt h  Parent%12~ ` @ -  ~, /, start, prev\n"
	   "5Ret Rt l  Open%20'  First file/match\n"
	       "9g ^A  Top%21J  Jump to entry/offset\n"
	       "9G ^E  End%20^J  Toggle auto-advance on open\n"
	      "8B (,)  Book(mark)%11b ^/  Select bookmark\n"
		"a1-4  Context%11(Sh)Tab  Cycle/new context\n"
	    "62Esc ^Q  Quit%19^y  Next young\n"
		 "b^G  QuitCD%18Q  Pick/err, quit\n"
		  "cq  Quit context\n"
	"0\n"
	"1FILTER & PROMPT\n"
		  "c/  Filter%17^N  Toggle type-to-nav\n"
		"aEsc  Exit prompt%12^L  Toggle last filter\n"
		  "c.  Toggle hidden%05Alt+Esc  Unfilter, quit context\n"
	"0\n"
	"1FILES\n"
	       "9o ^O  Open with%15n  Create new/link\n"
	       "9f ^F  File stats%14d  Detail mode toggle\n"
		 "b^R  Rename/dup%14r  Batch rename\n"
		  "cz  Archive%17e  Edit file\n"
		  "c*  Toggle exe%14>  Export list\n"
	    "6Space +  (Un)select%12m-m  Select range/clear\n"
	          "ca  Select all%14A  Invert sel\n"
	       "9p ^P  Copy here%12w ^W  Cp/mv sel as\n"
	       "9v ^V  Move here%15E  Edit sel list\n"
	       "9x ^X  Delete or trash%09S  Listed sel size\n"
		  "cX  Delete (rm -rf)%07Esc  Send to FIFO\n"
	"0\n"
	"1MISC\n"
	      "8Alt ;  Select plugin%11=  Launch app\n"
	       "9! ^]  Shell%19]  Cmd prompt\n"
		  "cc  Connect remote%10u  Unmount remote/archive\n"
	       "9t ^T  Sort toggles%12s  Manage session\n"
		  "cT  Set time type%110  Lock\n"
		 "b^L  Redraw%18?  Help, conf\n"
	};

	int fd = create_tmp_file();
	if (fd == -1)
		return;
	FILE *f = fdopen(fd, "wb");
	if (f == NULL) {
		close(fd);
		unlink(g_tmpfpath);
		return;
	}

	char *prog = xgetenv(env_cfg[NNN_HELP], NULL);
	if (prog)
		get_output(prog, NULL, NULL, fd, FALSE);

	bool hex = true;
	const char *end = helpstr + sizeof(helpstr) - 1;

	for (const char *s = helpstr; s < end; ++s) {
		if (hex) {
			for (int k = 0, n = xchartohex(*s); k < n; ++k)
				fputc(' ', f);
		} else if (*s == '%') {
			int n = ((s[1] - '0') * 10) + (s[2] - '0');
			for (int k = 0; k < n; ++k)
				fputc(' ', f);
			s += 2;
		} else {
			fputc(*s, f);
		}
		hex = (*s == '\n');
	}

#ifndef NOSSN
	if (curssn[0])
		fprintf(f, "\nSESSION: %s\n", curssn);
#endif

	fprintf(f, "\nCONTEXTS\n");
	for (uchar_t i = 0; i < CTX_MAX; ++i)
		if (g_ctx[i].c_cfg.ctxactive)
			fprintf(f, " %u%c %s\n", i + 1, (cfg.curctx == i) ? '*' : ' ', g_ctx[i].c_path);

	fprintf(f, "\nVOLUME: avail:%s ", coolsize(get_fs_info(path, VFS_AVAIL)));
	fprintf(f, "used:%s ", coolsize(get_fs_info(path, VFS_USED)));
	fprintf(f, "size:%s\n\n", coolsize(get_fs_info(path, VFS_SIZE)));

	if (bookmark) {
		fprintf(f, "BOOKMARKS\n");
		printkv(bookmark, f, maxbm, NNN_BMS);
		fprintf(f, "\n");
	}

	if (plug) {
		fprintf(f, "PLUGIN KEYS\n");
		printkv(plug, f, maxplug, NNN_PLUG);
		fprintf(f, "\n");
	}

	for (uchar_t i = NNN_OPENER; i <= NNN_TRASH; ++i) {
		char *s = getenv(env_cfg[i]);
		if (s)
			fprintf(f, "%s: %s\n", env_cfg[i], s);
	}

	if (selpath)
		fprintf(f, "SELECTION FILE: %s\n", selpath);

	fprintf(f, "\nv%s\n%s\n", VERSION, GENERAL_INFO);
	fclose(f); // also closes fd

	spawn(pager, g_tmpfpath, NULL, NULL, F_CLI | F_TTY);
	unlink(g_tmpfpath);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
callq 0xddd0
movl %eax, -0xc(%rbp)
cmpl $-0x1, -0xc(%rbp)
jne 0x12cdf
jmp 0x1311a
movl -0xc(%rbp), %edi
leaq 0x9b3b(%rip), %rsi      # 0x1c824
callq 0x4670
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x12d12
movl -0xc(%rbp), %edi
callq 0x43c0
leaq 0xdcf8(%rip), %rdi      # 0x20a00
callq 0x40d0
jmp 0x1311a
movq 0xcc87(%rip), %rdi      # 0x1f9a0
xorl %eax, %eax
movl %eax, %esi
callq 0x5c70
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x12d43
movq -0x20(%rbp), %rdi
movl -0xc(%rbp), %ecx
xorl %eax, %eax
movl %eax, %edx
xorl %r8d, %r8d
movq %rdx, %rsi
callq 0x10ba0
movb $0x1, -0x21(%rbp)
leaq 0x88c2(%rip), %rax      # 0x1b610
addq $0x4cf, %rax            # imm = 0x4CF
addq $-0x1, %rax
movq %rax, -0x30(%rbp)
leaq 0x88ad(%rip), %rax      # 0x1b610
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x30(%rbp), %rax
jae 0x12e4c
testb $0x1, -0x21(%rbp)
je 0x12db7
movl $0x0, -0x3c(%rbp)
movq -0x38(%rbp), %rax
movzbl (%rax), %edi
callq 0xd3d0
movzbl %al, %eax
movl %eax, -0x40(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x40(%rbp), %eax
jge 0x12db5
movq -0x18(%rbp), %rsi
movl $0x20, %edi
callq 0x4430
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x12d94
jmp 0x12e29
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x25, %eax
jne 0x12e17
movq -0x38(%rbp), %rax
movsbl 0x1(%rax), %eax
subl $0x30, %eax
imull $0xa, %eax, %eax
movq -0x38(%rbp), %rcx
movsbl 0x2(%rcx), %ecx
subl $0x30, %ecx
addl %ecx, %eax
movl %eax, -0x44(%rbp)
movl $0x0, -0x48(%rbp)
movl -0x48(%rbp), %eax
cmpl -0x44(%rbp), %eax
jge 0x12e09
movq -0x18(%rbp), %rsi
movl $0x20, %edi
callq 0x4430
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x12de8
movq -0x38(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x38(%rbp)
jmp 0x12e27
movq -0x38(%rbp), %rax
movsbl (%rax), %edi
movq -0x18(%rbp), %rsi
callq 0x4430
jmp 0x12e29
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
cmpl $0xa, %eax
sete %al
andb $0x1, %al
movb %al, -0x21(%rbp)
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x12d67
cmpb $0x0, 0xd9dd(%rip)      # 0x20830
je 0x12e6e
movq -0x18(%rbp), %rdi
leaq 0x99c7(%rip), %rsi      # 0x1c827
leaq 0xd9c9(%rip), %rdx      # 0x20830
movb $0x0, %al
callq 0x4510
movq -0x18(%rbp), %rdi
leaq 0x99bc(%rip), %rsi      # 0x1c835
movb $0x0, %al
callq 0x4510
movb $0x0, -0x49(%rbp)
movzbl -0x49(%rbp), %eax
cmpl $0x4, %eax
jge 0x12f17
movzbl -0x49(%rbp), %eax
movl %eax, %ecx
leaq 0xeff2(%rip), %rax      # 0x21e90
imulq $0x2138, %rcx, %rcx     # imm = 0x2138
addq %rcx, %rax
movl 0x2130(%rax), %eax
shrl $0x9, %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x12f08
movq -0x18(%rbp), %rdi
movzbl -0x49(%rbp), %edx
addl $0x1, %edx
movl 0xd606(%rip), %esi      # 0x204d0
shrl $0xd, %esi
andl $0x7, %esi
movzbl -0x49(%rbp), %r8d
movl $0x20, %ecx
movl $0x2a, %eax
cmpl %r8d, %esi
cmovel %eax, %ecx
movzbl -0x49(%rbp), %eax
leaq 0xefa0(%rip), %r8       # 0x21e90
imulq $0x2138, %rax, %rax     # imm = 0x2138
addq %rax, %r8
leaq 0x993f(%rip), %rsi      # 0x1c840
movb $0x0, %al
callq 0x4510
jmp 0x12f0a
movb -0x49(%rbp), %al
addb $0x1, %al
movb %al, -0x49(%rbp)
jmp 0x12e84
movq -0x18(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x185c0
movq %rax, %rdi
callq 0x17ea0
movq -0x70(%rbp), %rdi
movq %rax, %rdx
leaq 0x990a(%rip), %rsi      # 0x1c84a
movb $0x0, %al
callq 0x4510
movq -0x18(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x185c0
movq %rax, %rdi
callq 0x17ea0
movq -0x68(%rbp), %rdi
movq %rax, %rdx
leaq 0x98ea(%rip), %rsi      # 0x1c85d
movb $0x0, %al
callq 0x4510
movq -0x18(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x8(%rbp), %rdi
movl $0x2, %esi
callq 0x185c0
movq %rax, %rdi
callq 0x17ea0
movq -0x60(%rbp), %rdi
movq %rax, %rdx
leaq 0x98c0(%rip), %rsi      # 0x1c866
movb $0x0, %al
callq 0x4510
cmpq $0x0, 0xd9a3(%rip)      # 0x20958
je 0x12ff7
movq -0x18(%rbp), %rdi
leaq 0x98ae(%rip), %rsi      # 0x1c870
movb $0x0, %al
callq 0x4510
movq 0xd988(%rip), %rdi      # 0x20958
movq -0x18(%rbp), %rsi
movl $0x1, %ecx
movzbl 0xd988(%rip), %edx      # 0x20968
callq 0x19880
movq -0x18(%rbp), %rdi
leaq 0x987e(%rip), %rsi      # 0x1c86e
movb $0x0, %al
callq 0x4510
cmpq $0x0, 0xd971(%rip)      # 0x20970
je 0x13041
movq -0x18(%rbp), %rdi
leaq 0x986f(%rip), %rsi      # 0x1c87b
movb $0x0, %al
callq 0x4510
movq 0xd956(%rip), %rdi      # 0x20970
movq -0x18(%rbp), %rsi
movl $0x2, %ecx
movzbl 0xd956(%rip), %edx      # 0x20980
callq 0x19880
movq -0x18(%rbp), %rdi
leaq 0x9834(%rip), %rsi      # 0x1c86e
movb $0x0, %al
callq 0x4510
movb $0x3, -0x4a(%rbp)
movzbl -0x4a(%rbp), %eax
cmpl $0xd, %eax
jg 0x130a2
movzbl -0x4a(%rbp), %eax
movl %eax, %ecx
leaq 0xc8e5(%rip), %rax      # 0x1f940
movq (%rax,%rcx,8), %rdi
callq 0x4050
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x58(%rbp)
je 0x13096
movq -0x18(%rbp), %rdi
movzbl -0x4a(%rbp), %eax
movl %eax, %ecx
leaq 0xc8c0(%rip), %rax      # 0x1f940
movq (%rax,%rcx,8), %rdx
movq -0x58(%rbp), %rcx
leaq 0x97f9(%rip), %rsi      # 0x1c888
movb $0x0, %al
callq 0x4510
jmp 0x13098
movb -0x4a(%rbp), %al
addb $0x1, %al
movb %al, -0x4a(%rbp)
jmp 0x13045
cmpq $0x0, 0xd77e(%rip)      # 0x20828
je 0x130c5
movq -0x18(%rbp), %rdi
movq 0xd771(%rip), %rdx      # 0x20828
leaq 0x97d2(%rip), %rsi      # 0x1c890
movb $0x0, %al
callq 0x4510
movq -0x18(%rbp), %rdi
leaq 0x904c(%rip), %rsi      # 0x1c11c
leaq 0x8a52(%rip), %rdx      # 0x1bb29
leaq 0x904d(%rip), %rcx      # 0x1c12b
movb $0x0, %al
callq 0x4510
movq -0x18(%rbp), %rdi
callq 0x4250
movq 0xd8fb(%rip), %rdi      # 0x209f0
leaq 0xd904(%rip), %rsi      # 0x20a00
xorl %eax, %eax
movl %eax, %ecx
movl $0x109, %r8d            # imm = 0x109
movq %rcx, %rdx
callq 0xde30
leaq 0xd8eb(%rip), %rdi      # 0x20a00
callq 0x40d0
addq $0x70, %rsp
popq %rbp
retq