	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sdl_port_set_format
_sdl_port_set_format:                   ## @sdl_port_set_format
	.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
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	16(%rdi), %rax
	movq	(%rax), %rax
	movq	(%rax), %rbx
	movq	%rbx, %rdi
	callq	_mmal_sdl_create_surface
	movq	_MMAL_SUCCESS@GOTPCREL(%rip), %r15
	cmpl	(%r15), %eax
	jne	LBB0_11
## %bb.1:
	movq	8(%r14), %rcx
	movq	(%rcx), %rdx
	movq	_MMAL_ENCODING_I420@GOTPCREL(%rip), %rsi
	cmpq	(%rsi), %rdx
	jne	LBB0_8
## %bb.2:
	movq	8(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_6
## %bb.3:
	movl	(%rbx), %edx
	movq	8(%rcx), %rcx
	cmpl	(%rcx), %edx
	jne	LBB0_5
## %bb.4:
	movl	4(%rbx), %edx
	cmpl	4(%rcx), %edx
	je	LBB0_11
LBB0_5:
	callq	_SDL_FreeYUVOverlay
	movq	8(%r14), %rcx
LBB0_6:
	movq	8(%rcx), %rax
	movl	(%rax), %edi
	movl	4(%rax), %esi
	movq	_SDL_YV12_OVERLAY@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	16(%rbx), %ecx
	callq	_SDL_CreateYUVOverlay
	movq	%rax, 8(%rbx)
	testq	%rax, %rax
	je	LBB0_9
## %bb.7:
	movq	8(%r14), %rax
	movq	8(%rax), %rax
	movl	(%rax), %ecx
	movl	%ecx, (%rbx)
	movl	4(%rax), %eax
	movl	%eax, 4(%rbx)
	imull	%eax, %ecx
	leal	(%rcx,%rcx,2), %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%eax, %ecx
	sarl	%ecx
	movl	%ecx, (%r14)
	movl	(%r15), %eax
	jmp	LBB0_11
LBB0_8:
	movq	_MMAL_ENOSYS@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_9:
	leaq	L_.str(%rip), %rdi
	callq	_LOG_ERROR
	movq	_MMAL_ENOSPC@GOTPCREL(%rip), %rax
LBB0_10:
	movl	(%rax), %eax
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MMAL_SUCCESS,4,2               ## @MMAL_SUCCESS
	.comm	_MMAL_ENCODING_I420,8,3         ## @MMAL_ENCODING_I420
	.comm	_MMAL_ENOSYS,4,2                ## @MMAL_ENOSYS
	.comm	_SDL_YV12_OVERLAY,4,2           ## @SDL_YV12_OVERLAY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"cannot create SDL overlay"

	.comm	_MMAL_ENOSPC,4,2                ## @MMAL_ENOSPC
	.no_dead_strip	_sdl_port_set_format
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sdl_port_set_format
_sdl_port_set_format:                   ; @sdl_port_set_format
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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, x0
	ldr	x8, [x0, #16]
	ldr	x8, [x8]
	ldr	x20, [x8]
	mov	x0, x20
	bl	_mmal_sdl_create_surface
Lloh0:
	adrp	x21, _MMAL_SUCCESS@GOTPAGE
Lloh1:
	ldr	x21, [x21, _MMAL_SUCCESS@GOTPAGEOFF]
	ldr	w8, [x21]
	cmp	w0, w8
	b.ne	LBB0_11
; %bb.1:
	ldr	x9, [x19, #8]
	ldr	x8, [x9]
Lloh2:
	adrp	x10, _MMAL_ENCODING_I420@GOTPAGE
Lloh3:
	ldr	x10, [x10, _MMAL_ENCODING_I420@GOTPAGEOFF]
Lloh4:
	ldr	x10, [x10]
	cmp	x8, x10
	b.ne	LBB0_8
; %bb.2:
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_6
; %bb.3:
	ldr	w10, [x20]
	ldr	x9, [x9, #8]
	ldr	w11, [x9]
	cmp	w10, w11
	b.ne	LBB0_5
; %bb.4:
	ldr	w10, [x20, #4]
	ldr	w9, [x9, #4]
	cmp	w10, w9
	b.eq	LBB0_11
LBB0_5:
	mov	x0, x8
	bl	_SDL_FreeYUVOverlay
	ldr	x9, [x19, #8]
LBB0_6:
	ldr	x8, [x9, #8]
	ldp	w0, w1, [x8]
Lloh5:
	adrp	x8, _SDL_YV12_OVERLAY@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SDL_YV12_OVERLAY@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	ldr	w3, [x20, #16]
	bl	_SDL_CreateYUVOverlay
	str	x0, [x20, #8]
	cbz	x0, LBB0_9
; %bb.7:
	ldr	x8, [x19, #8]
	ldr	x8, [x8, #8]
	ldp	w9, w8, [x8]
	stp	w9, w8, [x20]
	mul	w8, w9, w8
	add	w8, w8, w8, lsl #1
	cmp	w8, #0
	cinc	w8, w8, lt
	asr	w8, w8, #1
	str	w8, [x19]
	ldr	w0, [x21]
	b	LBB0_11
LBB0_8:
Lloh8:
	adrp	x8, _MMAL_ENOSYS@GOTPAGE
Lloh9:
	ldr	x8, [x8, _MMAL_ENOSYS@GOTPAGEOFF]
	b	LBB0_10
LBB0_9:
Lloh10:
	adrp	x0, l_.str@PAGE
Lloh11:
	add	x0, x0, l_.str@PAGEOFF
	bl	_LOG_ERROR
Lloh12:
	adrp	x8, _MMAL_ENOSPC@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MMAL_ENOSPC@GOTPAGEOFF]
LBB0_10:
	ldr	w0, [x8]
LBB0_11:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_MMAL_SUCCESS,4,2               ; @MMAL_SUCCESS
	.comm	_MMAL_ENCODING_I420,8,3         ; @MMAL_ENCODING_I420
	.comm	_MMAL_ENOSYS,4,2                ; @MMAL_ENOSYS
	.comm	_SDL_YV12_OVERLAY,4,2           ; @SDL_YV12_OVERLAY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"cannot create SDL overlay"

	.comm	_MMAL_ENOSPC,4,2                ; @MMAL_ENOSPC
	.no_dead_strip	_sdl_port_set_format
.subsections_via_symbols
