	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_i2c_smbus_read_i2c_block_data_or_emulated ## -- Begin function i2c_smbus_read_i2c_block_data_or_emulated
	.p2align	4, 0x90
_i2c_smbus_read_i2c_block_data_or_emulated: ## @i2c_smbus_read_i2c_block_data_or_emulated
	.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	%edx, %r13d
	movq	_I2C_SMBUS_BLOCK_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%edx, %eax
	cmovll	%eax, %r13d
	movq	%rcx, %r12
	movl	%esi, %ebx
	movq	%rdi, %r15
	movl	(%rdi), %edi
	movq	_I2C_FUNC_SMBUS_READ_I2C_BLOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_i2c_check_functionality
	testq	%rax, %rax
	je	LBB0_1
## %bb.16:
	movq	%r15, %rdi
	movl	%ebx, %esi
	movl	%r13d, %edx
	movq	%r12, %rcx
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_i2c_smbus_read_i2c_block_data  ## TAILCALL
LBB0_1:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movl	(%r15), %edi
	movq	_I2C_FUNC_SMBUS_READ_BYTE_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_i2c_check_functionality
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:
	movl	(%r15), %edi
	movq	_I2C_FUNC_SMBUS_READ_WORD_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_i2c_check_functionality
	xorl	%ebx, %ebx
	testq	%rax, %rax
	je	LBB0_9
## %bb.4:
	cmpl	$2, %r13d
	jl	LBB0_9
## %bb.5:
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	leal	(%rax,%r14), %esi
	movq	%r15, %rdi
	callq	_i2c_smbus_read_word_data
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_15
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	leaq	2(%r14), %rax
	movzbl	%bl, %ecx
	movl	%ecx, (%r12,%r14,4)
	shrl	$8, %ebx
	movl	%ebx, 4(%r12,%r14,4)
	leal	2(%rax), %ecx
	movq	%rax, %r14
	cmpl	%ecx, %r13d
	jge	LBB0_6
## %bb.8:
	movl	%eax, %ebx
LBB0_9:
	cmpl	%r13d, %ebx
	jge	LBB0_15
## %bb.10:
	movl	%ebx, %eax
	leaq	(%r12,%rax,4), %r14
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	leal	(%r12,%rbx), %esi
	movq	%r15, %rdi
	callq	_i2c_smbus_read_byte_data
	testl	%eax, %eax
	js	LBB0_12
## %bb.13:                              ##   in Loop: Header=BB0_11 Depth=1
	movl	%eax, (%r14)
	incl	%ebx
	addq	$4, %r14
	cmpl	%ebx, %r13d
	jg	LBB0_11
## %bb.14:
	movl	%r13d, %ebx
	jmp	LBB0_15
LBB0_2:
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_15
LBB0_12:
	movl	%eax, %ebx
LBB0_15:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_I2C_SMBUS_BLOCK_MAX,4,2        ## @I2C_SMBUS_BLOCK_MAX
	.comm	_I2C_FUNC_SMBUS_READ_I2C_BLOCK,4,2 ## @I2C_FUNC_SMBUS_READ_I2C_BLOCK
	.comm	_I2C_FUNC_SMBUS_READ_BYTE_DATA,4,2 ## @I2C_FUNC_SMBUS_READ_BYTE_DATA
	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
	.comm	_I2C_FUNC_SMBUS_READ_WORD_DATA,4,2 ## @I2C_FUNC_SMBUS_READ_WORD_DATA
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_i2c_smbus_read_i2c_block_data_or_emulated ; -- Begin function i2c_smbus_read_i2c_block_data_or_emulated
	.p2align	2
_i2c_smbus_read_i2c_block_data_or_emulated: ; @i2c_smbus_read_i2c_block_data_or_emulated
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x22, x3
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _I2C_SMBUS_BLOCK_MAX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _I2C_SMBUS_BLOCK_MAX@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w2
	csel	w21, w8, w2, lt
	ldr	w0, [x0]
Lloh3:
	adrp	x8, _I2C_FUNC_SMBUS_READ_I2C_BLOCK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _I2C_FUNC_SMBUS_READ_I2C_BLOCK@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_i2c_check_functionality
	cbz	x0, LBB0_2
; %bb.1:
	mov	x0, x20
	mov	x1, x19
	mov	x2, x21
	mov	x3, x22
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_i2c_smbus_read_i2c_block_data
LBB0_2:
	ldr	w0, [x20]
Lloh6:
	adrp	x8, _I2C_FUNC_SMBUS_READ_BYTE_DATA@GOTPAGE
Lloh7:
	ldr	x8, [x8, _I2C_FUNC_SMBUS_READ_BYTE_DATA@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	bl	_i2c_check_functionality
	cbz	x0, LBB0_5
; %bb.3:
	ldr	w0, [x20]
Lloh9:
	adrp	x8, _I2C_FUNC_SMBUS_READ_WORD_DATA@GOTPAGE
Lloh10:
	ldr	x8, [x8, _I2C_FUNC_SMBUS_READ_WORD_DATA@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	bl	_i2c_check_functionality
	cmp	x0, #0
	ccmp	w21, #2, #8, ne
	b.ge	LBB0_6
; %bb.4:
	mov	w23, #0
	cmp	w23, w21
	b.lt	LBB0_10
	b	LBB0_15
LBB0_5:
Lloh12:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_15
LBB0_6:
	mov	x25, #0
	mov	w24, w19
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	add	w1, w24, w25
	mov	x0, x20
	bl	_i2c_smbus_read_word_data
	mov	x23, x0
	tbnz	w0, #31, LBB0_15
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	add	x8, x25, #2
	and	w9, w23, #0xff
	add	x10, x22, x25, lsl #2
	lsr	w11, w23, #8
	stp	w9, w11, [x10]
	add	w9, w8, #2
	mov	x25, x8
	cmp	w21, w9
	b.ge	LBB0_7
; %bb.9:
	mov	x23, x8
	cmp	w23, w21
	b.ge	LBB0_15
LBB0_10:
	add	x22, x22, w23, uxtw #2
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	add	w1, w19, w23
	mov	x0, x20
	bl	_i2c_smbus_read_byte_data
	tbnz	w0, #31, LBB0_14
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	str	w0, [x22], #4
	add	w23, w23, #1
	cmp	w21, w23
	b.gt	LBB0_11
; %bb.13:
	mov	x23, x21
	b	LBB0_15
LBB0_14:
	mov	x23, x0
LBB0_15:
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_I2C_SMBUS_BLOCK_MAX,4,2        ; @I2C_SMBUS_BLOCK_MAX
	.comm	_I2C_FUNC_SMBUS_READ_I2C_BLOCK,4,2 ; @I2C_FUNC_SMBUS_READ_I2C_BLOCK
	.comm	_I2C_FUNC_SMBUS_READ_BYTE_DATA,4,2 ; @I2C_FUNC_SMBUS_READ_BYTE_DATA
	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
	.comm	_I2C_FUNC_SMBUS_READ_WORD_DATA,4,2 ; @I2C_FUNC_SMBUS_READ_WORD_DATA
.subsections_via_symbols
