	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fits_read_packet
_fits_read_packet:                      ## @fits_read_packet
	.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	%rsi, %r15
	movq	%rdi, %r12
	movq	8(%rdi), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	cmpq	$0, 8(%rax)
	jne	LBB0_1
## %bb.2:
	movq	_STATE_XTENSION@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_STATE_SIMPLE@GOTPCREL(%rip), %rax
LBB0_3:
	movl	(%rax), %esi
	leaq	-68(%rbp), %r14
	movq	%r14, %rdi
	callq	_avpriv_fits_header_init
	movq	_FITS_BLOCK_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_AV_BPRINT_SIZE_UNLIMITED@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-48(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_av_bprint_init
	leaq	-56(%rbp), %r8
	movq	%r12, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movq	%r14, %rdx
	movq	%rbx, %rcx
	callq	_is_image
	movq	%rax, %rbx
	testq	%rax, %rax
	je	LBB0_4
## %bb.9:
	testq	%rbx, %rbx
	js	LBB0_13
LBB0_10:
	leaq	-48(%rbp), %rdi
	callq	_av_bprint_is_complete
	testl	%eax, %eax
	je	LBB0_11
## %bb.14:
	movslq	-48(%rbp), %rax
	movq	-56(%rbp), %rcx
	leaq	(%rax,%rcx), %rsi
	addq	$-80, %rsi
	movq	%r15, %rdi
	callq	_av_new_packet
	testq	%rax, %rax
	js	LBB0_12
## %bb.15:
	movq	$0, 24(%r15)
	movq	_AV_PKT_FLAG_KEY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 16(%r15)
	leaq	-48(%rbp), %rdi
	leaq	-80(%rbp), %rsi
	callq	_av_bprint_finalize
	testq	%rax, %rax
	js	LBB0_16
## %bb.17:
	movq	8(%r15), %rdi
	movq	-80(%rbp), %rsi
	addq	$80, %rsi
	movl	-48(%rbp), %edx
	addl	$-80, %edx
	callq	_memcpy
	movl	-48(%rbp), %eax
	addl	$-80, %eax
	movl	%eax, (%r15)
	leaq	-80(%rbp), %rdi
	callq	_av_freep
	movl	(%r12), %edi
	movslq	(%r15), %rsi
	addq	8(%r15), %rsi
	movq	-56(%rbp), %rdx
	callq	_avio_read
	movq	%rax, %rbx
	testq	%rax, %rax
	js	LBB0_18
## %bb.19:
	addl	%ebx, (%r15)
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movl	(%rcx), %eax
	movl	%eax, 4(%r15)
	incl	%eax
	movl	%eax, (%rcx)
	xorl	%ebx, %ebx
	jmp	LBB0_20
LBB0_4:
	movq	%r15, -88(%rbp)                 ## 8-byte Spill
	leaq	-48(%rbp), %r13
	leaq	-68(%rbp), %r14
	leaq	-56(%rbp), %r15
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %edi
	movq	-56(%rbp), %rsi
	callq	_avio_skip
	testq	%rax, %rax
	js	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_av_bprint_finalize
	movq	_FITS_BLOCK_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_AV_BPRINT_SIZE_UNLIMITED@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	callq	_av_bprint_init
	movq	_STATE_XTENSION@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_avpriv_fits_header_init
	movq	%r12, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movq	%r14, %rdx
	movq	%r13, %rcx
	movq	%r15, %r8
	callq	_is_image
	testq	%rax, %rax
	je	LBB0_5
## %bb.8:
	movq	%rax, %rbx
	movq	-88(%rbp), %r15                 ## 8-byte Reload
	testq	%rbx, %rbx
	jns	LBB0_10
	jmp	LBB0_13
LBB0_11:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_AVERROR
LBB0_12:
	movq	%rax, %rbx
LBB0_13:
	leaq	-48(%rbp), %rdi
	xorl	%esi, %esi
	callq	_av_bprint_finalize
	jmp	LBB0_20
LBB0_6:
	movq	%rax, %rbx
	jmp	LBB0_20
LBB0_16:
	movq	%rax, %rbx
LBB0_18:
	movq	%r15, %rdi
	callq	_av_packet_unref
LBB0_20:
	movl	%ebx, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_STATE_SIMPLE,4,2               ## @STATE_SIMPLE
	.comm	_STATE_XTENSION,4,2             ## @STATE_XTENSION
	.comm	_FITS_BLOCK_SIZE,4,2            ## @FITS_BLOCK_SIZE
	.comm	_AV_BPRINT_SIZE_UNLIMITED,4,2   ## @AV_BPRINT_SIZE_UNLIMITED
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_AV_PKT_FLAG_KEY,4,2            ## @AV_PKT_FLAG_KEY
	.no_dead_strip	_fits_read_packet
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fits_read_packet
_fits_read_packet:                      ; @fits_read_packet
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	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
	mov	x19, x1
	mov	x21, x0
	ldr	x20, [x0, #8]
Lloh0:
	adrp	x23, _STATE_XTENSION@GOTPAGE
Lloh1:
	ldr	x23, [x23, _STATE_XTENSION@GOTPAGEOFF]
	ldr	x8, [x20, #8]
Lloh2:
	adrp	x9, _STATE_SIMPLE@GOTPAGE
Lloh3:
	ldr	x9, [x9, _STATE_SIMPLE@GOTPAGEOFF]
	cmp	x8, #0
	csel	x8, x23, x9, eq
	ldr	w1, [x8]
	add	x0, sp, #20
	bl	_avpriv_fits_header_init
Lloh4:
	adrp	x24, _FITS_BLOCK_SIZE@GOTPAGE
Lloh5:
	ldr	x24, [x24, _FITS_BLOCK_SIZE@GOTPAGEOFF]
	ldr	w1, [x24]
Lloh6:
	adrp	x25, _AV_BPRINT_SIZE_UNLIMITED@GOTPAGE
Lloh7:
	ldr	x25, [x25, _AV_BPRINT_SIZE_UNLIMITED@GOTPAGEOFF]
	ldr	w2, [x25]
	add	x0, sp, #16
	bl	_av_bprint_init
	add	x2, sp, #20
	add	x3, sp, #16
	add	x4, sp, #24
	mov	x0, x21
	mov	x1, x20
	bl	_is_image
	mov	x22, x0
	cbz	x0, LBB0_8
; %bb.1:
	tbnz	x22, #63, LBB0_12
LBB0_2:
	add	x0, sp, #16
	bl	_av_bprint_is_complete
	cbz	w0, LBB0_10
; %bb.3:
	ldrsw	x8, [sp, #16]
	ldr	x9, [sp, #24]
	add	x8, x8, x9
	sub	x1, x8, #80
	mov	x0, x19
	bl	_av_new_packet
	tbnz	x0, #63, LBB0_11
; %bb.4:
	str	xzr, [x19, #24]
Lloh8:
	adrp	x8, _AV_PKT_FLAG_KEY@GOTPAGE
Lloh9:
	ldr	x8, [x8, _AV_PKT_FLAG_KEY@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	ldr	w9, [x19, #16]
	orr	w8, w9, w8
	str	w8, [x19, #16]
	add	x0, sp, #16
	add	x1, sp, #8
	bl	_av_bprint_finalize
	tbnz	x0, #63, LBB0_15
; %bb.5:
	ldr	x0, [x19, #8]
	ldr	x8, [sp, #8]
	add	x1, x8, #80
	ldr	w8, [sp, #16]
	sub	w2, w8, #80
	bl	_memcpy
	ldr	w8, [sp, #16]
	sub	w8, w8, #80
	str	w8, [x19]
	add	x0, sp, #8
	bl	_av_freep
	ldr	w0, [x21]
	ldr	x8, [x19, #8]
	ldrsw	x9, [x19]
	add	x1, x8, x9
	ldr	x2, [sp, #24]
	bl	_avio_read
	mov	x21, x0
	tbnz	x0, #63, LBB0_16
; %bb.6:
	mov	w22, #0
	ldr	w8, [x19]
	add	w8, w8, w21
	str	w8, [x19]
	ldr	w8, [x20]
	str	w8, [x19, #4]
	add	w8, w8, #1
	str	w8, [x20]
	b	LBB0_13
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	add	x0, sp, #16
	mov	x1, #0
	bl	_av_bprint_finalize
	ldr	w1, [x24]
	ldr	w2, [x25]
	add	x0, sp, #16
	bl	_av_bprint_init
	ldr	w1, [x23]
	add	x0, sp, #20
	bl	_avpriv_fits_header_init
	add	x2, sp, #20
	add	x3, sp, #16
	add	x4, sp, #24
	mov	x0, x21
	mov	x1, x20
	bl	_is_image
	cbnz	x0, LBB0_14
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x21]
	ldr	x1, [sp, #24]
	bl	_avio_skip
	tbz	x0, #63, LBB0_7
; %bb.9:
	mov	x22, x0
	b	LBB0_13
LBB0_10:
Lloh11:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
	bl	_AVERROR
LBB0_11:
	mov	x22, x0
LBB0_12:
	add	x0, sp, #16
	mov	x1, #0
	bl	_av_bprint_finalize
LBB0_13:
	mov	x0, x22
	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
	add	sp, sp, #112
	ret
LBB0_14:
	mov	x22, x0
	tbz	x22, #63, LBB0_2
	b	LBB0_12
LBB0_15:
	mov	x22, x0
	mov	x0, x19
	bl	_av_packet_unref
                                        ; kill: def $w22 killed $w22 killed $x22 def $x22
	b	LBB0_13
LBB0_16:
	mov	x0, x19
	bl	_av_packet_unref
	mov	x22, x21
	b	LBB0_13
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_STATE_SIMPLE,4,2               ; @STATE_SIMPLE
	.comm	_STATE_XTENSION,4,2             ; @STATE_XTENSION
	.comm	_FITS_BLOCK_SIZE,4,2            ; @FITS_BLOCK_SIZE
	.comm	_AV_BPRINT_SIZE_UNLIMITED,4,2   ; @AV_BPRINT_SIZE_UNLIMITED
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_AV_PKT_FLAG_KEY,4,2            ; @AV_PKT_FLAG_KEY
	.no_dead_strip	_fits_read_packet
.subsections_via_symbols
