	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function terratec_s_frequency
_terratec_s_frequency:                  ## @terratec_s_frequency
	.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	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movslq	%esi, %rax
	imulq	$1717986919, %rax, %rbx         ## imm = 0x66666667
	movq	%rbx, %rax
	shrq	$63, %rax
	sarq	$38, %rbx
	addl	%eax, %ebx
	leaq	-80(%rbp), %rdi
	xorl	%esi, %esi
	movl	$25, %edx
	callq	_memset
	leal	(%rbx,%rbx,4), %eax
	addl	%eax, %eax
	addl	$10700, %eax                    ## imm = 0x29CC
	je	LBB0_8
## %bb.1:
	movslq	%eax, %rcx
	leaq	-67(%rbp), %rsi
	movl	$102400, %edi                   ## imm = 0x19000
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	setne	(%rsi)
	movl	%edi, %eax
	shrl	$31, %eax
	addl	%edi, %eax
	sarl	%eax
	decq	%rsi
	movl	%eax, %edi
	subq	%rbx, %rcx
	je	LBB0_8
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movslq	%edi, %rbx
	movq	%rcx, %rax
	orq	%rbx, %rax
	shrq	$32, %rax
	je	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%rcx, %rax
	cqto
	idivq	%rbx
	cmpq	%rcx, %rdx
	jne	LBB0_7
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	%ecx, %eax
	xorl	%edx, %edx
	divl	%edi
                                        ## kill: def $edx killed $edx def $rdx
	cmpq	%rcx, %rdx
	jne	LBB0_7
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	$0, %ebx
	jmp	LBB0_7
LBB0_8:
	movl	$25, %ebx
	movq	_WRT_EN@GOTPCREL(%rip), %r15
	movq	_DATA@GOTPCREL(%rip), %r13
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_9 Depth=1
	orl	(%r13), %edi
	movl	(%r14), %esi
	callq	_outb
	movl	(%r13), %edi
	orl	(%r15), %edi
	movq	_CLK_ON@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
	movq	%r13, %r12
LBB0_12:                                ##   in Loop: Header=BB0_9 Depth=1
	movl	(%r14), %esi
	callq	_outb
	movl	(%r12), %edi
	orl	(%r15), %edi
	movl	(%r14), %esi
	callq	_outb
	decq	%rbx
	je	LBB0_13
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	cmpb	$1, -81(%rbp,%rbx)
	movl	(%r15), %edi
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	_CLK_ON@GOTPCREL(%rip), %r12
	jmp	LBB0_12
LBB0_13:
	movl	(%r14), %esi
	xorl	%edi, %edi
	callq	_outb
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_15
## %bb.14:
	xorl	%eax, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_WRT_EN,4,2                     ## @WRT_EN
	.comm	_DATA,4,2                       ## @DATA
	.comm	_CLK_ON,4,2                     ## @CLK_ON
	.no_dead_strip	_terratec_s_frequency
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function terratec_s_frequency
_terratec_s_frequency:                  ; @terratec_s_frequency
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #40]
	mov	w8, #26215
	movk	w8, #26214, lsl #16
	smull	x8, w1, w8
	lsr	x9, x8, #63
	asr	x8, x8, #38
	add	w21, w8, w9
	add	x20, sp, #15
	add	x0, sp, #15
	mov	w1, #0
	mov	w2, #25
	bl	_memset
	mov	w8, #10
	mov	w9, #10700
	madd	w8, w21, w8, w9
	cbz	w8, LBB0_3
; %bb.1:
	sxtw	x8, w8
	add	x9, x20, #13
	mov	w10, #36864
	movk	w10, #1, lsl #16
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	sxtw	x11, w10
	sdiv	x12, x8, x11
	msub	x12, x12, x11, x8
	cmp	x12, x8
	csel	x11, xzr, x11, eq
	cset	w12, ne
	strb	w12, [x9], #-1
	cmp	w10, #0
	cinc	w10, w10, lt
	asr	w10, w10, #1
	sub	x8, x8, x11
	cbnz	x8, LBB0_2
LBB0_3:
	mov	w21, #24
Lloh3:
	adrp	x22, _WRT_EN@GOTPAGE
Lloh4:
	ldr	x22, [x22, _WRT_EN@GOTPAGEOFF]
Lloh5:
	adrp	x23, _CLK_ON@GOTPAGE
Lloh6:
	ldr	x23, [x23, _CLK_ON@GOTPAGEOFF]
Lloh7:
	adrp	x24, _DATA@GOTPAGE
Lloh8:
	ldr	x24, [x24, _DATA@GOTPAGEOFF]
	b	LBB0_6
LBB0_4:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	w8, [x24]
	orr	w0, w8, w0
	ldr	w1, [x19]
	bl	_outb
	ldr	w8, [x22]
	ldr	w9, [x24]
	orr	w8, w9, w8
	ldr	w9, [x23]
	orr	w0, w8, w9
	mov	x25, x24
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	w1, [x19]
	bl	_outb
	ldr	w8, [x22]
	ldr	w9, [x25]
	orr	w0, w9, w8
	ldr	w1, [x19]
	bl	_outb
	sub	x21, x21, #1
	cmn	x21, #1
	b.eq	LBB0_8
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldrb	w8, [x20, x21]
	ldr	w0, [x22]
	cmp	w8, #1
	b.eq	LBB0_4
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x25, x23
	b	LBB0_5
LBB0_8:
	ldr	w1, [x19]
	mov	w0, #0
	bl	_outb
	ldr	x8, [sp, #40]
Lloh9:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh10:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_10
; %bb.9:
	mov	w0, #0
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_10:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_WRT_EN,4,2                     ; @WRT_EN
	.comm	_DATA,4,2                       ; @DATA
	.comm	_CLK_ON,4,2                     ; @CLK_ON
	.no_dead_strip	_terratec_s_frequency
.subsections_via_symbols
