	.file	"extr_outside_network.c_outside_network_create.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"malloc failed"
.LC1:
	.string	"no outgoing ports available"
.LC2:
	.string	"0.0.0.0"
	.text
	.p2align 4
	.globl	outside_network_create
	.type	outside_network_create, @function
outside_network_create:
.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	r14d, r8d
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rsi
	mov	esi, 192
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rdi
	mov	edi, 1
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rdx
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	ebx, r9d
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	QWORD PTR 8[rsp], rcx
	call	calloc@PLT
	mov	r15, rax
	test	rax, rax
	je	.L53
	lea	rdx, 184[rax]
	lea	rsi, 188[rax]
	mov	rdi, r12
	call	comm_base_timept@PLT
	mov	rax, QWORD PTR 88[rsp]
	mov	edx, DWORD PTR 184[rsp]
	mov	QWORD PTR 88[r15], r12
	mov	QWORD PTR 176[r15], 0
	mov	QWORD PTR [r15], rax
	mov	rax, QWORD PTR 96[rsp]
	mov	QWORD PTR 136[r15], 0
	mov	QWORD PTR 168[r15], rax
	mov	rax, QWORD PTR 104[rsp]
	mov	QWORD PTR 128[r15], 0
	mov	QWORD PTR 160[r15], rax
	mov	rax, QWORD PTR 176[rsp]
	mov	QWORD PTR 152[r15], rax
	mov	rax, QWORD PTR 136[rsp]
	mov	QWORD PTR 8[r15], rax
	mov	rax, QWORD PTR 152[rsp]
	mov	QWORD PTR 16[r15], rax
	mov	rax, QWORD PTR 160[rsp]
	mov	QWORD PTR 120[r15], rax
	mov	eax, DWORD PTR 112[rsp]
	mov	DWORD PTR 24[r15], eax
	mov	eax, DWORD PTR 168[rsp]
	mov	DWORD PTR 28[r15], eax
	mov	eax, DWORD PTR 144[rsp]
	mov	DWORD PTR 32[r15], eax
	test	edx, edx
	jne	.L54
.L4:
	mov	eax, DWORD PTR 128[rsp]
	test	eax, eax
	je	.L19
	test	rbp, rbp
	je	.L19
	mov	rdi, QWORD PTR 8[rsp]
	lea	r9, 48[r15]
	lea	r8, 40[r15]
	xor	ecx, ecx
	mov	edx, ebx
	mov	esi, r14d
	call	calc_num46@PLT
	mov	rdi, QWORD PTR 40[r15]
	test	rdi, rdi
	jne	.L55
	mov	rdi, QWORD PTR 48[r15]
	test	rdi, rdi
	jne	.L56
.L8:
	mov	rdi, r13
	call	sldns_buffer_new@PLT
	mov	DWORD PTR 80[r15], eax
	test	eax, eax
	je	.L50
	mov	edi, DWORD PTR pending_cmp[rip]
	call	rbtree_create@PLT
	mov	QWORD PTR 104[r15], rax
	test	rax, rax
	je	.L50
	mov	edi, DWORD PTR serviced_cmp[rip]
	call	rbtree_create@PLT
	mov	QWORD PTR 96[r15], rax
	test	rax, rax
	je	.L50
	mov	rsi, r13
	mov	rdi, r15
	call	create_pending_tcp@PLT
	test	eax, eax
	je	.L50
	xor	r12d, r12d
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L11:
	mov	edx, DWORD PTR 80[r15]
	mov	rdi, QWORD PTR 88[r15]
	mov	r8, r15
	mov	esi, -1
	mov	ecx, DWORD PTR outnet_udp_cb[rip]
	call	comm_point_create_udp@PLT
	mov	DWORD PTR 8[r13], eax
	test	eax, eax
	je	.L57
	mov	rax, QWORD PTR 72[r15]
	add	r12, 1
	mov	QWORD PTR 0[r13], rax
	mov	QWORD PTR 72[r15], r13
	cmp	rbp, r12
	jbe	.L58
.L13:
	mov	esi, 16
	mov	edi, 1
	call	calloc@PLT
	mov	r13, rax
	test	rax, rax
	jne	.L11
.L50:
	lea	rdi, .LC0[rip]
	call	log_err@PLT
	mov	rdi, r15
	xor	r15d, r15d
	call	outside_network_delete@PLT
.L1:
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	rax, r15
	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
.L54:
	.cfi_restore_state
	movsx	rax, DWORD PTR 184[rsp]
	mov	edx, DWORD PTR 184[rsp]
	mov	DWORD PTR 36[r15], 1
	mov	ecx, DWORD PTR 184[rsp]
	imul	rax, rax, 274877907
	sar	edx, 31
	sar	rax, 38
	sub	eax, edx
	mov	DWORD PTR 112[r15], eax
	imul	eax, eax, 1000
	sub	ecx, eax
	imul	eax, ecx, 1000
	mov	DWORD PTR 116[r15], eax
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L56:
	mov	esi, 4
	call	calloc@PLT
	mov	QWORD PTR 64[r15], rax
	test	rax, rax
	jne	.L8
	jmp	.L50
	.p2align 4,,10
	.p2align 3
.L55:
	mov	esi, 4
	call	calloc@PLT
	mov	QWORD PTR 56[r15], rax
	test	rax, rax
	je	.L50
	mov	rdi, QWORD PTR 48[r15]
	test	rdi, rdi
	je	.L8
	jmp	.L56
	.p2align 4,,10
	.p2align 3
.L53:
	lea	rdi, .LC0[rip]
	call	log_err@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L19:
	lea	rdi, .LC1[rip]
	call	log_err@PLT
	mov	rdi, r15
	xor	r15d, r15d
	call	outside_network_delete@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L58:
	test	r14d, r14d
	je	.L14
	jle	.L1
	test	ebx, ebx
	mov	rbx, QWORD PTR 8[rsp]
	lea	eax, -1[r14]
	setne	r12b
	xor	r14d, r14d
	lea	r13, 8[rbx+rax*8]
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L16:
	add	rbx, 8
	cmp	rbx, r13
	je	.L1
.L18:
	mov	rdi, QWORD PTR [rbx]
	call	str_is_ip6@PLT
	mov	rdi, QWORD PTR [rbx]
	call	str_is_ip6@PLT
	test	rax, rax
	jne	.L16
	test	r12b, r12b
	je	.L16
	mov	rax, QWORD PTR 56[r15]
	mov	ecx, DWORD PTR 128[rsp]
	mov	r8, rbp
	mov	rdx, QWORD PTR 120[rsp]
	mov	rsi, QWORD PTR [rbx]
	lea	rdi, [rax+r14*4]
	call	setup_if@PLT
	test	eax, eax
	je	.L50
	add	r14, 1
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L57:
	lea	rdi, .LC0[rip]
	call	log_err@PLT
	mov	rdi, r13
	call	free@PLT
	mov	rdi, r15
	xor	r15d, r15d
	call	outside_network_delete@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L14:
	test	ebx, ebx
	je	.L1
	mov	rdi, QWORD PTR 56[r15]
	mov	ecx, DWORD PTR 128[rsp]
	mov	r8, rbp
	lea	rsi, .LC2[rip]
	mov	rdx, QWORD PTR 120[rsp]
	call	setup_if@PLT
	test	eax, eax
	jne	.L1
	jmp	.L50
	.cfi_endproc
.LFE0:
	.size	outside_network_create, .-outside_network_create
	.comm	serviced_cmp,4,4
	.comm	pending_cmp,4,4
	.comm	outnet_udp_cb,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_outside_network.c_outside_network_create.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"malloc failed\000"
	.align	2
.LC1:
	.ascii	"no outgoing ports available\000"
	.align	2
.LC2:
	.ascii	"0.0.0.0\000"
	.text
	.align	2
	.global	outside_network_create
	.syntax unified
	.arm
	.fpu softvfp
	.type	outside_network_create, %function
outside_network_create:
	@ args = 68, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r6, r0
	sub	sp, sp, #20
	mov	fp, r1
	mov	r0, #1
	mov	r1, #112
	mov	r7, r2
	mov	r8, r3
	ldr	r10, [sp, #56]
	ldr	r5, [sp, #116]
	bl	calloc
	subs	r9, r0, #0
	beq	.L48
	mov	r4, r0
	add	r2, r0, #104
	add	r1, r0, #108
	mov	r0, r6
	bl	comm_base_timept
	mov	r3, #0
	ldr	r2, [sp, #68]
	cmp	r5, r3
	str	r2, [r4]
	ldr	r2, [sp, #72]
	str	r6, [r4, #52]
	str	r2, [r4, #96]
	ldr	r2, [sp, #76]
	str	r3, [r4, #100]
	str	r2, [r4, #92]
	ldr	r2, [sp, #112]
	str	r3, [r4, #80]
	str	r2, [r4, #88]
	ldr	r2, [sp, #92]
	str	r3, [r4, #76]
	str	r2, [r4, #4]
	ldr	r2, [sp, #100]
	str	r2, [r4, #8]
	ldr	r2, [sp, #104]
	str	r2, [r4, #72]
	ldr	r2, [sp, #80]
	str	r2, [r4, #12]
	ldr	r2, [sp, #108]
	str	r2, [r4, #16]
	ldr	r2, [sp, #96]
	str	r2, [r4, #20]
	bne	.L49
.L4:
	clz	r3, r7
	ldr	r2, [sp, #88]
	lsr	r3, r3, #5
	cmp	r2, #0
	moveq	r3, #1
	cmp	r3, #0
	bne	.L50
	add	r1, r4, #32
	add	r2, r4, #28
	str	r1, [sp, #4]
	str	r2, [sp]
	mov	r1, r10
	mov	r0, r8
	ldr	r2, [sp, #60]
	bl	calc_num46
	ldr	r0, [r4, #28]
	cmp	r0, #0
	bne	.L51
.L6:
	ldr	r0, [r4, #32]
	cmp	r0, #0
	bne	.L52
.L7:
	mov	r0, fp
	bl	sldns_buffer_new
	cmp	r0, #0
	str	r0, [r4, #48]
	beq	.L9
	ldr	r3, .L56
	ldr	r0, [r3]
	bl	rbtree_create
	cmp	r0, #0
	str	r0, [r4, #60]
	beq	.L9
	ldr	r3, .L56+4
	ldr	r0, [r3]
	bl	rbtree_create
	cmp	r0, #0
	str	r0, [r4, #56]
	beq	.L9
	mov	r1, fp
	mov	r0, r4
	bl	create_pending_tcp
	cmp	r0, #0
	beq	.L9
	mov	r6, #0
	ldr	fp, .L56+8
	b	.L12
.L11:
	ldr	r3, [r4, #44]
	cmp	r7, r6
	str	r3, [r5]
	str	r5, [r4, #44]
	bls	.L53
.L12:
	mov	r1, #8
	mov	r0, #1
	bl	calloc
	subs	r5, r0, #0
	add	r6, r6, #1
	beq	.L46
	ldr	r2, [r4, #48]
	ldr	r0, [r4, #52]
	str	r4, [sp]
	mvn	r1, #0
	ldr	r3, [fp]
	bl	comm_point_create_udp
	cmp	r0, #0
	str	r0, [r5, #4]
	bne	.L11
	str	r0, [sp, #12]
	ldr	r0, .L56+12
	bl	log_err
	mov	r0, r5
	bl	free
	ldr	r3, [sp, #12]
	mov	r0, r4
	mov	r9, r3
	bl	outside_network_delete
	mov	r0, r9
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L49:
	mov	r1, #1
	ldr	r3, .L56+16
	asr	r2, r5, #31
	smull	r0, r3, r5, r3
	rsb	r3, r2, r3, asr #6
	rsb	r2, r3, r3, lsl #5
	add	r2, r3, r2, lsl #2
	sub	r5, r5, r2, lsl #3
	rsb	r2, r5, r5, lsl #5
	add	r5, r5, r2, lsl #2
	lsl	r5, r5, #3
	str	r3, [r4, #64]
	str	r5, [r4, #68]
	str	r1, [r4, #24]
	b	.L4
.L52:
	mov	r1, #4
	bl	calloc
	cmp	r0, #0
	mov	r5, r0
	str	r0, [r4, #40]
	bne	.L7
.L46:
	ldr	r0, .L56+12
	bl	log_err
	mov	r0, r4
	mov	r9, r5
	bl	outside_network_delete
	b	.L1
.L9:
	ldr	r0, .L56+12
	bl	log_err
	mov	r0, r4
	bl	outside_network_delete
	mov	r9, #0
.L1:
	mov	r0, r9
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L51:
	mov	r1, #4
	bl	calloc
	cmp	r0, #0
	mov	r5, r0
	str	r0, [r4, #36]
	bne	.L6
	b	.L46
.L53:
	cmp	r10, #0
	beq	.L13
	ble	.L1
	mov	r5, #0
	ldr	r3, [sp, #60]
	str	r9, [sp, #12]
	subs	r6, r3, r5
	movne	r6, #1
	mov	fp, r5
	ldr	r9, [sp, #88]
	sub	r8, r8, #4
	b	.L17
.L15:
	cmp	r10, r5
	beq	.L54
.L17:
	ldr	r0, [r8, #4]!
	bl	str_is_ip6
	ldr	r0, [r8]
	bl	str_is_ip6
	cmp	r0, #0
	moveq	r0, r6
	movne	r0, #0
	cmp	r0, #0
	add	r5, r5, #1
	beq	.L15
	ldr	r0, [r4, #36]
	str	r7, [sp]
	mov	r3, r9
	ldr	r2, [sp, #84]
	ldr	r1, [r8]
	add	r0, r0, fp, lsl #2
	bl	setup_if
	cmp	r0, #0
	beq	.L55
	add	fp, fp, #1
	b	.L15
.L13:
	ldr	r3, [sp, #60]
	cmp	r3, #0
	beq	.L1
	ldr	r0, [r4, #36]
	ldr	r3, [sp, #88]
	ldr	r2, [sp, #84]
	ldr	r1, .L56+20
	str	r7, [sp]
	bl	setup_if
	cmp	r0, #0
	bne	.L1
	ldr	r0, .L56+12
	bl	log_err
	mov	r0, r4
	mov	r9, r10
	bl	outside_network_delete
	b	.L1
.L50:
	mov	r9, #0
	ldr	r0, .L56+24
	bl	log_err
	mov	r0, r4
	bl	outside_network_delete
	mov	r0, r9
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L54:
	ldr	r9, [sp, #12]
	b	.L1
.L55:
	str	r0, [sp, #12]
	ldr	r0, .L56+12
	bl	log_err
	ldr	r3, [sp, #12]
	mov	r0, r4
	mov	r9, r3
	bl	outside_network_delete
	b	.L1
.L48:
	ldr	r0, .L56+12
	bl	log_err
	b	.L1
.L57:
	.align	2
.L56:
	.word	pending_cmp
	.word	serviced_cmp
	.word	outnet_udp_cb
	.word	.LC0
	.word	274877907
	.word	.LC2
	.word	.LC1
	.size	outside_network_create, .-outside_network_create
	.comm	serviced_cmp,4,4
	.comm	pending_cmp,4,4
	.comm	outnet_udp_cb,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
