	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function select_frame_gif
_select_frame_gif:                      ## @select_frame_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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, %r14
	movq	_FALSE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movl	(%rdi), %esi
	xorl	%r15d, %r15d
	cmpl	%ebx, %esi
	movl	%ebx, -52(%rbp)                 ## 4-byte Spill
	jge	LBB0_7
## %bb.1:
	movl	12(%r14), %edi
	leaq	-48(%rbp), %rdx
	callq	_IWICBitmapDecoder_GetFrame
	movl	%eax, %r12d
	movl	%eax, %edi
	callq	_FAILED
	testq	%rax, %rax
	je	LBB0_3
LBB0_2:
	movl	%r12d, %edi
	callq	_hresult_to_status
	jmp	LBB0_32
LBB0_3:
	movq	-48(%rbp), %rdi
	movq	_GUID_MetadataFormatGCE@GOTPCREL(%rip), %rsi
	leaq	_select_frame_gif.disposalW(%rip), %rdx
	callq	_get_gif_frame_property
	movl	%eax, %r12d
	movq	-48(%rbp), %rdi
	callq	_IWICBitmapFrameDecode_Release
	movq	_GIF_DISPOSE_RESTORE_TO_BKGND@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	jne	LBB0_5
## %bb.4:
	movl	(%r14), %r15d
	movl	-52(%rbp), %ebx                 ## 4-byte Reload
	jmp	LBB0_7
LBB0_5:
	movq	_GIF_DISPOSE_RESTORE_TO_PREV@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	movl	-52(%rbp), %ebx                 ## 4-byte Reload
	je	LBB0_7
## %bb.6:
	movl	(%r14), %r15d
	incl	%r15d
LBB0_7:
	cmpl	%ebx, %r15d
	jne	LBB0_8
LBB0_28:
	movl	12(%r14), %edi
	leaq	-48(%rbp), %rdx
	movl	%ebx, %esi
	callq	_IWICBitmapDecoder_GetFrame
	movl	%eax, %r15d
	movl	%eax, %edi
	callq	_FAILED
	testq	%rax, %rax
	jne	LBB0_29
## %bb.30:
	movq	-48(%rbp), %rsi
	xorl	%edx, %edx
	testl	%ebx, %ebx
	sete	%dl
	movq	%r14, %rdi
	callq	_blit_gif_frame
	movl	%eax, %r15d
	movq	-48(%rbp), %rdi
	callq	_IWICBitmapFrameDecode_Release
	movl	%r15d, %edi
	callq	_FAILED
	testq	%rax, %rax
	je	LBB0_31
LBB0_29:
	movl	%r15d, %edi
	callq	_hresult_to_status
	jmp	LBB0_32
LBB0_8:
	xorl	%r13d, %r13d
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	-48(%rbp), %rsi
	xorl	%edx, %edx
	testl	%r15d, %r15d
	sete	%dl
	movq	%r14, %rdi
	callq	_blit_gif_frame
	movl	%eax, %r12d
	movl	%eax, %edi
	callq	_FAILED
	testq	%rax, %rax
	jne	LBB0_2
LBB0_27:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	-48(%rbp), %rdi
	callq	_IWICBitmapFrameDecode_Release
	incl	%r15d
	movl	-52(%rbp), %ebx                 ## 4-byte Reload
	cmpl	%ebx, %r15d
	je	LBB0_28
LBB0_9:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_20 Depth 2
                                        ##       Child Loop BB0_23 Depth 3
	movl	12(%r14), %edi
	movl	%r15d, %esi
	leaq	-48(%rbp), %rdx
	callq	_IWICBitmapDecoder_GetFrame
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_FAILED
	testq	%rax, %rax
	jne	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	-48(%rbp), %rdi
	movq	_GUID_MetadataFormatGCE@GOTPCREL(%rip), %rsi
	leaq	_select_frame_gif.disposalW(%rip), %rdx
	callq	_get_gif_frame_property
	movq	_GIF_DISPOSE_UNSPECIFIED@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	_GIF_DISPOSE_DO_NOT_DISPOSE@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_13
## %bb.14:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	_GIF_DISPOSE_RESTORE_TO_BKGND@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_27
## %bb.15:                              ##   in Loop: Header=BB0_9 Depth=1
	cmpq	$0, -80(%rbp)                   ## 8-byte Folded Reload
	jne	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	%r14, %rdi
	callq	_get_gif_background_color
	movl	%eax, %r13d
	movq	_TRUE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
LBB0_17:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	-48(%rbp), %rdi
	leaq	-68(%rbp), %rsi
	leaq	-64(%rbp), %rdx
	leaq	-60(%rbp), %rcx
	leaq	-56(%rbp), %r8
	callq	_get_gif_frame_rect
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_FAILED
	testq	%rax, %rax
	jne	LBB0_10
## %bb.18:                              ##   in Loop: Header=BB0_9 Depth=1
	movl	-56(%rbp), %ecx
	testl	%ecx, %ecx
	jle	LBB0_27
## %bb.19:                              ##   in Loop: Header=BB0_9 Depth=1
	movl	-64(%rbp), %edx
	movl	%edx, %eax
	jmp	LBB0_20
	.p2align	4, 0x90
LBB0_25:                                ##   in Loop: Header=BB0_20 Depth=2
	movl	-64(%rbp), %edx
	movl	-56(%rbp), %ecx
LBB0_26:                                ##   in Loop: Header=BB0_20 Depth=2
	incl	%eax
	leal	(%rcx,%rdx), %esi
	cmpl	%esi, %eax
	jge	LBB0_27
LBB0_20:                                ##   Parent Loop BB0_9 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_23 Depth 3
	cmpl	(%r14), %eax
	jge	LBB0_27
## %bb.21:                              ##   in Loop: Header=BB0_20 Depth=2
	cmpl	$0, -60(%rbp)
	jle	LBB0_26
## %bb.22:                              ##   in Loop: Header=BB0_20 Depth=2
	movslq	4(%r14), %rdx
	movslq	%eax, %rcx
	imulq	%rdx, %rcx
	addq	16(%r14), %rcx
	movslq	-68(%rbp), %rdx
	.p2align	4, 0x90
LBB0_23:                                ##   Parent Loop BB0_9 Depth=1
                                        ##     Parent Loop BB0_20 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movslq	8(%r14), %rsi
	cmpq	%rsi, %rdx
	jge	LBB0_25
## %bb.24:                              ##   in Loop: Header=BB0_23 Depth=3
	movl	%r13d, (%rcx,%rdx,4)
	incq	%rdx
	movslq	-68(%rbp), %rsi
	movslq	-60(%rbp), %rdi
	addq	%rsi, %rdi
	cmpq	%rdi, %rdx
	jl	LBB0_23
	jmp	LBB0_25
LBB0_10:
	movl	%ebx, %edi
	callq	_hresult_to_status
	jmp	LBB0_32
LBB0_31:
	movl	%ebx, (%r14)
	movq	_Ok@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_32:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
_select_frame_gif.disposalW:            ## @select_frame_gif.disposalW
	.asciz	"Disposal"

	.comm	_FALSE,8,3                      ## @FALSE
	.comm	_GUID_MetadataFormatGCE,4,2     ## @GUID_MetadataFormatGCE
	.comm	_GIF_DISPOSE_RESTORE_TO_BKGND,4,2 ## @GIF_DISPOSE_RESTORE_TO_BKGND
	.comm	_GIF_DISPOSE_RESTORE_TO_PREV,4,2 ## @GIF_DISPOSE_RESTORE_TO_PREV
	.comm	_GIF_DISPOSE_UNSPECIFIED,4,2    ## @GIF_DISPOSE_UNSPECIFIED
	.comm	_GIF_DISPOSE_DO_NOT_DISPOSE,4,2 ## @GIF_DISPOSE_DO_NOT_DISPOSE
	.comm	_TRUE,8,3                       ## @TRUE
	.comm	_Ok,4,2                         ## @Ok
	.no_dead_strip	_select_frame_gif
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function select_frame_gif
_select_frame_gif:                      ; @select_frame_gif
	.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
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _FALSE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
Lloh2:
	ldr	x26, [x8]
	ldr	w1, [x0]
	cmp	w1, w19
	b.ge	LBB0_5
; %bb.1:
	ldr	w0, [x20, #12]
	add	x2, sp, #24
	bl	_IWICBitmapDecoder_GetFrame
	mov	x21, x0
	bl	_FAILED
	cbnz	x0, LBB0_8
; %bb.2:
	ldr	x0, [sp, #24]
Lloh3:
	adrp	x1, _GUID_MetadataFormatGCE@GOTPAGE
Lloh4:
	ldr	x1, [x1, _GUID_MetadataFormatGCE@GOTPAGEOFF]
Lloh5:
	adrp	x2, _select_frame_gif.disposalW@PAGE
Lloh6:
	add	x2, x2, _select_frame_gif.disposalW@PAGEOFF
	bl	_get_gif_frame_property
	mov	x21, x0
	ldr	x0, [sp, #24]
	bl	_IWICBitmapFrameDecode_Release
Lloh7:
	adrp	x8, _GIF_DISPOSE_RESTORE_TO_BKGND@GOTPAGE
Lloh8:
	ldr	x8, [x8, _GIF_DISPOSE_RESTORE_TO_BKGND@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	cmp	w21, w8
	b.ne	LBB0_4
; %bb.3:
	ldr	w21, [x20]
	cmp	w21, w19
	b.ne	LBB0_11
	b	LBB0_6
LBB0_4:
Lloh10:
	adrp	x8, _GIF_DISPOSE_RESTORE_TO_PREV@GOTPAGE
Lloh11:
	ldr	x8, [x8, _GIF_DISPOSE_RESTORE_TO_PREV@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	cmp	w21, w8
	b.ne	LBB0_10
LBB0_5:
	mov	w21, #0
	cmp	w21, w19
	b.ne	LBB0_11
LBB0_6:
	ldr	w0, [x20, #12]
	add	x2, sp, #24
	mov	x1, x19
	bl	_IWICBitmapDecoder_GetFrame
	mov	x21, x0
	bl	_FAILED
	cbnz	x0, LBB0_8
; %bb.7:
	ldr	x1, [sp, #24]
	cmp	w19, #0
	cset	w2, eq
	mov	x0, x20
	bl	_blit_gif_frame
	mov	x21, x0
	ldr	x0, [sp, #24]
	bl	_IWICBitmapFrameDecode_Release
	mov	x0, x21
	bl	_FAILED
	cbz	x0, LBB0_9
LBB0_8:
	mov	x0, x21
	bl	_hresult_to_status
	b	LBB0_30
LBB0_9:
	str	w19, [x20]
Lloh13:
	adrp	x8, _Ok@GOTPAGE
Lloh14:
	ldr	x8, [x8, _Ok@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
	b	LBB0_30
LBB0_10:
	ldr	w8, [x20]
	add	w21, w8, #1
	cmp	w21, w19
	b.eq	LBB0_6
LBB0_11:
	mov	w23, #0
Lloh16:
	adrp	x22, _GUID_MetadataFormatGCE@GOTPAGE
Lloh17:
	ldr	x22, [x22, _GUID_MetadataFormatGCE@GOTPAGEOFF]
Lloh18:
	adrp	x27, _GIF_DISPOSE_UNSPECIFIED@GOTPAGE
Lloh19:
	ldr	x27, [x27, _GIF_DISPOSE_UNSPECIFIED@GOTPAGEOFF]
Lloh20:
	adrp	x24, _select_frame_gif.disposalW@PAGE
Lloh21:
	add	x24, x24, _select_frame_gif.disposalW@PAGEOFF
Lloh22:
	adrp	x28, _GIF_DISPOSE_DO_NOT_DISPOSE@GOTPAGE
Lloh23:
	ldr	x28, [x28, _GIF_DISPOSE_DO_NOT_DISPOSE@GOTPAGEOFF]
	b	LBB0_14
LBB0_12:                                ;   in Loop: Header=BB0_14 Depth=1
	ldr	x1, [sp, #24]
	cmp	w21, #0
	cset	w2, eq
	mov	x0, x20
	bl	_blit_gif_frame
	mov	x25, x0
	bl	_FAILED
	cbnz	x0, LBB0_29
LBB0_13:                                ;   in Loop: Header=BB0_14 Depth=1
	ldr	x0, [sp, #24]
	bl	_IWICBitmapFrameDecode_Release
	add	w21, w21, #1
	cmp	w21, w19
	b.eq	LBB0_6
LBB0_14:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_24 Depth 2
                                        ;       Child Loop BB0_27 Depth 3
	ldr	w0, [x20, #12]
	add	x2, sp, #24
	mov	x1, x21
	bl	_IWICBitmapDecoder_GetFrame
	mov	x25, x0
	bl	_FAILED
	cbnz	x0, LBB0_29
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=1
	ldr	x0, [sp, #24]
	mov	x1, x22
	mov	x2, x24
	bl	_get_gif_frame_property
	ldr	w8, [x27]
	ldr	w9, [x28]
	cmp	w0, w8
	ccmp	w0, w9, #4, ne
	b.eq	LBB0_12
; %bb.16:                               ;   in Loop: Header=BB0_14 Depth=1
Lloh24:
	adrp	x8, _GIF_DISPOSE_RESTORE_TO_BKGND@GOTPAGE
Lloh25:
	ldr	x8, [x8, _GIF_DISPOSE_RESTORE_TO_BKGND@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_13
; %bb.17:                               ;   in Loop: Header=BB0_14 Depth=1
	cbnz	x26, LBB0_19
; %bb.18:                               ;   in Loop: Header=BB0_14 Depth=1
	mov	x0, x20
	bl	_get_gif_background_color
	mov	x23, x0
Lloh27:
	adrp	x8, _TRUE@GOTPAGE
Lloh28:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
Lloh29:
	ldr	x26, [x8]
LBB0_19:                                ;   in Loop: Header=BB0_14 Depth=1
	ldr	x0, [sp, #24]
	add	x1, sp, #20
	add	x2, sp, #16
	add	x3, sp, #12
	add	x4, sp, #8
	bl	_get_gif_frame_rect
	mov	x25, x0
	bl	_FAILED
	cbnz	x0, LBB0_29
; %bb.20:                               ;   in Loop: Header=BB0_14 Depth=1
	ldr	w9, [sp, #8]
	cmp	w9, #1
	b.lt	LBB0_13
; %bb.21:                               ;   in Loop: Header=BB0_14 Depth=1
	ldr	w10, [sp, #16]
	mov	x8, x10
	b	LBB0_24
LBB0_22:                                ;   in Loop: Header=BB0_24 Depth=2
	ldr	w10, [sp, #16]
	ldr	w9, [sp, #8]
LBB0_23:                                ;   in Loop: Header=BB0_24 Depth=2
	add	w8, w8, #1
	add	w11, w9, w10
	cmp	w8, w11
	b.ge	LBB0_13
LBB0_24:                                ;   Parent Loop BB0_14 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_27 Depth 3
	ldr	w11, [x20]
	cmp	w8, w11
	b.ge	LBB0_13
; %bb.25:                               ;   in Loop: Header=BB0_24 Depth=2
	ldr	w11, [sp, #12]
	cmp	w11, #1
	b.lt	LBB0_23
; %bb.26:                               ;   in Loop: Header=BB0_24 Depth=2
	ldr	x9, [x20, #16]
	ldrsw	x10, [x20, #4]
	sxtw	x11, w8
	madd	x9, x10, x11, x9
	ldrsw	x10, [sp, #20]
LBB0_27:                                ;   Parent Loop BB0_14 Depth=1
                                        ;     Parent Loop BB0_24 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	ldrsw	x11, [x20, #8]
	cmp	x10, x11
	b.ge	LBB0_22
; %bb.28:                               ;   in Loop: Header=BB0_27 Depth=3
	str	w23, [x9, x10, lsl #2]
	add	x10, x10, #1
	ldrsw	x11, [sp, #20]
	ldrsw	x12, [sp, #12]
	add	x11, x12, x11
	cmp	x10, x11
	b.lt	LBB0_27
	b	LBB0_22
LBB0_29:
	mov	x0, x25
	bl	_hresult_to_status
LBB0_30:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
_select_frame_gif.disposalW:            ; @select_frame_gif.disposalW
	.asciz	"Disposal"

	.comm	_FALSE,8,3                      ; @FALSE
	.comm	_GUID_MetadataFormatGCE,4,2     ; @GUID_MetadataFormatGCE
	.comm	_GIF_DISPOSE_RESTORE_TO_BKGND,4,2 ; @GIF_DISPOSE_RESTORE_TO_BKGND
	.comm	_GIF_DISPOSE_RESTORE_TO_PREV,4,2 ; @GIF_DISPOSE_RESTORE_TO_PREV
	.comm	_GIF_DISPOSE_UNSPECIFIED,4,2    ; @GIF_DISPOSE_UNSPECIFIED
	.comm	_GIF_DISPOSE_DO_NOT_DISPOSE,4,2 ; @GIF_DISPOSE_DO_NOT_DISPOSE
	.comm	_TRUE,8,3                       ; @TRUE
	.comm	_Ok,4,2                         ; @Ok
	.no_dead_strip	_select_frame_gif
.subsections_via_symbols
