	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_server_update                  ## -- Begin function server_update
	.p2align	4, 0x90
_server_update:                         ## @server_update
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	_server_limit@GOTPCREL(%rip), %r14
	cmpl	$0, (%r14)
	je	LBB0_8
## %bb.1:
	movl	%edi, %ebx
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	callq	_log_debug
	movq	_UINT8_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	decl	%ebx
	imull	%ecx, %ebx
	movl	%ebx, %eax
	cltd
	idivl	(%r14)
	movl	%ecx, %edx
	subl	%eax, %edx
	movslq	%edx, %rsi
	movq	_server_avail@GOTPCREL(%rip), %rbx
	movq	%rsi, (%rbx)
	leaq	L_.str.1(%rip), %rdi
	movl	%ecx, %edx
	callq	_log_info
	movq	(%rbx), %rcx
	movq	_server_fd@GOTPCREL(%rip), %r14
	movl	(%r14), %eax
	testq	%rcx, %rcx
	jne	LBB0_4
## %bb.2:
	cmpl	$-1, %eax
	je	LBB0_4
## %bb.3:
	xorl	%eax, %eax
	callq	_server_close
	movq	(%rbx), %rcx
	movl	(%r14), %eax
LBB0_4:
	testq	%rcx, %rcx
	jle	LBB0_7
## %bb.5:
	cmpl	$-1, %eax
	jne	LBB0_7
## %bb.6:
	xorl	%eax, %eax
	callq	_server_open
LBB0_7:
	movq	_service_name@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_8
## %bb.9:
	xorl	%eax, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_server_register                ## TAILCALL
LBB0_8:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_server_limit,4,2               ## @server_limit
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"count %d"

	.comm	_UINT8_MAX,4,2                  ## @UINT8_MAX
	.comm	_server_avail,8,3               ## @server_avail
L_.str.1:                               ## @.str.1
	.asciz	"Service Availability: %d/%d"

	.comm	_server_fd,4,2                  ## @server_fd
	.comm	_service_name,8,3               ## @service_name
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_server_update                  ; -- Begin function server_update
	.p2align	2
_server_update:                         ; @server_update
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
Lloh0:
	adrp	x20, _server_limit@GOTPAGE
Lloh1:
	ldr	x20, [x20, _server_limit@GOTPAGEOFF]
	ldr	w8, [x20]
	cbz	w8, LBB0_8
; %bb.1:
	mov	x19, x0
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	bl	_log_debug
Lloh4:
	adrp	x8, _UINT8_MAX@GOTPAGE
Lloh5:
	ldr	x8, [x8, _UINT8_MAX@GOTPAGEOFF]
Lloh6:
	ldr	w2, [x8]
	sub	w8, w19, #1
	mul	w8, w2, w8
	ldr	w9, [x20]
	sdiv	w8, w8, w9
	sub	w8, w2, w8
	sxtw	x1, w8
Lloh7:
	adrp	x19, _server_avail@GOTPAGE
Lloh8:
	ldr	x19, [x19, _server_avail@GOTPAGEOFF]
	str	x1, [x19]
Lloh9:
	adrp	x0, l_.str.1@PAGE
Lloh10:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_log_info
	ldr	x8, [x19]
Lloh11:
	adrp	x20, _server_fd@GOTPAGE
Lloh12:
	ldr	x20, [x20, _server_fd@GOTPAGEOFF]
	ldr	w9, [x20]
	cbnz	x8, LBB0_4
; %bb.2:
	cmn	w9, #1
	b.eq	LBB0_4
; %bb.3:
	bl	_server_close
	ldr	x8, [x19]
	ldr	w9, [x20]
LBB0_4:
	cmp	x8, #1
	ccmn	w9, #1, #0, ge
	b.ne	LBB0_6
; %bb.5:
	bl	_server_open
LBB0_6:
Lloh13:
	adrp	x8, _service_name@GOTPAGE
Lloh14:
	ldr	x8, [x8, _service_name@GOTPAGEOFF]
Lloh15:
	ldr	x8, [x8]
	cbz	x8, LBB0_8
; %bb.7:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_server_register
LBB0_8:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_server_limit,4,2               ; @server_limit
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"count %d"

	.comm	_UINT8_MAX,4,2                  ; @UINT8_MAX
	.comm	_server_avail,8,3               ; @server_avail
l_.str.1:                               ; @.str.1
	.asciz	"Service Availability: %d/%d"

	.comm	_server_fd,4,2                  ; @server_fd
	.comm	_service_name,8,3               ; @service_name
.subsections_via_symbols
