	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function oaktrail_pipe_set_base
_oaktrail_pipe_set_base:                ## @oaktrail_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, %r15d
	movl	%esi, -48(%rbp)                 ## 4-byte Spill
	movq	%rdi, %rbx
	movq	8(%rdi), %r14
	movq	8(%r14), %r12
	callq	_to_gma_crtc
	movq	(%rbx), %rcx
	movq	(%rcx), %r13
	testq	%r13, %r13
	je	LBB0_7
## %bb.1:
	movl	%r15d, -44(%rbp)                ## 4-byte Spill
	movslq	(%rax), %r15
	movq	(%r12), %r12
	movq	%r14, %rdi
	movl	$1, %esi
	callq	_gma_power_begin
	testl	%eax, %eax
	je	LBB0_8
## %bb.2:
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	16(%r13), %rax
	movl	(%rax), %edi
	callq	_to_gtt_range
	movq	(%rax), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	(%r13), %rax
	movq	8(%r13), %rcx
	movslq	(%rax), %rsi
	movq	(%rcx), %rax
	movl	-48(%rbp), %ebx                 ## 4-byte Reload
	imull	(%rax), %ebx
	shlq	$4, %r15
	movl	12(%r12,%r15), %edi
	movq	%rsi, %r14
	callq	_REG_WRITE
	movl	8(%r12,%r15), %edi
	callq	_REG_READ
	movq	_DISPPLANE_PIXFORMAT_MASK@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	8(%r13), %rdx
	movq	(%rdx), %rsi
	movl	(%rsi), %esi
	decl	%esi
	andl	$536870911, %esi                ## imm = 0x1FFFFFFF
	leal	-2(%rsi), %edi
	cmpl	$2, %edi
	jb	LBB0_9
## %bb.3:
	testl	%esi, %esi
	je	LBB0_10
## %bb.4:
	cmpl	$1, %esi
	jne	LBB0_11
## %bb.5:
	cmpl	$15, 8(%rdx)
	jne	LBB0_12
## %bb.6:
	movq	_DISPPLANE_15_16BPP@GOTPCREL(%rip), %rdx
	jmp	LBB0_13
LBB0_7:
	movl	(%r14), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_dbg
LBB0_8:
	xorl	%ebx, %ebx
	jmp	LBB0_15
LBB0_9:
	movq	_DISPPLANE_32BPP_NO_ALPHA@GOTPCREL(%rip), %rdx
	jmp	LBB0_13
LBB0_10:
	movq	_DISPPLANE_8BPP@GOTPCREL(%rip), %rdx
	jmp	LBB0_13
LBB0_11:
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movl	(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_14
LBB0_12:
	movq	_DISPPLANE_16BPP@GOTPCREL(%rip), %rdx
LBB0_13:
	imull	-44(%rbp), %r14d                ## 4-byte Folded Reload
	addl	%r14d, %ebx
	movslq	%ebx, %rbx
	leaq	(%r12,%r15), %rsi
	addq	$8, %rsi
	notq	%rcx
	andq	%rcx, %rax
	orq	(%rdx), %rax
	movl	(%rsi), %edi
	movq	%rax, %rsi
	callq	_REG_WRITE
	movl	4(%r12,%r15), %edi
	movq	%rbx, %rsi
	callq	_REG_WRITE
	movl	4(%r12,%r15), %edi
	callq	_REG_READ
	movl	(%r12,%r15), %edi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	callq	_REG_WRITE
	movl	(%r12,%r15), %edi
	callq	_REG_READ
	xorl	%ebx, %ebx
	movq	-56(%rbp), %r14                 ## 8-byte Reload
LBB0_14:
	movq	%r14, %rdi
	callq	_gma_power_end
LBB0_15:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.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
	.no_dead_strip	_oaktrail_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 oaktrail_pipe_set_base
_oaktrail_pipe_set_base:                ; @oaktrail_pipe_set_base
	.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	x21, x2
	mov	x20, x1
	mov	x22, x0
	ldr	x19, [x0, #8]
	ldr	x23, [x19, #8]
	bl	_to_gma_crtc
	ldr	x8, [x22]
	ldr	x28, [x8]
	cbz	x28, LBB0_6
; %bb.1:
	ldrsw	x24, [x0]
	ldr	x25, [x23]
	mov	x0, x19
	mov	w1, #1
	bl	_gma_power_begin
	cbz	w0, LBB0_7
; %bb.2:
	ldr	x8, [x28, #16]
	ldr	w0, [x8]
	bl	_to_gtt_range
	ldr	x22, [x0]
	ldp	x8, x9, [x28]
	ldrsw	x23, [x8]
	ldr	x8, [x9]
	ldr	w27, [x8]
	add	x26, x25, x24, lsl #4
	ldr	w0, [x26, #12]
	mov	x1, x23
	bl	_REG_WRITE
	ldr	w0, [x26, #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, [x28, #8]
	ldr	x10, [x9]
	ldr	w10, [x10]
	sub	w10, w10, #1
	and	w10, w10, #0x1fffffff
	sub	w11, w10, #2
	cmp	w11, #2
	b.lo	LBB0_8
; %bb.3:
	cbz	w10, LBB0_9
; %bb.4:
	cmp	w10, #1
	b.ne	LBB0_11
; %bb.5:
	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_10
LBB0_6:
	ldr	w0, [x19]
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
LBB0_7:
	mov	w20, #0
	b	LBB0_13
LBB0_8:
Lloh9:
	adrp	x9, _DISPPLANE_32BPP_NO_ALPHA@GOTPAGE
Lloh10:
	ldr	x9, [x9, _DISPPLANE_32BPP_NO_ALPHA@GOTPAGEOFF]
	b	LBB0_10
LBB0_9:
Lloh11:
	adrp	x9, _DISPPLANE_8BPP@GOTPAGE
Lloh12:
	ldr	x9, [x9, _DISPPLANE_8BPP@GOTPAGEOFF]
LBB0_10:
	mul	w10, w23, w21
	madd	w10, w27, w20, w10
	sxtw	x20, w10
	bic	x8, x0, x8
	ldr	x9, [x9]
	orr	x1, x9, x8
	ldr	w0, [x26]
	bl	_REG_WRITE
	add	x21, x25, x24, lsl #4
	ldr	w0, [x21, #4]
	mov	x1, x20
	bl	_REG_WRITE
	ldr	w0, [x21, #4]
	bl	_REG_READ
	ldr	w0, [x21]
	mov	x1, x22
	bl	_REG_WRITE
	ldr	w0, [x21]
	bl	_REG_READ
	mov	w20, #0
	b	LBB0_12
LBB0_11:
	ldr	w0, [x19]
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
Lloh15:
	adrp	x8, _EINVAL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_12:
	mov	x0, x19
	bl	_gma_power_end
LBB0_13:
	mov	x0, x20
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh13, Lloh14
	.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
	.no_dead_strip	_oaktrail_pipe_set_base
.subsections_via_symbols
