	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bsg_alloc_command
_bsg_alloc_command:                     ## @bsg_alloc_command
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	subl	(%rax), %edi
	callq	_ERR_PTR
	movq	%rax, %r15
	leaq	16(%rbx), %r14
	movq	%r14, %rdi
	callq	_spin_lock_irq
	movq	(%rbx), %rax
	cmpq	8(%rbx), %rax
	jge	LBB0_3
## %bb.1:
	incq	%rax
	movq	%rax, (%rbx)
	movq	%r14, %rdi
	callq	_spin_unlock_irq
	movq	_bsg_cmd_cachep@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kmem_cache_zalloc
	movq	%rax, %r15
	xorl	%edi, %edi
	testq	%rax, %rax
	sete	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_5
## %bb.2:
	movq	%r14, %rdi
	callq	_spin_lock_irq
	decq	(%rbx)
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	subl	(%rax), %edi
	callq	_ERR_PTR
	movq	%rax, %r15
LBB0_3:
	movq	%r14, %rdi
	callq	_spin_unlock_irq
	jmp	LBB0_4
LBB0_5:
	movq	%rbx, 8(%r15)
	movq	%r15, %rdi
	callq	_INIT_LIST_HEAD
	movl	20(%rbx), %esi
	leaq	L_.str(%rip), %rdi
	movq	%r15, %rdx
	callq	_dprintk
LBB0_4:
	movq	%r15, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_bsg_cmd_cachep,4,2             ## @bsg_cmd_cachep
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: returning free cmd %p\n"

	.no_dead_strip	_bsg_alloc_command
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bsg_alloc_command
_bsg_alloc_command:                     ; @bsg_alloc_command
	.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, x0
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	bl	_ERR_PTR
	mov	x21, x0
	add	x19, x20, #16
	mov	x0, x19
	bl	_spin_lock_irq
	ldp	x8, x9, [x20]
	cmp	x8, x9
	b.ge	LBB0_3
; %bb.1:
	add	x8, x8, #1
	str	x8, [x20]
	mov	x0, x19
	bl	_spin_unlock_irq
Lloh3:
	adrp	x8, _bsg_cmd_cachep@GOTPAGE
Lloh4:
	ldr	x8, [x8, _bsg_cmd_cachep@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
Lloh6:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	bl	_kmem_cache_zalloc
	mov	x21, x0
	cmp	x0, #0
	cset	w0, eq
	bl	_unlikely
	cbz	x0, LBB0_4
; %bb.2:
	mov	x0, x19
	bl	_spin_lock_irq
	ldr	x8, [x20]
	sub	x8, x8, #1
	str	x8, [x20]
Lloh9:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w0, w8
	bl	_ERR_PTR
	mov	x21, x0
LBB0_3:
	mov	x0, x19
	bl	_spin_unlock_irq
	b	LBB0_5
LBB0_4:
	str	x20, [x21, #8]
	mov	x0, x21
	bl	_INIT_LIST_HEAD
	ldr	w1, [x20, #20]
Lloh12:
	adrp	x0, l_.str@PAGE
Lloh13:
	add	x0, x0, l_.str@PAGEOFF
	mov	x2, x21
	bl	_dprintk
LBB0_5:
	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	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_bsg_cmd_cachep,4,2             ; @bsg_cmd_cachep
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: returning free cmd %p\n"

	.no_dead_strip	_bsg_alloc_command
.subsections_via_symbols
