	.file	"extr_ctl_backend_ramdisk.c_ctl_backend_ramdisk_ws.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	ctl_backend_ramdisk_ws, @function
ctl_backend_ramdisk_ws:
.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
	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
	call	CTL_BACKEND_LUN@PLT
	mov	rdi, rbp
	mov	r12, QWORD PTR 16[rax]
	mov	r15, rax
	call	ARGS@PLT
	mov	ecx, DWORD PTR SWS_UNMAP[rip]
	mov	esi, DWORD PTR SWS_ANCHOR[rip]
	mov	edx, DWORD PTR [rax]
	mov	rbx, rax
	mov	eax, DWORD PTR SWS_LBDATA[rip]
	or	eax, ecx
	or	eax, esi
	or	eax, DWORD PTR SWS_NDOB[rip]
	not	eax
	test	eax, edx
	jne	.L21
	mov	r14, QWORD PTR 8[rbx]
	mov	r8, QWORD PTR 16[rbx]
	test	edx, ecx
	jne	.L22
	lea	rax, [r14+r8]
	mov	QWORD PTR 8[rsp], rax
	test	r8, r8
	jg	.L10
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L24:
	xor	esi, esi
	mov	rdi, r13
	call	memset@PLT
	mov	eax, DWORD PTR [rbx]
	test	DWORD PTR SWS_LBDATA[rip], eax
	jne	.L23
.L9:
	add	r14, 1
	cmp	r14, QWORD PTR 8[rsp]
	je	.L19
.L10:
	mov	rcx, QWORD PTR [r15]
	mov	edx, DWORD PTR GP_WRITE[rip]
	mov	rsi, r14
	mov	rdi, r12
	sar	rsi, cl
	call	ctl_backend_ramdisk_getpage@PLT
	cmp	QWORD PTR P_UNMAPPED[rip], rax
	je	.L5
	cmp	QWORD PTR P_ANCHORED[rip], rax
	je	.L5
	mov	rcx, QWORD PTR [r15]
	mov	rdx, QWORD PTR UINT_MAX[rip]
	mov	r8, QWORD PTR 8[r15]
	sal	rdx, cl
	not	rdx
	and	rdx, r14
	imul	rdx, r8
	lea	r13, [rax+rdx*4]
	mov	eax, DWORD PTR [rbx]
	mov	rdx, r8
	test	DWORD PTR SWS_NDOB[rip], eax
	jne	.L24
	mov	esi, DWORD PTR 0[rbp]
	mov	rdi, r13
	call	memcpy@PLT
	mov	eax, DWORD PTR [rbx]
	test	DWORD PTR SWS_LBDATA[rip], eax
	je	.L9
.L23:
	mov	rdi, r14
	mov	rsi, r13
	add	r14, 1
	call	scsi_ulto4b@PLT
	cmp	r14, QWORD PTR 8[rsp]
	jne	.L10
	.p2align 4,,10
	.p2align 3
.L19:
	mov	rdi, rbp
	call	ctl_set_success@PLT
.L18:
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	rdi, rbp
	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
	jmp	ctl_config_write_done@PLT
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	mov	rdi, rbp
	call	ctl_set_space_alloc_fail@PLT
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	rdi, rbp
	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
	jmp	ctl_data_submit_done@PLT
	.p2align 4,,10
	.p2align 3
.L21:
	.cfi_restore_state
	xor	r9d, r9d
	xor	r8d, r8d
	mov	ecx, 1
	mov	edx, 1
	mov	esi, 1
	mov	rdi, rbp
	call	ctl_set_invalid_field@PLT
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L22:
	xor	ecx, ecx
	test	edx, esi
	mov	rdi, r15
	mov	rdx, r8
	setne	cl
	mov	rsi, r14
	call	ctl_backend_ramdisk_delete@PLT
	jmp	.L19
	.cfi_endproc
.LFE0:
	.size	ctl_backend_ramdisk_ws, .-ctl_backend_ramdisk_ws
	.comm	UINT_MAX,8,8
	.comm	SWS_UNMAP,4,4
	.comm	SWS_NDOB,4,4
	.comm	SWS_LBDATA,4,4
	.comm	SWS_ANCHOR,4,4
	.comm	P_UNMAPPED,8,8
	.comm	P_ANCHORED,8,8
	.comm	GP_WRITE,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_ctl_backend_ramdisk.c_ctl_backend_ramdisk_ws.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ctl_backend_ramdisk_ws, %function
ctl_backend_ramdisk_ws:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	sub	sp, sp, #28
	mov	r4, r0
	str	r0, [sp, #20]
	bl	CTL_BACKEND_LUN
	mov	r9, r0
	ldr	r3, [r9, #8]
	mov	r0, r4
	str	r3, [sp, #12]
	bl	ARGS
	mov	r6, r0
	ldr	r2, .L24
	ldr	r8, .L24+4
	ldr	r1, .L24+8
	ldr	r0, [r2]
	ldr	r7, .L24+12
	ldr	r2, [r8]
	ldr	ip, [r1]
	ldr	lr, [r7]
	orr	r2, r0, r2
	ldr	r1, [r6]
	orr	r2, r2, ip
	orr	r2, r2, lr
	bics	r3, r1, r2
	bne	.L20
	tst	r1, r0
	ldr	r5, [r6, #4]
	ldr	r2, [r6, #8]
	bne	.L21
	cmp	r2, #0
	ble	.L18
	add	r3, r5, r2
	ldr	r10, .L24+16
	ldr	fp, .L24+20
	str	r3, [sp, #16]
	b	.L10
.L23:
	mov	r1, #0
	mov	r0, r4
	bl	memset
	ldr	r1, [r6]
	ldr	r2, [r8]
	tst	r1, r2
	bne	.L22
.L9:
	ldr	r3, [sp, #16]
	add	r5, r5, #1
	cmp	r5, r3
	beq	.L18
.L10:
	ldr	r1, [r9]
	ldr	r3, .L24+24
	ldr	r0, [sp, #12]
	ldr	r2, [r3]
	asr	r1, r5, r1
	bl	ctl_backend_ramdisk_getpage
	ldr	r2, [r10]
	cmp	r2, r0
	beq	.L5
	ldr	r2, [fp]
	cmp	r2, r0
	beq	.L5
	ldm	r9, {r1, r2}
	ldr	r3, .L24+28
	ldr	ip, [r6]
	ldr	r4, [r3]
	bic	r4, r5, r4, lsl r1
	mul	r4, r2, r4
	ldr	r1, [r7]
	add	r4, r0, r4, lsl #2
	tst	ip, r1
	bne	.L23
	ldr	r3, [sp, #20]
	mov	r0, r4
	ldr	r1, [r3]
	bl	memcpy
	ldr	r1, [r6]
	ldr	r2, [r8]
	tst	r1, r2
	beq	.L9
.L22:
	mov	r0, r5
	mov	r1, r4
	bl	scsi_ulto4b
	ldr	r3, [sp, #16]
	add	r5, r5, #1
	cmp	r5, r3
	bne	.L10
.L18:
	ldr	r4, [sp, #20]
	mov	r0, r4
	bl	ctl_set_success
	mov	r0, r4
	add	sp, sp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	b	ctl_config_write_done
.L5:
	ldr	r4, [sp, #20]
	mov	r0, r4
	bl	ctl_set_space_alloc_fail
	mov	r0, r4
	add	sp, sp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	b	ctl_data_submit_done
.L20:
	mov	r3, #1
	mov	r2, #0
	ldr	r4, [sp, #20]
	str	r2, [sp, #4]
	str	r2, [sp]
	mov	r1, r3
	mov	r2, r3
	mov	r0, r4
	bl	ctl_set_invalid_field
	mov	r0, r4
	add	sp, sp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	b	ctl_config_write_done
.L21:
	tst	r1, ip
	mov	r0, r9
	mov	r1, r5
	movne	r3, #1
	moveq	r3, #0
	bl	ctl_backend_ramdisk_delete
	b	.L18
.L25:
	.align	2
.L24:
	.word	SWS_UNMAP
	.word	SWS_LBDATA
	.word	SWS_ANCHOR
	.word	SWS_NDOB
	.word	P_UNMAPPED
	.word	P_ANCHORED
	.word	GP_WRITE
	.word	UINT_MAX
	.size	ctl_backend_ramdisk_ws, .-ctl_backend_ramdisk_ws
	.comm	UINT_MAX,4,4
	.comm	SWS_UNMAP,4,4
	.comm	SWS_NDOB,4,4
	.comm	SWS_LBDATA,4,4
	.comm	SWS_ANCHOR,4,4
	.comm	P_UNMAPPED,4,4
	.comm	P_ANCHORED,4,4
	.comm	GP_WRITE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
