	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ivtv_gpio_init                 ## -- Begin function ivtv_gpio_init
	.p2align	4, 0x90
_ivtv_gpio_init:                        ## @ivtv_gpio_init
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	32(%rdi), %rax
	movl	(%rax), %ecx
	movl	$1, %ebx
	shll	%cl, %ebx
	testl	%ecx, %ecx
	cmovel	%ecx, %ebx
	movl	4(%rax), %eax
	orl	%ebx, %eax
	je	LBB0_1
## %bb.2:
	movq	%rdi, %r14
	movq	_IVTV_REG_GPIO_DIR@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	callq	_read_reg
	movl	%eax, %r15d
	movq	_IVTV_REG_GPIO_OUT@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	callq	_read_reg
	leaq	L_.str(%rip), %rdi
	movl	%r15d, %esi
	movl	%eax, %edx
	callq	_IVTV_DEBUG_INFO
	movq	32(%r14), %rax
	movl	8(%rax), %edi
	orl	%ebx, %edi
	movl	(%r13), %esi
	callq	_write_reg
	movq	32(%r14), %rax
	orl	4(%rax), %ebx
	movl	(%r12), %esi
	movl	%ebx, %edi
	callq	_write_reg
	movq	_subdev_ops@GOTPCREL(%rip), %rsi
	movq	%r14, %rdi
	callq	_v4l2_subdev_init
	movl	12(%r14), %edi
	movq	16(%r14), %rcx
	leaq	L_.str.1(%rip), %rdx
	movl	$4, %esi
	callq	_snprintf
	movq	_IVTV_HW_GPIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%r14)
	leaq	24(%r14), %rbx
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_v4l2_ctrl_handler_init
	movq	_V4L2_CID_AUDIO_MUTE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$0, (%rsp)
	movq	_gpio_ctrl_ops@GOTPCREL(%rip), %rsi
	movq	%rbx, %rdi
	xorl	%ecx, %ecx
	movl	$1, %r8d
	movl	$1, %r9d
	callq	_v4l2_ctrl_new_std
	movl	24(%r14), %eax
	testl	%eax, %eax
	jne	LBB0_3
## %bb.4:
	leaq	16(%r14), %r15
	movq	%rbx, (%r14)
	movq	%rbx, %rdi
	callq	_v4l2_ctrl_handler_setup
	movq	%r15, %rdi
	movq	%r14, %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_v4l2_device_register_subdev    ## TAILCALL
LBB0_1:
	xorl	%eax, %eax
LBB0_3:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"GPIO initial dir: %08x out: %08x\n"

	.comm	_IVTV_REG_GPIO_DIR,4,2          ## @IVTV_REG_GPIO_DIR
	.comm	_IVTV_REG_GPIO_OUT,4,2          ## @IVTV_REG_GPIO_OUT
	.comm	_subdev_ops,4,2                 ## @subdev_ops
L_.str.1:                               ## @.str.1
	.asciz	"%s-gpio"

	.comm	_IVTV_HW_GPIO,4,2               ## @IVTV_HW_GPIO
	.comm	_gpio_ctrl_ops,4,2              ## @gpio_ctrl_ops
	.comm	_V4L2_CID_AUDIO_MUTE,4,2        ## @V4L2_CID_AUDIO_MUTE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ivtv_gpio_init                 ; -- Begin function ivtv_gpio_init
	.p2align	2
_ivtv_gpio_init:                        ; @ivtv_gpio_init
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	ldr	x8, [x0, #32]
	mov	w9, #1
	ldp	w10, w8, [x8]
	lsl	w9, w9, w10
	cmp	w10, #0
	csel	w21, wzr, w9, eq
	orr	w8, w21, w8
	cbz	w8, LBB0_3
; %bb.1:
	mov	x19, x0
Lloh0:
	adrp	x22, _IVTV_REG_GPIO_DIR@GOTPAGE
Lloh1:
	ldr	x22, [x22, _IVTV_REG_GPIO_DIR@GOTPAGEOFF]
	ldr	w0, [x22]
	bl	_read_reg
	mov	x20, x0
Lloh2:
	adrp	x23, _IVTV_REG_GPIO_OUT@GOTPAGE
Lloh3:
	ldr	x23, [x23, _IVTV_REG_GPIO_OUT@GOTPAGEOFF]
	ldr	w0, [x23]
	bl	_read_reg
	mov	x2, x0
Lloh4:
	adrp	x0, l_.str@PAGE
Lloh5:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	bl	_IVTV_DEBUG_INFO
	ldr	x8, [x19, #32]
	ldr	w8, [x8, #8]
	orr	w0, w8, w21
	ldr	w1, [x23]
	bl	_write_reg
	ldr	x8, [x19, #32]
	ldr	w8, [x8, #4]
	orr	w0, w8, w21
	ldr	w1, [x22]
	bl	_write_reg
Lloh6:
	adrp	x1, _subdev_ops@GOTPAGE
Lloh7:
	ldr	x1, [x1, _subdev_ops@GOTPAGEOFF]
	mov	x0, x19
	bl	_v4l2_subdev_init
	mov	x20, x19
	ldr	x3, [x20, #16]!
	ldur	w0, [x20, #-4]
Lloh8:
	adrp	x2, l_.str.1@PAGE
Lloh9:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	w1, #4
	bl	_snprintf
Lloh10:
	adrp	x8, _IVTV_HW_GPIO@GOTPAGE
Lloh11:
	ldr	x8, [x8, _IVTV_HW_GPIO@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	stur	w8, [x20, #-8]
	add	x21, x20, #8
	mov	x0, x21
	mov	w1, #1
	bl	_v4l2_ctrl_handler_init
Lloh13:
	adrp	x8, _V4L2_CID_AUDIO_MUTE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _V4L2_CID_AUDIO_MUTE@GOTPAGEOFF]
Lloh15:
	ldr	w2, [x8]
Lloh16:
	adrp	x1, _gpio_ctrl_ops@GOTPAGE
Lloh17:
	ldr	x1, [x1, _gpio_ctrl_ops@GOTPAGEOFF]
	mov	x0, x21
	mov	w3, #0
	mov	w4, #1
	mov	w5, #1
	mov	w6, #0
	bl	_v4l2_ctrl_new_std
	ldr	w0, [x20, #8]
	cbnz	w0, LBB0_4
; %bb.2:
	str	x21, [x19]
	mov	x0, x21
	bl	_v4l2_ctrl_handler_setup
	mov	x0, x20
	mov	x1, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_v4l2_device_register_subdev
LBB0_3:
	mov	w0, #0
LBB0_4:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"GPIO initial dir: %08x out: %08x\n"

	.comm	_IVTV_REG_GPIO_DIR,4,2          ; @IVTV_REG_GPIO_DIR
	.comm	_IVTV_REG_GPIO_OUT,4,2          ; @IVTV_REG_GPIO_OUT
	.comm	_subdev_ops,4,2                 ; @subdev_ops
l_.str.1:                               ; @.str.1
	.asciz	"%s-gpio"

	.comm	_IVTV_HW_GPIO,4,2               ; @IVTV_HW_GPIO
	.comm	_gpio_ctrl_ops,4,2              ; @gpio_ctrl_ops
	.comm	_V4L2_CID_AUDIO_MUTE,4,2        ; @V4L2_CID_AUDIO_MUTE
.subsections_via_symbols
