// File: /workspace/github_c_makefile_star2_O3/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, 0x18512(%rip)     # 0x1cae4
jne 0x47c0
cmpl $0x0, 0x10115(%rip)     # 0x146f4
je 0x47c0
cmpl $0x0, 0x10100(%rip)     # 0x146ec
jne 0x47c0
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3f8, %rsp            # imm = 0x3F8
leaq 0x1e796(%rip), %r15     # 0x22da0
movq (%r15), %rbx
testq %rbx, %rbx
je 0x47a5
leaq 0xffeb(%rip), %rsi      # 0x14608
leaq 0x20(%rsp), %rdi
movl $0x88, %edx
callq 0x3150
movq 0x1005d(%rip), %r14     # 0x14690
leaq 0x1005e(%rip), %rsi     # 0x14698
leaq 0xa8(%rsp), %rdi
movl $0x130, %edx            # imm = 0x130
callq 0x3150
movups 0xff8d(%rip), %xmm0     # 0x145e0
movaps %xmm0, 0x10(%rsp)
movups 0xff71(%rip), %xmm0     # 0x145d0
movaps %xmm0, (%rsp)
leaq 0xfd46(%rip), %rsi      # 0x143b0
leaq 0x1d8(%rsp), %rdi
movl $0x220, %edx            # imm = 0x220
callq 0x3150
movl 0xff6e(%rip), %ebp      # 0x145f0
movl $0x0, 0x10068(%rip)     # 0x146f4
leaq 0x1e715(%rip), %r12     # 0x22da8
movq (%rbx), %r13
cmpq %r14, 0x38(%rbx)
jne 0x472d
incl 0xfcf6(%rip)            # 0x1439c
movq 0x14(%rbx), %rax
movq %rax, 0xff57(%rip)      # 0x14608
movq 0x1c(%rbx), %rax
movq %rax, 0xff5c(%rip)      # 0x14618
movl 0x24(%rbx), %eax
movl %eax, 0xff67(%rip)      # 0x1462c
movl 0x10(%rbx), %eax
movl %eax, 0xfce2(%rip)      # 0x143b0
movq 0x40(%rbx), %rax
movq %rax, 0xff07(%rip)      # 0x145e0
leaq 0x48(%rbx), %rax
movq %rax, 0x100bc(%rip)     # 0x147a0
movl 0x30(%rbx), %eax
movl %eax, 0xff03(%rip)      # 0x145f0
movl $0x1, %edi
callq 0x42bd
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
testq %rcx, %rcx
je 0x4706
movq %rax, (%rcx)
testq %rax, %rax
je 0x470f
movq %rcx, 0x8(%rax)
cmpq (%r15), %rbx
jne 0x4717
movq %rax, (%r15)
cmpq (%r12), %rbx
jne 0x4725
movq 0x8(%rbx), %rax
movq %rax, (%r12)
movq %rbx, %rdi
callq 0x3050
movq %r13, %rbx
testq %r13, %r13
jne 0x4693
movl %ebp, 0xfeb1(%rip)      # 0x145f0
movaps (%rsp), %xmm0
movaps 0x10(%rsp), %xmm1
movups %xmm0, 0xfe81(%rip)     # 0x145d0
movups %xmm1, 0xfe8a(%rip)     # 0x145e0
leaq 0xfeab(%rip), %rdi      # 0x14608
leaq 0x20(%rsp), %rsi
movl $0x88, %edx
callq 0x3150
movq %r14, 0xff1d(%rip)      # 0x14690
leaq 0xff1e(%rip), %rdi      # 0x14698
leaq 0xa8(%rsp), %rsi
movl $0x130, %edx            # imm = 0x130
callq 0x3150
leaq 0xfc1d(%rip), %rdi      # 0x143b0
leaq 0x1d8(%rsp), %rsi
movl $0x220, %edx            # imm = 0x220
callq 0x3150
movl $0x0, 0xff45(%rip)      # 0x146f4
addq $0x3f8, %rsp            # imm = 0x3F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq