	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_gmbus_setup              ## -- Begin function intel_gmbus_setup
	.p2align	4, 0x90
_intel_gmbus_setup:                     ## @intel_gmbus_setup
	.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
	movq	%rdi, %r15
	movq	24(%rdi), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	callq	_HAS_DISPLAY
	xorl	%r13d, %r13d
	testl	%eax, %eax
	je	LBB0_19
## %bb.1:
	movq	%r15, %rdi
	callq	_IS_VALLEYVIEW
	movq	_VLV_DISPLAY_BASE@GOTPCREL(%rip), %rbx
	testq	%rax, %rax
	jne	LBB0_5
## %bb.2:
	movq	%r15, %rdi
	callq	_IS_CHERRYVIEW
	testq	%rax, %rax
	je	LBB0_3
LBB0_5:
	movl	(%rbx), %eax
	movl	%eax, 16(%r15)
LBB0_6:
	leaq	12(%r15), %rdi
	callq	_mutex_init
	leaq	8(%r15), %rdi
	callq	_init_waitqueue_head
	movq	(%r15), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	je	LBB0_18
## %bb.7:
	xorl	%r12d, %r12d
	xorl	%ebx, %ebx
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_8 Depth=1
	leaq	(%r12,%r13), %r14
	addq	$8, %r14
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, %esi
	callq	_intel_gpio_setup
	movq	%r14, %rdi
	callq	_i2c_add_adapter
	testl	%eax, %eax
	jne	LBB0_12
LBB0_17:                                ##   in Loop: Header=BB0_8 Depth=1
	incq	%rbx
	movq	(%r15), %rdi
	callq	_ARRAY_SIZE
	movl	%eax, %eax
	addq	$64, %r12
	cmpq	%rax, %rbx
	jae	LBB0_18
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_intel_gmbus_is_valid_pin
	testl	%eax, %eax
	je	LBB0_17
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movq	(%r15), %r13
	leaq	(%r12,%r13), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	_THIS_MODULE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 48(%r13,%r12)
	movq	_I2C_CLASS_DDC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 44(%r13,%r12)
	movl	40(%r13,%r12), %r14d
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_get_gmbus_pin
	movq	(%rax), %rcx
	movl	%r14d, %edi
	movl	$4, %esi
	leaq	L_.str(%rip), %rdx
	callq	_snprintf
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 32(%r13,%r12)
	movq	%r15, 56(%r13,%r12)
	movq	_gmbus_algorithm@GOTPCREL(%rip), %rax
	movq	%rax, 24(%r13,%r12)
	movq	_gmbus_lock_ops@GOTPCREL(%rip), %rax
	movq	%rax, 16(%r13,%r12)
	movl	$1, 8(%r13,%r12)
	movq	_GMBUS_RATE_100KHZ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%ebx, %eax
	movl	%eax, (%r13,%r12)
	movq	%r15, %rdi
	callq	_IS_I830
	testq	%rax, %rax
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_8 Depth=1
	movl	$1, 4(%r13,%r12)
	jmp	LBB0_11
LBB0_18:
	movq	%r15, %rdi
	callq	_intel_gmbus_reset
	xorl	%r13d, %r13d
LBB0_19:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movl	%eax, %r13d
	testl	%ebx, %ebx
	je	LBB0_19
## %bb.13:
	decq	%rbx
	movl	%ebx, %r14d
	shlq	$6, %r14
	orq	$8, %r14
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_14 Depth=1
	addq	$-64, %r14
	addl	$-1, %ebx
	jae	LBB0_19
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_intel_gmbus_is_valid_pin
	testl	%eax, %eax
	je	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_14 Depth=1
	movq	(%r15), %rdi
	addq	%r14, %rdi
	callq	_i2c_del_adapter
	jmp	LBB0_16
LBB0_3:
	movq	%r15, %rdi
	callq	_HAS_GMCH
	testl	%eax, %eax
	jne	LBB0_6
## %bb.4:
	movq	_PCH_DISPLAY_BASE@GOTPCREL(%rip), %rbx
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.comm	_VLV_DISPLAY_BASE,4,2           ## @VLV_DISPLAY_BASE
	.comm	_PCH_DISPLAY_BASE,4,2           ## @PCH_DISPLAY_BASE
	.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_algorithm,4,2            ## @gmbus_algorithm
	.comm	_gmbus_lock_ops,4,2             ## @gmbus_lock_ops
	.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_gmbus_setup              ; -- Begin function intel_gmbus_setup
	.p2align	2
_intel_gmbus_setup:                     ; @intel_gmbus_setup
	.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, #24]
	bl	_HAS_DISPLAY
	cbz	w0, LBB0_13
; %bb.1:
	mov	x0, x19
	bl	_IS_VALLEYVIEW
	cbnz	x0, LBB0_3
; %bb.2:
	mov	x0, x19
	bl	_IS_CHERRYVIEW
	cbz	x0, LBB0_20
LBB0_3:
Lloh0:
	adrp	x8, _VLV_DISPLAY_BASE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VLV_DISPLAY_BASE@GOTPAGEOFF]
LBB0_4:
	ldr	w8, [x8]
	str	w8, [x19, #16]
LBB0_5:
	add	x0, x19, #12
	bl	_mutex_init
	add	x0, x19, #8
	bl	_init_waitqueue_head
	ldr	x0, [x19]
	bl	_ARRAY_SIZE
	cbz	w0, LBB0_12
; %bb.6:
	mov	x25, #0
	mov	x20, #0
	mov	w28, #1
Lloh2:
	adrp	x27, _gmbus_lock_ops@GOTPAGE
Lloh3:
	ldr	x27, [x27, _gmbus_lock_ops@GOTPAGEOFF]
Lloh4:
	adrp	x21, l_.str@PAGE
Lloh5:
	add	x21, x21, l_.str@PAGEOFF
Lloh6:
	adrp	x26, _GMBUS_RATE_100KHZ@GOTPAGE
Lloh7:
	ldr	x26, [x26, _GMBUS_RATE_100KHZ@GOTPAGEOFF]
	b	LBB0_9
LBB0_7:                                 ;   in Loop: Header=BB0_9 Depth=1
	mov	x0, x22
	mov	x1, x20
	bl	_intel_gpio_setup
	mov	x0, x23
	bl	_i2c_add_adapter
	cbnz	w0, LBB0_15
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	add	x20, x20, #1
	ldr	x0, [x19]
	bl	_ARRAY_SIZE
	add	x25, x25, #64
	cmp	x20, w0, uxtw
	b.hs	LBB0_12
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x20
	bl	_intel_gmbus_is_valid_pin
	cbz	w0, LBB0_8
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	x8, [x19]
	add	x22, x8, x25
Lloh8:
	adrp	x8, _THIS_MODULE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _THIS_MODULE@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	str	w8, [x22, #48]
Lloh11:
	adrp	x8, _I2C_CLASS_DDC@GOTPAGE
Lloh12:
	ldr	x8, [x8, _I2C_CLASS_DDC@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	str	w8, [x22, #44]
	ldr	w23, [x22, #40]
	mov	x0, x19
	mov	x1, x20
	bl	_get_gmbus_pin
	ldr	x3, [x0]
	mov	x0, x23
	mov	w1, #4
	mov	x2, x21
	bl	_snprintf
	mov	x23, x22
	str	w28, [x23, #8]!
	str	x24, [x22, #32]
	str	x19, [x22, #56]
Lloh14:
	adrp	x8, _gmbus_algorithm@GOTPAGE
Lloh15:
	ldr	x8, [x8, _gmbus_algorithm@GOTPAGEOFF]
	stp	x27, x8, [x22, #16]
	ldr	w8, [x26]
	orr	w8, w8, w20
	str	w8, [x22]
	mov	x0, x19
	bl	_IS_I830
	cbz	x0, LBB0_7
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=1
	str	w28, [x22, #4]
	b	LBB0_7
LBB0_12:
	mov	x0, x19
	bl	_intel_gmbus_reset
LBB0_13:
	mov	w22, #0
LBB0_14:
	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_15:
	mov	x22, x0
	cbz	w20, LBB0_14
; %bb.16:
	sub	x20, x20, #1
	and	x8, x20, #0xffffffff
	mov	w21, #8
	bfi	x21, x8, #6, #32
	b	LBB0_18
LBB0_17:                                ;   in Loop: Header=BB0_18 Depth=1
	sub	x21, x21, #64
	sub	w20, w20, #1
	cmn	w20, #1
	b.eq	LBB0_14
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x20
	bl	_intel_gmbus_is_valid_pin
	cbz	w0, LBB0_17
; %bb.19:                               ;   in Loop: Header=BB0_18 Depth=1
	ldr	x8, [x19]
	add	x0, x8, x21
	bl	_i2c_del_adapter
	b	LBB0_17
LBB0_20:
	mov	x0, x19
	bl	_HAS_GMCH
	cbnz	w0, LBB0_5
; %bb.21:
Lloh16:
	adrp	x8, _PCH_DISPLAY_BASE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _PCH_DISPLAY_BASE@GOTPAGEOFF]
	b	LBB0_4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_VLV_DISPLAY_BASE,4,2           ; @VLV_DISPLAY_BASE
	.comm	_PCH_DISPLAY_BASE,4,2           ; @PCH_DISPLAY_BASE
	.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_algorithm,4,2            ; @gmbus_algorithm
	.comm	_gmbus_lock_ops,4,2             ; @gmbus_lock_ops
	.comm	_GMBUS_RATE_100KHZ,4,2          ; @GMBUS_RATE_100KHZ
.subsections_via_symbols
