	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sgi_timer_set
_sgi_timer_set:                         ## @sgi_timer_set
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rbx
	movl	%esi, %r14d
	movq	%rdi, %r12
	testq	%rcx, %rcx
	je	LBB0_2
## %bb.1:
	movq	%r12, %rdi
	movq	%rcx, %rsi
	callq	_sgi_timer_get
LBB0_2:
	movq	%r12, %rdi
	callq	_sgi_timer_del
	leaq	4(%rbx), %rdi
	callq	_timespec_to_ns
	movq	%rax, %r13
	movq	%rbx, %rdi
	callq	_timespec_to_ns
	testq	%r13, %r13
	je	LBB0_3
## %bb.4:
	movq	%rax, %r15
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$16, %edi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	_TIMER_ABSTIME@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_8
## %bb.7:
	leaq	-72(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_getnstimeofday
	movq	%rbx, %rdi
	callq	_timespec_to_ns
	xorl	%ecx, %ecx
	subq	%rax, %r13
	cmovbq	%rcx, %r13
LBB0_8:
	movq	_sgi_clock_period@GOTPCREL(%rip), %r14
	movq	(%r14), %rcx
	leaq	(%rcx,%r13), %rax
	decq	%rax
	movq	%rax, %rdx
	orq	%rcx, %rdx
	shrq	$32, %rdx
	je	LBB0_9
## %bb.10:
	xorl	%edx, %edx
	divq	%rcx
	movq	%rax, %rbx
	jmp	LBB0_11
LBB0_3:
	xorl	%r15d, %r15d
	jmp	LBB0_20
LBB0_5:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_20
LBB0_9:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%ecx
	movl	%eax, %ebx
LBB0_11:
	xorl	%eax, %eax
	callq	_rtc_time
	addq	%rbx, %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	(%r14), %rcx
	leaq	(%r15,%rcx), %rax
	decq	%rax
	movq	%rax, %rdx
	orq	%rcx, %rdx
	shrq	$32, %rdx
	je	LBB0_12
## %bb.13:
	xorl	%edx, %edx
	divq	%rcx
	jmp	LBB0_14
LBB0_12:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $eax killed $eax def $rax
LBB0_14:
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_preempt_disable
	xorl	%eax, %eax
	callq	_smp_processor_id
	movl	%eax, %edi
	callq	_cpu_to_node
	movq	%rax, %r14
	movq	_timers@GOTPCREL(%rip), %rax
	movq	%r14, %rbx
	shlq	$4, %rbx
	movq	(%rax), %rdi
	addq	%rbx, %rdi
	callq	_spin_lock_irqsave
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	movq	%r12, 8(%r13)
	xorl	%eax, %eax
	callq	_smp_processor_id
	movl	%eax, (%r13)
	movq	_TIMER_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%r12)
	movq	%r14, (%r12)
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 8(%r12)
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 16(%r12)
	movq	_timers@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rax
	movq	8(%rax,%rbx), %r12
	movq	%r13, %rdi
	movq	%rcx, %r13
	callq	_mmtimer_add_list
	movq	(%r13), %rdi
	cmpq	%r12, 8(%rdi,%rbx)
	je	LBB0_15
## %bb.16:
	testq	%r12, %r12
	je	LBB0_18
## %bb.17:
	movq	%r14, %rdi
	callq	_cnodeid_to_nasid
	movq	_COMPARATOR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	callq	_mmtimer_disable_int
LBB0_18:
	movq	%r14, %rdi
	callq	_mmtimer_set_next_timer
	addq	(%r13), %rbx
	movq	%rbx, %rdi
	callq	_spin_unlock_irqrestore
	xorl	%r15d, %r15d
	jmp	LBB0_19
LBB0_15:
	addq	%rbx, %rdi
	callq	_spin_unlock_irqrestore
LBB0_19:
	xorl	%eax, %eax
	callq	_preempt_enable
LBB0_20:
	movl	%r15d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_TIMER_ABSTIME,4,2              ## @TIMER_ABSTIME
	.comm	_sgi_clock_period,8,3           ## @sgi_clock_period
	.comm	_timers,8,3                     ## @timers
	.comm	_TIMER_SET,4,2                  ## @TIMER_SET
	.comm	_COMPARATOR,4,2                 ## @COMPARATOR
	.no_dead_strip	_sgi_timer_set
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sgi_timer_set
_sgi_timer_set:                         ; @sgi_timer_set
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x20, x2
	mov	x23, x1
	mov	x19, x0
	cbz	x3, LBB0_2
; %bb.1:
	mov	x0, x19
	mov	x1, x3
	bl	_sgi_timer_get
LBB0_2:
	mov	x0, x19
	bl	_sgi_timer_del
	add	x0, x20, #4
	bl	_timespec_to_ns
	mov	x22, x0
	mov	x0, x20
	bl	_timespec_to_ns
	cbz	x22, LBB0_11
; %bb.3:
	mov	x21, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #16
	bl	_kmalloc
	cbz	x0, LBB0_12
; %bb.4:
	mov	x20, x0
Lloh3:
	adrp	x8, _TIMER_ABSTIME@GOTPAGE
Lloh4:
	ldr	x8, [x8, _TIMER_ABSTIME@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	tst	w8, w23
	b.eq	LBB0_6
; %bb.5:
	add	x0, sp, #8
	bl	_getnstimeofday
	add	x0, sp, #8
	bl	_timespec_to_ns
	subs	x8, x22, x0
	csel	x22, xzr, x8, lo
LBB0_6:
Lloh6:
	adrp	x23, _sgi_clock_period@GOTPAGE
Lloh7:
	ldr	x23, [x23, _sgi_clock_period@GOTPAGEOFF]
	ldr	x8, [x23]
	add	x9, x22, x8
	sub	x9, x9, #1
	udiv	x22, x9, x8
	bl	_rtc_time
	add	x24, x0, x22
	ldr	x8, [x23]
	add	x9, x21, x8
	sub	x9, x9, #1
	udiv	x23, x9, x8
	bl	_preempt_disable
	bl	_smp_processor_id
	bl	_cpu_to_node
	mov	x21, x0
Lloh8:
	adrp	x22, _timers@GOTPAGE
Lloh9:
	ldr	x22, [x22, _timers@GOTPAGEOFF]
	ldr	x8, [x22]
	lsl	x25, x0, #4
	add	x0, x8, x25
	bl	_spin_lock_irqsave
	str	x19, [x20, #8]
	bl	_smp_processor_id
	str	w0, [x20]
Lloh10:
	adrp	x8, _TIMER_SET@GOTPAGE
Lloh11:
	ldr	x8, [x8, _TIMER_SET@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	str	w8, [x19, #24]
	stp	x21, x23, [x19]
	str	x24, [x19, #16]
	ldr	x8, [x22]
	add	x8, x8, x25
	ldr	x19, [x8, #8]
	mov	x0, x20
	bl	_mmtimer_add_list
	ldr	x8, [x22]
	add	x9, x8, x25
	ldr	x9, [x9, #8]
	cmp	x9, x19
	b.eq	LBB0_10
; %bb.7:
	cbz	x19, LBB0_9
; %bb.8:
	mov	x0, x21
	bl	_cnodeid_to_nasid
Lloh13:
	adrp	x8, _COMPARATOR@GOTPAGE
Lloh14:
	ldr	x8, [x8, _COMPARATOR@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	bl	_mmtimer_disable_int
LBB0_9:
	mov	x0, x21
	bl	_mmtimer_set_next_timer
	ldr	x8, [x22]
LBB0_10:
	add	x0, x8, x21, lsl #4
	bl	_spin_unlock_irqrestore
	bl	_preempt_enable
LBB0_11:
	mov	w0, #0
	b	LBB0_13
LBB0_12:
Lloh16:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_13:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_TIMER_ABSTIME,4,2              ; @TIMER_ABSTIME
	.comm	_sgi_clock_period,8,3           ; @sgi_clock_period
	.comm	_timers,8,3                     ; @timers
	.comm	_TIMER_SET,4,2                  ; @TIMER_SET
	.comm	_COMPARATOR,4,2                 ; @COMPARATOR
	.no_dead_strip	_sgi_timer_set
.subsections_via_symbols
