// File: /workspace/github_c_makefile_star2_O3/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 0x6aee(%rip), %eax      # 0xad68
cmpl $0x1f, %eax
jg 0x42f8
cmpl $0xb, %eax
je 0x434b
cmpl $0x13, %eax
jne 0x4397
leaq 0x2c(%rsp), %rbx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x4c9c
movl 0x20(%rbx), %eax
movl %eax, 0x6adf(%rip)      # 0xad88
movups (%rbx), %xmm0
movups 0x10(%rbx), %xmm1
movups %xmm1, 0x6ac1(%rip)     # 0xad78
movups %xmm0, 0x6aaa(%rip)     # 0xad68
callq 0x4125
movl 0x6abf(%rip), %eax      # 0xad88
movl %eax, 0x20(%rsp)
movups 0x6aa4(%rip), %xmm0     # 0xad78
movups %xmm0, 0x10(%rsp)
movups 0x6a88(%rip), %xmm0     # 0xad68
movups %xmm0, (%rsp)
leaq 0x2c(%rsp), %rbx
movq %rbx, %rdi
movl $0x14, %esi
callq 0x4f55
jmp 0x4373
cmpl $0x21, %eax
je 0x4357
cmpl $0x20, %eax
jne 0x4397
leaq 0x6a5f(%rip), %rdi      # 0xad6c
xorl %esi, %esi
callq 0x34c4
movl %eax, %ebx
movl %eax, %edi
callq 0x358a
movl %eax, %ebp
movl %eax, %edi
callq 0x502d
cmpl $0x3, %ebp
ja 0x4391
movl %ebp, %eax
leaq 0x206c(%rip), %rcx      # 0x63a0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x2, %edi
movl %ebx, %esi
callq 0x2310
jmp 0x4364
movl $0xc, %edi
callq 0x2372
jmp 0x4364
movl 0x6a0f(%rip), %esi      # 0xad6c
xorl %edi, %edi
callq 0x22c5
leaq 0x2c(%rsp), %rbx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x4c9c
movl 0x20(%rbx), %eax
movl %eax, 0x6a0c(%rip)      # 0xad88
movups (%rbx), %xmm0
movups 0x10(%rbx), %xmm1
movups %xmm1, 0x69ee(%rip)     # 0xad78
movups %xmm0, 0x69d7(%rip)     # 0xad68
movl 0x69d1(%rip), %eax      # 0xad68
cmpl $0x21, %eax
ja 0x43ba
movl %eax, %eax
movabsq $0x300080800, %rcx      # imm = 0x300080800
btq %rax, %rcx
jae 0x43ba
xorl %eax, %eax
callq 0x4b25
callq 0x426c
addq $0x50, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x2c(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x4c9c
movl 0x20(%r14), %eax
movl %eax, 0x69ac(%rip)      # 0xad88
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups %xmm1, 0x698c(%rip)     # 0xad78
movups %xmm0, 0x6975(%rip)     # 0xad68
cmpl $0x13, 0x696e(%rip)     # 0xad68
jne 0x445b
xorl %ebp, %ebp
leaq 0x2c(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x4c9c
movl 0x20(%r14), %eax
movl %eax, 0x6971(%rip)      # 0xad88
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups %xmm1, 0x6951(%rip)     # 0xad78
movups %xmm0, 0x693a(%rip)     # 0xad68
cmpl $0x14, 0x6933(%rip)     # 0xad68
jne 0x4474
leaq 0x2c(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x4c9c
jmp 0x44fb
movl %ebx, %edi
callq 0x35b8
xorl %edi, %edi
movl %eax, %esi
jmp 0x435f
movl $0x13, %edi
callq 0x4a4f
movl $0x14, %edi
callq 0x4a4f
jmp 0x4533
callq 0x4125
movl $0x1, %ebp
cmpl $0x1b, 0x68e3(%rip)     # 0xad68
jne 0x44c8
leaq 0x2c(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x4c9c
movl 0x4c(%rsp), %eax
movl %eax, 0x68e8(%rip)      # 0xad88
movups 0x2c(%rsp), %xmm0
movups 0x3c(%rsp), %xmm1
movups %xmm1, 0x68c7(%rip)     # 0xad78
movups %xmm0, 0x68b0(%rip)     # 0xad68
callq 0x4125
incl %ebp
cmpl $0x1b, 0x68a2(%rip)     # 0xad68
je 0x448c
movl 0x68ba(%rip), %eax      # 0xad88
movl %eax, 0x20(%rsp)
movups 0x689f(%rip), %xmm0     # 0xad78
movups %xmm0, 0x10(%rsp)
movups 0x6883(%rip), %xmm0     # 0xad68
movups %xmm0, (%rsp)
leaq 0x2c(%rsp), %r14
movq %r14, %rdi
movl $0x14, %esi
callq 0x4f55
movl 0x20(%r14), %eax
movl %eax, 0x6883(%rip)      # 0xad88
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups %xmm1, 0x6863(%rip)     # 0xad78
movups %xmm0, 0x684c(%rip)     # 0xad68
movl %ebx, %edi
callq 0x35cf
cmpl %ebp, %eax
je 0x4533
leaq 0x1ea9(%rip), %rdi      # 0x63d7
callq 0x4bff
movl $0x4, %edi
movl %ebx, %esi
callq 0x2310
jmp 0x4391