	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ath10k_sdio_mbox_rx_alloc
_ath10k_sdio_mbox_rx_alloc:             ## @ath10k_sdio_mbox_rx_alloc
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %ebx
	movq	%rsi, %r13
	movq	%rdi, %r14
	callq	_ath10k_sdio_priv
	movq	%rax, %r12
	movq	_ATH10K_SDIO_MAX_RX_MSGS@GOTPCREL(%rip), %r15
	movl	(%r15), %ecx
	cmpl	%ebx, %ecx
	jge	LBB0_1
## %bb.20:
	leaq	L_.str(%rip), %rsi
	xorl	%r13d, %r13d
	movq	%r14, %rdi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_ath10k_warn
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r13d
LBB0_21:
	cmpl	$0, (%r15)
	jle	LBB0_25
## %bb.22:
	xorl	%ebx, %ebx
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_23:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%r12), %rdi
	cmpl	$0, (%rdi,%rbx)
	je	LBB0_25
## %bb.24:                              ##   in Loop: Header=BB0_23 Depth=1
	addq	%rbx, %rdi
	callq	_ath10k_sdio_mbox_free_rx_pkt
	incq	%r14
	movslq	(%r15), %rax
	addq	$4, %rbx
	cmpq	%rax, %r14
	jl	LBB0_23
	jmp	LBB0_25
LBB0_1:
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movl	$0, %eax
	testl	%ebx, %ebx
	jle	LBB0_19
## %bb.2:
	xorl	%eax, %eax
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movq	%r13, -80(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ebx, -52(%rbp)                 ## 4-byte Spill
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movslq	%eax, %r14
	movl	4(%r13,%r14,4), %edi
	callq	_le16_to_cpu
	movl	%eax, %r15d
	movq	_ATH10K_HTC_MBOX_MAX_PAYLOAD_LENGTH@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	4(%r13,%r14,4), %edi
	callq	_le16_to_cpu
	cmpl	%ebx, %r15d
	jg	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	leaq	(%r13,%r14,4), %r13
	movslq	%eax, %r15
	addq	$12, %r15
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_ath10k_sdio_calc_txrx_padded_len
	movq	%rax, %r12
	movq	_ATH10K_SDIO_MAX_BUFFER_SIZE@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r12
	ja	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	(%r13), %eax
	movq	_ATH10K_HTC_FLAG_BUNDLE_MASK@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_9
## %bb.10:                              ##   in Loop: Header=BB0_4 Depth=1
	shlq	$2, %r14
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	addq	8(%rax), %r14
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r14, %rsi
	movq	%r13, %rdx
	movq	%r12, %rcx
	movq	%r15, %r8
	leaq	-88(%rbp), %r9
	callq	_ath10k_sdio_mbox_alloc_pkt_bundle
	testl	%eax, %eax
	jne	LBB0_14
## %bb.11:                              ##   in Loop: Header=BB0_4 Depth=1
	movl	-88(%rbp), %eax
	addl	%eax, -52(%rbp)                 ## 4-byte Folded Spill
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	addl	%eax, %ecx
	movl	(%r13), %eax
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	movslq	%ecx, %r14
	movl	$1, %ecx
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_4 Depth=1
	xorl	%ecx, %ecx
LBB0_12:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	-80(%rbp), %r13                 ## 8-byte Reload
	movq	_ATH10K_HTC_FLAGS_RECV_1MORE_BLOCK@GOTPCREL(%rip), %rdx
	andl	(%rdx), %eax
	je	LBB0_13
## %bb.16:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	_ATH10K_HIF_MBOX_BLOCK_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	jmp	LBB0_17
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_4 Depth=1
	xorl	%edx, %edx
LBB0_17:                                ##   in Loop: Header=BB0_4 Depth=1
	addq	%r12, %rdx
	shlq	$2, %r14
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	addq	8(%r12), %r14
	movq	%r14, %rdi
	movq	%r15, %rsi
	movl	%ecx, %r8d
	callq	_ath10k_sdio_mbox_alloc_rx_pkt
	testl	%eax, %eax
	jne	LBB0_18
## %bb.3:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	incl	%eax
	movl	-52(%rbp), %ebx                 ## 4-byte Reload
	cmpl	%ebx, %eax
	jl	LBB0_4
LBB0_19:
	movl	%eax, (%r12)
	xorl	%r13d, %r13d
LBB0_25:
	movl	%r13d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	_ATH10K_HTC_MBOX_MAX_PAYLOAD_LENGTH@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	leaq	L_.str.1(%rip), %rsi
	xorl	%r13d, %r13d
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_ath10k_warn
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r13d
	movq	_ATH10K_SDIO_MAX_RX_MSGS@GOTPCREL(%rip), %r15
	jmp	LBB0_21
LBB0_7:
	movl	8(%r13), %ebx
	movl	(%r13), %r14d
	movl	4(%r13), %edi
	callq	_le16_to_cpu
	leaq	L_.str.2(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, %edx
	xorl	%r13d, %r13d
	movl	%r14d, %ecx
	movl	%eax, %r8d
	xorl	%eax, %eax
	callq	_ath10k_warn
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r13d
	jmp	LBB0_15
LBB0_18:
	movl	%eax, %ebx
	leaq	L_.str.4(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_ath10k_warn
	movl	%ebx, %r13d
	movq	_ATH10K_SDIO_MAX_RX_MSGS@GOTPCREL(%rip), %r15
	jmp	LBB0_21
LBB0_14:
	movl	%eax, %ebx
	leaq	L_.str.3(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_ath10k_warn
	movl	%ebx, %r13d
LBB0_15:
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	movq	_ATH10K_SDIO_MAX_RX_MSGS@GOTPCREL(%rip), %r15
	jmp	LBB0_21
	.cfi_endproc
                                        ## -- End function
	.comm	_ATH10K_SDIO_MAX_RX_MSGS,4,2    ## @ATH10K_SDIO_MAX_RX_MSGS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"the total number of pkgs to be fetched (%u) exceeds maximum %u\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_ATH10K_HTC_MBOX_MAX_PAYLOAD_LENGTH,4,2 ## @ATH10K_HTC_MBOX_MAX_PAYLOAD_LENGTH
L_.str.1:                               ## @.str.1
	.asciz	"payload length %d exceeds max htc length: %zu\n"

	.comm	_ATH10K_SDIO_MAX_BUFFER_SIZE,8,3 ## @ATH10K_SDIO_MAX_BUFFER_SIZE
L_.str.2:                               ## @.str.2
	.asciz	"rx buffer requested with invalid htc_hdr length (%d, 0x%x): %d\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ATH10K_HTC_FLAG_BUNDLE_MASK,4,2 ## @ATH10K_HTC_FLAG_BUNDLE_MASK
L_.str.3:                               ## @.str.3
	.asciz	"alloc_bundle error %d\n"

	.comm	_ATH10K_HTC_FLAGS_RECV_1MORE_BLOCK,4,2 ## @ATH10K_HTC_FLAGS_RECV_1MORE_BLOCK
	.comm	_ATH10K_HIF_MBOX_BLOCK_SIZE,8,3 ## @ATH10K_HIF_MBOX_BLOCK_SIZE
L_.str.4:                               ## @.str.4
	.asciz	"alloc_rx_pkt error %d\n"

	.no_dead_strip	_ath10k_sdio_mbox_rx_alloc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ath10k_sdio_mbox_rx_alloc
_ath10k_sdio_mbox_rx_alloc:             ; @ath10k_sdio_mbox_rx_alloc
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	mov	x21, x2
	mov	x22, x1
	mov	x20, x0
	bl	_ath10k_sdio_priv
	mov	x19, x0
Lloh0:
	adrp	x27, _ATH10K_SDIO_MAX_RX_MSGS@GOTPAGE
Lloh1:
	ldr	x27, [x27, _ATH10K_SDIO_MAX_RX_MSGS@GOTPAGEOFF]
	ldr	w8, [x27]
	cmp	w8, w21
	b.ge	LBB0_8
; %bb.1:
	str	x8, [sp]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	mov	x2, x21
LBB0_2:
	bl	_ath10k_warn
Lloh4:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_3:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_4:
	ldr	w8, [x27]
	cmp	w8, #1
	b.lt	LBB0_20
; %bb.5:
	mov	x20, #0
	mov	x21, #0
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	add	x0, x8, x20
	ldr	w8, [x0]
	cbz	w8, LBB0_20
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	bl	_ath10k_sdio_mbox_free_rx_pkt
	add	x21, x21, #1
	ldrsw	x8, [x27]
	add	x20, x20, #4
	cmp	x21, x8
	b.lt	LBB0_6
	b	LBB0_20
LBB0_8:
	cmp	w21, #1
	b.lt	LBB0_18
; %bb.9:
	mov	w28, #0
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	add	x26, x22, w28, sxtw #2
	ldr	w0, [x26, #4]
	bl	_le16_to_cpu
	mov	x23, x0
Lloh6:
	adrp	x8, _ATH10K_HTC_MBOX_MAX_PAYLOAD_LENGTH@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ATH10K_HTC_MBOX_MAX_PAYLOAD_LENGTH@GOTPAGEOFF]
Lloh8:
	ldr	w24, [x8]
	ldr	w0, [x26, #4]
	bl	_le16_to_cpu
	mov	x2, x0
	cmp	w23, w24
	b.gt	LBB0_21
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	sxtw	x8, w2
	add	x24, x8, #12
	mov	x0, x19
	mov	x1, x24
	bl	_ath10k_sdio_calc_txrx_padded_len
Lloh9:
	adrp	x8, _ATH10K_SDIO_MAX_BUFFER_SIZE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ATH10K_SDIO_MAX_BUFFER_SIZE@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	cmp	x0, x8
	b.hi	LBB0_22
; %bb.12:                               ;   in Loop: Header=BB0_10 Depth=1
	mov	x25, x0
	sxtw	x8, w28
	ldr	w9, [x26]
Lloh12:
	adrp	x10, _ATH10K_HTC_FLAG_BUNDLE_MASK@GOTPAGE
Lloh13:
	ldr	x10, [x10, _ATH10K_HTC_FLAG_BUNDLE_MASK@GOTPAGEOFF]
Lloh14:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_15
; %bb.13:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	x9, [x19, #8]
	add	x1, x9, x8, lsl #2
	add	x5, sp, #24
	mov	x0, x20
	mov	x2, x26
	mov	x3, x25
	mov	x4, x24
	bl	_ath10k_sdio_mbox_alloc_pkt_bundle
	cbnz	w0, LBB0_24
; %bb.14:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	w8, [sp, #24]
	add	w21, w21, w8
	add	w28, w28, w8
	ldr	w9, [x26]
	sxtw	x8, w28
	mov	w3, #1
                                        ; kill: def $w28 killed $w28 killed $x28 def $x28
	b	LBB0_16
LBB0_15:                                ;   in Loop: Header=BB0_10 Depth=1
	mov	w3, #0
LBB0_16:                                ;   in Loop: Header=BB0_10 Depth=1
Lloh15:
	adrp	x10, _ATH10K_HTC_FLAGS_RECV_1MORE_BLOCK@GOTPAGE
Lloh16:
	ldr	x10, [x10, _ATH10K_HTC_FLAGS_RECV_1MORE_BLOCK@GOTPAGEOFF]
Lloh17:
	ldr	w10, [x10]
Lloh18:
	adrp	x11, _ATH10K_HIF_MBOX_BLOCK_SIZE@GOTPAGE
Lloh19:
	ldr	x11, [x11, _ATH10K_HIF_MBOX_BLOCK_SIZE@GOTPAGEOFF]
Lloh20:
	ldr	x11, [x11]
	tst	w10, w9
	csel	x9, xzr, x11, eq
	add	x2, x9, x25
	ldr	x9, [x19, #8]
	add	x0, x9, x8, lsl #2
	mov	x1, x24
	mov	x4, x3
	bl	_ath10k_sdio_mbox_alloc_rx_pkt
	cbnz	w0, LBB0_23
; %bb.17:                               ;   in Loop: Header=BB0_10 Depth=1
	add	w28, w28, #1
	cmp	w28, w21
	b.lt	LBB0_10
	b	LBB0_19
LBB0_18:
	mov	w28, #0
LBB0_19:
	mov	w23, #0
	str	w28, [x19]
LBB0_20:
	mov	x0, x23
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_21:
Lloh21:
	adrp	x8, _ATH10K_HTC_MBOX_MAX_PAYLOAD_LENGTH@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ATH10K_HTC_MBOX_MAX_PAYLOAD_LENGTH@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	str	x8, [sp]
Lloh24:
	adrp	x1, l_.str.1@PAGE
Lloh25:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
                                        ; kill: def $w2 killed $w2 killed $x2
	b	LBB0_2
LBB0_22:
	ldp	w0, w21, [x26, #4]
	ldr	w22, [x26]
	bl	_le16_to_cpu
                                        ; kill: def $w0 killed $w0 def $x0
	stp	x22, x0, [sp]
Lloh26:
	adrp	x1, l_.str.2@PAGE
Lloh27:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x20
	mov	x2, x21
	bl	_ath10k_warn
Lloh28:
	adrp	x8, _EINVAL@GOTPAGE
Lloh29:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_3
LBB0_23:
	mov	x23, x0
Lloh30:
	adrp	x1, l_.str.4@PAGE
Lloh31:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_25
LBB0_24:
	mov	x23, x0
Lloh32:
	adrp	x1, l_.str.3@PAGE
Lloh33:
	add	x1, x1, l_.str.3@PAGEOFF
LBB0_25:
	mov	x0, x20
	mov	x2, x23
	bl	_ath10k_warn
	b	LBB0_4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpAdd	Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.comm	_ATH10K_SDIO_MAX_RX_MSGS,4,2    ; @ATH10K_SDIO_MAX_RX_MSGS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"the total number of pkgs to be fetched (%u) exceeds maximum %u\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_ATH10K_HTC_MBOX_MAX_PAYLOAD_LENGTH,4,2 ; @ATH10K_HTC_MBOX_MAX_PAYLOAD_LENGTH
l_.str.1:                               ; @.str.1
	.asciz	"payload length %d exceeds max htc length: %zu\n"

	.comm	_ATH10K_SDIO_MAX_BUFFER_SIZE,8,3 ; @ATH10K_SDIO_MAX_BUFFER_SIZE
l_.str.2:                               ; @.str.2
	.asciz	"rx buffer requested with invalid htc_hdr length (%d, 0x%x): %d\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ATH10K_HTC_FLAG_BUNDLE_MASK,4,2 ; @ATH10K_HTC_FLAG_BUNDLE_MASK
l_.str.3:                               ; @.str.3
	.asciz	"alloc_bundle error %d\n"

	.comm	_ATH10K_HTC_FLAGS_RECV_1MORE_BLOCK,4,2 ; @ATH10K_HTC_FLAGS_RECV_1MORE_BLOCK
	.comm	_ATH10K_HIF_MBOX_BLOCK_SIZE,8,3 ; @ATH10K_HIF_MBOX_BLOCK_SIZE
l_.str.4:                               ; @.str.4
	.asciz	"alloc_rx_pkt error %d\n"

	.no_dead_strip	_ath10k_sdio_mbox_rx_alloc
.subsections_via_symbols
