	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function a10hdmi_set_audiomode
_a10hdmi_set_audiomode:                 ## @a10hdmi_set_audiomode
	.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
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	movl	%edi, %r15d
	callq	_device_get_softc
	movq	%rax, %r13
	movq	_HDMI_AUD_CTRL@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	_AUD_CTRL_RST@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	movq	%rax, %rdi
	callq	_HDMI_WRITE
	movq	_HDMI_AUDIO_RESET_RETRY@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	testl	%r14d, %r14d
	jle	LBB0_5
## %bb.1:
	incl	%r14d
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %esi
	movq	%r13, %rdi
	callq	_HDMI_READ
	testl	%eax, (%rbx)
	je	LBB0_6
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	decl	%r14d
	cmpl	$1, %r14d
	jg	LBB0_2
	jmp	LBB0_4
LBB0_5:
	je	LBB0_4
LBB0_6:
	cmpl	$0, (%r13)
	je	LBB0_7
## %bb.8:
	movq	_HDMI_ADMA_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_HDMI_ADMA_MODE_DDMA@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	callq	_HDMI_WRITE
	movq	_HDMI_AUD_FMT@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	_HDMI_AUDIO_CHANNELS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_AUD_FMT_CH
	movq	%r13, %rdi
	movl	%r15d, %esi
	movl	%eax, %edx
	callq	_HDMI_WRITE
	movq	_HDMI_PCM_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_HDMI_AUDIO_CHANNELMAP@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	callq	_HDMI_WRITE
	movq	_HDMI_AUD_CTS@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	movq	_HDMI_AUDIO_N@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	callq	_HDMI_AUDIO_CTS
	movq	%r13, %rdi
	movl	%r15d, %esi
	movl	%eax, %edx
	callq	_HDMI_WRITE
	movq	_HDMI_AUD_N@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%rbx), %edx
	movq	%r13, %rdi
	callq	_HDMI_WRITE
	movq	_HDMI_AUD_CH_STATUS0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_CH_STATUS0_FS_FREQ_48@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	callq	_HDMI_WRITE
	movq	_HDMI_AUD_CH_STATUS1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_CH_STATUS1_WORD_LEN_16@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	callq	_HDMI_WRITE
	movl	(%r12), %esi
	movq	_AUD_CTRL_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_HDMI_WRITE                     ## TAILCALL
LBB0_4:
	leaq	L_.str(%rip), %rsi
	movl	%r15d, %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_device_printf                  ## TAILCALL
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HDMI_AUD_CTRL,4,2              ## @HDMI_AUD_CTRL
	.comm	_AUD_CTRL_RST,4,2               ## @AUD_CTRL_RST
	.comm	_HDMI_AUDIO_RESET_RETRY,4,2     ## @HDMI_AUDIO_RESET_RETRY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"timeout waiting for audio module\n"

	.comm	_HDMI_ADMA_CTRL,4,2             ## @HDMI_ADMA_CTRL
	.comm	_HDMI_ADMA_MODE_DDMA,4,2        ## @HDMI_ADMA_MODE_DDMA
	.comm	_HDMI_AUD_FMT,4,2               ## @HDMI_AUD_FMT
	.comm	_HDMI_AUDIO_CHANNELS,4,2        ## @HDMI_AUDIO_CHANNELS
	.comm	_HDMI_PCM_CTRL,4,2              ## @HDMI_PCM_CTRL
	.comm	_HDMI_AUDIO_CHANNELMAP,4,2      ## @HDMI_AUDIO_CHANNELMAP
	.comm	_HDMI_AUD_CTS,4,2               ## @HDMI_AUD_CTS
	.comm	_HDMI_AUDIO_N,4,2               ## @HDMI_AUDIO_N
	.comm	_HDMI_AUD_N,4,2                 ## @HDMI_AUD_N
	.comm	_HDMI_AUD_CH_STATUS0,4,2        ## @HDMI_AUD_CH_STATUS0
	.comm	_CH_STATUS0_FS_FREQ_48,4,2      ## @CH_STATUS0_FS_FREQ_48
	.comm	_HDMI_AUD_CH_STATUS1,4,2        ## @HDMI_AUD_CH_STATUS1
	.comm	_CH_STATUS1_WORD_LEN_16,4,2     ## @CH_STATUS1_WORD_LEN_16
	.comm	_AUD_CTRL_EN,4,2                ## @AUD_CTRL_EN
	.no_dead_strip	_a10hdmi_set_audiomode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function a10hdmi_set_audiomode
_a10hdmi_set_audiomode:                 ; @a10hdmi_set_audiomode
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x1
	mov	x21, x0
	bl	_device_get_softc
	mov	x19, x0
Lloh0:
	adrp	x22, _HDMI_AUD_CTRL@GOTPAGE
Lloh1:
	ldr	x22, [x22, _HDMI_AUD_CTRL@GOTPAGEOFF]
	ldr	w1, [x22]
Lloh2:
	adrp	x23, _AUD_CTRL_RST@GOTPAGE
Lloh3:
	ldr	x23, [x23, _AUD_CTRL_RST@GOTPAGEOFF]
	ldr	w2, [x23]
	bl	_HDMI_WRITE
Lloh4:
	adrp	x8, _HDMI_AUDIO_RESET_RETRY@GOTPAGE
Lloh5:
	ldr	x8, [x8, _HDMI_AUDIO_RESET_RETRY@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_4
; %bb.1:
	add	w24, w8, #1
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x22]
	mov	x0, x19
	bl	_HDMI_READ
	ldr	w8, [x23]
	tst	w8, w0
	b.eq	LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	sub	w24, w24, #1
	cmp	w24, #1
	b.gt	LBB0_2
	b	L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OTPAGEOFF]
	ldr	w1, [x20]
	bl	_HDMI_AUDIO_CTS
	mov	x2, x0
	mov	x0, x19
	mov	x1, x21
	bl	_HDMI_WRITE
Lloh30:
	adrp	x8, _HDMI_AUD_N@GOTPAGE
Lloh31:
	ldr	x8, [x8, _HDMI_AUD_N@GOTPAGEOFF]
Lloh32:
	ldr	w1, [x8]
	ldr	w2, [x20]
	mov	x0, x19
	bl	_HDMI_WRITE
Lloh33:
	adrp	x8, _HDMI_AUD_CH_STATUS0@GOTPAGE
Lloh34:
	ldr	x8, [x8, _HDMI_AUD_CH_STATUS0@GOTPAGEOFF]
Lloh35:
	ldr	w1, [x8]
Lloh36:
	adrp	x8, _CH_STATUS0_FS_FREQ_48@GOTPAGE
Lloh37:
	ldr	x8, [x8, _CH_STATUS0_FS_FREQ_48@GOTPAGEOFF]
Lloh38:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_HDMI_WRITE
Lloh39:
	adrp	x8, _HDMI_AUD_CH_STATUS1@GOTPAGE
Lloh40:
	ldr	x8, [x8, _HDMI_AUD_CH_STATUS1@GOTPAGEOFF]
Lloh41:
	ldr	w1, [x8]
Lloh42:
	adrp	x8, _CH_STATUS1_WORD_LEN_16@GOTPAGE
Lloh43:
	ldr	x8, [x8, _CH_STATUS1_WORD_LEN_16@GOTPAGEOFF]
Lloh44:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_HDMI_WRITE
	ldr	w1, [x22]
Lloh45:
	adrp	x8, _AUD_CTRL_EN@GOTPAGE
Lloh46:
	ldr	x8, [x8, _AUD_CTRL_EN@GOTPAGEOFF]
Lloh47:
	ldr	w2, [x8]
	mov	x0, x19
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_HDMI_WRITE
LBB0_7:
Lloh48:
	adrp	x1, l_.str@PAGE
Lloh49:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_device_printf
LBB0_8:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh48, Lloh49
	.cfi_endproc
                                        ; -- End function
	.comm	_HDMI_AUD_CTRL,4,2              ; @HDMI_AUD_CTRL
	.comm	_AUD_CTRL_RST,4,2               ; @AUD_CTRL_RST
	.comm	_HDMI_AUDIO_RESET_RETRY,4,2     ; @HDMI_AUDIO_RESET_RETRY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"timeout waiting for audio module\n"

	.comm	_HDMI_ADMA_CTRL,4,2             ; @HDMI_ADMA_CTRL
	.comm	_HDMI_ADMA_MODE_DDMA,4,2        ; @HDMI_ADMA_MODE_DDMA
	.comm	_HDMI_AUD_FMT,4,2               ; @HDMI_AUD_FMT
	.comm	_HDMI_AUDIO_CHANNELS,4,2        ; @HDMI_AUDIO_CHANNELS
	.comm	_HDMI_PCM_CTRL,4,2              ; @HDMI_PCM_CTRL
	.comm	_HDMI_AUDIO_CHANNELMAP,4,2      ; @HDMI_AUDIO_CHANNELMAP
	.comm	_HDMI_AUD_CTS,4,2               ; @HDMI_AUD_CTS
	.comm	_HDMI_AUDIO_N,4,2               ; @HDMI_AUDIO_N
	.comm	_HDMI_AUD_N,4,2                 ; @HDMI_AUD_N
	.comm	_HDMI_AUD_CH_STATUS0,4,2        ; @HDMI_AUD_CH_STATUS0
	.comm	_CH_STATUS0_FS_FREQ_48,4,2      ; @CH_STATUS0_FS_FREQ_48
	.comm	_HDMI_AUD_CH_STATUS1,4,2        ; @HDMI_AUD_CH_STATUS1
	.comm	_CH_STATUS1_WORD_LEN_16,4,2     ; @CH_STATUS1_WORD_LEN_16
	.comm	_AUD_CTRL_EN,4,2                ; @AUD_CTRL_EN
	.no_dead_strip	_a10hdmi_set_audiomode
.subsections_via_symbols
