	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dc_set_generic_gpio_for_stereo ## -- Begin function dc_set_generic_gpio_for_stereo
	.p2align	4, 0x90
_dc_set_generic_gpio_for_stereo:        ## @dc_set_generic_gpio_for_stereo
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r12
	movl	%edi, %r14d
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$8, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_10
## %bb.1:
	movq	%rax, %r15
	movq	_GPIO_ID_GENERIC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_dal_gpio_get_generic_pin_info
	cmpl	$-1, %eax
	je	LBB0_7
## %bb.2:
	movq	%rax, %rsi
	shrq	$32, %rsi
	cmpl	$-1, %esi
	je	LBB0_7
## %bb.3:
	movq	%r12, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	movl	%eax, %edx
	callq	_dal_gpio_service_create_generic_mux
	movq	%rax, -40(%rbp)
	testq	%rax, %rax
	je	LBB0_9
## %bb.4:
	movq	%rax, %r12
	movq	_GPIO_MODE_OUTPUT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_dal_gpio_open
	movl	%r14d, (%r15)
	movq	_GPIO_SIGNAL_SOURCE_PASS_THROUGH_STEREO_SYNC@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 4(%r15)
	movq	_GPIO_RESULT_OK@GOTPCREL(%rip), %rbx
	movl	(%rbx), %ecx
	cmpl	%ecx, %eax
	jne	LBB0_6
## %bb.5:
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_dal_mux_setup_config
	movl	(%rbx), %ecx
LBB0_6:
	xorl	%ebx, %ebx
	cmpl	%ecx, %eax
	sete	%bl
	movq	%r12, %rdi
	callq	_dal_gpio_close
	leaq	-40(%rbp), %rdi
	callq	_dal_gpio_destroy_generic_mux
LBB0_7:
	movq	%r15, %rdi
	callq	_kfree
	jmp	LBB0_11
LBB0_9:
	movq	%r15, %rdi
	callq	_kfree
LBB0_10:
	xorl	%ebx, %ebx
LBB0_11:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GPIO_RESULT_NON_SPECIFIC_ERROR,4,2 ## @GPIO_RESULT_NON_SPECIFIC_ERROR
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_GPIO_ID_GENERIC,4,2            ## @GPIO_ID_GENERIC
	.comm	_GPIO_MODE_OUTPUT,4,2           ## @GPIO_MODE_OUTPUT
	.comm	_GPIO_SIGNAL_SOURCE_PASS_THROUGH_STEREO_SYNC,4,2 ## @GPIO_SIGNAL_SOURCE_PASS_THROUGH_STEREO_SYNC
	.comm	_GPIO_RESULT_OK,4,2             ## @GPIO_RESULT_OK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dc_set_generic_gpio_for_stereo ; -- Begin function dc_set_generic_gpio_for_stereo
	.p2align	2
_dc_set_generic_gpio_for_stereo:        ; @dc_set_generic_gpio_for_stereo
	.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	x21, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #8
	bl	_kzalloc
	cbz	x0, LBB0_7
; %bb.1:
	mov	x19, x0
Lloh3:
	adrp	x8, _GPIO_ID_GENERIC@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GPIO_ID_GENERIC@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x21
	mov	w2, #0
	bl	_dal_gpio_get_generic_pin_info
	mov	x2, x0
	lsr	x1, x0, #32
	cmn	w2, #1
	ccmn	w1, #1, #4, ne
	b.eq	LBB0_6
; %bb.2:
	mov	x0, x21
                                        ; kill: def $w1 killed $w1 killed $x1
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_dal_gpio_service_create_generic_mux
	str	x0, [sp, #8]
	cbz	x0, LBB0_6
; %bb.3:
	mov	x21, x0
Lloh6:
	adrp	x8, _GPIO_MODE_OUTPUT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _GPIO_MODE_OUTPUT@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	bl	_dal_gpio_open
	str	w20, [x19]
Lloh9:
	adrp	x8, _GPIO_SIGNAL_SOURCE_PASS_THROUGH_STEREO_SYNC@GOTPAGE
Lloh10:
	ldr	x8, [x8, _GPIO_SIGNAL_SOURCE_PASS_THROUGH_STEREO_SYNC@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	str	w8, [x19, #4]
Lloh12:
	adrp	x20, _GPIO_RESULT_OK@GOTPAGE
Lloh13:
	ldr	x20, [x20, _GPIO_RESULT_OK@GOTPAGEOFF]
	ldr	w8, [x20]
	cmp	w0, w8
	b.ne	LBB0_5
; %bb.4:
	mov	x0, x21
	mov	x1, x19
	bl	_dal_mux_setup_config
	ldr	w8, [x20]
LBB0_5:
	cmp	w0, w8
	cset	w20, eq
	mov	x0, x21
	bl	_dal_gpio_close
	add	x0, sp, #8
	bl	_dal_gpio_destroy_generic_mux
	mov	x0, x19
	bl	_kfree
	b	LBB0_8
LBB0_6:
	mov	x0, x19
	bl	_kfree
LBB0_7:
	mov	w20, #0
LBB0_8:
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_GPIO_RESULT_NON_SPECIFIC_ERROR,4,2 ; @GPIO_RESULT_NON_SPECIFIC_ERROR
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_GPIO_ID_GENERIC,4,2            ; @GPIO_ID_GENERIC
	.comm	_GPIO_MODE_OUTPUT,4,2           ; @GPIO_MODE_OUTPUT
	.comm	_GPIO_SIGNAL_SOURCE_PASS_THROUGH_STEREO_SYNC,4,2 ; @GPIO_SIGNAL_SOURCE_PASS_THROUGH_STEREO_SYNC
	.comm	_GPIO_RESULT_OK,4,2             ; @GPIO_RESULT_OK
.subsections_via_symbols
