	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gmbus_xfer_write
_gmbus_xfer_write:                      ## @gmbus_xfer_write
	.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
	movq	%rsi, %r14
	movq	%rdi, %r15
	movslq	(%rdi), %r12
	movl	(%rsi), %eax
	movq	8(%rsi), %r13
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	leal	-1(%rax), %ebx
	cmpl	$3, %ebx
	movl	$3, %ecx
	cmovbl	%ebx, %ecx
	movl	(%r13), %esi
	testl	%ecx, %ecx
	je	LBB0_3
## %bb.4:
	movl	4(%r13), %edx
	shll	$8, %edx
	orl	%edx, %esi
	cmpl	$1, %ecx
	jne	LBB0_6
## %bb.5:
	addq	$8, %r13
	addl	$-2, %eax
	jmp	LBB0_9
LBB0_1:
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	jmp	LBB0_10
LBB0_3:
	addq	$4, %r13
	jmp	LBB0_10
LBB0_6:
	movl	8(%r13), %edx
	shll	$16, %edx
	orl	%edx, %esi
	cmpl	$2, %ecx
	jne	LBB0_8
## %bb.7:
	addq	$12, %r13
	addl	$-3, %eax
	jmp	LBB0_9
LBB0_8:
	movl	12(%r13), %ecx
	addq	$16, %r13
	shll	$24, %ecx
	orl	%ecx, %esi
	addl	$-4, %eax
LBB0_9:
	movl	%eax, %ebx
LBB0_10:
	movq	_GMBUS3@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	%r12, %rdi
	callq	_I915_WRITE
	movq	_GMBUS1@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	_GMBUS_CYCLE_WAIT@GOTPCREL(%rip), %rax
	movq	_GMBUS_BYTE_COUNT_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movl	(%r14), %edx
	shll	%cl, %edx
	movl	4(%r14), %esi
	orl	(%rax), %edx
	movq	_GMBUS_SLAVE_ADDR_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %esi
	orl	%edx, %esi
	movq	_GMBUS_SLAVE_WRITE@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	addq	%r12, %rdi
	movq	_GMBUS_SW_RDY@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	callq	_I915_WRITE
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_11 Depth=1
	addq	$4, %r13
LBB0_21:                                ##   in Loop: Header=BB0_11 Depth=1
	movq	_GMBUS3@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	%r12, %rdi
	callq	_I915_WRITE
	movq	_GMBUS_HW_RDY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_GMBUS_HW_RDY_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	callq	_gmbus_wait_hw_status
	movl	%r14d, %ebx
	testl	%eax, %eax
	jne	LBB0_22
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	testl	%ebx, %ebx
	je	LBB0_12
## %bb.13:                              ##   in Loop: Header=BB0_11 Depth=1
	leal	-1(%rbx), %r14d
	cmpl	$3, %r14d
	movl	$3, %eax
	cmovbl	%r14d, %eax
	movl	(%r13), %esi
	testl	%eax, %eax
	je	LBB0_14
## %bb.15:                              ##   in Loop: Header=BB0_11 Depth=1
	movl	4(%r13), %ecx
	shll	$8, %ecx
	orl	%ecx, %esi
	cmpl	$1, %eax
	jne	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_11 Depth=1
	addq	$8, %r13
	addl	$-2, %ebx
	jmp	LBB0_20
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_11 Depth=1
	movl	8(%r13), %ecx
	shll	$16, %ecx
	orl	%ecx, %esi
	cmpl	$2, %eax
	jne	LBB0_19
## %bb.18:                              ##   in Loop: Header=BB0_11 Depth=1
	addq	$12, %r13
	addl	$-3, %ebx
	jmp	LBB0_20
LBB0_19:                                ##   in Loop: Header=BB0_11 Depth=1
	movl	12(%r13), %eax
	addq	$16, %r13
	shll	$24, %eax
	orl	%eax, %esi
	addl	$-4, %ebx
LBB0_20:                                ##   in Loop: Header=BB0_11 Depth=1
	movl	%ebx, %r14d
	jmp	LBB0_21
LBB0_12:
	xorl	%eax, %eax
LBB0_22:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GMBUS3,8,3                     ## @GMBUS3
	.comm	_GMBUS1,8,3                     ## @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,4,2     ## @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
.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
_gmbus_xfer_write:                      ; @gmbus_xfer_write
	.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	x20, x1
	mov	x19, x0
	ldrsw	x21, [x0]
	ldr	w8, [x1]
	ldr	x22, [x1, #8]
	cbz	w8, LBB0_4
; %bb.1:
	sub	w23, w8, #1
	mov	w9, #3
	cmp	w23, #3
	csel	w9, w23, w9, lo
	mov	x10, x22
	ldr	w1, [x10], #4
	cbz	w9, LBB0_5
; %bb.2:
	ldr	w10, [x22, #4]
	orr	w1, w1, w10, lsl #8
	cmp	w9, #1
	b.ne	LBB0_6
; %bb.3:
	add	x22, x22, #8
	sub	w23, w8, #2
	b	LBB0_9
LBB0_4:
	mov	w23, #0
	mov	w1, #0
	b	LBB0_9
LBB0_5:
	mov	x22, x10
	b	LBB0_9
LBB0_6:
	ldr	w10, [x22, #8]
	orr	w1, w1, w10, lsl #16
	cmp	w9, #2
	b.ne	LBB0_8
; %bb.7:
	add	x22, x22, #12
	sub	w23, w8, #3
	b	LBB0_9
LBB0_8:
	ldr	w9, [x22, #12]
	add	x22, x22, #16
	orr	w1, w1, w9, lsl #24
	sub	w23, w8, #4
LBB0_9:
Lloh0:
	adrp	x24, _GMBUS3@GOTPAGE
Lloh1:
	ldr	x24, [x24, _GMBUS3@GOTPAGEOFF]
	ldr	x8, [x24]
	add	x0, x8, x21
	bl	_I915_WRITE
Lloh2:
	adrp	x8, _GMBUS1@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GMBUS1@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	add	x0, x8, x21
Lloh5:
	adrp	x8, _GMBUS_CYCLE_WAIT@GOTPAGE
Lloh6:
	ldr	x8, [x8, _GMBUS_CYCLE_WAIT@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
Lloh8:
	adrp	x9, _GMBUS_BYTE_COUNT_SHIFT@GOTPAGE
Lloh9:
	ldr	x9, [x9, _GMBUS_BYTE_COUNT_SHIFT@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	ldp	w10, w11, [x20]
	lsl	w9, w10, w9
Lloh11:
	adrp	x10, _GMBUS_SLAVE_ADDR_SHIFT@GOTPAGE
Lloh12:
	ldr	x10, [x10, _GMBUS_SLAVE_ADDR_SHIFT@GOTPAGEOFF]
	orr	w8, w9, w8
Lloh13:
	ldr	w9, [x10]
	lsl	w9, w11, w9
	orr	w8, w8, w9
Lloh14:
	adrp	x9, _GMBUS_SLAVE_WRITE@GOTPAGE
Lloh15:
	ldr	x9, [x9, _GMBUS_SLAVE_WRITE@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh17:
	adrp	x9, _GMBUS_SW_RDY@GOTPAGE
Lloh18:
	ldr	x9, [x9, _GMBUS_SW_RDY@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	orr	w1, w8, w9
	bl	_I915_WRITE
	mov	w20, #3
Lloh20:
	adrp	x25, _GMBUS_HW_RDY@GOTPAGE
Lloh21:
	ldr	x25, [x25, _GMBUS_HW_RDY@GOTPAGEOFF]
Lloh22:
	adrp	x26, _GMBUS_HW_RDY_EN@GOTPAGE
Lloh23:
	ldr	x26, [x26, _GMBUS_HW_RDY_EN@GOTPAGEOFF]
	b	LBB0_12
LBB0_10:                                ;   in Loop: Header=BB0_12 Depth=1
	mov	x22, x10
	mov	x23, x8
LBB0_11:                                ;   in Loop: Header=BB0_12 Depth=1
	ldr	x8, [x24]
	add	x0, x8, x21
	bl	_I915_WRITE
	ldr	w1, [x25]
	ldr	w2, [x26]
	mov	x0, x19
	bl	_gmbus_wait_hw_status
	cbnz	w0, LBB0_20
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	cbz	w23, LBB0_19
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	sub	w8, w23, #1
	cmp	w8, #3
	csel	w9, w8, w20, lo
	mov	x10, x22
	ldr	w1, [x10], #4
	cbz	w9, LBB0_10
; %bb.14:                               ;   in Loop: Header=BB0_12 Depth=1
	ldr	w8, [x22, #4]
	orr	w1, w1, w8, lsl #8
	cmp	w9, #1
	b.ne	LBB0_16
; %bb.15:                               ;   in Loop: Header=BB0_12 Depth=1
	add	x22, x22, #8
	sub	w23, w23, #2
	b	LBB0_11
LBB0_16:                                ;   in Loop: Header=BB0_12 Depth=1
	ldr	w8, [x22, #8]
	orr	w1, w1, w8, lsl #16
	cmp	w9, #2
	b.ne	LBB0_18
; %bb.17:                               ;   in Loop: Header=BB0_12 Depth=1
	add	x22, x22, #12
	sub	w23, w23, #3
	b	LBB0_11
LBB0_18:                                ;   in Loop: Header=BB0_12 Depth=1
	ldr	w8, [x22, #12]
	add	x22, x22, #16
	orr	w1, w1, w8, lsl #24
	sub	w23, w23, #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	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.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,8,3                     ; @GMBUS3
	.comm	_GMBUS1,8,3                     ; @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,4,2     ; @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
.subsections_via_symbols
