	.file	"extr_socket.c_create_listen_socket4.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"LISTENER: IPv4 creating new listening socket on ip '%s' port %d, socktype %d"
	.align 8
.LC1:
	.string	"LISTENER: IPv4 socket() on ip '%s' port %d, socktype %d failed."
	.align 8
.LC2:
	.string	"LISTENER: Failed to convert IP '%s' to a valid IPv4 address."
	.align 8
.LC3:
	.string	"LISTENER: IPv4 bind() on ip '%s' port %d, socktype %d failed."
	.align 8
.LC4:
	.string	"LISTENER: IPv4 listen() on ip '%s' port %d, socktype %d failed."
	.align 8
.LC5:
	.string	"LISTENER: Listening on IPv4 ip '%s' port %d, socktype %d"
	.text
	.p2align 4
	.globl	create_listen_socket4
	.type	create_listen_socket4, @function
create_listen_socket4:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	r8d, edi
	mov	r15, rdx
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14, rsi
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13d, edi
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	ebx, ecx
	mov	rcx, rdx
	mov	rdx, rsi
	lea	rsi, .LC0[rip]
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	mov	edi, DWORD PTR D_LISTENER[rip]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 24[rsp], rax
	xor	eax, eax
	call	debug@PLT
	mov	edi, DWORD PTR AF_INET[rip]
	xor	edx, edx
	mov	esi, r13d
	call	socket@PLT
	test	eax, eax
	js	.L10
	mov	r12d, eax
	mov	esi, 1
	lea	rbp, 12[rsp]
	mov	edi, eax
	call	sock_setreuse@PLT
	mov	esi, 1
	mov	edi, r12d
	call	sock_setreuse_port@PLT
	mov	edi, r12d
	call	sock_setnonblock@PLT
	mov	edi, r12d
	call	sock_enlarge_in@PLT
	xor	esi, esi
	mov	edx, 12
	mov	rdi, rbp
	call	memset@PLT
	mov	eax, DWORD PTR AF_INET[rip]
	mov	rdi, r15
	mov	DWORD PTR 20[rsp], eax
	call	htons@PLT
	mov	edi, DWORD PTR AF_INET[rip]
	mov	rdx, rbp
	mov	rsi, r14
	mov	DWORD PTR 16[rsp], eax
	call	inet_pton@PLT
	cmp	eax, 1
	jne	.L11
	mov	edx, 12
	mov	rsi, rbp
	mov	edi, r12d
	call	bind@PLT
	test	rax, rax
	js	.L12
	cmp	DWORD PTR SOCK_STREAM[rip], r13d
	je	.L13
.L6:
	mov	edi, DWORD PTR D_LISTENER[rip]
	mov	r8d, r13d
	mov	rcx, r15
	mov	rdx, r14
	lea	rsi, .LC5[rip]
	call	debug@PLT
.L1:
	mov	rax, QWORD PTR 24[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L14
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r12d
	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
	mov	esi, ebx
	mov	edi, r12d
	call	listen@PLT
	test	rax, rax
	jns	.L6
	mov	edi, r12d
	mov	r12d, -1
	call	close@PLT
	mov	ecx, r13d
	mov	rdx, r15
	mov	rsi, r14
	lea	rdi, .LC4[rip]
	xor	eax, eax
	call	error@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L11:
	mov	rsi, r14
	lea	rdi, .LC2[rip]
	xor	eax, eax
	call	error@PLT
	mov	edi, r12d
	mov	r12d, -1
	call	close@PLT
	jmp	.L1
.L10:
	mov	ecx, r13d
	mov	rdx, r15
	mov	rsi, r14
	xor	eax, eax
	lea	rdi, .LC1[rip]
	mov	r12d, -1
	call	error@PLT
	jmp	.L1
.L12:
	mov	edi, r12d
	mov	r12d, -1
	call	close@PLT
	mov	ecx, r13d
	mov	rdx, r15
	mov	rsi, r14
	lea	rdi, .LC3[rip]
	xor	eax, eax
	call	error@PLT
	jmp	.L1
.L14:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	create_listen_socket4, .-create_listen_socket4
	.comm	SOCK_STREAM,4,4
	.comm	D_LISTENER,4,4
	.comm	AF_INET,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_socket.c_create_listen_socket4.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"LISTENER: IPv4 creating new listening socket on ip "
	.ascii	"'%s' port %d, socktype %d\000"
	.align	2
.LC1:
	.ascii	"LISTENER: IPv4 socket() on ip '%s' port %d, socktyp"
	.ascii	"e %d failed.\000"
	.align	2
.LC2:
	.ascii	"LISTENER: Failed to convert IP '%s' to a valid IPv4"
	.ascii	" address.\000"
	.align	2
.LC3:
	.ascii	"LISTENER: IPv4 bind() on ip '%s' port %d, socktype "
	.ascii	"%d failed.\000"
	.align	2
.LC4:
	.ascii	"LISTENER: IPv4 listen() on ip '%s' port %d, socktyp"
	.ascii	"e %d failed.\000"
	.align	2
.LC5:
	.ascii	"LISTENER: Listening on IPv4 ip '%s' port %d, sockty"
	.ascii	"pe %d\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC6:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	create_listen_socket4
	.syntax unified
	.arm
	.fpu softvfp
	.type	create_listen_socket4, %function
create_listen_socket4:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r5, r0
	ldr	r10, .L15
	sub	sp, sp, #24
	ldr	ip, .L15+4
	ldr	r8, .L15+8
	str	r0, [sp]
	mov	r6, r1
	mov	r7, r2
	mov	r9, r3
	ldr	r0, [r10]
	mov	r3, r2
	mov	r2, r1
	ldr	r1, .L15+12
	ldr	ip, [ip]
	str	ip, [sp, #20]
	mov	ip,#0
	bl	debug
	mov	r1, r5
	mov	r2, #0
	ldr	r0, [r8]
	bl	socket
	subs	r4, r0, #0
	blt	.L10
	mov	r1, #1
	bl	sock_setreuse
	mov	r1, #1
	mov	r0, r4
	bl	sock_setreuse_port
	mov	r0, r4
	bl	sock_setnonblock
	mov	r0, r4
	bl	sock_enlarge_in
	mov	r3, #0
	ldr	r2, [r8]
	mov	r0, r7
	str	r3, [sp, #8]
	str	r3, [sp, #12]
	str	r2, [sp, #16]
	bl	htons
	mov	r3, r0
	mov	r1, r6
	ldr	r0, [r8]
	add	r2, sp, #8
	str	r3, [sp, #12]
	bl	inet_pton
	cmp	r0, #1
	bne	.L11
	mov	r2, #12
	mov	r0, r4
	add	r1, sp, #8
	bl	bind
	cmp	r0, #0
	blt	.L12
	ldr	r3, .L15+16
	ldr	r8, [r3]
	cmp	r8, r5
	beq	.L13
.L6:
	mov	r3, r7
	mov	r2, r6
	ldr	r0, [r10]
	ldr	r1, .L15+20
	str	r5, [sp]
	bl	debug
.L1:
	ldr	r3, .L15+4
	ldr	r2, [r3]
	ldr	r3, [sp, #20]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L14
	mov	r0, r4
	add	sp, sp, #24
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L13:
	mov	r1, r9
	mov	r0, r4
	bl	listen
	cmp	r0, #0
	bge	.L6
	mov	r0, r4
	bl	close
	mov	r3, r8
	mov	r2, r7
	mov	r1, r6
	ldr	r0, .L15+24
	bl	error
	mvn	r4, #0
	b	.L1
.L11:
	mov	r1, r6
	ldr	r0, .L15+28
	bl	error
	mov	r0, r4
	bl	close
	mvn	r4, #0
	b	.L1
.L10:
	mov	r3, r5
	mov	r2, r7
	mov	r1, r6
	ldr	r0, .L15+32
	bl	error
	mvn	r4, #0
	b	.L1
.L12:
	mov	r0, r4
	bl	close
	mov	r3, r5
	mov	r2, r7
	mov	r1, r6
	ldr	r0, .L15+36
	bl	error
	mvn	r4, #0
	b	.L1
.L14:
	bl	__stack_chk_fail
.L16:
	.align	2
.L15:
	.word	D_LISTENER
	.word	.LC6
	.word	AF_INET
	.word	.LC0
	.word	SOCK_STREAM
	.word	.LC5
	.word	.LC4
	.word	.LC2
	.word	.LC1
	.word	.LC3
	.size	create_listen_socket4, .-create_listen_socket4
	.comm	SOCK_STREAM,4,4
	.comm	D_LISTENER,4,4
	.comm	AF_INET,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
