	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gma_pipe_set_base              ## -- Begin function gma_pipe_set_base
	.p2align	4, 0x90
_gma_pipe_set_base:                     ## @gma_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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, -80(%rbp)                 ## 8-byte Spill
	movl	%edx, -60(%rbp)                 ## 4-byte Spill
	movl	%esi, -64(%rbp)                 ## 4-byte Spill
	movq	%rdi, %rbx
	movq	8(%rdi), %r12
	movq	8(%r12), %r15
	callq	_to_gma_crtc
	movq	(%rbx), %rcx
	movq	(%rcx), %r14
	movslq	(%rax), %r13
	movq	(%r15), %rbx
	movq	%r12, %rdi
	movl	$1, %esi
	callq	_gma_power_begin
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	testq	%r14, %r14
	je	LBB0_3
## %bb.4:
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movq	8(%r14), %rax
	movl	(%rax), %edi
	callq	_to_gtt_range
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_psb_gtt_pin
	movl	%eax, %r15d
	testl	%eax, %eax
	js	LBB0_21
## %bb.5:
	movl	%r15d, -56(%rbp)                ## 4-byte Spill
	movq	(%rbx), %rax
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	movq	(%r14), %rax
	movq	16(%r14), %rcx
	movslq	(%rax), %rsi
	movq	(%rcx), %rax
	movl	(%rax), %ebx
	imull	-64(%rbp), %ebx                 ## 4-byte Folded Reload
	shlq	$4, %r13
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	movl	12(%r15,%r13), %edi
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	callq	_REG_WRITE
	movl	8(%r15,%r13), %edi
	callq	_REG_READ
	movq	_DISPPLANE_PIXFORMAT_MASK@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	16(%r14), %rdx
	movq	(%rdx), %rsi
	movl	(%rsi), %esi
	decl	%esi
	andl	$536870911, %esi                ## imm = 0x1FFFFFFF
	leal	-2(%rsi), %edi
	cmpl	$2, %edi
	jb	LBB0_15
## %bb.6:
	testl	%esi, %esi
	je	LBB0_7
## %bb.11:
	cmpl	$1, %esi
	movl	-56(%rbp), %r15d                ## 4-byte Reload
	jne	LBB0_16
## %bb.12:
	cmpl	$15, 8(%rdx)
	jne	LBB0_13
## %bb.14:
	movq	_DISPPLANE_15_16BPP@GOTPCREL(%rip), %rdx
	jmp	LBB0_9
LBB0_1:
	xorl	%r15d, %r15d
	jmp	LBB0_22
LBB0_3:
	movl	(%r12), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	xorl	%r15d, %r15d
	jmp	LBB0_19
LBB0_15:
	movq	_DISPPLANE_32BPP_NO_ALPHA@GOTPCREL(%rip), %rdx
	jmp	LBB0_8
LBB0_7:
	movq	_DISPPLANE_8BPP@GOTPCREL(%rip), %rdx
LBB0_8:
	movl	-56(%rbp), %r15d                ## 4-byte Reload
LBB0_9:
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	imull	-60(%rbp), %esi                 ## 4-byte Folded Reload
	addl	%esi, %ebx
	movslq	%ebx, %r14
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	addq	%r13, %rsi
	addq	$8, %rsi
	notq	%rcx
	andq	%rcx, %rax
	orq	(%rdx), %rax
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movl	(%rsi), %edi
	movq	%rax, %rsi
	callq	_REG_WRITE
	movl	(%r12), %edi
	leaq	L_.str.2(%rip), %rsi
	movq	-88(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdx
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movq	%r14, %rcx
	movl	-64(%rbp), %r8d                 ## 4-byte Reload
	movl	-60(%rbp), %r9d                 ## 4-byte Reload
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	callq	_dev_dbg
	movq	%r12, %rdi
	callq	_IS_PSB
	movl	4(%r14,%r13), %edi
	testq	%rax, %rax
	je	LBB0_17
## %bb.10:
	addq	-48(%rbp), %rbx                 ## 8-byte Folded Reload
	movq	%rbx, %rsi
	callq	_REG_WRITE
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	-4(%rax), %edi
	jmp	LBB0_18
LBB0_17:
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_REG_WRITE
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	-4(%rax), %edi
	callq	_REG_READ
	movl	(%r14,%r13), %edi
	movq	%rbx, %rsi
	callq	_REG_WRITE
	movl	(%r14,%r13), %edi
LBB0_18:
	callq	_REG_READ
LBB0_19:
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	testq	%rax, %rax
	je	LBB0_21
## %bb.20:
	movq	8(%rax), %rax
	movl	(%rax), %edi
	callq	_to_gtt_range
	movq	%rax, %rdi
	callq	_psb_gtt_unpin
LBB0_21:
	movq	%r12, %rdi
	callq	_gma_power_end
LBB0_22:
	movl	%r15d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	movl	(%r12), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_21
LBB0_13:
	movq	_DISPPLANE_16BPP@GOTPCREL(%rip), %rdx
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"No FB bound\n"

	.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.1:                               ## @.str.1
	.asciz	"Unknown color depth\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.2:                               ## @.str.2
	.asciz	"Writing base %08lX %08lX %d %d\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gma_pipe_set_base              ; -- Begin function gma_pipe_set_base
	.p2align	2
_gma_pipe_set_base:                     ; @gma_pipe_set_base
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x25, x3
	mov	x22, x2
	mov	x23, x1
	mov	x21, x0
	ldr	x19, [x0, #8]
	ldr	x24, [x19, #8]
	bl	_to_gma_crtc
	ldr	x8, [x21]
	ldr	x20, [x8]
	ldrsw	x27, [x0]
	ldr	x26, [x24]
	mov	x0, x19
	mov	w1, #1
	bl	_gma_power_begin
	cbz	w0, LBB0_7
; %bb.1:
	cbz	x20, LBB0_8
; %bb.2:
	ldr	x8, [x20, #8]
	ldr	w0, [x8]
	bl	_to_gtt_range
	mov	x24, x0
	bl	_psb_gtt_pin
	mov	x21, x0
	tbnz	w0, #31, LBB0_16
; %bb.3:
	ldr	x8, [x24]
	stp	x8, x25, [sp]                   ; 16-byte Folded Spill
	ldr	x8, [x20]
	ldrsw	x25, [x8]
	ldr	x8, [x20, #16]
	ldr	x8, [x8]
	ldr	w24, [x8]
	add	x28, x26, x27, lsl #4
	ldr	w0, [x28, #12]
	mov	x1, x25
	bl	_REG_WRITE
	ldr	w0, [x28, #8]!
	bl	_REG_READ
Lloh0:
	adrp	x8, _DISPPLANE_PIXFORMAT_MASK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DISPPLANE_PIXFORMAT_MASK@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	x9, [x20, #16]
	ldr	x10, [x9]
	ldr	w10, [x10]
	sub	w10, w10, #1
	and	w10, w10, #0x1fffffff
	sub	w11, w10, #2
	cmp	w11, #2
	b.lo	LBB0_9
; %bb.4:
	cbz	w10, LBB0_10
; %bb.5:
	cmp	w10, #1
	b.ne	LBB0_18
; %bb.6:
	ldr	w9, [x9, #8]
Lloh3:
	adrp	x10, _DISPPLANE_16BPP@GOTPAGE
Lloh4:
	ldr	x10, [x10, _DISPPLANE_16BPP@GOTPAGEOFF]
Lloh5:
	adrp	x11, _DISPPLANE_15_16BPP@GOTPAGE
Lloh6:
	ldr	x11, [x11, _DISPPLANE_15_16BPP@GOTPAGEOFF]
	cmp	w9, #15
	csel	x9, x11, x10, eq
	b	LBB0_11
LBB0_7:
	mov	w21, #0
	b	LBB0_17
LBB0_8:
	ldr	w0, [x19]
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	mov	w21, #0
	cbnz	x25, LBB0_15
	b	LBB0_16
LBB0_9:
Lloh9:
	adrp	x9, _DISPPLANE_32BPP_NO_ALPHA@GOTPAGE
Lloh10:
	ldr	x9, [x9, _DISPPLANE_32BPP_NO_ALPHA@GOTPAGEOFF]
	b	LBB0_11
LBB0_10:
Lloh11:
	adrp	x9, _DISPPLANE_8BPP@GOTPAGE
Lloh12:
	ldr	x9, [x9, _DISPPLANE_8BPP@GOTPAGEOFF]
LBB0_11:
	mul	w10, w25, w22
	madd	w10, w24, w23, w10
	sxtw	x25, w10
	bic	x8, x0, x8
	ldr	x9, [x9]
	orr	x1, x9, x8
	ldr	w0, [x28]
	bl	_REG_WRITE
	ldr	w0, [x19]
Lloh13:
	adrp	x1, l_.str.2@PAGE
Lloh14:
	add	x1, x1, l_.str.2@PAGEOFF
	ldr	x24, [sp]                       ; 8-byte Folded Reload
	mov	x2, x24
	mov	x3, x25
	mov	x4, x23
	mov	x5, x22
	bl	_dev_dbg
	mov	x0, x19
	bl	_IS_PSB
	mov	x8, x0
	add	x20, x26, x27, lsl #4
	ldr	w0, [x20, #4]!
	cbz	x8, LBB0_13
; %bb.12:
	add	x1, x24, x25
	bl	_REG_WRITE
	ldr	w0, [x20]
	b	LBB0_14
LBB0_13:
	mov	x1, x25
	bl	_REG_WRITE
	ldr	w0, [x20]
	bl	_REG_READ
	lsl	x20, x27, #4
	ldr	w0, [x26, x20]
	mov	x1, x24
	bl	_REG_WRITE
	ldr	w0, [x26, x20]
LBB0_14:
	bl	_REG_READ
	ldr	x25, [sp, #8]                   ; 8-byte Folded Reload
	cbz	x25, LBB0_16
LBB0_15:
	ldr	x8, [x25, #8]
	ldr	w0, [x8]
	bl	_to_gtt_range
	bl	_psb_gtt_unpin
LBB0_16:
	mov	x0, x19
	bl	_gma_power_end
LBB0_17:
	mov	x0, x21
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_18:
	ldr	w0, [x19]
Lloh15:
	adrp	x1, l_.str.1@PAGE
Lloh16:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
Lloh17:
	adrp	x8, _EINVAL@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_16
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"No FB bound\n"

	.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.1:                               ; @.str.1
	.asciz	"Unknown color depth\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.2:                               ; @.str.2
	.asciz	"Writing base %08lX %08lX %d %d\n"

.subsections_via_symbols
