	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function smmu_pmu_event_add
_smmu_pmu_event_add:                    ## @smmu_pmu_event_add
	.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
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movl	(%rdi), %edi
	callq	_to_smmu_pmu
	movq	%rax, %r15
	movq	%rax, %rdi
	movq	%rbx, %rsi
	callq	_smmu_pmu_get_event_idx
	movl	%eax, %r13d
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movl	%r13d, 4(%rbx)
	movq	_PERF_HES_STOPPED@GOTPCREL(%rip), %rax
	movq	_PERF_HES_UPTODATE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movl	%ecx, 8(%rbx)
	movq	(%r15), %rax
	movl	%r13d, %ecx
	movq	%rbx, (%rax,%rcx,8)
	leaq	12(%rbx), %rdi
	xorl	%r12d, %r12d
	xorl	%esi, %esi
	callq	_local64_set
	movq	%r15, %rdi
	movl	%r13d, %esi
	callq	_smmu_pmu_interrupt_enable
	movq	_PERF_EF_START@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_4
## %bb.3:
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_smmu_pmu_event_start
LBB0_4:
	movq	%rbx, %rdi
	callq	_perf_event_update_userpage
	jmp	LBB0_5
LBB0_1:
	movl	%r13d, %r12d
LBB0_5:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PERF_HES_STOPPED,4,2           ## @PERF_HES_STOPPED
	.comm	_PERF_HES_UPTODATE,4,2          ## @PERF_HES_UPTODATE
	.comm	_PERF_EF_START,4,2              ## @PERF_EF_START
	.no_dead_strip	_smmu_pmu_event_add
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function smmu_pmu_event_add
_smmu_pmu_event_add:                    ; @smmu_pmu_event_add
	.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	x20, x1
	mov	x19, x0
	ldr	w0, [x0]
	bl	_to_smmu_pmu
	mov	x22, x0
	mov	x1, x19
	bl	_smmu_pmu_get_event_idx
	mov	x21, x0
	tbnz	w0, #31, LBB0_4
; %bb.1:
Lloh0:
	adrp	x8, _PERF_HES_STOPPED@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PERF_HES_STOPPED@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _PERF_HES_UPTODATE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _PERF_HES_UPTODATE@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w8, w9, w8
	stp	w21, w8, [x19, #4]
	ldr	x8, [x22]
	str	x19, [x8, w21, uxtw #3]
	add	x0, x19, #12
	mov	w1, #0
	bl	_local64_set
	mov	x0, x22
	mov	x1, x21
	bl	_smmu_pmu_interrupt_enable
Lloh6:
	adrp	x8, _PERF_EF_START@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PERF_EF_START@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_3
; %bb.2:
	mov	x0, x19
	mov	x1, x20
	bl	_smmu_pmu_event_start
LBB0_3:
	mov	x0, x19
	bl	_perf_event_update_userpage
	mov	w21, #0
LBB0_4:
	mov	x0, x21
	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 AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_PERF_HES_STOPPED,4,2           ; @PERF_HES_STOPPED
	.comm	_PERF_HES_UPTODATE,4,2          ; @PERF_HES_UPTODATE
	.comm	_PERF_EF_START,4,2              ; @PERF_EF_START
	.no_dead_strip	_smmu_pmu_event_add
.subsections_via_symbols
