	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function device_authorization
LCPI0_0:
	.long	128                             ## 0x80
	.long	64                              ## 0x40
	.long	15                              ## 0xf
	.long	64                              ## 0x40
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_device_authorization:                  ## @device_authorization
	.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	%rdi, %r13
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	leaq	12(%rdi), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movl	20(%r13), %ebx
	movl	%ebx, %edi
	xorl	%esi, %esi
	callq	_usb_rcvctrlpipe
	subq	$8, %rsp
	movl	%ebx, %edi
	movl	%eax, %esi
	movl	$-127, %edx
	movl	$184, %ecx
	movl	$1024, %r8d                     ## imm = 0x400
	movl	$3, %r9d
	pushq	$10000                          ## imm = 0x2710
	pushq	$46
	pushq	(%r13)
	callq	_usb_control_msg
	addq	$32, %rsp
	cmpl	$46, %eax
	jne	LBB0_1
## %bb.2:
	movq	(%r13), %rax
	movsbl	1(%rax), %ecx
	movl	%ecx, 8(%r13)
	movb	$0, 46(%rax)
	leaq	16(%r13), %r15
	movl	8(%r13), %edx
	movq	(%r13), %rcx
	addq	$2, %rcx
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_v4l2_info
	movl	8(%r13), %eax
	cmpl	$22, %eax
	jl	LBB0_4
## %bb.3:
	movaps	LCPI0_0(%rip), %xmm0            ## xmm0 = [128,64,15,64]
	movups	%xmm0, 28(%r13)
	movl	$128, 44(%r13)
LBB0_4:
	leal	-128(%rax), %ecx
	cmpl	$4, %ecx
	jae	LBB0_5
## %bb.8:
	movq	_HDPVR_FLAG_AC3_CAP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_10:
	orl	%eax, 24(%r13)
	jmp	LBB0_11
LBB0_1:
	negl	%r15d
	addq	$16, %r13
	leaq	L_.str(%rip), %rsi
	movq	%r13, %rdi
	movl	%eax, %edx
	callq	_v4l2_err
	jmp	LBB0_12
LBB0_5:
	cmpl	$132, %eax
	jne	LBB0_9
## %bb.6:
	movq	_HDPVR_FLAG_AC3_CAP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_7
LBB0_9:
	leaq	L_.str.2(%rip), %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_v4l2_info
	cmpl	$128, 8(%r13)
	movq	_HDPVR_FLAG_AC3_CAP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jge	LBB0_10
LBB0_7:
	notl	%eax
	andl	%eax, 24(%r13)
LBB0_11:
	movq	(%r13), %r12
	addq	$38, %r12
	movq	%r12, %rdi
	callq	_challenge
	movl	$100, %edi
	callq	_msleep
	movl	20(%r13), %ebx
	movl	%ebx, %edi
	xorl	%esi, %esi
	callq	_usb_sndctrlpipe
	subq	$8, %rsp
	movl	%ebx, %edi
	movl	%eax, %esi
	movl	$209, %edx
	movl	$56, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	pushq	$10000                          ## imm = 0x2710
	pushq	$8
	pushq	%r12
	callq	_usb_control_msg
	addq	$32, %rsp
	movl	%eax, %ebx
	movq	_MSG_INFO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_hdpvr_debug@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.3(%rip), %rcx
	movq	%r15, %rdx
	movl	%ebx, %r8d
	xorl	%eax, %eax
	callq	_v4l2_dbg
	xorl	%r15d, %r15d
	cmpl	$8, %ebx
	setne	%r15b
LBB0_12:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unexpected answer of status request, len %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"firmware version 0x%x dated %s\n"

	.comm	_HDPVR_FLAG_AC3_CAP,4,2         ## @HDPVR_FLAG_AC3_CAP
L_.str.2:                               ## @.str.2
	.asciz	"untested firmware, the driver might not work.\n"

	.comm	_MSG_INFO,4,2                   ## @MSG_INFO
	.comm	_hdpvr_debug,4,2                ## @hdpvr_debug
L_.str.3:                               ## @.str.3
	.asciz	"magic request returned %d\n"

	.no_dead_strip	_device_authorization
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ; -- Begin function device_authorization
lCPI0_0:
	.long	128                             ; 0x80
	.long	64                              ; 0x40
	.long	15                              ; 0xf
	.long	64                              ; 0x40
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_device_authorization:                  ; @device_authorization
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x20, x0
Lloh0:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh2:
	ldr	w22, [x8]
	add	x19, x0, #12
	mov	x0, x19
	bl	_mutex_lock
	ldr	w21, [x20, #20]
	mov	x0, x21
	mov	w1, #0
	bl	_usb_rcvctrlpipe
	mov	x1, x0
	ldr	x6, [x20]
	mov	w8, #10000
	str	w8, [sp]
	mov	x0, x21
	mov	w2, #-127
	mov	w3, #184
	mov	w4, #1024
	mov	w5, #3
	mov	w7, #46
	bl	_usb_control_msg
	cmp	w0, #46
	b.ne	LBB0_6
; %bb.1:
	ldr	x8, [x20]
	ldrsb	w9, [x8, #1]
	str	w9, [x20, #8]
	strb	wzr, [x8, #46]
	add	x21, x20, #16
	ldr	x8, [x20]
	add	x8, x8, #2
	ldr	w9, [x20, #8]
	stp	x9, x8, [sp]
Lloh3:
	adrp	x1, l_.str.1@PAGE
Lloh4:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	bl	_v4l2_info
	ldr	w8, [x20, #8]
	cmp	w8, #22
	b.lt	LBB0_3
; %bb.2:
Lloh5:
	adrp	x9, lCPI0_0@PAGE
Lloh6:
	ldr	q0, [x9, lCPI0_0@PAGEOFF]
	stur	q0, [x20, #28]
	mov	w9, #128
	str	w9, [x20, #44]
LBB0_3:
	sub	w9, w8, #128
	cmp	w9, #4
	b.hs	LBB0_7
; %bb.4:
Lloh7:
	adrp	x8, _HDPVR_FLAG_AC3_CAP@GOTPAGE
Lloh8:
	ldr	x8, [x8, _HDPVR_FLAG_AC3_CAP@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
LBB0_5:
	ldr	w9, [x20, #24]
	orr	w8, w9, w8
	b	LBB0_11
LBB0_6:
	mov	x2, x0
	neg	w21, w22
	add	x0, x20, #16
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	bl	_v4l2_err
	b	LBB0_12
LBB0_7:
	cmp	w8, #132
	b.ne	LBB0_9
; %bb.8:
Lloh12:
	adrp	x8, _HDPVR_FLAG_AC3_CAP@GOTPAGE
Lloh13:
	ldr	x8, [x8, _HDPVR_FLAG_AC3_CAP@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	b	LBB0_10
LBB0_9:
Lloh15:
	adrp	x1, l_.str.2@PAGE
Lloh16:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x21
	bl	_v4l2_info
	ldr	w9, [x20, #8]
Lloh17:
	adrp	x8, _HDPVR_FLAG_AC3_CAP@GOTPAGE
Lloh18:
	ldr	x8, [x8, _HDPVR_FLAG_AC3_CAP@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	cmp	w9, #128
	b.ge	LBB0_5
LBB0_10:
	ldr	w9, [x20, #24]
	bic	w8, w9, w8
LBB0_11:
	str	w8, [x20, #24]
	ldr	x8, [x20]
	add	x22, x8, #38
	mov	x0, x22
	bl	_challenge
	mov	w0, #100
	bl	_msleep
	ldr	w20, [x20, #20]
	mov	x0, x20
	mov	w1, #0
	bl	_usb_sndctrlpipe
	mov	x1, x0
	mov	w8, #10000
	str	w8, [sp]
	mov	x0, x20
	mov	w2, #209
	mov	w3, #56
	mov	w4, #0
	mov	w5, #0
	mov	x6, x22
	mov	w7, #8
	bl	_usb_control_msg
	mov	x20, x0
Lloh20:
	adrp	x8, _MSG_INFO@GOTPAGE
Lloh21:
	ldr	x8, [x8, _MSG_INFO@GOTPAGEOFF]
Lloh22:
	ldr	w0, [x8]
Lloh23:
	adrp	x8, _hdpvr_debug@GOTPAGE
Lloh24:
	ldr	x8, [x8, _hdpvr_debug@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
	str	x20, [sp]
Lloh26:
	adrp	x3, l_.str.3@PAGE
Lloh27:
	add	x3, x3, l_.str.3@PAGEOFF
	mov	x2, x21
	bl	_v4l2_dbg
	cmp	w20, #8
	cset	w21, ne
LBB0_12:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x21
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdr	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unexpected answer of status request, len %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"firmware version 0x%x dated %s\n"

	.comm	_HDPVR_FLAG_AC3_CAP,4,2         ; @HDPVR_FLAG_AC3_CAP
l_.str.2:                               ; @.str.2
	.asciz	"untested firmware, the driver might not work.\n"

	.comm	_MSG_INFO,4,2                   ; @MSG_INFO
	.comm	_hdpvr_debug,4,2                ; @hdpvr_debug
l_.str.3:                               ; @.str.3
	.asciz	"magic request returned %d\n"

	.no_dead_strip	_device_authorization
.subsections_via_symbols
