	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function a10hdmiaudio_attach
_a10hdmiaudio_attach:                   ## @a10hdmiaudio_attach
	.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	%edi, %r15d
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_SND_STATUSLEN@GOTPCREL(%rip), %r14
	movl	(%r14), %eax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r13
	movq	_M_DEVBUF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_M_WAITOK@GOTPCREL(%rip), %rax
	movq	_M_ZERO@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movl	$16, %edi
	callq	_malloc
	movq	%rax, %rbx
	movl	%r15d, 12(%rax)
	movl	%r15d, %edi
	callq	_device_get_nameunit
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edi
	callq	_snd_mtxcreate
	movl	%eax, (%rbx)
	movq	_DMABUF_MIN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_DMABUF_DEFAULT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_DMABUF_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%r15d, %edi
	callq	_pcm_getbuffersize
	movl	%eax, 8(%rbx)
	movl	%r15d, %edi
	callq	_bus_get_dma_tag
	movl	8(%rbx), %edx
	movq	_BUS_SPACE_MAXADDR_32BIT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	_BUS_SPACE_MAXADDR@GOTPCREL(%rip), %rsi
	movl	(%rsi), %r8d
	movq	%rbx, %rsi
	addq	$4, %rsi
	subq	$64, %rsp
	movq	%rsi, 56(%rsp)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 40(%rsp)
	movl	%edx, 24(%rsp)
	movl	%edx, 8(%rsp)
	movl	$0, 32(%rsp)
	movl	$1, 16(%rsp)
	movq	$0, (%rsp)
	movl	%eax, %edi
	movl	$4, %esi
	xorl	%r9d, %r9d
	callq	_bus_dma_tag_create
	addq	$64, %rsp
	movl	%eax, %r12d
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_6
LBB0_2:
	movq	_a10hdmiaudio_mixer_class@GOTPCREL(%rip), %rsi
	movl	%r15d, %edi
	movq	%rbx, %rdx
	callq	_mixer_init
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_6
LBB0_4:
	movl	%r15d, %edi
	callq	_pcm_getflags
	movq	_SD_F_MPSAFE@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%r15d, %edi
	movl	%eax, %esi
	callq	_pcm_setflags
	movl	%r15d, %edi
	callq	_pcm_getflags
	movq	_SD_F_SOFTPCMVOL@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%r15d, %edi
	movl	%eax, %esi
	callq	_pcm_setflags
	movl	%r15d, %edi
	movq	%rbx, %rsi
	movl	$1, %edx
	xorl	%ecx, %ecx
	callq	_pcm_register
	testq	%rax, %rax
	je	LBB0_9
## %bb.5:
	leaq	L_.str.3(%rip), %rsi
LBB0_6:
	movl	%r15d, %edi
	callq	_device_printf
	movl	(%rbx), %edi
	callq	_snd_mtxfree
	movq	_M_DEVBUF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_free
LBB0_7:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_10
## %bb.8:
	movl	%r12d, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	_PCMDIR_PLAY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_a10hdmiaudio_chan_class@GOTPCREL(%rip), %rdx
	movl	%r15d, %edi
	movq	%rbx, %rcx
	callq	_pcm_addchan
	movl	(%r14), %r14d
	movl	%r15d, %edi
	callq	_ofw_bus_get_name
	leaq	L_.str.4(%rip), %rdx
	movq	%r13, %rdi
	movl	%r14d, %esi
	movq	%rax, %rcx
	callq	_snprintf
	movl	%r15d, %edi
	movq	%r13, %rsi
	callq	_pcm_setstatus
	jmp	LBB0_7
LBB0_10:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_SND_STATUSLEN,4,2              ## @SND_STATUSLEN
	.comm	_M_DEVBUF,4,2                   ## @M_DEVBUF
	.comm	_M_WAITOK,4,2                   ## @M_WAITOK
	.comm	_M_ZERO,4,2                     ## @M_ZERO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"a10hdmiaudio softc"

	.comm	_DMABUF_MIN,4,2                 ## @DMABUF_MIN
	.comm	_DMABUF_DEFAULT,4,2             ## @DMABUF_DEFAULT
	.comm	_DMABUF_MAX,4,2                 ## @DMABUF_MAX
	.comm	_BUS_SPACE_MAXADDR_32BIT,4,2    ## @BUS_SPACE_MAXADDR_32BIT
	.comm	_BUS_SPACE_MAXADDR,4,2          ## @BUS_SPACE_MAXADDR
L_.str.1:                               ## @.str.1
	.asciz	"cannot create DMA tag\n"

	.comm	_a10hdmiaudio_mixer_class,4,2   ## @a10hdmiaudio_mixer_class
L_.str.2:                               ## @.str.2
	.asciz	"mixer_init failed\n"

	.comm	_SD_F_MPSAFE,4,2                ## @SD_F_MPSAFE
	.comm	_SD_F_SOFTPCMVOL,4,2            ## @SD_F_SOFTPCMVOL
L_.str.3:                               ## @.str.3
	.asciz	"pcm_register failed\n"

	.comm	_PCMDIR_PLAY,4,2                ## @PCMDIR_PLAY
	.comm	_a10hdmiaudio_chan_class,4,2    ## @a10hdmiaudio_chan_class
L_.str.4:                               ## @.str.4
	.asciz	"at %s"

	.no_dead_strip	_a10hdmiaudio_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function a10hdmiaudio_attach
_a10hdmiaudio_attach:                   ; @a10hdmiaudio_attach
	.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
	sub	sp, sp, #16
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
Lloh3:
	adrp	x24, _SND_STATUSLEN@GOTPAGE
Lloh4:
	ldr	x24, [x24, _SND_STATUSLEN@GOTPAGEOFF]
	ldr	w8, [x24]
	mov	x9, x8
Lloh5:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh6:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x1fffffff0
	sub	x20, x9, x8
	mov	sp, x20
Lloh7:
	adrp	x23, _M_DEVBUF@GOTPAGE
Lloh8:
	ldr	x23, [x23, _M_DEVBUF@GOTPAGEOFF]
Lloh9:
	adrp	x8, _M_WAITOK@GOTPAGE
Lloh10:
	ldr	x8, [x8, _M_WAITOK@GOTPAGEOFF]
	ldr	w1, [x23]
Lloh11:
	ldr	w8, [x8]
Lloh12:
	adrp	x9, _M_ZERO@GOTPAGE
Lloh13:
	ldr	x9, [x9, _M_ZERO@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	w0, #16
	bl	_malloc
	mov	x21, x0
	str	w19, [x0, #12]
	mov	x0, x19
	bl	_device_get_nameunit
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	bl	_snd_mtxcreate
	str	w0, [x21]
Lloh17:
	adrp	x8, _DMABUF_MIN@GOTPAGE
Lloh18:
	ldr	x8, [x8, _DMABUF_MIN@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
Lloh20:
	adrp	x8, _DMABUF_DEFAULT@GOTPAGE
Lloh21:
	ldr	x8, [x8, _DMABUF_DEFAULT@GOTPAGEOFF]
Lloh22:
	ldr	w2, [x8]
Lloh23:
	adrp	x8, _DMABUF_MAX@GOTPAGE
Lloh24:
	ldr	x8, [x8, _DMABUF_MAX@GOTPAGEOFF]
Lloh25:
	ldr	w3, [x8]
	mov	x0, x19
	bl	_pcm_getbuffersize
	str	w0, [x21, #8]
	mov	x0, x19
	bl	_bus_get_dma_tag
Lloh26:
	adrp	x8, _BUS_SPACE_MAXADDR_32BIT@GOTPAGE
Lloh27:
	ldr	x8, [x8, _BUS_SPACE_MAXADDR_32BIT@GOTPAGEOFF]
	ldr	w2, [x21, #8]
Lloh28:
	ldr	w3, [x8]
Lloh29:
	adrp	x8, _BUS_SPACE_MAXADDR@GOTPAGE
Lloh30:
	ldr	x8, [x8, _BUS_SPACE_MAXADDR@GOTPAGEOFF]
Lloh31:
	ldr	w4, [x8]
	add	x8, x21, #4
	sub	sp, sp, #48
	stp	xzr, xzr, [sp, #16]
	str	x8, [sp, #32]
	stp	w2, wzr, [sp, #4]
	mov	w8, #1
	str	w8, [sp]
	mov	w1, #4
	mov	x5, #0
	mov	x6, #0
	mov	x7, x2
	bl	_bus_dma_tag_create
	add	sp, sp, #48
	mov	x22, x0
	cbz	w0, LBB0_2
; %bb.1:
Lloh32:
	adrp	x1, l_.str.1@PAGE
Lloh33:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_6
LBB0_2:
Lloh34:
	adrp	x1, _a10hdmiaudio_mixer_class@GOTPAGE
Lloh35:
	ldr	x1, [x1, _a10hdmiaudio_mixer_class@GOTPAGEOFF]
	mov	x0, x19
	mov	x2, x21
	bl	_mixer_init
	cbz	x0, LBB0_4
; %bb.3:
Lloh36:
	adrp	x1, l_.str.2@PAGE
Lloh37:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_6
LBB0_4:
	mov	x0, x19
	bl	_pcm_getflags
Lloh38:
	adrp	x8, _SD_F_MPSAFE@GOTPAGE
Lloh39:
	ldr	x8, [x8, _SD_F_MPSAFE@GOTPAGEOFF]
Lloh40:
	ldr	w8, [x8]
	orr	w1, w8, w0
	mov	x0, x19
	bl	_pcm_setflags
	mov	x0, x19
	bl	_pcm_getflags
Lloh41:
	adrp	x8, _SD_F_SOFTPCMVOL@GOTPAGE
Lloh42:
	ldr	x8, [x8, _SD_F_SOFTPCMVOL@GOTPAGEOFF]
Lloh43:
	ldr	w8, [x8]
	orr	w1, w8, w0
	mov	x0, x19
	bl	_pcm_setflags
	mov	x0, x19
	mov	x1, x21
	mov	w2, #1
	mov	w3, #0
	bl	_pcm_register
	cbz	x0, LBB0_9
; %bb.5:
Lloh44:
	adrp	x1, l_.str.3@PAGE
Lloh45:
	add	x1, x1, l_.str.3@PAGEOFF
LBB0_6:
	mov	x0, x19
	bl	_device_printf
	ldr	w0, [x21]
	bl	_snd_mtxfree
	ldr	w1, [x23]
	mov	x0, x21
	bl	_free
LBB0_7:
	ldur	x8, [x29, #-56]
Lloh46:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh47:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh48:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_10
; %bb.8:
	mov	x0, x22
	sub	sp, x29, #48
	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
LBB0_9:
Lloh49:
	adrp	x8, _PCMDIR_PLAY@GOTPAGE
Lloh50:
	ldr	x8, [x8, _PCMDIR_PLAY@GOTPAGEOFF]
Lloh51:
	ldr	w1, [x8]
Lloh52:
	adrp	x2, _a10hdmiaudio_chan_class@GOTPAGE
Lloh53:
	ldr	x2, [x2, _a10hdmiaudio_chan_class@GOTPAGEOFF]
	mov	x0, x19
	mov	x3, x21
	bl	_pcm_addchan
	ldr	w21, [x24]
	mov	x0, x19
	bl	_ofw_bus_get_name
	mov	x3, x0
Lloh54:
	adrp	x2, l_.str.4@PAGE
Lloh55:
	add	x2, x2, l_.str.4@PAGEOFF
	mov	x0, x20
	mov	x1, x21
	bl	_snprintf
	mov	x0, x19
	mov	x1, x20
	bl	_pcm_setstatus
	b	LBB0_7
LBB0_10:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh34, Lloh35
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpAdd	Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.loh AdrpAdd	Lloh54, Lloh55
	.loh AdrpLdrGot	Lloh52, Lloh53
	.loh AdrpLdrGotLdr	Lloh49, Lloh50, Lloh51
	.cfi_endproc
                                        ; -- End function
	.comm	_SND_STATUSLEN,4,2              ; @SND_STATUSLEN
	.comm	_M_DEVBUF,4,2                   ; @M_DEVBUF
	.comm	_M_WAITOK,4,2                   ; @M_WAITOK
	.comm	_M_ZERO,4,2                     ; @M_ZERO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"a10hdmiaudio softc"

	.comm	_DMABUF_MIN,4,2                 ; @DMABUF_MIN
	.comm	_DMABUF_DEFAULT,4,2             ; @DMABUF_DEFAULT
	.comm	_DMABUF_MAX,4,2                 ; @DMABUF_MAX
	.comm	_BUS_SPACE_MAXADDR_32BIT,4,2    ; @BUS_SPACE_MAXADDR_32BIT
	.comm	_BUS_SPACE_MAXADDR,4,2          ; @BUS_SPACE_MAXADDR
l_.str.1:                               ; @.str.1
	.asciz	"cannot create DMA tag\n"

	.comm	_a10hdmiaudio_mixer_class,4,2   ; @a10hdmiaudio_mixer_class
l_.str.2:                               ; @.str.2
	.asciz	"mixer_init failed\n"

	.comm	_SD_F_MPSAFE,4,2                ; @SD_F_MPSAFE
	.comm	_SD_F_SOFTPCMVOL,4,2            ; @SD_F_SOFTPCMVOL
l_.str.3:                               ; @.str.3
	.asciz	"pcm_register failed\n"

	.comm	_PCMDIR_PLAY,4,2                ; @PCMDIR_PLAY
	.comm	_a10hdmiaudio_chan_class,4,2    ; @a10hdmiaudio_chan_class
l_.str.4:                               ; @.str.4
	.asciz	"at %s"

	.no_dead_strip	_a10hdmiaudio_attach
.subsections_via_symbols
