// File: /workspace/github_c_makefile_star2_O0/heltilda[P]cicada/ciclib.c
// Function: cclib_setCompiler
void cclib_setCompiler()
{
    ccInt numArgs = numBIF_args(), rtrn;
    
    
        // if we're just trying to switch compilers, allow that
    
    if (numArgs == 1)  {
        whichCompiler = (ccInt) getBIFnumArg(1, 1., (ccFloat) allCompilers.elementNum);  
        if (errCode == passed)  {
            currentCompiler = *(compiler_type **) element(&allCompilers, whichCompiler);
    }   }
    
    
        // if we pass two arguments, that means that we're defining a new compiler
    
    else if (numArgs == 2)  {
        window *argWindows[5], *arg1Window = getBIFmember(1), *arg2Window = getBIFmember(2), *arg1CompositeWindow;
        member *argMembers[5], *oneArgMember, *arg1Member;
        compiler_type *tempCompiler = NULL;
        commandTokenType *cmdTokens;
        ccInt numCommands, numOoOs, loopArg, loopCommand, *precedences, argMemberNumber, entryOffset, windowOffsets[5];
        ccInt expectedType[5] = {  string_type, int_type, string_type, string_type, int_type  };
        
        if (arg1Window == NULL)  setError(void_member_err, pcCodePtr-1);
        else if (arg2Window == NULL)  setError(void_member_err, pcCodePtr-1);
        else if (arg1Window->variable_ptr->type != array_type)  setError(not_composite_err, pcCodePtr-1);
        else if (arg2Window->variable_ptr->type != array_type)  setError(not_composite_err, pcCodePtr-1);
        if (errCode != passed)  return;
        
        arg1Member = LL_member(arg1Window->variable_ptr, 1);
        arg1CompositeWindow = arg1Member->memberWindow;

        if (arg1CompositeWindow == NULL)  setError(void_member_err, pcCodePtr-1);
        if (arg1CompositeWindow->variable_ptr->type != composite_type)  setError(not_composite_err, pcCodePtr-1);
        if (errCode != passed)  return;
        
        for (loopArg = 0; loopArg < 5; loopArg++)  {
            if (loopArg < 4)  {
                findMemberIndex(arg1CompositeWindow->variable_ptr, 0, loopArg+1, &oneArgMember, &argMemberNumber, &entryOffset, ccFalse);
                argWindows[loopArg] = oneArgMember->memberWindow;
                windowOffsets[loopArg] = arg1Window->offset * arg1Member->indices;      }
            else  {
                argWindows[loopArg] = LL_member(arg2Window->variable_ptr, 1)->memberWindow;
                windowOffsets[loopArg] = 0;         }
            windowOffsets[loopArg] += argWindows[loopArg]->offset;
            
            if (errCode != passed)  return;
            if (argWindows[loopArg] == NULL)  {  setError(void_member_err, pcCodePtr-1);  return;  }
            if (argWindows[loopArg]->variable_ptr->type != expectedType[loopArg])  {
                if (expectedType[loopArg] == string_type)  setError(string_expected_err, pcCodePtr-1);
                else  setError(not_a_number_err, pcCodePtr-1);
                return;     }
            
            if (defragmentLinkedList(&(argWindows[loopArg]->variable_ptr->mem.data)) != passed)  {
                setError(void_member_err, pcCodePtr-1);
                return;         }
            if (argWindows[loopArg]->width == 0)  argMembers[loopArg] = NULL;
            else  argMembers[loopArg] = LL_member(argWindows[loopArg]->variable_ptr, windowOffsets[loopArg]+1);
            
            if (expectedType[loopArg] == string_type)  {
            for (loopCommand = 0; loopCommand < argWindows[loopArg]->width; loopCommand++)  {
                if (defragmentLinkedList(&(argMembers[loopArg][loopCommand].memberWindow->variable_ptr->mem.data)) != passed)  {
                    setError(out_of_memory_err, pcCodePtr-1);
                    return;
        }   }}  }
        
        numCommands = arg1Member->indices;
        numOoOs = LL_member(arg2Window->variable_ptr, 1)->indices;
        if (numCommands == 0)  precedences = NULL;
        else  precedences = LL_int(&(argWindows[1]->variable_ptr->mem.data), 1);
        
        cmdTokens = (commandTokenType *) malloc(numCommands*sizeof(commandTokenType));
        
        if (cmdTokens == NULL)  setError(out_of_memory_err, pcCodePtr-1);  
        else  {
            for (loopCommand = 0; loopCommand < numCommands; loopCommand++)  {
                cmdTokens[loopCommand].cmdString =
                        (const char *) getCompilerString(argWindows[0], windowOffsets[0], loopCommand);
                cmdTokens[loopCommand].precedence = precedences[loopCommand];
                cmdTokens[loopCommand].rtrnTypeString =
                        (const char *) getCompilerString(argWindows[2], windowOffsets[2], loopCommand);
                cmdTokens[loopCommand].translation =
                        (const char *) getCompilerString(argWindows[3], windowOffsets[3], loopCommand);    }
            
            if (errCode == passed)  {
                tempCompiler = newCompiler(cmdTokens, numCommands,
                            LL_int(&(argWindows[4]->variable_ptr->mem.data), argWindows[4]->offset+1), numOoOs, &rtrn);
                if (rtrn != passed)  setError(rtrn, pcCodePtr-1);
                
                else  {
                    rtrn = addElements(&allCompilers, 1, ccFalse);
                    if (rtrn != passed)  setError(rtrn, pcCodePtr-1);
                    else  {
                        currentCompiler = tempCompiler;
                        whichCompiler = allCompilers.elementNum;
                        *(compiler_type **) element(&allCompilers, whichCompiler) = tempCompiler;
            }   }   }
            
            for (loopCommand = 0; loopCommand < numCommands; loopCommand++)  {
                free((void *) cmdTokens[loopCommand].cmdString);
                free((void *) cmdTokens[loopCommand].rtrnTypeString);
                free((void *) cmdTokens[loopCommand].translation);        }
            free((void *) cmdTokens);
    }   }
    
        // zero args is allowed -- that means the user is just requesting the current compiler number
    
    else if (numArgs != 0)  setError(wrong_argument_count_err, pcCodePtr-1);
    
    intRegister = whichCompiler;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
callq 0x1fa40
movl %eax, -0x4(%rbp)
cmpl $0x1, -0x4(%rbp)
jne 0x1bfda
leaq 0x107e0(%rip), %rax     # 0x2c750
cvtsi2sdl 0x288(%rax), %xmm1
movl $0x1, %edi
movsd 0x6083(%rip), %xmm0     # 0x22008
callq 0x1fb80
cvttsd2si %xmm0, %ecx
leaq 0x107bb(%rip), %rax     # 0x2c750
movl %ecx, 0x1f0(%rax)
leaq 0x107ae(%rip), %rax     # 0x2c750
cmpl $0x0, 0x18(%rax)
jne 0x1bfd5
leaq 0x107a1(%rip), %rax     # 0x2c750
movl 0x1f0(%rax), %esi
leaq 0x10794(%rip), %rdi     # 0x2c750
addq $0x288, %rdi            # imm = 0x288
callq 0x9700
movq (%rax), %rcx
leaq 0x102be(%rip), %rax     # 0x2c290
movq %rcx, (%rax)
jmp 0x1c7d7
cmpl $0x2, -0x4(%rbp)
jne 0x1c7b1
movl $0x1, %edi
callq 0x1fab0
movq %rax, -0x38(%rbp)
movl $0x2, %edi
callq 0x1fab0
movq %rax, -0x40(%rbp)
movq $0x0, -0x88(%rbp)
movq 0x6cde(%rip), %rax      # 0x22cf0
movq %rax, -0xf0(%rbp)
movq 0x6cd8(%rip), %rax      # 0x22cf8
movq %rax, -0xe8(%rbp)
movl 0x6cd3(%rip), %eax      # 0x22d00
movl %eax, -0xe0(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x1c05b
leaq 0x1070f(%rip), %rax     # 0x2c750
movq 0xb8(%rax), %rsi
addq $-0x4, %rsi
movl $0x1a, %edi
callq 0xf740
jmp 0x1c0e2
cmpq $0x0, -0x40(%rbp)
jne 0x1c080
leaq 0x106e7(%rip), %rax     # 0x2c750
movq 0xb8(%rax), %rsi
addq $-0x4, %rsi
movl $0x1a, %edi
callq 0xf740
jmp 0x1c0e0
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
cmpl $0x6, 0xc0(%rax)
je 0x1c0af
leaq 0x106b8(%rip), %rax     # 0x2c750
movq 0xb8(%rax), %rsi
addq $-0x4, %rsi
movl $0x24, %edi
callq 0xf740
jmp 0x1c0de
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
cmpl $0x6, 0xc0(%rax)
je 0x1c0dc
leaq 0x10689(%rip), %rax     # 0x2c750
movq 0xb8(%rax), %rsi
addq $-0x4, %rsi
movl $0x24, %edi
callq 0xf740
jmp 0x1c0de
jmp 0x1c0e0
jmp 0x1c0e2
leaq 0x10667(%rip), %rax     # 0x2c750
cmpl $0x0, 0x18(%rax)
je 0x1c0f4
jmp 0x1c7ee
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rdi
addq $0x10, %rdi
movl $0x1, %esi
callq 0x9700
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
jne 0x1c13c
leaq 0x10629(%rip), %rax     # 0x2c750
movq 0xb8(%rax), %rsi
addq $-0x4, %rsi
movl $0x1a, %edi
callq 0xf740
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rax
cmpl $0x5, 0xc0(%rax)
je 0x1c169
leaq 0x105fc(%rip), %rax     # 0x2c750
movq 0xb8(%rax), %rsi
addq $-0x4, %rsi
movl $0x24, %edi
callq 0xf740
leaq 0x105e0(%rip), %rax     # 0x2c750
cmpl $0x0, 0x18(%rax)
je 0x1c17b
jmp 0x1c7ee
movl $0x0, -0x9c(%rbp)
cmpl $0x5, -0x9c(%rbp)
jge 0x1c45e
cmpl $0x4, -0x9c(%rbp)
jge 0x1c1fe
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rdi
movl -0x9c(%rbp), %edx
addl $0x1, %edx
xorl %esi, %esi
leaq -0x78(%rbp), %rcx
leaq -0xac(%rbp), %r8
leaq -0xb0(%rbp), %r9
movl $0x0, (%rsp)
callq 0x128f0
movq -0x78(%rbp), %rax
movq (%rax), %rcx
movslq -0x9c(%rbp), %rax
movq %rcx, -0x30(%rbp,%rax,8)
movq -0x38(%rbp), %rax
movl 0x18(%rax), %ecx
movq -0x80(%rbp), %rax
imull 0xc(%rax), %ecx
movslq -0x9c(%rbp), %rax
movl %ecx, -0xd0(%rbp,%rax,4)
jmp 0x1c235
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rdi
addq $0x10, %rdi
movl $0x1, %esi
callq 0x9700
movq (%rax), %rcx
movslq -0x9c(%rbp), %rax
movq %rcx, -0x30(%rbp,%rax,8)
movslq -0x9c(%rbp), %rax
movl $0x0, -0xd0(%rbp,%rax,4)
movslq -0x9c(%rbp), %rax
movq -0x30(%rbp,%rax,8), %rax
movl 0x18(%rax), %ecx
movslq -0x9c(%rbp), %rax
addl -0xd0(%rbp,%rax,4), %ecx
movl %ecx, -0xd0(%rbp,%rax,4)
leaq 0x104f0(%rip), %rax     # 0x2c750
cmpl $0x0, 0x18(%rax)
je 0x1c26b
jmp 0x1c7ee
movslq -0x9c(%rbp), %rax
cmpq $0x0, -0x30(%rbp,%rax,8)
jne 0x1c29b
leaq 0x104cf(%rip), %rax     # 0x2c750
movq 0xb8(%rax), %rsi
addq $-0x4, %rsi
movl $0x1a, %edi
callq 0xf740
jmp 0x1c7ee
movslq -0x9c(%rbp), %rax
movq -0x30(%rbp,%rax,8), %rax
movq 0x10(%rax), %rax
movl 0xc0(%rax), %eax
movslq -0x9c(%rbp), %rcx
cmpl -0xf0(%rbp,%rcx,4), %eax
je 0x1c311
movslq -0x9c(%rbp), %rax
cmpl $0x4, -0xf0(%rbp,%rax,4)
jne 0x1c2f0
leaq 0x10477(%rip), %rax     # 0x2c750
movq 0xb8(%rax), %rsi
addq $-0x4, %rsi
movl $0x25, %edi
callq 0xf740
jmp 0x1c30c
leaq 0x10459(%rip), %rax     # 0x2c750
movq 0xb8(%rax), %rsi
addq $-0x4, %rsi
movl $0x29, %edi
callq 0xf740
jmp 0x1c7ee
movslq -0x9c(%rbp), %rax
movq -0x30(%rbp,%rax,8), %rax
movq 0x10(%rax), %rdi
addq $0x10, %rdi
callq 0x8f70
cmpl $0x0, %eax
je 0x1c350
leaq 0x1041a(%rip), %rax     # 0x2c750
movq 0xb8(%rax), %rsi
addq $-0x4, %rsi
movl $0x1a, %edi
callq 0xf740
jmp 0x1c7ee
movslq -0x9c(%rbp), %rax
movq -0x30(%rbp,%rax,8), %rax
cmpl $0x0, 0x1c(%rax)
jne 0x1c374
movslq -0x9c(%rbp), %rax
movq $0x0, -0x70(%rbp,%rax,8)
jmp 0x1c3ad
movslq -0x9c(%rbp), %rax
movq -0x30(%rbp,%rax,8), %rax
movq 0x10(%rax), %rdi
addq $0x10, %rdi
movslq -0x9c(%rbp), %rax
movl -0xd0(%rbp,%rax,4), %esi
addl $0x1, %esi
callq 0x9700
movq %rax, %rcx
movslq -0x9c(%rbp), %rax
movq %rcx, -0x70(%rbp,%rax,8)
movslq -0x9c(%rbp), %rax
cmpl $0x4, -0xf0(%rbp,%rax,4)
jne 0x1c448
movl $0x0, -0xa0(%rbp)
movl -0xa0(%rbp), %eax
movslq -0x9c(%rbp), %rcx
movq -0x30(%rbp,%rcx,8), %rcx
cmpl 0x1c(%rcx), %eax
jge 0x1c446
movslq -0x9c(%rbp), %rax
movq -0x70(%rbp,%rax,8), %rax
movslq -0xa0(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq 0x10(%rax), %rdi
addq $0x10, %rdi
callq 0x8f70
cmpl $0x0, %eax
je 0x1c433
leaq 0x10337(%rip), %rax     # 0x2c750
movq 0xb8(%rax), %rsi
addq $-0x4, %rsi
movl $0x1, %edi
callq 0xf740
jmp 0x1c7ee
jmp 0x1c435
movl -0xa0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa0(%rbp)
jmp 0x1c3cc
jmp 0x1c448
jmp 0x1c44a
movl -0x9c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x9c(%rbp)
jmp 0x1c185
movq -0x80(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x94(%rbp)
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rdi
addq $0x10, %rdi
movl $0x1, %esi
callq 0x9700
movl 0xc(%rax), %eax
movl %eax, -0x98(%rbp)
cmpl $0x0, -0x94(%rbp)
jne 0x1c4a0
movq $0x0, -0xa8(%rbp)
jmp 0x1c4bd
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rdi
addq $0x10, %rdi
movl $0x1, %esi
callq 0x9700
movq %rax, -0xa8(%rbp)
movslq -0x94(%rbp), %rdi
shlq $0x5, %rdi
callq 0x81d0
movq %rax, -0x90(%rbp)
cmpq $0x0, -0x90(%rbp)
jne 0x1c4ff
leaq 0x1026b(%rip), %rax     # 0x2c750
movq 0xb8(%rax), %rsi
addq $-0x4, %rsi
movl $0x1, %edi
callq 0xf740
jmp 0x1c7af
movl $0x0, -0xa0(%rbp)
movl -0xa0(%rbp), %eax
cmpl -0x94(%rbp), %eax
jge 0x1c5ea
movq -0x30(%rbp), %rdi
movl -0xd0(%rbp), %esi
movl -0xa0(%rbp), %edx
callq 0x1fcb0
movq %rax, %rcx
movq -0x90(%rbp), %rax
movslq -0xa0(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movq %rcx, (%rax)
movq -0xa8(%rbp), %rax
movslq -0xa0(%rbp), %rcx
movl (%rax,%rcx,4), %ecx
movq -0x90(%rbp), %rax
movslq -0xa0(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movl %ecx, 0x8(%rax)
movq -0x20(%rbp), %rdi
movl -0xc8(%rbp), %esi
movl -0xa0(%rbp), %edx
callq 0x1fcb0
movq %rax, %rcx
movq -0x90(%rbp), %rax
movslq -0xa0(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rdi
movl -0xc4(%rbp), %esi
movl -0xa0(%rbp), %edx
callq 0x1fcb0
movq %rax, %rcx
movq -0x90(%rbp), %rax
movslq -0xa0(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movq %rcx, 0x18(%rax)
movl -0xa0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa0(%rbp)
jmp 0x1c509
leaq 0x1015f(%rip), %rax     # 0x2c750
cmpl $0x0, 0x18(%rax)
jne 0x1c721
movq -0x90(%rbp), %rax
movq %rax, -0x100(%rbp)
movl -0x94(%rbp), %eax
movl %eax, -0xf4(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
addq $0x10, %rdi
movq -0x10(%rbp), %rax
movl 0x18(%rax), %esi
addl $0x1, %esi
callq 0x9700
movq -0x100(%rbp), %rdi
movl -0xf4(%rbp), %esi
movq %rax, %rdx
movl -0x98(%rbp), %ecx
leaq -0x8(%rbp), %r8
callq 0x9c60
movq %rax, -0x88(%rbp)
cmpl $0x0, -0x8(%rbp)
je 0x1c67b
movl -0x8(%rbp), %edi
leaq 0x100ea(%rip), %rax     # 0x2c750
movq 0xb8(%rax), %rsi
addq $-0x4, %rsi
callq 0xf740
jmp 0x1c71f
leaq 0x100ce(%rip), %rdi     # 0x2c750
addq $0x288, %rdi            # imm = 0x288
movl $0x1, %esi
xorl %edx, %edx
callq 0x8e70
movl %eax, -0x8(%rbp)
cmpl $0x0, -0x8(%rbp)
je 0x1c6ba
movl -0x8(%rbp), %edi
leaq 0x100a8(%rip), %rax     # 0x2c750
movq 0xb8(%rax), %rsi
addq $-0x4, %rsi
callq 0xf740
jmp 0x1c71d
movq -0x88(%rbp), %rcx
leaq 0xfbc8(%rip), %rax      # 0x2c290
movq %rcx, (%rax)
leaq 0x1007e(%rip), %rax     # 0x2c750
movl 0x288(%rax), %ecx
leaq 0x10071(%rip), %rax     # 0x2c750
movl %ecx, 0x1f0(%rax)
movq -0x88(%rbp), %rax
movq %rax, -0x108(%rbp)
leaq 0x10056(%rip), %rax     # 0x2c750
movl 0x1f0(%rax), %esi
leaq 0x10049(%rip), %rdi     # 0x2c750
addq $0x288, %rdi            # imm = 0x288
callq 0x9700
movq -0x108(%rbp), %rcx
movq %rcx, (%rax)
jmp 0x1c71f
jmp 0x1c721
movl $0x0, -0xa0(%rbp)
movl -0xa0(%rbp), %eax
cmpl -0x94(%rbp), %eax
jge 0x1c7a3
movq -0x90(%rbp), %rax
movslq -0xa0(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rdi
callq 0x81c0
movq -0x90(%rbp), %rax
movslq -0xa0(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rdi
callq 0x81c0
movq -0x90(%rbp), %rax
movslq -0xa0(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rdi
callq 0x81c0
movl -0xa0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa0(%rbp)
jmp 0x1c72b
movq -0x90(%rbp), %rdi
callq 0x81c0
jmp 0x1c7d5
cmpl $0x0, -0x4(%rbp)
je 0x1c7d3
leaq 0xff92(%rip), %rax      # 0x2c750
movq 0xb8(%rax), %rsi
addq $-0x4, %rsi
movl $0x2d, %edi
callq 0xf740
jmp 0x1c7d5
jmp 0x1c7d7
leaq 0xff72(%rip), %rax      # 0x2c750
movl 0x1f0(%rax), %ecx
leaq 0xff65(%rip), %rax      # 0x2c750
movl %ecx, 0x6c(%rax)
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
nopw (%rax,%rax)