	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function stu300_await_event
_stu300_await_event:                    ## @stu300_await_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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %r15
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_irqs_disabled
	movl	%eax, %edi
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	8(%r15), %rdi
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EIO@GOTPCREL(%rip), %rax
	jmp	LBB0_13
LBB0_2:
	leaq	20(%r15), %r12
	movq	%r12, %rdi
	callq	_spin_lock_irq
	movq	_STU300_ERROR_NONE@GOTPCREL(%rip), %r13
	movl	(%r13), %eax
	movl	%eax, (%r15)
	movl	%r14d, 4(%r15)
	leaq	16(%r15), %rbx
	movq	%rbx, %rdi
	callq	_init_completion
	movq	%r15, %rdi
	callq	_stu300_irq_enable
	movq	%r12, %rdi
	callq	_spin_unlock_irq
	movq	_STU300_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_wait_for_completion_interruptible_timeout
	testl	%eax, %eax
	js	LBB0_3
## %bb.4:
	je	LBB0_5
## %bb.8:
	movl	(%r15), %edx
	xorl	%ebx, %ebx
	cmpl	(%r13), %edx
	je	LBB0_14
## %bb.9:
	movq	_STU300_EVENT_6@GOTPCREL(%rip), %rax
	cmpl	%r14d, (%rax)
	je	LBB0_11
## %bb.10:
	movq	8(%r15), %rdi
	leaq	L_.str.3(%rip), %rsi
	movl	%r14d, %ecx
	xorl	%eax, %eax
	callq	_dev_err
	movq	%r15, %rdi
	callq	_stu300_init_hw
LBB0_11:
	movq	_EIO@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_3:
	movl	%eax, %ebx
	movq	8(%r15), %rdi
	leaq	L_.str.1(%rip), %rsi
	movl	%eax, %edx
	movl	%r14d, %ecx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_14
LBB0_5:
	movq	_STU300_EVENT_6@GOTPCREL(%rip), %rax
	cmpl	%r14d, (%rax)
	je	LBB0_7
## %bb.6:
	movq	8(%r15), %rdi
	leaq	L_.str.2(%rip), %rsi
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_dev_err
	movq	%r15, %rdi
	callq	_stu300_init_hw
LBB0_7:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
LBB0_12:
	xorl	%ebx, %ebx
LBB0_13:
	subl	(%rax), %ebx
LBB0_14:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"irqs are disabled on this system!\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_STU300_ERROR_NONE,4,2          ## @STU300_ERROR_NONE
	.comm	_STU300_TIMEOUT,4,2             ## @STU300_TIMEOUT
L_.str.1:                               ## @.str.1
	.asciz	"wait_for_completion_interruptible_timeout()returned %d waiting for event %04x\n"

	.comm	_STU300_EVENT_6,4,2             ## @STU300_EVENT_6
L_.str.2:                               ## @.str.2
	.asciz	"controller timed out waiting for event %d, reinit hardware\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
L_.str.3:                               ## @.str.3
	.asciz	"controller error (await_event) %d waiting for event %d, reinit hardware\n"

	.no_dead_strip	_stu300_await_event
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function stu300_await_event
_stu300_await_event:                    ; @stu300_await_event
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x20, x1
	mov	x19, x0
	bl	_irqs_disabled
	bl	_unlikely
	cbz	x0, LBB0_5
; %bb.1:
	ldr	x0, [x19, #8]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
LBB0_2:
Lloh2:
	adrp	x8, _EIO@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_3:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_4:
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_5:
	add	x21, x19, #20
	mov	x0, x21
	bl	_spin_lock_irq
Lloh4:
	adrp	x23, _STU300_ERROR_NONE@GOTPAGE
Lloh5:
	ldr	x23, [x23, _STU300_ERROR_NONE@GOTPAGEOFF]
	ldr	w8, [x23]
	stp	w8, w20, [x19]
	add	x22, x19, #16
	mov	x0, x22
	bl	_init_completion
	mov	x0, x19
	bl	_stu300_irq_enable
	mov	x0, x21
	bl	_spin_unlock_irq
Lloh6:
	adrp	x8, _STU300_TIMEOUT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _STU300_TIMEOUT@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x22
	bl	_wait_for_completion_interruptible_timeout
	mov	x21, x0
	tbnz	w0, #31, LBB0_9
; %bb.6:
	cbz	w21, LBB0_10
; %bb.7:
	ldr	w8, [x19]
	ldr	w9, [x23]
	cmp	w8, w9
	b.ne	LBB0_13
; %bb.8:
	mov	w21, #0
	b	LBB0_4
LBB0_9:
	ldr	x0, [x19, #8]
	stp	x21, x20, [sp]
Lloh9:
	adrp	x1, l_.str.1@PAGE
Lloh10:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
	b	LBB0_4
LBB0_10:
Lloh11:
	adrp	x8, _STU300_EVENT_6@GOTPAGE
Lloh12:
	ldr	x8, [x8, _STU300_EVENT_6@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	cmp	w8, w20
	b.eq	LBB0_12
; %bb.11:
	ldr	x0, [x19, #8]
                                        ; kill: def $w20 killed $w20 killed $x20 def $x20
	str	x20, [sp]
Lloh14:
	adrp	x1, l_.str.2@PAGE
Lloh15:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_err
	mov	x0, x19
	bl	_stu300_init_hw
LBB0_12:
Lloh16:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
	b	LBB0_3
LBB0_13:
Lloh18:
	adrp	x9, _STU300_EVENT_6@GOTPAGE
Lloh19:
	ldr	x9, [x9, _STU300_EVENT_6@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	cmp	w9, w20
	b.eq	LBB0_2
; %bb.14:
	ldr	x0, [x19, #8]
                                        ; kill: def $w20 killed $w20 killed $x20 def $x20
	stp	x8, x20, [sp]
Lloh21:
	adrp	x1, l_.str.3@PAGE
Lloh22:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_err
	mov	x0, x19
	bl	_stu300_init_hw
	b	LBB0_2
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"irqs are disabled on this system!\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_STU300_ERROR_NONE,4,2          ; @STU300_ERROR_NONE
	.comm	_STU300_TIMEOUT,4,2             ; @STU300_TIMEOUT
l_.str.1:                               ; @.str.1
	.asciz	"wait_for_completion_interruptible_timeout()returned %d waiting for event %04x\n"

	.comm	_STU300_EVENT_6,4,2             ; @STU300_EVENT_6
l_.str.2:                               ; @.str.2
	.asciz	"controller timed out waiting for event %d, reinit hardware\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
l_.str.3:                               ; @.str.3
	.asciz	"controller error (await_event) %d waiting for event %d, reinit hardware\n"

	.no_dead_strip	_stu300_await_event
.subsections_via_symbols
