	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bq2415x_set_mode
_bq2415x_set_mode:                      ## @bq2415x_set_mode
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %r15
	leal	-128(%r14), %r12d
	xorl	%ebx, %ebx
	testl	$-5, %r12d
	je	LBB0_3
## %bb.1:
	cmpl	$132, %r14d
	jne	LBB0_4
LBB0_2:
	testl	%ebx, %ebx
	jns	LBB0_5
	jmp	LBB0_16
LBB0_3:
	movq	_BQ2415X_CHARGER_DISABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_bq2415x_exec_command
	movl	%eax, %ebx
	cmpl	$132, %r14d
	je	LBB0_2
LBB0_4:
	movq	_BQ2415X_BOOST_MODE_DISABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_bq2415x_exec_command
	movl	%eax, %ebx
	testl	%ebx, %ebx
	js	LBB0_16
LBB0_5:
	cmpl	$4, %r12d
	ja	LBB0_7
## %bb.6:
	movslq	%r12d, %rax
	leaq	l_reltable.bq2415x_set_mode(%rip), %rcx
	movslq	(%rcx,%rax,4), %rsi
	addq	%rcx, %rsi
	leaq	l_switch.table.bq2415x_set_mode.6(%rip), %rcx
	movl	(%rcx,%rax,4), %ebx
	movl	16(%r15), %edi
	callq	_dev_dbg
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_bq2415x_set_current_limit
	testl	%eax, %eax
	js	LBB0_15
LBB0_7:
	cmpl	$132, %r14d
	je	LBB0_9
## %bb.8:
	movl	%r12d, %eax
	andl	$-5, %eax
	je	LBB0_13
LBB0_9:
	testl	$-5, %r12d
	jne	LBB0_11
## %bb.10:
	movq	_BQ2415X_BOOST_MODE_ENABLE@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_11:
	movq	_BQ2415X_CHARGER_ENABLE@GOTPCREL(%rip), %rax
LBB0_12:
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_bq2415x_exec_command
	testl	%eax, %eax
	js	LBB0_15
LBB0_13:
	movq	_weak_battery_voltage@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_bq2415x_set_default_value
	movq	_battery_regulation_voltage@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_bq2415x_set_default_value
	movl	%r14d, (%r15)
	movq	8(%r15), %rdi
	leaq	L_.str.5(%rip), %rdx
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	callq	_sysfs_notify
	jmp	LBB0_16
LBB0_15:
	movl	%eax, %ebx
LBB0_16:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BQ2415X_CHARGER_DISABLE,4,2    ## @BQ2415X_CHARGER_DISABLE
	.comm	_BQ2415X_BOOST_MODE_DISABLE,4,2 ## @BQ2415X_BOOST_MODE_DISABLE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"changing mode to: Offline\n"

L_.str.1:                               ## @.str.1
	.asciz	"changing mode to: N/A\n"

L_.str.2:                               ## @.str.2
	.asciz	"changing mode to: Host/HUB charger\n"

L_.str.3:                               ## @.str.3
	.asciz	"changing mode to: Dedicated charger\n"

L_.str.4:                               ## @.str.4
	.asciz	"changing mode to: Boost\n"

	.comm	_BQ2415X_CHARGER_ENABLE,4,2     ## @BQ2415X_CHARGER_ENABLE
	.comm	_BQ2415X_BOOST_MODE_ENABLE,4,2  ## @BQ2415X_BOOST_MODE_ENABLE
	.comm	_weak_battery_voltage,4,2       ## @weak_battery_voltage
	.comm	_battery_regulation_voltage,4,2 ## @battery_regulation_voltage
L_.str.5:                               ## @.str.5
	.asciz	"mode"

	.no_dead_strip	_bq2415x_set_mode
	.section	__TEXT,__const
	.p2align	2                               ## @reltable.bq2415x_set_mode
l_reltable.bq2415x_set_mode:
	.long	L_.str-l_reltable.bq2415x_set_mode
	.long	L_.str.1-l_reltable.bq2415x_set_mode
	.long	L_.str.2-l_reltable.bq2415x_set_mode
	.long	L_.str.3-l_reltable.bq2415x_set_mode
	.long	L_.str.4-l_reltable.bq2415x_set_mode

	.p2align	2                               ## @switch.table.bq2415x_set_mode.6
l_switch.table.bq2415x_set_mode.6:
	.long	100                             ## 0x64
	.long	100                             ## 0x64
	.long	500                             ## 0x1f4
	.long	1800                            ## 0x708
	.long	100                             ## 0x64

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bq2415x_set_mode
_bq2415x_set_mode:                      ; @bq2415x_set_mode
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x20, x1
	mov	x19, x0
	sub	w21, w1, #128
	ands	w22, w21, #0xfffffffb
	b.eq	LBB0_11
; %bb.1:
	mov	w0, #0
	cmp	w20, #132
	b.eq	LBB0_3
LBB0_2:
Lloh0:
	adrp	x8, _BQ2415X_BOOST_MODE_DISABLE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BQ2415X_BOOST_MODE_DISABLE@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_bq2415x_exec_command
LBB0_3:
	tbnz	w0, #31, LBB0_10
; %bb.4:
	cmp	w21, #4
	b.hi	LBB0_6
; %bb.5:
Lloh3:
	adrp	x8, l_switch.table.bq2415x_set_mode@PAGE
Lloh4:
	add	x8, x8, l_switch.table.bq2415x_set_mode@PAGEOFF
	ldr	x1, [x8, w21, sxtw #3]
Lloh5:
	adrp	x8, l_switch.table.bq2415x_set_mode.6@PAGE
Lloh6:
	add	x8, x8, l_switch.table.bq2415x_set_mode.6@PAGEOFF
	ldr	w21, [x8, w21, sxtw #2]
	ldr	w0, [x19, #16]
	bl	_dev_dbg
	mov	x0, x19
	mov	x1, x21
	bl	_bq2415x_set_current_limit
	tbnz	w0, #31, LBB0_10
LBB0_6:
	cmp	w20, #132
	b.eq	LBB0_8
; %bb.7:
	cbz	w22, LBB0_9
LBB0_8:
Lloh7:
	adrp	x8, _BQ2415X_BOOST_MODE_ENABLE@GOTPAGE
Lloh8:
	ldr	x8, [x8, _BQ2415X_BOOST_MODE_ENABLE@GOTPAGEOFF]
Lloh9:
	adrp	x9, _BQ2415X_CHARGER_ENABLE@GOTPAGE
Lloh10:
	ldr	x9, [x9, _BQ2415X_CHARGER_ENABLE@GOTPAGEOFF]
	cmp	w22, #0
	csel	x8, x8, x9, eq
	ldr	w1, [x8]
	mov	x0, x19
	bl	_bq2415x_exec_command
	tbnz	w0, #31, LBB0_10
LBB0_9:
Lloh11:
	adrp	x8, _weak_battery_voltage@GOTPAGE
Lloh12:
	ldr	x8, [x8, _weak_battery_voltage@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_bq2415x_set_default_value
Lloh14:
	adrp	x8, _battery_regulation_voltage@GOTPAGE
Lloh15:
	ldr	x8, [x8, _battery_regulation_voltage@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_bq2415x_set_default_value
	str	w20, [x19]
	ldr	x0, [x19, #8]
Lloh17:
	adrp	x2, l_.str.5@PAGE
Lloh18:
	add	x2, x2, l_.str.5@PAGEOFF
	mov	x1, #0
	bl	_sysfs_notify
	mov	w0, #0
LBB0_10:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_11:
Lloh19:
	adrp	x8, _BQ2415X_CHARGER_DISABLE@GOTPAGE
Lloh20:
	ldr	x8, [x8, _BQ2415X_CHARGER_DISABLE@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_bq2415x_exec_command
	cmp	w20, #132
	b.ne	LBB0_2
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_BQ2415X_CHARGER_DISABLE,4,2    ; @BQ2415X_CHARGER_DISABLE
	.comm	_BQ2415X_BOOST_MODE_DISABLE,4,2 ; @BQ2415X_BOOST_MODE_DISABLE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"changing mode to: Offline\n"

l_.str.1:                               ; @.str.1
	.asciz	"changing mode to: N/A\n"

l_.str.2:                               ; @.str.2
	.asciz	"changing mode to: Host/HUB charger\n"

l_.str.3:                               ; @.str.3
	.asciz	"changing mode to: Dedicated charger\n"

l_.str.4:                               ; @.str.4
	.asciz	"changing mode to: Boost\n"

	.comm	_BQ2415X_CHARGER_ENABLE,4,2     ; @BQ2415X_CHARGER_ENABLE
	.comm	_BQ2415X_BOOST_MODE_ENABLE,4,2  ; @BQ2415X_BOOST_MODE_ENABLE
	.comm	_weak_battery_voltage,4,2       ; @weak_battery_voltage
	.comm	_battery_regulation_voltage,4,2 ; @battery_regulation_voltage
l_.str.5:                               ; @.str.5
	.asciz	"mode"

	.no_dead_strip	_bq2415x_set_mode
	.section	__DATA,__const
	.p2align	3                               ; @switch.table.bq2415x_set_mode
l_switch.table.bq2415x_set_mode:
	.quad	l_.str
	.quad	l_.str.1
	.quad	l_.str.2
	.quad	l_.str.3
	.quad	l_.str.4

	.section	__TEXT,__const
	.p2align	2                               ; @switch.table.bq2415x_set_mode.6
l_switch.table.bq2415x_set_mode.6:
	.long	100                             ; 0x64
	.long	100                             ; 0x64
	.long	500                             ; 0x1f4
	.long	1800                            ; 0x708
	.long	100                             ; 0x64

.subsections_via_symbols
