	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ivtvfb_init_card
_ivtvfb_init_card:                      ## @ivtvfb_init_card
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	cmpq	$0, 24(%rdi)
	je	LBB0_2
## %bb.1:
	movq	_ivtvfb_card_id@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_IVTVFB_ERR
	movq	_EBUSY@GOTPCREL(%rip), %rax
LBB0_7:
	subl	(%rax), %ebx
	jmp	LBB0_8
LBB0_2:
	movq	%rdi, %r14
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movq	___GFP_NOWARN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movl	$4, %edi
	callq	_kzalloc
	movq	%rax, 24(%r14)
	testq	%rax, %rax
	je	LBB0_6
## %bb.3:
	movq	%r14, %rdi
	callq	_ivtvfb_init_io
	testl	%eax, %eax
	jne	LBB0_5
## %bb.4:
	movq	%r14, %rdi
	callq	_ivtvfb_init_vidmode
	testl	%eax, %eax
	je	LBB0_9
LBB0_5:
	movl	%eax, %ebx
	movq	%r14, %rdi
	callq	_ivtvfb_release_buffers
LBB0_8:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_6:
	leaq	L_.str.1(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_IVTVFB_ERR
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_9:
	movq	24(%r14), %rdi
	callq	_register_framebuffer
	testq	%rax, %rax
	js	LBB0_11
## %bb.10:
	movq	24(%r14), %rdi
	movl	4(%rdi), %eax
	movl	%eax, 32(%r14)
	callq	_ivtvfb_set_par
	xorl	%ebx, %ebx
	xorl	%edi, %edi
	movl	$10800, %esi                    ## imm = 0x2A30
	callq	_write_reg
	xorl	%edi, %edi
	movl	$10804, %esi                    ## imm = 0x2A34
	callq	_write_reg
	movq	_FB_BLANK_UNBLANK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	24(%r14), %rsi
	callq	_ivtvfb_blank
	movq	_ivtvfb_restore@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%r14)
	movq	%r14, %rdi
	callq	_ivtv_udma_alloc
	movq	_V4L2_CAP_VIDEO_OUTPUT_OVERLAY@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	8(%r14), %rdx
	movq	_IVTV_DEC_STREAM_TYPE_YUV@GOTPCREL(%rip), %rsi
	movq	(%rsi), %rsi
	orl	%ecx, (%rdx,%rsi,4)
	movl	(%rax), %ecx
	movq	_IVTV_DEC_STREAM_TYPE_MPG@GOTPCREL(%rip), %rsi
	movq	(%rsi), %rsi
	orl	%ecx, (%rdx,%rsi,4)
	movl	(%rax), %eax
	orl	%eax, (%r14)
	jmp	LBB0_8
LBB0_11:
	movq	%r14, %rdi
	callq	_ivtvfb_release_buffers
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Card %d already initialised\n"

	.comm	_ivtvfb_card_id,4,2             ## @ivtvfb_card_id
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	___GFP_NOWARN,4,2               ## @__GFP_NOWARN
L_.str.1:                               ## @.str.1
	.asciz	"Failed to allocate memory for osd_info\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_FB_BLANK_UNBLANK,4,2           ## @FB_BLANK_UNBLANK
	.comm	_ivtvfb_restore,4,2             ## @ivtvfb_restore
	.comm	_V4L2_CAP_VIDEO_OUTPUT_OVERLAY,4,2 ## @V4L2_CAP_VIDEO_OUTPUT_OVERLAY
	.comm	_IVTV_DEC_STREAM_TYPE_YUV,8,3   ## @IVTV_DEC_STREAM_TYPE_YUV
	.comm	_IVTV_DEC_STREAM_TYPE_MPG,8,3   ## @IVTV_DEC_STREAM_TYPE_MPG
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_ivtvfb_force_pat,8,3           ## @ivtvfb_force_pat
	.no_dead_strip	_ivtvfb_init_card
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ivtvfb_init_card
_ivtvfb_init_card:                      ; @ivtvfb_init_card
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	ldr	x8, [x0, #24]
	cbz	x8, LBB0_3
; %bb.1:
Lloh0:
	adrp	x8, _ivtvfb_card_id@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ivtvfb_card_id@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	x8, [sp]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_IVTVFB_ERR
Lloh5:
	adrp	x8, _EBUSY@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
LBB0_2:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_7
LBB0_3:
	mov	x19, x0
Lloh7:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
Lloh10:
	adrp	x9, ___GFP_NOWARN@GOTPAGE
Lloh11:
	ldr	x9, [x9, ___GFP_NOWARN@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	orr	w1, w9, w8
	mov	w0, #4
	bl	_kzalloc
	str	x0, [x19, #24]
	cbz	x0, LBB0_8
; %bb.4:
	mov	x0, x19
	bl	_ivtvfb_init_io
	cbnz	w0, LBB0_6
; %bb.5:
	mov	x0, x19
	bl	_ivtvfb_init_vidmode
	cbz	w0, LBB0_9
LBB0_6:
	mov	x20, x0
	mov	x0, x19
	bl	_ivtvfb_release_buffers
LBB0_7:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_8:
Lloh13:
	adrp	x0, l_.str.1@PAGE
Lloh14:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_IVTVFB_ERR
Lloh15:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_2
LBB0_9:
	ldr	x0, [x19, #24]
	bl	_register_framebuffer
	tbnz	x0, #63, LBB0_11
; %bb.10:
	ldr	x0, [x19, #24]
	ldr	w8, [x0, #4]
	str	w8, [x19, #32]
	bl	_ivtvfb_set_par
	mov	w0, #0
	mov	w1, #10800
	bl	_write_reg
	mov	w0, #0
	mov	w1, #10804
	bl	_write_reg
Lloh17:
	adrp	x8, _FB_BLANK_UNBLANK@GOTPAGE
Lloh18:
	ldr	x8, [x8, _FB_BLANK_UNBLANK@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
	ldr	x1, [x19, #24]
	bl	_ivtvfb_blank
Lloh20:
	adrp	x8, _ivtvfb_restore@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ivtvfb_restore@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	str	w8, [x19, #16]
	mov	x0, x19
	bl	_ivtv_udma_alloc
	mov	w20, #0
Lloh23:
	adrp	x8, _V4L2_CAP_VIDEO_OUTPUT_OVERLAY@GOTPAGE
Lloh24:
	ldr	x8, [x8, _V4L2_CAP_VIDEO_OUTPUT_OVERLAY@GOTPAGEOFF]
	ldr	x9, [x19, #8]
Lloh25:
	adrp	x10, _IVTV_DEC_STREAM_TYPE_YUV@GOTPAGE
Lloh26:
	ldr	x10, [x10, _IVTV_DEC_STREAM_TYPE_YUV@GOTPAGEOFF]
Lloh27:
	ldr	x10, [x10]
	lsl	x10, x10, #2
	ldr	w11, [x9, x10]
	ldr	w12, [x8]
	orr	w11, w11, w12
	str	w11, [x9, x10]
Lloh28:
	adrp	x10, _IVTV_DEC_STREAM_TYPE_MPG@GOTPAGE
Lloh29:
	ldr	x10, [x10, _IVTV_DEC_STREAM_TYPE_MPG@GOTPAGEOFF]
	ldr	w11, [x8]
Lloh30:
	ldr	x10, [x10]
	lsl	x10, x10, #2
	ldr	w12, [x9, x10]
	orr	w11, w12, w11
	str	w11, [x9, x10]
	ldr	w8, [x8]
	ldr	w9, [x19]
	orr	w8, w9, w8
	str	w8, [x19]
	b	LBB0_7
LBB0_11:
	mov	x0, x19
	bl	_ivtvfb_release_buffers
Lloh31:
	adrp	x8, _EINVAL@GOTPAGE
Lloh32:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Card %d already initialised\n"

	.comm	_ivtvfb_card_id,4,2             ; @ivtvfb_card_id
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	___GFP_NOWARN,4,2               ; @__GFP_NOWARN
l_.str.1:                               ; @.str.1
	.asciz	"Failed to allocate memory for osd_info\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_FB_BLANK_UNBLANK,4,2           ; @FB_BLANK_UNBLANK
	.comm	_ivtvfb_restore,4,2             ; @ivtvfb_restore
	.comm	_V4L2_CAP_VIDEO_OUTPUT_OVERLAY,4,2 ; @V4L2_CAP_VIDEO_OUTPUT_OVERLAY
	.comm	_IVTV_DEC_STREAM_TYPE_YUV,8,3   ; @IVTV_DEC_STREAM_TYPE_YUV
	.comm	_IVTV_DEC_STREAM_TYPE_MPG,8,3   ; @IVTV_DEC_STREAM_TYPE_MPG
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_ivtvfb_force_pat,8,3           ; @ivtvfb_force_pat
	.no_dead_strip	_ivtvfb_init_card
.subsections_via_symbols
