	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bq2415x_sysfs_set_mode
_bq2415x_sysfs_set_mode:                ## @bq2415x_sysfs_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r14
	movq	%rdx, %rbx
	callq	_dev_get_drvdata
	movq	%rax, %rdi
	callq	_power_supply_get_drvdata
	movq	%rax, %r15
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	movl	$4, %edx
	callq	_strncmp
	testq	%rax, %rax
	je	LBB0_8
## %bb.1:
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	movl	$3, %edx
	callq	_strncmp
	testq	%rax, %rax
	je	LBB0_10
## %bb.2:
	leaq	L_.str.2(%rip), %rsi
	movq	%rbx, %rdi
	movl	$4, %edx
	callq	_strncmp
	testq	%rax, %rax
	je	LBB0_13
## %bb.3:
	leaq	L_.str.3(%rip), %rsi
	movq	%rbx, %rdi
	movl	$4, %edx
	callq	_strncmp
	testq	%rax, %rax
	je	LBB0_15
## %bb.4:
	leaq	L_.str.4(%rip), %rsi
	movq	%rbx, %rdi
	movl	$9, %edx
	callq	_strncmp
	testq	%rax, %rax
	je	LBB0_17
## %bb.5:
	leaq	L_.str.5(%rip), %rsi
	movq	%rbx, %rdi
	movl	$5, %edx
	callq	_strncmp
	testq	%rax, %rax
	je	LBB0_19
## %bb.6:
	leaq	L_.str.6(%rip), %rsi
	movq	%rbx, %rdi
	movl	$5, %edx
	callq	_strncmp
	testq	%rax, %rax
	jne	LBB0_12
## %bb.7:
	movq	%r15, %rdi
	callq	_bq2415x_reset_chip
	movq	%r15, %rdi
	callq	_bq2415x_set_defaults
	cmpl	$0, (%r15)
	jg	LBB0_9
	jmp	LBB0_22
LBB0_8:
	cmpl	$0, (%r15)
	js	LBB0_12
LBB0_9:
	movl	$1, (%r15)
	movq	%r15, %rax
	addq	$4, %rax
	jmp	LBB0_21
LBB0_10:
	movq	_BQ2415X_MODE_OFF@GOTPCREL(%rip), %rax
	cmpl	$0, (%r15)
	jle	LBB0_21
LBB0_20:
	movl	$0, (%r15)
LBB0_21:
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_bq2415x_set_mode
	testl	%eax, %eax
	cltq
	cmovsq	%rax, %r14
LBB0_22:
	movq	%r14, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subq	(%rax), %r14
	jmp	LBB0_22
LBB0_13:
	movq	_BQ2415X_MODE_NONE@GOTPCREL(%rip), %rax
	cmpl	$0, (%r15)
	jg	LBB0_20
	jmp	LBB0_21
LBB0_15:
	movq	_BQ2415X_MODE_HOST_CHARGER@GOTPCREL(%rip), %rax
	cmpl	$0, (%r15)
	jg	LBB0_20
	jmp	LBB0_21
LBB0_17:
	movq	_BQ2415X_MODE_DEDICATED_CHARGER@GOTPCREL(%rip), %rax
	cmpl	$0, (%r15)
	jg	LBB0_20
	jmp	LBB0_21
LBB0_19:
	movq	_BQ2415X_MODE_BOOST@GOTPCREL(%rip), %rax
	cmpl	$0, (%r15)
	jg	LBB0_20
	jmp	LBB0_21
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"auto"

	.comm	_EINVAL,8,3                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"off"

	.comm	_BQ2415X_MODE_OFF,4,2           ## @BQ2415X_MODE_OFF
L_.str.2:                               ## @.str.2
	.asciz	"none"

	.comm	_BQ2415X_MODE_NONE,4,2          ## @BQ2415X_MODE_NONE
L_.str.3:                               ## @.str.3
	.asciz	"host"

	.comm	_BQ2415X_MODE_HOST_CHARGER,4,2  ## @BQ2415X_MODE_HOST_CHARGER
L_.str.4:                               ## @.str.4
	.asciz	"dedicated"

	.comm	_BQ2415X_MODE_DEDICATED_CHARGER,4,2 ## @BQ2415X_MODE_DEDICATED_CHARGER
L_.str.5:                               ## @.str.5
	.asciz	"boost"

	.comm	_BQ2415X_MODE_BOOST,4,2         ## @BQ2415X_MODE_BOOST
L_.str.6:                               ## @.str.6
	.asciz	"reset"

	.no_dead_strip	_bq2415x_sysfs_set_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bq2415x_sysfs_set_mode
_bq2415x_sysfs_set_mode:                ; @bq2415x_sysfs_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	x19, x3
	mov	x21, x2
	bl	_dev_get_drvdata
	bl	_power_supply_get_drvdata
	mov	x20, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	mov	w2, #4
	bl	_strncmp
	cbz	x0, LBB0_8
; %bb.1:
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	mov	w2, #3
	bl	_strncmp
	cbz	x0, LBB0_10
; %bb.2:
Lloh4:
	adrp	x1, l_.str.2@PAGE
Lloh5:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x21
	mov	w2, #4
	bl	_strncmp
	cbz	x0, LBB0_14
; %bb.3:
Lloh6:
	adrp	x1, l_.str.3@PAGE
Lloh7:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x21
	mov	w2, #4
	bl	_strncmp
	cbz	x0, LBB0_17
; %bb.4:
Lloh8:
	adrp	x1, l_.str.4@PAGE
Lloh9:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x21
	mov	w2, #9
	bl	_strncmp
	cbz	x0, LBB0_20
; %bb.5:
Lloh10:
	adrp	x1, l_.str.5@PAGE
Lloh11:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x21
	mov	w2, #5
	bl	_strncmp
	cbz	x0, LBB0_23
; %bb.6:
Lloh12:
	adrp	x1, l_.str.6@PAGE
Lloh13:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	x0, x21
	mov	w2, #5
	bl	_strncmp
	cbnz	x0, LBB0_13
; %bb.7:
	mov	x0, x20
	bl	_bq2415x_reset_chip
	mov	x0, x20
	bl	_bq2415x_set_defaults
	ldr	w8, [x20]
	cmp	w8, #1
	b.ge	LBB0_9
	b	LBB0_27
LBB0_8:
	ldr	w8, [x20]
	tbnz	w8, #31, LBB0_13
LBB0_9:
	mov	w9, #1
	mov	x8, x20
	str	w9, [x8], #4
	b	LBB0_26
LBB0_10:
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_12
; %bb.11:
	str	wzr, [x20]
LBB0_12:
Lloh14:
	adrp	x8, _BQ2415X_MODE_OFF@GOTPAGE
Lloh15:
	ldr	x8, [x8, _BQ2415X_MODE_OFF@GOTPAGEOFF]
	b	LBB0_26
LBB0_13:
Lloh16:
	adrp	x8, _EINVAL@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh18:
	ldr	x8, [x8]
	neg	x19, x8
	b	LBB0_27
LBB0_14:
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_16
; %bb.15:
	str	wzr, [x20]
LBB0_16:
Lloh19:
	adrp	x8, _BQ2415X_MODE_NONE@GOTPAGE
Lloh20:
	ldr	x8, [x8, _BQ2415X_MODE_NONE@GOTPAGEOFF]
	b	LBB0_26
LBB0_17:
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_19
; %bb.18:
	str	wzr, [x20]
LBB0_19:
Lloh21:
	adrp	x8, _BQ2415X_MODE_HOST_CHARGER@GOTPAGE
Lloh22:
	ldr	x8, [x8, _BQ2415X_MODE_HOST_CHARGER@GOTPAGEOFF]
	b	LBB0_26
LBB0_20:
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_22
; %bb.21:
	str	wzr, [x20]
LBB0_22:
Lloh23:
	adrp	x8, _BQ2415X_MODE_DEDICATED_CHARGER@GOTPAGE
Lloh24:
	ldr	x8, [x8, _BQ2415X_MODE_DEDICATED_CHARGER@GOTPAGEOFF]
	b	LBB0_26
LBB0_23:
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_25
; %bb.24:
	str	wzr, [x20]
LBB0_25:
Lloh25:
	adrp	x8, _BQ2415X_MODE_BOOST@GOTPAGE
Lloh26:
	ldr	x8, [x8, _BQ2415X_MODE_BOOST@GOTPAGEOFF]
LBB0_26:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_bq2415x_set_mode
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x8, w0
	cmp	w0, #0
	csel	x19, x8, x19, lt
LBB0_27:
	mov	x0, x19
	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
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"auto"

	.comm	_EINVAL,8,3                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"off"

	.comm	_BQ2415X_MODE_OFF,4,2           ; @BQ2415X_MODE_OFF
l_.str.2:                               ; @.str.2
	.asciz	"none"

	.comm	_BQ2415X_MODE_NONE,4,2          ; @BQ2415X_MODE_NONE
l_.str.3:                               ; @.str.3
	.asciz	"host"

	.comm	_BQ2415X_MODE_HOST_CHARGER,4,2  ; @BQ2415X_MODE_HOST_CHARGER
l_.str.4:                               ; @.str.4
	.asciz	"dedicated"

	.comm	_BQ2415X_MODE_DEDICATED_CHARGER,4,2 ; @BQ2415X_MODE_DEDICATED_CHARGER
l_.str.5:                               ; @.str.5
	.asciz	"boost"

	.comm	_BQ2415X_MODE_BOOST,4,2         ; @BQ2415X_MODE_BOOST
l_.str.6:                               ; @.str.6
	.asciz	"reset"

	.no_dead_strip	_bq2415x_sysfs_set_mode
.subsections_via_symbols
