// File: /workspace/github_c_makefile_star2_O1/42Bastian[P]lyxass/lyxass.c
// Function: doReference
void doReference(void)
{
  if ( error || !Current.doRef || Current.pass2) return;

  if ( refFirst ){

    REFERENCE *ptr1,*ptr = refFirst;
    struct current_s save_current = Current;
    struct code_s save_code = code;
    struct global_s save_global = Global;
    int mode = sourceMode;

    //    printf("Pass 2:....");

    Current.doRef = 0;

    while ( ptr ){
      ptr1 = ptr->up;

      //      printf("->%p = %p %p\n",ptr->unknown,l,ptr1);

      if ( ptr->unknown == save_current.LabelPtr ){
        cntRef++;
        Current.Line = ptr->line;
        Current.File = ptr->file;
        Current.Macro.Line = ptr->macroline;
        Current.Macro.File = ptr->macrofile;
        Current.Macro.invoked = ptr->macroinvoked;
        Global.pc = ptr->pc;
        //Current.var = ptr->var;
        code.Ptr = ptr->codePtr;
        Current.SrcPtr = ptr->src;
        sourceMode = ptr->mode;

        //mesg(Current.SrcPtr);

        mainloop( 1 );

        ptr->unknown = 0;

        if ( ptr->down ){
          ptr->down->up = ptr->up;
        }
        if ( ptr->up ){
          ptr->up->down = ptr->down;
        }
        if ( ptr == refFirst ) refFirst = ptr->up;
        if ( ptr == refLast ) refLast = ptr->down;

        free(ptr);
      }
      ptr = ptr1;
    }

    //exit(1);
    sourceMode = mode;
    code = save_code;
    Current = save_current;
    Global = save_global;
    //    printf("finished\n");
  }
  Current.doRef = 0;
}

// Assembly:
cmpl $0x0, 0x184f3(%rip)     # 0x1cae4
jne 0x47f8
cmpl $0x0, 0x100f6(%rip)     # 0x146f4
je 0x47f8
cmpl $0x0, 0x100e1(%rip)     # 0x146ec
jne 0x47f8
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3f8, %rsp            # imm = 0x3F8
leaq 0x1e777(%rip), %r15     # 0x22da0
movq (%r15), %rbx
testq %rbx, %rbx
je 0x47dd
leaq 0xffcc(%rip), %rsi      # 0x14608
leaq 0x20(%rsp), %rdi
movl $0x88, %edx
callq 0x3150
movq 0x1003e(%rip), %r14     # 0x14690
leaq 0x1003f(%rip), %rsi     # 0x14698
leaq 0xa8(%rsp), %rdi
movl $0x130, %edx            # imm = 0x130
callq 0x3150
movups 0xff6e(%rip), %xmm0     # 0x145e0
movaps %xmm0, 0x10(%rsp)
movups 0xff52(%rip), %xmm0     # 0x145d0
movaps %xmm0, (%rsp)
leaq 0xfd27(%rip), %rsi      # 0x143b0
leaq 0x1d8(%rsp), %rdi
movl $0x220, %edx            # imm = 0x220
callq 0x3150
movl 0xff4f(%rip), %ebp      # 0x145f0
movl $0x0, 0x10049(%rip)     # 0x146f4
leaq 0x1e6f6(%rip), %r12     # 0x22da8
movq (%rbx), %r13
cmpq %r14, 0x38(%rbx)
jne 0x4765
incl 0xfcd7(%rip)            # 0x1439c
movl 0x14(%rbx), %eax
movl %eax, 0xff3a(%rip)      # 0x14608
movl 0x18(%rbx), %eax
movl %eax, 0xff35(%rip)      # 0x1460c
movl 0x1c(%rbx), %eax
movl %eax, 0xff38(%rip)      # 0x14618
movl 0x20(%rbx), %eax
movl %eax, 0xff33(%rip)      # 0x1461c
movl 0x24(%rbx), %eax
movl %eax, 0xff3a(%rip)      # 0x1462c
movl 0x10(%rbx), %eax
movl %eax, 0xfcb5(%rip)      # 0x143b0
movq 0x40(%rbx), %rax
movq %rax, 0xfeda(%rip)      # 0x145e0
leaq 0x48(%rbx), %rax
movq %rax, 0x1008f(%rip)     # 0x147a0
movl 0x30(%rbx), %eax
movl %eax, 0xfed6(%rip)      # 0x145f0
movl $0x1, %edi
callq 0x42cd
movq $0x0, 0x38(%rbx)
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x473b
movq (%rbx), %rcx
movq %rcx, (%rax)
movq (%rbx), %rcx
testq %rcx, %rcx
je 0x4747
movq %rax, 0x8(%rcx)
cmpq (%r15), %rbx
jne 0x474f
movq %rcx, (%r15)
cmpq (%r12), %rbx
jne 0x475d
movq 0x8(%rbx), %rax
movq %rax, (%r12)
movq %rbx, %rdi
callq 0x3050
movq %r13, %rbx
testq %r13, %r13
jne 0x46b2
movl %ebp, 0xfe79(%rip)      # 0x145f0
movaps (%rsp), %xmm0
movaps 0x10(%rsp), %xmm1
movups %xmm0, 0xfe49(%rip)     # 0x145d0
movups %xmm1, 0xfe52(%rip)     # 0x145e0
leaq 0xfe73(%rip), %rdi      # 0x14608
leaq 0x20(%rsp), %rsi
movl $0x88, %edx
callq 0x3150
movq %r14, 0xfee5(%rip)      # 0x14690
leaq 0xfee6(%rip), %rdi      # 0x14698
leaq 0xa8(%rsp), %rsi
movl $0x130, %edx            # imm = 0x130
callq 0x3150
leaq 0xfbe5(%rip), %rdi      # 0x143b0
leaq 0x1d8(%rsp), %rsi
movl $0x220, %edx            # imm = 0x220
callq 0x3150
movl $0x0, 0xff0d(%rip)      # 0x146f4
addq $0x3f8, %rsp            # imm = 0x3F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq