	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function coda_copy_firmware
_coda_copy_firmware:                    ## @coda_copy_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %rbx
	movq	%rdi, %r15
	cmpb	$77, (%rsi)
	jne	LBB0_2
## %bb.1:
	xorl	%eax, %eax
	cmpb	$88, 1(%rbx)
	sete	%al
	shlq	$4, %rax
	addq	%rax, %rbx
LBB0_2:
	movq	%rbx, %rdi
	callq	___le16_to_cpup
	movq	(%r15), %rdi
	cmpl	$58382, %eax                    ## imm = 0xE40E
	jne	LBB0_29
## %bb.3:
	movq	8(%r15), %rax
	movq	(%rax), %rax
	movq	_CODA_DX6@GOTPCREL(%rip), %rcx
	leaq	-16(%r14), %rdx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.14:
	cmpq	$4, %rdx
	jb	LBB0_28
## %bb.15:
	movq	%rdx, %rax
	shrq	$2, %rax
	xorl	%ecx, %ecx
	cmpq	$32, %rdx
	jb	LBB0_24
## %bb.16:
	movq	%rdi, %rdx
	subq	%rbx, %rdx
	cmpq	$32, %rdx
	jb	LBB0_24
## %bb.17:
	movq	%rax, %rcx
	andq	$-8, %rcx
	leaq	-8(%rcx), %rdx
	movq	%rdx, %r8
	shrq	$3, %r8
	incq	%r8
	testq	%rdx, %rdx
	je	LBB0_18
## %bb.19:
	movabsq	$4611686018427387896, %rsi      ## imm = 0x3FFFFFFFFFFFFFF8
	addq	$6, %rsi
	andq	%r8, %rsi
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_20:                                ## =>This Inner Loop Header: Depth=1
	movdqu	(%rbx,%rdx,4), %xmm0
	movdqu	16(%rbx,%rdx,4), %xmm1
	movdqa	%xmm0, %xmm2
	pslld	$16, %xmm2
	movdqa	%xmm1, %xmm3
	pslld	$16, %xmm3
	psrad	$16, %xmm0
	por	%xmm2, %xmm0
	psrad	$16, %xmm1
	por	%xmm3, %xmm1
	movdqu	%xmm0, (%rdi,%rdx,4)
	movdqu	%xmm1, 16(%rdi,%rdx,4)
	movdqu	32(%rbx,%rdx,4), %xmm0
	movdqu	48(%rbx,%rdx,4), %xmm1
	movdqa	%xmm0, %xmm2
	pslld	$16, %xmm2
	movdqa	%xmm1, %xmm3
	pslld	$16, %xmm3
	psrad	$16, %xmm0
	por	%xmm2, %xmm0
	psrad	$16, %xmm1
	por	%xmm3, %xmm1
	movdqu	%xmm0, 32(%rdi,%rdx,4)
	movdqu	%xmm1, 48(%rdi,%rdx,4)
	addq	$16, %rdx
	addq	$-2, %rsi
	jne	LBB0_20
## %bb.21:
	testb	$1, %r8b
	je	LBB0_23
LBB0_22:
	movdqu	(%rbx,%rdx,4), %xmm0
	movdqu	16(%rbx,%rdx,4), %xmm1
	movdqa	%xmm0, %xmm2
	pslld	$16, %xmm2
	movdqa	%xmm1, %xmm3
	pslld	$16, %xmm3
	psrad	$16, %xmm0
	por	%xmm2, %xmm0
	psrad	$16, %xmm1
	por	%xmm3, %xmm1
	movdqu	%xmm0, (%rdi,%rdx,4)
	movdqu	%xmm1, 16(%rdi,%rdx,4)
LBB0_23:
	cmpq	%rcx, %rax
	je	LBB0_28
LBB0_24:
	movq	%rcx, %rdx
	orq	$1, %rdx
	testb	$4, %r14b
	je	LBB0_26
## %bb.25:
	movl	(%rbx,%rcx,4), %esi
	movl	%esi, %r8d
	shll	$16, %r8d
	sarl	$16, %esi
	orl	%r8d, %esi
	movl	%esi, (%rdi,%rcx,4)
	movq	%rdx, %rcx
LBB0_26:
	cmpq	%rdx, %rax
	je	LBB0_28
	.p2align	4, 0x90
LBB0_27:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rbx,%rcx,4), %edx
	movl	%edx, %esi
	shll	$16, %esi
	sarl	$16, %edx
	orl	%esi, %edx
	movl	%edx, (%rdi,%rcx,4)
	movl	4(%rbx,%rcx,4), %edx
	movl	%edx, %esi
	shll	$16, %esi
	sarl	$16, %edx
	orl	%esi, %edx
	movl	%edx, 4(%rdi,%rcx,4)
	addq	$2, %rcx
	cmpq	%rcx, %rax
	jne	LBB0_27
	jmp	LBB0_28
LBB0_29:
	movq	%rbx, %rsi
	movq	%r14, %rdx
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_memcpy                         ## TAILCALL
LBB0_4:
	cmpq	$4, %rdx
	jb	LBB0_28
## %bb.5:
	shrq	$2, %rdx
	cmpq	$3, %rdx
	movl	$2, %eax
	movl	$2, %r8d
	cmovaeq	%rdx, %r8
	decq	%r8
	cmpq	$2, %r8
	jae	LBB0_7
## %bb.6:
	xorl	%eax, %eax
	jmp	LBB0_13
LBB0_7:
	cmpq	$3, %rdx
	cmovaeq	%rdx, %rax
	leaq	4(,%rax,4), %rcx
	andq	$-8, %rcx
	addq	%rbx, %rcx
	cmpq	%rdi, %rcx
	jbe	LBB0_10
## %bb.8:
	incq	%rax
	andq	$-2, %rax
	leaq	(%rdi,%rax,4), %rax
	cmpq	%rax, %rbx
	jae	LBB0_10
## %bb.9:
	xorl	%eax, %eax
	jmp	LBB0_13
LBB0_10:
	shrq	%r8
	incq	%r8
	movabsq	$9223372036854775806, %rsi      ## imm = 0x7FFFFFFFFFFFFFFE
	andq	%r8, %rsi
	leaq	(%rsi,%rsi), %rax
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movdqu	(%rbx,%rcx,8), %xmm0
	pshufd	$232, %xmm0, %xmm1              ## xmm1 = xmm0[0,2,2,3]
	pshufd	$237, %xmm0, %xmm0              ## xmm0 = xmm0[1,3,2,3]
	movdqa	%xmm0, %xmm2
	pslld	$16, %xmm2
	psrad	$16, %xmm0
	por	%xmm2, %xmm0
	movdqa	%xmm1, %xmm2
	pslld	$16, %xmm2
	psrad	$16, %xmm1
	por	%xmm2, %xmm1
	punpckldq	%xmm1, %xmm0            ## xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
	movdqu	%xmm0, (%rdi,%rcx,8)
	addq	$2, %rcx
	cmpq	%rcx, %rsi
	jne	LBB0_11
## %bb.12:
	cmpq	%rsi, %r8
	je	LBB0_28
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movl	4(%rbx,%rax,4), %ecx
	movl	%ecx, %esi
	shll	$16, %esi
	sarl	$16, %ecx
	orl	%esi, %ecx
	movl	%ecx, (%rdi,%rax,4)
	movl	(%rbx,%rax,4), %ecx
	movl	%ecx, %esi
	shll	$16, %esi
	sarl	$16, %ecx
	orl	%esi, %ecx
	movl	%ecx, 4(%rdi,%rax,4)
	addq	$2, %rax
	cmpq	%rax, %rdx
	ja	LBB0_13
LBB0_28:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_18:
	xorl	%edx, %edx
	testb	$1, %r8b
	jne	LBB0_22
	jmp	LBB0_23
	.cfi_endproc
                                        ## -- End function
	.comm	_CODA_DX6,8,3                   ## @CODA_DX6
	.no_dead_strip	_coda_copy_firmware
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function coda_copy_firmware
_coda_copy_firmware:                    ; @coda_copy_firmware
	.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
	mov	x20, x2
	mov	x19, x1
	mov	x21, x0
	ldrb	w8, [x1]
	cmp	w8, #77
	b.ne	LBB0_2
; %bb.1:
	ldrb	w8, [x19, #1]
	cmp	w8, #88
	cset	w8, eq
	add	x19, x19, w8, uxtw #4
LBB0_2:
	mov	x0, x19
	bl	___le16_to_cpup
	mov	x8, x0
	ldr	x0, [x21]
	mov	w9, #58382
	cmp	w8, w9
	b.ne	LBB0_12
; %bb.3:
	ldr	x8, [x21, #8]
	ldr	x8, [x8]
Lloh0:
	adrp	x9, _CODA_DX6@GOTPAGE
Lloh1:
	ldr	x9, [x9, _CODA_DX6@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	sub	x10, x20, #16
	cmp	x8, x9
	b.ne	LBB0_13
; %bb.4:
	cmp	x10, #4
	b.lo	LBB0_20
; %bb.5:
	mov	x9, #0
	lsr	x8, x10, #2
	cmp	x10, #64
	b.lo	LBB0_10
; %bb.6:
	sub	x10, x0, x19
	cmp	x10, #64
	b.lo	LBB0_10
; %bb.7:
	and	x9, x8, #0x3ffffffffffffff0
	add	x10, x0, #32
	add	x11, x19, #32
	mov	x12, x9
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldp	q0, q1, [x11, #-32]
	ldp	q2, q3, [x11], #64
	shl.4s	v4, v0, #16
	shl.4s	v5, v1, #16
	shl.4s	v6, v2, #16
	shl.4s	v7, v3, #16
	sshr.4s	v0, v0, #16
	sshr.4s	v1, v1, #16
	sshr.4s	v2, v2, #16
	sshr.4s	v3, v3, #16
	orr.16b	v0, v4, v0
	orr.16b	v1, v5, v1
	orr.16b	v2, v6, v2
	stp	q0, q1, [x10, #-32]
	orr.16b	v0, v7, v3
	stp	q2, q0, [x10], #64
	subs	x12, x12, #16
	b.ne	LBB0_8
; %bb.9:
	cmp	x8, x9
	b.eq	LBB0_20
LBB0_10:
	lsl	x11, x9, #2
	add	x10, x0, x11
	add	x11, x19, x11
	sub	x8, x8, x9
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	w9, [x11], #4
	lsl	w12, w9, #16
	orr	w9, w12, w9, asr #16
	str	w9, [x10], #4
	subs	x8, x8, #1
	b.ne	LBB0_11
	b	LBB0_20
LBB0_12:
	mov	x1, x19
	mov	x2, 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	_memcpy
LBB0_13:
	cmp	x10, #4
	b.lo	LBB0_20
; %bb.14:
	lsr	x8, x10, #2
	mov	w9, #2
	cmp	x8, #2
	csel	x9, x8, x9, hi
	sub	x9, x9, #1
	cmp	x9, #14
	b.lo	LBB0_17
; %bb.15:
	mov	w10, #2
	cmp	x8, #2
	csel	x10, x8, x10, hi
	lsl	x11, x10, #2
	add	x11, x11, #4
	and	x11, x11, #0xfffffffffffffff8
	add	x11, x19, x11
	cmp	x11, x0
	b.ls	LBB0_21
; %bb.16:
	add	x10, x10, #1
	and	x10, x10, #0x3ffffffffffffffe
	add	x10, x0, x10, lsl #2
	cmp	x19, x10
	b.hs	LBB0_21
LBB0_17:
	mov	x9, #0
LBB0_18:
	lsl	x10, x9, #2
	add	x11, x10, #4
	add	x10, x19, x11
	add	x11, x0, x11
LBB0_19:                                ; =>This Inner Loop Header: Depth=1
	ldr	w12, [x10]
	lsl	w13, w12, #16
	orr	w12, w13, w12, asr #16
	stur	w12, [x11, #-4]
	ldur	w12, [x10, #-4]
	lsl	w13, w12, #16
	orr	w12, w13, w12, asr #16
	str	w12, [x11], #8
	add	x9, x9, #2
	add	x10, x10, #8
	cmp	x8, x9
	b.hi	LBB0_19
LBB0_20:
	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_21:
	lsr	x9, x9, #1
	add	x10, x9, #1
	and	x11, x10, #0x7ffffffffffffff8
	lsl	x9, x11, #1
	add	x12, x0, #32
	add	x13, x19, #32
	mov	x14, x11
LBB0_22:                                ; =>This Inner Loop Header: Depth=1
	sub	x15, x13, #32
	ld2.4s	{ v0, v1 }, [x15]
	ld2.4s	{ v2, v3 }, [x13]
	shl.4s	v4, v1, #16
	shl.4s	v5, v3, #16
	sshr.4s	v6, v1, #16
	sshr.4s	v7, v3, #16
	orr.16b	v16, v4, v6
	shl.4s	v4, v0, #16
	sshr.4s	v0, v0, #16
	orr.16b	v17, v4, v0
	orr.16b	v0, v5, v7
	shl.4s	v4, v2, #16
	sub	x15, x12, #32
	st2.4s	{ v16, v17 }, [x15]
	sshr.4s	v2, v2, #16
	orr.16b	v1, v4, v2
	st2.4s	{ v0, v1 }, [x12]
	add	x12, x12, #64
	add	x13, x13, #64
	subs	x14, x14, #8
	b.ne	LBB0_22
; %bb.23:
	cmp	x10, x11
	b.eq	LBB0_20
	b	LBB0_18
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_CODA_DX6,8,3                   ; @CODA_DX6
	.no_dead_strip	_coda_copy_firmware
.subsections_via_symbols
