	.file	"extr_socket_server.c_open_socket.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC1:
	.string	"reach skynet socket number limit"
	.text
	.p2align 4
	.type	open_socket, @function
open_socket:
.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
	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, 104
	.cfi_def_cfa_offset 160
	mov	r15d, DWORD PTR [rsi]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 88[rsp], rax
	xor	eax, eax
	mov	eax, DWORD PTR 8[rsi]
	lea	rbp, 64[rsp]
	lea	rbx, 16[rsp]
	mov	DWORD PTR [rdx], r15d
	mov	rdi, rbp
	mov	DWORD PTR 24[rdx], eax
	mov	QWORD PTR 16[rdx], 0
	mov	QWORD PTR 8[rdx], 0
	mov	edx, DWORD PTR 4[rsi]
	lea	rsi, .LC0[rip]
	mov	QWORD PTR 8[rsp], 0
	call	sprintf@PLT
	xor	esi, esi
	mov	edx, 40
	mov	rdi, rbx
	call	memset@PLT
	mov	edi, DWORD PTR 12[r13]
	mov	rdx, rbx
	mov	rsi, rbp
	mov	rax, QWORD PTR AF_UNSPEC[rip]
	lea	rcx, 8[rsp]
	mov	QWORD PTR 16[rsp], rax
	mov	eax, DWORD PTR SOCK_STREAM[rip]
	mov	DWORD PTR 40[rsp], eax
	mov	eax, DWORD PTR IPPROTO_TCP[rip]
	mov	DWORD PTR 36[rsp], eax
	call	getaddrinfo@PLT
	test	eax, eax
	jne	.L32
	mov	rbx, QWORD PTR 8[rsp]
	test	rbx, rbx
	je	.L4
.L8:
	mov	edx, DWORD PTR 20[rbx]
	mov	esi, DWORD PTR 24[rbx]
	mov	rdi, QWORD PTR [rbx]
	call	socket@PLT
	mov	ebp, eax
	test	eax, eax
	js	.L5
	mov	edi, eax
	call	socket_keepalive@PLT
	mov	edi, ebp
	call	sp_nonblocking@PLT
	mov	edx, DWORD PTR 16[rbx]
	mov	rsi, QWORD PTR 8[rbx]
	mov	edi, ebp
	call	connect@PLT
	test	eax, eax
	je	.L6
	mov	rax, QWORD PTR EINPROGRESS[rip]
	cmp	QWORD PTR errno[rip], rax
	jne	.L33
	mov	r8d, DWORD PTR 8[r13]
	mov	ecx, DWORD PTR PROTOCOL_TCP[rip]
	mov	edx, ebp
	mov	esi, r15d
	mov	r9d, 1
	mov	rdi, r14
	call	new_fd@PLT
	test	rax, rax
	jne	.L34
.L11:
	mov	edi, ebp
	call	close@PLT
	lea	rax, .LC1[rip]
	mov	QWORD PTR 8[r12], rax
.L3:
	mov	rdi, QWORD PTR 8[rsp]
	call	freeaddrinfo@PLT
	mov	edi, r15d
	mov	rbx, QWORD PTR 8[r14]
	call	HASH_ID@PLT
	mov	edx, DWORD PTR SOCKET_TYPE_INVALID[rip]
	mov	DWORD PTR [rbx+rax*4], edx
	mov	eax, DWORD PTR SOCKET_ERR[rip]
.L1:
	mov	rcx, QWORD PTR 88[rsp]
	xor	rcx, QWORD PTR fs:40
	jne	.L35
	add	rsp, 104
	.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
.L33:
	.cfi_restore_state
	mov	edi, ebp
	call	close@PLT
.L5:
	mov	rbx, QWORD PTR 32[rbx]
	test	rbx, rbx
	jne	.L8
.L4:
	mov	rdi, QWORD PTR errno[rip]
	call	strerror@PLT
	mov	QWORD PTR 8[r12], rax
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L32:
	mov	edi, eax
	call	gai_strerror@PLT
	mov	QWORD PTR 8[r12], rax
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L6:
	mov	r8d, DWORD PTR 8[r13]
	mov	ecx, DWORD PTR PROTOCOL_TCP[rip]
	mov	edx, ebp
	mov	esi, r15d
	mov	r9d, 1
	mov	rdi, r14
	call	new_fd@PLT
	test	rax, rax
	je	.L11
	mov	edx, DWORD PTR SOCKET_TYPE_CONNECTED[rip]
	mov	rsi, QWORD PTR 8[rbx]
	mov	ecx, 8
	mov	rdi, QWORD PTR [rbx]
	mov	DWORD PTR 4[rax], edx
	mov	rdx, QWORD PTR [r14]
	call	inet_ntop@PLT
	test	rax, rax
	je	.L9
	mov	rax, QWORD PTR [r14]
	mov	QWORD PTR 8[r12], rax
.L9:
	mov	rdi, QWORD PTR 8[rsp]
	call	freeaddrinfo@PLT
	mov	eax, DWORD PTR SOCKET_OPEN[rip]
	jmp	.L1
.L34:
	mov	edx, DWORD PTR SOCKET_TYPE_CONNECTING[rip]
	mov	edi, DWORD PTR 16[r14]
	mov	ecx, 1
	mov	esi, DWORD PTR [rax]
	mov	DWORD PTR 4[rax], edx
	mov	rdx, rax
	call	sp_write@PLT
	mov	rdi, QWORD PTR 8[rsp]
	call	freeaddrinfo@PLT
	mov	eax, -1
	jmp	.L1
.L35:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	open_socket, .-open_socket
	.comm	errno,8,8
	.comm	SOCK_STREAM,4,4
	.comm	SOCKET_TYPE_INVALID,4,4
	.comm	SOCKET_TYPE_CONNECTING,4,4
	.comm	SOCKET_TYPE_CONNECTED,4,4
	.comm	SOCKET_OPEN,4,4
	.comm	SOCKET_ERR,4,4
	.comm	PROTOCOL_TCP,4,4
	.comm	IPPROTO_TCP,4,4
	.comm	EINPROGRESS,8,8
	.comm	AF_UNSPEC,8,8
	.comm	AF_INET,8,8
	.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_server.c_open_socket.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"%d\000"
	.align	2
.LC1:
	.ascii	"reach skynet socket number limit\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC2:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	open_socket, %function
open_socket:
	@ args = 0, pretend = 0, frame = 48
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r4, #0
	mov	r5, r2
	mov	r6, r1
	ldr	r3, [r1, #8]
	ldr	r8, [r1]
	ldr	r2, .L36
	sub	sp, sp, #60
	ldr	r2, [r2]
	str	r2, [sp, #52]
	mov	r2,#0
	mov	r7, r0
	ldr	r2, [r1, #4]
	str	r3, [r5, #12]
	ldr	r1, .L36+4
	str	r8, [r5]
	str	r4, [r5, #8]
	str	r4, [r5, #4]
	add	r0, sp, #36
	str	r4, [sp, #8]
	bl	sprintf
	ldr	r3, .L36+8
	ldr	r2, .L36+12
	ldr	r1, .L36+16
	ldr	r3, [r3]
	ldr	r2, [r2]
	ldr	ip, [r1]
	str	r3, [sp, #28]
	str	r2, [sp, #24]
	ldr	r0, [r6, #12]
	add	r1, sp, #36
	add	r3, sp, #8
	add	r2, sp, #12
	str	r4, [sp, #16]
	str	ip, [sp, #12]
	str	r4, [sp, #20]
	str	r4, [sp, #32]
	bl	getaddrinfo
	cmp	r0, r4
	bne	.L32
	ldr	r4, [sp, #8]
	cmp	r4, #0
	beq	.L4
	ldr	r10, .L36+20
	ldr	r9, .L36+24
.L8:
	ldr	r2, [r4, #12]
	ldr	r1, [r4, #16]
	ldr	r0, [r4]
	bl	socket
	subs	fp, r0, #0
	blt	.L5
	bl	socket_keepalive
	mov	r0, fp
	bl	sp_nonblocking
	ldmib	r4, {r1, r2}
	mov	r0, fp
	bl	connect
	cmp	r0, #0
	beq	.L6
	ldr	r2, [r10]
	ldr	r3, [r9]
	cmp	r2, r3
	bne	.L33
	mov	r4, #1
	ldr	r2, [r6, #8]
	ldr	r3, .L36+28
	stm	sp, {r2, r4}
	mov	r1, r8
	mov	r2, fp
	mov	r0, r7
	ldr	r3, [r3]
	bl	new_fd
	subs	r2, r0, #0
	bne	.L34
.L11:
	mov	r0, fp
	bl	close
	ldr	r3, .L36+32
	str	r3, [r5, #4]
.L3:
	ldr	r0, [sp, #8]
	bl	freeaddrinfo
	mov	r0, r8
	ldr	r4, [r7, #4]
	bl	HASH_ID
	ldr	r2, .L36+36
	ldr	r3, .L36+40
	ldr	r2, [r2]
	str	r2, [r4, r0, lsl #2]
	ldr	r0, [r3]
.L1:
	ldr	r3, .L36
	ldr	r2, [r3]
	ldr	r3, [sp, #52]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L35
	add	sp, sp, #60
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L33:
	mov	r0, fp
	bl	close
.L5:
	ldr	r4, [r4, #20]
	cmp	r4, #0
	bne	.L8
.L4:
	ldr	r3, .L36+20
	ldr	r0, [r3]
	bl	strerror
	str	r0, [r5, #4]
	b	.L3
.L32:
	bl	gai_strerror
	str	r0, [r5, #4]
	b	.L3
.L6:
	mov	r2, #1
	ldr	r1, [r6, #8]
	ldr	r3, .L36+28
	stm	sp, {r1, r2}
	mov	r0, r7
	mov	r2, fp
	mov	r1, r8
	ldr	r3, [r3]
	bl	new_fd
	cmp	r0, #0
	beq	.L11
	ldr	r2, .L36+44
	mov	r3, #4
	ldr	r1, [r2]
	ldr	r2, [r7]
	str	r1, [r0, #4]
	ldm	r4, {r0, r1}
	bl	inet_ntop
	cmp	r0, #0
	ldrne	r3, [r7]
	ldr	r0, [sp, #8]
	strne	r3, [r5, #4]
	bl	freeaddrinfo
	ldr	r3, .L36+48
	ldr	r0, [r3]
	b	.L1
.L34:
	ldr	r1, .L36+52
	mov	r3, r4
	ldr	r1, [r1]
	ldr	r0, [r7, #8]
	str	r1, [r2, #4]
	ldr	r1, [r2]
	bl	sp_write
	ldr	r0, [sp, #8]
	bl	freeaddrinfo
	mvn	r0, #0
	b	.L1
.L35:
	bl	__stack_chk_fail
.L37:
	.align	2
.L36:
	.word	.LC2
	.word	.LC0
	.word	SOCK_STREAM
	.word	IPPROTO_TCP
	.word	AF_UNSPEC
	.word	errno
	.word	EINPROGRESS
	.word	PROTOCOL_TCP
	.word	.LC1
	.word	SOCKET_TYPE_INVALID
	.word	SOCKET_ERR
	.word	SOCKET_TYPE_CONNECTED
	.word	SOCKET_OPEN
	.word	SOCKET_TYPE_CONNECTING
	.size	open_socket, .-open_socket
	.comm	errno,4,4
	.comm	SOCK_STREAM,4,4
	.comm	SOCKET_TYPE_INVALID,4,4
	.comm	SOCKET_TYPE_CONNECTING,4,4
	.comm	SOCKET_TYPE_CONNECTED,4,4
	.comm	SOCKET_OPEN,4,4
	.comm	SOCKET_ERR,4,4
	.comm	PROTOCOL_TCP,4,4
	.comm	IPPROTO_TCP,4,4
	.comm	EINPROGRESS,4,4
	.comm	AF_UNSPEC,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
