	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bq2415x_detect_chip
_bq2415x_detect_chip:                   ## @bq2415x_detect_chip
	.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
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	movl	4(%rdi), %edi
	callq	_to_i2c_client
	movq	%rax, %rbx
	movq	_BQ2415X_PART_NUMBER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_bq2415x_exec_command
	testl	%eax, %eax
	js	LBB0_21
## %bb.1:
	movl	(%rbx), %ecx
	cmpl	$106, %ecx
	je	LBB0_13
## %bb.2:
	cmpl	$107, %ecx
	jne	LBB0_19
## %bb.3:
	cmpl	$2, %eax
	je	LBB0_11
## %bb.4:
	cmpl	$1, %eax
	je	LBB0_8
## %bb.5:
	testl	%eax, %eax
	jne	LBB0_19
## %bb.6:
	movl	(%r14), %eax
	movq	_BQ24151A@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_21
## %bb.7:
	movq	_BQ24151@GOTPCREL(%rip), %rax
	jmp	LBB0_20
LBB0_13:
	cmpl	$2, %eax
	je	LBB0_17
## %bb.14:
	testl	%eax, %eax
	jne	LBB0_19
## %bb.15:
	movl	(%r14), %eax
	movq	_BQ24156A@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_21
## %bb.16:
	movq	_BQ24156@GOTPCREL(%rip), %rax
	jmp	LBB0_20
LBB0_19:
	movq	_BQUNKNOWN@GOTPCREL(%rip), %rax
LBB0_20:
	movl	(%rax), %eax
LBB0_21:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_17:
	movl	(%r14), %eax
	movq	_BQ24157S@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_21
## %bb.18:
	movq	_BQ24158@GOTPCREL(%rip), %rax
	jmp	LBB0_20
LBB0_11:
	movl	(%r14), %eax
	movq	_BQ24153A@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_21
## %bb.12:
	movq	_BQ24153@GOTPCREL(%rip), %rax
	jmp	LBB0_20
LBB0_8:
	movl	(%r14), %ecx
	movq	_BQ24150A@GOTPCREL(%rip), %rdx
	movq	_BQ24152@GOTPCREL(%rip), %rsi
	movq	_BQ24155@GOTPCREL(%rip), %rdi
	movl	%ecx, %eax
	cmpl	(%rdi), %ecx
	je	LBB0_10
## %bb.9:
	movq	_BQ24150@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_10:
	cmpl	(%rsi), %ecx
	cmovel	%ecx, %eax
	cmpl	(%rdx), %ecx
	cmovel	%ecx, %eax
	jmp	LBB0_21
	.cfi_endproc
                                        ## -- End function
	.comm	_BQ2415X_PART_NUMBER,4,2        ## @BQ2415X_PART_NUMBER
	.comm	_BQ24151A,4,2                   ## @BQ24151A
	.comm	_BQ24151,4,2                    ## @BQ24151
	.comm	_BQ24150A,4,2                   ## @BQ24150A
	.comm	_BQ24152,4,2                    ## @BQ24152
	.comm	_BQ24155,4,2                    ## @BQ24155
	.comm	_BQ24150,4,2                    ## @BQ24150
	.comm	_BQ24153A,4,2                   ## @BQ24153A
	.comm	_BQ24153,4,2                    ## @BQ24153
	.comm	_BQUNKNOWN,4,2                  ## @BQUNKNOWN
	.comm	_BQ24156A,4,2                   ## @BQ24156A
	.comm	_BQ24156,4,2                    ## @BQ24156
	.comm	_BQ24157S,4,2                   ## @BQ24157S
	.comm	_BQ24158,4,2                    ## @BQ24158
	.no_dead_strip	_bq2415x_detect_chip
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bq2415x_detect_chip
_bq2415x_detect_chip:                   ; @bq2415x_detect_chip
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.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, #4]
	bl	_to_i2c_client
	mov	x20, x0
Lloh0:
	adrp	x8, _BQ2415X_PART_NUMBER@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BQ2415X_PART_NUMBER@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_bq2415x_exec_command
	tbnz	w0, #31, LBB0_14
; %bb.1:
	ldr	w8, [x20]
	cmp	w8, #106
	b.eq	LBB0_7
; %bb.2:
	cmp	w8, #107
	b.ne	LBB0_10
; %bb.3:
	cmp	w0, #2
	b.eq	LBB0_12
; %bb.4:
	cmp	w0, #1
	b.eq	LBB0_15
; %bb.5:
	cbnz	w0, LBB0_10
; %bb.6:
	ldr	w8, [x19]
Lloh3:
	adrp	x9, _BQ24151A@GOTPAGE
Lloh4:
	ldr	x9, [x9, _BQ24151A@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
Lloh6:
	adrp	x10, _BQ24151@GOTPAGE
Lloh7:
	ldr	x10, [x10, _BQ24151@GOTPAGEOFF]
	b	LBB0_13
LBB0_7:
	cmp	w0, #2
	b.eq	LBB0_11
; %bb.8:
	cbnz	w0, LBB0_10
; %bb.9:
	ldr	w8, [x19]
Lloh8:
	adrp	x9, _BQ24156A@GOTPAGE
Lloh9:
	ldr	x9, [x9, _BQ24156A@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
Lloh11:
	adrp	x10, _BQ24156@GOTPAGE
Lloh12:
	ldr	x10, [x10, _BQ24156@GOTPAGEOFF]
	b	LBB0_13
LBB0_10:
Lloh13:
	adrp	x8, _BQUNKNOWN@GOTPAGE
Lloh14:
	ldr	x8, [x8, _BQUNKNOWN@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
	b	LBB0_14
LBB0_11:
	ldr	w8, [x19]
Lloh16:
	adrp	x9, _BQ24157S@GOTPAGE
Lloh17:
	ldr	x9, [x9, _BQ24157S@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
Lloh19:
	adrp	x10, _BQ24158@GOTPAGE
Lloh20:
	ldr	x10, [x10, _BQ24158@GOTPAGEOFF]
	b	LBB0_13
LBB0_12:
	ldr	w8, [x19]
Lloh21:
	adrp	x9, _BQ24153A@GOTPAGE
Lloh22:
	ldr	x9, [x9, _BQ24153A@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
Lloh24:
	adrp	x10, _BQ24153@GOTPAGE
Lloh25:
	ldr	x10, [x10, _BQ24153@GOTPAGEOFF]
LBB0_13:
	ldr	w10, [x10]
	cmp	w8, w9
	csel	w0, w8, w10, eq
LBB0_14:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_15:
	ldr	w8, [x19]
Lloh26:
	adrp	x9, _BQ24150A@GOTPAGE
Lloh27:
	ldr	x9, [x9, _BQ24150A@GOTPAGEOFF]
Lloh28:
	adrp	x10, _BQ24152@GOTPAGE
Lloh29:
	ldr	x10, [x10, _BQ24152@GOTPAGEOFF]
Lloh30:
	ldr	w9, [x9]
Lloh31:
	ldr	w10, [x10]
Lloh32:
	adrp	x11, _BQ24155@GOTPAGE
Lloh33:
	ldr	x11, [x11, _BQ24155@GOTPAGEOFF]
Lloh34:
	ldr	w11, [x11]
	cmp	w8, w11
	ccmp	w8, w10, #4, ne
	ccmp	w8, w9, #4, ne
Lloh35:
	adrp	x9, _BQ24150@GOTPAGE
Lloh36:
	ldr	x9, [x9, _BQ24150@GOTPAGEOFF]
Lloh37:
	ldr	w9, [x9]
	csel	w0, w8, w9, eq
	b	LBB0_14
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_BQ2415X_PART_NUMBER,4,2        ; @BQ2415X_PART_NUMBER
	.comm	_BQ24151A,4,2                   ; @BQ24151A
	.comm	_BQ24151,4,2                    ; @BQ24151
	.comm	_BQ24150A,4,2                   ; @BQ24150A
	.comm	_BQ24152,4,2                    ; @BQ24152
	.comm	_BQ24155,4,2                    ; @BQ24155
	.comm	_BQ24150,4,2                    ; @BQ24150
	.comm	_BQ24153A,4,2                   ; @BQ24153A
	.comm	_BQ24153,4,2                    ; @BQ24153
	.comm	_BQUNKNOWN,4,2                  ; @BQUNKNOWN
	.comm	_BQ24156A,4,2                   ; @BQ24156A
	.comm	_BQ24156,4,2                    ; @BQ24156
	.comm	_BQ24157S,4,2                   ; @BQ24157S
	.comm	_BQ24158,4,2                    ; @BQ24158
	.no_dead_strip	_bq2415x_detect_chip
.subsections_via_symbols
