	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_proc_apmevent                  ## -- Begin function proc_apmevent
	.p2align	4, 0x90
_proc_apmevent:                         ## @proc_apmevent
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %ebx
	leaq	-56(%rbp), %r14
	leaq	L_.str(%rip), %r15
	movq	_LOG_INFO@GOTPCREL(%rip), %r13
	leaq	L_.str.1(%rip), %r12
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	_APMIO_NEXTEVENT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edi
	movq	%r14, %rdx
	callq	_ioctl
	testq	%rax, %rax
	jne	LBB0_4
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	_LOG_NOTICE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	-56(%rbp), %rdx
	movl	-48(%rbp), %ecx
	movq	%r15, %rsi
	xorl	%eax, %eax
	callq	_syslog
	movl	(%r13), %edi
	movq	_events@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	-56(%rbp), %rcx
	movslq	(%rax,%rcx,4), %rdx
	movq	%r12, %rsi
	xorl	%eax, %eax
	callq	_syslog
	xorl	%eax, %eax
	callq	_fork
	testq	%rax, %rax
	jne	LBB0_1
## %bb.3:
	movq	-56(%rbp), %rdi
	shlq	$2, %rdi
	movq	_events@GOTPCREL(%rip), %rax
	addq	(%rax), %rdi
	callq	_exec_event_cmd
	movl	%eax, %edi
	callq	_exit
LBB0_4:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_APMIO_NEXTEVENT,4,2            ## @APMIO_NEXTEVENT
	.comm	_LOG_NOTICE,4,2                 ## @LOG_NOTICE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"apmevent %04x index %d\n"

	.comm	_LOG_INFO,4,2                   ## @LOG_INFO
L_.str.1:                               ## @.str.1
	.asciz	"apm event: %s"

	.comm	_events,8,3                     ## @events
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_proc_apmevent                  ; -- Begin function proc_apmevent
	.p2align	2
_proc_apmevent:                         ; @proc_apmevent
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	mov	x19, x0
Lloh0:
	adrp	x22, _APMIO_NEXTEVENT@GOTPAGE
Lloh1:
	ldr	x22, [x22, _APMIO_NEXTEVENT@GOTPAGEOFF]
Lloh2:
	adrp	x23, _LOG_NOTICE@GOTPAGE
Lloh3:
	ldr	x23, [x23, _LOG_NOTICE@GOTPAGEOFF]
Lloh4:
	adrp	x20, l_.str@PAGE
Lloh5:
	add	x20, x20, l_.str@PAGEOFF
Lloh6:
	adrp	x25, _LOG_INFO@GOTPAGE
Lloh7:
	ldr	x25, [x25, _LOG_INFO@GOTPAGEOFF]
Lloh8:
	adrp	x24, _events@GOTPAGE
Lloh9:
	ldr	x24, [x24, _events@GOTPAGEOFF]
Lloh10:
	adrp	x21, l_.str.1@PAGE
Lloh11:
	add	x21, x21, l_.str.1@PAGEOFF
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x22]
	add	x2, sp, #16
	mov	x0, x19
	bl	_ioctl
	cbnz	x0, LBB0_4
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w0, [x23]
	ldr	x2, [sp, #16]
	ldr	w8, [sp, #24]
	str	x8, [sp]
	mov	x1, x20
	bl	_syslog
	ldr	w0, [x25]
	ldr	x8, [x24]
	ldr	x9, [sp, #16]
	ldrsw	x2, [x8, x9, lsl #2]
	mov	x1, x21
	bl	_syslog
	bl	_fork
	cbnz	x0, LBB0_1
; %bb.3:
	ldr	x8, [x24]
	ldr	x9, [sp, #16]
	add	x0, x8, x9, lsl #2
	bl	_exec_event_cmd
	bl	_exit
LBB0_4:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_APMIO_NEXTEVENT,4,2            ; @APMIO_NEXTEVENT
	.comm	_LOG_NOTICE,4,2                 ; @LOG_NOTICE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"apmevent %04x index %d\n"

	.comm	_LOG_INFO,4,2                   ; @LOG_INFO
l_.str.1:                               ; @.str.1
	.asciz	"apm event: %s"

	.comm	_events,8,3                     ; @events
.subsections_via_symbols
