	.file	"extr_geom_vinum_create.c_gv_create_sd.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"gv_create_sd: NULL s"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC1:
	.string	"create sd '%s': drive '%s' not found"
	.align 8
.LC2:
	.string	"create sd '%s': plex '%s' not found"
	.align 8
.LC3:
	.string	"unable to give sd '%s' to plex '%s'"
	.text
	.p2align 4
	.globl	gv_create_sd
	.type	gv_create_sd, @function
gv_create_sd:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	mov	r13, rdi
	xor	edi, edi
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	mov	rbp, rsi
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	test	rsi, rsi
	lea	rsi, .LC0[rip]
	setne	dil
	call	KASSERT@PLT
	mov	esi, DWORD PTR 32[rbp]
	mov	rdi, r13
	call	gv_find_drive@PLT
	mov	r12, rax
	test	rax, rax
	je	.L20
.L2:
	mov	esi, DWORD PTR 28[rbp]
	mov	rdi, r13
	call	gv_find_plex@PLT
	mov	r14, rax
	test	rax, rax
	je	.L21
	mov	rsi, r12
	mov	rdi, rbp
	call	gv_sd_to_drive@PLT
	test	rax, rax
	jne	.L18
	mov	rsi, r14
	mov	rdi, rbp
	call	gv_sd_to_plex@PLT
	test	rax, rax
	je	.L7
	mov	ecx, DWORD PTR 4[r14]
	mov	edx, DWORD PTR 24[rbp]
	lea	rsi, .LC3[rip]
	xor	edi, edi
	call	G_VINUM_DEBUG@PLT
	mov	rax, QWORD PTR 16[rbp]
	test	rax, rax
	je	.L8
	mov	eax, DWORD PTR [rax]
	test	DWORD PTR GV_DRIVE_REFERENCED[rip], eax
	jne	.L8
	mov	esi, DWORD PTR from_drive[rip]
	mov	rdi, rbp
	call	LIST_REMOVE@PLT
.L8:
	mov	rdi, rbp
	call	gv_free_sd@PLT
	mov	rdi, rbp
	call	g_free@PLT
	mov	eax, DWORD PTR [r14]
	test	DWORD PTR GV_PLEX_NEWBORN[rip], eax
	je	.L17
	mov	rsi, r14
	mov	rdi, r13
	call	gv_rm_plex@PLT
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L3:
	mov	ecx, DWORD PTR 32[rbp]
	mov	edx, DWORD PTR 24[rbp]
	lea	rsi, .LC1[rip]
.L16:
	xor	edi, edi
	call	G_VINUM_DEBUG@PLT
.L18:
	mov	rdi, rbp
	call	g_free@PLT
.L17:
	mov	eax, DWORD PTR GV_ERR_CREATE[rip]
	add	rsp, 8
	.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
.L20:
	.cfi_restore_state
	mov	eax, DWORD PTR 0[rbp]
	test	DWORD PTR GV_SD_TASTED[rip], eax
	je	.L3
	mov	esi, DWORD PTR M_WAITOK[rip]
	mov	edi, 8
	or	esi, DWORD PTR M_ZERO[rip]
	call	g_malloc@PLT
	mov	esi, DWORD PTR 32[rbp]
	mov	edx, 4
	mov	r12, rax
	mov	eax, DWORD PTR GV_DRIVE_REFERENCED[rip]
	or	DWORD PTR [r12], eax
	mov	edi, DWORD PTR 4[r12]
	call	strlcpy@PLT
	mov	rsi, r12
	mov	rdi, r13
	call	gv_create_drive@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L7:
	mov	eax, DWORD PTR GV_SD_NEWBORN[rip]
	or	DWORD PTR 0[rbp], eax
	mov	rsi, rbp
	mov	rdi, r13
	mov	QWORD PTR 8[rbp], r13
	mov	edx, DWORD PTR sd[rip]
	call	LIST_INSERT_HEAD@PLT
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xor	eax, eax
	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
.L21:
	.cfi_restore_state
	mov	ecx, DWORD PTR 28[rbp]
	mov	edx, DWORD PTR 24[rbp]
	lea	rsi, .LC2[rip]
	jmp	.L16
	.cfi_endproc
.LFE0:
	.size	gv_create_sd, .-gv_create_sd
	.comm	sd,4,4
	.comm	from_drive,4,4
	.comm	M_ZERO,4,4
	.comm	M_WAITOK,4,4
	.comm	GV_SD_TASTED,4,4
	.comm	GV_SD_NEWBORN,4,4
	.comm	GV_PLEX_NEWBORN,4,4
	.comm	GV_ERR_CREATE,4,4
	.comm	GV_DRIVE_REFERENCED,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_geom_vinum_create.c_gv_create_sd.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"gv_create_sd: NULL s\000"
	.align	2
.LC1:
	.ascii	"create sd '%s': drive '%s' not found\000"
	.align	2
.LC2:
	.ascii	"create sd '%s': plex '%s' not found\000"
	.align	2
.LC3:
	.ascii	"unable to give sd '%s' to plex '%s'\000"
	.text
	.align	2
	.global	gv_create_sd
	.syntax unified
	.arm
	.fpu softvfp
	.type	gv_create_sd, %function
gv_create_sd:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r6, r0
	mov	r4, r1
	subs	r0, r1, #0
	movne	r0, #1
	ldr	r1, .L21
	bl	KASSERT
	mov	r0, r6
	ldr	r1, [r4, #20]
	bl	gv_find_drive
	subs	r5, r0, #0
	beq	.L19
.L2:
	mov	r0, r6
	ldr	r1, [r4, #16]
	bl	gv_find_plex
	subs	r8, r0, #0
	beq	.L20
	mov	r1, r5
	mov	r0, r4
	bl	gv_sd_to_drive
	subs	r7, r0, #0
	bne	.L17
	mov	r1, r8
	mov	r0, r4
	bl	gv_sd_to_plex
	subs	r5, r0, #0
	beq	.L7
	ldr	r3, [r8, #4]
	mov	r0, r7
	ldr	r2, [r4, #12]
	ldr	r1, .L21+4
	bl	G_VINUM_DEBUG
	ldr	r3, [r4, #8]
	cmp	r3, #0
	beq	.L8
	ldr	r1, .L21+8
	ldr	r2, [r3]
	ldr	r3, [r1]
	tst	r2, r3
	bne	.L8
	ldr	r3, .L21+12
	mov	r0, r4
	ldr	r1, [r3]
	bl	LIST_REMOVE
.L8:
	mov	r0, r4
	bl	gv_free_sd
	mov	r0, r4
	bl	g_free
	ldr	r3, .L21+16
	ldr	r2, [r8]
	ldr	r3, [r3]
	tst	r2, r3
	beq	.L16
	mov	r1, r8
	mov	r0, r6
	bl	gv_rm_plex
	b	.L16
.L3:
	ldr	r3, [r4, #20]
	ldr	r2, [r4, #12]
	ldr	r1, .L21+20
.L15:
	bl	G_VINUM_DEBUG
.L17:
	mov	r0, r4
	bl	g_free
.L16:
	ldr	r3, .L21+24
	ldr	r5, [r3]
	mov	r0, r5
	pop	{r4, r5, r6, r7, r8, pc}
.L19:
	ldr	r3, .L21+28
	ldr	r2, [r4]
	ldr	r3, [r3]
	tst	r2, r3
	beq	.L3
	ldr	r2, .L21+32
	ldr	r3, .L21+36
	ldr	r1, [r2]
	ldr	r3, [r3]
	mov	r0, #8
	orr	r1, r1, r3
	bl	g_malloc
	mov	r5, r0
	ldr	r2, .L21+8
	ldr	r3, [r0]
	ldr	r2, [r2]
	ldr	r1, [r4, #20]
	orr	r3, r3, r2
	ldr	r0, [r0, #4]
	mov	r2, #4
	str	r3, [r5]
	bl	strlcpy
	mov	r1, r5
	mov	r0, r6
	bl	gv_create_drive
	b	.L2
.L7:
	ldr	r2, .L21+40
	ldr	r3, [r4]
	ldr	r1, [r2]
	ldr	r2, .L21+44
	orr	r3, r3, r1
	mov	r0, r6
	mov	r1, r4
	ldr	r2, [r2]
	str	r6, [r4, #4]
	str	r3, [r4]
	bl	LIST_INSERT_HEAD
	mov	r0, r5
	pop	{r4, r5, r6, r7, r8, pc}
.L20:
	ldr	r3, [r4, #16]
	ldr	r2, [r4, #12]
	ldr	r1, .L21+48
	b	.L15
.L22:
	.align	2
.L21:
	.word	.LC0
	.word	.LC3
	.word	GV_DRIVE_REFERENCED
	.word	from_drive
	.word	GV_PLEX_NEWBORN
	.word	.LC1
	.word	GV_ERR_CREATE
	.word	GV_SD_TASTED
	.word	M_WAITOK
	.word	M_ZERO
	.word	GV_SD_NEWBORN
	.word	sd
	.word	.LC2
	.size	gv_create_sd, .-gv_create_sd
	.comm	sd,4,4
	.comm	from_drive,4,4
	.comm	M_ZERO,4,4
	.comm	M_WAITOK,4,4
	.comm	GV_SD_TASTED,4,4
	.comm	GV_SD_NEWBORN,4,4
	.comm	GV_PLEX_NEWBORN,4,4
	.comm	GV_ERR_CREATE,4,4
	.comm	GV_DRIVE_REFERENCED,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
