text:
using System.Text;
using OpenQA.Selenium;

namespace Cactus.Drivers
{
    public class CustomBy : OpenQA.Selenium.By
    {
        /// <summary>
        /// CustomBy extension for By.  Uses a CssSelector to find tags with data-automate as the attribute.
        /// Expects a value assigned to the tag to be entered
        /// </summary>
        /// <param name="customByString"></param>
        public CustomBy(string customByString)
        {
            FindElementMethod = context =>
            {
                IWebElement mockElement = Engine.WebDriver.FindElement(CssSelector("[data-automate=\"" + customByString + "\"]"));
                return mockElement;
            };
        }

        /// <summary>
        /// Custom By statement for specific DataSupapicka to be specified.  Extends XPATH
        ///  ////*[contains(@data-supapicka,'asset-employee')]
        /// </summary>
        /// <param name="value">value to search for</param>
        /// <returns></returns>
        public static OpenQA.Selenium.By DataSupapicka(string value)
        {
            return XPath("//*[contains(@data-supapicka,'" + value + "')]");
        }

        /// <summary>
        /// Custom By statement for specific SRC to be specified.  Extends XPATH
        /// </summary>
        /// <param name="value">value to search for</param>
        /// <returns></returns>
        public static OpenQA.Selenium.By Src(string value)
        {
            return XPath("//*[contains(@src,'" + value + "')]");
        }

        /// <summary>
        /// Custom By statement for specific attribute to be specified.  Extends CssSelector
        /// </summary>
        /// <param name="tagname">attribute to search for</param>
        /// <param name="value">value to search for</param>
        /// <returns></returns>
        public static OpenQA.Selenium.By CssTag(string tagname, string value)
        {
            return CssSelector("[" + tagname + "=\"" + value + "\"]");
        }

        /// <summary>
        /// Custom By statement for specific attribute to be specified.  Extends XPATH
        /// </summary>
        /// <param name="tagname">attribute to search for</param>
        /// <param name="value">value to search for</param>
        /// <returns></returns>
        public static OpenQA.Selenium.By HtmlTag(string tagname, string value)
        {
            if (tagname == "text")
            {
                tagname = tagname + "()";
            }
            else
            {
                tagname = "@" + tagname;
            }
            return XPath("//*[contains(" + tagname + ",'" + value + "')]");
        }

        /// <summary>
        /// Custom By statement for finding a element by value.  Extends CssSelector
        /// </summary>
        /// <param name="text"></param>
        /// <returns></returns>
        public static OpenQA.Selenium.By CssValue(string text)
        {
            return CssSelector("[value=\"" + text + "\"]");
        }

        /// <summary>
        /// CustomBy extension for jquery By.  Uses a jquery selector to find DOM.  Will send this to Browser $("div#item1").xpath(); To get back DOM xpath, convert to Selenium
        /// </summary>
        /// <param name="selector"></param>
        public static OpenQA.Selenium.By jQuery(string selector)
        {
            //format selector to add
            var jQueryCommand = "$(\"" + selector + "\").xpath();";
            //$("div#item1").xpath();
            var xpath = Engine.Execute<string>(Engine.WebDriver, jqueryXpathBuilder() + " " + jQueryCommand);
            //note: all javascript has to run in same process/time.  If you try and split it you will not see data.
            // this is a selenium thing, where it returns the page back to normal after javascript run.
            return XPath(xpath);

        }

        // http://edudotnet.blogspot.com/2013/08/get-element-xpath-of-selected-element.html
        // alternative =
        private static string jqueryXpathBuilder()
        {
            var sb = new StringBuilder();
            sb.Append("jQuery.fn.extend({   ");
            sb.Append(" xpath: function(){  ");
            sb.Append(" path = new Array(); ");
            sb.Append( "for(var i in this){ ");
            sb.Append("  var elt = this[i]; ");
            sb.Append("  if (elt && elt.id){ ");
            sb.Append("    path.push('//' + elt.tagName.toLowerCase() + '[id=' + elt.id + ']'); ");
            sb.Append("  ");
            sb.Append("  } else { ");
            sb.Append("    var tpath = ''; ");
            sb.Append("    for (; elt && elt.nodeType == 1; elt = elt.parentNode){ ");
            sb.Append("     idx = 1; ");
            sb.Append("      for (var sib = elt.previousSibling; sib ; sib = sib.previousSibling) ");
            sb.Append("          if(sib.nodeType == 1 && sib.tagName == elt.tagName) idx++; ");
            sb.Append("      xname = elt.tagName.toLowerCase(); ");
            sb.Append("      if (idx > 1) ");
            sb.Append("        xname += '[' + idx + ']'; ");
            sb.Append("      tpath = '/' + xname + tpath; ");
            sb.Append("    }  ");
            sb.Append("    if(tpath.length > 0) ");
            sb.Append("      path.push(tpath); ");
            sb.Append("  } ");
            sb.Append("} ");
            sb.Append("return path; ");
            sb.Append("} ");
            sb.Append("}); ");

            return sb.ToString();
        }

    }
}


text:
<?php

namespace Innmind\RestBundle\Client\Server\Cache;

use Innmind\RestBundle\Client\Server\CacheInterface;

class InMemoryCache implements CacheInterface
{
    protected $data = [];
    protected $isFresh = false;

    /**
     * {@inheritdoc}
     */
    public function save($name, $url)
    {
        $this->data[(string) $name] = (string) $url;
        $this->isFresh = true;

        return $this;
    }

    /**
     * {@inheritdoc}
     */
    public function has($name)
    {
        return array_key_exists((string) $name, $this->data);
    }

    /**
     * {@inheritdoc}
     */
    public function keys()
    {
        return array_keys($this->data);
    }

    /**
     * {@inheritdoc}
     */
    public function get($name)
    {
        if (!$this->has($name)) {
            throw new \InvalidArgumentException(sprintf(
                'No resource named "%s" found',
                $name
            ));
        }

        return $this->data[(string) $name];
    }

    /**
     * {@inheritdoc}
     */
    public function remove($name)
    {
        if ($this->has($name)) {
            unset($this->data[(string) $name]);
            $this->isFresh = true;
        }

        return $this;
    }

    /**
     * {@inheritdoc}
     */
    public function isFresh()
    {
        return $this->isFresh;
    }
}

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.IO;

namespace NuGet
{
    public static class PluginExtensions
    {
        public static int UnpackPackage(this IPackage package, string sourceDirectory, string targetRootDirectory)
        {
            if (sourceDirectory == null)
            {
                throw new ArgumentNullException("sourceDirectory");
            }

            if (targetRootDirectory == null)
            {
                throw new ArgumentNullException("targetRootDirectory");
            }

            if (!sourceDirectory.EndsWith("\\", StringComparison.OrdinalIgnoreCase))
            {
                sourceDirectory += "\\";
            }

            int numberOfFilesCopied = 0;
            foreach (IPackageFile file in package.GetFiles())
            {
                if (file.Path.StartsWith(sourceDirectory, StringComparison.OrdinalIgnoreCase))
                {
                    string suffixPath = file.Path.Substring(sourceDirectory.Length);
                    string targetPath = Path.Combine(targetRootDirectory, suffixPath);

                    using (FileStream stream = File.OpenWrite(targetPath))
                    {
                        using (Stream packageStream = file.GetStream())
                        {
                            packageStream.CopyTo(stream);
                        }
                    }

                    numberOfFilesCopied++;
                }
            }

            return numberOfFilesCopied;
        }
    }
}


text:
from PostgreSQLEngine import *
__all__ = ["PostgreSQLEngine"]


text:
<!DOCTYPE html>

    <title></title>

                2 Messagerie privée

                    Messagerie privée

                             admin Il y a une minute test de MP

                             user 21/12/13 à 13h20 Comment on fait pour devenir staff ?

Tous les messages

                3 Notifications

                    Notifications

                             admin Il y a 22 secondes test

                             admin Il y a 44 secondes [[C++] test

                             admin Il y a une minute test

Toutes les notifications

Mon Compte

             staff

                staff

                        Mon profil

                        Mes tutoriels

                        Mes articles

                        Galeries d'images

                        Paramètres

                        <form action="/membres/deconnexion/" method="post">
                            <input name="csrfmiddlewaretoken" type="hidden" value="DBbdmeEuLpKPdkYZFzfa8d7U7lbJZ4p0"> <button type="submit">Déconnexion</button>
                        </form>


text:
//===- IRBuilder.cpp - Builder for LLVM Instrs ----------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// This file implements the IRBuilder class, which is used as a convenient way
// to create LLVM instructions with a consistent and simplified interface.
//
//===----------------------------------------------------------------------===//

#include "llvm/IR/IRBuilder.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/None.h"
#include "llvm/IR/Constant.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/GlobalValue.h"
#include "llvm/IR/GlobalVariable.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Operator.h"
#include "llvm/IR/NoFolder.h"
#include "llvm/IR/Statepoint.h"
#include "llvm/IR/Type.h"
#include "llvm/IR/Value.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/MathExtras.h"
#include <cassert>
#include <cstdint>
#include <vector>

using namespace llvm;

/// CreateGlobalString - Make a new global variable with an initializer that
/// has array of i8 type filled in with the nul terminated string value
/// specified.  If Name is specified, it is the name of the global variable
/// created.
GlobalVariable *IRBuilderBase::CreateGlobalString(StringRef Str,
                                                  const Twine &Name,
                                                  unsigned AddressSpace) {
  Constant *StrConstant = ConstantDataArray::getString(Context, Str);
  Module &M = *BB->getParent()->getParent();
  auto *GV = new GlobalVariable(M, StrConstant->getType(), true,
                                GlobalValue::PrivateLinkage, StrConstant, Name,
                                nullptr, GlobalVariable::NotThreadLocal,
                                AddressSpace);
  GV->setUnnamedAddr(GlobalValue::UnnamedAddr::Global);
  GV->setAlignment(Align(1));
  return GV;
}

Type *IRBuilderBase::getCurrentFunctionReturnType() const {
  assert(BB && BB->getParent() && "No current function!");
  return BB->getParent()->getReturnType();
}

Value *IRBuilderBase::getCastedInt8PtrValue(Value *Ptr) {
  auto *PT = cast<PointerType>(Ptr->getType());
  if (PT->getElementType()->isIntegerTy(8))
    return Ptr;

  // Otherwise, we need to insert a bitcast.
  return CreateBitCast(Ptr, getInt8PtrTy(PT->getAddressSpace()));
}

static CallInst *createCallHelper(Function *Callee, ArrayRef<Value *> Ops,
                                  IRBuilderBase *Builder,
                                  const Twine &Name = "",
                                  Instruction *FMFSource = nullptr) {
  CallInst *CI = Builder->CreateCall(Callee, Ops, Name);
  if (FMFSource)
    CI->copyFastMathFlags(FMFSource);
  return CI;
}

CallInst *IRBuilderBase::CreateMemSet(Value *Ptr, Value *Val, Value *Size,
                                      MaybeAlign Align, bool isVolatile,
                                      MDNode *TBAATag, MDNode *ScopeTag,
                                      MDNode *NoAliasTag) {
  Ptr = getCastedInt8PtrValue(Ptr);
  Value *Ops[] = {Ptr, Val, Size, getInt1(isVolatile)};
  Type *Tys[] = { Ptr->getType(), Size->getType() };
  Module *M = BB->getParent()->getParent();
  Function *TheFn = Intrinsic::getDeclaration(M, Intrinsic::memset, Tys);

  CallInst *CI = createCallHelper(TheFn, Ops, this);

  if (Align)
    cast<MemSetInst>(CI)->setDestAlignment(Align->value());

  // Set the TBAA info if present.
  if (TBAATag)
    CI->setMetadata(LLVMContext::MD_tbaa, TBAATag);

  if (ScopeTag)
    CI->setMetadata(LLVMContext::MD_alias_scope, ScopeTag);

  if (NoAliasTag)
    CI->setMetadata(LLVMContext::MD_noalias, NoAliasTag);

  return CI;
}

CallInst *IRBuilderBase::CreateElementUnorderedAtomicMemSet(
    Value *Ptr, Value *Val, Value *Size, Align Alignment, uint32_t ElementSize,
    MDNode *TBAATag, MDNode *ScopeTag, MDNode *NoAliasTag) {

  Ptr = getCastedInt8PtrValue(Ptr);
  Value *Ops[] = {Ptr, Val, Size, getInt32(ElementSize)};
  Type *Tys[] = {Ptr->getType(), Size->getType()};
  Module *M = BB->getParent()->getParent();
  Function *TheFn = Intrinsic::getDeclaration(
      M, Intrinsic::memset_element_unordered_atomic, Tys);

  CallInst *CI = createCallHelper(TheFn, Ops, this);

  cast<AtomicMemSetInst>(CI)->setDestAlignment(Alignment);

  // Set the TBAA info if present.
  if (TBAATag)
    CI->setMetadata(LLVMContext::MD_tbaa, TBAATag);

  if (ScopeTag)
    CI->setMetadata(LLVMContext::MD_alias_scope, ScopeTag);

  if (NoAliasTag)
    CI->setMetadata(LLVMContext::MD_noalias, NoAliasTag);

  return CI;
}

CallInst *IRBuilderBase::CreateMemCpy(Value *Dst, MaybeAlign DstAlign,
                                      Value *Src, MaybeAlign SrcAlign,
                                      Value *Size, bool isVolatile,
                                      MDNode *TBAATag, MDNode *TBAAStructTag,
                                      MDNode *ScopeTag, MDNode *NoAliasTag) {
  Dst = getCastedInt8PtrValue(Dst);
  Src = getCastedInt8PtrValue(Src);

  Value *Ops[] = {Dst, Src, Size, getInt1(isVolatile)};
  Type *Tys[] = { Dst->getType(), Src->getType(), Size->getType() };
  Module *M = BB->getParent()->getParent();
  Function *TheFn = Intrinsic::getDeclaration(M, Intrinsic::memcpy, Tys);

  CallInst *CI = createCallHelper(TheFn, Ops, this);

  auto* MCI = cast<MemCpyInst>(CI);
  if (DstAlign)
    MCI->setDestAlignment(*DstAlign);
  if (SrcAlign)
    MCI->setSourceAlignment(*SrcAlign);

  // Set the TBAA info if present.
  if (TBAATag)
    CI->setMetadata(LLVMContext::MD_tbaa, TBAATag);

  // Set the TBAA Struct info if present.
  if (TBAAStructTag)
    CI->setMetadata(LLVMContext::MD_tbaa_struct, TBAAStructTag);

  if (ScopeTag)
    CI->setMetadata(LLVMContext::MD_alias_scope, ScopeTag);

  if (NoAliasTag)
    CI->setMetadata(LLVMContext::MD_noalias, NoAliasTag);

  return CI;
}

CallInst *IRBuilderBase::CreateMemCpyInline(Value *Dst, MaybeAlign DstAlign,
                                            Value *Src, MaybeAlign SrcAlign,
                                            Value *Size) {
  Dst = getCastedInt8PtrValue(Dst);
  Src = getCastedInt8PtrValue(Src);
  Value *IsVolatile = getInt1(false);

  Value *Ops[] = {Dst, Src, Size, IsVolatile};
  Type *Tys[] = {Dst->getType(), Src->getType(), Size->getType()};
  Function *F = BB->getParent();
  Module *M = F->getParent();
  Function *TheFn = Intrinsic::getDeclaration(M, Intrinsic::memcpy_inline, Tys);

  CallInst *CI = createCallHelper(TheFn, Ops, this);

  auto *MCI = cast<MemCpyInlineInst>(CI);
  if (DstAlign)
    MCI->setDestAlignment(*DstAlign);
  if (SrcAlign)
    MCI->setSourceAlignment(*SrcAlign);

  return CI;
}

CallInst *IRBuilderBase::CreateElementUnorderedAtomicMemCpy(
    Value *Dst, Align DstAlign, Value *Src, Align SrcAlign, Value *Size,
    uint32_t ElementSize, MDNode *TBAATag, MDNode *TBAAStructTag,
    MDNode *ScopeTag, MDNode *NoAliasTag) {
  assert(DstAlign >= ElementSize &&
         "Pointer alignment must be at least element size");
  assert(SrcAlign >= ElementSize &&
         "Pointer alignment must be at least element size");
  Dst = getCastedInt8PtrValue(Dst);
  Src = getCastedInt8PtrValue(Src);

  Value *Ops[] = {Dst, Src, Size, getInt32(ElementSize)};
  Type *Tys[] = {Dst->getType(), Src->getType(), Size->getType()};
  Module *M = BB->getParent()->getParent();
  Function *TheFn = Intrinsic::getDeclaration(
      M, Intrinsic::memcpy_element_unordered_atomic, Tys);

  CallInst *CI = createCallHelper(TheFn, Ops, this);

  // Set the alignment of the pointer args.
  auto *AMCI = cast<AtomicMemCpyInst>(CI);
  AMCI->setDestAlignment(DstAlign);
  AMCI->setSourceAlignment(SrcAlign);

  // Set the TBAA info if present.
  if (TBAATag)
    CI->setMetadata(LLVMContext::MD_tbaa, TBAATag);

  // Set the TBAA Struct info if present.
  if (TBAAStructTag)
    CI->setMetadata(LLVMContext::MD_tbaa_struct, TBAAStructTag);

  if (ScopeTag)
    CI->setMetadata(LLVMContext::MD_alias_scope, ScopeTag);

  if (NoAliasTag)
    CI->setMetadata(LLVMContext::MD_noalias, NoAliasTag);

  return CI;
}

CallInst *IRBuilderBase::CreateMemMove(Value *Dst, MaybeAlign DstAlign,
                                       Value *Src, MaybeAlign SrcAlign,
                                       Value *Size, bool isVolatile,
                                       MDNode *TBAATag, MDNode *ScopeTag,
                                       MDNode *NoAliasTag) {
  Dst = getCastedInt8PtrValue(Dst);
  Src = getCastedInt8PtrValue(Src);

  Value *Ops[] = {Dst, Src, Size, getInt1(isVolatile)};
  Type *Tys[] = { Dst->getType(), Src->getType(), Size->getType() };
  Module *M = BB->getParent()->getParent();
  Function *TheFn = Intrinsic::getDeclaration(M, Intrinsic::memmove, Tys);

  CallInst *CI = createCallHelper(TheFn, Ops, this);

  auto *MMI = cast<MemMoveInst>(CI);
  if (DstAlign)
    MMI->setDestAlignment(*DstAlign);
  if (SrcAlign)
    MMI->setSourceAlignment(*SrcAlign);

  // Set the TBAA info if present.
  if (TBAATag)
    CI->setMetadata(LLVMContext::MD_tbaa, TBAATag);

  if (ScopeTag)
    CI->setMetadata(LLVMContext::MD_alias_scope, ScopeTag);

  if (NoAliasTag)
    CI->setMetadata(LLVMContext::MD_noalias, NoAliasTag);

  return CI;
}

CallInst *IRBuilderBase::CreateElementUnorderedAtomicMemMove(
    Value *Dst, Align DstAlign, Value *Src, Align SrcAlign, Value *Size,
    uint32_t ElementSize, MDNode *TBAATag, MDNode *TBAAStructTag,
    MDNode *ScopeTag, MDNode *NoAliasTag) {
  assert(DstAlign >= ElementSize &&
         "Pointer alignment must be at least element size");
  assert(SrcAlign >= ElementSize &&
         "Pointer alignment must be at least element size");
  Dst = getCastedInt8PtrValue(Dst);
  Src = getCastedInt8PtrValue(Src);

  Value *Ops[] = {Dst, Src, Size, getInt32(ElementSize)};
  Type *Tys[] = {Dst->getType(), Src->getType(), Size->getType()};
  Module *M = BB->getParent()->getParent();
  Function *TheFn = Intrinsic::getDeclaration(
      M, Intrinsic::memmove_element_unordered_atomic, Tys);

  CallInst *CI = createCallHelper(TheFn, Ops, this);

  // Set the alignment of the pointer args.
  CI->addParamAttr(0, Attribute::getWithAlignment(CI->getContext(), DstAlign));
  CI->addParamAttr(1, Attribute::getWithAlignment(CI->getContext(), SrcAlign));

  // Set the TBAA info if present.
  if (TBAATag)
    CI->setMetadata(LLVMContext::MD_tbaa, TBAATag);

  // Set the TBAA Struct info if present.
  if (TBAAStructTag)
    CI->setMetadata(LLVMContext::MD_tbaa_struct, TBAAStructTag);

  if (ScopeTag)
    CI->setMetadata(LLVMContext::MD_alias_scope, ScopeTag);

  if (NoAliasTag)
    CI->setMetadata(LLVMContext::MD_noalias, NoAliasTag);

  return CI;
}

static CallInst *getReductionIntrinsic(IRBuilderBase *Builder, Intrinsic::ID ID,
                                    Value *Src) {
  Module *M = Builder->GetInsertBlock()->getParent()->getParent();
  Value *Ops[] = {Src};
  Type *Tys[] = { Src->getType() };
  auto Decl = Intrinsic::getDeclaration(M, ID, Tys);
  return createCallHelper(Decl, Ops, Builder);
}

CallInst *IRBuilderBase::CreateFAddReduce(Value *Acc, Value *Src) {
  Module *M = GetInsertBlock()->getParent()->getParent();
  Value *Ops[] = {Acc, Src};
  Type *Tys[] = {Acc->getType(), Src->getType()};
  auto Decl = Intrinsic::getDeclaration(
      M, Intrinsic::experimental_vector_reduce_v2_fadd, Tys);
  return createCallHelper(Decl, Ops, this);
}

CallInst *IRBuilderBase::CreateFMulReduce(Value *Acc, Value *Src) {
  Module *M = GetInsertBlock()->getParent()->getParent();
  Value *Ops[] = {Acc, Src};
  Type *Tys[] = {Acc->getType(), Src->getType()};
  auto Decl = Intrinsic::getDeclaration(
      M, Intrinsic::experimental_vector_reduce_v2_fmul, Tys);
  return createCallHelper(Decl, Ops, this);
}

CallInst *IRBuilderBase::CreateAddReduce(Value *Src) {
  return getReductionIntrinsic(this, Intrinsic::experimental_vector_reduce_add,
                               Src);
}

CallInst *IRBuilderBase::CreateMulReduce(Value *Src) {
  return getReductionIntrinsic(this, Intrinsic::experimental_vector_reduce_mul,
                               Src);
}

CallInst *IRBuilderBase::CreateAndReduce(Value *Src) {
  return getReductionIntrinsic(this, Intrinsic::experimental_vector_reduce_and,
                               Src);
}

CallInst *IRBuilderBase::CreateOrReduce(Value *Src) {
  return getReductionIntrinsic(this, Intrinsic::experimental_vector_reduce_or,
                               Src);
}

CallInst *IRBuilderBase::CreateXorReduce(Value *Src) {
  return getReductionIntrinsic(this, Intrinsic::experimental_vector_reduce_xor,
                               Src);
}

CallInst *IRBuilderBase::CreateIntMaxReduce(Value *Src, bool IsSigned) {
  auto ID = IsSigned ? Intrinsic::experimental_vector_reduce_smax
                     : Intrinsic::experimental_vector_reduce_umax;
  return getReductionIntrinsic(this, ID, Src);
}

CallInst *IRBuilderBase::CreateIntMinReduce(Value *Src, bool IsSigned) {
  auto ID = IsSigned ? Intrinsic::experimental_vector_reduce_smin
                     : Intrinsic::experimental_vector_reduce_umin;
  return getReductionIntrinsic(this, ID, Src);
}

CallInst *IRBuilderBase::CreateFPMaxReduce(Value *Src, bool NoNaN) {
  auto Rdx = getReductionIntrinsic(
      this, Intrinsic::experimental_vector_reduce_fmax, Src);
  if (NoNaN) {
    FastMathFlags FMF;
    FMF.setNoNaNs();
    Rdx->setFastMathFlags(FMF);
  }
  return Rdx;
}

CallInst *IRBuilderBase::CreateFPMinReduce(Value *Src, bool NoNaN) {
  auto Rdx = getReductionIntrinsic(
      this, Intrinsic::experimental_vector_reduce_fmin, Src);
  if (NoNaN) {
    FastMathFlags FMF;
    FMF.setNoNaNs();
    Rdx->setFastMathFlags(FMF);
  }
  return Rdx;
}

CallInst *IRBuilderBase::CreateLifetimeStart(Value *Ptr, ConstantInt *Size) {
  assert(isa<PointerType>(Ptr->getType()) &&
         "lifetime.start only applies to pointers.");
  Ptr = getCastedInt8PtrValue(Ptr);
  if (!Size)
    Size = getInt64(-1);
  else
    assert(Size->getType() == getInt64Ty() &&
           "lifetime.start requires the size to be an i64");
  Value *Ops[] = { Size, Ptr };
  Module *M = BB->getParent()->getParent();
  Function *TheFn =
      Intrinsic::getDeclaration(M, Intrinsic::lifetime_start, {Ptr->getType()});
  return createCallHelper(TheFn, Ops, this);
}

CallInst *IRBuilderBase::CreateLifetimeEnd(Value *Ptr, ConstantInt *Size) {
  assert(isa<PointerType>(Ptr->getType()) &&
         "lifetime.end only applies to pointers.");
  Ptr = getCastedInt8PtrValue(Ptr);
  if (!Size)
    Size = getInt64(-1);
  else
    assert(Size->getType() == getInt64Ty() &&
           "lifetime.end requires the size to be an i64");
  Value *Ops[] = { Size, Ptr };
  Module *M = BB->getParent()->getParent();
  Function *TheFn =
      Intrinsic::getDeclaration(M, Intrinsic::lifetime_end, {Ptr->getType()});
  return createCallHelper(TheFn, Ops, this);
}

CallInst *IRBuilderBase::CreateInvariantStart(Value *Ptr, ConstantInt *Size) {

  assert(isa<PointerType>(Ptr->getType()) &&
         "invariant.start only applies to pointers.");
  Ptr = getCastedInt8PtrValue(Ptr);
  if (!Size)
    Size = getInt64(-1);
  else
    assert(Size->getType() == getInt64Ty() &&
           "invariant.start requires the size to be an i64");

  Value *Ops[] = {Size, Ptr};
  // Fill in the single overloaded type: memory object type.
  Type *ObjectPtr[1] = {Ptr->getType()};
  Module *M = BB->getParent()->getParent();
  Function *TheFn =
      Intrinsic::getDeclaration(M, Intrinsic::invariant_start, ObjectPtr);
  return createCallHelper(TheFn, Ops, this);
}

CallInst *IRBuilderBase::CreateAssumption(Value *Cond) {
  assert(Cond->getType() == getInt1Ty() &&
         "an assumption condition must be of type i1");

  Value *Ops[] = { Cond };
  Module *M = BB->getParent()->getParent();
  Function *FnAssume = Intrinsic::getDeclaration(M, Intrinsic::assume);
  return createCallHelper(FnAssume, Ops, this);
}

/// Create a call to a Masked Load intrinsic.
/// \p Ptr       - base pointer for the load
/// \p Alignment - alignment of the source location
/// \p Mask      - vector of booleans which indicates what vector lanes should
///                be accessed in memory
/// \p PassThru  - pass-through value that is used to fill the masked-off lanes
///                of the result
/// \p Name      - name of the result variable
CallInst *IRBuilderBase::CreateMaskedLoad(Value *Ptr, Align Alignment,
                                          Value *Mask, Value *PassThru,
                                          const Twine &Name) {
  auto *PtrTy = cast<PointerType>(Ptr->getType());
  Type *DataTy = PtrTy->getElementType();
  assert(DataTy->isVectorTy() && "Ptr should point to a vector");
  assert(Mask && "Mask should not be all-ones (null)");
  if (!PassThru)
    PassThru = UndefValue::get(DataTy);
  Type *OverloadedTypes[] = { DataTy, PtrTy };
  Value *Ops[] = {Ptr, getInt32(Alignment.value()), Mask, PassThru};
  return CreateMaskedIntrinsic(Intrinsic::masked_load, Ops,
                               OverloadedTypes, Name);
}

/// Create a call to a Masked Store intrinsic.
/// \p Val       - data to be stored,
/// \p Ptr       - base pointer for the store
/// \p Alignment - alignment of the destination location
/// \p Mask      - vector of booleans which indicates what vector lanes should
///                be accessed in memory
CallInst *IRBuilderBase::CreateMaskedStore(Value *Val, Value *Ptr,
                                           Align Alignment, Value *Mask) {
  auto *PtrTy = cast<PointerType>(Ptr->getType());
  Type *DataTy = PtrTy->getElementType();
  assert(DataTy->isVectorTy() && "Ptr should point to a vector");
  assert(Mask && "Mask should not be all-ones (null)");
  Type *OverloadedTypes[] = { DataTy, PtrTy };
  Value *Ops[] = {Val, Ptr, getInt32(Alignment.value()), Mask};
  return CreateMaskedIntrinsic(Intrinsic::masked_store, Ops, OverloadedTypes);
}

/// Create a call to a Masked intrinsic, with given intrinsic Id,
/// an array of operands - Ops, and an array of overloaded types -
/// OverloadedTypes.
CallInst *IRBuilderBase::CreateMaskedIntrinsic(Intrinsic::ID Id,
                                               ArrayRef<Value *> Ops,
                                               ArrayRef<Type *> OverloadedTypes,
                                               const Twine &Name) {
  Module *M = BB->getParent()->getParent();
  Function *TheFn = Intrinsic::getDeclaration(M, Id, OverloadedTypes);
  return createCallHelper(TheFn, Ops, this, Name);
}

/// Create a call to a Masked Gather intrinsic.
/// \p Ptrs     - vector of pointers for loading
/// \p Align    - alignment for one element
/// \p Mask     - vector of booleans which indicates what vector lanes should
///               be accessed in memory
/// \p PassThru - pass-through value that is used to fill the masked-off lanes
///               of the result
/// \p Name     - name of the result variable
CallInst *IRBuilderBase::CreateMaskedGather(Value *Ptrs, Align Alignment,
                                            Value *Mask, Value *PassThru,
                                            const Twine &Name) {
  auto PtrsTy = cast<VectorType>(Ptrs->getType());
  auto PtrTy = cast<PointerType>(PtrsTy->getElementType());
  unsigned NumElts = PtrsTy->getNumElements();
  Type *DataTy = VectorType::get(PtrTy->getElementType(), NumElts);

  if (!Mask)
    Mask = Constant::getAllOnesValue(VectorType::get(Type::getInt1Ty(Context),
                                     NumElts));

  if (!PassThru)
    PassThru = UndefValue::get(DataTy);

  Type *OverloadedTypes[] = {DataTy, PtrsTy};
  Value *Ops[] = {Ptrs, getInt32(Alignment.value()), Mask, PassThru};

  // We specify only one type when we create this intrinsic. Types of other
  // arguments are derived from this type.
  return CreateMaskedIntrinsic(Intrinsic::masked_gather, Ops, OverloadedTypes,
                               Name);
}

/// Create a call to a Masked Scatter intrinsic.
/// \p Data  - data to be stored,
/// \p Ptrs  - the vector of pointers, where the \p Data elements should be
///            stored
/// \p Align - alignment for one element
/// \p Mask  - vector of booleans which indicates what vector lanes should
///            be accessed in memory
CallInst *IRBuilderBase::CreateMaskedScatter(Value *Data, Value *Ptrs,
                                             Align Alignment, Value *Mask) {
  auto PtrsTy = cast<VectorType>(Ptrs->getType());
  auto DataTy = cast<VectorType>(Data->getType());
  unsigned NumElts = PtrsTy->getNumElements();

#ifndef NDEBUG
  auto PtrTy = cast<PointerType>(PtrsTy->getElementType());
  assert(NumElts == DataTy->getNumElements() &&
         PtrTy->getElementType() == DataTy->getElementType() &&
         "Incompatible pointer and data types");
#endif

  if (!Mask)
    Mask = Constant::getAllOnesValue(VectorType::get(Type::getInt1Ty(Context),
                                     NumElts));

  Type *OverloadedTypes[] = {DataTy, PtrsTy};
  Value *Ops[] = {Data, Ptrs, getInt32(Alignment.value()), Mask};

  // We specify only one type when we create this intrinsic. Types of other
  // arguments are derived from this type.
  return CreateMaskedIntrinsic(Intrinsic::masked_scatter, Ops, OverloadedTypes);
}

template <typename T0, typename T1, typename T2, typename T3>
static std::vector<Value *>
getStatepointArgs(IRBuilderBase &B, uint64_t ID, uint32_t NumPatchBytes,
                  Value *ActualCallee, uint32_t Flags, ArrayRef<T0> CallArgs,
                  ArrayRef<T1> TransitionArgs, ArrayRef<T2> DeoptArgs,
                  ArrayRef<T3> GCArgs) {
  std::vector<Value *> Args;
  Args.push_back(B.getInt64(ID));
  Args.push_back(B.getInt32(NumPatchBytes));
  Args.push_back(ActualCallee);
  Args.push_back(B.getInt32(CallArgs.size()));
  Args.push_back(B.getInt32(Flags));
  Args.insert(Args.end(), CallArgs.begin(), CallArgs.end());
  Args.push_back(B.getInt32(TransitionArgs.size()));
  Args.insert(Args.end(), TransitionArgs.begin(), TransitionArgs.end());
  Args.push_back(B.getInt32(DeoptArgs.size()));
  Args.insert(Args.end(), DeoptArgs.begin(), DeoptArgs.end());
  Args.insert(Args.end(), GCArgs.begin(), GCArgs.end());

  return Args;
}

template <typename T0, typename T1, typename T2, typename T3>
static CallInst *CreateGCStatepointCallCommon(
    IRBuilderBase *Builder, uint64_t ID, uint32_t NumPatchBytes,
    Value *ActualCallee, uint32_t Flags, ArrayRef<T0> CallArgs,
    ArrayRef<T1> TransitionArgs, ArrayRef<T2> DeoptArgs, ArrayRef<T3> GCArgs,
    const Twine &Name) {
  // Extract out the type of the callee.
  auto *FuncPtrType = cast<PointerType>(ActualCallee->getType());
  assert(isa<FunctionType>(FuncPtrType->getElementType()) &&
         "actual callee must be a callable value");

  Module *M = Builder->GetInsertBlock()->getParent()->getParent();
  // Fill in the one generic type'd argument (the function is also vararg)
  Type *ArgTypes[] = { FuncPtrType };
  Function *FnStatepoint =
    Intrinsic::getDeclaration(M, Intrinsic::experimental_gc_statepoint,
                              ArgTypes);

  std::vector<Value *> Args =
      getStatepointArgs(*Builder, ID, NumPatchBytes, ActualCallee, Flags,
                        CallArgs, TransitionArgs, DeoptArgs, GCArgs);
  return createCallHelper(FnStatepoint, Args, Builder, Name);
}

CallInst *IRBuilderBase::CreateGCStatepointCall(
    uint64_t ID, uint32_t NumPatchBytes, Value *ActualCallee,
    ArrayRef<Value *> CallArgs, ArrayRef<Value *> DeoptArgs,
    ArrayRef<Value *> GCArgs, const Twine &Name) {
  return CreateGCStatepointCallCommon<Value *, Value *, Value *, Value *>(
      this, ID, NumPatchBytes, ActualCallee, uint32_t(StatepointFlags::None),
      CallArgs, None /* No Transition Args */, DeoptArgs, GCArgs, Name);
}

CallInst *IRBuilderBase::CreateGCStatepointCall(
    uint64_t ID, uint32_t NumPatchBytes, Value *ActualCallee, uint32_t Flags,
    ArrayRef<Use> CallArgs, ArrayRef<Use> TransitionArgs,
    ArrayRef<Use> DeoptArgs, ArrayRef<Value *> GCArgs, const Twine &Name) {
  return CreateGCStatepointCallCommon<Use, Use, Use, Value *>(
      this, ID, NumPatchBytes, ActualCallee, Flags, CallArgs, TransitionArgs,
      DeoptArgs, GCArgs, Name);
}

CallInst *IRBuilderBase::CreateGCStatepointCall(
    uint64_t ID, uint32_t NumPatchBytes, Value *ActualCallee,
    ArrayRef<Use> CallArgs, ArrayRef<Value *> DeoptArgs,
    ArrayRef<Value *> GCArgs, const Twine &Name) {
  return CreateGCStatepointCallCommon<Use, Value *, Value *, Value *>(
      this, ID, NumPatchBytes, ActualCallee, uint32_t(StatepointFlags::None),
      CallArgs, None, DeoptArgs, GCArgs, Name);
}

template <typename T0, typename T1, typename T2, typename T3>
static InvokeInst *CreateGCStatepointInvokeCommon(
    IRBuilderBase *Builder, uint64_t ID, uint32_t NumPatchBytes,
    Value *ActualInvokee, BasicBlock *NormalDest, BasicBlock *UnwindDest,
    uint32_t Flags, ArrayRef<T0> InvokeArgs, ArrayRef<T1> TransitionArgs,
    ArrayRef<T2> DeoptArgs, ArrayRef<T3> GCArgs, const Twine &Name) {
  // Extract out the type of the callee.
  auto *FuncPtrType = cast<PointerType>(ActualInvokee->getType());
  assert(isa<FunctionType>(FuncPtrType->getElementType()) &&
         "actual callee must be a callable value");

  Module *M = Builder->GetInsertBlock()->getParent()->getParent();
  // Fill in the one generic type'd argument (the function is also vararg)
  Function *FnStatepoint = Intrinsic::getDeclaration(
      M, Intrinsic::experimental_gc_statepoint, {FuncPtrType});

  std::vector<Value *> Args =
      getStatepointArgs(*Builder, ID, NumPatchBytes, ActualInvokee, Flags,
                        InvokeArgs, TransitionArgs, DeoptArgs, GCArgs);
  return Builder->CreateInvoke(FnStatepoint, NormalDest, UnwindDest, Args,
                               Name);
}

InvokeInst *IRBuilderBase::CreateGCStatepointInvoke(
    uint64_t ID, uint32_t NumPatchBytes, Value *ActualInvokee,
    BasicBlock *NormalDest, BasicBlock *UnwindDest,
    ArrayRef<Value *> InvokeArgs, ArrayRef<Value *> DeoptArgs,
    ArrayRef<Value *> GCArgs, const Twine &Name) {
  return CreateGCStatepointInvokeCommon<Value *, Value *, Value *, Value *>(
      this, ID, NumPatchBytes, ActualInvokee, NormalDest, UnwindDest,
      uint32_t(StatepointFlags::None), InvokeArgs, None /* No Transition Args*/,
      DeoptArgs, GCArgs, Name);
}

InvokeInst *IRBuilderBase::CreateGCStatepointInvoke(
    uint64_t ID, uint32_t NumPatchBytes, Value *ActualInvokee,
    BasicBlock *NormalDest, BasicBlock *UnwindDest, uint32_t Flags,
    ArrayRef<Use> InvokeArgs, ArrayRef<Use> TransitionArgs,
    ArrayRef<Use> DeoptArgs, ArrayRef<Value *> GCArgs, const Twine &Name) {
  return CreateGCStatepointInvokeCommon<Use, Use, Use, Value *>(
      this, ID, NumPatchBytes, ActualInvokee, NormalDest, UnwindDest, Flags,
      InvokeArgs, TransitionArgs, DeoptArgs, GCArgs, Name);
}

InvokeInst *IRBuilderBase::CreateGCStatepointInvoke(
    uint64_t ID, uint32_t NumPatchBytes, Value *ActualInvokee,
    BasicBlock *NormalDest, BasicBlock *UnwindDest, ArrayRef<Use> InvokeArgs,
    ArrayRef<Value *> DeoptArgs, ArrayRef<Value *> GCArgs, const Twine &Name) {
  return CreateGCStatepointInvokeCommon<Use, Value *, Value *, Value *>(
      this, ID, NumPatchBytes, ActualInvokee, NormalDest, UnwindDest,
      uint32_t(StatepointFlags::None), InvokeArgs, None, DeoptArgs, GCArgs,
      Name);
}

CallInst *IRBuilderBase::CreateGCResult(Instruction *Statepoint,
                                       Type *ResultType,
                                       const Twine &Name) {
 Intrinsic::ID ID = Intrinsic::experimental_gc_result;
 Module *M = BB->getParent()->getParent();
 Type *Types[] = {ResultType};
 Function *FnGCResult = Intrinsic::getDeclaration(M, ID, Types);

 Value *Args[] = {Statepoint};
 return createCallHelper(FnGCResult, Args, this, Name);
}

CallInst *IRBuilderBase::CreateGCRelocate(Instruction *Statepoint,
                                         int BaseOffset,
                                         int DerivedOffset,
                                         Type *ResultType,
                                         const Twine &Name) {
 Module *M = BB->getParent()->getParent();
 Type *Types[] = {ResultType};
 Function *FnGCRelocate =
     Intrinsic::getDeclaration(M, Intrinsic::experimental_gc_relocate, Types);

 Value *Args[] = {Statepoint,
                  getInt32(BaseOffset),
                  getInt32(DerivedOffset)};
 return createCallHelper(FnGCRelocate, Args, this, Name);
}

CallInst *IRBuilderBase::CreateUnaryIntrinsic(Intrinsic::ID ID, Value *V,
                                              Instruction *FMFSource,
                                              const Twine &Name) {
  Module *M = BB->getModule();
  Function *Fn = Intrinsic::getDeclaration(M, ID, {V->getType()});
  return createCallHelper(Fn, {V}, this, Name, FMFSource);
}

CallInst *IRBuilderBase::CreateBinaryIntrinsic(Intrinsic::ID ID, Value *LHS,
                                               Value *RHS,
                                               Instruction *FMFSource,
                                               const Twine &Name) {
  Module *M = BB->getModule();
  Function *Fn = Intrinsic::getDeclaration(M, ID, { LHS->getType() });
  return createCallHelper(Fn, {LHS, RHS}, this, Name, FMFSource);
}

CallInst *IRBuilderBase::CreateIntrinsic(Intrinsic::ID ID,
                                         ArrayRef<Type *> Types,
                                         ArrayRef<Value *> Args,
                                         Instruction *FMFSource,
                                         const Twine &Name) {
  Module *M = BB->getModule();
  Function *Fn = Intrinsic::getDeclaration(M, ID, Types);
  return createCallHelper(Fn, Args, this, Name, FMFSource);
}

CallInst *IRBuilderBase::CreateConstrainedFPBinOp(
    Intrinsic::ID ID, Value *L, Value *R, Instruction *FMFSource,
    const Twine &Name, MDNode *FPMathTag,
    Optional<RoundingMode> Rounding,
    Optional<fp::ExceptionBehavior> Except) {
  Value *RoundingV = getConstrainedFPRounding(Rounding);
  Value *ExceptV = getConstrainedFPExcept(Except);

  FastMathFlags UseFMF = FMF;
  if (FMFSource)
    UseFMF = FMFSource->getFastMathFlags();

  CallInst *C = CreateIntrinsic(ID, {L->getType()},
                                {L, R, RoundingV, ExceptV}, nullptr, Name);
  setConstrainedFPCallAttr(C);
  setFPAttrs(C, FPMathTag, UseFMF);
  return C;
}

Value *IRBuilderBase::CreateNAryOp(unsigned Opc, ArrayRef<Value *> Ops,
                                   const Twine &Name, MDNode *FPMathTag) {
  if (Instruction::isBinaryOp(Opc)) {
    assert(Ops.size() == 2 && "Invalid number of operands!");
    return CreateBinOp(static_cast<Instruction::BinaryOps>(Opc),
                       Ops[0], Ops[1], Name, FPMathTag);
  }
  if (Instruction::isUnaryOp(Opc)) {
    assert(Ops.size() == 1 && "Invalid number of operands!");
    return CreateUnOp(static_cast<Instruction::UnaryOps>(Opc),
                      Ops[0], Name, FPMathTag);
  }
  llvm_unreachable("Unexpected opcode!");
}

CallInst *IRBuilderBase::CreateConstrainedFPCast(
    Intrinsic::ID ID, Value *V, Type *DestTy,
    Instruction *FMFSource, const Twine &Name, MDNode *FPMathTag,
    Optional<RoundingMode> Rounding,
    Optional<fp::ExceptionBehavior> Except) {
  Value *ExceptV = getConstrainedFPExcept(Except);

  FastMathFlags UseFMF = FMF;
  if (FMFSource)
    UseFMF = FMFSource->getFastMathFlags();

  CallInst *C;
  bool HasRoundingMD = false;
  switch (ID) {
  default:
    break;
#define INSTRUCTION(NAME, NARG, ROUND_MODE, INTRINSIC)        \
  case Intrinsic::INTRINSIC:                                \
    HasRoundingMD = ROUND_MODE;                             \
    break;
#include "llvm/IR/ConstrainedOps.def"
  }
  if (HasRoundingMD) {
    Value *RoundingV = getConstrainedFPRounding(Rounding);
    C = CreateIntrinsic(ID, {DestTy, V->getType()}, {V, RoundingV, ExceptV},
                        nullptr, Name);
  } else
    C = CreateIntrinsic(ID, {DestTy, V->getType()}, {V, ExceptV}, nullptr,
                        Name);

  setConstrainedFPCallAttr(C);

  if (isa<FPMathOperator>(C))
    setFPAttrs(C, FPMathTag, UseFMF);
  return C;
}

Value *IRBuilderBase::CreateFCmpHelper(
    CmpInst::Predicate P, Value *LHS, Value *RHS, const Twine &Name,
    MDNode *FPMathTag, bool IsSignaling) {
  if (IsFPConstrained) {
    auto ID = IsSignaling ? Intrinsic::experimental_constrained_fcmps
                          : Intrinsic::experimental_constrained_fcmp;
    return CreateConstrainedFPCmp(ID, P, LHS, RHS, Name);
  }

  if (auto *LC = dyn_cast<Constant>(LHS))
    if (auto *RC = dyn_cast<Constant>(RHS))
      return Insert(Folder.CreateFCmp(P, LC, RC), Name);
  return Insert(setFPAttrs(new FCmpInst(P, LHS, RHS), FPMathTag, FMF), Name);
}

CallInst *IRBuilderBase::CreateConstrainedFPCmp(
    Intrinsic::ID ID, CmpInst::Predicate P, Value *L, Value *R,
    const Twine &Name, Optional<fp::ExceptionBehavior> Except) {
  Value *PredicateV = getConstrainedFPPredicate(P);
  Value *ExceptV = getConstrainedFPExcept(Except);

  CallInst *C = CreateIntrinsic(ID, {L->getType()},
                                {L, R, PredicateV, ExceptV}, nullptr, Name);
  setConstrainedFPCallAttr(C);
  return C;
}

CallInst *IRBuilderBase::CreateConstrainedFPCall(
    Function *Callee, ArrayRef<Value *> Args, const Twine &Name,
    Optional<RoundingMode> Rounding,
    Optional<fp::ExceptionBehavior> Except) {
  llvm::SmallVector<Value *, 6> UseArgs;

  for (auto *OneArg : Args)
    UseArgs.push_back(OneArg);
  bool HasRoundingMD = false;
  switch (Callee->getIntrinsicID()) {
  default:
    break;
#define INSTRUCTION(NAME, NARG, ROUND_MODE, INTRINSIC)        \
  case Intrinsic::INTRINSIC:                                \
    HasRoundingMD = ROUND_MODE;                             \
    break;
#include "llvm/IR/ConstrainedOps.def"
  }
  if (HasRoundingMD)
    UseArgs.push_back(getConstrainedFPRounding(Rounding));
  UseArgs.push_back(getConstrainedFPExcept(Except));

  CallInst *C = CreateCall(Callee, UseArgs, Name);
  setConstrainedFPCallAttr(C);
  return C;
}

Value *IRBuilderBase::CreateSelect(Value *C, Value *True, Value *False,
                                   const Twine &Name, Instruction *MDFrom) {
  if (auto *CC = dyn_cast<Constant>(C))
    if (auto *TC = dyn_cast<Constant>(True))
      if (auto *FC = dyn_cast<Constant>(False))
        return Insert(Folder.CreateSelect(CC, TC, FC), Name);

  SelectInst *Sel = SelectInst::Create(C, True, False);
  if (MDFrom) {
    MDNode *Prof = MDFrom->getMetadata(LLVMContext::MD_prof);
    MDNode *Unpred = MDFrom->getMetadata(LLVMContext::MD_unpredictable);
    Sel = addBranchMetadata(Sel, Prof, Unpred);
  }
  if (isa<FPMathOperator>(Sel))
    setFPAttrs(Sel, nullptr /* MDNode* */, FMF);
  return Insert(Sel, Name);
}

Value *IRBuilderBase::CreatePtrDiff(Value *LHS, Value *RHS,
                                    const Twine &Name) {
  assert(LHS->getType() == RHS->getType() &&
         "Pointer subtraction operand types must match!");
  auto *ArgType = cast<PointerType>(LHS->getType());
  Value *LHS_int = CreatePtrToInt(LHS, Type::getInt64Ty(Context));
  Value *RHS_int = CreatePtrToInt(RHS, Type::getInt64Ty(Context));
  Value *Difference = CreateSub(LHS_int, RHS_int);
  return CreateExactSDiv(Difference,
                         ConstantExpr::getSizeOf(ArgType->getElementType()),
                         Name);
}

Value *IRBuilderBase::CreateLaunderInvariantGroup(Value *Ptr) {
  assert(isa<PointerType>(Ptr->getType()) &&
         "launder.invariant.group only applies to pointers.");
  // FIXME: we could potentially avoid casts to/from i8*.
  auto *PtrType = Ptr->getType();
  auto *Int8PtrTy = getInt8PtrTy(PtrType->getPointerAddressSpace());
  if (PtrType != Int8PtrTy)
    Ptr = CreateBitCast(Ptr, Int8PtrTy);
  Module *M = BB->getParent()->getParent();
  Function *FnLaunderInvariantGroup = Intrinsic::getDeclaration(
      M, Intrinsic::launder_invariant_group, {Int8PtrTy});

  assert(FnLaunderInvariantGroup->getReturnType() == Int8PtrTy &&
         FnLaunderInvariantGroup->getFunctionType()->getParamType(0) ==
             Int8PtrTy &&
         "LaunderInvariantGroup should take and return the same type");

  CallInst *Fn = CreateCall(FnLaunderInvariantGroup, {Ptr});

  if (PtrType != Int8PtrTy)
    return CreateBitCast(Fn, PtrType);
  return Fn;
}

Value *IRBuilderBase::CreateStripInvariantGroup(Value *Ptr) {
  assert(isa<PointerType>(Ptr->getType()) &&
         "strip.invariant.group only applies to pointers.");

  // FIXME: we could potentially avoid casts to/from i8*.
  auto *PtrType = Ptr->getType();
  auto *Int8PtrTy = getInt8PtrTy(PtrType->getPointerAddressSpace());
  if (PtrType != Int8PtrTy)
    Ptr = CreateBitCast(Ptr, Int8PtrTy);
  Module *M = BB->getParent()->getParent();
  Function *FnStripInvariantGroup = Intrinsic::getDeclaration(
      M, Intrinsic::strip_invariant_group, {Int8PtrTy});

  assert(FnStripInvariantGroup->getReturnType() == Int8PtrTy &&
         FnStripInvariantGroup->getFunctionType()->getParamType(0) ==
             Int8PtrTy &&
         "StripInvariantGroup should take and return the same type");

  CallInst *Fn = CreateCall(FnStripInvariantGroup, {Ptr});

  if (PtrType != Int8PtrTy)
    return CreateBitCast(Fn, PtrType);
  return Fn;
}

Value *IRBuilderBase::CreateVectorSplat(unsigned NumElts, Value *V,
                                        const Twine &Name) {
  assert(NumElts > 0 && "Cannot splat to an empty vector!");

  // First insert it into an undef vector so we can shuffle it.
  Type *I32Ty = getInt32Ty();
  Value *Undef = UndefValue::get(VectorType::get(V->getType(), NumElts));
  V = CreateInsertElement(Undef, V, ConstantInt::get(I32Ty, 0),
                          Name + ".splatinsert");

  // Shuffle the value across the desired number of elements.
  Value *Zeros = ConstantAggregateZero::get(VectorType::get(I32Ty, NumElts));
  return CreateShuffleVector(V, Undef, Zeros, Name + ".splat");
}

Value *IRBuilderBase::CreateExtractInteger(
    const DataLayout &DL, Value *From, IntegerType *ExtractedTy,
    uint64_t Offset, const Twine &Name) {
  auto *IntTy = cast<IntegerType>(From->getType());
  assert(DL.getTypeStoreSize(ExtractedTy) + Offset <=
             DL.getTypeStoreSize(IntTy) &&
         "Element extends past full value");
  uint64_t ShAmt = 8 * Offset;
  Value *V = From;
  if (DL.isBigEndian())
    ShAmt = 8 * (DL.getTypeStoreSize(IntTy) -
                 DL.getTypeStoreSize(ExtractedTy) - Offset);
  if (ShAmt) {
    V = CreateLShr(V, ShAmt, Name + ".shift");
  }
  assert(ExtractedTy->getBitWidth() <= IntTy->getBitWidth() &&
         "Cannot extract to a larger integer!");
  if (ExtractedTy != IntTy) {
    V = CreateTrunc(V, ExtractedTy, Name + ".trunc");
  }
  return V;
}

Value *IRBuilderBase::CreatePreserveArrayAccessIndex(
    Type *ElTy, Value *Base, unsigned Dimension, unsigned LastIndex,
    MDNode *DbgInfo) {
  assert(isa<PointerType>(Base->getType()) &&
         "Invalid Base ptr type for preserve.array.access.index.");
  auto *BaseType = Base->getType();

  Value *LastIndexV = getInt32(LastIndex);
  Constant *Zero = ConstantInt::get(Type::getInt32Ty(Context), 0);
  SmallVector<Value *, 4> IdxList;
  for (unsigned I = 0; I < Dimension; ++I)
    IdxList.push_back(Zero);
  IdxList.push_back(LastIndexV);

  Type *ResultType =
      GetElementPtrInst::getGEPReturnType(ElTy, Base, IdxList);

  Module *M = BB->getParent()->getParent();
  Function *FnPreserveArrayAccessIndex = Intrinsic::getDeclaration(
      M, Intrinsic::preserve_array_access_index, {ResultType, BaseType});

  Value *DimV = getInt32(Dimension);
  CallInst *Fn =
      CreateCall(FnPreserveArrayAccessIndex, {Base, DimV, LastIndexV});
  if (DbgInfo)
    Fn->setMetadata(LLVMContext::MD_preserve_access_index, DbgInfo);

  return Fn;
}

Value *IRBuilderBase::CreatePreserveUnionAccessIndex(
    Value *Base, unsigned FieldIndex, MDNode *DbgInfo) {
  assert(isa<PointerType>(Base->getType()) &&
         "Invalid Base ptr type for preserve.union.access.index.");
  auto *BaseType = Base->getType();

  Module *M = BB->getParent()->getParent();
  Function *FnPreserveUnionAccessIndex = Intrinsic::getDeclaration(
      M, Intrinsic::preserve_union_access_index, {BaseType, BaseType});

  Value *DIIndex = getInt32(FieldIndex);
  CallInst *Fn =
      CreateCall(FnPreserveUnionAccessIndex, {Base, DIIndex});
  if (DbgInfo)
    Fn->setMetadata(LLVMContext::MD_preserve_access_index, DbgInfo);

  return Fn;
}

Value *IRBuilderBase::CreatePreserveStructAccessIndex(
    Type *ElTy, Value *Base, unsigned Index, unsigned FieldIndex,
    MDNode *DbgInfo) {
  assert(isa<PointerType>(Base->getType()) &&
         "Invalid Base ptr type for preserve.struct.access.index.");
  auto *BaseType = Base->getType();

  Value *GEPIndex = getInt32(Index);
  Constant *Zero = ConstantInt::get(Type::getInt32Ty(Context), 0);
  Type *ResultType =
      GetElementPtrInst::getGEPReturnType(ElTy, Base, {Zero, GEPIndex});

  Module *M = BB->getParent()->getParent();
  Function *FnPreserveStructAccessIndex = Intrinsic::getDeclaration(
      M, Intrinsic::preserve_struct_access_index, {ResultType, BaseType});

  Value *DIIndex = getInt32(FieldIndex);
  CallInst *Fn = CreateCall(FnPreserveStructAccessIndex,
                            {Base, GEPIndex, DIIndex});
  if (DbgInfo)
    Fn->setMetadata(LLVMContext::MD_preserve_access_index, DbgInfo);

  return Fn;
}

CallInst *IRBuilderBase::CreateAlignmentAssumptionHelper(
    const DataLayout &DL, Value *PtrValue, Value *Mask, Type *IntPtrTy,
    Value *OffsetValue, Value **TheCheck) {
  Value *PtrIntValue = CreatePtrToInt(PtrValue, IntPtrTy, "ptrint");

  if (OffsetValue) {
    bool IsOffsetZero = false;
    if (const auto *CI = dyn_cast<ConstantInt>(OffsetValue))
      IsOffsetZero = CI->isZero();

    if (!IsOffsetZero) {
      if (OffsetValue->getType() != IntPtrTy)
        OffsetValue = CreateIntCast(OffsetValue, IntPtrTy, /*isSigned*/ true,
                                    "offsetcast");
      PtrIntValue = CreateSub(PtrIntValue, OffsetValue, "offsetptr");
    }
  }

  Value *Zero = ConstantInt::get(IntPtrTy, 0);
  Value *MaskedPtr = CreateAnd(PtrIntValue, Mask, "maskedptr");
  Value *InvCond = CreateICmpEQ(MaskedPtr, Zero, "maskcond");
  if (TheCheck)
    *TheCheck = InvCond;

  return CreateAssumption(InvCond);
}

CallInst *IRBuilderBase::CreateAlignmentAssumption(
    const DataLayout &DL, Value *PtrValue, unsigned Alignment,
    Value *OffsetValue, Value **TheCheck) {
  assert(isa<PointerType>(PtrValue->getType()) &&
         "trying to create an alignment assumption on a non-pointer?");
  assert(Alignment != 0 && "Invalid Alignment");
  auto *PtrTy = cast<PointerType>(PtrValue->getType());
  Type *IntPtrTy = getIntPtrTy(DL, PtrTy->getAddressSpace());

  Value *Mask = ConstantInt::get(IntPtrTy, Alignment - 1);
  return CreateAlignmentAssumptionHelper(DL, PtrValue, Mask, IntPtrTy,
                                         OffsetValue, TheCheck);
}

CallInst *IRBuilderBase::CreateAlignmentAssumption(
    const DataLayout &DL, Value *PtrValue, Value *Alignment,
    Value *OffsetValue, Value **TheCheck) {
  assert(isa<PointerType>(PtrValue->getType()) &&
         "trying to create an alignment assumption on a non-pointer?");
  auto *PtrTy = cast<PointerType>(PtrValue->getType());
  Type *IntPtrTy = getIntPtrTy(DL, PtrTy->getAddressSpace());

  if (Alignment->getType() != IntPtrTy)
    Alignment = CreateIntCast(Alignment, IntPtrTy, /*isSigned*/ false,
                              "alignmentcast");

  Value *Mask = CreateSub(Alignment, ConstantInt::get(IntPtrTy, 1), "mask");

  return CreateAlignmentAssumptionHelper(DL, PtrValue, Mask, IntPtrTy,
                                         OffsetValue, TheCheck);
}

IRBuilderDefaultInserter::~IRBuilderDefaultInserter() {}
IRBuilderCallbackInserter::~IRBuilderCallbackInserter() {}
IRBuilderFolder::~IRBuilderFolder() {}
void ConstantFolder::anchor() {}
void NoFolder::anchor() {}


text:
body{

}
.form-control::-moz-placeholder{
   color: #DDDDDD;
   opacity: 1;
}
.form-control:-moz-placeholder{
   color: #DDDDDD;
   opacity: 1;
}
.form-control::-webkit-input-placeholder{
   color: #DDDDDD;
   opacity: 1;
}
.form-control:-ms-input-placeholder{
   color: #DDDDDD;
   opacity: 1;
}
/*     General overwrite     */
a{
    color: #2C93FF;
}
a:hover, a:focus {
    color: #1084FF;
}
a:focus, a:active,
button::-moz-focus-inner,
input[type="reset"]::-moz-focus-inner,
input[type="button"]::-moz-focus-inner,
input[type="submit"]::-moz-focus-inner,
select::-moz-focus-inner,
input[type="file"] > input[type="button"]::-moz-focus-inner {
    outline : 0;
}

/*           Font Smoothing      */

h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6, p, .navbar, .brand, .btn-simple{
    -moz-osx-font-smoothing: grayscale;
    -webkit-font-smoothing: antialiased;
}

/*           Typography          */

h1, .h1, h2, .h2, h3, .h3, h4, .h4{
    font-weight: 400;
    margin: 30px 0 15px;
}

h1, .h1 {
    font-size: 52px;
}
h2, .h2{
    font-size: 36px;
}
h3, .h3{
    font-size: 28px;
    margin: 20px 0 10px;
}
h4, .h4{
    font-size: 22px;
}
h5, .h5 {
    font-size: 16px;
}
h6, .h6{
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
}
p{
    font-size: 16px;
    line-height: 1.6180em;
}
h1 small, h2 small, h3 small, h4 small, h5 small, h6 small, .h1 small, .h2 small, .h3 small, .h4 small, .h5 small, .h6 small, h1 .small, h2 .small, h3 .small, h4 .small, h5 .small, h6 .small, .h1 .small, .h2 .small, .h3 .small, .h4 .small, .h5 .small, .h6 .small {
    color: #999999;
    font-weight: 300;
    line-height: 1;
}
h1 small, h2 small, h3 small, h1 .small, h2 .small, h3 .small {
    font-size: 60%;
}

/*           Animations              */
.form-control, .input-group-addon{
    -webkit-transition: all 300ms linear;
    -moz-transition: all 300ms linear;
    -o-transition: all 300ms linear;
    -ms-transition: all 300ms linear;
    transition: all 300ms linear;
}

.btn{
    border-width: 2px;
    background-color: rgba(0,0,0,.0);
    font-weight: 400;
    opacity: 0.8;
    padding: 8px 16px;
}
.btn-round{
    border-width: 1px;
    border-radius: 30px !important;
    opacity: 0.79;
    padding: 9px 18px;
}
.btn-sm, .btn-xs {
    border-radius: 3px;
    font-size: 12px;
    line-height: 1.5;
    padding: 5px 10px;
}
.btn-xs {
    padding: 1px 5px;
}
.btn-lg{
   border-radius: 6px;
   font-size: 18px;
   font-weight: 400;
   padding: 14px 60px;
}
.btn-wd {
    min-width: 140px;
}
.btn-default{
    color: #777777;
    border-color: #999999
}
.btn-primary {
    color: #3472F7;
    border-color: #3472F7;
}
.btn-info{
     color: #2C93FF;
    border-color: #2C93FF;
}
.btn-success{
    color: #05AE0E;
    border-color: #05AE0E;
}
.btn-warning{
    color: #FF9500;
    border-color: #FF9500;
}
.btn-danger{
    color: #FF3B30;
    border-color: #FF3B30;
}
.btn:hover{
    background-color: rgba(0,0,0,.0);
    opacity: 1;
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active, .btn-primary.active, .open .dropdown-toggle.btn-primary {
    color: #1D62F0;
    border-color: #1D62F0;
    background-color: rgba(0,0,0,.0);
}
.btn-info:hover, .btn-info:focus, .btn-info:active, .btn-info.active, .open .dropdown-toggle.btn-info {
    color: #1084FF;
    border-color: #1084FF;
    background-color: rgba(0,0,0,.0);
}
.btn-success:hover, .btn-success:focus, .btn-success:active, .btn-success.active, .open .dropdown-toggle.btn-success {
    color: #049F0C;
    border-color: #049F0C;
    background-color: rgba(0,0,0,.0);
}
.btn-warning:hover, .btn-warning:focus, .btn-warning:active, .btn-warning.active, .open .dropdown-toggle.btn-warning {
    color: #ED8D00;
    border-color: #ED8D00;
    background-color: rgba(0,0,0,.0);
}
.btn-danger:hover, .btn-danger:focus, .btn-danger:active, .btn-danger.active, .open .dropdown-toggle.btn-danger {
    color: #EE2D20;
    border-color: #EE2D20;
    background-color: rgba(0,0,0,.0);
}
.btn-default:hover, .btn-default:focus, .btn-default:active, .btn-default.active, .open .dropdown-toggle.btn-default {
    color: #666666;
    border-color: #888888;
    background-color: rgba(0,0,0,.0);
}
.btn:active, .btn.active {
    background-image: none;
    box-shadow: none;

}
.btn.disabled, .btn[disabled], fieldset[disabled] .btn {
    opacity: 0.45;
}
.btn-primary.disabled, .btn-primary[disabled], fieldset[disabled] .btn-primary, .btn-primary.disabled:hover, .btn-primary[disabled]:hover, fieldset[disabled] .btn-primary:hover, .btn-primary.disabled:focus, .btn-primary[disabled]:focus, fieldset[disabled] .btn-primary:focus, .btn-primary.disabled:active, .btn-primary[disabled]:active, fieldset[disabled] .btn-primary:active, .btn-primary.disabled.active, .btn-primary.active[disabled], fieldset[disabled] .btn-primary.active {
    background-color: rgba(0, 0, 0, 0);
    border-color: #3472F7;
}
.btn-info.disabled, .btn-info[disabled], fieldset[disabled] .btn-info, .btn-info.disabled:hover, .btn-info[disabled]:hover, fieldset[disabled] .btn-info:hover, .btn-info.disabled:focus, .btn-info[disabled]:focus, fieldset[disabled] .btn-info:focus, .btn-info.disabled:active, .btn-info[disabled]:active, fieldset[disabled] .btn-info:active, .btn-info.disabled.active, .btn-info.active[disabled], fieldset[disabled] .btn-info.active {
    background-color: rgba(0, 0, 0, 0);
    border-color: #2C93FF;
}
.btn-success.disabled, .btn-success[disabled], fieldset[disabled] .btn-success, .btn-success.disabled:hover, .btn-success[disabled]:hover, fieldset[disabled] .btn-success:hover, .btn-success.disabled:focus, .btn-success[disabled]:focus, fieldset[disabled] .btn-success:focus, .btn-success.disabled:active, .btn-success[disabled]:active, fieldset[disabled] .btn-success:active, .btn-success.disabled.active, .btn-success.active[disabled], fieldset[disabled] .btn-success.active {
    background-color: rgba(0, 0, 0, 0);
    border-color: #05AE0E;
}
.btn-danger.disabled, .btn-danger[disabled], fieldset[disabled] .btn-danger, .btn-danger.disabled:hover, .btn-danger[disabled]:hover, fieldset[disabled] .btn-danger:hover, .btn-danger.disabled:focus, .btn-danger[disabled]:focus, fieldset[disabled] .btn-danger:focus, .btn-danger.disabled:active, .btn-danger[disabled]:active, fieldset[disabled] .btn-danger:active, .btn-danger.disabled.active, .btn-danger.active[disabled], fieldset[disabled] .btn-danger.active {
    background-color: rgba(0, 0, 0, 0);
    border-color: #FF3B30;
}
.btn-warning.disabled, .btn-warning[disabled], fieldset[disabled] .btn-warning, .btn-warning.disabled:hover, .btn-warning[disabled]:hover, fieldset[disabled] .btn-warning:hover, .btn-warning.disabled:focus, .btn-warning[disabled]:focus, fieldset[disabled] .btn-warning:focus, .btn-warning.disabled:active, .btn-warning[disabled]:active, fieldset[disabled] .btn-warning:active, .btn-warning.disabled.active, .btn-warning.active[disabled], fieldset[disabled] .btn-warning.active {
    background-color: rgba(0, 0, 0, 0);
    border-color: #FF9500;
}

/*           Buttons fill .btn-fill           */
.btn-fill{
    color: #FFFFFF;
    opacity: 1;
}
.btn-fill:hover, .btn-fill:active, .btn-fill:focus{
    color: #FFFFFF;
}
.btn-default.btn-fill{
    background-color: #999999;
    border-color: #999999
}
.btn-primary.btn-fill{
    background-color: #3472F7;
    border-color: #3472F7;
}
.btn-info.btn-fill{
    background-color: #2C93FF;
    border-color: #2C93FF;
}
.btn-success.btn-fill{
    background-color: #05AE0E;
    border-color: #05AE0E;
}
.btn-warning.btn-fill{
   background-color: #FF9500;
   border-color: #FF9500;
}
.btn-danger.btn-fill{
    background-color: #FF3B30;
    border-color: #FF3B30;
}
.btn-default.btn-fill:hover, .btn-default.btn-fill:focus, .btn-default.btn-fill:active, .btn-default.btn-fill.active, .open .dropdown-toggle.btn-fill.btn-default {
    background-color: #888888;
    border-color: #888888;
}
.btn-primary.btn-fill:hover, .btn-primary.btn-fill:focus, .btn-primary.btn-fill:active, .btn-primary.btn-fill.active, .open .dropdown-toggle.btn-primary.btn-fill{
    border-color: #1D62F0;
    background-color: #1D62F0;
}
.btn-info.btn-fill:hover, .btn-info.btn-fill:focus, .btn-info.btn-fill:active, .btn-info.btn-fill.active, .open .dropdown-toggle.btn-info.btn-fill {
    background-color: #1084FF;
    border-color: #1084FF;
}
.btn-success.btn-fill:hover, .btn-success.btn-fill:focus, .btn-success.btn-fill:active, .btn-success.btn-fill.active, .open .dropdown-toggle.btn-fill.btn-success {
    background-color: #049F0C;
    border-color: #049F0C;
}
.btn-warning.btn-fill:hover, .btn-warning.btn-fill:focus, .btn-warning.btn-fill:active, .btn-warning.btn-fill.active, .open .dropdown-toggle.btn-fill.btn-warning {
    background-color: #ED8D00;
    border-color: #ED8D00;
}
.btn-danger.btn-fill:hover, .btn-danger.btn-fill:focus, .btn-danger.btn-fill:active, .btn-danger.btn-fill.active, .open .dropdown-toggle.btn-danger.btn-fill {
    background-color: #EE2D20;
    border-color: #EE2D20;
}

/*          End Buttons fill          */

.btn-simple{
    font-weight: 600;
    border: 0;
    padding: 10px 18px;
}
.btn-simple.btn-xs{
    padding: 3px 5px;
}
.btn-simple.btn-sm{
    padding: 7px 10px;
}
.btn-simple.btn-lg{
   padding: 16px 60px;
}
.btn-round.btn-xs{
    padding: 2px 5px;
}
.btn-round.btn-sm{
    padding: 6px 10px;
}
.btn-round.btn-lg{
    padding: 15px 60px;
}

/*             Inputs               */
.form-control {
    background-color: #FFFFFF;
    border: 1px solid #E3E3E3;
    border-radius: 4px;
    box-shadow: none;
    color: #444444;
    height: 38px;
    padding: 6px 16px;
}

.form-control:focus {
    background-color: #FFFFFF;
    border: 1px solid #9A9A9A;
    box-shadow: none;
    outline: 0 none;
}
.form-control + .form-control-feedback{
    border-radius: 6px;
    font-size: 14px;
    padding: 0 12px 0 0;
    position: absolute;
    right: 25px;
    top: 13px;
    vertical-align: middle;
}
.form-control.transparent{
    background-color: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(238, 238, 238, 0.27);
    color: #FFFFFF;
}
.form-control.transparent:focus{
    border-color: #FFFFFF;

}
.input-lg{
    height: 56px;
    padding: 10px 16px;
}

/*           Navigation Bar             */
.navbar{
    border: 0 none;
    transition: all 0.4s;
    -webkit-transition: all 0.4s;
    font-size: 16px;
}
.navbar-default {
    background-color: #D9D9D9;

}
.navbar .navbar-brand {
    font-weight: 600;
    margin-top: 5px;
    margin-bottom: 5px;
    font-size: 20px;
}
.navbar-nav > li > a {
    margin-top: 13px;
    margin-bottom: 13px;
    padding-bottom: 12px;
    padding-top: 12px;
    font-size: 16px;
}
.navbar-nav > li > a [class^="fa"]{
    font-size: 22px;
}
.navbar-brand{
    padding: 20px 15px;
}

.navbar .btn{
    margin-top: 8px;
    margin-bottom: 8px;
}
.navbar-default:not(.navbar-transparent) {
    background-color: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
.navbar-transparent{
    padding-top: 15px;
    background-color: rgba(0,0,0,.0);
}
.navbar-transparent .navbar-brand, [class*="navbar-ct"] .navbar-brand{
    color: #FFFFFF;
    opacity: 0.95;
}
.navbar-transparent .navbar-brand:hover, .navbar-transparent .navbar-brand:focus {
    background-color: rgba(0, 0, 0, 0);
    color: #5E5E5E;
}
.navbar-transparent .nav .caret{
    border-bottom-color: #FFFFFF;
    border-top-color: #FFFFFF;
}
.navbar-transparent .navbar-nav > li > a, [class*="navbar-ct"] .navbar-nav > li > a{
    color: #FFFFFF;
    border-color: #FFFFFF;
    opacity: 0.7;
}
.navbar-transparent .navbar-brand:hover, .navbar-transparent .navbar-brand:focus, [class*="navbar-ct"] .navbar-brand:hover, [class*="navbar-ct"] .navbar-brand:focus {
    background-color: rgba(0, 0, 0, 0);
    color: #FFFFFF;
    opacity: 1;
}
.navbar-default .navbar-nav > .active > a, .navbar-default .navbar-nav > .active > a:hover, .navbar-default .navbar-nav > .active > a:focus, .navbar-default .navbar-nav > li > a:hover, .navbar-default .navbar-nav > li > a:focus {
    background-color: rgba(255, 255, 255, 0);
    border-radius: 3px;
    color: #2C93FF;
    opacity: 1;
}
.navbar-default .navbar-nav > .dropdown > a:hover .caret, .navbar-default .navbar-nav > .dropdown > a:focus .caret {
    border-bottom-color: #2C93FF;
    border-top-color: #2C93FF;
}
.navbar-default .navbar-nav > .open > a, .navbar-default .navbar-nav > .open > a:hover, .navbar-default .navbar-nav > .open > a:focus{
    background-color: rgba(255, 255, 255, 0);
    color: #2C93FF;
}
.navbar-transparent .navbar-nav > .active > a, .navbar-transparent .navbar-nav > .active > a:hover, .navbar-transparent .navbar-nav > .active > a:focus, .navbar-transparent .navbar-nav > li > a:hover, .navbar-transparent .navbar-nav > li > a:focus, [class*="navbar-ct"] .navbar-nav > .active > a, [class*="navbar-ct"] .navbar-nav > .active > a:hover, [class*="navbar-ct"] .navbar-nav > .active > a:focus, [class*="navbar-ct"] .navbar-nav > li > a:hover, [class*="navbar-ct"] .navbar-nav > li > a:focus {
    background-color: rgba(255, 255, 255, 0);
    border-radius: 3px;
    color: #FFFFFF;
    opacity: 1;
}
.navbar-transparent .navbar-nav > .dropdown > a .caret, [class*="navbar-ct"] .navbar-nav > .dropdown > a .caret{
    border-bottom-color: #FFFFFF;
    border-top-color: #FFFFFF;
}
.navbar-transparent .navbar-nav > .dropdown > a:hover .caret, .navbar-transparent .navbar-nav > .dropdown > a:focus .caret {
    border-bottom-color: #FFFFFF;
    border-top-color: #FFFFFF;
}
.navbar-transparent .navbar-nav > .open > a, .navbar-transparent .navbar-nav > .open > a:hover, .navbar-transparent .navbar-nav > .open > a:focus {
    background-color: rgba(255, 255, 255, 0);
    color: #FFFFFF;
    opacity: 1;
}
.navbar .btn{
    font-size: 16px;
    margin-top: 13px;
    margin-bottom: 13px;
}
.navbar .btn-default{
    color: #777777;
    border-color: #777777;
}
.navbar-default:not(.navbar-transparent) .btn-default:hover{
    color: #2C93FF;
    border-color: #2C93FF;
}
.navbar-transparent .btn-default, [class*="navbar-ct"] .btn-default{
    color: #FFFFFF;
    border-color: #FFFFFF;
}
[class*="navbar-ct"] .btn-default.btn-fill{
    color: #777777;
    background-color: #FFFFFF;
    opacity: 0.9;
}
[class*="navbar-ct"] .btn-default.btn-fill:hover, [class*="navbar-ct"] .btn-default.btn-fill:focus, [class*="navbar-ct"] .btn-default.btn-fill:active, [class*="navbar-ct"] .btn-default.btn-fill.active, [class*="navbar-ct"] .open .dropdown-toggle.btn-fill.btn-default{
    border-color: #FFFFFF;
    opacity: 1;
}
.navbar-form{
    box-shadow: none;
}
.navbar-form .form-control{
    background-color: rgba(244, 244, 244, 0);
    border-radius: 0;
    border:0;
    height: 22px;
    padding: 0;
    font-size: 16px;
    line-height: 20px;
    color: #777777;
}
.navbar-transparent .navbar-form .form-control, [class*="navbar-ct"] .navbar-form .form-control{
    color: #FFFFFF;
    border: 0;
    border-bottom: 1px solid rgba(255,255,255,.6);
}

.navbar .label{
    background-color: #FFFFFF;
    border: 1px solid #DDDDDD;
    color: #BBBBBB;
    text-transform: uppercase;
}
.dropdown-menu > li > a {
/*     border-bottom: 1px solid #DDDDDD; */
    padding: 6px 15px;
    color: #777777;
}
.dropdown-menu > li:first-child > a{
    border-radius: 10px 10px 0 0;
    padding-top: 12px;
}
.dropdown-menu > li:last-child > a{
    border-bottom: 0 none;
    border-radius: 0 0 10px 10px;
    padding-bottom: 12px;
}
.dropdown-menu > li > a:hover, .dropdown-menu > li > a:focus {
    background-color: #FFFFFF;
    color: #333333;
    opacity: 1;
    text-decoration: none;
}
.dropdown-menu > li > a img{
    margin-right: 5px;
}
.dropdown-menu .divider {
    background-color: #E5E5E5;
    height: 1px;
    margin: 8px 15px;
    overflow: hidden;
}

.navbar-toggle{
    margin-top: 19px;
    margin-bottom: 19px;
    border: 0;
}
.navbar-toggle .icon-bar {
    background-color: #FFFFFF;
}
.navbar-collapse, .navbar-form {
    border-color: rgba(0, 0, 0, 0);
}
.navbar-default .navbar-toggle:hover, .navbar-default .navbar-toggle:focus {
    background-color: rgba(0,0,0,0);
}

@media (min-width: 768px){
    .navbar-form {
        margin-top: 21px;
        margin-bottom: 21px;
        padding-left: 5px;
        padding-right: 5px;
    }
    .navbar-nav > li > .dropdown-menu, .dropdown-menu{
        display: block;
        margin: 0;
        padding: 0;
        z-index: 9000;
        position: absolute;
        -webkit-border-radius: 10px;
        box-shadow: 1px 2px 3px rgba(0, 0, 0, 0.125);
        border-radius: 10px;
        -webkit-box-sizing: border-box;
        -moz-box-sizing: border-box;
        box-sizing: border-box;
        opacity: 0;
        -ms-filter: "alpha(opacity=0)";
        -webkit-filter: alpha(opacity=0);
        -moz-filter: alpha(opacity=0);
        -ms-filter: alpha(opacity=0);
        -o-filter: alpha(opacity=0);
        filter: alpha(opacity=0);
        -webkit-transform: scale(0);
        -moz-transform: scale(0);
        -o-transform: scale(0);
        -ms-transform: scale(0);
        transform: scale(0);
        -webkit-transition: all 300ms cubic-bezier(0.34, 1.61, 0.7, 1);
        -moz-transition: all 300ms cubic-bezier(0.34, 1.61, 0.7, 1);
        -o-transition: all 300ms cubic-bezier(0.34, 1.61, 0.7, 1);
        -ms-transition: all 300ms cubic-bezier(0.34, 1.61, 0.7, 1);
        transition: all 300ms cubic-bezier(0.34, 1.61, 0.7, 1);

    }
    .navbar-nav > li.open > .dropdown-menu, .open .dropdown-menu{
        -webkit-transform-origin: 29px -50px;
        -moz-transform-origin: 29px -50px;
        -o-transform-origin: 29px -50px;
        -ms-transform-origin: 29px -50px;
        transform-origin: 29px -50px;
        -webkit-transform: scale(1);
        -moz-transform: scale(1);
        -o-transform: scale(1);
        -ms-transform: scale(1);
        transform: scale(1);
        opacity: 1;
        -ms-filter: none;
        -webkit-filter: none;
        -moz-filter: none;
        -ms-filter: none;
        -o-filter: none;
        filter: none;
    }
    .dropdown-menu:before{
        border-bottom: 11px solid rgba(0, 0, 0, 0.2);
        border-left: 11px solid rgba(0, 0, 0, 0);
        border-right: 11px solid rgba(0, 0, 0, 0);
        content: "";
        display: inline-block;
        position: absolute;
        left: 100%;
        margin-left: -60%;
        top: -11px;
    }
    .dropdown-menu:after {
        border-bottom: 11px solid #FFFFFF;
        border-left: 11px solid rgba(0, 0, 0, 0);
        border-right: 11px solid rgba(0, 0, 0, 0);
        content: "";
        display: inline-block;
        position: absolute;
        left: 100%;
        margin-left: -60%;
        top: -10px;
    }

}

@media (max-width: 768px){
    .navbar-transparent{
        padding-top: 0px;
        background-color: rgba(0, 0, 0, 0.75);
    }
    .navbar-transparent .navbar-collapse.in .navbar-nav .open .dropdown-menu > li > a:hover, .navbar-transparent .navbar-collapse.in .navbar-nav .open .dropdown-menu > li > a:focus, .navbar-transparent .dropdown-menu > li > a:hover, .navbar-transparent .dropdown-menu > li > a:focus, [class*="navbar-ct"] .dropdown-menu > li > a:hover, [class*="navbar-ct"] .dropdown-menu > li > a:focus{
        color: #FFFFFF;
        background-color: rgba(0,0,0,0);
        opacity: 1;
    }
    .navbar-transparent .navbar-collapse.in .navbar-nav .open .dropdown-menu > li > a, [class*="navbar-ct"] .dropdown-menu > li > a {
        color: #FFFFFF;
        opacity: 0.8;
    }
    .nav .open > a, .nav .open > a:hover, .nav .open > a:focus {
        background-color: rgba(0,0,0,0);
        border-color: #428BCA;
    }
    .navbar-collapse{
        text-align: center;
    }
    .navbar-collapse .navbar-form {
        width: 170px;
        margin: 0 auto;
    }
    .navbar-transparent .dropdown-menu .divider{
        background-color: #434343;
    }

}
.modal-backdrop.in {
    opacity: 0.25;
}

.main{
    background-position: center center;
    background-size: cover;
    height: auto;
    left: 0;
    min-height: 100%;
    min-width: 100%;
    position: absolute;
    top: 0;
    width: auto;
}
.cover{
    position: fixed;
    opacity: 1;
    background-color: rgba(0,0,0,.6);
    left: 0px;
    top: 0px;
    width: 100%;
    height: 100%;
    z-index: 1;
}
.cover.black{
    background-color: rgba(0,0,0,.6);
}
.cover.blue{
    background-color: rgba(5, 31, 60, 0.6);
}
.cover.green{
    background-color: rgba(3, 28, 7, 0.6);
}
.cover.orange{
    background-color: rgba(37, 28, 5, 0.6);
}
.cover.red{
    background-color: rgba(35, 3, 2, 0.66);
}

.blur{
  opacity:0;
}

.logo-container{
    left: 50px;
    position: absolute;
    top: 20px;
     z-index: 3;
}
.logo-container .logo{
    overflow: hidden;
    border-radius: 50%;
    border: 1px solid #333333;
    width: 60px;
    float: left;
}
.logo-container .brand{
    font-size: 18px;
    color: #FFFFFF;
    line-height: 20px;
    float: left;
    margin-left: 10px;
    margin-top: 10px;
    width: 60px
}
.main .logo{
    color: #FFFFFF;
    font-size: 56px;
    font-weight: 300;
    position: relative;
    text-align: center;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.33);
    margin-top: 150px;
    z-index: 3;
}

    /* Custom, iPhone Retina */
    @media only screen and (min-width : 320px) {
        .main .logo.cursive{
            font-family: 'Tangerine',cursive;
            font-size:56px;
        }
    }

    /* Extra Small Devices, Phones */
    @media only screen and (min-width : 480px) {
        .main .logo.cursive{
            font-family: 'Tangerine',cursive;
            font-size:112px;
        }
    }

    /* Small Devices, Tablets */
    @media only screen and (min-width : 768px) {
        .main .logo.cursive{
            font-family: 'Tangerine',cursive;
            font-size:112px;
        }
    }

    /* Medium Devices, Desktops */
    @media only screen and (min-width : 992px) {
        .main .logo.cursive{
            font-family: 'Tangerine',cursive;
            font-size:112px;
        }
    }

    /* Large Devices, Wide Screens */
    @media only screen and (min-width : 1200px) {
        .main .logo.cursive{
            font-family: 'Tangerine',cursive;
            font-size:112px;
        }
    }
}
.main .content{
    position: relative;
    z-index: 4;
}
.main .motto{
    min-height: 140px;
}
.main .motto, .main .subscribe .info-text{
    font-size: 28px;
    color: #FFFFFF;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.33);
    text-align: center;
    margin-top: 50px;

}

/* Custom, iPhone Retina */
    @media only screen and (min-width : 320px) {
        .main .subscribe .info-text{
    font-size: 12px;
    margin-bottom: 30px;
}
    }

    /* Extra Small Devices, Phones */
    @media only screen and (min-width : 480px) {
.main .subscribe .info-text{
    font-size: 18px;
    margin-bottom: 30px;
}
    }

#video_background {
    position: fixed;
    top: 0px;
    right: 0px;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: 1;
    overflow: hidden;
    background-position: center center;
    background-size: cover;

}
#video_pattern {
    position: fixed;
    opacity: 0.6;
    background-color: rgba(0,0,0,.45);
    left: 0px;
    top: 0px;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.footer{
    position: relative;
    bottom: 20px;
    right: 0px;
    width: 100%;
    color: #AAAAAA;
    z-index: 4;
    text-align: center;
    margin-top: 50px;
}
.footer a{
    color: #FFFFFF;
}
.footer .heart{
    color: #FF3B30;
}

@media (min-width:219px){
    .main .subscribe .form-group{
        width: auto;
    }
    .main .subscribe .form-inline .btn{
        width: 100%;
    }
}
@media (min-width:768px){
    .main .subscribe .form-inline .btn{
        width: auto;
    }
}
@media (min-width:991px){
    .main .subscribe .form-group{
        width: 190px;
    }

}
@media (min-width:1200px){
    .main .subscribe .form-group{
        width: 250px;
    }
}

.footer{
        position: fixed;
        bottom: 20px;
    }

/*          For demo purpose         */

.fixed-plugin{
    position: fixed;
    top:0px;
    right: 50px;
    z-index: 1031;
}
.fixed-plugin .fa-cog{
    color: #FFFFFF;
    background-color: rgba(0,0,0,.2);
    padding: 10px;
    border-radius: 0 0 6px 6px;
}
.fixed-plugin .dropdown-menu{
    right: 0;
    left: auto;
}
.fixed-plugin .dropdown-menu:after, .fixed-plugin .dropdown-menu:before{
    right: 10px;
    margin-left: auto;
    left: auto;
}
.fixed-plugin .fa-circle-thin{
    color: #FFFFFF;
}
.fixed-plugin .active .fa-circle-thin{
    color: #00bbff;
}
.fixed-plugin .dropdown-menu > li > a{
    padding-left: 10px;
    padding-right: 10px;
}

.fixed-plugin .dropdown-menu > .active > a, .fixed-plugin .dropdown-menu > .active > a:hover, .fixed-plugin .dropdown-menu > .active > a:focus{
    background: none;
    color: #777777;
}
.fixed-plugin img{
    border-radius: 6px;
    width: 150px;
    max-height: 65px;
    border: 4px solid #FFFFFF;

}
.fixed-plugin .active img, .fixed-plugin a:hover img{
    border-color: #00bbff;
}

.fixed-plugin .btn{
    margin: 10px 15px 0;
    color: #FFFFFF;
}
.fixed-plugin .btn:hover{
    color: #FFFFFF;
}
.fixed-plugin .badge{
    border: 3px solid #FFFFFF;
    border-radius: 50%;
    cursor: pointer;
    display: inline-block;
    height: 23px;
    margin-right: 5px;
    position: relative;
    top: 5px;
    width: 23px;
}
.fixed-plugin .badge.active, .fixed-plugin .badge:hover{
    border-color: #00bbff;
}
.fixed-plugin .badge-black{
    background-color: #333333;
}
.fixed-plugin .badge-blue{
    background-color: #2C93FF;
}
.fixed-plugin .badge-green{
    background-color: #05AE0E;
}
.fixed-plugin .badge-orange{
    background-color: #FF9500;
}
.fixed-plugin .badge-red{
    background-color: #FF3B30;
}

.tangerine{
    font-family: 'Tangerine', serif;
    color: white;
    font-size: 112px;
}

.raleway{
    font-family: 'Raleway', serif;
    font-size: 48px;
    color: white;
}

@media (max-width:768px){
    .fixed-plugin{
        top: 80px;
        right: 0px;
    }
    .main .container{
        margin-bottom: 50px;
    }
    #video_background{
        display: none;
    }

}

.col-centered{
    float: none;
    margin: 0 auto;
}

.wrapBorder{
border-style: solid;
    border-width: 5px;
    border-color: white;
}

.transparentBtn{
    background-color: rgba(0, 0, 0, 0.0001);
    border-color: #f5f5f5;
}


text:
package com.amazon.pay.response.parser;

import com.amazon.pay.response.model.GetProviderCreditDetailsResponse;
import com.amazon.pay.response.model.ProviderCreditDetails;
import java.io.Serializable;

/**
 * Response from GetProviderCreditDetails service API, as returned by Amazon Pay
 */
public final class GetProviderCreditDetailsResponseData  extends ResponseData implements Serializable {

    private String requestId;
    private ProviderCreditDetails providerCreditDetails;

    public GetProviderCreditDetailsResponseData(GetProviderCreditDetailsResponse getProviderCreditDetailsResponse , ResponseData rawResponse) {
        super(rawResponse);
        if(getProviderCreditDetailsResponse != null) {
            if(getProviderCreditDetailsResponse.getGetProviderCreditDetailsResult()!= null) {
                this.providerCreditDetails = getProviderCreditDetailsResponse.getGetProviderCreditDetailsResult().getProviderCreditDetails();
            }
            this.requestId = getProviderCreditDetailsResponse.getResponseMetadata().getRequestId();
        }
    }

    /**
     * The requestID that uniquely identifies the service request
     * the caller made.
     *
     * @return  The requestID that uniquely identifies the service request
     * the caller made.
     */
    public String getRequestId() {
        return requestId;
    }

    /**
     * Encapsulates details about providerCreditDetails
     *
     * @return providerCreditDetails
     */
    public ProviderCreditDetails getDetails() {
        return providerCreditDetails;
    }

    /**
     * Returns the string representation of GetProviderCreditDetailsResponseData
     */
    @Override
    public String toString() {
        return "GetProviderCreditDetailsResponseData{" + "requestId=" + requestId + ", providerCreditDetails=" + providerCreditDetails.toString() + '}';
    }

}


text:
package org.elasticsearch.common.util.concurrent;

import org.elasticsearch.ExceptionsHelper;

/**
 * A class used to wrap a {@code Runnable} that allows capturing the time of the task since creation
 * through execution as well as only execution time.
 */
class TimedRunnable extends AbstractRunnable implements WrappedRunnable {
    private final Runnable original;
    private final long creationTimeNanos;
    private long startTimeNanos;
    private long finishTimeNanos = -1;
    private boolean failedOrRejected = false;

    TimedRunnable(final Runnable original) {
        this.original = original;
        this.creationTimeNanos = System.nanoTime();
    }

    @Override
    public void doRun() {
        try {
            startTimeNanos = System.nanoTime();
            original.run();
        } finally {
            finishTimeNanos = System.nanoTime();
        }
    }

    @Override
    public void onRejection(final Exception e) {
        this.failedOrRejected = true;
        if (original instanceof AbstractRunnable) {
            ((AbstractRunnable) original).onRejection(e);
        } else {
            ExceptionsHelper.reThrowIfNotNull(e);
        }
    }

    @Override
    public void onAfter() {
        if (original instanceof AbstractRunnable) {
            ((AbstractRunnable) original).onAfter();
        }
    }

    @Override
    public void onFailure(final Exception e) {
        this.failedOrRejected = true;
        if (original instanceof AbstractRunnable) {
            ((AbstractRunnable) original).onFailure(e);
        } else {
            ExceptionsHelper.reThrowIfNotNull(e);
        }
    }

    @Override
    public boolean isForceExecution() {
        return original instanceof AbstractRunnable && ((AbstractRunnable) original).isForceExecution();
    }

    /**
     * Return the time since this task was created until it finished running.
     * If the task is still running or has not yet been run, returns -1.
     */
    long getTotalNanos() {
        if (finishTimeNanos == -1) {
            // There must have been an exception thrown, the total time is unknown (-1)
            return -1;
        }
        return Math.max(finishTimeNanos - creationTimeNanos, 1);
    }

    /**
     * Return the time this task spent being run.
     * If the task is still running or has not yet been run, returns -1.
     */
    long getTotalExecutionNanos() {
        if (startTimeNanos == -1 || finishTimeNanos == -1) {
            // There must have been an exception thrown, the total time is unknown (-1)
            return -1;
        }
        return Math.max(finishTimeNanos - startTimeNanos, 1);
    }

    /**
     * If the task was failed or rejected, return true.
     * Otherwise, false.
     */
    boolean getFailedOrRejected() {
        return this.failedOrRejected;
    }

    @Override
    public Runnable unwrap() {
        return original;
    }

}


text:
package br.com.dwarflink.test;

import org.junit.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.Select;
import org.apache.commons.lang3.RandomStringUtils;

public class AcessLink {
  private static final String APPLICATION_URL = "http://localhost:9000";

  //User infos
  private static final String USERNAME = "johnLocke";
  private static final String PSSW = "4515162342";

  //HTML elements id
  private static final String BTN_SIGNIN = "btnSignin";
  private static final String W_USERNAME = "username";
  private static final String CONTROL_PANEL_ID = "btnControlPanel";

  private static final String BTN_START = "btnStart";
  private static final String BTN_SIGNUP = "btnSignup";
  private static final String BTN_LOGOUT = "btnLogout";

  //Sign form
  private static final String SIGN_UNAME = "username";
  private static final String SIGN_PSSW = "password";
  private static final String BTN_SUBMIT = "submitLink";

  //Control Panel Page
  private static final String BTN_SHORT_LINK = "shorten";
  private static final String BTN_SECURE_LINK = "secure";
  private static final String BTN_LIST_ALL = "btnListAll";

  //General link
  private static final String ORIGINAL_LINK_BOX = "originalLink";
  private static final String RESULT_LINK = "resultLink";

  //Secure Link
  private static final String SECURE_LINK_BOX = "secureSlug";
  private static final String SECURE_LINK_KEY_BOX = "goldenShovel";
  private static final String SECURE_SLUG = "foobar";
  private static final String SECURE_LINK_KEY = "gnulinux";

  //Original links
  private static final String LINK_1 = "http://www.ime.usp.br/";
  private static final String LINK_2 = "http://www.uol.com.br/";
  private static final String LINK_3 = "www.globo.com.br";

  public static WebDriver signinUsuarioCorreto() {

    // abre firefox
    WebDriver driver = new FirefoxDriver();
    driver.manage().window().maximize();
    String randomComplement = "-" + RandomStringUtils.randomAscii(4);

    // O usuario acessa a homepage
    driver.get(APPLICATION_URL);

    //O usuario clica no botao 'Sign up' para se cadastrar
    WebElement botaoSignup = driver.findElement(By.id(BTN_SIGNIN));
    botaoSignup.click();

    //O usuário preenche o formulario de login com username e senha
    WebElement name = driver.findElement(By.name(SIGN_UNAME));
    WebElement password = driver.findElement(By.name(SIGN_PSSW));
    WebElement btnSubmit = driver.findElement(By.name(BTN_SUBMIT));

    name.sendKeys(USERNAME);
    password.sendKeys(PSSW);

    //O usuario clica em submit
    btnSubmit.click();

    return driver;
  }

  public WebDriver requisitaLinkEncurtado(String link) {
    WebDriver driver = signinUsuarioCorreto();

    WebElement linkBox = driver.findElement(By.id(BTN_SHORT_LINK));
    linkBox.click();

    WebElement originalLinkBox = driver.findElement(By.name(ORIGINAL_LINK_BOX));
    WebElement btnSubmit = driver.findElement(By.name(BTN_SUBMIT));

    originalLinkBox.sendKeys(link);
    btnSubmit.click();

    return driver;
  }

  public WebDriver requisitaLinkSeguro(String link, String secureKey) {
    WebDriver driver = signinUsuarioCorreto();
    String randomComplement = "-" + RandomStringUtils.randomAscii(4);

    WebElement linkBox = driver.findElement(By.id(BTN_SECURE_LINK));
    linkBox.click();

    WebElement originalLink = driver.findElement(By.name(ORIGINAL_LINK_BOX));
    WebElement secureSlug = driver.findElement(By.name(SECURE_LINK_BOX));
    WebElement secureLinkKey = driver.findElement(By.name(SECURE_LINK_KEY_BOX));
    WebElement btnSubmit = driver.findElement(By.name(BTN_SUBMIT));

    originalLink.sendKeys(link);
    secureSlug.sendKeys(SECURE_SLUG + randomComplement);
    secureLinkKey.sendKeys(secureKey);
    btnSubmit.click();

    return driver;
  }

  @Test
  public void acessaUmLinkEncurtado() {
    //Cria um link encurtado simples, com o usuario logado
    WebDriver driver = requisitaLinkEncurtado(LINK_1);

    //Acessa o link encurtado
    WebElement resultLink = driver.findElement(By.id(RESULT_LINK));
    String shortenedLink = resultLink.getText();

    driver.get(shortenedLink);

    //Compara o resultado do link encurtado com o link original e da sucesso caso for o mesmo
    String url = driver.getCurrentUrl();

    assertEquals(LINK_1, url);
    driver.quit();
  }

  @Test
  public void acessaUmLinkProtegido() {
    //Cria um link encurtado seguro, com o usuario logado
    WebDriver driver = requisitaLinkSeguro(LINK_2, SECURE_LINK_KEY);

    //Acessa o link encurtado
    WebElement resultLink = driver.findElement(By.id(RESULT_LINK));
    String shortenedLink = resultLink.getText();

    driver.get(shortenedLink);

    //Fornece o nome do criado e senha do link
    WebElement creatorName = driver.findElement(By.name(W_USERNAME));
    WebElement secureLinkKey = driver.findElement(By.name(SECURE_LINK_KEY_BOX));
    //Submete o formulario
    WebElement btnSubmit = driver.findElement(By.name(BTN_SUBMIT));

    creatorName.sendKeys(USERNAME);
    secureLinkKey.sendKeys(SECURE_LINK_KEY);
    btnSubmit.click();

    //Compara o resultado do link encurtado com o link original e da sucesso caso for o mesmo
    String url = driver.getCurrentUrl();

    assertEquals(LINK_2, url);
    driver.quit();
  }

  @Test
  public void encurtaLinkEncontraNaListagem() throws InterruptedException {
    //Cria um link encurtado seguro, com o usuario logado
    WebDriver driver = requisitaLinkEncurtado(LINK_3);

    //Salva o link encurtado
    WebElement resultLink = driver.findElement(By.id(RESULT_LINK));
    String shortenedLink = resultLink.getText();

    //Acessa o painel de controle
    driver.findElement(By.id(CONTROL_PANEL_ID)).click();
    //Acessa a listagem de links encurtados
    driver.findElement(By.id(BTN_LIST_ALL)).click();

    //Procura o link encurtado e o original na listagem, caso ache é sucesso
    boolean hasOriginalLink = driver.getPageSource().contains(LINK_2);
    boolean hasResultLink = driver.getPageSource().contains(shortenedLink);

    assertTrue(hasOriginalLink);
    assertTrue(hasResultLink);

    driver.quit();
  }
}