	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sdl2_write_packet
_sdl2_write_packet:                     ## @sdl2_write_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	%r12
	pushq	%rbx
	subq	$96, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	movq	(%rdi), %rax
	movq	8(%rdi), %r12
	movq	(%rax), %rax
	movq	(%rax), %rbx
	leaq	-120(%rbp), %rdi
	callq	_SDL_PollEvent
	testq	%rax, %rax
	je	LBB0_9
## %bb.1:
	movl	-120(%rbp), %eax
	cmpl	$130, %eax
	je	LBB0_7
## %bb.2:
	cmpl	$131, %eax
	je	LBB0_5
## %bb.3:
	cmpl	$151, %eax
	jne	LBB0_9
## %bb.4:
	movl	-104(%rbp), %eax
	andl	$-2, %eax
	cmpl	$152, %eax
	jne	LBB0_9
LBB0_5:
	cmpq	$0, 16(%r12)
	je	LBB0_9
## %bb.6:
	movq	%r15, %rdi
	callq	_sdl2_write_trailer
	movq	_EIO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_AVERROR
	movl	%eax, %r14d
	jmp	LBB0_14
LBB0_7:
	movl	-108(%rbp), %eax
	andl	$-2, %eax
	cmpl	$128, %eax
	jne	LBB0_9
## %bb.8:
	movl	-112(%rbp), %eax
	movl	%eax, 28(%r12)
	movl	-116(%rbp), %eax
	movl	%eax, 24(%r12)
	movq	%r15, %rdi
	callq	_compute_texture_rect
LBB0_9:
	movl	(%r14), %edx
	movl	8(%rbx), %ecx
	movl	(%rbx), %r9d
	movl	4(%rbx), %r8d
	subq	$8, %rsp
	leaq	-80(%rbp), %rdi
	leaq	-96(%rbp), %rsi
	pushq	$1
	callq	_av_image_fill_arrays
	addq	$16, %rsp
	movl	$-132, %eax
	addl	(%r12), %eax
	cmpl	$18, %eax
	ja	LBB0_17
## %bb.10:
	movl	$523260, %ecx                   ## imm = 0x7FBFC
	btl	%eax, %ecx
	jae	LBB0_16
## %bb.11:
	movl	12(%r12), %edi
	movq	-80(%rbp), %rdx
	movl	-96(%rbp), %ecx
	xorl	%esi, %esi
	callq	_SDL_UpdateTexture
LBB0_12:
	movl	%eax, %r14d
LBB0_13:
	movl	4(%r12), %edi
	callq	_SDL_RenderClear
	movl	4(%r12), %edi
	movl	12(%r12), %esi
	leaq	8(%r12), %rcx
	xorl	%edx, %edx
	callq	_SDL_RenderCopy
	movl	4(%r12), %edi
	callq	_SDL_RenderPresent
LBB0_14:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_18
## %bb.15:
	movl	%r14d, %eax
	addq	$96, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	movl	12(%r12), %edi
	movq	-80(%rbp), %rdx
	movq	-72(%rbp), %r8
	movl	-96(%rbp), %ecx
	movl	-92(%rbp), %r9d
	movl	-88(%rbp), %eax
	xorl	%esi, %esi
	pushq	%rax
	pushq	-64(%rbp)
	callq	_SDL_UpdateYUVTexture
	addq	$16, %rsp
	jmp	LBB0_12
LBB0_17:
	movq	_AV_LOG_FATAL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	xorl	%edi, %edi
	callq	_av_log
	movl	$-1, %r14d
	jmp	LBB0_13
LBB0_18:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_EIO,4,2                        ## @EIO
	.comm	_AV_LOG_FATAL,4,2               ## @AV_LOG_FATAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unsupported pixel format\n"

	.no_dead_strip	_sdl2_write_packet
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sdl2_write_packet
_sdl2_write_packet:                     ; @sdl2_write_packet
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	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
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
	ldp	x8, x21, [x0]
	ldr	x8, [x8]
	ldr	x22, [x8]
	mov	x0, sp
	bl	_SDL_PollEvent
	cbz	x0, LBB0_9
; %bb.1:
	ldr	w8, [sp]
	cmp	w8, #130
	b.eq	LBB0_7
; %bb.2:
	cmp	w8, #131
	b.eq	LBB0_5
; %bb.3:
	cmp	w8, #151
	b.ne	LBB0_9
; %bb.4:
	ldr	w8, [sp, #16]
	and	w8, w8, #0xfffffffe
	cmp	w8, #152
	b.ne	LBB0_9
LBB0_5:
	ldr	x8, [x21, #16]
	cbz	x8, LBB0_9
; %bb.6:
	mov	x0, x20
	bl	_sdl2_write_trailer
Lloh3:
	adrp	x8, _EIO@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	bl	_AVERROR
	mov	x19, x0
	b	LBB0_14
LBB0_7:
	ldr	w8, [sp, #12]
	and	w8, w8, #0xfffffffe
	cmp	w8, #128
	b.ne	LBB0_9
; %bb.8:
	ldur	d0, [sp, #4]
	str	d0, [x21, #24]
	mov	x0, x20
	bl	_compute_texture_rect
LBB0_9:
	ldr	w2, [x19]
	ldp	w4, w3, [x22, #4]
	ldr	w5, [x22]
	mov	w19, #1
	add	x0, sp, #40
	add	x1, sp, #24
	mov	w6, #1
	bl	_av_image_fill_arrays
	ldr	w8, [x21]
	sub	w8, w8, #132
	cmp	w8, #18
	b.hi	LBB0_17
; %bb.10:
	lsl	w8, w19, w8
	mov	w9, #64508
	movk	w9, #7, lsl #16
	tst	w8, w9
	b.eq	LBB0_16
; %bb.11:
	ldr	w0, [x21, #12]
	ldr	x2, [sp, #40]
	ldr	w3, [sp, #24]
	mov	x1, #0
	bl	_SDL_UpdateTexture
LBB0_12:
	mov	x19, x0
LBB0_13:
	ldr	w0, [x21, #4]
	bl	_SDL_RenderClear
	ldr	w0, [x21, #4]
	ldr	w1, [x21, #12]
	add	x3, x21, #8
	mov	x2, #0
	bl	_SDL_RenderCopy
	ldr	w0, [x21, #4]
	bl	_SDL_RenderPresent
LBB0_14:
	ldur	x8, [x29, #-40]
Lloh6:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh7:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_18
; %bb.15:
	mov	x0, x19
	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
	add	sp, sp, #128
	ret
LBB0_16:
	ldr	w0, [x21, #12]
	ldp	x2, x4, [sp, #40]
	ldp	w3, w5, [sp, #24]
	ldr	x6, [sp, #56]
	ldr	w7, [sp, #32]
	mov	x1, #0
	bl	_SDL_UpdateYUVTexture
	b	LBB0_12
LBB0_17:
Lloh9:
	adrp	x8, _AV_LOG_FATAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _AV_LOG_FATAL@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
Lloh12:
	adrp	x2, l_.str@PAGE
Lloh13:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, #0
	bl	_av_log
	mov	w19, #-1
	b	LBB0_13
LBB0_18:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_EIO,4,2                        ; @EIO
	.comm	_AV_LOG_FATAL,4,2               ; @AV_LOG_FATAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unsupported pixel format\n"

	.no_dead_strip	_sdl2_write_packet
.subsections_via_symbols
