// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/storyboard.c
// Function: de_run_storyboard_newfmt
static void de_run_storyboard_newfmt(deark *c, struct storyboard_ctx *d,
	de_module_params *mparams)
{
	u8 hdrbytes[4];

	dbuf_read(c->infile, hdrbytes, 0, sizeof(hdrbytes));

	if(hdrbytes[1]==0x84 && hdrbytes[3]==0x08) {
		d->sm_width = 320;
		d->sm_height = 200;
		d->bpp = 2;
	}
	else if(hdrbytes[1]==0x84 && hdrbytes[3]==0x01) {
		d->sm_width = 640;
		d->sm_height = 200;
		d->bpp = 4;
	}
	else if(hdrbytes[1]==0x84 && hdrbytes[3]==0x03) {
		d->sm_width = 640;
		d->sm_height = 350;
		d->bpp = 4;
	}
	else if(hdrbytes[1]==0x84 && hdrbytes[3]==0x07) {
		d->sm_width = 640;
		d->sm_height = 480;
		d->bpp = 4;
	}
	else if(hdrbytes[1]==0x85) {
		d->sm_width = 320;
		d->sm_height = 200;
		d->bpp = 8;
		d->pixels_start = 1856;
	}
	else if(hdrbytes[1]==0x86) {
		d->sm_width = 640;
		d->sm_height = 480;
		d->bpp = 8;
		d->pixels_start = 2816;
		d->cmpr_meth = 1;
	}

	if(d->sm_width>0) {
		do_newfmt_main(c, d);
	}
	else {
		de_err(c, "Not a supported Storyboard format");
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x1c(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
movl $0x4, %ecx
callq 0x164d10
movzbl -0x1b(%rbp), %eax
cmpl $0x84, %eax
jne 0x157d2b
movzbl -0x19(%rbp), %eax
cmpl $0x8, %eax
jne 0x157d2b
movq -0x10(%rbp), %rax
movq $0x140, 0x50(%rax)      # imm = 0x140
movq -0x10(%rbp), %rax
movq $0xc8, 0x58(%rax)
movq -0x10(%rbp), %rax
movq $0x2, 0x8(%rax)
jmp 0x157e6c
movzbl -0x1b(%rbp), %eax
cmpl $0x84, %eax
jne 0x157d68
movzbl -0x19(%rbp), %eax
cmpl $0x1, %eax
jne 0x157d68
movq -0x10(%rbp), %rax
movq $0x280, 0x50(%rax)      # imm = 0x280
movq -0x10(%rbp), %rax
movq $0xc8, 0x58(%rax)
movq -0x10(%rbp), %rax
movq $0x4, 0x8(%rax)
jmp 0x157e6a
movzbl -0x1b(%rbp), %eax
cmpl $0x84, %eax
jne 0x157da5
movzbl -0x19(%rbp), %eax
cmpl $0x3, %eax
jne 0x157da5
movq -0x10(%rbp), %rax
movq $0x280, 0x50(%rax)      # imm = 0x280
movq -0x10(%rbp), %rax
movq $0x15e, 0x58(%rax)      # imm = 0x15E
movq -0x10(%rbp), %rax
movq $0x4, 0x8(%rax)
jmp 0x157e68
movzbl -0x1b(%rbp), %eax
cmpl $0x84, %eax
jne 0x157de2
movzbl -0x19(%rbp), %eax
cmpl $0x7, %eax
jne 0x157de2
movq -0x10(%rbp), %rax
movq $0x280, 0x50(%rax)      # imm = 0x280
movq -0x10(%rbp), %rax
movq $0x1e0, 0x58(%rax)      # imm = 0x1E0
movq -0x10(%rbp), %rax
movq $0x4, 0x8(%rax)
jmp 0x157e66
movzbl -0x1b(%rbp), %eax
cmpl $0x85, %eax
jne 0x157e1f
movq -0x10(%rbp), %rax
movq $0x140, 0x50(%rax)      # imm = 0x140
movq -0x10(%rbp), %rax
movq $0xc8, 0x58(%rax)
movq -0x10(%rbp), %rax
movq $0x8, 0x8(%rax)
movq -0x10(%rbp), %rax
movq $0x740, 0x70(%rax)      # imm = 0x740
jmp 0x157e64
movzbl -0x1b(%rbp), %eax
cmpl $0x86, %eax
jne 0x157e62
movq -0x10(%rbp), %rax
movq $0x280, 0x50(%rax)      # imm = 0x280
movq -0x10(%rbp), %rax
movq $0x1e0, 0x58(%rax)      # imm = 0x1E0
movq -0x10(%rbp), %rax
movq $0x8, 0x8(%rax)
movq -0x10(%rbp), %rax
movq $0xb00, 0x70(%rax)      # imm = 0xB00
movq -0x10(%rbp), %rax
movb $0x1, 0x78(%rax)
jmp 0x157e64
jmp 0x157e66
jmp 0x157e68
jmp 0x157e6a
jmp 0x157e6c
movq -0x10(%rbp), %rax
cmpq $0x0, 0x50(%rax)
jle 0x157e86
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x158730
jmp 0x157e98
movq -0x8(%rbp), %rdi
leaq 0x79b1b(%rip), %rsi     # 0x1d19ac
movb $0x0, %al
callq 0x15bfb0
addq $0x20, %rsp
popq %rbp
retq
nop