	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pstcache_init                  ## -- Begin function pstcache_init
	.p2align	4, 0x90
_pstcache_init:                         ## @pstcache_init
	.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
	subq	$264, %rsp                      ## imm = 0x108
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_g_pstcache_enumerated@GOTPCREL(%rip), %rax
	movq	_True@GOTPCREL(%rip), %r12
	cmpq	$0, (%rax)
	je	LBB0_1
LBB0_9:
	movq	%r12, %rbx
LBB0_10:
	movl	(%rbx), %eax
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_12
## %bb.11:
	addq	$264, %rsp                      ## imm = 0x108
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	%rdi, %r15
	movq	_g_pstcache_fd@GOTPCREL(%rip), %r13
	movq	(%r13), %rax
	movl	$0, (%rax,%rdi,4)
	movq	_g_bitmap_cache@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	movq	_False@GOTPCREL(%rip), %rbx
	je	LBB0_10
## %bb.2:
	movq	_g_bitmap_cache_persist_enable@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_10
## %bb.3:
	xorl	%eax, %eax
	callq	_rd_pstcache_mkdir
	testl	%eax, %eax
	je	LBB0_4
## %bb.5:
	movq	_g_server_depth@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leal	7(%rcx), %eax
	addl	$14, %ecx
	testl	%eax, %eax
	cmovnsl	%eax, %ecx
	sarl	$3, %ecx
	movq	_g_pstcache_Bpp@GOTPCREL(%rip), %rax
	movl	%ecx, (%rax)
	leaq	L_.str.1(%rip), %rsi
	leaq	-304(%rbp), %r14
	movq	%r14, %rdi
	movq	%r15, %rdx
                                        ## kill: def $ecx killed $ecx killed $rcx
	callq	_sprintf
	movq	%r14, %rdi
	callq	_DEBUG
	movq	%r14, %rdi
	callq	_rd_open_file
	cmpl	$-1, %eax
	je	LBB0_10
## %bb.6:
	movl	%eax, %r14d
	movl	%eax, %edi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_rd_lock_file
	testl	%eax, %eax
	je	LBB0_7
## %bb.8:
	movq	(%r13), %rax
	movl	%r14d, (%rax,%r15,4)
	jmp	LBB0_9
LBB0_4:
	leaq	L_.str(%rip), %rdi
	callq	_DEBUG
	jmp	LBB0_10
LBB0_7:
	leaq	L_.str.3(%rip), %rdi
	callq	_warning
	movl	%r14d, %edi
	callq	_rd_close_file
	jmp	LBB0_10
LBB0_12:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_g_pstcache_enumerated,8,3      ## @g_pstcache_enumerated
	.comm	_True,4,2                       ## @True
	.comm	_g_pstcache_fd,8,3              ## @g_pstcache_fd
	.comm	_g_bitmap_cache,8,3             ## @g_bitmap_cache
	.comm	_g_bitmap_cache_persist_enable,8,3 ## @g_bitmap_cache_persist_enable
	.comm	_False,4,2                      ## @False
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to get/make cache directory!\n"

	.comm	_g_server_depth,4,2             ## @g_server_depth
	.comm	_g_pstcache_Bpp,4,2             ## @g_pstcache_Bpp
L_.str.1:                               ## @.str.1
	.asciz	"cache/pstcache_%d_%d"

L_.str.3:                               ## @.str.3
	.asciz	"Persistent bitmap caching is disabled. (The file is already in use)\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pstcache_init                  ; -- Begin function pstcache_init
	.p2align	2
_pstcache_init:                         ; @pstcache_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #320
	.cfi_def_cfa_offset 320
	stp	x22, x21, [sp, #272]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #288]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #304]            ; 16-byte Folded Spill
	add	x29, sp, #304
	.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
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
Lloh3:
	adrp	x8, _g_pstcache_enumerated@GOTPAGE
Lloh4:
	ldr	x8, [x8, _g_pstcache_enumerated@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cbz	x8, LBB0_2
LBB0_1:
Lloh6:
	adrp	x8, _True@GOTPAGE
Lloh7:
	ldr	x8, [x8, _True@GOTPAGEOFF]
	b	LBB0_10
LBB0_2:
	mov	x19, x0
Lloh8:
	adrp	x21, _g_pstcache_fd@GOTPAGE
Lloh9:
	ldr	x21, [x21, _g_pstcache_fd@GOTPAGEOFF]
	ldr	x8, [x21]
	str	wzr, [x8, x0, lsl #2]
Lloh10:
	adrp	x8, _g_bitmap_cache@GOTPAGE
Lloh11:
	ldr	x8, [x8, _g_bitmap_cache@GOTPAGEOFF]
Lloh12:
	ldr	x8, [x8]
Lloh13:
	adrp	x9, _g_bitmap_cache_persist_enable@GOTPAGE
Lloh14:
	ldr	x9, [x9, _g_bitmap_cache_persist_enable@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
	cmp	x8, #0
	ccmp	x9, #0, #4, ne
	b.eq	LBB0_9
; %bb.3:
	bl	_rd_pstcache_mkdir
	cbz	w0, LBB0_7
; %bb.4:
Lloh16:
	adrp	x8, _g_server_depth@GOTPAGE
Lloh17:
	ldr	x8, [x8, _g_server_depth@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	add	w9, w8, #7
	add	w8, w8, #14
	cmp	w9, #0
	csel	w8, w8, w9, lt
	asr	w3, w8, #3
Lloh19:
	adrp	x8, _g_pstcache_Bpp@GOTPAGE
Lloh20:
	ldr	x8, [x8, _g_pstcache_Bpp@GOTPAGEOFF]
Lloh21:
	str	w3, [x8]
Lloh22:
	adrp	x1, l_.str.1@PAGE
Lloh23:
	add	x1, x1, l_.str.1@PAGEOFF
	add	x0, sp, #8
	mov	x2, x19
	bl	_sprintf
	add	x0, sp, #8
	bl	_DEBUG
	add	x0, sp, #8
	bl	_rd_open_file
	cmn	w0, #1
	b.eq	LBB0_9
; %bb.5:
	mov	x20, x0
	mov	w1, #0
	mov	w2, #0
	bl	_rd_lock_file
	cbz	w0, LBB0_8
; %bb.6:
	ldr	x8, [x21]
	str	w20, [x8, x19, lsl #2]
	b	LBB0_1
LBB0_7:
Lloh24:
	adrp	x0, l_.str@PAGE
Lloh25:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DEBUG
	b	LBB0_9
LBB0_8:
Lloh26:
	adrp	x0, l_.str.3@PAGE
Lloh27:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_warning
	mov	x0, x20
	bl	_rd_close_file
LBB0_9:
Lloh28:
	adrp	x8, _False@GOTPAGE
Lloh29:
	ldr	x8, [x8, _False@GOTPAGEOFF]
LBB0_10:
	ldr	w0, [x8]
	ldur	x8, [x29, #-40]
Lloh30:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh31:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh32:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_12
; %bb.11:
	ldp	x29, x30, [sp, #304]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #288]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #272]            ; 16-byte Folded Reload
	add	sp, sp, #320
	ret
LBB0_12:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotStr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_g_pstcache_enumerated,8,3      ; @g_pstcache_enumerated
	.comm	_True,4,2                       ; @True
	.comm	_g_pstcache_fd,8,3              ; @g_pstcache_fd
	.comm	_g_bitmap_cache,8,3             ; @g_bitmap_cache
	.comm	_g_bitmap_cache_persist_enable,8,3 ; @g_bitmap_cache_persist_enable
	.comm	_False,4,2                      ; @False
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to get/make cache directory!\n"

	.comm	_g_server_depth,4,2             ; @g_server_depth
	.comm	_g_pstcache_Bpp,4,2             ; @g_pstcache_Bpp
l_.str.1:                               ; @.str.1
	.asciz	"cache/pstcache_%d_%d"

l_.str.3:                               ; @.str.3
	.asciz	"Persistent bitmap caching is disabled. (The file is already in use)\n"

.subsections_via_symbols
