	.file	"extr_bsdlabel.c_writelabel.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"write to disk label suppressed - label was as follows:"
	.align 8
.LC1:
	.string	"cannot open file %s for writing label"
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC2:
	.string	"PART"
	.section	.rodata.str1.8
	.align 8
.LC3:
	.string	"cannot open provider %s for writing label"
	.section	.rodata.str1.1
.LC4:
	.string	"Try to use gpart(8)."
.LC5:
	.string	"%s"
.LC6:
	.string	"write %s"
	.text
	.p2align 4
	.type	writelabel, @function
writelabel:
.LFB0:
	.cfi_startproc
	endbr64
	cmp	QWORD PTR disable_write[rip], 0
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	jne	.L15
	mov	rax, QWORD PTR DISKMAGIC[rip]
	lea	rdi, lab[rip]
	mov	QWORD PTR lab[rip+16], 0
	mov	QWORD PTR lab[rip+32], rax
	mov	QWORD PTR lab[rip+24], rax
	call	dkcksum@PLT
	cmp	QWORD PTR installboot[rip], 0
	mov	QWORD PTR lab[rip+16], rax
	jne	.L16
.L4:
	mov	eax, DWORD PTR lab[rip]
	test	eax, eax
	jle	.L5
	mov	rdx, QWORD PTR lab[rip+8]
	lea	ecx, -1[rax]
	mov	esi, DWORD PTR lba_offset[rip]
	sal	rcx, 4
	lea	rax, 16[rdx]
	add	rcx, rax
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L17:
	add	rax, 16
.L7:
	cmp	QWORD PTR 8[rdx], 0
	je	.L6
	add	DWORD PTR [rdx], esi
.L6:
	mov	rdx, rax
	cmp	rcx, rax
	jne	.L17
.L5:
	mov	eax, DWORD PTR lab[rip+4]
	imul	eax, DWORD PTR labelsoffset[rip]
	lea	rsi, lab[rip]
	mov	rdi, QWORD PTR labeloffset[rip]
	add	rdi, QWORD PTR bootarea[rip]
	cdqe
	add	rdi, rax
	call	bsd_disklabel_le_enc@PLT
	mov	esi, DWORD PTR O_RDWR[rip]
	mov	edi, DWORD PTR specname[rip]
	call	open@PLT
	mov	ebp, eax
	test	eax, eax
	jns	.L8
	cmp	QWORD PTR is_file[rip], 0
	jne	.L18
	lea	rdi, .LC2[rip]
	mov	ebp, DWORD PTR errno[rip]
	call	geom_class_available@PLT
	mov	edx, DWORD PTR specname[rip]
	test	rax, rax
	je	.L10
	mov	edi, ebp
	lea	rsi, .LC3[rip]
	call	warnc@PLT
	lea	rdi, .LC4[rip]
	call	warnx@PLT
	mov	eax, 1
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L8:
	.cfi_restore_state
	mov	rdx, QWORD PTR bbsize[rip]
	mov	rsi, QWORD PTR bootarea[rip]
	mov	edi, eax
	call	write@PLT
	cmp	rax, QWORD PTR bbsize[rip]
	je	.L11
	mov	esi, DWORD PTR specname[rip]
	lea	rdi, .LC6[rip]
	call	warn@PLT
	mov	edi, ebp
	call	close@PLT
	mov	eax, 1
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L16:
	.cfi_restore_state
	xor	eax, eax
	call	readboot@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L15:
	lea	rdi, .LC0[rip]
	call	warnx@PLT
	mov	edi, DWORD PTR stdout[rip]
	xor	esi, esi
	call	display@PLT
	xor	eax, eax
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	mov	edi, ebp
	call	close@PLT
	xor	eax, eax
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L10:
	.cfi_restore_state
	mov	edi, ebp
	lea	rsi, .LC5[rip]
	call	warnc@PLT
	mov	eax, 1
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L18:
	.cfi_restore_state
	mov	esi, DWORD PTR specname[rip]
	lea	rdi, .LC1[rip]
	call	warn@PLT
	mov	eax, 1
	pop	rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	writelabel, .-writelabel
	.comm	stdout,4,4
	.comm	specname,4,4
	.comm	lba_offset,8,8
	.comm	labelsoffset,4,4
	.comm	labeloffset,8,8
	.comm	lab,40,32
	.comm	is_file,8,8
	.comm	installboot,8,8
	.comm	errno,4,4
	.comm	disable_write,8,8
	.comm	bootarea,8,8
	.comm	bbsize,8,8
	.comm	O_RDWR,4,4
	.comm	DISKMAGIC,8,8
	.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_bsdlabel.c_writelabel.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"write to disk label suppressed - label was as follo"
	.ascii	"ws:\000"
	.align	2
.LC1:
	.ascii	"cannot open file %s for writing label\000"
	.align	2
.LC2:
	.ascii	"PART\000"
	.align	2
.LC3:
	.ascii	"cannot open provider %s for writing label\000"
	.align	2
.LC4:
	.ascii	"Try to use gpart(8).\000"
	.align	2
.LC5:
	.ascii	"%s\000"
	.align	2
.LC6:
	.ascii	"write %s\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	writelabel, %function
writelabel:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r3, .L24
	push	{r4, r5, r6, r7, r8, lr}
	ldr	r5, [r3]
	cmp	r5, #0
	bne	.L21
	ldr	r3, .L24+4
	ldr	r4, .L24+8
	ldr	r3, [r3]
	mov	r0, r4
	str	r3, [r4, #20]
	str	r3, [r4, #16]
	str	r5, [r4, #12]
	bl	dkcksum
	ldr	r3, .L24+12
	str	r0, [r4, #12]
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L22
.L4:
	ldr	r1, [r4]
	cmp	r1, #0
	ble	.L5
	mov	r3, #0
	ldr	r2, .L24+16
	ldr	r0, [r4, #8]
	ldr	lr, [r2]
	add	ip, r0, #4
.L7:
	ldr	r2, [ip, r3, lsl #3]
	cmp	r2, #0
	ldrne	r2, [r0, r3, lsl #3]
	addne	r2, r2, lr
	strne	r2, [r0, r3, lsl #3]
	add	r3, r3, #1
	cmp	r1, r3
	bne	.L7
.L5:
	ldr	r2, .L24+20
	ldr	r7, .L24+24
	ldr	r0, .L24+28
	ldr	r1, [r2]
	ldr	r3, [r7]
	ldr	r2, [r4, #4]
	ldr	r0, [r0]
	add	r3, r3, r1
	mla	r0, r2, r0, r3
	ldr	r1, .L24+8
	bl	bsd_disklabel_le_enc
	ldr	r6, .L24+32
	ldr	r3, .L24+36
	ldr	r0, [r6]
	ldr	r1, [r3]
	bl	open
	subs	r4, r0, #0
	bge	.L8
	ldr	r3, .L24+40
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L23
	ldr	r3, .L24+44
	ldr	r0, .L24+48
	ldr	r4, [r3]
	bl	geom_class_available
	cmp	r0, #0
	ldr	r2, [r6]
	mov	r0, r4
	beq	.L10
	mov	r5, #1
	ldr	r1, .L24+52
	bl	warnc
	ldr	r0, .L24+56
	bl	warnx
	mov	r0, r5
	pop	{r4, r5, r6, r7, r8, pc}
.L8:
	ldr	r8, .L24+60
	ldr	r1, [r7]
	ldr	r2, [r8]
	bl	write
	ldr	r3, [r8]
	cmp	r0, r3
	beq	.L11
	mov	r5, #1
	ldr	r1, [r6]
	ldr	r0, .L24+64
	bl	warn
	mov	r0, r4
	bl	close
	mov	r0, r5
	pop	{r4, r5, r6, r7, r8, pc}
.L22:
	bl	readboot
	b	.L4
.L21:
	mov	r5, #0
	ldr	r0, .L24+68
	bl	warnx
	ldr	r3, .L24+72
	mov	r1, #0
	ldr	r0, [r3]
	bl	display
	mov	r0, r5
	pop	{r4, r5, r6, r7, r8, pc}
.L11:
	mov	r0, r4
	bl	close
	mov	r0, r5
	pop	{r4, r5, r6, r7, r8, pc}
.L10:
	mov	r5, #1
	ldr	r1, .L24+76
	bl	warnc
	mov	r0, r5
	pop	{r4, r5, r6, r7, r8, pc}
.L23:
	mov	r5, #1
	ldr	r1, [r6]
	ldr	r0, .L24+80
	bl	warn
	mov	r0, r5
	pop	{r4, r5, r6, r7, r8, pc}
.L25:
	.align	2
.L24:
	.word	disable_write
	.word	DISKMAGIC
	.word	lab
	.word	installboot
	.word	lba_offset
	.word	labeloffset
	.word	bootarea
	.word	labelsoffset
	.word	specname
	.word	O_RDWR
	.word	is_file
	.word	errno
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	bbsize
	.word	.LC6
	.word	.LC0
	.word	stdout
	.word	.LC5
	.word	.LC1
	.size	writelabel, .-writelabel
	.comm	stdout,4,4
	.comm	specname,4,4
	.comm	lba_offset,4,4
	.comm	labelsoffset,4,4
	.comm	labeloffset,4,4
	.comm	lab,24,4
	.comm	is_file,4,4
	.comm	installboot,4,4
	.comm	errno,4,4
	.comm	disable_write,4,4
	.comm	bootarea,4,4
	.comm	bbsize,4,4
	.comm	O_RDWR,4,4
	.comm	DISKMAGIC,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
