	.file	"extr_mpt_cam.c_fetch_scsi_capacity.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	fetch_scsi_capacity, @function
fetch_scsi_capacity:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	mov	r12, rdi
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	rbx, rsi
	sub	rsp, 16
	.cfi_def_cfa_offset 48
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	call	cam_getccb@PLT
	test	rax, rax
	je	.L13
	mov	rdi, rax
	mov	rbp, rax
	call	CCB_CLEAR_ALL_EXCEPT_HDR@PLT
	sub	rsp, 8
	.cfi_def_cfa_offset 56
	xor	edx, edx
	mov	esi, 1
	push	5000
	.cfi_def_cfa_offset 64
	mov	ecx, DWORD PTR MSG_SIMPLE_Q_TAG[rip]
	mov	rdi, rbp
	mov	r9d, DWORD PTR SSD_FULL_SIZE[rip]
	lea	r8, 16[rsp]
	call	scsi_read_capacity@PLT
	mov	eax, DWORD PTR CAM_DEV_QFRZDIS[rip]
	or	DWORD PTR 4[rbp], eax
	mov	rsi, rbp
	mov	rdi, r12
	call	cam_send_ccb@PLT
	pop	rdx
	.cfi_def_cfa_offset 56
	pop	rcx
	.cfi_def_cfa_offset 48
	test	rax, rax
	js	.L11
	mov	eax, DWORD PTR 0[rbp]
	and	eax, DWORD PTR CAM_STATUS_MASK[rip]
	cmp	eax, DWORD PTR CAM_REQ_CMP[rip]
	je	.L5
	mov	rdi, rbp
	call	cam_freeccb@PLT
	mov	r12d, DWORD PTR EIO[rip]
.L1:
	mov	rax, QWORD PTR 8[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L14
	add	rsp, 16
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	mov	eax, r12d
	pop	rbx
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	mov	edi, DWORD PTR [rsp]
	call	scsi_4btoul@PLT
	cmp	eax, -1
	jne	.L15
	mov	rdi, rbp
	call	CCB_CLEAR_ALL_EXCEPT_HDR@PLT
	mov	eax, DWORD PTR SSD_FULL_SIZE[rip]
	xor	r9d, r9d
	xor	edx, edx
	sub	rsp, 8
	.cfi_def_cfa_offset 56
	mov	ecx, DWORD PTR MSG_SIMPLE_Q_TAG[rip]
	xor	r8d, r8d
	mov	rdi, rbp
	push	5000
	.cfi_def_cfa_offset 64
	mov	esi, 1
	push	rax
	.cfi_def_cfa_offset 72
	push	4
	.cfi_def_cfa_offset 80
	lea	rax, 36[rsp]
	push	rax
	.cfi_def_cfa_offset 88
	push	0
	.cfi_def_cfa_offset 96
	call	scsi_read_capacity_16@PLT
	add	rsp, 48
	.cfi_def_cfa_offset 48
	mov	rsi, rbp
	mov	rdi, r12
	mov	eax, DWORD PTR CAM_DEV_QFRZDIS[rip]
	or	DWORD PTR 4[rbp], eax
	call	cam_send_ccb@PLT
	test	rax, rax
	js	.L11
	mov	eax, DWORD PTR 0[rbp]
	and	eax, DWORD PTR CAM_STATUS_MASK[rip]
	mov	rdi, rbp
	cmp	eax, DWORD PTR CAM_REQ_CMP[rip]
	je	.L8
	call	cam_freeccb@PLT
	mov	r12d, DWORD PTR EIO[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L13:
	mov	r12d, DWORD PTR ENOMEM[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L15:
	mov	edi, DWORD PTR [rsp]
	xor	r12d, r12d
	call	scsi_4btoul@PLT
	mov	rdi, rbp
	mov	DWORD PTR [rbx], eax
	call	cam_freeccb@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L11:
	mov	rdi, rbp
	mov	r12d, DWORD PTR errno[rip]
	call	cam_freeccb@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L8:
	call	cam_freeccb@PLT
	mov	edi, DWORD PTR 4[rsp]
	xor	r12d, r12d
	call	scsi_8btou64@PLT
	mov	DWORD PTR [rbx], eax
	jmp	.L1
.L14:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	fetch_scsi_capacity, .-fetch_scsi_capacity
	.comm	errno,4,4
	.comm	SSD_FULL_SIZE,4,4
	.comm	MSG_SIMPLE_Q_TAG,4,4
	.comm	ENOMEM,4,4
	.comm	EIO,4,4
	.comm	CAM_STATUS_MASK,4,4
	.comm	CAM_REQ_CMP,4,4
	.comm	CAM_DEV_QFRZDIS,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_mpt_cam.c_fetch_scsi_capacity.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	fetch_scsi_capacity, %function
fetch_scsi_capacity:
	@ 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, .L16
	sub	sp, sp, #60
	str	r1, [sp, #36]
	ldr	r3, [r3]
	str	r3, [sp, #52]
	mov	r3,#0
	mov	r5, r0
	bl	cam_getccb
	subs	r4, r0, #0
	beq	.L13
	ldr	r9, .L16+4
	bl	CCB_CLEAR_ALL_EXCEPT_HDR
	ldr	r7, .L16+8
	ldr	r3, [r9]
	ldr	r8, .L16+12
	add	r2, sp, #44
	ldr	r6, .L16+16
	mov	r1, #1
	str	r3, [sp, #4]
	str	r2, [sp]
	ldr	r3, [r7]
	mov	r2, #0
	mov	r0, r4
	str	r8, [sp, #8]
	bl	scsi_read_capacity
	ldr	r3, [r4, #4]
	ldr	r2, [r6]
	mov	r1, r4
	orr	r3, r3, r2
	mov	r0, r5
	str	r3, [r4, #4]
	bl	cam_send_ccb
	cmp	r0, #0
	blt	.L11
	ldr	fp, .L16+20
	ldr	r10, .L16+24
	ldr	r1, [fp]
	ldr	r3, [r4]
	ldr	r2, [r10]
	and	r3, r3, r1
	cmp	r3, r2
	beq	.L5
	mov	r0, r4
	bl	cam_freeccb
	ldr	r3, .L16+28
	ldr	r4, [r3]
.L1:
	ldr	r3, .L16
	ldr	r2, [r3]
	ldr	r3, [sp, #52]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L14
	mov	r0, r4
	add	sp, sp, #60
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L5:
	ldr	r0, [sp, #44]
	bl	scsi_4btoul
	cmn	r0, #1
	bne	.L15
	mov	r0, r4
	bl	CCB_CLEAR_ALL_EXCEPT_HDR
	mov	r2, #0
	mov	r0, #4
	ldr	r3, [r9]
	add	r1, sp, #48
	str	r3, [sp, #20]
	str	r0, [sp, #16]
	ldr	r3, [r7]
	str	r2, [sp, #8]
	str	r2, [sp, #4]
	str	r2, [sp]
	str	r1, [sp, #12]
	mov	r0, r4
	mov	r1, #1
	str	r8, [sp, #24]
	bl	scsi_read_capacity_16
	ldr	r1, [r6]
	ldr	r3, [r4, #4]
	mov	r0, r5
	orr	r3, r3, r1
	str	r3, [r4, #4]
	mov	r1, r4
	bl	cam_send_ccb
	cmp	r0, #0
	blt	.L11
	ldr	r0, [fp]
	ldr	r3, [r4]
	ldr	r1, [r10]
	and	r3, r3, r0
	cmp	r3, r1
	mov	r0, r4
	beq	.L8
	bl	cam_freeccb
	ldr	r3, .L16+28
	ldr	r4, [r3]
	b	.L1
.L13:
	ldr	r3, .L16+32
	ldr	r4, [r3]
	b	.L1
.L15:
	ldr	r0, [sp, #44]
	bl	scsi_4btoul
	mov	r3, r0
	ldr	r2, [sp, #36]
	mov	r0, r4
	str	r3, [r2]
	bl	cam_freeccb
	mov	r4, #0
	b	.L1
.L11:
	ldr	r3, .L16+36
	mov	r0, r4
	ldr	r4, [r3]
	bl	cam_freeccb
	b	.L1
.L8:
	bl	cam_freeccb
	ldr	r0, [sp, #48]
	bl	scsi_8btou64
	mov	r2, #0
	ldr	r3, [sp, #36]
	mov	r4, r2
	str	r0, [r3]
	b	.L1
.L14:
	bl	__stack_chk_fail
.L17:
	.align	2
.L16:
	.word	.LC0
	.word	SSD_FULL_SIZE
	.word	MSG_SIMPLE_Q_TAG
	.word	5000
	.word	CAM_DEV_QFRZDIS
	.word	CAM_STATUS_MASK
	.word	CAM_REQ_CMP
	.word	EIO
	.word	ENOMEM
	.word	errno
	.size	fetch_scsi_capacity, .-fetch_scsi_capacity
	.comm	errno,4,4
	.comm	SSD_FULL_SIZE,4,4
	.comm	MSG_SIMPLE_Q_TAG,4,4
	.comm	ENOMEM,4,4
	.comm	EIO,4,4
	.comm	CAM_STATUS_MASK,4,4
	.comm	CAM_REQ_CMP,4,4
	.comm	CAM_DEV_QFRZDIS,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
