	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function d3d8_free_handle
_d3d8_free_handle:                      ## @d3d8_free_handle
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	_D3D8_INVALID_HANDLE@GOTPCREL(%rip), %rax
	cmpq	%rsi, (%rax)
	je	LBB0_2
## %bb.1:
	cmpq	%rsi, (%rdi)
	jbe	LBB0_2
## %bb.3:
	movl	%edx, %r8d
	movq	16(%rdi), %rax
	movq	%rsi, %rcx
	shlq	$4, %rcx
	leaq	(%rax,%rcx), %rdx
	cmpl	%r8d, (%rax,%rcx)
	jne	LBB0_4
## %bb.5:
	movq	8(%rax,%rcx), %rbx
	movq	8(%rdi), %rsi
	movq	%rsi, 8(%rax,%rcx)
	movq	_D3D8_HANDLE_FREE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	movq	%rdx, 8(%rdi)
	jmp	LBB0_6
LBB0_2:
	leaq	L_.str(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_WARN
LBB0_6:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
LBB0_4:
	leaq	L_.str.1(%rip), %rdi
	xorl	%ebx, %ebx
	movl	%r8d, %ecx
	xorl	%eax, %eax
	callq	_WARN
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_D3D8_INVALID_HANDLE,8,3        ## @D3D8_INVALID_HANDLE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid handle %u passed.\n"

L_.str.1:                               ## @.str.1
	.asciz	"Handle %u(%p) is not of type %#x.\n"

	.comm	_D3D8_HANDLE_FREE,4,2           ## @D3D8_HANDLE_FREE
	.no_dead_strip	_d3d8_free_handle
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function d3d8_free_handle
_d3d8_free_handle:                      ; @d3d8_free_handle
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #32
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
                                        ; kill: def $w2 killed $w2 def $x2
Lloh0:
	adrp	x8, _D3D8_INVALID_HANDLE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _D3D8_INVALID_HANDLE@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x8, x1
	b.eq	LBB0_4
; %bb.1:
	ldr	x8, [x0]
	cmp	x8, x1
	b.ls	LBB0_4
; %bb.2:
	ldr	x8, [x0, #16]
	add	x9, x8, x1, lsl #4
	ldr	w8, [x9]
	cmp	w8, w2
	b.ne	LBB0_7
; %bb.3:
	ldr	x8, [x9, #8]
	ldr	x10, [x0, #8]
	str	x10, [x9, #8]
Lloh3:
	adrp	x10, _D3D8_HANDLE_FREE@GOTPAGE
Lloh4:
	ldr	x10, [x10, _D3D8_HANDLE_FREE@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	str	w10, [x9]
	str	x9, [x0, #8]
	b	LBB0_6
LBB0_4:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
LBB0_5:
	bl	_WARN
	mov	x8, #0
LBB0_6:
	mov	x0, x8
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #32
	ret
LBB0_7:
	stp	x9, x2, [sp]
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_D3D8_INVALID_HANDLE,8,3        ; @D3D8_INVALID_HANDLE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid handle %u passed.\n"

l_.str.1:                               ; @.str.1
	.asciz	"Handle %u(%p) is not of type %#x.\n"

	.comm	_D3D8_HANDLE_FREE,4,2           ; @D3D8_HANDLE_FREE
	.no_dead_strip	_d3d8_free_handle
.subsections_via_symbols
