	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sm_listen                      ## -- Begin function sm_listen
	.p2align	4, 0x90
_sm_listen:                             ## @sm_listen
	.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	%r12
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %r15d
	movq	_AF_INET@GOTPCREL(%rip), %r12
	movq	(%r12), %rdi
	movq	_SOCK_STREAM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_IPPROTO_TCP@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_socket
	testl	%eax, %eax
	js	LBB0_7
## %bb.1:
	movl	%eax, %ebx
	movq	_F_GETFL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edi
	callq	_fcntl
	movl	%eax, %r14d
	movq	(%r12), %rax
	movq	%rax, -48(%rbp)
	movq	_INADDR_ANY@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -56(%rbp)
	movl	%r15d, %edi
	callq	_htons
	movq	%rax, -64(%rbp)
	movl	$1, -40(%rbp)
	movl	$1, -36(%rbp)
	movq	_SOL_SOCKET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_SO_REUSEADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-40(%rbp), %rcx
	movl	%ebx, %edi
	movl	$4, %r8d
	callq	_setsockopt
	testq	%rax, %rax
	js	LBB0_6
## %bb.2:
	testl	%r14d, %r14d
	js	LBB0_6
## %bb.3:
	movq	_FIONBIO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-36(%rbp), %rdx
	movl	%ebx, %edi
	callq	_ioctl
	testq	%rax, %rax
	js	LBB0_6
## %bb.4:
	leaq	-64(%rbp), %rsi
	movl	%ebx, %edi
	movl	$24, %edx
	callq	_bind
	testq	%rax, %rax
	js	LBB0_6
## %bb.5:
	movl	%ebx, %edi
	movl	$5, %esi
	callq	_listen
	testq	%rax, %rax
	je	LBB0_8
LBB0_6:
	movl	%ebx, %edi
	callq	_close
LBB0_7:
	movl	$-1, %ebx
LBB0_8:
	movl	%ebx, %eax
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AF_INET,8,3                    ## @AF_INET
	.comm	_SOCK_STREAM,4,2                ## @SOCK_STREAM
	.comm	_IPPROTO_TCP,4,2                ## @IPPROTO_TCP
	.comm	_F_GETFL,4,2                    ## @F_GETFL
	.comm	_INADDR_ANY,8,3                 ## @INADDR_ANY
	.comm	_SOL_SOCKET,4,2                 ## @SOL_SOCKET
	.comm	_SO_REUSEADDR,4,2               ## @SO_REUSEADDR
	.comm	_FIONBIO,4,2                    ## @FIONBIO
	.comm	_INVALID_SOCKET,4,2             ## @INVALID_SOCKET
	.comm	_SOCKET_ERROR,8,3               ## @SOCKET_ERROR
	.comm	_stderr,4,2                     ## @stderr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sm_listen                      ; -- Begin function sm_listen
	.p2align	2
_sm_listen:                             ; @sm_listen
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x21, x0
Lloh0:
	adrp	x22, _AF_INET@GOTPAGE
Lloh1:
	ldr	x22, [x22, _AF_INET@GOTPAGEOFF]
	ldr	x0, [x22]
Lloh2:
	adrp	x8, _SOCK_STREAM@GOTPAGE
Lloh3:
	ldr	x8, [x8, _SOCK_STREAM@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
Lloh5:
	adrp	x8, _IPPROTO_TCP@GOTPAGE
Lloh6:
	ldr	x8, [x8, _IPPROTO_TCP@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	bl	_socket
	tbnz	w0, #31, LBB0_7
; %bb.1:
	mov	x19, x0
Lloh8:
	adrp	x8, _F_GETFL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _F_GETFL@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	bl	_fcntl
	mov	x20, x0
	ldr	x8, [x22]
Lloh11:
	adrp	x9, _INADDR_ANY@GOTPAGE
Lloh12:
	ldr	x9, [x9, _INADDR_ANY@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	stp	x9, x8, [sp, #16]
	mov	x0, x21
	bl	_htons
	str	x0, [sp, #8]
	mov	w8, #1
	stp	w8, w8, [sp]
Lloh14:
	adrp	x8, _SOL_SOCKET@GOTPAGE
Lloh15:
	ldr	x8, [x8, _SOL_SOCKET@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
Lloh17:
	adrp	x8, _SO_REUSEADDR@GOTPAGE
Lloh18:
	ldr	x8, [x8, _SO_REUSEADDR@GOTPAGEOFF]
Lloh19:
	ldr	w2, [x8]
	add	x3, sp, #4
	mov	x0, x19
	mov	w4, #4
	bl	_setsockopt
	tbnz	x0, #63, LBB0_6
; %bb.2:
	tbnz	w20, #31, LBB0_6
; %bb.3:
Lloh20:
	adrp	x8, _FIONBIO@GOTPAGE
Lloh21:
	ldr	x8, [x8, _FIONBIO@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	mov	x2, sp
	mov	x0, x19
	bl	_ioctl
	tbnz	x0, #63, LBB0_6
; %bb.4:
	add	x1, sp, #8
	mov	x0, x19
	mov	w2, #24
	bl	_bind
	tbnz	x0, #63, LBB0_6
; %bb.5:
	mov	x0, x19
	mov	w1, #5
	bl	_listen
	cbz	x0, LBB0_8
LBB0_6:
	mov	x0, x19
	bl	_close
LBB0_7:
	mov	w19, #-1
LBB0_8:
	mov	x0, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_AF_INET,8,3                    ; @AF_INET
	.comm	_SOCK_STREAM,4,2                ; @SOCK_STREAM
	.comm	_IPPROTO_TCP,4,2                ; @IPPROTO_TCP
	.comm	_F_GETFL,4,2                    ; @F_GETFL
	.comm	_INADDR_ANY,8,3                 ; @INADDR_ANY
	.comm	_SOL_SOCKET,4,2                 ; @SOL_SOCKET
	.comm	_SO_REUSEADDR,4,2               ; @SO_REUSEADDR
	.comm	_FIONBIO,4,2                    ; @FIONBIO
	.comm	_INVALID_SOCKET,4,2             ; @INVALID_SOCKET
	.comm	_SOCKET_ERROR,8,3               ; @SOCKET_ERROR
	.comm	_stderr,4,2                     ; @stderr
.subsections_via_symbols
