	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_brain_connect                  ## -- Begin function brain_connect
	.p2align	4, 0x90
_brain_connect:                         ## @brain_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, %r15d
	movl	%edx, %r12d
	movq	%rsi, %r13
	movl	%edi, %ebx
	movq	_F_GETFL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_fcntl
	movl	%eax, %r14d
	movq	_F_SETFL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_O_NONBLOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	orl	%r14d, %edx
	movl	%ebx, %edi
	callq	_fcntl
	cmpl	$-1, %eax
	je	LBB0_1
## %bb.2:
	movl	%ebx, %edi
	movq	%r13, %rsi
	movl	%r12d, %edx
	callq	_connect
	movl	%ebx, %edi
	movl	%r15d, %esi
	callq	_select_write_timeout
	cmpl	$-1, %eax
	je	LBB0_13
## %bb.3:
	testl	%eax, %eax
	jne	LBB0_5
## %bb.4:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rdx
	xorl	%esi, %esi
	xorl	%eax, %eax
	callq	_brain_logging
	jmp	LBB0_12
LBB0_5:
	movl	$0, -44(%rbp)
	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	%ebx, %edi
	callq	_getsockopt
	cmpl	$-1, %eax
	je	LBB0_6
## %bb.7:
	movq	_F_SETFL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edi
	movl	%r14d, %edx
	callq	_fcntl
	cmpl	$-1, %eax
	je	LBB0_1
## %bb.8:
	movl	-44(%rbp), %edi
	testl	%edi, %edi
	je	LBB0_9
## %bb.10:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	callq	_strerror
	leaq	L_.str.3(%rip), %rdx
	jmp	LBB0_11
LBB0_1:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strerror
	leaq	L_.str(%rip), %rdx
LBB0_11:
	movl	%ebx, %edi
	xorl	%esi, %esi
	movq	%rax, %rcx
	xorl	%eax, %eax
	callq	_brain_logging
LBB0_12:
	movl	$-1, %eax
LBB0_13:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strerror
	leaq	L_.str.2(%rip), %rdx
	jmp	LBB0_11
LBB0_9:
	xorl	%eax, %eax
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_F_GETFL,4,2                    ## @F_GETFL
	.comm	_F_SETFL,4,2                    ## @F_SETFL
	.comm	_O_NONBLOCK,4,2                 ## @O_NONBLOCK
	.comm	_stderr,4,2                     ## @stderr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"fcntl: %s\n"

	.comm	_errno,4,2                      ## @errno
L_.str.1:                               ## @.str.1
	.asciz	"connect: timeout\n"

	.comm	_SOL_SOCKET,4,2                 ## @SOL_SOCKET
	.comm	_SO_ERROR,4,2                   ## @SO_ERROR
L_.str.2:                               ## @.str.2
	.asciz	"getsockopt: %s\n"

L_.str.3:                               ## @.str.3
	.asciz	"connect: %s\n"

	.comm	_FORMAT_MESSAGE_FROM_SYSTEM,4,2 ## @FORMAT_MESSAGE_FROM_SYSTEM
	.comm	_FORMAT_MESSAGE_IGNORE_INSERTS,4,2 ## @FORMAT_MESSAGE_IGNORE_INSERTS
	.comm	_LANG_NEUTRAL,4,2               ## @LANG_NEUTRAL
	.comm	_SOCKET_ERROR,8,3               ## @SOCKET_ERROR
	.comm	_SUBLANG_DEFAULT,4,2            ## @SUBLANG_DEFAULT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_brain_connect                  ; -- Begin function brain_connect
	.p2align	2
_brain_connect:                         ; @brain_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, x3
	mov	x22, x2
	mov	x23, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _F_GETFL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _F_GETFL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_fcntl
	mov	x20, x0
Lloh3:
	adrp	x24, _F_SETFL@GOTPAGE
Lloh4:
	ldr	x24, [x24, _F_SETFL@GOTPAGEOFF]
	ldr	w1, [x24]
Lloh5:
	adrp	x8, _O_NONBLOCK@GOTPAGE
Lloh6:
	ldr	x8, [x8, _O_NONBLOCK@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	orr	w2, w8, w0
	mov	x0, x19
	bl	_fcntl
	cmn	w0, #1
	b.eq	LBB0_8
; %bb.1:
	mov	x0, x19
	mov	x1, x23
	mov	x2, x22
	bl	_connect
	mov	x0, x19
	mov	x1, x21
	bl	_select_write_timeout
	cmn	w0, #1
	b.eq	LBB0_11
; %bb.2:
	cbnz	w0, LBB0_4
; %bb.3:
Lloh8:
	adrp	x8, _stderr@GOTPAGE
Lloh9:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
Lloh11:
	adrp	x2, l_.str.1@PAGE
Lloh12:
	add	x2, x2, l_.str.1@PAGEOFF
	b	LBB0_10
LBB0_4:
	mov	w8, #4
	stp	w8, wzr, [sp, #8]
Lloh13:
	adrp	x8, _SOL_SOCKET@GOTPAGE
Lloh14:
	ldr	x8, [x8, _SOL_SOCKET@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
Lloh16:
	adrp	x8, _SO_ERROR@GOTPAGE
Lloh17:
	ldr	x8, [x8, _SO_ERROR@GOTPAGEOFF]
Lloh18:
	ldr	w2, [x8]
	add	x3, sp, #12
	add	x4, sp, #8
	mov	x0, x19
	bl	_getsockopt
	cmn	w0, #1
	b.eq	LBB0_12
; %bb.5:
	ldr	w1, [x24]
	mov	x0, x19
	mov	x2, x20
	bl	_fcntl
	cmn	w0, #1
	b.eq	LBB0_8
; %bb.6:
	ldr	w0, [sp, #12]
	cbz	w0, LBB0_11
; %bb.7:
Lloh19:
	adrp	x8, _stderr@GOTPAGE
Lloh20:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh21:
	ldr	w19, [x8]
	bl	_strerror
	str	x0, [sp]
Lloh22:
	adrp	x2, l_.str.3@PAGE
Lloh23:
	add	x2, x2, l_.str.3@PAGEOFF
	b	LBB0_9
LBB0_8:
Lloh24:
	adrp	x8, _stderr@GOTPAGE
Lloh25:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh26:
	ldr	w19, [x8]
Lloh27:
	adrp	x8, _errno@GOTPAGE
Lloh28:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh29:
	ldr	w0, [x8]
	bl	_strerror
	str	x0, [sp]
Lloh30:
	adrp	x2, l_.str@PAGE
Lloh31:
	add	x2, x2, l_.str@PAGEOFF
LBB0_9:
	mov	x0, x19
LBB0_10:
	mov	w1, #0
	bl	_brain_logging
	mov	w0, #-1
LBB0_11:
	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
LBB0_12:
Lloh32:
	adrp	x8, _stderr@GOTPAGE
Lloh33:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh34:
	ldr	w19, [x8]
Lloh35:
	adrp	x8, _errno@GOTPAGE
Lloh36:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh37:
	ldr	w0, [x8]
	bl	_strerror
	str	x0, [sp]
Lloh38:
	adrp	x2, l_.str.2@PAGE
Lloh39:
	add	x2, x2, l_.str.2@PAGEOFF
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_F_GETFL,4,2                    ; @F_GETFL
	.comm	_F_SETFL,4,2                    ; @F_SETFL
	.comm	_O_NONBLOCK,4,2                 ; @O_NONBLOCK
	.comm	_stderr,4,2                     ; @stderr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"fcntl: %s\n"

	.comm	_errno,4,2                      ; @errno
l_.str.1:                               ; @.str.1
	.asciz	"connect: timeout\n"

	.comm	_SOL_SOCKET,4,2                 ; @SOL_SOCKET
	.comm	_SO_ERROR,4,2                   ; @SO_ERROR
l_.str.2:                               ; @.str.2
	.asciz	"getsockopt: %s\n"

l_.str.3:                               ; @.str.3
	.asciz	"connect: %s\n"

	.comm	_FORMAT_MESSAGE_FROM_SYSTEM,4,2 ; @FORMAT_MESSAGE_FROM_SYSTEM
	.comm	_FORMAT_MESSAGE_IGNORE_INSERTS,4,2 ; @FORMAT_MESSAGE_IGNORE_INSERTS
	.comm	_LANG_NEUTRAL,4,2               ; @LANG_NEUTRAL
	.comm	_SOCKET_ERROR,8,3               ; @SOCKET_ERROR
	.comm	_SUBLANG_DEFAULT,4,2            ; @SUBLANG_DEFAULT
.subsections_via_symbols
