	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_m5mols_write                   ## -- Begin function m5mols_write
	.p2align	4, 0x90
_m5mols_write:                          ## @m5mols_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
	subq	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movl	%edx, -88(%rbp)
	callq	_v4l2_get_subdevdata
	movq	%rax, %rbx
	movq	%r12, %rdi
	callq	_to_m5mols
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	movq	_M5MOLS_I2C_MAX_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	$4, %eax
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r15
	movl	%r14d, %edi
	callq	_I2C_CATEGORY
	movl	%eax, -84(%rbp)                 ## 4-byte Spill
	movl	%r14d, %edi
	callq	_I2C_COMMAND
	movl	%eax, %r13d
	movl	%r14d, %edi
	callq	_I2C_SIZE
	cmpl	$0, (%rbx)
	je	LBB0_7
## %bb.1:
	cmpl	$4, %eax
	ja	LBB0_8
## %bb.2:
	movl	$22, %ecx
	btl	%eax, %ecx
	jae	LBB0_8
## %bb.3:
	movl	4(%rbx), %ecx
	movl	%ecx, -56(%rbp)
	movq	$0, -64(%rbp)
	movl	%eax, %ecx
	addq	$4, %rcx
	movq	%rcx, -72(%rbp)
	movq	%r15, -80(%rbp)
	movl	%eax, %ecx
	addl	$4, %ecx
	movl	%ecx, (%r15)
	movq	_M5MOLS_BYTE_WRITE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 4(%r15)
	movl	-84(%rbp), %ecx                 ## 4-byte Reload
	movl	%ecx, 8(%r15)
	movl	%r13d, 12(%r15)
	leaq	-88(%rbp), %rdi
	movl	%eax, %esi
	callq	_m5mols_swap_byte
	movl	%eax, 16(%r15)
	movl	$200, %edi
	movl	$300, %esi                      ## imm = 0x12C
	callq	_usleep_range
	movl	(%rbx), %edi
	leaq	-80(%rbp), %rsi
	movl	$1, %edx
	callq	_i2c_transfer
	xorl	%ebx, %ebx
	cmpl	$1, %eax
	je	LBB0_10
## %bb.4:
	movl	%eax, %r14d
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	cmpq	$0, (%rax)
	je	LBB0_6
## %bb.5:
	leaq	L_.str.1(%rip), %rsi
	movq	%r12, %rdi
	movl	-84(%rbp), %edx                 ## 4-byte Reload
	movl	%r13d, %ecx
	movl	%r14d, %r8d
	xorl	%eax, %eax
	callq	_v4l2_err
LBB0_6:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	testl	%r14d, %r14d
	cmovsl	%r14d, %ebx
	jmp	LBB0_10
LBB0_7:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	jmp	LBB0_9
LBB0_8:
	leaq	L_.str(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_v4l2_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_9:
	subl	(%rax), %ebx
LBB0_10:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_12
## %bb.11:
	movl	%ebx, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_M5MOLS_I2C_MAX_SIZE,4,2        ## @M5MOLS_I2C_MAX_SIZE
	.comm	_ENODEV,4,2                     ## @ENODEV
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Wrong data size\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_M5MOLS_BYTE_WRITE,4,2          ## @M5MOLS_BYTE_WRITE
L_.str.1:                               ## @.str.1
	.asciz	"write failed: cat:%02x cmd:%02x ret:%d\n"

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

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_m5mols_write                   ; -- Begin function m5mols_write
	.p2align	2
_m5mols_write:                          ; @m5mols_write
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	sub	sp, sp, #48
	mov	x24, x1
	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, #-72]
	stur	w2, [x29, #-108]
	bl	_v4l2_get_subdevdata
	mov	x22, x0
	mov	x0, x19
	bl	_to_m5mols
	mov	x20, x0
Lloh3:
	adrp	x8, _M5MOLS_I2C_MAX_SIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _M5MOLS_I2C_MAX_SIZE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	add	w8, w8, #4
	lsl	x8, x8, #2
	mov	x9, x8
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x25, x9, x8
	mov	sp, x25
	mov	x0, x24
	bl	_I2C_CATEGORY
	mov	x21, x0
	mov	x0, x24
	bl	_I2C_COMMAND
	mov	x23, x0
	mov	x0, x24
	bl	_I2C_SIZE
	ldr	w8, [x22]
	cbz	w8, LBB0_5
; %bb.1:
	mov	x1, x0
	cmp	w0, #4
	b.hi	LBB0_9
; %bb.2:
	mov	w8, #1
	lsl	w8, w8, w1
	mov	w9, #22
	tst	w8, w9
	b.eq	LBB0_9
; %bb.3:
	ldr	w8, [x22, #4]
	stur	w8, [x29, #-80]
	mov	w8, w1
	add	x8, x8, #4
	stp	x8, xzr, [x29, #-96]
	stur	x25, [x29, #-104]
Lloh8:
	adrp	x8, _M5MOLS_BYTE_WRITE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _M5MOLS_BYTE_WRITE@GOTPAGEOFF]
	add	w9, w1, #4
Lloh10:
	ldr	w8, [x8]
	stp	w9, w8, [x25]
	stp	w21, w23, [x25, #8]
	sub	x0, x29, #108
	bl	_m5mols_swap_byte
	str	w0, [x25, #16]
	mov	w0, #200
	mov	w1, #300
	bl	_usleep_range
	ldr	w0, [x22]
	sub	x1, x29, #104
	mov	w2, #1
	bl	_i2c_transfer
	cmp	w0, #1
	b.ne	LBB0_6
; %bb.4:
	mov	w0, #0
	b	LBB0_11
LBB0_5:
Lloh11:
	adrp	x8, _ENODEV@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_10
LBB0_6:
	mov	x22, x0
	ldr	x8, [x20]
	cbz	x8, LBB0_8
; %bb.7:
	sub	sp, sp, #32
	stp	x23, x22, [sp, #8]
	str	x21, [sp]
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_v4l2_err
	add	sp, sp, #32
LBB0_8:
Lloh15:
	adrp	x8, _EIO@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	cmp	w22, #0
	csneg	w0, w22, w8, lt
	b	LBB0_11
LBB0_9:
Lloh18:
	adrp	x1, l_.str@PAGE
Lloh19:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_v4l2_err
Lloh20:
	adrp	x8, _EINVAL@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_10:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_11:
	ldur	x8, [x29, #-72]
Lloh22:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh23:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh24:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_13
; %bb.12:
	sub	sp, x29, #64
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_13:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_M5MOLS_I2C_MAX_SIZE,4,2        ; @M5MOLS_I2C_MAX_SIZE
	.comm	_ENODEV,4,2                     ; @ENODEV
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Wrong data size\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_M5MOLS_BYTE_WRITE,4,2          ; @M5MOLS_BYTE_WRITE
l_.str.1:                               ; @.str.1
	.asciz	"write failed: cat:%02x cmd:%02x ret:%d\n"

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