	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pmbus_init_common
_pmbus_init_common:                     ## @pmbus_init_common
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movq	%rsi, %r12
	movq	%rdi, %r13
	leaq	4(%rdi), %r14
	movq	_pmbus_read_status_word@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%rsi)
	movq	_PMBUS_STATUS_WORD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_i2c_smbus_read_word_data
	testl	%eax, %eax
	js	LBB0_2
## %bb.1:
	cmpl	$65535, %eax                    ## imm = 0xFFFF
	je	LBB0_2
## %bb.6:
	movl	$1, (%r12)
	jmp	LBB0_7
LBB0_2:
	movq	_pmbus_read_status_byte@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%r12)
	movq	_PMBUS_STATUS_BYTE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_i2c_smbus_read_byte_data
	testl	%eax, %eax
	js	LBB0_4
## %bb.3:
	cmpl	$255, %eax
	je	LBB0_4
LBB0_7:
	movq	_PMBUS_CAPABILITY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_i2c_smbus_read_byte_data
	testl	%eax, %eax
	js	LBB0_10
## %bb.8:
	movq	_PB_CAPABILITY_ERROR_CHECK@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_10
## %bb.9:
	movq	_I2C_CLIENT_PEC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%r13)
LBB0_10:
	movq	8(%r12), %rax
	cmpq	$0, (%rax)
	je	LBB0_12
## %bb.11:
	movq	%r13, %rdi
	callq	_pmbus_clear_faults
	jmp	LBB0_13
LBB0_12:
	movq	%r13, %rdi
	movl	$-1, %esi
	callq	_pmbus_clear_fault_page
LBB0_13:
	movq	(%r15), %rax
	testq	%rax, %rax
	je	LBB0_16
## %bb.14:
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	*%rax
	testl	%eax, %eax
	js	LBB0_15
LBB0_16:
	movl	8(%r15), %edx
	testl	%edx, %edx
	jle	LBB0_22
## %bb.17:
	movq	_PMBUS_PAGES@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edx
	jg	LBB0_22
## %bb.18:
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_19:                                ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	movq	%r12, %rsi
	movl	%r14d, %edx
	callq	_pmbus_identify_common
	testl	%eax, %eax
	js	LBB0_20
## %bb.23:                              ##   in Loop: Header=BB0_19 Depth=1
	incl	%r14d
	cmpl	8(%r15), %r14d
	jl	LBB0_19
## %bb.24:
	xorl	%ebx, %ebx
	jmp	LBB0_25
LBB0_22:
	leaq	L_.str.2(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_5
LBB0_4:
	leaq	L_.str(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_err
LBB0_5:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_25
LBB0_15:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	jmp	LBB0_21
LBB0_20:
	movl	%eax, %ebx
	leaq	L_.str.3(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
LBB0_21:
	xorl	%eax, %eax
	callq	_dev_err
LBB0_25:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_pmbus_read_status_word,4,2     ## @pmbus_read_status_word
	.comm	_PMBUS_STATUS_WORD,4,2          ## @PMBUS_STATUS_WORD
	.comm	_pmbus_read_status_byte,4,2     ## @pmbus_read_status_byte
	.comm	_PMBUS_STATUS_BYTE,4,2          ## @PMBUS_STATUS_BYTE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"PMBus status register not found\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_PMBUS_CAPABILITY,4,2           ## @PMBUS_CAPABILITY
	.comm	_PB_CAPABILITY_ERROR_CHECK,4,2  ## @PB_CAPABILITY_ERROR_CHECK
	.comm	_I2C_CLIENT_PEC,4,2             ## @I2C_CLIENT_PEC
L_.str.1:                               ## @.str.1
	.asciz	"Chip identification failed\n"

	.comm	_PMBUS_PAGES,4,2                ## @PMBUS_PAGES
L_.str.2:                               ## @.str.2
	.asciz	"Bad number of PMBus pages: %d\n"

L_.str.3:                               ## @.str.3
	.asciz	"Failed to identify chip capabilities\n"

	.no_dead_strip	_pmbus_init_common
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pmbus_init_common
_pmbus_init_common:                     ; @pmbus_init_common
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x2
	mov	x21, x1
	mov	x22, x0
Lloh0:
	adrp	x8, _pmbus_read_status_word@GOTPAGE
Lloh1:
	ldr	x8, [x8, _pmbus_read_status_word@GOTPAGEOFF]
	add	x19, x0, #4
Lloh2:
	ldr	w8, [x8]
	str	w8, [x1, #16]
Lloh3:
	adrp	x8, _PMBUS_STATUS_WORD@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PMBUS_STATUS_WORD@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_i2c_smbus_read_word_data
	tbnz	w0, #31, LBB0_3
; %bb.1:
	mov	w8, #65535
	cmp	w0, w8
	b.eq	LBB0_3
; %bb.2:
	mov	w8, #1
	str	w8, [x21]
	b	LBB0_5
LBB0_3:
Lloh6:
	adrp	x8, _pmbus_read_status_byte@GOTPAGE
Lloh7:
	ldr	x8, [x8, _pmbus_read_status_byte@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	str	w8, [x21, #16]
Lloh9:
	adrp	x8, _PMBUS_STATUS_BYTE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _PMBUS_STATUS_BYTE@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x22
	bl	_i2c_smbus_read_byte_data
	tbnz	w0, #31, LBB0_19
; %bb.4:
	cmp	w0, #255
	b.eq	LBB0_19
LBB0_5:
Lloh12:
	adrp	x8, _PMBUS_CAPABILITY@GOTPAGE
Lloh13:
	ldr	x8, [x8, _PMBUS_CAPABILITY@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x22
	bl	_i2c_smbus_read_byte_data
	tbnz	w0, #31, LBB0_8
; %bb.6:
Lloh15:
	adrp	x8, _PB_CAPABILITY_ERROR_CHECK@GOTPAGE
Lloh16:
	ldr	x8, [x8, _PB_CAPABILITY_ERROR_CHECK@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_8
; %bb.7:
Lloh18:
	adrp	x8, _I2C_CLIENT_PEC@GOTPAGE
Lloh19:
	ldr	x8, [x8, _I2C_CLIENT_PEC@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	ldr	w9, [x22]
	orr	w8, w9, w8
	str	w8, [x22]
LBB0_8:
	ldr	x8, [x21, #8]
	ldr	x8, [x8]
	cbz	x8, LBB0_10
; %bb.9:
	mov	x0, x22
	bl	_pmbus_clear_faults
	ldr	x8, [x20]
	cbnz	x8, LBB0_11
	b	LBB0_12
LBB0_10:
	mov	x0, x22
	mov	w1, #-1
	bl	_pmbus_clear_fault_page
	ldr	x8, [x20]
	cbz	x8, LBB0_12
LBB0_11:
	mov	x0, x22
	mov	x1, x20
	blr	x8
	tbnz	w0, #31, LBB0_21
LBB0_12:
	ldr	w8, [x20, #8]
	cmp	w8, #1
	b.lt	LBB0_18
; %bb.13:
Lloh21:
	adrp	x9, _PMBUS_PAGES@GOTPAGE
Lloh22:
	ldr	x9, [x9, _PMBUS_PAGES@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	cmp	w8, w9
	b.gt	LBB0_18
; %bb.14:
	mov	w24, #0
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	mov	x1, x21
	mov	x2, x24
	bl	_pmbus_identify_common
	tbnz	w0, #31, LBB0_22
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
	add	w24, w24, #1
	ldr	w8, [x20, #8]
	cmp	w24, w8
	b.lt	LBB0_15
; %bb.17:
	mov	w23, #0
	b	LBB0_24
LBB0_18:
	str	x8, [sp]
Lloh24:
	adrp	x1, l_.str.2@PAGE
Lloh25:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_20
LBB0_19:
Lloh26:
	adrp	x1, l_.str@PAGE
Lloh27:
	add	x1, x1, l_.str@PAGEOFF
LBB0_20:
	mov	x0, x19
	bl	_dev_err
Lloh28:
	adrp	x8, _ENODEV@GOTPAGE
Lloh29:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_24
LBB0_21:
	mov	x23, x0
Lloh31:
	adrp	x1, l_.str.1@PAGE
Lloh32:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_23
LBB0_22:
	mov	x23, x0
Lloh33:
	adrp	x1, l_.str.3@PAGE
Lloh34:
	add	x1, x1, l_.str.3@PAGEOFF
LBB0_23:
	mov	x0, x19
	bl	_dev_err
LBB0_24:
	mov	x0, x23
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpAdd	Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_pmbus_read_status_word,4,2     ; @pmbus_read_status_word
	.comm	_PMBUS_STATUS_WORD,4,2          ; @PMBUS_STATUS_WORD
	.comm	_pmbus_read_status_byte,4,2     ; @pmbus_read_status_byte
	.comm	_PMBUS_STATUS_BYTE,4,2          ; @PMBUS_STATUS_BYTE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"PMBus status register not found\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_PMBUS_CAPABILITY,4,2           ; @PMBUS_CAPABILITY
	.comm	_PB_CAPABILITY_ERROR_CHECK,4,2  ; @PB_CAPABILITY_ERROR_CHECK
	.comm	_I2C_CLIENT_PEC,4,2             ; @I2C_CLIENT_PEC
l_.str.1:                               ; @.str.1
	.asciz	"Chip identification failed\n"

	.comm	_PMBUS_PAGES,4,2                ; @PMBUS_PAGES
l_.str.2:                               ; @.str.2
	.asciz	"Bad number of PMBus pages: %d\n"

l_.str.3:                               ; @.str.3
	.asciz	"Failed to identify chip capabilities\n"

	.no_dead_strip	_pmbus_init_common
.subsections_via_symbols
