// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x420, %rsp            # imm = 0x420
cmpl $0x0, 0x1bd92(%rip)     # 0x20ad4
jne 0x4d56
cmpl $0x0, 0x13999(%rip)     # 0x186e4
je 0x4d56
cmpl $0x0, 0x13988(%rip)     # 0x186dc
je 0x4d5b
jmp 0x4fd2
leaq 0x2202e(%rip), %rax     # 0x26d90
cmpq $0x0, (%rax)
je 0x4fc8
leaq 0x2201d(%rip), %rax     # 0x26d90
movq (%rax), %rax
movq %rax, -0x10(%rbp)
leaq -0x1d0(%rbp), %rdi
leaq 0x13870(%rip), %rsi     # 0x185f8
movl $0x1c0, %edx            # imm = 0x1C0
callq 0x3140
movq 0x13827(%rip), %rax     # 0x185c0
movq %rax, -0x1f0(%rbp)
movq 0x13821(%rip), %rax     # 0x185c8
movq %rax, -0x1e8(%rbp)
movq 0x1381b(%rip), %rax     # 0x185d0
movq %rax, -0x1e0(%rbp)
movq 0x13815(%rip), %rax     # 0x185d8
movq %rax, -0x1d8(%rbp)
leaq -0x410(%rbp), %rdi
leaq 0x135c8(%rip), %rsi     # 0x183a0
movl $0x220, %edx            # imm = 0x220
callq 0x3140
movl 0x137f8(%rip), %eax     # 0x185e0
movl %eax, -0x414(%rbp)
movl $0x0, 0x138ec(%rip)     # 0x186e4
cmpq $0x0, -0x10(%rbp)
je 0x4f54
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x8(%rbp)
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
cmpq -0x148(%rbp), %rax
jne 0x4f47
movl 0x13563(%rip), %eax     # 0x1838c
addl $0x1, %eax
movl %eax, 0x1355a(%rip)     # 0x1838c
movq -0x10(%rbp), %rax
movl 0x14(%rax), %eax
movl %eax, 0x137b9(%rip)     # 0x185f8
movq -0x10(%rbp), %rax
movl 0x18(%rax), %eax
movl %eax, 0x137b0(%rip)     # 0x185fc
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %eax
movl %eax, 0x137af(%rip)     # 0x18608
movq -0x10(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, 0x137a6(%rip)     # 0x1860c
movq -0x10(%rbp), %rax
movl 0x24(%rax), %eax
movl %eax, 0x137a9(%rip)     # 0x1861c
movq -0x10(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, 0x13520(%rip)     # 0x183a0
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq %rax, 0x13741(%rip)     # 0x185d0
movq -0x10(%rbp), %rax
addq $0x48, %rax
movq %rax, 0x138f2(%rip)     # 0x18790
movq -0x10(%rbp), %rax
movl 0x30(%rax), %eax
movl %eax, 0x13735(%rip)     # 0x185e0
movl $0x1, %edi
callq 0x48f0
movq -0x10(%rbp), %rax
movq $0x0, 0x38(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x4ede
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
je 0x4efb
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
leaq 0x21e8a(%rip), %rcx     # 0x26d90
cmpq (%rcx), %rax
jne 0x4f1c
movq -0x10(%rbp), %rax
movq (%rax), %rcx
leaq 0x21e77(%rip), %rax     # 0x26d90
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
leaq 0x21e71(%rip), %rcx     # 0x26d98
cmpq (%rcx), %rax
jne 0x4f3e
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
leaq 0x21e5d(%rip), %rax     # 0x26d98
movq %rcx, (%rax)
movq -0x10(%rbp), %rdi
callq 0x3040
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
jmp 0x4df8
movl -0x414(%rbp), %eax
movl %eax, 0x13680(%rip)     # 0x185e0
movq -0x1f0(%rbp), %rax
movq %rax, 0x13652(%rip)     # 0x185c0
movq -0x1e8(%rbp), %rax
movq %rax, 0x1364c(%rip)     # 0x185c8
movq -0x1e0(%rbp), %rax
movq %rax, 0x13646(%rip)     # 0x185d0
movq -0x1d8(%rbp), %rax
movq %rax, 0x13640(%rip)     # 0x185d8
leaq 0x13659(%rip), %rdi     # 0x185f8
leaq -0x1d0(%rbp), %rsi
movl $0x1c0, %edx            # imm = 0x1C0
callq 0x3140
leaq 0x133e9(%rip), %rdi     # 0x183a0
leaq -0x410(%rbp), %rsi
movl $0x220, %edx            # imm = 0x220
callq 0x3140
movl $0x0, 0x13712(%rip)     # 0x186e4
addq $0x420, %rsp            # imm = 0x420
popq %rbp
retq
nopl (%rax,%rax)