	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_query_init                     ## -- Begin function query_init
	.p2align	4, 0x90
_query_init:                            ## @query_init
	.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
	movl	%edx, %r12d
	movq	_D3DQUERYTYPE_MEMORYPRESSURE@GOTPCREL(%rip), %rax
	cmpl	%edx, (%rax)
	jge	LBB0_5
## %bb.1:
	cmpl	$22, %r12d
	jne	LBB0_3
## %bb.2:
	leaq	L_.str(%rip), %rdi
	movl	$22, %esi
	callq	_FIXME
	movq	_D3DERR_NOTAVAILABLE@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_5:
	movq	%rsi, %r14
	movq	%rdi, %r15
	movq	_d3d9_query_vtbl@GOTPCREL(%rip), %rax
	movq	%rax, 24(%rdi)
	movl	$1, (%rdi)
	xorl	%eax, %eax
	callq	_wined3d_mutex_lock
	movl	4(%r14), %edi
	leaq	16(%r15), %r13
	movq	_d3d9_null_wined3d_parent_ops@GOTPCREL(%rip), %rcx
	movl	%r12d, %esi
	movq	%r15, %rdx
	movq	%r13, %r8
	callq	_wined3d_query_create
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_FAILED
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	xorl	%eax, %eax
	callq	_wined3d_mutex_unlock
	leaq	L_.str.2(%rip), %rdi
	movl	%ebx, %esi
	callq	_WARN
	jmp	LBB0_12
LBB0_3:
	leaq	L_.str.1(%rip), %rdi
	movl	%r12d, %esi
	callq	_WARN
	movq	_D3DERR_NOTAVAILABLE@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_7:
	movq	_D3DQUERYTYPE_OCCLUSION@GOTPCREL(%rip), %rcx
	movl	$4, %eax
	cmpl	%r12d, (%rcx)
	je	LBB0_10
## %bb.8:
	movq	_D3DQUERYTYPE_TIMESTAMPDISJOINT@GOTPCREL(%rip), %rcx
	cmpl	%r12d, (%rcx)
	je	LBB0_10
## %bb.9:
	movl	(%r13), %edi
	callq	_wined3d_query_get_data_size
LBB0_10:
	movl	%eax, 4(%r15)
	xorl	%eax, %eax
	callq	_wined3d_mutex_unlock
	movq	%r14, 8(%r15)
	movq	%r14, %rdi
	callq	_IDirect3DDevice9Ex_AddRef
	movq	_D3D_OK@GOTPCREL(%rip), %rax
LBB0_11:
	movl	(%rax), %ebx
LBB0_12:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_D3DQUERYTYPE_MEMORYPRESSURE,4,2 ## @D3DQUERYTYPE_MEMORYPRESSURE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Undocumented query %#x created.\n"

L_.str.1:                               ## @.str.1
	.asciz	"Invalid query type %#x.\n"

	.comm	_D3DERR_NOTAVAILABLE,4,2        ## @D3DERR_NOTAVAILABLE
	.comm	_d3d9_query_vtbl,4,2            ## @d3d9_query_vtbl
	.comm	_d3d9_null_wined3d_parent_ops,4,2 ## @d3d9_null_wined3d_parent_ops
L_.str.2:                               ## @.str.2
	.asciz	"Failed to create wined3d query, hr %#x.\n"

	.comm	_D3DQUERYTYPE_OCCLUSION,4,2     ## @D3DQUERYTYPE_OCCLUSION
	.comm	_D3DQUERYTYPE_TIMESTAMPDISJOINT,4,2 ## @D3DQUERYTYPE_TIMESTAMPDISJOINT
	.comm	_D3D_OK,4,2                     ## @D3D_OK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_query_init                     ; -- Begin function query_init
	.p2align	2
_query_init:                            ; @query_init
	.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	x21, x2
Lloh0:
	adrp	x8, _D3DQUERYTYPE_MEMORYPRESSURE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _D3DQUERYTYPE_MEMORYPRESSURE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w2
	b.ge	LBB0_3
; %bb.1:
	cmp	w21, #22
	b.ne	LBB0_5
; %bb.2:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	mov	w1, #22
	bl	_FIXME
	b	LBB0_6
LBB0_3:
	mov	x19, x1
	mov	x20, x0
Lloh5:
	adrp	x8, _d3d9_query_vtbl@GOTPAGE
Lloh6:
	ldr	x8, [x8, _d3d9_query_vtbl@GOTPAGEOFF]
	str	x8, [x0, #24]
	mov	w8, #1
	str	w8, [x0]
	bl	_wined3d_mutex_lock
	ldr	w0, [x19, #4]
	add	x23, x20, #16
Lloh7:
	adrp	x3, _d3d9_null_wined3d_parent_ops@GOTPAGE
Lloh8:
	ldr	x3, [x3, _d3d9_null_wined3d_parent_ops@GOTPAGEOFF]
	mov	x1, x21
	mov	x2, x20
	mov	x4, x23
	bl	_wined3d_query_create
	mov	x22, x0
	bl	_FAILED
	cbz	x0, LBB0_7
; %bb.4:
	bl	_wined3d_mutex_unlock
Lloh9:
	adrp	x0, l_.str.2@PAGE
Lloh10:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x22
	bl	_WARN
	b	LBB0_12
LBB0_5:
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x21
	bl	_WARN
LBB0_6:
Lloh13:
	adrp	x8, _D3DERR_NOTAVAILABLE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _D3DERR_NOTAVAILABLE@GOTPAGEOFF]
	b	LBB0_11
LBB0_7:
Lloh15:
	adrp	x8, _D3DQUERYTYPE_OCCLUSION@GOTPAGE
Lloh16:
	ldr	x8, [x8, _D3DQUERYTYPE_OCCLUSION@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
Lloh18:
	adrp	x9, _D3DQUERYTYPE_TIMESTAMPDISJOINT@GOTPAGE
Lloh19:
	ldr	x9, [x9, _D3DQUERYTYPE_TIMESTAMPDISJOINT@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	cmp	w8, w21
	ccmp	w9, w21, #4, ne
	b.ne	LBB0_9
; %bb.8:
	mov	w0, #4
	b	LBB0_10
LBB0_9:
	ldr	w0, [x23]
	bl	_wined3d_query_get_data_size
LBB0_10:
	str	w0, [x20, #4]
	bl	_wined3d_mutex_unlock
	str	x19, [x20, #8]
	mov	x0, x19
	bl	_IDirect3DDevice9Ex_AddRef
Lloh21:
	adrp	x8, _D3D_OK@GOTPAGE
Lloh22:
	ldr	x8, [x8, _D3D_OK@GOTPAGEOFF]
LBB0_11:
	ldr	w22, [x8]
LBB0_12:
	mov	x0, x22
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_D3DQUERYTYPE_MEMORYPRESSURE,4,2 ; @D3DQUERYTYPE_MEMORYPRESSURE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Undocumented query %#x created.\n"

l_.str.1:                               ; @.str.1
	.asciz	"Invalid query type %#x.\n"

	.comm	_D3DERR_NOTAVAILABLE,4,2        ; @D3DERR_NOTAVAILABLE
	.comm	_d3d9_query_vtbl,4,2            ; @d3d9_query_vtbl
	.comm	_d3d9_null_wined3d_parent_ops,4,2 ; @d3d9_null_wined3d_parent_ops
l_.str.2:                               ; @.str.2
	.asciz	"Failed to create wined3d query, hr %#x.\n"

	.comm	_D3DQUERYTYPE_OCCLUSION,4,2     ; @D3DQUERYTYPE_OCCLUSION
	.comm	_D3DQUERYTYPE_TIMESTAMPDISJOINT,4,2 ; @D3DQUERYTYPE_TIMESTAMPDISJOINT
	.comm	_D3D_OK,4,2                     ; @D3D_OK
.subsections_via_symbols
