	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function opt3001_configure
_opt3001_configure:                     ## @opt3001_configure
	.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, %r14
	movl	20(%rdi), %edi
	movq	_OPT3001_CONFIGURATION@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	callq	_i2c_smbus_read_word_swapped
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_8
## %bb.1:
	movq	_OPT3001_CONFIGURATION_RN_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, %ebx
	movq	_OPT3001_CONFIGURATION_RN_AUTO@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movl	%ebx, -28(%rbp)
	movq	_OPT3001_CONFIGURATION_CT@GOTPCREL(%rip), %rax
	andl	(%rax), %ebx
	jne	LBB0_3
## %bb.2:
	movq	_OPT3001_INT_TIME_SHORT@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_3:
	movq	_OPT3001_INT_TIME_LONG@GOTPCREL(%rip), %rax
LBB0_4:
	movl	(%rax), %eax
	movl	%eax, 40(%r14)
	movq	_OPT3001_CONFIGURATION_M_SHUTDOWN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-28(%rbp), %rsi
	movq	%r14, %rdi
	callq	_opt3001_set_mode
	movq	_OPT3001_CONFIGURATION_L@GOTPCREL(%rip), %rax
	movl	-28(%rbp), %ecx
	orl	(%rax), %ecx
	movq	_OPT3001_CONFIGURATION_POL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_OPT3001_CONFIGURATION_ME@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	_OPT3001_CONFIGURATION_FC_MASK@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	notl	%edx
	andl	%ecx, %edx
	movl	%edx, -28(%rbp)
	movl	20(%r14), %edi
	movl	(%r15), %esi
	callq	_i2c_smbus_write_word_swapped
	testl	%eax, %eax
	js	LBB0_9
## %bb.5:
	movl	20(%r14), %edi
	movq	_OPT3001_LOW_LIMIT@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	callq	_i2c_smbus_read_word_swapped
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_8
## %bb.6:
	movl	%ebx, %edi
	callq	_OPT3001_REG_MANTISSA
	movq	%rax, 32(%r14)
	movl	%ebx, %edi
	callq	_OPT3001_REG_EXPONENT
	movq	%rax, 24(%r14)
	movl	20(%r14), %edi
	movq	_OPT3001_HIGH_LIMIT@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	callq	_i2c_smbus_read_word_swapped
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_8
## %bb.7:
	movl	%ebx, %edi
	callq	_OPT3001_REG_MANTISSA
	movq	%rax, 8(%r14)
	movl	%ebx, %edi
	callq	_OPT3001_REG_EXPONENT
	movq	%rax, (%r14)
	xorl	%ebx, %ebx
	jmp	LBB0_11
LBB0_8:
	movl	16(%r14), %edi
	movl	(%r15), %edx
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_10
LBB0_9:
	movl	%eax, %ebx
	movl	16(%r14), %edi
	movl	(%r15), %edx
	leaq	L_.str.1(%rip), %rsi
LBB0_10:
	callq	_dev_err
LBB0_11:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_OPT3001_CONFIGURATION,4,2      ## @OPT3001_CONFIGURATION
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to read register %02x\n"

	.comm	_OPT3001_CONFIGURATION_RN_MASK,4,2 ## @OPT3001_CONFIGURATION_RN_MASK
	.comm	_OPT3001_CONFIGURATION_RN_AUTO,4,2 ## @OPT3001_CONFIGURATION_RN_AUTO
	.comm	_OPT3001_CONFIGURATION_CT,4,2   ## @OPT3001_CONFIGURATION_CT
	.comm	_OPT3001_INT_TIME_LONG,4,2      ## @OPT3001_INT_TIME_LONG
	.comm	_OPT3001_INT_TIME_SHORT,4,2     ## @OPT3001_INT_TIME_SHORT
	.comm	_OPT3001_CONFIGURATION_M_SHUTDOWN,4,2 ## @OPT3001_CONFIGURATION_M_SHUTDOWN
	.comm	_OPT3001_CONFIGURATION_L,4,2    ## @OPT3001_CONFIGURATION_L
	.comm	_OPT3001_CONFIGURATION_POL,4,2  ## @OPT3001_CONFIGURATION_POL
	.comm	_OPT3001_CONFIGURATION_ME,4,2   ## @OPT3001_CONFIGURATION_ME
	.comm	_OPT3001_CONFIGURATION_FC_MASK,4,2 ## @OPT3001_CONFIGURATION_FC_MASK
L_.str.1:                               ## @.str.1
	.asciz	"failed to write register %02x\n"

	.comm	_OPT3001_LOW_LIMIT,4,2          ## @OPT3001_LOW_LIMIT
	.comm	_OPT3001_HIGH_LIMIT,4,2         ## @OPT3001_HIGH_LIMIT
	.no_dead_strip	_opt3001_configure
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function opt3001_configure
_opt3001_configure:                     ; @opt3001_configure
	.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	x19, x0
	ldr	w0, [x0, #20]
Lloh0:
	adrp	x21, _OPT3001_CONFIGURATION@GOTPAGE
Lloh1:
	ldr	x21, [x21, _OPT3001_CONFIGURATION@GOTPAGEOFF]
	ldr	w1, [x21]
	bl	_i2c_smbus_read_word_swapped
	mov	x20, x0
	tbnz	w0, #31, LBB0_5
; %bb.1:
Lloh2:
	adrp	x8, _OPT3001_CONFIGURATION_RN_MASK@GOTPAGE
Lloh3:
	ldr	x8, [x8, _OPT3001_CONFIGURATION_RN_MASK@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _OPT3001_CONFIGURATION_RN_AUTO@GOTPAGE
Lloh6:
	ldr	x9, [x9, _OPT3001_CONFIGURATION_RN_AUTO@GOTPAGEOFF]
	bic	w8, w20, w8
Lloh7:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	w8, [sp, #12]
Lloh8:
	adrp	x9, _OPT3001_CONFIGURATION_CT@GOTPAGE
Lloh9:
	ldr	x9, [x9, _OPT3001_CONFIGURATION_CT@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
Lloh11:
	adrp	x10, _OPT3001_INT_TIME_SHORT@GOTPAGE
Lloh12:
	ldr	x10, [x10, _OPT3001_INT_TIME_SHORT@GOTPAGEOFF]
Lloh13:
	adrp	x11, _OPT3001_INT_TIME_LONG@GOTPAGE
Lloh14:
	ldr	x11, [x11, _OPT3001_INT_TIME_LONG@GOTPAGEOFF]
	tst	w9, w8
	csel	x8, x10, x11, eq
	ldr	w8, [x8]
	str	w8, [x19, #40]
Lloh15:
	adrp	x8, _OPT3001_CONFIGURATION_M_SHUTDOWN@GOTPAGE
Lloh16:
	ldr	x8, [x8, _OPT3001_CONFIGURATION_M_SHUTDOWN@GOTPAGEOFF]
Lloh17:
	ldr	w2, [x8]
	add	x1, sp, #12
	mov	x0, x19
	bl	_opt3001_set_mode
Lloh18:
	adrp	x8, _OPT3001_CONFIGURATION_L@GOTPAGE
Lloh19:
	ldr	x8, [x8, _OPT3001_CONFIGURATION_L@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	ldr	w9, [sp, #12]
	orr	w8, w9, w8
Lloh21:
	adrp	x9, _OPT3001_CONFIGURATION_POL@GOTPAGE
Lloh22:
	ldr	x9, [x9, _OPT3001_CONFIGURATION_POL@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
Lloh24:
	adrp	x10, _OPT3001_CONFIGURATION_ME@GOTPAGE
Lloh25:
	ldr	x10, [x10, _OPT3001_CONFIGURATION_ME@GOTPAGEOFF]
Lloh26:
	ldr	w10, [x10]
	orr	w9, w9, w10
Lloh27:
	adrp	x10, _OPT3001_CONFIGURATION_FC_MASK@GOTPAGE
Lloh28:
	ldr	x10, [x10, _OPT3001_CONFIGURATION_FC_MASK@GOTPAGEOFF]
Lloh29:
	ldr	w10, [x10]
	orr	w9, w9, w10
	bic	w2, w8, w9
	str	w2, [sp, #12]
	ldr	w0, [x19, #20]
	ldr	w1, [x21]
	bl	_i2c_smbus_write_word_swapped
	tbnz	w0, #31, LBB0_6
; %bb.2:
	ldr	w0, [x19, #20]
Lloh30:
	adrp	x21, _OPT3001_LOW_LIMIT@GOTPAGE
Lloh31:
	ldr	x21, [x21, _OPT3001_LOW_LIMIT@GOTPAGEOFF]
	ldr	w1, [x21]
	bl	_i2c_smbus_read_word_swapped
	mov	x20, x0
	tbnz	w0, #31, LBB0_5
; %bb.3:
	mov	x0, x20
	bl	_OPT3001_REG_MANTISSA
	str	x0, [x19, #32]
	mov	x0, x20
	bl	_OPT3001_REG_EXPONENT
	str	x0, [x19, #24]
	ldr	w0, [x19, #20]
Lloh32:
	adrp	x21, _OPT3001_HIGH_LIMIT@GOTPAGE
Lloh33:
	ldr	x21, [x21, _OPT3001_HIGH_LIMIT@GOTPAGEOFF]
	ldr	w1, [x21]
	bl	_i2c_smbus_read_word_swapped
	mov	x20, x0
	tbnz	w0, #31, LBB0_5
; %bb.4:
	mov	x0, x20
	bl	_OPT3001_REG_MANTISSA
	str	x0, [x19, #8]
	mov	x0, x20
	bl	_OPT3001_REG_EXPONENT
	mov	w20, #0
	str	x0, [x19]
	b	LBB0_8
LBB0_5:
	ldr	w0, [x19, #16]
	ldr	w2, [x21]
Lloh34:
	adrp	x1, l_.str@PAGE
Lloh35:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_7
LBB0_6:
	mov	x20, x0
	ldr	w0, [x19, #16]
	ldr	w2, [x21]
Lloh36:
	adrp	x1, l_.str.1@PAGE
Lloh37:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_7:
	bl	_dev_err
LBB0_8:
	mov	x0, x20
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpAdd	Lloh36, Lloh37
	.cfi_endproc
                                        ; -- End function
	.comm	_OPT3001_CONFIGURATION,4,2      ; @OPT3001_CONFIGURATION
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to read register %02x\n"

	.comm	_OPT3001_CONFIGURATION_RN_MASK,4,2 ; @OPT3001_CONFIGURATION_RN_MASK
	.comm	_OPT3001_CONFIGURATION_RN_AUTO,4,2 ; @OPT3001_CONFIGURATION_RN_AUTO
	.comm	_OPT3001_CONFIGURATION_CT,4,2   ; @OPT3001_CONFIGURATION_CT
	.comm	_OPT3001_INT_TIME_LONG,4,2      ; @OPT3001_INT_TIME_LONG
	.comm	_OPT3001_INT_TIME_SHORT,4,2     ; @OPT3001_INT_TIME_SHORT
	.comm	_OPT3001_CONFIGURATION_M_SHUTDOWN,4,2 ; @OPT3001_CONFIGURATION_M_SHUTDOWN
	.comm	_OPT3001_CONFIGURATION_L,4,2    ; @OPT3001_CONFIGURATION_L
	.comm	_OPT3001_CONFIGURATION_POL,4,2  ; @OPT3001_CONFIGURATION_POL
	.comm	_OPT3001_CONFIGURATION_ME,4,2   ; @OPT3001_CONFIGURATION_ME
	.comm	_OPT3001_CONFIGURATION_FC_MASK,4,2 ; @OPT3001_CONFIGURATION_FC_MASK
l_.str.1:                               ; @.str.1
	.asciz	"failed to write register %02x\n"

	.comm	_OPT3001_LOW_LIMIT,4,2          ; @OPT3001_LOW_LIMIT
	.comm	_OPT3001_HIGH_LIMIT,4,2         ; @OPT3001_HIGH_LIMIT
	.no_dead_strip	_opt3001_configure
.subsections_via_symbols
