// File: /workspace/github_c_makefile_star2_O0/jarun[P]nnn/src/nnn.c
// Function: handle_bookmark
static size_t handle_bookmark(const char *bmark, char *newpath)
{
	int fd = '\r';
	size_t r;

	if (maxbm || bmark) {
		r = xstrsncpy(g_buf, messages[MSG_KEYS], CMD_LEN_MAX);

		if (bmark) { /* There is a marked directory */
			g_buf[--r] = ' ';
			g_buf[++r] = ',';
			g_buf[++r] = '\0';
			++r;
		}
		printkeys(bookmark, g_buf + r - 1, maxbm);
		printmsg(g_buf);
		fd = get_input(NULL);
	}

	r = FALSE;
	if (fd == ',') /* Visit marked directory */
		bmark ? xstrsncpy(newpath, bmark, PATH_MAX) : (r = MSG_NOT_SET);
	else if (fd == '\r') { /* Visit bookmarks directory */
		mkpath(cfgpath, toks[TOK_BM], newpath);
		g_state.selbm = 1;
	} else if (!get_kv_val(bookmark, newpath, fd, maxbm, NNN_BMS))
		r = MSG_INVALID_KEY;

	if (!r && chdir(newpath) == -1) {
		r = MSG_ACCESS;
		if (g_state.selbm)
			g_state.selbm = 0;
	}

	return r;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0xd, -0x14(%rbp)
movzbl 0xf04a(%rip), %eax      # 0x20968
cmpl $0x0, %eax
jne 0x1192e
cmpq $0x0, -0x8(%rbp)
je 0x119e8
movq 0xe23b(%rip), %rsi      # 0x1fb70
leaq 0xf114(%rip), %rdi      # 0x20a50
movl $0x1200, %edx           # imm = 0x1200
callq 0x6250
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x119ae
movq -0x20(%rbp), %rcx
movq %rcx, %rax
addq $-0x1, %rax
movq %rax, -0x20(%rbp)
leaq 0xf0e9(%rip), %rax      # 0x20a50
movb $0x20, -0x1(%rax,%rcx)
movq -0x20(%rbp), %rcx
movq %rcx, %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
leaq 0xf0ce(%rip), %rax      # 0x20a50
movb $0x2c, 0x1(%rax,%rcx)
movq -0x20(%rbp), %rcx
movq %rcx, %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
leaq 0xf0b3(%rip), %rax      # 0x20a50
movb $0x0, 0x1(%rax,%rcx)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movq 0xefa3(%rip), %rdi      # 0x20958
leaq 0xf094(%rip), %rsi      # 0x20a50
addq -0x20(%rbp), %rsi
addq $-0x1, %rsi
movzbl 0xef9d(%rip), %edx      # 0x20968
callq 0x158f0
leaq 0xf079(%rip), %rdi      # 0x20a50
callq 0xd020
xorl %eax, %eax
movl %eax, %edi
callq 0x10dc0
movl %eax, -0x14(%rbp)
movq $0x0, -0x20(%rbp)
cmpl $0x2c, -0x14(%rbp)
jne 0x11a1b
cmpq $0x0, -0x8(%rbp)
je 0x11a11
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl $0x1000, %edx           # imm = 0x1000
callq 0x6250
jmp 0x11a19
movq $0x1b, -0x20(%rbp)
jmp 0x11a82
cmpl $0xd, -0x14(%rbp)
jne 0x11a50
movq 0x10240(%rip), %rdi     # 0x21c68
movq 0xe281(%rip), %rsi      # 0x1fcb0
movq -0x10(%rbp), %rdx
callq 0x74c0
movl 0xede6(%rip), %eax      # 0x20824
andl $0xffefffff, %eax       # imm = 0xFFEFFFFF
orl $0x100000, %eax         # imm = 0x100000
movl %eax, 0xedd6(%rip)      # 0x20824
jmp 0x11a80
movq 0xef01(%rip), %rdi      # 0x20958
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
movl $0x1, %r8d
movzbl 0xeefd(%rip), %ecx      # 0x20968
callq 0x7060
cmpq $0x0, %rax
jne 0x11a7e
movq $0x28, -0x20(%rbp)
jmp 0x11a80
jmp 0x11a82
cmpq $0x0, -0x20(%rbp)
jne 0x11ac6
movq -0x10(%rbp), %rdi
callq 0x42d0
cmpl $-0x1, %eax
jne 0x11ac6
movq $0x18, -0x20(%rbp)
movl 0xed7f(%rip), %eax      # 0x20824
shrl $0x14, %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x11ac4
movl 0xed6e(%rip), %eax      # 0x20824
andl $0xffefffff, %eax       # imm = 0xFFEFFFFF
orl $0x0, %eax
movl %eax, 0xed60(%rip)      # 0x20824
jmp 0x11ac6
movq -0x20(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq