	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function calculate_freq_for_card
_calculate_freq_for_card:               ## @calculate_freq_for_card
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
                                        ## kill: def $esi killed $esi def $rsi
	movl	(%rdi), %r8d
	testl	%esi, %esi
	je	LBB0_1
## %bb.2:
	leal	(%rsi,%rsi), %r9d
	xorl	%ecx, %ecx
	cmpl	%r9d, %r8d
	jbe	LBB0_4
## %bb.3:
	movl	%r8d, %eax
	xorl	%edx, %edx
	divl	%r9d
	movl	%eax, %ecx
	decl	%ecx
LBB0_4:
	leal	1(%rcx), %r9d
	leal	(%rcx,%rcx), %r10d
	addl	$2, %r10d
	movl	%r8d, %eax
	xorl	%edx, %edx
	divl	%r10d
	cmpl	%esi, %eax
	cmovbel	%ecx, %r9d
	cmpl	$400001, %esi                   ## imm = 0x61A81
	movl	$1000, %eax                     ## imm = 0x3E8
	movl	$1000000, %ecx                  ## imm = 0xF4240
	cmovbl	%eax, %ecx
	jmp	LBB0_5
LBB0_1:
	xorl	%r9d, %r9d
	cmpl	$2, %r8d
	setae	%r9b
	movl	$1000, %ecx                     ## imm = 0x3E8
LBB0_5:
	leal	(%r9,%r9), %esi
	addl	$2, %esi
	movl	%r8d, %eax
	xorl	%edx, %edx
	divl	%esi
	xorl	%edx, %edx
	divl	%ecx
	movl	%eax, %ecx
	movl	$1000000, %eax                  ## imm = 0xF4240
	xorl	%edx, %edx
	divl	%ecx
	movl	%eax, 4(%rdi)
	movl	%r9d, %eax
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_calculate_freq_for_card
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function calculate_freq_for_card
_calculate_freq_for_card:               ; @calculate_freq_for_card
	.cfi_startproc
; %bb.0:
	mov	w9, #16960
	movk	w9, #15, lsl #16
	ldr	w10, [x0]
	cbz	w1, LBB0_3
; %bb.1:
	lsl	w8, w1, #1
	cmp	w10, w8
	b.ls	LBB0_4
; %bb.2:
	udiv	w8, w10, w8
	sub	w8, w8, #1
	b	LBB0_5
LBB0_3:
	cmp	w10, #1
	cset	w8, hi
	mov	w11, #1000
	b	LBB0_6
LBB0_4:
	mov	w8, #0
LBB0_5:
	add	w11, w8, #1
	lsl	w11, w11, #1
	udiv	w11, w10, w11
	cmp	w11, w1
	cinc	w8, w8, hi
	mov	w11, #6785
	movk	w11, #6, lsl #16
	mov	w12, #1000
	cmp	w1, w11
	csel	w11, w12, w9, lo
LBB0_6:
	lsl	w12, w8, #1
	add	w12, w12, #2
	udiv	w10, w10, w12
	udiv	w10, w10, w11
	udiv	w9, w9, w10
	str	w9, [x0, #4]
	mov	x0, x8
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_calculate_freq_for_card
.subsections_via_symbols
