	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_GetAreaPortalBrush             ## -- Begin function GetAreaPortalBrush
	.p2align	4, 0x90
_GetAreaPortalBrush:                    ## @GetAreaPortalBrush
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	movl	(%rdi), %esi
	movq	_nummapbrushes@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	testl	%r9d, %r9d
	setg	%cl
                                        ## implicit-def: $rax
	jle	LBB0_7
## %bb.1:
	testl	%esi, %esi
	je	LBB0_7
## %bb.2:
	movq	_mapbrushes@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_CONTENTS_AREAPORTAL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r8d
	addq	$-16, %rax
	movl	$1, %edi
	movl	%esi, %edx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	$0, 16(%rax)
	jne	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	24(%rax), %ecx
	andl	%r8d, %ecx
	cmpl	$1, %ecx
	adcl	$-1, %edx
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	addq	$16, %rax
	cmpq	%r9, %rdi
	setb	%cl
	jae	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	incq	%rdi
	testl	%edx, %edx
	jne	LBB0_3
LBB0_7:
	testb	%cl, %cl
	jne	LBB0_9
## %bb.8:
	leaq	L_.str(%rip), %rdi
	callq	_Log_Print
	xorl	%eax, %eax
LBB0_9:
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_nummapbrushes,4,2              ## @nummapbrushes
	.comm	_mapbrushes,8,3                 ## @mapbrushes
	.comm	_CONTENTS_AREAPORTAL,4,2        ## @CONTENTS_AREAPORTAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"area portal %d brush not found\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_GetAreaPortalBrush             ; -- Begin function GetAreaPortalBrush
	.p2align	2
_GetAreaPortalBrush:                    ; @GetAreaPortalBrush
	.cfi_startproc
; %bb.0:
	stp	x29, x30, [sp, #-16]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 16
	mov	x29, sp
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
Lloh0:
	adrp	x8, _nummapbrushes@GOTPAGE
Lloh1:
	ldr	x8, [x8, _nummapbrushes@GOTPAGEOFF]
	ldr	w1, [x0]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, #0
	cset	w12, gt
	cmp	w8, #1
	ccmp	w1, #0, #4, ge
	b.ne	LBB0_2
; %bb.1:
                                        ; implicit-def: $x0
	b	LBB0_7
LBB0_2:
Lloh3:
	adrp	x9, _mapbrushes@GOTPAGE
Lloh4:
	ldr	x9, [x9, _mapbrushes@GOTPAGEOFF]
Lloh5:
	ldr	x10, [x9]
Lloh6:
	adrp	x9, _CONTENTS_AREAPORTAL@GOTPAGE
Lloh7:
	ldr	x9, [x9, _CONTENTS_AREAPORTAL@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	sub	x0, x10, #16
	mov	w10, #1
	mov	x11, x1
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x12, [x0, #16]
	cbnz	x12, LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w12, [x0, #24]
	tst	w9, w12
	cset	w12, ne
	sub	w11, w11, w12
LBB0_5:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x0, x0, #16
	cmp	x10, x8
	cset	w12, lo
	b.hs	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x10, x10, #1
	cbnz	w11, LBB0_3
LBB0_7:
	tbnz	w12, #0, LBB0_9
; %bb.8:
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	bl	_Log_Print
	mov	x0, #0
LBB0_9:
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_nummapbrushes,4,2              ; @nummapbrushes
	.comm	_mapbrushes,8,3                 ; @mapbrushes
	.comm	_CONTENTS_AREAPORTAL,4,2        ; @CONTENTS_AREAPORTAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"area portal %d brush not found\n"

.subsections_via_symbols
