	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gl_TexSubImage2D               ## -- Begin function gl_TexSubImage2D
	.p2align	4, 0x90
_gl_TexSubImage2D:                      ## @gl_TexSubImage2D
	.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	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	_GL_TEXTURE_2D@GOTPCREL(%rip), %rax
	cmpq	%rsi, (%rax)
	jne	LBB0_1
## %bb.2:
	movq	%rdx, %r14
	movq	_MAX_TEXTURE_LEVELS@GOTPCREL(%rip), %rax
	cmpq	%rdx, (%rax)
	jbe	LBB0_3
## %bb.4:
	movq	(%rbx), %rax
	movq	(%rax), %rax
	movq	(%rax,%r14,8), %r15
	testq	%r15, %r15
	je	LBB0_5
## %bb.8:
	movq	(%r15), %rax
	movq	%rax, %rdx
	negq	%rdx
	cmpq	%rcx, %rdx
	jbe	LBB0_10
## %bb.9:
	movq	_GL_INVALID_VALUE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.3(%rip), %rdx
	jmp	LBB0_7
LBB0_1:
	movq	_GL_INVALID_ENUM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	jmp	LBB0_7
LBB0_3:
	movq	_GL_INVALID_ENUM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	jmp	LBB0_7
LBB0_5:
	movq	_GL_INVALID_OPERATION@GOTPCREL(%rip), %rax
LBB0_6:
	movl	(%rax), %esi
	leaq	L_.str.2(%rip), %rdx
	jmp	LBB0_7
LBB0_10:
	cmpq	%r8, %rdx
	jbe	LBB0_12
## %bb.11:
	movq	_GL_INVALID_VALUE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.4(%rip), %rdx
	jmp	LBB0_7
LBB0_12:
	movq	%r9, %r13
	leaq	(%r9,%rcx), %rsi
	movq	8(%r15), %rdx
	addq	%rax, %rdx
	cmpq	%rdx, %rsi
	jbe	LBB0_14
## %bb.13:
	movq	_GL_INVALID_VALUE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.5(%rip), %rdx
	jmp	LBB0_7
LBB0_14:
	movq	16(%rbp), %r12
	leaq	(%r12,%r8), %rdx
	addq	16(%r15), %rax
	cmpq	%rax, %rdx
	jbe	LBB0_16
## %bb.15:
	movq	_GL_INVALID_VALUE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.6(%rip), %rdx
LBB0_7:
	movq	%rbx, %rdi
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_gl_error                       ## TAILCALL
LBB0_16:
	movq	40(%rbp), %rax
	testq	%rax, %rax
	je	LBB0_32
## %bb.17:
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movq	%r8, -72(%rbp)                  ## 8-byte Spill
	movl	40(%r15), %edi
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	callq	_components_in_intformat
	movq	-88(%rbp), %rsi                 ## 8-byte Reload
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	(%rsi), %rax
	movq	_GL_UNSIGNED_BYTE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	movq	%rbx, -120(%rbp)                ## 8-byte Spill
	movq	%r12, -80(%rbp)                 ## 8-byte Spill
	movq	%r15, -104(%rbp)                ## 8-byte Spill
	jne	LBB0_22
## %bb.18:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	cmpq	8(%rsi), %rax
	jne	LBB0_22
## %bb.19:
	testq	%r12, %r12
	movq	%r15, %rbx
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	je	LBB0_26
## %bb.20:
	movq	8(%rbx), %rcx
	imulq	-72(%rbp), %rcx                 ## 8-byte Folded Reload
	addq	-64(%rbp), %rcx                 ## 8-byte Folded Reload
	movq	%rax, %rdx
	imulq	%rax, %rcx
	shlq	$2, %rcx
	addq	32(%rbx), %rcx
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	movq	24(%rax), %r15
	movq	%rdx, %rax
	imulq	%r13, %rax
	shlq	$2, %rdx
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	shlq	$4, %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	-80(%rbp), %r12                 ## 8-byte Reload
LBB0_21:                                ## =>This Inner Loop Header: Depth=1
	movq	%rcx, %rbx
	movq	%rcx, %rdi
	movq	%r15, %rsi
	movq	-96(%rbp), %rdx                 ## 8-byte Reload
	callq	_MEMCPY
	movq	%rbx, %rcx
	movq	-104(%rbp), %rbx                ## 8-byte Reload
	movq	8(%rbx), %rax
	imulq	-48(%rbp), %rax                 ## 8-byte Folded Reload
	leaq	(%rcx,%rax,4), %rcx
	addq	-56(%rbp), %r15                 ## 8-byte Folded Reload
	decq	%r12
	jne	LBB0_21
	jmp	LBB0_26
LBB0_22:
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	movl	24(%r15), %edx
	movq	(%r15), %rcx
	movq	%rbx, %rdi
	callq	_image_to_texture
	movq	%rax, -112(%rbp)                ## 8-byte Spill
	testq	%r12, %r12
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	je	LBB0_25
## %bb.23:
	movq	%r15, %rax
	movq	8(%r15), %r15
	imulq	-72(%rbp), %r15                 ## 8-byte Folded Reload
	addq	-64(%rbp), %r15                 ## 8-byte Folded Reload
	imulq	%rcx, %r15
	shlq	$2, %r15
	addq	32(%rax), %r15
	movq	-112(%rbp), %rax                ## 8-byte Reload
	movq	32(%rax), %r12
	movq	%rcx, %rbx
	imulq	-56(%rbp), %rbx                 ## 8-byte Folded Reload
	shlq	$2, %rcx
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	movq	%rbx, -96(%rbp)                 ## 8-byte Spill
	shlq	$4, %rbx
	movq	-80(%rbp), %r13                 ## 8-byte Reload
LBB0_24:                                ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	movq	%r12, %rsi
	movq	-96(%rbp), %rdx                 ## 8-byte Reload
	callq	_MEMCPY
	movq	-104(%rbp), %rax                ## 8-byte Reload
	movq	8(%rax), %rax
	imulq	-48(%rbp), %rax                 ## 8-byte Folded Reload
	leaq	(%r15,%rax,4), %r15
	addq	%rbx, %r12
	decq	%r13
	jne	LBB0_24
LBB0_25:
	movq	-112(%rbp), %rdi                ## 8-byte Reload
	callq	_gl_free_texture_image
	movq	-104(%rbp), %rbx                ## 8-byte Reload
	movq	-56(%rbp), %r13                 ## 8-byte Reload
LBB0_26:
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	cmpq	$0, 16(%rdi)
	jne	LBB0_28
## %bb.27:
	callq	_gl_free_image
LBB0_28:
	movq	_GL_TRUE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	-120(%rbp), %rdi                ## 8-byte Reload
	movq	(%rdi), %rdx
	movq	%rax, 8(%rdx)
	movq	%rax, 8(%rdi)
	movq	24(%rdi), %rax
	testq	%rax, %rax
	movq	%rbx, %r11
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	je	LBB0_30
## %bb.29:
	movq	_GL_TEXTURE_2D@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	movq	(%rdx), %rcx
	movq	(%rcx,%r14,8), %rcx
	movl	24(%rcx), %r10d
	movq	%r14, %rcx
	movq	-64(%rbp), %r8                  ## 8-byte Reload
	movq	-72(%rbp), %r9                  ## 8-byte Reload
	pushq	%r11
	pushq	%r10
	pushq	%rbx
	pushq	%r13
	callq	*%rax
	addq	$120, %rsp
LBB0_46:
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_32:
	testq	%r13, %r13
	js	LBB0_33
## %bb.34:
	testq	%r12, %r12
	js	LBB0_35
## %bb.36:
	movq	32(%rbp), %r15
	movq	24(%rbp), %r14
	movq	_GL_BITMAP@GOTPCREL(%rip), %rax
	cmpq	%r15, (%rax)
	jne	LBB0_39
## %bb.37:
	movq	_GL_COLOR_INDEX@GOTPCREL(%rip), %rax
	cmpq	%r14, (%rax)
	je	LBB0_39
## %bb.38:
	movq	_GL_INVALID_ENUM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.9(%rip), %rdx
	jmp	LBB0_7
LBB0_30:
	movq	16(%rdi), %rax
	testq	%rax, %rax
	je	LBB0_45
## %bb.31:
	movq	_GL_TEXTURE_2D@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	movq	(%rdx), %rcx
	movq	(%rcx,%r14,8), %rcx
	movl	24(%rcx), %r8d
	movq	%r14, %rcx
	movq	%r11, %r9
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmpq	*%rax                           ## TAILCALL
LBB0_33:
	movq	_GL_INVALID_VALUE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.7(%rip), %rdx
	jmp	LBB0_7
LBB0_35:
	movq	_GL_INVALID_VALUE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.8(%rip), %rdx
	jmp	LBB0_7
LBB0_45:
	addq	$88, %rsp
	jmp	LBB0_46
LBB0_39:
	movq	%r14, %rdi
	callq	_gl_components_in_format
	movq	_GL_STENCIL_INDEX@GOTPCREL(%rip), %rax
	cmpq	%r14, (%rax)
	je	LBB0_41
## %bb.40:
	movq	_GL_DEPTH_COMPONENT@GOTPCREL(%rip), %rax
	cmpq	%r14, (%rax)
	je	LBB0_41
## %bb.42:
	movq	%r15, %rdi
	callq	_gl_sizeof_type
	testq	%rax, %rax
	je	LBB0_43
## %bb.44:
	movq	_GL_OUT_OF_MEMORY@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_41:
	movq	_GL_INVALID_ENUM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.10(%rip), %rdx
	jmp	LBB0_7
LBB0_43:
	movq	_GL_INVALID_ENUM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.11(%rip), %rdx
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_GL_TEXTURE_2D,8,3              ## @GL_TEXTURE_2D
	.comm	_GL_INVALID_ENUM,4,2            ## @GL_INVALID_ENUM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"glTexSubImage2D(target)"

	.comm	_MAX_TEXTURE_LEVELS,8,3         ## @MAX_TEXTURE_LEVELS
L_.str.1:                               ## @.str.1
	.asciz	"glTexSubImage2D(level)"

	.comm	_GL_INVALID_OPERATION,4,2       ## @GL_INVALID_OPERATION
L_.str.2:                               ## @.str.2
	.asciz	"glTexSubImage2D"

	.comm	_GL_INVALID_VALUE,4,2           ## @GL_INVALID_VALUE
L_.str.3:                               ## @.str.3
	.asciz	"glTexSubImage2D(xoffset)"

L_.str.4:                               ## @.str.4
	.asciz	"glTexSubImage2D(yoffset)"

L_.str.5:                               ## @.str.5
	.asciz	"glTexSubImage2D(xoffset+width)"

L_.str.6:                               ## @.str.6
	.asciz	"glTexSubImage2D(yoffset+height)"

	.comm	_GL_UNSIGNED_BYTE,8,3           ## @GL_UNSIGNED_BYTE
	.comm	_GL_TRUE,8,3                    ## @GL_TRUE
L_.str.7:                               ## @.str.7
	.asciz	"glTexSubImage2D(width)"

L_.str.8:                               ## @.str.8
	.asciz	"glTexSubImage2D(height)"

	.comm	_GL_BITMAP,8,3                  ## @GL_BITMAP
	.comm	_GL_COLOR_INDEX,8,3             ## @GL_COLOR_INDEX
L_.str.9:                               ## @.str.9
	.asciz	"glTexSubImage1D(format)"

	.comm	_GL_STENCIL_INDEX,8,3           ## @GL_STENCIL_INDEX
	.comm	_GL_DEPTH_COMPONENT,8,3         ## @GL_DEPTH_COMPONENT
L_.str.10:                              ## @.str.10
	.asciz	"glTexSubImage2D(format)"

L_.str.11:                              ## @.str.11
	.asciz	"glTexSubImage2D(type)"

	.comm	_GL_OUT_OF_MEMORY,4,2           ## @GL_OUT_OF_MEMORY
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gl_TexSubImage2D               ; -- Begin function gl_TexSubImage2D
	.p2align	2
_gl_TexSubImage2D:                      ; @gl_TexSubImage2D
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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	x19, x0
Lloh0:
	adrp	x26, _GL_TEXTURE_2D@GOTPAGE
Lloh1:
	ldr	x26, [x26, _GL_TEXTURE_2D@GOTPAGEOFF]
	ldr	x8, [x26]
	cmp	x8, x1
	b.ne	LBB0_5
; %bb.1:
	mov	x20, x2
Lloh2:
	adrp	x8, _MAX_TEXTURE_LEVELS@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MAX_TEXTURE_LEVELS@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	cmp	x8, x2
	b.ls	LBB0_6
; %bb.2:
	ldr	x8, [x19]
	ldr	x8, [x8]
	ldr	x21, [x8, x20, lsl #3]
	cbz	x21, LBB0_7
; %bb.3:
	mov	x24, x3
	ldr	x8, [x21]
	neg	x9, x8
	cmp	x9, x3
	b.ls	LBB0_9
; %bb.4:
Lloh5:
	adrp	x8, _GL_INVALID_VALUE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _GL_INVALID_VALUE@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
Lloh8:
	adrp	x2, l_.str.3@PAGE
Lloh9:
	add	x2, x2, l_.str.3@PAGEOFF
	b	LBB0_15
LBB0_5:
Lloh10:
	adrp	x8, _GL_INVALID_ENUM@GOTPAGE
Lloh11:
	ldr	x8, [x8, _GL_INVALID_ENUM@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
Lloh13:
	adrp	x2, l_.str@PAGE
Lloh14:
	add	x2, x2, l_.str@PAGEOFF
	b	LBB0_15
LBB0_6:
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_15
LBB0_7:
Lloh20:
	adrp	x8, _GL_INVALID_OPERATION@GOTPAGE
Lloh21:
	ldr	x8, [x8, _GL_INVALID_OPERATION@GOTPAGEOFF]
LBB0_8:
	ldr	w1, [x8]
Lloh22:
	adrp	x2, l_.str.2@PAGE
Lloh23:
	add	x2, x2, l_.str.2@PAGEOFF
	b	LBB0_15
LBB0_9:
	mov	x23, x4
	cmp	x9, x4
	b.ls	LBB0_11
; %bb.10:
Lloh24:
	adrp	x8, _GL_INVALID_VALUE@GOTPAGE
Lloh25:
	ldr	x8, [x8, _GL_INVALID_VALUE@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
Lloh27:
	adrp	x2, l_.str.4@PAGE
Lloh28:
	add	x2, x2, l_.str.4@PAGEOFF
	b	LBB0_15
LBB0_11:
	mov	x22, x5
	add	x9, x5, x24
	ldr	x10, [x21, #8]
	add	x10, x10, x8
	cmp	x9, x10
	b.ls	LBB0_13
; %bb.12:
Lloh29:
	adrp	x8, _GL_INVALID_VALUE@GOTPAGE
Lloh30:
	ldr	x8, [x8, _GL_INVALID_VALUE@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
Lloh32:
	adrp	x2, l_.str.5@PAGE
Lloh33:
	add	x2, x2, l_.str.5@PAGEOFF
	b	LBB0_15
LBB0_13:
	mov	x25, x6
	add	x9, x6, x23
	ldr	x10, [x21, #16]
	add	x8, x10, x8
	cmp	x9, x8
	b.ls	LBB0_16
; %bb.14:
Lloh34:
	adrp	x8, _GL_INVALID_VALUE@GOTPAGE
Lloh35:
	ldr	x8, [x8, _GL_INVALID_VALUE@GOTPAGEOFF]
Lloh36:
	ldr	w1, [x8]
Lloh37:
	adrp	x2, l_.str.6@PAGE
Lloh38:
	add	x2, x2, l_.str.6@PAGEOFF
LBB0_15:
	mov	x0, x19
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	b	_gl_error
LBB0_16:
	ldr	x28, [x29, #24]
	cbz	x28, LBB0_30
; %bb.17:
	ldr	w0, [x21, #40]
	bl	_components_in_intformat
	mov	x27, x0
	ldr	x8, [x28]
Lloh39:
	adrp	x9, _GL_UNSIGNED_BYTE@GOTPAGE
Lloh40:
	ldr	x9, [x9, _GL_UNSIGNED_BYTE@GOTPAGEOFF]
Lloh41:
	ldr	x9, [x9]
	cmp	x8, x9
	str	x28, [sp, #8]                   ; 8-byte Folded Spill
	b.ne	LBB0_22
; %bb.18:
	ldr	x8, [x28, #8]
	cmp	x27, x8
	b.ne	LBB0_22
; %bb.19:
	cbz	x25, LBB0_26
; %bb.20:
	ldr	x8, [sp, #8]                    ; 8-byte Folded Reload
	ldr	x11, [x8, #24]
	ldr	x8, [x21, #32]
	ldr	x9, [x21, #8]
	madd	x9, x9, x23, x24
	mul	x9, x9, x27
	mov	x10, x27
	add	x27, x8, x9, lsl #2
	mul	x8, x10, x22
	lsl	x9, x10, #2
	stp	x9, x8, [sp, #24]               ; 16-byte Folded Spill
	lsl	x8, x8, #4
	str	x8, [sp, #16]                   ; 8-byte Folded Spill
	mov	x28, x25
LBB0_21:                                ; =>This Inner Loop Header: Depth=1
	str	x11, [sp, #40]                  ; 8-byte Folded Spill
	mov	x0, x27
	mov	x1, x11
	ldr	x2, [sp, #32]                   ; 8-byte Folded Reload
	bl	_MEMCPY
	ldr	x11, [sp, #40]                  ; 8-byte Folded Reload
	ldr	x8, [x21, #8]
	ldr	x9, [sp, #24]                   ; 8-byte Folded Reload
	mul	x8, x9, x8
	add	x27, x27, x8, lsl #2
	ldr	x8, [sp, #16]                   ; 8-byte Folded Reload
	add	x11, x11, x8
	subs	x28, x28, #1
	b.ne	LBB0_21
	b	LBB0_26
LBB0_22:
	ldr	w2, [x21, #24]
	ldr	x3, [x21]
	mov	x0, x19
	mov	x1, x28
	bl	_image_to_texture
	str	x0, [sp]                        ; 8-byte Folded Spill
	str	x21, [sp, #40]                  ; 8-byte Folded Spill
	cbz	x25, LBB0_25
; %bb.23:
	ldr	x8, [sp]                        ; 8-byte Folded Reload
	ldr	x28, [x8, #32]
	ldr	x9, [sp, #40]                   ; 8-byte Folded Reload
	ldr	x8, [x9, #32]
	ldr	x9, [x9, #8]
	madd	x9, x9, x23, x24
	mul	x9, x9, x27
	mov	x10, x27
	add	x27, x8, x9, lsl #2
	mul	x8, x10, x22
	lsl	x9, x10, #2
	stp	x9, x8, [sp, #24]               ; 16-byte Folded Spill
	lsl	x8, x8, #4
	str	x8, [sp, #16]                   ; 8-byte Folded Spill
	mov	x21, x25
LBB0_24:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x27
	mov	x1, x28
	ldr	x2, [sp, #32]                   ; 8-byte Folded Reload
	bl	_MEMCPY
	ldr	x8, [sp, #40]                   ; 8-byte Folded Reload
	ldr	x8, [x8, #8]
	ldr	x9, [sp, #24]                   ; 8-byte Folded Reload
	mul	x8, x9, x8
	add	x27, x27, x8, lsl #2
	ldr	x8, [sp, #16]                   ; 8-byte Folded Reload
	add	x28, x28, x8
	subs	x21, x21, #1
	b.ne	LBB0_24
LBB0_25:
	ldr	x0, [sp]                        ; 8-byte Folded Reload
	bl	_gl_free_texture_image
	ldr	x21, [sp, #40]                  ; 8-byte Folded Reload
LBB0_26:
	ldr	x0, [sp, #8]                    ; 8-byte Folded Reload
	ldr	x8, [x0, #16]
	cbnz	x8, LBB0_28
; %bb.27:
	bl	_gl_free_image
LBB0_28:
Lloh42:
	adrp	x8, _GL_TRUE@GOTPAGE
Lloh43:
	ldr	x8, [x8, _GL_TRUE@GOTPAGEOFF]
Lloh44:
	ldr	x8, [x8]
	ldr	x2, [x19]
	str	x8, [x2, #8]
	str	x8, [x19, #8]
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_35
; %bb.29:
	ldr	x9, [x2]
	ldr	x9, [x9, x20, lsl #3]
	ldr	x1, [x26]
	ldr	w9, [x9, #24]
	str	w9, [x29, #16]
	str	x21, [x29, #24]
	mov	x0, x19
	mov	x3, x20
	mov	x4, x24
	mov	x5, x23
	mov	x6, x22
	mov	x7, x25
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	br	x8
LBB0_30:
	tbnz	x22, #63, LBB0_37
; %bb.31:
	tbnz	x25, #63, LBB0_38
; %bb.32:
	mov	x27, x7
	ldr	x20, [x29, #16]
Lloh45:
	adrp	x8, _GL_BITMAP@GOTPAGE
Lloh46:
	ldr	x8, [x8, _GL_BITMAP@GOTPAGEOFF]
Lloh47:
	ldr	x8, [x8]
	cmp	x8, x20
	b.ne	LBB0_40
; %bb.33:
Lloh48:
	adrp	x8, _GL_COLOR_INDEX@GOTPAGE
Lloh49:
	ldr	x8, [x8, _GL_COLOR_INDEX@GOTPAGEOFF]
Lloh50:
	ldr	x8, [x8]
	cmp	x8, x27
	b.eq	LBB0_40
; %bb.34:
Lloh51:
	adrp	x8, _GL_INVALID_ENUM@GOTPAGE
Lloh52:
	ldr	x8, [x8, _GL_INVALID_ENUM@GOTPAGEOFF]
Lloh53:
	ldr	w1, [x8]
Lloh54:
	adrp	x2, l_.str.9@PAGE
Lloh55:
	add	x2, x2, l_.str.9@PAGEOFF
	b	LBB0_15
LBB0_35:
	ldr	x6, [x19, #16]
	cbz	x6, LBB0_39
; %bb.36:
	ldr	x1, [x26]
	ldr	x8, [x2]
	ldr	x8, [x8, x20, lsl #3]
	ldr	w4, [x8, #24]
	mov	x0, x19
	mov	x3, x20
	mov	x5, x21
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	br	x6
LBB0_37:
Lloh56:
	adrp	x8, _GL_INVALID_VALUE@GOTPAGE
Lloh57:
	ldr	x8, [x8, _GL_INVALID_VALUE@GOTPAGEOFF]
Lloh58:
	ldr	w1, [x8]
Lloh59:
	adrp	x2, l_.str.7@PAGE
Lloh60:
	add	x2, x2, l_.str.7@PAGEOFF
	b	LBB0_15
LBB0_38:
Lloh61:
	adrp	x8, _GL_INVALID_VALUE@GOTPAGE
Lloh62:
	ldr	x8, [x8, _GL_INVALID_VALUE@GOTPAGEOFF]
Lloh63:
	ldr	w1, [x8]
Lloh64:
	adrp	x2, l_.str.8@PAGE
Lloh65:
	add	x2, x2, l_.str.8@PAGEOFF
	b	LBB0_15
LBB0_39:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
LBB0_40:
	mov	x0, x27
	bl	_gl_components_in_format
Lloh66:
	adrp	x8, _GL_STENCIL_INDEX@GOTPAGE
Lloh67:
	ldr	x8, [x8, _GL_STENCIL_INDEX@GOTPAGEOFF]
Lloh68:
	ldr	x8, [x8]
	cmp	x8, x27
	b.eq	LBB0_44
; %bb.41:
Lloh69:
	adrp	x8, _GL_DEPTH_COMPONENT@GOTPAGE
Lloh70:
	ldr	x8, [x8, _GL_DEPTH_COMPONENT@GOTPAGEOFF]
Lloh71:
	ldr	x8, [x8]
	cmp	x8, x27
	b.eq	LBB0_44
; %bb.42:
	mov	x0, x20
	bl	_gl_sizeof_type
	cbz	x0, LBB0_45
; %bb.43:
Lloh72:
	adrp	x8, _GL_OUT_OF_MEMORY@GOTPAGE
Lloh73:
	ldr	x8, [x8, _GL_OUT_OF_MEMORY@GOTPAGEOFF]
	b	LBB0_8
LBB0_44:
Lloh74:
	adrp	x8, _GL_INVALID_ENUM@GOTPAGE
Lloh75:
	ldr	x8, [x8, _GL_INVALID_ENUM@GOTPAGEOFF]
Lloh76:
	ldr	w1, [x8]
Lloh77:
	adrp	x2, l_.str.10@PAGE
Lloh78:
	add	x2, x2, l_.str.10@PAGEOFF
	b	LBB0_15
LBB0_45:
Lloh79:
	adrp	x8, _GL_INVALID_ENUM@GOTPAGE
Lloh80:
	ldr	x8, [x8, _GL_INVALID_ENUM@GOTPAGEOFF]
Lloh81:
	ldr	w1, [x8]
Lloh82:
	adrp	x2, l_.str.11@PAGE
Lloh83:
	add	x2, x2, l_.str.11@PAGEOFF
	b	LBB0_15
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.loh AdrpAdd	Lloh54, Lloh55
	.loh AdrpLdrGotLdr	Lloh51, Lloh52, Lloh53
	.loh AdrpAdd	Lloh59, Lloh60
	.loh AdrpLdrGotLdr	Lloh56, Lloh57, Lloh58
	.loh AdrpAdd	Lloh64, Lloh65
	.loh AdrpLdrGotLdr	Lloh61, Lloh62, Lloh63
	.loh AdrpLdrGotLdr	Lloh66, Lloh67, Lloh68
	.loh AdrpLdrGotLdr	Lloh69, Lloh70, Lloh71
	.loh AdrpLdrGot	Lloh72, Lloh73
	.loh AdrpAdd	Lloh77, Lloh78
	.loh AdrpLdrGotLdr	Lloh74, Lloh75, Lloh76
	.loh AdrpAdd	Lloh82, Lloh83
	.loh AdrpLdrGotLdr	Lloh79, Lloh80, Lloh81
	.cfi_endproc
                                        ; -- End function
	.comm	_GL_TEXTURE_2D,8,3              ; @GL_TEXTURE_2D
	.comm	_GL_INVALID_ENUM,4,2            ; @GL_INVALID_ENUM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"glTexSubImage2D(target)"

	.comm	_MAX_TEXTURE_LEVELS,8,3         ; @MAX_TEXTURE_LEVELS
l_.str.1:                               ; @.str.1
	.asciz	"glTexSubImage2D(level)"

	.comm	_GL_INVALID_OPERATION,4,2       ; @GL_INVALID_OPERATION
l_.str.2:                               ; @.str.2
	.asciz	"glTexSubImage2D"

	.comm	_GL_INVALID_VALUE,4,2           ; @GL_INVALID_VALUE
l_.str.3:                               ; @.str.3
	.asciz	"glTexSubImage2D(xoffset)"

l_.str.4:                               ; @.str.4
	.asciz	"glTexSubImage2D(yoffset)"

l_.str.5:                               ; @.str.5
	.asciz	"glTexSubImage2D(xoffset+width)"

l_.str.6:                               ; @.str.6
	.asciz	"glTexSubImage2D(yoffset+height)"

	.comm	_GL_UNSIGNED_BYTE,8,3           ; @GL_UNSIGNED_BYTE
	.comm	_GL_TRUE,8,3                    ; @GL_TRUE
l_.str.7:                               ; @.str.7
	.asciz	"glTexSubImage2D(width)"

l_.str.8:                               ; @.str.8
	.asciz	"glTexSubImage2D(height)"

	.comm	_GL_BITMAP,8,3                  ; @GL_BITMAP
	.comm	_GL_COLOR_INDEX,8,3             ; @GL_COLOR_INDEX
l_.str.9:                               ; @.str.9
	.asciz	"glTexSubImage1D(format)"

	.comm	_GL_STENCIL_INDEX,8,3           ; @GL_STENCIL_INDEX
	.comm	_GL_DEPTH_COMPONENT,8,3         ; @GL_DEPTH_COMPONENT
l_.str.10:                              ; @.str.10
	.asciz	"glTexSubImage2D(format)"

l_.str.11:                              ; @.str.11
	.asciz	"glTexSubImage2D(type)"

	.comm	_GL_OUT_OF_MEMORY,4,2           ; @GL_OUT_OF_MEMORY
.subsections_via_symbols
