	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __aat2870_write
___aat2870_write:                       ## @__aat2870_write
	.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	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	movq	_AAT2870_REG_NUM@GOTPCREL(%rip), %rax
	cmpq	%rsi, (%rax)
	jbe	LBB0_1
## %bb.3:
	movq	8(%r15), %rax
	movq	%rbx, %r12
	shlq	$4, %r12
	cmpl	$0, 8(%rax,%r12)
	je	LBB0_4
## %bb.5:
	movq	%rdx, %r14
	movq	%rbx, -64(%rbp)
	movq	%rdx, -56(%rbp)
	movl	16(%r15), %edi
	leaq	-64(%rbp), %rsi
	movl	$2, %edx
	callq	_i2c_master_send
	testl	%eax, %eax
	js	LBB0_10
## %bb.6:
	cmpl	$2, %eax
	jne	LBB0_7
## %bb.9:
	movq	8(%r15), %rax
	movq	%r14, (%rax,%r12)
	movl	(%r15), %edi
	leaq	L_.str.2(%rip), %rsi
	movq	%rbx, %rdx
	movq	%r14, %rcx
	callq	_dev_dbg
	xorl	%eax, %eax
	jmp	LBB0_10
LBB0_1:
	movl	(%r15), %edi
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_2
LBB0_4:
	movl	(%r15), %edi
	leaq	L_.str.1(%rip), %rsi
LBB0_2:
	movq	%rbx, %rdx
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_8:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_10:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-40(%rbp), %rcx
	jne	LBB0_12
## %bb.11:
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	_EIO@GOTPCREL(%rip), %rcx
	jmp	LBB0_8
LBB0_12:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_AAT2870_REG_NUM,8,3            ## @AAT2870_REG_NUM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid address, 0x%02x\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"Address 0x%02x is not writeable\n"

	.comm	_EIO,4,2                        ## @EIO
L_.str.2:                               ## @.str.2
	.asciz	"write: addr=0x%02x, val=0x%02x\n"

	.no_dead_strip	___aat2870_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function __aat2870_write
___aat2870_write:                       ; @__aat2870_write
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x21, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
Lloh3:
	adrp	x8, _AAT2870_REG_NUM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AAT2870_REG_NUM@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cmp	x8, x1
	b.ls	LBB0_5
; %bb.1:
	ldr	x8, [x21, #8]
	add	x8, x8, x19, lsl #4
	ldr	w8, [x8, #8]
	cbz	w8, LBB0_6
; %bb.2:
	mov	x20, x2
	stp	x19, x2, [sp, #8]
	ldr	w0, [x21, #16]
	add	x1, sp, #8
	mov	w2, #2
	bl	_i2c_master_send
	tbnz	w0, #31, LBB0_9
; %bb.3:
	cmp	w0, #2
	b.ne	LBB0_11
; %bb.4:
	ldr	x8, [x21, #8]
	lsl	x9, x19, #4
	str	x20, [x8, x9]
	ldr	w0, [x21]
Lloh6:
	adrp	x1, l_.str.2@PAGE
Lloh7:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x2, x19
	mov	x3, x20
	bl	_dev_dbg
	mov	w0, #0
	b	LBB0_9
LBB0_5:
	ldr	w0, [x21]
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_7
LBB0_6:
	ldr	w0, [x21]
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_7:
	mov	x2, x19
	bl	_dev_err
Lloh12:
	adrp	x8, _EINVAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_9:
	ldr	x8, [sp, #24]
Lloh14:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh15:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_12
; %bb.10:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_11:
Lloh17:
	adrp	x8, _EIO@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_8
LBB0_12:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_AAT2870_REG_NUM,8,3            ; @AAT2870_REG_NUM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid address, 0x%02x\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"Address 0x%02x is not writeable\n"

	.comm	_EIO,4,2                        ; @EIO
l_.str.2:                               ; @.str.2
	.asciz	"write: addr=0x%02x, val=0x%02x\n"

	.no_dead_strip	___aat2870_write
.subsections_via_symbols
