	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_GLS_BeginScene                 ## -- Begin function GLS_BeginScene
	.p2align	4, 0x90
_GLS_BeginScene:                        ## @GLS_BeginScene
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	_wins_init@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jne	LBB0_3
## %bb.1:
	movl	$1, (%rax)
	movl	$1, %edi
	movl	$1, %esi
	callq	_MAKEWORD
	movl	$1, %edi
	movl	$1, %esi
	callq	_MAKEWORD
	leaq	-36(%rbp), %rsi
	movl	%eax, %edi
	callq	_WSAStartup
	testl	%eax, %eax
	je	LBB0_3
## %bb.2:
	leaq	L_.str(%rip), %rdi
	callq	_Error
LBB0_3:
	movq	_PF_INET@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_SOCK_STREAM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_IPPROTO_TCP@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_socket
	movl	%eax, %ebx
	movq	_draw_socket@GOTPCREL(%rip), %r14
	movl	%eax, (%r14)
	cmpl	$-1, %eax
	jne	LBB0_5
## %bb.4:
	leaq	L_.str.1(%rip), %rdi
	callq	_Error
	movl	(%r14), %ebx
LBB0_5:
	movq	_AF_INET@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -24(%rbp)
	movq	_INADDR_LOOPBACK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_htonl
	movl	%eax, -28(%rbp)
	movq	_GLSERV_PORT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -32(%rbp)
	leaq	-32(%rbp), %rsi
	movl	%ebx, %edi
	movl	$12, %edx
	callq	_connect
	cmpl	$-1, %eax
	jne	LBB0_7
## %bb.6:
	movl	(%r14), %edi
	callq	_closesocket
	movl	$0, (%r14)
LBB0_7:
	addq	$32, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_wins_init,4,2                  ## @wins_init
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Winsock initialization failed."

	.comm	_PF_INET,4,2                    ## @PF_INET
	.comm	_SOCK_STREAM,4,2                ## @SOCK_STREAM
	.comm	_IPPROTO_TCP,4,2                ## @IPPROTO_TCP
	.comm	_draw_socket,4,2                ## @draw_socket
L_.str.1:                               ## @.str.1
	.asciz	"draw_socket failed"

	.comm	_AF_INET,4,2                    ## @AF_INET
	.comm	_INADDR_LOOPBACK,4,2            ## @INADDR_LOOPBACK
	.comm	_GLSERV_PORT,4,2                ## @GLSERV_PORT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_GLS_BeginScene                 ; -- Begin function GLS_BeginScene
	.p2align	2
_GLS_BeginScene:                        ; @GLS_BeginScene
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
Lloh0:
	adrp	x8, _wins_init@GOTPAGE
Lloh1:
	ldr	x8, [x8, _wins_init@GOTPAGEOFF]
	ldr	w9, [x8]
	cbnz	w9, LBB0_3
; %bb.1:
	mov	w9, #1
	str	w9, [x8]
	mov	w0, #1
	mov	w1, #1
	bl	_MAKEWORD
	mov	w0, #1
	mov	w1, #1
	bl	_MAKEWORD
	add	x1, sp, #12
	bl	_WSAStartup
	cbz	w0, LBB0_3
; %bb.2:
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	bl	_Error
LBB0_3:
Lloh4:
	adrp	x8, _PF_INET@GOTPAGE
Lloh5:
	ldr	x8, [x8, _PF_INET@GOTPAGEOFF]
Lloh6:
	ldr	w0, [x8]
Lloh7:
	adrp	x8, _SOCK_STREAM@GOTPAGE
Lloh8:
	ldr	x8, [x8, _SOCK_STREAM@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
Lloh10:
	adrp	x8, _IPPROTO_TCP@GOTPAGE
Lloh11:
	ldr	x8, [x8, _IPPROTO_TCP@GOTPAGEOFF]
Lloh12:
	ldr	w2, [x8]
	bl	_socket
	mov	x19, x0
Lloh13:
	adrp	x20, _draw_socket@GOTPAGE
Lloh14:
	ldr	x20, [x20, _draw_socket@GOTPAGEOFF]
	str	w0, [x20]
	cmn	w0, #1
	b.ne	LBB0_5
; %bb.4:
Lloh15:
	adrp	x0, l_.str.1@PAGE
Lloh16:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_Error
	ldr	w19, [x20]
LBB0_5:
Lloh17:
	adrp	x8, _AF_INET@GOTPAGE
Lloh18:
	ldr	x8, [x8, _AF_INET@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	str	w8, [sp, #8]
Lloh20:
	adrp	x8, _INADDR_LOOPBACK@GOTPAGE
Lloh21:
	ldr	x8, [x8, _INADDR_LOOPBACK@GOTPAGEOFF]
Lloh22:
	ldr	w0, [x8]
	bl	_htonl
Lloh23:
	adrp	x8, _GLSERV_PORT@GOTPAGE
Lloh24:
	ldr	x8, [x8, _GLSERV_PORT@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	stp	w8, w0, [sp]
	mov	x1, sp
	mov	x0, x19
	mov	w2, #12
	bl	_connect
	cmn	w0, #1
	b.ne	LBB0_7
; %bb.6:
	ldr	w0, [x20]
	bl	_closesocket
	str	wzr, [x20]
LBB0_7:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_wins_init,4,2                  ; @wins_init
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Winsock initialization failed."

	.comm	_PF_INET,4,2                    ; @PF_INET
	.comm	_SOCK_STREAM,4,2                ; @SOCK_STREAM
	.comm	_IPPROTO_TCP,4,2                ; @IPPROTO_TCP
	.comm	_draw_socket,4,2                ; @draw_socket
l_.str.1:                               ; @.str.1
	.asciz	"draw_socket failed"

	.comm	_AF_INET,4,2                    ; @AF_INET
	.comm	_INADDR_LOOPBACK,4,2            ; @INADDR_LOOPBACK
	.comm	_GLSERV_PORT,4,2                ; @GLSERV_PORT
.subsections_via_symbols
