	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sunxi_layer_reserve
_sunxi_layer_reserve:                   ## @sunxi_layer_reserve
	.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	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	(%rdi), %rax
	movq	%rax, -80(%rbp)
	movq	_DISP_LAYER_WORK_MODE_NORMAL@GOTPCREL(%rip), %r15
	movq	(%r15), %rax
	movq	%rax, -72(%rbp)
	movl	40(%rdi), %edi
	movq	_DISP_CMD_LAYER_REQUEST@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-80(%rbp), %r14
	movq	%r14, %rdx
	xorl	%eax, %eax
	callq	_ioctl
	movq	%rax, 8(%rbx)
	movq	(%rbx), %rcx
	movq	%rcx, -80(%rbp)
	movq	%rax, -72(%rbp)
	leaq	-128(%rbp), %r13
	movq	%r13, -64(%rbp)
	movl	40(%rbx), %edi
	movq	_DISP_CMD_LAYER_GET_PARA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdx
	xorl	%eax, %eax
	callq	_ioctl
	movl	$-1, %r14d
	testq	%rax, %rax
	js	LBB0_5
## %bb.1:
	movabsq	$4294967297, %rax               ## imm = 0x100000001
	movq	%rax, -128(%rbp)
	movl	$255, -120(%rbp)
	movl	44(%rbx), %ecx
	movq	-88(%rbp), %rdx
	movl	%ecx, (%rdx)
	movq	%rax, -96(%rbp)
	movq	_DISP_FORMAT_ARGB8888@GOTPCREL(%rip), %r12
	movq	(%r12), %rax
	movq	%rax, -104(%rbp)
	movq	_DISP_SEQ_ARGB@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -108(%rbp)
	movq	_DISP_MOD_INTERLEAVED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -112(%rbp)
	movups	(%rbx), %xmm0
	movaps	%xmm0, -80(%rbp)
	movq	%r13, -64(%rbp)
	movl	40(%rbx), %edi
	movq	_DISP_CMD_LAYER_SET_PARA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-80(%rbp), %rdx
	xorl	%eax, %eax
	callq	_ioctl
	testq	%rax, %rax
	js	LBB0_5
## %bb.2:
	movq	_DISP_LAYER_WORK_MODE_SCALER@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%rbx, %rdi
	callq	_sunxi_layer_change_work_mode
	testq	%rax, %rax
	jne	LBB0_4
## %bb.3:
	movl	$1, 16(%rbx)
LBB0_4:
	movq	(%r15), %rsi
	movq	%rbx, %rdi
	callq	_sunxi_layer_change_work_mode
	movq	$0, 32(%rbx)
	movq	(%r12), %rax
	movq	%rax, 24(%rbx)
	movl	8(%rbx), %r14d
LBB0_5:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_7
## %bb.6:
	movl	%r14d, %eax
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_DISP_LAYER_WORK_MODE_NORMAL,8,3 ## @DISP_LAYER_WORK_MODE_NORMAL
	.comm	_DISP_CMD_LAYER_REQUEST,4,2     ## @DISP_CMD_LAYER_REQUEST
	.comm	_DISP_CMD_LAYER_GET_PARA,4,2    ## @DISP_CMD_LAYER_GET_PARA
	.comm	_DISP_FORMAT_ARGB8888,8,3       ## @DISP_FORMAT_ARGB8888
	.comm	_DISP_SEQ_ARGB,4,2              ## @DISP_SEQ_ARGB
	.comm	_DISP_MOD_INTERLEAVED,4,2       ## @DISP_MOD_INTERLEAVED
	.comm	_DISP_CMD_LAYER_SET_PARA,4,2    ## @DISP_CMD_LAYER_SET_PARA
	.comm	_DISP_LAYER_WORK_MODE_SCALER,8,3 ## @DISP_LAYER_WORK_MODE_SCALER
	.no_dead_strip	_sunxi_layer_reserve
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sunxi_layer_reserve
_sunxi_layer_reserve:                   ; @sunxi_layer_reserve
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #176
	.cfi_def_cfa_offset 176
	stp	x24, x23, [sp, #112]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #128]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #144]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #160]            ; 16-byte Folded Spill
	add	x29, sp, #160
	.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
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
	ldr	x8, [x0]
Lloh3:
	adrp	x20, _DISP_LAYER_WORK_MODE_NORMAL@GOTPAGE
Lloh4:
	ldr	x20, [x20, _DISP_LAYER_WORK_MODE_NORMAL@GOTPAGEOFF]
	ldr	x9, [x20]
	stp	x8, x9, [sp, #64]
	ldr	w0, [x0, #40]
Lloh5:
	adrp	x8, _DISP_CMD_LAYER_REQUEST@GOTPAGE
Lloh6:
	ldr	x8, [x8, _DISP_CMD_LAYER_REQUEST@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	add	x21, sp, #64
	str	x21, [sp]
	bl	_ioctl
	str	x0, [x19, #8]
	ldr	x8, [x19]
	stp	x8, x0, [sp, #64]
	add	x23, sp, #16
	str	x23, [sp, #80]
	ldr	w0, [x19, #40]
Lloh8:
	adrp	x8, _DISP_CMD_LAYER_GET_PARA@GOTPAGE
Lloh9:
	ldr	x8, [x8, _DISP_CMD_LAYER_GET_PARA@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	str	x21, [sp]
	bl	_ioctl
	tbnz	x0, #63, LBB0_5
; %bb.1:
	movi.2s	v0, #1
	str	d0, [sp, #16]
	mov	w8, #255
	str	w8, [sp, #24]
	ldr	w8, [x19, #44]
	ldr	x9, [sp, #56]
	str	w8, [x9]
Lloh11:
	adrp	x22, _DISP_FORMAT_ARGB8888@GOTPAGE
Lloh12:
	ldr	x22, [x22, _DISP_FORMAT_ARGB8888@GOTPAGEOFF]
	str	d0, [sp, #48]
	ldr	x8, [x22]
	str	x8, [sp, #40]
Lloh13:
	adrp	x8, _DISP_SEQ_ARGB@GOTPAGE
Lloh14:
	ldr	x8, [x8, _DISP_SEQ_ARGB@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
Lloh16:
	adrp	x9, _DISP_MOD_INTERLEAVED@GOTPAGE
Lloh17:
	ldr	x9, [x9, _DISP_MOD_INTERLEAVED@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	stp	w9, w8, [sp, #32]
	ldr	q0, [x19]
	str	q0, [sp, #64]
	str	x23, [sp, #80]
	ldr	w0, [x19, #40]
Lloh19:
	adrp	x8, _DISP_CMD_LAYER_SET_PARA@GOTPAGE
Lloh20:
	ldr	x8, [x8, _DISP_CMD_LAYER_SET_PARA@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	str	x21, [sp]
	bl	_ioctl
	tbnz	x0, #63, LBB0_5
; %bb.2:
Lloh22:
	adrp	x8, _DISP_LAYER_WORK_MODE_SCALER@GOTPAGE
Lloh23:
	ldr	x8, [x8, _DISP_LAYER_WORK_MODE_SCALER@GOTPAGEOFF]
Lloh24:
	ldr	x1, [x8]
	mov	x0, x19
	bl	_sunxi_layer_change_work_mode
	cbnz	x0, LBB0_4
; %bb.3:
	mov	w8, #1
	str	w8, [x19, #16]
LBB0_4:
	ldr	x1, [x20]
	mov	x0, x19
	bl	_sunxi_layer_change_work_mode
	ldr	x8, [x22]
	stp	x8, xzr, [x19, #24]
	ldr	w0, [x19, #8]
	b	LBB0_6
LBB0_5:
	mov	w0, #-1
LBB0_6:
	ldur	x8, [x29, #-56]
Lloh25:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh26:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh27:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_8
; %bb.7:
	ldp	x29, x30, [sp, #160]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #144]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #128]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #112]            ; 16-byte Folded Reload
	add	sp, sp, #176
	ret
LBB0_8:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_DISP_LAYER_WORK_MODE_NORMAL,8,3 ; @DISP_LAYER_WORK_MODE_NORMAL
	.comm	_DISP_CMD_LAYER_REQUEST,4,2     ; @DISP_CMD_LAYER_REQUEST
	.comm	_DISP_CMD_LAYER_GET_PARA,4,2    ; @DISP_CMD_LAYER_GET_PARA
	.comm	_DISP_FORMAT_ARGB8888,8,3       ; @DISP_FORMAT_ARGB8888
	.comm	_DISP_SEQ_ARGB,4,2              ; @DISP_SEQ_ARGB
	.comm	_DISP_MOD_INTERLEAVED,4,2       ; @DISP_MOD_INTERLEAVED
	.comm	_DISP_CMD_LAYER_SET_PARA,4,2    ; @DISP_CMD_LAYER_SET_PARA
	.comm	_DISP_LAYER_WORK_MODE_SCALER,8,3 ; @DISP_LAYER_WORK_MODE_SCALER
	.no_dead_strip	_sunxi_layer_reserve
.subsections_via_symbols
