	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function brcmf_sdio_txpkt_prep_sg
_brcmf_sdio_txpkt_prep_sg:              ## @brcmf_sdio_txpkt_prep_sg
	.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	%ecx, %r12d
	movq	%rdx, %r14
	movq	%rsi, %rbx
	movq	%rdi, %r13
	movq	16(%rdi), %rax
	movq	(%rax), %rax
	movl	(%rax), %r15d
	movl	%r15d, %eax
	xorl	%edx, %edx
	divl	(%rdi)
	movl	%edx, %edi
	callq	_WARN_ON
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_skb_queue_is_last
	movl	%eax, %ecx
	movl	(%r14), %eax
	movl	(%r13), %esi
	xorl	%edx, %edx
	divl	%esi
	movl	%edx, %ebx
	subl	%edx, %esi
	testl	%edx, %edx
	cmovel	%edx, %esi
	addl	%esi, %r12d
	movl	%r12d, %eax
	xorl	%edx, %edx
	divl	%r15d
	movl	%r15d, %r12d
	subl	%edx, %r12d
	testl	%edx, %edx
	cmovel	%edx, %r12d
	testl	%ecx, %ecx
	cmovel	%ecx, %r12d
	addl	%esi, %r12d
	movq	%r14, %rdi
	callq	_skb_tailroom
	cmpl	%r12d, %eax
	jge	LBB0_7
## %bb.1:
	cmpl	%r15d, (%r14)
	jbe	LBB0_7
## %bb.2:
	leal	(%r12,%rbx), %r15d
	movslq	%r15d, %rdi
	addq	8(%r13), %rdi
	callq	_brcmu_pkt_buf_get_skb
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movl	%r15d, -44(%rbp)                ## 4-byte Spill
	movq	%rbx, %r15
	movq	%r13, %rdi
	movq	%rax, %r13
	movq	%rax, %rsi
	callq	_brcmf_sdio_txpkt_hdalign
	movl	%eax, %ebx
	movl	%eax, %edi
	shrl	$31, %edi
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movq	%r13, %rdi
	callq	_kfree_skb
	movl	%ebx, %r12d
	jmp	LBB0_13
LBB0_7:
	movl	4(%r14), %eax
	addl	%r12d, %eax
	movl	12(%r14), %ebx
	subl	8(%r14), %ebx
	addl	%eax, %ebx
	movq	%r14, %rdi
	callq	_skb_cloned
	testq	%rax, %rax
	jne	LBB0_9
## %bb.8:
	testl	%ebx, %ebx
	jle	LBB0_11
LBB0_9:
	movq	_GFP_ATOMIC@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	xorl	%r15d, %r15d
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	%ebx, %edx
	callq	_pskb_expand_head
	testq	%rax, %rax
	je	LBB0_11
## %bb.10:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	movl	%r15d, %r12d
	jmp	LBB0_13
LBB0_11:
	movq	%r14, %rdi
	callq	_skb_linearize
	testq	%rax, %rax
	je	LBB0_12
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_13
LBB0_12:
	movq	%r14, %rdi
	movl	%r12d, %esi
	callq	___skb_put
	jmp	LBB0_13
LBB0_6:
	movq	24(%r13), %rdi
	movq	24(%r14), %rsi
	movslq	(%r14), %rax
	movq	%r15, %rbx
	movslq	%ebx, %rcx
	subq	%rcx, %rsi
	addq	%rax, %rsi
	movl	%ebx, %edx
	callq	_memcpy
	movq	_ALIGN_SKB_FLAG@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%ebx, %eax
	movq	16(%r13), %rcx
	movl	%eax, (%rcx)
	movl	(%r14), %esi
	subl	%ebx, %esi
	movq	%r14, %rdi
	callq	_skb_trim
	movq	%r13, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_skb_trim
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%r14, %rsi
	movq	%r13, %rdx
	callq	___skb_queue_after
LBB0_13:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_ALIGN_SKB_FLAG,4,2             ## @ALIGN_SKB_FLAG
	.comm	_GFP_ATOMIC,4,2                 ## @GFP_ATOMIC
	.no_dead_strip	_brcmf_sdio_txpkt_prep_sg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function brcmf_sdio_txpkt_prep_sg
_brcmf_sdio_txpkt_prep_sg:              ; @brcmf_sdio_txpkt_prep_sg
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x20, x3
	mov	x19, x2
	mov	x21, x1
	mov	x23, x0
	ldr	x8, [x0, #16]
	ldr	x8, [x8]
	ldr	w24, [x8]
	ldr	w8, [x0]
	udiv	w9, w24, w8
	msub	w0, w9, w8, w24
	bl	_WARN_ON
	mov	x0, x21
	mov	x1, x19
	bl	_skb_queue_is_last
	ldr	w8, [x19]
	ldr	w9, [x23]
	udiv	w10, w8, w9
	msub	w22, w10, w9, w8
	sub	w8, w9, w22
	cmp	w22, #0
	csel	w8, wzr, w8, eq
	add	w9, w8, w20
	udiv	w10, w9, w24
	msub	w9, w10, w24, w9
	sub	w10, w24, w9
	cmp	w9, #0
	ccmp	w0, #0, #4, ne
	csel	w9, w10, wzr, ne
	add	w20, w9, w8
	mov	x0, x19
	bl	_skb_tailroom
	cmp	w0, w20
	b.ge	LBB0_5
; %bb.1:
	ldr	w8, [x19]
	cmp	w8, w24
	b.ls	LBB0_5
; %bb.2:
	add	w25, w20, w22
	ldr	x8, [x23, #8]
	add	x0, x8, w25, sxtw
	bl	_brcmu_pkt_buf_get_skb
	cbz	x0, LBB0_9
; %bb.3:
	mov	x24, x0
	mov	x0, x23
	mov	x1, x24
	bl	_brcmf_sdio_txpkt_hdalign
	mov	x23, x0
	lsr	w0, w0, #31
	bl	_unlikely
	cbz	x0, LBB0_11
; %bb.4:
	mov	x0, x24
	bl	_kfree_skb
	mov	x20, x23
	b	LBB0_12
LBB0_5:
	ldp	w8, w9, [x19, #4]
	add	w8, w8, w20
	ldr	w10, [x19, #12]
	sub	w9, w10, w9
	add	w21, w8, w9
	mov	x0, x19
	bl	_skb_cloned
	cbnz	x0, LBB0_7
; %bb.6:
	cmp	w21, #1
	b.lt	LBB0_8
LBB0_7:
Lloh0:
	adrp	x8, _GFP_ATOMIC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_ATOMIC@GOTPAGEOFF]
Lloh2:
	ldr	w3, [x8]
	mov	x0, x19
	mov	w1, #0
	mov	x2, x21
	bl	_pskb_expand_head
	cbnz	x0, LBB0_9
LBB0_8:
	mov	x0, x19
	bl	_skb_linearize
	cbz	x0, LBB0_10
LBB0_9:
Lloh3:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_12
LBB0_10:
	mov	x0, x19
	mov	x1, x20
	bl	___skb_put
	b	LBB0_12
LBB0_11:
	ldr	x0, [x24, #24]
	ldr	x8, [x19, #24]
	ldrsw	x9, [x19]
	sub	x8, x8, w22, sxtw
	add	x1, x8, x9
	mov	x2, x22
	bl	_memcpy
Lloh6:
	adrp	x8, _ALIGN_SKB_FLAG@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ALIGN_SKB_FLAG@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	add	w8, w8, w22
	ldr	x9, [x24, #16]
	str	w8, [x9]
	ldr	w8, [x19]
	sub	w1, w8, w22
	mov	x0, x19
	bl	_skb_trim
	mov	x0, x24
	mov	x1, x25
	bl	_skb_trim
	mov	x0, x21
	mov	x1, x19
	mov	x2, x24
	bl	___skb_queue_after
LBB0_12:
	mov	x0, x20
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_ALIGN_SKB_FLAG,4,2             ; @ALIGN_SKB_FLAG
	.comm	_GFP_ATOMIC,4,2                 ; @GFP_ATOMIC
	.no_dead_strip	_brcmf_sdio_txpkt_prep_sg
.subsections_via_symbols
