	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CheckArmor                     ## -- Begin function CheckArmor
	.p2align	4, 0x90
_CheckArmor:                            ## @CheckArmor
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	xorl	%ebx, %ebx
	testl	%esi, %esi
	je	LBB0_5
## %bb.1:
	movq	(%rdi), %r14
	testq	%r14, %r14
	je	LBB0_5
## %bb.2:
	movq	_DAMAGE_NO_ARMOR@GOTPCREL(%rip), %rax
	testl	%edx, (%rax)
	jne	LBB0_5
## %bb.3:
	movq	(%r14), %rax
	movq	_STAT_ARMOR@GOTPCREL(%rip), %r12
	movq	(%r12), %rcx
	movl	(%rax,%rcx,4), %r15d
	movq	_ARMOR_PROTECTION@GOTPCREL(%rip), %rax
	imull	(%rax), %esi
	movl	%esi, %edi
	callq	_ceil
	cmpl	%r15d, %eax
	cmovll	%eax, %r15d
	testl	%r15d, %r15d
	je	LBB0_5
## %bb.4:
	movq	(%r14), %rax
	movq	(%r12), %rcx
	subl	%r15d, (%rax,%rcx,4)
	movl	%r15d, %ebx
LBB0_5:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DAMAGE_NO_ARMOR,4,2            ## @DAMAGE_NO_ARMOR
	.comm	_STAT_ARMOR,8,3                 ## @STAT_ARMOR
	.comm	_ARMOR_PROTECTION,4,2           ## @ARMOR_PROTECTION
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CheckArmor                     ; -- Begin function CheckArmor
	.p2align	2
_CheckArmor:                            ; @CheckArmor
	.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
	cbz	w1, LBB0_3
; %bb.1:
	ldr	x19, [x0]
	cbz	x19, LBB0_3
; %bb.2:
Lloh0:
	adrp	x8, _DAMAGE_NO_ARMOR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DAMAGE_NO_ARMOR@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	tst	w8, w2
	b.eq	LBB0_5
LBB0_3:
	mov	w0, #0
LBB0_4:
	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
LBB0_5:
	ldr	x8, [x19]
Lloh3:
	adrp	x20, _STAT_ARMOR@GOTPAGE
Lloh4:
	ldr	x20, [x20, _STAT_ARMOR@GOTPAGEOFF]
	ldr	x9, [x20]
	ldr	w21, [x8, x9, lsl #2]
Lloh5:
	adrp	x8, _ARMOR_PROTECTION@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ARMOR_PROTECTION@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	mul	w0, w8, w1
	bl	_ceil
	cmp	w0, w21
	csel	w0, w0, w21, lt
	cbz	w0, LBB0_4
; %bb.6:
	ldr	x8, [x19]
	ldr	x9, [x20]
	lsl	x9, x9, #2
	ldr	w10, [x8, x9]
	sub	w10, w10, w0
	str	w10, [x8, x9]
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_DAMAGE_NO_ARMOR,4,2            ; @DAMAGE_NO_ARMOR
	.comm	_STAT_ARMOR,8,3                 ; @STAT_ARMOR
	.comm	_ARMOR_PROTECTION,4,2           ; @ARMOR_PROTECTION
.subsections_via_symbols
