	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_timeout_connect                ## -- Begin function timeout_connect
	.p2align	4, 0x90
_timeout_connect:                       ## @timeout_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	%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	%edx, %r12d
	movq	%rsi, %rbx
	movl	%edi, %r15d
	movq	_timeout@GOTPCREL(%rip), %r13
	cmpl	$-1, (%r13)
	je	LBB0_1
## %bb.2:
	movq	_F_GETFL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r15d, %edi
	xorl	%edx, %edx
	callq	_fcntl
	movl	%eax, %r14d
	movq	_F_SETFL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_O_NONBLOCK@GOTPCREL(%rip), %rax
	movl	%r14d, %edx
	orl	(%rax), %edx
	movl	%r15d, %edi
	callq	_fcntl
	cmpl	$-1, %eax
	jne	LBB0_4
## %bb.3:
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	callq	_err
	jmp	LBB0_4
LBB0_1:
                                        ## implicit-def: $r14d
LBB0_4:
	movl	%r15d, %edi
	movq	%rbx, %rsi
	movl	%r12d, %edx
	callq	_connect
	testl	%eax, %eax
	je	LBB0_5
## %bb.6:
	movl	%eax, %ebx
	movq	_errno@GOTPCREL(%rip), %r12
	movl	(%r12), %eax
	movq	_EINPROGRESS@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_13
## %bb.7:
	movl	%r15d, -56(%rbp)
	movq	_POLLOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -52(%rbp)
	movl	(%r13), %edx
	leaq	-56(%rbp), %rdi
	movl	$1, %esi
	callq	_poll
	testl	%eax, %eax
	je	LBB0_11
## %bb.8:
	movl	%eax, %ebx
	cmpl	$1, %eax
	jne	LBB0_12
## %bb.9:
	movl	$4, -48(%rbp)
	movq	_SOL_SOCKET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_SO_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-44(%rbp), %rcx
	leaq	-48(%rbp), %r8
	movl	%r15d, %edi
	callq	_getsockopt
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_13
## %bb.10:
	movl	-44(%rbp), %eax
	movl	%eax, (%r12)
	xorl	%ebx, %ebx
	negl	%eax
	sbbl	%ebx, %ebx
	cmpl	$-1, (%r13)
	jne	LBB0_14
	jmp	LBB0_16
LBB0_5:
	xorl	%ebx, %ebx
	cmpl	$-1, (%r13)
	jne	LBB0_14
	jmp	LBB0_16
LBB0_11:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r12)
	movl	$-1, %ebx
LBB0_13:
	cmpl	$-1, (%r13)
	je	LBB0_16
LBB0_14:
	movq	_F_SETFL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r15d, %edi
	movl	%r14d, %edx
	callq	_fcntl
	cmpl	$-1, %eax
	jne	LBB0_16
## %bb.15:
	leaq	L_.str.2(%rip), %rsi
	movl	$1, %edi
	callq	_err
LBB0_16:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	leaq	L_.str.1(%rip), %rsi
	movl	$1, %edi
	callq	_err
	cmpl	$-1, (%r13)
	jne	LBB0_14
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.comm	_timeout,4,2                    ## @timeout
	.comm	_F_GETFL,4,2                    ## @F_GETFL
	.comm	_F_SETFL,4,2                    ## @F_SETFL
	.comm	_O_NONBLOCK,4,2                 ## @O_NONBLOCK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"set non-blocking mode"

	.comm	_errno,4,2                      ## @errno
	.comm	_EINPROGRESS,4,2                ## @EINPROGRESS
	.comm	_POLLOUT,4,2                    ## @POLLOUT
	.comm	_SOL_SOCKET,4,2                 ## @SOL_SOCKET
	.comm	_SO_ERROR,4,2                   ## @SO_ERROR
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
L_.str.1:                               ## @.str.1
	.asciz	"poll failed"

L_.str.2:                               ## @.str.2
	.asciz	"restoring flags"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_timeout_connect                ; -- Begin function timeout_connect
	.p2align	2
_timeout_connect:                       ; @timeout_connect
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x21, x2
	mov	x22, x1
	mov	x19, x0
Lloh0:
	adrp	x24, _timeout@GOTPAGE
Lloh1:
	ldr	x24, [x24, _timeout@GOTPAGEOFF]
	ldr	w8, [x24]
Lloh2:
	adrp	x23, _F_SETFL@GOTPAGE
Lloh3:
	ldr	x23, [x23, _F_SETFL@GOTPAGEOFF]
	cmn	w8, #1
	b.eq	LBB0_3
; %bb.1:
Lloh4:
	adrp	x8, _F_GETFL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _F_GETFL@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_fcntl
	mov	x20, x0
	ldr	w1, [x23]
Lloh7:
	adrp	x8, _O_NONBLOCK@GOTPAGE
Lloh8:
	ldr	x8, [x8, _O_NONBLOCK@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	orr	w2, w8, w0
	mov	x0, x19
	bl	_fcntl
	cmn	w0, #1
	b.ne	LBB0_4
; %bb.2:
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_err
	b	LBB0_4
LBB0_3:
                                        ; implicit-def: $w20
LBB0_4:
	mov	x0, x19
	mov	x1, x22
	mov	x2, x21
	bl	_connect
	mov	x21, x0
	cbz	w0, LBB0_12
; %bb.5:
Lloh12:
	adrp	x22, _errno@GOTPAGE
Lloh13:
	ldr	x22, [x22, _errno@GOTPAGEOFF]
	ldr	w8, [x22]
Lloh14:
	adrp	x9, _EINPROGRESS@GOTPAGE
Lloh15:
	ldr	x9, [x9, _EINPROGRESS@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_12
; %bb.6:
Lloh17:
	adrp	x8, _POLLOUT@GOTPAGE
Lloh18:
	ldr	x8, [x8, _POLLOUT@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	stp	w19, w8, [sp, #8]
	ldr	w2, [x24]
	add	x0, sp, #8
	mov	w1, #1
	bl	_poll
	cbz	w0, LBB0_10
; %bb.7:
	mov	x21, x0
	cmp	w0, #1
	b.ne	LBB0_11
; %bb.8:
	mov	w8, #4
	str	w8, [sp, #4]
Lloh20:
	adrp	x8, _SOL_SOCKET@GOTPAGE
Lloh21:
	ldr	x8, [x8, _SOL_SOCKET@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
Lloh23:
	adrp	x8, _SO_ERROR@GOTPAGE
Lloh24:
	ldr	x8, [x8, _SO_ERROR@GOTPAGEOFF]
Lloh25:
	ldr	w2, [x8]
	mov	x3, sp
	add	x4, sp, #4
	mov	x0, x19
	bl	_getsockopt
	mov	x21, x0
	cbnz	w0, LBB0_12
; %bb.9:
	ldr	w8, [sp]
	str	w8, [x22]
	cmp	w8, #0
	csetm	w21, ne
	b	LBB0_12
LBB0_10:
Lloh26:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh27:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	str	w8, [x22]
	mov	w21, #-1
	b	LBB0_12
LBB0_11:
Lloh29:
	adrp	x1, l_.str.1@PAGE
Lloh30:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_12:
	ldr	w8, [x24]
	cmn	w8, #1
	b.eq	LBB0_15
; %bb.13:
	ldr	w1, [x23]
	mov	x0, x19
	mov	x2, x20
	bl	_fcntl
	cmn	w0, #1
	b.ne	LBB0_15
; %bb.14:
Lloh31:
	adrp	x1, l_.str.2@PAGE
Lloh32:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_15:
	mov	x0, x21
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpAdd	Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_timeout,4,2                    ; @timeout
	.comm	_F_GETFL,4,2                    ; @F_GETFL
	.comm	_F_SETFL,4,2                    ; @F_SETFL
	.comm	_O_NONBLOCK,4,2                 ; @O_NONBLOCK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"set non-blocking mode"

	.comm	_errno,4,2                      ; @errno
	.comm	_EINPROGRESS,4,2                ; @EINPROGRESS
	.comm	_POLLOUT,4,2                    ; @POLLOUT
	.comm	_SOL_SOCKET,4,2                 ; @SOL_SOCKET
	.comm	_SO_ERROR,4,2                   ; @SO_ERROR
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
l_.str.1:                               ; @.str.1
	.asciz	"poll failed"

l_.str.2:                               ; @.str.2
	.asciz	"restoring flags"

.subsections_via_symbols
