	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pctv452e_i2c_msg
_pctv452e_i2c_msg:                      ## @pctv452e_i2c_msg
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, %r14d
	movq	%r8, -72(%rbp)                  ## 8-byte Spill
	movl	%ecx, %r15d
	movq	%rdx, -80(%rbp)                 ## 8-byte Spill
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r12
	movq	(%rdi), %r13
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$64, %edi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_8
## %bb.1:
	movq	%rax, %rbx
	movl	(%r13), %ecx
	leal	1(%rcx), %eax
	movl	%eax, (%r13)
	cmpl	$57, %r15d
	jg	LBB0_9
## %bb.2:
	cmpl	$58, %r14d
	jge	LBB0_9
## %bb.3:
	movq	_SYNC_BYTE_OUT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rbx)
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movl	%ecx, 4(%rbx)
	movq	_PCTV_CMD_I2C@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%rbx)
	leal	3(%r15), %eax
	movl	%eax, 12(%rbx)
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	addl	%eax, %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	%eax, 16(%rbx)
	movl	%r15d, 20(%rbx)
	movl	%r14d, 24(%rbx)
	movq	%rbx, %rdi
	addq	$28, %rdi
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
	movl	%r15d, %edx
	movq	%r15, %r13
	callq	_memcpy
	leal	7(%r15), %edx
	xorl	%r13d, %r13d
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movq	%rbx, %rcx
	movl	$64, %r8d
	xorl	%r9d, %r9d
	callq	_dvb_usb_generic_rw
	testl	%eax, %eax
	js	LBB0_10
## %bb.4:
	movq	_EIO@GOTPCREL(%rip), %rax
	subl	(%rax), %r13d
	movq	_SYNC_BYTE_IN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	(%rbx), %eax
	jne	LBB0_11
## %bb.5:
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	cmpl	4(%rbx), %ecx
	jne	LBB0_14
## %bb.6:
	movq	_EREMOTEIO@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	cmpl	%r15d, 20(%rbx)
	jge	LBB0_15
LBB0_14:
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	jmp	LBB0_12
LBB0_8:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_13
LBB0_9:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	addl	%r8d, %r8d
	jmp	LBB0_12
LBB0_10:
	movl	%eax, %r13d
LBB0_11:
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
LBB0_12:
	movq	_SYNC_BYTE_OUT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	subq	$8, %rsp
	leaq	L_.str(%rip), %rdi
	movl	%r13d, %esi
                                        ## kill: def $ecx killed $ecx killed $rcx
	movl	%r15d, %r9d
	pushq	%rbx
	pushq	$7
	pushq	%r14
	callq	_err
	addq	$32, %rsp
	movq	%rbx, %rdi
	callq	_kfree
	movl	%r13d, %r14d
LBB0_13:
	movl	%r14d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	cmpl	%r14d, 24(%rbx)
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	jl	LBB0_12
## %bb.16:
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movl	%r14d, %edx
	callq	_memcpy
	movq	%rbx, %rdi
	callq	_kfree
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_SYNC_BYTE_OUT,4,2              ## @SYNC_BYTE_OUT
	.comm	_PCTV_CMD_I2C,4,2               ## @PCTV_CMD_I2C
	.comm	_EIO,4,2                        ## @EIO
	.comm	_SYNC_BYTE_IN,4,2               ## @SYNC_BYTE_IN
	.comm	_EREMOTEIO,4,2                  ## @EREMOTEIO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"I2C error %d; %02X %02X  %02X %02X %02X -> %*ph"

	.no_dead_strip	_pctv452e_i2c_msg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pctv452e_i2c_msg
_pctv452e_i2c_msg:                      ; @pctv452e_i2c_msg
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x5
	mov	x23, x4
	mov	x21, x3
	mov	x27, x2
	mov	x24, x1
	mov	x25, x0
	ldr	x26, [x0]
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #64
	bl	_kmalloc
	cbz	x0, LBB0_9
; %bb.1:
	mov	x20, x0
	ldr	w22, [x26]
	add	w8, w22, #1
	str	w8, [x26]
Lloh3:
	adrp	x28, _SYNC_BYTE_OUT@GOTPAGE
Lloh4:
	ldr	x28, [x28, _SYNC_BYTE_OUT@GOTPAGEOFF]
	cmp	w21, #57
	b.gt	LBB0_10
; %bb.2:
	cmp	w19, #58
	b.ge	LBB0_10
; %bb.3:
	ldr	w8, [x28]
	stp	w8, w22, [x20]
Lloh5:
	adrp	x8, _PCTV_CMD_I2C@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PCTV_CMD_I2C@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	add	w9, w21, #3
	stp	w8, w9, [x20, #8]
	lsl	w24, w24, #1
	stp	w24, w21, [x20, #16]
	str	w19, [x20, #24]
	add	x26, x20, #28
	mov	x0, x26
	mov	x1, x27
	mov	x2, x21
	bl	_memcpy
	add	w2, w21, #7
	mov	x0, x25
	mov	x1, x20
	mov	x3, x20
	mov	w4, #64
	mov	w5, #0
	bl	_dvb_usb_generic_rw
	tbnz	w0, #31, LBB0_11
; %bb.4:
Lloh8:
	adrp	x8, _EIO@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w25, w8
Lloh11:
	adrp	x8, _SYNC_BYTE_IN@GOTPAGE
Lloh12:
	ldr	x8, [x8, _SYNC_BYTE_IN@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	ldr	w9, [x20]
	cmp	w8, w9
	b.ne	LBB0_12
; %bb.5:
	ldr	w8, [x20, #4]
	cmp	w22, w8
	b.ne	LBB0_12
; %bb.6:
Lloh14:
	adrp	x8, _EREMOTEIO@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EREMOTEIO@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w25, w8
	ldr	w8, [x20, #20]
	cmp	w8, w21
	b.lt	LBB0_12
; %bb.7:
	ldr	w8, [x20, #24]
	cmp	w8, w19
	b.lt	LBB0_12
; %bb.8:
	mov	x0, x23
	mov	x1, x26
	mov	x2, x19
	bl	_memcpy
	mov	x0, x20
	bl	_kfree
	b	LBB0_13
LBB0_9:
Lloh17:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	neg	w19, w8
	b	LBB0_13
LBB0_10:
Lloh20:
	adrp	x8, _EINVAL@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	neg	w25, w8
	lsl	w24, w24, #1
	b	LBB0_12
LBB0_11:
	mov	x25, x0
LBB0_12:
	ldr	w2, [x28]
	str	x20, [sp]
Lloh23:
	adrp	x0, l_.str@PAGE
Lloh24:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x25
	mov	x3, x22
	mov	x4, x24
	mov	x5, x21
	mov	x6, x19
	mov	w7, #7
	bl	_err
	mov	x0, x20
	bl	_kfree
	mov	x19, x25
LBB0_13:
	mov	x0, x19
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_SYNC_BYTE_OUT,4,2              ; @SYNC_BYTE_OUT
	.comm	_PCTV_CMD_I2C,4,2               ; @PCTV_CMD_I2C
	.comm	_EIO,4,2                        ; @EIO
	.comm	_SYNC_BYTE_IN,4,2               ; @SYNC_BYTE_IN
	.comm	_EREMOTEIO,4,2                  ; @EREMOTEIO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"I2C error %d; %02X %02X  %02X %02X %02X -> %*ph"

	.no_dead_strip	_pctv452e_i2c_msg
.subsections_via_symbols
