	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tegra_bpmp_i2c_msg_len_check
_tegra_bpmp_i2c_msg_len_check:          ## @tegra_bpmp_i2c_msg_len_check
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	.cfi_offset %rbx, -24
	testl	%esi, %esi
	je	LBB0_1
## %bb.2:
	movq	_I2C_M_RD@GOTPCREL(%rip), %r8
	movl	(%r8), %eax
	movq	_SERIALI2C_HDR_SIZE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %r11
	movl	%esi, %r9d
	movq	%r9, %r10
	decq	%r10
	je	LBB0_3
## %bb.4:
	movl	%r9d, %edx
	andl	$-2, %edx
	leaq	24(%rdi), %rbx
	xorl	%esi, %esi
	xorl	%ecx, %ecx
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_5 Depth=1
	addq	$2, %rsi
	addq	$32, %rbx
	cmpq	%rsi, %rdx
	je	LBB0_10
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	testl	%eax, -24(%rbx)
	je	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	testl	%eax, -8(%rbx)
	jne	LBB0_9
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_5 Depth=1
	addq	%r11, %rcx
	addq	-16(%rbx), %rcx
	testl	%eax, -8(%rbx)
	jne	LBB0_9
LBB0_8:                                 ##   in Loop: Header=BB0_5 Depth=1
	addq	%r11, %rcx
	addq	(%rbx), %rcx
	jmp	LBB0_9
LBB0_1:
	xorl	%eax, %eax
	jmp	LBB0_27
LBB0_3:
	xorl	%esi, %esi
	xorl	%ecx, %ecx
LBB0_10:
	testb	$1, %r9b
	je	LBB0_13
## %bb.11:
	shlq	$4, %rsi
	testl	%eax, (%rdi,%rsi)
	jne	LBB0_13
## %bb.12:
	addq	%rcx, %r11
	addq	8(%rdi,%rsi), %r11
	movq	%r11, %rcx
LBB0_13:
	movq	_TEGRA_I2C_IPC_MAX_IN_BUF_SIZE@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rcx
	ja	LBB0_26
## %bb.14:
	movl	(%r8), %eax
	testq	%r10, %r10
	je	LBB0_15
## %bb.16:
	movl	%r9d, %esi
	andl	$-2, %esi
	leaq	24(%rdi), %rbx
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	jmp	LBB0_17
	.p2align	4, 0x90
LBB0_21:                                ##   in Loop: Header=BB0_17 Depth=1
	addq	$2, %rdx
	addq	$32, %rbx
	cmpq	%rdx, %rsi
	je	LBB0_22
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	testl	%eax, -24(%rbx)
	je	LBB0_19
## %bb.18:                              ##   in Loop: Header=BB0_17 Depth=1
	addq	-16(%rbx), %rcx
LBB0_19:                                ##   in Loop: Header=BB0_17 Depth=1
	testl	%eax, -8(%rbx)
	je	LBB0_21
## %bb.20:                              ##   in Loop: Header=BB0_17 Depth=1
	addq	(%rbx), %rcx
	jmp	LBB0_21
LBB0_15:
	xorl	%edx, %edx
	xorl	%ecx, %ecx
LBB0_22:
	testb	$1, %r9b
	je	LBB0_25
## %bb.23:
	shlq	$4, %rdx
	testl	%eax, (%rdi,%rdx)
	je	LBB0_25
## %bb.24:
	addq	8(%rdi,%rdx), %rcx
LBB0_25:
	movq	_TEGRA_I2C_IPC_MAX_OUT_BUF_SIZE@GOTPCREL(%rip), %rdx
	xorl	%eax, %eax
	cmpq	(%rdx), %rcx
	jbe	LBB0_27
LBB0_26:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_27:
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_I2C_M_RD,4,2                   ## @I2C_M_RD
	.comm	_SERIALI2C_HDR_SIZE,8,3         ## @SERIALI2C_HDR_SIZE
	.comm	_TEGRA_I2C_IPC_MAX_IN_BUF_SIZE,8,3 ## @TEGRA_I2C_IPC_MAX_IN_BUF_SIZE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_TEGRA_I2C_IPC_MAX_OUT_BUF_SIZE,8,3 ## @TEGRA_I2C_IPC_MAX_OUT_BUF_SIZE
	.no_dead_strip	_tegra_bpmp_i2c_msg_len_check
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tegra_bpmp_i2c_msg_len_check
_tegra_bpmp_i2c_msg_len_check:          ; @tegra_bpmp_i2c_msg_len_check
	.cfi_startproc
; %bb.0:
	cbz	w1, LBB0_12
; %bb.1:
	mov	x10, #0
Lloh0:
	adrp	x9, _I2C_M_RD@GOTPAGE
Lloh1:
	ldr	x9, [x9, _I2C_M_RD@GOTPAGEOFF]
	ldr	w11, [x9]
Lloh2:
	adrp	x8, _SERIALI2C_HDR_SIZE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _SERIALI2C_HDR_SIZE@GOTPAGEOFF]
Lloh4:
	ldr	x12, [x8]
	mov	w8, w1
	add	x13, x0, #8
	mov	x14, x8
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x13, x13, #16
	subs	x14, x14, #1
	b.eq	LBB0_5
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldur	w15, [x13, #-8]
	tst	w11, w15
	b.ne	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x15, [x13]
	add	x10, x12, x10
	add	x10, x10, x15
	b	LBB0_2
LBB0_5:
Lloh5:
	adrp	x11, _TEGRA_I2C_IPC_MAX_IN_BUF_SIZE@GOTPAGE
Lloh6:
	ldr	x11, [x11, _TEGRA_I2C_IPC_MAX_IN_BUF_SIZE@GOTPAGEOFF]
Lloh7:
	ldr	x11, [x11]
	cmp	x10, x11
	b.hi	LBB0_11
; %bb.6:
	mov	x10, #0
	ldr	w9, [x9]
	add	x11, x0, #8
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	add	x11, x11, #16
	subs	x8, x8, #1
	b.eq	LBB0_10
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldur	w12, [x11, #-8]
	tst	w9, w12
	b.eq	LBB0_7
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	x12, [x11]
	add	x10, x12, x10
	b	LBB0_7
LBB0_10:
Lloh8:
	adrp	x8, _TEGRA_I2C_IPC_MAX_OUT_BUF_SIZE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _TEGRA_I2C_IPC_MAX_OUT_BUF_SIZE@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	cmp	x10, x8
	b.ls	LBB0_12
LBB0_11:
Lloh11:
	adrp	x8, _EINVAL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w0, w8
	ret
LBB0_12:
	mov	w0, #0
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_I2C_M_RD,4,2                   ; @I2C_M_RD
	.comm	_SERIALI2C_HDR_SIZE,8,3         ; @SERIALI2C_HDR_SIZE
	.comm	_TEGRA_I2C_IPC_MAX_IN_BUF_SIZE,8,3 ; @TEGRA_I2C_IPC_MAX_IN_BUF_SIZE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_TEGRA_I2C_IPC_MAX_OUT_BUF_SIZE,8,3 ; @TEGRA_I2C_IPC_MAX_OUT_BUF_SIZE
	.no_dead_strip	_tegra_bpmp_i2c_msg_len_check
.subsections_via_symbols
