	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function iddma_download_firmware
_iddma_download_firmware:               ## @iddma_download_firmware
	.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	%r8d, -44(%rbp)                 ## 4-byte Spill
	movl	%ecx, %ebx
	movl	%edx, -52(%rbp)                 ## 4-byte Spill
	movl	%esi, -48(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r13
	movq	_BIT_DDMACH0_CHKSUM_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	_BIT_DDMACH0_OWN@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	_REG_DDMA_CH0CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%r14d, %r14d
	movl	%r12d, %edx
	xorl	%ecx, %ecx
	callq	_check_hw_ready
	testl	%eax, %eax
	je	LBB0_4
## %bb.1:
	movq	_BIT_MASK_DDMACH0_DLEN@GOTPCREL(%rip), %rax
	andl	(%rax), %ebx
	orl	%r15d, %r12d
	orl	%r12d, %ebx
	movl	$0, %eax
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_3
## %bb.2:
	movq	_BIT_DDMACH0_CHKSUM_CONT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_3:
	orl	%eax, %ebx
	movq	%r13, %rdi
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	movl	-52(%rbp), %edx                 ## 4-byte Reload
	movl	%ebx, %ecx
	callq	_iddma_enable
	testq	%rax, %rax
	je	LBB0_5
LBB0_4:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_5:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BIT_DDMACH0_CHKSUM_EN,4,2      ## @BIT_DDMACH0_CHKSUM_EN
	.comm	_BIT_DDMACH0_OWN,4,2            ## @BIT_DDMACH0_OWN
	.comm	_REG_DDMA_CH0CTRL,4,2           ## @REG_DDMA_CH0CTRL
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_BIT_MASK_DDMACH0_DLEN,4,2      ## @BIT_MASK_DDMACH0_DLEN
	.comm	_BIT_DDMACH0_CHKSUM_CONT,4,2    ## @BIT_DDMACH0_CHKSUM_CONT
	.no_dead_strip	_iddma_download_firmware
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function iddma_download_firmware
_iddma_download_firmware:               ; @iddma_download_firmware
	.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	x22, x4
	mov	x23, x3
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x8, _BIT_DDMACH0_CHKSUM_EN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BIT_DDMACH0_CHKSUM_EN@GOTPAGEOFF]
Lloh2:
	ldr	w25, [x8]
Lloh3:
	adrp	x8, _BIT_DDMACH0_OWN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BIT_DDMACH0_OWN@GOTPAGEOFF]
Lloh5:
	ldr	w24, [x8]
Lloh6:
	adrp	x8, _REG_DDMA_CH0CTRL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _REG_DDMA_CH0CTRL@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x2, x24
	mov	w3, #0
	bl	_check_hw_ready
	cbz	w0, LBB0_2
; %bb.1:
	orr	w8, w24, w25
Lloh9:
	adrp	x9, _BIT_MASK_DDMACH0_DLEN@GOTPAGE
Lloh10:
	ldr	x9, [x9, _BIT_MASK_DDMACH0_DLEN@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	and	w9, w9, w23
	orr	w8, w8, w9
Lloh12:
	adrp	x9, _BIT_DDMACH0_CHKSUM_CONT@GOTPAGE
Lloh13:
	ldr	x9, [x9, _BIT_DDMACH0_CHKSUM_CONT@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	cmp	w22, #0
	csel	w9, w9, wzr, eq
	orr	w3, w8, w9
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	bl	_iddma_enable
	cbz	x0, LBB0_3
LBB0_2:
Lloh15:
	adrp	x8, _EBUSY@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_3:
	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	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_BIT_DDMACH0_CHKSUM_EN,4,2      ; @BIT_DDMACH0_CHKSUM_EN
	.comm	_BIT_DDMACH0_OWN,4,2            ; @BIT_DDMACH0_OWN
	.comm	_REG_DDMA_CH0CTRL,4,2           ; @REG_DDMA_CH0CTRL
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_BIT_MASK_DDMACH0_DLEN,4,2      ; @BIT_MASK_DDMACH0_DLEN
	.comm	_BIT_DDMACH0_CHKSUM_CONT,4,2    ; @BIT_DDMACH0_CHKSUM_CONT
	.no_dead_strip	_iddma_download_firmware
.subsections_via_symbols
