// File: chenhn123[P]wdt_util_src/wdt_ct/wdt_dev_api.cpp
// Function: wh_get_device_private_access_func(WdtDevice*, FuncPtrStructDevOperation*)
int wh_get_device_private_access_func(WDT_DEV* pdev,  FUNC_PTR_STRUCT_DEV_OPERATION*  pFuncs)
{
	if (!pFuncs || !pdev)
		return 0;

	if (pdev->board_info.dev_type & FW_WDT8755) {
		pFuncs->p_wh_program_chunk = (LPFUNC_wh_program_chunk) wh_w8755_dev_program_chunk;
		pFuncs->p_wh_verify_chunk	= (LPFUNC_wh_verify_chunk) wh_w8755_dev_verify_chunk;
		pFuncs->p_wh_flash_write_data = (LPFUNC_wh_flash_write_data) wh_w8755_dev_flash_write_data;
		pFuncs->p_wh_flash_get_checksum = (LPFUNC_wh_flash_get_checksum) wh_w8755_dev_flash_get_checksum;
 		pFuncs->p_wh_send_commands = (LPFUNC_wh_send_commands) wh_w8755_dev_send_commands;

		return wh_w8755_dev_set_basic_op(pdev);
	}

	if (pdev->board_info.dev_type & FW_WDT8760_2) {
		pFuncs->p_wh_program_chunk = (LPFUNC_wh_program_chunk) wh_w8760_dev_program_chunk;
		pFuncs->p_wh_verify_chunk	= (LPFUNC_wh_verify_chunk) wh_w8760_dev_verify_chunk;
		pFuncs->p_wh_flash_write_data = (LPFUNC_wh_flash_write_data) wh_w8760_dev_flash_write_data;
		pFuncs->p_wh_flash_get_checksum = (LPFUNC_wh_flash_get_checksum) wh_w8760_dev_flash_get_checksum;
 		pFuncs->p_wh_send_commands = (LPFUNC_wh_send_commands) wh_w8760_dev_send_commands;

		return wh_w8760_dev_set_basic_op(pdev);
	}
	if (pdev->board_info.dev_type & FW_WDT8790) {
		pFuncs->p_wh_flash_write_data = (LPFUNC_wh_flash_write_data)wh_w8790_dev_flash_write_data;
		pFuncs->p_wh_flash_get_checksum = (LPFUNC_wh_flash_get_checksum)wh_w8790_dev_flash_get_checksum;
		pFuncs->p_wh_send_commands = (LPFUNC_wh_send_commands)wh_w8790_dev_send_commands;
		pFuncs->p_wh_flash_erase = (LPFUNC_wh_flash_erase)wh_w8790_dev_flash_erase;


		return wh_w8790_dev_set_basic_op(pdev);
	}


	return 0;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x8d7e
cmpq $0x0, -0x10(%rbp)
jne 0x8d8a
movl $0x0, -0x4(%rbp)
jmp 0x8ec8
movq -0x10(%rbp), %rax
movl 0x188(%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x8df7
movq -0x18(%rbp), %rax
leaq -0x4c67(%rip), %rcx     # 0x4140
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
leaq -0x4cb5(%rip), %rcx     # 0x4100
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
leaq -0x5e14(%rip), %rcx     # 0x2fb0
movq %rcx, 0x18(%rax)
movq -0x18(%rbp), %rax
leaq -0x5463(%rip), %rcx     # 0x3970
movq %rcx, 0x20(%rax)
movq -0x18(%rbp), %rax
leaq -0x5ce2(%rip), %rcx     # 0x3100
movq %rcx, 0x28(%rax)
movq -0x10(%rbp), %rdi
callq 0x42d0
movl %eax, -0x4(%rbp)
jmp 0x8ec8
movq -0x10(%rbp), %rax
movl 0x188(%rax), %eax
andl $0x2800, %eax           # imm = 0x2800
cmpl $0x0, %eax
je 0x8e63
movq -0x18(%rbp), %rax
leaq -0x2916(%rip), %rcx     # 0x6500
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
leaq -0x30c4(%rip), %rcx     # 0x5d60
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
leaq -0x3283(%rip), %rcx     # 0x5bb0
movq %rcx, 0x18(%rax)
movq -0x18(%rbp), %rax
leaq -0x3212(%rip), %rcx     # 0x5c30
movq %rcx, 0x20(%rax)
movq -0x18(%rbp), %rax
leaq -0x3521(%rip), %rcx     # 0x5930
movq %rcx, 0x28(%rax)
movq -0x10(%rbp), %rdi
callq 0x4ab0
movl %eax, -0x4(%rbp)
jmp 0x8ec8
movq -0x10(%rbp), %rax
movl 0x188(%rax), %eax
andl $0x200, %eax            # imm = 0x200
cmpl $0x0, %eax
je 0x8ec1
movq -0x18(%rbp), %rax
leaq -0xa92(%rip), %rcx      # 0x83f0
movq %rcx, 0x18(%rax)
movq -0x18(%rbp), %rax
leaq -0x11f1(%rip), %rcx     # 0x7ca0
movq %rcx, 0x20(%rax)
movq -0x18(%rbp), %rax
leaq -0xcc0(%rip), %rcx      # 0x81e0
movq %rcx, 0x28(%rax)
movq -0x18(%rbp), %rax
leaq -0xa2f(%rip), %rcx      # 0x8480
movq %rcx, 0x30(%rax)
movq -0x10(%rbp), %rdi
callq 0x6850
movl %eax, -0x4(%rbp)
jmp 0x8ec8
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)