	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function finalize_request
_finalize_request:                      ## @finalize_request
	.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), %rax
	movq	_COMPLETION_FINALIZE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_24
## %bb.1:
	movq	%rdi, %rbx
	movq	24(%rdi), %r14
	testq	%r14, %r14
	je	LBB0_24
## %bb.2:
	xorl	%eax, %eax
	cmpl	$0, 8(%rbx)
	setne	%al
	movq	8(%r14,%rax,8), %r15
	movq	8(%r15), %rax
	testq	%rax, %rax
	je	LBB0_7
## %bb.3:
	cmpq	$0, (%r15)
	jne	LBB0_7
## %bb.4:
	cmpq	$0, (%rax)
	je	LBB0_5
LBB0_7:
	movq	_S3C2410_SDIRSP0@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	32(%rbx), %rdi
	callq	_readl
	movq	16(%r15), %rcx
	movq	%rax, (%rcx)
	movq	_S3C2410_SDIRSP1@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	32(%rbx), %rdi
	callq	_readl
	movq	16(%r15), %rcx
	movq	%rax, 8(%rcx)
	movq	_S3C2410_SDIRSP2@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	32(%rbx), %rdi
	callq	_readl
	movq	16(%r15), %rcx
	movq	%rax, 16(%rcx)
	movq	_S3C2410_SDIRSP3@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	32(%rbx), %rdi
	callq	_readl
	movq	16(%r15), %rcx
	movq	%rax, 24(%rcx)
	movl	12(%rbx), %edi
	movq	_S3C2410_SDIPRE@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	32(%rbx), %rsi
	callq	_writel
	xorl	%edx, %edx
	cmpq	$0, (%r15)
	setne	%dl
	movq	8(%r15), %rax
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	cmpq	$0, (%rax)
	movl	$1, %eax
	cmovnel	%eax, %edx
LBB0_9:
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_dbg_dumpcmd
	movq	_S3C2410_SDICMDARG@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	32(%rbx), %rsi
	xorl	%edi, %edi
	callq	_writel
	movq	_S3C2410_SDIDCON_STOP@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_S3C2410_SDIDCON@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	32(%rbx), %rsi
	callq	_writel
	movq	_S3C2410_SDICMDCON@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	32(%rbx), %rsi
	xorl	%edi, %edi
	callq	_writel
	movq	%rbx, %rdi
	callq	_clear_imask
	movq	8(%r15), %rax
	testq	%rax, %rax
	je	LBB0_14
## %bb.10:
	movq	(%r15), %rcx
	testq	%rcx, %rcx
	je	LBB0_12
## %bb.11:
	movq	%rcx, (%rax)
LBB0_12:
	cmpq	$0, 8(%rax)
	je	LBB0_14
## %bb.13:
	cmpl	$0, 8(%rbx)
	je	LBB0_26
LBB0_14:
	movq	(%r14), %rax
	testq	%rax, %rax
	je	LBB0_23
## %bb.15:
	cmpq	$0, (%rax)
	je	LBB0_16
## %bb.17:
	movl	$0, 8(%rax)
	movq	%rbx, %rdi
	callq	_s3cmci_host_usedma
	testq	%rax, %rax
	je	LBB0_19
## %bb.18:
	movl	48(%rbx), %edi
	callq	_dmaengine_terminate_all
LBB0_19:
	cmpq	$0, 40(%rbx)
	je	LBB0_21
## %bb.20:
	movq	_S3C2440_SDIFSTA_FIFORESET@GOTPCREL(%rip), %rax
	movq	_S3C2440_SDIFSTA_FIFOFAIL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	orl	(%rax), %edi
	movq	_S3C2410_SDIFSTA@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	32(%rbx), %rsi
	jmp	LBB0_22
LBB0_24:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	movl	16(%rax), %ecx
	imull	12(%rax), %ecx
	movl	%ecx, 8(%rax)
	jmp	LBB0_23
LBB0_26:
	movl	$1, 8(%rbx)
	movl	16(%rbx), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_s3cmci_send_request            ## TAILCALL
LBB0_21:
	movq	_S3C2410_SDICON@GOTPCREL(%rip), %r15
	movq	(%r15), %rdi
	addq	32(%rbx), %rdi
	callq	_readl
	movq	_S3C2410_SDICON_FIFORESET@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	(%r15), %rsi
	addq	32(%rbx), %rsi
	movl	%eax, %edi
LBB0_22:
	callq	_writel
LBB0_23:
	movq	_COMPLETION_NONE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%rbx)
	movq	$0, 24(%rbx)
	movq	%rbx, %rdi
	callq	_s3cmci_check_sdio_irq
	movl	16(%rbx), %edi
	movq	%r14, %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mmc_request_done               ## TAILCALL
LBB0_5:
	movq	%rbx, %rdi
	callq	_s3cmci_host_usedma
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	cmpl	$0, 52(%rbx)
	jne	LBB0_7
## %bb.25:
	movq	_dbg_dma@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%ecx, %ecx
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dbg                            ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_COMPLETION_FINALIZE,8,3        ## @COMPLETION_FINALIZE
	.comm	_dbg_dma,4,2                    ## @dbg_dma
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"DMA Missing (%d)!\n"

	.comm	_S3C2410_SDIRSP0,8,3            ## @S3C2410_SDIRSP0
	.comm	_S3C2410_SDIRSP1,8,3            ## @S3C2410_SDIRSP1
	.comm	_S3C2410_SDIRSP2,8,3            ## @S3C2410_SDIRSP2
	.comm	_S3C2410_SDIRSP3,8,3            ## @S3C2410_SDIRSP3
	.comm	_S3C2410_SDIPRE,8,3             ## @S3C2410_SDIPRE
	.comm	_S3C2410_SDICMDARG,8,3          ## @S3C2410_SDICMDARG
	.comm	_S3C2410_SDIDCON_STOP,4,2       ## @S3C2410_SDIDCON_STOP
	.comm	_S3C2410_SDIDCON,8,3            ## @S3C2410_SDIDCON
	.comm	_S3C2410_SDICMDCON,8,3          ## @S3C2410_SDICMDCON
	.comm	_S3C2440_SDIFSTA_FIFORESET,4,2  ## @S3C2440_SDIFSTA_FIFORESET
	.comm	_S3C2440_SDIFSTA_FIFOFAIL,4,2   ## @S3C2440_SDIFSTA_FIFOFAIL
	.comm	_S3C2410_SDIFSTA,8,3            ## @S3C2410_SDIFSTA
	.comm	_S3C2410_SDICON,8,3             ## @S3C2410_SDICON
	.comm	_S3C2410_SDICON_FIFORESET,4,2   ## @S3C2410_SDICON_FIFORESET
	.comm	_COMPLETION_NONE,8,3            ## @COMPLETION_NONE
	.no_dead_strip	_finalize_request
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function finalize_request
_finalize_request:                      ; @finalize_request
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	ldr	x20, [x0, #24]
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _COMPLETION_FINALIZE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _COMPLETION_FINALIZE@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	ccmp	x20, #0, #4, eq
	b.ne	LBB0_2
; %bb.1:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_2:
	mov	x19, x0
	ldr	w8, [x0, #8]
	cmp	w8, #0
	mov	w8, #16
	mov	w9, #8
	csel	x8, x9, x8, eq
	ldr	x21, [x20, x8]
	ldr	x8, [x21, #8]
	cbz	x8, LBB0_5
; %bb.3:
	ldr	x9, [x21]
	cbnz	x9, LBB0_5
; %bb.4:
	ldr	x8, [x8]
	cbz	x8, LBB0_23
LBB0_5:
	ldr	x8, [x19, #32]
Lloh3:
	adrp	x9, _S3C2410_SDIRSP0@GOTPAGE
Lloh4:
	ldr	x9, [x9, _S3C2410_SDIRSP0@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readl
	ldr	x8, [x21, #16]
	str	x0, [x8]
	ldr	x8, [x19, #32]
Lloh6:
	adrp	x9, _S3C2410_SDIRSP1@GOTPAGE
Lloh7:
	ldr	x9, [x9, _S3C2410_SDIRSP1@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readl
	ldr	x8, [x21, #16]
	str	x0, [x8, #8]
	ldr	x8, [x19, #32]
Lloh9:
	adrp	x9, _S3C2410_SDIRSP2@GOTPAGE
Lloh10:
	ldr	x9, [x9, _S3C2410_SDIRSP2@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readl
	ldr	x8, [x21, #16]
	str	x0, [x8, #16]
	ldr	x8, [x19, #32]
Lloh12:
	adrp	x9, _S3C2410_SDIRSP3@GOTPAGE
Lloh13:
	ldr	x9, [x9, _S3C2410_SDIRSP3@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readl
	ldr	x8, [x21, #16]
	str	x0, [x8, #24]
	ldr	w0, [x19, #12]
	ldr	x8, [x19, #32]
Lloh15:
	adrp	x9, _S3C2410_SDIPRE@GOTPAGE
Lloh16:
	ldr	x9, [x9, _S3C2410_SDIPRE@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
	ldp	x9, x8, [x21]
	cmp	x9, #0
	cset	w2, ne
	cbz	x8, LBB0_7
; %bb.6:
	ldr	x8, [x8]
	cmp	x8, #0
	csinc	w2, w2, wzr, eq
LBB0_7:
	mov	x0, x19
	mov	x1, x21
	bl	_dbg_dumpcmd
	ldr	x8, [x19, #32]
Lloh18:
	adrp	x9, _S3C2410_SDICMDARG@GOTPAGE
Lloh19:
	ldr	x9, [x9, _S3C2410_SDICMDARG@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	w0, #0
	bl	_writel
Lloh21:
	adrp	x8, _S3C2410_SDIDCON_STOP@GOTPAGE
Lloh22:
	ldr	x8, [x8, _S3C2410_SDIDCON_STOP@GOTPAGEOFF]
Lloh23:
	ldr	w0, [x8]
	ldr	x8, [x19, #32]
Lloh24:
	adrp	x9, _S3C2410_SDIDCON@GOTPAGE
Lloh25:
	ldr	x9, [x9, _S3C2410_SDIDCON@GOTPAGEOFF]
Lloh26:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
	ldr	x8, [x19, #32]
Lloh27:
	adrp	x9, _S3C2410_SDICMDCON@GOTPAGE
Lloh28:
	ldr	x9, [x9, _S3C2410_SDICMDCON@GOTPAGEOFF]
Lloh29:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	w0, #0
	bl	_writel
	mov	x0, x19
	bl	_clear_imask
	ldr	x8, [x21, #8]
	cbz	x8, LBB0_12
; %bb.8:
	ldr	x9, [x21]
	cbz	x9, LBB0_10
; %bb.9:
	str	x9, [x8]
LBB0_10:
	ldr	x8, [x8, #8]
	cbz	x8, LBB0_12
; %bb.11:
	ldr	w8, [x19, #8]
	cbz	w8, LBB0_19
LBB0_12:
	ldr	x8, [x20]
	cbz	x8, LBB0_22
; %bb.13:
	ldr	x9, [x8]
	cbz	x9, LBB0_18
; %bb.14:
	str	wzr, [x8, #8]
	mov	x0, x19
	bl	_s3cmci_host_usedma
	cbz	x0, LBB0_16
; %bb.15:
	ldr	w0, [x19, #48]
	bl	_dmaengine_terminate_all
LBB0_16:
	ldr	x8, [x19, #40]
	cbz	x8, LBB0_20
; %bb.17:
Lloh30:
	adrp	x8, _S3C2440_SDIFSTA_FIFORESET@GOTPAGE
Lloh31:
	ldr	x8, [x8, _S3C2440_SDIFSTA_FIFORESET@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
Lloh33:
	adrp	x9, _S3C2440_SDIFSTA_FIFOFAIL@GOTPAGE
Lloh34:
	ldr	x9, [x9, _S3C2440_SDIFSTA_FIFOFAIL@GOTPAGEOFF]
Lloh35:
	ldr	w9, [x9]
	orr	w0, w9, w8
	ldr	x8, [x19, #32]
Lloh36:
	adrp	x9, _S3C2410_SDIFSTA@GOTPAGE
Lloh37:
	ldr	x9, [x9, _S3C2410_SDIFSTA@GOTPAGEOFF]
Lloh38:
	ldr	x9, [x9]
	b	LBB0_21
LBB0_18:
	ldp	w9, w10, [x8, #12]
	mul	w9, w10, w9
	str	w9, [x8, #8]
	b	LBB0_22
LBB0_19:
	mov	w8, #1
	str	w8, [x19, #8]
	ldr	w0, [x19, #16]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_s3cmci_send_request
LBB0_20:
	ldr	x8, [x19, #32]
Lloh39:
	adrp	x21, _S3C2410_SDICON@GOTPAGE
Lloh40:
	ldr	x21, [x21, _S3C2410_SDICON@GOTPAGEOFF]
	ldr	x9, [x21]
	add	x0, x9, x8
	bl	_readl
Lloh41:
	adrp	x8, _S3C2410_SDICON_FIFORESET@GOTPAGE
Lloh42:
	ldr	x8, [x8, _S3C2410_SDICON_FIFORESET@GOTPAGEOFF]
Lloh43:
	ldr	w8, [x8]
	orr	w0, w8, w0
	ldr	x8, [x19, #32]
	ldr	x9, [x21]
LBB0_21:
	add	x1, x9, x8
	bl	_writel
LBB0_22:
Lloh44:
	adrp	x8, _COMPLETION_NONE@GOTPAGE
Lloh45:
	ldr	x8, [x8, _COMPLETION_NONE@GOTPAGEOFF]
Lloh46:
	ldr	x8, [x8]
	str	x8, [x19]
	str	xzr, [x19, #24]
	mov	x0, x19
	bl	_s3cmci_check_sdio_irq
	ldr	w0, [x19, #16]
	mov	x1, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_mmc_request_done
LBB0_23:
	mov	x0, x19
	bl	_s3cmci_host_usedma
	cbz	x0, LBB0_5
; %bb.24:
	ldr	w8, [x19, #52]
	cbnz	w8, LBB0_5
; %bb.25:
Lloh47:
	adrp	x8, _dbg_dma@GOTPAGE
Lloh48:
	ldr	x8, [x8, _dbg_dma@GOTPAGEOFF]
Lloh49:
	ldr	w1, [x8]
Lloh50:
	adrp	x2, l_.str@PAGE
Lloh51:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	mov	w3, #0
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_dbg
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGot	Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpAdd	Lloh50, Lloh51
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.cfi_endproc
                                        ; -- End function
	.comm	_COMPLETION_FINALIZE,8,3        ; @COMPLETION_FINALIZE
	.comm	_dbg_dma,4,2                    ; @dbg_dma
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"DMA Missing (%d)!\n"

	.comm	_S3C2410_SDIRSP0,8,3            ; @S3C2410_SDIRSP0
	.comm	_S3C2410_SDIRSP1,8,3            ; @S3C2410_SDIRSP1
	.comm	_S3C2410_SDIRSP2,8,3            ; @S3C2410_SDIRSP2
	.comm	_S3C2410_SDIRSP3,8,3            ; @S3C2410_SDIRSP3
	.comm	_S3C2410_SDIPRE,8,3             ; @S3C2410_SDIPRE
	.comm	_S3C2410_SDICMDARG,8,3          ; @S3C2410_SDICMDARG
	.comm	_S3C2410_SDIDCON_STOP,4,2       ; @S3C2410_SDIDCON_STOP
	.comm	_S3C2410_SDIDCON,8,3            ; @S3C2410_SDIDCON
	.comm	_S3C2410_SDICMDCON,8,3          ; @S3C2410_SDICMDCON
	.comm	_S3C2440_SDIFSTA_FIFORESET,4,2  ; @S3C2440_SDIFSTA_FIFORESET
	.comm	_S3C2440_SDIFSTA_FIFOFAIL,4,2   ; @S3C2440_SDIFSTA_FIFOFAIL
	.comm	_S3C2410_SDIFSTA,8,3            ; @S3C2410_SDIFSTA
	.comm	_S3C2410_SDICON,8,3             ; @S3C2410_SDICON
	.comm	_S3C2410_SDICON_FIFORESET,4,2   ; @S3C2410_SDICON_FIFORESET
	.comm	_COMPLETION_NONE,8,3            ; @COMPLETION_NONE
	.no_dead_strip	_finalize_request
.subsections_via_symbols
