	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function af9013_wregs
_af9013_wregs:                          ## @af9013_wregs
	.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	%rbx
	subq	$136, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
                                        ## kill: def $r8d killed $r8d def $r8
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	leal	3(%r8), %eax
	movl	%eax, -160(%rbp)
	leaq	-128(%rbp), %rdi
	movq	%rdi, -152(%rbp)
	movl	$0, -144(%rbp)
	movl	8(%r14), %edi
	movl	%edi, -140(%rbp)
	cmpl	$85, %eax
	jb	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_2:
	movl	%r9d, %ebx
	movzbl	%dh, %eax
	movl	%eax, -128(%rbp)
	movzbl	%dl, %eax
	movl	%eax, -124(%rbp)
	movl	%esi, -120(%rbp)
	leaq	-116(%rbp), %rdi
	movq	%rcx, %rsi
	movl	%r8d, %edx
	callq	_memcpy
	movl	4(%r14), %edi
	testl	%ebx, %ebx
	je	LBB0_3
## %bb.4:
	movq	_I2C_LOCK_SEGMENT@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	callq	_i2c_lock_bus
	movl	4(%r14), %edi
	leaq	-160(%rbp), %rsi
	movl	$1, %edx
	callq	___i2c_transfer
	movl	%eax, %ebx
	movl	4(%r14), %edi
	movl	(%r15), %esi
	callq	_i2c_unlock_bus
	testl	%ebx, %ebx
	jns	LBB0_6
	jmp	LBB0_9
LBB0_3:
	leaq	-160(%rbp), %rsi
	movl	$1, %edx
	callq	___i2c_transfer
	movl	%eax, %ebx
	testl	%ebx, %ebx
	js	LBB0_9
LBB0_6:
	cmpl	$1, %ebx
	movl	$0, %ebx
	je	LBB0_10
## %bb.7:
	movq	_EREMOTEIO@GOTPCREL(%rip), %rax
LBB0_8:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_9:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_dev_dbg
LBB0_10:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-32(%rbp), %rax
	jne	LBB0_12
## %bb.11:
	movl	%ebx, %eax
	addq	$136, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_I2C_LOCK_SEGMENT,4,2           ## @I2C_LOCK_SEGMENT
	.comm	_EREMOTEIO,4,2                  ## @EREMOTEIO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed %d\n"

	.no_dead_strip	_af9013_wregs
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function af9013_wregs
_af9013_wregs:                          ; @af9013_wregs
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #176
	.cfi_def_cfa_offset 176
	stp	x22, x21, [sp, #128]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #144]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #160]            ; 16-byte Folded Spill
	add	x29, sp, #160
	.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]
	stur	x8, [x29, #-40]
	add	w9, w4, #3
	str	w9, [sp, #8]
	add	x8, sp, #36
	str	x8, [sp, #16]
	ldr	w10, [x0, #8]
	stp	wzr, w10, [sp, #24]
	cmp	w9, #85
	b.lo	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_8
LBB0_2:
	mov	x20, x5
	ubfx	w9, w2, #8, #8
	and	w10, w2, #0xff
	stp	w9, w10, [sp, #36]
	str	w1, [sp, #44]
	add	x0, x8, #12
	mov	x1, x3
	mov	x2, x4
	bl	_memcpy
	ldr	w0, [x19, #4]
	cbz	w20, LBB0_4
; %bb.3:
Lloh5:
	adrp	x21, _I2C_LOCK_SEGMENT@GOTPAGE
Lloh6:
	ldr	x21, [x21, _I2C_LOCK_SEGMENT@GOTPAGEOFF]
	ldr	w1, [x21]
	bl	_i2c_lock_bus
	ldr	w0, [x19, #4]
	add	x1, sp, #8
	mov	w2, #1
	bl	___i2c_transfer
	mov	x20, x0
	ldr	w0, [x19, #4]
	ldr	w1, [x21]
	bl	_i2c_unlock_bus
	tbz	w20, #31, LBB0_5
	b	LBB0_9
LBB0_4:
	add	x1, sp, #8
	mov	w2, #1
	bl	___i2c_transfer
	mov	x20, x0
	tbnz	w20, #31, LBB0_9
LBB0_5:
	cmp	w20, #1
	b.ne	LBB0_7
; %bb.6:
	mov	w20, #0
	b	LBB0_10
LBB0_7:
Lloh7:
	adrp	x8, _EREMOTEIO@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EREMOTEIO@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_9:
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, x20
	bl	_dev_dbg
LBB0_10:
	ldur	x8, [x29, #-40]
Lloh11:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh12:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_12
; %bb.11:
	mov	x0, x20
	ldp	x29, x30, [sp, #160]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #144]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #128]            ; 16-byte Folded Reload
	add	sp, sp, #176
	ret
LBB0_12:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_I2C_LOCK_SEGMENT,4,2           ; @I2C_LOCK_SEGMENT
	.comm	_EREMOTEIO,4,2                  ; @EREMOTEIO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed %d\n"

	.no_dead_strip	_af9013_wregs
.subsections_via_symbols
