	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gmbus_xfer_read_chunk
_gmbus_xfer_read_chunk:                 ## @gmbus_xfer_read_chunk
	.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
	movl	%r9d, %r15d
	movl	%r8d, -48(%rbp)                 ## 4-byte Spill
	movl	%ecx, %ebx
	movq	%rdx, %r12
	movl	%esi, -56(%rbp)                 ## 4-byte Spill
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	callq	_gmbus_max_xfer_size
	movl	%ebx, %r13d
	movl	%ebx, %r14d
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movl	%ebx, -52(%rbp)                 ## 4-byte Spill
	cmpl	%ebx, %eax
	jae	LBB0_2
## %bb.1:
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	cmpl	$512, %eax                      ## imm = 0x200
	movl	$513, %r13d                     ## imm = 0x201
	cmovnel	%eax, %r13d
	sete	%al
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movzbl	%r13b, %r14d
	orl	$256, %r14d                     ## imm = 0x100
	movq	_GMBUS0@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_GMBUS_BYTE_CNT_OVERRIDE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	orl	-48(%rbp), %esi                 ## 4-byte Folded Reload
	callq	_I915_WRITE_FW
LBB0_2:
	movq	_GMBUS1@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_GMBUS_CYCLE_WAIT@GOTPCREL(%rip), %rax
	movq	_GMBUS_BYTE_COUNT_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movl	%r14d, %esi
	shll	%cl, %esi
	orl	(%rax), %r15d
	movzwl	-56(%rbp), %eax                 ## 2-byte Folded Reload
	movq	_GMBUS_SLAVE_ADDR_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %eax
	orl	%r15d, %esi
	movq	_GMBUS_SLAVE_READ@GOTPCREL(%rip), %rcx
	orl	(%rcx), %esi
	movq	_GMBUS_SW_RDY@GOTPCREL(%rip), %rcx
	orl	%eax, %esi
	orl	(%rcx), %esi
	callq	_I915_WRITE_FW
	testl	%r13d, %r13d
	je	LBB0_21
## %bb.3:
	addl	$-4, %r14d
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_5 Depth=1
	testl	%r13d, %r13d
	je	LBB0_21
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r13d, %ebx
	movq	%r12, %r15
	movq	_GMBUS_HW_RDY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_GMBUS_HW_RDY_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	callq	_gmbus_wait
	testl	%eax, %eax
	jne	LBB0_22
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	_GMBUS3@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_I915_READ_FW
	cmpl	$1, %ebx
	sete	%cl
	movl	$1, %r13d
	testb	%cl, -44(%rbp)                  ## 1-byte Folded Reload
	je	LBB0_8
LBB0_7:                                 ##   in Loop: Header=BB0_5 Depth=1
	movq	%r15, %r12
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_5 Depth=1
	movzbl	%al, %ecx
	leaq	4(%r15), %r12
	movl	%ecx, (%r15)
	movl	%ebx, %ecx
	decl	%ecx
	jne	LBB0_13
LBB0_9:                                 ##   in Loop: Header=BB0_5 Depth=1
	xorl	%r13d, %r13d
LBB0_10:                                ##   in Loop: Header=BB0_5 Depth=1
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	cmpl	%eax, -60(%rbp)                 ## 4-byte Folded Reload
	jae	LBB0_4
## %bb.11:                              ##   in Loop: Header=BB0_5 Depth=1
	cmpl	%r14d, %r13d
	jne	LBB0_4
## %bb.12:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	_GMBUS0@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	callq	_I915_WRITE_FW
	jmp	LBB0_4
LBB0_13:                                ##   in Loop: Header=BB0_5 Depth=1
	cmpl	$1, %ecx
	sete	%cl
	testb	%cl, -44(%rbp)                  ## 1-byte Folded Reload
	jne	LBB0_10
## %bb.14:                              ##   in Loop: Header=BB0_5 Depth=1
	movzbl	%ah, %ecx
	leaq	8(%r15), %r12
	movl	%ecx, 4(%r15)
	movl	%ebx, %ecx
	addl	$-2, %ecx
	je	LBB0_9
## %bb.15:                              ##   in Loop: Header=BB0_5 Depth=1
	cmpl	$1, %ecx
	sete	%cl
	testb	%cl, -44(%rbp)                  ## 1-byte Folded Reload
	jne	LBB0_10
## %bb.16:                              ##   in Loop: Header=BB0_5 Depth=1
	movl	%eax, %ecx
	shrl	$16, %ecx
	movzbl	%cl, %ecx
	leaq	12(%r15), %r12
	movl	%ecx, 8(%r15)
	movl	%ebx, %ecx
	addl	$-3, %ecx
	je	LBB0_9
## %bb.17:                              ##   in Loop: Header=BB0_5 Depth=1
	cmpl	$1, %ecx
	sete	%cl
	testb	%cl, -44(%rbp)                  ## 1-byte Folded Reload
	jne	LBB0_10
## %bb.18:                              ##   in Loop: Header=BB0_5 Depth=1
	addl	$-4, %ebx
	shrl	$24, %eax
	movl	%eax, 12(%r15)
	addq	$16, %r15
	movl	%ebx, %r13d
	jmp	LBB0_7
LBB0_21:
	xorl	%eax, %eax
LBB0_22:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GMBUS0,4,2                     ## @GMBUS0
	.comm	_GMBUS_BYTE_CNT_OVERRIDE,4,2    ## @GMBUS_BYTE_CNT_OVERRIDE
	.comm	_GMBUS1,4,2                     ## @GMBUS1
	.comm	_GMBUS_CYCLE_WAIT,4,2           ## @GMBUS_CYCLE_WAIT
	.comm	_GMBUS_BYTE_COUNT_SHIFT,4,2     ## @GMBUS_BYTE_COUNT_SHIFT
	.comm	_GMBUS_SLAVE_ADDR_SHIFT,2,1     ## @GMBUS_SLAVE_ADDR_SHIFT
	.comm	_GMBUS_SLAVE_READ,4,2           ## @GMBUS_SLAVE_READ
	.comm	_GMBUS_SW_RDY,4,2               ## @GMBUS_SW_RDY
	.comm	_GMBUS_HW_RDY,4,2               ## @GMBUS_HW_RDY
	.comm	_GMBUS_HW_RDY_EN,4,2            ## @GMBUS_HW_RDY_EN
	.comm	_GMBUS3,4,2                     ## @GMBUS3
	.no_dead_strip	_gmbus_xfer_read_chunk
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gmbus_xfer_read_chunk
_gmbus_xfer_read_chunk:                 ; @gmbus_xfer_read_chunk
	.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	x25, x5
	mov	x26, x4
	mov	x20, x3
	mov	x23, x2
	mov	x24, x1
	mov	x21, x0
	bl	_gmbus_max_xfer_size
	mov	x22, x0
Lloh0:
	adrp	x9, _GMBUS0@GOTPAGE
Lloh1:
	ldr	x9, [x9, _GMBUS0@GOTPAGEOFF]
	cmp	w0, w20
	b.hs	LBB0_2
; %bb.1:
	mov	w8, #513
	cmp	w20, #512
	csel	w28, w8, w20, eq
	cset	w27, eq
	mov	w19, #256
	bfxil	w19, w28, #0, #8
	ldr	w0, [x9]
Lloh2:
	adrp	x8, _GMBUS_BYTE_CNT_OVERRIDE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GMBUS_BYTE_CNT_OVERRIDE@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	orr	w1, w8, w26
	bl	_I915_WRITE_FW
	b	LBB0_3
LBB0_2:
	mov	w27, #0
	mov	x28, x20
	mov	x19, x20
LBB0_3:
Lloh5:
	adrp	x8, _GMBUS1@GOTPAGE
Lloh6:
	ldr	x8, [x8, _GMBUS1@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
Lloh8:
	adrp	x8, _GMBUS_CYCLE_WAIT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _GMBUS_CYCLE_WAIT@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	orr	w8, w8, w25
Lloh11:
	adrp	x9, _GMBUS_BYTE_COUNT_SHIFT@GOTPAGE
Lloh12:
	ldr	x9, [x9, _GMBUS_BYTE_COUNT_SHIFT@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	lsl	w9, w19, w9
Lloh14:
	adrp	x10, _GMBUS_SLAVE_ADDR_SHIFT@GOTPAGE
Lloh15:
	ldr	x10, [x10, _GMBUS_SLAVE_ADDR_SHIFT@GOTPAGEOFF]
	orr	w8, w8, w9
	ldrh	w9, [x10]
	lsl	w9, w24, w9
Lloh16:
	adrp	x10, _GMBUS_SLAVE_READ@GOTPAGE
Lloh17:
	ldr	x10, [x10, _GMBUS_SLAVE_READ@GOTPAGEOFF]
Lloh18:
	ldr	w10, [x10]
Lloh19:
	adrp	x11, _GMBUS_SW_RDY@GOTPAGE
Lloh20:
	ldr	x11, [x11, _GMBUS_SW_RDY@GOTPAGEOFF]
Lloh21:
	ldr	w11, [x11]
	orr	w8, w8, w10
	orr	w8, w8, w9
	orr	w1, w8, w11
	bl	_I915_WRITE_FW
	cbz	w28, LBB0_21
; %bb.4:
	mov	x25, x26
	sub	w24, w19, #4
Lloh22:
	adrp	x19, _GMBUS_HW_RDY@GOTPAGE
Lloh23:
	ldr	x19, [x19, _GMBUS_HW_RDY@GOTPAGEOFF]
Lloh24:
	adrp	x26, _GMBUS_HW_RDY_EN@GOTPAGE
Lloh25:
	ldr	x26, [x26, _GMBUS_HW_RDY_EN@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	cbz	w28, LBB0_21
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x19]
	ldr	w2, [x26]
	mov	x0, x21
	bl	_gmbus_wait
	cbnz	w0, LBB0_22
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
Lloh26:
	adrp	x8, _GMBUS3@GOTPAGE
Lloh27:
	ldr	x8, [x8, _GMBUS3@GOTPAGEOFF]
Lloh28:
	ldr	w0, [x8]
	bl	_I915_READ_FW
	cmp	w28, #1
	cset	w8, eq
	and	w8, w27, w8
	tbz	w8, #0, LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	w28, #1
	cmp	w22, w20
	b.lo	LBB0_18
	b	LBB0_5
LBB0_9:                                 ;   in Loop: Header=BB0_6 Depth=1
	and	w9, w0, #0xff
	mov	x8, x23
	str	w9, [x8], #4
	subs	w9, w28, #1
	b.ne	LBB0_11
LBB0_10:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	w28, #0
	b	LBB0_17
LBB0_11:                                ;   in Loop: Header=BB0_6 Depth=1
	cmp	w9, #1
	cset	w9, eq
	and	w9, w27, w9
	tbnz	w9, #0, LBB0_16
; %bb.12:                               ;   in Loop: Header=BB0_6 Depth=1
	ubfx	w9, w0, #8, #8
	add	x8, x23, #8
	str	w9, [x23, #4]
	subs	w9, w28, #2
	b.eq	LBB0_10
; %bb.13:                               ;   in Loop: Header=BB0_6 Depth=1
	cmp	w9, #1
	cset	w9, eq
	and	w9, w27, w9
	tbnz	w9, #0, LBB0_16
; %bb.14:                               ;   in Loop: Header=BB0_6 Depth=1
	ubfx	w9, w0, #16, #8
	add	x8, x23, #12
	str	w9, [x23, #8]
	subs	w9, w28, #3
	b.eq	LBB0_10
; %bb.15:                               ;   in Loop: Header=BB0_6 Depth=1
	cmp	w9, #1
	cset	w9, eq
	and	w9, w27, w9
	tbz	w9, #0, LBB0_20
LBB0_16:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	w28, #1
LBB0_17:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x23, x8
	cmp	w22, w20
	b.hs	LBB0_5
LBB0_18:                                ;   in Loop: Header=BB0_6 Depth=1
	cmp	w28, w24
	b.ne	LBB0_5
; %bb.19:                               ;   in Loop: Header=BB0_6 Depth=1
Lloh29:
	adrp	x8, _GMBUS0@GOTPAGE
Lloh30:
	ldr	x8, [x8, _GMBUS0@GOTPAGEOFF]
Lloh31:
	ldr	w0, [x8]
	mov	x1, x25
	bl	_I915_WRITE_FW
	b	LBB0_5
LBB0_20:                                ;   in Loop: Header=BB0_6 Depth=1
	sub	w28, w28, #4
	lsr	w8, w0, #24
	str	w8, [x23, #12]
	add	x23, x23, #16
	cmp	w22, w20
	b.lo	LBB0_18
	b	LBB0_5
LBB0_21:
	mov	w0, #0
LBB0_22:
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_GMBUS0,4,2                     ; @GMBUS0
	.comm	_GMBUS_BYTE_CNT_OVERRIDE,4,2    ; @GMBUS_BYTE_CNT_OVERRIDE
	.comm	_GMBUS1,4,2                     ; @GMBUS1
	.comm	_GMBUS_CYCLE_WAIT,4,2           ; @GMBUS_CYCLE_WAIT
	.comm	_GMBUS_BYTE_COUNT_SHIFT,4,2     ; @GMBUS_BYTE_COUNT_SHIFT
	.comm	_GMBUS_SLAVE_ADDR_SHIFT,2,1     ; @GMBUS_SLAVE_ADDR_SHIFT
	.comm	_GMBUS_SLAVE_READ,4,2           ; @GMBUS_SLAVE_READ
	.comm	_GMBUS_SW_RDY,4,2               ; @GMBUS_SW_RDY
	.comm	_GMBUS_HW_RDY,4,2               ; @GMBUS_HW_RDY
	.comm	_GMBUS_HW_RDY_EN,4,2            ; @GMBUS_HW_RDY_EN
	.comm	_GMBUS3,4,2                     ; @GMBUS3
	.no_dead_strip	_gmbus_xfer_read_chunk
.subsections_via_symbols
