	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_m5602_read_sensor              ## -- Begin function m5602_read_sensor
	.p2align	4, 0x90
_m5602_read_sensor:                     ## @m5602_read_sensor
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testl	%ecx, %ecx
	je	LBB0_2
## %bb.1:
	movl	%ecx, %r12d
	movq	%rdi, %r13
	movq	(%rdi), %rax
	cmpl	%ecx, (%rax)
	jge	LBB0_4
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_3
LBB0_4:
	movq	%rdx, %r14
	movl	%esi, %r15d
	movq	%r13, %rdi
	callq	_m5602_wait_for_i2c
	testl	%eax, %eax
	js	LBB0_10
## %bb.5:
	movq	_M5602_XB_I2C_DEV_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	(%r13), %rax
	movl	4(%rax), %edx
	movq	%r13, %rdi
	callq	_m5602_write_bridge
	testl	%eax, %eax
	js	LBB0_10
## %bb.6:
	movq	_M5602_XB_I2C_REG_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	movl	%r15d, %edx
	callq	_m5602_write_bridge
	testl	%eax, %eax
	js	LBB0_10
## %bb.7:
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movq	(%r13), %rax
	cmpl	$1, (%rax)
	movq	_M5602_XB_I2C_CTRL@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	jne	LBB0_13
## %bb.8:
	movq	%r13, %rdi
	movl	$1, %edx
	callq	_m5602_write_bridge
	testl	%eax, %eax
	js	LBB0_10
## %bb.9:
	movl	(%r14), %esi
	movq	%r13, %rdi
	movl	$8, %edx
	jmp	LBB0_14
LBB0_13:
	leal	24(%r12), %edx
	movq	%r13, %rdi
LBB0_14:
	callq	_m5602_write_bridge
	movl	%eax, %ebx
	testl	%r12d, %r12d
	jle	LBB0_3
## %bb.15:
	testl	%ebx, %ebx
	jne	LBB0_3
## %bb.16:
	movl	%r12d, %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	$1, %r12d
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	callq	_m5602_wait_for_i2c
	testl	%eax, %eax
	js	LBB0_10
## %bb.18:                              ##   in Loop: Header=BB0_17 Depth=1
	movq	_M5602_XB_I2C_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	movq	%r14, %rdx
	callq	_m5602_read_bridge
	movl	%eax, %ebx
	movq	_D_CONF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %r8d
	movq	%r13, %rdi
	leaq	L_.str(%rip), %rdx
	movl	%r15d, %ecx
	callq	_gspca_dbg
	cmpq	-56(%rbp), %r12                 ## 8-byte Folded Reload
	jae	LBB0_3
## %bb.19:                              ##   in Loop: Header=BB0_17 Depth=1
	addq	$4, %r14
	incq	%r12
	testl	%ebx, %ebx
	je	LBB0_17
	jmp	LBB0_3
LBB0_10:
	movl	%eax, %ebx
LBB0_3:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_M5602_XB_I2C_DEV_ADDR,4,2      ## @M5602_XB_I2C_DEV_ADDR
	.comm	_M5602_XB_I2C_REG_ADDR,4,2      ## @M5602_XB_I2C_REG_ADDR
	.comm	_M5602_XB_I2C_CTRL,4,2          ## @M5602_XB_I2C_CTRL
	.comm	_M5602_XB_I2C_DATA,4,2          ## @M5602_XB_I2C_DATA
	.comm	_D_CONF,4,2                     ## @D_CONF
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Reading sensor register 0x%x containing 0x%x\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_m5602_read_sensor              ; -- Begin function m5602_read_sensor
	.p2align	2
_m5602_read_sensor:                     ; @m5602_read_sensor
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	cbz	w3, LBB0_2
; %bb.1:
	mov	x22, x3
	mov	x21, x0
	ldr	x8, [x0]
	ldr	w8, [x8]
	cmp	w8, w3
	b.ge	LBB0_3
LBB0_2:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_17
LBB0_3:
	mov	x19, x2
	mov	x20, x1
	mov	x0, x21
	bl	_m5602_wait_for_i2c
	tbnz	w0, #31, LBB0_16
; %bb.4:
Lloh3:
	adrp	x8, _M5602_XB_I2C_DEV_ADDR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _M5602_XB_I2C_DEV_ADDR@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	ldr	x8, [x21]
	ldr	w2, [x8, #4]
	mov	x0, x21
	bl	_m5602_write_bridge
	tbnz	w0, #31, LBB0_16
; %bb.5:
Lloh6:
	adrp	x8, _M5602_XB_I2C_REG_ADDR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _M5602_XB_I2C_REG_ADDR@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x21
	mov	x2, x20
	bl	_m5602_write_bridge
	tbnz	w0, #31, LBB0_16
; %bb.6:
	ldr	x8, [x21]
	ldr	w8, [x8]
Lloh9:
	adrp	x24, _M5602_XB_I2C_CTRL@GOTPAGE
Lloh10:
	ldr	x24, [x24, _M5602_XB_I2C_CTRL@GOTPAGEOFF]
	ldr	w1, [x24]
	cmp	w8, #1
	b.ne	LBB0_9
; %bb.7:
	mov	x0, x21
	mov	w2, #1
	bl	_m5602_write_bridge
	tbnz	w0, #31, LBB0_16
; %bb.8:
	ldr	w1, [x24]
	mov	x0, x21
	mov	w2, #8
	b	LBB0_10
LBB0_9:
	add	w2, w22, #24
	mov	x0, x21
LBB0_10:
	bl	_m5602_write_bridge
	mov	x23, x0
	cmp	w22, #1
	b.lt	LBB0_17
; %bb.11:
	cbnz	w23, LBB0_17
; %bb.12:
	mov	w25, w22
Lloh11:
	adrp	x26, _M5602_XB_I2C_DATA@GOTPAGE
Lloh12:
	ldr	x26, [x26, _M5602_XB_I2C_DATA@GOTPAGEOFF]
	mov	w27, #1
Lloh13:
	adrp	x28, _D_CONF@GOTPAGE
Lloh14:
	ldr	x28, [x28, _D_CONF@GOTPAGEOFF]
	mov	x22, x19
Lloh15:
	adrp	x24, l_.str@PAGE
Lloh16:
	add	x24, x24, l_.str@PAGEOFF
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	bl	_m5602_wait_for_i2c
	tbnz	w0, #31, LBB0_16
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	ldr	w1, [x26]
	mov	x0, x21
	mov	x2, x22
	bl	_m5602_read_bridge
	mov	x23, x0
	ldr	w1, [x28]
	ldr	w4, [x19]
	mov	x0, x21
	mov	x2, x24
	mov	x3, x20
	bl	_gspca_dbg
	cmp	x27, x25
	b.hs	LBB0_17
; %bb.15:                               ;   in Loop: Header=BB0_13 Depth=1
	add	x22, x22, #4
	add	x27, x27, #1
	cbz	w23, LBB0_13
	b	LBB0_17
LBB0_16:
	mov	x23, x0
LBB0_17:
	mov	x0, x23
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_M5602_XB_I2C_DEV_ADDR,4,2      ; @M5602_XB_I2C_DEV_ADDR
	.comm	_M5602_XB_I2C_REG_ADDR,4,2      ; @M5602_XB_I2C_REG_ADDR
	.comm	_M5602_XB_I2C_CTRL,4,2          ; @M5602_XB_I2C_CTRL
	.comm	_M5602_XB_I2C_DATA,4,2          ; @M5602_XB_I2C_DATA
	.comm	_D_CONF,4,2                     ; @D_CONF
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Reading sensor register 0x%x containing 0x%x\n"

.subsections_via_symbols
