	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sii8620_write_buf
_sii8620_write_buf:                     ## @sii8620_write_buf
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r13d
	movq	%rdx, -80(%rbp)                 ## 8-byte Spill
	movl	%esi, %ebx
	movq	%rdi, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	8(%rdi), %r14
	movq	%r14, %rdi
	callq	_to_i2c_client
	movq	%rax, %r15
	leal	1(%r13), %edi
	movl	%edi, -104(%rbp)
	movl	4(%rax), %eax
	movl	%eax, -88(%rbp)
	movq	_sii8620_i2c_page@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	%ebx, %ecx
	sarl	$8, %ecx
	movslq	%ecx, %rcx
	movl	(%rax,%rcx,4), %eax
	movl	%eax, -84(%rbp)
	cmpl	$0, (%r12)
	je	LBB0_1
LBB0_10:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_12
## %bb.11:
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	%r12, -72(%rbp)                 ## 8-byte Spill
	movq	%r14, -112(%rbp)                ## 8-byte Spill
	movl	%ebx, -60(%rbp)                 ## 4-byte Spill
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	movq	%r13, %r14
	cmpl	$2, %r13d
	jl	LBB0_5
## %bb.2:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kmalloc
	movq	%rax, -96(%rbp)
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%rax, %r13
	movq	%rax, %rdi
	addq	$4, %rdi
	movq	%rbx, %rsi
	movl	%r14d, %edx
	callq	_memcpy
	jmp	LBB0_6
LBB0_5:
	leaq	-56(%rbp), %r13
	movq	%r13, -96(%rbp)
	movl	(%rbx), %eax
	movl	%eax, -52(%rbp)
LBB0_6:
	movl	-60(%rbp), %r12d                ## 4-byte Reload
	movl	%r12d, (%r13)
	movl	(%r15), %edi
	leaq	-104(%rbp), %rsi
	movl	$1, %edx
	callq	_i2c_transfer
	movl	%eax, %r15d
	leaq	L_.str(%rip), %rsi
	movq	-112(%rbp), %rbx                ## 8-byte Reload
	movq	%rbx, %rdi
	movl	%r12d, %edx
	movl	%r14d, %ecx
	movq	-80(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %r8
	movl	%eax, %r9d
	callq	_dev_dbg
	cmpl	$1, %r15d
	je	LBB0_8
## %bb.7:
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	movl	%r12d, %edx
	movl	%r14d, %ecx
	movq	%r13, %r8
	movl	%r15d, %r9d
	callq	_dev_err
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	subl	(%rax), %ecx
	testl	%r15d, %r15d
	cmovnel	%r15d, %ecx
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movl	%ecx, (%rax)
LBB0_8:
	cmpl	$2, %r14d
	jl	LBB0_10
## %bb.9:
	movq	-96(%rbp), %rdi
	callq	_kfree
	jmp	LBB0_10
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	subl	(%rax), %ecx
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movl	%ecx, (%rax)
	jmp	LBB0_10
LBB0_12:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_sii8620_i2c_page,8,3           ## @sii8620_i2c_page
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"write at %04x: %*ph, %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"Write at %#06x of %*ph failed with code %d.\n"

	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_sii8620_write_buf
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sii8620_write_buf
_sii8620_write_buf:                     ; @sii8620_write_buf
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x3
	mov	x21, x2
	mov	x22, x1
	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, #40]
	ldr	x23, [x0, #8]
	mov	x0, x23
	bl	_to_i2c_client
	mov	x24, x0
	add	w0, w20, #1
	ldr	w8, [x24, #4]
	str	w0, [sp, #8]
	str	w8, [sp, #24]
Lloh3:
	adrp	x8, _sii8620_i2c_page@GOTPAGE
Lloh4:
	ldr	x8, [x8, _sii8620_i2c_page@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	asr	w9, w22, #8
	ldr	w8, [x8, w9, sxtw #2]
	str	w8, [sp, #28]
	ldr	w8, [x19]
	cbz	w8, LBB0_3
LBB0_1:
	ldr	x8, [sp, #40]
Lloh6:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh7:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_12
; %bb.2:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_3:
	cmp	w20, #2
	b.lt	LBB0_6
; %bb.4:
Lloh9:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	bl	_kmalloc
	str	x0, [sp, #16]
	cbz	x0, LBB0_11
; %bb.5:
	mov	x25, x0
	add	x0, x0, #4
	mov	x1, x21
	mov	x2, x20
	bl	_memcpy
	b	LBB0_7
LBB0_6:
	add	x25, sp, #32
	str	x25, [sp, #16]
	ldr	w8, [x21]
	str	w8, [sp, #36]
LBB0_7:
	str	w22, [x25]
	ldr	w0, [x24]
	add	x1, sp, #8
	mov	w2, #1
	bl	_i2c_transfer
	mov	x24, x0
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x23
	mov	x2, x22
	mov	x3, x20
	mov	x4, x21
	mov	x5, x24
	bl	_dev_dbg
	cmp	w24, #1
	b.eq	LBB0_9
; %bb.8:
Lloh14:
	adrp	x1, l_.str.1@PAGE
Lloh15:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x23
	mov	x2, x22
	mov	x3, x20
	mov	x4, x21
	mov	x5, x24
	bl	_dev_err
Lloh16:
	adrp	x8, _EIO@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	cmp	w24, #0
	csneg	w8, w24, w8, ne
	str	w8, [x19]
LBB0_9:
	cmp	w20, #2
	b.lt	LBB0_1
; %bb.10:
	ldr	x0, [sp, #16]
	bl	_kfree
	b	LBB0_1
LBB0_11:
Lloh19:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	neg	w8, w8
	str	w8, [x19]
	b	LBB0_1
LBB0_12:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_sii8620_i2c_page,8,3           ; @sii8620_i2c_page
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"write at %04x: %*ph, %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"Write at %#06x of %*ph failed with code %d.\n"

	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_sii8620_write_buf
.subsections_via_symbols
