	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function proxy_connection_set
_proxy_connection_set:                  ## @proxy_connection_set
	.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	%rdi, %r12
	callq	_luaL_checkself
	movq	(%rax), %r14
	movl	$0, -44(%rbp)
	leaq	-44(%rbp), %rdx
	movq	%r12, %rdi
	movl	$2, %esi
	callq	_luaL_checklstring
	movq	%rax, %r15
	movq	8(%r14), %r13
	movl	-44(%rbp), %ebx
	leaq	L_.str(%rip), %rdi
	callq	_C
	movq	%r15, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_strleq
	testq	%rax, %rax
	je	LBB0_10
## %bb.1:
	movq	%r12, %rdi
	movl	$3, %esi
	callq	_luaL_checkinteger
	movl	%eax, %ebx
	subl	$1, %ebx
	jae	LBB0_3
## %bb.2:
	movq	%r14, %rdi
	callq	_network_connection_pool_lua_add_connection
	xorl	%r15d, %r15d
	jmp	LBB0_13
LBB0_10:
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	callq	_strcmp
	testq	%rax, %rax
	je	LBB0_11
## %bb.12:
	leaq	L_.str.2(%rip), %rsi
	movq	%r12, %rdi
	movq	%r15, %rdx
	callq	_luaL_error
	movl	%eax, %r15d
	jmp	LBB0_13
LBB0_3:
	xorl	%r15d, %r15d
	movq	%r14, %rdi
	movl	%ebx, %esi
	xorl	%edx, %edx
	callq	_network_connection_pool_lua_swap
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	%rax, (%r14)
	jmp	LBB0_13
LBB0_11:
	movq	_LUA_TBOOLEAN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	movl	$3, %esi
	callq	_luaL_checktype
	movq	%r12, %rdi
	movl	$3, %esi
	callq	_lua_toboolean
	movl	%eax, 4(%r13)
	xorl	%r15d, %r15d
	jmp	LBB0_13
LBB0_5:
	cmpl	$-2, %ebx
	jne	LBB0_9
## %bb.6:
	movq	8(%r13), %rax
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	decl	(%rax)
	movq	$0, 8(%r13)
LBB0_8:
	movl	$-1, (%r13)
	movq	(%r14), %rdi
	callq	_network_socket_free
	movq	$0, (%r14)
	jmp	LBB0_13
LBB0_9:
	movl	%ebx, (%r13)
LBB0_13:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"backend_ndx"

L_.str.1:                               ## @.str.1
	.asciz	"connection_close"

	.comm	_LUA_TBOOLEAN,4,2               ## @LUA_TBOOLEAN
L_.str.2:                               ## @.str.2
	.asciz	"proxy.connection.%s is not writable"

	.no_dead_strip	_proxy_connection_set
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function proxy_connection_set
_proxy_connection_set:                  ; @proxy_connection_set
	.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	x20, x0
	bl	_luaL_checkself
	ldr	x19, [x0]
	str	wzr, [sp, #12]
	add	x2, sp, #12
	mov	x0, x20
	mov	w1, #2
	bl	_luaL_checklstring
	mov	x21, x0
	ldr	x23, [x19, #8]
	ldr	w22, [sp, #12]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_C
	mov	x2, x0
	mov	x0, x21
	mov	x1, x22
	bl	_strleq
	cbz	x0, LBB0_4
; %bb.1:
	mov	x0, x20
	mov	w1, #3
	bl	_luaL_checkinteger
	cbz	w0, LBB0_6
; %bb.2:
	sub	w20, w0, #1
	mov	x0, x19
	mov	x1, x20
	mov	x2, #0
	bl	_network_connection_pool_lua_swap
	cbz	x0, LBB0_7
; %bb.3:
	mov	x8, x0
	mov	w0, #0
	str	x8, [x19]
	b	LBB0_13
LBB0_4:
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	bl	_strcmp
	cbz	x0, LBB0_11
; %bb.5:
Lloh4:
	adrp	x1, l_.str.2@PAGE
Lloh5:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x20
	mov	x2, x21
	bl	_luaL_error
	b	LBB0_13
LBB0_6:
	mov	x0, x19
	bl	_network_connection_pool_lua_add_connection
	mov	w0, #0
	b	LBB0_13
LBB0_7:
	cmn	w20, #2
	b.ne	LBB0_12
; %bb.8:
	ldr	x8, [x23, #8]
	cbz	x8, LBB0_10
; %bb.9:
	ldr	w9, [x8]
	sub	w9, w9, #1
	str	w9, [x8]
	str	xzr, [x23, #8]
LBB0_10:
	mov	w8, #-1
	str	w8, [x23]
	ldr	x0, [x19]
	bl	_network_socket_free
	mov	w0, #0
	str	xzr, [x19]
	b	LBB0_13
LBB0_11:
Lloh6:
	adrp	x8, _LUA_TBOOLEAN@GOTPAGE
Lloh7:
	ldr	x8, [x8, _LUA_TBOOLEAN@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	mov	x0, x20
	mov	w1, #3
	bl	_luaL_checktype
	mov	x0, x20
	mov	w1, #3
	bl	_lua_toboolean
	mov	x8, x0
	mov	w0, #0
	str	w8, [x23, #4]
	b	LBB0_13
LBB0_12:
	mov	w0, #0
	str	w20, [x23]
LBB0_13:
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"backend_ndx"

l_.str.1:                               ; @.str.1
	.asciz	"connection_close"

	.comm	_LUA_TBOOLEAN,4,2               ; @LUA_TBOOLEAN
l_.str.2:                               ; @.str.2
	.asciz	"proxy.connection.%s is not writable"

	.no_dead_strip	_proxy_connection_set
.subsections_via_symbols
