	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function buffer_create_buffer_object
_buffer_create_buffer_object:           ## @buffer_create_buffer_object
	.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, %r12
	movq	(%rsi), %rbx
	movq	_GL_STATIC_DRAW@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	16(%rdi), %edi
	callq	_debug_d3dusage
	leaq	L_.str(%rip), %rdi
	movq	%r12, %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_TRACE
	movq	_GL_NO_ERROR@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	xorl	%eax, %eax
	callq	*(%rbx)
	cmpq	(%r15), %rax
	jne	LBB0_1
## %bb.2:
	leaq	28(%r12), %rsi
	movl	$1, %edi
	callq	_glGenBuffers
	movl	%eax, %edi
	callq	_GL_EXTCALL
	xorl	%eax, %eax
	callq	*(%rbx)
	movq	%rax, %r13
	cmpl	$0, 28(%r12)
	je	LBB0_4
## %bb.3:
	cmpq	(%r15), %r13
	jne	LBB0_4
## %bb.7:
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_buffer_bind
	xorl	%eax, %eax
	callq	*(%rbx)
	cmpq	(%r15), %rax
	jne	LBB0_8
## %bb.9:
	movq	_WINED3DUSAGE_DYNAMIC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 16(%r12)
	je	LBB0_12
## %bb.10:
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_TRACE
	movq	_GL_STREAM_DRAW_ARB@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movq	8(%rbx), %rax
	movq	_APPLE_FLUSH_BUFFER_RANGE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	$0, (%rax,%rcx,8)
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	je	LBB0_12
## %bb.11:
	movl	24(%r12), %edi
	movq	_GL_BUFFER_FLUSHING_UNMAP_APPLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_GL_FALSE@GOTPCREL(%rip), %r13
	movl	(%r13), %edx
	callq	_glBufferParameteriAPPLE
	movl	%eax, %edi
	callq	_GL_EXTCALL
	movl	24(%r12), %edi
	movq	_GL_BUFFER_SERIALIZED_MODIFY_APPLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r13), %edx
	callq	_glBufferParameteriAPPLE
	movl	%eax, %edi
	callq	_GL_EXTCALL
	leaq	L_.str.4(%rip), %rdi
	callq	_checkGLcall
	movq	_WINED3D_BUFFER_APPLESYNC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%r12)
LBB0_12:
	movl	20(%r12), %esi
	movl	24(%r12), %edi
	xorl	%edx, %edx
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rcx
	callq	_glBufferData
	movl	%eax, %edi
	callq	_GL_EXTCALL
	xorl	%eax, %eax
	callq	*(%rbx)
	cmpq	(%r15), %rax
	jne	LBB0_13
## %bb.14:
	movq	%r13, 8(%r12)
	movq	%r12, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_buffer_invalidate_bo_range
	movq	_TRUE@GOTPCREL(%rip), %rax
	jmp	LBB0_15
LBB0_4:
	movq	%r13, %rdi
	callq	_debug_glerror
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_5
LBB0_8:
	movq	%rax, %r13
	movq	%rax, %rdi
	callq	_debug_glerror
	leaq	L_.str.2(%rip), %rdi
LBB0_5:
	movl	%eax, %esi
	movq	%r13, %rdx
LBB0_6:
	xorl	%eax, %eax
	callq	_ERR
	leaq	L_.str.6(%rip), %rdi
	xorl	%eax, %eax
	callq	_ERR
	movq	_WINED3D_BUFFER_USE_BO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, (%r12)
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_buffer_destroy_buffer_object
	movq	%r12, %rdi
	callq	_buffer_clear_dirty_areas
	movq	_FALSE@GOTPCREL(%rip), %rax
LBB0_15:
	movl	(%rax), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_debug_glerror
	leaq	L_.str.5(%rip), %rdi
	movl	%eax, %esi
	movq	%rbx, %rdx
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_GL_STATIC_DRAW,8,3             ## @GL_STATIC_DRAW
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Creating an OpenGL buffer object for wined3d_buffer %p with usage %s.\n"

	.comm	_GL_NO_ERROR,8,3                ## @GL_NO_ERROR
L_.str.1:                               ## @.str.1
	.asciz	"Failed to create a BO with error %s (%#x).\n"

L_.str.2:                               ## @.str.2
	.asciz	"Failed to bind the BO with error %s (%#x).\n"

	.comm	_WINED3DUSAGE_DYNAMIC,4,2       ## @WINED3DUSAGE_DYNAMIC
L_.str.3:                               ## @.str.3
	.asciz	"Buffer has WINED3DUSAGE_DYNAMIC set.\n"

	.comm	_GL_STREAM_DRAW_ARB,8,3         ## @GL_STREAM_DRAW_ARB
	.comm	_APPLE_FLUSH_BUFFER_RANGE,8,3   ## @APPLE_FLUSH_BUFFER_RANGE
	.comm	_GL_BUFFER_FLUSHING_UNMAP_APPLE,4,2 ## @GL_BUFFER_FLUSHING_UNMAP_APPLE
	.comm	_GL_FALSE,4,2                   ## @GL_FALSE
	.comm	_GL_BUFFER_SERIALIZED_MODIFY_APPLE,4,2 ## @GL_BUFFER_SERIALIZED_MODIFY_APPLE
L_.str.4:                               ## @.str.4
	.asciz	"glBufferParameteriAPPLE"

	.comm	_WINED3D_BUFFER_APPLESYNC,4,2   ## @WINED3D_BUFFER_APPLESYNC
L_.str.5:                               ## @.str.5
	.asciz	"glBufferData failed with error %s (%#x).\n"

	.comm	_TRUE,4,2                       ## @TRUE
L_.str.6:                               ## @.str.6
	.asciz	"Failed to create a buffer object. Continuing, but performance issues may occur.\n"

	.comm	_WINED3D_BUFFER_USE_BO,4,2      ## @WINED3D_BUFFER_USE_BO
	.comm	_FALSE,4,2                      ## @FALSE
	.no_dead_strip	_buffer_create_buffer_object
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function buffer_create_buffer_object
_buffer_create_buffer_object:           ; @buffer_create_buffer_object
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x20, x1
	mov	x19, x0
	ldr	x23, [x1]
Lloh0:
	adrp	x8, _GL_STATIC_DRAW@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GL_STATIC_DRAW@GOTPAGEOFF]
Lloh2:
	ldr	x21, [x8]
	ldr	w0, [x0, #16]
	bl	_debug_d3dusage
                                        ; kill: def $w0 killed $w0 def $x0
	stp	x19, x0, [sp]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_TRACE
Lloh5:
	adrp	x24, _GL_NO_ERROR@GOTPAGE
Lloh6:
	ldr	x24, [x24, _GL_NO_ERROR@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x23]
	blr	x8
	ldr	x8, [x24]
	cmp	x0, x8
	b.ne	LBB0_1
; %bb.2:
	add	x1, x19, #28
	mov	w0, #1
	bl	_glGenBuffers
	bl	_GL_EXTCALL
	ldr	x8, [x23]
	blr	x8
	mov	x22, x0
	ldr	w8, [x19, #28]
	cbz	w8, LBB0_10
; %bb.3:
	ldr	x8, [x24]
	cmp	x22, x8
	b.ne	LBB0_10
; %bb.4:
	mov	x0, x19
	mov	x1, x20
	bl	_buffer_bind
	ldr	x8, [x23]
	blr	x8
	ldr	x8, [x24]
	cmp	x0, x8
	b.ne	LBB0_11
; %bb.5:
	ldr	w8, [x19, #16]
Lloh7:
	adrp	x9, _WINED3DUSAGE_DYNAMIC@GOTPAGE
Lloh8:
	ldr	x9, [x9, _WINED3DUSAGE_DYNAMIC@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_8
; %bb.6:
Lloh10:
	adrp	x0, l_.str.3@PAGE
Lloh11:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_TRACE
Lloh12:
	adrp	x8, _GL_STREAM_DRAW_ARB@GOTPAGE
Lloh13:
	ldr	x8, [x8, _GL_STREAM_DRAW_ARB@GOTPAGEOFF]
Lloh14:
	ldr	x21, [x8]
	ldr	x8, [x23, #8]
Lloh15:
	adrp	x9, _APPLE_FLUSH_BUFFER_RANGE@GOTPAGE
Lloh16:
	ldr	x9, [x9, _APPLE_FLUSH_BUFFER_RANGE@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	ldr	x8, [x8, x9, lsl #3]
	cbz	x8, LBB0_8
; %bb.7:
	ldr	w0, [x19, #24]
Lloh18:
	adrp	x8, _GL_BUFFER_FLUSHING_UNMAP_APPLE@GOTPAGE
Lloh19:
	ldr	x8, [x8, _GL_BUFFER_FLUSHING_UNMAP_APPLE@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
Lloh21:
	adrp	x22, _GL_FALSE@GOTPAGE
Lloh22:
	ldr	x22, [x22, _GL_FALSE@GOTPAGEOFF]
	ldr	w2, [x22]
	bl	_glBufferParameteriAPPLE
	bl	_GL_EXTCALL
	ldr	w0, [x19, #24]
Lloh23:
	adrp	x8, _GL_BUFFER_SERIALIZED_MODIFY_APPLE@GOTPAGE
Lloh24:
	ldr	x8, [x8, _GL_BUFFER_SERIALIZED_MODIFY_APPLE@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
	ldr	w2, [x22]
	bl	_glBufferParameteriAPPLE
	bl	_GL_EXTCALL
Lloh26:
	adrp	x0, l_.str.4@PAGE
Lloh27:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_checkGLcall
Lloh28:
	adrp	x8, _WINED3D_BUFFER_APPLESYNC@GOTPAGE
Lloh29:
	ldr	x8, [x8, _WINED3D_BUFFER_APPLESYNC@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
	ldr	w9, [x19]
	orr	w8, w9, w8
	str	w8, [x19]
LBB0_8:
	ldp	w1, w0, [x19, #20]
	mov	x2, #0
	mov	x3, x21
	bl	_glBufferData
	bl	_GL_EXTCALL
	ldr	x8, [x23]
	blr	x8
	ldr	x8, [x24]
	cmp	x0, x8
	b.ne	LBB0_12
; %bb.9:
	str	x21, [x19, #8]
	mov	x0, x19
	mov	w1, #0
	mov	w2, #0
	bl	_buffer_invalidate_bo_range
Lloh31:
	adrp	x8, _TRUE@GOTPAGE
Lloh32:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
	b	LBB0_14
LBB0_10:
	mov	x0, x22
	bl	_debug_glerror
                                        ; kill: def $w0 killed $w0 def $x0
	stp	x0, x22, [sp]
Lloh33:
	adrp	x0, l_.str.1@PAGE
Lloh34:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_13
LBB0_11:
	mov	x22, x0
	bl	_debug_glerror
                                        ; kill: def $w0 killed $w0 def $x0
	stp	x0, x22, [sp]
Lloh35:
	adrp	x0, l_.str.2@PAGE
Lloh36:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_13
LBB0_12:
	mov	x22, x0
	bl	_debug_glerror
                                        ; kill: def $w0 killed $w0 def $x0
	stp	x0, x22, [sp]
Lloh37:
	adrp	x0, l_.str.5@PAGE
Lloh38:
	add	x0, x0, l_.str.5@PAGEOFF
LBB0_13:
	bl	_ERR
Lloh39:
	adrp	x0, l_.str.6@PAGE
Lloh40:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_ERR
Lloh41:
	adrp	x8, _WINED3D_BUFFER_USE_BO@GOTPAGE
Lloh42:
	ldr	x8, [x8, _WINED3D_BUFFER_USE_BO@GOTPAGEOFF]
Lloh43:
	ldr	w8, [x8]
	ldr	w9, [x19]
	bic	w8, w9, w8
	str	w8, [x19]
	mov	x0, x19
	mov	x1, x20
	bl	_buffer_destroy_buffer_object
	mov	x0, x19
	bl	_buffer_clear_dirty_areas
Lloh44:
	adrp	x8, _FALSE@GOTPAGE
Lloh45:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
LBB0_14:
	ldr	w0, [x8]
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpLdrGot	Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpAdd	Lloh39, Lloh40
	.cfi_endproc
                                        ; -- End function
	.comm	_GL_STATIC_DRAW,8,3             ; @GL_STATIC_DRAW
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Creating an OpenGL buffer object for wined3d_buffer %p with usage %s.\n"

	.comm	_GL_NO_ERROR,8,3                ; @GL_NO_ERROR
l_.str.1:                               ; @.str.1
	.asciz	"Failed to create a BO with error %s (%#x).\n"

l_.str.2:                               ; @.str.2
	.asciz	"Failed to bind the BO with error %s (%#x).\n"

	.comm	_WINED3DUSAGE_DYNAMIC,4,2       ; @WINED3DUSAGE_DYNAMIC
l_.str.3:                               ; @.str.3
	.asciz	"Buffer has WINED3DUSAGE_DYNAMIC set.\n"

	.comm	_GL_STREAM_DRAW_ARB,8,3         ; @GL_STREAM_DRAW_ARB
	.comm	_APPLE_FLUSH_BUFFER_RANGE,8,3   ; @APPLE_FLUSH_BUFFER_RANGE
	.comm	_GL_BUFFER_FLUSHING_UNMAP_APPLE,4,2 ; @GL_BUFFER_FLUSHING_UNMAP_APPLE
	.comm	_GL_FALSE,4,2                   ; @GL_FALSE
	.comm	_GL_BUFFER_SERIALIZED_MODIFY_APPLE,4,2 ; @GL_BUFFER_SERIALIZED_MODIFY_APPLE
l_.str.4:                               ; @.str.4
	.asciz	"glBufferParameteriAPPLE"

	.comm	_WINED3D_BUFFER_APPLESYNC,4,2   ; @WINED3D_BUFFER_APPLESYNC
l_.str.5:                               ; @.str.5
	.asciz	"glBufferData failed with error %s (%#x).\n"

	.comm	_TRUE,4,2                       ; @TRUE
l_.str.6:                               ; @.str.6
	.asciz	"Failed to create a buffer object. Continuing, but performance issues may occur.\n"

	.comm	_WINED3D_BUFFER_USE_BO,4,2      ; @WINED3D_BUFFER_USE_BO
	.comm	_FALSE,4,2                      ; @FALSE
	.no_dead_strip	_buffer_create_buffer_object
.subsections_via_symbols
