	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function denali_multidev_fixup
_denali_multidev_fixup:                 ## @denali_multidev_fixup
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	callq	_to_denali_controller
	movq	%rax, %r14
	movq	%rbx, %rdi
	callq	_nand_to_mtd
	movq	%rax, %r15
	leaq	32(%rbx), %rdi
	callq	_nanddev_get_memorg
	movq	%rax, %r12
	movq	_DEVICES_CONNECTED@GOTPCREL(%rip), %r13
	movq	(%r13), %rdi
	addq	16(%r14), %rdi
	callq	_ioread32
	movl	%eax, %edx
	movl	%eax, (%r14)
	testl	%eax, %eax
	jne	LBB0_2
## %bb.1:
	movl	$1, (%r14)
	movq	(%r13), %rsi
	addq	16(%r14), %rsi
	movl	$1, %edi
	callq	_iowrite32
	movl	(%r14), %edx
LBB0_2:
	xorl	%eax, %eax
	cmpl	$1, %edx
	je	LBB0_6
## %bb.3:
	cmpl	$2, %edx
	jne	LBB0_4
## %bb.5:
	shll	(%r12)
	shll	4(%r12)
	movdqu	(%r15), %xmm0
	paddd	%xmm0, %xmm0
	movdqu	%xmm0, (%r15)
	pcmpeqd	%xmm0, %xmm0
	movdqu	(%rbx), %xmm1
	psubd	%xmm0, %xmm1
	movdqu	16(%rbx), %xmm0
	movdqu	%xmm1, (%rbx)
	paddd	%xmm0, %xmm0
	movdqu	%xmm0, 16(%rbx)
	shll	4(%r14)
	jmp	LBB0_6
LBB0_4:
	movl	8(%r14), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DEVICES_CONNECTED,8,3          ## @DEVICES_CONNECTED
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unsupported number of devices %d\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_denali_multidev_fixup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function denali_multidev_fixup
_denali_multidev_fixup:                 ; @denali_multidev_fixup
	.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
	bl	_to_denali_controller
	mov	x20, x0
	mov	x0, x19
	bl	_nand_to_mtd
	mov	x21, x0
	add	x0, x19, #32
	bl	_nanddev_get_memorg
	mov	x22, x0
	ldr	x8, [x20, #16]
Lloh0:
	adrp	x23, _DEVICES_CONNECTED@GOTPAGE
Lloh1:
	ldr	x23, [x23, _DEVICES_CONNECTED@GOTPAGEOFF]
	ldr	x9, [x23]
	add	x0, x9, x8
	bl	_ioread32
	mov	x2, x0
	str	w0, [x20]
	cbz	w0, LBB0_4
; %bb.1:
	cmp	w2, #1
	b.eq	LBB0_5
LBB0_2:
	cmp	w2, #2
	b.ne	LBB0_6
; %bb.3:
	mov	w0, #0
	ldr	d0, [x22]
	shl.2s	v0, v0, #1
	str	d0, [x22]
	ldr	q0, [x21]
	shl.4s	v0, v0, #1
	movi.4s	v1, #1
	str	q0, [x21]
	ldp	q0, q2, [x19]
	add.4s	v0, v0, v1
	shl.4s	v1, v2, #1
	stp	q0, q1, [x19]
	ldr	w8, [x20, #4]
	lsl	w8, w8, #1
	str	w8, [x20, #4]
	b	LBB0_7
LBB0_4:
	mov	w8, #1
	str	w8, [x20]
	ldr	x8, [x20, #16]
	ldr	x9, [x23]
	add	x1, x9, x8
	mov	w0, #1
	bl	_iowrite32
	ldr	w2, [x20]
	cmp	w2, #1
	b.ne	LBB0_2
LBB0_5:
	mov	w0, #0
	b	LBB0_7
LBB0_6:
	ldr	w0, [x20, #8]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh4:
	adrp	x8, _EINVAL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	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
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	_DEVICES_CONNECTED,8,3          ; @DEVICES_CONNECTED
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unsupported number of devices %d\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_denali_multidev_fixup
.subsections_via_symbols
