	.file	"extr_ffs_suspend.c_ffs_susp_rdwr.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"neither UIO_READ or UIO_WRITE"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC1:
	.string	"uio->uio_segflg != UIO_USERSPACE"
	.text
	.p2align 4
	.type	ffs_susp_rdwr, @function
ffs_susp_rdwr:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	lea	rdi, ffs_susp_lock[rip]
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, rsi
	sub	rsp, 72
	.cfi_def_cfa_offset 128
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 56[rsp], rax
	xor	eax, eax
	call	sx_slock@PLT
	lea	rdi, 40[rsp]
	call	devfs_get_cdevpriv@PLT
	test	eax, eax
	jne	.L22
	mov	rdi, QWORD PTR 40[rsp]
	call	VFSTOUFS@PLT
	mov	rdi, QWORD PTR 40[rsp]
	mov	r14, QWORD PTR 8[rax]
	mov	r12, QWORD PTR [rax]
	call	ffs_susp_suspended@PLT
	test	rax, rax
	je	.L22
	mov	rax, QWORD PTR [rbx]
	cmp	rax, QWORD PTR UIO_READ[rip]
	mov	edi, 1
	je	.L5
	xor	edi, edi
	cmp	QWORD PTR UIO_WRITE[rip], rax
	sete	dil
.L5:
	lea	rsi, .LC0[rip]
	call	KASSERT@PLT
	mov	rax, QWORD PTR UIO_USERSPACE[rip]
	xor	edi, edi
	cmp	QWORD PTR 8[rbx], rax
	sete	dil
	lea	rsi, .LC1[rip]
	call	KASSERT@PLT
	mov	rax, QWORD PTR 16[rbx]
	mov	QWORD PTR 24[rsp], rax
	mov	eax, DWORD PTR 24[rbx]
	test	eax, eax
	jle	.L7
	mov	QWORD PTR 16[rsp], 0
	mov	rcx, QWORD PTR 40[rbx]
	lea	r15, 48[rsp]
.L6:
	mov	rax, QWORD PTR 16[rsp]
	sal	rax, 4
	lea	rdx, [rcx+rax]
	mov	QWORD PTR 8[rsp], rax
	mov	rax, QWORD PTR [rdx]
	test	rax, rax
	je	.L14
	mov	rsi, QWORD PTR 32[rbx]
	mov	r13, QWORD PTR 8[rdx]
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L11:
	mov	rsi, r13
	call	copyout@PLT
	mov	rdi, QWORD PTR 48[rsp]
	mov	DWORD PTR 4[rsp], eax
	call	brelse@PLT
	mov	r8d, DWORD PTR 4[rsp]
	test	r8d, r8d
	jne	.L9
.L15:
	mov	rcx, QWORD PTR 40[rbx]
	mov	rax, QWORD PTR 8[rsp]
	mov	rsi, QWORD PTR 32[rbx]
	lea	rdx, [rcx+rax]
	mov	r13, QWORD PTR 8[rdx]
	mov	rax, QWORD PTR [rdx]
	add	rsi, rbp
	add	r13, rbp
	sub	rax, rbp
	mov	QWORD PTR 8[rdx], r13
	mov	QWORD PTR [rdx], rax
	sub	QWORD PTR 16[rbx], rbp
	mov	QWORD PTR 32[rbx], rsi
	test	rax, rax
	je	.L14
.L13:
	cmp	QWORD PTR [r12], rax
	cmovbe	rax, QWORD PTR [r12]
	mov	rdi, r12
	mov	rbp, rax
	call	fragoff@PLT
	test	rax, rax
	jne	.L10
	mov	rsi, rbp
	mov	rdi, r12
	call	fragoff@PLT
	test	rax, rax
	jne	.L10
	mov	ecx, DWORD PTR NOCRED[rip]
	mov	rdi, QWORD PTR 32[rbx]
	mov	DWORD PTR 4[rsp], ecx
	call	btodb@PLT
	mov	ecx, DWORD PTR 4[rsp]
	mov	r8, r15
	mov	rdx, rbp
	mov	esi, eax
	mov	rdi, r14
	call	bread@PLT
	mov	r8d, eax
	test	eax, eax
	jne	.L9
	mov	rax, QWORD PTR 48[rsp]
	mov	rdx, rbp
	mov	edi, DWORD PTR 4[rax]
	mov	rax, QWORD PTR UIO_WRITE[rip]
	cmp	QWORD PTR [rbx], rax
	jne	.L11
	mov	esi, edi
	mov	rdi, r13
	call	copyin@PLT
	test	eax, eax
	jne	.L24
	mov	rdi, QWORD PTR 48[rsp]
	call	bwrite@PLT
	mov	r8d, eax
	test	eax, eax
	je	.L15
	.p2align 4,,10
	.p2align 3
.L9:
	lea	rdi, ffs_susp_lock[rip]
	mov	DWORD PTR 4[rsp], r8d
	call	sx_sunlock@PLT
	mov	r8d, DWORD PTR 4[rsp]
	mov	rax, QWORD PTR 24[rsp]
	cmp	QWORD PTR 16[rbx], rax
	mov	eax, 0
	cmovl	r8d, eax
.L1:
	mov	rax, QWORD PTR 56[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L25
	add	rsp, 72
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r8d
	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
.L22:
	.cfi_restore_state
	lea	rdi, ffs_susp_lock[rip]
	call	sx_sunlock@PLT
	mov	r8d, DWORD PTR ENXIO[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L10:
	mov	r8d, DWORD PTR EINVAL[rip]
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L14:
	add	QWORD PTR 16[rsp], 1
	mov	rax, QWORD PTR 16[rsp]
	cmp	DWORD PTR 24[rbx], eax
	jg	.L6
.L7:
	xor	r8d, r8d
	jmp	.L9
.L24:
	mov	rdi, QWORD PTR 48[rsp]
	mov	DWORD PTR 4[rsp], eax
	mov	eax, DWORD PTR B_INVAL[rip]
	or	eax, DWORD PTR B_NOCACHE[rip]
	or	DWORD PTR [rdi], eax
	call	brelse@PLT
	mov	r8d, DWORD PTR 4[rsp]
	jmp	.L9
.L25:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	ffs_susp_rdwr, .-ffs_susp_rdwr
	.comm	ffs_susp_lock,4,4
	.comm	UIO_WRITE,8,8
	.comm	UIO_USERSPACE,8,8
	.comm	UIO_READ,8,8
	.comm	NOCRED,4,4
	.comm	ENXIO,4,4
	.comm	EINVAL,4,4
	.comm	B_NOCACHE,4,4
	.comm	B_INVAL,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_ffs_suspend.c_ffs_susp_rdwr.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"neither UIO_READ or UIO_WRITE\000"
	.align	2
.LC1:
	.ascii	"uio->uio_segflg != UIO_USERSPACE\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC2:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ffs_susp_rdwr, %function
ffs_susp_rdwr:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r3, .L29
	sub	sp, sp, #36
	ldr	r0, .L29+4
	mov	r5, r1
	ldr	r3, [r3]
	str	r3, [sp, #28]
	mov	r3,#0
	bl	sx_slock
	add	r0, sp, #20
	bl	devfs_get_cdevpriv
	cmp	r0, #0
	bne	.L24
	ldr	r0, [sp, #20]
	bl	VFSTOUFS
	mov	r3, r0
	ldr	r0, [sp, #20]
	ldm	r3, {r7, r9}
	bl	ffs_susp_suspended
	cmp	r0, #0
	beq	.L24
	ldr	r2, .L29+8
	ldr	r3, [r5]
	ldr	r2, [r2]
	ldr	r1, .L29+12
	cmp	r3, r2
	ldrne	r2, .L29+16
	moveq	r0, #1
	ldrne	r0, [r2]
	subne	r0, r0, r3
	clzne	r0, r0
	lsrne	r0, r0, #5
	bl	KASSERT
	ldr	r3, .L29+20
	ldr	r0, [r5, #4]
	ldr	r3, [r3]
	ldr	r1, .L29+24
	sub	r0, r0, r3
	clz	r0, r0
	lsr	r0, r0, #5
	bl	KASSERT
	ldr	r3, [r5, #12]
	ldr	r2, [r5, #8]
	cmp	r3, #0
	str	r2, [sp, #12]
	ble	.L7
	mov	r2, #0
	ldr	r0, [r5, #20]
	ldr	fp, .L29+16
	str	r2, [sp, #8]
.L6:
	ldr	r1, [sp, #8]
	ldr	r2, [r0, r1, lsl #3]
	lsl	r8, r1, #3
	cmp	r2, #0
	add	r1, r0, r1, lsl #3
	beq	.L14
	ldr	r6, [r1, #4]
	ldr	r1, [r5, #16]
	b	.L13
.L11:
	mov	r1, r6
	mov	r2, r4
	bl	copyout
	mov	r10, r0
	ldr	r0, [sp, #24]
	bl	brelse
	cmp	r10, #0
	bne	.L9
.L15:
	ldr	r0, [r5, #20]
	ldr	r3, [r5, #8]
	ldr	r2, [r0, r8]
	add	ip, r0, r8
	ldr	r6, [ip, #4]
	ldr	r1, [r5, #16]
	sub	r2, r2, r4
	add	r6, r6, r4
	sub	r3, r3, r4
	add	r1, r4, r1
	cmp	r2, #0
	str	r6, [ip, #4]
	str	r2, [r0, r8]
	str	r3, [r5, #8]
	str	r1, [r5, #16]
	beq	.L26
.L13:
	ldr	r4, [r7]
	mov	r0, r7
	cmp	r2, r4
	movcc	r4, r2
	bl	fragoff
	cmp	r0, #0
	bne	.L10
	mov	r1, r4
	mov	r0, r7
	bl	fragoff
	cmp	r0, #0
	bne	.L10
	ldr	r0, [r5, #16]
	bl	btodb
	add	r3, sp, #24
	str	r3, [sp]
	ldr	r3, .L29+28
	mov	r1, r0
	mov	r2, r4
	mov	r0, r9
	ldr	r3, [r3]
	bl	bread
	subs	r10, r0, #0
	bne	.L9
	ldr	r1, [r5]
	ldr	r2, [fp]
	ldr	r3, [sp, #24]
	cmp	r1, r2
	ldr	r0, [r3, #4]
	bne	.L11
	mov	r1, r0
	mov	r2, r4
	mov	r0, r6
	bl	copyin
	subs	r10, r0, #0
	bne	.L27
	ldr	r0, [sp, #24]
	bl	bwrite
	subs	r10, r0, #0
	beq	.L15
.L9:
	ldr	r0, .L29+4
	bl	sx_sunlock
	ldr	r2, [r5, #8]
	ldr	r3, [sp, #12]
	cmp	r2, r3
	movlt	r10, #0
.L1:
	ldr	r3, .L29
	ldr	r2, [r3]
	ldr	r3, [sp, #28]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L28
	mov	r0, r10
	add	sp, sp, #36
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L24:
	ldr	r0, .L29+4
	bl	sx_sunlock
	ldr	r3, .L29+32
	ldr	r10, [r3]
	b	.L1
.L10:
	ldr	r3, .L29+36
	ldr	r10, [r3]
	b	.L9
.L26:
	ldr	r3, [r5, #12]
.L14:
	ldr	r2, [sp, #8]
	add	r2, r2, #1
	cmp	r3, r2
	str	r2, [sp, #8]
	bgt	.L6
.L7:
	mov	r10, #0
	b	.L9
.L27:
	ldr	r2, .L29+40
	ldr	r1, .L29+44
	ldr	r0, [sp, #24]
	ldr	ip, [r2]
	ldr	r1, [r1]
	ldr	r2, [r0]
	orr	r1, r1, ip
	orr	r2, r2, r1
	str	r2, [r0]
	bl	brelse
	b	.L9
.L28:
	bl	__stack_chk_fail
.L30:
	.align	2
.L29:
	.word	.LC2
	.word	ffs_susp_lock
	.word	UIO_READ
	.word	.LC0
	.word	UIO_WRITE
	.word	UIO_USERSPACE
	.word	.LC1
	.word	NOCRED
	.word	ENXIO
	.word	EINVAL
	.word	B_NOCACHE
	.word	B_INVAL
	.size	ffs_susp_rdwr, .-ffs_susp_rdwr
	.comm	ffs_susp_lock,4,4
	.comm	UIO_WRITE,4,4
	.comm	UIO_USERSPACE,4,4
	.comm	UIO_READ,4,4
	.comm	NOCRED,4,4
	.comm	ENXIO,4,4
	.comm	EINVAL,4,4
	.comm	B_NOCACHE,4,4
	.comm	B_INVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
