	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function smb347_hw_init
_smb347_hw_init:                        ## @smb347_hw_init
	.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	$1, %esi
	callq	_smb347_set_writable
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movq	%r14, %rdi
	callq	_smb347_set_charge_current
	testl	%eax, %eax
	js	LBB0_21
## %bb.3:
	movq	%r14, %rdi
	callq	_smb347_set_current_limits
	testl	%eax, %eax
	js	LBB0_21
## %bb.4:
	movq	%r14, %rdi
	callq	_smb347_set_voltage_limits
	testl	%eax, %eax
	js	LBB0_21
## %bb.5:
	movq	%r14, %rdi
	callq	_smb347_set_temp_limits
	testl	%eax, %eax
	js	LBB0_21
## %bb.6:
	movq	8(%r14), %rax
	cmpl	$0, 16(%rax)
	jne	LBB0_9
## %bb.7:
	movl	(%r14), %edi
	movq	_CMD_A@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_CMD_A_SUSPEND_ENABLED@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%ecx, %edx
	callq	_regmap_update_bits
	testl	%eax, %eax
	js	LBB0_21
## %bb.8:
	movq	8(%r14), %rax
LBB0_9:
	movl	(%r14), %edi
	movq	_CFG_OTHER@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	_CFG_OTHER_RID_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	xorl	%ecx, %ecx
	cmpq	$0, 8(%rax)
	je	LBB0_11
## %bb.10:
	movq	_CFG_OTHER_RID_ENABLED_AUTO_OTG@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
LBB0_11:
	callq	_regmap_update_bits
	testl	%eax, %eax
	js	LBB0_21
## %bb.12:
	movq	8(%r14), %rax
	movl	(%rax), %eax
	cmpl	$129, %eax
	je	LBB0_15
## %bb.13:
	xorl	%ecx, %ecx
	cmpl	$128, %eax
	jne	LBB0_17
## %bb.14:
	movq	_CFG_PIN_EN_CTRL_ACTIVE_LOW@GOTPCREL(%rip), %rax
	jmp	LBB0_16
LBB0_1:
	movl	%eax, %ebx
	jmp	LBB0_22
LBB0_15:
	movq	_CFG_PIN_EN_CTRL_ACTIVE_HIGH@GOTPCREL(%rip), %rax
LBB0_16:
	movl	(%rax), %ecx
LBB0_17:
	movl	(%r14), %edi
	movq	_CFG_PIN@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	_CFG_PIN_EN_CTRL_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_regmap_update_bits
	testl	%eax, %eax
	js	LBB0_21
## %bb.18:
	movl	(%r14), %edi
	movl	(%r15), %esi
	movq	_CFG_PIN_EN_APSD_IRQ@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%ecx, %ecx
	callq	_regmap_update_bits
	testl	%eax, %eax
	js	LBB0_21
## %bb.19:
	movq	%r14, %rdi
	callq	_smb347_update_ps_status
	testl	%eax, %eax
	js	LBB0_21
## %bb.20:
	movq	%r14, %rdi
	callq	_smb347_start_stop_charging
LBB0_21:
	movl	%eax, %ebx
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_smb347_set_writable
LBB0_22:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CMD_A,4,2                      ## @CMD_A
	.comm	_CMD_A_SUSPEND_ENABLED,4,2      ## @CMD_A_SUSPEND_ENABLED
	.comm	_CFG_OTHER,4,2                  ## @CFG_OTHER
	.comm	_CFG_OTHER_RID_MASK,4,2         ## @CFG_OTHER_RID_MASK
	.comm	_CFG_OTHER_RID_ENABLED_AUTO_OTG,4,2 ## @CFG_OTHER_RID_ENABLED_AUTO_OTG
	.comm	_CFG_PIN_EN_CTRL_ACTIVE_LOW,4,2 ## @CFG_PIN_EN_CTRL_ACTIVE_LOW
	.comm	_CFG_PIN_EN_CTRL_ACTIVE_HIGH,4,2 ## @CFG_PIN_EN_CTRL_ACTIVE_HIGH
	.comm	_CFG_PIN,4,2                    ## @CFG_PIN
	.comm	_CFG_PIN_EN_CTRL_MASK,4,2       ## @CFG_PIN_EN_CTRL_MASK
	.comm	_CFG_PIN_EN_APSD_IRQ,4,2        ## @CFG_PIN_EN_APSD_IRQ
	.no_dead_strip	_smb347_hw_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function smb347_hw_init
_smb347_hw_init:                        ; @smb347_hw_init
	.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, x0
	mov	w1, #1
	bl	_smb347_set_writable
	tbnz	w0, #31, LBB0_12
; %bb.1:
	mov	x0, x19
	bl	_smb347_set_charge_current
	tbnz	w0, #31, LBB0_20
; %bb.2:
	mov	x0, x19
	bl	_smb347_set_current_limits
	tbnz	w0, #31, LBB0_20
; %bb.3:
	mov	x0, x19
	bl	_smb347_set_voltage_limits
	tbnz	w0, #31, LBB0_20
; %bb.4:
	mov	x0, x19
	bl	_smb347_set_temp_limits
	tbnz	w0, #31, LBB0_20
; %bb.5:
	ldr	x8, [x19, #8]
	ldr	w9, [x8, #16]
	cbnz	w9, LBB0_8
; %bb.6:
	ldr	w0, [x19]
Lloh0:
	adrp	x8, _CMD_A@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CMD_A@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x8, _CMD_A_SUSPEND_ENABLED@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CMD_A_SUSPEND_ENABLED@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	x3, x2
	bl	_regmap_update_bits
	tbnz	w0, #31, LBB0_20
; %bb.7:
	ldr	x8, [x19, #8]
LBB0_8:
	ldr	w0, [x19]
Lloh6:
	adrp	x9, _CFG_OTHER@GOTPAGE
Lloh7:
	ldr	x9, [x9, _CFG_OTHER@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x9]
Lloh9:
	adrp	x9, _CFG_OTHER_RID_MASK@GOTPAGE
Lloh10:
	ldr	x9, [x9, _CFG_OTHER_RID_MASK@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x9]
	ldr	x8, [x8, #8]
Lloh12:
	adrp	x9, _CFG_OTHER_RID_ENABLED_AUTO_OTG@GOTPAGE
Lloh13:
	ldr	x9, [x9, _CFG_OTHER_RID_ENABLED_AUTO_OTG@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	cmp	x8, #0
	csel	w3, wzr, w9, eq
	bl	_regmap_update_bits
	tbnz	w0, #31, LBB0_20
; %bb.9:
	ldr	x8, [x19, #8]
	ldr	w8, [x8]
	cmp	w8, #129
	b.eq	LBB0_13
; %bb.10:
	cmp	w8, #128
	b.ne	LBB0_15
; %bb.11:
Lloh15:
	adrp	x8, _CFG_PIN_EN_CTRL_ACTIVE_LOW@GOTPAGE
Lloh16:
	ldr	x8, [x8, _CFG_PIN_EN_CTRL_ACTIVE_LOW@GOTPAGEOFF]
	b	LBB0_14
LBB0_12:
	mov	x20, x0
	b	LBB0_21
LBB0_13:
Lloh17:
	adrp	x8, _CFG_PIN_EN_CTRL_ACTIVE_HIGH@GOTPAGE
Lloh18:
	ldr	x8, [x8, _CFG_PIN_EN_CTRL_ACTIVE_HIGH@GOTPAGEOFF]
LBB0_14:
	ldr	w3, [x8]
	b	LBB0_16
LBB0_15:
	mov	w3, #0
LBB0_16:
	ldr	w0, [x19]
Lloh19:
	adrp	x21, _CFG_PIN@GOTPAGE
Lloh20:
	ldr	x21, [x21, _CFG_PIN@GOTPAGEOFF]
	ldr	w1, [x21]
Lloh21:
	adrp	x8, _CFG_PIN_EN_CTRL_MASK@GOTPAGE
Lloh22:
	ldr	x8, [x8, _CFG_PIN_EN_CTRL_MASK@GOTPAGEOFF]
Lloh23:
	ldr	w2, [x8]
	bl	_regmap_update_bits
	tbnz	w0, #31, LBB0_20
; %bb.17:
	ldr	w0, [x19]
	ldr	w1, [x21]
Lloh24:
	adrp	x8, _CFG_PIN_EN_APSD_IRQ@GOTPAGE
Lloh25:
	ldr	x8, [x8, _CFG_PIN_EN_APSD_IRQ@GOTPAGEOFF]
Lloh26:
	ldr	w2, [x8]
	mov	w3, #0
	bl	_regmap_update_bits
	tbnz	w0, #31, LBB0_20
; %bb.18:
	mov	x0, x19
	bl	_smb347_update_ps_status
	tbnz	w0, #31, LBB0_20
; %bb.19:
	mov	x0, x19
	bl	_smb347_start_stop_charging
LBB0_20:
	mov	x20, x0
	mov	x0, x19
	mov	w1, #0
	bl	_smb347_set_writable
LBB0_21:
	mov	x0, x20
	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 AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_CMD_A,4,2                      ; @CMD_A
	.comm	_CMD_A_SUSPEND_ENABLED,4,2      ; @CMD_A_SUSPEND_ENABLED
	.comm	_CFG_OTHER,4,2                  ; @CFG_OTHER
	.comm	_CFG_OTHER_RID_MASK,4,2         ; @CFG_OTHER_RID_MASK
	.comm	_CFG_OTHER_RID_ENABLED_AUTO_OTG,4,2 ; @CFG_OTHER_RID_ENABLED_AUTO_OTG
	.comm	_CFG_PIN_EN_CTRL_ACTIVE_LOW,4,2 ; @CFG_PIN_EN_CTRL_ACTIVE_LOW
	.comm	_CFG_PIN_EN_CTRL_ACTIVE_HIGH,4,2 ; @CFG_PIN_EN_CTRL_ACTIVE_HIGH
	.comm	_CFG_PIN,4,2                    ; @CFG_PIN
	.comm	_CFG_PIN_EN_CTRL_MASK,4,2       ; @CFG_PIN_EN_CTRL_MASK
	.comm	_CFG_PIN_EN_APSD_IRQ,4,2        ; @CFG_PIN_EN_APSD_IRQ
	.no_dead_strip	_smb347_hw_init
.subsections_via_symbols
