	.file	"extr_mpt.c_mpt_core_attach.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"doorbell req = %s\n"
	.text
	.p2align 4
	.type	mpt_core_attach, @function
mpt_core_attach:
.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
	mov	r12, rdi
	add	rdi, 36
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	call	LIST_INIT@PLT
	lea	rdi, 32[r12]
	call	TAILQ_INIT@PLT
	lea	rdi, 28[r12]
	call	TAILQ_INIT@PLT
	lea	rdi, 24[r12]
	call	TAILQ_INIT@PLT
	mov	eax, DWORD PTR MPT_MAX_LUNS[rip]
	test	eax, eax
	jle	.L2
	xor	ebp, ebp
	.p2align 4,,10
	.p2align 3
.L3:
	mov	rdi, QWORD PTR 16[r12]
	lea	rbx, 0[0+rbp*8]
	add	rbp, 1
	add	rdi, rbx
	add	rdi, 4
	call	STAILQ_INIT@PLT
	add	rbx, QWORD PTR 16[r12]
	mov	rdi, rbx
	call	STAILQ_INIT@PLT
	cmp	DWORD PTR MPT_MAX_LUNS[rip], ebp
	jg	.L3
.L2:
	lea	rdi, 12[r12]
	call	STAILQ_INIT@PLT
	lea	rdi, 8[r12]
	call	STAILQ_INIT@PLT
	mov	eax, DWORD PTR MPT_HANDLER_ID_NONE[rip]
	mov	rdi, r12
	mov	DWORD PTR 4[r12], eax
	call	mpt_sysctl_attach@PLT
	mov	esi, DWORD PTR MPT_OFFSET_DOORBELL[rip]
	mov	rdi, r12
	call	mpt_read@PLT
	mov	edi, eax
	call	mpt_ioc_diag@PLT
	mov	esi, DWORD PTR MPT_PRT_DEBUG[rip]
	lea	rdx, .LC0[rip]
	mov	rdi, r12
	mov	ecx, eax
	call	mpt_lprt@PLT
	mov	rdi, r12
	call	MPT_LOCK@PLT
	mov	rdi, r12
	xor	edx, edx
	xor	esi, esi
	call	mpt_configure_ioc@PLT
	mov	rdi, r12
	mov	r13d, eax
	call	MPT_UNLOCK@PLT
	add	rsp, 8
	.cfi_def_cfa_offset 40
	mov	eax, r13d
	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	mpt_core_attach, .-mpt_core_attach
	.comm	MPT_PRT_DEBUG,4,4
	.comm	MPT_OFFSET_DOORBELL,4,4
	.comm	MPT_MAX_LUNS,4,4
	.comm	MPT_HANDLER_ID_NONE,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_core_attach.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"doorbell req = %s\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	mpt_core_attach, %function
mpt_core_attach:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r5, r0
	add	r0, r0, #32
	bl	LIST_INIT
	add	r0, r5, #28
	bl	TAILQ_INIT
	ldr	r7, .L7
	add	r0, r5, #24
	bl	TAILQ_INIT
	add	r0, r5, #20
	bl	TAILQ_INIT
	ldr	r3, [r7]
	cmp	r3, #0
	ble	.L2
	mov	r4, #0
.L3:
	ldr	r0, [r5, #16]
	lsl	r6, r4, #3
	add	r0, r0, r4, lsl #3
	add	r0, r0, #4
	bl	STAILQ_INIT
	ldr	r0, [r5, #16]
	add	r4, r4, #1
	add	r0, r0, r6
	bl	STAILQ_INIT
	ldr	r3, [r7]
	cmp	r3, r4
	bgt	.L3
.L2:
	add	r0, r5, #12
	bl	STAILQ_INIT
	add	r0, r5, #8
	bl	STAILQ_INIT
	ldr	r3, .L7+4
	mov	r0, r5
	ldr	r3, [r3]
	str	r3, [r5, #4]
	bl	mpt_sysctl_attach
	ldr	r3, .L7+8
	ldr	r2, .L7+12
	ldr	r1, [r3]
	mov	r0, r5
	ldr	r4, [r2]
	bl	mpt_read
	bl	mpt_ioc_diag
	mov	r1, r4
	mov	r3, r0
	ldr	r2, .L7+16
	mov	r0, r5
	bl	mpt_lprt
	mov	r0, r5
	bl	MPT_LOCK
	mov	r2, #0
	mov	r0, r5
	mov	r1, r2
	bl	mpt_configure_ioc
	mov	r4, r0
	mov	r0, r5
	bl	MPT_UNLOCK
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, pc}
.L8:
	.align	2
.L7:
	.word	MPT_MAX_LUNS
	.word	MPT_HANDLER_ID_NONE
	.word	MPT_OFFSET_DOORBELL
	.word	MPT_PRT_DEBUG
	.word	.LC0
	.size	mpt_core_attach, .-mpt_core_attach
	.comm	MPT_PRT_DEBUG,4,4
	.comm	MPT_OFFSET_DOORBELL,4,4
	.comm	MPT_MAX_LUNS,4,4
	.comm	MPT_HANDLER_ID_NONE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
