	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function falcon_copy_firmware_image
_falcon_copy_firmware_image:            ## @falcon_copy_firmware_image
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	8(%rdi), %r15
	cmpl	$4, (%rsi)
	jb	LBB0_3
## %bb.1:
	movq	%rsi, %r12
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r12), %rax
	movl	(%rax,%rbx,4), %edi
	callq	_le32_to_cpu
	movl	%eax, (%r15,%rbx,4)
	incq	%rbx
	movslq	(%r12), %rax
	shrq	$2, %rax
	cmpq	%rax, %rbx
	jb	LBB0_2
LBB0_3:
	movl	(%r14), %edx
	movl	16(%r14), %edi
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %r12
	movl	(%r12), %ecx
	movq	%r15, %rsi
	callq	_dma_map_single
	movl	%eax, %ebx
	movl	16(%r14), %edi
	movl	%eax, %esi
	callq	_dma_mapping_error
	movl	16(%r14), %edi
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edx
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dev_err                        ## TAILCALL
LBB0_5:
	movl	(%r14), %edx
	movl	(%r12), %ecx
	movl	%ebx, %esi
	callq	_dma_sync_single_for_device
	movl	(%r14), %edx
	movl	16(%r14), %edi
	movl	(%r12), %ecx
	movl	%ebx, %esi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dma_unmap_single               ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_DMA_TO_DEVICE,4,2              ## @DMA_TO_DEVICE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to map firmware: %d\n"

	.no_dead_strip	_falcon_copy_firmware_image
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function falcon_copy_firmware_image
_falcon_copy_firmware_image:            ; @falcon_copy_firmware_image
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x0
	ldr	x20, [x0, #8]
	ldr	w8, [x1]
	cmp	w8, #4
	b.lo	LBB0_3
; %bb.1:
	mov	x21, x1
	mov	x22, #0
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x21, #8]
	lsl	x23, x22, #2
	ldr	w0, [x8, x23]
	bl	_le32_to_cpu
	str	w0, [x20, x23]
	add	x22, x22, #1
	ldrsw	x8, [x21]
	cmp	x22, x8, lsr #2
	b.lo	LBB0_2
LBB0_3:
	ldr	w0, [x19, #16]
	ldr	w2, [x19]
Lloh0:
	adrp	x21, _DMA_TO_DEVICE@GOTPAGE
Lloh1:
	ldr	x21, [x21, _DMA_TO_DEVICE@GOTPAGEOFF]
	ldr	w3, [x21]
	mov	x1, x20
	bl	_dma_map_single
	mov	x20, x0
	ldr	w0, [x19, #16]
	mov	x1, x20
	bl	_dma_mapping_error
	mov	x2, x0
	ldr	w0, [x19, #16]
	cbz	w2, LBB0_5
; %bb.4:
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_dev_err
LBB0_5:
	ldr	w2, [x19]
	ldr	w3, [x21]
	mov	x1, x20
	bl	_dma_sync_single_for_device
	ldr	w0, [x19, #16]
	ldr	w2, [x19]
	ldr	w3, [x21]
	mov	x1, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_dma_unmap_single
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	_DMA_TO_DEVICE,4,2              ; @DMA_TO_DEVICE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to map firmware: %d\n"

	.no_dead_strip	_falcon_copy_firmware_image
.subsections_via_symbols
