	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function saa7134_enum_input
_saa7134_enum_input:                    ## @saa7134_enum_input
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	(%rdx), %ebx
	movq	_SAA7134_INPUT_MAX@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jae	LBB0_1
## %bb.2:
	movq	%rdx, %r14
	movq	(%rsi), %r15
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_card_in
	testq	%rdx, %rdx
	je	LBB0_1
## %bb.3:
	movl	%ebx, (%r14)
	movq	_V4L2_INPUT_TYPE_CAMERA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%r14)
	movl	20(%r14), %r12d
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_card_in
	movl	%r12d, %edi
	movq	%rdx, %rsi
	callq	_strcpy
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_card_in
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	_V4L2_INPUT_TYPE_TUNER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%r14)
LBB0_5:
	movl	$1, 4(%r14)
	cmpl	(%r15), %ebx
	jne	LBB0_12
## %bb.6:
	movq	_SAA7134_STATUS_VIDEO1@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_saa_readb
	movl	%eax, %ebx
	movq	_SAA7134_STATUS_VIDEO2@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_saa_readb
	testb	$64, %bl
	jne	LBB0_7
## %bb.8:
	testb	$64, %al
	jne	LBB0_9
LBB0_10:
	testb	$14, %al
	je	LBB0_12
LBB0_11:
	movq	_V4L2_IN_ST_MACROVISION@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 12(%r14)
LBB0_12:
	movq	_SAA7134_NORMS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%r14)
	xorl	%eax, %eax
	jmp	LBB0_13
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_13:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	_V4L2_IN_ST_NO_H_LOCK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	%ecx, 12(%r14)
	testb	$64, %al
	je	LBB0_10
LBB0_9:
	movq	_V4L2_IN_ST_NO_SYNC@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	%ecx, 12(%r14)
	testb	$14, %al
	jne	LBB0_11
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_SAA7134_INPUT_MAX,4,2          ## @SAA7134_INPUT_MAX
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_V4L2_INPUT_TYPE_CAMERA,4,2     ## @V4L2_INPUT_TYPE_CAMERA
	.comm	_V4L2_INPUT_TYPE_TUNER,4,2      ## @V4L2_INPUT_TYPE_TUNER
	.comm	_SAA7134_STATUS_VIDEO1,4,2      ## @SAA7134_STATUS_VIDEO1
	.comm	_SAA7134_STATUS_VIDEO2,4,2      ## @SAA7134_STATUS_VIDEO2
	.comm	_V4L2_IN_ST_NO_H_LOCK,4,2       ## @V4L2_IN_ST_NO_H_LOCK
	.comm	_V4L2_IN_ST_NO_SYNC,4,2         ## @V4L2_IN_ST_NO_SYNC
	.comm	_V4L2_IN_ST_MACROVISION,4,2     ## @V4L2_IN_ST_MACROVISION
	.comm	_SAA7134_NORMS,4,2              ## @SAA7134_NORMS
	.no_dead_strip	_saa7134_enum_input
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function saa7134_enum_input
_saa7134_enum_input:                    ; @saa7134_enum_input
	.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
	ldr	w20, [x2]
Lloh0:
	adrp	x8, _SAA7134_INPUT_MAX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SAA7134_INPUT_MAX@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w20, w8
	b.hs	LBB0_10
; %bb.1:
	mov	x19, x2
	ldr	x21, [x1]
	mov	x0, x21
	mov	x1, x20
	bl	_card_in
	cbz	x1, LBB0_10
; %bb.2:
	str	w20, [x19]
Lloh3:
	adrp	x8, _V4L2_INPUT_TYPE_CAMERA@GOTPAGE
Lloh4:
	ldr	x8, [x8, _V4L2_INPUT_TYPE_CAMERA@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [x19, #16]
	ldr	w22, [x19, #20]
	mov	x0, x21
	mov	x1, x20
	bl	_card_in
	mov	x0, x22
	bl	_strcpy
	mov	x0, x21
	mov	x1, x20
	bl	_card_in
	cbz	x0, LBB0_4
; %bb.3:
Lloh6:
	adrp	x8, _V4L2_INPUT_TYPE_TUNER@GOTPAGE
Lloh7:
	ldr	x8, [x8, _V4L2_INPUT_TYPE_TUNER@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	str	w8, [x19, #16]
LBB0_4:
	mov	w8, #1
	str	w8, [x19, #4]
	ldr	w8, [x21]
	cmp	w20, w8
	b.ne	LBB0_9
; %bb.5:
Lloh9:
	adrp	x8, _SAA7134_STATUS_VIDEO1@GOTPAGE
Lloh10:
	ldr	x8, [x8, _SAA7134_STATUS_VIDEO1@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	bl	_saa_readb
	mov	x20, x0
Lloh12:
	adrp	x8, _SAA7134_STATUS_VIDEO2@GOTPAGE
Lloh13:
	ldr	x8, [x8, _SAA7134_STATUS_VIDEO2@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	bl	_saa_readb
	tbnz	w20, #6, LBB0_12
; %bb.6:
	tbnz	w0, #6, LBB0_13
LBB0_7:
	tst	w0, #0xe
	b.eq	LBB0_9
LBB0_8:
Lloh15:
	adrp	x8, _V4L2_IN_ST_MACROVISION@GOTPAGE
Lloh16:
	ldr	x8, [x8, _V4L2_IN_ST_MACROVISION@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	ldr	w9, [x19, #12]
	orr	w8, w9, w8
	str	w8, [x19, #12]
LBB0_9:
	mov	w0, #0
Lloh18:
	adrp	x8, _SAA7134_NORMS@GOTPAGE
Lloh19:
	ldr	x8, [x8, _SAA7134_NORMS@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	str	w8, [x19, #8]
	b	LBB0_11
LBB0_10:
Lloh21:
	adrp	x8, _EINVAL@GOTPAGE
Lloh22:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	neg	w0, w8
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
LBB0_12:
Lloh24:
	adrp	x8, _V4L2_IN_ST_NO_H_LOCK@GOTPAGE
Lloh25:
	ldr	x8, [x8, _V4L2_IN_ST_NO_H_LOCK@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	ldr	w9, [x19, #12]
	orr	w8, w9, w8
	str	w8, [x19, #12]
	tbz	w0, #6, LBB0_7
LBB0_13:
Lloh27:
	adrp	x8, _V4L2_IN_ST_NO_SYNC@GOTPAGE
Lloh28:
	ldr	x8, [x8, _V4L2_IN_ST_NO_SYNC@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	ldr	w9, [x19, #12]
	orr	w8, w9, w8
	str	w8, [x19, #12]
	tst	w0, #0xe
	b.ne	LBB0_8
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_SAA7134_INPUT_MAX,4,2          ; @SAA7134_INPUT_MAX
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_V4L2_INPUT_TYPE_CAMERA,4,2     ; @V4L2_INPUT_TYPE_CAMERA
	.comm	_V4L2_INPUT_TYPE_TUNER,4,2      ; @V4L2_INPUT_TYPE_TUNER
	.comm	_SAA7134_STATUS_VIDEO1,4,2      ; @SAA7134_STATUS_VIDEO1
	.comm	_SAA7134_STATUS_VIDEO2,4,2      ; @SAA7134_STATUS_VIDEO2
	.comm	_V4L2_IN_ST_NO_H_LOCK,4,2       ; @V4L2_IN_ST_NO_H_LOCK
	.comm	_V4L2_IN_ST_NO_SYNC,4,2         ; @V4L2_IN_ST_NO_SYNC
	.comm	_V4L2_IN_ST_MACROVISION,4,2     ; @V4L2_IN_ST_MACROVISION
	.comm	_SAA7134_NORMS,4,2              ; @SAA7134_NORMS
	.no_dead_strip	_saa7134_enum_input
.subsections_via_symbols
