	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function grab_global_resources
_grab_global_resources:                 ## @grab_global_resources
	.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	_spu_lock@GOTPCREL(%rip), %rdi
	callq	_mutex_lock
	movq	_global_ref@GOTPCREL(%rip), %r14
	movl	(%r14), %eax
	leal	1(%rax), %ecx
	movl	%ecx, (%r14)
	xorl	%ebx, %ebx
	testl	%eax, %eax
	jne	LBB0_10
## %bb.1:
	xorl	%eax, %eax
	callq	_n2_spu_hvapi_register
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_9
## %bb.2:
	xorl	%eax, %eax
	callq	_queue_cache_init
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %ebx
	xorl	%eax, %eax
	callq	_n2_spu_hvapi_unregister
LBB0_9:
	decl	(%r14)
LBB0_10:
	movq	_spu_lock@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	_NR_CPUS@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	movl	$8, %esi
	callq	_kcalloc
	movq	_cpu_to_cwq@GOTPCREL(%rip), %r12
	movq	%rax, (%r12)
	testq	%rax, %rax
	je	LBB0_7
## %bb.5:
	movl	(%r13), %edi
	movl	(%rbx), %edx
	movl	$8, %esi
	callq	_kcalloc
	movq	_cpu_to_mau@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	xorl	%ebx, %ebx
	testq	%rax, %rax
	jne	LBB0_10
## %bb.6:
	movq	(%r12), %rdi
	callq	_kfree
	movq	$0, (%r12)
LBB0_7:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_queue_cache_destroy
	xorl	%eax, %eax
	callq	_n2_spu_hvapi_unregister
	testl	%r15d, %r15d
	je	LBB0_10
## %bb.8:
	negl	%r15d
	movl	%r15d, %ebx
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_spu_lock,4,2                   ## @spu_lock
	.comm	_global_ref,4,2                 ## @global_ref
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_NR_CPUS,4,2                    ## @NR_CPUS
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_cpu_to_cwq,8,3                 ## @cpu_to_cwq
	.comm	_cpu_to_mau,8,3                 ## @cpu_to_mau
	.no_dead_strip	_grab_global_resources
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function grab_global_resources
_grab_global_resources:                 ; @grab_global_resources
	.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
Lloh0:
	adrp	x0, _spu_lock@GOTPAGE
Lloh1:
	ldr	x0, [x0, _spu_lock@GOTPAGEOFF]
	bl	_mutex_lock
Lloh2:
	adrp	x20, _global_ref@GOTPAGE
Lloh3:
	ldr	x20, [x20, _global_ref@GOTPAGEOFF]
	ldr	w8, [x20]
	add	w9, w8, #1
	str	w9, [x20]
	cbz	w8, LBB0_2
LBB0_1:
	mov	w19, #0
	b	LBB0_6
LBB0_2:
	bl	_n2_spu_hvapi_register
	mov	x19, x0
	cbnz	w0, LBB0_5
; %bb.3:
	bl	_queue_cache_init
	cbz	w0, LBB0_7
; %bb.4:
	mov	x19, x0
	bl	_n2_spu_hvapi_unregister
LBB0_5:
	ldr	w8, [x20]
	sub	w8, w8, #1
	str	w8, [x20]
LBB0_6:
Lloh4:
	adrp	x0, _spu_lock@GOTPAGE
Lloh5:
	ldr	x0, [x0, _spu_lock@GOTPAGEOFF]
	bl	_mutex_unlock
	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_7:
Lloh6:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh8:
	ldr	w19, [x8]
Lloh9:
	adrp	x22, _NR_CPUS@GOTPAGE
Lloh10:
	ldr	x22, [x22, _NR_CPUS@GOTPAGEOFF]
	ldr	w0, [x22]
Lloh11:
	adrp	x23, _GFP_KERNEL@GOTPAGE
Lloh12:
	ldr	x23, [x23, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w2, [x23]
	mov	w1, #8
	bl	_kcalloc
Lloh13:
	adrp	x21, _cpu_to_cwq@GOTPAGE
Lloh14:
	ldr	x21, [x21, _cpu_to_cwq@GOTPAGEOFF]
	str	x0, [x21]
	cbz	x0, LBB0_10
; %bb.8:
	ldr	w0, [x22]
	ldr	w2, [x23]
	mov	w1, #8
	bl	_kcalloc
Lloh15:
	adrp	x8, _cpu_to_mau@GOTPAGE
Lloh16:
	ldr	x8, [x8, _cpu_to_mau@GOTPAGEOFF]
Lloh17:
	str	x0, [x8]
	cbnz	x0, LBB0_1
; %bb.9:
	ldr	x0, [x21]
	bl	_kfree
	str	xzr, [x21]
LBB0_10:
	bl	_queue_cache_destroy
	bl	_n2_spu_hvapi_unregister
	cbz	w19, LBB0_6
; %bb.11:
	neg	w19, w19
	b	LBB0_5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotStr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_spu_lock,4,2                   ; @spu_lock
	.comm	_global_ref,4,2                 ; @global_ref
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_NR_CPUS,4,2                    ; @NR_CPUS
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_cpu_to_cwq,8,3                 ; @cpu_to_cwq
	.comm	_cpu_to_mau,8,3                 ; @cpu_to_mau
	.no_dead_strip	_grab_global_resources
.subsections_via_symbols
