	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rs_setup_takeover
_rs_setup_takeover:                     ## @rs_setup_takeover
	.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
	movq	%rdi, %r14
	movl	(%rdi), %r15d
	movl	%r15d, 32(%rdi)
	movq	16(%rdi), %rax
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	cmpq	$0, 24(%rax)
	jne	LBB0_2
## %bb.1:
	movl	28(%r14), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
LBB0_2:
	movl	24(%r14), %edi
	callq	_rt_is_raid10
	testq	%rax, %rax
	je	LBB0_8
## %bb.3:
	movq	%r14, %rdi
	callq	_rs_is_raid0
	movq	%r14, %rdi
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	callq	___reorder_raid_disk_indexes
	movq	_ALGORITHM_RAID10_FAR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	4(%r14), %edx
	jmp	LBB0_7
LBB0_5:
	callq	_rs_is_raid1
	testq	%rax, %rax
	je	LBB0_15
## %bb.6:
	movq	_ALGORITHM_RAID10_NEAR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r14), %edx
LBB0_7:
	movq	%r14, %rdi
	callq	_raid10_format_to_md_layout
	movq	%rax, 48(%r14)
LBB0_8:
	movq	_MD_ARRAY_FIRST_USE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	36(%r14), %rsi
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	callq	_clear_bit
	movq	_MaxSector@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 40(%r14)
	xorl	%eax, %eax
	testl	%r15d, %r15d
	je	LBB0_14
## %bb.9:
	decl	%r15d
	movq	%r15, %r13
	shlq	$5, %r13
	orq	$16, %r13
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_10 Depth=1
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, -16(%r12,%r13)
	addq	$-32, %r13
	addl	$-1, %r15d
	jae	LBB0_13
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%r14), %rsi
	movq	16(%r14), %r12
	movl	%r15d, %edi
	callq	_test_bit
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	_In_sync@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	(%r12,%r13), %rbx
	movq	%rbx, %rsi
	callq	_clear_bit
	movq	_Faulty@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_clear_bit
	movq	$0, -8(%r12,%r13)
	movq	$0, 40(%r14)
	movq	_MD_ARRAY_FIRST_USE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	callq	_set_bit
	jmp	LBB0_12
LBB0_13:
	xorl	%eax, %eax
LBB0_14:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_ALGORITHM_RAID10_FAR,4,2       ## @ALGORITHM_RAID10_FAR
	.comm	_ALGORITHM_RAID10_NEAR,4,2      ## @ALGORITHM_RAID10_NEAR
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_MD_ARRAY_FIRST_USE,4,2         ## @MD_ARRAY_FIRST_USE
	.comm	_MaxSector,8,3                  ## @MaxSector
	.comm	_In_sync,4,2                    ## @In_sync
	.comm	_Faulty,4,2                     ## @Faulty
	.no_dead_strip	_rs_setup_takeover
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rs_setup_takeover
_rs_setup_takeover:                     ; @rs_setup_takeover
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
	ldr	w21, [x0]
	str	w21, [x0, #32]
	ldr	x8, [x0, #16]
	ldr	x8, [x8, #24]
	cbz	x8, LBB0_2
; %bb.1:
	mov	w23, #0
	b	LBB0_3
LBB0_2:
	ldr	w23, [x19, #28]
LBB0_3:
	ldr	w0, [x19, #24]
	bl	_rt_is_raid10
	cbz	x0, LBB0_9
; %bb.4:
	mov	x0, x19
	bl	_rs_is_raid0
	cbz	x0, LBB0_6
; %bb.5:
	mov	x0, x19
	bl	___reorder_raid_disk_indexes
Lloh0:
	adrp	x8, _ALGORITHM_RAID10_FAR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ALGORITHM_RAID10_FAR@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	ldr	w2, [x19, #4]
	b	LBB0_8
LBB0_6:
	mov	x0, x19
	bl	_rs_is_raid1
	cbz	x0, LBB0_16
; %bb.7:
Lloh3:
	adrp	x8, _ALGORITHM_RAID10_NEAR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ALGORITHM_RAID10_NEAR@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	ldr	w2, [x19]
LBB0_8:
	mov	x0, x19
	bl	_raid10_format_to_md_layout
	str	x0, [x19, #48]
LBB0_9:
Lloh6:
	adrp	x8, _MD_ARRAY_FIRST_USE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MD_ARRAY_FIRST_USE@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	add	x20, x19, #36
	mov	x1, x20
	bl	_clear_bit
Lloh9:
	adrp	x8, _MaxSector@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MaxSector@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	str	x8, [x19, #40]
	cbz	w21, LBB0_14
; %bb.10:
	sub	w21, w21, #1
	lsl	x25, x21, #5
Lloh12:
	adrp	x26, _In_sync@GOTPAGE
Lloh13:
	ldr	x26, [x26, _In_sync@GOTPAGEOFF]
Lloh14:
	adrp	x27, _Faulty@GOTPAGE
Lloh15:
	ldr	x27, [x27, _Faulty@GOTPAGEOFF]
	b	LBB0_12
LBB0_11:                                ;   in Loop: Header=BB0_12 Depth=1
	str	w23, [x28, x25]
	sub	x25, x25, #32
	sub	w21, w21, #1
	cmn	w21, #1
	b.eq	LBB0_14
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldp	x1, x28, [x19, #8]
	mov	x0, x21
	bl	_test_bit
	cbz	x0, LBB0_11
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	ldr	w0, [x26]
	add	x24, x28, x25
	add	x22, x24, #16
	mov	x1, x22
	bl	_clear_bit
	ldr	w0, [x27]
	mov	x1, x22
	bl	_clear_bit
	str	xzr, [x24, #8]
	str	xzr, [x19, #40]
Lloh16:
	adrp	x8, _MD_ARRAY_FIRST_USE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _MD_ARRAY_FIRST_USE@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
	mov	x1, x20
	bl	_set_bit
	b	LBB0_11
LBB0_14:
	mov	w0, #0
LBB0_15:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_16:
Lloh19:
	adrp	x8, _EINVAL@GOTPAGE
Lloh20:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_15
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_ALGORITHM_RAID10_FAR,4,2       ; @ALGORITHM_RAID10_FAR
	.comm	_ALGORITHM_RAID10_NEAR,4,2      ; @ALGORITHM_RAID10_NEAR
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_MD_ARRAY_FIRST_USE,4,2         ; @MD_ARRAY_FIRST_USE
	.comm	_MaxSector,8,3                  ; @MaxSector
	.comm	_In_sync,4,2                    ; @In_sync
	.comm	_Faulty,4,2                     ; @Faulty
	.no_dead_strip	_rs_setup_takeover
.subsections_via_symbols
