	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function apm_set_timer
_apm_set_timer:                         ## @apm_set_timer
	.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
	subq	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movl	%edi, %r14d
	xorl	%edi, %edi
	callq	_time
	movslq	%r15d, %rcx
	addq	%rax, %rcx
	movq	%rcx, -64(%rbp)
	movq	_cmos_wall@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_2
## %bb.1:
	leaq	-64(%rbp), %rdi
	callq	_localtime
	jmp	LBB0_3
LBB0_2:
	leaq	-64(%rbp), %rdi
	callq	_gmtime
LBB0_3:
	movq	%rax, %r12
	leaq	-56(%rbp), %rdi
	movl	$24, %esi
	callq	_bzero
	movq	_APM_BIOS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	shll	$8, %eax
	movq	_APM_RESUMETIMER@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, -56(%rbp)
	movq	_PMDV_APMBIOS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -36(%rbp)
	testl	%r15d, %r15d
	jle	LBB0_5
## %bb.4:
	movq	40(%r12), %rdi
	callq	_int2bcd
	shll	$8, %eax
	orl	$2, %eax
	movl	%eax, -52(%rbp)
	movq	32(%r12), %rdi
	callq	_int2bcd
	movl	%eax, %ebx
	shll	$8, %ebx
	movq	24(%r12), %rdi
	callq	_int2bcd
	orl	%ebx, %eax
	movl	%eax, -48(%rbp)
	movq	16(%r12), %rdi
	incq	%rdi
	callq	_int2bcd
	movl	%eax, %ebx
	shll	$8, %ebx
	movq	8(%r12), %rdi
	callq	_int2bcd
	orl	%ebx, %eax
	movl	%eax, -44(%rbp)
	movl	$1900, %edi                     ## imm = 0x76C
	addq	(%r12), %rdi
	callq	_int2bcd
	movl	%eax, -40(%rbp)
	jmp	LBB0_6
LBB0_5:
	movl	$0, -52(%rbp)
LBB0_6:
	movq	_APMIO_BIOS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-56(%rbp), %rdx
	movl	%r14d, %edi
	callq	_ioctl
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	callq	_err
LBB0_8:
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_cmos_wall,8,3                  ## @cmos_wall
	.comm	_APM_BIOS,4,2                   ## @APM_BIOS
	.comm	_APM_RESUMETIMER,4,2            ## @APM_RESUMETIMER
	.comm	_PMDV_APMBIOS,4,2               ## @PMDV_APMBIOS
	.comm	_APMIO_BIOS,4,2                 ## @APMIO_BIOS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"set resume timer"

	.no_dead_strip	_apm_set_timer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function apm_set_timer
_apm_set_timer:                         ; @apm_set_timer
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x21, x1
	mov	x19, x0
	mov	x0, #0
	bl	_time
	add	x8, x0, w21, sxtw
	str	x8, [sp, #24]
Lloh0:
	adrp	x8, _cmos_wall@GOTPAGE
Lloh1:
	ldr	x8, [x8, _cmos_wall@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cbz	x8, LBB0_2
; %bb.1:
	add	x0, sp, #24
	bl	_localtime
	b	LBB0_3
LBB0_2:
	add	x0, sp, #24
	bl	_gmtime
LBB0_3:
	mov	x20, x0
	mov	x0, sp
	mov	w1, #24
	bl	_bzero
Lloh3:
	adrp	x8, _APM_BIOS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _APM_BIOS@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _APM_RESUMETIMER@GOTPAGE
Lloh7:
	ldr	x9, [x9, _APM_RESUMETIMER@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w8, w9, w8, lsl #8
Lloh9:
	adrp	x9, _PMDV_APMBIOS@GOTPAGE
Lloh10:
	ldr	x9, [x9, _PMDV_APMBIOS@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	str	w8, [sp]
	str	w9, [sp, #20]
	cmp	w21, #1
	b.lt	LBB0_5
; %bb.4:
	ldr	x0, [x20, #40]
	bl	_int2bcd
	mov	w8, #2
	bfi	w8, w0, #8, #24
	str	w8, [sp, #4]
	ldr	x0, [x20, #32]
	bl	_int2bcd
	mov	x21, x0
	ldr	x0, [x20, #24]
	bl	_int2bcd
	orr	w8, w0, w21, lsl #8
	str	w8, [sp, #8]
	ldr	x8, [x20, #16]
	add	x0, x8, #1
	bl	_int2bcd
	mov	x21, x0
	ldr	x0, [x20, #8]
	bl	_int2bcd
	orr	w8, w0, w21, lsl #8
	str	w8, [sp, #12]
	ldr	x8, [x20]
	add	x0, x8, #1900
	bl	_int2bcd
	str	w0, [sp, #16]
	b	LBB0_6
LBB0_5:
	str	wzr, [sp, #4]
LBB0_6:
Lloh12:
	adrp	x8, _APMIO_BIOS@GOTPAGE
Lloh13:
	ldr	x8, [x8, _APMIO_BIOS@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x2, sp
	mov	x0, x19
	bl	_ioctl
	cbz	x0, LBB0_8
; %bb.7:
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_8:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_cmos_wall,8,3                  ; @cmos_wall
	.comm	_APM_BIOS,4,2                   ; @APM_BIOS
	.comm	_APM_RESUMETIMER,4,2            ; @APM_RESUMETIMER
	.comm	_PMDV_APMBIOS,4,2               ; @PMDV_APMBIOS
	.comm	_APMIO_BIOS,4,2                 ; @APMIO_BIOS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"set resume timer"

	.no_dead_strip	_apm_set_timer
.subsections_via_symbols
