	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function attach_gl_context_to_window
_attach_gl_context_to_window:           ## @attach_gl_context_to_window
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, -88(%rbp)                 ## 8-byte Spill
	movq	%rdx, -80(%rbp)                 ## 8-byte Spill
	movl	%esi, %r12d
	movl	%edi, -68(%rbp)                 ## 4-byte Spill
	movl	$0, -48(%rbp)
	movq	$0, -64(%rbp)
	movq	$0, -56(%rbp)
	movl	$0, -44(%rbp)
	xorl	%eax, %eax
	callq	_CGSMainConnectionID
	movl	%eax, %r13d
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	movl	%r12d, %edx
	xorl	%eax, %eax
	callq	_printf
	movq	_kCGWindowListOptionIncludingWindow@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r12d, %esi
	callq	_CGWindowListCopyWindowInfo
	movl	%eax, %r14d
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_CFArrayGetValueAtIndex
	movq	_kCGWindowBounds@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	%rax, %rdi
	callq	_CFDictionaryGetValue
	movq	%rax, %r15
	leaq	L_.str.1(%rip), %rdi
	callq	_CFSTR
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_CFDictionaryGetValue
	movq	_kCFNumberFloat64Type@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	leaq	-64(%rbp), %rdx
	movl	%eax, %edi
	callq	_CFNumberGetValue
	leaq	L_.str.2(%rip), %rdi
	callq	_CFSTR
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_CFDictionaryGetValue
	movl	(%rbx), %esi
	leaq	-56(%rbp), %rdx
	movl	%eax, %edi
	callq	_CFNumberGetValue
	movl	%r14d, %edi
	callq	_CFRelease
	leaq	-44(%rbp), %rdx
	movl	%r13d, %edi
	movl	%r12d, %esi
	callq	_CGSAddSurface
	movq	_kCGErrorSuccess@GOTPCREL(%rip), %r14
	cmpq	(%r14), %rax
	je	LBB0_2
## %bb.1:
	leaq	L_str.12(%rip), %rdi
	callq	_puts
LBB0_2:
	movl	-44(%rbp), %esi
	leaq	L_.str.4(%rip), %rdi
	xorl	%eax, %eax
	callq	_printf
	movl	-44(%rbp), %ebx
	movq	-64(%rbp), %rdx
	movq	-56(%rbp), %rcx
	xorl	%edi, %edi
	xorl	%esi, %esi
	callq	_CGRectMake
	movl	%r13d, %edi
	movl	%r12d, %esi
	movl	%ebx, %edx
	movl	%eax, %ecx
	callq	_CGSSetSurfaceBounds
	cmpq	(%r14), %rax
	je	LBB0_4
## %bb.3:
	leaq	L_str.11(%rip), %rdi
	callq	_puts
LBB0_4:
	movl	-44(%rbp), %edx
	movl	%r13d, %edi
	movl	%r12d, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	callq	_CGSOrderSurface
	cmpq	(%r14), %rax
	movl	-68(%rbp), %ebx                 ## 4-byte Reload
	je	LBB0_6
## %bb.5:
	leaq	L_str.10(%rip), %rdi
	callq	_puts
LBB0_6:
	movl	-44(%rbp), %ecx
	movl	%ebx, %edi
	movl	%r13d, %esi
	movl	%r12d, %edx
	callq	_CGLSetSurface
	cmpq	(%r14), %rax
	je	LBB0_8
## %bb.7:
	leaq	L_str.9(%rip), %rdi
	callq	_puts
LBB0_8:
	movq	_kCGLCPHasDrawable@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %rdx
	movl	%ebx, %edi
	callq	_CGLGetParameter
	cmpl	$1, -48(%rbp)
	je	LBB0_10
## %bb.9:
	leaq	L_str(%rip), %rdi
	callq	_puts
LBB0_10:
	movl	-64(%rbp), %eax
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, (%rcx)
	movl	-56(%rbp), %eax
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, (%rcx)
	movl	-44(%rbp), %eax
	addq	$56, %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	"cid:%d wid:%d\n"

	.comm	_kCGWindowListOptionIncludingWindow,4,2 ## @kCGWindowListOptionIncludingWindow
	.comm	_kCGWindowBounds,4,2            ## @kCGWindowBounds
L_.str.1:                               ## @.str.1
	.asciz	"Width"

	.comm	_kCFNumberFloat64Type,4,2       ## @kCFNumberFloat64Type
L_.str.2:                               ## @.str.2
	.asciz	"Height"

	.comm	_kCGErrorSuccess,8,3            ## @kCGErrorSuccess
L_.str.4:                               ## @.str.4
	.asciz	"sid:%d\n"

	.comm	_kCGLCPHasDrawable,4,2          ## @kCGLCPHasDrawable
L_str:                                  ## @str
	.asciz	"ERR: no drawable"

L_str.9:                                ## @str.9
	.asciz	"ERR: cant set surface"

L_str.10:                               ## @str.10
	.asciz	"ERR: cant order front"

L_str.11:                               ## @str.11
	.asciz	"ERR: cant set bounds"

L_str.12:                               ## @str.12
	.asciz	"ERR: no surface"

	.no_dead_strip	_attach_gl_context_to_window
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function attach_gl_context_to_window
_attach_gl_context_to_window:           ; @attach_gl_context_to_window
	.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
	mov	x19, x3
	mov	x20, x2
	mov	x22, x1
	mov	x21, x0
	str	wzr, [sp, #44]
	stp	xzr, xzr, [sp, #24]
	str	wzr, [sp, #20]
	bl	_CGSMainConnectionID
	mov	x23, x0
	stp	x23, x22, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_printf
Lloh2:
	adrp	x8, _kCGWindowListOptionIncludingWindow@GOTPAGE
Lloh3:
	ldr	x8, [x8, _kCGWindowListOptionIncludingWindow@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	mov	x1, x22
	bl	_CGWindowListCopyWindowInfo
	mov	x24, x0
	mov	w1, #0
	bl	_CFArrayGetValueAtIndex
Lloh5:
	adrp	x8, _kCGWindowBounds@GOTPAGE
Lloh6:
	ldr	x8, [x8, _kCGWindowBounds@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	bl	_CFDictionaryGetValue
	mov	x25, x0
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_CFSTR
	mov	x1, x0
	mov	x0, x25
	bl	_CFDictionaryGetValue
Lloh10:
	adrp	x26, _kCFNumberFloat64Type@GOTPAGE
Lloh11:
	ldr	x26, [x26, _kCFNumberFloat64Type@GOTPAGEOFF]
	ldr	w1, [x26]
	add	x2, sp, #32
                                        ; kill: def $w0 killed $w0 killed $x0
	bl	_CFNumberGetValue
Lloh12:
	adrp	x0, l_.str.2@PAGE
Lloh13:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_CFSTR
	mov	x1, x0
	mov	x0, x25
	bl	_CFDictionaryGetValue
	ldr	w1, [x26]
	add	x2, sp, #24
                                        ; kill: def $w0 killed $w0 killed $x0
	bl	_CFNumberGetValue
	mov	x0, x24
	bl	_CFRelease
	add	x2, sp, #20
	mov	x0, x23
	mov	x1, x22
	bl	_CGSAddSurface
Lloh14:
	adrp	x25, _kCGErrorSuccess@GOTPAGE
Lloh15:
	ldr	x25, [x25, _kCGErrorSuccess@GOTPAGEOFF]
	ldr	x8, [x25]
	cmp	x0, x8
	b.eq	LBB0_2
; %bb.1:
Lloh16:
	adrp	x0, l_str.12@PAGE
Lloh17:
	add	x0, x0, l_str.12@PAGEOFF
	bl	_puts
LBB0_2:
	ldr	w8, [sp, #20]
	str	x8, [sp]
Lloh18:
	adrp	x0, l_.str.4@PAGE
Lloh19:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_printf
	ldr	w24, [sp, #20]
	ldp	x3, x2, [sp, #24]
	mov	w0, #0
	mov	w1, #0
	bl	_CGRectMake
	mov	x3, x0
	mov	x0, x23
	mov	x1, x22
	mov	x2, x24
	bl	_CGSSetSurfaceBounds
	ldr	x8, [x25]
	cmp	x0, x8
	b.eq	LBB0_4
; %bb.3:
Lloh20:
	adrp	x0, l_str.11@PAGE
Lloh21:
	add	x0, x0, l_str.11@PAGEOFF
	bl	_puts
LBB0_4:
	ldr	w2, [sp, #20]
	mov	x0, x23
	mov	x1, x22
	mov	w3, #1
	mov	w4, #0
	bl	_CGSOrderSurface
	ldr	x8, [x25]
	cmp	x0, x8
	b.eq	LBB0_6
; %bb.5:
Lloh22:
	adrp	x0, l_str.10@PAGE
Lloh23:
	add	x0, x0, l_str.10@PAGEOFF
	bl	_puts
LBB0_6:
	ldr	w3, [sp, #20]
	mov	x0, x21
	mov	x1, x23
	mov	x2, x22
	bl	_CGLSetSurface
	ldr	x8, [x25]
	cmp	x0, x8
	b.eq	LBB0_8
; %bb.7:
Lloh24:
	adrp	x0, l_str.9@PAGE
Lloh25:
	add	x0, x0, l_str.9@PAGEOFF
	bl	_puts
LBB0_8:
Lloh26:
	adrp	x8, _kCGLCPHasDrawable@GOTPAGE
Lloh27:
	ldr	x8, [x8, _kCGLCPHasDrawable@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
	add	x2, sp, #44
	mov	x0, x21
	bl	_CGLGetParameter
	ldr	w8, [sp, #44]
	cmp	w8, #1
	b.eq	LBB0_10
; %bb.9:
Lloh29:
	adrp	x0, l_str@PAGE
Lloh30:
	add	x0, x0, l_str@PAGEOFF
	bl	_puts
LBB0_10:
	ldr	x8, [sp, #32]
	str	w8, [x20]
	ldr	x8, [sp, #24]
	str	w8, [x19]
	ldr	w0, [sp, #20]
	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
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpAdd	Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"cid:%d wid:%d\n"

	.comm	_kCGWindowListOptionIncludingWindow,4,2 ; @kCGWindowListOptionIncludingWindow
	.comm	_kCGWindowBounds,4,2            ; @kCGWindowBounds
l_.str.1:                               ; @.str.1
	.asciz	"Width"

	.comm	_kCFNumberFloat64Type,4,2       ; @kCFNumberFloat64Type
l_.str.2:                               ; @.str.2
	.asciz	"Height"

	.comm	_kCGErrorSuccess,8,3            ; @kCGErrorSuccess
l_.str.4:                               ; @.str.4
	.asciz	"sid:%d\n"

	.comm	_kCGLCPHasDrawable,4,2          ; @kCGLCPHasDrawable
l_str:                                  ; @str
	.asciz	"ERR: no drawable"

l_str.9:                                ; @str.9
	.asciz	"ERR: cant set surface"

l_str.10:                               ; @str.10
	.asciz	"ERR: cant order front"

l_str.11:                               ; @str.11
	.asciz	"ERR: cant set bounds"

l_str.12:                               ; @str.12
	.asciz	"ERR: no surface"

	.no_dead_strip	_attach_gl_context_to_window
.subsections_via_symbols
