	.file	"extr_sbp_targ.c_sbp_targ_attach.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"sbp_targ"
	.text
	.p2align 4
	.type	sbp_targ_attach, @function
sbp_targ_attach:
.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
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	mov	ebp, edi
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	call	device_get_softc@PLT
	mov	esi, 64
	mov	rbx, rax
	mov	rdi, rax
	call	bzero@PLT
	lea	r14, 24[rbx]
	xor	edx, edx
	mov	ecx, DWORD PTR MTX_DEF[rip]
	lea	rsi, .LC0[rip]
	mov	rdi, r14
	call	mtx_init@PLT
	mov	edi, ebp
	call	device_get_ivars@PLT
	mov	edi, DWORD PTR MAX_LUN[rip]
	mov	DWORD PTR 48[rbx], ebp
	mov	QWORD PTR 56[rbx], rax
	mov	r13, rax
	mov	rax, QWORD PTR sbp_targ_post_explore[rip]
	imul	edi, DWORD PTR MAX_INITIATORS[rip]
	mov	QWORD PTR 40[rbx], rax
	mov	rax, QWORD PTR sbp_targ_post_busreset[rip]
	mov	QWORD PTR 32[rbx], rax
	call	cam_simq_alloc@PLT
	test	rax, rax
	je	.L8
	mov	edi, ebp
	mov	r12, rax
	call	device_get_unit@PLT
	sub	rsp, 8
	.cfi_def_cfa_offset 56
	mov	r9, r14
	mov	rcx, rbx
	push	r12
	.cfi_def_cfa_offset 64
	mov	esi, DWORD PTR sbp_targ_poll[rip]
	mov	r8d, eax
	lea	rdx, .LC0[rip]
	push	1
	.cfi_def_cfa_offset 72
	mov	edi, DWORD PTR sbp_targ_action[rip]
	push	1
	.cfi_def_cfa_offset 80
	call	cam_sim_alloc@PLT
	add	rsp, 32
	.cfi_def_cfa_offset 48
	mov	QWORD PTR [rbx], rax
	test	rax, rax
	je	.L10
	mov	rdi, rbx
	call	SBP_LOCK@PLT
	mov	rdi, QWORD PTR [rbx]
	xor	edx, edx
	mov	esi, ebp
	call	xpt_bus_register@PLT
	cmp	rax, QWORD PTR CAM_SUCCESS[rip]
	je	.L11
.L5:
	mov	rdi, rbx
	call	SBP_UNLOCK@PLT
	mov	esi, DWORD PTR TRUE[rip]
	mov	rdi, QWORD PTR [rbx]
	call	cam_sim_free@PLT
.L8:
	mov	eax, DWORD PTR ENXIO[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
.L11:
	.cfi_restore_state
	mov	rdi, QWORD PTR [rbx]
	mov	ebp, DWORD PTR CAM_LUN_WILDCARD[rip]
	mov	r12d, DWORD PTR CAM_TARGET_WILDCARD[rip]
	call	cam_sim_path@PLT
	xor	esi, esi
	lea	rdi, 20[rbx]
	mov	r8d, ebp
	mov	edx, eax
	mov	ecx, r12d
	call	xpt_create_path@PLT
	cmp	rax, QWORD PTR CAM_REQ_CMP[rip]
	je	.L6
	mov	rdi, QWORD PTR [rbx]
	call	cam_sim_path@PLT
	mov	edi, eax
	call	xpt_bus_deregister@PLT
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L10:
	mov	rdi, r12
	call	cam_simq_free@PLT
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, DWORD PTR ENXIO[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
.L6:
	.cfi_restore_state
	mov	rdi, rbx
	lea	rbp, 8[rbx]
	call	SBP_UNLOCK@PLT
	mov	eax, DWORD PTR SBP_TARG_BIND_START[rip]
	mov	rdi, rbp
	mov	DWORD PTR 16[rbx], eax
	mov	eax, DWORD PTR SBP_TARG_BIND_END[rip]
	mov	DWORD PTR 12[rbx], eax
	call	STAILQ_INIT@PLT
	mov	eax, DWORD PTR sbp_targ_recv[rip]
	xor	edx, edx
	mov	r9, r13
	mov	r8d, DWORD PTR MAX_LUN[rip]
	mov	ecx, DWORD PTR SBP_TARG_RECV_LEN[rip]
	mov	rdi, rbp
	push	rax
	.cfi_def_cfa_offset 56
	mov	esi, DWORD PTR M_SBP_TARG[rip]
	push	rbx
	.cfi_def_cfa_offset 64
	call	fw_xferlist_add@PLT
	mov	rsi, rbp
	mov	rdi, r13
	call	fw_bindadd@PLT
	pop	rax
	.cfi_def_cfa_offset 56
	xor	eax, eax
	pop	rdx
	.cfi_def_cfa_offset 48
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	sbp_targ_attach, .-sbp_targ_attach
	.comm	sbp_targ_recv,4,4
	.comm	sbp_targ_post_explore,8,8
	.comm	sbp_targ_post_busreset,8,8
	.comm	sbp_targ_poll,4,4
	.comm	sbp_targ_action,4,4
	.comm	TRUE,4,4
	.comm	SBP_TARG_RECV_LEN,4,4
	.comm	SBP_TARG_BIND_START,4,4
	.comm	SBP_TARG_BIND_END,4,4
	.comm	M_SBP_TARG,4,4
	.comm	MTX_DEF,4,4
	.comm	MAX_LUN,4,4
	.comm	MAX_INITIATORS,4,4
	.comm	ENXIO,4,4
	.comm	CAM_TARGET_WILDCARD,4,4
	.comm	CAM_SUCCESS,8,8
	.comm	CAM_REQ_CMP,8,8
	.comm	CAM_LUN_WILDCARD,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_sbp_targ.c_sbp_targ_attach.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"sbp_targ\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	sbp_targ_attach, %function
sbp_targ_attach:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	sub	sp, sp, #28
	mov	r5, r0
	bl	device_get_softc
	mov	r4, r0
	mov	r1, #40
	bl	bzero
	ldr	r3, .L12
	add	r9, r4, #20
	mov	r2, #0
	ldr	r3, [r3]
	ldr	r1, .L12+4
	mov	r0, r9
	bl	mtx_init
	mov	r0, r5
	bl	device_get_ivars
	mov	r7, r0
	ldr	r3, .L12+8
	ldr	r1, .L12+12
	ldr	r3, [r3]
	ldr	r2, .L12+16
	ldr	r8, .L12+20
	ldr	r2, [r2]
	ldr	r0, [r1]
	str	r3, [r4, #28]
	ldr	r3, [r8]
	str	r5, [r4, #32]
	mul	r0, r3, r0
	str	r7, [r4, #36]
	str	r2, [r4, #24]
	bl	cam_simq_alloc
	subs	r6, r0, #0
	beq	.L8
	ldr	r2, .L12+24
	ldr	r3, .L12+28
	mov	r0, r5
	ldr	r10, [r2]
	ldr	fp, [r3]
	bl	device_get_unit
	mov	r3, #1
	mov	r2, r0
	str	r3, [sp, #12]
	str	r2, [sp]
	str	r3, [sp, #8]
	mov	r1, fp
	mov	r0, r10
	mov	r3, r4
	ldr	r2, .L12+4
	str	r6, [sp, #16]
	str	r9, [sp, #4]
	bl	cam_sim_alloc
	cmp	r0, #0
	str	r0, [r4]
	beq	.L10
	mov	r0, r4
	bl	SBP_LOCK
	mov	r1, r5
	mov	r2, #0
	ldr	r0, [r4]
	bl	xpt_bus_register
	ldr	r3, .L12+32
	ldr	r3, [r3]
	cmp	r0, r3
	beq	.L11
.L5:
	mov	r0, r4
	bl	SBP_UNLOCK
	ldr	r3, .L12+36
	ldr	r0, [r4]
	ldr	r1, [r3]
	bl	cam_sim_free
.L8:
	ldr	r3, .L12+40
	ldr	r0, [r3]
.L1:
	add	sp, sp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L11:
	mov	r5, r4
	ldr	r0, [r5], #16
	bl	cam_sim_path
	ldr	r1, .L12+44
	ldr	r3, .L12+48
	ldr	r1, [r1]
	mov	r2, r0
	str	r1, [sp]
	ldr	r3, [r3]
	mov	r0, r5
	mov	r1, #0
	bl	xpt_create_path
	ldr	r3, .L12+52
	ldr	r3, [r3]
	cmp	r0, r3
	beq	.L6
	ldr	r0, [r4]
	bl	cam_sim_path
	bl	xpt_bus_deregister
	b	.L5
.L10:
	mov	r0, r6
	bl	cam_simq_free
	ldr	r3, .L12+40
	ldr	r0, [r3]
	add	sp, sp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L6:
	mov	r0, r4
	bl	SBP_UNLOCK
	ldr	r2, .L12+56
	ldr	r3, .L12+60
	ldr	r2, [r2]
	ldr	r3, [r3]
	add	r5, r4, #4
	str	r2, [r4, #12]
	str	r3, [r4, #8]
	mov	r0, r5
	bl	STAILQ_INIT
	ldr	r3, .L12+64
	ldr	r0, [r8]
	ldr	r1, [r3]
	ldr	r2, .L12+68
	ldr	r3, .L12+72
	str	r0, [sp]
	str	r4, [sp, #8]
	str	r7, [sp, #4]
	str	r1, [sp, #12]
	ldr	r1, [r2]
	ldr	r3, [r3]
	mov	r2, #0
	mov	r0, r5
	bl	fw_xferlist_add
	mov	r1, r5
	mov	r0, r7
	bl	fw_bindadd
	mov	r0, #0
	b	.L1
.L13:
	.align	2
.L12:
	.word	MTX_DEF
	.word	.LC0
	.word	sbp_targ_post_explore
	.word	MAX_INITIATORS
	.word	sbp_targ_post_busreset
	.word	MAX_LUN
	.word	sbp_targ_action
	.word	sbp_targ_poll
	.word	CAM_SUCCESS
	.word	TRUE
	.word	ENXIO
	.word	CAM_LUN_WILDCARD
	.word	CAM_TARGET_WILDCARD
	.word	CAM_REQ_CMP
	.word	SBP_TARG_BIND_START
	.word	SBP_TARG_BIND_END
	.word	sbp_targ_recv
	.word	M_SBP_TARG
	.word	SBP_TARG_RECV_LEN
	.size	sbp_targ_attach, .-sbp_targ_attach
	.comm	sbp_targ_recv,4,4
	.comm	sbp_targ_post_explore,4,4
	.comm	sbp_targ_post_busreset,4,4
	.comm	sbp_targ_poll,4,4
	.comm	sbp_targ_action,4,4
	.comm	TRUE,4,4
	.comm	SBP_TARG_RECV_LEN,4,4
	.comm	SBP_TARG_BIND_START,4,4
	.comm	SBP_TARG_BIND_END,4,4
	.comm	M_SBP_TARG,4,4
	.comm	MTX_DEF,4,4
	.comm	MAX_LUN,4,4
	.comm	MAX_INITIATORS,4,4
	.comm	ENXIO,4,4
	.comm	CAM_TARGET_WILDCARD,4,4
	.comm	CAM_SUCCESS,4,4
	.comm	CAM_REQ_CMP,4,4
	.comm	CAM_LUN_WILDCARD,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
