	.file	"extr_dm-raid.c_rs_setup_takeover.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	rs_setup_takeover, @function
rs_setup_takeover:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	xor	r13d, r13d
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	rax, QWORD PTR 16[rdi]
	mov	r12d, DWORD PTR [rdi]
	cmp	QWORD PTR 24[rax], 0
	mov	DWORD PTR 32[rdi], r12d
	jne	.L2
	mov	r13d, DWORD PTR 28[rdi]
.L2:
	mov	edi, DWORD PTR 24[rbp]
	call	rt_is_raid10@PLT
	test	rax, rax
	je	.L3
	mov	rdi, rbp
	call	rs_is_raid0@PLT
	mov	rdi, rbp
	test	rax, rax
	je	.L4
	call	__reorder_raid_disk_indexes@PLT
	mov	edx, DWORD PTR 4[rbp]
	mov	esi, DWORD PTR ALGORITHM_RAID10_FAR[rip]
	mov	rdi, rbp
	call	raid10_format_to_md_layout@PLT
	mov	QWORD PTR 48[rbp], rax
.L3:
	mov	edi, DWORD PTR MD_ARRAY_FIRST_USE[rip]
	lea	r14, 36[rbp]
	lea	ebx, -1[r12]
	mov	rsi, r14
	call	clear_bit@PLT
	mov	rax, QWORD PTR MaxSector[rip]
	mov	QWORD PTR 40[rbp], rax
	test	r12d, r12d
	je	.L7
	mov	r12d, ebx
	sal	r12, 5
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L8:
	sub	ebx, 1
	mov	DWORD PTR [r15], r13d
	sub	r12, 32
	cmp	ebx, -1
	je	.L7
.L9:
	mov	r15, QWORD PTR 16[rbp]
	mov	rsi, QWORD PTR 8[rbp]
	mov	edi, ebx
	add	r15, r12
	call	test_bit@PLT
	test	rax, rax
	je	.L8
	mov	edi, DWORD PTR In_sync[rip]
	lea	rsi, 16[r15]
	sub	ebx, 1
	sub	r12, 32
	mov	QWORD PTR 8[rsp], rsi
	call	clear_bit@PLT
	mov	rsi, QWORD PTR 8[rsp]
	mov	edi, DWORD PTR Faulty[rip]
	call	clear_bit@PLT
	mov	QWORD PTR 8[r15], 0
	mov	edi, DWORD PTR MD_ARRAY_FIRST_USE[rip]
	mov	rsi, r14
	mov	QWORD PTR 40[rbp], 0
	call	set_bit@PLT
	mov	DWORD PTR [r15], r13d
	cmp	ebx, -1
	jne	.L9
.L7:
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xor	eax, eax
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	call	rs_is_raid1@PLT
	test	rax, rax
	jne	.L24
	mov	eax, DWORD PTR EINVAL[rip]
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	neg	eax
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L24:
	.cfi_restore_state
	mov	edx, DWORD PTR 0[rbp]
	mov	esi, DWORD PTR ALGORITHM_RAID10_NEAR[rip]
	mov	rdi, rbp
	call	raid10_format_to_md_layout@PLT
	mov	QWORD PTR 48[rbp], rax
	jmp	.L3
	.cfi_endproc
.LFE0:
	.size	rs_setup_takeover, .-rs_setup_takeover
	.comm	MaxSector,8,8
	.comm	MD_ARRAY_FIRST_USE,4,4
	.comm	In_sync,4,4
	.comm	Faulty,4,4
	.comm	EINVAL,4,4
	.comm	ALGORITHM_RAID10_NEAR,4,4
	.comm	ALGORITHM_RAID10_FAR,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_dm-raid.c_rs_setup_takeover.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	rs_setup_takeover, %function
rs_setup_takeover:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r3, [r0, #12]
	ldr	r4, [r0]
	ldr	r3, [r3, #12]
	mov	r5, r0
	cmp	r3, #0
	ldreq	r7, [r0, #20]
	str	r4, [r0, #24]
	sub	sp, sp, #12
	ldr	r0, [r0, #16]
	movne	r7, #0
	bl	rt_is_raid10
	cmp	r0, #0
	beq	.L3
	mov	r0, r5
	bl	rs_is_raid0
	cmp	r0, #0
	mov	r0, r5
	beq	.L4
	bl	__reorder_raid_disk_indexes
	ldr	r3, .L24
	mov	r0, r5
	ldr	r2, [r5, #4]
	ldr	r1, [r3]
	bl	raid10_format_to_md_layout
	str	r0, [r5, #36]
.L3:
	ldr	r3, .L24+4
	add	r9, r5, #28
	ldr	r0, [r3]
	mov	r1, r9
	bl	clear_bit
	ldr	r3, .L24+8
	cmp	r4, #0
	ldr	r3, [r3]
	sub	r4, r4, #1
	str	r3, [r5, #32]
	beq	.L7
	mov	r8, #0
	b	.L9
.L8:
	cmn	r4, #1
	str	r7, [r6, r10]
	beq	.L7
.L9:
	mov	r0, r4
	ldr	r1, [r5, #8]
	ldr	r6, [r5, #12]
	bl	test_bit
	cmp	r0, #0
	add	fp, r6, r4, lsl #4
	lsl	r10, r4, #4
	sub	r4, r4, #1
	beq	.L8
	ldr	r3, .L24+12
	add	r1, fp, #8
	ldr	r0, [r3]
	str	r1, [sp, #4]
	bl	clear_bit
	ldr	r3, .L24+16
	ldr	r1, [sp, #4]
	ldr	r0, [r3]
	bl	clear_bit
	ldr	r3, .L24+4
	str	r8, [fp, #4]
	mov	r1, r9
	ldr	r0, [r3]
	str	r8, [r5, #32]
	bl	set_bit
	cmn	r4, #1
	str	r7, [r6, r10]
	bne	.L9
.L7:
	mov	r0, #0
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L4:
	bl	rs_is_raid1
	cmp	r0, #0
	bne	.L23
	ldr	r3, .L24+20
	ldr	r0, [r3]
	rsb	r0, r0, #0
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L23:
	ldr	r3, .L24+24
	mov	r0, r5
	ldr	r2, [r5]
	ldr	r1, [r3]
	bl	raid10_format_to_md_layout
	str	r0, [r5, #36]
	b	.L3
.L25:
	.align	2
.L24:
	.word	ALGORITHM_RAID10_FAR
	.word	MD_ARRAY_FIRST_USE
	.word	MaxSector
	.word	In_sync
	.word	Faulty
	.word	EINVAL
	.word	ALGORITHM_RAID10_NEAR
	.size	rs_setup_takeover, .-rs_setup_takeover
	.comm	MaxSector,4,4
	.comm	MD_ARRAY_FIRST_USE,4,4
	.comm	In_sync,4,4
	.comm	Faulty,4,4
	.comm	EINVAL,4,4
	.comm	ALGORITHM_RAID10_NEAR,4,4
	.comm	ALGORITHM_RAID10_FAR,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
