	.file	"extr_daemon.c_daemon_open_shared_ports.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	daemon_open_shared_ports
	.type	daemon_open_shared_ports, @function
daemon_open_shared_ports:
.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
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	mov	rbx, rdi
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	call	log_assert@PLT
	mov	r8, QWORD PTR 32[rbx]
	mov	rax, QWORD PTR [rbx]
	cmp	QWORD PTR [r8], rax
	je	.L2
	mov	rdi, QWORD PTR 48[rbx]
	mov	DWORD PTR 8[rbx], 0
	test	rdi, rdi
	je	.L3
	cmp	QWORD PTR 16[rbx], 0
	je	.L4
	xor	ebp, ebp
	.p2align 4,,10
	.p2align 3
.L6:
	mov	rdi, QWORD PTR [rdi+rbp*8]
	add	rbp, 1
	call	listening_ports_free@PLT
	cmp	QWORD PTR 16[rbx], rbp
	mov	rdi, QWORD PTR 48[rbx]
	ja	.L6
.L4:
	call	free@PLT
	mov	QWORD PTR 48[rbx], 0
	mov	r8, QWORD PTR 32[rbx]
.L3:
	lea	r12, 8[rbx]
	mov	rdi, r8
	mov	rsi, r12
	call	listening_ports_open@PLT
	mov	rbp, rax
	test	rax, rax
	je	.L33
	mov	esi, DWORD PTR 8[rbx]
	test	esi, esi
	je	.L21
	mov	rax, QWORD PTR 32[rbx]
	mov	rax, QWORD PTR 8[rax]
	mov	edi, eax
.L9:
	mov	QWORD PTR 16[rbx], rax
	mov	esi, 8
	call	calloc@PLT
	mov	QWORD PTR 48[rbx], rax
	test	rax, rax
	je	.L34
	mov	ecx, DWORD PTR 8[rbx]
	mov	QWORD PTR [rax], rbp
	test	ecx, ecx
	je	.L11
	cmp	QWORD PTR 16[rbx], 1
	jbe	.L11
	mov	ebp, 1
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L12:
	mov	edx, DWORD PTR 8[rbx]
	test	edx, edx
	je	.L14
	add	rbp, 1
	cmp	rbp, rax
	jnb	.L11
	mov	rax, QWORD PTR 48[rbx]
.L17:
	mov	rdi, QWORD PTR 32[rbx]
	mov	rsi, r12
	lea	r13, [rax+rbp*8]
	call	listening_ports_open@PLT
	test	rax, rax
	mov	QWORD PTR 0[r13], rax
	mov	rax, QWORD PTR 16[rbx]
	jne	.L12
.L14:
	xor	ebp, ebp
	test	rax, rax
	je	.L16
	.p2align 4,,10
	.p2align 3
.L13:
	mov	rax, QWORD PTR 48[rbx]
	mov	rdi, QWORD PTR [rax+rbp*8]
	add	rbp, 1
	call	listening_ports_free@PLT
	cmp	QWORD PTR 16[rbx], rbp
	ja	.L13
.L16:
	mov	rdi, QWORD PTR 48[rbx]
	call	free@PLT
	mov	QWORD PTR 48[rbx], 0
	xor	eax, eax
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	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
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	mov	r8, QWORD PTR 32[rbx]
	mov	rax, QWORD PTR [r8]
	mov	QWORD PTR [rbx], rax
.L2:
	cmp	QWORD PTR 24[r8], 0
	mov	rax, QWORD PTR 24[rbx]
	jne	.L18
	test	rax, rax
	jne	.L19
.L31:
	mov	eax, 1
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	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
	.p2align 4,,10
	.p2align 3
.L19:
	.cfi_restore_state
	mov	rdi, QWORD PTR 40[rbx]
	call	listening_ports_free@PLT
	mov	r8, QWORD PTR 32[rbx]
	mov	QWORD PTR 40[rbx], 0
	mov	QWORD PTR 24[rbx], 0
	cmp	QWORD PTR 24[r8], 0
	je	.L31
	xor	eax, eax
	.p2align 4,,10
	.p2align 3
.L18:
	cmp	QWORD PTR 16[r8], rax
	je	.L31
	mov	rdi, QWORD PTR 40[rbx]
	call	listening_ports_free@PLT
	mov	rdi, QWORD PTR 32[rbx]
	call	daemon_remote_open_ports@PLT
	mov	QWORD PTR 40[rbx], rax
	test	rax, rax
	je	.L23
	mov	rax, QWORD PTR 32[rbx]
	mov	rax, QWORD PTR 16[rax]
	mov	QWORD PTR 24[rbx], rax
	jmp	.L31
	.p2align 4,,10
	.p2align 3
.L21:
	mov	edi, 1
	mov	eax, 1
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L33:
	xor	edi, edi
	call	listening_ports_free@PLT
	xor	eax, eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L34:
	mov	rdi, rbp
	call	listening_ports_free@PLT
	xor	eax, eax
	jmp	.L1
.L23:
	xor	eax, eax
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	daemon_open_shared_ports, .-daemon_open_shared_ports
	.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_daemon.c_daemon_open_shared_ports.c"
	.text
	.align	2
	.global	daemon_open_shared_ports
	.syntax unified
	.arm
	.fpu softvfp
	.type	daemon_open_shared_ports, %function
daemon_open_shared_ports:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r4, r0
	bl	log_assert
	ldr	r6, [r4, #16]
	ldr	r3, [r4]
	ldr	r2, [r6]
	cmp	r2, r3
	beq	.L2
	mov	r5, #0
	ldr	r0, [r4, #24]
	str	r5, [r4, #4]
	cmp	r0, r5
	beq	.L3
	ldr	r3, [r4, #8]
	cmp	r3, r5
	beq	.L4
.L6:
	ldr	r0, [r0, r5, lsl #2]
	bl	listening_ports_free
	ldr	r3, [r4, #8]
	add	r5, r5, #1
	cmp	r3, r5
	ldr	r0, [r4, #24]
	bhi	.L6
.L4:
	bl	free
	mov	r3, #0
	ldr	r6, [r4, #16]
	str	r3, [r4, #24]
.L3:
	add	r8, r4, #4
	mov	r0, r6
	mov	r1, r8
	bl	listening_ports_open
	subs	r5, r0, #0
	beq	.L45
	ldr	r3, [r4, #4]
	cmp	r3, #0
	beq	.L9
	ldr	r6, [r4, #16]
	mov	r1, #4
	ldr	r9, [r6, #4]
	mov	r0, r9
	str	r9, [r4, #8]
	bl	calloc
	cmp	r0, #0
	mov	r7, r0
	str	r0, [r4, #24]
	beq	.L11
	cmp	r9, #1
	str	r5, [r0]
	movhi	r5, #1
	bhi	.L19
	b	.L18
.L13:
	ldmib	r4, {r2, r3}
	cmp	r2, #0
	beq	.L15
	cmp	r5, r3
	ldr	r6, [r4, #16]
	bcs	.L18
	ldr	r7, [r4, #24]
.L19:
	mov	r0, r6
	mov	r1, r8
	bl	listening_ports_open
	cmp	r0, #0
	str	r0, [r7, r5, lsl #2]
	add	r5, r5, #1
	bne	.L13
	ldr	r3, [r4, #8]
.L15:
	cmp	r3, #0
	movne	r5, #0
	beq	.L17
.L14:
	ldr	r3, [r4, #24]
	ldr	r0, [r3, r5, lsl #2]
	bl	listening_ports_free
	ldr	r3, [r4, #8]
	add	r5, r5, #1
	cmp	r3, r5
	bhi	.L14
.L17:
	ldr	r0, [r4, #24]
	bl	free
	mov	r0, #0
	str	r0, [r4, #24]
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L9:
	mov	r0, #1
	mov	r1, #4
	str	r0, [r4, #8]
	bl	calloc
	cmp	r0, #0
	ldrne	r6, [r4, #16]
	str	r0, [r4, #24]
	strne	r5, [r0]
	beq	.L11
.L18:
	ldr	r3, [r6]
	str	r3, [r4]
.L2:
	ldr	r5, [r6, #12]
	ldr	r3, [r4, #12]
	cmp	r5, #0
	bne	.L20
	cmp	r3, #0
	bne	.L21
.L22:
	mov	r0, #1
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L21:
	ldr	r0, [r4, #20]
	bl	listening_ports_free
	ldr	r6, [r4, #16]
	str	r5, [r4, #20]
	ldr	r3, [r6, #12]
	str	r5, [r4, #12]
	cmp	r3, #0
	beq	.L22
	mov	r3, r5
.L20:
	ldr	r2, [r6, #8]
	cmp	r2, r3
	beq	.L22
	ldr	r0, [r4, #20]
	bl	listening_ports_free
	ldr	r0, [r4, #16]
	bl	daemon_remote_open_ports
	cmp	r0, #0
	ldrne	r3, [r4, #16]
	str	r0, [r4, #20]
	ldrne	r3, [r3, #8]
	movne	r0, #1
	strne	r3, [r4, #12]
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L11:
	mov	r0, r5
.L45:
	bl	listening_ports_free
	mov	r0, #0
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
	.size	daemon_open_shared_ports, .-daemon_open_shared_ports
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
