	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cqhci_host_alloc_tdl
_cqhci_host_alloc_tdl:                  ## @cqhci_host_alloc_tdl
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	_CQHCI_TASK_DESC_SZ_128@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	$8, %ebx
	movl	$8, %eax
	testl	%ecx, (%rdi)
	je	LBB0_2
## %bb.1:
	movq	_CQHCI_CFG@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	%r15, %rdi
	callq	_cqhci_readl
	movq	_CQHCI_TASK_DESC_SZ@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	(%r14), %edx
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_cqhci_writel
	movl	$16, %eax
LBB0_2:
	movl	%eax, 4(%r15)
	cmpq	$0, 80(%r15)
	movl	$8, %ecx
	je	LBB0_4
## %bb.3:
	movq	_CQHCI_QUIRK_SHORT_TXFR_DESC_SZ@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	xorl	%edx, %edx
	testl	%ecx, 8(%r15)
	sete	%dl
	leal	12(,%rdx,4), %ebx
	movl	$16, %ecx
LBB0_4:
	movl	%ebx, 12(%r15)
	movl	%ecx, 16(%r15)
	addl	%ecx, %eax
	movl	%eax, 20(%r15)
	imull	28(%r15), %eax
	movl	%eax, 24(%r15)
	movq	72(%r15), %rdi
	imull	(%rdi), %ebx
	imull	4(%rdi), %ebx
	movl	%ebx, 32(%r15)
	callq	_mmc_hostname
	movl	24(%r15), %edx
	movl	32(%r15), %ecx
	movslq	20(%r15), %r8
	leaq	L_.str(%rip), %rdi
	xorl	%r14d, %r14d
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_pr_debug
	movq	72(%r15), %rdi
	callq	_mmc_dev
	movl	24(%r15), %esi
	leaq	48(%r15), %rdx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %ecx
	movl	%eax, %edi
	callq	_dmam_alloc_coherent
	movq	%rax, 64(%r15)
	testq	%rax, %rax
	je	LBB0_9
## %bb.5:
	movq	72(%r15), %rdi
	callq	_mmc_dev
	movl	32(%r15), %esi
	leaq	40(%r15), %rdx
	movl	(%rbx), %ecx
	movl	%eax, %edi
	callq	_dmam_alloc_coherent
	movq	%rax, 56(%r15)
	movq	72(%r15), %rdi
	testq	%rax, %rax
	je	LBB0_10
## %bb.6:
	callq	_mmc_hostname
	movl	64(%r15), %edx
	movl	56(%r15), %ecx
	movq	40(%r15), %r9
	movq	48(%r15), %r8
	leaq	L_.str.1(%rip), %rdi
	xorl	%r14d, %r14d
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_pr_debug
	cmpl	$0, 28(%r15)
	jle	LBB0_12
## %bb.7:
	xorl	%r14d, %r14d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_setup_trans_desc
	incl	%ebx
	cmpl	28(%r15), %ebx
	jl	LBB0_8
	jmp	LBB0_12
LBB0_9:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_10:
	callq	_mmc_dev
	movl	24(%r15), %esi
	movq	64(%r15), %rdx
	movq	48(%r15), %rcx
	movl	%eax, %edi
	callq	_dmam_free_coherent
	movq	$0, 64(%r15)
	movq	$0, 48(%r15)
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
LBB0_11:
	subl	(%rax), %r14d
LBB0_12:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CQHCI_TASK_DESC_SZ_128,4,2     ## @CQHCI_TASK_DESC_SZ_128
	.comm	_CQHCI_CFG,4,2                  ## @CQHCI_CFG
	.comm	_CQHCI_TASK_DESC_SZ,4,2         ## @CQHCI_TASK_DESC_SZ
	.comm	_CQHCI_QUIRK_SHORT_TXFR_DESC_SZ,4,2 ## @CQHCI_QUIRK_SHORT_TXFR_DESC_SZ
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: cqhci: desc_size: %zu data_sz: %zu slot-sz: %d\n"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.1:                               ## @.str.1
	.asciz	"%s: cqhci: desc-base: 0x%p trans-base: 0x%p\n desc_dma 0x%llx trans_dma: 0x%llx\n"

	.no_dead_strip	_cqhci_host_alloc_tdl
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cqhci_host_alloc_tdl
_cqhci_host_alloc_tdl:                  ; @cqhci_host_alloc_tdl
	.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
	mov	x19, x0
	ldr	w8, [x0]
Lloh0:
	adrp	x9, _CQHCI_TASK_DESC_SZ_128@GOTPAGE
Lloh1:
	ldr	x9, [x9, _CQHCI_TASK_DESC_SZ_128@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.1:
Lloh3:
	adrp	x20, _CQHCI_CFG@GOTPAGE
Lloh4:
	ldr	x20, [x20, _CQHCI_CFG@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	x0, x19
	bl	_cqhci_readl
Lloh5:
	adrp	x8, _CQHCI_TASK_DESC_SZ@GOTPAGE
Lloh6:
	ldr	x8, [x8, _CQHCI_TASK_DESC_SZ@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	orr	w1, w8, w0
	ldr	w2, [x20]
	mov	x0, x19
	bl	_cqhci_writel
	mov	w8, #16
	b	LBB0_3
LBB0_2:
	mov	w8, #8
LBB0_3:
	str	w8, [x19, #4]
	ldr	x9, [x19, #80]
	cbz	x9, LBB0_5
; %bb.4:
Lloh8:
	adrp	x9, _CQHCI_QUIRK_SHORT_TXFR_DESC_SZ@GOTPAGE
Lloh9:
	ldr	x9, [x9, _CQHCI_QUIRK_SHORT_TXFR_DESC_SZ@GOTPAGEOFF]
	ldr	w10, [x19, #8]
Lloh10:
	ldr	w9, [x9]
	tst	w9, w10
	mov	w9, #12
	mov	w10, #16
	csel	w9, w10, w9, eq
	b	LBB0_6
LBB0_5:
	mov	w9, #8
	mov	w10, #8
LBB0_6:
	stp	w9, w10, [x19, #12]
	add	w8, w10, w8
	ldr	w10, [x19, #28]
	mul	w10, w10, w8
	stp	w8, w10, [x19, #20]
	ldr	x0, [x19, #72]
	ldp	w8, w10, [x0]
	mul	w8, w8, w9
	mul	w8, w8, w10
	str	w8, [x19, #32]
	bl	_mmc_hostname
	mov	x1, x0
	ldr	w3, [x19, #32]
	ldp	w4, w2, [x19, #20]
                                        ; kill: def $w4 killed $w4 def $x4
	sxtw	x4, w4
Lloh11:
	adrp	x0, l_.str@PAGE
Lloh12:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_debug
	ldr	x0, [x19, #72]
	bl	_mmc_dev
	ldr	w1, [x19, #24]
	add	x2, x19, #48
Lloh13:
	adrp	x20, _GFP_KERNEL@GOTPAGE
Lloh14:
	ldr	x20, [x20, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w3, [x20]
	bl	_dmam_alloc_coherent
	str	x0, [x19, #64]
	cbz	x0, LBB0_13
; %bb.7:
	ldr	x0, [x19, #72]
	bl	_mmc_dev
	ldr	w1, [x19, #32]
	add	x2, x19, #40
	ldr	w3, [x20]
	bl	_dmam_alloc_coherent
	mov	x8, x0
	str	x0, [x19, #56]
	ldr	x0, [x19, #72]
	cbz	x8, LBB0_12
; %bb.8:
	bl	_mmc_hostname
	mov	x1, x0
	ldr	w2, [x19, #64]
	ldr	w3, [x19, #56]
	ldp	x8, x4, [x19, #40]
Lloh15:
	adrp	x0, l_.str.1@PAGE
Lloh16:
	add	x0, x0, l_.str.1@PAGEOFF
	str	x8, [sp]
	bl	_pr_debug
	ldr	w8, [x19, #28]
	cmp	w8, #1
	b.lt	LBB0_11
; %bb.9:
	mov	w20, #0
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x20
	bl	_setup_trans_desc
	add	w20, w20, #1
	ldr	w8, [x19, #28]
	cmp	w20, w8
	b.lt	LBB0_10
LBB0_11:
	mov	w0, #0
	b	LBB0_14
LBB0_12:
	bl	_mmc_dev
	ldr	w1, [x19, #24]
	ldr	x2, [x19, #64]
	ldr	x3, [x19, #48]
	bl	_dmam_free_coherent
	str	xzr, [x19, #64]
	str	xzr, [x19, #48]
LBB0_13:
Lloh17:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_14:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_CQHCI_TASK_DESC_SZ_128,4,2     ; @CQHCI_TASK_DESC_SZ_128
	.comm	_CQHCI_CFG,4,2                  ; @CQHCI_CFG
	.comm	_CQHCI_TASK_DESC_SZ,4,2         ; @CQHCI_TASK_DESC_SZ
	.comm	_CQHCI_QUIRK_SHORT_TXFR_DESC_SZ,4,2 ; @CQHCI_QUIRK_SHORT_TXFR_DESC_SZ
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: cqhci: desc_size: %zu data_sz: %zu slot-sz: %d\n"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.1:                               ; @.str.1
	.asciz	"%s: cqhci: desc-base: 0x%p trans-base: 0x%p\n desc_dma 0x%llx trans_dma: 0x%llx\n"

	.no_dead_strip	_cqhci_host_alloc_tdl
.subsections_via_symbols
