	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_snd_hda_ctl_add                ## -- Begin function snd_hda_ctl_add
	.p2align	4, 0x90
_snd_hda_ctl_add:                       ## @snd_hda_ctl_add
	.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
	movq	%rdx, %r12
	movq	%rdi, %r14
	movl	(%rdx), %eax
	movq	_HDA_SUBDEV_AMP_FLAG@GOTPCREL(%rip), %rbx
	movl	(%rbx), %ecx
	testl	%eax, %ecx
	je	LBB0_1
## %bb.2:
	movq	_HDA_NID_ITEM_AMP@GOTPCREL(%rip), %rdx
	movzwl	(%rdx), %r15d
	testl	%esi, %esi
	jne	LBB0_4
## %bb.3:
	movl	4(%r12), %edi
	callq	_get_amp_nid_
	movl	%eax, %esi
	movl	(%r12), %eax
	movl	(%rbx), %ecx
	jmp	LBB0_4
LBB0_1:
	xorl	%r15d, %r15d
LBB0_4:
	movq	_HDA_SUBDEV_NID_FLAG@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	testl	%esi, %esi
	movzwl	%ax, %ebx
	cmovnel	%esi, %ebx
	testl	%eax, %edx
	cmovel	%esi, %ebx
	orl	%edx, %ecx
	testl	%eax, %ecx
	je	LBB0_6
## %bb.5:
	movl	$0, (%r12)
LBB0_6:
	movq	8(%r14), %rax
	movl	(%rax), %edi
	movq	%r12, %rsi
	callq	_snd_ctl_add
	testl	%eax, %eax
	js	LBB0_10
## %bb.7:
	movq	%r14, %rdi
	callq	_snd_array_new
	testq	%rax, %rax
	je	LBB0_8
## %bb.9:
	movq	%r12, 8(%rax)
	movl	%ebx, (%rax)
	movw	%r15w, 4(%rax)
	xorl	%eax, %eax
	jmp	LBB0_10
LBB0_8:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_10:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HDA_SUBDEV_AMP_FLAG,4,2        ## @HDA_SUBDEV_AMP_FLAG
	.comm	_HDA_NID_ITEM_AMP,2,1           ## @HDA_NID_ITEM_AMP
	.comm	_HDA_SUBDEV_NID_FLAG,4,2        ## @HDA_SUBDEV_NID_FLAG
	.comm	_ENOMEM,4,2                     ## @ENOMEM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_snd_hda_ctl_add                ; -- Begin function snd_hda_ctl_add
	.p2align	2
_snd_hda_ctl_add:                       ; @snd_hda_ctl_add
	.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	x19, x2
	mov	x20, x0
	ldr	w8, [x2]
Lloh0:
	adrp	x22, _HDA_SUBDEV_AMP_FLAG@GOTPAGE
Lloh1:
	ldr	x22, [x22, _HDA_SUBDEV_AMP_FLAG@GOTPAGEOFF]
	ldr	w9, [x22]
	tst	w9, w8
	b.eq	LBB0_3
; %bb.1:
Lloh2:
	adrp	x10, _HDA_NID_ITEM_AMP@GOTPAGE
Lloh3:
	ldr	x10, [x10, _HDA_NID_ITEM_AMP@GOTPAGEOFF]
	ldrh	w21, [x10]
	cbnz	w1, LBB0_4
; %bb.2:
	ldr	w0, [x19, #4]
	bl	_get_amp_nid_
	mov	x1, x0
	ldr	w8, [x19]
	ldr	w9, [x22]
	b	LBB0_4
LBB0_3:
	mov	w21, #0
LBB0_4:
Lloh4:
	adrp	x10, _HDA_SUBDEV_NID_FLAG@GOTPAGE
Lloh5:
	ldr	x10, [x10, _HDA_SUBDEV_NID_FLAG@GOTPAGEOFF]
Lloh6:
	ldr	w10, [x10]
	and	w11, w10, w8
	cmp	w1, #0
	ccmp	w11, #0, #4, eq
	and	w11, w8, #0xffff
	csel	w22, w11, w1, ne
	orr	w9, w9, w10
	tst	w9, w8
	b.eq	LBB0_6
; %bb.5:
	str	wzr, [x19]
LBB0_6:
	ldr	x8, [x20, #8]
	ldr	w0, [x8]
	mov	x1, x19
	bl	_snd_ctl_add
	tbnz	w0, #31, LBB0_10
; %bb.7:
	mov	x0, x20
	bl	_snd_array_new
	cbz	x0, LBB0_9
; %bb.8:
	mov	x8, x0
	mov	w0, #0
	str	x19, [x8, #8]
	str	w22, [x8]
	strh	w21, [x8, #4]
	b	LBB0_10
LBB0_9:
Lloh7:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_10:
	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
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_HDA_SUBDEV_AMP_FLAG,4,2        ; @HDA_SUBDEV_AMP_FLAG
	.comm	_HDA_NID_ITEM_AMP,2,1           ; @HDA_NID_ITEM_AMP
	.comm	_HDA_SUBDEV_NID_FLAG,4,2        ; @HDA_SUBDEV_NID_FLAG
	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
