	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function g2d_check_reg_offset
_g2d_check_reg_offset:                  ## @g2d_check_reg_offset
	.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	%ecx, -44(%rbp)                 ## 4-byte Spill
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	xorl	%eax, %eax
	testl	%edx, %edx
	jle	LBB0_23
## %bb.1:
	movl	%edx, %ebx
	movq	16(%rsi), %r14
	movq	8(%r14), %rcx
	movl	$-1, %r12d
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	_BUF_TYPE_GEM@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movq	8(%rsi), %rsi
	movl	%edx, (%rsi,%rax,4)
LBB0_20:                                ##   in Loop: Header=BB0_2 Depth=1
	addl	$-2, %r12d
	decl	%ebx
	je	LBB0_21
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %r15d
	leal	(%r12,%r15), %eax
	decl	%eax
	movslq	%eax, %r13
	movslq	(%rcx,%r13,4), %rdx
	movl	%edx, %esi
	andl	$4095, %esi                     ## imm = 0xFFF
	movq	_G2D_VALID_START@GOTPCREL(%rip), %rax
	cmpl	(%rax), %esi
	jl	LBB0_22
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_G2D_VALID_END@GOTPCREL(%rip), %rax
	cmpl	(%rax), %esi
	jg	LBB0_22
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%edx, %eax
	andl	$3, %eax
	jne	LBB0_22
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	leal	-128(%rsi), %eax
	cmpl	$13, %eax
	ja	LBB0_19
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_22
## %bb.8:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_g2d_get_reg_type
	movq	8(%r14), %rcx
	cmpl	$0, (%rcx,%r13,4)
	movl	%eax, %eax
	jns	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_BUF_TYPE_USERPTR@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movq	8(%rsi), %rsi
	movl	%edx, (%rsi,%rax,4)
	movq	_G2D_BUF_USERPTR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, (%rcx,%r13,4)
	jmp	LBB0_20
LBB0_11:                                ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_22
## %bb.12:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_g2d_get_reg_type
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx), %rdx
	movl	%eax, %eax
	movq	8(%r14), %rcx
	addl	%r12d, %r15d
	movslq	%r15d, %rsi
	movl	(%rcx,%rsi,4), %esi
	leaq	(%rax,%rax,2), %rax
	shlq	$4, %rax
	movl	%esi, (%rdx,%rax)
	jmp	LBB0_20
LBB0_17:                                ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_22
## %bb.18:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_g2d_get_reg_type
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx), %rdx
	movl	%eax, %eax
	movq	8(%r14), %rcx
	addl	%r12d, %r15d
	movslq	%r15d, %rsi
	movl	(%rcx,%rsi,4), %esi
	movl	%esi, %edi
	andl	$8191, %edi                     ## imm = 0x1FFF
	leaq	(%rax,%rax,2), %rax
	shlq	$4, %rax
	movq	%rdi, 32(%rdx,%rax)
	shrl	$16, %esi
	andl	$8191, %esi                     ## imm = 0x1FFF
	movq	%rsi, 40(%rdx,%rax)
	jmp	LBB0_20
LBB0_15:                                ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_22
## %bb.16:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_g2d_get_reg_type
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx), %rdx
	movl	%eax, %eax
	movq	8(%r14), %rcx
	addl	%r12d, %r15d
	movslq	%r15d, %rsi
	movl	(%rcx,%rsi,4), %esi
	movl	%esi, %edi
	andl	$8191, %edi                     ## imm = 0x1FFF
	leaq	(%rax,%rax,2), %rax
	shlq	$4, %rax
	movq	%rdi, 16(%rdx,%rax)
	shrl	$16, %esi
	andl	$8191, %esi                     ## imm = 0x1FFF
	movq	%rsi, 24(%rdx,%rax)
	jmp	LBB0_20
LBB0_13:                                ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_22
## %bb.14:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_g2d_get_reg_type
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx), %rdx
	movl	%eax, %eax
	movq	8(%r14), %rcx
	addl	%r12d, %r15d
	movslq	%r15d, %rsi
	movl	(%rcx,%rsi,4), %esi
	andl	$15, %esi
	leaq	(%rax,%rax,2), %rax
	shlq	$4, %rax
	movq	%rsi, 8(%rdx,%rax)
	jmp	LBB0_20
LBB0_19:                                ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_20
LBB0_22:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_23
LBB0_21:
	xorl	%eax, %eax
LBB0_23:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_11, LBB0_11-LJTI0_0
.set L0_0_set_17, LBB0_17-LJTI0_0
.set L0_0_set_7, LBB0_7-LJTI0_0
.set L0_0_set_15, LBB0_15-LJTI0_0
.set L0_0_set_13, LBB0_13-LJTI0_0
LJTI0_0:
	.long	L0_0_set_11
	.long	L0_0_set_17
	.long	L0_0_set_7
	.long	L0_0_set_15
	.long	L0_0_set_13
	.long	L0_0_set_7
	.long	L0_0_set_7
	.long	L0_0_set_7
	.long	L0_0_set_11
	.long	L0_0_set_17
	.long	L0_0_set_7
	.long	L0_0_set_15
	.long	L0_0_set_13
	.long	L0_0_set_7
	.end_data_region
                                        ## -- End function
	.comm	_G2D_VALID_START,4,2            ## @G2D_VALID_START
	.comm	_G2D_VALID_END,4,2              ## @G2D_VALID_END
	.comm	_BUF_TYPE_USERPTR,4,2           ## @BUF_TYPE_USERPTR
	.comm	_G2D_BUF_USERPTR,4,2            ## @G2D_BUF_USERPTR
	.comm	_BUF_TYPE_GEM,4,2               ## @BUF_TYPE_GEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Bad register offset: 0x%lx\n"

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

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function g2d_check_reg_offset
_g2d_check_reg_offset:                  ; @g2d_check_reg_offset
	.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
	cmp	w2, #1
	b.lt	LBB0_20
; %bb.1:
	mov	x19, x3
	mov	x21, x2
	mov	x22, x1
	mov	x20, x0
	ldr	x23, [x1, #16]
	ldr	x8, [x23, #8]
Lloh0:
	adrp	x24, _G2D_VALID_START@GOTPAGE
Lloh1:
	ldr	x24, [x24, _G2D_VALID_START@GOTPAGEOFF]
	mov	w25, #-1
Lloh2:
	adrp	x26, _G2D_VALID_END@GOTPAGE
Lloh3:
	ldr	x26, [x26, _G2D_VALID_END@GOTPAGEOFF]
Lloh4:
	adrp	x27, lJTI0_0@PAGE
Lloh5:
	add	x27, x27, lJTI0_0@PAGEOFF
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
Lloh6:
	adrp	x9, _BUF_TYPE_GEM@GOTPAGE
Lloh7:
	ldr	x9, [x9, _BUF_TYPE_GEM@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	ldr	x10, [x22, #8]
	str	w9, [x10, w0, uxtw #2]
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	sub	w25, w25, #2
	sub	w21, w21, #1
	cbz	w21, LBB0_20
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w28, [x23]
	add	w9, w25, w28
	sub	w9, w9, #1
	ldrsw	x2, [x8, w9, sxtw #2]
	and	w1, w2, #0xfff
	ldr	w10, [x24]
	ldr	w11, [x26]
	and	w12, w2, #0x3
	cmp	w1, w10
	ccmp	w1, w11, #0, ge
	ccmp	w12, #0, #0, le
	b.ne	LBB0_19
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	sub	w10, w1, #128
	cmp	w10, #13
	b.hi	LBB0_18
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	adr	x8, LBB0_7
	ldrb	w11, [x27, x10]
	add	x8, x8, x11, lsl #2
	br	x8
LBB0_7:                                 ;   in Loop: Header=BB0_4 Depth=1
	cbz	w19, LBB0_19
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	sxtw	x28, w9
	mov	x0, x20
	bl	_g2d_get_reg_type
	ldr	x8, [x23, #8]
	ldr	w9, [x8, x28, lsl #2]
	tbz	w9, #31, LBB0_2
; %bb.9:                                ;   in Loop: Header=BB0_4 Depth=1
Lloh9:
	adrp	x9, _BUF_TYPE_USERPTR@GOTPAGE
Lloh10:
	ldr	x9, [x9, _BUF_TYPE_USERPTR@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	ldr	x10, [x22, #8]
	str	w9, [x10, w0, uxtw #2]
Lloh12:
	adrp	x9, _G2D_BUF_USERPTR@GOTPAGE
Lloh13:
	ldr	x9, [x9, _G2D_BUF_USERPTR@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	lsl	x10, x28, #2
	ldr	w11, [x8, x10]
	bic	w9, w11, w9
	str	w9, [x8, x10]
	b	LBB0_3
LBB0_10:                                ;   in Loop: Header=BB0_4 Depth=1
	cbnz	w19, LBB0_19
; %bb.11:                               ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x20
	bl	_g2d_get_reg_type
	ldr	x9, [x22]
	ldr	x8, [x23, #8]
	add	w10, w25, w28
	ldr	w10, [x8, w10, sxtw #2]
	mov	w11, #48
	umull	x11, w0, w11
	str	w10, [x9, x11]
	b	LBB0_3
LBB0_12:                                ;   in Loop: Header=BB0_4 Depth=1
	cbnz	w19, LBB0_19
; %bb.13:                               ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x20
	bl	_g2d_get_reg_type
	ldr	x8, [x23, #8]
	add	w9, w25, w28
	ldr	w9, [x8, w9, sxtw #2]
	ldr	x10, [x22]
	and	x11, x9, #0x1fff
	mov	w12, #48
	umaddl	x10, w0, w12, x10
	ubfx	x9, x9, #16, #13
	stp	x11, x9, [x10, #32]
	b	LBB0_3
LBB0_14:                                ;   in Loop: Header=BB0_4 Depth=1
	cbnz	w19, LBB0_19
; %bb.15:                               ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x20
	bl	_g2d_get_reg_type
	ldr	x8, [x23, #8]
	add	w9, w25, w28
	ldr	w9, [x8, w9, sxtw #2]
	ldr	x10, [x22]
	and	x11, x9, #0x1fff
	mov	w12, #48
	umaddl	x10, w0, w12, x10
	ubfx	x9, x9, #16, #13
	stp	x11, x9, [x10, #16]
	b	LBB0_3
LBB0_16:                                ;   in Loop: Header=BB0_4 Depth=1
	cbnz	w19, LBB0_19
; %bb.17:                               ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x20
	bl	_g2d_get_reg_type
	ldr	x9, [x22]
	ldr	x8, [x23, #8]
	add	w10, w25, w28
	ldr	w10, [x8, w10, sxtw #2]
	and	x10, x10, #0xf
	mov	w11, #48
	umaddl	x9, w0, w11, x9
	str	x10, [x9, #8]
	b	LBB0_3
LBB0_18:                                ;   in Loop: Header=BB0_4 Depth=1
	cbz	w19, LBB0_3
LBB0_19:
	ldr	w0, [x20]
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh17:
	adrp	x8, _EINVAL@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_21
LBB0_20:
	mov	w0, #0
LBB0_21:
	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 AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_10-LBB0_7)>>2
	.byte	(LBB0_12-LBB0_7)>>2
	.byte	(LBB0_7-LBB0_7)>>2
	.byte	(LBB0_14-LBB0_7)>>2
	.byte	(LBB0_16-LBB0_7)>>2
	.byte	(LBB0_7-LBB0_7)>>2
	.byte	(LBB0_7-LBB0_7)>>2
	.byte	(LBB0_7-LBB0_7)>>2
	.byte	(LBB0_10-LBB0_7)>>2
	.byte	(LBB0_12-LBB0_7)>>2
	.byte	(LBB0_7-LBB0_7)>>2
	.byte	(LBB0_14-LBB0_7)>>2
	.byte	(LBB0_16-LBB0_7)>>2
	.byte	(LBB0_7-LBB0_7)>>2
                                        ; -- End function
	.comm	_G2D_VALID_START,4,2            ; @G2D_VALID_START
	.comm	_G2D_VALID_END,4,2              ; @G2D_VALID_END
	.comm	_BUF_TYPE_USERPTR,4,2           ; @BUF_TYPE_USERPTR
	.comm	_G2D_BUF_USERPTR,4,2            ; @G2D_BUF_USERPTR
	.comm	_BUF_TYPE_GEM,4,2               ; @BUF_TYPE_GEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Bad register offset: 0x%lx\n"

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