	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_network_connection_pool_lua_swap ## -- Begin function network_connection_pool_lua_swap
	.p2align	4, 0x90
_network_connection_pool_lua_swap:      ## @network_connection_pool_lua_swap
	.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
	movq	%rdx, %r15
	movl	%esi, %r14d
	movq	%rdi, %r13
	movq	8(%rdi), %rax
	movq	16(%rdi), %r12
	movl	(%rax), %edi
	callq	_network_backends_get
	testq	%rax, %rax
	je	LBB0_8
## %bb.1:
	movq	%rax, %rbx
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	movq	%rax, %rdi
	callq	_chassis_event_thread_pool
	movq	%rax, %rdi
	callq	_network_connection_pool_get
	testq	%rax, %rax
	je	LBB0_5
## %bb.2:
	movq	%rax, %r15
	movq	%rbx, 8(%r12)
	movl	%r14d, (%r12)
	movq	%rbx, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_g_atomic_int_compare_and_exchange
	testl	%eax, %eax
	jne	LBB0_9
## %bb.3:
	movq	8(%r12), %rdi
	callq	_g_atomic_int_dec_and_test
	jmp	LBB0_9
LBB0_5:
	movq	%r13, %rdi
	movq	%rbx, %rsi
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	callq	_self_connect
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movq	%rax, %r15
	movq	%rbx, 8(%r12)
	movl	%r14d, (%r12)
	jmp	LBB0_9
LBB0_7:
	movl	$-1, (%r12)
LBB0_8:
	xorl	%r15d, %r15d
LBB0_9:
	movq	%r15, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_G_STRLOC,4,2                   ## @G_STRLOC
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_network_connection_pool_lua_swap ; -- Begin function network_connection_pool_lua_swap
	.p2align	2
_network_connection_pool_lua_swap:      ; @network_connection_pool_lua_swap
	.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	x22, x2
	mov	x20, x1
	mov	x23, x0
	ldp	x8, x24, [x0, #8]
	ldr	w0, [x8]
	bl	_network_backends_get
	cbz	x0, LBB0_4
; %bb.1:
	mov	x21, x0
	bl	_chassis_event_thread_pool
	bl	_network_connection_pool_get
	cbz	x0, LBB0_5
; %bb.2:
	mov	x19, x0
	str	x21, [x24, #8]
	str	w20, [x24]
	mov	x0, x21
	mov	w1, #0
	mov	w2, #0
	bl	_g_atomic_int_compare_and_exchange
	cbnz	w0, LBB0_8
; %bb.3:
	ldr	x0, [x24, #8]
	bl	_g_atomic_int_dec_and_test
	b	LBB0_8
LBB0_4:
	mov	x19, #0
	b	LBB0_8
LBB0_5:
	mov	x0, x23
	mov	x1, x21
	mov	x2, x22
	bl	_self_connect
	mov	x19, x0
	cbz	x0, LBB0_7
; %bb.6:
	str	x21, [x24, #8]
	str	w20, [x24]
	b	LBB0_8
LBB0_7:
	mov	w8, #-1
	str	w8, [x24]
LBB0_8:
	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
	.cfi_endproc
                                        ; -- End function
	.comm	_G_STRLOC,4,2                   ; @G_STRLOC
.subsections_via_symbols
