If the consequent is if and the altenrate is not then switch them out. That way we know we don't have to print a block.x
552093
function switchConsequent(path) {
    const { node } = path;

    if (!node.alternate) {
      return;
    }

    if (!t.isIfStatement(node.consequent)) {
      return;
    }

    if (t.isIfStatement(node.alternate)) {
      return;
    }

    node.test = t.unaryExpression("!", node.test, true);
    [node.alternate, node.consequent] = [node.consequent, node.alternate];
  }
218955
function not(pred, thisArg) {
    function notPred() {
        return !(notPred.pred.apply(notPred.thisArg, arguments));
    }
    notPred.pred = pred;
    notPred.thisArg = thisArg;
    return notPred;
}
987943
def tryCondition(self, block):
        
        currentBlock = self._prevNonEmptyBlock(block)
        if not currentBlock.isValid():
            return None

        # found non-empty line
        currentText = currentBlock.text()
        if currentText.rstrip().endswith(';') and \
           re.search(r'^\s*(if\b|[}]?\s*else|do\b|while\b|for)', currentText) is None:
            # idea: we had something like:
            #   if/while/for (expression)
            #       statement();  <-- we catch this trailing ';'
            # Now, look for a line that starts with if/for/while, that has one
            # indent level less.
            currentIndentation = self._lineIndent(currentText)
            if not currentIndentation:
                return None

            for block in self.iterateBlocksBackFrom(currentBlock.previous()):
                if block.text().strip(): # not empty
                    indentation = self._blockIndent(block)

                    if len(indentation) < len(currentIndentation):
                        if re.search(r'^\s*(if\b|[}]?\s*else|do\b|while\b|for)[^{]*$', block.text()) is not None:
                            dbg("tryCondition: success in line %d" % block.blockNumber())
                            return indentation
                        break

        return None
520792
def cbranch(self, cond, truebr, falsebr):
        
        br = instructions.ConditionalBranch(self.block, "br",
                                            [cond, truebr, falsebr])
        self._set_terminator(br)
        return br
213473
def _not(condition=None, **kwargs):
    

    result = True

    if condition is not None:
        result = not run(condition, **kwargs)

    return result
286294
function(node){
    var test = null;
    if ('default' != node.expr) {
      test = node.astExpr || this.parseExpr(node.expr);
    }
    var consequent = []
    if (node.block) {
      consequent = this.visit(node.block, node);
      consequent.push(t.breakStatement());
    }
    var c = t.switchCase(test, consequent);
    return [c];
  }
491249
def _conditional_exits(self, block_addr):
        

        vex_block = self.project.factory.block(block_addr).vex
        lst = [ ]

        for i, stmt in enumerate(vex_block.statements):
            if isinstance(stmt, pyvex.IRStmt.Exit):
                lst.append(i)

        return lst
788574
function() {
    var token = this.expect('if');

    this.state.push('conditional');
    this.cond = true;
    var node = new nodes.If(this.expression())
      , cond
      , block
      , item;

    node.column = token.column;

    this.cond = false;
    node.block = this.block(node, false);
    this.skip(['newline', 'comment']);
    while (this.accept('else')) {
      token = this.accept('if');
      if (token) {
        this.cond = true;
        cond = this.expression();
        this.cond = false;
        block = this.block(node, false);
        item = new nodes.If(cond, block);

        item.column = token.column;

        node.elses.push(item);
      } else {
        node.elses.push(this.block(node, false));
        break;
      }
      this.skip(['newline', 'comment']);
    }
    this.state.pop();
    return node;
  }
1001434
function (out, statement) {
                    var ifstruct = statement.parent;
                    if (ifstruct.name != "if") {
                        return out.logError(statement, statementsSingleton.ELSE_WITHOUT_IF);
                    } else if (ifstruct[Aria.FRAMEWORK_PREFIX + "elsepresent"]) {
                        return out.logError(statement, statementsSingleton.ELSE_ALREADY_USED);
                    }
                    ifstruct[Aria.FRAMEWORK_PREFIX + "elsepresent"] = true;
                    out.decreaseIndent();
                    out.writeln("} else {");
                    out.increaseIndent();
                }
526036
function mapIfStmt(ifStmt, path, down) {
        if (ifStmt.type === 'IfStatement' && containsAwait([ifStmt.consequent,ifStmt.alternate])) {
            var symName = generateSymbol(ifStmt);
            var ref = path[0];
            var synthBlock = {
                type: 'BlockStatement',
                body: [ifStmt]
            };
            if ('index' in ref) {
                var idx = ref.index;
                var deferredCode = ref.parent[ref.field].splice(idx + 1, ref.parent[ref.field].length - (idx + 1));
                ref.replace(synthBlock);
                if (deferredCode.length) {
                    var call = returnThisCall(symName);
                    synthBlock.body.push(down(makeContinuation(symName, deferredCode)));
                    [ifStmt.consequent,ifStmt.alternate].forEach(function (cond) {
                        if (!cond) 
                            return;
                        var blockEnd;
                        if (!examine(cond).isBlockStatement) 
                            blockEnd = cond;
                         else 
                            blockEnd = cond.body[cond.body.length - 1];
                        if (!(blockEnd && blockEnd.type === 'ReturnStatement')) {
                            if (!(cond.type === 'BlockStatement')) {
                                coerce(cond, {
                                    type: 'BlockStatement',
                                    body: [cloneNode(cond)]
                                });
                            }
                            cond.$deferred = true;
                            cond.body.push(cloneNode(call));
                        }
                        down(cond);
                    });
                    // If both blocks are transformed, the trailing call to $post_if()
                    // can be omitted as it'll be unreachable via a synchronous path
                    if (!(ifStmt.consequent && ifStmt.alternate && ifStmt.consequent.$deferred && ifStmt.alternate.$deferred)) 
                        synthBlock.body.push(cloneNode(call));
                }
            } else {
                ref.parent[ref.field] = synthBlock;
            }
        }
    }
813398
function endsWithCurlyBraceOrSemicolon ( node ) {
	return (
		node.type === 'BlockStatement' ||
		node.type === 'SwitchStatement' ||
		node.type === 'TryStatement' ||
		node.type === 'EmptyStatement'
	);
}
1286731
function(x) {
  return _.isUndefined(x) || _.isNull(x) || _.isNaN(x);
}
630151
def p_IfBlock(p):
    '''
    
    '''
    if isinstance(p[1], str):
        p[0] = IfBlock(None, p[2], p[4], p[5])
    else:
        p[0] = IfBlock(p[1], p[3], p[5], p[6])
200254
private WyalFile.Stmt implies(WyalFile.Stmt antecedent, WyalFile.Stmt consequent) {
		if (antecedent == null) {
			return consequent;
		} else {
			WyalFile.Stmt.Block antecedentBlock = new WyalFile.Stmt.Block(antecedent);
			WyalFile.Stmt.Block consequentBlock = new WyalFile.Stmt.Block(consequent);
			return new WyalFile.Stmt.IfThen(antecedentBlock, consequentBlock);
		}
	}
99578
function alwaysReturns(node) {
            if (node.type === "BlockStatement") {

                // If we have a BlockStatement, check each consequent body node.
                return node.body.some(checkForReturnOrIf);
            }

            /*
             * If not a block statement, make sure the consequent isn't a
             * ReturnStatement or an IfStatement with returns on both paths.
             */
            return checkForReturnOrIf(node);
        }
538581
def trySwitchStatement(self, block):
        
        if not re.match(r'^\s*(default\s*|case\b.*):', block.text()):
            return None

        for block in self.iterateBlocksBackFrom(block.previous()):
            text = block.text()
            if re.match(r"^\s*(default\s*|case\b.*):", text):
                dbg("trySwitchStatement: success in line %d" % block.blockNumber())
                return self._lineIndent(text)
            elif re.match(r"^\s*switch\b", text):
                if CFG_INDENT_CASE:
                    return self._increaseIndent(self._lineIndent(text))
                else:
                    return self._lineIndent(text)

        return None
150558
function checkValue(i) {
  const start = i;
  let l;
  let s;
  let _i;

  while (i < tokensLength) {
    if (checkDeclDelim(i)) break;

    if (l = checkBlock(i)) {
      i += l;
      break;
    }

    s = checkS(i);
    _i = i + s;

    if (l = _checkValue(_i)) i += l + s;
    if (!l || checkBlock(i - l)) break;
  }

  return i - start;
}