// File: /workspace/github_c_makefile_star2_O0/wjmelements[P]evm/src/scan.c
// Function: parseDecimal
op_t parseDecimal(const char **iter, int negative) {
    uint64_t words[4] = {0,0,0,0};
    while (isDecimal(**iter)) {
        // multiply number by 10
        for (uint8_t i = 4; i --> 0;) {
            // long multiplication
            uint64_t s0, s1, s2, s3;

            uint64_t x = lo32(words[i]) * 10;
            s0 = lo32(x);

            x = hi32(words[i]) * 10 + hi32(x);
            s1 = lo32(x);
            s2 = hi32(x);

            x = s1;
            s1 = lo32(x);

            x = s2 + hi32(x);
            s2 = lo32(x);
            s3 = hi32(x);

            words[i] = s1 << 32 | s0;
            uint64_t carry = s3 << 32 | s2;
            // add carry
            for (uint8_t j = i + 1; j < 4; j++) {
                words[j] += carry;
                if (carry > words[j]) {
                    carry = 1;
                } else break;
            }
        }
        uint8_t digit = *((*iter)++) - '0';
        // add digit
        for (uint8_t i = 0; i < 4; i++) {
            words[i] += digit;
            if (digit > words[i]) {
                digit = 1;
            } else break;
        }
    }
    if (negative) {
        // negate via -x = ~x + 1
        for (uint8_t i = 4; i --> 0;) {
            words[i] = ~words[i];
        }
        // add 1 with carry
        for (uint8_t i = 0; !++words[i++];);
    }
    uint64_t isNonzero = words[0] | words[1] | words[2] | words[3];
    if (!isNonzero) {
        return PUSH0;
    }
    uint8_t start = 0;
    // determine start
    for (uint8_t i = 4; i --> 0;) {
        for (uint8_t j = 8; j --> 0;) {
            uint64_t shift = j * 8;
            uint8_t byte = (words[i] & (0xffllu << shift)) >> shift;
            if (byte) {
                start = i * 8 + j;
                i = 0; // break outer
                break;
            }
        }
    }
    for (uint8_t i = 0; i < 4; i++) {
        for (uint8_t j = 0; j < 8; j++) {
            if (i * 8 + j > start) {
                break;
            }
            uint64_t shift = j * 8;
            uint8_t byte = (words[i] & (0xffllu << shift)) >> shift;
            scanstackPush(byte);
        }
    }
    return (op_t) PUSH1 + start;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
leaq -0x40(%rbp), %rdi
xorl %esi, %esi
movl $0x20, %edx
callq 0x3140
movq -0x10(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %edi
callq 0x17160
cmpl $0x0, %eax
je 0x16f22
movb $0x4, -0x41(%rbp)
movb -0x41(%rbp), %al
movb %al, %cl
addb $-0x1, %cl
movb %cl, -0x41(%rbp)
movzbl %al, %eax
cmpl $0x0, %eax
jle 0x16ebf
movzbl -0x41(%rbp), %eax
movq -0x40(%rbp,%rax,8), %rdi
callq 0x171a0
imulq $0xa, %rax, %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rdi
callq 0x171a0
movq %rax, -0x50(%rbp)
movzbl -0x41(%rbp), %eax
movq -0x40(%rbp,%rax,8), %rdi
callq 0x171c0
imulq $0xa, %rax, %rax
movq %rax, -0xc0(%rbp)
movq -0x70(%rbp), %rdi
callq 0x171c0
movq %rax, %rcx
movq -0xc0(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rdi
callq 0x171a0
movq %rax, -0x58(%rbp)
movq -0x70(%rbp), %rdi
callq 0x171c0
movq %rax, -0x60(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rdi
callq 0x171a0
movq %rax, -0x58(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0x70(%rbp), %rdi
callq 0x171c0
movq %rax, %rcx
movq -0xb8(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rdi
callq 0x171a0
movq %rax, -0x60(%rbp)
movq -0x70(%rbp), %rdi
callq 0x171c0
movq %rax, -0x68(%rbp)
movq -0x58(%rbp), %rcx
shlq $0x20, %rcx
orq -0x50(%rbp), %rcx
movzbl -0x41(%rbp), %eax
movq %rcx, -0x40(%rbp,%rax,8)
movq -0x68(%rbp), %rax
shlq $0x20, %rax
orq -0x60(%rbp), %rax
movq %rax, -0x78(%rbp)
movzbl -0x41(%rbp), %eax
addl $0x1, %eax
movb %al, -0x79(%rbp)
movzbl -0x79(%rbp), %eax
cmpl $0x4, %eax
jge 0x16eba
movq -0x78(%rbp), %rcx
movzbl -0x79(%rbp), %eax
addq -0x40(%rbp,%rax,8), %rcx
movq %rcx, -0x40(%rbp,%rax,8)
movq -0x78(%rbp), %rax
movzbl -0x79(%rbp), %ecx
cmpq -0x40(%rbp,%rcx,8), %rax
jbe 0x16eac
movq $0x1, -0x78(%rbp)
jmp 0x16eae
jmp 0x16eba
jmp 0x16eb0
movb -0x79(%rbp), %al
addb $0x1, %al
movb %al, -0x79(%rbp)
jmp 0x16e78
jmp 0x16d6e
movq -0x10(%rbp), %rcx
movq (%rcx), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, (%rcx)
movsbl (%rax), %eax
subl $0x30, %eax
movb %al, -0x7a(%rbp)
movb $0x0, -0x7b(%rbp)
movzbl -0x7b(%rbp), %eax
cmpl $0x4, %eax
jge 0x16f1d
movzbl -0x7a(%rbp), %eax
movl %eax, %ecx
movzbl -0x7b(%rbp), %eax
addq -0x40(%rbp,%rax,8), %rcx
movq %rcx, -0x40(%rbp,%rax,8)
movzbl -0x7a(%rbp), %eax
movzbl -0x7b(%rbp), %ecx
cmpq -0x40(%rbp,%rcx,8), %rax
jbe 0x16f0f
movb $0x1, -0x7a(%rbp)
jmp 0x16f11
jmp 0x16f1d
jmp 0x16f13
movb -0x7b(%rbp), %al
addb $0x1, %al
movb %al, -0x7b(%rbp)
jmp 0x16edd
jmp 0x16d52
cmpl $0x0, -0x14(%rbp)
je 0x16f8c
movb $0x4, -0x7c(%rbp)
movb -0x7c(%rbp), %al
movb %al, %cl
addb $-0x1, %cl
movb %cl, -0x7c(%rbp)
movzbl %al, %eax
cmpl $0x0, %eax
jle 0x16f57
movzbl -0x7c(%rbp), %eax
movq -0x40(%rbp,%rax,8), %rcx
xorq $-0x1, %rcx
movzbl -0x7c(%rbp), %eax
movq %rcx, -0x40(%rbp,%rax,8)
jmp 0x16f2c
movb $0x0, -0x7d(%rbp)
movb -0x7d(%rbp), %al
movb %al, %cl
addb $0x1, %cl
movb %cl, -0x7d(%rbp)
movzbl %al, %eax
movl %eax, %ecx
movq -0x40(%rbp,%rcx,8), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp,%rcx,8)
cmpq $0x0, %rax
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x16f88
jmp 0x16f8a
jmp 0x16f5b
jmp 0x16f8c
movq -0x40(%rbp), %rax
orq -0x38(%rbp), %rax
orq -0x30(%rbp), %rax
orq -0x28(%rbp), %rax
movq %rax, -0x88(%rbp)
cmpq $0x0, -0x88(%rbp)
jne 0x16fb6
movb $0x5f, -0x1(%rbp)
jmp 0x1714d
movb $0x0, -0x89(%rbp)
movb $0x4, -0x8a(%rbp)
movb -0x8a(%rbp), %al
movb %al, %cl
addb $-0x1, %cl
movb %cl, -0x8a(%rbp)
movzbl %al, %eax
cmpl $0x0, %eax
jle 0x1707a
movb $0x8, -0x8b(%rbp)
movb -0x8b(%rbp), %al
movb %al, %cl
addb $-0x1, %cl
movb %cl, -0x8b(%rbp)
movzbl %al, %eax
cmpl $0x0, %eax
jle 0x17075
movzbl -0x8b(%rbp), %eax
shll $0x3, %eax
cltq
movq %rax, -0x98(%rbp)
movzbl -0x8a(%rbp), %eax
movq -0x40(%rbp,%rax,8), %rax
movq -0x98(%rbp), %rcx
movl $0xff, %edx
shlq %cl, %rdx
movq %rdx, %rcx
andq %rcx, %rax
movq -0x98(%rbp), %rcx
shrq %cl, %rax
movb %al, -0x99(%rbp)
cmpb $0x0, -0x99(%rbp)
je 0x17070
movzbl -0x8a(%rbp), %eax
shll $0x3, %eax
movzbl -0x8b(%rbp), %ecx
addl %ecx, %eax
movb %al, -0x89(%rbp)
movb $0x0, -0x8a(%rbp)
jmp 0x17075
jmp 0x16fe8
jmp 0x16fc4
movb $0x0, -0x9a(%rbp)
movzbl -0x9a(%rbp), %eax
cmpl $0x4, %eax
jge 0x17140
movb $0x0, -0x9b(%rbp)
movzbl -0x9b(%rbp), %eax
cmpl $0x8, %eax
jge 0x1712b
movzbl -0x9a(%rbp), %eax
shll $0x3, %eax
movzbl -0x9b(%rbp), %ecx
addl %ecx, %eax
movzbl -0x89(%rbp), %ecx
cmpl %ecx, %eax
jle 0x170c8
jmp 0x1712b
movzbl -0x9b(%rbp), %eax
shll $0x3, %eax
cltq
movq %rax, -0xa8(%rbp)
movzbl -0x9a(%rbp), %eax
movq -0x40(%rbp,%rax,8), %rax
movq -0xa8(%rbp), %rcx
movl $0xff, %edx
shlq %cl, %rdx
movq %rdx, %rcx
andq %rcx, %rax
movq -0xa8(%rbp), %rcx
shrq %cl, %rax
movb %al, -0xa9(%rbp)
movzbl -0xa9(%rbp), %edi
callq 0x171e0
movb -0x9b(%rbp), %al
addb $0x1, %al
movb %al, -0x9b(%rbp)
jmp 0x17098
jmp 0x1712d
movb -0x9a(%rbp), %al
addb $0x1, %al
movb %al, -0x9a(%rbp)
jmp 0x17081
movzbl -0x89(%rbp), %eax
addl $0x60, %eax
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
addq $0xc0, %rsp
popq %rbp
retq
nopl (%rax)