// File: /workspace/github_c_makefile_star2_O1/MartinNovotny25[P]VUT-FIT-IFJ2020/semantics.c
// Function: insertBuiltInFunction
void insertBuiltInFunction() {
    functionData inputs;
    inputs.numOfParams = 0;
    inputs.numOfReturns = 2;
    inputs.returns[0] = t_STRING_ID;
    inputs.returns[1] = t_INT_ID;
    
    functionData inputi;
    inputi.numOfParams = 0;
    inputi.numOfReturns = 2;
    inputi.returns[0] = t_INT_ID;
    inputi.returns[1] = t_INT_ID;
    
    functionData inputf;
    inputf.numOfParams = 0;
    inputf.numOfReturns = 2;
    inputf.returns[0] = t_FLOAT64;
    inputf.returns[1] = t_INT_ID;
    
    functionData int2float;
    int2float.numOfParams = 1;
    int2float.numOfReturns = 1;
    int2float.returns[0] = t_FLOAT64;
    int2float.paramsType[0] = t_INT_ID;
    int2float.params[0] = "i";
    
    functionData float2int;
    float2int.numOfParams = 1;
    float2int.numOfReturns = 1;
    float2int.returns[0] = t_INT_ID;
    float2int.paramsType[0] = t_FLOAT64;
    float2int.params[0] = "f";
    
    functionData len;
    len.numOfParams = 1;
    len.numOfReturns = 1;
    len.returns[0] = t_INT_ID;
    len.paramsType[0] = t_STRING_ID;
    len.params[0] = "s";
    
    functionData substr;
    substr.numOfParams = 3;
    substr.numOfReturns =2;
    substr.returns[0] = t_STRING_ID;
    substr.returns[1] = t_INT_ID;
    substr.paramsType[0] = t_STRING_ID;
    substr.paramsType[1] = t_INT_ID;
    substr.paramsType[2] = t_INT_ID;
    substr.params[0] = "s";
    substr.params[1] = "i";
    substr.params[2] = "n";
    
    functionData ord;
    ord.numOfParams = 2;
    ord.numOfReturns =2;
    ord.returns[0] = t_INT_ID;
    ord.returns[1] = t_INT_ID;
    ord.paramsType[0] = t_STRING_ID;
    ord.paramsType[1] = t_INT_ID;
    ord.params[0] = "s";
    ord.params[0] = "i";
    
    functionData chr;
    chr.numOfParams = 1;
    chr.numOfReturns = 2;
    chr.returns[0] = t_STRING_ID;
    chr.returns[1] = t_INT_ID;
    chr.paramsType[0] = t_INT_ID;
    chr.params[0] = "i";
    
    functionData print;
    print.numOfParams = MAXPARAMS;
    print.numOfReturns = 0;
    
    BSTInsertGlobal(&functions, "inputs", inputs);
    BSTInsertGlobal(&functions, "inputi", inputi);
    BSTInsertGlobal(&functions, "inputf", inputf);
    BSTInsertGlobal(&functions, "int2float", int2float);
    BSTInsertGlobal(&functions, "float2int", float2int);
    BSTInsertGlobal(&functions, "len", len);
    BSTInsertGlobal(&functions, "substr", substr);
    BSTInsertGlobal(&functions, "ord", ord);
    BSTInsertGlobal(&functions, "chr", chr);
    BSTInsertGlobal(&functions, "print", print);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb058, %rsp           # imm = 0xB058
movabsq $0x200000000, %rdx      # imm = 0x200000000
leaq 0xa050(%rsp), %rsi
movq %rdx, (%rsi)
movabsq $0x1800000014, %rax     # imm = 0x1800000014
movq %rax, 0xc08(%rsi)
leaq 0x4020(%rsp), %rdi
movq %rdx, (%rdi)
movabsq $0x1800000018, %rcx     # imm = 0x1800000018
movq %rcx, 0xc08(%rdi)
leaq 0x3018(%rsp), %rdi
movq %rdx, (%rdi)
movabsq $0x1800000017, %rdx     # imm = 0x1800000017
movq %rdx, 0xc08(%rdi)
movabsq $0x100000001, %r8       # imm = 0x100000001
leaq 0x9048(%rsp), %r15
movq %r8, (%r15)
movl $0x17, %r9d
movl %r9d, 0xc08(%r15)
movl $0x18, %edx
movl %edx, 0x808(%r15)
leaq 0x10b6(%rip), %rdi      # 0x8547
movq %rdi, 0x8(%r15)
leaq 0x8040(%rsp), %rbx
movq %r8, (%rbx)
movl %edx, 0xc08(%rbx)
movl %r9d, 0x808(%rbx)
leaq 0xdce(%rip), %r9        # 0x8282
movq %r9, 0x8(%rbx)
leaq 0x7038(%rsp), %rbp
movq %r8, (%rbp)
movl %edx, 0xc08(%rbp)
movl $0x14, 0x808(%rbp)
leaq 0x1065(%rip), %r8       # 0x8540
movq %r8, 0x8(%rbp)
movabsq $0x200000003, %r9       # imm = 0x200000003
leaq 0x6030(%rsp), %r13
movq %r9, (%r13)
movq %rax, 0xc08(%r13)
movq %rax, 0x808(%r13)
movl %edx, 0x810(%r13)
movq %r8, 0x8(%r13)
movq %rdi, 0x10(%r13)
leaq 0x104d(%rip), %r8       # 0x8566
movq %r8, 0x18(%r13)
movabsq $0x200000002, %r8       # imm = 0x200000002
leaq 0x5028(%rsp), %r12
movq %r8, (%r12)
movq %rcx, 0xc08(%r12)
movq %rax, 0x808(%r12)
movq %rdi, 0x8(%r12)
movabsq $0x200000001, %rcx      # imm = 0x200000001
leaq 0x2010(%rsp), %r8
movq %rcx, (%r8)
movq %rax, 0xc08(%r8)
movl %edx, 0x808(%r8)
movq %rdi, 0x8(%r8)
leaq 0x1008(%rsp), %rax
movq $0x100, (%rax)          # imm = 0x100
movl $0x201, %ecx            # imm = 0x201
movq %rsp, %rdi
rep  movsq (%rsi), %es:(%rdi)
leaq 0x6e40(%rip), %r14      # 0xe3d0
leaq 0xfa4(%rip), %rsi       # 0x853b
movq %r14, %rdi
callq 0x43fe
movl $0x201, %ecx            # imm = 0x201
movq %rsp, %rdi
leaq 0x4020(%rsp), %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0xf89(%rip), %rsi       # 0x8542
movq %r14, %rdi
callq 0x43fe
movl $0x201, %ecx            # imm = 0x201
movq %rsp, %rdi
leaq 0x3018(%rsp), %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0xf6e(%rip), %rsi       # 0x8549
movq %r14, %rdi
callq 0x43fe
movl $0x201, %ecx            # imm = 0x201
movq %rsp, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0xf58(%rip), %rsi       # 0x8550
movq %r14, %rdi
callq 0x43fe
movl $0x201, %ecx            # imm = 0x201
movq %rsp, %rdi
movq %rbx, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0xf45(%rip), %rsi       # 0x855a
movq %r14, %rdi
callq 0x43fe
movl $0x201, %ecx            # imm = 0x201
movq %rsp, %rdi
movq %rbp, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0xf32(%rip), %rsi       # 0x8564
movq %r14, %rdi
callq 0x43fe
movl $0x201, %ecx            # imm = 0x201
movq %rsp, %rdi
movq %r13, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0xf19(%rip), %rsi       # 0x8568
movq %r14, %rdi
callq 0x43fe
movl $0x201, %ecx            # imm = 0x201
movq %rsp, %rdi
movq %r12, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0xf03(%rip), %rsi       # 0x856f
movq %r14, %rdi
callq 0x43fe
movl $0x201, %ecx            # imm = 0x201
movq %rsp, %rdi
leaq 0x2010(%rsp), %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0xee5(%rip), %rsi       # 0x8573
movq %r14, %rdi
callq 0x43fe
movl $0x201, %ecx            # imm = 0x201
movq %rsp, %rdi
leaq 0x1008(%rsp), %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0xe71(%rip), %rsi       # 0x8521
movq %r14, %rdi
callq 0x43fe
addq $0xb058, %rsp           # imm = 0xB058
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq