	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function adv748x_afe_querystd
_adv748x_afe_querystd:                  ## @adv748x_afe_querystd
	.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	%rsi, %r14
	callq	_adv748x_sd_to_afe
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_adv748x_afe_to_state
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_mutex_lock
	cmpq	$0, 8(%rbx)
	je	LBB0_2
## %bb.1:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_4
LBB0_2:
	movq	_ADV748X_AFE_STD_AD_PAL_BG_NTSC_J_SECAM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_adv748x_afe_set_video_standard
	movl	$100, %edi
	callq	_msleep
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movq	%r14, %rdx
	callq	_adv748x_afe_status
	movl	%eax, %r14d
	movl	(%rbx), %edi
	callq	_adv748x_afe_std
	testl	%eax, %eax
	js	LBB0_4
## %bb.3:
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_adv748x_afe_set_video_standard
LBB0_4:
	movq	%r15, %rdi
	callq	_mutex_unlock
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_ADV748X_AFE_STD_AD_PAL_BG_NTSC_J_SECAM,4,2 ## @ADV748X_AFE_STD_AD_PAL_BG_NTSC_J_SECAM
	.no_dead_strip	_adv748x_afe_querystd
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function adv748x_afe_querystd
_adv748x_afe_querystd:                  ; @adv748x_afe_querystd
	.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	x20, x1
	bl	_adv748x_sd_to_afe
	mov	x21, x0
	bl	_adv748x_afe_to_state
	mov	x19, x0
	bl	_mutex_lock
	ldr	x8, [x21, #8]
	cbz	x8, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EBUSY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_4
LBB0_2:
Lloh3:
	adrp	x8, _ADV748X_AFE_STD_AD_PAL_BG_NTSC_J_SECAM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ADV748X_AFE_STD_AD_PAL_BG_NTSC_J_SECAM@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_adv748x_afe_set_video_standard
	mov	w0, #100
	bl	_msleep
	mov	x0, x21
	mov	x1, #0
	mov	x2, x20
	bl	_adv748x_afe_status
	mov	x20, x0
	ldr	w0, [x21]
	bl	_adv748x_afe_std
	tbnz	w0, #31, LBB0_4
; %bb.3:
	mov	x1, x0
	mov	x0, x19
	bl	_adv748x_afe_set_video_standard
LBB0_4:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x20
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_ADV748X_AFE_STD_AD_PAL_BG_NTSC_J_SECAM,4,2 ; @ADV748X_AFE_STD_AD_PAL_BG_NTSC_J_SECAM
	.no_dead_strip	_adv748x_afe_querystd
.subsections_via_symbols
