	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CG_PainEvent                   ## -- Begin function CG_PainEvent
	.p2align	4, 0x90
_CG_PainEvent:                          ## @CG_PainEvent
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_cg@GOTPCREL(%rip), %r13
	movl	(%r13), %eax
	subl	(%rdi), %eax
	cmpl	$500, %eax                      ## imm = 0x1F4
	jl	LBB0_13
## %bb.1:
	movq	%rdi, %rbx
	cmpl	$25, %esi
	jge	LBB0_3
## %bb.2:
	leaq	L_.str(%rip), %r14
	jmp	LBB0_6
LBB0_3:
	cmpl	$50, %esi
	jae	LBB0_5
## %bb.4:
	leaq	L_.str.1(%rip), %r14
	jmp	LBB0_6
LBB0_5:
	cmpl	$75, %esi
	leaq	L_.str.2(%rip), %rax
	leaq	L_.str.3(%rip), %r14
	cmovbq	%rax, %r14
LBB0_6:
	movq	%rbx, %rdi
	callq	_CG_WaterLevel
	cmpl	$3, %eax
	jne	LBB0_11
## %bb.7:
	xorl	%eax, %eax
	callq	_rand
	movl	8(%rbx), %r14d
	movq	_CHAN_VOICE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r15d
	testb	$1, %al
	jne	LBB0_8
## %bb.10:
	leaq	L_.str.5(%rip), %rsi
	jmp	LBB0_9
LBB0_11:
	movl	8(%rbx), %r15d
	movq	_CHAN_VOICE@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movl	%r15d, %edi
	movq	%r14, %rsi
	callq	_CG_CustomSound
	xorl	%edi, %edi
	movl	%r15d, %esi
	movl	%r12d, %edx
	jmp	LBB0_12
LBB0_8:
	leaq	L_.str.4(%rip), %rsi
LBB0_9:
	movl	%r14d, %edi
	callq	_CG_CustomSound
	xorl	%edi, %edi
	movl	%r14d, %esi
	movl	%r15d, %edx
LBB0_12:
	movl	%eax, %ecx
	callq	_trap_S_StartSound
	movl	(%r13), %eax
	movl	%eax, (%rbx)
	xorb	$1, 4(%rbx)
LBB0_13:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_cg,4,2                         ## @cg
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"*pain25_1.wav"

L_.str.1:                               ## @.str.1
	.asciz	"*pain50_1.wav"

L_.str.2:                               ## @.str.2
	.asciz	"*pain75_1.wav"

L_.str.3:                               ## @.str.3
	.asciz	"*pain100_1.wav"

	.comm	_CHAN_VOICE,4,2                 ## @CHAN_VOICE
L_.str.4:                               ## @.str.4
	.asciz	"sound/player/gurp1.wav"

L_.str.5:                               ## @.str.5
	.asciz	"sound/player/gurp2.wav"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CG_PainEvent                   ; -- Begin function CG_PainEvent
	.p2align	2
_CG_PainEvent:                          ; @CG_PainEvent
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
Lloh0:
	adrp	x23, _cg@GOTPAGE
Lloh1:
	ldr	x23, [x23, _cg@GOTPAGEOFF]
	ldr	w8, [x23]
	ldr	w9, [x0]
	sub	w8, w8, w9
	cmp	w8, #500
	b.lt	LBB0_8
; %bb.1:
	mov	x19, x0
Lloh2:
	adrp	x8, l_.str@PAGE
Lloh3:
	add	x8, x8, l_.str@PAGEOFF
Lloh4:
	adrp	x9, l_.str.1@PAGE
Lloh5:
	add	x9, x9, l_.str.1@PAGEOFF
Lloh6:
	adrp	x10, l_.str.3@PAGE
Lloh7:
	add	x10, x10, l_.str.3@PAGEOFF
Lloh8:
	adrp	x11, l_.str.2@PAGE
Lloh9:
	add	x11, x11, l_.str.2@PAGEOFF
	cmp	w1, #75
	csel	x10, x11, x10, lo
	cmp	w1, #50
	csel	x9, x9, x10, lo
	cmp	w1, #25
	csel	x20, x8, x9, lt
	bl	_CG_WaterLevel
	cmp	w0, #3
	b.ne	LBB0_4
; %bb.2:
	bl	_rand
	ldr	w20, [x19, #8]
Lloh10:
	adrp	x8, _CHAN_VOICE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _CHAN_VOICE@GOTPAGEOFF]
Lloh12:
	ldr	w21, [x8]
	tbnz	w0, #0, LBB0_5
; %bb.3:
Lloh13:
	adrp	x1, l_.str.5@PAGE
Lloh14:
	add	x1, x1, l_.str.5@PAGEOFF
	b	LBB0_6
LBB0_4:
	ldr	w21, [x19, #8]
Lloh15:
	adrp	x8, _CHAN_VOICE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _CHAN_VOICE@GOTPAGEOFF]
Lloh17:
	ldr	w22, [x8]
	mov	x0, x21
	mov	x1, x20
	bl	_CG_CustomSound
	mov	x3, x0
	mov	x0, #0
	mov	x1, x21
	mov	x2, x22
	b	LBB0_7
LBB0_5:
Lloh18:
	adrp	x1, l_.str.4@PAGE
Lloh19:
	add	x1, x1, l_.str.4@PAGEOFF
LBB0_6:
	mov	x0, x20
	bl	_CG_CustomSound
	mov	x3, x0
	mov	x0, #0
	mov	x1, x20
	mov	x2, x21
LBB0_7:
	bl	_trap_S_StartSound
	ldr	w8, [x23]
	ldr	w9, [x19, #4]
	eor	w9, w9, #0x1
	stp	w8, w9, [x19]
LBB0_8:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_cg,4,2                         ; @cg
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"*pain25_1.wav"

l_.str.1:                               ; @.str.1
	.asciz	"*pain50_1.wav"

l_.str.2:                               ; @.str.2
	.asciz	"*pain75_1.wav"

l_.str.3:                               ; @.str.3
	.asciz	"*pain100_1.wav"

	.comm	_CHAN_VOICE,4,2                 ; @CHAN_VOICE
l_.str.4:                               ; @.str.4
	.asciz	"sound/player/gurp1.wav"

l_.str.5:                               ; @.str.5
	.asciz	"sound/player/gurp2.wav"

.subsections_via_symbols
