	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gb_interface_mailbox_event     ## -- Begin function gb_interface_mailbox_event
	.p2align	4, 0x90
_gb_interface_mailbox_event:            ## @gb_interface_mailbox_event
	.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, %r15d
	movl	%esi, %ebx
	movq	%rdi, %r12
	leaq	4(%rdi), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	testl	%ebx, %ebx
	je	LBB0_2
## %bb.1:
	leaq	12(%r12), %rdi
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edx
	jmp	LBB0_9
LBB0_2:
	movq	_GB_SVC_INTF_MAILBOX_GREYBUS@GOTPCREL(%rip), %rax
	cmpl	%r15d, (%rax)
	jne	LBB0_3
## %bb.4:
	movq	_GB_INTERFACE_QUIRK_LEGACY_MODE_SWITCH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r12)
	je	LBB0_6
## %bb.5:
	movq	%r12, %rdi
	callq	_gb_interface_legacy_mode_switch
	jmp	LBB0_10
LBB0_3:
	leaq	12(%r12), %rdi
	leaq	L_.str.1(%rip), %rsi
LBB0_8:
	movl	%r15d, %edx
LBB0_9:
	callq	_dev_warn
	movq	%r12, %rdi
	callq	_gb_interface_disable
	movq	%r12, %rdi
	callq	_gb_interface_deactivate
LBB0_10:
	movq	%r14, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mutex_unlock                   ## TAILCALL
LBB0_6:
	leaq	12(%r12), %rdi
	cmpl	$0, 16(%r12)
	je	LBB0_7
## %bb.11:
	leaq	L_.str.3(%rip), %rsi
	callq	_dev_info
	addq	$8, %r12
	movq	%r12, %rdi
	callq	_complete
	jmp	LBB0_10
LBB0_7:
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"mailbox event with UniPro error: 0x%04x\n"

	.comm	_GB_SVC_INTF_MAILBOX_GREYBUS,4,2 ## @GB_SVC_INTF_MAILBOX_GREYBUS
L_.str.1:                               ## @.str.1
	.asciz	"mailbox event with unexpected value: 0x%08x\n"

	.comm	_GB_INTERFACE_QUIRK_LEGACY_MODE_SWITCH,4,2 ## @GB_INTERFACE_QUIRK_LEGACY_MODE_SWITCH
L_.str.2:                               ## @.str.2
	.asciz	"unexpected mailbox event: 0x%08x\n"

L_.str.3:                               ## @.str.3
	.asciz	"mode switch detected\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gb_interface_mailbox_event     ; -- Begin function gb_interface_mailbox_event
	.p2align	2
_gb_interface_mailbox_event:            ; @gb_interface_mailbox_event
	.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	x21, x2
	mov	x22, x1
	mov	x20, x0
	add	x19, x0, #4
	mov	x0, x19
	bl	_mutex_lock
	cbz	w22, LBB0_2
; %bb.1:
	add	x0, x20, #12
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x22
	b	LBB0_7
LBB0_2:
Lloh2:
	adrp	x8, _GB_SVC_INTF_MAILBOX_GREYBUS@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GB_SVC_INTF_MAILBOX_GREYBUS@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	cmp	w8, w21
	b.ne	LBB0_5
; %bb.3:
	ldr	w8, [x20]
Lloh5:
	adrp	x9, _GB_INTERFACE_QUIRK_LEGACY_MODE_SWITCH@GOTPAGE
Lloh6:
	ldr	x9, [x9, _GB_INTERFACE_QUIRK_LEGACY_MODE_SWITCH@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_9
; %bb.4:
	mov	x0, x20
	bl	_gb_interface_legacy_mode_switch
	b	LBB0_8
LBB0_5:
	add	x0, x20, #12
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_6:
	mov	x2, x21
LBB0_7:
	bl	_dev_warn
	mov	x0, x20
	bl	_gb_interface_disable
	mov	x0, x20
	bl	_gb_interface_deactivate
LBB0_8:
	mov	x0, x19
	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
	b	_mutex_unlock
LBB0_9:
	ldr	w8, [x20, #16]
	add	x0, x20, #12
	cbz	w8, LBB0_11
; %bb.10:
Lloh10:
	adrp	x1, l_.str.3@PAGE
Lloh11:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_info
	add	x0, x20, #8
	bl	_complete
	b	LBB0_8
LBB0_11:
Lloh12:
	adrp	x1, l_.str.2@PAGE
Lloh13:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_6
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"mailbox event with UniPro error: 0x%04x\n"

	.comm	_GB_SVC_INTF_MAILBOX_GREYBUS,4,2 ; @GB_SVC_INTF_MAILBOX_GREYBUS
l_.str.1:                               ; @.str.1
	.asciz	"mailbox event with unexpected value: 0x%08x\n"

	.comm	_GB_INTERFACE_QUIRK_LEGACY_MODE_SWITCH,4,2 ; @GB_INTERFACE_QUIRK_LEGACY_MODE_SWITCH
l_.str.2:                               ; @.str.2
	.asciz	"unexpected mailbox event: 0x%08x\n"

l_.str.3:                               ; @.str.3
	.asciz	"mode switch detected\n"

.subsections_via_symbols
