	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_context_acquire                ## -- Begin function context_acquire
	.p2align	4, 0x90
_context_acquire:                       ## @context_acquire
	.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, %r14d
	movq	%rsi, %rbx
	movq	%rdi, %r15
	xorl	%eax, %eax
	callq	_context_get_current
	movq	%rax, %r12
	leaq	L_.str(%rip), %rdi
	movq	%r15, %rsi
	movq	%rbx, %rdx
	movl	%r14d, %ecx
	xorl	%eax, %eax
	callq	_TRACE
	movl	8(%r15), %edi
	callq	_wined3d_from_cs
	testq	%r12, %r12
	je	LBB0_6
## %bb.1:
	xorl	%eax, %eax
	cmpq	$0, 24(%r12)
	cmoveq	%r12, %rax
	testq	%rbx, %rbx
	je	LBB0_9
## %bb.2:
	movq	(%rbx), %rcx
	testq	%rax, %rax
	je	LBB0_18
## %bb.3:
	movq	16(%rax), %rdx
	cmpq	%rbx, %rdx
	je	LBB0_22
## %bb.4:
	testq	%rcx, %rcx
	jne	LBB0_19
## %bb.5:
	movq	%rbx, %r13
	jmp	LBB0_16
LBB0_6:
	testq	%rbx, %rbx
	je	LBB0_13
## %bb.7:
	cmpq	$0, (%rbx)
	je	LBB0_8
LBB0_19:
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_TRACE
	movq	(%rbx), %rdi
	callq	_swapchain_get_context
	jmp	LBB0_23
LBB0_9:
	testq	%rax, %rax
	je	LBB0_13
## %bb.10:
	movq	16(%rax), %rbx
	testq	%rbx, %rbx
	je	LBB0_14
## %bb.11:
	cmpq	%r15, (%rax)
	jne	LBB0_14
## %bb.12:
	movl	8(%rax), %r14d
	jmp	LBB0_24
LBB0_13:
	xorl	%r12d, %r12d
LBB0_14:
	movq	(%r15), %rax
	movq	(%rax), %rax
	movq	8(%rax), %rcx
	testq	%rcx, %rcx
	cmoveq	%rax, %rcx
	movq	(%rcx), %r13
	testq	%r12, %r12
	je	LBB0_20
## %bb.15:
	movq	16(%r12), %rbx
	xorl	%r14d, %r14d
	cmpq	%r13, %rbx
	je	LBB0_24
LBB0_16:
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_TRACE
	movq	%r13, %rbx
	cmpq	%r15, (%r12)
	jne	LBB0_17
	jmp	LBB0_24
LBB0_18:
	testq	%rcx, %rcx
	jne	LBB0_19
LBB0_8:
	movq	%rbx, %r13
	jmp	LBB0_21
LBB0_20:
	xorl	%r14d, %r14d
LBB0_21:
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_TRACE
LBB0_17:
	movq	(%r15), %rax
	movq	(%rax), %rdi
	callq	_swapchain_get_context
	movq	%rax, %r12
	movq	%r13, %rbx
	jmp	LBB0_24
LBB0_22:
	movq	%rdx, %rbx
LBB0_23:
	movq	%rax, %r12
LBB0_24:
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movl	%r14d, %edx
	callq	_context_activate
	movq	%r12, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"device %p, texture %p, sub_resource_idx %u.\n"

L_.str.1:                               ## @.str.1
	.asciz	"Rendering onscreen.\n"

L_.str.2:                               ## @.str.2
	.asciz	"Rendering offscreen.\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_context_acquire                ; -- Begin function context_acquire
	.p2align	2
_context_acquire:                       ; @context_acquire
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x20, x2
	mov	x19, x1
	mov	x21, x0
	bl	_context_get_current
	mov	x22, x0
	stp	x19, x20, [sp, #8]
	str	x21, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_TRACE
	ldr	w0, [x21, #8]
	bl	_wined3d_from_cs
	cbz	x22, LBB0_5
; %bb.1:
	ldr	x8, [x22, #24]
	cmp	x8, #0
	csel	x8, x22, xzr, eq
	cbz	x19, LBB0_7
; %bb.2:
	ldr	x9, [x19]
	cbz	x8, LBB0_15
; %bb.3:
	ldr	x10, [x8, #16]
	cmp	x10, x19
	b.eq	LBB0_21
; %bb.4:
	cbnz	x9, LBB0_16
	b	LBB0_14
LBB0_5:
	cbz	x19, LBB0_11
; %bb.6:
	ldr	x8, [x19]
	cbnz	x8, LBB0_16
	b	LBB0_17
LBB0_7:
	cbz	x8, LBB0_11
; %bb.8:
	ldr	x19, [x8, #16]
	cbz	x19, LBB0_12
; %bb.9:
	ldr	x9, [x8]
	cmp	x9, x21
	b.ne	LBB0_12
; %bb.10:
	ldr	w20, [x8, #8]
	b	LBB0_20
LBB0_11:
	mov	x22, #0
LBB0_12:
	ldr	x8, [x21]
	ldr	x8, [x8]
	ldr	x9, [x8, #8]
	cmp	x9, #0
	csel	x8, x8, x9, eq
	ldr	x19, [x8]
	mov	w20, #0
	cbz	x22, LBB0_17
; %bb.13:
	ldr	x8, [x22, #16]
	cmp	x8, x19
	b.eq	LBB0_22
LBB0_14:
Lloh2:
	adrp	x0, l_.str.2@PAGE
Lloh3:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_TRACE
	ldr	x8, [x22]
	cmp	x8, x21
	b.ne	LBB0_18
	b	LBB0_20
LBB0_15:
	cbz	x9, LBB0_17
LBB0_16:
Lloh4:
	adrp	x0, l_.str.1@PAGE
Lloh5:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_TRACE
	ldr	x0, [x19]
	b	LBB0_19
LBB0_17:
Lloh6:
	adrp	x0, l_.str.2@PAGE
Lloh7:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_TRACE
LBB0_18:
	ldr	x8, [x21]
	ldr	x0, [x8]
LBB0_19:
	bl	_swapchain_get_context
	mov	x22, x0
LBB0_20:
	mov	x0, x22
	mov	x1, x19
	mov	x2, x20
	bl	_context_activate
	mov	x0, x22
	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
	add	sp, sp, #80
	ret
LBB0_21:
	mov	x19, x10
	mov	x22, x8
	b	LBB0_20
LBB0_22:
	mov	x19, x8
	b	LBB0_20
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"device %p, texture %p, sub_resource_idx %u.\n"

l_.str.1:                               ; @.str.1
	.asciz	"Rendering onscreen.\n"

l_.str.2:                               ; @.str.2
	.asciz	"Rendering offscreen.\n"

.subsections_via_symbols
