	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gl_TexImage2D                  ## -- Begin function gl_TexImage2D
	.p2align	4, 0x90
_gl_TexImage2D:                         ## @gl_TexImage2D
	.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	%r9, -64(%rbp)                  ## 8-byte Spill
	movq	%r8, -80(%rbp)                  ## 8-byte Spill
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	movq	%rdx, -88(%rbp)                 ## 8-byte Spill
	movq	%rsi, -96(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r15
	movq	40(%rbp), %r12
	movq	32(%rbp), %r14
	movq	24(%rbp), %rbx
	movq	16(%rbp), %r13
	callq	_INSIDE_BEGIN_END
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	_GL_INVALID_OPERATION@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
LBB0_2:
	movq	%r15, %rdi
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_gl_error                       ## TAILCALL
LBB0_3:
	movq	%rbx, %r8
	movq	%r14, %r9
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	movq	-88(%rbp), %r14                 ## 8-byte Reload
	movq	%r12, -72(%rbp)                 ## 8-byte Spill
	movq	_GL_TEXTURE_2D@GOTPCREL(%rip), %r13
	movq	-96(%rbp), %rsi                 ## 8-byte Reload
	cmpq	%rsi, (%r13)
	jne	LBB0_15
## %bb.4:
	subq	$8, %rsp
	movq	%r15, %rbx
	movq	%r15, %rdi
	movq	%r14, %rdx
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	pushq	-56(%rbp)                       ## 8-byte Folded Reload
	pushq	-64(%rbp)                       ## 8-byte Folded Reload
	pushq	-80(%rbp)                       ## 8-byte Folded Reload
	callq	_texture_2d_error_check
	addq	$32, %rsp
	testq	%rax, %rax
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	jne	LBB0_24
## %bb.5:
	movq	8(%rbx), %rax
	movq	8(%rax), %rax
	movq	(%rax,%r14,8), %rdi
	testq	%rdi, %rdi
	je	LBB0_7
## %bb.6:
	callq	_gl_free_texture_image
LBB0_7:
	movq	%rbx, %rdi
	testq	%r15, %r15
	je	LBB0_9
## %bb.8:
	movq	%r15, %rsi
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	callq	_image_to_texture
	jmp	LBB0_10
LBB0_15:
	movq	_GL_PROXY_TEXTURE_2D@GOTPCREL(%rip), %rax
	cmpq	%rsi, (%rax)
	jne	LBB0_23
## %bb.16:
	movq	%r14, %r12
	subq	$8, %rsp
	movq	%r15, %r14
	movq	%r15, %rdi
	movq	%r12, %rdx
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rcx
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	pushq	%r15
	pushq	-64(%rbp)                       ## 8-byte Folded Reload
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	pushq	%rbx
	callq	_texture_2d_error_check
	addq	$32, %rsp
	testq	%rax, %rax
	je	LBB0_19
## %bb.17:
	movq	%r14, %rcx
	movq	_MAX_TEXTURE_LEVELS@GOTPCREL(%rip), %rax
	cmpq	%r12, (%rax)
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	jbe	LBB0_20
## %bb.18:
	movq	(%rcx), %rax
	movq	(%rax), %rax
	movq	(%rax,%r12,8), %rdi
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_MEMSET
LBB0_20:
	testq	%r14, %r14
	jne	LBB0_21
	jmp	LBB0_24
LBB0_23:
	movq	_GL_INVALID_ENUM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	jmp	LBB0_2
LBB0_19:
	movq	(%r14), %rax
	movq	(%rax), %rax
	movq	(%rax,%r12,8), %rcx
	movq	%r13, (%rcx)
	movq	%r15, 8(%rcx)
	movq	%rbx, 24(%rcx)
	movq	(%rax,%r12,8), %rax
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	%rcx, 16(%rax)
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	testq	%r14, %r14
	je	LBB0_24
LBB0_21:
	cmpq	$0, (%r14)
	jne	LBB0_24
## %bb.22:
	movq	%r14, %rdi
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_gl_free_image                  ## TAILCALL
LBB0_9:
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movq	-80(%rbp), %rdx                 ## 8-byte Reload
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movl	$1, %r8d
	movq	-56(%rbp), %r9                  ## 8-byte Reload
	callq	_make_null_texture
LBB0_10:
	movq	%rax, %r12
	movq	8(%rbx), %rax
	movq	8(%rax), %rax
	movq	%r12, (%rax,%r14,8)
	movq	_GL_TRUE@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	8(%rbx), %rdx
	movq	%rcx, (%rdx)
	movq	(%rax), %rax
	movq	%rax, 16(%rbx)
	movq	_NEW_TEXTURING@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 32(%rbx)
	testq	%r15, %r15
	je	LBB0_13
## %bb.11:
	cmpq	$0, (%r15)
	jne	LBB0_13
## %bb.12:
	movq	%r15, %rdi
	callq	_gl_free_image
LBB0_13:
	movq	24(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_24
## %bb.14:
	movq	(%r13), %rsi
	movq	8(%rbx), %rdx
	movq	%rbx, %rdi
	movq	%r14, %rcx
	movq	-48(%rbp), %r8                  ## 8-byte Reload
	movq	%r12, %r9
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmpq	*%rax                           ## TAILCALL
LBB0_24:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GL_INVALID_OPERATION,4,2       ## @GL_INVALID_OPERATION
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"glTexImage2D"

	.comm	_GL_TEXTURE_2D,8,3              ## @GL_TEXTURE_2D
	.comm	_GL_TRUE,8,3                    ## @GL_TRUE
	.comm	_NEW_TEXTURING,4,2              ## @NEW_TEXTURING
	.comm	_GL_PROXY_TEXTURE_2D,8,3        ## @GL_PROXY_TEXTURE_2D
	.comm	_MAX_TEXTURE_LEVELS,8,3         ## @MAX_TEXTURE_LEVELS
	.comm	_GL_INVALID_ENUM,4,2            ## @GL_INVALID_ENUM
L_.str.1:                               ## @.str.1
	.asciz	"glTexImage2D(target)"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gl_TexImage2D                  ; -- Begin function gl_TexImage2D
	.p2align	2
_gl_TexImage2D:                         ; @gl_TexImage2D
	.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	x26, x7
	mov	x23, x6
	mov	x24, x5
	mov	x25, x4
	mov	x22, x3
	mov	x20, x2
	mov	x28, x1
	mov	x21, x0
	ldp	x27, x19, [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]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x2, l_.str@PAGE
Lloh4:
	add	x2, x2, l_.str@PAGEOFF
LBB0_2:
	mov	x0, x21
	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_3:
Lloh5:
	adrp	x8, _GL_TEXTURE_2D@GOTPAGE
Lloh6:
	ldr	x8, [x8, _GL_TEXTURE_2D@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	cmp	x8, x28
	b.ne	LBB0_9
; %bb.4:
	str	x23, [sp]
	mov	x0, x21
	mov	x1, x28
	mov	x2, x20
	mov	x3, x22
	mov	x4, x26
	mov	x5, x27
	mov	x6, x25
	mov	x7, x24
	bl	_texture_2d_error_check
	cbnz	x0, LBB0_24
; %bb.5:
	ldr	x8, [x21, #8]
	ldr	x8, [x8, #8]
	ldr	x0, [x8, x20, lsl #3]
	cbz	x0, LBB0_7
; %bb.6:
	bl	_gl_free_texture_image
LBB0_7:
	mov	x0, x21
	cbz	x19, LBB0_18
; %bb.8:
	mov	x1, x19
	mov	x2, x22
	mov	x3, x23
	bl	_image_to_texture
	b	LBB0_19
LBB0_9:
Lloh8:
	adrp	x8, _GL_PROXY_TEXTURE_2D@GOTPAGE
Lloh9:
	ldr	x8, [x8, _GL_PROXY_TEXTURE_2D@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	cmp	x8, x28
	b.ne	LBB0_14
; %bb.10:
	str	x23, [sp]
	mov	x0, x21
	mov	x1, x28
	mov	x2, x20
	mov	x3, x22
	mov	x4, x26
	mov	x5, x27
	mov	x6, x25
	mov	x7, x24
	bl	_texture_2d_error_check
	cbz	x0, LBB0_15
; %bb.11:
Lloh11:
	adrp	x8, _MAX_TEXTURE_LEVELS@GOTPAGE
Lloh12:
	ldr	x8, [x8, _MAX_TEXTURE_LEVELS@GOTPAGEOFF]
Lloh13:
	ldr	x8, [x8]
	cmp	x8, x20
	b.ls	LBB0_13
; %bb.12:
	ldr	x8, [x21]
	ldr	x8, [x8]
	ldr	x0, [x8, x20, lsl #3]
	mov	w1, #0
	mov	w2, #4
	bl	_MEMSET
LBB0_13:
	cbnz	x19, LBB0_16
	b	LBB0_24
LBB0_14:
Lloh14:
	adrp	x8, _GL_INVALID_ENUM@GOTPAGE
Lloh15:
	ldr	x8, [x8, _GL_INVALID_ENUM@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
Lloh17:
	adrp	x2, l_.str.1@PAGE
Lloh18:
	add	x2, x2, l_.str.1@PAGEOFF
	b	LBB0_2
LBB0_15:
	ldr	x8, [x21]
	ldr	x8, [x8]
	lsl	x9, x20, #3
	ldr	x10, [x8, x9]
	stp	x22, x23, [x10]
	str	x25, [x10, #24]
	ldr	x8, [x8, x9]
	str	x24, [x8, #16]
	cbz	x19, LBB0_24
LBB0_16:
	ldr	x8, [x19]
	cbnz	x8, LBB0_24
; %bb.17:
	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_free_image
LBB0_18:
	mov	x1, x22
	mov	x2, x25
	mov	x3, x24
	mov	w4, #1
	mov	x5, x23
	bl	_make_null_texture
LBB0_19:
	mov	x23, x0
	ldr	x8, [x21, #8]
	ldr	x8, [x8, #8]
	str	x0, [x8, x20, lsl #3]
Lloh19:
	adrp	x8, _GL_TRUE@GOTPAGE
Lloh20:
	ldr	x8, [x8, _GL_TRUE@GOTPAGEOFF]
	ldr	x9, [x8]
	ldr	x10, [x21, #8]
	str	x9, [x10]
	ldr	x8, [x8]
	str	x8, [x21, #16]
Lloh21:
	adrp	x8, _NEW_TEXTURING@GOTPAGE
Lloh22:
	ldr	x8, [x8, _NEW_TEXTURING@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	ldr	w9, [x21, #32]
	orr	w8, w9, w8
	str	w8, [x21, #32]
	cbz	x19, LBB0_22
; %bb.20:
	ldr	x8, [x19]
	cbnz	x8, LBB0_22
; %bb.21:
	mov	x0, x19
	bl	_gl_free_image
LBB0_22:
	ldr	x6, [x21, #24]
	cbz	x6, LBB0_24
; %bb.23:
Lloh24:
	adrp	x8, _GL_TEXTURE_2D@GOTPAGE
Lloh25:
	ldr	x8, [x8, _GL_TEXTURE_2D@GOTPAGEOFF]
Lloh26:
	ldr	x1, [x8]
	ldr	x2, [x21, #8]
	mov	x0, x21
	mov	x3, x20
	mov	x4, x22
	mov	x5, x23
	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
	br	x6
LBB0_24:
	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
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_GL_INVALID_OPERATION,4,2       ; @GL_INVALID_OPERATION
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"glTexImage2D"

	.comm	_GL_TEXTURE_2D,8,3              ; @GL_TEXTURE_2D
	.comm	_GL_TRUE,8,3                    ; @GL_TRUE
	.comm	_NEW_TEXTURING,4,2              ; @NEW_TEXTURING
	.comm	_GL_PROXY_TEXTURE_2D,8,3        ; @GL_PROXY_TEXTURE_2D
	.comm	_MAX_TEXTURE_LEVELS,8,3         ; @MAX_TEXTURE_LEVELS
	.comm	_GL_INVALID_ENUM,4,2            ; @GL_INVALID_ENUM
l_.str.1:                               ; @.str.1
	.asciz	"glTexImage2D(target)"

.subsections_via_symbols
