	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nsim_dev_flash_update
_nsim_dev_flash_update:                 ## @nsim_dev_flash_update
	.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	%rdx, %r12
	movq	%rdi, %r13
	callq	_devlink_priv
	movq	%rax, %rbx
	cmpq	$0, (%rax)
	je	LBB0_2
## %bb.1:
	movq	%r13, %rdi
	callq	_devlink_flash_update_begin_notify
	leaq	L_.str(%rip), %rsi
	movq	%r13, %rdi
	movq	%r12, %rdx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_devlink_flash_update_status_notify
LBB0_2:
	movq	_NSIM_DEV_FLASH_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	_NSIM_DEV_FLASH_CHUNK_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%r8d, %eax
	cltd
	idivl	%ecx
	testl	%eax, %eax
	jle	LBB0_7
## %bb.3:
	xorl	%r14d, %r14d
	movq	_NSIM_DEV_FLASH_CHUNK_TIME_MS@GOTPCREL(%rip), %r15
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	movl	(%r15), %edi
	callq	_msleep
	incl	%r14d
	movq	_NSIM_DEV_FLASH_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	_NSIM_DEV_FLASH_CHUNK_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%r8d, %eax
	cltd
	idivl	%ecx
	cmpl	%eax, %r14d
	jge	LBB0_7
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	$0, (%rbx)
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	imull	%r14d, %ecx
	movq	%r13, %rdi
	leaq	L_.str.1(%rip), %rsi
	movq	%r12, %rdx
	callq	_devlink_flash_update_status_notify
	jmp	LBB0_6
LBB0_7:
	cmpq	$0, (%rbx)
	je	LBB0_9
## %bb.8:
	leaq	L_.str.1(%rip), %rsi
	movq	%r13, %rdi
	movq	%r12, %rdx
	movl	%r8d, %ecx
	callq	_devlink_flash_update_status_notify
	leaq	L_.str.2(%rip), %rsi
	movq	%r13, %rdi
	movq	%r12, %rdx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_devlink_flash_update_status_notify
	movq	%r13, %rdi
	callq	_devlink_flash_update_end_notify
LBB0_9:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Preparing to flash"

	.comm	_NSIM_DEV_FLASH_SIZE,4,2        ## @NSIM_DEV_FLASH_SIZE
	.comm	_NSIM_DEV_FLASH_CHUNK_SIZE,4,2  ## @NSIM_DEV_FLASH_CHUNK_SIZE
L_.str.1:                               ## @.str.1
	.asciz	"Flashing"

	.comm	_NSIM_DEV_FLASH_CHUNK_TIME_MS,4,2 ## @NSIM_DEV_FLASH_CHUNK_TIME_MS
L_.str.2:                               ## @.str.2
	.asciz	"Flashing done"

	.no_dead_strip	_nsim_dev_flash_update
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nsim_dev_flash_update
_nsim_dev_flash_update:                 ; @nsim_dev_flash_update
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x20, x2
	mov	x19, x0
	bl	_devlink_priv
	mov	x21, x0
	ldr	x8, [x0]
	cbz	x8, LBB0_2
; %bb.1:
	mov	x0, x19
	bl	_devlink_flash_update_begin_notify
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, x20
	mov	w3, #0
	mov	w4, #0
	bl	_devlink_flash_update_status_notify
LBB0_2:
Lloh2:
	adrp	x23, _NSIM_DEV_FLASH_SIZE@GOTPAGE
Lloh3:
	ldr	x23, [x23, _NSIM_DEV_FLASH_SIZE@GOTPAGEOFF]
	ldr	w4, [x23]
Lloh4:
	adrp	x24, _NSIM_DEV_FLASH_CHUNK_SIZE@GOTPAGE
Lloh5:
	ldr	x24, [x24, _NSIM_DEV_FLASH_CHUNK_SIZE@GOTPAGEOFF]
	ldr	w8, [x24]
	sdiv	w9, w4, w8
	cmp	w9, #1
	b.lt	LBB0_7
; %bb.3:
	mov	w25, #0
Lloh6:
	adrp	x26, _NSIM_DEV_FLASH_CHUNK_TIME_MS@GOTPAGE
Lloh7:
	ldr	x26, [x26, _NSIM_DEV_FLASH_CHUNK_TIME_MS@GOTPAGEOFF]
Lloh8:
	adrp	x22, l_.str.1@PAGE
Lloh9:
	add	x22, x22, l_.str.1@PAGEOFF
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	w0, [x26]
	bl	_msleep
	add	w25, w25, #1
	ldr	w4, [x23]
	ldr	w8, [x24]
	sdiv	w9, w4, w8
	cmp	w25, w9
	b.ge	LBB0_7
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x21]
	cbz	x9, LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mul	w3, w8, w25
	mov	x0, x19
	mov	x1, x22
	mov	x2, x20
	bl	_devlink_flash_update_status_notify
	b	LBB0_4
LBB0_7:
	ldr	x8, [x21]
	cbz	x8, LBB0_9
; %bb.8:
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	x2, x20
	mov	x3, x4
	bl	_devlink_flash_update_status_notify
Lloh12:
	adrp	x1, l_.str.2@PAGE
Lloh13:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	mov	x2, x20
	mov	w3, #0
	mov	w4, #0
	bl	_devlink_flash_update_status_notify
	mov	x0, x19
	bl	_devlink_flash_update_end_notify
LBB0_9:
	mov	w0, #0
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Preparing to flash"

	.comm	_NSIM_DEV_FLASH_SIZE,4,2        ; @NSIM_DEV_FLASH_SIZE
	.comm	_NSIM_DEV_FLASH_CHUNK_SIZE,4,2  ; @NSIM_DEV_FLASH_CHUNK_SIZE
l_.str.1:                               ; @.str.1
	.asciz	"Flashing"

	.comm	_NSIM_DEV_FLASH_CHUNK_TIME_MS,4,2 ; @NSIM_DEV_FLASH_CHUNK_TIME_MS
l_.str.2:                               ; @.str.2
	.asciz	"Flashing done"

	.no_dead_strip	_nsim_dev_flash_update
.subsections_via_symbols
