	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wined3d_cs_exec_set_light
_wined3d_cs_exec_set_light:             ## @wined3d_cs_exec_set_light
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r13
	movl	(%rsi), %r15d
	leaq	8(%rdi), %r12
	movq	%r12, %rdi
	movl	%r15d, %esi
	callq	_wined3d_state_get_light
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	%rax, %rbx
	movl	(%rax), %edi
	cmpl	$-1, %edi
	je	LBB0_7
## %bb.4:
	movq	24(%rbx), %rax
	cmpq	24(%r14), %rax
	je	LBB0_6
## %bb.5:
	movl	(%r13), %edi
	movq	_STATE_LIGHT_TYPE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_device_invalidate_state
	movl	(%rbx), %edi
LBB0_6:
	movl	(%r13), %r15d
	callq	_STATE_ACTIVELIGHT
	movl	%r15d, %edi
	movl	%eax, %esi
	callq	_device_invalidate_state
	jmp	LBB0_7
LBB0_1:
	leaq	L_.str(%rip), %rdi
	callq	_TRACE
	movl	$40, %edi
	callq	_heap_alloc_zero
	testq	%rax, %rax
	je	LBB0_8
## %bb.2:
	movq	%rax, %rbx
	movl	%r15d, %edi
	callq	_LIGHTMAP_HASHFUNC
	movl	%eax, %edi
	shlq	$2, %rdi
	addq	(%r12), %rdi
	movq	%rbx, %rsi
	addq	$32, %rsi
	callq	_list_add_head
	movl	$-1, (%rbx)
	movl	%r15d, 4(%rbx)
LBB0_7:
	movq	24(%r14), %rax
	movq	%rax, 24(%rbx)
	movups	4(%r14), %xmm0
	movups	%xmm0, 8(%rbx)
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	leaq	L_.str.1(%rip), %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR                            ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Adding new light.\n"

L_.str.1:                               ## @.str.1
	.asciz	"Failed to allocate light info.\n"

	.comm	_STATE_LIGHT_TYPE,4,2           ## @STATE_LIGHT_TYPE
	.no_dead_strip	_wined3d_cs_exec_set_light
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wined3d_cs_exec_set_light
_wined3d_cs_exec_set_light:             ; @wined3d_cs_exec_set_light
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x1
	mov	x22, x0
	ldr	w21, [x1]
	add	x23, x0, #8
	mov	x0, x23
	mov	x1, x21
	bl	_wined3d_state_get_light
	cbz	x0, LBB0_5
; %bb.1:
	mov	x20, x0
	ldr	w0, [x0]
	cmn	w0, #1
	b.eq	LBB0_7
; %bb.2:
	ldr	x8, [x20, #24]
	ldr	x9, [x19, #24]
	cmp	x8, x9
	b.eq	LBB0_4
; %bb.3:
	ldr	w0, [x22]
Lloh0:
	adrp	x8, _STATE_LIGHT_TYPE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _STATE_LIGHT_TYPE@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_device_invalidate_state
	ldr	w0, [x20]
LBB0_4:
	ldr	w21, [x22]
	bl	_STATE_ACTIVELIGHT
	mov	x1, x0
	mov	x0, x21
	bl	_device_invalidate_state
	b	LBB0_7
LBB0_5:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_TRACE
	mov	w0, #40
	bl	_heap_alloc_zero
	cbz	x0, LBB0_8
; %bb.6:
	mov	x20, x0
	mov	x0, x21
	bl	_LIGHTMAP_HASHFUNC
	ldr	x8, [x23]
	add	x0, x8, w0, uxtw #2
	add	x1, x20, #32
	bl	_list_add_head
	mov	w8, #-1
	stp	w8, w21, [x20]
LBB0_7:
	ldr	x8, [x19, #24]
	str	x8, [x20, #24]
	ldur	q0, [x19, #4]
	stur	q0, [x20, #8]
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_8:
Lloh5:
	adrp	x0, l_.str.1@PAGE
Lloh6:
	add	x0, x0, l_.str.1@PAGEOFF
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_ERR
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Adding new light.\n"

l_.str.1:                               ; @.str.1
	.asciz	"Failed to allocate light info.\n"

	.comm	_STATE_LIGHT_TYPE,4,2           ; @STATE_LIGHT_TYPE
	.no_dead_strip	_wined3d_cs_exec_set_light
.subsections_via_symbols
