	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gmbus_xfer_write_chunk
_gmbus_xfer_write_chunk:                ## @gmbus_xfer_write_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, %r12d
	movl	%ecx, %r15d
	movq	%rdx, %rbx
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r14
	testl	%ecx, %ecx
	je	LBB0_1
## %bb.2:
	leal	-1(%r15), %r13d
	cmpl	$3, %r13d
	movl	$3, %eax
	cmovbl	%r13d, %eax
	movl	(%rbx), %esi
	testl	%eax, %eax
	je	LBB0_3
## %bb.4:
	movl	4(%rbx), %ecx
	shll	$8, %ecx
	orl	%ecx, %esi
	cmpl	$1, %eax
	jne	LBB0_6
## %bb.5:
	addq	$8, %rbx
	leal	-2(%r15), %r13d
	jmp	LBB0_9
LBB0_1:
	xorl	%r13d, %r13d
	xorl	%esi, %esi
	jmp	LBB0_9
LBB0_3:
	addq	$4, %rbx
	jmp	LBB0_9
LBB0_6:
	movl	8(%rbx), %ecx
	shll	$16, %ecx
	orl	%ecx, %esi
	cmpl	$2, %eax
	jne	LBB0_8
## %bb.7:
	addq	$12, %rbx
	leal	-3(%r15), %r13d
	jmp	LBB0_9
LBB0_8:
	movl	12(%rbx), %eax
	addq	$16, %rbx
	shll	$24, %eax
	orl	%eax, %esi
	leal	-4(%r15), %r13d
LBB0_9:
	movq	_GMBUS3@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_I915_WRITE_FW
	movq	_GMBUS1@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_GMBUS_BYTE_COUNT_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movq	_GMBUS_CYCLE_WAIT@GOTPCREL(%rip), %rax
	shll	%cl, %r15d
	orl	(%rax), %r12d
	movzwl	-44(%rbp), %eax                 ## 2-byte Folded Reload
	movq	_GMBUS_SLAVE_ADDR_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %eax
	orl	%r12d, %r15d
	movq	_GMBUS_SLAVE_WRITE@GOTPCREL(%rip), %rcx
	orl	(%rcx), %r15d
	movq	_GMBUS_SW_RDY@GOTPCREL(%rip), %rcx
	orl	%eax, %r15d
	orl	(%rcx), %r15d
	movl	%r15d, %esi
	callq	_I915_WRITE_FW
	movq	_GMBUS_HW_RDY_EN@GOTPCREL(%rip), %r12
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_10 Depth=1
	addq	$4, %rbx
LBB0_20:                                ##   in Loop: Header=BB0_10 Depth=1
	movq	_GMBUS3@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_I915_WRITE_FW
	movq	_GMBUS_HW_RDY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r12), %edx
	movq	%r14, %rdi
	callq	_gmbus_wait
	movl	%r15d, %r13d
	testl	%eax, %eax
	jne	LBB0_21
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	testl	%r13d, %r13d
	je	LBB0_11
## %bb.12:                              ##   in Loop: Header=BB0_10 Depth=1
	leal	-1(%r13), %r15d
	cmpl	$3, %r15d
	movl	$3, %eax
	cmovbl	%r15d, %eax
	movl	(%rbx), %esi
	testl	%eax, %eax
	je	LBB0_13
## %bb.14:                              ##   in Loop: Header=BB0_10 Depth=1
	movl	4(%rbx), %ecx
	shll	$8, %ecx
	orl	%ecx, %esi
	cmpl	$1, %eax
	jne	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_10 Depth=1
	addq	$8, %rbx
	addl	$-2, %r13d
	jmp	LBB0_19
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_10 Depth=1
	movl	8(%rbx), %ecx
	shll	$16, %ecx
	orl	%ecx, %esi
	cmpl	$2, %eax
	jne	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_10 Depth=1
	addq	$12, %rbx
	addl	$-3, %r13d
	jmp	LBB0_19
LBB0_18:                                ##   in Loop: Header=BB0_10 Depth=1
	movl	12(%rbx), %eax
	addq	$16, %rbx
	shll	$24, %eax
	orl	%eax, %esi
	addl	$-4, %r13d
LBB0_19:                                ##   in Loop: Header=BB0_10 Depth=1
	movl	%r13d, %r15d
	jmp	LBB0_20
LBB0_11:
	xorl	%eax, %eax
LBB0_21:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GMBUS3,4,2                     ## @GMBUS3
	.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_WRITE,4,2          ## @GMBUS_SLAVE_WRITE
	.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
	.no_dead_strip	_gmbus_xfer_write_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_write_chunk
_gmbus_xfer_write_chunk:                ; @gmbus_xfer_write_chunk
	.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	x23, x4
	mov	x22, x3
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
	cbz	w3, LBB0_4
; %bb.1:
	sub	w24, w22, #1
	mov	w8, #3
	cmp	w24, #3
	csel	w8, w24, w8, lo
	mov	x9, x20
	ldr	w1, [x9], #4
	cbz	w8, LBB0_5
; %bb.2:
	ldr	w9, [x20, #4]
	orr	w1, w1, w9, lsl #8
	cmp	w8, #1
	b.ne	LBB0_6
; %bb.3:
	add	x20, x20, #8
	sub	w24, w22, #2
	b	LBB0_9
LBB0_4:
	mov	w24, #0
	mov	w1, #0
	b	LBB0_9
LBB0_5:
	mov	x20, x9
	b	LBB0_9
LBB0_6:
	ldr	w9, [x20, #8]
	orr	w1, w1, w9, lsl #16
	cmp	w8, #2
	b.ne	LBB0_8
; %bb.7:
	add	x20, x20, #12
	sub	w24, w22, #3
	b	LBB0_9
LBB0_8:
	ldr	w8, [x20, #12]
	add	x20, x20, #16
	orr	w1, w1, w8, lsl #24
	sub	w24, w22, #4
LBB0_9:
Lloh0:
	adrp	x25, _GMBUS3@GOTPAGE
Lloh1:
	ldr	x25, [x25, _GMBUS3@GOTPAGEOFF]
	ldr	w0, [x25]
	bl	_I915_WRITE_FW
Lloh2:
	adrp	x8, _GMBUS1@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GMBUS1@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
Lloh5:
	adrp	x8, _GMBUS_CYCLE_WAIT@GOTPAGE
Lloh6:
	ldr	x8, [x8, _GMBUS_CYCLE_WAIT@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	orr	w8, w8, w23
Lloh8:
	adrp	x9, _GMBUS_BYTE_COUNT_SHIFT@GOTPAGE
Lloh9:
	ldr	x9, [x9, _GMBUS_BYTE_COUNT_SHIFT@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	lsl	w9, w22, w9
Lloh11:
	adrp	x10, _GMBUS_SLAVE_ADDR_SHIFT@GOTPAGE
Lloh12:
	ldr	x10, [x10, _GMBUS_SLAVE_ADDR_SHIFT@GOTPAGEOFF]
	orr	w8, w8, w9
	ldrh	w9, [x10]
	lsl	w9, w21, w9
Lloh13:
	adrp	x10, _GMBUS_SLAVE_WRITE@GOTPAGE
Lloh14:
	ldr	x10, [x10, _GMBUS_SLAVE_WRITE@GOTPAGEOFF]
Lloh15:
	ldr	w10, [x10]
Lloh16:
	adrp	x11, _GMBUS_SW_RDY@GOTPAGE
Lloh17:
	ldr	x11, [x11, _GMBUS_SW_RDY@GOTPAGEOFF]
Lloh18:
	ldr	w11, [x11]
	orr	w8, w8, w10
	orr	w8, w8, w9
	orr	w1, w8, w11
	bl	_I915_WRITE_FW
	mov	w21, #3
Lloh19:
	adrp	x22, _GMBUS_HW_RDY@GOTPAGE
Lloh20:
	ldr	x22, [x22, _GMBUS_HW_RDY@GOTPAGEOFF]
Lloh21:
	adrp	x23, _GMBUS_HW_RDY_EN@GOTPAGE
Lloh22:
	ldr	x23, [x23, _GMBUS_HW_RDY_EN@GOTPAGEOFF]
	b	LBB0_12
LBB0_10:                                ;   in Loop: Header=BB0_12 Depth=1
	mov	x20, x10
	mov	x24, x8
LBB0_11:                                ;   in Loop: Header=BB0_12 Depth=1
	ldr	w0, [x25]
	bl	_I915_WRITE_FW
	ldr	w1, [x22]
	ldr	w2, [x23]
	mov	x0, x19
	bl	_gmbus_wait
	cbnz	w0, LBB0_20
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	cbz	w24, LBB0_19
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	sub	w8, w24, #1
	cmp	w8, #3
	csel	w9, w8, w21, lo
	mov	x10, x20
	ldr	w1, [x10], #4
	cbz	w9, LBB0_10
; %bb.14:                               ;   in Loop: Header=BB0_12 Depth=1
	ldr	w8, [x20, #4]
	orr	w1, w1, w8, lsl #8
	cmp	w9, #1
	b.ne	LBB0_16
; %bb.15:                               ;   in Loop: Header=BB0_12 Depth=1
	add	x20, x20, #8
	sub	w24, w24, #2
	b	LBB0_11
LBB0_16:                                ;   in Loop: Header=BB0_12 Depth=1
	ldr	w8, [x20, #8]
	orr	w1, w1, w8, lsl #16
	cmp	w9, #2
	b.ne	LBB0_18
; %bb.17:                               ;   in Loop: Header=BB0_12 Depth=1
	add	x20, x20, #12
	sub	w24, w24, #3
	b	LBB0_11
LBB0_18:                                ;   in Loop: Header=BB0_12 Depth=1
	ldr	w8, [x20, #12]
	add	x20, x20, #16
	orr	w1, w1, w8, lsl #24
	sub	w24, w24, #4
	b	LBB0_11
LBB0_19:
	mov	w0, #0
LBB0_20:
	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 AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_GMBUS3,4,2                     ; @GMBUS3
	.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_WRITE,4,2          ; @GMBUS_SLAVE_WRITE
	.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
	.no_dead_strip	_gmbus_xfer_write_chunk
.subsections_via_symbols
