	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bcm_otpc_write
_bcm_otpc_write:                        ## @bcm_otpc_write
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movl	%esi, %eax
	movq	%rdi, %r12
	movq	24(%rdi), %rsi
	xorl	%edi, %edi
	xorl	%edx, %edx
	divl	(%rsi)
	testl	%edx, %edx
	je	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_2:
	movl	%eax, %ebx
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	movq	(%r12), %rdi
	callq	_enable_ocotp_program
	testl	%eax, %eax
	jne	LBB0_11
## %bb.3:
	movl	%ebx, %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	xorl	%r14d, %r14d
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_5 Depth=1
	incq	-56(%rbp)                       ## 8-byte Folded Spill
	movq	(%r12), %rdi
	callq	_set_start_bit
	movq	(%r12), %rdi
	movq	_OTPC_STAT_CMD_DONE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_poll_cpu_status
	movl	%eax, %r13d
	movq	(%r12), %rdi
	callq	_reset_start_bit
	testl	%r13d, %r13d
	jne	LBB0_10
LBB0_5:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_8 Depth 2
	movq	(%r12), %rdi
	cmpq	%rbx, %r14
	jae	LBB0_14
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	_OTPC_CMD_PROGRAM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_set_command
	movq	(%r12), %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_set_cpu_address
	movq	16(%r12), %rax
	cmpl	$0, (%rax)
	jle	LBB0_4
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	xorl	%r13d, %r13d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_8:                                 ##   Parent Loop BB0_5 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	(%r15,%rbx,8), %rdi
	movq	8(%rax), %rax
	movq	(%rax,%rbx,8), %rsi
	addq	(%r12), %rsi
	callq	_writel
	addq	$8, %r14
	incq	%rbx
	movq	16(%r12), %rax
	movslq	(%rax), %rcx
	addq	$8, %r13
	cmpq	%rcx, %rbx
	jl	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=1
	addq	%r13, %r15
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	jmp	LBB0_4
LBB0_10:
	movl	8(%r12), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r13d, %edx
	callq	_dev_err
LBB0_11:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
LBB0_12:
	subl	(%rax), %edi
LBB0_13:
	movl	%edi, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	callq	_disable_ocotp_program
	xorl	%edi, %edi
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_EIO,4,2                        ## @EIO
	.comm	_OTPC_CMD_PROGRAM,4,2           ## @OTPC_CMD_PROGRAM
	.comm	_OTPC_STAT_CMD_DONE,4,2         ## @OTPC_STAT_CMD_DONE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"otp write error: 0x%x"

	.no_dead_strip	_bcm_otpc_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bcm_otpc_write
_bcm_otpc_write:                        ; @bcm_otpc_write
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	ldr	x8, [x0, #24]
	ldr	w8, [x8]
	udiv	w22, w1, w8
	msub	w8, w22, w8, w1
	cbz	w8, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_12
LBB0_2:
	mov	x19, x3
	mov	x21, x2
	mov	x20, x0
	ldr	x0, [x0]
	bl	_enable_ocotp_program
	cbnz	w0, LBB0_11
; %bb.3:
	mov	x24, #0
Lloh2:
	adrp	x25, _OTPC_CMD_PROGRAM@GOTPAGE
Lloh3:
	ldr	x25, [x25, _OTPC_CMD_PROGRAM@GOTPAGEOFF]
Lloh4:
	adrp	x26, _OTPC_STAT_CMD_DONE@GOTPAGE
Lloh5:
	ldr	x26, [x26, _OTPC_STAT_CMD_DONE@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x22, x22, #1
	ldr	x0, [x20]
	bl	_set_start_bit
	ldr	x0, [x20]
	ldr	w1, [x26]
	bl	_poll_cpu_status
	mov	x23, x0
	ldr	x0, [x20]
	bl	_reset_start_bit
	cbnz	w23, LBB0_10
LBB0_5:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_8 Depth 2
	ldr	x0, [x20]
	cmp	x24, x19
	b.hs	LBB0_14
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w1, [x25]
	bl	_set_command
	ldr	x0, [x20]
	mov	x1, x22
	bl	_set_cpu_address
	ldr	x8, [x20, #16]
	ldr	w9, [x8]
	cmp	w9, #1
	b.lt	LBB0_4
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x23, #0
	mov	x27, #0
LBB0_8:                                 ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	lsl	x9, x27, #3
	ldr	x0, [x21, x9]
	ldr	x10, [x20]
	ldr	x8, [x8, #8]
	ldr	x8, [x8, x9]
	add	x1, x8, x10
	bl	_writel
	add	x24, x24, #8
	add	x27, x27, #1
	ldr	x8, [x20, #16]
	ldrsw	x9, [x8]
	add	x23, x23, #8
	cmp	x27, x9
	b.lt	LBB0_8
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=1
	add	x21, x21, x23
	b	LBB0_4
LBB0_10:
	ldr	w0, [x20, #8]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x23
	bl	_dev_err
LBB0_11:
Lloh8:
	adrp	x8, _EIO@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_12:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_13:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_14:
	bl	_disable_ocotp_program
	mov	w0, #0
	b	LBB0_13
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_EIO,4,2                        ; @EIO
	.comm	_OTPC_CMD_PROGRAM,4,2           ; @OTPC_CMD_PROGRAM
	.comm	_OTPC_STAT_CMD_DONE,4,2         ; @OTPC_STAT_CMD_DONE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"otp write error: 0x%x"

	.no_dead_strip	_bcm_otpc_write
.subsections_via_symbols
