	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function apds9300_chip_init
_apds9300_chip_init:                    ## @apds9300_chip_init
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	xorl	%esi, %esi
	callq	_apds9300_set_power_state
	testl	%eax, %eax
	js	LBB0_5
## %bb.1:
	movq	%r14, %rdi
	movl	$1, %esi
	callq	_apds9300_set_power_state
	testl	%eax, %eax
	js	LBB0_5
## %bb.2:
	movq	(%r14), %rdi
	movq	_APDS9300_CONTROL@GOTPCREL(%rip), %rax
	movq	_APDS9300_CMD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	callq	_i2c_smbus_read_byte_data
	movq	_APDS9300_POWER_ON@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_3
## %bb.4:
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_apds9300_set_intr_state
	testl	%eax, %eax
	jns	LBB0_7
LBB0_5:
	movl	%eax, %ebx
	jmp	LBB0_6
LBB0_3:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_6:
	movq	(%r14), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
LBB0_7:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_APDS9300_CONTROL,4,2           ## @APDS9300_CONTROL
	.comm	_APDS9300_CMD,4,2               ## @APDS9300_CMD
	.comm	_APDS9300_POWER_ON,4,2          ## @APDS9300_POWER_ON
	.comm	_ENODEV,4,2                     ## @ENODEV
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to init the chip\n"

	.no_dead_strip	_apds9300_chip_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function apds9300_chip_init
_apds9300_chip_init:                    ; @apds9300_chip_init
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	mov	w1, #0
	bl	_apds9300_set_power_state
	tbnz	w0, #31, LBB0_4
; %bb.1:
	mov	x0, x19
	mov	w1, #1
	bl	_apds9300_set_power_state
	tbnz	w0, #31, LBB0_4
; %bb.2:
Lloh0:
	adrp	x8, _APDS9300_CONTROL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _APDS9300_CONTROL@GOTPAGEOFF]
	ldr	x0, [x19]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _APDS9300_CMD@GOTPAGE
Lloh4:
	ldr	x9, [x9, _APDS9300_CMD@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w1, w9, w8
	bl	_i2c_smbus_read_byte_data
Lloh6:
	adrp	x8, _APDS9300_POWER_ON@GOTPAGE
Lloh7:
	ldr	x8, [x8, _APDS9300_POWER_ON@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_5
; %bb.3:
	mov	x0, x19
	mov	w1, #0
	bl	_apds9300_set_intr_state
	mov	w20, #0
	tbz	w0, #31, LBB0_7
LBB0_4:
	mov	x20, x0
	b	LBB0_6
LBB0_5:
Lloh9:
	adrp	x8, _ENODEV@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_6:
	ldr	x0, [x19]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
LBB0_7:
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_APDS9300_CONTROL,4,2           ; @APDS9300_CONTROL
	.comm	_APDS9300_CMD,4,2               ; @APDS9300_CMD
	.comm	_APDS9300_POWER_ON,4,2          ; @APDS9300_POWER_ON
	.comm	_ENODEV,4,2                     ; @ENODEV
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to init the chip\n"

	.no_dead_strip	_apds9300_chip_init
.subsections_via_symbols
