	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bq24190_set_config
_bq24190_set_config:                    ## @bq24190_set_config
	.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, %rbx
	movq	_BQ24190_REG_CTTC@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	leaq	-20(%rbp), %rdx
	callq	_bq24190_read
	testl	%eax, %eax
	js	LBB0_9
## %bb.1:
	movl	-20(%rbp), %eax
	movq	_BQ24190_REG_CTTC_WATCHDOG_MASK@GOTPCREL(%rip), %rdx
	movl	(%rdx), %esi
	andl	%eax, %esi
	movq	_BQ24190_REG_CTTC_WATCHDOG_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %esi
	movl	%esi, (%rbx)
	movl	(%rdx), %edx
	notl	%edx
	andl	%eax, %edx
	movl	%edx, -20(%rbp)
	movl	(%r14), %esi
	movq	%rbx, %rdi
	callq	_bq24190_write
	testl	%eax, %eax
	js	LBB0_9
## %bb.2:
	movl	4(%rbx), %eax
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	cltq
	imulq	$1374389535, %rax, %rax         ## imm = 0x51EB851F
	movq	%rax, %rcx
	sarq	$37, %rcx
	shrq	$63, %rax
	leal	(%rcx,%rax), %r8d
	addl	$-30, %r8d
	movl	%r8d, -20(%rbp)
	movq	_BQ24190_REG_POC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_BQ24190_REG_POC_SYS_MIN_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_BQ24190_REG_POC_SYS_MIN_SHIFT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rbx, %rdi
	callq	_bq24190_write_mask
	testl	%eax, %eax
	js	LBB0_9
LBB0_4:
	movl	8(%rbx), %eax
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	leal	127(%rax), %r8d
	testl	%eax, %eax
	cmovnsl	%eax, %r8d
	sarl	$7, %r8d
	decl	%r8d
	movl	%r8d, -20(%rbp)
	movq	_BQ24190_REG_PCTCC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_BQ24190_REG_PCTCC_IPRECHG_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_BQ24190_REG_PCTCC_IPRECHG_SHIFT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rbx, %rdi
	callq	_bq24190_write_mask
	testl	%eax, %eax
	js	LBB0_9
LBB0_6:
	movl	12(%rbx), %eax
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	leal	127(%rax), %r8d
	testl	%eax, %eax
	cmovnsl	%eax, %r8d
	sarl	$7, %r8d
	decl	%r8d
	movl	%r8d, -20(%rbp)
	movq	_BQ24190_REG_PCTCC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_BQ24190_REG_PCTCC_ITERM_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_BQ24190_REG_PCTCC_ITERM_SHIFT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rbx, %rdi
	callq	_bq24190_write_mask
	testl	%eax, %eax
	js	LBB0_9
LBB0_8:
	xorl	%eax, %eax
LBB0_9:
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BQ24190_REG_CTTC,4,2           ## @BQ24190_REG_CTTC
	.comm	_BQ24190_REG_CTTC_WATCHDOG_MASK,4,2 ## @BQ24190_REG_CTTC_WATCHDOG_MASK
	.comm	_BQ24190_REG_CTTC_WATCHDOG_SHIFT,4,2 ## @BQ24190_REG_CTTC_WATCHDOG_SHIFT
	.comm	_BQ24190_REG_POC,4,2            ## @BQ24190_REG_POC
	.comm	_BQ24190_REG_POC_SYS_MIN_MASK,4,2 ## @BQ24190_REG_POC_SYS_MIN_MASK
	.comm	_BQ24190_REG_POC_SYS_MIN_SHIFT,4,2 ## @BQ24190_REG_POC_SYS_MIN_SHIFT
	.comm	_BQ24190_REG_PCTCC,4,2          ## @BQ24190_REG_PCTCC
	.comm	_BQ24190_REG_PCTCC_IPRECHG_MASK,4,2 ## @BQ24190_REG_PCTCC_IPRECHG_MASK
	.comm	_BQ24190_REG_PCTCC_IPRECHG_SHIFT,4,2 ## @BQ24190_REG_PCTCC_IPRECHG_SHIFT
	.comm	_BQ24190_REG_PCTCC_ITERM_MASK,4,2 ## @BQ24190_REG_PCTCC_ITERM_MASK
	.comm	_BQ24190_REG_PCTCC_ITERM_SHIFT,4,2 ## @BQ24190_REG_PCTCC_ITERM_SHIFT
	.no_dead_strip	_bq24190_set_config
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bq24190_set_config
_bq24190_set_config:                    ; @bq24190_set_config
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
Lloh0:
	adrp	x20, _BQ24190_REG_CTTC@GOTPAGE
Lloh1:
	ldr	x20, [x20, _BQ24190_REG_CTTC@GOTPAGEOFF]
	ldr	w1, [x20]
	add	x2, sp, #12
	bl	_bq24190_read
	tbnz	w0, #31, LBB0_9
; %bb.1:
Lloh2:
	adrp	x8, _BQ24190_REG_CTTC_WATCHDOG_MASK@GOTPAGE
Lloh3:
	ldr	x8, [x8, _BQ24190_REG_CTTC_WATCHDOG_MASK@GOTPAGEOFF]
	ldr	w9, [sp, #12]
	ldr	w10, [x8]
	and	w10, w10, w9
Lloh4:
	adrp	x11, _BQ24190_REG_CTTC_WATCHDOG_SHIFT@GOTPAGE
Lloh5:
	ldr	x11, [x11, _BQ24190_REG_CTTC_WATCHDOG_SHIFT@GOTPAGEOFF]
Lloh6:
	ldr	w11, [x11]
	asr	w10, w10, w11
	str	w10, [x19]
	ldr	w8, [x8]
	bic	w2, w9, w8
	str	w2, [sp, #12]
	ldr	w1, [x20]
	mov	x0, x19
	bl	_bq24190_write
	tbnz	w0, #31, LBB0_9
; %bb.2:
	ldr	w8, [x19, #4]
	cbz	w8, LBB0_4
; %bb.3:
	mov	w9, #34079
	movk	w9, #20971, lsl #16
	smull	x8, w8, w9
	lsr	x9, x8, #63
	asr	x8, x8, #37
	add	w8, w8, w9
	sub	w4, w8, #30
	str	w4, [sp, #12]
Lloh7:
	adrp	x8, _BQ24190_REG_POC@GOTPAGE
Lloh8:
	ldr	x8, [x8, _BQ24190_REG_POC@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
Lloh10:
	adrp	x8, _BQ24190_REG_POC_SYS_MIN_MASK@GOTPAGE
Lloh11:
	ldr	x8, [x8, _BQ24190_REG_POC_SYS_MIN_MASK@GOTPAGEOFF]
Lloh12:
	ldr	w2, [x8]
Lloh13:
	adrp	x8, _BQ24190_REG_POC_SYS_MIN_SHIFT@GOTPAGE
Lloh14:
	ldr	x8, [x8, _BQ24190_REG_POC_SYS_MIN_SHIFT@GOTPAGEOFF]
Lloh15:
	ldr	w3, [x8]
	mov	x0, x19
	bl	_bq24190_write_mask
	tbnz	w0, #31, LBB0_9
LBB0_4:
	ldr	w8, [x19, #8]
Lloh16:
	adrp	x20, _BQ24190_REG_PCTCC@GOTPAGE
Lloh17:
	ldr	x20, [x20, _BQ24190_REG_PCTCC@GOTPAGEOFF]
	cbz	w8, LBB0_6
; %bb.5:
	add	w9, w8, #127
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w8, w8, #7
	sub	w4, w8, #1
	str	w4, [sp, #12]
	ldr	w1, [x20]
Lloh18:
	adrp	x8, _BQ24190_REG_PCTCC_IPRECHG_MASK@GOTPAGE
Lloh19:
	ldr	x8, [x8, _BQ24190_REG_PCTCC_IPRECHG_MASK@GOTPAGEOFF]
Lloh20:
	ldr	w2, [x8]
Lloh21:
	adrp	x8, _BQ24190_REG_PCTCC_IPRECHG_SHIFT@GOTPAGE
Lloh22:
	ldr	x8, [x8, _BQ24190_REG_PCTCC_IPRECHG_SHIFT@GOTPAGEOFF]
Lloh23:
	ldr	w3, [x8]
	mov	x0, x19
	bl	_bq24190_write_mask
	tbnz	w0, #31, LBB0_9
LBB0_6:
	ldr	w8, [x19, #12]
	cbz	w8, LBB0_8
; %bb.7:
	add	w9, w8, #127
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w8, w8, #7
	sub	w4, w8, #1
	str	w4, [sp, #12]
	ldr	w1, [x20]
Lloh24:
	adrp	x8, _BQ24190_REG_PCTCC_ITERM_MASK@GOTPAGE
Lloh25:
	ldr	x8, [x8, _BQ24190_REG_PCTCC_ITERM_MASK@GOTPAGEOFF]
Lloh26:
	ldr	w2, [x8]
Lloh27:
	adrp	x8, _BQ24190_REG_PCTCC_ITERM_SHIFT@GOTPAGE
Lloh28:
	ldr	x8, [x8, _BQ24190_REG_PCTCC_ITERM_SHIFT@GOTPAGEOFF]
Lloh29:
	ldr	w3, [x8]
	mov	x0, x19
	bl	_bq24190_write_mask
	tbnz	w0, #31, LBB0_9
LBB0_8:
	mov	w0, #0
LBB0_9:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_BQ24190_REG_CTTC,4,2           ; @BQ24190_REG_CTTC
	.comm	_BQ24190_REG_CTTC_WATCHDOG_MASK,4,2 ; @BQ24190_REG_CTTC_WATCHDOG_MASK
	.comm	_BQ24190_REG_CTTC_WATCHDOG_SHIFT,4,2 ; @BQ24190_REG_CTTC_WATCHDOG_SHIFT
	.comm	_BQ24190_REG_POC,4,2            ; @BQ24190_REG_POC
	.comm	_BQ24190_REG_POC_SYS_MIN_MASK,4,2 ; @BQ24190_REG_POC_SYS_MIN_MASK
	.comm	_BQ24190_REG_POC_SYS_MIN_SHIFT,4,2 ; @BQ24190_REG_POC_SYS_MIN_SHIFT
	.comm	_BQ24190_REG_PCTCC,4,2          ; @BQ24190_REG_PCTCC
	.comm	_BQ24190_REG_PCTCC_IPRECHG_MASK,4,2 ; @BQ24190_REG_PCTCC_IPRECHG_MASK
	.comm	_BQ24190_REG_PCTCC_IPRECHG_SHIFT,4,2 ; @BQ24190_REG_PCTCC_IPRECHG_SHIFT
	.comm	_BQ24190_REG_PCTCC_ITERM_MASK,4,2 ; @BQ24190_REG_PCTCC_ITERM_MASK
	.comm	_BQ24190_REG_PCTCC_ITERM_SHIFT,4,2 ; @BQ24190_REG_PCTCC_ITERM_SHIFT
	.no_dead_strip	_bq24190_set_config
.subsections_via_symbols
