// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-util.c
// Function: de_run_module
int de_run_module(deark *c, struct deark_module_info *mi, de_module_params *mparams,
	enum de_moddisp_enum moddisp)
{
	enum de_moddisp_enum old_moddisp;
	struct de_detection_data_struct *old_detection_data;
	struct de_mp_data *old_mp_data;

	if(!mi) return 0;
	if(!mi->run_fn) {
		if(moddisp==DE_MODDISP_EXPLICIT) {
			de_err(c, "Module '%s' is disabled", mi->id);
		}
		else { // presumably DE_MODDISP_INTERNAL
			de_dbg(c, "[module '%s' is disabled]", mi->id);
		}
		return 0;
	}
	// Note that c->module_nesting_level is 0 when we are not in a module,
	// 1 when in the top-level module, 2 for a first-level submodule, etc.
	if(c->module_nesting_level >= 1+DE_MAX_SUBMODULE_NESTING_LEVEL) {
		de_err(c, "Max module nesting level exceeded");
		return 0;
	}

	old_moddisp = c->module_disposition;
	c->module_disposition = moddisp;
	old_detection_data = c->detection_data;
	if(c->module_nesting_level > 0) {
		c->detection_data = NULL;
	}

	old_mp_data = c->mp_data;
	if(c->module_nesting_level > 0) {
		c->mp_data = NULL;
	}

	if(c->module_nesting_level>0 && c->debug_level>=3) {
		de_dbg3(c, "[using %s module]", mi->id);
	}
	c->module_nesting_level++;
	mi->run_fn(c, mparams);
	c->module_nesting_level--;
	c->module_disposition = old_moddisp;
	c->detection_data = old_detection_data;
	c->mp_data = old_mp_data;
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x15c81a
movl $0x0, -0x4(%rbp)
jmp 0x15c96c
movq -0x18(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x15c86b
cmpl $0x2, -0x24(%rbp)
jne 0x15c846
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rdx
leaq 0x756e9(%rip), %rsi     # 0x1d1f26
movb $0x0, %al
callq 0x15bfb0
jmp 0x15c85f
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rdx
leaq 0x756e6(%rip), %rsi     # 0x1d1f3e
movb $0x0, %al
callq 0x15b0d0
movl $0x0, -0x4(%rbp)
jmp 0x15c96c
movq -0x10(%rbp), %rax
cmpl $0xb, 0x10(%rax)
jl 0x15c893
movq -0x10(%rbp), %rdi
leaq 0x756d8(%rip), %rsi     # 0x1d1f58
movb $0x0, %al
callq 0x15bfb0
movl $0x0, -0x4(%rbp)
jmp 0x15c96c
movq -0x10(%rbp), %rax
movl 0x24(%rax), %eax
movl %eax, -0x28(%rbp)
movl -0x24(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x24(%rax)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jle 0x15c8c9
movq -0x10(%rbp), %rax
movq $0x0, 0x28(%rax)
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jle 0x15c8eb
movq -0x10(%rbp), %rax
movq $0x0, 0x30(%rax)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jle 0x15c917
movq -0x10(%rbp), %rax
cmpl $0x3, (%rax)
jl 0x15c917
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rdx
leaq 0x7566a(%rip), %rsi     # 0x1d1f7a
movb $0x0, %al
callq 0x15b400
movq -0x10(%rbp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq *%rax
movq -0x10(%rbp), %rax
movl 0x10(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x10(%rax)
movl -0x28(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x24(%rax)
movq -0x30(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x38(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x30(%rax)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)