	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function malidp_crtc_atomic_check_gamma
_malidp_crtc_atomic_check_gamma:        ## @malidp_crtc_atomic_check_gamma
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movq	%rsi, %rdi
	callq	_to_malidp_crtc_state
	movq	%rax, %r14
	xorl	%eax, %eax
	cmpl	$0, 20(%rbx)
	je	LBB0_16
## %bb.1:
	movq	8(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_16
## %bb.2:
	movq	8(%r15), %rcx
	movq	(%rcx), %rcx
	testq	%rcx, %rcx
	je	LBB0_4
## %bb.3:
	movq	(%rcx), %rcx
	cmpq	16(%rdi), %rcx
	je	LBB0_16
LBB0_4:
	movslq	(%rdi), %rcx
	movabsq	$-6148914691236517205, %rsi     ## imm = 0xAAAAAAAAAAAAAAAB
	movq	%rcx, %rax
	mulq	%rsi
	imulq	%rcx, %rsi
	rorq	$3, %rsi
	movabsq	$768614336404564651, %rax       ## imm = 0xAAAAAAAAAAAAAAB
	cmpq	%rax, %rsi
	jae	LBB0_5
## %bb.6:
	shrq	$4, %rdx
	movq	_MALIDP_GAMMA_LUT_SIZE@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rdx
	jne	LBB0_5
## %bb.7:
	cmpl	$24, %ecx
	jb	LBB0_12
## %bb.8:
	movq	8(%rdi), %rax
	cmpq	$2, %rdx
	movl	$1, %ecx
	cmovaeq	%rdx, %rcx
	addq	$16, %rax
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	-16(%rax), %rdx
	cmpq	-8(%rax), %rdx
	jne	LBB0_5
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	cmpq	(%rax), %rdx
	jne	LBB0_5
## %bb.9:                               ##   in Loop: Header=BB0_10 Depth=1
	addq	$24, %rax
	decq	%rcx
	jne	LBB0_10
LBB0_12:
	cmpl	$0, (%rbx)
	je	LBB0_13
LBB0_15:
	movl	(%r14), %esi
	callq	_malidp_generate_gamma_table
	xorl	%eax, %eax
	jmp	LBB0_16
LBB0_5:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_16:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	movl	$1, (%rbx)
	movl	(%r15), %edi
	movl	16(%rbx), %esi
	callq	_drm_atomic_helper_check_modeset
	testl	%eax, %eax
	jne	LBB0_16
## %bb.14:
	movq	8(%rbx), %rdi
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_MALIDP_GAMMA_LUT_SIZE,8,3      ## @MALIDP_GAMMA_LUT_SIZE
	.no_dead_strip	_malidp_crtc_atomic_check_gamma
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function malidp_crtc_atomic_check_gamma
_malidp_crtc_atomic_check_gamma:        ; @malidp_crtc_atomic_check_gamma
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x1
	mov	x21, x0
	mov	x0, x1
	bl	_to_malidp_crtc_state
	ldr	w8, [x19, #20]
	cbz	w8, LBB0_4
; %bb.1:
	mov	x20, x0
	ldr	x0, [x19, #8]
	cbz	x0, LBB0_15
; %bb.2:
	ldr	x8, [x21, #8]
	ldr	x8, [x8]
	cbz	x8, LBB0_5
; %bb.3:
	ldr	x8, [x8]
	ldr	x9, [x0, #16]
	cmp	x8, x9
	b.ne	LBB0_5
LBB0_4:
	mov	w0, #0
	b	LBB0_15
LBB0_5:
	ldrsw	x9, [x0]
	mov	x8, #-6148914691236517206
	movk	x8, #43691
	umulh	x8, x9, x8
	lsr	x8, x8, #4
	mov	w10, #24
	msub	x10, x8, x10, x9
	cbnz	x10, LBB0_14
; %bb.6:
Lloh0:
	adrp	x10, _MALIDP_GAMMA_LUT_SIZE@GOTPAGE
Lloh1:
	ldr	x10, [x10, _MALIDP_GAMMA_LUT_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	x10, [x10]
	cmp	x8, x10
	b.ne	LBB0_14
; %bb.7:
	cmp	w9, #24
	b.lo	LBB0_12
; %bb.8:
	ldr	x9, [x0, #8]
	cmp	x8, #1
	csinc	x8, x8, xzr, hi
	add	x9, x9, #16
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldp	x10, x11, [x9, #-16]
	cmp	x10, x11
	b.ne	LBB0_14
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	x11, [x9]
	cmp	x10, x11
	b.ne	LBB0_14
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=1
	add	x9, x9, #24
	subs	x8, x8, #1
	b.ne	LBB0_9
LBB0_12:
	ldr	w8, [x19]
	cbz	w8, LBB0_16
LBB0_13:
	ldr	w1, [x20]
	bl	_malidp_generate_gamma_table
	b	LBB0_4
LBB0_14:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_15:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_16:
	mov	w8, #1
	str	w8, [x19]
	ldr	w0, [x21]
	ldr	w1, [x19, #16]
	bl	_drm_atomic_helper_check_modeset
	cbnz	w0, LBB0_15
; %bb.17:
	ldr	x0, [x19, #8]
	b	LBB0_13
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_MALIDP_GAMMA_LUT_SIZE,8,3      ; @MALIDP_GAMMA_LUT_SIZE
	.no_dead_strip	_malidp_crtc_atomic_check_gamma
.subsections_via_symbols
