// File: /workspace/github_c_makefile_star2_O2/cyb70289[P]tt/src/apn/integer/prime.c
// Function: tt_int_isprime_buf
bool _tt_int_isprime_buf(const _tt_word *ui, int msb)
{
	if (msb == 1 && ui[0] < BIT(31))
		return isprime_naive(ui[0]);

	if ((ui[0] & 0x1) == 0)
		return false;

	if (!maybe_prime(ui, msb))
		return false;

	int bits = (msb - 1) * _tt_word_bits;
	bits += _tt_int_word_bits(ui[msb-1]);
	return isprime_miller_rabin(ui, msb, ml_rounds(bits));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
cmpl $0x1, %esi
sete %al
movq (%rdi), %rcx
testq $-0x80000000, %rcx      # imm = 0x80000000
sete %dl
andb %al, %dl
cmpb $0x1, %dl
jne 0x74ff
movl %ecx, %eax
andl $0x7ffffffe, %eax       # imm = 0x7FFFFFFE
movb $0x1, %bl
cmpl $0x2, %eax
je 0x7cf9
xorl %ebx, %ebx
pushq $0x3
popq %rsi
movl %ecx, %eax
xorl %edx, %edx
divl %esi
testl %edx, %edx
je 0x7cf9
cmpq $0x2, %rcx
jb 0x7cf9
movl %ecx, %eax
andl $0x1, %eax
je 0x7cf9
pushq $0x7
popq %rsi
leal -0x2(%rsi), %edi
movl %edi, %eax
imull %edi, %eax
cmpl %ecx, %eax
seta %bl
ja 0x7cf9
movl %ecx, %eax
xorl %edx, %edx
divl %edi
testl %edx, %edx
je 0x7cf9
movl %ecx, %eax
xorl %edx, %edx
divl %esi
addl $0x6, %esi
testl %edx, %edx
jne 0x74cc
jmp 0x7cf9
xorl %ebx, %ebx
testb $0x1, %cl
je 0x7cf9
movl %esi, %r12d
movq %rdi, 0x10(%rsp)
testl %esi, %esi
movl $0x0, %r13d
cmovgl %esi, %r13d
movabsq $0x7fffffffffffffff, %rcx # imm = 0x7FFFFFFFFFFFFFFF
pushq $0x1
popq %rsi
leaq 0xa74e(%rip), %rdi      # 0x11c80
leaq 0xb627(%rip), %r8       # 0x12b60
cmpq $0x76c, %rsi            # imm = 0x76C
je 0x75a7
movq (%r8,%rsi,8), %r9
xorl %r10d, %r10d
movzwl (%rdi,%rsi,2), %r11d
xorl %eax, %eax
cmpq %r10, %r13
je 0x7599
movl %eax, %ebx
movq 0x10(%rsp), %rax
movq (%rax,%r10,8), %r14
movq %r14, %rax
subq %rbx, %rax
andq %rcx, %rax
movq %r14, %r15
subq %rbx, %r15
cmovbq %rax, %r15
movq %r15, %rax
imulq %r9, %rax
andq %rcx, %rax
mulq %r11
subq %r15, %rax
sbbq $0x0, %rdx
shrq $0x3f, %rax
cmpq %rbx, %r14
leal (%rax,%rdx,2), %eax
adcl $0x0, %eax
incq %r10
jmp 0x7550
incq %rsi
testl %eax, %eax
jne 0x7539
xorl %ebx, %ebx
jmp 0x7cf9
movslq %r12d, %rcx
leaq -0x1(%rcx), %rax
movq %rax, 0xb8(%rsp)
imull $0x3f, %r12d, %ebx
movq 0x10(%rsp), %rax
movq %rcx, 0xc0(%rsp)
movq -0x8(%rax,%rcx,8), %rdi
callq 0x3fcd
addl %ebx, %eax
addl $-0x3f, %eax
xorl %ecx, %ecx
pushq $0x2
popq %rdi
leaq 0xf0de(%rip), %rdx      # 0x166c0
movq %r13, 0xa0(%rsp)
cmpq $0xc, %rcx
je 0x7606
leaq 0x1(%rcx), %rsi
cmpl %eax, (%rdx,%rcx,8)
movq %rsi, %rcx
jg 0x75ea
movl -0x4(%rdx,%rsi,8), %eax
movl %eax, 0x1c(%rsp)
jmp 0x760a
movl %edi, 0x1c(%rsp)
imull $0x38, %r12d, %eax
addl $0x70, %eax
movslq %eax, %rdi
callq 0x1140
leaq 0x100(%rsp), %rbx
andl $0x0, (%rbx)
movq %rax, %r14
movl %r12d, 0x4(%rbx)
movl %r12d, 0x8(%rbx)
movq 0x10(%rsp), %rax
movq %rax, 0x10(%rbx)
callq 0x3e50
movq %rax, %r13
leal 0x1(%r12), %ebp
movq %rax, %rdi
movl %ebp, %esi
callq 0x3ec0
movq 0x10(%r13), %rax
movq 0xc0(%rsp), %r15
movq $0x1, (%rax,%r15,8)
movl %ebp, 0x8(%r13)
callq 0x3e50
movq %rax, %rbp
movq %rax, %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x727c
movq %rbp, 0x60(%rsp)
cmpl $0x0, (%rbp)
jne 0x7698
movq 0x60(%rsp), %rdi
movq %r13, %rsi
movq %rdi, %rdx
callq 0x61ff
leaq 0x2(%r15), %rax
movq %rax, 0x68(%rsp)
movq %r15, %rbx
leaq (%r14,%r15,8), %rax
addq $0x10, %rax
movq %rax, 0x58(%rsp)
callq 0x3e50
leaq 0x100(%rsp), %rcx
xorl %edi, %edi
movq %rax, 0xa8(%rsp)
movq %rax, %rsi
movq %r13, 0xb0(%rsp)
movq %r13, %rdx
callq 0x6311
leal (,%r12,8), %eax
movslq %eax, %rdx
movq %r14, %rdi
movq 0x10(%rsp), %rsi
movq %rdx, 0xc8(%rsp)
callq 0x1120
xorl %r8d, %r8d
movq (%r14), %rdi
decq %rdi
movq %rdi, (%r14)
movq 0xb8(%rsp), %rax
movq 0xa0(%rsp), %r15
movl 0x1c(%rsp), %ebp
testq %rax, %rax
movl $0x0, %ecx
cmovgq %rax, %rcx
testq %rdi, %rdi
jne 0x7750
xorl %edx, %edx
cmpq %rdx, %rcx
je 0x7741
movq 0x8(%r14,%rdx,8), %rsi
movq %rsi, (%r14,%rdx,8)
incq %rdx
jmp 0x772e
decq %rbx
addl $0x3f, %r8d
movq (%r14), %rdi
decq %rax
jmp 0x771b
movq %r8, 0xd8(%rsp)
callq 0x3fe0
negl %eax
movq %r14, %rdi
movl %ebx, %esi
movl %eax, 0x94(%rsp)
movl %eax, %edx
callq 0x40ab
movl %eax, 0x20(%rsp)
callq 0x3e50
movq %rax, 0x48(%rsp)
movq %rax, %rdi
movq 0x68(%rsp), %rbx
movl %ebx, %esi
callq 0x3ec0
movl %ebx, %eax
shll $0x4, %eax
cltq
movq %rax, 0x70(%rsp)
leal (%rbx,%rbx), %eax
cltq
movq 0x58(%rsp), %rcx
leaq (%rcx,%rax,8), %r13
leaq (,%rbx,8), %rax
addq %r13, %rax
decl 0x20(%rsp)
movq %r12, 0x38(%rsp)
movq %r14, 0x30(%rsp)
movq %r13, 0x28(%rsp)
movq %rax, 0x78(%rsp)
subl $0x1, %ebp
setb %bl
jb 0x7cc3
movl %ebx, 0x98(%rsp)
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rbx
xorl %r14d, %r14d
cmpq %r14, %r15
je 0x7812
callq 0x832a
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
shlq $0x20, %rax
movq %rax, (%rbx,%r14,8)
callq 0x832a
movl %eax, %eax
orq %rax, (%rbx,%r14,8)
incq %r14
jmp 0x77eb
movl %ebp, 0x1c(%rsp)
movq 0x10(%rsp), %r14
movq 0xb8(%rsp), %r15
movq (%r14,%r15,8), %rdi
callq 0x3fcd
pushq $-0x1
popq %rdx
movl %eax, %ecx
shlq %cl, %rdx
notq %rdx
andq %rdx, (%rbx,%r15,8)
movq %rbx, %rdi
movl %r12d, %esi
callq 0x4df9
movl %eax, %ebp
movq %rbx, %rdi
movl %eax, %esi
movq %r14, %rdx
movl %r12d, %ecx
callq 0x4dca
testl %eax, %eax
js 0x786e
movq %rbx, %rdi
movl %ebp, %esi
movq %r14, %rdx
movl %r12d, %ecx
callq 0x4d64
movl %eax, %ebp
movq 0x30(%rsp), %r14
cmpl $0x1, %ebp
leaq 0xc(%rsp), %r12
jne 0x7895
movq (%rbx), %rax
cmpq $0x2, %rax
ja 0x7895
callq 0x832a
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq %rax, (%rbx)
jmp 0x7880
movq $0x1, 0xe8(%rsp)
movq %rbx, %rdi
movl %ebp, %esi
movq %r12, %rbp
leaq 0xe8(%rsp), %r15
movq %r15, %rdx
pushq $0x1
popq %rcx
callq 0x4d64
movq 0x48(%rsp), %rbx
movl %eax, 0x8(%rbx)
movq 0x58(%rsp), %r13
movq %r13, %rdi
xorl %esi, %esi
movq 0x70(%rsp), %r12
movq %r12, %rdx
callq 0x10e0
movq 0x10(%rbx), %rsi
movl 0x8(%rbx), %edx
movq 0xb0(%rsp), %rax
movq 0x10(%rax), %rcx
movl 0x8(%rax), %r8d
movq %r13, %rdi
callq 0x4e12
andl $0x0, 0xe8(%rsp)
movl %eax, 0xec(%rsp)
movl %eax, 0xf0(%rsp)
movq %r13, 0xf8(%rsp)
xorl %edi, %edi
movq %rbx, %rsi
movq %r15, %rdx
movq %rbp, %r15
leaq 0x100(%rsp), %rcx
callq 0x6311
movq 0x10(%rbx), %rsi
movslq 0x8(%rbx), %rdx
movq %r12, %rbx
movq 0x60(%rsp), %rax
movq 0x10(%rax), %r12
movl 0x8(%rax), %eax
movl %eax, 0x24(%rsp)
movq 0xa8(%rsp), %rax
movq 0x10(%rax), %rcx
movq %rcx, 0xd0(%rsp)
movl 0x8(%rax), %eax
movl %eax, 0x44(%rsp)
movl %edx, 0xc(%rsp)
movq %rdx, 0xe0(%rsp)
shlq $0x3, %rdx
movq 0x28(%rsp), %r13
movq %r13, %rdi
movq %rsi, 0x50(%rsp)
callq 0x1120
movl 0x20(%rsp), %ecx
movq %r12, 0x80(%rsp)
testl %ecx, %ecx
js 0x7b2d
movl %ecx, %eax
movq (%r14,%rax,8), %r14
movl %ecx, 0x9c(%rsp)
cmpl 0x20(%rsp), %ecx
jne 0x79ce
movq %r14, %rdi
callq 0x3fcd
leal -0x1(%rax), %ebp
negb %al
movl %eax, %ecx
shlq %cl, %r14
movq %r14, 0x88(%rsp)
jmp 0x7b11
movq %r14, 0x88(%rsp)
pushq $0x3f
popq %rbp
jmp 0x7b11
movq 0x58(%rsp), %r14
movq %r14, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x10e0
movl 0xc(%rsp), %edx
movq %r14, %rdi
movq %r13, %rsi
movq %r13, %rcx
movl %edx, %r8d
callq 0x4e12
subq $0x8, %rsp
movq %r14, %rdi
movq %r15, %rsi
movq %r14, %rdx
movl %eax, %ecx
movq %r12, %r8
movl 0x2c(%rsp), %r9d
pushq 0x80(%rsp)
pushq 0x48(%rsp)
pushq 0x28(%rsp)
callq 0x72c0
addq $0x20, %rsp
movq %rbx, %r15
movslq 0xc(%rsp), %r12
movq %r12, %rdx
shlq $0x3, %rdx
movq %r13, %rdi
movq %r14, %rsi
callq 0x1120
movq 0x88(%rsp), %rbx
btq $0x3e, %rbx
jae 0x7ad2
movq %r14, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x10e0
movq %r14, %rdi
movq %r13, %rsi
movl %r12d, %edx
movq 0x50(%rsp), %rcx
movq 0xe0(%rsp), %r8
callq 0x4e12
subq $0x8, %rsp
movq %r14, %rdi
leaq 0x14(%rsp), %rsi
movq %r14, %rdx
movl %eax, %ecx
movq 0x88(%rsp), %r8
movl 0x2c(%rsp), %r9d
pushq 0x80(%rsp)
pushq 0x48(%rsp)
pushq 0x28(%rsp)
callq 0x72c0
addq $0x20, %rsp
movslq 0xc(%rsp), %r12
movq %r12, %rdx
shlq $0x3, %rdx
movq %r13, %rdi
movq %r14, %rsi
callq 0x1120
movslq %r12d, %rax
leaq (,%rax,8), %rdi
addq %r13, %rdi
movq 0x68(%rsp), %rcx
subl %eax, %ecx
shll $0x3, %ecx
movslq %ecx, %rdx
xorl %esi, %esi
callq 0x10e0
addq %rbx, %rbx
movq %rbx, 0x88(%rsp)
movq 0x70(%rsp), %rbx
leaq 0xc(%rsp), %r15
movq 0x80(%rsp), %r12
subl $0x1, %ebp
jae 0x79de
movl 0x9c(%rsp), %ecx
decl %ecx
movq 0x30(%rsp), %r14
jmp 0x7994
movq 0x50(%rsp), %rbx
movq %rbx, %rdi
movq 0x10(%rsp), %rsi
movq 0xc8(%rsp), %rdx
callq 0x1120
movq 0xc0(%rsp), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rbx,%rax,8)
movq %rbx, %rdi
movq 0x38(%rsp), %rsi
movq 0xd0(%rsp), %r12
movq %r12, %rdx
movl 0x44(%rsp), %ebx
movl %ebx, %ecx
callq 0x4d64
movl %eax, %r14d
movl 0xc(%rsp), %esi
movq %r13, %rdi
movq %r12, %rdx
movl %ebx, %ecx
callq 0x4dca
testl %eax, %eax
je 0x7c92
movl 0xc(%rsp), %esi
movq %r13, %rdi
movq 0x50(%rsp), %rdx
movl %r14d, %ecx
callq 0x4dca
testl %eax, %eax
je 0x7c92
movl 0x94(%rsp), %ebp
incl %ebp
cmpl %ebp, 0xd8(%rsp)
je 0x7cb7
movq 0x58(%rsp), %r13
movq %r13, %rdi
xorl %esi, %esi
movq 0x70(%rsp), %rdx
callq 0x10e0
movl 0xc(%rsp), %edx
movq %r13, %rdi
movq 0x28(%rsp), %rsi
movq 0x28(%rsp), %rcx
movl %edx, %r8d
callq 0x4e12
subq $0x8, %rsp
movq %r13, %rdi
movq %r15, %rsi
movq %r13, %rdx
movl %eax, %ecx
movq 0x88(%rsp), %r8
movl 0x2c(%rsp), %r9d
pushq 0x80(%rsp)
pushq 0x48(%rsp)
pushq 0x28(%rsp)
callq 0x72c0
addq $0x20, %rsp
movslq 0xc(%rsp), %rbx
leaq (,%rbx,8), %rdx
movq 0x28(%rsp), %rdi
movq %r13, %rsi
movq 0x28(%rsp), %r13
callq 0x1120
leaq (,%rbx,8), %rdi
addq %r13, %rdi
movq 0x68(%rsp), %rax
subl %ebx, %eax
shll $0x3, %eax
movslq %eax, %rdx
xorl %esi, %esi
callq 0x10e0
movq %r13, %rdi
movl %ebx, %esi
movq %r12, %rdx
movl 0x44(%rsp), %ecx
callq 0x4dca
testl %eax, %eax
je 0x7cb7
movl 0xc(%rsp), %esi
movq %r13, %rdi
movq 0x50(%rsp), %rdx
movl %r14d, %ecx
callq 0x4dca
testl %eax, %eax
jne 0x7bb3
movq 0x48(%rsp), %rdi
callq 0x3fad
movq 0xa0(%rsp), %r15
movl 0x1c(%rsp), %ebp
movq 0x30(%rsp), %r14
movq 0x38(%rsp), %r12
jmp 0x77cc
movq 0x30(%rsp), %r14
movl 0x98(%rsp), %ebx
movq %r14, %rdi
callq 0x1030
movq 0xb0(%rsp), %rdi
callq 0x3eaa
movq 0x60(%rsp), %rdi
callq 0x3eaa
movq 0xa8(%rsp), %rdi
callq 0x3eaa
movq 0x48(%rsp), %rdi
callq 0x3eaa
movl %ebx, %eax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq