	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gmbus_xfer_read
_gmbus_xfer_read:                       ## @gmbus_xfer_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rax
	movq	%rdi, %r15
	movslq	(%rdi), %r14
	movl	(%rsi), %ebx
	movl	4(%rsi), %esi
	movq	8(%rax), %r12
	movq	_GMBUS_CYCLE_WAIT@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	_GMBUS_BYTE_COUNT_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	%ebx, %eax
	shll	%cl, %eax
	movq	_GMBUS1@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdi
	orl	%edx, %eax
	movq	_GMBUS_SLAVE_ADDR_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %esi
	orl	%eax, %esi
	movq	_GMBUS_SLAVE_READ@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	addq	%r14, %rdi
	movq	_GMBUS_SW_RDY@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	callq	_I915_WRITE
	testl	%ebx, %ebx
	je	LBB0_12
## %bb.1:
	movq	_GMBUS_HW_RDY_EN@GOTPCREL(%rip), %r13
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_2:                                 ##   in Loop: Header=BB0_5 Depth=1
	addq	$4, %r12
LBB0_3:                                 ##   in Loop: Header=BB0_5 Depth=1
	xorl	%ebx, %ebx
	testl	%ebx, %ebx
	je	LBB0_13
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	_GMBUS_HW_RDY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r13), %edx
	movq	%r15, %rdi
	callq	_gmbus_wait_hw_status
	testl	%eax, %eax
	jne	LBB0_13
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	_GMBUS3@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	%r14, %rdi
	callq	_I915_READ
	movl	%eax, %ecx
	movzbl	%cl, %eax
	movl	%eax, (%r12)
	xorl	%eax, %eax
	cmpl	$1, %ebx
	je	LBB0_2
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movzbl	%ch, %edx
	movl	%edx, 4(%r12)
	cmpl	$2, %ebx
	jne	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	addq	$8, %r12
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_5 Depth=1
	movl	%ecx, %edx
	shrl	$16, %edx
	movzbl	%dl, %edx
	movl	%edx, 8(%r12)
	cmpl	$3, %ebx
	jne	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_5 Depth=1
	addq	$12, %r12
	jmp	LBB0_3
LBB0_11:                                ##   in Loop: Header=BB0_5 Depth=1
	shrl	$24, %ecx
	movl	%ecx, 12(%r12)
	addq	$16, %r12
	addl	$-4, %ebx
	testl	%ebx, %ebx
	jne	LBB0_5
	jmp	LBB0_13
LBB0_12:
	xorl	%eax, %eax
LBB0_13:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.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_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,8,3                     ## @GMBUS3
	.no_dead_strip	_gmbus_xfer_read
.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
_gmbus_xfer_read:                       ; @gmbus_xfer_read
	.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	x19, x0
	ldrsw	x20, [x0]
	ldr	x21, [x1, #8]
Lloh0:
	adrp	x8, _GMBUS1@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GMBUS1@GOTPAGEOFF]
Lloh2:
	adrp	x9, _GMBUS_CYCLE_WAIT@GOTPAGE
Lloh3:
	ldr	x9, [x9, _GMBUS_CYCLE_WAIT@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
Lloh5:
	ldr	w9, [x9]
	orr	w9, w9, w2
Lloh6:
	adrp	x10, _GMBUS_BYTE_COUNT_SHIFT@GOTPAGE
Lloh7:
	ldr	x10, [x10, _GMBUS_BYTE_COUNT_SHIFT@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
	ldp	w22, w11, [x1]
	lsl	w10, w22, w10
	orr	w9, w9, w10
Lloh9:
	adrp	x10, _GMBUS_SLAVE_ADDR_SHIFT@GOTPAGE
Lloh10:
	ldr	x10, [x10, _GMBUS_SLAVE_ADDR_SHIFT@GOTPAGEOFF]
	add	x0, x8, x20
Lloh11:
	ldr	w8, [x10]
	lsl	w8, w11, w8
	orr	w8, w9, w8
Lloh12:
	adrp	x9, _GMBUS_SLAVE_READ@GOTPAGE
Lloh13:
	ldr	x9, [x9, _GMBUS_SLAVE_READ@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh15:
	adrp	x9, _GMBUS_SW_RDY@GOTPAGE
Lloh16:
	ldr	x9, [x9, _GMBUS_SW_RDY@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	orr	w1, w8, w9
	bl	_I915_WRITE
	cbz	w22, LBB0_11
; %bb.1:
Lloh18:
	adrp	x23, _GMBUS_HW_RDY@GOTPAGE
Lloh19:
	ldr	x23, [x23, _GMBUS_HW_RDY@GOTPAGEOFF]
Lloh20:
	adrp	x24, _GMBUS_HW_RDY_EN@GOTPAGE
Lloh21:
	ldr	x24, [x24, _GMBUS_HW_RDY_EN@GOTPAGEOFF]
Lloh22:
	adrp	x25, _GMBUS3@GOTPAGE
Lloh23:
	ldr	x25, [x25, _GMBUS3@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	w22, #0
	mov	x21, x8
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	cbz	w22, LBB0_11
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x23]
	ldr	w2, [x24]
	mov	x0, x19
	bl	_gmbus_wait_hw_status
	cbnz	w0, LBB0_12
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x25]
	add	x0, x8, x20
	bl	_I915_READ
	and	w9, w0, #0xff
	mov	x8, x21
	str	w9, [x8], #4
	cmp	w22, #1
	b.eq	LBB0_2
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	ubfx	w8, w0, #8, #8
	str	w8, [x21, #4]
	cmp	w22, #2
	b.ne	LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w22, #0
	add	x21, x21, #8
	b	LBB0_3
LBB0_8:                                 ;   in Loop: Header=BB0_4 Depth=1
	ubfx	w8, w0, #16, #8
	str	w8, [x21, #8]
	cmp	w22, #3
	b.ne	LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w22, #0
	add	x21, x21, #12
	b	LBB0_3
LBB0_10:                                ;   in Loop: Header=BB0_4 Depth=1
	lsr	w8, w0, #24
	str	w8, [x21, #12]
	add	x21, x21, #16
	sub	w22, w22, #4
	b	LBB0_3
LBB0_11:
	mov	w0, #0
LBB0_12:
	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	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh4
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.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_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,8,3                     ; @GMBUS3
	.no_dead_strip	_gmbus_xfer_read
.subsections_via_symbols
