	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function attach_gpio_amp
_attach_gpio_amp:                       ## @attach_gpio_amp
	.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	%rsi, %r14
	movq	%rdi, %r15
	movq	_pdata@GOTPCREL(%rip), %r12
	movq	(%r12), %rax
	movq	(%rax), %rcx
	cmpq	$0, (%rcx)
	jle	LBB0_6
## %bb.1:
	movq	(%r14), %rax
	movq	(%rax), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_gpio_request
	testl	%eax, %eax
	je	LBB0_3
## %bb.2:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_12
LBB0_3:
	movq	(%r14), %rax
	movq	8(%rax), %rdi
	leaq	L_.str.2(%rip), %rsi
	callq	_gpio_request
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movl	%eax, %ebx
	leaq	L_.str.3(%rip), %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	movq	(%r12), %rax
	movq	(%rax), %rax
	movq	(%rax), %rdi
	jmp	LBB0_11
LBB0_5:
	movq	(%r14), %rax
	movq	(%rax), %rdi
	xorl	%esi, %esi
	callq	_gpio_direction_output
	movq	(%r14), %rax
	movq	8(%rax), %rdi
	xorl	%esi, %esi
	callq	_gpio_direction_output
	movq	(%r12), %rax
LBB0_6:
	cmpq	$0, 8(%rax)
	jle	LBB0_7
## %bb.8:
	movq	8(%r14), %rdi
	leaq	L_.str.4(%rip), %rsi
	callq	_gpio_request
	testl	%eax, %eax
	je	LBB0_13
## %bb.9:
	movl	%eax, %ebx
	movq	8(%r14), %rdx
	leaq	L_.str.5(%rip), %rsi
	movq	%r15, %rdi
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_dev_err
	movq	(%r14), %rax
	movq	(%rax), %rdi
	testq	%rdi, %rdi
	jle	LBB0_12
## %bb.10:
	callq	_gpio_free
	movq	(%r14), %rax
	movq	8(%rax), %rdi
LBB0_11:
	callq	_gpio_free
	jmp	LBB0_12
LBB0_7:
	xorl	%ebx, %ebx
	jmp	LBB0_12
LBB0_13:
	xorl	%ebx, %ebx
	xorl	%edi, %edi
	callq	_spk_unmute_state
LBB0_12:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_pdata,8,3                      ## @pdata
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"gpio-amp-gain0"

L_.str.1:                               ## @.str.1
	.asciz	"cannot get amp gpio gain0\n"

L_.str.2:                               ## @.str.2
	.asciz	"gpio-amp-gain1"

L_.str.3:                               ## @.str.3
	.asciz	"cannot get amp gpio gain1\n"

L_.str.4:                               ## @.str.4
	.asciz	"gpio-amp"

L_.str.5:                               ## @.str.5
	.asciz	"cannot get amp gpio %d (%d)\n"

	.no_dead_strip	_attach_gpio_amp
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function attach_gpio_amp
_attach_gpio_amp:                       ; @attach_gpio_amp
	.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, x1
	mov	x20, x0
Lloh0:
	adrp	x22, _pdata@GOTPAGE
Lloh1:
	ldr	x22, [x22, _pdata@GOTPAGEOFF]
	ldr	x8, [x22]
	ldr	x9, [x8]
	ldr	x9, [x9]
	cmp	x9, #1
	b.lt	LBB0_6
; %bb.1:
	ldr	x8, [x19]
	ldr	x0, [x8]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	bl	_gpio_request
	cbz	w0, LBB0_3
; %bb.2:
	mov	x21, x0
Lloh4:
	adrp	x1, l_.str.1@PAGE
Lloh5:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_dev_err
	b	LBB0_13
LBB0_3:
	ldr	x8, [x19]
	ldr	x0, [x8, #8]
Lloh6:
	adrp	x1, l_.str.2@PAGE
Lloh7:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_gpio_request
	cbz	w0, LBB0_5
; %bb.4:
	mov	x21, x0
Lloh8:
	adrp	x1, l_.str.3@PAGE
Lloh9:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x20
	bl	_dev_err
	ldr	x8, [x22]
	ldr	x8, [x8]
	ldr	x0, [x8]
	b	LBB0_10
LBB0_5:
	ldr	x8, [x19]
	ldr	x0, [x8]
	mov	w1, #0
	bl	_gpio_direction_output
	ldr	x8, [x19]
	ldr	x0, [x8, #8]
	mov	w1, #0
	bl	_gpio_direction_output
	ldr	x8, [x22]
LBB0_6:
	ldr	x8, [x8, #8]
	cmp	x8, #1
	b.lt	LBB0_11
; %bb.7:
	ldr	x0, [x19, #8]
Lloh10:
	adrp	x1, l_.str.4@PAGE
Lloh11:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_gpio_request
	mov	x21, x0
	cbz	w0, LBB0_12
; %bb.8:
	ldr	x8, [x19, #8]
	stp	x8, x21, [sp]
Lloh12:
	adrp	x1, l_.str.5@PAGE
Lloh13:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x20
	bl	_dev_err
	ldr	x8, [x19]
	ldr	x0, [x8]
	cmp	x0, #0
	b.le	LBB0_13
; %bb.9:
	bl	_gpio_free
	ldr	x8, [x19]
	ldr	x0, [x8, #8]
LBB0_10:
	bl	_gpio_free
	b	LBB0_13
LBB0_11:
	mov	w21, #0
	b	LBB0_13
LBB0_12:
	bl	_spk_unmute_state
LBB0_13:
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_pdata,8,3                      ; @pdata
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"gpio-amp-gain0"

l_.str.1:                               ; @.str.1
	.asciz	"cannot get amp gpio gain0\n"

l_.str.2:                               ; @.str.2
	.asciz	"gpio-amp-gain1"

l_.str.3:                               ; @.str.3
	.asciz	"cannot get amp gpio gain1\n"

l_.str.4:                               ; @.str.4
	.asciz	"gpio-amp"

l_.str.5:                               ; @.str.5
	.asciz	"cannot get amp gpio %d (%d)\n"

	.no_dead_strip	_attach_gpio_amp
.subsections_via_symbols
