	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_new_socket                     ## -- Begin function new_socket
	.p2align	4, 0x90
_new_socket:                            ## @new_socket
	.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	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movl	%edi, %ebx
	movq	_SM_IPV6@GOTPCREL(%rip), %r12
	movl	(%r12), %eax
	andl	%edi, %eax
	jne	LBB0_1
## %bb.2:
	movq	_AF_INET@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_AF_INET6@GOTPCREL(%rip), %rax
LBB0_3:
	movl	(%rax), %edi
	movq	_SM_UDP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%ebx, %eax
	jne	LBB0_4
## %bb.5:
	movq	_SOCK_STREAM@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_4:
	movq	_SOCK_DGRAM@GOTPCREL(%rip), %rax
LBB0_6:
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_socket
	cmpl	$-1, %eax
	je	LBB0_7
## %bb.8:
	movl	%eax, %r15d
	testl	%ebx, (%r12)
	je	LBB0_11
## %bb.9:
	movq	_SM_IPV6_ONLY@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	andl	(%rax), %ebx
	setne	%cl
	movl	%ecx, -36(%rbp)
	movq	_IPPROTO_IPV6@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_IPV6_V6ONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-36(%rbp), %rcx
	movl	%r15d, %edi
	movl	$4, %r8d
	callq	_setsockopt
	testq	%rax, %rax
	js	LBB0_10
LBB0_11:
	testl	%r14d, %r14d
	je	LBB0_17
## %bb.12:
	movq	_F_GETFL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r15d, %edi
	xorl	%edx, %edx
	callq	_fcntl
	movl	%eax, -36(%rbp)
	testl	%eax, %eax
	js	LBB0_14
## %bb.13:
	movq	_F_SETFL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	_O_NONBLOCK@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%r15d, %edi
	movl	%eax, %edx
	callq	_fcntl
	testl	%eax, %eax
	jns	LBB0_17
LBB0_14:
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_15
LBB0_7:
	leaq	L_.str(%rip), %rdi
	callq	_perror
	jmp	LBB0_16
LBB0_10:
	leaq	L_.str.1(%rip), %rdi
LBB0_15:
	callq	_perror
	movl	%r15d, %edi
	callq	_close
LBB0_16:
	movl	$-1, %r15d
LBB0_17:
	movl	%r15d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SM_IPV6,4,2                    ## @SM_IPV6
	.comm	_AF_INET6,4,2                   ## @AF_INET6
	.comm	_AF_INET,4,2                    ## @AF_INET
	.comm	_SM_UDP,4,2                     ## @SM_UDP
	.comm	_SOCK_DGRAM,4,2                 ## @SOCK_DGRAM
	.comm	_SOCK_STREAM,4,2                ## @SOCK_STREAM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"socket()"

	.comm	_SM_IPV6_ONLY,4,2               ## @SM_IPV6_ONLY
	.comm	_IPPROTO_IPV6,4,2               ## @IPPROTO_IPV6
	.comm	_IPV6_V6ONLY,4,2                ## @IPV6_V6ONLY
L_.str.1:                               ## @.str.1
	.asciz	"setting IPV6_V6ONLY"

	.comm	_F_GETFL,4,2                    ## @F_GETFL
	.comm	_F_SETFL,4,2                    ## @F_SETFL
	.comm	_O_NONBLOCK,4,2                 ## @O_NONBLOCK
L_.str.2:                               ## @.str.2
	.asciz	"setting O_NONBLOCK"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_new_socket                     ; -- Begin function new_socket
	.p2align	2
_new_socket:                            ; @new_socket
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x22, _SM_IPV6@GOTPAGE
Lloh1:
	ldr	x22, [x22, _SM_IPV6@GOTPAGEOFF]
	ldr	w8, [x22]
Lloh2:
	adrp	x9, _AF_INET6@GOTPAGE
Lloh3:
	ldr	x9, [x9, _AF_INET6@GOTPAGEOFF]
Lloh4:
	adrp	x10, _AF_INET@GOTPAGE
Lloh5:
	ldr	x10, [x10, _AF_INET@GOTPAGEOFF]
	tst	w8, w0
	csel	x8, x10, x9, eq
	ldr	w0, [x8]
Lloh6:
	adrp	x8, _SM_UDP@GOTPAGE
Lloh7:
	ldr	x8, [x8, _SM_UDP@GOTPAGEOFF]
Lloh8:
	adrp	x9, _SOCK_DGRAM@GOTPAGE
Lloh9:
	ldr	x9, [x9, _SOCK_DGRAM@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
Lloh11:
	adrp	x10, _SOCK_STREAM@GOTPAGE
Lloh12:
	ldr	x10, [x10, _SOCK_STREAM@GOTPAGEOFF]
	tst	w8, w21
	csel	x8, x10, x9, eq
	ldr	w1, [x8]
	mov	w2, #0
	bl	_socket
	mov	x19, x0
	cmn	w0, #1
	b.eq	LBB0_8
; %bb.1:
	ldr	w8, [x22]
	tst	w8, w21
	b.eq	LBB0_3
; %bb.2:
Lloh13:
	adrp	x8, _SM_IPV6_ONLY@GOTPAGE
Lloh14:
	ldr	x8, [x8, _SM_IPV6_ONLY@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	tst	w8, w21
	cset	w8, ne
	str	w8, [sp, #12]
Lloh16:
	adrp	x8, _IPPROTO_IPV6@GOTPAGE
Lloh17:
	ldr	x8, [x8, _IPPROTO_IPV6@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
Lloh19:
	adrp	x8, _IPV6_V6ONLY@GOTPAGE
Lloh20:
	ldr	x8, [x8, _IPV6_V6ONLY@GOTPAGEOFF]
Lloh21:
	ldr	w2, [x8]
	add	x3, sp, #12
	mov	x0, x19
	mov	w4, #4
	bl	_setsockopt
	tbnz	x0, #63, LBB0_9
LBB0_3:
	cbz	w20, LBB0_6
; %bb.4:
Lloh22:
	adrp	x8, _F_GETFL@GOTPAGE
Lloh23:
	ldr	x8, [x8, _F_GETFL@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_fcntl
	str	w0, [sp, #12]
	tbnz	w0, #31, LBB0_7
; %bb.5:
Lloh25:
	adrp	x8, _F_SETFL@GOTPAGE
Lloh26:
	ldr	x8, [x8, _F_SETFL@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
Lloh28:
	adrp	x8, _O_NONBLOCK@GOTPAGE
Lloh29:
	ldr	x8, [x8, _O_NONBLOCK@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
	orr	w2, w8, w0
	mov	x0, x19
	bl	_fcntl
	tbnz	w0, #31, LBB0_7
LBB0_6:
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_7:
Lloh31:
	adrp	x0, l_.str.2@PAGE
Lloh32:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_10
LBB0_8:
Lloh33:
	adrp	x0, l_.str@PAGE
Lloh34:
	add	x0, x0, l_.str@PAGEOFF
	bl	_perror
	b	LBB0_6
LBB0_9:
Lloh35:
	adrp	x0, l_.str.1@PAGE
Lloh36:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_10:
	bl	_perror
	mov	x0, x19
	bl	_close
	mov	w19, #-1
	b	LBB0_6
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh10
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpAdd	Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.comm	_SM_IPV6,4,2                    ; @SM_IPV6
	.comm	_AF_INET6,4,2                   ; @AF_INET6
	.comm	_AF_INET,4,2                    ; @AF_INET
	.comm	_SM_UDP,4,2                     ; @SM_UDP
	.comm	_SOCK_DGRAM,4,2                 ; @SOCK_DGRAM
	.comm	_SOCK_STREAM,4,2                ; @SOCK_STREAM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"socket()"

	.comm	_SM_IPV6_ONLY,4,2               ; @SM_IPV6_ONLY
	.comm	_IPPROTO_IPV6,4,2               ; @IPPROTO_IPV6
	.comm	_IPV6_V6ONLY,4,2                ; @IPV6_V6ONLY
l_.str.1:                               ; @.str.1
	.asciz	"setting IPV6_V6ONLY"

	.comm	_F_GETFL,4,2                    ; @F_GETFL
	.comm	_F_SETFL,4,2                    ; @F_SETFL
	.comm	_O_NONBLOCK,4,2                 ; @O_NONBLOCK
l_.str.2:                               ; @.str.2
	.asciz	"setting O_NONBLOCK"

.subsections_via_symbols
