// File: /workspace/github_c_makefile_star2_O0/jarun[P]nnn/src/nnn.c
// Function: handle_archive
static bool handle_archive(char *fpath /* in-out param */, char op)
{
	char arg[] = "-tvf"; /* options for tar/bsdtar to list files */
	char *util, *outdir = NULL;
	bool x_to = FALSE;
	bool is_atool = (!g_state.usebsdtar && getutil(utils[UTIL_ATOOL]));

	if (op == 'x') {
		outdir = xreadline(is_atool ? "." : xbasename(fpath), messages[MSG_NEW_PATH]);
		if (!outdir || !*outdir) { /* Cancelled */
			printwait(messages[MSG_CANCEL], NULL);
			return FALSE;
		}
		/* Do not create smart context for current dir */
		if (!(*outdir == '.' && outdir[1] == '\0')) {
			if (!xmktree(outdir, TRUE) || (chdir(outdir) == -1)) {
				printwarn(NULL);
				return FALSE;
			}
			/* Copy the new dir path to open it in smart context */
			outdir = getcwd(NULL, 0); // NOLINT
			x_to = TRUE;
		}
	}

	if (is_atool) {
		util = utils[UTIL_ATOOL];
		arg[1] = op;
		arg[2] = '\0';
	} else if (getutil(utils[UTIL_BSDTAR])) {
		util = utils[UTIL_BSDTAR];
		if (op == 'x')
			arg[1] = op;
	} else if (is_suffix(fpath, ".zip")) {
		util = utils[UTIL_UNZIP];
		arg[1] = (op == 'l') ? 'v' /* verbose listing */ : '\0';
		arg[2] = '\0';
	} else {
		util = utils[UTIL_TAR];
		if (op == 'x')
			arg[1] = op;
	}

	if (op == 'x') /* extract */
		spawn(util, arg, fpath, NULL, F_NORMAL | F_MULTI);
	else /* list */
		get_output(util, arg, fpath, -1, TRUE);

	if (x_to) {
		if (chdir(xdirname(fpath)) == -1) {
			printwarn(NULL);
			free(outdir);
			return FALSE;
		}
		xstrsncpy(fpath, outdir, PATH_MAX);
		free(outdir);
	} else if (op == 'x')
		fpath[0] = '\0';

	return TRUE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movb %sil, %al
movq %rdi, -0x10(%rbp)
movb %al, -0x11(%rbp)
movl 0xb8e5(%rip), %eax      # 0x1c76d
movl %eax, -0x16(%rbp)
movb 0xb8e0(%rip), %al       # 0x1c771
movb %al, -0x12(%rbp)
movq $0x0, -0x28(%rbp)
movb $0x0, -0x29(%rbp)
movl 0xf97e(%rip), %ecx      # 0x20824
shrl $0x18, %ecx
andl $0x1, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x2b(%rbp)
jne 0x10ec5
movq 0xeafb(%rip), %rdi      # 0x1f9b8
callq 0x12930
movb %al, -0x2b(%rbp)
movb -0x2b(%rbp), %al
andb $0x1, %al
movb %al, -0x2a(%rbp)
movsbl -0x11(%rbp), %eax
cmpl $0x78, %eax
jne 0x10fa9
testb $0x1, -0x2a(%rbp)
je 0x10eed
leaq 0xb7ab(%rip), %rax      # 0x1c692
movq %rax, -0x38(%rbp)
jmp 0x10efa
movq -0x10(%rbp), %rdi
callq 0x7240
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
movq 0xebf3(%rip), %rsi      # 0x1faf8
callq 0x144a0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x10f1e
movq -0x28(%rbp), %rax
cmpb $0x0, (%rax)
jne 0x10f37
movq 0xeb5b(%rip), %rdi      # 0x1fa80
xorl %eax, %eax
movl %eax, %esi
callq 0xd210
movb $0x0, -0x1(%rbp)
jmp 0x1110a
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2e, %eax
jne 0x10f50
movq -0x28(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x0, %eax
je 0x10fa7
movq -0x28(%rbp), %rdi
movl $0x1, %esi
callq 0x7360
testb $0x1, %al
jne 0x10f64
jmp 0x10f72
movq -0x28(%rbp), %rdi
callq 0x42d0
cmpl $-0x1, %eax
jne 0x10f93
callq 0x40c0
movl (%rax), %edi
callq 0x4870
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xd210
movb $0x0, -0x1(%rbp)
jmp 0x1110a
xorl %eax, %eax
movl %eax, %esi
movq %rsi, %rdi
callq 0x43a0
movq %rax, -0x28(%rbp)
movb $0x1, -0x29(%rbp)
jmp 0x10fa9
testb $0x1, -0x2a(%rbp)
je 0x10fc9
movq 0xea02(%rip), %rax      # 0x1f9b8
movq %rax, -0x20(%rbp)
movb -0x11(%rbp), %al
movb %al, -0x15(%rbp)
movb $0x0, -0x14(%rbp)
jmp 0x11052
movq 0xe9f0(%rip), %rdi      # 0x1f9c0
callq 0x12930
testb $0x1, %al
jne 0x10fdb
jmp 0x10ff7
movq 0xe9de(%rip), %rax      # 0x1f9c0
movq %rax, -0x20(%rbp)
movsbl -0x11(%rbp), %eax
cmpl $0x78, %eax
jne 0x10ff5
movb -0x11(%rbp), %al
movb %al, -0x15(%rbp)
jmp 0x11050
movq -0x10(%rbp), %rdi
leaq 0xb770(%rip), %rsi      # 0x1c772
callq 0x192d0
testb $0x1, %al
jne 0x1100d
jmp 0x11032
movq 0xe9b4(%rip), %rax      # 0x1f9c8
movq %rax, -0x20(%rbp)
movsbl -0x11(%rbp), %edx
xorl %eax, %eax
movl $0x76, %ecx
cmpl $0x6c, %edx
cmovel %ecx, %eax
movb %al, -0x15(%rbp)
movb $0x0, -0x14(%rbp)
jmp 0x1104e
movq 0xe997(%rip), %rax      # 0x1f9d0
movq %rax, -0x20(%rbp)
movsbl -0x11(%rbp), %eax
cmpl $0x78, %eax
jne 0x1104c
movb -0x11(%rbp), %al
movb %al, -0x15(%rbp)
jmp 0x1104e
jmp 0x11050
jmp 0x11052
movsbl -0x11(%rbp), %eax
cmpl $0x78, %eax
jne 0x11078
movq -0x20(%rbp), %rdi
leaq -0x16(%rbp), %rsi
movq -0x10(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
movl $0x9, %r8d
callq 0xde30
jmp 0x11094
movq -0x20(%rbp), %rdi
leaq -0x16(%rbp), %rsi
movq -0x10(%rbp), %rdx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl $0x1, %r8d
callq 0x10ba0
testb $0x1, -0x29(%rbp)
je 0x110f4
movq -0x10(%rbp), %rdi
callq 0x72a0
movq %rax, %rdi
callq 0x42d0
cmpl $-0x1, %eax
jne 0x110d7
callq 0x40c0
movl (%rax), %edi
callq 0x4870
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xd210
movq -0x28(%rbp), %rdi
callq 0x4090
movb $0x0, -0x1(%rbp)
jmp 0x1110a
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
movl $0x1000, %edx           # imm = 0x1000
callq 0x6250
movq -0x28(%rbp), %rdi
callq 0x4090
jmp 0x11106
movsbl -0x11(%rbp), %eax
cmpl $0x78, %eax
jne 0x11104
movq -0x10(%rbp), %rax
movb $0x0, (%rax)
jmp 0x11106
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)