	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function p2wi_smbus_xfer
_p2wi_smbus_xfer:                       ## @p2wi_smbus_xfer
	.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
	movl	%r8d, %ebx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movq	%rsi, %r14
	movq	%rdi, %r15
	callq	_i2c_get_adapdata
	movq	%rax, %r13
	movl	$1, %edi
	callq	_P2WI_DLEN_DATA_LENGTH
	movq	%rax, %r12
	movq	(%r13), %rax
	testq	%rax, %rax
	js	LBB0_3
## %bb.1:
	cmpq	%r14, %rax
	je	LBB0_3
## %bb.2:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_err
	jmp	LBB0_4
LBB0_3:
	movq	16(%rbp), %r14
	testq	%r14, %r14
	je	LBB0_4
## %bb.6:
	movq	_P2WI_DADDR0@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	16(%r13), %rsi
	movl	%ebx, %edi
	callq	_writel
	movq	_I2C_SMBUS_READ@GOTPCREL(%rip), %rcx
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	cmpb	%al, (%rcx)
	jne	LBB0_8
## %bb.7:
	movq	_P2WI_DLEN_READ@GOTPCREL(%rip), %rax
	orq	(%rax), %r12
	jmp	LBB0_9
LBB0_4:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_8:
	movl	(%r14), %edi
	movq	_P2WI_DATA0@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	16(%r13), %rsi
	callq	_writel
LBB0_9:
	movq	_P2WI_DLEN@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	16(%r13), %rsi
	movl	%r12d, %edi
	callq	_writel
	movq	_P2WI_CTRL@GOTPCREL(%rip), %r12
	movq	(%r12), %rdi
	addq	16(%r13), %rdi
	callq	_readl
	movq	_P2WI_CTRL_START_TRANS@GOTPCREL(%rip), %r14
	testl	%eax, (%r14)
	jne	LBB0_10
## %bb.11:
	movq	%r13, %rbx
	addq	$24, %rbx
	movq	%rbx, %rdi
	callq	_reinit_completion
	movq	_P2WI_INTS_LOAD_BSY@GOTPCREL(%rip), %rcx
	movq	_P2WI_INTS_TRANS_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	orl	(%rcx), %edi
	movq	_P2WI_INTS_TRANS_OVER@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
	movq	_P2WI_INTE@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	16(%r13), %rsi
	callq	_writel
	movq	_P2WI_CTRL_GLOBAL_INT_ENB@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	orl	(%r14), %edi
	movq	(%r12), %rsi
	addq	16(%r13), %rsi
	callq	_writel
	movq	%rbx, %rdi
	callq	_wait_for_completion
	movl	8(%r13), %eax
	movq	_P2WI_INTS_LOAD_BSY@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_12
LBB0_10:
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_err
	movq	_EBUSY@GOTPCREL(%rip), %rax
LBB0_5:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_16:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movq	_P2WI_INTS_TRANS_ERR@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_14
## %bb.13:
	leaq	L_.str.2(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_err
	movq	_ENXIO@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_14:
	xorl	%ebx, %ebx
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movq	_I2C_SMBUS_READ@GOTPCREL(%rip), %rcx
	cmpb	%al, (%rcx)
	jne	LBB0_16
## %bb.15:
	movq	_P2WI_DATA0@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	16(%r13), %rdi
	callq	_readl
	movq	16(%rbp), %rcx
	movl	%eax, (%rcx)
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"invalid P2WI address\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_P2WI_DADDR0,8,3                ## @P2WI_DADDR0
	.comm	_I2C_SMBUS_READ,1,0             ## @I2C_SMBUS_READ
	.comm	_P2WI_DLEN_READ,8,3             ## @P2WI_DLEN_READ
	.comm	_P2WI_DATA0,8,3                 ## @P2WI_DATA0
	.comm	_P2WI_DLEN,8,3                  ## @P2WI_DLEN
	.comm	_P2WI_CTRL,8,3                  ## @P2WI_CTRL
	.comm	_P2WI_CTRL_START_TRANS,4,2      ## @P2WI_CTRL_START_TRANS
L_.str.1:                               ## @.str.1
	.asciz	"P2WI bus busy\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_P2WI_INTS_LOAD_BSY,4,2         ## @P2WI_INTS_LOAD_BSY
	.comm	_P2WI_INTS_TRANS_ERR,4,2        ## @P2WI_INTS_TRANS_ERR
	.comm	_P2WI_INTS_TRANS_OVER,4,2       ## @P2WI_INTS_TRANS_OVER
	.comm	_P2WI_INTE,8,3                  ## @P2WI_INTE
	.comm	_P2WI_CTRL_GLOBAL_INT_ENB,4,2   ## @P2WI_CTRL_GLOBAL_INT_ENB
L_.str.2:                               ## @.str.2
	.asciz	"P2WI bus xfer error\n"

	.comm	_ENXIO,4,2                      ## @ENXIO
	.no_dead_strip	_p2wi_smbus_xfer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function p2wi_smbus_xfer
_p2wi_smbus_xfer:                       ; @p2wi_smbus_xfer
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x6
	mov	x23, x4
	mov	x24, x3
	mov	x25, x1
	mov	x20, x0
	bl	_i2c_get_adapdata
	mov	x21, x0
	mov	w0, #1
	bl	_P2WI_DLEN_DATA_LENGTH
	mov	x22, x0
	ldr	x8, [x21]
	tbnz	x8, #63, LBB0_3
; %bb.1:
	cmp	x8, x25
	b.eq	LBB0_3
; %bb.2:
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_dev_err
	b	LBB0_6
LBB0_3:
	cbz	x19, LBB0_6
; %bb.4:
	and	w24, w24, #0xff
	ldr	x8, [x21, #16]
Lloh2:
	adrp	x9, _P2WI_DADDR0@GOTPAGE
Lloh3:
	ldr	x9, [x9, _P2WI_DADDR0@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	x0, x23
	bl	_writel
Lloh5:
	adrp	x23, _I2C_SMBUS_READ@GOTPAGE
Lloh6:
	ldr	x23, [x23, _I2C_SMBUS_READ@GOTPAGEOFF]
	ldrb	w8, [x23]
	cmp	w8, w24
	b.ne	LBB0_7
; %bb.5:
Lloh7:
	adrp	x8, _P2WI_DLEN_READ@GOTPAGE
Lloh8:
	ldr	x8, [x8, _P2WI_DLEN_READ@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
	orr	x22, x8, x22
	b	LBB0_8
LBB0_6:
Lloh10:
	adrp	x8, _EINVAL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_11
LBB0_7:
	ldr	w0, [x19]
	ldr	x8, [x21, #16]
Lloh12:
	adrp	x9, _P2WI_DATA0@GOTPAGE
Lloh13:
	ldr	x9, [x9, _P2WI_DATA0@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
LBB0_8:
	ldr	x8, [x21, #16]
Lloh15:
	adrp	x9, _P2WI_DLEN@GOTPAGE
Lloh16:
	ldr	x9, [x9, _P2WI_DLEN@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	x0, x22
	bl	_writel
	ldr	x8, [x21, #16]
Lloh18:
	adrp	x25, _P2WI_CTRL@GOTPAGE
Lloh19:
	ldr	x25, [x25, _P2WI_CTRL@GOTPAGEOFF]
	ldr	x9, [x25]
	add	x0, x9, x8
	bl	_readl
Lloh20:
	adrp	x27, _P2WI_CTRL_START_TRANS@GOTPAGE
Lloh21:
	ldr	x27, [x27, _P2WI_CTRL_START_TRANS@GOTPAGEOFF]
	ldr	w8, [x27]
	tst	w8, w0
	b.ne	LBB0_10
; %bb.9:
	add	x22, x21, #24
	mov	x0, x22
	bl	_reinit_completion
Lloh22:
	adrp	x28, _P2WI_INTS_LOAD_BSY@GOTPAGE
Lloh23:
	ldr	x28, [x28, _P2WI_INTS_LOAD_BSY@GOTPAGEOFF]
Lloh24:
	adrp	x26, _P2WI_INTS_TRANS_ERR@GOTPAGE
Lloh25:
	ldr	x26, [x26, _P2WI_INTS_TRANS_ERR@GOTPAGEOFF]
	ldr	w8, [x28]
	ldr	w9, [x26]
	orr	w8, w9, w8
Lloh26:
	adrp	x9, _P2WI_INTS_TRANS_OVER@GOTPAGE
Lloh27:
	ldr	x9, [x9, _P2WI_INTS_TRANS_OVER@GOTPAGEOFF]
Lloh28:
	ldr	w9, [x9]
	orr	w0, w8, w9
	ldr	x8, [x21, #16]
Lloh29:
	adrp	x9, _P2WI_INTE@GOTPAGE
Lloh30:
	ldr	x9, [x9, _P2WI_INTE@GOTPAGEOFF]
Lloh31:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
Lloh32:
	adrp	x8, _P2WI_CTRL_GLOBAL_INT_ENB@GOTPAGE
Lloh33:
	ldr	x8, [x8, _P2WI_CTRL_GLOBAL_INT_ENB@GOTPAGEOFF]
	ldr	w9, [x27]
Lloh34:
	ldr	w8, [x8]
	orr	w0, w8, w9
	ldr	x8, [x21, #16]
	ldr	x9, [x25]
	add	x1, x9, x8
	bl	_writel
	mov	x0, x22
	bl	_wait_for_completion
	ldr	w8, [x21, #8]
	ldr	w9, [x28]
	tst	w9, w8
	b.eq	LBB0_13
LBB0_10:
Lloh35:
	adrp	x1, l_.str.1@PAGE
Lloh36:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_dev_err
Lloh37:
	adrp	x8, _EBUSY@GOTPAGE
Lloh38:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
LBB0_11:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_12:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_13:
	ldr	w9, [x26]
	tst	w9, w8
	b.eq	LBB0_15
; %bb.14:
Lloh39:
	adrp	x1, l_.str.2@PAGE
Lloh40:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x20
	bl	_dev_err
Lloh41:
	adrp	x8, _ENXIO@GOTPAGE
Lloh42:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
	b	LBB0_11
LBB0_15:
	ldrb	w8, [x23]
	cmp	w8, w24
	b.ne	LBB0_17
; %bb.16:
	ldr	x8, [x21, #16]
Lloh43:
	adrp	x9, _P2WI_DATA0@GOTPAGE
Lloh44:
	ldr	x9, [x9, _P2WI_DATA0@GOTPAGEOFF]
Lloh45:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readl
	mov	x8, x0
	mov	w0, #0
	str	w8, [x19]
	b	LBB0_12
LBB0_17:
	mov	w0, #0
	b	LBB0_12
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh37, Lloh38
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpLdrGot	Lloh41, Lloh42
	.loh AdrpAdd	Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"invalid P2WI address\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_P2WI_DADDR0,8,3                ; @P2WI_DADDR0
	.comm	_I2C_SMBUS_READ,1,0             ; @I2C_SMBUS_READ
	.comm	_P2WI_DLEN_READ,8,3             ; @P2WI_DLEN_READ
	.comm	_P2WI_DATA0,8,3                 ; @P2WI_DATA0
	.comm	_P2WI_DLEN,8,3                  ; @P2WI_DLEN
	.comm	_P2WI_CTRL,8,3                  ; @P2WI_CTRL
	.comm	_P2WI_CTRL_START_TRANS,4,2      ; @P2WI_CTRL_START_TRANS
l_.str.1:                               ; @.str.1
	.asciz	"P2WI bus busy\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_P2WI_INTS_LOAD_BSY,4,2         ; @P2WI_INTS_LOAD_BSY
	.comm	_P2WI_INTS_TRANS_ERR,4,2        ; @P2WI_INTS_TRANS_ERR
	.comm	_P2WI_INTS_TRANS_OVER,4,2       ; @P2WI_INTS_TRANS_OVER
	.comm	_P2WI_INTE,8,3                  ; @P2WI_INTE
	.comm	_P2WI_CTRL_GLOBAL_INT_ENB,4,2   ; @P2WI_CTRL_GLOBAL_INT_ENB
l_.str.2:                               ; @.str.2
	.asciz	"P2WI bus xfer error\n"

	.comm	_ENXIO,4,2                      ; @ENXIO
	.no_dead_strip	_p2wi_smbus_xfer
.subsections_via_symbols
