	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_atomic_helper_legacy_gamma_set ## -- Begin function drm_atomic_helper_legacy_gamma_set
	.p2align	4, 0x90
_drm_atomic_helper_legacy_gamma_set:    ## @drm_atomic_helper_legacy_gamma_set
	.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
	movq	%r9, -64(%rbp)                  ## 8-byte Spill
	movl	%r8d, %r12d
	movq	%rcx, %rbx
	movq	%rdx, %r15
	movq	%rsi, %r14
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movq	(%rdi), %r13
	movq	%r13, %rdi
	callq	_drm_atomic_state_alloc
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	leal	(,%r12,8), %eax
	leal	(%rax,%rax,2), %esi
	movq	%r13, %rdi
	xorl	%edx, %edx
	callq	_drm_property_create_blob
	movq	%rax, %r13
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	%r13, %rdi
	callq	_PTR_ERR
	movl	%eax, %ebx
	xorl	%r13d, %r13d
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	jmp	LBB0_15
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_16
LBB0_4:
	testl	%r12d, %r12d
	jle	LBB0_11
## %bb.5:
	movq	16(%r13), %rax
	movl	%r12d, %r8d
	cmpl	$1, %r12d
	jne	LBB0_7
## %bb.6:
	xorl	%edx, %edx
	jmp	LBB0_9
LBB0_7:
	movl	%r8d, %esi
	andl	$-2, %esi
	leaq	40(%rax), %rdi
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r14,%rdx,8), %rcx
	movq	%rcx, -24(%rdi)
	movq	(%r15,%rdx,8), %rcx
	movq	%rcx, -32(%rdi)
	movq	(%rbx,%rdx,8), %rcx
	movq	%rcx, -40(%rdi)
	movq	8(%r14,%rdx,8), %rcx
	movq	%rcx, (%rdi)
	movq	8(%r15,%rdx,8), %rcx
	movq	%rcx, -8(%rdi)
	movq	8(%rbx,%rdx,8), %rcx
	movq	%rcx, -16(%rdi)
	addq	$2, %rdx
	addq	$48, %rdi
	cmpq	%rdx, %rsi
	jne	LBB0_8
LBB0_9:
	testb	$1, %r8b
	je	LBB0_11
## %bb.10:
	movq	(%r14,%rdx,8), %rcx
	leaq	(%rdx,%rdx,2), %rsi
	movq	%rcx, 16(%rax,%rsi,8)
	movq	(%r15,%rdx,8), %rcx
	movq	%rcx, 8(%rax,%rsi,8)
	movq	(%rbx,%rdx,8), %rcx
	movq	%rcx, (%rax,%rsi,8)
LBB0_11:
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, (%r12)
	movq	%r12, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	callq	_drm_atomic_get_crtc_state
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_13
## %bb.12:
	movq	%rbx, %rdi
	callq	_PTR_ERR
	jmp	LBB0_14
LBB0_13:
	leaq	12(%rbx), %rdi
	xorl	%esi, %esi
	callq	_drm_property_replace_blob
	movl	%eax, %r14d
	leaq	8(%rbx), %rdi
	xorl	%esi, %esi
	callq	_drm_property_replace_blob
	movl	%eax, %r15d
	orl	%r14d, %r15d
	movq	%rbx, %rdi
	addq	$4, %rdi
	movq	%r13, %rsi
	callq	_drm_property_replace_blob
	orl	%r15d, %eax
	orl	%eax, (%rbx)
	movq	%r12, %rdi
	callq	_drm_atomic_commit
LBB0_14:
	movl	%eax, %ebx
LBB0_15:
	movq	%r12, %rdi
	callq	_drm_atomic_state_put
	movq	%r13, %rdi
	callq	_drm_property_blob_put
LBB0_16:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_atomic_helper_legacy_gamma_set ; -- Begin function drm_atomic_helper_legacy_gamma_set
	.p2align	2
_drm_atomic_helper_legacy_gamma_set:    ; @drm_atomic_helper_legacy_gamma_set
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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, x5
	mov	x26, x4
	mov	x25, x3
	mov	x24, x2
	mov	x23, x1
	mov	x22, x0
	ldr	x20, [x0]
	mov	x0, x20
	bl	_drm_atomic_state_alloc
	cbz	x0, LBB0_3
; %bb.1:
	mov	x19, x0
	add	w8, w26, w26, lsl #1
	lsl	w1, w8, #3
	mov	x0, x20
	mov	x2, #0
	bl	_drm_property_create_blob
	mov	x20, x0
	bl	_IS_ERR
	cbz	x0, LBB0_4
; %bb.2:
	mov	x0, x20
	bl	_PTR_ERR
	mov	x21, x0
	mov	x20, #0
	b	LBB0_19
LBB0_3:
Lloh0:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_20
LBB0_4:
	cmp	w26, #1
	b.lt	LBB0_15
; %bb.5:
	ldr	x8, [x20, #16]
	mov	w9, w26
	cmp	w26, #1
	b.ne	LBB0_7
; %bb.6:
	mov	x10, #0
	b	LBB0_13
LBB0_7:
	mov	x10, #0
	mov	w11, #24
	madd	x13, x9, x11, x8
	lsl	x14, x9, #3
	add	x11, x24, x14
	cmp	x8, x11
	ccmp	x13, x24, #0, lo
	cset	w11, hi
	add	x12, x25, x14
	cmp	x8, x12
	ccmp	x13, x25, #0, lo
	cset	w12, hi
	cmp	x13, x23
	add	x13, x23, x14
	ccmp	x8, x13, #2, hi
	b.lo	LBB0_13
; %bb.8:
	tbnz	w11, #0, LBB0_13
; %bb.9:
	tbnz	w12, #0, LBB0_13
; %bb.10:
	and	x10, x9, #0xfffffffe
	mov	x11, x10
	mov	x12, x8
	mov	x13, x25
	mov	x14, x24
	mov	x15, x23
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	q2, [x15], #16
	ldr	q1, [x14], #16
	ldr	q0, [x13], #16
	st3.2d	{ v0, v1, v2 }, [x12], #48
	subs	x11, x11, #2
	b.ne	LBB0_11
; %bb.12:
	cmp	x10, x9
	b.eq	LBB0_15
LBB0_13:
	lsl	x13, x10, #3
	add	x11, x25, x13
	add	x12, x24, x13
	add	x13, x23, x13
	sub	x9, x9, x10
	mov	w14, #24
	mul	x10, x10, x14
	add	x8, x8, x10
	add	x8, x8, #8
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x13], #8
	str	x10, [x8, #8]
	ldr	x10, [x12], #8
	str	x10, [x8]
	ldr	x10, [x11], #8
	stur	x10, [x8, #-8]
	add	x8, x8, #24
	subs	x9, x9, #1
	b.ne	LBB0_14
LBB0_15:
	str	x21, [x19]
	mov	x0, x19
	mov	x1, x22
	bl	_drm_atomic_get_crtc_state
	mov	x21, x0
	bl	_IS_ERR
	cbz	x0, LBB0_17
; %bb.16:
	mov	x0, x21
	bl	_PTR_ERR
	b	LBB0_18
LBB0_17:
	add	x0, x21, #12
	mov	x1, #0
	bl	_drm_property_replace_blob
	mov	x22, x0
	add	x0, x21, #8
	mov	x1, #0
	bl	_drm_property_replace_blob
	orr	w22, w0, w22
	add	x0, x21, #4
	mov	x1, x20
	bl	_drm_property_replace_blob
	orr	w8, w22, w0
	ldr	w9, [x21]
	orr	w8, w8, w9
	str	w8, [x21]
	mov	x0, x19
	bl	_drm_atomic_commit
LBB0_18:
	mov	x21, x0
LBB0_19:
	mov	x0, x19
	bl	_drm_atomic_state_put
	mov	x0, x20
	bl	_drm_property_blob_put
LBB0_20:
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
