	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function i801_block_transaction
_i801_block_transaction:                ## @i801_block_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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, -48(%rbp)                 ## 4-byte Spill
	movl	%ecx, %r12d
	movl	%edx, %r13d
	movq	%rdi, %r15
	movq	_I2C_SMBUS_I2C_BLOCK_DATA@GOTPCREL(%rip), %rbx
	movl	(%rbx), %eax
	cmpl	%ecx, %eax
	jne	LBB0_3
## %bb.1:
	movq	_I2C_SMBUS_WRITE@GOTPCREL(%rip), %rax
	cmpb	%r13b, (%rax)
	jne	LBB0_9
## %bb.2:
	movq	8(%r15), %rdi
	movq	_SMBHSTCFG@GOTPCREL(%rip), %rbx
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movl	(%rbx), %esi
	leaq	-41(%rbp), %rdx
	callq	_pci_read_config_byte
	movq	8(%r15), %rdi
	movl	(%rbx), %esi
	movq	_I2C_SMBUS_I2C_BLOCK_DATA@GOTPCREL(%rip), %rbx
	movq	_SMBHSTCFG_I2C_EN@GOTPCREL(%rip), %rax
	movb	(%rax), %al
	orb	-41(%rbp), %al
	movzbl	%al, %edx
	callq	_pci_write_config_byte
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movl	(%rbx), %eax
LBB0_3:
	movq	_I2C_SMBUS_WRITE@GOTPCREL(%rip), %rcx
	cmpb	%r13b, (%rcx)
	je	LBB0_5
## %bb.4:
	cmpl	%r12d, %eax
	je	LBB0_5
## %bb.11:
	movq	(%rsi), %rax
	movl	$32, (%rax)
	jmp	LBB0_12
LBB0_9:
	movq	_FEATURE_I2C_BLOCK_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r15)
	je	LBB0_10
LBB0_5:
	movq	(%rsi), %rax
	movl	(%rax), %ecx
	testl	%ecx, %ecx
	jg	LBB0_7
## %bb.6:
	movl	$1, (%rax)
	movq	(%rsi), %rax
	movl	(%rax), %ecx
LBB0_7:
	movq	_I2C_SMBUS_BLOCK_MAX@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	cmpl	%edx, %ecx
	jle	LBB0_12
## %bb.8:
	movl	%edx, (%rax)
LBB0_12:
	movq	_FEATURE_BLOCK_BUFFER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r15)
	movl	%r13d, -52(%rbp)                ## 4-byte Spill
	je	LBB0_16
## %bb.13:
	cmpl	%r12d, (%rbx)
	je	LBB0_16
## %bb.14:
	movq	%r15, %rdi
	movq	%rsi, %r14
	callq	_i801_set_block_buffer_mode
	movq	%r14, %rsi
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	testq	%rax, %rax
	je	LBB0_15
LBB0_16:
	movl	%r13d, %eax
	movq	%rbx, %r13
	movsbl	%al, %edx
	movq	%r15, %rdi
	movl	%r12d, %ecx
	movl	-48(%rbp), %r8d                 ## 4-byte Reload
	callq	_i801_block_transaction_byte_by_byte
LBB0_17:
	movl	-48(%rbp), %r14d                ## 4-byte Reload
	movl	%eax, %ebx
	testl	%r14d, %r14d
	je	LBB0_20
## %bb.18:
	testl	%ebx, %ebx
	jne	LBB0_20
## %bb.19:
	movq	%r15, %rdi
	callq	_i801_wait_hwpec
LBB0_20:
	cmpl	%r12d, (%r13)
	jne	LBB0_23
## %bb.21:
	movq	_I2C_SMBUS_WRITE@GOTPCREL(%rip), %rax
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
	cmpb	%cl, (%rax)
	jne	LBB0_23
## %bb.22:
	movq	8(%r15), %rdi
	movq	_SMBHSTCFG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movzbl	-41(%rbp), %edx
	callq	_pci_write_config_byte
LBB0_23:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	movl	%r13d, %eax
	movq	%rbx, %r13
	movsbl	%al, %edx
	movq	%r15, %rdi
	callq	_i801_block_transaction_by_block
	jmp	LBB0_17
LBB0_10:
	movq	8(%r15), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_23
	.cfi_endproc
                                        ## -- End function
	.comm	_I2C_SMBUS_I2C_BLOCK_DATA,4,2   ## @I2C_SMBUS_I2C_BLOCK_DATA
	.comm	_I2C_SMBUS_WRITE,1,0            ## @I2C_SMBUS_WRITE
	.comm	_SMBHSTCFG,4,2                  ## @SMBHSTCFG
	.comm	_SMBHSTCFG_I2C_EN,1,0           ## @SMBHSTCFG_I2C_EN
	.comm	_FEATURE_I2C_BLOCK_READ,4,2     ## @FEATURE_I2C_BLOCK_READ
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"I2C block read is unsupported!\n"

	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
	.comm	_I2C_SMBUS_BLOCK_MAX,4,2        ## @I2C_SMBUS_BLOCK_MAX
	.comm	_FEATURE_BLOCK_BUFFER,4,2       ## @FEATURE_BLOCK_BUFFER
	.no_dead_strip	_i801_block_transaction
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function i801_block_transaction
_i801_block_transaction:                ; @i801_block_transaction
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.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
	mov	x22, x4
	mov	x21, x3
	mov	x20, x2
	mov	x23, x1
	mov	x19, x0
Lloh0:
	adrp	x24, _I2C_SMBUS_I2C_BLOCK_DATA@GOTPAGE
Lloh1:
	ldr	x24, [x24, _I2C_SMBUS_I2C_BLOCK_DATA@GOTPAGEOFF]
	ldr	w8, [x24]
Lloh2:
	adrp	x25, _I2C_SMBUS_WRITE@GOTPAGE
Lloh3:
	ldr	x25, [x25, _I2C_SMBUS_WRITE@GOTPAGEOFF]
	cmp	w8, w3
	b.ne	LBB0_3
; %bb.1:
	ldrb	w8, [x25]
	cmp	w8, w20, uxtb
	b.ne	LBB0_5
; %bb.2:
	ldr	x0, [x19, #8]
Lloh4:
	adrp	x26, _SMBHSTCFG@GOTPAGE
Lloh5:
	ldr	x26, [x26, _SMBHSTCFG@GOTPAGEOFF]
	ldr	w1, [x26]
	add	x2, sp, #15
	bl	_pci_read_config_byte
	ldr	x0, [x19, #8]
	ldr	w1, [x26]
	ldrb	w8, [sp, #15]
Lloh6:
	adrp	x9, _SMBHSTCFG_I2C_EN@GOTPAGE
Lloh7:
	ldr	x9, [x9, _SMBHSTCFG_I2C_EN@GOTPAGEOFF]
	ldrb	w9, [x9]
	orr	w2, w9, w8
	bl	_pci_write_config_byte
	ldr	w8, [x24]
LBB0_3:
	ldrb	w9, [x25]
	cmp	w9, w20, uxtb
	ccmp	w8, w21, #4, ne
	b.eq	LBB0_6
; %bb.4:
	ldr	x8, [x23]
	mov	w9, #32
	str	w9, [x8]
	b	LBB0_10
LBB0_5:
	ldr	w8, [x19]
Lloh8:
	adrp	x9, _FEATURE_I2C_BLOCK_READ@GOTPAGE
Lloh9:
	ldr	x9, [x9, _FEATURE_I2C_BLOCK_READ@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_20
LBB0_6:
	ldr	x8, [x23]
	ldr	w9, [x8]
	cmp	w9, #0
	b.gt	LBB0_8
; %bb.7:
	mov	w9, #1
	str	w9, [x8]
	ldr	x8, [x23]
	ldr	w9, [x8]
LBB0_8:
Lloh11:
	adrp	x10, _I2C_SMBUS_BLOCK_MAX@GOTPAGE
Lloh12:
	ldr	x10, [x10, _I2C_SMBUS_BLOCK_MAX@GOTPAGEOFF]
Lloh13:
	ldr	w10, [x10]
	cmp	w9, w10
	b.le	LBB0_10
; %bb.9:
	str	w10, [x8]
LBB0_10:
Lloh14:
	adrp	x8, _FEATURE_BLOCK_BUFFER@GOTPAGE
Lloh15:
	ldr	x8, [x8, _FEATURE_BLOCK_BUFFER@GOTPAGEOFF]
	ldr	w9, [x19]
Lloh16:
	ldr	w8, [x8]
	and	w8, w8, w9
	ldr	w9, [x24]
	cmp	w8, #0
	ccmp	w9, w21, #4, ne
	b.eq	LBB0_12
; %bb.11:
	mov	x0, x19
	bl	_i801_set_block_buffer_mode
	cbz	x0, LBB0_19
LBB0_12:
	mov	x0, x19
	mov	x1, x23
	mov	x2, x20
	mov	x3, x21
	mov	x4, x22
	bl	_i801_block_transaction_byte_by_byte
	mov	x23, x0
	cbz	w22, LBB0_15
LBB0_13:
	cbnz	w23, LBB0_15
; %bb.14:
	mov	x0, x19
	bl	_i801_wait_hwpec
LBB0_15:
	ldr	w8, [x24]
	cmp	w8, w21
	b.ne	LBB0_18
; %bb.16:
	ldrb	w8, [x25]
	cmp	w8, w20, uxtb
	b.ne	LBB0_18
; %bb.17:
	ldr	x0, [x19, #8]
Lloh17:
	adrp	x8, _SMBHSTCFG@GOTPAGE
Lloh18:
	ldr	x8, [x8, _SMBHSTCFG@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	ldrb	w2, [sp, #15]
	bl	_pci_write_config_byte
LBB0_18:
	mov	x0, x23
	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
	add	sp, sp, #96
	ret
LBB0_19:
	mov	x0, x19
	mov	x1, x23
	mov	x2, x20
	mov	x3, x22
	bl	_i801_block_transaction_by_block
	mov	x23, x0
	cbnz	w22, LBB0_13
	b	LBB0_15
LBB0_20:
	ldr	x0, [x19, #8]
Lloh20:
	adrp	x1, l_.str@PAGE
Lloh21:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh22:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh23:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_18
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_I2C_SMBUS_I2C_BLOCK_DATA,4,2   ; @I2C_SMBUS_I2C_BLOCK_DATA
	.comm	_I2C_SMBUS_WRITE,1,0            ; @I2C_SMBUS_WRITE
	.comm	_SMBHSTCFG,4,2                  ; @SMBHSTCFG
	.comm	_SMBHSTCFG_I2C_EN,1,0           ; @SMBHSTCFG_I2C_EN
	.comm	_FEATURE_I2C_BLOCK_READ,4,2     ; @FEATURE_I2C_BLOCK_READ
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"I2C block read is unsupported!\n"

	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
	.comm	_I2C_SMBUS_BLOCK_MAX,4,2        ; @I2C_SMBUS_BLOCK_MAX
	.comm	_FEATURE_BLOCK_BUFFER,4,2       ; @FEATURE_BLOCK_BUFFER
	.no_dead_strip	_i801_block_transaction
.subsections_via_symbols
