	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gpu_i2c_master_xfer
_gpu_i2c_master_xfer:                   ## @gpu_i2c_master_xfer
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r14d
	movq	%rsi, %rbx
	callq	_i2c_get_adapdata
	movq	%rax, %r13
	movl	(%rax), %edi
	callq	_pm_runtime_get_sync
	testl	%r14d, %r14d
	jle	LBB0_14
## %bb.1:
	movl	%r14d, -52(%rbp)                ## 4-byte Spill
	movl	%r14d, %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	xorl	%r14d, %r14d
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_2:                                 ##   in Loop: Header=BB0_4 Depth=1
	movl	16(%rbx,%r15,8), %edi
	movq	_I2C_MST_ADDR@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r13), %rsi
	callq	_writel
	movq	8(%rbx,%r15,8), %rsi
	movl	4(%rbx,%r15,8), %edx
	movq	%r13, %rdi
	callq	_gpu_i2c_read
	testl	%eax, %eax
	js	LBB0_11
LBB0_3:                                 ##   in Loop: Header=BB0_4 Depth=1
	incq	%r14
	cmpq	-64(%rbp), %r14                 ## 8-byte Folded Reload
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	je	LBB0_17
LBB0_4:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_9 Depth 2
	leaq	(%r14,%r14,2), %r15
	movq	_I2C_M_RD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx,%r15,8)
	jne	LBB0_2
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	leaq	(%rbx,%r15,8), %rdi
	callq	_i2c_8bit_addr_from_msg
	movq	%r13, %rbx
	movl	%eax, %r13d
	movq	%rbx, %rdi
	callq	_gpu_i2c_start
	testl	%eax, %eax
	js	LBB0_19
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	%r13d, %esi
	movq	%rbx, %r13
	movq	%rbx, %rdi
	callq	_gpu_i2c_write
	testl	%eax, %eax
	js	LBB0_11
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	cmpl	$0, 4(%rax,%r15,8)
	jle	LBB0_3
## %bb.8:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%r15,8), %r15
	addq	$4, %r15
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_9:                                 ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	4(%r15), %rax
	movl	(%rax,%rbx,4), %esi
	movq	%r13, %rdi
	callq	_gpu_i2c_write
	testl	%eax, %eax
	js	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=2
	incq	%rbx
	movslq	(%r15), %rax
	cmpq	%rax, %rbx
	jl	LBB0_9
	jmp	LBB0_3
LBB0_11:
	movl	%eax, %r12d
LBB0_12:
	movq	%r13, %rdi
	callq	_gpu_i2c_stop
	testl	%eax, %eax
	jns	LBB0_16
## %bb.13:
	movl	(%r13), %edi
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edx
	callq	_dev_err
	jmp	LBB0_16
LBB0_14:
	xorl	%r12d, %r12d
LBB0_15:
	movq	%r13, %rdi
	callq	_gpu_i2c_stop
	testl	%eax, %eax
	cmovsl	%eax, %r12d
LBB0_16:
	movl	(%r13), %edi
	callq	_pm_runtime_mark_last_busy
	movl	(%r13), %edi
	callq	_pm_runtime_put_autosuspend
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	movl	-52(%rbp), %r12d                ## 4-byte Reload
	jmp	LBB0_15
LBB0_19:
	movl	%eax, %r12d
	testl	%r14d, %r14d
	movq	%rbx, %r13
	jne	LBB0_12
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.comm	_I2C_M_RD,4,2                   ## @I2C_M_RD
	.comm	_I2C_MST_ADDR,8,3               ## @I2C_MST_ADDR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"i2c stop failed %d\n"

	.no_dead_strip	_gpu_i2c_master_xfer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gpu_i2c_master_xfer
_gpu_i2c_master_xfer:                   ; @gpu_i2c_master_xfer
	.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	x20, x2
	mov	x21, x1
	bl	_i2c_get_adapdata
	mov	x19, x0
	ldr	w0, [x0]
	bl	_pm_runtime_get_sync
	cmp	w20, #1
	b.lt	LBB0_14
; %bb.1:
	mov	x24, #0
	mov	w25, #24
	mov	w28, w20
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	madd	x22, x24, x25, x21
	ldr	w0, [x22, #16]
	ldr	x8, [x19, #8]
Lloh0:
	adrp	x9, _I2C_MST_ADDR@GOTPAGE
Lloh1:
	ldr	x9, [x9, _I2C_MST_ADDR@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
	ldr	x1, [x22, #8]
	ldr	w2, [x22, #4]
	mov	x0, x19
	bl	_gpu_i2c_read
	tbnz	w0, #31, LBB0_11
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x24, x24, #1
	cmp	x24, x28
	b.eq	LBB0_15
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_9 Depth 2
	madd	x0, x24, x25, x21
	ldr	w8, [x0]
Lloh3:
	adrp	x9, _I2C_M_RD@GOTPAGE
Lloh4:
	ldr	x9, [x9, _I2C_M_RD@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	bl	_i2c_8bit_addr_from_msg
	mov	x23, x0
	mov	x0, x19
	bl	_gpu_i2c_start
	tbnz	w0, #31, LBB0_17
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x19
	mov	x1, x23
	bl	_gpu_i2c_write
	tbnz	w0, #31, LBB0_11
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	madd	x23, x24, x25, x21
	ldr	w8, [x23, #4]!
	cmp	w8, #1
	b.lt	LBB0_3
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x27, #0
	madd	x8, x24, x25, x21
	add	x26, x8, #8
LBB0_9:                                 ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x8, [x26]
	ldr	w1, [x8, x27, lsl #2]
	mov	x0, x19
	bl	_gpu_i2c_write
	tbnz	w0, #31, LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=2
	add	x27, x27, #1
	ldrsw	x8, [x23]
	cmp	x27, x8
	b.lt	LBB0_9
	b	LBB0_3
LBB0_11:
	mov	x22, x0
LBB0_12:
	mov	x0, x19
	bl	_gpu_i2c_stop
	tbz	w0, #31, LBB0_16
; %bb.13:
	mov	x2, x0
	ldr	w0, [x19]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	b	LBB0_16
LBB0_14:
	mov	w20, #0
LBB0_15:
	mov	x0, x19
	bl	_gpu_i2c_stop
	cmp	w0, #0
	csel	w22, w0, w20, lt
LBB0_16:
	ldr	w0, [x19]
	bl	_pm_runtime_mark_last_busy
	ldr	w0, [x19]
	bl	_pm_runtime_put_autosuspend
	mov	x0, x22
	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
LBB0_17:
	mov	x22, x0
	cbnz	w24, LBB0_12
	b	LBB0_16
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_I2C_M_RD,4,2                   ; @I2C_M_RD
	.comm	_I2C_MST_ADDR,8,3               ; @I2C_MST_ADDR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"i2c stop failed %d\n"

	.no_dead_strip	_gpu_i2c_master_xfer
.subsections_via_symbols
