	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function find_or_create_connection
_find_or_create_connection:             ## @find_or_create_connection
	.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	%esi, %r14d
	movq	%rdi, %r15
	movq	_connections@GOTPCREL(%rip), %r13
	movq	16(%r13), %rbx
	cmpq	%r13, %rbx
	je	LBB0_8
## %bb.1:
	leaq	4(%r15), %r12
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%r12, %rsi
	movl	$4, %edx
	callq	_memcmp
	testl	%eax, %eax
	je	LBB0_6
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	16(%rbx), %rbx
	cmpq	%r13, %rbx
	je	LBB0_8
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	36(%rbx), %eax
	cmpl	(%r15), %eax
	jne	LBB0_7
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	leaq	36(%rbx), %rdi
	cmpl	$128, %eax
	je	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$129, %eax
	je	LBB0_5
	jmp	LBB0_11
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	32(%rbx), %eax
	cmpl	(%r15), %eax
	jne	LBB0_7
	jmp	LBB0_10
LBB0_8:
	movl	$48, %edi
	callq	_malloc
	movq	%rax, %rbx
	xorl	%edi, %edi
	testq	%rax, %rax
	setne	%dil
	callq	_assert
	movq	_find_or_create_connection.cid(%rip), %rax
	leaq	1(%rax), %rcx
	movq	%rcx, _find_or_create_connection.cid(%rip)
	movl	%eax, 44(%rbx)
	movq	_server_addr@GOTPCREL(%rip), %r12
	movq	(%r12), %rax
	movl	8(%rax), %edi
	callq	_new_socket
	movl	%eax, 40(%rbx)
	movq	(%r12), %rcx
	movl	(%rcx), %edx
	movl	4(%rcx), %esi
	movl	%eax, %edi
	callq	_connect
	testq	%rax, %rax
	jne	LBB0_12
## %bb.9:
	movq	%rbx, %rdi
	addq	$36, %rdi
	movq	%r15, %rsi
	movl	%r14d, %edx
	callq	_memcpy
	movl	%r14d, 32(%rbx)
	movq	24(%r13), %rax
	movq	%rax, 24(%rbx)
	movq	%r13, 16(%rbx)
	movq	%rbx, 24(%r13)
	movq	24(%rbx), %rax
	movq	%rbx, 16(%rax)
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rbx)
LBB0_10:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	xorl	%edi, %edi
	callq	_assert
	jmp	LBB0_10
LBB0_12:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strerror
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %edi
	movq	%rax, %rdx
	callq	_fprintf
	movl	$1, %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_find_or_create_connection.cid,8,3 ## @find_or_create_connection.cid
	.comm	_connections,48,3               ## @connections
	.comm	_server_addr,8,3                ## @server_addr
	.comm	_stderr,4,2                     ## @stderr
	.section	__TEXT,__cstring,cstring_literals
L_.str.1:                               ## @.str.1
	.asciz	"failed to connect to server:%s\n"

	.comm	_errno,4,2                      ## @errno
	.no_dead_strip	_find_or_create_connection
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function find_or_create_connection
_find_or_create_connection:             ; @find_or_create_connection
	.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	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x23, _connections@GOTPAGE
Lloh1:
	ldr	x23, [x23, _connections@GOTPAGEOFF]
	ldr	x19, [x23, #16]
	cmp	x19, x23
	b.eq	LBB0_8
; %bb.1:
	add	x22, x21, #4
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x1, x22
	mov	w2, #4
	bl	_memcmp
	cbz	w0, LBB0_7
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	x19, [x19, #16]
	cmp	x19, x23
	b.eq	LBB0_8
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	ldr	w8, [x0, #36]!
	ldr	w9, [x21]
	cmp	w8, w9
	b.ne	LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	cmp	w8, #128
	b.eq	LBB0_2
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	cmp	w8, #129
	b.eq	LBB0_2
	b	LBB0_11
LBB0_7:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x19, #32]
	ldr	w9, [x21]
	cmp	w8, w9
	b.ne	LBB0_3
	b	LBB0_10
LBB0_8:
	mov	w0, #48
	bl	_malloc
	mov	x19, x0
	cmp	x0, #0
	cset	w0, ne
	bl	_assert
	adrp	x8, _find_or_create_connection.cid@PAGE
	ldr	x9, [x8, _find_or_create_connection.cid@PAGEOFF]
	add	x10, x9, #1
	str	x10, [x8, _find_or_create_connection.cid@PAGEOFF]
	str	w9, [x19, #44]
Lloh2:
	adrp	x22, _server_addr@GOTPAGE
Lloh3:
	ldr	x22, [x22, _server_addr@GOTPAGEOFF]
	ldr	x8, [x22]
	ldr	w0, [x8, #8]
	bl	_new_socket
	str	w0, [x19, #40]
	ldr	x8, [x22]
	ldp	w2, w1, [x8]
	bl	_connect
	cbnz	x0, LBB0_12
; %bb.9:
	add	x0, x19, #36
	mov	x1, x21
	mov	x2, x20
	bl	_memcpy
	str	w20, [x19, #32]
	ldr	x8, [x23, #24]
	stp	x23, x8, [x19, #16]
	str	x19, [x23, #24]
	ldr	x8, [x19, #24]
	str	x19, [x8, #16]
	stp	xzr, xzr, [x19]
LBB0_10:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_11:
	mov	w0, #0
	bl	_assert
	b	LBB0_10
LBB0_12:
Lloh4:
	adrp	x8, _stderr@GOTPAGE
Lloh5:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh6:
	ldr	w19, [x8]
Lloh7:
	adrp	x8, _errno@GOTPAGE
Lloh8:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
	bl	_strerror
	mov	x2, x0
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_fprintf
	mov	w0, #1
	bl	_exit
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_find_or_create_connection.cid,8,3 ; @find_or_create_connection.cid
	.comm	_connections,48,3               ; @connections
	.comm	_server_addr,8,3                ; @server_addr
	.comm	_stderr,4,2                     ; @stderr
	.section	__TEXT,__cstring,cstring_literals
l_.str.1:                               ; @.str.1
	.asciz	"failed to connect to server:%s\n"

	.comm	_errno,4,2                      ; @errno
	.no_dead_strip	_find_or_create_connection
.subsections_via_symbols
