// File: /workspace/github_c_makefile_star2_O2/pahihu[P]mixal/driver.c
// Function: assemble_line
void assemble_line(const char *line)
{
    char mnemonic[max_identifier_length+1];
    const char *scan = line;
    int n;

    current_line[0] = '\0';             /* trim right */
    if (line) {
        strcpy(current_line, line);
        n = strlen(current_line);
        while (n && isspace(current_line[n-1])) n--;
        current_line[n] = '\0';
    }

    if (*skip_blanks(scan) == '*') {    /* the comment character */
        if (VERBOSE)
            printf("                       %s\n", current_line);
	    return;
    }

    eat_identifier(label, &scan);       /* eat label if any */
    scan = skip_blanks(scan);
    eat_identifier(mnemonic, &scan);    /* eat mnemonic */
    if (0 == strcasecmp(mnemonic, "alf")) {
      scan = skip_2blanks(scan);
      setup_scanner(scan, 0);
    } else {
      scan = skip_blanks(scan);
      setup_scanner(scan, 1);           /* prepare to parse operand field */
    }

    {
	Handler handler = lookup_mnemonic(mnemonic);
	if (handler != do_equ && label[0] != '\0')
	    define_symbol(string_to_symbol(label), address_to_cell(here));
	if (handler) {
	    handler();
	    done_parsing();  /* this goes here since *all* handlers parse an operand field */
	} else if (mnemonic[0] != '\0')
	    error("Unknown instruction: %s", mnemonic);
	else
	    ;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
movq %rdi, 0x18(%rsp)
movb $0x0, 0xbb97(%rip)      # 0xfb70
testq %rdi, %rdi
je 0x403b
leaq 0xbb8b(%rip), %r14      # 0xfb70
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3090
movq %r14, %rdi
callq 0x3100
movslq %eax, %r12
shlq $0x20, %rax
movabsq $-0x100000000, %r15     # imm = 0xFFFFFFFF00000000
movq %r12, %rbp
movq %rax, %r13
subq $0x1, %rbp
jb 0x4031
callq 0x32d0
movq (%rax), %rcx
movsbq -0x1(%r12,%r14), %rdx
leaq (%r15,%r13), %rax
testb $0x20, 0x1(%rcx,%rdx,2)
movq %rbp, %r12
jne 0x400c
sarq $0x20, %r13
movb $0x0, (%r13,%r14)
movq %rbx, %rdi
callq 0x424e
cmpb $0x2a, (%rax)
jne 0x407b
leaq 0xcc91(%rip), %rax      # 0x10ce0
cmpl $0x0, (%rax)
je 0x423f
leaq 0x5252(%rip), %rdi      # 0x92b1
leaq 0xbb0a(%rip), %rsi      # 0xfb70
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3120
leaq 0xbbfe(%rip), %rdi      # 0xfc80
leaq 0x18(%rsp), %rbx
movq %rbx, %rsi
callq 0x4263
movq (%rbx), %rdi
callq 0x424e
movq %rax, (%rbx)
leaq 0x20(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4263
leaq 0x521b(%rip), %rsi      # 0x92cc
movq %r14, %rdi
callq 0x3060
movq (%rbx), %rbx
testl %eax, %eax
je 0x40d0
movq %rbx, %rdi
callq 0x424e
pushq $0x1
popq %rsi
movq %rax, %rdi
jmp 0x40f9
xorl %r14d, %r14d
cmpq $0x2, %r14
je 0x40f1
callq 0x32d0
movq (%rax), %rax
movsbq (%rbx,%r14), %rcx
testb $0x1, (%rax,%rcx,2)
je 0x40f1
incq %r14
jmp 0x40d3
addq %r14, %rbx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x5ee0
callq 0x32c0
movq %rax, %rbx
leaq 0x536e(%rip), %r12      # 0x947b
xorl %ecx, %ecx
cmpq $0x46, %rcx
je 0x41ca
movq %rcx, 0x10(%rsp)
movq %rcx, %rax
shlq $0x5, %rax
leaq 0x9c24(%rip), %rcx      # 0xdd50
leaq (%rcx,%rax), %rdx
movq %rdx, 0x8(%rsp)
movq (%rax,%rcx), %rbp
xorl %r15d, %r15d
xorl %r13d, %r13d
movsbl (%rbp,%r15), %eax
movsbq 0x20(%rsp,%r15), %rcx
testl %eax, %eax
je 0x4183
movq (%rbx), %rdx
movl (%rdx,%rcx,4), %r14d
cmpb $0x2d, %al
jne 0x4176
movsbl %r14b, %esi
movq %r12, %rdi
pushq $0x9
popq %rdx
callq 0x3180
testq %rax, %rax
je 0x418e
subl %r12d, %eax
movl %eax, %r13d
jmp 0x417e
movsbl %r14b, %ecx
cmpl %eax, %ecx
jne 0x4191
incq %r15
jmp 0x413f
movq (%rbx), %rax
movl (%rax,%rcx,4), %r14d
xorl %eax, %eax
jmp 0x4191
pushq $0x2d
popq %rax
movq 0x10(%rsp), %rcx
incq %rcx
cmpl %eax, %r14d
jne 0x410f
movq 0x8(%rsp), %rcx
addl 0x10(%rcx), %r13d
movl %r13d, 0xbaf2(%rip)     # 0xfca4
movl 0x14(%rcx), %eax
movl %eax, 0xbaed(%rip)      # 0xfca8
movl 0x18(%rcx), %eax
movl %eax, 0xbae8(%rip)      # 0xfcac
movq 0x8(%rcx), %r14
jmp 0x41cd
xorl %r14d, %r14d
leaq 0x173(%rip), %rax       # 0x4347
cmpq %rax, %r14
je 0x420a
cmpb $0x0, 0xbaa0(%rip)      # 0xfc80
je 0x420a
leaq 0xba97(%rip), %rdi      # 0xfc80
callq 0x8104
movq %rax, %rbx
leaq 0xb53c(%rip), %rax      # 0xf734
movl (%rax), %edi
callq 0x3e11
movq %rbx, %rdi
movq %rax, %rsi
callq 0x826d
testq %r14, %r14
je 0x4225
callq *%r14
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6480
cmpb $0x0, 0x20(%rsp)
je 0x423f
leaq 0x509d(%rip), %rdi      # 0x92d0
leaq 0x20(%rsp), %rsi
xorl %eax, %eax
callq 0x5700
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq