	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function m5mols_read
_m5mols_read:                           ## @m5mols_read
	.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	$136, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, -168(%rbp)                ## 8-byte Spill
	movl	%edx, %ebx
                                        ## kill: def $esi killed $esi def $rsi
	movq	%rsi, -176(%rbp)                ## 8-byte Spill
	movq	%rdi, %r13
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	callq	_v4l2_get_subdevdata
	movq	%rax, %r14
	movq	%r13, %rdi
	callq	_to_m5mols
	movq	%rax, -160(%rbp)                ## 8-byte Spill
	movq	_M5MOLS_I2C_MAX_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	incl	%eax
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r12
	movl	%ebx, %edi
	callq	_I2C_CATEGORY
	movl	%eax, %r15d
	movl	%ebx, %edi
	callq	_I2C_COMMAND
	cmpl	$0, (%r14)
	je	LBB0_1
## %bb.2:
	movl	4(%r14), %ecx
	movl	%ecx, -88(%rbp)
	movq	$0, -96(%rbp)
	movl	$5, -112(%rbp)
	leaq	-144(%rbp), %rcx
	movq	%rcx, -104(%rbp)
	movl	$5, -144(%rbp)
	movq	_M5MOLS_BYTE_READ@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, -140(%rbp)
	movl	%r15d, -148(%rbp)               ## 4-byte Spill
	movl	%r15d, -136(%rbp)
	movl	%eax, %r15d
	movl	%eax, -132(%rbp)
	movq	-176(%rbp), %rbx                ## 8-byte Reload
	movl	%ebx, -128(%rbp)
	movl	4(%r14), %eax
	movl	%eax, -56(%rbp)
	movq	_I2C_M_RD@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -64(%rbp)
	leal	1(%rbx), %eax
	movl	%eax, -80(%rbp)
	movq	%r12, -72(%rbp)
	movl	$200, %edi
	movl	$300, %esi                      ## imm = 0x12C
	callq	_usleep_range
	movl	(%r14), %edi
	leaq	-112(%rbp), %rsi
	movl	$2, %edx
	callq	_i2c_transfer
	cmpl	$2, %eax
	movq	%rbx, %rdx
	jne	LBB0_4
## %bb.3:
	addq	$4, %r12
	movq	%r12, %rdi
	movl	%edx, %esi
	callq	_m5mols_swap_byte
	movq	-168(%rbp), %rcx                ## 8-byte Reload
	movl	%eax, (%rcx)
	xorl	%eax, %eax
	jmp	LBB0_7
LBB0_1:
	movq	_ENODEV@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_7
LBB0_4:
	movl	%eax, %r14d
	movq	-160(%rbp), %rax                ## 8-byte Reload
	cmpq	$0, (%rax)
	je	LBB0_6
## %bb.5:
	leaq	L_.str(%rip), %rsi
	movq	%r13, %rdi
                                        ## kill: def $edx killed $edx killed $rdx
	movl	-148(%rbp), %ecx                ## 4-byte Reload
	movl	%r15d, %r8d
	movl	%r14d, %r9d
	callq	_v4l2_err
LBB0_6:
	movq	_EIO@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	testl	%r14d, %r14d
	cmovsl	%r14d, %eax
LBB0_7:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_9
## %bb.8:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_M5MOLS_I2C_MAX_SIZE,4,2        ## @M5MOLS_I2C_MAX_SIZE
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_M5MOLS_BYTE_READ,4,2           ## @M5MOLS_BYTE_READ
	.comm	_I2C_M_RD,8,3                   ## @I2C_M_RD
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"read failed: size:%d cat:%02x cmd:%02x. %d\n"

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

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function m5mols_read
_m5mols_read:                           ; @m5mols_read
	.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, #96
	mov	x20, x3
	mov	x25, x2
	mov	x19, x1
	mov	x21, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-72]
	bl	_v4l2_get_subdevdata
	mov	x24, x0
	mov	x0, x21
	bl	_to_m5mols
	mov	x22, 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, #1
	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	x26, x9, x8
	mov	sp, x26
	mov	x0, x25
	bl	_I2C_CATEGORY
	mov	x23, x0
	mov	x0, x25
	bl	_I2C_COMMAND
	ldr	w8, [x24]
	cbz	w8, LBB0_3
; %bb.1:
	mov	x25, x0
	ldr	w8, [x24, #4]
	stur	w8, [x29, #-112]
	mov	w8, #5
	stur	w8, [x29, #-136]
	sub	x9, x29, #156
	stp	x9, xzr, [x29, #-128]
Lloh8:
	adrp	x9, _M5MOLS_BYTE_READ@GOTPAGE
Lloh9:
	ldr	x9, [x9, _M5MOLS_BYTE_READ@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	stp	w8, w9, [x29, #-156]
	stp	w23, w0, [x29, #-148]
	stur	w19, [x29, #-140]
	ldr	w8, [x24, #4]
Lloh11:
	adrp	x9, _I2C_M_RD@GOTPAGE
Lloh12:
	ldr	x9, [x9, _I2C_M_RD@GOTPAGEOFF]
	stur	w8, [x29, #-80]
Lloh13:
	ldr	x8, [x9]
	add	w9, w19, #1
	stur	w9, [x29, #-104]
	stp	x26, x8, [x29, #-96]
	mov	w0, #200
	mov	w1, #300
	bl	_usleep_range
	ldr	w0, [x24]
	sub	x1, x29, #136
	mov	w2, #2
	bl	_i2c_transfer
	cmp	w0, #2
	b.ne	LBB0_4
; %bb.2:
	add	x0, x26, #4
	mov	x1, x19
	bl	_m5mols_swap_byte
	mov	x8, x0
	mov	w0, #0
	str	w8, [x20]
	b	LBB0_7
LBB0_3:
Lloh14:
	adrp	x8, _ENODEV@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_7
LBB0_4:
	mov	x24, x0
	ldr	x8, [x22]
	cbz	x8, LBB0_6
; %bb.5:
Lloh17:
	adrp	x1, l_.str@PAGE
Lloh18:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	mov	x2, x19
	mov	x3, x23
	mov	x4, x25
	mov	x5, x24
	bl	_v4l2_err
LBB0_6:
Lloh19:
	adrp	x8, _EIO@GOTPAGE
Lloh20:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	cmp	w24, #0
	csneg	w0, w24, w8, lt
LBB0_7:
	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_9
; %bb.8:
	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_9:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.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
	.comm	_M5MOLS_BYTE_READ,4,2           ; @M5MOLS_BYTE_READ
	.comm	_I2C_M_RD,8,3                   ; @I2C_M_RD
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"read failed: size:%d cat:%02x cmd:%02x. %d\n"

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