	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tw686x_audio_init              ## -- Begin function tw686x_audio_init
	.p2align	4, 0x90
_tw686x_audio_init:                     ## @tw686x_audio_init
	.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	%rdi, %r14
	movq	16(%rdi), %r15
	movq	_AUDIO_CONTROL1@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	xorl	%edi, %edi
	callq	_BIT
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_reg_write
	movq	_SNDRV_DEFAULT_IDX1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_SNDRV_DEFAULT_STR1@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_THIS_MODULE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-48(%rbp), %r9
	movq	%r15, %rdi
	xorl	%r8d, %r8d
	callq	_snd_card_new
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movq	-48(%rbp), %rax
	movq	%rax, (%r14)
	movl	8(%rax), %edi
	leaq	L_.str(%rip), %rbx
	movq	%rbx, %rsi
	movl	$4, %edx
	callq	_strscpy
	movq	-48(%rbp), %rax
	movl	4(%rax), %edi
	movq	%rbx, %rsi
	movl	$4, %edx
	callq	_strscpy
	movq	-48(%rbp), %rax
	movl	(%rax), %ebx
	movq	%r15, %rdi
	callq	_pci_name
	movl	%ebx, %edi
	movq	%rax, %rsi
	movl	$4, %edx
	callq	_strscpy
	movq	-48(%rbp), %rdi
	movq	%r15, %rsi
	callq	_snd_card_set_dev
	movq	%r14, %rdi
	callq	_max_channels
	testl	%eax, %eax
	jle	LBB0_13
## %bb.3:
	xorl	%ebx, %ebx
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r14), %r12
	leaq	(%r12,%rbx), %r15
	leaq	(%r12,%rbx), %rdi
	addq	$16, %rdi
	callq	_spin_lock_init
	movq	%r14, 8(%r12,%rbx)
	movl	%r13d, (%r12,%rbx)
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_tw686x_audio_dma_alloc
	testl	%eax, %eax
	js	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_5 Depth=1
	incq	%r13
	movq	%r14, %rdi
	callq	_max_channels
	cltq
	addq	$24, %rbx
	cmpq	%rax, %r13
	jl	LBB0_5
LBB0_13:
	movq	%r14, %rdi
	callq	_tw686x_snd_pcm_init
	testl	%eax, %eax
	js	LBB0_6
## %bb.14:
	movq	-48(%rbp), %rdi
	callq	_snd_card_register
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_7
## %bb.15:
	xorl	%r12d, %r12d
	jmp	LBB0_16
LBB0_1:
	movl	%eax, %r12d
	jmp	LBB0_16
LBB0_6:
	movl	%eax, %r12d
LBB0_7:
	movq	%r14, %rdi
	callq	_max_channels
	testl	%eax, %eax
	jle	LBB0_12
## %bb.8:
	xorl	%ebx, %ebx
	xorl	%r15d, %r15d
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_9 Depth=1
	incq	%r15
	movq	%r14, %rdi
	callq	_max_channels
	cltq
	addq	$24, %rbx
	cmpq	%rax, %r15
	jge	LBB0_12
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r14), %rsi
	cmpq	$0, 8(%rsi,%rbx)
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	addq	%rbx, %rsi
	movq	%r14, %rdi
	callq	_tw686x_audio_dma_free
	jmp	LBB0_11
LBB0_12:
	movq	-48(%rbp), %rdi
	callq	_snd_card_free
	movq	$0, (%r14)
LBB0_16:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AUDIO_CONTROL1,4,2             ## @AUDIO_CONTROL1
	.comm	_SNDRV_DEFAULT_IDX1,4,2         ## @SNDRV_DEFAULT_IDX1
	.comm	_SNDRV_DEFAULT_STR1,4,2         ## @SNDRV_DEFAULT_STR1
	.comm	_THIS_MODULE,4,2                ## @THIS_MODULE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"tw686x"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tw686x_audio_init              ; -- Begin function tw686x_audio_init
	.p2align	2
_tw686x_audio_init:                     ; @tw686x_audio_init
	.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	x19, x0
	ldr	x21, [x0, #16]
Lloh0:
	adrp	x8, _AUDIO_CONTROL1@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AUDIO_CONTROL1@GOTPAGEOFF]
Lloh2:
	ldr	w20, [x8]
	mov	w0, #0
	bl	_BIT
	mov	x2, x0
	mov	x0, x19
	mov	x1, x20
	bl	_reg_write
Lloh3:
	adrp	x8, _SNDRV_DEFAULT_IDX1@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SNDRV_DEFAULT_IDX1@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
Lloh6:
	adrp	x8, _SNDRV_DEFAULT_STR1@GOTPAGE
Lloh7:
	ldr	x8, [x8, _SNDRV_DEFAULT_STR1@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
Lloh9:
	adrp	x8, _THIS_MODULE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _THIS_MODULE@GOTPAGEOFF]
Lloh11:
	ldr	w3, [x8]
	add	x5, sp, #8
	mov	x0, x21
	mov	w4, #0
	bl	_snd_card_new
	tbnz	w0, #31, LBB0_7
; %bb.1:
	ldr	x8, [sp, #8]
	str	x8, [x19]
	ldr	w0, [x8, #8]
Lloh12:
	adrp	x20, l_.str@PAGE
Lloh13:
	add	x20, x20, l_.str@PAGEOFF
	mov	x1, x20
	mov	w2, #4
	bl	_strscpy
	ldr	x8, [sp, #8]
	ldr	w0, [x8, #4]
	mov	x1, x20
	mov	w2, #4
	bl	_strscpy
	ldr	x8, [sp, #8]
	ldr	w20, [x8]
	mov	x0, x21
	bl	_pci_name
	mov	x1, x0
	mov	x0, x20
	mov	w2, #4
	bl	_strscpy
	ldr	x0, [sp, #8]
	mov	x1, x21
	bl	_snd_card_set_dev
	mov	x0, x19
	bl	_max_channels
	cmp	w0, #1
	b.lt	LBB0_5
; %bb.2:
	mov	x21, #0
	mov	x22, #0
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	add	x20, x8, x21
	add	x0, x20, #16
	bl	_spin_lock_init
	str	x19, [x20, #8]
	str	w22, [x20]
	mov	x0, x19
	mov	x1, x20
	bl	_tw686x_audio_dma_alloc
	tbnz	w0, #31, LBB0_8
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x22, x22, #1
	mov	x0, x19
	bl	_max_channels
	add	x21, x21, #24
	cmp	x22, w0, sxtw
	b.lt	LBB0_3
LBB0_5:
	mov	x0, x19
	bl	_tw686x_snd_pcm_init
	tbnz	w0, #31, LBB0_8
; %bb.6:
	ldr	x0, [sp, #8]
	bl	_snd_card_register
	mov	x20, x0
	cbnz	w0, LBB0_9
	b	LBB0_15
LBB0_7:
	mov	x20, x0
	b	LBB0_15
LBB0_8:
	mov	x20, x0
LBB0_9:
	mov	x0, x19
	bl	_max_channels
	cmp	w0, #1
	b.lt	LBB0_14
; %bb.10:
	mov	x21, #0
	mov	x22, #0
	b	LBB0_12
LBB0_11:                                ;   in Loop: Header=BB0_12 Depth=1
	add	x22, x22, #1
	mov	x0, x19
	bl	_max_channels
	add	x21, x21, #24
	cmp	x22, w0, sxtw
	b.ge	LBB0_14
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	add	x1, x8, x21
	ldr	x8, [x1, #8]
	cbz	x8, LBB0_11
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	mov	x0, x19
	bl	_tw686x_audio_dma_free
	b	LBB0_11
LBB0_14:
	ldr	x0, [sp, #8]
	bl	_snd_card_free
	str	xzr, [x19]
LBB0_15:
	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 AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_AUDIO_CONTROL1,4,2             ; @AUDIO_CONTROL1
	.comm	_SNDRV_DEFAULT_IDX1,4,2         ; @SNDRV_DEFAULT_IDX1
	.comm	_SNDRV_DEFAULT_STR1,4,2         ; @SNDRV_DEFAULT_STR1
	.comm	_THIS_MODULE,4,2                ; @THIS_MODULE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"tw686x"

.subsections_via_symbols
