// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/dosbackup.c
// Function: de_run_dosbackup20
static void de_run_dosbackup20(deark *c, de_module_params *mparams)
{
	int v;
	lctx *d = NULL;

	d = de_malloc(c, sizeof(lctx));
	d->fmtver = DOSBK_VER_DOS20;
	d->input_encoding = de_get_input_encoding(c, NULL, DE_ENCODING_CP437);
	de_declare_fmt(c, "MS-DOS BACKUP (MS-DOS 2.0-3.2)");

	d->num_input_files_tot = 1;
	if(c->mp_data) d->num_input_files_tot += c->mp_data->count;

	d->data_file_xidxs = de_mallocarray(c, d->num_input_files_tot, sizeof(int));
	for(v=0; v<d->num_input_files_tot; v++) {
		d->data_file_xidxs[v] = -1;
	}

	scan_input_files20(c, d);
	if(d->errflag) goto done;

	// Verify that we have all the needed files.
	for(v=0; v<d->num_input_files_tot; v++) {
		de_dbg2(c, "data file idx[%d] = %d", v, d->data_file_xidxs[v]);
		if(d->data_file_xidxs[v]<0) {
			d->need_errmsg = 1;
			goto done;
		}
	}

	dosbackup20_main(c, d);

done:
	dbk_destroy_lctx(c, d);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r12
pushq $0x48
popq %rsi
callq 0xdecaf
movq %rax, %r14
movl $0x2, 0x4(%rax)
pushq $0xd
popq %rdx
movq %r12, %rdi
xorl %esi, %esi
callq 0xe08d2
movl %eax, (%r14)
leaq 0xc651b(%rip), %rsi     # 0x111b15
movq %r12, %rdi
callq 0xe07f7
movl $0x1, 0x10(%r14)
movq 0x30(%r12), %rax
testq %rax, %rax
je 0x4b620
movslq (%rax), %rsi
incq %rsi
movl %esi, 0x10(%r14)
jmp 0x4b623
pushq $0x1
popq %rsi
pushq $0x4
popq %rdx
movq %r12, %rdi
callq 0xdf66f
movq %rax, 0x28(%r14)
xorl %ecx, %ecx
movslq 0x10(%r14), %rdx
cmpq %rdx, %rcx
jge 0x4b646
orl $-0x1, (%rax,%rcx,4)
incq %rcx
jmp 0x4b634
leaq 0x8(%rsp), %rax
andq $0x0, (%rax)
leaq 0xc6353(%rip), %rsi     # 0x1119a9
movq %r12, %rdi
xorl %eax, %eax
callq 0xde896
pushq $0x1
popq %rsi
movq %r12, %rdi
callq 0xdeba7
pushq $0x4f
popq %rbx
xorl %r13d, %r13d
movq %r12, (%rsp)
cmpl 0x10(%r14), %r13d
jge 0x4b807
cmpb $0x0, 0x8(%r14)
jne 0x4b807
movq %r12, %rdi
movl %r13d, %esi
callq 0xe10d7
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0x4b802
movq %rax, %r15
movq %r12, %rdi
leaq 0xc6310(%rip), %rsi     # 0x1119c0
movl %r13d, %edx
xorl %eax, %eax
callq 0xde896
movq %r12, %rdi
pushq $0x1
popq %rsi
callq 0xdeba7
movq %r15, %rdi
xorl %esi, %esi
callq 0xe3eb4
movl %eax, %ebp
movzbl %al, %edx
movq %r12, %rdi
leaq 0xc6456(%rip), %rsi     # 0x111b34
xorl %eax, %eax
callq 0xde896
movq %r15, %rdi
pushq $0x1
popq %rsi
callq 0xe3fa3
movq %r12, %rdi
movq %rax, %r12
leaq 0xc62e7(%rip), %rsi     # 0x1119e4
movl %r12d, %edx
xorl %eax, %eax
callq 0xde896
movl 0x10(%r14), %eax
cmpl $0x1, %eax
jne 0x4b753
cmpl $0x1, %r12d
sete %cl
testb %bpl, %bpl
setne %dl
testb %cl, %dl
jne 0x4b763
movq (%rsp), %r12
movq %r12, %rdi
leaq 0xc641d(%rip), %rsi     # 0x111b4c
xorl %eax, %eax
callq 0xdf2a5
movq %r12, %rdi
leaq 0xc6437(%rip), %rsi     # 0x111b77
xorl %eax, %eax
callq 0xdf37f
movb $0x1, 0x8(%r14)
xorl %ebp, %ebp
jmp 0x4b7d4
testl %r12d, %r12d
setg %cl
cmpl %r12d, %eax
setge %dl
testb %dl, %cl
je 0x4b7b4
testb %bpl, %bpl
sete %cl
cmpl %r12d, %eax
sete %al
xorb %cl, %al
je 0x4b7b4
movq (%rsp), %rdi
movq %rbx, %rsi
callq 0xdecaf
movq %rax, %rbp
movq %r15, %rdi
movq %rax, %rsi
pushq $0x5
popq %rdx
movq %rbx, %rcx
callq 0xe3cb7
movq 0x40(%r14), %rdi
testq %rdi, %rdi
je 0x4b7bf
movq %rbp, %rsi
movq %rbx, %rdx
callq 0x18230
testl %eax, %eax
je 0x4b7c5
movw $0x101, 0x8(%r14)       # imm = 0x101
jmp 0x4b7d0
movw $0x101, 0x8(%r14)       # imm = 0x101
xorl %ebp, %ebp
jmp 0x4b7d0
movq %rbp, 0x40(%r14)
xorl %ebp, %ebp
movq 0x28(%r14), %rax
decl %r12d
movl %r13d, (%rax,%r12,4)
movq (%rsp), %r12
movq %r12, %rdi
movq %rbp, %rsi
callq 0xded32
movq %r12, %rdi
pushq $-0x1
popq %rsi
callq 0xdeba7
movq %r12, %rdi
movl %r13d, %esi
leaq 0x8(%rsp), %rdx
callq 0xe1130
incl %r13d
jmp 0x4b675
movb $0x1, 0x8(%r14)
pushq $-0x1
popq %rsi
movq %r12, %rdi
callq 0xdeba7
cmpb $0x0, 0x8(%r14)
jne 0x4bada
leaq 0xc616e(%rip), %r15     # 0x111992
xorl %r12d, %r12d
movslq 0x10(%r14), %rax
cmpq %rax, %r12
jge 0x4b867
movq 0x28(%r14), %rax
movl (%rax,%r12,4), %ecx
movq (%rsp), %rdi
movq %r15, %rsi
movl %r12d, %edx
xorl %eax, %eax
callq 0xde9f1
movq 0x28(%r14), %rax
cmpl $0x0, (%rax,%r12,4)
leaq 0x1(%r12), %r12
jns 0x4b827
movb $0x1, 0x9(%r14)
movq (%rsp), %r12
jmp 0x4bada
leaq 0x8(%rsp), %r13
andq $0x0, (%r13)
leaq 0x14(%rsp), %rsi
movq (%rsp), %rdi
callq 0xdebae
leaq 0xc6321(%rip), %rbp     # 0x111ba7
xorl %r15d, %r15d
xorl %r12d, %r12d
movslq 0x10(%r14), %rax
cmpq %rax, %r15
jge 0x4bab1
cmpb $0x0, 0x8(%r14)
jne 0x4bab1
movq 0x28(%r14), %rax
movl (%rax,%r15,4), %ecx
leal 0x1(%r15), %edx
movq (%rsp), %rbx
movq %rbx, %rdi
movq %rbp, %rsi
xorl %eax, %eax
callq 0xde896
movq %rbx, %rdi
pushq $0x1
popq %rsi
callq 0xdeba7
movq 0x28(%r14), %rax
movl (%rax,%r15,4), %esi
movq %rbx, %rdi
callq 0xe10d7
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0x4baac
testq %r12, %r12
movq (%rsp), %rbx
je 0x4b8fe
movq %rbx, %rdi
movq %r12, %rsi
callq 0x4bca4
movq %rbx, %rdi
pushq $0x50
popq %rsi
callq 0xdecaf
movq %rax, %r12
movq 0x8(%rsp), %rdi
pushq $0x53
popq %rsi
callq 0xe3eb4
movb %al, 0x30(%r12)
leal -0x4f(%rax), %ecx
cmpb $-0x4f, %cl
jbe 0x4baa3
movq 0x8(%rsp), %rdi
movzbl %al, %ecx
movl (%r14), %r9d
pushq $0x5
popq %rsi
movq %rcx, %rdx
pushq $0x1
popq %r8
callq 0xe495c
movq %rax, 0x38(%r12)
movq 0x18(%rax), %rdi
callq 0xeb877
movq %rbx, %rdi
leaq 0xe3102(%rip), %rsi     # 0x12ea5e
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
cmpq $0x0, 0x30(%r14)
jne 0x4ba24
movq %r13, %rbp
movq %rbx, %rdi
callq 0xdfd1a
movq %rax, %r13
movq %rbx, %rdi
pushq $0x20
popq %rsi
callq 0xdecaf
movq %rax, 0x30(%r14)
movq 0x38(%r12), %rax
movq 0x18(%rax), %rdi
callq 0xeaf0b
movq 0x30(%r14), %rcx
movq %rax, 0x18(%rcx)
movq %rax, %rdi
xorl %esi, %esi
callq 0xf1712
movq 0x30(%r14), %rax
movq 0x18(%rax), %rdi
callq 0xeaf76
testl %eax, %eax
je 0x4b9cf
movq 0x30(%r14), %rax
movq 0x18(%rax), %rdi
pushq $0x5f
popq %rsi
callq 0xeada5
movq 0x30(%r14), %rax
movq 0x18(%rax), %rdx
movq (%rsp), %rbx
movq %rbx, %rdi
movq %r13, %rsi
pushq $0x1
popq %rcx
callq 0xdfd55
movb $0x1, 0x8(%r13)
movq %rbx, %rdi
xorl %esi, %esi
movq %r13, %rdx
xorl %ecx, %ecx
callq 0xe4e62
movq 0x30(%r14), %rcx
movq %rax, (%rcx)
movq %rbx, %rdi
movq %r13, %rsi
callq 0xdfd24
cmpb $0x0, 0x8(%r14)
movq %rbp, %r13
leaq 0xc6189(%rip), %rbp     # 0x111ba7
jne 0x4bab1
movq $0x80, 0x8(%r12)
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rdx
addq $-0x80, %rdx
movq %rdx, 0x10(%r12)
movq %rbx, %rdi
leaq 0xc6060(%rip), %rsi     # 0x111aa9
xorl %eax, %eax
callq 0xde896
movq 0x10(%r12), %rdx
testq %rdx, %rdx
js 0x4baa3
movq 0x8(%rsp), %rdi
movq 0x8(%r12), %rsi
movq 0x30(%r14), %rax
movq (%rax), %rcx
callq 0xe45f4
movq 0x10(%r12), %rax
movq 0x30(%r14), %rcx
addq %rax, 0x8(%rcx)
movq 0x28(%r14), %rax
movl (%rax,%r15,4), %esi
movq %rbx, %rdi
movq %r13, %rdx
callq 0xe1130
movq %rbx, %rdi
pushq $-0x1
popq %rsi
callq 0xdeba7
incq %r15
jmp 0x4b88c
movw $0x101, 0x8(%r14)       # imm = 0x101
jmp 0x4bab1
movb $0x1, 0x8(%r14)
movq (%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4bccf
movq %rbx, %rdi
movq %r12, %rsi
movq %rbx, %r12
callq 0x4bca4
movl 0x14(%rsp), %esi
movq %rbx, %rdi
callq 0xdebb7
movq %r12, %rdi
movq %r14, %rsi
callq 0x4bbfc
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq