	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function btmrvl_sdio_card_to_host
_btmrvl_sdio_card_to_host:              ## @btmrvl_sdio_card_to_host
	.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
	movl	$0, -44(%rbp)
	movq	(%rdi), %rbx
	movq	8(%rdi), %r12
	testq	%rbx, %rbx
	je	LBB0_2
## %bb.1:
	cmpl	$0, 4(%rbx)
	je	LBB0_2
## %bb.4:
	movq	%rdi, %r15
	leaq	-44(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_btmrvl_sdio_read_rx_len
	testl	%eax, %eax
	js	LBB0_5
## %bb.6:
	movl	%eax, %r13d
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	movl	-44(%rbp), %esi
	movq	_SDIO_HEADER_LEN@GOTPCREL(%rip), %rax
	cmpl	(%rax), %esi
	jle	LBB0_8
## %bb.7:
	movq	_SDIO_BLOCK_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leal	(%rsi,%rcx), %r12d
	decl	%r12d
	movl	%r12d, %eax
	cltd
	idivl	%ecx
	subl	%edx, %r12d
	movq	_ALLOC_BUF_SIZE@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	jle	LBB0_9
LBB0_8:
	leaq	L_.str.2(%rip), %rdi
	xorl	%r14d, %r14d
                                        ## kill: def $esi killed $esi killed $rsi
	xorl	%eax, %eax
	callq	_BT_ERR
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
LBB0_23:
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	testl	%r13d, %r13d
	jne	LBB0_25
	jmp	LBB0_27
LBB0_2:
	leaq	L_.str(%rip), %rdi
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_BT_ERR
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_3:
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	testl	%r13d, %r13d
	je	LBB0_27
LBB0_25:
	incl	4(%r12)
	testq	%r14, %r14
	je	LBB0_27
## %bb.26:
	movq	%r14, %rdi
	callq	_kfree_skb
LBB0_27:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	leaq	L_.str.1(%rip), %rdi
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_BT_ERR
	movq	_EIO@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_9:
	movq	_BTSDIO_DMA_ALIGN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addl	%r12d, %edi
	movq	_GFP_ATOMIC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_bt_skb_alloc
	testq	%rax, %rax
	je	LBB0_10
## %bb.11:
	movq	%rax, %r14
	movq	(%rax), %rax
	movq	_BTSDIO_DMA_ALIGN@GOTPCREL(%rip), %r13
	movslq	(%r13), %rsi
	decq	%rsi
	andq	%rax, %rsi
	je	LBB0_13
## %bb.12:
	movq	%r14, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_skb_put
	movl	(%r13), %esi
	decl	%esi
	andl	(%r14), %esi
	movq	%r14, %rdi
	callq	_skb_pull
	movq	(%r14), %rax
LBB0_13:
	movl	(%rbx), %edx
	movl	4(%rbx), %edi
	movq	%rax, %rsi
	movq	%rax, %rbx
	movl	%r12d, %ecx
	callq	_sdio_readsb
	movl	%eax, %r13d
	testl	%eax, %eax
	js	LBB0_14
## %bb.15:
	movl	4(%rbx), %eax
	shll	$8, %eax
	orl	(%rbx), %eax
	movl	%eax, -44(%rbp)
	movl	12(%rbx), %esi
	leal	-129(%rsi), %eax
	cmpl	$3, %eax
	jae	LBB0_16
## %bb.18:
	movq	%r14, %rdi
	movq	%rsi, %rbx
	callq	_bt_cb
	movl	%ebx, (%rax)
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, 8(%r14)
	movl	-44(%rbp), %esi
	movq	%r14, %rdi
	callq	_skb_put
	movq	_SDIO_HEADER_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_skb_pull
	cmpl	$130, %ebx
	jne	LBB0_20
## %bb.19:
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_btmrvl_check_evtpkt
	jmp	LBB0_20
LBB0_10:
	leaq	L_.str.3(%rip), %rdi
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_BT_ERR
	jmp	LBB0_23
LBB0_14:
	leaq	L_.str.4(%rip), %rdi
	xorl	%ebx, %ebx
	movl	%r13d, %esi
	xorl	%eax, %eax
	callq	_BT_ERR
	movq	_EIO@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	movl	%ebx, %r13d
	jmp	LBB0_23
LBB0_16:
	cmpl	$128, %esi
	jne	LBB0_22
## %bb.17:
	movq	_HCI_VENDOR_PKT@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	%r14, %rdi
	callq	_bt_cb
	movl	%ebx, (%rax)
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, 8(%r14)
	movl	-44(%rbp), %esi
	movq	%r14, %rdi
	callq	_skb_put
	movq	_SDIO_HEADER_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_skb_pull
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_btmrvl_process_event
	testl	%eax, %eax
	je	LBB0_21
LBB0_20:
	movq	%r14, %rdi
	callq	_hci_recv_frame
LBB0_21:
	movl	-44(%rbp), %eax
	addl	%eax, (%r12)
	testl	%r13d, %r13d
	jne	LBB0_25
	jmp	LBB0_27
LBB0_22:
	leaq	L_.str.5(%rip), %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	xorl	%eax, %eax
	callq	_BT_ERR
	movq	_DUMP_PREFIX_OFFSET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.6(%rip), %rdi
	movq	%rbx, %rdx
	movl	%r12d, %ecx
	callq	_print_hex_dump_bytes
	movq	%r14, %rdi
	callq	_kfree_skb
	xorl	%r14d, %r14d
	jmp	LBB0_23
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"card or function is NULL!"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"read rx_len failed"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_SDIO_BLOCK_SIZE,4,2            ## @SDIO_BLOCK_SIZE
	.comm	_SDIO_HEADER_LEN,4,2            ## @SDIO_HEADER_LEN
	.comm	_ALLOC_BUF_SIZE,4,2             ## @ALLOC_BUF_SIZE
L_.str.2:                               ## @.str.2
	.asciz	"invalid packet length: %d"

	.comm	_BTSDIO_DMA_ALIGN,4,2           ## @BTSDIO_DMA_ALIGN
	.comm	_GFP_ATOMIC,4,2                 ## @GFP_ATOMIC
L_.str.3:                               ## @.str.3
	.asciz	"No free skb"

L_.str.4:                               ## @.str.4
	.asciz	"readsb failed: %d"

	.comm	_HCI_VENDOR_PKT,4,2             ## @HCI_VENDOR_PKT
L_.str.5:                               ## @.str.5
	.asciz	"Unknow packet type:%d"

L_.str.6:                               ## @.str.6
	.space	1

	.comm	_DUMP_PREFIX_OFFSET,4,2         ## @DUMP_PREFIX_OFFSET
	.no_dead_strip	_btmrvl_sdio_card_to_host
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function btmrvl_sdio_card_to_host
_btmrvl_sdio_card_to_host:              ; @btmrvl_sdio_card_to_host
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	str	wzr, [sp, #12]
	ldp	x23, x25, [x0]
	cbz	x23, LBB0_6
; %bb.1:
	ldr	w8, [x23, #4]
	cbz	w8, LBB0_6
; %bb.2:
	mov	x21, x0
	add	x1, sp, #12
	mov	x0, x23
	bl	_btmrvl_sdio_read_rx_len
	tbnz	w0, #31, LBB0_13
; %bb.3:
	ldr	w8, [sp, #12]
Lloh0:
	adrp	x26, _SDIO_HEADER_LEN@GOTPAGE
Lloh1:
	ldr	x26, [x26, _SDIO_HEADER_LEN@GOTPAGEOFF]
	ldr	w9, [x26]
	cmp	w8, w9
	b.le	LBB0_5
; %bb.4:
Lloh2:
	adrp	x9, _SDIO_BLOCK_SIZE@GOTPAGE
Lloh3:
	ldr	x9, [x9, _SDIO_BLOCK_SIZE@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	add	w10, w8, w9
	sub	w10, w10, #1
	sdiv	w10, w10, w9
	mul	w22, w10, w9
Lloh5:
	adrp	x9, _ALLOC_BUF_SIZE@GOTPAGE
Lloh6:
	ldr	x9, [x9, _ALLOC_BUF_SIZE@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	cmp	w22, w9
	b.le	LBB0_15
LBB0_5:
	str	x8, [sp]
Lloh8:
	adrp	x0, l_.str.2@PAGE
Lloh9:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_7
LBB0_6:
Lloh10:
	adrp	x0, l_.str@PAGE
Lloh11:
	add	x0, x0, l_.str@PAGEOFF
LBB0_7:
	bl	_BT_ERR
	mov	x19, #0
Lloh12:
	adrp	x8, _EINVAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_9:
	cbz	w20, LBB0_12
; %bb.10:
	ldr	w8, [x25, #4]
	add	w8, w8, #1
	str	w8, [x25, #4]
	cbz	x19, LBB0_12
; %bb.11:
	mov	x0, x19
	bl	_kfree_skb
LBB0_12:
	mov	x0, x20
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_13:
Lloh14:
	adrp	x0, l_.str.1@PAGE
Lloh15:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_BT_ERR
	mov	x19, #0
LBB0_14:
Lloh16:
	adrp	x8, _EIO@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_8
LBB0_15:
	mov	x20, x0
Lloh18:
	adrp	x27, _BTSDIO_DMA_ALIGN@GOTPAGE
Lloh19:
	ldr	x27, [x27, _BTSDIO_DMA_ALIGN@GOTPAGEOFF]
	ldr	w8, [x27]
	add	w0, w8, w22
Lloh20:
	adrp	x8, _GFP_ATOMIC@GOTPAGE
Lloh21:
	ldr	x8, [x8, _GFP_ATOMIC@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	bl	_bt_skb_alloc
	mov	x19, x0
	cbz	x0, LBB0_22
; %bb.16:
	ldr	x24, [x19]
	ldrsw	x8, [x27]
	sub	x8, x8, #1
	ands	x1, x8, x24
	b.eq	LBB0_18
; %bb.17:
	mov	x0, x19
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_skb_put
	ldr	w8, [x19]
	ldr	w9, [x27]
	sub	w9, w9, #1
	and	w1, w9, w8
	mov	x0, x19
	bl	_skb_pull
	ldr	x24, [x19]
LBB0_18:
	ldp	w2, w0, [x23]
	mov	x1, x24
	mov	x3, x22
	bl	_sdio_readsb
	mov	x20, x0
	tbnz	w0, #31, LBB0_23
; %bb.19:
	ldp	w8, w9, [x24]
	orr	w8, w8, w9, lsl #8
	str	w8, [sp, #12]
	ldr	w23, [x24, #12]
	sub	w8, w23, #129
	cmp	w8, #3
	b.hs	LBB0_24
; %bb.20:
	mov	x0, x19
	bl	_bt_cb
	str	w23, [x0]
	str	x25, [x19, #8]
	ldr	w1, [sp, #12]
	mov	x0, x19
	bl	_skb_put
	ldr	w1, [x26]
	mov	x0, x19
	bl	_skb_pull
	cmp	w23, #130
	b.ne	LBB0_26
; %bb.21:
	mov	x0, x21
	mov	x1, x19
	bl	_btmrvl_check_evtpkt
	b	LBB0_26
LBB0_22:
Lloh23:
	adrp	x0, l_.str.3@PAGE
Lloh24:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_BT_ERR
	b	LBB0_9
LBB0_23:
	str	x20, [sp]
Lloh25:
	adrp	x0, l_.str.4@PAGE
Lloh26:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_BT_ERR
	b	LBB0_14
LBB0_24:
	cmp	w23, #128
	b.ne	LBB0_28
; %bb.25:
Lloh27:
	adrp	x8, _HCI_VENDOR_PKT@GOTPAGE
Lloh28:
	ldr	x8, [x8, _HCI_VENDOR_PKT@GOTPAGEOFF]
Lloh29:
	ldr	w22, [x8]
	mov	x0, x19
	bl	_bt_cb
	str	w22, [x0]
	str	x25, [x19, #8]
	ldr	w1, [sp, #12]
	mov	x0, x19
	bl	_skb_put
	ldr	w1, [x26]
	mov	x0, x19
	bl	_skb_pull
	mov	x0, x21
	mov	x1, x19
	bl	_btmrvl_process_event
	cbz	w0, LBB0_27
LBB0_26:
	mov	x0, x19
	bl	_hci_recv_frame
LBB0_27:
	ldr	w8, [sp, #12]
	ldr	w9, [x25]
	add	w8, w9, w8
	str	w8, [x25]
	b	LBB0_9
LBB0_28:
	str	x23, [sp]
Lloh30:
	adrp	x0, l_.str.5@PAGE
Lloh31:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_BT_ERR
Lloh32:
	adrp	x8, _DUMP_PREFIX_OFFSET@GOTPAGE
Lloh33:
	ldr	x8, [x8, _DUMP_PREFIX_OFFSET@GOTPAGEOFF]
Lloh34:
	ldr	w1, [x8]
Lloh35:
	adrp	x0, l_.str.6@PAGE
Lloh36:
	add	x0, x0, l_.str.6@PAGEOFF
	mov	x2, x24
	mov	x3, x22
	bl	_print_hex_dump_bytes
	mov	x0, x19
	bl	_kfree_skb
	mov	x19, #0
	b	LBB0_9
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpAdd	Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"card or function is NULL!"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"read rx_len failed"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_SDIO_BLOCK_SIZE,4,2            ; @SDIO_BLOCK_SIZE
	.comm	_SDIO_HEADER_LEN,4,2            ; @SDIO_HEADER_LEN
	.comm	_ALLOC_BUF_SIZE,4,2             ; @ALLOC_BUF_SIZE
l_.str.2:                               ; @.str.2
	.asciz	"invalid packet length: %d"

	.comm	_BTSDIO_DMA_ALIGN,4,2           ; @BTSDIO_DMA_ALIGN
	.comm	_GFP_ATOMIC,4,2                 ; @GFP_ATOMIC
l_.str.3:                               ; @.str.3
	.asciz	"No free skb"

l_.str.4:                               ; @.str.4
	.asciz	"readsb failed: %d"

	.comm	_HCI_VENDOR_PKT,4,2             ; @HCI_VENDOR_PKT
l_.str.5:                               ; @.str.5
	.asciz	"Unknow packet type:%d"

l_.str.6:                               ; @.str.6
	.space	1

	.comm	_DUMP_PREFIX_OFFSET,4,2         ; @DUMP_PREFIX_OFFSET
	.no_dead_strip	_btmrvl_sdio_card_to_host
.subsections_via_symbols
