// File: /workspace/github_c_makefile_star2_O2/tyabu12[P]pl0compiler/compile.c
// Function: factor
void factor() {                 /* 式の因子のコンパイル                 */
    int tIndex, i;
    /* ishii KeyId k; */
    KindT k;
    if (token.kind == Id) {
        tIndex = searchT(token.u.id, varId);
        setIdKind(k = kindT(tIndex)); /* 印字のための情報のセット       */
        switch (k) {
        case varId: case parId: /* 変数名かパラメタ名                   */
            genCodeT(lod, tIndex);
            token = nextToken(); break;
        case constId:           /* 定数名                               */
            genCodeV(lit, val(tIndex));
            token = nextToken(); break;
        case funcId:            /* 関数呼び出し                         */
            token = nextToken();
            if (token.kind == Lparen){
                i = 0;          /* iは実引数の個数                      */
                token = nextToken();
                if (token.kind != Rparen) {
                    while (1) {
                        expression(); i++; /* 実引数のコンパイル        */
                        if (token.kind == Comma) { /* 次がコンマなら実引数が続く */
                            token = nextToken();
                            continue;
                        }
                        token = checkGet(token, Rparen);
                        break;
                    }
                } else
                    token = nextToken();
                if (pars(tIndex) != i)
                    errorMessage("\\#par"); /* pars(tIndex)は仮引数の個数 */
            } else {
                errorInsert(Lparen);
                errorInsert(Rparen);
            }
            genCodeT(cal, tIndex); /* call命令                          */
            break;
        }
    } else if (token.kind == Num) { /* 定数                             */
        genCodeV(lit, token.u.value);
        token = nextToken();
    } else if (token.kind == Lparen) { /* 「(」「因子」「)」            */
        token = nextToken();
        expression();
        token = checkGet(token, Rparen);
    } else if (token.kind == Read) { /* 標準入力から読み込み */
        genCodeO(rd);
        token = nextToken();
    }
    switch (token.kind) {       /* 因子の後がまた因子ならエラー         */
    case Id:
    case Num:
    case Lparen:
    case Read:
        errorMissingOp();
        factor();
    default:
        return;
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x50, %rsp
movl 0x5dab(%rip), %eax      # 0x9d68
cmpl $0xb, %eax
je 0x4098
cmpl $0x13, %eax
je 0x4024
cmpl $0x21, %eax
je 0x4089
cmpl $0x20, %eax
jne 0x40d3
leaq 0x5d88(%rip), %rdi      # 0x9d6c
xorl %esi, %esi
callq 0x328f
movl %eax, %ebx
movl %eax, %edi
callq 0x3315
movl %eax, %ebp
movl %eax, %edi
callq 0x4a4c
cmpl $0x3, %ebp
ja 0x40cd
movl %ebp, %eax
leaq 0x136d(%rip), %rcx      # 0x537c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
pushq $0x2
popq %rdi
movl %ebx, %esi
callq 0x22b1
jmp 0x40a0
leaq 0x2c(%rsp), %rbx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x475d
movl 0x20(%rbx), %eax
movl %eax, 0x5d4c(%rip)      # 0x9d88
movups (%rbx), %xmm0
movups 0x10(%rbx), %xmm1
movups %xmm1, 0x5d2e(%rip)     # 0x9d78
movups %xmm0, 0x5d17(%rip)     # 0x9d68
callq 0x3e82
movl 0x5d2c(%rip), %eax      # 0x9d88
movl %eax, 0x20(%rsp)
movups 0x5d11(%rip), %xmm0     # 0x9d78
movups %xmm0, 0x10(%rsp)
movups 0x5cf5(%rip), %xmm0     # 0x9d68
movups %xmm0, (%rsp)
leaq 0x2c(%rsp), %rbx
pushq $0x14
popq %rsi
movq %rbx, %rdi
callq 0x49ce
jmp 0x40af
movl 0x5cdd(%rip), %esi      # 0x9d6c
xorl %edi, %edi
callq 0x2285
jmp 0x40a0
pushq $0xc
popq %rdi
callq 0x22f4
leaq 0x2c(%rsp), %rbx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x475d
movl 0x20(%rbx), %eax
movl %eax, 0x5cd0(%rip)      # 0x9d88
movups (%rbx), %xmm0
movups 0x10(%rbx), %xmm1
movups %xmm1, 0x5cb2(%rip)     # 0x9d78
movups %xmm0, 0x5c9b(%rip)     # 0x9d68
movl 0x5c95(%rip), %eax      # 0x9d68
cmpl $0x21, %eax
ja 0x40f6
movl %eax, %eax
movabsq $0x300080800, %rcx      # imm = 0x300080800
btq %rax, %rcx
jae 0x40f6
xorl %eax, %eax
callq 0x460b
callq 0x3faf
addq $0x50, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x2c(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x475d
movl 0x20(%r14), %eax
movl %eax, 0x5c70(%rip)      # 0x9d88
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups %xmm1, 0x5c50(%rip)     # 0x9d78
movups %xmm0, 0x5c39(%rip)     # 0x9d68
cmpl $0x13, 0x5c32(%rip)     # 0x9d68
jne 0x4197
xorl %ebp, %ebp
leaq 0x2c(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x475d
movl 0x20(%r14), %eax
movl %eax, 0x5c35(%rip)      # 0x9d88
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups %xmm1, 0x5c15(%rip)     # 0x9d78
movups %xmm0, 0x5bfe(%rip)     # 0x9d68
cmpl $0x14, 0x5bf7(%rip)     # 0x9d68
jne 0x41ac
leaq 0x2c(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x475d
jmp 0x4223
movl %ebx, %edi
callq 0x333b
xorl %edi, %edi
movl %eax, %esi
jmp 0x4091
pushq $0x13
popq %rdi
callq 0x453b
pushq $0x14
popq %rdi
callq 0x453b
jmp 0x425b
pushq $0x1
popq %rbp
leaq 0x2c(%rsp), %r14
callq 0x3e82
cmpl $0x1b, 0x5ba8(%rip)     # 0x9d68
jne 0x41f2
movq %r14, %rdi
xorl %eax, %eax
callq 0x475d
movl 0x4c(%rsp), %eax
movl %eax, 0x5bb2(%rip)      # 0x9d88
movups 0x2c(%rsp), %xmm0
movups 0x3c(%rsp), %xmm1
movups %xmm1, 0x5b91(%rip)     # 0x9d78
movups %xmm0, 0x5b7a(%rip)     # 0x9d68
incl %ebp
jmp 0x41b4
movl 0x5b90(%rip), %eax      # 0x9d88
movl %eax, 0x20(%rsp)
movups 0x5b75(%rip), %xmm0     # 0x9d78
movups %xmm0, 0x10(%rsp)
movups 0x5b59(%rip), %xmm0     # 0x9d68
movups %xmm0, (%rsp)
leaq 0x2c(%rsp), %r14
pushq $0x14
popq %rsi
movq %r14, %rdi
callq 0x49ce
movl 0x20(%r14), %eax
movl %eax, 0x5b5b(%rip)      # 0x9d88
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups %xmm1, 0x5b3b(%rip)     # 0x9d78
movups %xmm0, 0x5b24(%rip)     # 0x9d68
movl %ebx, %edi
callq 0x334e
cmpl %ebp, %eax
je 0x425b
leaq 0x115d(%rip), %rdi      # 0x53b3
callq 0x46e5
pushq $0x4
popq %rdi
movl %ebx, %esi
callq 0x22b1
jmp 0x40cd