	.file	"extr_mpt.c_mpt_recv_handshake_reply.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"mpt_recv_handshake_cmd timeout1\n"
	.align 8
.LC1:
	.string	"mpt_recv_handshake_cmd timeout2\n"
	.align 8
.LC2:
	.string	"reply length does not match message length: got %x; expected %zx for function %x\n"
	.align 8
.LC3:
	.string	"mpt_recv_handshake_cmd timeout3\n"
	.align 8
.LC4:
	.string	"mpt_recv_handshake_cmd timeout4\n"
	.text
	.p2align 4
	.globl	mpt_recv_handshake_reply
	.type	mpt_recv_handshake_reply, @function
mpt_recv_handshake_reply:
.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
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	mov	r12, rdx
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	rbx, rsi
	call	mpt_wait_db_int@PLT
	cmp	rax, QWORD PTR MPT_OK[rip]
	je	.L2
	lea	rsi, .LC0[rip]
	mov	rdi, rbp
	xor	eax, eax
	call	mpt_prt@PLT
	mov	eax, DWORD PTR ETIMEDOUT[rip]
.L1:
	pop	rbx
	.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	esi, DWORD PTR MPT_OFFSET_DOORBELL[rip]
	mov	rdi, rbp
	call	mpt_read@PLT
	and	eax, DWORD PTR MPT_DB_DATA_MASK[rip]
	mov	edi, eax
	call	le16toh@PLT
	xor	edx, edx
	mov	rdi, rbp
	mov	DWORD PTR [r12], eax
	mov	esi, DWORD PTR MPT_OFFSET_INTR_STATUS[rip]
	call	mpt_write@PLT
	mov	rdi, rbp
	call	mpt_wait_db_int@PLT
	cmp	rax, QWORD PTR MPT_OK[rip]
	je	.L4
	mov	rdi, rbp
	lea	rsi, .LC1[rip]
	xor	eax, eax
	call	mpt_prt@PLT
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, DWORD PTR ETIMEDOUT[rip]
	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
.L4:
	.cfi_restore_state
	mov	esi, DWORD PTR MPT_OFFSET_DOORBELL[rip]
	mov	rdi, rbp
	lea	r13, 8[r12]
	call	mpt_read@PLT
	and	eax, DWORD PTR MPT_DB_DATA_MASK[rip]
	mov	edi, eax
	call	le16toh@PLT
	mov	esi, DWORD PTR MPT_OFFSET_INTR_STATUS[rip]
	xor	edx, edx
	mov	rdi, rbp
	mov	DWORD PTR 4[r12], eax
	call	mpt_write@PLT
	mov	rax, rbx
	mov	rdx, QWORD PTR [r12]
	shr	rax, 2
	cmp	rax, rdx
	je	.L5
	mov	r8, QWORD PTR 8[r12]
	cmp	r8, QWORD PTR MPI_FUNCTION_IOC_FACTS[rip]
	je	.L5
	mov	rcx, rbx
	sal	rdx, 2
	lea	rsi, .LC2[rip]
	xor	eax, eax
	and	rcx, -2
	mov	rdi, rbp
	call	mpt_prt@PLT
	mov	rdx, QWORD PTR [r12]
.L5:
	shr	rbx
	add	edx, edx
	mov	eax, ebx
	mov	r14d, edx
	sub	ebx, 2
	sub	r14d, eax
	cmp	edx, 2
	jne	.L6
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L9:
	mov	esi, DWORD PTR MPT_OFFSET_DOORBELL[rip]
	mov	rdi, rbp
	call	mpt_read@PLT
	test	ebx, ebx
	jle	.L10
	and	eax, DWORD PTR MPT_DB_DATA_MASK[rip]
	add	r13, 4
	mov	edi, eax
	call	le16toh@PLT
	mov	DWORD PTR -4[r13], eax
.L10:
	mov	esi, DWORD PTR MPT_OFFSET_INTR_STATUS[rip]
	xor	edx, edx
	mov	rdi, rbp
	sub	ebx, 1
	call	mpt_write@PLT
	mov	eax, r14d
	add	eax, ebx
	je	.L11
.L6:
	mov	rdi, rbp
	call	mpt_wait_db_int@PLT
	cmp	rax, QWORD PTR MPT_OK[rip]
	je	.L9
	mov	rdi, rbp
	lea	rsi, .LC3[rip]
	xor	eax, eax
	call	mpt_prt@PLT
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, DWORD PTR ETIMEDOUT[rip]
	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
.L11:
	.cfi_restore_state
	mov	rdi, rbp
	call	mpt_wait_db_int@PLT
	cmp	rax, QWORD PTR MPT_OK[rip]
	je	.L19
	lea	rsi, .LC4[rip]
	mov	rdi, rbp
	xor	eax, eax
	call	mpt_prt@PLT
	mov	eax, DWORD PTR ETIMEDOUT[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L19:
	mov	esi, DWORD PTR MPT_OFFSET_INTR_STATUS[rip]
	xor	edx, edx
	mov	rdi, rbp
	call	mpt_write@PLT
	mov	edx, DWORD PTR 16[r12]
	mov	ecx, DWORD PTR MPI_IOCSTATUS_MASK[rip]
	xor	eax, eax
	and	ecx, edx
	cmp	ecx, DWORD PTR MPI_IOCSTATUS_SUCCESS[rip]
	je	.L1
	mov	rax, QWORD PTR MPT_PRT_TRACE[rip]
	cmp	QWORD PTR 0[rbp], rax
	jge	.L20
.L12:
	mov	eax, DWORD PTR MPT_FAIL[rip]
	or	eax, edx
	jmp	.L1
.L20:
	mov	rdi, r12
	call	mpt_print_reply@PLT
	mov	edx, DWORD PTR 16[r12]
	jmp	.L12
	.cfi_endproc
.LFE0:
	.size	mpt_recv_handshake_reply, .-mpt_recv_handshake_reply
	.comm	MPT_PRT_TRACE,8,8
	.comm	MPT_OK,8,8
	.comm	MPT_OFFSET_INTR_STATUS,4,4
	.comm	MPT_OFFSET_DOORBELL,4,4
	.comm	MPT_FAIL,4,4
	.comm	MPT_DB_DATA_MASK,4,4
	.comm	MPI_IOCSTATUS_SUCCESS,4,4
	.comm	MPI_IOCSTATUS_MASK,4,4
	.comm	MPI_FUNCTION_IOC_FACTS,8,8
	.comm	ETIMEDOUT,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.c_mpt_recv_handshake_reply.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"mpt_recv_handshake_cmd timeout1\012\000"
	.align	2
.LC1:
	.ascii	"mpt_recv_handshake_cmd timeout2\012\000"
	.align	2
.LC2:
	.ascii	"reply length does not match message length: got %x;"
	.ascii	" expected %zx for function %x\012\000"
	.align	2
.LC3:
	.ascii	"mpt_recv_handshake_cmd timeout3\012\000"
	.align	2
.LC4:
	.ascii	"mpt_recv_handshake_cmd timeout4\012\000"
	.text
	.align	2
	.global	mpt_recv_handshake_reply
	.syntax unified
	.arm
	.fpu softvfp
	.type	mpt_recv_handshake_reply, %function
mpt_recv_handshake_reply:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	sub	sp, sp, #20
	mov	r5, r1
	mov	r7, r2
	mov	r4, r0
	bl	mpt_wait_db_int
	ldr	r6, .L21
	ldr	r3, [r6]
	cmp	r0, r3
	beq	.L2
	mov	r0, r4
	ldr	r1, .L21+4
	bl	mpt_prt
	ldr	r3, .L21+8
	ldr	r0, [r3]
.L1:
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L2:
	ldr	r10, .L21+12
	mov	r0, r4
	ldr	r1, [r10]
	bl	mpt_read
	ldr	fp, .L21+16
	ldr	r9, .L21+20
	ldr	r3, [fp]
	and	r0, r0, r3
	bl	le16toh
	str	r0, [r7]
	mov	r2, #0
	ldr	r1, [r9]
	mov	r0, r4
	bl	mpt_write
	mov	r0, r4
	bl	mpt_wait_db_int
	ldr	r3, [r6]
	cmp	r0, r3
	beq	.L4
	mov	r0, r4
	ldr	r1, .L21+24
	bl	mpt_prt
	ldr	r3, .L21+8
	ldr	r0, [r3]
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L4:
	ldr	r1, [r10]
	mov	r0, r4
	bl	mpt_read
	ldr	r3, [fp]
	add	r2, r7, #8
	and	r0, r0, r3
	str	r2, [sp, #12]
	bl	le16toh
	mov	r2, #0
	str	r0, [r7, #4]
	ldr	r1, [r9]
	mov	r0, r4
	bl	mpt_write
	ldr	r2, [r7]
	cmp	r2, r5, lsr #2
	beq	.L5
	ldr	r1, .L21+28
	ldr	r3, [r7, #4]
	ldr	r1, [r1]
	cmp	r3, r1
	beq	.L5
	str	r3, [sp]
	lsl	r2, r2, #2
	mov	r0, r4
	ldr	r1, .L21+32
	bic	r3, r5, #1
	bl	mpt_prt
	ldr	r2, [r7]
.L5:
	lsl	r2, r2, #1
	lsr	r1, r5, #1
	cmp	r2, #2
	sub	r5, r1, #2
	beq	.L11
	sub	r8, r2, r1
	b	.L6
.L9:
	mov	r0, r4
	ldr	r1, [r10]
	bl	mpt_read
	cmp	r5, #0
	sub	r5, r5, #1
	ble	.L10
	ldr	r3, [fp]
	and	r0, r0, r3
	bl	le16toh
	ldr	r3, [sp, #12]
	str	r0, [r3], #4
	str	r3, [sp, #12]
.L10:
	mov	r2, #0
	mov	r0, r4
	ldr	r1, [r9]
	bl	mpt_write
	cmn	r8, r5
	beq	.L11
.L6:
	mov	r0, r4
	bl	mpt_wait_db_int
	ldr	r3, [r6]
	cmp	r0, r3
	beq	.L9
	mov	r0, r4
	ldr	r1, .L21+36
	bl	mpt_prt
	ldr	r3, .L21+8
	ldr	r0, [r3]
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L11:
	mov	r0, r4
	bl	mpt_wait_db_int
	ldr	r3, [r6]
	cmp	r0, r3
	beq	.L19
	mov	r0, r4
	ldr	r1, .L21+40
	bl	mpt_prt
	ldr	r3, .L21+8
	ldr	r0, [r3]
	b	.L1
.L19:
	mov	r2, #0
	mov	r0, r4
	ldr	r1, [r9]
	bl	mpt_write
	ldr	r3, .L21+44
	ldr	r2, .L21+48
	ldr	r0, [r7, #8]
	ldr	r3, [r3]
	ldr	r2, [r2]
	and	r3, r3, r0
	cmp	r3, r2
	moveq	r0, #0
	beq	.L1
	ldr	r3, .L21+52
	ldr	r2, [r4]
	ldr	r3, [r3]
	cmp	r2, r3
	bge	.L20
.L12:
	ldr	r3, .L21+56
	ldr	r3, [r3]
	orr	r0, r0, r3
	b	.L1
.L20:
	mov	r0, r7
	bl	mpt_print_reply
	ldr	r0, [r7, #8]
	b	.L12
.L22:
	.align	2
.L21:
	.word	MPT_OK
	.word	.LC0
	.word	ETIMEDOUT
	.word	MPT_OFFSET_DOORBELL
	.word	MPT_DB_DATA_MASK
	.word	MPT_OFFSET_INTR_STATUS
	.word	.LC1
	.word	MPI_FUNCTION_IOC_FACTS
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	MPI_IOCSTATUS_MASK
	.word	MPI_IOCSTATUS_SUCCESS
	.word	MPT_PRT_TRACE
	.word	MPT_FAIL
	.size	mpt_recv_handshake_reply, .-mpt_recv_handshake_reply
	.comm	MPT_PRT_TRACE,4,4
	.comm	MPT_OK,4,4
	.comm	MPT_OFFSET_INTR_STATUS,4,4
	.comm	MPT_OFFSET_DOORBELL,4,4
	.comm	MPT_FAIL,4,4
	.comm	MPT_DB_DATA_MASK,4,4
	.comm	MPI_IOCSTATUS_SUCCESS,4,4
	.comm	MPI_IOCSTATUS_MASK,4,4
	.comm	MPI_FUNCTION_IOC_FACTS,4,4
	.comm	ETIMEDOUT,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
