	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function xc_write_reg
LCPI0_0:
	.byte	255                             ## 0xff
	.byte	0                               ## 0x0
	.byte	0                               ## 0x0
	.byte	0                               ## 0x0
	.byte	255                             ## 0xff
	.byte	0                               ## 0x0
	.byte	0                               ## 0x0
	.byte	0                               ## 0x0
	.byte	255                             ## 0xff
	.byte	0                               ## 0x0
	.byte	0                               ## 0x0
	.byte	0                               ## 0x0
	.byte	255                             ## 0xff
	.byte	0                               ## 0x0
	.byte	0                               ## 0x0
	.byte	0                               ## 0x0
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_xc_write_reg:                          ## @xc_write_reg
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %eax
	shrl	$8, %eax
	movl	%edx, %ecx
	shrl	$8, %ecx
	movd	%eax, %xmm0
	pinsrd	$1, %esi, %xmm0
	pinsrd	$2, %ecx, %xmm0
	pinsrd	$3, %edx, %xmm0
	movq	%rdi, %r14
	pand	LCPI0_0(%rip), %xmm0
	movdqa	%xmm0, -64(%rbp)
	leaq	-64(%rbp), %rsi
	movl	$4, %edx
	callq	_xc_send_i2c_data
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_7
## %bb.1:
	movl	$100, %ebx
	movq	_XREG_BUSY@GOTPCREL(%rip), %r13
	leaq	-64(%rbp), %r15
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %esi
	movq	%r14, %rdi
	movq	%r15, %rdx
	callq	_xc5000_readreg
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_6
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	-64(%rbp), %eax
	orl	-60(%rbp), %eax
	je	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	$5, %edi
	callq	_msleep
	decl	%ebx
	jne	LBB0_2
LBB0_6:
	movq	_EREMOTEIO@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	subl	(%rax), %ecx
	testl	%ebx, %ebx
	cmovel	%ecx, %r12d
	jmp	LBB0_7
LBB0_4:
	xorl	%r12d, %r12d
LBB0_7:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_XREG_BUSY,4,2                  ## @XREG_BUSY
	.comm	_EREMOTEIO,4,2                  ## @EREMOTEIO
	.no_dead_strip	_xc_write_reg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function xc_write_reg
_xc_write_reg:                          ; @xc_write_reg
	.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, 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, w1, #8, #8
	and	w9, w1, #0xff
	stp	w8, w9, [sp, #8]
	ubfx	w8, w2, #8, #8
	and	w9, w2, #0xff
	stp	w8, w9, [sp, #16]
	add	x1, sp, #8
	mov	w2, #4
	bl	_xc_send_i2c_data
	cbnz	w0, LBB0_7
; %bb.1:
	mov	w21, #100
Lloh3:
	adrp	x22, _XREG_BUSY@GOTPAGE
Lloh4:
	ldr	x22, [x22, _XREG_BUSY@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x22]
	add	x2, sp, #8
	mov	x0, x19
	bl	_xc5000_readreg
	mov	x20, x0
	cbnz	w0, LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldp	w8, w9, [sp, #8]
	orr	w8, w8, w9
	cbz	w8, LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	w0, #5
	bl	_msleep
	subs	w21, w21, #1
	b.ne	LBB0_2
LBB0_5:
Lloh5:
	adrp	x8, _EREMOTEIO@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EREMOTEIO@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	cmp	w21, #0
	csneg	w0, w20, w8, ne
	b	LBB0_7
LBB0_6:
	mov	w0, #0
LBB0_7:
	ldr	x8, [sp, #24]
Lloh8:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh9:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_9
; %bb.8:
	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_9:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_XREG_BUSY,4,2                  ; @XREG_BUSY
	.comm	_EREMOTEIO,4,2                  ; @EREMOTEIO
	.no_dead_strip	_xc_write_reg
.subsections_via_symbols
