	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mbedtls_net_accept             ## -- Begin function mbedtls_net_accept
	.p2align	4, 0x90
_mbedtls_net_accept:                    ## @mbedtls_net_accept
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, -96(%rbp)                  ## 8-byte Spill
	movq	%rcx, -88(%rbp)                 ## 8-byte Spill
	movq	%rdx, %r12
	movq	%rsi, %r13
	movq	%rdi, %rbx
	movl	$8, -44(%rbp)
	movl	$4, -80(%rbp)
	movl	(%rdi), %edi
	movq	_SOL_SOCKET@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	_SO_TYPE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-60(%rbp), %rcx
	leaq	-80(%rbp), %r8
	callq	_getsockopt
	testq	%rax, %rax
	jne	LBB0_3
## %bb.1:
	movl	-60(%rbp), %eax
	movq	_SOCK_STREAM@GOTPCREL(%rip), %r15
	movl	(%r15), %ecx
	movq	_SOCK_DGRAM@GOTPCREL(%rip), %rdx
	cmpl	%ecx, %eax
	je	LBB0_6
## %bb.2:
	cmpl	(%rdx), %eax
	je	LBB0_6
LBB0_3:
	movq	_MBEDTLS_ERR_NET_ACCEPT_FAILED@GOTPCREL(%rip), %rax
LBB0_4:
	movl	(%rax), %ebx
LBB0_5:
	movl	%ebx, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	cmpl	%ecx, %eax
	jne	LBB0_12
## %bb.7:
	movl	(%rbx), %edi
	leaq	-56(%rbp), %rsi
	leaq	-44(%rbp), %rdx
	callq	_accept
	movl	%eax, (%r13)
	testl	%eax, %eax
	js	LBB0_13
LBB0_8:
	movl	-60(%rbp), %eax
	cmpl	(%r15), %eax
	jne	LBB0_15
LBB0_9:
	xorl	%ebx, %ebx
	testq	%r12, %r12
	je	LBB0_5
## %bb.10:
	movq	-56(%rbp), %rax
	movq	_AF_INET@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	movq	$4, (%rax)
	cmpq	$3, -88(%rbp)                   ## 8-byte Folded Reload
	ja	LBB0_19
## %bb.11:
	movq	_MBEDTLS_ERR_NET_BUFFER_TOO_SMALL@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_12:
	movb	$0, -72(%rbp)
	movl	(%rbx), %edi
	movq	_MSG_PEEK@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-72(%rbp), %rsi
	leaq	-56(%rbp), %r8
	leaq	-44(%rbp), %r9
	movl	$1, %edx
	callq	_recvfrom
	testl	%eax, %eax
	jns	LBB0_8
LBB0_13:
	movq	%rbx, %rdi
	callq	_net_would_block
	testq	%rax, %rax
	je	LBB0_3
## %bb.14:
	movq	_MBEDTLS_ERR_SSL_WANT_READ@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_15:
	movl	$1, -76(%rbp)
	movl	(%rbx), %edi
	movl	-44(%rbp), %edx
	leaq	-56(%rbp), %rsi
	callq	_connect
	testq	%rax, %rax
	je	LBB0_17
## %bb.16:
	movq	_MBEDTLS_ERR_NET_ACCEPT_FAILED@GOTPCREL(%rip), %r15
	movl	(%r15), %ebx
	jmp	LBB0_5
LBB0_17:
	movl	(%rbx), %eax
	movl	%eax, (%r13)
	movl	$-1, (%rbx)
	movl	$8, -44(%rbp)
	movl	(%r13), %edi
	leaq	-72(%rbp), %rsi
	leaq	-44(%rbp), %rdx
	callq	_getsockname
	movq	_MBEDTLS_ERR_NET_SOCKET_FAILED@GOTPCREL(%rip), %r15
	testq	%rax, %rax
	je	LBB0_20
LBB0_18:
	movl	(%r15), %ebx
	jmp	LBB0_5
LBB0_19:
	leaq	-56(%rbp), %rsi
	movl	$4, %edx
	movq	%r12, %rdi
	callq	_memcpy
	jmp	LBB0_5
LBB0_20:
	movq	-72(%rbp), %rdi
	movq	_SOCK_DGRAM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_IPPROTO_UDP@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_socket
	movl	%eax, (%rbx)
	testl	%eax, %eax
	js	LBB0_18
## %bb.21:
	movl	(%r14), %esi
	movq	_SO_REUSEADDR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	leaq	-76(%rbp), %rcx
	movl	%eax, %edi
	movl	$4, %r8d
	callq	_setsockopt
	testq	%rax, %rax
	jne	LBB0_18
## %bb.22:
	movl	(%rbx), %edi
	movl	-44(%rbp), %edx
	leaq	-72(%rbp), %rsi
	callq	_bind
	testq	%rax, %rax
	je	LBB0_9
## %bb.23:
	movq	_MBEDTLS_ERR_NET_BIND_FAILED@GOTPCREL(%rip), %rax
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.comm	_SOL_SOCKET,4,2                 ## @SOL_SOCKET
	.comm	_SO_TYPE,4,2                    ## @SO_TYPE
	.comm	_SOCK_STREAM,4,2                ## @SOCK_STREAM
	.comm	_SOCK_DGRAM,4,2                 ## @SOCK_DGRAM
	.comm	_MBEDTLS_ERR_NET_ACCEPT_FAILED,4,2 ## @MBEDTLS_ERR_NET_ACCEPT_FAILED
	.comm	_MSG_PEEK,4,2                   ## @MSG_PEEK
	.comm	_MBEDTLS_ERR_SSL_WANT_READ,4,2  ## @MBEDTLS_ERR_SSL_WANT_READ
	.comm	_IPPROTO_UDP,4,2                ## @IPPROTO_UDP
	.comm	_SO_REUSEADDR,4,2               ## @SO_REUSEADDR
	.comm	_MBEDTLS_ERR_NET_SOCKET_FAILED,4,2 ## @MBEDTLS_ERR_NET_SOCKET_FAILED
	.comm	_MBEDTLS_ERR_NET_BIND_FAILED,4,2 ## @MBEDTLS_ERR_NET_BIND_FAILED
	.comm	_AF_INET,8,3                    ## @AF_INET
	.comm	_MBEDTLS_ERR_NET_BUFFER_TOO_SMALL,4,2 ## @MBEDTLS_ERR_NET_BUFFER_TOO_SMALL
	.comm	_SOCKET_ERROR,4,2               ## @SOCKET_ERROR
	.comm	_WSAEMSGSIZE,8,3                ## @WSAEMSGSIZE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mbedtls_net_accept             ; -- Begin function mbedtls_net_accept
	.p2align	2
_mbedtls_net_accept:                    ; @mbedtls_net_accept
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x21, x4
	mov	x20, x3
	mov	x19, x2
	mov	x23, x1
	mov	x22, x0
	mov	w9, #8
	mov	w8, #4
	stp	w8, w9, [sp, #24]
	ldr	w0, [x0]
Lloh0:
	adrp	x24, _SOL_SOCKET@GOTPAGE
Lloh1:
	ldr	x24, [x24, _SOL_SOCKET@GOTPAGEOFF]
	ldr	w1, [x24]
Lloh2:
	adrp	x8, _SO_TYPE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _SO_TYPE@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
	add	x3, sp, #44
	add	x4, sp, #24
	bl	_getsockopt
	cbnz	x0, LBB0_12
; %bb.1:
	ldr	w8, [sp, #44]
Lloh5:
	adrp	x26, _SOCK_STREAM@GOTPAGE
Lloh6:
	ldr	x26, [x26, _SOCK_STREAM@GOTPAGEOFF]
	ldr	w9, [x26]
Lloh7:
	adrp	x25, _SOCK_DGRAM@GOTPAGE
Lloh8:
	ldr	x25, [x25, _SOCK_DGRAM@GOTPAGEOFF]
	ldr	w10, [x25]
	cmp	w8, w9
	ccmp	w8, w10, #4, ne
	b.ne	LBB0_12
; %bb.2:
	cmp	w8, w9
	b.ne	LBB0_8
; %bb.3:
	ldr	w0, [x22]
	add	x1, sp, #32
	add	x2, sp, #28
	bl	_accept
	str	w0, [x23]
	tbnz	w0, #31, LBB0_9
LBB0_4:
	ldr	w8, [sp, #44]
	ldr	w9, [x26]
	cmp	w8, w9
	b.ne	LBB0_11
LBB0_5:
	cbz	x19, LBB0_18
; %bb.6:
	ldr	x8, [sp, #32]
Lloh9:
	adrp	x9, _AF_INET@GOTPAGE
Lloh10:
	ldr	x9, [x9, _AF_INET@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	mov	w10, #4
	str	x10, [x21]
	cmp	x8, x9
	cmp	x20, #3
	b.hi	LBB0_17
; %bb.7:
Lloh12:
	adrp	x8, _MBEDTLS_ERR_NET_BUFFER_TOO_SMALL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MBEDTLS_ERR_NET_BUFFER_TOO_SMALL@GOTPAGEOFF]
	b	LBB0_13
LBB0_8:
	strb	wzr, [sp, #16]
	ldr	w0, [x22]
Lloh14:
	adrp	x8, _MSG_PEEK@GOTPAGE
Lloh15:
	ldr	x8, [x8, _MSG_PEEK@GOTPAGEOFF]
Lloh16:
	ldr	w3, [x8]
	add	x1, sp, #16
	add	x4, sp, #32
	add	x5, sp, #28
	mov	w2, #1
	bl	_recvfrom
                                        ; kill: def $w0 killed $w0 killed $x0 def $x0
	tbz	w0, #31, LBB0_4
LBB0_9:
	mov	x0, x22
	bl	_net_would_block
	cbz	x0, LBB0_12
; %bb.10:
Lloh17:
	adrp	x8, _MBEDTLS_ERR_SSL_WANT_READ@GOTPAGE
Lloh18:
	ldr	x8, [x8, _MBEDTLS_ERR_SSL_WANT_READ@GOTPAGEOFF]
	b	LBB0_13
LBB0_11:
	mov	w8, #1
	str	w8, [sp, #12]
	ldr	w0, [x22]
	ldr	w2, [sp, #28]
	add	x1, sp, #32
	bl	_connect
	cbz	x0, LBB0_15
LBB0_12:
Lloh19:
	adrp	x8, _MBEDTLS_ERR_NET_ACCEPT_FAILED@GOTPAGE
Lloh20:
	ldr	x8, [x8, _MBEDTLS_ERR_NET_ACCEPT_FAILED@GOTPAGEOFF]
LBB0_13:
	ldr	w0, [x8]
LBB0_14:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_15:
	ldr	w8, [x22]
	str	w8, [x23]
	mov	w8, #-1
	str	w8, [x22]
	mov	w8, #8
	str	w8, [sp, #28]
	ldr	w0, [x23]
	add	x1, sp, #16
	add	x2, sp, #28
	bl	_getsockname
	cbz	x0, LBB0_19
LBB0_16:
Lloh21:
	adrp	x8, _MBEDTLS_ERR_NET_SOCKET_FAILED@GOTPAGE
Lloh22:
	ldr	x8, [x8, _MBEDTLS_ERR_NET_SOCKET_FAILED@GOTPAGEOFF]
	b	LBB0_13
LBB0_17:
	add	x1, sp, #32
	mov	x0, x19
	mov	w2, #4
	bl	_memcpy
LBB0_18:
	mov	w0, #0
	b	LBB0_14
LBB0_19:
	ldr	x0, [sp, #16]
	ldr	w1, [x25]
Lloh23:
	adrp	x8, _IPPROTO_UDP@GOTPAGE
Lloh24:
	ldr	x8, [x8, _IPPROTO_UDP@GOTPAGEOFF]
Lloh25:
	ldr	w2, [x8]
	bl	_socket
	str	w0, [x22]
	tbnz	w0, #31, LBB0_16
; %bb.20:
	ldr	w1, [x24]
Lloh26:
	adrp	x8, _SO_REUSEADDR@GOTPAGE
Lloh27:
	ldr	x8, [x8, _SO_REUSEADDR@GOTPAGEOFF]
Lloh28:
	ldr	w2, [x8]
	add	x3, sp, #12
                                        ; kill: def $w0 killed $w0 killed $x0
	mov	w4, #4
	bl	_setsockopt
	cbnz	x0, LBB0_16
; %bb.21:
	ldr	w0, [x22]
	ldr	w2, [sp, #28]
	add	x1, sp, #16
	bl	_bind
	cbz	x0, LBB0_5
; %bb.22:
Lloh29:
	adrp	x8, _MBEDTLS_ERR_NET_BIND_FAILED@GOTPAGE
Lloh30:
	ldr	x8, [x8, _MBEDTLS_ERR_NET_BIND_FAILED@GOTPAGEOFF]
	b	LBB0_13
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_SOL_SOCKET,4,2                 ; @SOL_SOCKET
	.comm	_SO_TYPE,4,2                    ; @SO_TYPE
	.comm	_SOCK_STREAM,4,2                ; @SOCK_STREAM
	.comm	_SOCK_DGRAM,4,2                 ; @SOCK_DGRAM
	.comm	_MBEDTLS_ERR_NET_ACCEPT_FAILED,4,2 ; @MBEDTLS_ERR_NET_ACCEPT_FAILED
	.comm	_MSG_PEEK,4,2                   ; @MSG_PEEK
	.comm	_MBEDTLS_ERR_SSL_WANT_READ,4,2  ; @MBEDTLS_ERR_SSL_WANT_READ
	.comm	_IPPROTO_UDP,4,2                ; @IPPROTO_UDP
	.comm	_SO_REUSEADDR,4,2               ; @SO_REUSEADDR
	.comm	_MBEDTLS_ERR_NET_SOCKET_FAILED,4,2 ; @MBEDTLS_ERR_NET_SOCKET_FAILED
	.comm	_MBEDTLS_ERR_NET_BIND_FAILED,4,2 ; @MBEDTLS_ERR_NET_BIND_FAILED
	.comm	_AF_INET,8,3                    ; @AF_INET
	.comm	_MBEDTLS_ERR_NET_BUFFER_TOO_SMALL,4,2 ; @MBEDTLS_ERR_NET_BUFFER_TOO_SMALL
	.comm	_SOCKET_ERROR,4,2               ; @SOCKET_ERROR
	.comm	_WSAEMSGSIZE,8,3                ; @WSAEMSGSIZE
.subsections_via_symbols
