	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dibusb_i2c_msg
_dibusb_i2c_msg:                        ## @dibusb_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	%ecx, %r15d
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
                                        ## kill: def $esi killed $esi def $rsi
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	movq	%r8, -80(%rbp)                  ## 8-byte Spill
	testq	%r8, %r8
	sete	%r12b
	movl	%r9d, -48(%rbp)                 ## 4-byte Spill
	testl	%r9d, %r9d
	sete	%r14b
	movq	_MAX_XFER_SIZE@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r13
	leal	4(%r15), %eax
	cmpl	(%rbx), %eax
	jle	LBB0_4
## %bb.3:
	leaq	L_.str(%rip), %rdi
	movl	%r15d, %esi
	callq	_warn
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_10
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_11
LBB0_4:
	orb	%r14b, %r12b
	movl	%r12d, %eax
	xorb	$1, %al
	movzbl	%al, %eax
	movl	-48(%rbp), %ebx                 ## 4-byte Reload
	testl	%ebx, %ebx
	setne	%cl
	movq	-80(%rbp), %r14                 ## 8-byte Reload
	testq	%r14, %r14
	setne	%dl
	testb	%r12b, %r12b
	je	LBB0_5
## %bb.6:
	movq	_DIBUSB_REQ_I2C_WRITE@GOTPCREL(%rip), %rsi
	jmp	LBB0_7
LBB0_5:
	movq	_DIBUSB_REQ_I2C_READ@GOTPCREL(%rip), %rsi
LBB0_7:
	leal	(%r15,%rax,2), %eax
	addl	$2, %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	(%rsi), %eax
	movl	%eax, (%r13)
	andb	%cl, %dl
	movzbl	%dl, %eax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	leal	(%rax,%rcx,2), %eax
	movl	%eax, 4(%r13)
	movq	%r13, %rdi
	addq	$8, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movl	%r15d, %edx
	callq	_memcpy
	testb	%r12b, %r12b
	jne	LBB0_9
## %bb.8:
	leal	2(%r15), %eax
	movzbl	%bh, %ecx
	cltq
	movl	%ecx, (%r13,%rax,4)
	movzbl	%bl, %eax
	movslq	%r15d, %rcx
	movl	%eax, 12(%r13,%rcx,4)
LBB0_9:
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movq	%r13, %rsi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movq	%r14, %rcx
	movl	%ebx, %r8d
	xorl	%r9d, %r9d
	callq	_dvb_usb_generic_rw
	movl	%eax, %ebx
LBB0_10:
	movq	%r13, %rdi
	callq	_kfree
LBB0_11:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_XFER_SIZE,4,2              ## @MAX_XFER_SIZE
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"i2c wr: len=%d is too big!\n"

	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
	.comm	_DIBUSB_REQ_I2C_WRITE,4,2       ## @DIBUSB_REQ_I2C_WRITE
	.comm	_DIBUSB_REQ_I2C_READ,4,2        ## @DIBUSB_REQ_I2C_READ
	.no_dead_strip	_dibusb_i2c_msg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dibusb_i2c_msg
_dibusb_i2c_msg:                        ; @dibusb_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	x20, x5
	mov	x21, x4
	mov	x23, x3
	mov	x24, x2
	mov	x25, x1
	mov	x22, x0
	cmp	x4, #0
	ccmp	w5, #0, #4, ne
	cset	w27, eq
	mov	w8, #2
	csel	w28, wzr, w8, eq
Lloh0:
	adrp	x26, _MAX_XFER_SIZE@GOTPAGE
Lloh1:
	ldr	x26, [x26, _MAX_XFER_SIZE@GOTPAGEOFF]
	ldr	w0, [x26]
Lloh2:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	bl	_kmalloc
	cbz	x0, LBB0_3
; %bb.1:
	mov	x19, x0
	add	w8, w23, #4
	ldr	w9, [x26]
	cmp	w8, w9
	b.le	LBB0_4
; %bb.2:
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x23
	bl	_warn
Lloh7:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_7
LBB0_3:
Lloh10:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_8
LBB0_4:
	sxtw	x8, w23
	str	x8, [sp, #8]                    ; 8-byte Folded Spill
	add	x26, x8, #2
	add	w28, w28, w26
Lloh13:
	adrp	x8, _DIBUSB_REQ_I2C_WRITE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _DIBUSB_REQ_I2C_WRITE@GOTPAGEOFF]
Lloh15:
	adrp	x9, _DIBUSB_REQ_I2C_READ@GOTPAGE
Lloh16:
	ldr	x9, [x9, _DIBUSB_REQ_I2C_READ@GOTPAGEOFF]
	cmp	w27, #0
	csel	x8, x8, x9, ne
	cmp	x21, #0
	ldr	w8, [x8]
	ccmp	w20, #0, #4, ne
	cset	w9, ne
	bfi	w9, w25, #1, #31
	stp	w8, w9, [x19]
	add	x0, x19, #8
	mov	x1, x24
	mov	x2, x23
	bl	_memcpy
	tbnz	w27, #0, LBB0_6
; %bb.5:
	ubfx	w8, w20, #8, #8
	str	w8, [x19, x26, lsl #2]
	and	w8, w20, #0xff
	ldr	x9, [sp, #8]                    ; 8-byte Folded Reload
	add	x9, x19, x9, lsl #2
	str	w8, [x9, #12]
LBB0_6:
	mov	x0, x22
	mov	x1, x19
	mov	x2, x28
	mov	x3, x21
	mov	x4, x20
	mov	w5, #0
	bl	_dvb_usb_generic_rw
	mov	x20, x0
LBB0_7:
	mov	x0, x19
	bl	_kfree
LBB0_8:
	mov	x0, x20
	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	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_XFER_SIZE,4,2              ; @MAX_XFER_SIZE
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"i2c wr: len=%d is too big!\n"

	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
	.comm	_DIBUSB_REQ_I2C_WRITE,4,2       ; @DIBUSB_REQ_I2C_WRITE
	.comm	_DIBUSB_REQ_I2C_READ,4,2        ; @DIBUSB_REQ_I2C_READ
	.no_dead_strip	_dibusb_i2c_msg
.subsections_via_symbols
