	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wined3d_so_statistics_query_create
_wined3d_so_statistics_query_create:    ## @wined3d_so_statistics_query_create
	.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	%rcx, %rbx
	movq	%rdx, %rcx
	movq	_WINED3D_QUERY_TYPE_SO_STATISTICS_STREAM0@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	_WINED3DERR_NOTAVAILABLE@GOTPCREL(%rip), %rdx
	cmpl	%esi, %r15d
	ja	LBB0_10
## %bb.1:
	movl	%esi, %r12d
	movq	_WINED3D_QUERY_TYPE_SO_STATISTICS_STREAM3@GOTPCREL(%rip), %rax
	cmpl	%esi, (%rax)
	jb	LBB0_10
## %bb.2:
	movq	%r8, %r9
	movq	%rdi, %r13
	movq	(%rdi), %r14
	leaq	L_.str(%rip), %rdi
	movq	%r13, %rsi
	movl	%r12d, %edx
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	%rbx, %r8
	movq	%r9, -64(%rbp)                  ## 8-byte Spill
	xorl	%eax, %eax
	callq	_TRACE
	movq	(%r14), %rax
	movq	_WINED3D_GL_PRIMITIVE_QUERY@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpl	$0, (%rax,%rcx,4)
	je	LBB0_3
## %bb.5:
	movq	_ARB_TRANSFORM_FEEDBACK3@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpl	$0, (%rax,%rcx,4)
	je	LBB0_6
## %bb.7:
	movl	$12, %edi
	callq	_heap_alloc_zero
	testq	%rax, %rax
	je	LBB0_8
## %bb.9:
	movq	%rax, %r14
	movl	%r12d, %ebx
	subl	%r15d, %ebx
	leaq	4(%rax), %r15
	movq	%rax, %rcx
	addq	$8, %rcx
	movq	_so_statistics_query_ops@GOTPCREL(%rip), %r9
	movq	%r15, %rdi
	movq	%r13, %rsi
	movl	%r12d, %edx
	movl	$4, %r8d
	pushq	-48(%rbp)                       ## 8-byte Folded Reload
	pushq	-56(%rbp)                       ## 8-byte Folded Reload
	callq	_wined3d_query_init
	addq	$16, %rsp
	movl	%ebx, (%r14)
	leaq	L_.str.3(%rip), %rdi
	movq	%r14, %rsi
	xorl	%eax, %eax
	callq	_TRACE
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	%r15, (%rax)
	movq	_WINED3D_OK@GOTPCREL(%rip), %rdx
	jmp	LBB0_10
LBB0_3:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_4
LBB0_6:
	leaq	L_.str.2(%rip), %rdi
LBB0_4:
	callq	_WARN
	movq	_WINED3DERR_NOTAVAILABLE@GOTPCREL(%rip), %rdx
	jmp	LBB0_10
LBB0_8:
	movq	_E_OUTOFMEMORY@GOTPCREL(%rip), %rdx
LBB0_10:
	movl	(%rdx), %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_WINED3D_QUERY_TYPE_SO_STATISTICS_STREAM0,4,2 ## @WINED3D_QUERY_TYPE_SO_STATISTICS_STREAM0
	.comm	_WINED3D_QUERY_TYPE_SO_STATISTICS_STREAM3,4,2 ## @WINED3D_QUERY_TYPE_SO_STATISTICS_STREAM3
	.comm	_WINED3DERR_NOTAVAILABLE,4,2    ## @WINED3DERR_NOTAVAILABLE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"device %p, type %#x, parent %p, parent_ops %p, query %p.\n"

	.comm	_WINED3D_GL_PRIMITIVE_QUERY,8,3 ## @WINED3D_GL_PRIMITIVE_QUERY
L_.str.1:                               ## @.str.1
	.asciz	"OpenGL implementation does not support primitive queries.\n"

	.comm	_ARB_TRANSFORM_FEEDBACK3,8,3    ## @ARB_TRANSFORM_FEEDBACK3
L_.str.2:                               ## @.str.2
	.asciz	"OpenGL implementation does not support indexed queries.\n"

	.comm	_E_OUTOFMEMORY,4,2              ## @E_OUTOFMEMORY
	.comm	_so_statistics_query_ops,4,2    ## @so_statistics_query_ops
L_.str.3:                               ## @.str.3
	.asciz	"Created query %p.\n"

	.comm	_WINED3D_OK,4,2                 ## @WINED3D_OK
	.no_dead_strip	_wined3d_so_statistics_query_create
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wined3d_so_statistics_query_create
_wined3d_so_statistics_query_create:    ; @wined3d_so_statistics_query_create
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
Lloh0:
	adrp	x8, _WINED3D_QUERY_TYPE_SO_STATISTICS_STREAM0@GOTPAGE
Lloh1:
	ldr	x8, [x8, _WINED3D_QUERY_TYPE_SO_STATISTICS_STREAM0@GOTPAGEOFF]
Lloh2:
	ldr	w25, [x8]
Lloh3:
	adrp	x8, _WINED3D_QUERY_TYPE_SO_STATISTICS_STREAM3@GOTPAGE
Lloh4:
	ldr	x8, [x8, _WINED3D_QUERY_TYPE_SO_STATISTICS_STREAM3@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w25, w1
	ccmp	w8, w1, #0, ls
	b.lo	LBB0_8
; %bb.1:
	mov	x19, x4
	mov	x20, x3
	mov	x21, x2
	mov	x22, x1
	mov	x23, x0
	ldr	x24, [x0]
	stp	x3, x4, [sp, #24]
	stp	x22, x2, [sp, #8]
	str	x0, [sp]
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	bl	_TRACE
	ldr	x8, [x24]
Lloh8:
	adrp	x9, _WINED3D_GL_PRIMITIVE_QUERY@GOTPAGE
Lloh9:
	ldr	x9, [x9, _WINED3D_GL_PRIMITIVE_QUERY@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	ldr	w9, [x8, x9, lsl #2]
	cbz	w9, LBB0_5
; %bb.2:
Lloh11:
	adrp	x9, _ARB_TRANSFORM_FEEDBACK3@GOTPAGE
Lloh12:
	ldr	x9, [x9, _ARB_TRANSFORM_FEEDBACK3@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	ldr	w8, [x8, x9, lsl #2]
	cbz	w8, LBB0_6
; %bb.3:
	mov	w0, #12
	bl	_heap_alloc_zero
	cbz	x0, LBB0_10
; %bb.4:
	mov	x24, x0
	sub	w26, w22, w25
	add	x25, x0, #4
	add	x3, x0, #8
Lloh14:
	adrp	x5, _so_statistics_query_ops@GOTPAGE
Lloh15:
	ldr	x5, [x5, _so_statistics_query_ops@GOTPAGEOFF]
	mov	x0, x25
	mov	x1, x23
	mov	x2, x22
	mov	w4, #4
	mov	x6, x21
	mov	x7, x20
	bl	_wined3d_query_init
	str	w26, [x24]
	str	x24, [sp]
Lloh16:
	adrp	x0, l_.str.3@PAGE
Lloh17:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_TRACE
	str	x25, [x19]
Lloh18:
	adrp	x8, _WINED3D_OK@GOTPAGE
Lloh19:
	ldr	x8, [x8, _WINED3D_OK@GOTPAGEOFF]
	b	LBB0_9
LBB0_5:
Lloh20:
	adrp	x0, l_.str.1@PAGE
Lloh21:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_7
LBB0_6:
Lloh22:
	adrp	x0, l_.str.2@PAGE
Lloh23:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_7:
	bl	_WARN
LBB0_8:
Lloh24:
	adrp	x8, _WINED3DERR_NOTAVAILABLE@GOTPAGE
Lloh25:
	ldr	x8, [x8, _WINED3DERR_NOTAVAILABLE@GOTPAGEOFF]
LBB0_9:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_10:
Lloh26:
	adrp	x8, _E_OUTOFMEMORY@GOTPAGE
Lloh27:
	ldr	x8, [x8, _E_OUTOFMEMORY@GOTPAGEOFF]
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_WINED3D_QUERY_TYPE_SO_STATISTICS_STREAM0,4,2 ; @WINED3D_QUERY_TYPE_SO_STATISTICS_STREAM0
	.comm	_WINED3D_QUERY_TYPE_SO_STATISTICS_STREAM3,4,2 ; @WINED3D_QUERY_TYPE_SO_STATISTICS_STREAM3
	.comm	_WINED3DERR_NOTAVAILABLE,4,2    ; @WINED3DERR_NOTAVAILABLE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"device %p, type %#x, parent %p, parent_ops %p, query %p.\n"

	.comm	_WINED3D_GL_PRIMITIVE_QUERY,8,3 ; @WINED3D_GL_PRIMITIVE_QUERY
l_.str.1:                               ; @.str.1
	.asciz	"OpenGL implementation does not support primitive queries.\n"

	.comm	_ARB_TRANSFORM_FEEDBACK3,8,3    ; @ARB_TRANSFORM_FEEDBACK3
l_.str.2:                               ; @.str.2
	.asciz	"OpenGL implementation does not support indexed queries.\n"

	.comm	_E_OUTOFMEMORY,4,2              ; @E_OUTOFMEMORY
	.comm	_so_statistics_query_ops,4,2    ; @so_statistics_query_ops
l_.str.3:                               ; @.str.3
	.asciz	"Created query %p.\n"

	.comm	_WINED3D_OK,4,2                 ; @WINED3D_OK
	.no_dead_strip	_wined3d_so_statistics_query_create
.subsections_via_symbols
