	.file	"extr_port_config.c_sci_apc_agent_configure_ports.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	sci_apc_agent_configure_ports, @function
sci_apc_agent_configure_ports:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14, rdi
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rsi
	mov	rsi, rdx
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rdx
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	DWORD PTR 12[rsp], ecx
	call	sci_port_configuration_agent_find_port@PLT
	test	rax, rax
	je	.L2
	mov	rsi, QWORD PTR [r12]
	mov	rdi, rax
	mov	rbp, rax
	call	sci_port_is_valid_phy_assignment@PLT
	test	rax, rax
	je	.L1
.L3:
	mov	rsi, r12
	mov	rdi, rbp
	call	sci_port_add_phy@PLT
	cmp	eax, DWORD PTR SCI_SUCCESS[rip]
	je	.L27
.L1:
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	rsi, QWORD PTR [r12]
	mov	rax, rsi
	sal	rax, 4
	add	rax, QWORD PTR 8[r13]
	mov	r15, QWORD PTR [rax]
	cmp	r15, QWORD PTR 8[rax]
	ja	.L1
	mov	ebx, 129
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L30:
	mov	rsi, QWORD PTR [r12]
	mov	eax, 1
	mov	edi, DWORD PTR 0[rbp]
	mov	ecx, esi
	sal	eax, cl
	cmp	edi, eax
	jg	.L1
	movsx	rax, DWORD PTR 4[rbp]
	cmp	rsi, rax
	je	.L28
	test	edi, edi
	mov	eax, 128
	cmove	ebx, eax
.L9:
	mov	rax, rsi
	add	r15, 1
	sal	rax, 4
	add	rax, QWORD PTR 8[r13]
	cmp	QWORD PTR 8[rax], r15
	jb	.L29
.L10:
	mov	rax, QWORD PTR [r14]
	lea	rbp, [rax+r15*8]
	mov	rdi, rbp
	call	sci_port_is_valid_phy_assignment@PLT
	test	rax, rax
	jne	.L30
	mov	ecx, DWORD PTR 0[rbp]
	mov	eax, 129
	mov	rsi, QWORD PTR [r12]
	test	ecx, ecx
	cmovne	ebx, eax
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L29:
	mov	edx, DWORD PTR 12[rsp]
	test	edx, edx
	jne	.L13
	cmp	ebx, 128
	je	.L3
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L27:
	mov	rcx, QWORD PTR [r12]
	mov	eax, 1
	sal	eax, cl
	or	DWORD PTR 0[r13], eax
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L13:
	.cfi_restore_state
	cmp	ebx, 128
	jne	.L1
.L12:
	mov	esi, DWORD PTR SCIC_SDS_APC_WAIT_LINK_UP_NOTIFICATION[rip]
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	rdi, r13
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	jmp	sci_apc_agent_start_timer@PLT
	.p2align 4,,10
	.p2align 3
.L28:
	.cfi_restore_state
	cmp	ebx, 128
	jne	.L3
	mov	eax, DWORD PTR 12[rsp]
	test	eax, eax
	jne	.L12
	jmp	.L3
	.cfi_endproc
.LFE0:
	.size	sci_apc_agent_configure_ports, .-sci_apc_agent_configure_ports
	.comm	SCI_SUCCESS,4,4
	.comm	SCIC_SDS_APC_WAIT_LINK_UP_NOTIFICATION,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_port_config.c_sci_apc_agent_configure_ports.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	sci_apc_agent_configure_ports, %function
sci_apc_agent_configure_ports:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r6, r1
	sub	sp, sp, #12
	mov	r1, r2
	mov	r5, r2
	mov	r7, r0
	str	r3, [sp, #4]
	bl	sci_port_configuration_agent_find_port
	subs	r10, r0, #0
	ldr	r1, [r5]
	beq	.L2
	bl	sci_port_is_valid_phy_assignment
	cmp	r0, #0
	beq	.L1
.L3:
	mov	r0, r10
	mov	r1, r5
	bl	sci_port_add_phy
	ldr	r3, .L28
	ldr	r3, [r3]
	cmp	r0, r3
	beq	.L24
.L1:
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L2:
	ldr	r3, [r6, #4]
	add	r2, r3, r1, lsl #3
	ldr	r2, [r2, #4]
	ldr	r4, [r3, r1, lsl #3]
	cmp	r4, r2
	bhi	.L1
	mov	fp, #129
	mov	r8, #1
	b	.L10
.L27:
	cmp	r3, r8, lsl r1
	bgt	.L1
	ldr	r2, [r10, #4]
	cmp	r2, r1
	beq	.L25
	cmp	r3, #0
	moveq	fp, #128
.L9:
	ldr	ip, [r6, #4]
	add	r4, r4, #1
	add	ip, ip, r1, lsl #3
	ldr	r3, [ip, #4]
	cmp	r3, r4
	bcc	.L26
.L10:
	ldr	r9, [r7]
	add	r10, r9, r4, lsl #3
	mov	r0, r10
	bl	sci_port_is_valid_phy_assignment
	cmp	r0, #0
	ldr	r3, [r9, r4, lsl #3]
	ldr	r1, [r5]
	bne	.L27
	cmp	r3, #0
	movne	fp, #129
	b	.L9
.L26:
	ldr	r3, [sp, #4]
	cmp	r3, #0
	cmpeq	fp, #128
	beq	.L3
	cmp	fp, #128
	bne	.L1
.L11:
	mov	r0, r6
	ldr	r3, .L28+4
	ldr	r1, [r3]
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	b	sci_apc_agent_start_timer
.L24:
	mov	r1, #1
	ldr	r2, [r5]
	ldr	r3, [r6]
	orr	r3, r3, r1, lsl r2
	str	r3, [r6]
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L25:
	cmp	fp, #128
	bne	.L3
	ldr	r3, [sp, #4]
	cmp	r3, #0
	bne	.L11
	b	.L3
.L29:
	.align	2
.L28:
	.word	SCI_SUCCESS
	.word	SCIC_SDS_APC_WAIT_LINK_UP_NOTIFICATION
	.size	sci_apc_agent_configure_ports, .-sci_apc_agent_configure_ports
	.comm	SCI_SUCCESS,4,4
	.comm	SCIC_SDS_APC_WAIT_LINK_UP_NOTIFICATION,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
