	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function alloc_bfreg
_alloc_bfreg:                           ## @alloc_bfreg
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r12
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	leaq	4(%rsi), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	cmpl	$2, (%r15)
	jl	LBB0_3
## %bb.1:
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_alloc_high_class_bfreg
	movl	%eax, %ebx
	testl	%eax, %eax
	jns	LBB0_5
## %bb.2:
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_alloc_med_class_bfreg
	movl	%eax, %ebx
LBB0_3:
	testl	%ebx, %ebx
	jns	LBB0_5
## %bb.4:
	movq	_NUM_NON_BLUE_FLAME_BFREGS@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	cmpl	$1, (%rax)
	setne	%dil
	callq	_BUILD_BUG_ON
	movq	8(%r15), %rax
	incl	(%rax)
	xorl	%ebx, %ebx
LBB0_5:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_NUM_NON_BLUE_FLAME_BFREGS,4,2  ## @NUM_NON_BLUE_FLAME_BFREGS
	.no_dead_strip	_alloc_bfreg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function alloc_bfreg
_alloc_bfreg:                           ; @alloc_bfreg
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x20, x1
	mov	x22, x0
Lloh0:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh2:
	ldr	w21, [x8]
	add	x19, x1, #4
	mov	x0, x19
	bl	_mutex_lock
	ldr	w8, [x20]
	cmp	w8, #2
	b.lt	LBB0_3
; %bb.1:
	mov	x0, x22
	mov	x1, x20
	bl	_alloc_high_class_bfreg
	mov	x21, x0
	tbz	w0, #31, LBB0_5
; %bb.2:
	mov	x0, x22
	mov	x1, x20
	bl	_alloc_med_class_bfreg
	mov	x21, x0
	tbz	w21, #31, LBB0_5
	b	LBB0_4
LBB0_3:
	neg	w21, w21
	tbz	w21, #31, LBB0_5
LBB0_4:
Lloh3:
	adrp	x8, _NUM_NON_BLUE_FLAME_BFREGS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _NUM_NON_BLUE_FLAME_BFREGS@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w8, #1
	cset	w0, ne
	bl	_BUILD_BUG_ON
	mov	w21, #0
	ldr	x8, [x20, #8]
	ldr	w9, [x8]
	add	w9, w9, #1
	str	w9, [x8]
LBB0_5:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x21
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_NUM_NON_BLUE_FLAME_BFREGS,4,2  ; @NUM_NON_BLUE_FLAME_BFREGS
	.no_dead_strip	_alloc_bfreg
.subsections_via_symbols
