	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gif_read_header1
_gif_read_header1:                      ## @gif_read_header1
	.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	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	leaq	36(%rdi), %r14
	movq	%r14, %rdi
	callq	_bytestream2_get_bytes_left
	cmpl	$12, %eax
	jle	LBB0_1
## %bb.2:
	leaq	-64(%rbp), %r15
	movq	%r14, %rdi
	movq	%r15, %rsi
	movl	$6, %edx
	callq	_bytestream2_get_bufferu
	movq	_gif87a_sig@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	$6, %edx
	callq	_memcmp
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	_gif89a_sig@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-64(%rbp), %rdi
	movl	$6, %edx
	callq	_memcmp
	testq	%rax, %rax
	jne	LBB0_1
LBB0_4:
	movl	$-1, (%rbx)
	movq	%r14, %rdi
	callq	_bytestream2_get_le16u
	movq	%rax, 48(%rbx)
	movq	%r14, %rdi
	callq	_bytestream2_get_le16u
	movq	%rax, 40(%rbx)
	movq	%r14, %rdi
	callq	_bytestream2_get_byteu
	movl	%eax, %ecx
	shrl	$4, %ecx
	andl	$7, %ecx
	incl	%ecx
	movl	%ecx, 4(%rbx)
	movl	%eax, %ecx
	andl	$128, %ecx
	movl	%ecx, 8(%rbx)
	andl	$7, %eax
	incl	%eax
	movl	%eax, 12(%rbx)
	movq	%r14, %rdi
	callq	_bytestream2_get_byteu
	movl	%eax, %r15d
	movq	%r14, %rdi
	callq	_bytestream2_get_byteu
	testl	%eax, %eax
	je	LBB0_5
## %bb.6:
	addl	$15, %eax
	movq	56(%rbx), %rdi
	movl	%eax, (%rdi)
	movl	$64, 4(%rdi)
	jmp	LBB0_7
LBB0_5:
	movq	56(%rbx), %rdi
LBB0_7:
	movq	48(%rbx), %rdx
	movq	40(%rbx), %rcx
	movl	8(%rbx), %r9d
	movl	12(%rbx), %r8d
	leaq	L_.str(%rip), %rsi
	callq	_ff_dlog
	cmpl	$0, 8(%rbx)
	je	LBB0_10
## %bb.8:
	movl	%r15d, 16(%rbx)
	movl	12(%rbx), %r15d
	movq	%r14, %rdi
	callq	_bytestream2_get_bytes_left
	movl	$3, %edx
	movl	%r15d, %ecx
	shll	%cl, %edx
	cmpl	%edx, %eax
	jge	LBB0_9
LBB0_1:
	movq	_AVERROR_INVALIDDATA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_12
LBB0_10:
	movl	$-1, 16(%rbx)
	jmp	LBB0_11
LBB0_9:
	movl	$1, %edx
	movl	%r15d, %ecx
	shll	%cl, %edx
	movq	24(%rbx), %rsi
	movq	%rbx, %rdi
	callq	_gif_read_palette
	movq	24(%rbx), %rax
	movslq	16(%rbx), %rcx
	movl	(%rax,%rcx,4), %eax
	movl	%eax, 32(%rbx)
LBB0_11:
	xorl	%eax, %eax
LBB0_12:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-32(%rbp), %rcx
	jne	LBB0_14
## %bb.13:
	addq	$40, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_AVERROR_INVALIDDATA,4,2        ## @AVERROR_INVALIDDATA
	.comm	_gif87a_sig,4,2                 ## @gif87a_sig
	.comm	_gif89a_sig,4,2                 ## @gif89a_sig
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"screen_w=%d screen_h=%d bpp=%d global_palette=%d\n"

	.no_dead_strip	_gif_read_header1
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gif_read_header1
_gif_read_header1:                      ; @gif_read_header1
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
	add	x20, x0, #36
	mov	x0, x20
	bl	_bytestream2_get_bytes_left
	cmp	w0, #12
	b.le	LBB0_8
; %bb.1:
	mov	x1, sp
	mov	x0, x20
	mov	w2, #6
	bl	_bytestream2_get_bufferu
Lloh3:
	adrp	x8, _gif87a_sig@GOTPAGE
Lloh4:
	ldr	x8, [x8, _gif87a_sig@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, sp
	mov	w2, #6
	bl	_memcmp
	cbz	x0, LBB0_3
; %bb.2:
Lloh6:
	adrp	x8, _gif89a_sig@GOTPAGE
Lloh7:
	ldr	x8, [x8, _gif89a_sig@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, sp
	mov	w2, #6
	bl	_memcmp
	cbnz	x0, LBB0_8
LBB0_3:
	mov	w8, #-1
	str	w8, [x19]
	mov	x0, x20
	bl	_bytestream2_get_le16u
	str	x0, [x19, #48]
	mov	x0, x20
	bl	_bytestream2_get_le16u
	str	x0, [x19, #40]
	mov	x0, x20
	bl	_bytestream2_get_byteu
	ubfx	w8, w0, #4, #3
	add	w8, w8, #1
	and	w9, w0, #0x80
	stp	w8, w9, [x19, #4]
	and	w8, w0, #0x7
	add	w8, w8, #1
	str	w8, [x19, #12]
	mov	x0, x20
	bl	_bytestream2_get_byteu
	mov	x21, x0
	mov	x0, x20
	bl	_bytestream2_get_byteu
	cbz	w0, LBB0_5
; %bb.4:
	add	w8, w0, #15
	ldr	x0, [x19, #56]
	mov	w9, #64
	stp	w8, w9, [x0]
	b	LBB0_6
LBB0_5:
	ldr	x0, [x19, #56]
LBB0_6:
	ldp	x3, x2, [x19, #40]
	ldp	w5, w4, [x19, #8]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	bl	_ff_dlog
	ldr	w8, [x19, #8]
	cbz	w8, LBB0_11
; %bb.7:
	str	w21, [x19, #16]
	ldr	w21, [x19, #12]
	mov	x0, x20
	bl	_bytestream2_get_bytes_left
	mov	w8, #3
	lsl	w8, w8, w21
	cmp	w0, w8
	b.ge	LBB0_12
LBB0_8:
Lloh11:
	adrp	x8, _AVERROR_INVALIDDATA@GOTPAGE
Lloh12:
	ldr	x8, [x8, _AVERROR_INVALIDDATA@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
LBB0_9:
	ldr	x8, [sp, #24]
Lloh14:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh15:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_13
; %bb.10:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_11:
	mov	w0, #0
	mov	w8, #-1
	str	w8, [x19, #16]
	b	LBB0_9
LBB0_12:
	mov	w8, #1
	lsl	w2, w8, w21
	ldr	x1, [x19, #24]
	mov	x0, x19
	bl	_gif_read_palette
	mov	w0, #0
	ldr	x8, [x19, #24]
	ldrsw	x9, [x19, #16]
	ldr	w8, [x8, x9, lsl #2]
	str	w8, [x19, #32]
	b	LBB0_9
LBB0_13:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_AVERROR_INVALIDDATA,4,2        ; @AVERROR_INVALIDDATA
	.comm	_gif87a_sig,4,2                 ; @gif87a_sig
	.comm	_gif89a_sig,4,2                 ; @gif89a_sig
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"screen_w=%d screen_h=%d bpp=%d global_palette=%d\n"

	.no_dead_strip	_gif_read_header1
.subsections_via_symbols
