	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function i2c_dw_read
_i2c_dw_read:                           ## @i2c_dw_read
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	callq	_i2c_get_adapdata
	movq	%rax, %r14
	movq	8(%rax), %rax
	movq	48(%r14), %r15
	movslq	(%r14), %r12
	shlq	$5, %rax
	movq	(%r15,%rax), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	_DW_IC_RXFLR@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	40(%r14), %rdi
	callq	_readw
	movl	%eax, %ebx
	movq	8(%r14), %rax
	movq	%r12, -80(%rbp)                 ## 8-byte Spill
	cmpq	%r12, %rax
	jae	LBB0_15
## %bb.1:
	leaq	24(%r14), %rcx
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movq	%r14, %rcx
	addq	$32, %rcx
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movq	_STATUS_READ_IN_PROGRESS@GOTPCREL(%rip), %rdi
	movq	_DW_IC_DATA_CMD@GOTPCREL(%rip), %r13
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_2:                                 ##   in Loop: Header=BB0_4 Depth=1
	movl	%ebx, %ecx
LBB0_3:                                 ##   in Loop: Header=BB0_4 Depth=1
	incq	%rax
	movq	%rax, 8(%r14)
	movl	%ecx, %ebx
	cmpq	-80(%rbp), %rax                 ## 8-byte Folded Reload
	jae	LBB0_15
LBB0_4:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_8 Depth 2
	movq	%rax, %rcx
	shlq	$5, %rcx
	movq	_I2C_M_RD@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	testl	%edx, 8(%r15,%rcx)
	je	LBB0_2
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	cmpq	%rax, (%r15,%rcx)
	jne	LBB0_15
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	(%rdi), %eax
	testl	%eax, 16(%r14)
	leaq	16(%r15,%rcx), %rax
	leaq	24(%r15,%rcx), %rcx
	cmovneq	-64(%rbp), %rax                 ## 8-byte Folded Reload
	cmovneq	-56(%rbp), %rcx                 ## 8-byte Folded Reload
	movq	(%rcx), %r12
	movq	(%rax), %rax
	testq	%rax, %rax
	setg	%dl
	jle	LBB0_11
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	testl	%ebx, %ebx
	jle	LBB0_11
	.p2align	4, 0x90
LBB0_8:                                 ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%rax, %r15
	movq	(%r13), %rdi
	addq	40(%r14), %rdi
	callq	_readb
	movl	%eax, (%r12)
	addq	$4, %r12
	leaq	-1(%r15), %rax
	leal	-1(%rbx), %ecx
	cmpq	$2, %r15
	setae	%dl
	jb	LBB0_12
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=2
	cmpl	$1, %ebx
	movl	%ecx, %ebx
	ja	LBB0_8
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_4 Depth=1
	movl	%ebx, %ecx
LBB0_12:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	_STATUS_READ_IN_PROGRESS@GOTPCREL(%rip), %rdi
	movl	(%rdi), %esi
	testb	%dl, %dl
	jne	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_4 Depth=1
	notl	%esi
	andl	%esi, 16(%r14)
	movq	8(%r14), %rax
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	jmp	LBB0_3
LBB0_14:
	orl	%esi, 16(%r14)
	movq	%rax, 24(%r14)
	movq	%r12, 32(%r14)
LBB0_15:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DW_IC_RXFLR,8,3                ## @DW_IC_RXFLR
	.comm	_I2C_M_RD,4,2                   ## @I2C_M_RD
	.comm	_STATUS_READ_IN_PROGRESS,4,2    ## @STATUS_READ_IN_PROGRESS
	.comm	_DW_IC_DATA_CMD,8,3             ## @DW_IC_DATA_CMD
	.no_dead_strip	_i2c_dw_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function i2c_dw_read
_i2c_dw_read:                           ; @i2c_dw_read
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	bl	_i2c_get_adapdata
	mov	x19, x0
	ldrsw	x20, [x0]
	ldr	x8, [x0, #8]
	lsl	x8, x8, #5
	ldp	x9, x21, [x0, #40]
	ldr	x22, [x21, x8]
Lloh0:
	adrp	x8, _DW_IC_RXFLR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DW_IC_RXFLR@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	add	x0, x8, x9
	bl	_readw
	ldr	x8, [x19, #8]
	cmp	x8, x20
	b.hs	LBB0_12
; %bb.1:
	add	x9, x19, #24
	str	x9, [sp, #8]                    ; 8-byte Folded Spill
	add	x24, x19, #32
Lloh3:
	adrp	x11, _STATUS_READ_IN_PROGRESS@GOTPAGE
Lloh4:
	ldr	x11, [x11, _STATUS_READ_IN_PROGRESS@GOTPAGEOFF]
Lloh5:
	adrp	x27, _DW_IC_DATA_CMD@GOTPAGE
Lloh6:
	ldr	x27, [x27, _DW_IC_DATA_CMD@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x8, x8, #1
	str	x8, [x19, #8]
	cmp	x8, x20
	b.hs	LBB0_12
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
	add	x9, x21, x8, lsl #5
	ldr	w9, [x9, #8]
Lloh7:
	adrp	x10, _I2C_M_RD@GOTPAGE
Lloh8:
	ldr	x10, [x10, _I2C_M_RD@GOTPAGEOFF]
Lloh9:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	lsl	x9, x8, #5
	ldr	x9, [x21, x9]
	cmp	x9, x22
	b.ne	LBB0_12
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w9, [x19, #16]
	mov	x23, x11
	ldr	w10, [x11]
	add	x8, x21, x8, lsl #5
	add	x11, x8, #16
	add	x8, x8, #24
	tst	w10, w9
	ldr	x9, [sp, #8]                    ; 8-byte Folded Reload
	csel	x9, x11, x9, eq
	csel	x8, x8, x24, eq
	ldr	x28, [x8]
	ldr	x8, [x9]
	cmp	x8, #0
	cset	w9, gt
	cmp	x8, #1
	ccmp	w0, #1, #8, ge
	b.lt	LBB0_9
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x25, x0
LBB0_7:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x26, x8
	ldr	x8, [x19, #40]
	ldr	x9, [x27]
	add	x0, x9, x8
	bl	_readb
	str	w0, [x28], #4
	sub	w0, w25, #1
	subs	x8, x26, #1
	cset	w9, hi
	cmp	x26, #2
	b.lo	LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=2
	cmp	w25, #1
	mov	x25, x0
	b.hi	LBB0_7
LBB0_9:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	w10, [x23]
	cbnz	w9, LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_3 Depth=1
	mov	x11, x23
	ldr	w8, [x19, #16]
	bic	w8, w8, w10
	str	w8, [x19, #16]
	ldr	x8, [x19, #8]
	b	LBB0_2
LBB0_11:
	ldr	w9, [x19, #16]
	orr	w9, w9, w10
	str	w9, [x19, #16]
	stp	x8, x28, [x19, #24]
LBB0_12:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_DW_IC_RXFLR,8,3                ; @DW_IC_RXFLR
	.comm	_I2C_M_RD,4,2                   ; @I2C_M_RD
	.comm	_STATUS_READ_IN_PROGRESS,4,2    ; @STATUS_READ_IN_PROGRESS
	.comm	_DW_IC_DATA_CMD,8,3             ; @DW_IC_DATA_CMD
	.no_dead_strip	_i2c_dw_read
.subsections_via_symbols
