	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function jz4780_calculate
_jz4780_calculate:                      ## @jz4780_calculate
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r14
	movq	%rdx, %r12
	movq	%rsi, %r15
	movq	%rdi, %rbx
	callq	_mutex_lock
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movl	$1, %edx
	callq	_jz4780_bch_reset
	movl	4(%r15), %edx
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_jz4780_bch_write_data
	movq	_BCH_BHINT_ENCF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%r12d, %r12d
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_jz4780_bch_wait_complete
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movl	(%r15), %edx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_jz4780_bch_read_parity
	jmp	LBB0_3
LBB0_2:
	movl	4(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
LBB0_3:
	movq	%rbx, %rdi
	callq	_jz4780_bch_disable
	movq	%rbx, %rdi
	callq	_mutex_unlock
	movl	%r12d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BCH_BHINT_ENCF,4,2             ## @BCH_BHINT_ENCF
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"timed out while calculating ECC\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.no_dead_strip	_jz4780_calculate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function jz4780_calculate
_jz4780_calculate:                      ; @jz4780_calculate
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x20, x3
	mov	x22, x2
	mov	x21, x1
	mov	x19, x0
	bl	_mutex_lock
	mov	x0, x19
	mov	x1, x21
	mov	w2, #1
	bl	_jz4780_bch_reset
	ldr	w2, [x21, #4]
	mov	x0, x19
	mov	x1, x22
	bl	_jz4780_bch_write_data
Lloh0:
	adrp	x8, _BCH_BHINT_ENCF@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BCH_BHINT_ENCF@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, #0
	bl	_jz4780_bch_wait_complete
	cbz	x0, LBB0_2
; %bb.1:
	ldr	w2, [x21]
	mov	x0, x19
	mov	x1, x20
	bl	_jz4780_bch_read_parity
	mov	w20, #0
	b	LBB0_3
LBB0_2:
	ldr	w0, [x19, #4]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh5:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_3:
	mov	x0, x19
	bl	_jz4780_bch_disable
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_BCH_BHINT_ENCF,4,2             ; @BCH_BHINT_ENCF
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"timed out while calculating ECC\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.no_dead_strip	_jz4780_calculate
.subsections_via_symbols
