	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __issue_creg_rw
___issue_creg_rw:                       ## @__issue_creg_rw
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, -60(%rbp)                 ## 4-byte Spill
	movq	%r8, -72(%rbp)                  ## 8-byte Spill
	movl	%ecx, %ebx
	movl	%edx, %r13d
	movl	%esi, %r14d
	movq	%rdi, %r15
	movq	_cmd_done@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	callq	_DECLARE_COMPLETION_ONSTACK
	movq	%r12, -48(%rbp)
	movq	$0, -56(%rbp)
	movq	_creg_cmd_done_cb@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leaq	-56(%rbp), %r10
	movq	%r15, %rdi
	movl	%r14d, %esi
	movl	%r13d, %edx
	movl	%ebx, %ecx
	movq	-72(%rbp), %r8                  ## 8-byte Reload
	movl	-60(%rbp), %r9d                 ## 4-byte Reload
	pushq	%r10
	pushq	%rax
	callq	_creg_queue_cmd
	addq	$16, %rsp
	testl	%eax, %eax
	je	LBB0_1
LBB0_6:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	_CREG_TIMEOUT_MSEC@GOTPCREL(%rip), %rax
	movl	8(%r15), %edi
	imull	(%rax), %edi
	addl	$20000, %edi                    ## imm = 0x4E20
	callq	_msecs_to_jiffies
	movq	-48(%rbp), %rdi
	movq	%rax, %rsi
	callq	_wait_for_completion_timeout
	testl	%eax, %eax
	je	LBB0_2
## %bb.3:
	movq	16(%rbp), %rax
	movl	-52(%rbp), %ecx
	movl	%ecx, (%rax)
	cmpl	$0, -56(%rbp)
	je	LBB0_4
## %bb.5:
	movq	_SCRATCH@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%r15), %rdi
	callq	_ioread32
	movq	%r15, %rdi
	callq	_CARD_TO_DEV
	movl	-56(%rbp), %edx
	leaq	L_.str.1(%rip), %rsi
	movl	%eax, %edi
	movl	%r13d, %ecx
	callq	_dev_warn
	movl	-56(%rbp), %eax
	jmp	LBB0_6
LBB0_2:
	movq	%r15, %rdi
	callq	_CARD_TO_DEV
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edi
	callq	_dev_crit
	movq	%r15, %rdi
	callq	_creg_reset
	movq	_EIO@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_6
LBB0_4:
	xorl	%eax, %eax
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_cmd_done,4,2                   ## @cmd_done
	.comm	_creg_cmd_done_cb,4,2           ## @creg_cmd_done_cb
	.comm	_CREG_TIMEOUT_MSEC,4,2          ## @CREG_TIMEOUT_MSEC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"cregs timer failed\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_SCRATCH,8,3                    ## @SCRATCH
L_.str.1:                               ## @.str.1
	.asciz	"creg command failed(%d x%08x)\n"

	.no_dead_strip	___issue_creg_rw
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function __issue_creg_rw
___issue_creg_rw:                       ; @__issue_creg_rw
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x21, x6
	mov	x22, x5
	mov	x23, x4
	mov	x24, x3
	mov	x20, x2
	mov	x25, x1
	mov	x19, x0
Lloh0:
	adrp	x26, _cmd_done@GOTPAGE
Lloh1:
	ldr	x26, [x26, _cmd_done@GOTPAGEOFF]
	ldr	w0, [x26]
	bl	_DECLARE_COMPLETION_ONSTACK
	stp	xzr, x26, [sp]
Lloh2:
	adrp	x8, _creg_cmd_done_cb@GOTPAGE
Lloh3:
	ldr	x8, [x8, _creg_cmd_done_cb@GOTPAGEOFF]
Lloh4:
	ldr	w6, [x8]
	mov	x7, sp
	mov	x0, x19
	mov	x1, x25
	mov	x2, x20
	mov	x3, x24
	mov	x4, x23
	mov	x5, x22
	bl	_creg_queue_cmd
	cbz	w0, LBB0_2
LBB0_1:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_2:
Lloh5:
	adrp	x8, _CREG_TIMEOUT_MSEC@GOTPAGE
Lloh6:
	ldr	x8, [x8, _CREG_TIMEOUT_MSEC@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	ldr	w9, [x19, #8]
	mov	w10, #20000
	madd	w0, w9, w8, w10
	bl	_msecs_to_jiffies
	mov	x1, x0
	ldr	x0, [sp, #8]
	bl	_wait_for_completion_timeout
	cbz	w0, LBB0_5
; %bb.3:
	ldp	w9, w8, [sp]
	str	w8, [x21]
	cbz	w9, LBB0_6
; %bb.4:
	ldr	x8, [x19]
Lloh8:
	adrp	x9, _SCRATCH@GOTPAGE
Lloh9:
	ldr	x9, [x9, _SCRATCH@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_ioread32
	mov	x0, x19
	bl	_CARD_TO_DEV
	ldr	w2, [sp]
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x3, x20
	bl	_dev_warn
	ldr	w0, [sp]
	b	LBB0_1
LBB0_5:
	mov	x0, x19
	bl	_CARD_TO_DEV
Lloh13:
	adrp	x1, l_.str@PAGE
Lloh14:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_crit
	mov	x0, x19
	bl	_creg_reset
Lloh15:
	adrp	x8, _EIO@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_1
LBB0_6:
	mov	w0, #0
	b	LBB0_1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_cmd_done,4,2                   ; @cmd_done
	.comm	_creg_cmd_done_cb,4,2           ; @creg_cmd_done_cb
	.comm	_CREG_TIMEOUT_MSEC,4,2          ; @CREG_TIMEOUT_MSEC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"cregs timer failed\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_SCRATCH,8,3                    ; @SCRATCH
l_.str.1:                               ; @.str.1
	.asciz	"creg command failed(%d x%08x)\n"

	.no_dead_strip	___issue_creg_rw
.subsections_via_symbols
