	.file	"extr_net_sockets.c_mbedtls_net_connect.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	mbedtls_net_connect
	.type	mbedtls_net_connect, @function
mbedtls_net_connect:
.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, ecx
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	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
	mov	rbp, rsi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, rdi
	sub	rsp, 72
	.cfi_def_cfa_offset 128
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 56[rsp], rax
	xor	eax, eax
	call	net_prepare@PLT
	mov	r13d, eax
	test	eax, eax
	je	.L16
.L1:
	mov	rax, QWORD PTR 56[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L17
	add	rsp, 72
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r13d
	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
.L16:
	.cfi_restore_state
	lea	r15, 16[rsp]
	xor	esi, esi
	mov	edx, 32
	mov	rdi, r15
	call	memset@PLT
	mov	eax, DWORD PTR AF_UNSPEC[rip]
	cmp	DWORD PTR MBEDTLS_NET_PROTO_UDP[rip], r14d
	mov	DWORD PTR 32[rsp], eax
	je	.L18
	mov	eax, DWORD PTR SOCK_STREAM[rip]
	mov	DWORD PTR 28[rsp], eax
	mov	eax, DWORD PTR IPPROTO_TCP[rip]
.L4:
	lea	rcx, 8[rsp]
	mov	rdx, r15
	mov	rsi, r12
	mov	rdi, rbp
	mov	DWORD PTR 24[rsp], eax
	call	getaddrinfo@PLT
	test	rax, rax
	jne	.L19
	mov	rbp, QWORD PTR 8[rsp]
	test	rbp, rbp
	je	.L20
	.p2align 4,,10
	.p2align 3
.L6:
	mov	edx, DWORD PTR 8[rbp]
	mov	esi, DWORD PTR 12[rbp]
	mov	edi, DWORD PTR 16[rbp]
	call	socket@PLT
	mov	r12d, eax
	mov	eax, DWORD PTR MBEDTLS_ERR_NET_SOCKET_FAILED[rip]
	test	r12d, r12d
	js	.L9
	mov	esi, DWORD PTR 4[rbp]
	mov	edx, DWORD PTR 0[rbp]
	mov	edi, r12d
	call	connect@PLT
	test	rax, rax
	je	.L21
	mov	edi, r12d
	call	close@PLT
	mov	eax, DWORD PTR MBEDTLS_ERR_NET_CONNECT_FAILED[rip]
.L9:
	mov	rbp, QWORD PTR 24[rbp]
	test	rbp, rbp
	jne	.L6
	mov	rbp, QWORD PTR 8[rsp]
	mov	r13d, eax
.L7:
	mov	rdi, rbp
	call	freeaddrinfo@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L19:
	mov	r13d, DWORD PTR MBEDTLS_ERR_NET_UNKNOWN_HOST[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L18:
	mov	eax, DWORD PTR SOCK_DGRAM[rip]
	mov	DWORD PTR 28[rsp], eax
	mov	eax, DWORD PTR IPPROTO_UDP[rip]
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L21:
	mov	DWORD PTR [rbx], r12d
	mov	rbp, QWORD PTR 8[rsp]
	jmp	.L7
.L20:
	mov	r13d, DWORD PTR MBEDTLS_ERR_NET_UNKNOWN_HOST[rip]
	jmp	.L7
.L17:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	mbedtls_net_connect, .-mbedtls_net_connect
	.comm	SOCK_STREAM,4,4
	.comm	SOCK_DGRAM,4,4
	.comm	MBEDTLS_NET_PROTO_UDP,4,4
	.comm	MBEDTLS_ERR_NET_UNKNOWN_HOST,4,4
	.comm	MBEDTLS_ERR_NET_SOCKET_FAILED,4,4
	.comm	MBEDTLS_ERR_NET_CONNECT_FAILED,4,4
	.comm	IPPROTO_UDP,4,4
	.comm	IPPROTO_TCP,4,4
	.comm	AF_UNSPEC,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_net_sockets.c_mbedtls_net_connect.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	mbedtls_net_connect
	.syntax unified
	.arm
	.fpu softvfp
	.type	mbedtls_net_connect, %function
mbedtls_net_connect:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, lr}
	mov	r4, r3
	ldr	r3, .L22
	sub	sp, sp, #36
	mov	r7, r0
	mov	r8, r1
	mov	r6, r2
	ldr	r3, [r3]
	str	r3, [sp, #28]
	mov	r3,#0
	bl	net_prepare
	subs	r5, r0, #0
	beq	.L17
.L1:
	ldr	r3, .L22
	ldr	r2, [r3]
	ldr	r3, [sp, #28]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L18
	mov	r0, r5
	add	sp, sp, #36
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, pc}
.L17:
	ldr	r2, .L22+4
	ldr	r3, .L22+8
	ldr	r2, [r2]
	ldr	r3, [r3]
	cmp	r2, r4
	str	r3, [sp, #20]
	ldreq	r3, .L22+12
	ldrne	r3, .L22+16
	ldreq	r2, .L22+20
	ldrne	r2, .L22+24
	str	r5, [sp, #4]
	str	r5, [sp, #8]
	str	r5, [sp, #24]
	ldr	r3, [r3]
	ldr	ip, [r2]
	mov	r1, r6
	str	r3, [sp, #16]
	mov	r0, r8
	mov	r3, sp
	add	r2, sp, #4
	str	ip, [sp, #12]
	bl	getaddrinfo
	cmp	r0, #0
	bne	.L19
	ldr	r4, [sp]
	cmp	r4, #0
	beq	.L14
	ldr	r8, .L22+28
	ldr	r9, .L22+32
	b	.L6
.L8:
	ldr	r2, [r4]
	ldr	r1, [r4, #4]
	bl	connect
	subs	r5, r0, #0
	beq	.L20
	mov	r0, r6
	bl	close
	ldr	r4, [r4, #20]
	ldr	r5, [r8]
	cmp	r4, #0
	beq	.L21
.L6:
	ldr	r2, [r4, #8]
	ldr	r1, [r4, #12]
	ldr	r0, [r4, #16]
	bl	socket
	subs	r6, r0, #0
	bge	.L8
	ldr	r4, [r4, #20]
	ldr	r5, [r9]
	cmp	r4, #0
	bne	.L6
.L21:
	ldr	r4, [sp]
.L7:
	mov	r0, r4
	bl	freeaddrinfo
	b	.L1
.L19:
	ldr	r3, .L22+36
	ldr	r5, [r3]
	b	.L1
.L20:
	ldr	r4, [sp]
	str	r6, [r7]
	b	.L7
.L14:
	ldr	r3, .L22+36
	ldr	r5, [r3]
	b	.L7
.L18:
	bl	__stack_chk_fail
.L23:
	.align	2
.L22:
	.word	.LC0
	.word	MBEDTLS_NET_PROTO_UDP
	.word	AF_UNSPEC
	.word	SOCK_DGRAM
	.word	SOCK_STREAM
	.word	IPPROTO_UDP
	.word	IPPROTO_TCP
	.word	MBEDTLS_ERR_NET_CONNECT_FAILED
	.word	MBEDTLS_ERR_NET_SOCKET_FAILED
	.word	MBEDTLS_ERR_NET_UNKNOWN_HOST
	.size	mbedtls_net_connect, .-mbedtls_net_connect
	.comm	SOCK_STREAM,4,4
	.comm	SOCK_DGRAM,4,4
	.comm	MBEDTLS_NET_PROTO_UDP,4,4
	.comm	MBEDTLS_ERR_NET_UNKNOWN_HOST,4,4
	.comm	MBEDTLS_ERR_NET_SOCKET_FAILED,4,4
	.comm	MBEDTLS_ERR_NET_CONNECT_FAILED,4,4
	.comm	IPPROTO_UDP,4,4
	.comm	IPPROTO_TCP,4,4
	.comm	AF_UNSPEC,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
