	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_udl_handle_damage              ## -- Begin function udl_handle_damage
	.p2align	4, 0x90
_udl_handle_damage:                     ## @udl_handle_damage
	.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
                                        ## kill: def $r8d killed $r8d def $r8
	movq	%r8, -72(%rbp)                  ## 8-byte Spill
	movl	%ecx, %ebx
	movl	%edx, %r14d
	movl	%esi, %r13d
	movq	%rdi, %r15
	movq	32(%rdi), %rdi
	movq	%rdi, -80(%rbp)                 ## 8-byte Spill
	callq	_to_udl
	movq	%rax, -120(%rbp)                ## 8-byte Spill
	movl	$0, -48(%rbp)
	movl	$0, -52(%rbp)
	movq	24(%r15), %rax
	movq	(%rax), %rax
	movl	(%rax), %edi
	callq	_is_power_of_2
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_BUG_ON
	movq	24(%r15), %rax
	movq	(%rax), %rax
	movl	(%rax), %edi
	callq	___ffs
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	xorl	%r12d, %r12d
	cmpl	$0, 40(%r15)
	je	LBB0_22
## %bb.1:
	movq	(%r15), %rdi
	cmpq	$0, (%rdi)
	je	LBB0_2
LBB0_6:
	movl	%r13d, %edi
	movl	$8, %esi
	callq	_DL_ALIGN_DOWN
	movl	%eax, %r12d
	addl	%r13d, %ebx
	subl	%eax, %ebx
	movl	%ebx, %edi
	movl	$8, %esi
	callq	_DL_ALIGN_UP
	testl	%eax, %eax
	jle	LBB0_9
## %bb.7:
	movl	%eax, %ebx
	leal	(%rbx,%r12), %eax
	cmpl	8(%r15), %eax
	jg	LBB0_9
## %bb.8:
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	addl	%r14d, %eax
	movl	%eax, -96(%rbp)                 ## 4-byte Spill
	cmpl	12(%r15), %eax
	jle	LBB0_10
LBB0_9:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_22
LBB0_2:
	callq	_udl_gem_vmap
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	addl	(%rcx), %eax
	jne	LBB0_4
## %bb.3:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR
	jmp	LBB0_22
LBB0_4:
	movq	(%r15), %rax
	cmpq	$0, (%rax)
	jne	LBB0_6
## %bb.5:
	leaq	L_.str.1(%rip), %rdi
	callq	_DRM_ERROR
	jmp	LBB0_22
LBB0_10:
	movq	%r12, -104(%rbp)                ## 8-byte Spill
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	callq	_get_cycles
	movl	%eax, %r13d
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	callq	_udl_get_urb
	movq	%rax, -88(%rbp)
	testq	%rax, %rax
	je	LBB0_22
## %bb.11:
	movq	(%rax), %r12
	movq	%r12, -64(%rbp)
	cmpl	$0, -72(%rbp)                   ## 4-byte Folded Reload
	movq	%rbx, -112(%rbp)                ## 8-byte Spill
	movl	%r13d, -92(%rbp)                ## 4-byte Spill
	jle	LBB0_16
## %bb.12:
	movq	-104(%rbp), %rax                ## 8-byte Reload
	movl	%eax, %r12d
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	shll	%cl, %r12d
	movl	%ebx, %r13d
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %r13d
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r15), %rax
	movq	16(%r15), %rcx
	movl	(%rcx), %r9d
	imull	%r14d, %r9d
	addl	%r12d, %r9d
	movl	8(%r15), %ebx
	imull	%r14d, %ebx
	addl	-104(%rbp), %ebx                ## 4-byte Folded Reload
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	%esi, %ecx
	shll	%cl, %ebx
	movq	(%rax), %rcx
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	leaq	-88(%rbp), %rdx
	leaq	-64(%rbp), %r8
	leaq	-48(%rbp), %rax
	pushq	%rax
	leaq	-52(%rbp), %rax
	pushq	%rax
	pushq	%r13
	pushq	%rbx
	callq	_udl_render_hline
	addq	$32, %rsp
	testq	%rax, %rax
	jne	LBB0_21
## %bb.13:                              ##   in Loop: Header=BB0_14 Depth=1
	incl	%r14d
	cmpl	-96(%rbp), %r14d                ## 4-byte Folded Reload
	jl	LBB0_14
## %bb.15:
	movq	-64(%rbp), %r12
	movq	-88(%rbp), %rax
LBB0_16:
	movq	(%rax), %rcx
	cmpq	%rcx, %r12
	jbe	LBB0_20
## %bb.17:
	movslq	8(%rax), %rdx
	addq	%rcx, %rdx
	cmpq	%rdx, %r12
	jae	LBB0_19
## %bb.18:
	leaq	1(%r12), %rax
	movq	%rax, -64(%rbp)
	movb	$-81, (%r12)
	movq	-64(%rbp), %r12
	movq	-88(%rbp), %rax
	movq	(%rax), %rcx
LBB0_19:
	subl	%ecx, %r12d
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	movq	%rax, %rsi
	movl	%r12d, %edx
	callq	_udl_submit_urb
	addl	%r12d, -48(%rbp)
	jmp	LBB0_21
LBB0_20:
	movq	%rax, %rdi
	callq	_udl_urb_completion
LBB0_21:
	movl	-48(%rbp), %edi
	movq	-120(%rbp), %rbx                ## 8-byte Reload
	leaq	12(%rbx), %rsi
	callq	_atomic_add
	movl	-52(%rbp), %edi
	leaq	8(%rbx), %rsi
	callq	_atomic_add
	movq	-112(%rbp), %rdi                ## 8-byte Reload
	imull	-72(%rbp), %edi                 ## 4-byte Folded Reload
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %edi
	movq	%rbx, %rsi
	addq	$4, %rsi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_atomic_add
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	callq	_get_cycles
	subl	-92(%rbp), %eax                 ## 4-byte Folded Reload
	sarl	$10, %eax
	movl	%eax, %edi
	movq	%rbx, %rsi
	callq	_atomic_add
LBB0_22:
	movl	%r12d, %eax
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to vmap fb\n"

L_.str.1:                               ## @.str.1
	.asciz	"failed to vmapping\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_udl_handle_damage              ; -- Begin function udl_handle_damage
	.p2align	2
_udl_handle_damage:                     ; @udl_handle_damage
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x28, x27, [sp, #64]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #80]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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	x20, x4
	mov	x23, x3
	mov	x24, x2
	mov	x25, x1
	mov	x26, x0
	ldr	x21, [x0, #32]
	mov	x0, x21
	bl	_to_udl
	mov	x19, x0
	str	xzr, [sp, #48]
	ldr	x8, [x26, #24]
	ldr	x8, [x8]
	ldr	w0, [x8]
	bl	_is_power_of_2
	cmp	w0, #0
	cset	w0, eq
	bl	_BUG_ON
	ldr	x8, [x26, #24]
	ldr	x8, [x8]
	ldr	w0, [x8]
	bl	___ffs
	ldr	w8, [x26, #40]
	cbz	w8, LBB0_22
; %bb.1:
	mov	x22, x0
	ldr	x0, [x26]
	ldr	x8, [x0]
	cbz	x8, LBB0_6
LBB0_2:
	mov	x0, x25
	mov	w1, #8
	bl	_DL_ALIGN_DOWN
	mov	x27, x0
	add	w8, w23, w25
	sub	w0, w8, w0
	mov	w1, #8
	bl	_DL_ALIGN_UP
	cmp	w0, #1
	b.lt	LBB0_5
; %bb.3:
	mov	x23, x0
	ldr	w8, [x26, #8]
	add	w9, w0, w27
	cmp	w9, w8
	b.gt	LBB0_5
; %bb.4:
	ldr	w8, [x26, #12]
	add	w25, w20, w24
	cmp	w25, w8
	b.le	LBB0_10
LBB0_5:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_23
LBB0_6:
	bl	_udl_gem_vmap
Lloh3:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmn	w0, w8
	b.ne	LBB0_8
; %bb.7:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_22
LBB0_8:
	ldr	x8, [x26]
	ldr	x8, [x8]
	cbnz	x8, LBB0_2
; %bb.9:
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_22
LBB0_10:
	bl	_get_cycles
	mov	x28, x0
	mov	x0, x21
	bl	_udl_get_urb
	str	x0, [sp, #40]
	cbz	x0, LBB0_23
; %bb.11:
	mov	x1, x0
	str	w28, [sp, #28]                  ; 4-byte Folded Spill
	str	x19, [sp, #32]                  ; 8-byte Folded Spill
	ldr	x8, [x0]
	str	x8, [sp, #56]
	cmp	w20, #1
	b.lt	LBB0_16
; %bb.12:
	lsl	w19, w27, w22
	lsl	w28, w23, w22
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x26, #16]
	ldr	w8, [x8]
	madd	w5, w8, w24, w19
	ldr	w8, [x26, #8]
	madd	w8, w8, w24, w27
	lsl	w6, w8, w22
	ldr	x8, [x26]
	ldr	x3, [x8]
	add	x8, sp, #52
	str	x8, [sp, #8]
	add	x8, sp, #48
	str	x8, [sp]
	add	x2, sp, #40
	add	x4, sp, #56
	mov	x0, x21
	mov	x1, x22
	mov	x7, x28
	bl	_udl_render_hline
	cbnz	x0, LBB0_21
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	add	w24, w24, #1
	cmp	w24, w25
	b.lt	LBB0_13
; %bb.15:
	ldr	x8, [sp, #56]
	ldr	x1, [sp, #40]
LBB0_16:
	ldr	x9, [x1]
	cmp	x8, x9
	b.ls	LBB0_20
; %bb.17:
	ldrsw	x10, [x1, #8]
	add	x10, x9, x10
	cmp	x8, x10
	b.hs	LBB0_19
; %bb.18:
	add	x9, x8, #1
	str	x9, [sp, #56]
	mov	w9, #175
	strb	w9, [x8]
	ldr	x8, [sp, #56]
	ldr	x1, [sp, #40]
	ldr	x9, [x1]
LBB0_19:
	sub	w24, w8, w9
	mov	x0, x21
	mov	x2, x24
	bl	_udl_submit_urb
	ldr	w8, [sp, #52]
	add	w8, w8, w24
	str	w8, [sp, #52]
	b	LBB0_21
LBB0_20:
	mov	x0, x1
	bl	_udl_urb_completion
LBB0_21:
	ldr	w0, [sp, #52]
	ldr	x19, [sp, #32]                  ; 8-byte Folded Reload
	add	x1, x19, #12
	bl	_atomic_add
	ldr	w0, [sp, #48]
	add	x1, x19, #8
	bl	_atomic_add
	mul	w8, w23, w20
	lsl	w0, w8, w22
	add	x1, x19, #4
	bl	_atomic_add
	bl	_get_cycles
	ldr	w8, [sp, #28]                   ; 4-byte Folded Reload
	sub	w8, w0, w8
	asr	w0, w8, #10
	mov	x1, x19
	bl	_atomic_add
LBB0_22:
	mov	w0, #0
LBB0_23:
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to vmap fb\n"

l_.str.1:                               ; @.str.1
	.asciz	"failed to vmapping\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
.subsections_via_symbols
