	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gl_CopyTexImage2D              ## -- Begin function gl_CopyTexImage2D
	.p2align	4, 0x90
_gl_CopyTexImage2D:                     ## @gl_CopyTexImage2D
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, -88(%rbp)                  ## 8-byte Spill
	movq	%r8, -80(%rbp)                  ## 8-byte Spill
	movq	%rcx, -104(%rbp)                ## 8-byte Spill
	movq	%rdx, -96(%rbp)                 ## 8-byte Spill
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	32(%rbp), %r12
	movl	24(%rbp), %r15d
	movl	16(%rbp), %r13d
	callq	_INSIDE_BEGIN_END
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_GL_INVALID_OPERATION@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r14, %rdi
	jmp	LBB0_5
LBB0_2:
	movl	%r13d, -56(%rbp)                ## 4-byte Spill
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movq	-96(%rbp), %r13                 ## 8-byte Reload
	movl	%r15d, -52(%rbp)                ## 4-byte Spill
	movq	-104(%rbp), %r14                ## 8-byte Reload
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movq	_GL_TEXTURE_2D@GOTPCREL(%rip), %rax
	cmpq	%rbx, (%rax)
	jne	LBB0_3
## %bb.6:
	testq	%r13, %r13
	js	LBB0_8
## %bb.7:
	movq	%r13, %r15
	movq	_MAX_TEXTURE_LEVELS@GOTPCREL(%rip), %rax
	cmpq	%r13, (%rax)
	jle	LBB0_8
## %bb.9:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	cmpq	$2, %rax
	jae	LBB0_10
## %bb.11:
	movl	-56(%rbp), %edx                 ## 4-byte Reload
	movslq	%edx, %rcx
	addq	%rax, %rax
	cmpq	%rcx, %rax
	jle	LBB0_12
LBB0_14:
	movq	_GL_INVALID_VALUE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.4(%rip), %rdx
	jmp	LBB0_4
LBB0_3:
	movq	_GL_INVALID_ENUM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	jmp	LBB0_4
LBB0_8:
	movq	_GL_INVALID_VALUE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.2(%rip), %rdx
	jmp	LBB0_4
LBB0_10:
	movq	_GL_INVALID_VALUE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.3(%rip), %rdx
LBB0_4:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
LBB0_5:
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_gl_error                       ## TAILCALL
LBB0_12:
	testl	%edx, %edx
	js	LBB0_14
## %bb.13:
	movq	_MAX_TEXTURE_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	addl	$2, %ecx
	cmpl	%edx, %ecx
	jl	LBB0_14
## %bb.15:
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	movslq	%esi, %rdx
	cmpq	%rdx, %rax
	jle	LBB0_16
LBB0_18:
	movq	_GL_INVALID_VALUE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.5(%rip), %rdx
	jmp	LBB0_4
LBB0_16:
	testl	%esi, %esi
	js	LBB0_18
## %bb.17:
	cmpl	%esi, %ecx
	jl	LBB0_18
## %bb.19:
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movq	%r14, %r12
	movq	%r14, %rdi
	callq	_decode_internal_format
	leaq	-1(%r14), %rcx
	cmpq	$4, %rcx
	jb	LBB0_21
## %bb.20:
	testq	%rax, %rax
	js	LBB0_21
## %bb.22:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
	movq	-88(%rbp), %rdx                 ## 8-byte Reload
	movl	-56(%rbp), %r13d                ## 4-byte Reload
	movl	%r13d, %ecx
	movl	-52(%rbp), %r14d                ## 4-byte Reload
	movl	%r14d, %r8d
	movq	%rax, %r9
	callq	_read_color_image
	testq	%rax, %rax
	je	LBB0_23
## %bb.24:
	movq	_GL_RGBA@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r10d
	movq	_GL_UNSIGNED_BYTE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r11d
	movq	%rbx, %rdi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	movq	%r15, %rdx
	movq	%r12, %rcx
	movl	%r13d, %r8d
	movl	%r14d, %r9d
	pushq	%rax
	pushq	%r11
	pushq	%r10
	pushq	-64(%rbp)                       ## 8-byte Folded Reload
	callq	_gl_TexImage2D
	addq	$104, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_21:
	movq	_GL_INVALID_VALUE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.6(%rip), %rdx
	jmp	LBB0_4
LBB0_23:
	movq	_GL_OUT_OF_MEMORY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%rbx, %rdi
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.comm	_GL_INVALID_OPERATION,4,2       ## @GL_INVALID_OPERATION
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"glCopyTexImage2D"

	.comm	_GL_TEXTURE_2D,8,3              ## @GL_TEXTURE_2D
	.comm	_GL_INVALID_ENUM,4,2            ## @GL_INVALID_ENUM
L_.str.1:                               ## @.str.1
	.asciz	"glCopyTexImage2D(target)"

	.comm	_MAX_TEXTURE_LEVELS,8,3         ## @MAX_TEXTURE_LEVELS
	.comm	_GL_INVALID_VALUE,4,2           ## @GL_INVALID_VALUE
L_.str.2:                               ## @.str.2
	.asciz	"glCopyTexImage2D(level)"

L_.str.3:                               ## @.str.3
	.asciz	"glCopyTexImage2D(border)"

	.comm	_MAX_TEXTURE_SIZE,4,2           ## @MAX_TEXTURE_SIZE
L_.str.4:                               ## @.str.4
	.asciz	"glCopyTexImage2D(width)"

L_.str.5:                               ## @.str.5
	.asciz	"glCopyTexImage2D(height)"

L_.str.6:                               ## @.str.6
	.asciz	"glCopyTexImage2D(format)"

	.comm	_GL_OUT_OF_MEMORY,4,2           ## @GL_OUT_OF_MEMORY
	.comm	_GL_RGBA,4,2                    ## @GL_RGBA
	.comm	_GL_UNSIGNED_BYTE,4,2           ## @GL_UNSIGNED_BYTE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gl_CopyTexImage2D              ; -- Begin function gl_CopyTexImage2D
	.p2align	2
_gl_CopyTexImage2D:                     ; @gl_CopyTexImage2D
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x7
	mov	x21, x6
	mov	x26, x5
	mov	x27, x4
	mov	x22, x3
	mov	x24, x2
	mov	x25, x1
	mov	x19, x0
	ldr	x23, [x29, #16]
	bl	_INSIDE_BEGIN_END
	cbz	x0, LBB0_3
; %bb.1:
Lloh0:
	adrp	x8, _GL_INVALID_OPERATION@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GL_INVALID_OPERATION@GOTPAGEOFF]
LBB0_2:
	ldr	w1, [x8]
Lloh2:
	adrp	x2, l_.str@PAGE
Lloh3:
	add	x2, x2, l_.str@PAGEOFF
	b	LBB0_12
LBB0_3:
Lloh4:
	adrp	x8, _GL_TEXTURE_2D@GOTPAGE
Lloh5:
	ldr	x8, [x8, _GL_TEXTURE_2D@GOTPAGEOFF]
Lloh6:
	ldr	x8, [x8]
	cmp	x8, x25
	b.ne	LBB0_9
; %bb.4:
	tbnz	x24, #63, LBB0_10
; %bb.5:
Lloh7:
	adrp	x8, _MAX_TEXTURE_LEVELS@GOTPAGE
Lloh8:
	ldr	x8, [x8, _MAX_TEXTURE_LEVELS@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
	cmp	x8, x24
	b.le	LBB0_10
; %bb.6:
	cmp	x23, #2
	b.hs	LBB0_11
; %bb.7:
	lsl	x8, x23, #1
	cmp	x8, w21, sxtw
	b.le	LBB0_13
LBB0_8:
Lloh10:
	adrp	x8, _GL_INVALID_VALUE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _GL_INVALID_VALUE@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
Lloh13:
	adrp	x2, l_.str.4@PAGE
Lloh14:
	add	x2, x2, l_.str.4@PAGEOFF
	b	LBB0_12
LBB0_9:
Lloh15:
	adrp	x8, _GL_INVALID_ENUM@GOTPAGE
Lloh16:
	ldr	x8, [x8, _GL_INVALID_ENUM@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
Lloh18:
	adrp	x2, l_.str.1@PAGE
Lloh19:
	add	x2, x2, l_.str.1@PAGEOFF
	b	LBB0_12
LBB0_10:
Lloh20:
	adrp	x8, _GL_INVALID_VALUE@GOTPAGE
Lloh21:
	ldr	x8, [x8, _GL_INVALID_VALUE@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
Lloh23:
	adrp	x2, l_.str.2@PAGE
Lloh24:
	add	x2, x2, l_.str.2@PAGEOFF
	b	LBB0_12
LBB0_11:
Lloh25:
	adrp	x8, _GL_INVALID_VALUE@GOTPAGE
Lloh26:
	ldr	x8, [x8, _GL_INVALID_VALUE@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
Lloh28:
	adrp	x2, l_.str.3@PAGE
Lloh29:
	add	x2, x2, l_.str.3@PAGEOFF
LBB0_12:
	mov	x0, x19
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_gl_error
LBB0_13:
	tbnz	w21, #31, LBB0_8
; %bb.14:
Lloh30:
	adrp	x9, _MAX_TEXTURE_SIZE@GOTPAGE
Lloh31:
	ldr	x9, [x9, _MAX_TEXTURE_SIZE@GOTPAGEOFF]
Lloh32:
	ldr	w9, [x9]
	add	w9, w9, #2
	cmp	w9, w21
	b.lt	LBB0_8
; %bb.15:
	cmp	x8, w20, sxtw
	b.le	LBB0_17
LBB0_16:
Lloh33:
	adrp	x8, _GL_INVALID_VALUE@GOTPAGE
Lloh34:
	ldr	x8, [x8, _GL_INVALID_VALUE@GOTPAGEOFF]
Lloh35:
	ldr	w1, [x8]
Lloh36:
	adrp	x2, l_.str.5@PAGE
Lloh37:
	add	x2, x2, l_.str.5@PAGEOFF
	b	LBB0_12
LBB0_17:
	tbnz	w20, #31, LBB0_16
; %bb.18:
	cmp	w9, w20
	b.lt	LBB0_16
; %bb.19:
	mov	x0, x22
	bl	_decode_internal_format
	sub	x8, x22, #1
	cmp	x8, #4
	b.lo	LBB0_23
; %bb.20:
	mov	x5, x0
	tbnz	x0, #63, LBB0_23
; %bb.21:
	mov	x0, x19
	mov	x1, x27
	mov	x2, x26
	mov	x3, x21
	mov	x4, x20
	bl	_read_color_image
	cbz	x0, LBB0_24
; %bb.22:
Lloh38:
	adrp	x8, _GL_RGBA@GOTPAGE
Lloh39:
	ldr	x8, [x8, _GL_RGBA@GOTPAGEOFF]
Lloh40:
	ldr	w7, [x8]
Lloh41:
	adrp	x8, _GL_UNSIGNED_BYTE@GOTPAGE
Lloh42:
	ldr	x8, [x8, _GL_UNSIGNED_BYTE@GOTPAGEOFF]
Lloh43:
	ldr	w8, [x8]
	str	x0, [sp, #8]
	str	w8, [sp]
	mov	x0, x19
	mov	x1, x25
	mov	x2, x24
	mov	x3, x22
	mov	x4, x21
	mov	x5, x20
	mov	x6, x23
	bl	_gl_TexImage2D
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_23:
Lloh44:
	adrp	x8, _GL_INVALID_VALUE@GOTPAGE
Lloh45:
	ldr	x8, [x8, _GL_INVALID_VALUE@GOTPAGEOFF]
Lloh46:
	ldr	w1, [x8]
Lloh47:
	adrp	x2, l_.str.6@PAGE
Lloh48:
	add	x2, x2, l_.str.6@PAGEOFF
	b	LBB0_12
LBB0_24:
Lloh49:
	adrp	x8, _GL_OUT_OF_MEMORY@GOTPAGE
Lloh50:
	ldr	x8, [x8, _GL_OUT_OF_MEMORY@GOTPAGEOFF]
	b	LBB0_2
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpAdd	Lloh47, Lloh48
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGot	Lloh49, Lloh50
	.cfi_endproc
                                        ; -- End function
	.comm	_GL_INVALID_OPERATION,4,2       ; @GL_INVALID_OPERATION
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"glCopyTexImage2D"

	.comm	_GL_TEXTURE_2D,8,3              ; @GL_TEXTURE_2D
	.comm	_GL_INVALID_ENUM,4,2            ; @GL_INVALID_ENUM
l_.str.1:                               ; @.str.1
	.asciz	"glCopyTexImage2D(target)"

	.comm	_MAX_TEXTURE_LEVELS,8,3         ; @MAX_TEXTURE_LEVELS
	.comm	_GL_INVALID_VALUE,4,2           ; @GL_INVALID_VALUE
l_.str.2:                               ; @.str.2
	.asciz	"glCopyTexImage2D(level)"

l_.str.3:                               ; @.str.3
	.asciz	"glCopyTexImage2D(border)"

	.comm	_MAX_TEXTURE_SIZE,4,2           ; @MAX_TEXTURE_SIZE
l_.str.4:                               ; @.str.4
	.asciz	"glCopyTexImage2D(width)"

l_.str.5:                               ; @.str.5
	.asciz	"glCopyTexImage2D(height)"

l_.str.6:                               ; @.str.6
	.asciz	"glCopyTexImage2D(format)"

	.comm	_GL_OUT_OF_MEMORY,4,2           ; @GL_OUT_OF_MEMORY
	.comm	_GL_RGBA,4,2                    ; @GL_RGBA
	.comm	_GL_UNSIGNED_BYTE,4,2           ; @GL_UNSIGNED_BYTE
.subsections_via_symbols
