	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sunxi_layer_set_rgb_input_buffer
_sunxi_layer_set_rgb_input_buffer:      ## @sunxi_layer_set_rgb_input_buffer
	.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	$120, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, -84(%rbp)                 ## 4-byte Spill
	movl	%r8d, %r15d
	movq	%rdx, %r12
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -160(%rbp)
	movaps	%xmm0, -144(%rbp)
	movl	%ecx, -88(%rbp)                 ## 4-byte Spill
	movl	%ecx, -152(%rbp)
	movl	%r8d, -148(%rbp)
	leaq	-128(%rbp), %rdi
	xorl	%esi, %esi
	movl	$40, %edx
	callq	_memset
	cmpl	$0, 8(%rbx)
	je	LBB0_1
LBB0_3:
	addq	16(%rbx), %r12
	movq	-128(%rbp), %rax
	movq	%r12, (%rax)
	movl	%r15d, -116(%rbp)
	movl	$-1, %r13d
	cmpl	$16, %r14d
	je	LBB0_6
## %bb.4:
	cmpl	$32, %r14d
	jne	LBB0_9
## %bb.5:
	movq	_DISP_FORMAT_ARGB8888@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -120(%rbp)
	movq	_DISP_SEQ_ARGB@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -96(%rbp)
	movq	_DISP_MOD_INTERLEAVED@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -104(%rbp)
	movl	-84(%rbp), %eax                 ## 4-byte Reload
	jmp	LBB0_7
LBB0_1:
	movq	_DISP_LAYER_WORK_MODE_SCALER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_sunxi_layer_change_work_mode
	movl	$-1, %r13d
	testq	%rax, %rax
	jne	LBB0_9
## %bb.2:
	movl	$1, 8(%rbx)
	jmp	LBB0_3
LBB0_6:
	movq	_DISP_FORMAT_RGB565@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -120(%rbp)
	movq	_DISP_SEQ_P10@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -96(%rbp)
	movq	_DISP_MOD_INTERLEAVED@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -104(%rbp)
	movl	-84(%rbp), %eax                 ## 4-byte Reload
	addl	%eax, %eax
LBB0_7:
	movl	%eax, -112(%rbp)
	movq	24(%rbx), %rax
	movq	%rax, -80(%rbp)
	movq	(%rbx), %rax
	movq	%rax, -72(%rbp)
	leaq	-128(%rbp), %rax
	movq	%rax, -64(%rbp)
	movl	32(%rbx), %edi
	movq	_DISP_CMD_LAYER_SET_FB@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-80(%rbp), %rdx
	callq	_ioctl
	testl	%eax, %eax
	js	LBB0_9
## %bb.8:
	movq	$0, 48(%rbx)
	movl	%r15d, 44(%rbx)
	movl	-88(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 40(%rbx)
	movl	-120(%rbp), %eax
	movl	%eax, 36(%rbx)
	movq	24(%rbx), %rax
	movq	%rax, -80(%rbp)
	movq	(%rbx), %rax
	movq	%rax, -72(%rbp)
	leaq	-160(%rbp), %rax
	movq	%rax, -64(%rbp)
	movl	32(%rbx), %edi
	movq	_DISP_CMD_LAYER_SET_SRC_WINDOW@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-80(%rbp), %rdx
	callq	_ioctl
	movl	%eax, %r13d
LBB0_9:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_11
## %bb.10:
	movl	%r13d, %eax
	addq	$120, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_DISP_LAYER_WORK_MODE_SCALER,4,2 ## @DISP_LAYER_WORK_MODE_SCALER
	.comm	_DISP_FORMAT_ARGB8888,4,2       ## @DISP_FORMAT_ARGB8888
	.comm	_DISP_SEQ_ARGB,4,2              ## @DISP_SEQ_ARGB
	.comm	_DISP_MOD_INTERLEAVED,8,3       ## @DISP_MOD_INTERLEAVED
	.comm	_DISP_FORMAT_RGB565,4,2         ## @DISP_FORMAT_RGB565
	.comm	_DISP_SEQ_P10,4,2               ## @DISP_SEQ_P10
	.comm	_DISP_CMD_LAYER_SET_FB,4,2      ## @DISP_CMD_LAYER_SET_FB
	.comm	_DISP_CMD_LAYER_SET_SRC_WINDOW,4,2 ## @DISP_CMD_LAYER_SET_SRC_WINDOW
	.no_dead_strip	_sunxi_layer_set_rgb_input_buffer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sunxi_layer_set_rgb_input_buffer
_sunxi_layer_set_rgb_input_buffer:      ; @sunxi_layer_set_rgb_input_buffer
	.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	x22, x5
	mov	x21, x4
	mov	x20, x3
	mov	x24, x2
	mov	x23, x1
	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]
	movi.2d	v0, #0000000000000000
	stp	q0, q0, [sp]
	stp	w3, w4, [sp, #8]
	add	x0, sp, #32
	mov	w1, #0
	mov	w2, #40
	bl	_memset
	ldr	w8, [x19, #8]
	cbz	w8, LBB0_4
LBB0_1:
	ldr	x8, [x19, #16]
	add	x8, x8, x24
	ldr	x9, [sp, #32]
	str	x8, [x9]
	str	w21, [sp, #44]
	cmp	w23, #16
	b.eq	LBB0_6
; %bb.2:
	cmp	w23, #32
	b.ne	LBB0_9
; %bb.3:
Lloh3:
	adrp	x8, _DISP_FORMAT_ARGB8888@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DISP_FORMAT_ARGB8888@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [sp, #40]
Lloh6:
	adrp	x8, _DISP_SEQ_ARGB@GOTPAGE
Lloh7:
	ldr	x8, [x8, _DISP_SEQ_ARGB@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	str	w8, [sp, #64]
Lloh9:
	adrp	x8, _DISP_MOD_INTERLEAVED@GOTPAGE
Lloh10:
	ldr	x8, [x8, _DISP_MOD_INTERLEAVED@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	str	x8, [sp, #56]
	b	LBB0_7
LBB0_4:
Lloh12:
	adrp	x8, _DISP_LAYER_WORK_MODE_SCALER@GOTPAGE
Lloh13:
	ldr	x8, [x8, _DISP_LAYER_WORK_MODE_SCALER@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_sunxi_layer_change_work_mode
	cbnz	x0, LBB0_9
; %bb.5:
	mov	w8, #1
	str	w8, [x19, #8]
	b	LBB0_1
LBB0_6:
Lloh15:
	adrp	x8, _DISP_FORMAT_RGB565@GOTPAGE
Lloh16:
	ldr	x8, [x8, _DISP_FORMAT_RGB565@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	str	w8, [sp, #40]
Lloh18:
	adrp	x8, _DISP_SEQ_P10@GOTPAGE
Lloh19:
	ldr	x8, [x8, _DISP_SEQ_P10@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	str	w8, [sp, #64]
Lloh21:
	adrp	x8, _DISP_MOD_INTERLEAVED@GOTPAGE
Lloh22:
	ldr	x8, [x8, _DISP_MOD_INTERLEAVED@GOTPAGEOFF]
Lloh23:
	ldr	x8, [x8]
	str	x8, [sp, #56]
	lsl	w22, w22, #1
LBB0_7:
	str	w22, [sp, #48]
	ldr	x8, [x19, #24]
	ldr	x9, [x19]
	stp	x8, x9, [sp, #72]
	add	x8, sp, #32
	str	x8, [sp, #88]
	ldr	w0, [x19, #32]
Lloh24:
	adrp	x8, _DISP_CMD_LAYER_SET_FB@GOTPAGE
Lloh25:
	ldr	x8, [x8, _DISP_CMD_LAYER_SET_FB@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
	add	x2, sp, #72
	bl	_ioctl
	tbnz	w0, #31, LBB0_9
; %bb.8:
	str	xzr, [x19, #48]
	stp	w20, w21, [x19, #40]
	ldr	w8, [sp, #40]
	str	w8, [x19, #36]
	ldr	x8, [x19, #24]
	ldr	x9, [x19]
	stp	x8, x9, [sp, #72]
	mov	x8, sp
	str	x8, [sp, #88]
	ldr	w0, [x19, #32]
Lloh27:
	adrp	x8, _DISP_CMD_LAYER_SET_SRC_WINDOW@GOTPAGE
Lloh28:
	ldr	x8, [x8, _DISP_CMD_LAYER_SET_SRC_WINDOW@GOTPAGEOFF]
Lloh29:
	ldr	w1, [x8]
	add	x2, sp, #72
	bl	_ioctl
	b	LBB0_10
LBB0_9:
	mov	w0, #-1
LBB0_10:
	ldur	x8, [x29, #-56]
Lloh30:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh31:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh32:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_12
; %bb.11:
	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_12:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_DISP_LAYER_WORK_MODE_SCALER,4,2 ; @DISP_LAYER_WORK_MODE_SCALER
	.comm	_DISP_FORMAT_ARGB8888,4,2       ; @DISP_FORMAT_ARGB8888
	.comm	_DISP_SEQ_ARGB,4,2              ; @DISP_SEQ_ARGB
	.comm	_DISP_MOD_INTERLEAVED,8,3       ; @DISP_MOD_INTERLEAVED
	.comm	_DISP_FORMAT_RGB565,4,2         ; @DISP_FORMAT_RGB565
	.comm	_DISP_SEQ_P10,4,2               ; @DISP_SEQ_P10
	.comm	_DISP_CMD_LAYER_SET_FB,4,2      ; @DISP_CMD_LAYER_SET_FB
	.comm	_DISP_CMD_LAYER_SET_SRC_WINDOW,4,2 ; @DISP_CMD_LAYER_SET_SRC_WINDOW
	.no_dead_strip	_sunxi_layer_set_rgb_input_buffer
.subsections_via_symbols
