	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function repaper_fb_dirty
_repaper_fb_dirty:                      ## @repaper_fb_dirty
	.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	%rdi, %r12
	xorl	%r14d, %r14d
	xorl	%esi, %esi
	callq	_drm_fb_cma_get_gem_obj
	movq	%rax, %r13
	movq	8(%rax), %r15
	movl	12(%r12), %edi
	callq	_drm_to_epd
	cmpl	$0, 28(%rax)
	je	LBB0_22
## %bb.1:
	movq	%rax, %rbx
	movl	12(%r12), %edi
	leaq	-52(%rbp), %rsi
	callq	_drm_dev_enter
	testl	%eax, %eax
	je	LBB0_2
## %bb.3:
	movl	(%r12), %eax
	movl	%eax, -88(%rbp)
	xorps	%xmm0, %xmm0
	movups	%xmm0, -80(%rbp)
	movl	4(%r12), %eax
	movl	%eax, -84(%rbp)
	movq	%rbx, %rdi
	callq	_repaper_get_temperature
	movl	8(%r12), %esi
	movl	24(%rbx), %edx
	leaq	L_.str(%rip), %rdi
	callq	_DRM_DEBUG
	movl	(%r12), %edi
	movl	4(%r12), %esi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_kmalloc_array
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	testq	%r15, %r15
	je	LBB0_8
## %bb.6:
	movl	(%r15), %edi
	movq	_DMA_FROM_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_dma_buf_begin_cpu_access
	movl	%eax, %r14d
	testl	%eax, %eax
	movq	%r15, %rbx
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	jne	LBB0_20
## %bb.7:
	movl	(%r13), %esi
	leaq	-88(%rbp), %rcx
	movq	%r15, %rdi
	movq	%r12, %rdx
	callq	_drm_fb_xrgb8888_to_gray8
	movl	(%rbx), %edi
	movq	_DMA_FROM_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_dma_buf_end_cpu_access
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_20
	jmp	LBB0_9
LBB0_2:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_22
LBB0_4:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_21
LBB0_8:
	movl	(%r13), %esi
	leaq	-88(%rbp), %rcx
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	movq	%r12, %rdx
	callq	_drm_fb_xrgb8888_to_gray8
LBB0_9:
	movl	(%r12), %esi
	movl	4(%r12), %edx
	movq	%r15, %rdi
	callq	_repaper_gray8_to_mono_reversed
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	cmpl	$0, (%rbx)
	je	LBB0_11
## %bb.10:
	movq	8(%rbx), %rdx
	movq	_REPAPER_NORMAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_repaper_frame_data_repeat
	jmp	LBB0_14
LBB0_11:
	cmpl	$0, 4(%rbx)
	je	LBB0_13
## %bb.12:
	movq	8(%rbx), %rsi
	movq	_REPAPER_COMPENSATE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_repaper_frame_data_repeat
	movq	8(%rbx), %rsi
	movq	_REPAPER_WHITE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_repaper_frame_data_repeat
	movq	_REPAPER_INVERSE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rbx, %rdi
	movq	%r15, %rsi
	xorl	%edx, %edx
	callq	_repaper_frame_data_repeat
	movq	_REPAPER_NORMAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rbx, %rdi
	movq	%r15, %rsi
	xorl	%edx, %edx
	callq	_repaper_frame_data_repeat
	movl	$1, (%rbx)
	jmp	LBB0_14
LBB0_13:
	movq	_REPAPER_COMPENSATE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movl	$255, %esi
	callq	_repaper_frame_fixed_repeat
	movq	_REPAPER_WHITE@GOTPCREL(%rip), %r14
	movl	(%r14), %edx
	movq	%rbx, %rdi
	movl	$255, %esi
	callq	_repaper_frame_fixed_repeat
	movq	_REPAPER_INVERSE@GOTPCREL(%rip), %r15
	movl	(%r15), %edx
	movq	%rbx, %rdi
	movl	$170, %esi
	callq	_repaper_frame_fixed_repeat
	movq	_REPAPER_NORMAL@GOTPCREL(%rip), %r13
	movl	(%r13), %edx
	movq	%rbx, %rdi
	movl	$170, %esi
	callq	_repaper_frame_fixed_repeat
	movq	_REPAPER_COMPENSATE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movl	$170, %esi
	callq	_repaper_frame_fixed_repeat
	movl	(%r14), %edx
	movq	%rbx, %rdi
	movl	$170, %esi
	callq	_repaper_frame_fixed_repeat
	movl	(%r15), %ecx
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	movq	%rbx, %rdi
	movq	%r15, %rsi
	xorl	%edx, %edx
	callq	_repaper_frame_data_repeat
	movl	(%r13), %ecx
	movq	%rbx, %rdi
	movq	%r15, %rsi
	xorl	%edx, %edx
	callq	_repaper_frame_data_repeat
	movabsq	$4294967297, %rax               ## imm = 0x100000001
	movq	%rax, (%rbx)
LBB0_14:
	movq	8(%rbx), %rdi
	movl	4(%r12), %eax
	imull	(%r12), %eax
	leal	7(%rax), %edx
	testl	%eax, %eax
	cmovnsl	%eax, %edx
	sarl	$3, %edx
	movq	%r15, %rsi
	callq	_memcpy
	xorl	%r14d, %r14d
	cmpq	$0, 16(%rbx)
	je	LBB0_20
## %bb.15:
	movl	(%r12), %eax
	leal	7(%rax), %ecx
	cmpl	$15, %ecx
	jb	LBB0_20
## %bb.16:
	testl	%eax, %eax
	cmovnsl	%eax, %ecx
	sarl	$3, %ecx
	movl	4(%r12), %edx
	decl	%edx
	imull	%eax, %edx
	leal	7(%rdx), %eax
	testl	%edx, %edx
	cmovnsl	%edx, %eax
	sarl	$3, %eax
	cmpl	$2, %ecx
	movl	$1, %edx
	cmovael	%ecx, %edx
	.p2align	4, 0x90
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	movl	%eax, %ecx
	cmpq	$0, (%r15,%rcx,8)
	jne	LBB0_19
## %bb.17:                              ##   in Loop: Header=BB0_18 Depth=1
	incl	%eax
	decq	%rdx
	jne	LBB0_18
	jmp	LBB0_20
LBB0_19:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	8(%rdi), %rdx
	movq	_REPAPER_NORMAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r15, %rsi
	callq	_repaper_frame_data_repeat
LBB0_20:
	movq	%r15, %rdi
	callq	_kfree
LBB0_21:
	movl	-52(%rbp), %edi
	callq	_drm_dev_exit
LBB0_22:
	movl	%r14d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENODEV,4,2                     ## @ENODEV
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Flushing [FB:%d] st=%ums\n"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_DMA_FROM_DEVICE,4,2            ## @DMA_FROM_DEVICE
	.comm	_REPAPER_NORMAL,4,2             ## @REPAPER_NORMAL
	.comm	_REPAPER_COMPENSATE,4,2         ## @REPAPER_COMPENSATE
	.comm	_REPAPER_WHITE,4,2              ## @REPAPER_WHITE
	.comm	_REPAPER_INVERSE,4,2            ## @REPAPER_INVERSE
	.no_dead_strip	_repaper_fb_dirty
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function repaper_fb_dirty
_repaper_fb_dirty:                      ; @repaper_fb_dirty
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	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
	mov	x21, x0
	mov	w1, #0
	bl	_drm_fb_cma_get_gem_obj
	mov	x22, x0
	ldr	x24, [x0, #8]
	ldr	w0, [x21, #12]
	bl	_drm_to_epd
	ldr	w8, [x0, #28]
	cbz	w8, LBB0_6
; %bb.1:
	mov	x19, x0
	ldr	w0, [x21, #12]
	add	x1, sp, #4
	bl	_drm_dev_enter
	cbz	w0, LBB0_7
; %bb.2:
	stp	xzr, xzr, [sp, #16]
	ldr	d0, [x21]
	str	d0, [sp, #8]
	mov	x0, x19
	bl	_repaper_get_temperature
	ldr	w1, [x21, #8]
	ldr	w2, [x19, #24]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_DEBUG
	ldp	w0, w1, [x21]
Lloh2:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
	bl	_kmalloc_array
	cbz	x0, LBB0_8
; %bb.3:
	mov	x20, x0
	cbz	x24, LBB0_9
; %bb.4:
	ldr	w0, [x24]
Lloh5:
	adrp	x25, _DMA_FROM_DEVICE@GOTPAGE
Lloh6:
	ldr	x25, [x25, _DMA_FROM_DEVICE@GOTPAGEOFF]
	ldr	w1, [x25]
	bl	_dma_buf_begin_cpu_access
	mov	x23, x0
	cbnz	w0, LBB0_22
; %bb.5:
	ldr	w1, [x22]
	add	x3, sp, #8
	mov	x0, x20
	mov	x2, x21
	bl	_drm_fb_xrgb8888_to_gray8
	ldr	w0, [x24]
	ldr	w1, [x25]
	bl	_dma_buf_end_cpu_access
	mov	x23, x0
	cbnz	w0, LBB0_22
	b	LBB0_10
LBB0_6:
	mov	w23, #0
	b	LBB0_24
LBB0_7:
Lloh7:
	adrp	x8, _ENODEV@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_24
LBB0_8:
Lloh10:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_23
LBB0_9:
	ldr	w1, [x22]
	add	x3, sp, #8
	mov	x0, x20
	mov	x2, x21
	bl	_drm_fb_xrgb8888_to_gray8
LBB0_10:
	ldp	w1, w2, [x21]
	mov	x0, x20
	bl	_repaper_gray8_to_mono_reversed
	ldr	w8, [x19]
	cbz	w8, LBB0_12
; %bb.11:
	ldr	x2, [x19, #8]
Lloh13:
	adrp	x8, _REPAPER_NORMAL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _REPAPER_NORMAL@GOTPAGEOFF]
Lloh15:
	ldr	w3, [x8]
	mov	x0, x19
	mov	x1, x20
	bl	_repaper_frame_data_repeat
	b	LBB0_15
LBB0_12:
	ldr	w8, [x19, #4]
	cbz	w8, LBB0_14
; %bb.13:
	ldr	x1, [x19, #8]
Lloh16:
	adrp	x8, _REPAPER_COMPENSATE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _REPAPER_COMPENSATE@GOTPAGEOFF]
Lloh18:
	ldr	w3, [x8]
	mov	x0, x19
	mov	x2, #0
	bl	_repaper_frame_data_repeat
	ldr	x1, [x19, #8]
Lloh19:
	adrp	x8, _REPAPER_WHITE@GOTPAGE
Lloh20:
	ldr	x8, [x8, _REPAPER_WHITE@GOTPAGEOFF]
Lloh21:
	ldr	w3, [x8]
	mov	x0, x19
	mov	x2, #0
	bl	_repaper_frame_data_repeat
Lloh22:
	adrp	x8, _REPAPER_INVERSE@GOTPAGE
Lloh23:
	ldr	x8, [x8, _REPAPER_INVERSE@GOTPAGEOFF]
Lloh24:
	ldr	w3, [x8]
	mov	x0, x19
	mov	x1, x20
	mov	x2, #0
	bl	_repaper_frame_data_repeat
Lloh25:
	adrp	x8, _REPAPER_NORMAL@GOTPAGE
Lloh26:
	ldr	x8, [x8, _REPAPER_NORMAL@GOTPAGEOFF]
Lloh27:
	ldr	w3, [x8]
	mov	x0, x19
	mov	x1, x20
	mov	x2, #0
	bl	_repaper_frame_data_repeat
	mov	w8, #1
	str	w8, [x19]
	b	LBB0_15
LBB0_14:
Lloh28:
	adrp	x22, _REPAPER_COMPENSATE@GOTPAGE
Lloh29:
	ldr	x22, [x22, _REPAPER_COMPENSATE@GOTPAGEOFF]
	ldr	w2, [x22]
	mov	x0, x19
	mov	w1, #255
	bl	_repaper_frame_fixed_repeat
Lloh30:
	adrp	x23, _REPAPER_WHITE@GOTPAGE
Lloh31:
	ldr	x23, [x23, _REPAPER_WHITE@GOTPAGEOFF]
	ldr	w2, [x23]
	mov	x0, x19
	mov	w1, #255
	bl	_repaper_frame_fixed_repeat
Lloh32:
	adrp	x24, _REPAPER_INVERSE@GOTPAGE
Lloh33:
	ldr	x24, [x24, _REPAPER_INVERSE@GOTPAGEOFF]
	ldr	w2, [x24]
	mov	x0, x19
	mov	w1, #170
	bl	_repaper_frame_fixed_repeat
Lloh34:
	adrp	x25, _REPAPER_NORMAL@GOTPAGE
Lloh35:
	ldr	x25, [x25, _REPAPER_NORMAL@GOTPAGEOFF]
	ldr	w2, [x25]
	mov	x0, x19
	mov	w1, #170
	bl	_repaper_frame_fixed_repeat
	ldr	w2, [x22]
	mov	x0, x19
	mov	w1, #170
	bl	_repaper_frame_fixed_repeat
	ldr	w2, [x23]
	mov	x0, x19
	mov	w1, #170
	bl	_repaper_frame_fixed_repeat
	ldr	w3, [x24]
	mov	x0, x19
	mov	x1, x20
	mov	x2, #0
	bl	_repaper_frame_data_repeat
	ldr	w3, [x25]
	mov	x0, x19
	mov	x1, x20
	mov	x2, #0
	bl	_repaper_frame_data_repeat
	movi.2s	v0, #1
	str	d0, [x19]
LBB0_15:
	ldr	x0, [x19, #8]
	ldp	w8, w9, [x21]
	mul	w8, w9, w8
	add	w9, w8, #7
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w2, w8, #3
	mov	x1, x20
	bl	_memcpy
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_21
; %bb.16:
	ldr	w8, [x21]
	add	w9, w8, #7
	cmp	w9, #15
	b.lo	LBB0_21
; %bb.17:
	cmp	w8, #0
	csel	w9, w9, w8, lt
	asr	w9, w9, #3
	ldr	w10, [x21, #4]
	sub	w10, w10, #1
	mul	w8, w10, w8
	add	w10, w8, #7
	cmp	w8, #0
	csel	w8, w10, w8, lt
	asr	w8, w8, #3
	cmp	w9, #1
	csinc	w9, w9, wzr, hi
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x20, w8, uxtw #3]
	cbnz	x10, LBB0_20
; %bb.19:                               ;   in Loop: Header=BB0_18 Depth=1
	add	w8, w8, #1
	subs	x9, x9, #1
	b.ne	LBB0_18
	b	LBB0_21
LBB0_20:
	ldr	x2, [x19, #8]
Lloh36:
	adrp	x8, _REPAPER_NORMAL@GOTPAGE
Lloh37:
	ldr	x8, [x8, _REPAPER_NORMAL@GOTPAGEOFF]
Lloh38:
	ldr	w3, [x8]
	mov	x0, x19
	mov	x1, x20
	bl	_repaper_frame_data_repeat
LBB0_21:
	mov	w23, #0
LBB0_22:
	mov	x0, x20
	bl	_kfree
LBB0_23:
	ldr	w0, [sp, #4]
	bl	_drm_dev_exit
LBB0_24:
	mov	x0, x23
	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
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.cfi_endproc
                                        ; -- End function
	.comm	_ENODEV,4,2                     ; @ENODEV
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Flushing [FB:%d] st=%ums\n"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_DMA_FROM_DEVICE,4,2            ; @DMA_FROM_DEVICE
	.comm	_REPAPER_NORMAL,4,2             ; @REPAPER_NORMAL
	.comm	_REPAPER_COMPENSATE,4,2         ; @REPAPER_COMPENSATE
	.comm	_REPAPER_WHITE,4,2              ; @REPAPER_WHITE
	.comm	_REPAPER_INVERSE,4,2            ; @REPAPER_INVERSE
	.no_dead_strip	_repaper_fb_dirty
.subsections_via_symbols
