	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ubi_dbg_power_cut              ## -- Begin function ubi_dbg_power_cut
	.p2align	4, 0x90
_ubi_dbg_power_cut:                     ## @ubi_dbg_power_cut
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	xorl	%r14d, %r14d
	testl	%esi, (%rdi)
	je	LBB0_6
## %bb.1:
	movq	%rdi, %rbx
	movq	8(%rdi), %rax
	testq	%rax, %rax
	je	LBB0_2
## %bb.4:
	decq	%rax
	movq	%rax, 8(%rbx)
	jne	LBB0_6
## %bb.5:
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_ubi_msg
	movq	%rbx, %rdi
	callq	_ubi_ro_mode
	movl	$1, %r14d
	jmp	LBB0_6
LBB0_2:
	movq	16(%rbx), %rax
	movq	24(%rbx), %r15
	movq	%rax, 8(%rbx)
	cmpq	%rax, %r15
	jle	LBB0_6
## %bb.3:
	subl	%eax, %r15d
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_prandom_u32
	xorl	%edx, %edx
	divl	%r15d
                                        ## kill: def $edx killed $edx def $rdx
	addq	%rdx, 8(%rbx)
LBB0_6:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"XXXXXXXXXXXXXXX emulating a power cut XXXXXXXXXXXXXXXX"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ubi_dbg_power_cut              ; -- Begin function ubi_dbg_power_cut
	.p2align	2
_ubi_dbg_power_cut:                     ; @ubi_dbg_power_cut
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	ldr	w8, [x0]
	tst	w8, w1
	b.eq	LBB0_6
; %bb.1:
	mov	x19, x0
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_4
; %bb.2:
	subs	x8, x8, #1
	str	x8, [x19, #8]
	b.ne	LBB0_6
; %bb.3:
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_ubi_msg
	mov	x0, x19
	bl	_ubi_ro_mode
	mov	w0, #1
	b	LBB0_7
LBB0_4:
	ldp	x8, x9, [x19, #16]
	str	x8, [x19, #8]
	cmp	x9, x8
	b.le	LBB0_6
; %bb.5:
	sub	w20, w9, w8
	bl	_prandom_u32
	mov	x8, x0
	mov	w0, #0
	udiv	w9, w8, w20
	msub	w8, w9, w20, w8
	ldr	x9, [x19, #8]
	add	x8, x9, x8
	str	x8, [x19, #8]
	b	LBB0_7
LBB0_6:
	mov	w0, #0
LBB0_7:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"XXXXXXXXXXXXXXX emulating a power cut XXXXXXXXXXXXXXXX"

.subsections_via_symbols
