	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function xmb_init_ribbon
_xmb_init_ribbon:                       ## @xmb_init_ribbon
	.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	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	xorl	%eax, %eax
	callq	_menu_display_get_coords_array
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	movq	_XMB_RIBBON_VERTICES@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	leal	(,%r14,4), %edi
	movl	$4, %esi
	callq	_calloc
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	%r14, -80(%rbp)                 ## 8-byte Spill
	leal	(%r14,%r14), %edi
	movl	$4, %esi
	callq	_calloc
	xorl	%esi, %esi
	movq	%rax, %r12
	movq	_XMB_RIBBON_ROWS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	$1, %eax
	jne	LBB0_1
LBB0_8:
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, -128(%rbp)
	movq	%r12, -120(%rbp)
	movq	%rbx, -112(%rbp)
	movq	%rbx, -104(%rbp)
	movq	-80(%rbp), %rdx                 ## 8-byte Reload
	movl	%edx, -96(%rbp)
	leaq	-128(%rbp), %rsi
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_video_coord_array_append
	movq	%rbx, %rdi
	callq	_free
	movq	%r12, %rdi
	callq	_free
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	_XMB_RIBBON_COLS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r15d
	xorl	%r14d, %r14d
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_2 Depth=1
	incl	%esi
	xorl	%r15d, %r15d
	movl	%esi, %edx
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	leal	-1(%rax), %ecx
	movl	%edx, %esi
	cmpl	%ecx, %edx
	jae	LBB0_8
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_5 Depth 2
	testl	%r15d, %r15d
	je	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	leal	1(%rsi), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	xorl	%r12d, %r12d
	movl	$-1, %r13d
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_5:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	addl	%r13d, %r15d
	testb	$1, %sil
	cmovel	%r12d, %r15d
	movq	%rbx, %rdi
	movl	%r14d, %esi
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	movl	%r15d, %ecx
	callq	_xmb_ribbon_set_vertex
	leal	2(%r14), %esi
	movq	%rbx, %rdi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movl	%r15d, %ecx
	callq	_xmb_ribbon_set_vertex
	movq	_XMB_RIBBON_COLS@GOTPCREL(%rip), %rax
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	addl	$4, %r14d
	incl	%r12d
	movl	(%rax), %r15d
	decl	%r13d
	cmpl	%r12d, %r15d
	ja	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_XMB_RIBBON_ROWS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_XMB_RIBBON_VERTICES,4,2        ## @XMB_RIBBON_VERTICES
	.comm	_XMB_RIBBON_ROWS,4,2            ## @XMB_RIBBON_ROWS
	.comm	_XMB_RIBBON_COLS,4,2            ## @XMB_RIBBON_COLS
	.no_dead_strip	_xmb_init_ribbon
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function xmb_init_ribbon
_xmb_init_ribbon:                       ; @xmb_init_ribbon
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x28, x27, [sp, #64]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #80]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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
	bl	_menu_display_get_coords_array
	str	x0, [sp, #16]                   ; 8-byte Folded Spill
Lloh0:
	adrp	x8, _XMB_RIBBON_VERTICES@GOTPAGE
Lloh1:
	ldr	x8, [x8, _XMB_RIBBON_VERTICES@GOTPAGEOFF]
Lloh2:
	ldr	w19, [x8]
	lsl	w0, w19, #2
	mov	w1, #4
	bl	_calloc
	mov	x21, x0
	str	w19, [sp, #12]                  ; 4-byte Folded Spill
	lsl	w0, w19, #1
	mov	w1, #4
	bl	_calloc
	mov	x22, x0
Lloh3:
	adrp	x27, _XMB_RIBBON_ROWS@GOTPAGE
Lloh4:
	ldr	x27, [x27, _XMB_RIBBON_ROWS@GOTPAGEOFF]
	ldr	w9, [x27]
	cmp	w9, #1
	b.ne	LBB0_2
LBB0_1:
	stp	x21, x22, [sp, #24]
	stp	x21, x21, [sp, #40]
	ldr	w2, [sp, #12]                   ; 4-byte Folded Reload
	str	w2, [sp, #56]
	add	x1, sp, #24
	ldr	x0, [sp, #16]                   ; 8-byte Folded Reload
	bl	_video_coord_array_append
	mov	x0, x21
	bl	_free
	mov	x0, x22
	bl	_free
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
LBB0_2:
	mov	w25, #0
	mov	w23, #0
Lloh5:
	adrp	x28, _XMB_RIBBON_COLS@GOTPAGE
Lloh6:
	ldr	x28, [x28, _XMB_RIBBON_COLS@GOTPAGEOFF]
	ldr	w8, [x28]
	b	LBB0_5
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	w24, w25, #1
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	sub	w10, w9, #1
	mov	x25, x24
	cmp	w24, w10
	b.hs	LBB0_1
LBB0_5:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
	cbz	w8, LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	w19, #0
	add	w24, w25, #1
	mov	w20, #-1
LBB0_7:                                 ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	add	w8, w8, w20
	tst	w25, #0x1
	csel	w26, w19, w8, eq
	mov	x0, x22
	mov	x1, x23
	mov	x2, x25
	mov	x3, x26
	bl	_xmb_ribbon_set_vertex
	add	w1, w23, #2
	mov	x0, x22
	mov	x2, x24
	mov	x3, x26
	bl	_xmb_ribbon_set_vertex
	add	w23, w23, #4
	add	w19, w19, #1
	ldr	w8, [x28]
	sub	w20, w20, #1
	cmp	w8, w19
	b.hi	LBB0_7
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w9, [x27]
	b	LBB0_4
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_XMB_RIBBON_VERTICES,4,2        ; @XMB_RIBBON_VERTICES
	.comm	_XMB_RIBBON_ROWS,4,2            ; @XMB_RIBBON_ROWS
	.comm	_XMB_RIBBON_COLS,4,2            ; @XMB_RIBBON_COLS
	.no_dead_strip	_xmb_init_ribbon
.subsections_via_symbols
