	.file	"extr_ubd_kern.c_ubd_remove.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	ubd_remove, @function
ubd_remove:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movsx	rbx, edi
	lea	rdi, ubd_lock[rip]
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	mov	rax, QWORD PTR ubd_gendisk[rip]
	mov	r12d, DWORD PTR ENODEV[rip]
	mov	r13, QWORD PTR [rax+rbx*8]
	call	mutex_lock@PLT
	mov	rax, QWORD PTR ubd_devs[rip]
	lea	rdx, [rbx+rbx*2]
	lea	rbp, [rax+rdx*8]
	cmp	QWORD PTR 16[rbp], 0
	je	.L14
	cmp	QWORD PTR 0[rbp], 0
	jg	.L16
	mov	rax, QWORD PTR ubd_gendisk[rip]
	mov	QWORD PTR [rax+rbx*8], 0
	test	r13, r13
	je	.L5
	mov	rdi, r13
	call	del_gendisk@PLT
	mov	rdi, r13
	call	put_disk@PLT
.L5:
	mov	rax, QWORD PTR fake_gendisk[rip]
	mov	rdi, QWORD PTR [rax+rbx*8]
	test	rdi, rdi
	je	.L6
	call	del_gendisk@PLT
	mov	rax, QWORD PTR fake_gendisk[rip]
	mov	rdi, QWORD PTR [rax+rbx*8]
	call	put_disk@PLT
	mov	rax, QWORD PTR fake_gendisk[rip]
	mov	QWORD PTR [rax+rbx*8], 0
.L6:
	lea	rdi, 8[rbp]
	xor	r12d, r12d
	call	platform_device_unregister@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L16:
	mov	r12d, DWORD PTR EBUSY[rip]
.L14:
	neg	r12d
.L3:
	lea	rdi, ubd_lock[rip]
	call	mutex_unlock@PLT
	add	rsp, 8
	.cfi_def_cfa_offset 40
	mov	eax, r12d
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	ubd_remove, .-ubd_remove
	.comm	ubd_lock,4,4
	.comm	ubd_gendisk,8,8
	.comm	ubd_devs,8,8
	.comm	fake_gendisk,8,8
	.comm	ENODEV,4,4
	.comm	EBUSY,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_ubd_kern.c_ubd_remove.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ubd_remove, %function
ubd_remove:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r4, r0
	ldr	r8, .L16
	ldr	r3, .L16+4
	ldr	r2, [r8]
	ldr	r0, .L16+8
	ldr	r6, [r2, r4, lsl #2]
	ldr	r7, [r3]
	bl	mutex_lock
	ldr	r3, .L16+12
	add	r0, r4, r4, lsl #1
	ldr	r3, [r3]
	add	r5, r3, r0, lsl #2
	ldr	r2, [r5, #8]
	cmp	r2, #0
	rsbeq	r4, r7, #0
	beq	.L3
	lsl	r1, r0, #2
	ldr	r3, [r3, r1]
	cmp	r3, #0
	bgt	.L15
	mov	r2, #0
	ldr	r3, [r8]
	cmp	r6, r2
	str	r2, [r3, r4, lsl #2]
	beq	.L5
	mov	r0, r6
	bl	del_gendisk
	mov	r0, r6
	bl	put_disk
.L5:
	ldr	r6, .L16+16
	ldr	r3, [r6]
	ldr	r0, [r3, r4, lsl #2]
	cmp	r0, #0
	beq	.L6
	bl	del_gendisk
	ldr	r3, [r6]
	ldr	r0, [r3, r4, lsl #2]
	bl	put_disk
	mov	r2, #0
	ldr	r3, [r6]
	str	r2, [r3, r4, lsl #2]
.L6:
	add	r0, r5, #4
	bl	platform_device_unregister
	mov	r4, #0
.L3:
	ldr	r0, .L16+8
	bl	mutex_unlock
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, pc}
.L15:
	ldr	r3, .L16+20
	ldr	r4, [r3]
	rsb	r4, r4, #0
	b	.L3
.L17:
	.align	2
.L16:
	.word	ubd_gendisk
	.word	ENODEV
	.word	ubd_lock
	.word	ubd_devs
	.word	fake_gendisk
	.word	EBUSY
	.size	ubd_remove, .-ubd_remove
	.comm	ubd_lock,4,4
	.comm	ubd_gendisk,4,4
	.comm	ubd_devs,4,4
	.comm	fake_gendisk,4,4
	.comm	ENODEV,4,4
	.comm	EBUSY,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
