	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function do_otp_lock
_do_otp_lock:                           ## @do_otp_lock
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testq	%rdx, %rdx
	jne	LBB0_2
## %bb.1:
	cmpq	%r9, %rcx
	jne	LBB0_2
## %bb.3:
	movq	%rsi, %r15
	movq	%rdi, %r14
	movq	(%rdi), %r12
	movq	%rsi, %rdi
	callq	_mutex_lock
	movl	4(%r15), %edx
	movq	_FL_LOCKING@GOTPCREL(%rip), %r13
	movl	(%r13), %ecx
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_get_chip
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movl	%eax, %ebx
	jmp	LBB0_11
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_12
LBB0_5:
	movl	(%r13), %eax
	movl	%eax, 8(%r15)
	movl	(%r12), %r9d
	movl	4(%r12), %esi
	movl	4(%r15), %edx
	movq	$0, (%rsp)
	movl	$170, %edi
	movq	%r14, %rcx
	movq	%r12, %r8
	callq	_cfi_send_gen_cmd
	movl	(%r12), %r9d
	movl	8(%r12), %esi
	movl	4(%r15), %edx
	movq	$0, (%rsp)
	movl	$85, %edi
	movq	%r14, %rcx
	movq	%r12, %r8
	callq	_cfi_send_gen_cmd
	movl	(%r12), %r9d
	movl	4(%r12), %esi
	movl	4(%r15), %edx
	movq	$0, (%rsp)
	movl	$64, %edi
	movq	%r14, %rcx
	movq	%r12, %r8
	callq	_cfi_send_gen_cmd
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_cfi_read_query
	movl	%eax, %r12d
	andl	$-2, %r12d
	movl	$160, %edi
	callq	_CMD
	movl	4(%r15), %edx
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_map_write
	movl	%r12d, %edi
	callq	_CMD
	movl	4(%r15), %edx
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_map_write
	movq	_jiffies@GOTPCREL(%rip), %r13
	movq	(%r13), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	$2, %edi
	callq	_msecs_to_jiffies
	movq	%rax, %r12
	movq	%r14, %rdi
	movq	%r15, %rsi
	xorl	%edx, %edx
	callq	_chip_ready
	testq	%rax, %rax
	jne	LBB0_10
## %bb.6:
	addq	-48(%rbp), %r12                 ## 8-byte Folded Reload
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r13), %rdi
	movq	%r12, %rsi
	callq	_time_after
	testq	%rax, %rax
	jne	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	movq	%r15, %rsi
	xorl	%edx, %edx
	movl	$1, %ecx
	callq	_UDELAY
	movq	%r14, %rdi
	movq	%r15, %rsi
	xorl	%edx, %edx
	callq	_chip_ready
	testq	%rax, %rax
	je	LBB0_7
	jmp	LBB0_10
LBB0_8:
	leaq	L_.str(%rip), %rdi
	callq	_pr_err
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_10:
	movl	$144, %edi
	callq	_CMD
	movl	4(%r15), %edx
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_map_write
	xorl	%edi, %edi
	callq	_CMD
	movl	4(%r15), %edx
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_map_write
	movq	_FL_READY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%r15)
	movl	4(%r15), %edx
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_put_chip
LBB0_11:
	movq	%r15, %rdi
	callq	_mutex_unlock
LBB0_12:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_FL_LOCKING,4,2                 ## @FL_LOCKING
	.comm	_jiffies,8,3                    ## @jiffies
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Waiting for chip to be ready timed out.\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_FL_READY,4,2                   ## @FL_READY
	.no_dead_strip	_do_otp_lock
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function do_otp_lock
_do_otp_lock:                           ; @do_otp_lock
	.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
	cbnz	x2, LBB0_4
; %bb.1:
	cmp	x3, x5
	b.ne	LBB0_4
; %bb.2:
	mov	x19, x1
	mov	x20, x0
	ldr	x22, [x0]
	mov	x0, x1
	bl	_mutex_lock
	ldr	w2, [x19, #4]
Lloh0:
	adrp	x23, _FL_LOCKING@GOTPAGE
Lloh1:
	ldr	x23, [x23, _FL_LOCKING@GOTPAGEOFF]
	ldr	w3, [x23]
	mov	x0, x20
	mov	x1, x19
	bl	_get_chip
	cbz	w0, LBB0_5
; %bb.3:
	mov	x21, x0
	b	LBB0_12
LBB0_4:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_13
LBB0_5:
	ldr	w8, [x23]
	str	w8, [x19, #8]
	ldr	w2, [x19, #4]
	ldp	w5, w1, [x22]
	mov	w0, #170
	mov	x3, x20
	mov	x4, x22
	mov	x6, #0
	bl	_cfi_send_gen_cmd
	ldr	w1, [x22, #8]
	ldr	w2, [x19, #4]
	ldr	w5, [x22]
	mov	w0, #85
	mov	x3, x20
	mov	x4, x22
	mov	x6, #0
	bl	_cfi_send_gen_cmd
	ldr	w2, [x19, #4]
	ldp	w5, w1, [x22]
	mov	w0, #64
	mov	x3, x20
	mov	x4, x22
	mov	x6, #0
	bl	_cfi_send_gen_cmd
	mov	x0, x20
	mov	w1, #0
	bl	_cfi_read_query
	and	w21, w0, #0xfffffffe
	mov	w0, #160
	bl	_CMD
	mov	x1, x0
	ldr	w2, [x19, #4]
	mov	x0, x20
	bl	_map_write
	mov	x0, x21
	bl	_CMD
	mov	x1, x0
	ldr	w2, [x19, #4]
	mov	x0, x20
	bl	_map_write
Lloh5:
	adrp	x23, _jiffies@GOTPAGE
Lloh6:
	ldr	x23, [x23, _jiffies@GOTPAGEOFF]
	ldr	x24, [x23]
	mov	w0, #2
	bl	_msecs_to_jiffies
	mov	x22, x0
	mov	x0, x20
	mov	x1, x19
	mov	x2, #0
	bl	_chip_ready
	mov	w21, #0
	cbnz	x0, LBB0_11
; %bb.6:
	add	x21, x22, x24
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x23]
	mov	x1, x21
	bl	_time_after
	cbnz	x0, LBB0_10
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x20
	mov	x1, x19
	mov	w2, #0
	mov	w3, #1
	bl	_UDELAY
	mov	x0, x20
	mov	x1, x19
	mov	x2, #0
	bl	_chip_ready
	cbz	x0, LBB0_7
; %bb.9:
	mov	w21, #0
	b	LBB0_11
LBB0_10:
Lloh7:
	adrp	x0, l_.str@PAGE
Lloh8:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
Lloh9:
	adrp	x8, _EIO@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_11:
	mov	w0, #144
	bl	_CMD
	mov	x1, x0
	ldr	w2, [x19, #4]
	mov	x0, x20
	bl	_map_write
	mov	w0, #0
	bl	_CMD
	mov	x1, x0
	ldr	w2, [x19, #4]
	mov	x0, x20
	bl	_map_write
Lloh12:
	adrp	x8, _FL_READY@GOTPAGE
Lloh13:
	ldr	x8, [x8, _FL_READY@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	str	w8, [x19, #8]
	ldr	w2, [x19, #4]
	mov	x0, x20
	mov	x1, x19
	bl	_put_chip
LBB0_12:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_13:
	mov	x0, x21
	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 AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_FL_LOCKING,4,2                 ; @FL_LOCKING
	.comm	_jiffies,8,3                    ; @jiffies
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Waiting for chip to be ready timed out.\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_FL_READY,4,2                   ; @FL_READY
	.no_dead_strip	_do_otp_lock
.subsections_via_symbols
