	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function titan_add_partition
_titan_add_partition:                   ## @titan_add_partition
	.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
	movq	%rdi, %rbx
	movq	_titan_parts@GOTPCREL(%rip), %r15
	movq	(%r15), %rax
	movq	_part_count@GOTPCREL(%rip), %r14
	movq	(%r14), %rcx
	shlq	$3, %rcx
	leaq	(%rcx,%rcx,2), %rcx
	movq	%rdi, (%rax,%rcx)
	movq	(%r15), %rax
	movl	%esi, 8(%rax,%rcx)
	subl	%esi, %edx
	movl	%edx, 12(%rax,%rcx)
	leaq	L_.str(%rip), %rsi
	callq	_strcmp
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	callq	_strcmp
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	leaq	L_.str.2(%rip), %rsi
	movq	%rbx, %rdi
	callq	_strcmp
	xorl	%ecx, %ecx
	testq	%rax, %rax
	jne	LBB0_4
LBB0_3:
	movq	_MTD_WRITEABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
LBB0_4:
	movq	(%r15), %rax
	movq	(%r14), %rdx
	leaq	(%rdx,%rdx,2), %rsi
	movl	%ecx, 16(%rax,%rsi,8)
	incq	%rdx
	movq	%rdx, (%r14)
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_titan_parts,8,3                ## @titan_parts
	.comm	_part_count,8,3                 ## @part_count
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"bootloader"

L_.str.1:                               ## @.str.1
	.asciz	"boot_env"

L_.str.2:                               ## @.str.2
	.asciz	"full_image"

	.comm	_MTD_WRITEABLE,4,2              ## @MTD_WRITEABLE
	.no_dead_strip	_titan_add_partition
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function titan_add_partition
_titan_add_partition:                   ; @titan_add_partition
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x0
Lloh0:
	adrp	x21, _titan_parts@GOTPAGE
Lloh1:
	ldr	x21, [x21, _titan_parts@GOTPAGEOFF]
Lloh2:
	adrp	x20, _part_count@GOTPAGE
Lloh3:
	ldr	x20, [x20, _part_count@GOTPAGEOFF]
	ldr	x8, [x21]
	ldr	x9, [x20]
	add	x9, x9, x9, lsl #1
	lsl	x9, x9, #3
	str	x0, [x8, x9]
	ldr	x8, [x21]
	add	x8, x8, x9
	sub	w9, w2, w1
	stp	w1, w9, [x8, #8]
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
	bl	_strcmp
	cbz	x0, LBB0_4
; %bb.1:
Lloh6:
	adrp	x1, l_.str.1@PAGE
Lloh7:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_strcmp
	cbz	x0, LBB0_4
; %bb.2:
Lloh8:
	adrp	x1, l_.str.2@PAGE
Lloh9:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_strcmp
	cbz	x0, LBB0_4
; %bb.3:
	mov	w8, #0
	b	LBB0_5
LBB0_4:
Lloh10:
	adrp	x8, _MTD_WRITEABLE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _MTD_WRITEABLE@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
LBB0_5:
	ldr	x9, [x21]
	ldr	x10, [x20]
	mov	w11, #24
	madd	x9, x10, x11, x9
	str	w8, [x9, #16]
	add	x8, x10, #1
	str	x8, [x20]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_titan_parts,8,3                ; @titan_parts
	.comm	_part_count,8,3                 ; @part_count
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"bootloader"

l_.str.1:                               ; @.str.1
	.asciz	"boot_env"

l_.str.2:                               ; @.str.2
	.asciz	"full_image"

	.comm	_MTD_WRITEABLE,4,2              ; @MTD_WRITEABLE
	.no_dead_strip	_titan_add_partition
.subsections_via_symbols
