	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function upload_texture
_upload_texture:                        ## @upload_texture
	.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	$136, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r12
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movl	24(%rsi), %edi
	leaq	-104(%rbp), %rsi
	leaq	-116(%rbp), %rdx
	callq	_get_sdl_pix_fmt_and_blendmode
	movl	-104(%rbp), %esi
	cmpl	$128, %esi
	jne	LBB0_2
## %bb.1:
	movq	_SDL_PIXELFORMAT_ARGB8888@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
LBB0_2:
	movl	16(%rbx), %ecx
	movl	20(%rbx), %edx
	movl	-116(%rbp), %r8d
	movq	%r15, %rdi
	xorl	%r9d, %r9d
	callq	_realloc_texture
	movl	$-1, %r14d
	testq	%rax, %rax
	js	LBB0_25
## %bb.3:
	movl	-104(%rbp), %eax
	cmpl	$129, %eax
	je	LBB0_10
## %bb.4:
	cmpl	$128, %eax
	jne	LBB0_20
## %bb.5:
	movq	(%r12), %rdi
	movl	16(%rbx), %edx
	movl	20(%rbx), %esi
	movl	24(%rbx), %ecx
	movq	_AV_PIX_FMT_BGRA@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	_sws_flags@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movl	%eax, 8(%rsp)
	movl	%r8d, (%rsp)
	movq	$0, 32(%rsp)
	movl	%esi, %r8d
	movl	%edx, %r9d
	callq	_sws_getCachedContext
	movq	%rax, (%r12)
	testq	%rax, %rax
	je	LBB0_8
## %bb.6:
	movq	(%r15), %rdi
	xorl	%r14d, %r14d
	leaq	-80(%rbp), %rdx
	leaq	-96(%rbp), %r13
	xorl	%esi, %esi
	movq	%r13, %rcx
	callq	_SDL_LockTexture
	testl	%eax, %eax
	jne	LBB0_25
## %bb.7:
	movq	(%r12), %rdi
	movq	(%rbx), %rsi
	movq	8(%rbx), %rdx
	movl	16(%rbx), %r8d
	movq	%r13, (%rsp)
	leaq	-80(%rbp), %r9
	xorl	%ecx, %ecx
	callq	_sws_scale
	movq	(%r15), %rdi
	callq	_SDL_UnlockTexture
	jmp	LBB0_25
LBB0_10:
	movq	8(%rbx), %rax
	movl	(%rax), %r12d
	testl	%r12d, %r12d
	jle	LBB0_15
## %bb.11:
	movl	4(%rax), %r9d
	testl	%r9d, %r9d
	jle	LBB0_19
## %bb.12:
	movl	8(%rax), %eax
	testl	%eax, %eax
	jle	LBB0_19
## %bb.13:
	movq	(%r15), %rdi
	movq	(%rbx), %rcx
	movl	(%rcx), %edx
	movl	4(%rcx), %r8d
	movl	8(%rcx), %ecx
	movl	%eax, 8(%rsp)
	movl	%ecx, (%rsp)
	xorl	%esi, %esi
	movl	%r12d, %ecx
	callq	_SDL_UpdateYUVTexture
	jmp	LBB0_24
LBB0_20:
	movq	(%rbx), %rax
	movq	8(%rbx), %rcx
	movl	(%rcx), %ecx
	movq	(%r15), %rdi
	movl	(%rax), %edx
	testl	%ecx, %ecx
	js	LBB0_21
## %bb.22:
	xorl	%esi, %esi
	jmp	LBB0_23
LBB0_8:
	movq	_AV_LOG_FATAL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	jmp	LBB0_9
LBB0_15:
	jns	LBB0_19
## %bb.16:
	movl	4(%rax), %r13d
	testl	%r13d, %r13d
	jns	LBB0_19
## %bb.17:
	cmpl	$0, 8(%rax)
	js	LBB0_18
LBB0_19:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
LBB0_9:
	xorl	%edi, %edi
	callq	_av_log
	jmp	LBB0_25
LBB0_21:
	movl	16(%rbx), %eax
	decl	%eax
	imull	%ecx, %eax
	addl	%edx, %eax
	negl	%ecx
	xorl	%esi, %esi
	movl	%eax, %edx
LBB0_23:
	callq	_SDL_UpdateTexture
LBB0_24:
	movl	%eax, %r14d
LBB0_25:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_27
## %bb.26:
	movl	%r14d, %eax
	addq	$136, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_18:
	movq	(%r15), %rax
	movq	%rax, -128(%rbp)                ## 8-byte Spill
	movq	(%rbx), %rax
	movl	16(%rbx), %edi
	leal	-1(%rdi), %r15d
	imull	%r12d, %r15d
	addl	(%rax), %r15d
	negl	%r12d
	movl	4(%rax), %eax
	movl	%eax, -100(%rbp)                ## 4-byte Spill
                                        ## kill: def $edi killed $edi killed $rdi
	movl	$1, %esi
	callq	_AV_CEIL_RSHIFT
                                        ## kill: def $eax killed $eax def $rax
	leal	-1(%rax), %r14d
	imull	%r13d, %r14d
	addl	-100(%rbp), %r14d               ## 4-byte Folded Reload
	movq	(%rbx), %rax
	movq	8(%rbx), %rcx
	xorl	%edx, %edx
	subl	4(%rcx), %edx
	movl	%edx, -100(%rbp)                ## 4-byte Spill
	xorl	%r13d, %r13d
	movl	8(%rax), %eax
	movl	%eax, -112(%rbp)                ## 4-byte Spill
	movl	8(%rcx), %eax
	movl	%eax, -108(%rbp)                ## 4-byte Spill
	movl	16(%rbx), %edi
	movl	$1, %esi
	callq	_AV_CEIL_RSHIFT
	decl	%eax
	imull	-108(%rbp), %eax                ## 4-byte Folded Reload
	addl	-112(%rbp), %eax                ## 4-byte Folded Reload
	movq	8(%rbx), %rcx
	subl	8(%rcx), %r13d
	movl	%r13d, 8(%rsp)
	movl	%eax, (%rsp)
	movq	-128(%rbp), %rdi                ## 8-byte Reload
	xorl	%esi, %esi
	movl	%r15d, %edx
	movl	%r12d, %ecx
	movl	%r14d, %r8d
	movl	-100(%rbp), %r9d                ## 4-byte Reload
	callq	_SDL_UpdateYUVTexture
	jmp	LBB0_24
LBB0_27:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_SDL_PIXELFORMAT_ARGB8888,4,2   ## @SDL_PIXELFORMAT_ARGB8888
	.comm	_AV_PIX_FMT_BGRA,4,2            ## @AV_PIX_FMT_BGRA
	.comm	_sws_flags,4,2                  ## @sws_flags
	.comm	_AV_LOG_FATAL,4,2               ## @AV_LOG_FATAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Cannot initialize the conversion context\n"

	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
L_.str.1:                               ## @.str.1
	.asciz	"Mixed negative and positive linesizes are not supported.\n"

	.no_dead_strip	_upload_texture
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function upload_texture
_upload_texture:                        ; @upload_texture
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #176
	.cfi_def_cfa_offset 176
	stp	x26, x25, [sp, #96]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #112]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #128]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #144]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #160]            ; 16-byte Folded Spill
	add	x29, sp, #160
	.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	x21, x2
	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, #-72]
	ldr	w0, [x1, #24]
	add	x1, sp, #36
	add	x2, sp, #32
	bl	_get_sdl_pix_fmt_and_blendmode
	ldp	w4, w8, [sp, #32]
Lloh3:
	adrp	x9, _SDL_PIXELFORMAT_ARGB8888@GOTPAGE
Lloh4:
	ldr	x9, [x9, _SDL_PIXELFORMAT_ARGB8888@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w8, #128
	csel	w1, w9, w8, eq
	ldp	w3, w2, [x19, #16]
	mov	x0, x20
	mov	w5, #0
	bl	_realloc_texture
	tbnz	x0, #63, LBB0_20
; %bb.1:
	ldr	w8, [sp, #36]
	cmp	w8, #129
	b.eq	LBB0_7
; %bb.2:
	cmp	w8, #128
	b.ne	LBB0_11
; %bb.3:
	ldr	x0, [x21]
	ldp	w2, w1, [x19, #16]
	ldr	w3, [x19, #24]
Lloh6:
	adrp	x8, _AV_PIX_FMT_BGRA@GOTPAGE
Lloh7:
	ldr	x8, [x8, _AV_PIX_FMT_BGRA@GOTPAGEOFF]
Lloh8:
	ldr	w6, [x8]
Lloh9:
	adrp	x8, _sws_flags@GOTPAGE
Lloh10:
	ldr	x8, [x8, _sws_flags@GOTPAGEOFF]
Lloh11:
	ldr	w7, [x8]
	stp	xzr, xzr, [sp]
	str	xzr, [sp, #16]
	mov	x4, x1
	mov	x5, x2
	bl	_sws_getCachedContext
	str	x0, [x21]
	cbz	x0, LBB0_14
; %bb.4:
	ldr	x0, [x20]
	add	x2, sp, #56
	add	x3, sp, #40
	mov	x1, #0
	bl	_SDL_LockTexture
	cbnz	w0, LBB0_6
; %bb.5:
	ldr	x0, [x21]
	ldp	x1, x2, [x19]
	ldr	w4, [x19, #16]
	add	x5, sp, #56
	add	x6, sp, #40
	mov	w3, #0
	bl	_sws_scale
	ldr	x0, [x20]
	bl	_SDL_UnlockTexture
LBB0_6:
	mov	w0, #0
	b	LBB0_21
LBB0_7:
	ldr	x8, [x19, #8]
	ldr	w3, [x8]
	cmp	w3, #1
	b.lt	LBB0_15
; %bb.8:
	ldr	w5, [x8, #4]
	cmp	w5, #1
	b.lt	LBB0_18
; %bb.9:
	ldr	w7, [x8, #8]
	cmp	w7, #1
	b.lt	LBB0_18
; %bb.10:
	ldr	x0, [x20]
	ldr	x8, [x19]
	ldp	w2, w4, [x8]
	ldr	w6, [x8, #8]
	mov	x1, #0
	bl	_SDL_UpdateYUVTexture
	b	LBB0_21
LBB0_11:
	ldp	x9, x8, [x19]
	ldr	w3, [x8]
	ldr	x0, [x20]
	ldr	w2, [x9]
	tbz	w3, #31, LBB0_13
; %bb.12:
	ldr	w8, [x19, #16]
	sub	w8, w8, #1
	madd	w2, w8, w3, w2
	neg	w3, w3
LBB0_13:
	mov	x1, #0
	bl	_SDL_UpdateTexture
	b	LBB0_21
LBB0_14:
Lloh12:
	adrp	x8, _AV_LOG_FATAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _AV_LOG_FATAL@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
Lloh15:
	adrp	x2, l_.str@PAGE
Lloh16:
	add	x2, x2, l_.str@PAGEOFF
	b	LBB0_19
LBB0_15:
	tbz	w3, #31, LBB0_18
; %bb.16:
	ldr	w23, [x8, #4]
	tbz	w23, #31, LBB0_18
; %bb.17:
	ldr	w8, [x8, #8]
	tbnz	w8, #31, LBB0_23
LBB0_18:
Lloh17:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh18:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
Lloh20:
	adrp	x2, l_.str.1@PAGE
Lloh21:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, #0
LBB0_19:
	bl	_av_log
LBB0_20:
	mov	w0, #-1
LBB0_21:
	ldur	x8, [x29, #-72]
Lloh22:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh23:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh24:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_24
; %bb.22:
	ldp	x29, x30, [sp, #160]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #144]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #128]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #112]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #96]             ; 16-byte Folded Reload
	add	sp, sp, #176
	ret
LBB0_23:
	ldr	x20, [x20]
	ldr	x8, [x19]
	ldr	w0, [x19, #16]
	sub	w9, w0, #1
	ldp	w10, w24, [x8]
	madd	w21, w9, w3, w10
	neg	w22, w3
	mov	w1, #1
	bl	_AV_CEIL_RSHIFT
	sub	w8, w0, #1
	madd	w23, w8, w23, w24
	ldp	x9, x8, [x19]
	ldp	w10, w25, [x8, #4]
	neg	w24, w10
	ldr	w26, [x9, #8]
	ldr	w0, [x19, #16]
	mov	w1, #1
	bl	_AV_CEIL_RSHIFT
	sub	w8, w0, #1
	madd	w6, w8, w25, w26
	ldr	x8, [x19, #8]
	ldr	w8, [x8, #8]
	neg	w7, w8
	mov	x0, x20
	mov	x1, #0
	mov	x2, x21
	mov	x3, x22
	mov	x4, x23
	mov	x5, x24
	bl	_SDL_UpdateYUVTexture
	b	LBB0_21
LBB0_24:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_SDL_PIXELFORMAT_ARGB8888,4,2   ; @SDL_PIXELFORMAT_ARGB8888
	.comm	_AV_PIX_FMT_BGRA,4,2            ; @AV_PIX_FMT_BGRA
	.comm	_sws_flags,4,2                  ; @sws_flags
	.comm	_AV_LOG_FATAL,4,2               ; @AV_LOG_FATAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Cannot initialize the conversion context\n"

	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
l_.str.1:                               ; @.str.1
	.asciz	"Mixed negative and positive linesizes are not supported.\n"

	.no_dead_strip	_upload_texture
.subsections_via_symbols
