bcc ((CASE True r code def):xs)
    | length code < 4 = do
        showCases def code
        bcc xs
  where
    showCode bc = do
        w <- getBC bc xs
        i <- get
        tell $ "{\n" ++ w ++ indent (level i) ++ "}\n"

    showCases Nothing [(t, c)] = do
        i <- get
        tell $ indent (level i)
        showCode c
    showCases (Just def) [] = do
        i <- get
        tell $ indent (level i)
        showCode def
    showCases def ((t, c) : cs) = do
        i <- get
        tell $ indent (level i) ++ "if (CTAG(" ++ creg r ++ ") == "
               ++ show t ++ ") "
        showCode c
        tell $ indent (level i) ++ "else\n"
        showCases def cs
bcc ((CASE True r code def):xs)
    | length code < 4 = do
        showCases def code
        bcc xs
  where
    showCode bc = do
        w <- getBC bc xs
        i <- get
        tell $ "{\n" ++ w ++ indent (level i) ++ "}\n"

    showCases Nothing [(t, c)] = do
        i <- get
        tell $ indent (level i)
        showCode c
    showCases (Just def) [] = do
        i <- get
        tell $ indent (level i)
        showCode def
    showCases def ((t, c) : cs) = do
        i <- get
        tell $ indent (level i) ++ "if (CTAG(" ++ creg r ++ ") == "
               ++ show t ++ ") "
        showCode c
        tell $ indent (level i) ++ "else\n"
        showCases def cs
bcc ((CASE True r code def):xs)
    | length code < 4 = do
        showCases def code
        bcc xs
  where
    showCode bc = do
        w <- getBC bc xs
        i <- get
        tell $ "{\n" ++ w ++ indent (level i) ++ "}\n"

    showCases Nothing [(t, c)] = do
        i <- get
        tell $ indent (level i)
        showCode c
    showCases (Just def) [] = do
        i <- get
        tell $ indent (level i)
        showCode def
    showCases def ((t, c) : cs) = do
        i <- get
        tell $ indent (level i) ++ "if (CTAG(" ++ creg r ++ ") == "
               ++ show t ++ ") "
        showCode c
        tell $ indent (level i) ++ "else\n"
        showCases def cs