	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fdp_nci_patch_otp
_fdp_nci_patch_otp:                     ## @fdp_nci_patch_otp
	.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
	movq	%rdi, %r15
	callq	_nci_get_drvdata
	movq	%rax, %r12
	movq	(%rax), %rax
	xorl	%ebx, %ebx
	cmpq	8(%r12), %rax
	jge	LBB0_11
## %bb.1:
	movq	40(%r12), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	$0, 16(%r12)
	movl	$0, 24(%r12)
	movq	_NCI_PATCH_TYPE_OTP@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	%r15, %rdi
	callq	_fdp_nci_patch_cmd
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_2
LBB0_11:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	%r15, %rdi
	callq	_fdp_nci_create_conn
	movl	%eax, %r13d
	testl	%eax, %eax
	js	LBB0_3
## %bb.4:
	movl	(%r14), %edx
	movq	%r15, %rdi
	movl	%r13d, %esi
	callq	_fdp_nci_send_patch
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_11
## %bb.5:
	movl	32(%r12), %edi
	xorl	%esi, %esi
	cmpl	$1, 16(%r12)
	sete	%sil
	callq	_wait_event_interruptible
	movq	_FDP_FW_UPDATE_SLEEP@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msleep
	movl	36(%r12), %edi
	movl	%r13d, %esi
	callq	_nci_core_conn_close
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_11
## %bb.6:
	movq	_NCI_PATCH_TYPE_EOT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_fdp_nci_patch_cmd
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	leaq	L_.str(%rip), %rsi
	xorl	%ebx, %ebx
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	xorl	%edx, %edx
	callq	_nfc_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_11
LBB0_3:
	movl	%r13d, %ebx
	jmp	LBB0_11
LBB0_8:
	movl	24(%r12), %esi
	movl	32(%r12), %edi
	callq	_wait_event_interruptible
	movl	28(%r12), %edx
	testl	%edx, %edx
	je	LBB0_10
## %bb.9:
	leaq	L_.str(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_nfc_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_11
LBB0_10:
	movl	20(%r12), %esi
	movl	32(%r12), %edi
	callq	_wait_event_interruptible
	xorl	%ebx, %ebx
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_NCI_PATCH_TYPE_OTP,4,2         ## @NCI_PATCH_TYPE_OTP
	.comm	_FDP_FW_UPDATE_SLEEP,4,2        ## @FDP_FW_UPDATE_SLEEP
	.comm	_NCI_PATCH_TYPE_EOT,4,2         ## @NCI_PATCH_TYPE_EOT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"OTP patch error 0x%x\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_fdp_nci_patch_otp
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fdp_nci_patch_otp
_fdp_nci_patch_otp:                     ; @fdp_nci_patch_otp
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x21, x0
	bl	_nci_get_drvdata
	ldp	x8, x9, [x0]
	cmp	x8, x9
	b.ge	LBB0_12
; %bb.1:
	mov	x19, x0
	ldr	x8, [x0, #40]
	ldr	x20, [x8]
	str	xzr, [x0, #16]
	str	wzr, [x0, #24]
Lloh0:
	adrp	x23, _NCI_PATCH_TYPE_OTP@GOTPAGE
Lloh1:
	ldr	x23, [x23, _NCI_PATCH_TYPE_OTP@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x21
	bl	_fdp_nci_patch_cmd
	cbnz	w0, LBB0_13
; %bb.2:
	mov	x0, x21
	bl	_fdp_nci_create_conn
	mov	x22, x0
	tbnz	w0, #31, LBB0_7
; %bb.3:
	ldr	w2, [x23]
	mov	x0, x21
	mov	x1, x22
	bl	_fdp_nci_send_patch
	cbnz	w0, LBB0_13
; %bb.4:
	ldr	w0, [x19, #32]
	ldr	w8, [x19, #16]
	cmp	w8, #1
	cset	w1, eq
	bl	_wait_event_interruptible
Lloh2:
	adrp	x8, _FDP_FW_UPDATE_SLEEP@GOTPAGE
Lloh3:
	ldr	x8, [x8, _FDP_FW_UPDATE_SLEEP@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	bl	_msleep
	ldr	w0, [x19, #36]
	mov	x1, x22
	bl	_nci_core_conn_close
	cbnz	w0, LBB0_13
; %bb.5:
Lloh5:
	adrp	x8, _NCI_PATCH_TYPE_EOT@GOTPAGE
Lloh6:
	ldr	x8, [x8, _NCI_PATCH_TYPE_EOT@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_fdp_nci_patch_cmd
	cbz	w0, LBB0_8
; %bb.6:
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	mov	w2, #0
	b	LBB0_10
LBB0_7:
	mov	x0, x22
	b	LBB0_13
LBB0_8:
	ldr	w0, [x19, #32]
	ldr	w1, [x19, #24]
	bl	_wait_event_interruptible
	ldr	w2, [x19, #28]
	cbz	w2, LBB0_11
; %bb.9:
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
LBB0_10:
	bl	_nfc_err
Lloh12:
	adrp	x8, _EINVAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_13
LBB0_11:
	ldr	w0, [x19, #32]
	ldr	w1, [x19, #20]
	bl	_wait_event_interruptible
LBB0_12:
	mov	w0, #0
LBB0_13:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_NCI_PATCH_TYPE_OTP,4,2         ; @NCI_PATCH_TYPE_OTP
	.comm	_FDP_FW_UPDATE_SLEEP,4,2        ; @FDP_FW_UPDATE_SLEEP
	.comm	_NCI_PATCH_TYPE_EOT,4,2         ; @NCI_PATCH_TYPE_EOT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"OTP patch error 0x%x\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_fdp_nci_patch_otp
.subsections_via_symbols
