	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rpi_firmware_transaction
_rpi_firmware_transaction:              ## @rpi_firmware_transaction
	.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
	movl	%edx, %ebx
	movq	%rdi, %r14
	movl	%esi, %edi
	movl	%edx, %esi
	callq	_MBOX_MSG
	movl	%eax, -28(%rbp)
	andl	$15, %ebx
	movl	%ebx, %edi
	callq	_WARN_ON
	movq	_transaction_lock@GOTPCREL(%rip), %rdi
	callq	_mutex_lock
	leaq	4(%r14), %r15
	movq	%r15, %rdi
	callq	_reinit_completion
	movl	8(%r14), %edi
	leaq	-28(%rbp), %rsi
	callq	_mbox_send_message
	testl	%eax, %eax
	js	LBB0_3
## %bb.1:
	movq	_HZ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_wait_for_completion_timeout
	xorl	%ebx, %ebx
	testq	%rax, %rax
	jne	LBB0_4
## %bb.2:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	callq	_WARN_ONCE
	jmp	LBB0_4
LBB0_3:
	movl	%eax, %ebx
	movl	(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%eax, %edx
	callq	_dev_err
LBB0_4:
	movq	_transaction_lock@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_transaction_lock,4,2           ## @transaction_lock
	.comm	_HZ,4,2                         ## @HZ
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Firmware transaction timeout"

L_.str.1:                               ## @.str.1
	.asciz	"mbox_send_message returned %d\n"

	.no_dead_strip	_rpi_firmware_transaction
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rpi_firmware_transaction
_rpi_firmware_transaction:              ; @rpi_firmware_transaction
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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, x2
	mov	x19, x0
	mov	x0, x1
	mov	x1, x2
	bl	_MBOX_MSG
	str	w0, [sp, #12]
	and	w0, w20, #0xf
	bl	_WARN_ON
Lloh0:
	adrp	x0, _transaction_lock@GOTPAGE
Lloh1:
	ldr	x0, [x0, _transaction_lock@GOTPAGEOFF]
	bl	_mutex_lock
	add	x21, x19, #4
	mov	x0, x21
	bl	_reinit_completion
	ldr	w0, [x19, #8]
	add	x1, sp, #12
	bl	_mbox_send_message
	tbnz	w0, #31, LBB0_3
; %bb.1:
Lloh2:
	adrp	x8, _HZ@GOTPAGE
Lloh3:
	ldr	x8, [x8, _HZ@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_wait_for_completion_timeout
	cbz	x0, LBB0_4
; %bb.2:
	mov	w20, #0
	b	LBB0_5
LBB0_3:
	mov	x20, x0
	ldr	w0, [x19]
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x20
	bl	_dev_err
	b	LBB0_5
LBB0_4:
Lloh7:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w20, w8
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_WARN_ONCE
LBB0_5:
Lloh12:
	adrp	x0, _transaction_lock@GOTPAGE
Lloh13:
	ldr	x0, [x0, _transaction_lock@GOTPAGEOFF]
	bl	_mutex_unlock
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_transaction_lock,4,2           ; @transaction_lock
	.comm	_HZ,4,2                         ; @HZ
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Firmware transaction timeout"

l_.str.1:                               ; @.str.1
	.asciz	"mbox_send_message returned %d\n"

	.no_dead_strip	_rpi_firmware_transaction
.subsections_via_symbols
