	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lgdt3305_write_reg
_lgdt3305_write_reg:                    ## @lgdt3305_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	%rbx
	subq	$56, %rsp
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -16(%rbp)
	movl	%esi, %eax
	sarl	$8, %eax
	movl	%eax, -28(%rbp)
	movzbl	%sil, %eax
	movl	%eax, -24(%rbp)
	movl	%edx, -20(%rbp)
	leaq	-28(%rbp), %rax
	movq	%rax, -56(%rbp)
	movq	$3, -48(%rbp)
	movq	8(%rdi), %rax
	movl	(%rax), %eax
	movl	%eax, -40(%rbp)
	leaq	L_.str(%rip), %rdi
	callq	_lg_reg
	movl	(%rbx), %edi
	leaq	-56(%rbp), %rsi
	movl	$1, %edx
	callq	_i2c_transfer
	movl	%eax, %ebx
	xorl	%eax, %eax
	cmpl	$1, %ebx
	je	LBB0_3
## %bb.1:
	movq	-56(%rbp), %rax
	movl	(%rax), %esi
	movl	4(%rax), %edx
	movl	8(%rax), %ecx
	leaq	L_.str.1(%rip), %rdi
	movl	%ebx, %r8d
	callq	_lg_err
	movl	%ebx, %eax
	testl	%ebx, %ebx
	js	LBB0_3
## %bb.2:
	movq	_EREMOTEIO@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_3:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-16(%rbp), %rcx
	jne	LBB0_5
## %bb.4:
	addq	$56, %rsp
	popq	%rbx
	popq	%rbp
	retq
LBB0_5:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"reg: 0x%04x, val: 0x%02x\n"

L_.str.1:                               ## @.str.1
	.asciz	"error (addr %02x %02x <- %02x, err = %i)\n"

	.comm	_EREMOTEIO,4,2                  ## @EREMOTEIO
	.no_dead_strip	_lgdt3305_write_reg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function lgdt3305_write_reg
lCPI0_0:
	.long	3                               ; 0x3
	.long	0                               ; 0x0
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_lgdt3305_write_reg:                    ; @lgdt3305_write_reg
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-24]
	asr	w8, w1, #8
	and	w9, w1, #0xff
	stp	w8, w9, [sp, #28]
	str	w2, [sp, #36]
	add	x8, sp, #28
	str	x8, [sp]
Lloh3:
	adrp	x8, lCPI0_0@PAGE
Lloh4:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	str	d0, [sp, #8]
	ldr	x8, [x0, #8]
	ldr	w8, [x8]
	str	w8, [sp, #16]
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_lg_reg
	ldr	w0, [x19]
	mov	x1, sp
	mov	w2, #1
	bl	_i2c_transfer
	cmp	w0, #1
	b.ne	LBB0_2
; %bb.1:
	mov	w19, #0
	b	LBB0_4
LBB0_2:
	mov	x19, x0
	ldr	x8, [sp]
	ldp	w1, w2, [x8]
	ldr	w3, [x8, #8]
Lloh7:
	adrp	x0, l_.str.1@PAGE
Lloh8:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x4, x19
	bl	_lg_err
	tbnz	w19, #31, LBB0_4
; %bb.3:
Lloh9:
	adrp	x8, _EREMOTEIO@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EREMOTEIO@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w19, w8
LBB0_4:
	ldur	x8, [x29, #-24]
Lloh12:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh13:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_6
; %bb.5:
	mov	x0, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_6:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdr	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"reg: 0x%04x, val: 0x%02x\n"

l_.str.1:                               ; @.str.1
	.asciz	"error (addr %02x %02x <- %02x, err = %i)\n"

	.comm	_EREMOTEIO,4,2                  ; @EREMOTEIO
	.no_dead_strip	_lgdt3305_write_reg
.subsections_via_symbols
