	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gl_unpack_pixels               ## -- Begin function gl_unpack_pixels
	.p2align	4, 0x90
_gl_unpack_pixels:                      ## @gl_unpack_pixels
	.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, -104(%rbp)                 ## 8-byte Spill
	movq	%rcx, %rbx
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %r12
	movq	%r8, -80(%rbp)                  ## 8-byte Spill
	movq	%r8, %rdi
	callq	_gl_sizeof_type
	testq	%rax, %rax
	js	LBB0_10
## %bb.1:
	movq	%rax, %r13
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movq	%rbx, -96(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_gl_components_in_format
	testq	%rax, %rax
	js	LBB0_11
## %bb.2:
	movq	%rax, %r12
	movq	_GL_BITMAP@GOTPCREL(%rip), %rax
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	cmpq	%rcx, (%rax)
	jne	LBB0_15
## %bb.3:
	movq	%r14, %rdi
	imulq	%r15, %rdi
	movl	$8, %esi
	callq	_CEILING
	movq	%rax, %r13
	movq	%rax, %rdi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_13
## %bb.4:
	movq	%rax, %rbx
	movq	%r13, -48(%rbp)                 ## 8-byte Spill
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
	movq	%r15, %rdi
	movl	$8, %esi
	callq	_CEILING
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	testq	%r14, %r14
	jle	LBB0_8
## %bb.5:
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	shlq	$2, %r15
	xorl	%r13d, %r13d
	movq	%rbx, %r12
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r13, (%rsp)
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	-104(%rbp), %rsi                ## 8-byte Reload
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	movq	%r14, %rcx
	movq	-96(%rbp), %r8                  ## 8-byte Reload
	movq	-80(%rbp), %r9                  ## 8-byte Reload
	callq	_gl_pixel_addr_in_image
	testq	%rax, %rax
	je	LBB0_27
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	%r12, %rdi
	movq	%rax, %rsi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	callq	_MEMCPY
	incq	%r13
	addq	%r15, %r12
	cmpq	%r13, %r14
	jne	LBB0_6
LBB0_8:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	cmpq	$0, 8(%rax)
	je	LBB0_14
## %bb.9:
	movq	%rbx, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_gl_flip_bytes
	jmp	LBB0_14
LBB0_10:
	movq	_GL_INVALID_ENUM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r12, %rdi
	jmp	LBB0_12
LBB0_11:
	movq	_GL_INVALID_ENUM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
LBB0_12:
	callq	_gl_error
LBB0_13:
	xorl	%ebx, %ebx
LBB0_14:
	movq	%rbx, %rax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
	imulq	%r15, %r13
	imulq	%r12, %r13
	movq	%r13, %rbx
	imulq	%r14, %rbx
	movq	%rbx, %rdi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_13
## %bb.16:
	movq	%rbx, -88(%rbp)                 ## 8-byte Spill
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	testq	%r14, %r14
	jle	LBB0_20
## %bb.17:
	imulq	-56(%rbp), %r12                 ## 8-byte Folded Reload
	imulq	-72(%rbp), %r12                 ## 8-byte Folded Reload
	shlq	$2, %r12
	xorl	%ebx, %ebx
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	movq	%rbx, (%rsp)
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	-104(%rbp), %rsi                ## 8-byte Reload
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	movq	%r14, %rcx
	movq	-96(%rbp), %r8                  ## 8-byte Reload
	movq	-80(%rbp), %r9                  ## 8-byte Reload
	callq	_gl_pixel_addr_in_image
	testq	%rax, %rax
	je	LBB0_28
## %bb.19:                              ##   in Loop: Header=BB0_18 Depth=1
	movq	%r15, %rdi
	movq	%rax, %rsi
	movq	%r13, %rdx
	callq	_MEMCPY
	incq	%rbx
	addq	%r12, %r15
	cmpq	%rbx, %r14
	jne	LBB0_18
LBB0_20:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	cmpq	$0, (%rax)
	je	LBB0_30
## %bb.21:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	cmpq	$2, %rax
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	jl	LBB0_14
## %bb.22:
	cmpq	$4, %rax
	je	LBB0_31
## %bb.23:
	cmpq	$2, %rax
	jne	LBB0_14
## %bb.24:
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, %rsi
	shrq	$63, %rsi
	addq	%rax, %rsi
	sarq	%rsi
	movq	%rbx, %rdi
	callq	_gl_swap2
	jmp	LBB0_14
LBB0_27:
	movq	%rbx, %rdi
	jmp	LBB0_29
LBB0_28:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
LBB0_29:
	callq	_free
	jmp	LBB0_13
LBB0_30:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	jmp	LBB0_14
LBB0_31:
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	leaq	3(%rax), %rsi
	testq	%rax, %rax
	cmovnsq	%rax, %rsi
	sarq	$2, %rsi
	movq	%rbx, %rdi
	callq	_gl_swap4
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_GL_INVALID_ENUM,4,2            ## @GL_INVALID_ENUM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"internal error in gl_unpack(type)"

L_.str.1:                               ## @.str.1
	.asciz	"gl_unpack_pixels(format)"

	.comm	_GL_BITMAP,8,3                  ## @GL_BITMAP
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gl_unpack_pixels               ; -- Begin function gl_unpack_pixels
	.p2align	2
_gl_unpack_pixels:                      ; @gl_unpack_pixels
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	str	x5, [sp, #24]                   ; 8-byte Folded Spill
	mov	x22, x4
	mov	x23, x3
	mov	x24, x2
	mov	x25, x1
	mov	x20, x0
	mov	x0, x4
	bl	_gl_sizeof_type
	tbnz	x0, #63, LBB0_10
; %bb.1:
	mov	x26, x0
	mov	x0, x23
	bl	_gl_components_in_format
	tbnz	x0, #63, LBB0_11
; %bb.2:
Lloh0:
	adrp	x8, _GL_BITMAP@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GL_BITMAP@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x8, x22
	b.ne	LBB0_15
; %bb.3:
	mul	x0, x24, x25
	mov	w1, #8
	bl	_CEILING
	mov	x26, x0
	bl	_malloc
	cbz	x0, LBB0_13
; %bb.4:
	str	x0, [sp, #16]                   ; 8-byte Folded Spill
	mov	x0, x25
	mov	w1, #8
	bl	_CEILING
	cmp	x24, #1
	b.lt	LBB0_8
; %bb.5:
	mov	x27, x0
	mov	x28, #0
	lsl	x21, x0, #2
	ldr	x19, [sp, #16]                  ; 8-byte Folded Reload
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	ldr	x1, [sp, #24]                   ; 8-byte Folded Reload
	mov	x2, x25
	mov	x3, x24
	mov	x4, x23
	mov	x5, x22
	mov	x6, x28
	bl	_gl_pixel_addr_in_image
	cbz	x0, LBB0_25
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x1, x0
	mov	x0, x19
	mov	x2, x27
	bl	_MEMCPY
	add	x28, x28, #1
	add	x19, x19, x21
	cmp	x24, x28
	b.ne	LBB0_6
LBB0_8:
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_26
; %bb.9:
	ldr	x19, [sp, #16]                  ; 8-byte Folded Reload
	mov	x0, x19
	mov	x1, x26
	bl	_gl_flip_bytes
	b	LBB0_14
LBB0_10:
Lloh3:
	adrp	x8, _GL_INVALID_ENUM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GL_INVALID_ENUM@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
Lloh6:
	adrp	x2, l_.str@PAGE
Lloh7:
	add	x2, x2, l_.str@PAGEOFF
	b	LBB0_12
LBB0_11:
Lloh8:
	adrp	x8, _GL_INVALID_ENUM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _GL_INVALID_ENUM@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
Lloh11:
	adrp	x2, l_.str.1@PAGE
Lloh12:
	add	x2, x2, l_.str.1@PAGEOFF
LBB0_12:
	mov	x0, x20
	bl	_gl_error
LBB0_13:
	mov	x19, #0
LBB0_14:
	mov	x0, x19
	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
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_15:
	mov	x19, x0
	mul	x8, x26, x25
	mul	x28, x8, x0
	mul	x21, x28, x24
	mov	x0, x21
	bl	_malloc
	cbz	x0, LBB0_13
; %bb.16:
	stp	x21, x0, [sp, #8]               ; 16-byte Folded Spill
	cmp	x24, #1
	b.lt	LBB0_20
; %bb.17:
	mov	x27, #0
	mul	x8, x26, x19
	mul	x8, x8, x25
	lsl	x21, x8, #2
	ldr	x19, [sp, #16]                  ; 8-byte Folded Reload
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	ldr	x1, [sp, #24]                   ; 8-byte Folded Reload
	mov	x2, x25
	mov	x3, x24
	mov	x4, x23
	mov	x5, x22
	mov	x6, x27
	bl	_gl_pixel_addr_in_image
	cbz	x0, LBB0_25
; %bb.19:                               ;   in Loop: Header=BB0_18 Depth=1
	mov	x1, x0
	mov	x0, x19
	mov	x2, x28
	bl	_MEMCPY
	add	x27, x27, #1
	add	x19, x19, x21
	cmp	x24, x27
	b.ne	LBB0_18
LBB0_20:
	ldr	x8, [x20]
	cbz	x8, LBB0_26
; %bb.21:
	cmp	x26, #2
	ldp	x9, x19, [sp, #8]               ; 16-byte Folded Reload
	b.lt	LBB0_14
; %bb.22:
	cmp	x26, #4
	b.eq	LBB0_27
; %bb.23:
	cmp	x26, #2
	b.ne	LBB0_14
; %bb.24:
	cmp	x9, #0
	cinc	x8, x9, lt
	asr	x1, x8, #1
	mov	x0, x19
	bl	_gl_swap2
	b	LBB0_14
LBB0_25:
	ldr	x0, [sp, #16]                   ; 8-byte Folded Reload
	bl	_free
	b	LBB0_13
LBB0_26:
	ldr	x19, [sp, #16]                  ; 8-byte Folded Reload
	b	LBB0_14
LBB0_27:
	add	x8, x9, #3
	cmp	x9, #0
	csel	x8, x8, x9, lt
	asr	x1, x8, #2
	mov	x0, x19
	bl	_gl_swap4
	b	LBB0_14
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_GL_INVALID_ENUM,4,2            ; @GL_INVALID_ENUM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"internal error in gl_unpack(type)"

l_.str.1:                               ; @.str.1
	.asciz	"gl_unpack_pixels(format)"

	.comm	_GL_BITMAP,8,3                  ; @GL_BITMAP
.subsections_via_symbols
