	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function write_const
_write_const:                           ## @write_const
	.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, %r13
	movq	%r8, %rbx
	movq	%rdx, %r14
	movl	%esi, %r12d
	movq	%rdi, %r15
	movq	%rcx, %rdi
	xorl	%esi, %esi
	callq	_d3dsp_register
                                        ## kill: def $eax killed $eax def $rax
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	testq	%r13, %r13
	je	LBB0_5
## %bb.1:
	movq	_D3DSIO_DEFB@GOTPCREL(%rip), %rdx
	movq	_D3DSI_INSTLENGTH_SHIFT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	cmpq	%r14, (%rdx)
	jne	LBB0_3
## %bb.2:
	movl	$2, %edx
	jmp	LBB0_4
LBB0_3:
	movl	$5, %edx
LBB0_4:
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %edx
	movslq	%edx, %rcx
	orq	%r14, %rcx
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
LBB0_5:
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	testl	%r12d, %r12d
	jle	LBB0_10
## %bb.6:
	movq	_D3DSP_WRITEMASK_ALL@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	$2147483648, %r13d              ## imm = 0x80000000
	orq	%rax, %r13
	movl	%r12d, %r14d
	xorl	%r12d, %r12d
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_7 Depth=1
	incq	%r12
	cmpq	%r12, %r14
	je	LBB0_10
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_put_dword
	movq	(%r15,%r12,8), %rax
	movq	_D3DSP_REGNUM_MASK@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	andq	(%rax), %rsi
	orq	%r13, %rsi
	movq	%rbx, %rdi
	callq	_put_dword
	movq	(%r15,%r12,8), %rax
	movq	8(%rax), %rax
	movq	(%rax), %rsi
	movq	%rbx, %rdi
	callq	_put_dword
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	_D3DSIO_DEFB@GOTPCREL(%rip), %rcx
	cmpq	%rax, (%rcx)
	je	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	(%r15,%r12,8), %rax
	movq	8(%rax), %rax
	movq	8(%rax), %rsi
	movq	%rbx, %rdi
	callq	_put_dword
	movq	(%r15,%r12,8), %rax
	movq	8(%rax), %rax
	movq	16(%rax), %rsi
	movq	%rbx, %rdi
	callq	_put_dword
	movq	(%r15,%r12,8), %rax
	movq	8(%rax), %rax
	movq	24(%rax), %rsi
	movq	%rbx, %rdi
	callq	_put_dword
	jmp	LBB0_9
LBB0_10:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_D3DSP_WRITEMASK_ALL,4,2        ## @D3DSP_WRITEMASK_ALL
	.comm	_D3DSIO_DEFB,8,3                ## @D3DSIO_DEFB
	.comm	_D3DSI_INSTLENGTH_SHIFT,4,2     ## @D3DSI_INSTLENGTH_SHIFT
	.comm	_D3DSP_REGNUM_MASK,8,3          ## @D3DSP_REGNUM_MASK
	.no_dead_strip	_write_const
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function write_const
_write_const:                           ; @write_const
	.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	x24, x5
	mov	x19, x4
	mov	x20, x2
	mov	x23, x1
	mov	x21, x0
	mov	x0, x3
	mov	w1, #0
	bl	_d3dsp_register
Lloh0:
	adrp	x25, _D3DSIO_DEFB@GOTPAGE
Lloh1:
	ldr	x25, [x25, _D3DSIO_DEFB@GOTPAGEOFF]
	mov	x22, x20
	cbz	x24, LBB0_5
; %bb.1:
	ldr	x9, [x25]
Lloh2:
	adrp	x8, _D3DSI_INSTLENGTH_SHIFT@GOTPAGE
Lloh3:
	ldr	x8, [x8, _D3DSI_INSTLENGTH_SHIFT@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	cmp	x9, x20
	b.ne	LBB0_3
; %bb.2:
	mov	w9, #2
	b	LBB0_4
LBB0_3:
	mov	w9, #5
LBB0_4:
	lsl	w8, w9, w8
	sxtw	x8, w8
	orr	x22, x8, x20
LBB0_5:
	cmp	w23, #1
	b.lt	LBB0_10
; %bb.6:
Lloh5:
	adrp	x8, _D3DSP_WRITEMASK_ALL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _D3DSP_WRITEMASK_ALL@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	orr	w8, w0, w8
	orr	x24, x8, #0x80000000
	mov	w23, w23
Lloh8:
	adrp	x26, _D3DSP_REGNUM_MASK@GOTPAGE
Lloh9:
	ldr	x26, [x26, _D3DSP_REGNUM_MASK@GOTPAGEOFF]
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	add	x21, x21, #8
	subs	x23, x23, #1
	b.eq	LBB0_10
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x22
	bl	_put_dword
	ldr	x8, [x21]
	ldr	x8, [x8]
	ldr	x9, [x26]
	and	x8, x9, x8
	orr	x1, x8, x24
	mov	x0, x19
	bl	_put_dword
	ldr	x8, [x21]
	ldr	x8, [x8, #8]
	ldr	x1, [x8]
	mov	x0, x19
	bl	_put_dword
	ldr	x8, [x25]
	cmp	x8, x20
	b.eq	LBB0_7
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	x8, [x21]
	ldr	x8, [x8, #8]
	ldr	x1, [x8, #8]
	mov	x0, x19
	bl	_put_dword
	ldr	x8, [x21]
	ldr	x8, [x8, #8]
	ldr	x1, [x8, #16]
	mov	x0, x19
	bl	_put_dword
	ldr	x8, [x21]
	ldr	x8, [x8, #8]
	ldr	x1, [x8, #24]
	mov	x0, x19
	bl	_put_dword
	b	LBB0_7
LBB0_10:
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_D3DSP_WRITEMASK_ALL,4,2        ; @D3DSP_WRITEMASK_ALL
	.comm	_D3DSIO_DEFB,8,3                ; @D3DSIO_DEFB
	.comm	_D3DSI_INSTLENGTH_SHIFT,4,2     ; @D3DSI_INSTLENGTH_SHIFT
	.comm	_D3DSP_REGNUM_MASK,8,3          ; @D3DSP_REGNUM_MASK
	.no_dead_strip	_write_const
.subsections_via_symbols
