	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function get_attachment
_get_attachment:                        ## @get_attachment
	.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	$2072, %rsp                     ## imm = 0x818
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, -2100(%rbp)               ## 4-byte Spill
	movq	%rsi, %r13
	movq	%rdi, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	%rsi, %rdi
	callq	_avio_tell
	movq	%rax, %r15
	movq	_INT_MAX@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	leaq	-1072(%rbp), %rbx
	movq	%r13, %rdi
	movq	%rbx, %rdx
	movl	$1024, %ecx                     ## imm = 0x400
	callq	_avio_get_str16le
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_strcmp
	testq	%rax, %rax
	je	LBB0_1
LBB0_5:
	movslq	-2100(%rbp), %rax               ## 4-byte Folded Reload
	addq	%rax, %r15
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	_avio_seek
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_7
## %bb.6:
	addq	$2072, %rsp                     ## imm = 0x818
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	%r13, %rdi
	callq	_avio_r8
	movl	(%r14), %esi
	leaq	-2096(%rbp), %rdx
	movq	%r13, %rdi
	movl	$1024, %ecx                     ## imm = 0x400
	callq	_avio_get_str16le
	movq	%r13, %rdi
	callq	_avio_rl32
	testl	%eax, %eax
	je	LBB0_5
## %bb.2:
	movl	%eax, %ebx
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_avformat_new_stream
	testq	%rax, %rax
	je	LBB0_5
## %bb.3:
	movq	%rax, %r12
	leaq	32(%rax), %rdi
	leaq	L_.str.1(%rip), %rsi
	leaq	-2096(%rbp), %rdx
	xorl	%ecx, %ecx
	callq	_av_dict_set
	movq	_AVMEDIA_TYPE_VIDEO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	24(%r12), %rcx
	movl	%eax, 4(%rcx)
	movq	_AV_CODEC_ID_MJPEG@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rcx)
	movl	$-1, (%r12)
	movq	%r12, %rsi
	addq	$8, %rsi
	movq	%r13, %rdi
	movl	%ebx, %edx
	callq	_av_get_packet
	testl	%eax, %eax
	js	LBB0_5
## %bb.4:
	movl	16(%r12), %eax
	movl	%eax, 12(%r12)
	movq	_AV_PKT_FLAG_KEY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 8(%r12)
	movq	_AV_DISPOSITION_ATTACHED_PIC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 4(%r12)
	jmp	LBB0_5
LBB0_7:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_INT_MAX,4,2                    ## @INT_MAX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"image/jpeg"

L_.str.1:                               ## @.str.1
	.asciz	"title"

	.comm	_AVMEDIA_TYPE_VIDEO,4,2         ## @AVMEDIA_TYPE_VIDEO
	.comm	_AV_CODEC_ID_MJPEG,4,2          ## @AV_CODEC_ID_MJPEG
	.comm	_AV_PKT_FLAG_KEY,4,2            ## @AV_PKT_FLAG_KEY
	.comm	_AV_DISPOSITION_ATTACHED_PIC,4,2 ## @AV_DISPOSITION_ATTACHED_PIC
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
	.no_dead_strip	_get_attachment
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function get_attachment
_get_attachment:                        ; @get_attachment
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	sub	sp, sp, #2064
	mov	x20, x2
	mov	x19, x1
	mov	x22, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
	mov	x0, x1
	bl	_avio_tell
	mov	x21, x0
Lloh3:
	adrp	x23, _INT_MAX@GOTPAGE
Lloh4:
	ldr	x23, [x23, _INT_MAX@GOTPAGEOFF]
	ldr	w1, [x23]
	add	x2, sp, #1032
	mov	x0, x19
	mov	w3, #1024
	bl	_avio_get_str16le
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	add	x0, sp, #1032
	bl	_strcmp
	cbz	x0, LBB0_3
LBB0_1:
	add	x1, x21, w20, sxtw
Lloh7:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh8:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh9:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_avio_seek
	ldur	x8, [x29, #-56]
Lloh10:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh11:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_7
; %bb.2:
	add	sp, sp, #2064
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_3:
	mov	x0, x19
	bl	_avio_r8
	ldr	w1, [x23]
	add	x2, sp, #8
	mov	x0, x19
	mov	w3, #1024
	bl	_avio_get_str16le
	mov	x0, x19
	bl	_avio_rl32
	cbz	w0, LBB0_1
; %bb.4:
	mov	x23, x0
	mov	x0, x22
	mov	x1, #0
	bl	_avformat_new_stream
	cbz	x0, LBB0_1
; %bb.5:
	mov	x22, x0
	add	x0, x0, #32
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
	add	x2, sp, #8
	mov	w3, #0
	bl	_av_dict_set
Lloh15:
	adrp	x8, _AVMEDIA_TYPE_VIDEO@GOTPAGE
Lloh16:
	ldr	x8, [x8, _AVMEDIA_TYPE_VIDEO@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	ldr	x9, [x22, #24]
Lloh18:
	adrp	x10, _AV_CODEC_ID_MJPEG@GOTPAGE
Lloh19:
	ldr	x10, [x10, _AV_CODEC_ID_MJPEG@GOTPAGEOFF]
Lloh20:
	ldr	w10, [x10]
	stp	w10, w8, [x9]
	mov	w8, #-1
	str	w8, [x22]
	add	x1, x22, #8
	mov	x0, x19
	mov	x2, x23
	bl	_av_get_packet
	tbnz	w0, #31, LBB0_1
; %bb.6:
	ldr	w8, [x22, #16]
	str	w8, [x22, #12]
Lloh21:
	adrp	x8, _AV_PKT_FLAG_KEY@GOTPAGE
Lloh22:
	ldr	x8, [x8, _AV_PKT_FLAG_KEY@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	ldp	w10, w9, [x22, #4]
	orr	w8, w9, w8
Lloh24:
	adrp	x9, _AV_DISPOSITION_ATTACHED_PIC@GOTPAGE
Lloh25:
	ldr	x9, [x9, _AV_DISPOSITION_ATTACHED_PIC@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	orr	w9, w10, w9
	stp	w9, w8, [x22, #4]
	b	LBB0_1
LBB0_7:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_INT_MAX,4,2                    ; @INT_MAX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"image/jpeg"

l_.str.1:                               ; @.str.1
	.asciz	"title"

	.comm	_AVMEDIA_TYPE_VIDEO,4,2         ; @AVMEDIA_TYPE_VIDEO
	.comm	_AV_CODEC_ID_MJPEG,4,2          ; @AV_CODEC_ID_MJPEG
	.comm	_AV_PKT_FLAG_KEY,4,2            ; @AV_PKT_FLAG_KEY
	.comm	_AV_DISPOSITION_ATTACHED_PIC,4,2 ; @AV_DISPOSITION_ATTACHED_PIC
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
	.no_dead_strip	_get_attachment
.subsections_via_symbols
