	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_h2o_socket_connect             ## -- Begin function h2o_socket_connect
	.p2align	4, 0x90
_h2o_socket_connect:                    ## @h2o_socket_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r14d
	movl	%edx, %r12d
	movq	%rsi, %r13
	movq	%rdi, %r15
	movl	(%rsi), %edi
	movq	_SOCK_STREAM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_cloexec_socket
	cmpl	$-1, %eax
	je	LBB0_4
## %bb.1:
	movl	%eax, %ebx
	movq	_F_SETFL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_O_NONBLOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%ebx, %edi
	callq	_fcntl
	movl	%ebx, %edi
	movq	%r13, %rsi
	movl	%r12d, %edx
	callq	_connect
	testq	%rax, %rax
	je	LBB0_6
## %bb.2:
	movq	_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_EINPROGRESS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_3
LBB0_6:
	movq	_H2O_SOCKET_FLAG_IS_CONNECTING@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_create_socket_set_nodelay
	movq	%rax, %rbx
	movq	%rax, %rdi
	movl	%r14d, %esi
	callq	_h2o_socket_notify_write
	movq	%rbx, %rax
	jmp	LBB0_5
LBB0_3:
	movl	%ebx, %edi
	callq	_close
LBB0_4:
	xorl	%eax, %eax
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SOCK_STREAM,4,2                ## @SOCK_STREAM
	.comm	_F_SETFL,4,2                    ## @F_SETFL
	.comm	_O_NONBLOCK,4,2                 ## @O_NONBLOCK
	.comm	_errno,8,3                      ## @errno
	.comm	_EINPROGRESS,8,3                ## @EINPROGRESS
	.comm	_H2O_SOCKET_FLAG_IS_CONNECTING,4,2 ## @H2O_SOCKET_FLAG_IS_CONNECTING
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_h2o_socket_connect             ; -- Begin function h2o_socket_connect
	.p2align	2
_h2o_socket_connect:                    ; @h2o_socket_connect
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x3
	mov	x22, x2
	mov	x23, x1
	mov	x20, x0
	ldr	w0, [x1]
Lloh0:
	adrp	x8, _SOCK_STREAM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SOCK_STREAM@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_cloexec_socket
	cmn	w0, #1
	b.eq	LBB0_5
; %bb.1:
	mov	x21, x0
Lloh3:
	adrp	x8, _F_SETFL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _F_SETFL@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
Lloh6:
	adrp	x8, _O_NONBLOCK@GOTPAGE
Lloh7:
	ldr	x8, [x8, _O_NONBLOCK@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	bl	_fcntl
	mov	x0, x21
	mov	x1, x23
	mov	x2, x22
	bl	_connect
	cbz	x0, LBB0_3
; %bb.2:
Lloh9:
	adrp	x8, _errno@GOTPAGE
Lloh10:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
Lloh12:
	adrp	x9, _EINPROGRESS@GOTPAGE
Lloh13:
	ldr	x9, [x9, _EINPROGRESS@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_4
LBB0_3:
Lloh15:
	adrp	x8, _H2O_SOCKET_FLAG_IS_CONNECTING@GOTPAGE
Lloh16:
	ldr	x8, [x8, _H2O_SOCKET_FLAG_IS_CONNECTING@GOTPAGEOFF]
Lloh17:
	ldr	w2, [x8]
	mov	x0, x20
	mov	x1, x21
	bl	_create_socket_set_nodelay
	mov	x20, x0
	mov	x1, x19
	bl	_h2o_socket_notify_write
	mov	x0, x20
	b	LBB0_6
LBB0_4:
	mov	x0, x21
	bl	_close
LBB0_5:
	mov	x0, #0
LBB0_6:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_SOCK_STREAM,4,2                ; @SOCK_STREAM
	.comm	_F_SETFL,4,2                    ; @F_SETFL
	.comm	_O_NONBLOCK,4,2                 ; @O_NONBLOCK
	.comm	_errno,8,3                      ; @errno
	.comm	_EINPROGRESS,8,3                ; @EINPROGRESS
	.comm	_H2O_SOCKET_FLAG_IS_CONNECTING,4,2 ; @H2O_SOCKET_FLAG_IS_CONNECTING
.subsections_via_symbols
