	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function btmrvl_sdio_register_dev
_btmrvl_sdio_register_dev:              ## @btmrvl_sdio_register_dev
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	testq	%rdi, %rdi
	je	LBB0_2
## %bb.1:
	movq	%rdi, %rbx
	movq	8(%rdi), %r14
	testq	%r14, %r14
	je	LBB0_2
## %bb.3:
	movq	%r14, %rdi
	callq	_sdio_claim_host
	movq	%r14, %rdi
	callq	_sdio_enable_func
	testl	%eax, %eax
	je	LBB0_6
## %bb.4:
	leaq	L_.str.1(%rip), %rdi
	xorl	%ebx, %ebx
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_BT_ERR
	movq	_EIO@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	movl	%ebx, -20(%rbp)
	jmp	LBB0_5
LBB0_2:
	leaq	L_.str(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_BT_ERR
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_17
LBB0_6:
	movq	_btmrvl_sdio_interrupt@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_sdio_claim_irq
	testl	%eax, %eax
	je	LBB0_9
## %bb.7:
	leaq	L_.str.2(%rip), %rdi
	xorl	%ebx, %ebx
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_BT_ERR
	movq	_EIO@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	movl	%ebx, -20(%rbp)
	jmp	LBB0_8
LBB0_9:
	movq	8(%rbx), %rdi
	movq	_SDIO_BLOCK_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_sdio_set_block_size
	movl	%eax, -20(%rbp)
	testl	%eax, %eax
	je	LBB0_12
## %bb.10:
	leaq	L_.str.3(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_BT_ERR
	movq	_EIO@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	movl	%ebx, -20(%rbp)
	jmp	LBB0_11
LBB0_12:
	movq	_IO_PORT_0_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-20(%rbp), %rdx
	movq	%r14, %rdi
	callq	_sdio_readb
	cmpl	$0, -20(%rbp)
	js	LBB0_13
## %bb.14:
	movl	%eax, (%rbx)
	movq	_IO_PORT_1_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-20(%rbp), %rdx
	movq	%r14, %rdi
	callq	_sdio_readb
	cmpl	$0, -20(%rbp)
	js	LBB0_13
## %bb.15:
	shll	$8, %eax
	orl	%eax, (%rbx)
	movq	_IO_PORT_2_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-20(%rbp), %rdx
	movq	%r14, %rdi
	callq	_sdio_readb
	cmpl	$0, -20(%rbp)
	js	LBB0_13
## %bb.16:
	shll	$16, %eax
	orl	(%rbx), %eax
	movl	%eax, (%rbx)
	movl	(%r14), %esi
	leaq	L_.str.4(%rip), %rdi
	movl	%eax, %edx
	callq	_BT_DBG
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_sdio_set_drvdata
	movq	%r14, %rdi
	callq	_sdio_release_host
	xorl	%ebx, %ebx
	jmp	LBB0_17
LBB0_13:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	subl	(%rax), %ecx
	movl	%ecx, -20(%rbp)
LBB0_11:
	movq	%r14, %rdi
	callq	_sdio_release_irq
LBB0_8:
	movq	%r14, %rdi
	callq	_sdio_disable_func
LBB0_5:
	movq	%r14, %rdi
	callq	_sdio_release_host
	movl	-20(%rbp), %ebx
LBB0_17:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Error: card or function is NULL!"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"sdio_enable_func() failed: ret=%d"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_btmrvl_sdio_interrupt,4,2      ## @btmrvl_sdio_interrupt
L_.str.2:                               ## @.str.2
	.asciz	"sdio_claim_irq failed: ret=%d"

	.comm	_SDIO_BLOCK_SIZE,4,2            ## @SDIO_BLOCK_SIZE
L_.str.3:                               ## @.str.3
	.asciz	"cannot set SDIO block size"

	.comm	_IO_PORT_0_REG,4,2              ## @IO_PORT_0_REG
	.comm	_IO_PORT_1_REG,4,2              ## @IO_PORT_1_REG
	.comm	_IO_PORT_2_REG,4,2              ## @IO_PORT_2_REG
L_.str.4:                               ## @.str.4
	.asciz	"SDIO FUNC%d IO port: 0x%x"

	.no_dead_strip	_btmrvl_sdio_register_dev
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function btmrvl_sdio_register_dev
_btmrvl_sdio_register_dev:              ; @btmrvl_sdio_register_dev
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	cbz	x0, LBB0_4
; %bb.1:
	mov	x20, x0
	ldr	x19, [x0, #8]
	cbz	x19, LBB0_4
; %bb.2:
	mov	x0, x19
	bl	_sdio_claim_host
	mov	x0, x19
	bl	_sdio_enable_func
                                        ; kill: def $w0 killed $w0 def $x0
	cbz	w0, LBB0_5
; %bb.3:
	str	x0, [sp]
Lloh0:
	adrp	x0, l_.str.1@PAGE
Lloh1:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_BT_ERR
Lloh2:
	adrp	x8, _EIO@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w8, w8
	str	w8, [sp, #12]
	b	LBB0_11
LBB0_4:
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_BT_ERR
Lloh7:
	adrp	x8, _EINVAL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_12
LBB0_5:
Lloh10:
	adrp	x8, _btmrvl_sdio_interrupt@GOTPAGE
Lloh11:
	ldr	x8, [x8, _btmrvl_sdio_interrupt@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_sdio_claim_irq
                                        ; kill: def $w0 killed $w0 def $x0
	cbz	w0, LBB0_7
; %bb.6:
	str	x0, [sp]
Lloh13:
	adrp	x0, l_.str.2@PAGE
Lloh14:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_BT_ERR
Lloh15:
	adrp	x8, _EIO@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w8, w8
	str	w8, [sp, #12]
	b	LBB0_10
LBB0_7:
	ldr	x0, [x20, #8]
Lloh18:
	adrp	x8, _SDIO_BLOCK_SIZE@GOTPAGE
Lloh19:
	ldr	x8, [x8, _SDIO_BLOCK_SIZE@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	bl	_sdio_set_block_size
	str	w0, [sp, #12]
	cbz	w0, LBB0_13
; %bb.8:
Lloh21:
	adrp	x0, l_.str.3@PAGE
Lloh22:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_BT_ERR
LBB0_9:
Lloh23:
	adrp	x8, _EIO@GOTPAGE
Lloh24:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	neg	w8, w8
	str	w8, [sp, #12]
	mov	x0, x19
	bl	_sdio_release_irq
LBB0_10:
	mov	x0, x19
	bl	_sdio_disable_func
LBB0_11:
	mov	x0, x19
	bl	_sdio_release_host
	ldr	w0, [sp, #12]
LBB0_12:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_13:
Lloh26:
	adrp	x8, _IO_PORT_0_REG@GOTPAGE
Lloh27:
	ldr	x8, [x8, _IO_PORT_0_REG@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
	add	x2, sp, #12
	mov	x0, x19
	bl	_sdio_readb
	ldr	w8, [sp, #12]
	tbnz	w8, #31, LBB0_9
; %bb.14:
	str	w0, [x20]
Lloh29:
	adrp	x8, _IO_PORT_1_REG@GOTPAGE
Lloh30:
	ldr	x8, [x8, _IO_PORT_1_REG@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
	add	x2, sp, #12
	mov	x0, x19
	bl	_sdio_readb
	ldr	w8, [sp, #12]
	tbnz	w8, #31, LBB0_9
; %bb.15:
	ldr	w8, [x20]
	orr	w8, w8, w0, lsl #8
	str	w8, [x20]
Lloh32:
	adrp	x8, _IO_PORT_2_REG@GOTPAGE
Lloh33:
	ldr	x8, [x8, _IO_PORT_2_REG@GOTPAGEOFF]
Lloh34:
	ldr	w1, [x8]
	add	x2, sp, #12
	mov	x0, x19
	bl	_sdio_readb
	ldr	w8, [sp, #12]
	tbnz	w8, #31, LBB0_9
; %bb.16:
	ldr	w8, [x20]
	orr	w2, w8, w0, lsl #16
	str	w2, [x20]
	ldr	w1, [x19]
Lloh35:
	adrp	x0, l_.str.4@PAGE
Lloh36:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_BT_DBG
	mov	x0, x19
	mov	x1, x20
	bl	_sdio_set_drvdata
	mov	x0, x19
	bl	_sdio_release_host
	mov	w0, #0
	b	LBB0_12
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpAdd	Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Error: card or function is NULL!"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"sdio_enable_func() failed: ret=%d"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_btmrvl_sdio_interrupt,4,2      ; @btmrvl_sdio_interrupt
l_.str.2:                               ; @.str.2
	.asciz	"sdio_claim_irq failed: ret=%d"

	.comm	_SDIO_BLOCK_SIZE,4,2            ; @SDIO_BLOCK_SIZE
l_.str.3:                               ; @.str.3
	.asciz	"cannot set SDIO block size"

	.comm	_IO_PORT_0_REG,4,2              ; @IO_PORT_0_REG
	.comm	_IO_PORT_1_REG,4,2              ; @IO_PORT_1_REG
	.comm	_IO_PORT_2_REG,4,2              ; @IO_PORT_2_REG
l_.str.4:                               ; @.str.4
	.asciz	"SDIO FUNC%d IO port: 0x%x"

	.no_dead_strip	_btmrvl_sdio_register_dev
.subsections_via_symbols
