	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function uda1380_write
_uda1380_write:                         ## @uda1380_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
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	movl	%esi, -52(%rbp)
	movzbl	%dh, %eax
	movl	%eax, -48(%rbp)
	movzbl	%dl, %eax
	movl	%eax, -44(%rbp)
	movl	%edx, %r12d
	callq	_uda1380_write_reg_cache
	cmpl	$0, 12(%rbx)
	jne	LBB0_2
## %bb.1:
	xorl	%r15d, %r15d
	movq	_UDA1380_MVOL@GOTPCREL(%rip), %rax
	cmpl	%r14d, (%rax)
	jbe	LBB0_8
LBB0_2:
	leaq	L_.str(%rip), %rdi
	xorl	%r15d, %r15d
	movl	%r14d, %esi
	movl	%r12d, %edx
	xorl	%eax, %eax
	callq	_pr_debug
	movl	8(%rbx), %edi
	leaq	-52(%rbp), %rsi
	movl	$3, %edx
	callq	*(%rbx)
	cmpl	$3, %eax
	jne	LBB0_5
## %bb.3:
	movl	8(%rbx), %edi
	leaq	-52(%rbp), %r15
	movq	%r15, %rsi
	movl	$1, %edx
	callq	_i2c_master_send
	movl	8(%rbx), %edi
	movq	%r15, %rsi
	movl	$2, %edx
	callq	_i2c_master_recv
	movl	-52(%rbp), %esi
	shll	$8, %esi
	orl	-48(%rbp), %esi
	cmpl	%r12d, %esi
	jne	LBB0_4
## %bb.6:
	xorl	%r15d, %r15d
	cmpl	$16, %r14d
	jb	LBB0_8
## %bb.7:
	addl	$-16, %r14d
	movq	_uda1380_cache_dirty@GOTPCREL(%rip), %rsi
	movl	%r14d, %edi
	callq	_clear_bit
	jmp	LBB0_8
LBB0_4:
	leaq	L_.str.1(%rip), %rdi
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_pr_debug
LBB0_5:
	movq	_EIO@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
LBB0_8:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_10
## %bb.9:
	movl	%r15d, %eax
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_UDA1380_MVOL,4,2               ## @UDA1380_MVOL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"uda1380: hw write %x val %x\n"

L_.str.1:                               ## @.str.1
	.asciz	"uda1380: READ BACK VAL %x\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_uda1380_cache_dirty,4,2        ## @uda1380_cache_dirty
	.no_dead_strip	_uda1380_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function uda1380_write
_uda1380_write:                         ; @uda1380_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	x20, x2
	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]
	ubfx	w8, w2, #8, #8
	stp	w1, w8, [sp, #12]
	and	w8, w2, #0xff
	str	w8, [sp, #20]
	bl	_uda1380_write_reg_cache
	ldr	w8, [x21, #12]
Lloh3:
	adrp	x9, _UDA1380_MVOL@GOTPAGE
Lloh4:
	ldr	x9, [x9, _UDA1380_MVOL@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w8, #0
	ccmp	w9, w19, #2, eq
	b.ls	LBB0_5
; %bb.1:
	str	x20, [sp]
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	bl	_pr_debug
	ldr	x8, [x21]
	ldr	w0, [x21, #8]
	add	x1, sp, #12
	mov	w2, #3
	blr	x8
	cmp	w0, #3
	b.ne	LBB0_7
; %bb.2:
	ldr	w0, [x21, #8]
	add	x1, sp, #12
	mov	w2, #1
	bl	_i2c_master_send
	ldr	w0, [x21, #8]
	add	x1, sp, #12
	mov	w2, #2
	bl	_i2c_master_recv
	ldp	w8, w9, [sp, #12]
	orr	w1, w9, w8, lsl #8
	cmp	w1, w20
	b.ne	LBB0_6
; %bb.3:
	subs	w0, w19, #16
	b.lo	LBB0_5
; %bb.4:
Lloh8:
	adrp	x1, _uda1380_cache_dirty@GOTPAGE
Lloh9:
	ldr	x1, [x1, _uda1380_cache_dirty@GOTPAGEOFF]
	bl	_clear_bit
LBB0_5:
	mov	w0, #0
	b	LBB0_8
LBB0_6:
Lloh10:
	adrp	x0, l_.str.1@PAGE
Lloh11:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_debug
LBB0_7:
Lloh12:
	adrp	x8, _EIO@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	ldr	x8, [sp, #24]
Lloh15:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh16:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_10
; %bb.9:
	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_10:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_UDA1380_MVOL,4,2               ; @UDA1380_MVOL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"uda1380: hw write %x val %x\n"

l_.str.1:                               ; @.str.1
	.asciz	"uda1380: READ BACK VAL %x\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_uda1380_cache_dirty,4,2        ; @uda1380_cache_dirty
	.no_dead_strip	_uda1380_write
.subsections_via_symbols
