	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function alloc_msgbuf
_alloc_msgbuf:                          ## @alloc_msgbuf
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	_vchiq_lib_mutex@GOTPCREL(%rip), %rdi
	callq	_vcos_mutex_lock
	movq	_free_msgbufs@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	testq	%rbx, %rbx
	je	LBB0_2
## %bb.1:
	movq	(%rbx), %rcx
	movq	%rcx, (%rax)
	movq	_vchiq_lib_mutex@GOTPCREL(%rip), %rdi
	callq	_vcos_mutex_unlock
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
LBB0_2:
	movq	_vchiq_lib_mutex@GOTPCREL(%rip), %rdi
	callq	_vcos_mutex_unlock
	movq	_MSGBUF_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	jmp	_vcos_malloc                    ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_vchiq_lib_mutex,4,2            ## @vchiq_lib_mutex
	.comm	_free_msgbufs,8,3               ## @free_msgbufs
	.comm	_MSGBUF_SIZE,4,2                ## @MSGBUF_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"alloc_msgbuf"

	.no_dead_strip	_alloc_msgbuf
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function alloc_msgbuf
_alloc_msgbuf:                          ; @alloc_msgbuf
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
Lloh0:
	adrp	x0, _vchiq_lib_mutex@GOTPAGE
Lloh1:
	ldr	x0, [x0, _vchiq_lib_mutex@GOTPAGEOFF]
	bl	_vcos_mutex_lock
Lloh2:
	adrp	x8, _free_msgbufs@GOTPAGE
Lloh3:
	ldr	x8, [x8, _free_msgbufs@GOTPAGEOFF]
	ldr	x19, [x8]
	cbz	x19, LBB0_2
; %bb.1:
	ldr	x9, [x19]
	str	x9, [x8]
Lloh4:
	adrp	x0, _vchiq_lib_mutex@GOTPAGE
Lloh5:
	ldr	x0, [x0, _vchiq_lib_mutex@GOTPAGEOFF]
	bl	_vcos_mutex_unlock
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_2:
Lloh6:
	adrp	x0, _vchiq_lib_mutex@GOTPAGE
Lloh7:
	ldr	x0, [x0, _vchiq_lib_mutex@GOTPAGEOFF]
	bl	_vcos_mutex_unlock
Lloh8:
	adrp	x8, _MSGBUF_SIZE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _MSGBUF_SIZE@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_vcos_malloc
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_vchiq_lib_mutex,4,2            ; @vchiq_lib_mutex
	.comm	_free_msgbufs,8,3               ; @free_msgbufs
	.comm	_MSGBUF_SIZE,4,2                ; @MSGBUF_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"alloc_msgbuf"

	.no_dead_strip	_alloc_msgbuf
.subsections_via_symbols
