	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function msc_buffer_alloc
_msc_buffer_alloc:                      ## @msc_buffer_alloc
	.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
	movl	%edx, %r12d
	movq	%rsi, %r15
	movq	%rdi, %rbx
	leaq	8(%rdi), %r14
	movq	%r14, %rdi
	callq	_atomic_read
	cmpl	$-1, %eax
	je	LBB0_2
## %bb.1:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_2:
	movq	(%rbx), %rax
	movq	_MSC_MODE_SINGLE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_5
## %bb.3:
	cmpl	$1, %r12d
	jne	LBB0_10
## %bb.4:
	movq	(%r15), %rsi
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shlq	%cl, %rsi
	movq	%rbx, %rdi
	callq	_msc_buffer_contig_alloc
	jmp	LBB0_7
LBB0_5:
	movq	_MSC_MODE_MULTI@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_8
## %bb.6:
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movl	%r12d, %edx
	callq	_msc_buffer_multi_alloc
LBB0_7:
	movl	%eax, %ebx
	testl	%ebx, %ebx
	jne	LBB0_12
	jmp	LBB0_9
LBB0_8:
	movq	_ENOTSUPP@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	testl	%ebx, %ebx
	jne	LBB0_12
LBB0_9:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_smp_mb__before_atomic
	movq	%r14, %rdi
	movl	$-1, %esi
	xorl	%edx, %edx
	callq	_atomic_cmpxchg
	xorl	%edi, %edi
	cmpl	$-1, %eax
	setne	%dil
	callq	_WARN_ON_ONCE
	testq	%rax, %rax
	je	LBB0_12
LBB0_10:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_11:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_12:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_MSC_MODE_SINGLE,8,3            ## @MSC_MODE_SINGLE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PAGE_SHIFT,8,3                 ## @PAGE_SHIFT
	.comm	_MSC_MODE_MULTI,8,3             ## @MSC_MODE_MULTI
	.comm	_ENOTSUPP,4,2                   ## @ENOTSUPP
	.no_dead_strip	_msc_buffer_alloc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function msc_buffer_alloc
_msc_buffer_alloc:                      ; @msc_buffer_alloc
	.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	x22, x2
	mov	x21, x1
	mov	x20, x0
	add	x19, x0, #8
	mov	x0, x19
	bl	_atomic_read
	cmn	w0, #1
	b.eq	LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EBUSY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_10
LBB0_2:
	ldr	x8, [x20]
Lloh2:
	adrp	x9, _MSC_MODE_SINGLE@GOTPAGE
Lloh3:
	ldr	x9, [x9, _MSC_MODE_SINGLE@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.3:
	cmp	w22, #1
	b.ne	LBB0_9
; %bb.4:
	ldr	x8, [x21]
Lloh5:
	adrp	x9, _PAGE_SHIFT@GOTPAGE
Lloh6:
	ldr	x9, [x9, _PAGE_SHIFT@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	lsl	x1, x8, x9
	mov	x0, x20
	bl	_msc_buffer_contig_alloc
	cbnz	w0, LBB0_11
	b	LBB0_8
LBB0_5:
Lloh8:
	adrp	x9, _MSC_MODE_MULTI@GOTPAGE
Lloh9:
	ldr	x9, [x9, _MSC_MODE_MULTI@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.6:
	mov	x0, x20
	mov	x1, x21
	mov	x2, x22
	bl	_msc_buffer_multi_alloc
	cbnz	w0, LBB0_11
	b	LBB0_8
LBB0_7:
Lloh11:
	adrp	x8, _ENOTSUPP@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ENOTSUPP@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w0, w8
	cbnz	w0, LBB0_11
LBB0_8:
	bl	_smp_mb__before_atomic
	mov	x0, x19
	mov	w1, #-1
	mov	w2, #0
	bl	_atomic_cmpxchg
	cmn	w0, #1
	cset	w0, ne
	bl	_WARN_ON_ONCE
	cbz	x0, LBB0_11
LBB0_9:
Lloh14:
	adrp	x8, _EINVAL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_10:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_11:
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_MSC_MODE_SINGLE,8,3            ; @MSC_MODE_SINGLE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PAGE_SHIFT,8,3                 ; @PAGE_SHIFT
	.comm	_MSC_MODE_MULTI,8,3             ; @MSC_MODE_MULTI
	.comm	_ENOTSUPP,4,2                   ; @ENOTSUPP
	.no_dead_strip	_msc_buffer_alloc
.subsections_via_symbols
