	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mmal_vc_sendwait_message       ## -- Begin function mmal_vc_sendwait_message
	.p2align	4, 0x90
_mmal_vc_sendwait_message:              ## @mmal_vc_sendwait_message
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, -72(%rbp)                  ## 8-byte Spill
	movq	%r8, %rbx
	movl	%ecx, %r15d
	movq	%rsi, %r13
	movq	%rdi, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	%rsi, -64(%rbp)
	movq	%rdx, -56(%rbp)
	xorl	%edi, %edi
	cmpq	$16, %rdx
	setae	%dil
	callq	_vcos_assert
	movq	%rbx, %rdi
	callq	_vcos_assert
	cmpl	$0, 8(%r12)
	je	LBB0_1
## %bb.2:
	cmpq	$0, 16(%rbp)
	je	LBB0_4
## %bb.3:
	movq	%r12, %rdi
	callq	_vcos_mutex_lock
LBB0_4:
	movq	%r12, %rdi
	callq	_get_waiter
	movq	%rax, %r14
	movl	%r15d, (%r13)
	movq	%rax, 8(%r13)
	movq	_MMAL_MAGIC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%r13)
	movq	%rbx, 16(%r14)
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movq	%rax, (%r14)
	leaq	L_.str(%rip), %rdi
	movq	%r14, %rsi
	movq	%rbx, %rdx
	xorl	%eax, %eax
	callq	_LOG_TRACE
	movq	%r12, %rdi
	callq	_mmal_vc_use_internal
	movl	4(%r12), %edi
	leaq	-64(%rbp), %rsi
	movl	$1, %edx
	callq	_vchiq_queue_message
	movq	_VCHIQ_SUCCESS@GOTPCREL(%rip), %rbx
	cmpq	(%rbx), %rax
	jne	LBB0_5
## %bb.7:
	cmpq	$0, 16(%rbp)
	je	LBB0_13
## %bb.8:
	movl	4(%r12), %edi
	leaq	_mmal_vc_sendwait_message.data(%rip), %rsi
	movl	$8, %edx
	movq	%r13, %rcx
	callq	_vchiq_queue_bulk_transmit
	movq	%rax, %r15
	movq	%r12, %rdi
	callq	_vcos_mutex_unlock
	xorl	%edi, %edi
	cmpq	(%rbx), %r15
	sete	%dil
	callq	_vcos_verify
	testl	%eax, %eax
	je	LBB0_9
LBB0_13:
	movq	%r14, %rdi
	addq	$8, %rdi
	callq	_vcos_semaphore_wait
	movq	%r12, %rdi
	callq	_mmal_vc_release_internal
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	movl	(%rbx), %esi
	movl	(%r14), %edx
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_LOG_TRACE
	movq	(%r14), %rax
	movq	%rax, (%rbx)
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_release_waiter
	movq	_MMAL_SUCCESS@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_11
LBB0_1:
	xorl	%edi, %edi
	callq	_vcos_assert
	movq	_MMAL_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_11
LBB0_5:
	movq	_MMAL_EIO@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	cmpq	$0, 16(%rbp)
	je	LBB0_10
## %bb.6:
	movq	%r12, %rdi
	callq	_vcos_mutex_unlock
	jmp	LBB0_10
LBB0_9:
	leaq	L_.str.1(%rip), %rdi
	callq	_LOG_ERROR
	xorl	%edi, %edi
	callq	_vcos_assert
	movq	_MMAL_EIO@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_10:
	movq	%r12, %rdi
	callq	_mmal_vc_release_internal
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_release_waiter
LBB0_11:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_14
## %bb.12:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_MMAL_EINVAL,4,2                ## @MMAL_EINVAL
	.comm	_MMAL_MAGIC,4,2                 ## @MMAL_MAGIC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"wait %p, reply to %p"

	.comm	_VCHIQ_SUCCESS,8,3              ## @VCHIQ_SUCCESS
	.comm	_MMAL_EIO,4,2                   ## @MMAL_EIO
.zerofill __DATA,__bss,_mmal_vc_sendwait_message.data,32,4 ## @mmal_vc_sendwait_message.data
L_.str.1:                               ## @.str.1
	.asciz	"failed bulk transmit"

L_.str.2:                               ## @.str.2
	.asciz	"got reply (len %i/%i)"

	.comm	_MMAL_SUCCESS,4,2               ## @MMAL_SUCCESS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mmal_vc_sendwait_message       ; -- Begin function mmal_vc_sendwait_message
	.p2align	2
_mmal_vc_sendwait_message:              ; @mmal_vc_sendwait_message
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x23, x6
	mov	x21, x5
	mov	x24, x4
	mov	x25, x3
	mov	x22, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #40]
	stp	x1, x2, [sp, #24]
	cmp	x2, #15
	cset	w0, hi
	bl	_vcos_assert
	mov	x0, x24
	bl	_vcos_assert
	ldr	w8, [x19, #8]
	cbz	w8, LBB0_7
; %bb.1:
	cbz	x23, LBB0_3
; %bb.2:
	mov	x0, x19
	bl	_vcos_mutex_lock
LBB0_3:
	mov	x0, x19
	bl	_get_waiter
	mov	x20, x0
	str	w25, [x22]
Lloh3:
	adrp	x8, _MMAL_MAGIC@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MMAL_MAGIC@GOTPAGEOFF]
	str	x0, [x22, #8]
Lloh5:
	ldr	w8, [x8]
	str	w8, [x22, #4]
	str	x24, [x0, #16]
	ldr	x8, [x21]
	str	x8, [x0]
	stp	x0, x24, [sp]
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	bl	_LOG_TRACE
	mov	x0, x19
	bl	_mmal_vc_use_internal
	ldr	w0, [x19, #4]
	add	x1, sp, #24
	mov	w2, #1
	bl	_vchiq_queue_message
Lloh8:
	adrp	x24, _VCHIQ_SUCCESS@GOTPAGE
Lloh9:
	ldr	x24, [x24, _VCHIQ_SUCCESS@GOTPAGEOFF]
	ldr	x8, [x24]
	cmp	x0, x8
	b.ne	LBB0_8
; %bb.4:
	cbz	x23, LBB0_6
; %bb.5:
	ldr	w0, [x19, #4]
Lloh10:
	adrp	x1, _mmal_vc_sendwait_message.data@PAGE
Lloh11:
	add	x1, x1, _mmal_vc_sendwait_message.data@PAGEOFF
	mov	w2, #8
	mov	x3, x22
	bl	_vchiq_queue_bulk_transmit
	mov	x22, x0
	mov	x0, x19
	bl	_vcos_mutex_unlock
	ldr	x8, [x24]
	cmp	x22, x8
	cset	w0, eq
	bl	_vcos_verify
	cbz	w0, LBB0_10
LBB0_6:
	add	x0, x20, #8
	bl	_vcos_semaphore_wait
	mov	x0, x19
	bl	_mmal_vc_release_internal
	ldr	x8, [x21]
	ldr	x9, [x20]
	stp	x8, x9, [sp]
Lloh12:
	adrp	x0, l_.str.2@PAGE
Lloh13:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_LOG_TRACE
	ldr	x8, [x20]
	str	x8, [x21]
	mov	x0, x19
	mov	x1, x20
	bl	_release_waiter
Lloh14:
	adrp	x8, _MMAL_SUCCESS@GOTPAGE
Lloh15:
	ldr	x8, [x8, _MMAL_SUCCESS@GOTPAGEOFF]
Lloh16:
	ldr	w21, [x8]
	b	LBB0_12
LBB0_7:
	mov	x0, #0
	bl	_vcos_assert
Lloh17:
	adrp	x8, _MMAL_EINVAL@GOTPAGE
Lloh18:
	ldr	x8, [x8, _MMAL_EINVAL@GOTPAGEOFF]
Lloh19:
	ldr	w21, [x8]
	b	LBB0_12
LBB0_8:
Lloh20:
	adrp	x8, _MMAL_EIO@GOTPAGE
Lloh21:
	ldr	x8, [x8, _MMAL_EIO@GOTPAGEOFF]
Lloh22:
	ldr	w21, [x8]
	cbz	x23, LBB0_11
; %bb.9:
	mov	x0, x19
	bl	_vcos_mutex_unlock
	b	LBB0_11
LBB0_10:
Lloh23:
	adrp	x0, l_.str.1@PAGE
Lloh24:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_LOG_ERROR
	mov	x0, #0
	bl	_vcos_assert
Lloh25:
	adrp	x8, _MMAL_EIO@GOTPAGE
Lloh26:
	ldr	x8, [x8, _MMAL_EIO@GOTPAGEOFF]
Lloh27:
	ldr	w21, [x8]
LBB0_11:
	mov	x0, x19
	bl	_mmal_vc_release_internal
	mov	x0, x19
	mov	x1, x20
	bl	_release_waiter
LBB0_12:
	ldr	x8, [sp, #40]
Lloh28:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh29:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh30:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_14
; %bb.13:
	mov	x0, x21
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_14:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_MMAL_EINVAL,4,2                ; @MMAL_EINVAL
	.comm	_MMAL_MAGIC,4,2                 ; @MMAL_MAGIC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"wait %p, reply to %p"

	.comm	_VCHIQ_SUCCESS,8,3              ; @VCHIQ_SUCCESS
	.comm	_MMAL_EIO,4,2                   ; @MMAL_EIO
.zerofill __DATA,__bss,_mmal_vc_sendwait_message.data,32,2 ; @mmal_vc_sendwait_message.data
l_.str.1:                               ; @.str.1
	.asciz	"failed bulk transmit"

l_.str.2:                               ; @.str.2
	.asciz	"got reply (len %i/%i)"

	.comm	_MMAL_SUCCESS,4,2               ; @MMAL_SUCCESS
.subsections_via_symbols
