	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rs_prepare_reshape
_rs_prepare_reshape:                    ## @rs_prepare_reshape
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	callq	_rs_is_raid10
	testq	%rax, %rax
	je	LBB0_8
## %bb.1:
	movq	(%rbx), %rax
	cmpq	32(%rbx), %rax
	je	LBB0_9
## %bb.2:
	movl	44(%rbx), %edi
	callq	___is_raid10_near
	testq	%rax, %rax
	je	LBB0_9
## %bb.3:
	movq	8(%rbx), %r14
	testq	%r14, %r14
	je	LBB0_9
## %bb.4:
	movl	44(%rbx), %edi
	callq	___raid10_near_copies
	cmpq	%rax, %r14
	je	LBB0_9
## %bb.5:
	movq	(%rbx), %rax
	movq	8(%rbx), %rcx
	movq	%rax, %rdx
	orq	%rcx, %rdx
	shrq	$32, %rdx
	je	LBB0_18
## %bb.6:
	cqto
	idivq	%rcx
	testq	%rdx, %rdx
	je	LBB0_19
LBB0_7:
	movq	24(%rbx), %rax
	leaq	L_.str(%rip), %rcx
	jmp	LBB0_16
LBB0_8:
	movq	%rbx, %rdi
	callq	_rs_is_raid456
	testq	%rax, %rax
	je	LBB0_12
LBB0_9:
	movq	_RT_FLAG_RESHAPE_RS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$20, %rbx
	movq	%rbx, %rsi
	callq	_set_bit
	movq	_RT_FLAG_UPDATE_SBS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_set_bit
LBB0_10:
	xorl	%r14d, %r14d
LBB0_11:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_12:
	movq	%rbx, %rdi
	callq	_rs_is_raid1
	testq	%rax, %rax
	je	LBB0_15
## %bb.13:
	movl	16(%rbx), %eax
	testl	%eax, %eax
	je	LBB0_17
## %bb.14:
	movl	%eax, %ecx
	negl	%ecx
	cmovsl	%eax, %ecx
	movl	%ecx, 40(%rbx)
	jmp	LBB0_9
LBB0_15:
	movq	24(%rbx), %rax
	leaq	L_.str.1(%rip), %rcx
LBB0_16:
	movq	%rcx, (%rax)
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_11
LBB0_17:
	movq	(%rbx), %rax
	movq	%rax, 32(%rbx)
	jmp	LBB0_10
LBB0_18:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $edx killed $edx def $rdx
	testq	%rdx, %rdx
	jne	LBB0_7
LBB0_19:
	movq	%rbx, %rdi
	callq	___reorder_raid_disk_indexes
	movq	_ALGORITHM_RAID10_NEAR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	8(%rbx), %edx
	movq	%rbx, %rdi
	callq	_raid10_format_to_md_layout
	movl	%eax, 44(%rbx)
	movl	%eax, 48(%rbx)
	movq	32(%rbx), %rax
	xorl	%r14d, %r14d
	cmpq	(%rbx), %rax
	jge	LBB0_11
## %bb.20:
	movq	_RT_FLAG_UPDATE_SBS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$20, %rbx
	movq	%rbx, %rsi
	callq	_set_bit
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Can't reshape raid10 mirror groups"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ALGORITHM_RAID10_NEAR,4,2      ## @ALGORITHM_RAID10_NEAR
L_.str.1:                               ## @.str.1
	.asciz	"Called with bogus raid type"

	.comm	_RT_FLAG_RESHAPE_RS,4,2         ## @RT_FLAG_RESHAPE_RS
	.comm	_RT_FLAG_UPDATE_SBS,4,2         ## @RT_FLAG_UPDATE_SBS
	.no_dead_strip	_rs_prepare_reshape
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rs_prepare_reshape
_rs_prepare_reshape:                    ; @rs_prepare_reshape
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	bl	_rs_is_raid10
	cbz	x0, LBB0_7
; %bb.1:
	ldr	x8, [x19]
	ldr	x9, [x19, #32]
	cmp	x8, x9
	b.eq	LBB0_8
; %bb.2:
	ldr	w0, [x19, #44]
	bl	___is_raid10_near
	cbz	x0, LBB0_8
; %bb.3:
	ldr	x20, [x19, #8]
	cbz	x20, LBB0_8
; %bb.4:
	ldr	w0, [x19, #44]
	bl	___raid10_near_copies
	cmp	x20, x0
	b.eq	LBB0_8
; %bb.5:
	ldp	x8, x9, [x19]
	sdiv	x10, x8, x9
	msub	x8, x10, x9, x8
	cbz	x8, LBB0_18
; %bb.6:
Lloh0:
	adrp	x8, l_.str@PAGE
Lloh1:
	add	x8, x8, l_.str@PAGEOFF
	b	LBB0_16
LBB0_7:
	mov	x0, x19
	bl	_rs_is_raid456
	cbz	x0, LBB0_12
LBB0_8:
Lloh2:
	adrp	x8, _RT_FLAG_RESHAPE_RS@GOTPAGE
Lloh3:
	ldr	x8, [x8, _RT_FLAG_RESHAPE_RS@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	add	x19, x19, #20
	mov	x1, x19
	bl	_set_bit
Lloh5:
	adrp	x8, _RT_FLAG_UPDATE_SBS@GOTPAGE
Lloh6:
	ldr	x8, [x8, _RT_FLAG_UPDATE_SBS@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	mov	x1, x19
LBB0_9:
	bl	_set_bit
LBB0_10:
	mov	w0, #0
LBB0_11:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_12:
	mov	x0, x19
	bl	_rs_is_raid1
	cbz	x0, LBB0_15
; %bb.13:
	ldr	w8, [x19, #16]
	cbz	w8, LBB0_17
; %bb.14:
	cmp	w8, #0
	cneg	w8, w8, mi
	str	w8, [x19, #40]
	b	LBB0_8
LBB0_15:
Lloh8:
	adrp	x8, l_.str.1@PAGE
Lloh9:
	add	x8, x8, l_.str.1@PAGEOFF
LBB0_16:
	ldr	x9, [x19, #24]
	str	x8, [x9]
Lloh10:
	adrp	x8, _EINVAL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_11
LBB0_17:
	mov	w0, #0
	ldr	x8, [x19]
	str	x8, [x19, #32]
	b	LBB0_11
LBB0_18:
	mov	x0, x19
	bl	___reorder_raid_disk_indexes
Lloh13:
	adrp	x8, _ALGORITHM_RAID10_NEAR@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ALGORITHM_RAID10_NEAR@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	ldr	w2, [x19, #8]
	mov	x0, x19
	bl	_raid10_format_to_md_layout
	stp	w0, w0, [x19, #44]
	ldr	x8, [x19, #32]
	ldr	x9, [x19]
	cmp	x8, x9
	b.ge	LBB0_10
; %bb.19:
Lloh16:
	adrp	x8, _RT_FLAG_UPDATE_SBS@GOTPAGE
Lloh17:
	ldr	x8, [x8, _RT_FLAG_UPDATE_SBS@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
	add	x1, x19, #20
	b	LBB0_9
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Can't reshape raid10 mirror groups"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ALGORITHM_RAID10_NEAR,4,2      ; @ALGORITHM_RAID10_NEAR
l_.str.1:                               ; @.str.1
	.asciz	"Called with bogus raid type"

	.comm	_RT_FLAG_RESHAPE_RS,4,2         ; @RT_FLAG_RESHAPE_RS
	.comm	_RT_FLAG_UPDATE_SBS,4,2         ; @RT_FLAG_UPDATE_SBS
	.no_dead_strip	_rs_prepare_reshape
.subsections_via_symbols
