	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __bxt_hpd_detection_setup
___bxt_hpd_detection_setup:             ## @__bxt_hpd_detection_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movq	%rdi, %r14
	movq	_PCH_PORT_HOTPLUG@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	callq	_I915_READ
	movl	%eax, %ebx
	movq	_PORTA_HOTPLUG_ENABLE@GOTPCREL(%rip), %rax
	movq	_PORTB_HOTPLUG_ENABLE@GOTPCREL(%rip), %rcx
	movq	_PORTC_HOTPLUG_ENABLE@GOTPCREL(%rip), %rdx
	orl	(%rax), %ebx
	orl	(%rcx), %ebx
	orl	(%rdx), %ebx
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	movl	%r15d, %edx
	callq	_DRM_DEBUG_KMS
	movq	_BXT_DDI_HPD_INVERT_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	notl	%r12d
	andl	%ebx, %r12d
	movq	_BXT_DE_PORT_HP_DDIA@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_3
## %bb.1:
	movq	_PORT_A@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_intel_bios_is_port_hpd_inverted
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movq	_BXT_DDIA_HPD_INVERT@GOTPCREL(%rip), %rax
	orl	(%rax), %r12d
LBB0_3:
	movq	_BXT_DE_PORT_HP_DDIB@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_6
## %bb.4:
	movq	_PORT_B@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_intel_bios_is_port_hpd_inverted
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movq	_BXT_DDIB_HPD_INVERT@GOTPCREL(%rip), %rax
	orl	(%rax), %r12d
LBB0_6:
	movq	_BXT_DE_PORT_HP_DDIC@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_9
## %bb.7:
	movq	_PORT_C@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_intel_bios_is_port_hpd_inverted
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	movq	_BXT_DDIC_HPD_INVERT@GOTPCREL(%rip), %rax
	orl	(%rax), %r12d
LBB0_9:
	movl	(%r13), %edi
	movl	%r12d, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_I915_WRITE                     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_PCH_PORT_HOTPLUG,4,2           ## @PCH_PORT_HOTPLUG
	.comm	_PORTA_HOTPLUG_ENABLE,4,2       ## @PORTA_HOTPLUG_ENABLE
	.comm	_PORTB_HOTPLUG_ENABLE,4,2       ## @PORTB_HOTPLUG_ENABLE
	.comm	_PORTC_HOTPLUG_ENABLE,4,2       ## @PORTC_HOTPLUG_ENABLE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invert bit setting: hp_ctl:%x hp_port:%x\n"

	.comm	_BXT_DDI_HPD_INVERT_MASK,4,2    ## @BXT_DDI_HPD_INVERT_MASK
	.comm	_BXT_DE_PORT_HP_DDIA,4,2        ## @BXT_DE_PORT_HP_DDIA
	.comm	_PORT_A,4,2                     ## @PORT_A
	.comm	_BXT_DDIA_HPD_INVERT,4,2        ## @BXT_DDIA_HPD_INVERT
	.comm	_BXT_DE_PORT_HP_DDIB,4,2        ## @BXT_DE_PORT_HP_DDIB
	.comm	_PORT_B,4,2                     ## @PORT_B
	.comm	_BXT_DDIB_HPD_INVERT,4,2        ## @BXT_DDIB_HPD_INVERT
	.comm	_BXT_DE_PORT_HP_DDIC,4,2        ## @BXT_DE_PORT_HP_DDIC
	.comm	_PORT_C,4,2                     ## @PORT_C
	.comm	_BXT_DDIC_HPD_INVERT,4,2        ## @BXT_DDIC_HPD_INVERT
	.no_dead_strip	___bxt_hpd_detection_setup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function __bxt_hpd_detection_setup
___bxt_hpd_detection_setup:             ; @__bxt_hpd_detection_setup
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x22, _PCH_PORT_HOTPLUG@GOTPAGE
Lloh1:
	ldr	x22, [x22, _PCH_PORT_HOTPLUG@GOTPAGEOFF]
	ldr	w0, [x22]
	bl	_I915_READ
Lloh2:
	adrp	x8, _PORTA_HOTPLUG_ENABLE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PORTA_HOTPLUG_ENABLE@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _PORTB_HOTPLUG_ENABLE@GOTPAGE
Lloh6:
	ldr	x9, [x9, _PORTB_HOTPLUG_ENABLE@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
Lloh8:
	adrp	x10, _PORTC_HOTPLUG_ENABLE@GOTPAGE
Lloh9:
	ldr	x10, [x10, _PORTC_HOTPLUG_ENABLE@GOTPAGEOFF]
Lloh10:
	ldr	w10, [x10]
	orr	w8, w8, w0
	orr	w8, w8, w9
	orr	w20, w8, w10
Lloh11:
	adrp	x0, l_.str@PAGE
Lloh12:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	mov	x2, x21
	bl	_DRM_DEBUG_KMS
Lloh13:
	adrp	x8, _BXT_DDI_HPD_INVERT_MASK@GOTPAGE
Lloh14:
	ldr	x8, [x8, _BXT_DDI_HPD_INVERT_MASK@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	bic	w20, w20, w8
Lloh16:
	adrp	x8, _BXT_DE_PORT_HP_DDIA@GOTPAGE
Lloh17:
	ldr	x8, [x8, _BXT_DE_PORT_HP_DDIA@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_3
; %bb.1:
Lloh19:
	adrp	x8, _PORT_A@GOTPAGE
Lloh20:
	ldr	x8, [x8, _PORT_A@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_intel_bios_is_port_hpd_inverted
	cbz	x0, LBB0_3
; %bb.2:
Lloh22:
	adrp	x8, _BXT_DDIA_HPD_INVERT@GOTPAGE
Lloh23:
	ldr	x8, [x8, _BXT_DDIA_HPD_INVERT@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	orr	w20, w8, w20
LBB0_3:
Lloh25:
	adrp	x8, _BXT_DE_PORT_HP_DDIB@GOTPAGE
Lloh26:
	ldr	x8, [x8, _BXT_DE_PORT_HP_DDIB@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_6
; %bb.4:
Lloh28:
	adrp	x8, _PORT_B@GOTPAGE
Lloh29:
	ldr	x8, [x8, _PORT_B@GOTPAGEOFF]
Lloh30:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_intel_bios_is_port_hpd_inverted
	cbz	x0, LBB0_6
; %bb.5:
Lloh31:
	adrp	x8, _BXT_DDIB_HPD_INVERT@GOTPAGE
Lloh32:
	ldr	x8, [x8, _BXT_DDIB_HPD_INVERT@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
	orr	w20, w8, w20
LBB0_6:
Lloh34:
	adrp	x8, _BXT_DE_PORT_HP_DDIC@GOTPAGE
Lloh35:
	ldr	x8, [x8, _BXT_DE_PORT_HP_DDIC@GOTPAGEOFF]
Lloh36:
	ldr	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_9
; %bb.7:
Lloh37:
	adrp	x8, _PORT_C@GOTPAGE
Lloh38:
	ldr	x8, [x8, _PORT_C@GOTPAGEOFF]
Lloh39:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_intel_bios_is_port_hpd_inverted
	cbz	x0, LBB0_9
; %bb.8:
Lloh40:
	adrp	x8, _BXT_DDIC_HPD_INVERT@GOTPAGE
Lloh41:
	ldr	x8, [x8, _BXT_DDIC_HPD_INVERT@GOTPAGEOFF]
Lloh42:
	ldr	w8, [x8]
	orr	w20, w8, w20
LBB0_9:
	ldr	w0, [x22]
	mov	x1, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_I915_WRITE
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.cfi_endproc
                                        ; -- End function
	.comm	_PCH_PORT_HOTPLUG,4,2           ; @PCH_PORT_HOTPLUG
	.comm	_PORTA_HOTPLUG_ENABLE,4,2       ; @PORTA_HOTPLUG_ENABLE
	.comm	_PORTB_HOTPLUG_ENABLE,4,2       ; @PORTB_HOTPLUG_ENABLE
	.comm	_PORTC_HOTPLUG_ENABLE,4,2       ; @PORTC_HOTPLUG_ENABLE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invert bit setting: hp_ctl:%x hp_port:%x\n"

	.comm	_BXT_DDI_HPD_INVERT_MASK,4,2    ; @BXT_DDI_HPD_INVERT_MASK
	.comm	_BXT_DE_PORT_HP_DDIA,4,2        ; @BXT_DE_PORT_HP_DDIA
	.comm	_PORT_A,4,2                     ; @PORT_A
	.comm	_BXT_DDIA_HPD_INVERT,4,2        ; @BXT_DDIA_HPD_INVERT
	.comm	_BXT_DE_PORT_HP_DDIB,4,2        ; @BXT_DE_PORT_HP_DDIB
	.comm	_PORT_B,4,2                     ; @PORT_B
	.comm	_BXT_DDIB_HPD_INVERT,4,2        ; @BXT_DDIB_HPD_INVERT
	.comm	_BXT_DE_PORT_HP_DDIC,4,2        ; @BXT_DE_PORT_HP_DDIC
	.comm	_PORT_C,4,2                     ; @PORT_C
	.comm	_BXT_DDIC_HPD_INVERT,4,2        ; @BXT_DDIC_HPD_INVERT
	.no_dead_strip	___bxt_hpd_detection_setup
.subsections_via_symbols
