	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_socket_bind                    ## -- Begin function socket_bind
	.p2align	4, 0x90
_socket_bind:                           ## @socket_bind
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, -56(%rbp)                 ## 4-byte Spill
	movq	%rcx, %r14
	movl	%edx, %ebx
	movq	%rsi, %r12
	movl	%edi, %r15d
	xorl	%eax, %eax
	callq	_gc_new
	movl	%eax, -48(%rbp)
	movq	%r12, %rdi
	callq	_ASSERT
	testq	%r12, %r12
	je	LBB0_4
## %bb.1:
	movq	%r12, %r13
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	%ebx, (%r13)
	je	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	16(%r13), %r13
	testq	%r13, %r13
	jne	LBB0_2
LBB0_4:
	movq	_M_FATAL@GOTPCREL(%rip), %rax
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movl	%r15d, %r12d
	movq	%r14, %r15
	movl	(%rax), %r14d
	movl	%ebx, %edi
	callq	_addr_family_name
	leaq	L_.str(%rip), %rsi
	xorl	%r13d, %r13d
	movl	%r14d, %edi
	movq	%r15, %r14
	movl	%r12d, %r15d
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	movq	%r14, %rdx
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_msg
LBB0_5:
	movq	_AF_INET6@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jne	LBB0_8
## %bb.6:
	xorl	%edx, %edx
	cmpl	$0, -56(%rbp)                   ## 4-byte Folded Reload
	setne	%dl
	movl	%edx, -52(%rbp)
	movq	_M_INFO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_msg
	movq	_IPPROTO_IPV6@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_IPV6_V6ONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-52(%rbp), %rcx
	movl	%r15d, %edi
	movl	$4, %r8d
	callq	_setsockopt
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movq	_M_NONFATAL@GOTPCREL(%rip), %rax
	movq	_M_ERRNO@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	orl	(%rax), %edi
	movl	-52(%rbp), %edx
	leaq	L_.str.2(%rip), %rsi
	xorl	%eax, %eax
	callq	_msg
LBB0_8:
	movl	4(%r13), %esi
	movl	8(%r13), %edx
	movl	%r15d, %edi
	callq	_bind
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	movq	_M_FATAL@GOTPCREL(%rip), %rax
	movq	_M_ERRNO@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	orl	(%rax), %ebx
	movl	4(%r12), %edi
	movq	_PS_SHOW_PORT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str.4(%rip), %rsi
	leaq	-48(%rbp), %rcx
	callq	_print_sockaddr_ex
	leaq	L_.str.3(%rip), %rsi
	movl	%ebx, %edi
	movq	%r14, %rdx
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_msg
LBB0_10:
	leaq	-48(%rbp), %rdi
	callq	_gc_free
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_M_FATAL,4,2                    ## @M_FATAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: Socket bind failed: Addr to bind has no %s record"

	.comm	_AF_INET6,4,2                   ## @AF_INET6
	.comm	_M_INFO,4,2                     ## @M_INFO
L_.str.1:                               ## @.str.1
	.asciz	"setsockopt(IPV6_V6ONLY=%d)"

	.comm	_IPPROTO_IPV6,4,2               ## @IPPROTO_IPV6
	.comm	_IPV6_V6ONLY,4,2                ## @IPV6_V6ONLY
	.comm	_M_NONFATAL,4,2                 ## @M_NONFATAL
	.comm	_M_ERRNO,4,2                    ## @M_ERRNO
L_.str.2:                               ## @.str.2
	.asciz	"Setting IPV6_V6ONLY=%d failed"

L_.str.3:                               ## @.str.3
	.asciz	"%s: Socket bind failed on local address %s"

L_.str.4:                               ## @.str.4
	.asciz	":"

	.comm	_PS_SHOW_PORT,4,2               ## @PS_SHOW_PORT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_socket_bind                    ; -- Begin function socket_bind
	.p2align	2
_socket_bind:                           ; @socket_bind
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x22, x4
	mov	x19, x3
	mov	x23, x2
	mov	x20, x1
	mov	x21, x0
	bl	_gc_new
	str	w0, [sp, #24]
	mov	x0, x20
	bl	_ASSERT
Lloh0:
	adrp	x25, _M_FATAL@GOTPAGE
Lloh1:
	ldr	x25, [x25, _M_FATAL@GOTPAGEOFF]
	cbz	x20, LBB0_4
; %bb.1:
	mov	x24, x20
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x24]
	cmp	w8, w23
	b.eq	LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x24, [x24, #16]
	cbnz	x24, LBB0_2
LBB0_4:
	ldr	w24, [x25]
	mov	x0, x23
	bl	_addr_family_name
                                        ; kill: def $w0 killed $w0 def $x0
	stp	x19, x0, [sp]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x24
	bl	_msg
	mov	x24, #0
LBB0_5:
Lloh4:
	adrp	x8, _AF_INET6@GOTPAGE
Lloh5:
	ldr	x8, [x8, _AF_INET6@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	cmp	w8, w23
	b.ne	LBB0_8
; %bb.6:
	cmp	w22, #0
	cset	w8, ne
	str	w8, [sp, #20]
Lloh7:
	adrp	x9, _M_INFO@GOTPAGE
Lloh8:
	ldr	x9, [x9, _M_INFO@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x9]
	str	x8, [sp]
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_msg
Lloh12:
	adrp	x8, _IPPROTO_IPV6@GOTPAGE
Lloh13:
	ldr	x8, [x8, _IPPROTO_IPV6@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
Lloh15:
	adrp	x8, _IPV6_V6ONLY@GOTPAGE
Lloh16:
	ldr	x8, [x8, _IPV6_V6ONLY@GOTPAGEOFF]
Lloh17:
	ldr	w2, [x8]
	add	x3, sp, #20
	mov	x0, x21
	mov	w4, #4
	bl	_setsockopt
	cbz	x0, LBB0_8
; %bb.7:
Lloh18:
	adrp	x8, _M_NONFATAL@GOTPAGE
Lloh19:
	ldr	x8, [x8, _M_NONFATAL@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
Lloh21:
	adrp	x9, _M_ERRNO@GOTPAGE
Lloh22:
	ldr	x9, [x9, _M_ERRNO@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	orr	w0, w9, w8
	ldr	w8, [sp, #20]
	str	x8, [sp]
Lloh24:
	adrp	x1, l_.str.2@PAGE
Lloh25:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_msg
LBB0_8:
	ldp	w1, w2, [x24, #4]
	mov	x0, x21
	bl	_bind
	cbz	x0, LBB0_10
; %bb.9:
	ldr	w8, [x25]
Lloh26:
	adrp	x9, _M_ERRNO@GOTPAGE
Lloh27:
	ldr	x9, [x9, _M_ERRNO@GOTPAGEOFF]
Lloh28:
	ldr	w9, [x9]
	orr	w21, w9, w8
	ldr	w0, [x20, #4]
Lloh29:
	adrp	x8, _PS_SHOW_PORT@GOTPAGE
Lloh30:
	ldr	x8, [x8, _PS_SHOW_PORT@GOTPAGEOFF]
Lloh31:
	ldr	w2, [x8]
Lloh32:
	adrp	x1, l_.str.4@PAGE
Lloh33:
	add	x1, x1, l_.str.4@PAGEOFF
	add	x3, sp, #24
	bl	_print_sockaddr_ex
                                        ; kill: def $w0 killed $w0 def $x0
	stp	x19, x0, [sp]
Lloh34:
	adrp	x1, l_.str.3@PAGE
Lloh35:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x21
	bl	_msg
LBB0_10:
	add	x0, sp, #24
	bl	_gc_free
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_M_FATAL,4,2                    ; @M_FATAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: Socket bind failed: Addr to bind has no %s record"

	.comm	_AF_INET6,4,2                   ; @AF_INET6
	.comm	_M_INFO,4,2                     ; @M_INFO
l_.str.1:                               ; @.str.1
	.asciz	"setsockopt(IPV6_V6ONLY=%d)"

	.comm	_IPPROTO_IPV6,4,2               ; @IPPROTO_IPV6
	.comm	_IPV6_V6ONLY,4,2                ; @IPV6_V6ONLY
	.comm	_M_NONFATAL,4,2                 ; @M_NONFATAL
	.comm	_M_ERRNO,4,2                    ; @M_ERRNO
l_.str.2:                               ; @.str.2
	.asciz	"Setting IPV6_V6ONLY=%d failed"

l_.str.3:                               ; @.str.3
	.asciz	"%s: Socket bind failed on local address %s"

l_.str.4:                               ; @.str.4
	.asciz	":"

	.comm	_PS_SHOW_PORT,4,2               ; @PS_SHOW_PORT
.subsections_via_symbols
