	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sys_connect                    ## -- Begin function sys_connect
	.p2align	4, 0x90
_sys_connect:                           ## @sys_connect
	.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	%edx, %ecx
	movl	%esi, %r14d
	movl	%edi, %ebx
	movl	%edx, -36(%rbp)
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	movl	%r14d, %edx
	callq	_STRACE
	movl	%ebx, %edi
	callq	_sock_getfd
	movq	%rax, -48(%rbp)
	testq	%rax, %rax
	je	LBB0_9
## %bb.1:
	movq	%rax, %r15
	leaq	-40(%rbp), %rsi
	leaq	-36(%rbp), %rdx
	movl	%r14d, %edi
	callq	_sockaddr_read
	testl	%eax, %eax
	js	LBB0_12
## %bb.2:
	movl	32(%r15), %edi
	movl	-36(%rbp), %edx
	leaq	-40(%rbp), %rsi
	callq	_connect
	testl	%eax, %eax
	js	LBB0_11
## %bb.3:
	movl	%eax, %r14d
	movq	(%r15), %rax
	movq	_AF_LOCAL_@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_13
## %bb.4:
	leaq	24(%r15), %rdi
	callq	_fill_cred
	xorl	%edi, %edi
	cmpq	$0, 16(%r15)
	sete	%dil
	callq	_assert
	movl	32(%r15), %edi
	leaq	-48(%rbp), %rsi
	movl	$8, %edx
	callq	_write
	cmpl	$8, %eax
	jne	LBB0_13
## %bb.5:
	movq	_peer_lock@GOTPCREL(%rip), %rdi
	callq	_lock
	cmpq	$0, 16(%r15)
	jne	LBB0_8
## %bb.6:
	movq	%r15, %rbx
	addq	$8, %rbx
	movq	_peer_lock@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	movq	%r12, %rsi
	xorl	%edx, %edx
	callq	_wait_for
	cmpq	$0, 16(%r15)
	je	LBB0_7
LBB0_8:
	movq	_peer_lock@GOTPCREL(%rip), %rdi
	callq	_unlock
	jmp	LBB0_13
LBB0_9:
	movq	__EBADF@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	jmp	LBB0_13
LBB0_11:
	xorl	%eax, %eax
	callq	_errno_map
LBB0_12:
	movl	%eax, %r14d
LBB0_13:
	movl	%r14d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"connect(%d, 0x%x, %d)"

	.comm	__EBADF,4,2                     ## @_EBADF
	.comm	_AF_LOCAL_,8,3                  ## @AF_LOCAL_
	.comm	_peer_lock,4,2                  ## @peer_lock
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sys_connect                    ; -- Begin function sys_connect
	.p2align	2
_sys_connect:                           ; @sys_connect
	.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	x3, x2
	mov	x19, x1
	mov	x20, x0
	str	w2, [sp, #28]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	mov	x2, x19
	bl	_STRACE
	mov	x0, x20
	bl	_sock_getfd
	str	x0, [sp, #16]
	cbz	x0, LBB0_9
; %bb.1:
	mov	x20, x0
	add	x1, sp, #8
	add	x2, sp, #28
	mov	x0, x19
	bl	_sockaddr_read
	tbnz	w0, #31, LBB0_11
; %bb.2:
	ldr	w0, [x20, #32]
	ldr	w2, [sp, #28]
	add	x1, sp, #8
	bl	_connect
	tbnz	w0, #31, LBB0_10
; %bb.3:
	mov	x19, x0
	ldr	x8, [x20]
Lloh2:
	adrp	x9, _AF_LOCAL_@GOTPAGE
Lloh3:
	ldr	x9, [x9, _AF_LOCAL_@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_12
; %bb.4:
	add	x0, x20, #24
	bl	_fill_cred
	ldr	x8, [x20, #16]
	cmp	x8, #0
	cset	w0, eq
	bl	_assert
	ldr	w0, [x20, #32]
	add	x1, sp, #16
	mov	w2, #8
	bl	_write
	cmp	w0, #8
	b.ne	LBB0_12
; %bb.5:
Lloh5:
	adrp	x0, _peer_lock@GOTPAGE
Lloh6:
	ldr	x0, [x0, _peer_lock@GOTPAGEOFF]
	bl	_lock
	ldr	x8, [x20, #16]
	cbnz	x8, LBB0_8
; %bb.6:
	add	x21, x20, #8
Lloh7:
	adrp	x22, _peer_lock@GOTPAGE
Lloh8:
	ldr	x22, [x22, _peer_lock@GOTPAGEOFF]
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	mov	x1, x22
	mov	x2, #0
	bl	_wait_for
	ldr	x8, [x20, #16]
	cbz	x8, LBB0_7
LBB0_8:
Lloh9:
	adrp	x0, _peer_lock@GOTPAGE
Lloh10:
	ldr	x0, [x0, _peer_lock@GOTPAGEOFF]
	bl	_unlock
	b	LBB0_12
LBB0_9:
Lloh11:
	adrp	x8, __EBADF@GOTPAGE
Lloh12:
	ldr	x8, [x8, __EBADF@GOTPAGEOFF]
Lloh13:
	ldr	w19, [x8]
	b	LBB0_12
LBB0_10:
	bl	_errno_map
LBB0_11:
	mov	x19, x0
LBB0_12:
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"connect(%d, 0x%x, %d)"

	.comm	__EBADF,4,2                     ; @_EBADF
	.comm	_AF_LOCAL_,8,3                  ; @AF_LOCAL_
	.comm	_peer_lock,4,2                  ; @peer_lock
.subsections_via_symbols
