	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wined3d_caps_gl_ctx_create
_wined3d_caps_gl_ctx_create:            ## @wined3d_caps_gl_ctx_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	%r12
	pushq	%rbx
	subq	$64, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r14
	leaq	L_.str(%rip), %rdi
	callq	_TRACE
	xorl	%eax, %eax
	callq	_wglGetCurrentDC
	movq	%rax, 8(%rbx)
	xorl	%eax, %eax
	callq	_wglGetCurrentContext
	movq	%rax, (%rbx)
	movq	_WINED3D_OPENGL_WINDOW_CLASS_NAME@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_WS_OVERLAPPEDWINDOW@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorps	%xmm0, %xmm0
	movups	%xmm0, 24(%rsp)
	movups	%xmm0, 8(%rsp)
	movl	$10, (%rsp)
	leaq	L_.str.1(%rip), %rsi
	movl	$10, %ecx
	movl	$10, %r8d
	movl	$10, %r9d
	callq	_CreateWindowA
	movq	%rax, 16(%rbx)
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rdi
	callq	_GetDC
	movq	%rax, 24(%rbx)
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	leaq	-56(%rbp), %r15
	movq	%r15, %rdi
	movl	$24, %esi
	callq	_ZeroMemory
	movabsq	$4294967320, %rax               ## imm = 0x100000018
	movq	%rax, -56(%rbp)
	movq	_PFD_SUPPORT_OPENGL@GOTPCREL(%rip), %rax
	movq	_PFD_DOUBLEBUFFER@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_PFD_DRAW_TO_WINDOW@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movl	%ecx, -48(%rbp)
	movq	_PFD_TYPE_RGBA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -36(%rbp)
	movl	$32, -44(%rbp)
	movq	_PFD_MAIN_PLANE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -40(%rbp)
	movq	24(%rbx), %rdi
	movq	%r15, %rsi
	callq	_ChoosePixelFormat
	testl	%eax, %eax
	je	LBB0_5
## %bb.6:
	movl	%eax, %r15d
	movq	24(%rbx), %rdi
	leaq	-56(%rbp), %r12
	movl	%eax, %esi
	movl	$24, %edx
	movq	%r12, %rcx
	callq	_DescribePixelFormat
	movq	24(%rbx), %rdi
	movl	%r15d, %esi
	movq	%r12, %rdx
	callq	_SetPixelFormat
	movq	24(%rbx), %rdi
	callq	_wglCreateContext
	movq	%rax, 32(%rbx)
	testq	%rax, %rax
	je	LBB0_7
## %bb.8:
	movq	24(%rbx), %rdi
	movq	%rax, %rsi
	callq	_wglMakeCurrent
	testl	%eax, %eax
	je	LBB0_9
## %bb.21:
	movq	%r14, 40(%rbx)
	movq	_TRUE@GOTPCREL(%rip), %r14
	jmp	LBB0_20
LBB0_1:
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_10
LBB0_3:
	leaq	L_.str.3(%rip), %rdi
	jmp	LBB0_10
LBB0_5:
	leaq	L_.str.4(%rip), %rdi
	jmp	LBB0_10
LBB0_7:
	leaq	L_.str.5(%rip), %rdi
	callq	_WARN
	jmp	LBB0_11
LBB0_9:
	leaq	L_.str.6(%rip), %rdi
LBB0_10:
	callq	_ERR
LBB0_11:
	movq	32(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_13
## %bb.12:
	callq	_wglDeleteContext
LBB0_13:
	movq	$0, 32(%rbx)
	movq	24(%rbx), %rsi
	testq	%rsi, %rsi
	je	LBB0_15
## %bb.14:
	movq	16(%rbx), %rdi
	callq	_ReleaseDC
LBB0_15:
	movq	$0, 24(%rbx)
	movq	16(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_17
## %bb.16:
	callq	_DestroyWindow
LBB0_17:
	movq	$0, 16(%rbx)
	movq	(%rbx), %rsi
	movq	_FALSE@GOTPCREL(%rip), %r14
	testq	%rsi, %rsi
	je	LBB0_20
## %bb.18:
	movq	8(%rbx), %rdi
	callq	_wglMakeCurrent
	testl	%eax, %eax
	jne	LBB0_20
## %bb.19:
	leaq	L_.str.7(%rip), %rdi
	callq	_ERR
LBB0_20:
	movl	(%r14), %eax
	addq	$64, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"getting context...\n"

	.comm	_WINED3D_OPENGL_WINDOW_CLASS_NAME,4,2 ## @WINED3D_OPENGL_WINDOW_CLASS_NAME
L_.str.1:                               ## @.str.1
	.asciz	"WineD3D fake window"

	.comm	_WS_OVERLAPPEDWINDOW,4,2        ## @WS_OVERLAPPEDWINDOW
L_.str.2:                               ## @.str.2
	.asciz	"Failed to create a window.\n"

L_.str.3:                               ## @.str.3
	.asciz	"Failed to get a DC.\n"

	.comm	_PFD_SUPPORT_OPENGL,4,2         ## @PFD_SUPPORT_OPENGL
	.comm	_PFD_DOUBLEBUFFER,4,2           ## @PFD_DOUBLEBUFFER
	.comm	_PFD_DRAW_TO_WINDOW,4,2         ## @PFD_DRAW_TO_WINDOW
	.comm	_PFD_TYPE_RGBA,4,2              ## @PFD_TYPE_RGBA
	.comm	_PFD_MAIN_PLANE,4,2             ## @PFD_MAIN_PLANE
L_.str.4:                               ## @.str.4
	.asciz	"Failed to find a suitable pixel format.\n"

L_.str.5:                               ## @.str.5
	.asciz	"Failed to create default context for capabilities initialization.\n"

L_.str.6:                               ## @.str.6
	.asciz	"Failed to make caps GL context current.\n"

	.comm	_TRUE,4,2                       ## @TRUE
L_.str.7:                               ## @.str.7
	.asciz	"Failed to restore previous GL context.\n"

	.comm	_FALSE,4,2                      ## @FALSE
	.no_dead_strip	_wined3d_caps_gl_ctx_create
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function wined3d_caps_gl_ctx_create
lCPI0_0:
	.long	24                              ; 0x18
	.long	1                               ; 0x1
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_wined3d_caps_gl_ctx_create:            ; @wined3d_caps_gl_ctx_create
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_TRACE
	bl	_wglGetCurrentDC
	str	x0, [x19, #8]
	bl	_wglGetCurrentContext
	str	x0, [x19]
Lloh2:
	adrp	x8, _WINED3D_OPENGL_WINDOW_CLASS_NAME@GOTPAGE
Lloh3:
	ldr	x8, [x8, _WINED3D_OPENGL_WINDOW_CLASS_NAME@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
Lloh5:
	adrp	x8, _WS_OVERLAPPEDWINDOW@GOTPAGE
Lloh6:
	ldr	x8, [x8, _WS_OVERLAPPEDWINDOW@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	stp	xzr, xzr, [sp]
	str	xzr, [sp, #16]
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w3, #10
	mov	w4, #10
	mov	w5, #10
	mov	w6, #10
	mov	x7, #0
	bl	_CreateWindowA
	str	x0, [x19, #16]
	cbz	x0, LBB0_6
; %bb.1:
	bl	_GetDC
	str	x0, [x19, #24]
	cbz	x0, LBB0_7
; %bb.2:
	add	x0, sp, #24
	mov	w1, #24
	bl	_ZeroMemory
Lloh10:
	adrp	x8, lCPI0_0@PAGE
Lloh11:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	str	d0, [sp, #24]
Lloh12:
	adrp	x8, _PFD_SUPPORT_OPENGL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _PFD_SUPPORT_OPENGL@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
Lloh15:
	adrp	x9, _PFD_DOUBLEBUFFER@GOTPAGE
Lloh16:
	ldr	x9, [x9, _PFD_DOUBLEBUFFER@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh18:
	adrp	x9, _PFD_DRAW_TO_WINDOW@GOTPAGE
Lloh19:
	ldr	x9, [x9, _PFD_DRAW_TO_WINDOW@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh21:
	adrp	x9, _PFD_TYPE_RGBA@GOTPAGE
Lloh22:
	ldr	x9, [x9, _PFD_TYPE_RGBA@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	mov	w10, #32
	stp	w8, w10, [sp, #32]
Lloh24:
	adrp	x8, _PFD_MAIN_PLANE@GOTPAGE
Lloh25:
	ldr	x8, [x8, _PFD_MAIN_PLANE@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	stp	w8, w9, [sp, #40]
	ldr	x0, [x19, #24]
	add	x1, sp, #24
	bl	_ChoosePixelFormat
	cbz	w0, LBB0_8
; %bb.3:
	mov	x21, x0
	ldr	x0, [x19, #24]
	add	x3, sp, #24
	mov	x1, x21
	mov	w2, #24
	bl	_DescribePixelFormat
	ldr	x0, [x19, #24]
	add	x2, sp, #24
	mov	x1, x21
	bl	_SetPixelFormat
	ldr	x0, [x19, #24]
	bl	_wglCreateContext
	str	x0, [x19, #32]
	cbz	x0, LBB0_9
; %bb.4:
	mov	x1, x0
	ldr	x0, [x19, #24]
	bl	_wglMakeCurrent
	cbz	w0, LBB0_10
; %bb.5:
	str	x20, [x19, #40]
Lloh27:
	adrp	x8, _TRUE@GOTPAGE
Lloh28:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
	b	LBB0_21
LBB0_6:
Lloh29:
	adrp	x0, l_.str.2@PAGE
Lloh30:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_11
LBB0_7:
Lloh31:
	adrp	x0, l_.str.3@PAGE
Lloh32:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_11
LBB0_8:
Lloh33:
	adrp	x0, l_.str.4@PAGE
Lloh34:
	add	x0, x0, l_.str.4@PAGEOFF
	b	LBB0_11
LBB0_9:
Lloh35:
	adrp	x0, l_.str.5@PAGE
Lloh36:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_WARN
	ldr	x0, [x19, #32]
	cbnz	x0, LBB0_12
	b	LBB0_13
LBB0_10:
Lloh37:
	adrp	x0, l_.str.6@PAGE
Lloh38:
	add	x0, x0, l_.str.6@PAGEOFF
LBB0_11:
	bl	_ERR
	ldr	x0, [x19, #32]
	cbz	x0, LBB0_13
LBB0_12:
	bl	_wglDeleteContext
LBB0_13:
	str	xzr, [x19, #32]
	ldr	x1, [x19, #24]
	cbz	x1, LBB0_15
; %bb.14:
	ldr	x0, [x19, #16]
	bl	_ReleaseDC
LBB0_15:
	str	xzr, [x19, #24]
	ldr	x0, [x19, #16]
	cbz	x0, LBB0_17
; %bb.16:
	bl	_DestroyWindow
LBB0_17:
	str	xzr, [x19, #16]
	ldr	x1, [x19]
	cbz	x1, LBB0_20
; %bb.18:
	ldr	x0, [x19, #8]
	bl	_wglMakeCurrent
	cbnz	w0, LBB0_20
; %bb.19:
Lloh39:
	adrp	x0, l_.str.7@PAGE
Lloh40:
	add	x0, x0, l_.str.7@PAGEOFF
	bl	_ERR
LBB0_20:
Lloh41:
	adrp	x8, _FALSE@GOTPAGE
Lloh42:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
LBB0_21:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdrp	Lloh10, Lloh12
	.loh AdrpLdr	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpAdd	Lloh39, Lloh40
	.loh AdrpLdrGot	Lloh41, Lloh42
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"getting context...\n"

	.comm	_WINED3D_OPENGL_WINDOW_CLASS_NAME,4,2 ; @WINED3D_OPENGL_WINDOW_CLASS_NAME
l_.str.1:                               ; @.str.1
	.asciz	"WineD3D fake window"

	.comm	_WS_OVERLAPPEDWINDOW,4,2        ; @WS_OVERLAPPEDWINDOW
l_.str.2:                               ; @.str.2
	.asciz	"Failed to create a window.\n"

l_.str.3:                               ; @.str.3
	.asciz	"Failed to get a DC.\n"

	.comm	_PFD_SUPPORT_OPENGL,4,2         ; @PFD_SUPPORT_OPENGL
	.comm	_PFD_DOUBLEBUFFER,4,2           ; @PFD_DOUBLEBUFFER
	.comm	_PFD_DRAW_TO_WINDOW,4,2         ; @PFD_DRAW_TO_WINDOW
	.comm	_PFD_TYPE_RGBA,4,2              ; @PFD_TYPE_RGBA
	.comm	_PFD_MAIN_PLANE,4,2             ; @PFD_MAIN_PLANE
l_.str.4:                               ; @.str.4
	.asciz	"Failed to find a suitable pixel format.\n"

l_.str.5:                               ; @.str.5
	.asciz	"Failed to create default context for capabilities initialization.\n"

l_.str.6:                               ; @.str.6
	.asciz	"Failed to make caps GL context current.\n"

	.comm	_TRUE,4,2                       ; @TRUE
l_.str.7:                               ; @.str.7
	.asciz	"Failed to restore previous GL context.\n"

	.comm	_FALSE,4,2                      ; @FALSE
	.no_dead_strip	_wined3d_caps_gl_ctx_create
.subsections_via_symbols
