	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_setup_gmbus              ## -- Begin function intel_setup_gmbus
	.p2align	4, 0x90
_intel_setup_gmbus:                     ## @intel_setup_gmbus
	.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	%rdi, %rbx
	movq	8(%rdi), %r15
	callq	_HAS_PCH_SPLIT
	testq	%rax, %rax
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	je	LBB0_2
## %bb.1:
	movq	_PCH_GPIOA@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_GPIOA@GOTPCREL(%rip), %rcx
	subq	(%rcx), %rax
	jmp	LBB0_4
LBB0_2:
	movq	%rbx, %rdi
	callq	_IS_VALLEYVIEW
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	_VLV_DISPLAY_BASE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
LBB0_4:
	movq	%rax, 24(%r15)
	leaq	16(%r15), %rdi
	callq	_mutex_init
	leaq	12(%r15), %rdi
	callq	_init_waitqueue_head
	xorl	%r14d, %r14d
	xorl	%r13d, %r13d
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_5 Depth=1
	addq	%r14, %rbx
	addq	$8, %rbx
	movq	%r12, %rdi
	movl	%r13d, %esi
	callq	_intel_gpio_setup
	movq	%rbx, %rdi
	callq	_i2c_add_adapter
	addq	$48, %r14
	testl	%eax, %eax
	jne	LBB0_9
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	_GMBUS_NUM_PORTS@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	cmpq	%rax, %r13
	jge	LBB0_13
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	(%r15), %rbx
	leaq	(%rbx,%r14), %r12
	movq	_THIS_MODULE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%rbx,%r14)
	movq	_I2C_CLASS_DDC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 28(%rbx,%r14)
	movl	24(%rbx,%r14), %edi
	movq	_gmbus_ports@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax,%r13,8), %rcx
	movl	$4, %esi
	leaq	L_.str(%rip), %rdx
	callq	_snprintf
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	(%rdi), %rax
	movq	%rax, 16(%rbx,%r14)
	movq	%r15, 40(%rbx,%r14)
	movq	_gmbus_algorithm@GOTPCREL(%rip), %rax
	movq	%rax, 8(%rbx,%r14)
	incq	%r13
	movq	_GMBUS_RATE_100KHZ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%r13d, %eax
	movl	%eax, (%rbx,%r14)
	callq	_IS_I830
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	$1, 4(%rbx,%r14)
	jmp	LBB0_8
LBB0_13:
	movl	8(%r15), %edi
	callq	_intel_i2c_reset
	xorl	%r12d, %r12d
	jmp	LBB0_12
LBB0_9:
	movl	%eax, %r12d
	cmpl	$2, %r13d
	je	LBB0_12
## %bb.10:
	addq	$-88, %r14
	movl	$2, %ebx
	subl	%r13d, %ebx
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r15), %rdi
	addq	%r14, %rdi
	callq	_i2c_del_adapter
	addq	$-48, %r14
	incl	%ebx
	jne	LBB0_11
LBB0_12:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PCH_GPIOA,8,3                  ## @PCH_GPIOA
	.comm	_GPIOA,8,3                      ## @GPIOA
	.comm	_VLV_DISPLAY_BASE,8,3           ## @VLV_DISPLAY_BASE
	.comm	_GMBUS_NUM_PORTS,4,2            ## @GMBUS_NUM_PORTS
	.comm	_THIS_MODULE,4,2                ## @THIS_MODULE
	.comm	_I2C_CLASS_DDC,4,2              ## @I2C_CLASS_DDC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"i915 gmbus %s"

	.comm	_gmbus_ports,8,3                ## @gmbus_ports
	.comm	_gmbus_algorithm,4,2            ## @gmbus_algorithm
	.comm	_GMBUS_RATE_100KHZ,4,2          ## @GMBUS_RATE_100KHZ
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_setup_gmbus              ; -- Begin function intel_setup_gmbus
	.p2align	2
_intel_setup_gmbus:                     ; @intel_setup_gmbus
	.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	x19, x0
	ldr	x24, [x0, #8]
	bl	_HAS_PCH_SPLIT
	cbz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _PCH_GPIOA@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PCH_GPIOA@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _GPIOA@GOTPAGE
Lloh4:
	ldr	x9, [x9, _GPIOA@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	sub	x8, x8, x9
	b	LBB0_3
LBB0_2:
	mov	x0, x19
	bl	_IS_VALLEYVIEW
Lloh6:
	adrp	x8, _VLV_DISPLAY_BASE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _VLV_DISPLAY_BASE@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	cmp	x0, #0
	csel	x8, xzr, x8, eq
LBB0_3:
	str	x8, [x24, #24]
	add	x0, x24, #16
	bl	_mutex_init
	add	x0, x24, #12
	bl	_init_waitqueue_head
	mov	x20, #0
Lloh9:
	adrp	x21, l_.str@PAGE
Lloh10:
	add	x21, x21, l_.str@PAGEOFF
	mov	x25, #-88
Lloh11:
	adrp	x28, _GMBUS_RATE_100KHZ@GOTPAGE
Lloh12:
	ldr	x28, [x28, _GMBUS_RATE_100KHZ@GOTPAGEOFF]
Lloh13:
	adrp	x27, _gmbus_algorithm@GOTPAGE
Lloh14:
	ldr	x27, [x27, _gmbus_algorithm@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x23
	mov	x1, x20
	bl	_intel_gpio_setup
	mov	x0, x22
	bl	_i2c_add_adapter
	add	x25, x25, #48
	cbnz	w0, LBB0_9
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
Lloh15:
	adrp	x8, _GMBUS_NUM_PORTS@GOTPAGE
Lloh16:
	ldr	x8, [x8, _GMBUS_NUM_PORTS@GOTPAGEOFF]
Lloh17:
	ldrsw	x8, [x8]
	cmp	x20, x8
	b.ge	LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x24]
	add	x26, x8, x25
Lloh18:
	adrp	x8, _THIS_MODULE@GOTPAGE
Lloh19:
	ldr	x8, [x8, _THIS_MODULE@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	str	w8, [x26, #120]
Lloh21:
	adrp	x8, _I2C_CLASS_DDC@GOTPAGE
Lloh22:
	ldr	x8, [x8, _I2C_CLASS_DDC@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	str	w8, [x26, #116]
	ldr	w0, [x26, #112]
Lloh24:
	adrp	x8, _gmbus_ports@GOTPAGE
Lloh25:
	ldr	x8, [x8, _gmbus_ports@GOTPAGEOFF]
Lloh26:
	ldr	x8, [x8]
	ldr	x3, [x8, x20, lsl #3]
	mov	w1, #4
	mov	x2, x21
	bl	_snprintf
	ldr	w8, [x28]
	add	x20, x20, #1
	orr	w8, w8, w20
	mov	x23, x26
	str	w8, [x23, #88]!
	mov	x22, x23
	str	x27, [x22, #8]!
	ldr	x8, [x19]
	str	x8, [x23, #16]
	str	x24, [x23, #40]
	mov	x0, x19
	bl	_IS_I830
	cbz	x0, LBB0_4
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	w8, #1
	str	w8, [x26, #92]
	b	LBB0_4
LBB0_8:
	ldr	w0, [x24, #8]
	bl	_intel_i2c_reset
	mov	w22, #0
	b	LBB0_12
LBB0_9:
	mov	x22, x0
	cmp	w20, #2
	b.eq	LBB0_12
; %bb.10:
	mov	w8, #2
	sub	w19, w8, w20
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x24]
	add	x0, x8, x25
	bl	_i2c_del_adapter
	sub	x25, x25, #48
	adds	w19, w19, #1
	b.lo	LBB0_11
LBB0_12:
	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
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_PCH_GPIOA,8,3                  ; @PCH_GPIOA
	.comm	_GPIOA,8,3                      ; @GPIOA
	.comm	_VLV_DISPLAY_BASE,8,3           ; @VLV_DISPLAY_BASE
	.comm	_GMBUS_NUM_PORTS,4,2            ; @GMBUS_NUM_PORTS
	.comm	_THIS_MODULE,4,2                ; @THIS_MODULE
	.comm	_I2C_CLASS_DDC,4,2              ; @I2C_CLASS_DDC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"i915 gmbus %s"

	.comm	_gmbus_ports,8,3                ; @gmbus_ports
	.comm	_gmbus_algorithm,4,2            ; @gmbus_algorithm
	.comm	_GMBUS_RATE_100KHZ,4,2          ; @GMBUS_RATE_100KHZ
.subsections_via_symbols
