	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function af9013_regmap_write
_af9013_regmap_write:                   ## @af9013_regmap_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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r13
	movq	%rsi, %r12
	movq	%rdi, %r14
	callq	_i2c_get_clientdata
	xorl	%r15d, %r15d
	cmpl	$0, (%r12)
	sete	%r15b
	movl	4(%r12), %ebx
	shll	$8, %ebx
	orl	8(%r12), %ebx
	addq	$12, %r12
	leal	-3(%r13), %r8d
	movq	(%rax), %rax
	movq	_AF9013_TS_MODE_USB@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.1:
	movl	%ebx, %eax
	andl	$65280, %eax                    ## imm = 0xFF00
	cmpl	$44544, %eax                    ## imm = 0xAE00
	je	LBB0_4
## %bb.2:
	leal	-13(,%r13,4), %esi
	jmp	LBB0_3
LBB0_4:
	leal	-20736(%rbx), %eax
	cmpl	$16127, %eax                    ## imm = 0x3EFF
	jae	LBB0_5
## %bb.10:
	leal	-16(,%r13,4), %esi
	orl	$195, %esi
LBB0_3:
	movq	%r14, %rdi
	movl	%ebx, %edx
	movq	%r12, %rcx
	movl	%r15d, %r9d
	callq	_af9013_wregs
	movl	%eax, %r13d
	testl	%eax, %eax
	je	LBB0_12
LBB0_9:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movl	%r13d, %edx
	callq	_dev_dbg
	jmp	LBB0_13
LBB0_5:
	xorl	%r13d, %r13d
	testl	%r8d, %r8d
	je	LBB0_13
## %bb.6:
	movl	%r8d, %r13d
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	movl	$3, %esi
	movl	%ebx, %edx
	movq	%r12, %rcx
	movl	$1, %r8d
	movl	%r15d, %r9d
	callq	_af9013_wregs
	testl	%eax, %eax
	jne	LBB0_8
## %bb.11:                              ##   in Loop: Header=BB0_7 Depth=1
	incl	%ebx
	addq	$4, %r12
	decq	%r13
	jne	LBB0_7
LBB0_12:
	xorl	%r13d, %r13d
LBB0_13:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movl	%eax, %r13d
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_AF9013_TS_MODE_USB,8,3         ## @AF9013_TS_MODE_USB
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed %d\n"

	.no_dead_strip	_af9013_regmap_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function af9013_regmap_write
_af9013_regmap_write:                   ; @af9013_regmap_write
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x24, x2
	mov	x21, x1
	mov	x19, x0
	bl	_i2c_get_clientdata
	ldp	w8, w9, [x21]
	cmp	w8, #0
	cset	w20, eq
	ldr	w8, [x21, #8]
	orr	w22, w8, w9, lsl #8
	add	x21, x21, #12
	sub	w23, w24, #3
Lloh0:
	adrp	x8, _AF9013_TS_MODE_USB@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AF9013_TS_MODE_USB@GOTPAGEOFF]
	ldr	x9, [x0]
Lloh2:
	ldr	x8, [x8]
	and	w10, w22, #0xff00
	cmp	x9, x8
	mov	w8, #44544
	ccmp	w10, w8, #4, eq
	b.ne	LBB0_3
; %bb.1:
	mov	w8, #-20736
	mov	w9, #16127
	add	w8, w22, w8
	cmp	w8, w9
	b.hs	LBB0_6
; %bb.2:
	lsl	w8, w24, #2
	sub	w8, w8, #16
	mov	w9, #195
	orr	w1, w8, w9
	b	LBB0_4
LBB0_3:
	lsl	w8, w24, #2
	sub	w1, w8, #13
LBB0_4:
	mov	x0, x19
	mov	x2, x22
	mov	x3, x21
	mov	x4, x23
	mov	x5, x20
	bl	_af9013_wregs
	mov	x24, x0
	cbz	w0, LBB0_10
LBB0_5:
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, x24
	bl	_dev_dbg
	b	LBB0_10
LBB0_6:
	cbz	w23, LBB0_9
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	w1, #3
	mov	x2, x22
	mov	x3, x21
	mov	w4, #1
	mov	x5, x20
	bl	_af9013_wregs
	cbnz	w0, LBB0_11
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	add	w22, w22, #1
	add	x21, x21, #4
	subs	x23, x23, #1
	b.ne	LBB0_7
LBB0_9:
	mov	w24, #0
LBB0_10:
	mov	x0, x24
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_11:
	mov	x24, x0
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_AF9013_TS_MODE_USB,8,3         ; @AF9013_TS_MODE_USB
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed %d\n"

	.no_dead_strip	_af9013_regmap_write
.subsections_via_symbols
