	.file	"extr_g_mirror.c_g_mirror_sync_start.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"Device %s: rebuilding provider %s."
	.align 8
.LC1:
	.string	"Sending synchronization request."
	.text
	.p2align 4
	.type	g_mirror_sync_start, @function
g_mirror_sync_start:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	xor	eax, eax
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	rbx, rdi
	call	g_topology_assert_not@PLT
	mov	r13, QWORD PTR 48[rbx]
	mov	esi, DWORD PTR SX_LOCKED[rip]
	lea	r12, 24[r13]
	mov	rdi, r12
	call	sx_assert@PLT
	mov	rdi, rbx
	call	g_mirror_get_diskname@PLT
	xor	edi, edi
	movsx	rsi, eax
	mov	rax, QWORD PTR G_MIRROR_DISK_STATE_SYNCHRONIZING[rip]
	cmp	QWORD PTR [rbx], rax
	sete	dil
	call	KASSERT@PLT
	mov	rsi, QWORD PTR 0[r13]
	xor	edi, edi
	cmp	QWORD PTR G_MIRROR_DEVICE_STATE_RUNNING[rip], rsi
	sete	dil
	call	KASSERT@PLT
	mov	rdi, r12
	call	sx_xunlock@PLT
	xor	eax, eax
	call	g_topology_lock@PLT
	mov	edi, DWORD PTR 16[r13]
	call	g_new_consumer@PLT
	mov	esi, DWORD PTR 28[r13]
	mov	rbp, rax
	mov	eax, DWORD PTR G_CF_DIRECT_SEND[rip]
	or	eax, DWORD PTR G_CF_DIRECT_RECEIVE[rip]
	or	DWORD PTR 0[rbp], eax
	mov	rdi, rbp
	call	g_attach@PLT
	xor	edi, edi
	test	eax, eax
	movsx	rsi, eax
	sete	dil
	call	KASSERT@PLT
	xor	ecx, ecx
	xor	edx, edx
	mov	esi, 1
	mov	rdi, rbp
	call	g_access@PLT
	xor	edi, edi
	test	eax, eax
	movsx	rsi, eax
	sete	dil
	call	KASSERT@PLT
	xor	eax, eax
	call	g_topology_unlock@PLT
	mov	rdi, r12
	call	sx_xlock@PLT
	mov	rdi, rbx
	call	g_mirror_get_diskname@PLT
	mov	edx, DWORD PTR 20[r13]
	lea	rsi, .LC0[rip]
	xor	edi, edi
	mov	ecx, eax
	call	G_MIRROR_DEBUG@PLT
	mov	eax, DWORD PTR 8[r13]
	test	DWORD PTR G_MIRROR_DEVICE_FLAG_NOFAILSYNC[rip], eax
	jne	.L2
	mov	eax, DWORD PTR G_MIRROR_DISK_FLAG_DIRTY[rip]
	or	DWORD PTR 8[rbx], eax
.L2:
	mov	rdi, rbx
	call	g_mirror_get_diskname@PLT
	xor	edi, edi
	cmp	QWORD PTR 24[rbx], 0
	sete	dil
	movsx	rsi, eax
	call	KASSERT@PLT
	mov	QWORD PTR 24[rbx], rbp
	mov	eax, DWORD PTR g_mirror_syncreqs[rip]
	mov	edx, DWORD PTR M_WAITOK[rip]
	mov	esi, DWORD PTR M_MIRROR[rip]
	mov	QWORD PTR 16[rbp], rbx
	mov	QWORD PTR 8[rbp], 0
	lea	edi, 0[0+rax*8]
	call	malloc@PLT
	mov	QWORD PTR 32[rbx], rax
	mov	eax, DWORD PTR g_mirror_syncreqs[rip]
	test	eax, eax
	jle	.L3
	xor	r12d, r12d
	.p2align 4,,10
	.p2align 3
.L4:
	xor	eax, eax
	call	g_alloc_bio@PLT
	mov	edx, DWORD PTR M_WAITOK[rip]
	mov	esi, DWORD PTR M_MIRROR[rip]
	mov	rbp, rax
	mov	rax, QWORD PTR 32[rbx]
	mov	edi, DWORD PTR MAXPHYS[rip]
	mov	QWORD PTR [rax+r12*8], rbp
	call	malloc@PLT
	mov	QWORD PTR 8[rbp], r12
	mov	edx, DWORD PTR 40[rbx]
	mov	rsi, rbp
	mov	QWORD PTR 16[rbp], rax
	mov	rdi, rbx
	add	r12, 1
	call	g_mirror_sync_reinit@PLT
	mov	rax, QWORD PTR 0[rbp]
	add	DWORD PTR 40[rbx], eax
	mov	eax, DWORD PTR g_mirror_syncreqs[rip]
	cmp	eax, r12d
	jg	.L4
	add	DWORD PTR 12[r13], 1
	mov	DWORD PTR 16[rbx], eax
	test	eax, eax
	jle	.L1
	xor	ebp, ebp
	lea	r14, .LC1[rip]
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L14:
	mov	rsi, r12
	mov	rdi, r13
	add	rbp, 1
	call	g_mirror_sync_delay@PLT
	cmp	DWORD PTR g_mirror_syncreqs[rip], ebp
	jle	.L1
.L5:
	mov	rax, QWORD PTR 32[rbx]
	mov	edi, 3
	mov	rdx, r14
	mov	r12, QWORD PTR [rax+rbp*8]
	mov	rsi, r12
	call	G_MIRROR_LOGREQ@PLT
	mov	rax, QWORD PTR 24[rbx]
	mov	rsi, r12
	mov	rdi, r13
	add	QWORD PTR 8[rax], 1
	call	g_mirror_regular_collision@PLT
	test	rax, rax
	jne	.L14
	mov	rsi, QWORD PTR 24[rbx]
	mov	rdi, r12
	add	rbp, 1
	call	g_io_request@PLT
	cmp	DWORD PTR g_mirror_syncreqs[rip], ebp
	jg	.L5
.L1:
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L3:
	.cfi_restore_state
	add	DWORD PTR 12[r13], 1
	mov	DWORD PTR 16[rbx], eax
	pop	rbx
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	g_mirror_sync_start, .-g_mirror_sync_start
	.comm	g_mirror_syncreqs,4,4
	.comm	SX_LOCKED,4,4
	.comm	M_WAITOK,4,4
	.comm	M_MIRROR,4,4
	.comm	MAXPHYS,4,4
	.comm	G_MIRROR_DISK_STATE_SYNCHRONIZING,8,8
	.comm	G_MIRROR_DISK_FLAG_DIRTY,4,4
	.comm	G_MIRROR_DEVICE_STATE_RUNNING,8,8
	.comm	G_MIRROR_DEVICE_FLAG_NOFAILSYNC,4,4
	.comm	G_CF_DIRECT_SEND,4,4
	.comm	G_CF_DIRECT_RECEIVE,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_g_mirror.c_g_mirror_sync_start.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Device %s: rebuilding provider %s.\000"
	.align	2
.LC1:
	.ascii	"Sending synchronization request.\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	g_mirror_sync_start, %function
g_mirror_sync_start:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r3, r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r4, r0
	bl	g_topology_assert_not
	ldr	r7, [r4, #24]
	ldr	r3, .L16
	add	r6, r7, #20
	ldr	r1, [r3]
	mov	r0, r6
	bl	sx_assert
	ldr	r3, .L16+4
	ldr	r5, [r4]
	ldr	r3, [r3]
	mov	r0, r4
	sub	r5, r5, r3
	clz	r5, r5
	bl	g_mirror_get_diskname
	lsr	r5, r5, #5
	mov	r1, r0
	mov	r0, r5
	bl	KASSERT
	ldr	r3, .L16+8
	ldr	r1, [r7]
	ldr	r0, [r3]
	ldr	r8, .L16+12
	sub	r0, r0, r1
	clz	r0, r0
	lsr	r0, r0, #5
	bl	KASSERT
	mov	r0, r6
	bl	sx_xunlock
	bl	g_topology_lock
	ldr	r0, [r7, #12]
	bl	g_new_consumer
	ldr	r3, .L16+16
	ldr	r2, .L16+20
	ldr	r1, [r3]
	ldr	r2, [r2]
	ldr	r3, [r0]
	orr	r2, r2, r1
	orr	r3, r3, r2
	str	r3, [r0]
	ldr	r1, [r7, #24]
	mov	r5, r0
	bl	g_attach
	mov	r1, r0
	clz	r0, r0
	lsr	r0, r0, #5
	bl	KASSERT
	mov	r3, #0
	mov	r1, #1
	mov	r2, r3
	mov	r0, r5
	bl	g_access
	mov	r1, r0
	clz	r0, r0
	lsr	r0, r0, #5
	bl	KASSERT
	bl	g_topology_unlock
	mov	r0, r6
	bl	sx_xlock
	mov	r0, r4
	ldr	r6, [r7, #16]
	bl	g_mirror_get_diskname
	mov	r2, r6
	mov	r3, r0
	ldr	r1, .L16+24
	mov	r0, #0
	bl	G_MIRROR_DEBUG
	ldr	r3, .L16+28
	ldr	r2, [r7, #4]
	ldr	r3, [r3]
	ldr	r9, [r4, #12]
	tst	r2, r3
	ldreq	r2, .L16+32
	ldreq	r3, [r4, #4]
	ldreq	r2, [r2]
	clz	r9, r9
	orreq	r3, r3, r2
	streq	r3, [r4, #4]
	mov	r0, r4
	bl	g_mirror_get_diskname
	mov	r6, #0
	lsr	r9, r9, #5
	mov	r1, r0
	mov	r0, r9
	bl	KASSERT
	ldr	r9, .L16+36
	ldr	r0, [r8]
	ldr	r10, .L16+40
	str	r5, [r4, #12]
	ldr	r2, [r9]
	ldr	r1, [r10]
	lsl	r0, r0, #2
	str	r4, [r5, #8]
	str	r6, [r5, #4]
	bl	malloc
	ldr	r3, [r8]
	str	r0, [r4, #16]
	cmp	r3, r6
	ble	.L3
	ldr	fp, .L16+44
.L4:
	bl	g_alloc_bio
	ldr	r3, [r4, #16]
	mov	r5, r0
	ldr	r2, [r9]
	ldr	r1, [r10]
	str	r0, [r3, r6, lsl #2]
	ldr	r0, [fp]
	bl	malloc
	mov	r1, r5
	ldr	r2, [r4, #20]
	str	r6, [r5, #4]
	str	r0, [r5, #8]
	mov	r0, r4
	bl	g_mirror_sync_reinit
	ldr	r1, [r5]
	ldr	r3, [r4, #20]
	ldr	r2, [r8]
	add	r6, r6, #1
	add	r3, r3, r1
	cmp	r2, r6
	str	r3, [r4, #20]
	bgt	.L4
	ldr	r3, [r7, #8]
	cmp	r2, #0
	add	r3, r3, #1
	str	r3, [r7, #8]
	str	r2, [r4, #8]
	pople	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
	mov	r5, #0
	ldr	r9, .L16+48
	b	.L5
.L15:
	mov	r1, r6
	mov	r0, r7
	bl	g_mirror_sync_delay
.L7:
	ldr	r3, [r8]
	add	r5, r5, #1
	cmp	r3, r5
	pople	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L5:
	ldr	r3, [r4, #16]
	mov	r2, r9
	ldr	r6, [r3, r5, lsl #2]
	mov	r0, #3
	mov	r1, r6
	bl	G_MIRROR_LOGREQ
	ldr	r2, [r4, #12]
	mov	r1, r6
	ldr	r3, [r2, #4]
	mov	r0, r7
	add	r3, r3, #1
	str	r3, [r2, #4]
	bl	g_mirror_regular_collision
	cmp	r0, #0
	bne	.L15
	mov	r0, r6
	ldr	r1, [r4, #12]
	bl	g_io_request
	b	.L7
.L3:
	ldr	r2, [r7, #8]
	add	r2, r2, #1
	str	r2, [r7, #8]
	str	r3, [r4, #8]
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L17:
	.align	2
.L16:
	.word	SX_LOCKED
	.word	G_MIRROR_DISK_STATE_SYNCHRONIZING
	.word	G_MIRROR_DEVICE_STATE_RUNNING
	.word	g_mirror_syncreqs
	.word	G_CF_DIRECT_RECEIVE
	.word	G_CF_DIRECT_SEND
	.word	.LC0
	.word	G_MIRROR_DEVICE_FLAG_NOFAILSYNC
	.word	G_MIRROR_DISK_FLAG_DIRTY
	.word	M_WAITOK
	.word	M_MIRROR
	.word	MAXPHYS
	.word	.LC1
	.size	g_mirror_sync_start, .-g_mirror_sync_start
	.comm	g_mirror_syncreqs,4,4
	.comm	SX_LOCKED,4,4
	.comm	M_WAITOK,4,4
	.comm	M_MIRROR,4,4
	.comm	MAXPHYS,4,4
	.comm	G_MIRROR_DISK_STATE_SYNCHRONIZING,4,4
	.comm	G_MIRROR_DISK_FLAG_DIRTY,4,4
	.comm	G_MIRROR_DEVICE_STATE_RUNNING,4,4
	.comm	G_MIRROR_DEVICE_FLAG_NOFAILSYNC,4,4
	.comm	G_CF_DIRECT_SEND,4,4
	.comm	G_CF_DIRECT_RECEIVE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
