// File: /workspace/github_c_makefile_star2_O2/AK6DN[P]dec-utilities-for-pdp/macro8x/macro8x.c
// Function: printLine
void printLine( char *line, WORD32 loc, WORD32 val, LINESTYLE_T linestyle )
{
  if( listfile == NULL )
  {
    save_error_count = 0;
    return;
  }

  printPageBreak();

  list_lineno++;
  page_lineno++;
  switch( linestyle )
  {
  default:
  case LINE:
    fprintf( listfile, "%5d             ", lineno );
    fputs( line, listfile );
    listed = TRUE;
    break;

  case LINE_VAL:
    if( !listed )
    {
	fprintf( listfile, "%5d       %4.4o  ", lineno, (unsigned)val );
      fputs( line, listfile );
      listed = TRUE;
    }
    else
    {
	fprintf( listfile, "            %4.4o\n", (unsigned)val );
    }
    break;

  case LINE_LOC_VAL:
    if( !listed )
    {
      if( indirect_generated && lgm_flag )
      {
	  fprintf( listfile, "%5d %5.5o %4.4o@ ", lineno, (unsigned)loc, (unsigned)val );
      }
      else
      {
	  fprintf( listfile, "%5d %5.5o %4.4o  ", lineno, (unsigned)loc, (unsigned)val );
      }
      fputs( line, listfile );
      listed = TRUE;
    }
    else
    {
	fprintf( listfile, "      %5.5o %4.4o\n", (unsigned)loc, (unsigned)val );
    }
    /* update memory map */
    memory_map[loc] = TRUE;
    if (loc > memory_max) memory_max = loc;
    if (loc < memory_min) memory_min = loc;
    break;

  case LOC_VAL:
      fprintf( listfile, "      %5.5o %4.4o\n", (unsigned)loc, (unsigned)val );
    /* update memory map */
    memory_map[loc] = TRUE;
    if (loc > memory_max) memory_max = loc;
    if (loc < memory_min) memory_min = loc;
    break;
  }
  printErrorMessages();
}

// Assembly:
cmpq $0x0, 0x12119(%rip)     # 0x15e70
je 0x3daf
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %ebp
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
callq 0x60d5
incl 0x13a7e(%rip)           # 0x177f4
incl 0x13a80(%rip)           # 0x177fc
cmpl $0x1, %ebp
je 0x3e0f
cmpl $0x2, %ebp
je 0x3db7
cmpl $0x3, %ebp
je 0x3dc1
movq 0x120da(%rip), %rdi     # 0x15e70
movl 0x13a50(%rip), %edx     # 0x177ec
leaq 0x3ac0(%rip), %rsi      # 0x7863
xorl %eax, %eax
callq 0x2120
jmp 0x3ea9
andl $0x0, 0x9f66(%rip)      # 0xdd1c
retq
cmpq $0x0, 0x13a21(%rip)     # 0x177e0
je 0x3e36
movq 0x120a8(%rip), %rdi     # 0x15e70
leaq 0x3aee(%rip), %rsi      # 0x78bd
movl %ebx, %edx
movl %r14d, %ecx
xorl %eax, %eax
callq 0x2120
leaq 0x9f5e(%rip), %rax      # 0xdd40
movb $0x1, (%rbx,%rax)
cmpq %rbx, 0x11f5b(%rip)     # 0x15d48
jge 0x3df6
movq %rbx, 0x11f52(%rip)     # 0x15d48
cmpq %rbx, 0x11f43(%rip)     # 0x15d40
jle 0x3ec3
movq %rbx, 0x11f36(%rip)     # 0x15d40
jmp 0x3ec3
cmpq $0x0, 0x139c9(%rip)     # 0x177e0
movq 0x12052(%rip), %rdi     # 0x15e70
je 0x3e92
leaq 0x3a5f(%rip), %rsi      # 0x7886
movl %r14d, %edx
xorl %eax, %eax
callq 0x2120
jmp 0x3ec3
cmpb $0x0, 0x139ab(%rip)     # 0x177e8
leaq 0x3a55(%rip), %rsi      # 0x7899
leaq 0x3a60(%rip), %rax      # 0x78ab
cmoveq %rax, %rsi
cmpb $0x0, 0x141ca(%rip)     # 0x18020
movq 0x12013(%rip), %rdi     # 0x15e70
movl 0x13989(%rip), %edx     # 0x177ec
cmoveq %rax, %rsi
movl %ebx, %ecx
movl %r14d, %r8d
xorl %eax, %eax
callq 0x2120
movq 0x11ff6(%rip), %rsi     # 0x15e70
movq %r15, %rdi
callq 0x20c0
movq $0x1, 0x13953(%rip) # 0x177e0
jmp 0x3ddb
movl 0x13954(%rip), %edx     # 0x177ec
leaq 0x39d5(%rip), %rsi      # 0x7874
movl %r14d, %ecx
xorl %eax, %eax
callq 0x2120
movq 0x11fc0(%rip), %rsi     # 0x15e70
movq %r15, %rdi
callq 0x20c0
movq $0x1, 0x1391d(%rip) # 0x177e0
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x6142