	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sis5595_transaction
_sis5595_transaction:                   ## @sis5595_transaction
	.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	%rdi, %r14
	movq	_SMB_STS_LO@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	callq	_sis5595_read
	movl	%eax, %r15d
	movq	_SMB_STS_HI@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	callq	_sis5595_read
	movl	%eax, %ebx
	shll	$8, %ebx
	addl	%r15d, %ebx
	je	LBB0_4
## %bb.1:
	leaq	L_.str(%rip), %rsi
	xorl	%r15d, %r15d
	movq	%r14, %rdi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_dev_dbg
	movl	(%r13), %edi
	movzbl	%bl, %esi
	callq	_sis5595_write
	movl	(%r12), %edi
	sarl	$8, %ebx
	movl	%ebx, %esi
	callq	_sis5595_write
	movl	(%r13), %edi
	callq	_sis5595_read
	movl	%eax, %ebx
	movl	(%r12), %edi
	callq	_sis5595_read
	shll	$8, %eax
	addl	%ebx, %eax
	je	LBB0_3
## %bb.2:
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_dbg
	movq	_EBUSY@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	jmp	LBB0_18
LBB0_3:
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_dbg
LBB0_4:
	movq	_SMB_CTL_LO@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	%ebx, %edi
	callq	_sis5595_read
	orl	$16, %eax
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_sis5595_write
	xorl	%ebx, %ebx
	movq	_MAX_TIMEOUT@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	$1, %edi
	callq	_msleep
	movl	(%r13), %edi
	callq	_sis5595_read
	movl	%eax, %r12d
	testb	$64, %r12b
	jne	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	leal	1(%rbx), %ecx
	movl	(%r15), %eax
	cmpl	%eax, %ebx
	movl	%ecx, %ebx
	jl	LBB0_5
	jmp	LBB0_8
LBB0_6:
	movl	(%r15), %eax
	movl	%ebx, %ecx
LBB0_8:
	xorl	%r15d, %r15d
	cmpl	%eax, %ecx
	jg	LBB0_9
## %bb.10:
	testb	$16, %r12b
	jne	LBB0_11
LBB0_12:
	testb	$32, %r12b
	je	LBB0_14
LBB0_13:
	leaq	L_.str.5(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_err
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_14:
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movl	(%r13), %edi
	callq	_sis5595_read
	movl	%eax, %r12d
	movq	_SMB_STS_HI@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	callq	_sis5595_read
	movl	%eax, %ebx
	shll	$8, %ebx
	addl	%r12d, %ebx
	je	LBB0_16
## %bb.15:
	movl	(%r13), %edi
	movzbl	%bl, %esi
	callq	_sis5595_write
	movl	(%r14), %edi
	sarl	$8, %ebx
	movl	%ebx, %esi
	callq	_sis5595_write
LBB0_16:
	movl	(%r13), %edi
	callq	_sis5595_read
	movl	%eax, %ebx
	movl	(%r14), %edi
	callq	_sis5595_read
	shll	$8, %eax
	addl	%ebx, %eax
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	je	LBB0_18
## %bb.17:
	leaq	L_.str.6(%rip), %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_dbg
LBB0_18:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	leaq	L_.str.3(%rip), %rsi
	xorl	%r15d, %r15d
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_dbg
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	testb	$16, %r12b
	je	LBB0_12
LBB0_11:
	leaq	L_.str.4(%rip), %rsi
	xorl	%r15d, %r15d
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_dbg
	movq	_ENXIO@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	testb	$32, %r12b
	jne	LBB0_13
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_SMB_STS_LO,4,2                 ## @SMB_STS_LO
	.comm	_SMB_STS_HI,4,2                 ## @SMB_STS_HI
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"SMBus busy (%04x). Resetting...\n"

L_.str.1:                               ## @.str.1
	.asciz	"Failed! (%02x)\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
L_.str.2:                               ## @.str.2
	.asciz	"Successful!\n"

	.comm	_SMB_CTL_LO,4,2                 ## @SMB_CTL_LO
	.comm	_MAX_TIMEOUT,4,2                ## @MAX_TIMEOUT
L_.str.3:                               ## @.str.3
	.asciz	"SMBus Timeout!\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
L_.str.4:                               ## @.str.4
	.asciz	"Error: Failed bus transaction\n"

	.comm	_ENXIO,4,2                      ## @ENXIO
L_.str.5:                               ## @.str.5
	.asciz	"Bus collision! SMBus may be locked until next hard reset (or not...)\n"

	.comm	_EIO,4,2                        ## @EIO
L_.str.6:                               ## @.str.6
	.asciz	"Failed reset at end of transaction (%02x)\n"

	.no_dead_strip	_sis5595_transaction
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sis5595_transaction
_sis5595_transaction:                   ; @sis5595_transaction
	.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	x19, x0
Lloh0:
	adrp	x22, _SMB_STS_LO@GOTPAGE
Lloh1:
	ldr	x22, [x22, _SMB_STS_LO@GOTPAGEOFF]
	ldr	w0, [x22]
	bl	_sis5595_read
	mov	x20, x0
Lloh2:
	adrp	x23, _SMB_STS_HI@GOTPAGE
Lloh3:
	ldr	x23, [x23, _SMB_STS_HI@GOTPAGEOFF]
	ldr	w0, [x23]
	bl	_sis5595_read
	adds	w20, w20, w0, lsl #8
	b.eq	LBB0_4
; %bb.1:
	str	x20, [sp]
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_dbg
	ldr	w0, [x22]
	and	w1, w20, #0xff
	bl	_sis5595_write
	ldr	w0, [x23]
	asr	w1, w20, #8
	bl	_sis5595_write
	ldr	w0, [x22]
	bl	_sis5595_read
	mov	x20, x0
	ldr	w0, [x23]
	bl	_sis5595_read
	adds	w8, w20, w0, lsl #8
	b.eq	LBB0_3
; %bb.2:
	str	x8, [sp]
Lloh6:
	adrp	x1, l_.str.1@PAGE
Lloh7:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_dev_dbg
Lloh8:
	adrp	x8, _EBUSY@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_18
LBB0_3:
Lloh11:
	adrp	x1, l_.str.2@PAGE
Lloh12:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_dev_dbg
LBB0_4:
Lloh13:
	adrp	x8, _SMB_CTL_LO@GOTPAGE
Lloh14:
	ldr	x8, [x8, _SMB_CTL_LO@GOTPAGEOFF]
Lloh15:
	ldr	w20, [x8]
	mov	x0, x20
	bl	_sis5595_read
	orr	w1, w0, #0x10
	mov	x0, x20
	bl	_sis5595_write
	mov	w20, #0
Lloh16:
	adrp	x24, _MAX_TIMEOUT@GOTPAGE
Lloh17:
	ldr	x24, [x24, _MAX_TIMEOUT@GOTPAGEOFF]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	mov	w0, #1
	bl	_msleep
	ldr	w0, [x22]
	bl	_sis5595_read
	mov	x21, x0
	tbnz	w0, #6, LBB0_9
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	add	w9, w20, #1
	ldr	w8, [x24]
	cmp	w20, w8
	mov	x20, x9
	b.lt	LBB0_5
; %bb.7:
	mov	x20, x9
	cmp	w20, w8
	b.gt	LBB0_10
LBB0_8:
	mov	w20, #0
	tbnz	w21, #4, LBB0_11
	b	LBB0_12
LBB0_9:
	ldr	w8, [x24]
	cmp	w20, w8
	b.le	LBB0_8
LBB0_10:
Lloh18:
	adrp	x1, l_.str.3@PAGE
Lloh19:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_dev_dbg
Lloh20:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	neg	w20, w8
	tbz	w21, #4, LBB0_12
LBB0_11:
Lloh23:
	adrp	x1, l_.str.4@PAGE
Lloh24:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x19
	bl	_dev_dbg
Lloh25:
	adrp	x8, _ENXIO@GOTPAGE
Lloh26:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_12:
	tbz	w21, #5, LBB0_14
; %bb.13:
Lloh28:
	adrp	x1, l_.str.5@PAGE
Lloh29:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x19
	bl	_dev_err
Lloh30:
	adrp	x8, _EIO@GOTPAGE
Lloh31:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_14:
	ldr	w0, [x22]
	bl	_sis5595_read
	mov	x21, x0
	ldr	w0, [x23]
	bl	_sis5595_read
	adds	w21, w21, w0, lsl #8
	b.eq	LBB0_16
; %bb.15:
	ldr	w0, [x22]
	and	w1, w21, #0xff
	bl	_sis5595_write
	ldr	w0, [x23]
	asr	w1, w21, #8
	bl	_sis5595_write
LBB0_16:
	ldr	w0, [x22]
	bl	_sis5595_read
	mov	x21, x0
	ldr	w0, [x23]
	bl	_sis5595_read
	adds	w8, w21, w0, lsl #8
	b.eq	LBB0_18
; %bb.17:
	str	x8, [sp]
Lloh33:
	adrp	x1, l_.str.6@PAGE
Lloh34:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	x0, x19
	bl	_dev_dbg
LBB0_18:
	mov	x0, x20
	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 AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_SMB_STS_LO,4,2                 ; @SMB_STS_LO
	.comm	_SMB_STS_HI,4,2                 ; @SMB_STS_HI
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"SMBus busy (%04x). Resetting...\n"

l_.str.1:                               ; @.str.1
	.asciz	"Failed! (%02x)\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
l_.str.2:                               ; @.str.2
	.asciz	"Successful!\n"

	.comm	_SMB_CTL_LO,4,2                 ; @SMB_CTL_LO
	.comm	_MAX_TIMEOUT,4,2                ; @MAX_TIMEOUT
l_.str.3:                               ; @.str.3
	.asciz	"SMBus Timeout!\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
l_.str.4:                               ; @.str.4
	.asciz	"Error: Failed bus transaction\n"

	.comm	_ENXIO,4,2                      ; @ENXIO
l_.str.5:                               ; @.str.5
	.asciz	"Bus collision! SMBus may be locked until next hard reset (or not...)\n"

	.comm	_EIO,4,2                        ; @EIO
l_.str.6:                               ; @.str.6
	.asciz	"Failed reset at end of transaction (%02x)\n"

	.no_dead_strip	_sis5595_transaction
.subsections_via_symbols
