	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function apds990x_detect
_apds990x_detect:                       ## @apds990x_detect
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	8(%rdi), %r15
	movq	_APDS990X_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-28(%rbp), %rdx
	callq	_apds990x_read_byte
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movq	_APDS990X_REV@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movq	%rbx, %rdx
	callq	_apds990x_read_byte
	movl	%eax, %r14d
	testl	%eax, %eax
	js	LBB0_3
## %bb.5:
	movl	-28(%rbp), %eax
	addl	$-128, %eax
	cmpl	$2, %eax
	ja	LBB0_7
## %bb.6:
	movl	4(%rbx), %edi
	leaq	L_.str.2(%rip), %rdx
	movl	$4, %esi
	callq	_snprintf
	jmp	LBB0_8
LBB0_1:
	movl	%eax, %r14d
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_4
LBB0_3:
	leaq	L_.str.1(%rip), %rsi
LBB0_4:
	movq	%r15, %rdi
	callq	_dev_err
	jmp	LBB0_8
LBB0_7:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_8:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_APDS990X_ID,4,2                ## @APDS990X_ID
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ID read failed\n"

	.comm	_APDS990X_REV,4,2               ## @APDS990X_REV
L_.str.1:                               ## @.str.1
	.asciz	"REV read failed\n"

L_.str.2:                               ## @.str.2
	.asciz	"APDS-990x"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.no_dead_strip	_apds990x_detect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function apds990x_detect
_apds990x_detect:                       ; @apds990x_detect
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x20, x0
	ldr	x21, [x0, #8]
Lloh0:
	adrp	x8, _APDS990X_ID@GOTPAGE
Lloh1:
	ldr	x8, [x8, _APDS990X_ID@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_apds990x_read_byte
	tbnz	w0, #31, LBB0_4
; %bb.1:
Lloh3:
	adrp	x8, _APDS990X_REV@GOTPAGE
Lloh4:
	ldr	x8, [x8, _APDS990X_REV@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, x20
	bl	_apds990x_read_byte
	mov	x19, x0
	tbnz	w0, #31, LBB0_5
; %bb.2:
	ldr	w8, [sp, #12]
	sub	w8, w8, #128
	cmp	w8, #2
	b.hi	LBB0_7
; %bb.3:
	ldr	w0, [x20, #4]
Lloh6:
	adrp	x2, l_.str.2@PAGE
Lloh7:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	w1, #4
	bl	_snprintf
	b	LBB0_8
LBB0_4:
	mov	x19, x0
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_6
LBB0_5:
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_6:
	mov	x0, x21
	bl	_dev_err
	b	LBB0_8
LBB0_7:
Lloh12:
	adrp	x8, _ENODEV@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w19, w8
LBB0_8:
	mov	x0, x19
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_APDS990X_ID,4,2                ; @APDS990X_ID
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ID read failed\n"

	.comm	_APDS990X_REV,4,2               ; @APDS990X_REV
l_.str.1:                               ; @.str.1
	.asciz	"REV read failed\n"

l_.str.2:                               ; @.str.2
	.asciz	"APDS-990x"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.no_dead_strip	_apds990x_detect
.subsections_via_symbols
