	.file	"extr_pci_ahci.c_handle_atapi_identify.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"001"
.LC1:
	.string	"BHYVE SATA DVD ROM"
	.text
	.p2align 4
	.type	handle_atapi_identify, @function
handle_atapi_identify:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	mov	r13, rdx
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	mov	r12d, esi
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	mov	rbp, rdi
	sub	rsp, 1048
	.cfi_def_cfa_offset 1088
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 1032[rsp], rax
	xor	eax, eax
	mov	eax, DWORD PTR 16[rdi]
	test	eax, eax
	jne	.L2
	mov	eax, DWORD PTR ATA_E_ABORT[rip]
	mov	ecx, DWORD PTR ATA_S_READY[rip]
	or	ecx, DWORD PTR ATA_S_ERROR[rip]
	sal	eax, 8
	or	ecx, eax
	call	ahci_write_fis_d2h@PLT
.L1:
	mov	rax, QWORD PTR 1032[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L15
	add	rsp, 1048
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	r14, rsp
	mov	edx, 1024
	xor	esi, esi
	mov	rdi, r14
	call	memset@PLT
	mov	rsi, QWORD PTR 0[rbp]
	lea	rdi, 40[rsp]
	mov	edx, 20
	mov	DWORD PTR [rsp], 34240
	call	ata_string@PLT
	lea	rdi, 92[rsp]
	mov	edx, 8
	lea	rsi, .LC0[rip]
	call	ata_string@PLT
	mov	edx, 40
	lea	rdi, 108[rsp]
	lea	rsi, .LC1[rip]
	call	ata_string@PLT
	mov	edx, DWORD PTR 8[rbp]
	movabs	rax, 70373039145728
	mov	DWORD PTR 212[rsp], 6
	mov	QWORD PTR 196[rsp], rax
	movabs	rax, 30064771135
	mov	QWORD PTR 248[rsp], rax
	test	DWORD PTR ATA_WDMA0[rip], edx
	je	.L4
	mov	ecx, edx
	mov	eax, 1
	and	ecx, 7
	add	ecx, 8
	sal	eax, cl
	or	eax, 7
	mov	DWORD PTR 252[rsp], eax
.L4:
	movabs	rax, 515396075523
	movabs	rsi, 70368744194048
	mov	DWORD PTR 272[rsp], 120
	mov	QWORD PTR 256[rsp], rax
	add	rax, 117
	mov	QWORD PTR 264[rsp], rax
	mov	eax, DWORD PTR ATA_SATA_GEN1[rip]
	or	eax, DWORD PTR ATA_SATA_GEN2[rip]
	or	eax, DWORD PTR ATA_SATA_GEN3[rip]
	mov	DWORD PTR 312[rsp], 32
	mov	DWORD PTR 304[rsp], eax
	mov	eax, DWORD PTR 12[rbp]
	and	eax, DWORD PTR ATA_SS_SPD_MASK[rip]
	mov	QWORD PTR 332[rsp], rsi
	mov	DWORD PTR 320[rsp], 1008
	sar	eax, 3
	mov	DWORD PTR 308[rsp], eax
	mov	eax, DWORD PTR ATA_SUPPORT_POWERMGT[rip]
	or	eax, DWORD PTR ATA_SUPPORT_PACKET[rip]
	or	eax, DWORD PTR ATA_SUPPORT_RESET[rip]
	or	eax, DWORD PTR ATA_SUPPORT_NOP[rip]
	mov	DWORD PTR 328[rsp], eax
	mov	DWORD PTR 340[rsp], eax
	movabs	rax, 545460862976
	mov	QWORD PTR 348[rsp], rax
	test	DWORD PTR ATA_UDMA0[rip], edx
	je	.L5
	and	edx, 7
	mov	eax, 1
	lea	ecx, 8[rdx]
	sal	eax, cl
	or	eax, 127
	mov	DWORD PTR 352[rsp], eax
.L5:
	mov	esi, 1024
	mov	rdi, r14
	mov	DWORD PTR 888[rsp], 4128
	mov	DWORD PTR 1020[rsp], 165
	call	ahci_checksum@PLT
	mov	rdi, rbp
	call	ahci_write_fis_piosetup@PLT
	mov	rcx, r14
	mov	rdx, r13
	mov	esi, r12d
	mov	rdi, rbp
	mov	r8d, 1024
	call	write_prdt@PLT
	mov	rdx, r13
	mov	esi, r12d
	mov	rdi, rbp
	mov	ecx, DWORD PTR ATA_S_DSC[rip]
	or	ecx, DWORD PTR ATA_S_READY[rip]
	call	ahci_write_fis_d2h@PLT
	jmp	.L1
.L15:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	handle_atapi_identify, .-handle_atapi_identify
	.comm	ATA_WDMA0,4,4
	.comm	ATA_UDMA0,4,4
	.comm	ATA_S_READY,4,4
	.comm	ATA_S_ERROR,4,4
	.comm	ATA_S_DSC,4,4
	.comm	ATA_SUPPORT_RESET,4,4
	.comm	ATA_SUPPORT_POWERMGT,4,4
	.comm	ATA_SUPPORT_PACKET,4,4
	.comm	ATA_SUPPORT_NOP,4,4
	.comm	ATA_SS_SPD_MASK,4,4
	.comm	ATA_SATA_GEN3,4,4
	.comm	ATA_SATA_GEN2,4,4
	.comm	ATA_SATA_GEN1,4,4
	.comm	ATA_E_ABORT,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_pci_ahci.c_handle_atapi_identify.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"001\000"
	.align	2
.LC1:
	.ascii	"BHYVE SATA DVD ROM\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC2:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	handle_atapi_identify, %function
handle_atapi_identify:
	@ args = 0, pretend = 0, frame = 1032
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, lr}
	ldr	r3, [r0, #12]
	ldr	ip, .L16
	sub	sp, sp, #1040
	sub	sp, sp, #4
	cmp	r3, #0
	ldr	ip, [ip]
	str	ip, [sp, #1036]
	mov	ip,#0
	bne	.L2
	ldr	ip, .L16+4
	ldr	r3, .L16+8
	ldr	lr, .L16+12
	ldr	ip, [ip]
	ldr	r3, [r3]
	ldr	lr, [lr]
	orr	r3, ip, r3
	orr	r3, r3, lr, lsl #8
	bl	ahci_write_fis_d2h
.L1:
	ldr	r3, .L16
	ldr	r2, [r3]
	ldr	r3, [sp, #1036]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L15
	add	sp, sp, #1040
	add	sp, sp, #4
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, pc}
.L2:
	mov	r4, r0
	mov	r5, r1
	mov	r6, r2
	mov	r1, #0
	mov	r2, #1024
	add	r0, sp, #12
	bl	memset
	ldr	r3, .L16+16
	mov	r2, #20
	ldr	r1, [r4]
	add	r0, sp, #52
	str	r3, [sp, #12]
	bl	ata_string
	mov	r2, #8
	ldr	r1, .L16+20
	add	r0, sp, #104
	bl	ata_string
	mov	r2, #40
	ldr	r1, .L16+24
	add	r0, sp, #120
	bl	ata_string
	mov	r3, #6
	mov	lr, #768
	mov	r0, #63
	mov	r1, #7
	ldr	ip, .L16+28
	ldr	r2, [r4, #4]
	ldr	ip, [ip]
	str	r3, [sp, #224]
	ldr	r3, .L16+32
	tst	r2, ip
	str	lr, [sp, #208]
	str	r0, [sp, #260]
	str	r1, [sp, #264]
	str	r3, [sp, #212]
	beq	.L4
	mov	r3, #1
	and	r1, r2, r1
	add	r1, r1, #8
	lsl	r3, r3, r1
	orr	r3, r3, #7
	str	r3, [sp, #264]
.L4:
	mov	lr, #120
	mov	r7, #32
	mov	r9, #3
	mov	r1, #16384
	mov	ip, #1008
	mov	r0, #127
	ldr	r3, .L16+36
	ldr	r8, .L16+40
	ldr	r3, [r3]
	ldr	r8, [r8]
	str	lr, [sp, #272]
	orr	r3, r3, r8
	ldr	r8, .L16+44
	str	lr, [sp, #276]
	ldr	r8, [r8]
	str	lr, [sp, #280]
	orr	r3, r3, r8
	ldr	r8, .L16+48
	str	lr, [sp, #284]
	ldr	r8, [r8]
	ldr	lr, .L16+52
	orr	r3, r3, r8
	ldr	r8, .L16+56
	ldr	lr, [lr]
	str	r3, [sp, #340]
	str	r3, [sp, #352]
	ldr	r3, [r8]
	str	r7, [sp, #324]
	orr	lr, lr, r3
	ldr	r3, .L16+60
	ldr	r7, .L16+64
	ldr	r3, [r3]
	ldr	r8, .L16+68
	orr	lr, lr, r3
	ldr	r7, [r7]
	ldr	r3, [r4, #8]
	str	lr, [sp, #316]
	ldr	lr, [r8]
	and	r3, r3, r7
	asr	r3, r3, r9
	tst	r2, lr
	str	r9, [sp, #268]
	str	r3, [sp, #320]
	str	ip, [sp, #332]
	str	r1, [sp, #344]
	str	r1, [sp, #348]
	str	r1, [sp, #360]
	str	r0, [sp, #364]
	beq	.L5
	mov	r3, #1
	and	r2, r2, #7
	add	r2, r2, #8
	lsl	r2, r3, r2
	orr	r2, r2, r0
	str	r2, [sp, #364]
.L5:
	mov	r2, #165
	ldr	r3, .L16+72
	mov	r1, #1024
	add	r0, sp, #12
	str	r2, [sp, #1032]
	str	r3, [sp, #900]
	bl	ahci_checksum
	mov	r0, r4
	bl	ahci_write_fis_piosetup
	mov	r2, #1024
	mov	r1, r5
	add	r3, sp, #12
	str	r2, [sp]
	mov	r0, r4
	mov	r2, r6
	bl	write_prdt
	ldr	r2, .L16+76
	ldr	r3, .L16+4
	ldr	ip, [r2]
	ldr	r3, [r3]
	mov	r2, r6
	mov	r1, r5
	mov	r0, r4
	orr	r3, ip, r3
	bl	ahci_write_fis_d2h
	b	.L1
.L15:
	bl	__stack_chk_fail
.L17:
	.align	2
.L16:
	.word	.LC2
	.word	ATA_S_READY
	.word	ATA_S_ERROR
	.word	ATA_E_ABORT
	.word	34240
	.word	.LC0
	.word	.LC1
	.word	ATA_WDMA0
	.word	16385
	.word	ATA_SUPPORT_POWERMGT
	.word	ATA_SUPPORT_PACKET
	.word	ATA_SUPPORT_RESET
	.word	ATA_SUPPORT_NOP
	.word	ATA_SATA_GEN1
	.word	ATA_SATA_GEN2
	.word	ATA_SATA_GEN3
	.word	ATA_SS_SPD_MASK
	.word	ATA_UDMA0
	.word	4128
	.word	ATA_S_DSC
	.size	handle_atapi_identify, .-handle_atapi_identify
	.comm	ATA_WDMA0,4,4
	.comm	ATA_UDMA0,4,4
	.comm	ATA_S_READY,4,4
	.comm	ATA_S_ERROR,4,4
	.comm	ATA_S_DSC,4,4
	.comm	ATA_SUPPORT_RESET,4,4
	.comm	ATA_SUPPORT_POWERMGT,4,4
	.comm	ATA_SUPPORT_PACKET,4,4
	.comm	ATA_SUPPORT_NOP,4,4
	.comm	ATA_SS_SPD_MASK,4,4
	.comm	ATA_SATA_GEN3,4,4
	.comm	ATA_SATA_GEN2,4,4
	.comm	ATA_SATA_GEN1,4,4
	.comm	ATA_E_ABORT,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
