// File: /workspace/github_c_makefile_star2_O0/radekh[P]palbart/palbart-2.5.c
// Function: defineSymbol
SYM_T *defineSymbol( char *name, WORD16 val, SYMTYP type, WORD16 start )
{
  SYM_T  *sym;
  int     xref_count;

  if( strlen( name ) < 1 )
  {
    return( &sym_undefined );   /* Protect against non-existent names.        */
  }
  sym = lookup( name );
  if( M_FIXED( sym->type ))
  {
      return( sym );            /* Can't modify permanent symbols.            */
  }

  xref_count = 0;               /* Set concordance for normal defintion.      */

  if( M_DEFINED( sym->type ))
  {
    if( pass == 2 && sym->val != val )
    {
      /* Generate diagnostic if redefining a symbol.                          */
      if( M_REDEFINED( sym->type ))
      {
        errorSymbol( &redefined_symbol, sym->name, start );
      }
      type = type | REDEFINED;
      sym->xref_count++;      /* Referenced suymbol, count it.                */
      xref_count = sym->xref_count;
    }
  }

  if( pass == 2 && xref )
  {
    /* Put the definition line number in the concordance table.               */
    /* Defined symbols are not counted as references.                         */
    xreftab[sym->xref_index] = lineno;
    /* Put the line number in the concordance table.                          */
    xreftab[sym->xref_index + xref_count] = lineno;
  }

  /* Now set the value and the type.                                          */
  sym->val = ( type == LABEL) ? val : val & 07777;
  sym->type = ( pass == 1 ) ? ( type | CONDITION ) : type;
  return( sym );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movw %cx, %ax
movw %si, %cx
movq %rdi, -0x10(%rbp)
movw %cx, -0x12(%rbp)
movl %edx, -0x18(%rbp)
movw %ax, -0x1a(%rbp)
movq -0x10(%rbp), %rdi
callq 0x1090
cmpq $0x1, %rax
jae 0x1e1c
leaq 0x938d(%rip), %rax      # 0xb1a0
movq %rax, -0x8(%rbp)
jmp 0x1f62
movq -0x10(%rbp), %rdi
callq 0x3590
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movl (%rax), %eax
andl $0x2, %eax
cmpl $0x2, %eax
jne 0x1e44
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x1f62
movl $0x0, -0x2c(%rbp)
movq -0x28(%rbp), %rax
movl (%rax), %eax
andl $0x1, %eax
cmpl $0x1, %eax
jne 0x1eba
cmpl $0x2, 0x9400(%rip)      # 0xb260
jne 0x1eb8
movq -0x28(%rbp), %rax
movswl 0xc(%rax), %eax
movswl -0x12(%rbp), %ecx
cmpl %ecx, %eax
je 0x1eb8
movq -0x28(%rbp), %rax
movl (%rax), %eax
andl $0x11, %eax
cmpl $0x11, %eax
jne 0x1e98
movq -0x28(%rbp), %rsi
addq $0x4, %rsi
movswl -0x1a(%rbp), %edx
leaq 0x915d(%rip), %rdi      # 0xaff0
callq 0x37f0
movl -0x18(%rbp), %eax
orl $0x11, %eax
movl %eax, -0x18(%rbp)
movq -0x28(%rbp), %rax
movl 0x14(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x14(%rax)
movq -0x28(%rbp), %rax
movl 0x14(%rax), %eax
movl %eax, -0x2c(%rbp)
jmp 0x1eba
cmpl $0x2, 0x939f(%rip)      # 0xb260
jne 0x1f0c
movzbl 0x92f4(%rip), %eax      # 0xb1be
cmpl $0x0, %eax
je 0x1f0c
movl 0x980f(%rip), %eax      # 0xb6e4
movw %ax, %dx
movq 0x94e1(%rip), %rax      # 0xb3c0
movq -0x28(%rbp), %rcx
movslq 0x10(%rcx), %rcx
movw %dx, (%rax,%rcx,2)
movl 0x97f3(%rip), %eax      # 0xb6e4
movw %ax, %dx
movq 0x94c5(%rip), %rax      # 0xb3c0
movq -0x28(%rbp), %rcx
movl 0x10(%rcx), %ecx
addl -0x2c(%rbp), %ecx
movslq %ecx, %rcx
movw %dx, (%rax,%rcx,2)
cmpl $0x9, -0x18(%rbp)
jne 0x1f1b
movswl -0x12(%rbp), %eax
movl %eax, -0x30(%rbp)
jmp 0x1f27
movswl -0x12(%rbp), %eax
andl $0xfff, %eax            # imm = 0xFFF
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %eax
movw %ax, %cx
movq -0x28(%rbp), %rax
movw %cx, 0xc(%rax)
cmpl $0x1, 0x9324(%rip)      # 0xb260
jne 0x1f4b
movl -0x18(%rbp), %eax
orl $0x81, %eax
movl %eax, -0x34(%rbp)
jmp 0x1f51
movl -0x18(%rbp), %eax
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)