	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mdfld__intel_pipe_set_base
_mdfld__intel_pipe_set_base:            ## @mdfld__intel_pipe_set_base
	.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, -56(%rbp)                 ## 4-byte Spill
	movl	%esi, -52(%rbp)                 ## 4-byte Spill
	movq	(%rdi), %rax
	movq	8(%rdi), %r13
	movq	8(%r13), %rbx
	movq	(%rax), %r15
	callq	_to_gma_crtc
	movl	(%rax), %r14d
	movq	(%rbx), %rbx
	movq	_globle_dev@GOTPCREL(%rip), %rdi
	movq	%r13, %rsi
	movl	$16, %edx
	callq	_memcpy
	movl	(%r13), %edi
	leaq	L_.str(%rip), %rsi
	xorl	%r12d, %r12d
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_dev_dbg
	testq	%r15, %r15
	je	LBB0_1
## %bb.2:
	movq	%r15, %rdi
	callq	_check_fb
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_18
## %bb.3:
	cmpl	$3, %r14d
	jl	LBB0_5
## %bb.4:
	leaq	L_.str.2(%rip), %rdi
	callq	_DRM_ERROR
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_18
LBB0_1:
	movl	(%r13), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_dbg
LBB0_18:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	%r13, %rdi
	movl	$1, %esi
	callq	_gma_power_begin
	testl	%eax, %eax
	je	LBB0_6
## %bb.7:
	movslq	%r14d, %r14
	movq	16(%r15), %rax
	movl	(%rax), %edi
	callq	_to_gtt_range
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	(%r15), %rax
	movq	8(%r15), %rcx
	movslq	(%rax), %rsi
	movl	%esi, %eax
	imull	-56(%rbp), %eax                 ## 4-byte Folded Reload
	movq	(%rcx), %rcx
	movl	(%rcx), %ecx
	imull	-52(%rbp), %ecx                 ## 4-byte Folded Reload
	addl	%eax, %ecx
	movslq	%ecx, %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	shlq	$4, %r14
	movl	12(%rbx,%r14), %edi
	callq	_REG_WRITE
	leaq	(%rbx,%r14), %r12
	addq	$8, %r12
	movl	8(%rbx,%r14), %edi
	callq	_REG_READ
	movq	_DISPPLANE_PIXFORMAT_MASK@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	notq	%rsi
	andq	%rax, %rsi
	movq	8(%r15), %rax
	movq	(%rax), %rcx
	movl	(%rcx), %ecx
	decl	%ecx
	andl	$536870911, %ecx                ## imm = 0x1FFFFFFF
	leal	-2(%rcx), %edx
	cmpl	$2, %edx
	jb	LBB0_14
## %bb.8:
	cmpl	$1, %ecx
	je	LBB0_11
## %bb.9:
	testl	%ecx, %ecx
	jne	LBB0_16
## %bb.10:
	movq	_DISPPLANE_8BPP@GOTPCREL(%rip), %rax
	jmp	LBB0_15
LBB0_6:
	xorl	%r12d, %r12d
	jmp	LBB0_18
LBB0_14:
	movq	_DISPPLANE_32BPP_NO_ALPHA@GOTPCREL(%rip), %rax
LBB0_15:
	orq	(%rax), %rsi
LBB0_16:
	movq	-48(%rbp), %r15                 ## 8-byte Reload
LBB0_17:
	movl	(%r12), %edi
	callq	_REG_WRITE
	movl	(%r13), %edi
	leaq	L_.str.3(%rip), %rsi
	xorl	%r12d, %r12d
	movq	%r15, %rdx
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rcx
	movl	-52(%rbp), %r8d                 ## 4-byte Reload
	movl	-56(%rbp), %r9d                 ## 4-byte Reload
	xorl	%eax, %eax
	callq	_dev_dbg
	movl	4(%rbx,%r14), %edi
	movq	%r15, %rsi
	callq	_REG_WRITE
	movl	4(%rbx,%r14), %edi
	callq	_REG_READ
	movl	(%rbx,%r14), %edi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_REG_WRITE
	movl	(%rbx,%r14), %edi
	callq	_REG_READ
	movq	%r13, %rdi
	callq	_gma_power_end
	jmp	LBB0_18
LBB0_11:
	cmpl	$15, 8(%rax)
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	jne	LBB0_13
## %bb.12:
	movq	_DISPPLANE_15_16BPP@GOTPCREL(%rip), %rax
	orq	(%rax), %rsi
	jmp	LBB0_17
LBB0_13:
	movq	_DISPPLANE_16BPP@GOTPCREL(%rip), %rax
	orq	(%rax), %rsi
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.comm	_globle_dev,4,2                 ## @globle_dev
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"pipe = 0x%x.\n"

L_.str.1:                               ## @.str.1
	.asciz	"No FB bound\n"

L_.str.2:                               ## @.str.2
	.asciz	"Illegal Pipe Number.\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_DISPPLANE_PIXFORMAT_MASK,8,3   ## @DISPPLANE_PIXFORMAT_MASK
	.comm	_DISPPLANE_8BPP,8,3             ## @DISPPLANE_8BPP
	.comm	_DISPPLANE_15_16BPP,8,3         ## @DISPPLANE_15_16BPP
	.comm	_DISPPLANE_16BPP,8,3            ## @DISPPLANE_16BPP
	.comm	_DISPPLANE_32BPP_NO_ALPHA,8,3   ## @DISPPLANE_32BPP_NO_ALPHA
L_.str.3:                               ## @.str.3
	.asciz	"Writing base %08lX %08lX %d %d\n"

	.no_dead_strip	_mdfld__intel_pipe_set_base
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mdfld__intel_pipe_set_base
_mdfld__intel_pipe_set_base:            ; @mdfld__intel_pipe_set_base
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x21, x2
	mov	x20, x1
	ldp	x8, x19, [x0]
	ldr	x22, [x19, #8]
	ldr	x24, [x8]
	bl	_to_gma_crtc
	ldr	x25, [x22]
	ldrsw	x26, [x0]
Lloh0:
	adrp	x0, _globle_dev@GOTPAGE
Lloh1:
	ldr	x0, [x0, _globle_dev@GOTPAGEOFF]
	mov	x1, x19
	mov	w2, #16
	bl	_memcpy
	ldr	w0, [x19]
	str	x26, [sp]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
	cbz	x24, LBB0_4
; %bb.1:
	mov	x0, x24
	bl	_check_fb
	cbnz	w0, LBB0_6
; %bb.2:
	cmp	w26, #3
	b.lt	LBB0_7
; %bb.3:
Lloh4:
	adrp	x0, l_.str.2@PAGE
Lloh5:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DRM_ERROR
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_6
LBB0_4:
	ldr	w0, [x19]
Lloh9:
	adrp	x1, l_.str.1@PAGE
Lloh10:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_dbg
LBB0_5:
	mov	w0, #0
LBB0_6:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_7:
	mov	x0, x19
	mov	w1, #1
	bl	_gma_power_begin
	cbz	w0, LBB0_6
; %bb.8:
	ldr	x8, [x24, #16]
	ldr	w0, [x8]
	bl	_to_gtt_range
	ldr	x22, [x0]
	ldp	x8, x9, [x24]
	ldrsw	x1, [x8]
	mul	w8, w1, w21
	ldr	x9, [x9]
	ldr	w9, [x9]
	madd	w8, w9, w20, w8
	sxtw	x23, w8
	add	x27, x25, x26, lsl #4
	ldr	w0, [x27, #12]
	bl	_REG_WRITE
	ldr	w0, [x27, #8]!
	bl	_REG_READ
Lloh11:
	adrp	x8, _DISPPLANE_PIXFORMAT_MASK@GOTPAGE
Lloh12:
	ldr	x8, [x8, _DISPPLANE_PIXFORMAT_MASK@GOTPAGEOFF]
Lloh13:
	ldr	x8, [x8]
	bic	x1, x0, x8
	ldr	x8, [x24, #8]
	ldr	x9, [x8]
	ldr	w9, [x9]
	sub	w9, w9, #1
	and	w9, w9, #0x1fffffff
	sub	w10, w9, #2
	cmp	w10, #2
	b.lo	LBB0_12
; %bb.9:
	cmp	w9, #1
	b.eq	LBB0_13
; %bb.10:
	cbnz	w9, LBB0_17
; %bb.11:
Lloh14:
	adrp	x8, _DISPPLANE_8BPP@GOTPAGE
Lloh15:
	ldr	x8, [x8, _DISPPLANE_8BPP@GOTPAGEOFF]
	b	LBB0_16
LBB0_12:
Lloh16:
	adrp	x8, _DISPPLANE_32BPP_NO_ALPHA@GOTPAGE
Lloh17:
	ldr	x8, [x8, _DISPPLANE_32BPP_NO_ALPHA@GOTPAGEOFF]
	b	LBB0_16
LBB0_13:
	ldr	w8, [x8, #8]
	cmp	w8, #15
	b.ne	LBB0_15
; %bb.14:
Lloh18:
	adrp	x8, _DISPPLANE_15_16BPP@GOTPAGE
Lloh19:
	ldr	x8, [x8, _DISPPLANE_15_16BPP@GOTPAGEOFF]
	b	LBB0_16
LBB0_15:
Lloh20:
	adrp	x8, _DISPPLANE_16BPP@GOTPAGE
Lloh21:
	ldr	x8, [x8, _DISPPLANE_16BPP@GOTPAGEOFF]
LBB0_16:
	ldr	x8, [x8]
	orr	x1, x8, x1
LBB0_17:
	ldr	w0, [x27]
	bl	_REG_WRITE
	ldr	w0, [x19]
	stp	x20, x21, [sp, #16]
	stp	x22, x23, [sp]
Lloh22:
	adrp	x1, l_.str.3@PAGE
Lloh23:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_dbg
	add	x20, x25, x26, lsl #4
	ldr	w0, [x20, #4]
	mov	x1, x23
	bl	_REG_WRITE
	ldr	w0, [x20, #4]
	bl	_REG_READ
	ldr	w0, [x20]
	mov	x1, x22
	bl	_REG_WRITE
	ldr	w0, [x20]
	bl	_REG_READ
	mov	x0, x19
	bl	_gma_power_end
	b	LBB0_5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_globle_dev,4,2                 ; @globle_dev
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"pipe = 0x%x.\n"

l_.str.1:                               ; @.str.1
	.asciz	"No FB bound\n"

l_.str.2:                               ; @.str.2
	.asciz	"Illegal Pipe Number.\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_DISPPLANE_PIXFORMAT_MASK,8,3   ; @DISPPLANE_PIXFORMAT_MASK
	.comm	_DISPPLANE_8BPP,8,3             ; @DISPPLANE_8BPP
	.comm	_DISPPLANE_15_16BPP,8,3         ; @DISPPLANE_15_16BPP
	.comm	_DISPPLANE_16BPP,8,3            ; @DISPPLANE_16BPP
	.comm	_DISPPLANE_32BPP_NO_ALPHA,8,3   ; @DISPPLANE_32BPP_NO_ALPHA
l_.str.3:                               ; @.str.3
	.asciz	"Writing base %08lX %08lX %d %d\n"

	.no_dead_strip	_mdfld__intel_pipe_set_base
.subsections_via_symbols
