	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wdt87xx_do_update_firmware
_wdt87xx_do_update_firmware:            ## @wdt87xx_do_update_firmware
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r12d
	movq	%rsi, %r13
	movq	%rdi, %r15
	callq	_i2c_get_clientdata
	movq	%rax, %r14
	movq	%rax, %rdi
	movq	%r13, %rsi
	callq	_wdt87xx_validate_firmware
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_11
## %bb.1:
	movq	%r14, %rdi
	callq	_mutex_lock_interruptible
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_11
## %bb.2:
	movl	(%r15), %edi
	callq	_disable_irq
	movq	%r15, %rdi
	movq	%r13, %rsi
	movl	%r12d, %edx
	callq	_wdt87xx_load_chunk
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %ebx
	leaq	4(%r15), %rdi
	leaq	L_.str(%rip), %rsi
	movl	%r12d, %edx
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_10
LBB0_4:
	movq	%r15, %rdi
	callq	_wdt87xx_sw_reset
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	movl	%eax, %ebx
	leaq	4(%r15), %rdi
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_9
LBB0_6:
	movq	%r14, %rsi
	addq	$4, %rsi
	movq	%r15, %rdi
	callq	_wdt87xx_get_sysparam
	testl	%eax, %eax
	je	LBB0_7
## %bb.8:
	movl	%eax, %ebx
	leaq	4(%r15), %rdi
	leaq	L_.str.2(%rip), %rsi
LBB0_9:
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_dev_err
LBB0_10:
	movl	(%r15), %edi
	callq	_enable_irq
	movq	%r14, %rdi
	callq	_mutex_unlock
LBB0_11:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	xorl	%ebx, %ebx
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"firmware load failed (type: %d): %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"soft reset failed: %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"failed to refresh system parameters: %d\n"

	.no_dead_strip	_wdt87xx_do_update_firmware
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wdt87xx_do_update_firmware
_wdt87xx_do_update_firmware:            ; @wdt87xx_do_update_firmware
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x22, x2
	mov	x23, x1
	mov	x20, x0
	bl	_i2c_get_clientdata
	mov	x19, x0
	mov	x1, x23
	bl	_wdt87xx_validate_firmware
	mov	x21, x0
	cbnz	w0, LBB0_11
; %bb.1:
	mov	x0, x19
	bl	_mutex_lock_interruptible
	mov	x21, x0
	cbnz	w0, LBB0_11
; %bb.2:
	ldr	w0, [x20]
	bl	_disable_irq
	mov	x0, x20
	mov	x1, x23
	mov	x2, x22
	bl	_wdt87xx_load_chunk
	cbz	w0, LBB0_4
; %bb.3:
	mov	x21, x0
	add	x0, x20, #4
	str	x21, [sp]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x22
	b	LBB0_9
LBB0_4:
	mov	x0, x20
	bl	_wdt87xx_sw_reset
	cbz	w0, LBB0_6
; %bb.5:
	mov	x21, x0
	add	x0, x20, #4
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_8
LBB0_6:
	add	x1, x19, #4
	mov	x0, x20
	bl	_wdt87xx_get_sysparam
	mov	x21, x0
	cbz	w0, LBB0_10
; %bb.7:
	add	x0, x20, #4
Lloh4:
	adrp	x1, l_.str.2@PAGE
Lloh5:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_8:
	mov	x2, x21
LBB0_9:
	bl	_dev_err
LBB0_10:
	ldr	w0, [x20]
	bl	_enable_irq
	mov	x0, x19
	bl	_mutex_unlock
LBB0_11:
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"firmware load failed (type: %d): %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"soft reset failed: %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"failed to refresh system parameters: %d\n"

	.no_dead_strip	_wdt87xx_do_update_firmware
.subsections_via_symbols
