	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rpr0521_init
_rpr0521_init:                          ## @rpr0521_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
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	movl	8(%rdi), %edi
	movq	_RPR0521_REG_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-20(%rbp), %rdx
	callq	_regmap_read
	testl	%eax, %eax
	js	LBB0_4
## %bb.1:
	movl	-20(%rbp), %edx
	movq	_RPR0521_MANUFACT_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	cmpl	%ecx, %edx
	jne	LBB0_5
## %bb.2:
	movl	8(%r14), %edi
	movq	_RPR0521_REG_MODE_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_RPR0521_MODE_MEAS_TIME_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_RPR0521_DEFAULT_MEAS_TIME@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_regmap_update_bits
	testl	%eax, %eax
	je	LBB0_7
## %bb.3:
	movl	%eax, %ebx
	leaq	L_.str.2(%rip), %rdi
	movl	%eax, %esi
	callq	_pr_err
	jmp	LBB0_6
LBB0_4:
	movl	%eax, %ebx
	movq	16(%r14), %rdi
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_6
LBB0_5:
	movq	16(%r14), %rdi
	leaq	L_.str.1(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_dev_err
	movq	_ENODEV@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_6:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_7:
	movq	_RPR0521_MODE_ALS_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_rpr0521_als_enable
	testl	%eax, %eax
	js	LBB0_11
## %bb.8:
	movq	_RPR0521_MODE_PXS_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_rpr0521_pxs_enable
	testl	%eax, %eax
	js	LBB0_11
## %bb.9:
	movq	$0, (%r14)
	xorl	%ebx, %ebx
	jmp	LBB0_6
LBB0_11:
	movl	%eax, %ebx
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_RPR0521_REG_ID,4,2             ## @RPR0521_REG_ID
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to read REG_ID register\n"

	.comm	_RPR0521_MANUFACT_ID,4,2        ## @RPR0521_MANUFACT_ID
L_.str.1:                               ## @.str.1
	.asciz	"Wrong id, got %x, expected %x\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_RPR0521_REG_MODE_CTRL,4,2      ## @RPR0521_REG_MODE_CTRL
	.comm	_RPR0521_MODE_MEAS_TIME_MASK,4,2 ## @RPR0521_MODE_MEAS_TIME_MASK
	.comm	_RPR0521_DEFAULT_MEAS_TIME,4,2  ## @RPR0521_DEFAULT_MEAS_TIME
L_.str.2:                               ## @.str.2
	.asciz	"regmap_update_bits returned %d\n"

	.comm	_RPR0521_MODE_ALS_ENABLE,4,2    ## @RPR0521_MODE_ALS_ENABLE
	.comm	_RPR0521_MODE_PXS_ENABLE,4,2    ## @RPR0521_MODE_PXS_ENABLE
	.no_dead_strip	_rpr0521_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rpr0521_init
_rpr0521_init:                          ; @rpr0521_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	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
	mov	x19, x0
	ldr	w0, [x0, #8]
Lloh0:
	adrp	x8, _RPR0521_REG_ID@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RPR0521_REG_ID@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	sub	x2, x29, #20
	bl	_regmap_read
	tbnz	w0, #31, LBB0_4
; %bb.1:
	ldur	w8, [x29, #-20]
Lloh3:
	adrp	x9, _RPR0521_MANUFACT_ID@GOTPAGE
Lloh4:
	ldr	x9, [x9, _RPR0521_MANUFACT_ID@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_5
; %bb.2:
	ldr	w0, [x19, #8]
Lloh6:
	adrp	x8, _RPR0521_REG_MODE_CTRL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _RPR0521_REG_MODE_CTRL@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
Lloh9:
	adrp	x8, _RPR0521_MODE_MEAS_TIME_MASK@GOTPAGE
Lloh10:
	ldr	x8, [x8, _RPR0521_MODE_MEAS_TIME_MASK@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
Lloh12:
	adrp	x8, _RPR0521_DEFAULT_MEAS_TIME@GOTPAGE
Lloh13:
	ldr	x8, [x8, _RPR0521_DEFAULT_MEAS_TIME@GOTPAGEOFF]
Lloh14:
	ldr	w3, [x8]
	bl	_regmap_update_bits
	cbz	w0, LBB0_7
; %bb.3:
	mov	x20, x0
Lloh15:
	adrp	x0, l_.str.2@PAGE
Lloh16:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x20
	bl	_pr_err
	b	LBB0_6
LBB0_4:
	mov	x20, x0
	ldr	x0, [x19, #16]
Lloh17:
	adrp	x1, l_.str@PAGE
Lloh18:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	b	LBB0_6
LBB0_5:
	ldr	x0, [x19, #16]
	stp	x8, x9, [sp]
Lloh19:
	adrp	x1, l_.str.1@PAGE
Lloh20:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
Lloh21:
	adrp	x8, _ENODEV@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_6:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_7:
Lloh24:
	adrp	x8, _RPR0521_MODE_ALS_ENABLE@GOTPAGE
Lloh25:
	ldr	x8, [x8, _RPR0521_MODE_ALS_ENABLE@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_rpr0521_als_enable
	tbnz	w0, #31, LBB0_10
; %bb.8:
Lloh27:
	adrp	x8, _RPR0521_MODE_PXS_ENABLE@GOTPAGE
Lloh28:
	ldr	x8, [x8, _RPR0521_MODE_PXS_ENABLE@GOTPAGEOFF]
Lloh29:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_rpr0521_pxs_enable
	tbnz	w0, #31, LBB0_10
; %bb.9:
	mov	w20, #0
	str	xzr, [x19]
	b	LBB0_6
LBB0_10:
	mov	x20, x0
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_RPR0521_REG_ID,4,2             ; @RPR0521_REG_ID
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to read REG_ID register\n"

	.comm	_RPR0521_MANUFACT_ID,4,2        ; @RPR0521_MANUFACT_ID
l_.str.1:                               ; @.str.1
	.asciz	"Wrong id, got %x, expected %x\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_RPR0521_REG_MODE_CTRL,4,2      ; @RPR0521_REG_MODE_CTRL
	.comm	_RPR0521_MODE_MEAS_TIME_MASK,4,2 ; @RPR0521_MODE_MEAS_TIME_MASK
	.comm	_RPR0521_DEFAULT_MEAS_TIME,4,2  ; @RPR0521_DEFAULT_MEAS_TIME
l_.str.2:                               ; @.str.2
	.asciz	"regmap_update_bits returned %d\n"

	.comm	_RPR0521_MODE_ALS_ENABLE,4,2    ; @RPR0521_MODE_ALS_ENABLE
	.comm	_RPR0521_MODE_PXS_ENABLE,4,2    ; @RPR0521_MODE_PXS_ENABLE
	.no_dead_strip	_rpr0521_init
.subsections_via_symbols
