	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function decode_image_gif
_decode_image_gif:                      ## @decode_image_gif
	.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	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	_GUID_ContainerFormatGif@GOTPCREL(%rip), %rsi
	leaq	-40(%rbp), %rdx
	callq	_initialize_decoder_wic
	movq	%rax, %rbx
	movq	_Ok@GOTPCREL(%rip), %r15
	cmpq	(%r15), %rax
	jne	LBB0_6
## %bb.1:
	movq	-40(%rbp), %rdi
	leaq	-28(%rbp), %rsi
	callq	_IWICBitmapDecoder_GetFrameCount
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_FAILED
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movl	%ebx, %edi
	callq	_hresult_to_status
	movq	%rax, %rbx
	jmp	LBB0_6
LBB0_3:
	xorl	%esi, %esi
	cmpl	$2, -28(%rbp)
	movq	-40(%rbp), %rdi
	setge	%sil
	movq	_gif_metadata_reader@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	xorl	%edx, %edx
	movq	%r14, %r8
	callq	_decode_frame_wic
	movq	%rax, %rbx
	movq	-40(%rbp), %rdi
	callq	_IWICBitmapDecoder_Release
	cmpq	(%r15), %rbx
	jne	LBB0_6
## %bb.4:
	cmpl	$2, -28(%rbp)
	jl	LBB0_6
## %bb.5:
	movq	(%r14), %rax
	movq	(%rax), %rdi
	callq	_heap_free
	movq	(%r14), %rax
	movq	$0, (%rax)
	movq	(%r15), %rbx
LBB0_6:
	movq	%rbx, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GUID_ContainerFormatGif,4,2    ## @GUID_ContainerFormatGif
	.comm	_Ok,8,3                         ## @Ok
	.comm	_gif_metadata_reader,4,2        ## @gif_metadata_reader
	.no_dead_strip	_decode_image_gif
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function decode_image_gif
_decode_image_gif:                      ; @decode_image_gif
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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, x1
Lloh0:
	adrp	x1, _GUID_ContainerFormatGif@GOTPAGE
Lloh1:
	ldr	x1, [x1, _GUID_ContainerFormatGif@GOTPAGEOFF]
	add	x2, sp, #8
	bl	_initialize_decoder_wic
	mov	x20, x0
Lloh2:
	adrp	x21, _Ok@GOTPAGE
Lloh3:
	ldr	x21, [x21, _Ok@GOTPAGEOFF]
	ldr	x8, [x21]
	cmp	x0, x8
	b.ne	LBB0_5
; %bb.1:
	ldr	x0, [sp, #8]
	add	x1, sp, #4
	bl	_IWICBitmapDecoder_GetFrameCount
	mov	x20, x0
	bl	_FAILED
	cbz	x0, LBB0_3
; %bb.2:
	mov	x0, x20
	bl	_hresult_to_status
	mov	x20, x0
	b	LBB0_5
LBB0_3:
	ldr	x0, [sp, #8]
	ldr	w8, [sp, #4]
	cmp	w8, #1
	cset	w1, gt
Lloh4:
	adrp	x8, _gif_metadata_reader@GOTPAGE
Lloh5:
	ldr	x8, [x8, _gif_metadata_reader@GOTPAGEOFF]
Lloh6:
	ldr	w3, [x8]
	mov	w2, #0
	mov	x4, x19
	bl	_decode_frame_wic
	mov	x20, x0
	ldr	x0, [sp, #8]
	bl	_IWICBitmapDecoder_Release
	ldr	x8, [x21]
	ldr	w9, [sp, #4]
	cmp	x20, x8
	ccmp	w9, #2, #8, eq
	b.lt	LBB0_5
; %bb.4:
	ldr	x8, [x19]
	ldr	x0, [x8]
	bl	_heap_free
	ldr	x8, [x19]
	str	xzr, [x8]
	ldr	x20, [x21]
LBB0_5:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_GUID_ContainerFormatGif,4,2    ; @GUID_ContainerFormatGif
	.comm	_Ok,8,3                         ; @Ok
	.comm	_gif_metadata_reader,4,2        ; @gif_metadata_reader
	.no_dead_strip	_decode_image_gif
.subsections_via_symbols
