	.file	"extr_libata-scsi.c_atapi_qc_complete.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"ENTER, err_mask 0x%X\n"
	.text
	.p2align 4
	.type	atapi_qc_complete, @function
atapi_qc_complete:
.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
	mov	rbp, rdi
	sub	rsp, 16
	.cfi_def_cfa_offset 48
	mov	r12d, DWORD PTR [rdi]
	mov	r13, QWORD PTR 24[rdi]
	lea	rdi, .LC0[rip]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	mov	esi, r12d
	call	VPRINTK@PLT
	mov	rax, QWORD PTR 40[rbp]
	xor	edi, edi
	mov	rax, QWORD PTR [rax]
	cmp	QWORD PTR [rax], 0
	je	.L2
	mov	edi, 1
	test	r12d, r12d
	je	.L17
.L2:
	call	unlikely@PLT
	test	rax, rax
	je	.L3
.L21:
	mov	eax, DWORD PTR 4[rbp]
	test	DWORD PTR ATA_QCFLAG_SENSE_VALID[rip], eax
	je	.L18
	mov	rax, QWORD PTR 8[rbp]
	mov	rcx, QWORD PTR ALLOW_MEDIUM_REMOVAL[rip]
	cmp	QWORD PTR [rax], rcx
	je	.L19
.L5:
	mov	rax, QWORD PTR 24[rbp]
	mov	rdx, QWORD PTR SAM_STAT_CHECK_CONDITION[rip]
	mov	rdi, r13
	mov	QWORD PTR 8[rax], rdx
	call	[QWORD PTR 16[rbp]]
	mov	rdi, rbp
	call	ata_qc_free@PLT
.L1:
	mov	rax, QWORD PTR 8[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L20
	add	rsp, 16
	.cfi_remember_state
	.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
	.p2align 4,,10
	.p2align 3
.L17:
	.cfi_restore_state
	xor	edi, edi
	mov	eax, DWORD PTR 4[rbp]
	test	DWORD PTR ATA_QCFLAG_SENSE_VALID[rip], eax
	setne	dil
	call	unlikely@PLT
	test	rax, rax
	jne	.L21
.L3:
	mov	edi, DWORD PTR AC_ERR_DEV[rip]
	and	edi, r12d
	call	unlikely@PLT
	test	rax, rax
	jne	.L22
	mov	edi, r12d
	call	unlikely@PLT
	test	rax, rax
	jne	.L23
	mov	rax, QWORD PTR 0[r13]
	mov	ecx, DWORD PTR INQUIRY[rip]
	cmp	DWORD PTR [rax], ecx
	je	.L24
.L10:
	mov	rax, QWORD PTR SAM_STAT_GOOD[rip]
	mov	QWORD PTR 8[r13], rax
.L9:
	mov	rdi, r13
	call	[QWORD PTR 16[rbp]]
	mov	rdi, rbp
	call	ata_qc_free@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L19:
	mov	rax, QWORD PTR 32[rbp]
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR [rax], 0
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L18:
	mov	rdi, rbp
	call	ata_gen_passthru_sense@PLT
	mov	rax, QWORD PTR 8[rbp]
	mov	rcx, QWORD PTR ALLOW_MEDIUM_REMOVAL[rip]
	cmp	QWORD PTR [rax], rcx
	jne	.L5
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L24:
	test	BYTE PTR 4[rax], 3
	jne	.L10
	mov	r12, rsp
	mov	esi, 1
	mov	rdi, r13
	mov	rdx, r12
	call	ata_scsi_rbuf_get@PLT
	mov	edx, DWORD PTR 8[rax]
	test	edx, edx
	jne	.L11
	movabs	rsi, 214748364805
	mov	QWORD PTR 8[rax], rsi
.L11:
	mov	rdx, r12
	mov	esi, 1
	mov	rdi, r13
	call	ata_scsi_rbuf_put@PLT
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L22:
	mov	rax, QWORD PTR SAM_STAT_CHECK_CONDITION[rip]
	mov	rdi, rbp
	mov	QWORD PTR 8[r13], rax
	call	atapi_request_sense@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L23:
	mov	rdi, rbp
	call	ata_gen_passthru_sense@PLT
	jmp	.L9
.L20:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	atapi_qc_complete, .-atapi_qc_complete
	.comm	SAM_STAT_GOOD,8,8
	.comm	SAM_STAT_CHECK_CONDITION,8,8
	.comm	INQUIRY,4,4
	.comm	ATA_QCFLAG_SENSE_VALID,4,4
	.comm	ALLOW_MEDIUM_REMOVAL,8,8
	.comm	AC_ERR_DEV,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_libata-scsi.c_atapi_qc_complete.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"ENTER, err_mask 0x%X\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC1:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	atapi_qc_complete, %function
atapi_qc_complete:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	mov	r4, r0
	ldr	r5, [r0]
	ldr	r3, .L24
	sub	sp, sp, #8
	mov	r1, r5
	ldr	r0, .L24+4
	ldr	r3, [r3]
	str	r3, [sp, #4]
	mov	r3,#0
	ldr	r6, [r4, #16]
	bl	VPRINTK
	ldr	r3, [r4, #24]
	ldr	r3, [r3]
	ldr	r0, [r3]
	cmp	r0, #0
	beq	.L2
	cmp	r5, #0
	movne	r0, #1
	beq	.L17
.L2:
	bl	unlikely
	cmp	r0, #0
	beq	.L3
.L20:
	ldr	r3, .L24+8
	ldr	r2, [r4, #4]
	ldr	r3, [r3]
	tst	r2, r3
	beq	.L18
.L4:
	ldr	r2, [r4, #8]
	ldr	r3, .L24+12
	ldr	r2, [r2]
	ldr	r3, [r3]
	mov	r0, r6
	cmp	r2, r3
	moveq	r2, #0
	ldreq	r3, [r4, #20]
	ldreq	r3, [r3]
	streq	r2, [r3]
	ldr	r2, .L24+16
	ldr	r3, [r4, #16]
	ldr	r2, [r2]
	str	r2, [r3, #4]
	ldr	r3, [r4, #12]
	blx	r3
	mov	r0, r4
	bl	ata_qc_free
.L1:
	ldr	r3, .L24
	ldr	r2, [r3]
	ldr	r3, [sp, #4]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L19
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, pc}
.L17:
	ldr	r3, .L24+8
	ldr	r2, [r4, #4]
	ldr	r3, [r3]
	tst	r2, r3
	movne	r0, #1
	moveq	r0, #0
	bl	unlikely
	cmp	r0, #0
	bne	.L20
.L3:
	ldr	r3, .L24+20
	ldr	r0, [r3]
	and	r0, r0, r5
	bl	unlikely
	cmp	r0, #0
	bne	.L21
	mov	r0, r5
	bl	unlikely
	cmp	r0, #0
	bne	.L22
	ldr	r3, [r6]
	ldr	r2, .L24+24
	ldr	r1, [r3]
	ldr	r2, [r2]
	cmp	r1, r2
	beq	.L23
.L10:
	ldr	r3, .L24+28
	ldr	r3, [r3]
	str	r3, [r6, #4]
.L9:
	mov	r0, r6
	ldr	r3, [r4, #12]
	blx	r3
	mov	r0, r4
	bl	ata_qc_free
	b	.L1
.L18:
	mov	r0, r4
	bl	ata_gen_passthru_sense
	b	.L4
.L23:
	ldr	r3, [r3, #4]
	tst	r3, #3
	bne	.L10
	mov	r2, sp
	mov	r1, #1
	mov	r0, r6
	bl	ata_scsi_rbuf_get
	ldr	r3, [r0, #8]
	mov	r1, #1
	cmp	r3, #0
	moveq	r2, #5
	moveq	r3, #50
	streq	r2, [r0, #8]
	streq	r3, [r0, #12]
	mov	r2, sp
	mov	r0, r6
	bl	ata_scsi_rbuf_put
	b	.L10
.L21:
	ldr	r3, .L24+16
	mov	r0, r4
	ldr	r3, [r3]
	str	r3, [r6, #4]
	bl	atapi_request_sense
	b	.L1
.L22:
	mov	r0, r4
	bl	ata_gen_passthru_sense
	b	.L9
.L19:
	bl	__stack_chk_fail
.L25:
	.align	2
.L24:
	.word	.LC1
	.word	.LC0
	.word	ATA_QCFLAG_SENSE_VALID
	.word	ALLOW_MEDIUM_REMOVAL
	.word	SAM_STAT_CHECK_CONDITION
	.word	AC_ERR_DEV
	.word	INQUIRY
	.word	SAM_STAT_GOOD
	.size	atapi_qc_complete, .-atapi_qc_complete
	.comm	SAM_STAT_GOOD,4,4
	.comm	SAM_STAT_CHECK_CONDITION,4,4
	.comm	INQUIRY,4,4
	.comm	ATA_QCFLAG_SENSE_VALID,4,4
	.comm	ALLOW_MEDIUM_REMOVAL,4,4
	.comm	AC_ERR_DEV,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
