// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x1d0, %rsp            # imm = 0x1D0
cmpl $0x20, 0x6cc6(%rip)     # 0xbf58
jne 0x54a9
leaq 0x6cbd(%rip), %rdi      # 0xbf5c
xorl %esi, %esi
callq 0x4350
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %edi
callq 0x43f0
movl %eax, %edi
movl %edi, -0xc(%rbp)
callq 0x6020
movl -0xc(%rbp), %eax
movq %rax, -0x1a0(%rbp)
subq $0x3, %rax
ja 0x54a4
movq -0x1a0(%rbp), %rax
leaq 0x20f3(%rip), %rcx      # 0x73d0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl -0x4(%rbp), %esi
movl $0x2, %edi
callq 0x22c0
leaq -0x30(%rbp), %rdi
movb $0x0, %al
callq 0x5ba0
leaq 0x6c53(%rip), %rdi      # 0xbf58
leaq -0x30(%rbp), %rsi
movl $0x24, %edx
callq 0x20e0
jmp 0x54a4
movl -0x4(%rbp), %edi
callq 0x4440
movl %eax, %esi
xorl %edi, %edi
callq 0x2260
leaq -0x54(%rbp), %rdi
movb $0x0, %al
callq 0x5ba0
leaq 0x6c1d(%rip), %rdi      # 0xbf58
leaq -0x54(%rbp), %rsi
movl $0x24, %edx
callq 0x20e0
jmp 0x54a4
leaq -0x78(%rbp), %rdi
movb $0x0, %al
callq 0x5ba0
leaq 0x6bf8(%rip), %rdi      # 0xbf58
leaq -0x78(%rbp), %rsi
movl $0x24, %edx
callq 0x20e0
cmpl $0x13, 0x6be3(%rip)     # 0xbf58
jne 0x5483
movl $0x0, -0x8(%rbp)
leaq -0x9c(%rbp), %rdi
movb $0x0, %al
callq 0x5ba0
leaq 0x6bc1(%rip), %rdi      # 0xbf58
leaq -0x9c(%rbp), %rsi
movl $0x24, %edx
callq 0x20e0
cmpl $0x14, 0x6ba9(%rip)     # 0xbf58
je 0x5442
jmp 0x53b7
callq 0x5120
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
cmpl $0x1b, 0x6b8c(%rip)     # 0xbf58
jne 0x53f6
leaq -0xc0(%rbp), %rdi
movb $0x0, %al
callq 0x5ba0
leaq 0x6b75(%rip), %rdi      # 0xbf58
leaq -0xc0(%rbp), %rsi
movl $0x24, %edx
callq 0x20e0
jmp 0x53b7
movl 0x6b7c(%rip), %ecx      # 0xbf78
movq %rsp, %rax
movl %ecx, 0x20(%rax)
movups 0x6b5f(%rip), %xmm0     # 0xbf68
movups %xmm0, 0x10(%rax)
movups 0x6b44(%rip), %xmm0     # 0xbf58
movups %xmm0, (%rax)
leaq -0xe4(%rbp), %rdi
movl $0x14, %esi
callq 0x5f20
leaq 0x6b29(%rip), %rdi      # 0xbf58
leaq -0xe4(%rbp), %rsi
movl $0x24, %edx
callq 0x20e0
jmp 0x5468
leaq -0x108(%rbp), %rdi
movb $0x0, %al
callq 0x5ba0
leaq 0x6b01(%rip), %rdi      # 0xbf58
leaq -0x108(%rbp), %rsi
movl $0x24, %edx
callq 0x20e0
movl -0x4(%rbp), %edi
callq 0x4460
cmpl -0x8(%rbp), %eax
je 0x5481
leaq 0x1f8b(%rip), %rdi      # 0x7407
callq 0x5af0
jmp 0x5497
movl $0x13, %edi
callq 0x58a0
movl $0x14, %edi
callq 0x58a0
movl -0x4(%rbp), %esi
movl $0x4, %edi
callq 0x22c0
jmp 0x55a9
cmpl $0x21, 0x6aa8(%rip)     # 0xbf58
jne 0x54ea
movl 0x6aa4(%rip), %esi      # 0xbf5c
xorl %edi, %edi
callq 0x2260
leaq -0x12c(%rbp), %rdi
movb $0x0, %al
callq 0x5ba0
leaq 0x6a84(%rip), %rdi      # 0xbf58
leaq -0x12c(%rbp), %rsi
movl $0x24, %edx
callq 0x20e0
jmp 0x55a7
cmpl $0x13, 0x6a67(%rip)     # 0xbf58
jne 0x556a
leaq -0x150(%rbp), %rdi
movb $0x0, %al
callq 0x5ba0
leaq 0x6a50(%rip), %rdi      # 0xbf58
leaq -0x150(%rbp), %rsi
movl $0x24, %edx
callq 0x20e0
callq 0x5120
movl 0x6a54(%rip), %ecx      # 0xbf78
movq %rsp, %rax
movl %ecx, 0x20(%rax)
movups 0x6a37(%rip), %xmm0     # 0xbf68
movups %xmm0, 0x10(%rax)
movups 0x6a1c(%rip), %xmm0     # 0xbf58
movups %xmm0, (%rax)
leaq -0x174(%rbp), %rdi
movl $0x14, %esi
callq 0x5f20
leaq 0x6a01(%rip), %rdi      # 0xbf58
leaq -0x174(%rbp), %rsi
movl $0x24, %edx
callq 0x20e0
jmp 0x55a5
cmpl $0xb, 0x69e7(%rip)      # 0xbf58
jne 0x55a3
movl $0xc, %edi
callq 0x2330
leaq -0x198(%rbp), %rdi
movb $0x0, %al
callq 0x5ba0
leaq 0x69c6(%rip), %rdi      # 0xbf58
leaq -0x198(%rbp), %rsi
movl $0x24, %edx
callq 0x20e0
jmp 0x55a5
jmp 0x55a7
jmp 0x55a9
movl 0x69a9(%rip), %eax      # 0xbf58
movl %eax, -0x1a4(%rbp)
subl $0xb, %eax
je 0x55d9
jmp 0x55bc
movl -0x1a4(%rbp), %eax
subl $0x13, %eax
je 0x55d9
jmp 0x55c9
movl -0x1a4(%rbp), %eax
addl $-0x20, %eax
subl $0x1, %eax
ja 0x55e5
jmp 0x55d9
movb $0x0, %al
callq 0x59c0
callq 0x5280
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbp
retq
nop