text:
module Main (main) where

import qualified Data.ByteString.Lazy.Char8 as LC
import System.Environment

main :: IO ()
main = do xs <- getArgs
          case xs of
              [x] ->
                  case reads x of
                      [(n, "")] ->
                          LC.putStr $ foo n
                      _ -> error "Bad argument"
              _ -> error "Need exactly 1 argument (number of times to loop)"

foo :: Int -> LC.ByteString
foo 0 = LC.empty
foo (n+1) = 'c' `LC.cons` foo n


To correlate imaging features of epithelioid sarcoma in children and young adults enrolled in Children's Oncology Group study ARST0332 with clinical and pathological findings.
Fifteen patients (6 males; median age 16.1 years, range 6.5–24.8 years) with epithelioid sarcoma enrolled in ARST0332 had preoperative imaging (MRI, n=10; CT, n=5) that was reviewed by two radiologists who recorded numerous features including presence and percentage of tumor necrosis, presence of surrounding edema, and lymph node involvement. Discrepancies between reviewers were adjudicated by concurrent re-review. We correlated imaging findings with histological assessment of percentage tumor necrosis, proximal- vs. classic-type histology, lymph node involvement and recurrence.
Eleven patients (11/15, 73%) had proximal-type histology tumors. Ten of 14 tumors (71%) had imaging evidence of necrosis. Among the nine tumors with imaging and histological estimates of percentage necrosis, agreement was within 30% (in six tumors there was ≤10% difference between pathology and imaging). All 10 tumors imaged with MRI had surrounding edema. Four patients had biopsy-proven nodal involvement; all had necrotic nodes on imaging. There were four false-positives for nodal involvment by imaging. Twelve patients (12/15, 80%) had recurrences (local only, n=1; local and distant, n=1; distant only, n=10).
Proximal-type histology was prevalent in this young cohort with preoperative imaging. Necrosis is common in primary tumors and involved nodes. There is good agreement between histological and imaging estimates of primary tumor necrosis. Surrounding tumor edema is common in this tumor, which is known to spread along fascial planes.
The authors thank Anne Speights and Edwina Anderson for their assistance in data collection and management, Fran Laurie and Richard Hanusik for their assistance with imaging processing and transfer from QARC, and Adriane Matthews for administrative assistance. This project was supported by U10CA98543, U10CA98413, U10CA180886, U10CA180899 and St. Baldrick's Foundation.
Dr. Spunt received funding support from the National Cancer Institute/CureSearch as principal investigator of the study.


Welcome to this pretty, stone-built cottage in the country, for family groups wanting to get away for a pleasant weekend. With comfortable facilities, the cottage has a professional kitchen, a beautiful lounge with a pool table and open fire, a spacious dining room and 8 bedrooms, 4 of which have bathrooms! Outside, there's a beautiful terrace ideal for barbecues and a garden for children! Close to Celles, one of Wallonia's most beautiful villages, Han-sur-Lesse and Beauraing. Numerous places to visit, numerous walks in the forest.


text:
Dingxi () ist eine bezirksfreie Stadt der chinesischen Provinz Gansu. Dingxi hat eine Fläche von 19.646 Quadratkilometern und zählt 2.821.700 Einwohner (Stand: Ende 2018). In dem eigentlichen städtischen Siedlungsgebiet von Dingxi leben 158.062 Menschen (Zensus 2010).

Administrative Gliederung
Die bezirksfreie Stadt Dingxi setzt sich auf Kreisebene aus einem Stadtbezirk und sechs Kreisen zusammen. Diese sind:

 Stadtbezirk Anding - ;
 Kreis Tongwei - ;
 Kreis Lintao - ;
 Kreis Zhang - ;
 Kreis Min - ;
 Kreis Weiyuan - ;
 Kreis Longxi - .

Einzelnachweise

Weblinks

 Offizielle Website – Chinesisch

Ort in Gansu
Bezirksfreie Stadt

redpajama_set_name: RedPajamaWikipedia


Key Alike Service to match keyways..
The Adams Tubular Entry Set (4414) is available in the several finishes (Polished Brass Lifetime, Fr..
The Apollo Keyed Tubular Exterior Grip Entry Set (D04-H524) is available in the several finishes (Ag..
The Apollo Tubular Entry Set (4815) is available in the several finishes (Satin Brass, Oil Rubbed Br..
The Ares Tubular Entry Set (4817) is available in the several finishes (Satin Brass, Oil Rubbed Bron..
The Art Nouveau Grip x Grip Tubular Entry Set (473333) is available in the several finishes (Flat Bl..
The Art Nouveau Tubular Entry Set (471333) is available in the several finishes (Flat Black, Medium ..
The Arts & Crafts Full Length Tubular Entry Set (4812) is available in the several finishes (Oil Rub..
The Arts & Crafts Tubular Entry Set (4811) is available in the several finishes (Oil Rubbed Bronze, ..
The Aspen Tubular Entry Set (7925/7800) is available in the these finishes (Oil Rubbed Bronze, Flat ..
The Baden Tubular Entry Set (4820) is available in the several finishes (Satin Brass, Oil Rubbed Bro..
The Bethpage Entry Set w/ 5077 Bethpage Knob (85327) is available in the several finishes (003, 031,..
The Bethpage Entry Set w/ 5077 Bethpage Knob (85337) is available in the several finishes (003, 031,..
The Bethpage Entry Set w/ 5447V Bethpage Lever (85327) is available in the several finishes (003, 03..
The Bethpage Entry Set w/ 5447V Bethpage Lever (85337) is available in the several finishes (003, 03..
The Blakely Entry Set w/ 5025 Egg Knob (85360) is available in the several finishes (003, 031, 050, ..
The Boulder Entry Set w/ 5024 Oval Knob (6402) is available in the several finishes (003, 031, 050, ..
The Boulder Entry Set w/ 5024 Oval Knob (85354) is available in the several finishes (003, 031, 050,..
The Boulder Entry Set w/ 5452V Beavertail Lever (6402) is available in the several finishes (003, 03..
The Boulder Entry Set w/ 5452V Beavertail Lever (85354) is available in the several finishes (003, 0..
The Boulder Keyless Entry Set w/ 5452V Beavertail Lever (8252-AC1/85353-AC) is available in the seve..
The Brighton Grip x Grip Tubular Entry Set (453929) is available in the several finishes (Flat Black..
The Brighton Tubular Entry Set (451923) is available in the several finishes (Flat Black, Medium Bro..
The Bristol Entry Set w/ 5064 Knob (6420) is available in the several finishes (003, 031, 050, 060, ..
The Canterbury Entry Set w/ 5020 Colonial Knob (85305) is available in the several finishes (003, 03..


text:
"That's football" : Philosophy among the Ivorians.
The Match: Greece v Cote d'Ivoire
The Date: Tuesday, June 24
The Venue: New Ivoire in East Harlem
New Ivoire restaurant in East Harlem the day of Cote d'Ivoire's match with Greece in the 2014 World Cup
"That's football," a cabdriver named Cain told me after Cote d'Ivoire lost to Greece on a penalty kick in the 93′. Cain approached me on the street outside New Ivoire restaurant and shrugged his shoulders. "That's what happens in this game. Now we root for USA."
Yeah, but that was a pretty awful way to lose, I prodded.
"That's the way the game goes," he responded.
I couldn't believe how calm and philosophical he was after that heartbreaking loss, especially since the Ivorian crowd seemed incredulous for the previous two hours. After every Ivorian mistake, every give-away, every cross that didn't find a green kit in the box, the pack of men at New Ivoire Restaurant whined like they were personally offended. At halftime, one guy in a gray pin-stripe suit got into an impassioned argument with another guy wearing a pink button-down and slacks. They pointed into each other's chests and their staccato French sounded like throaty morse code.
I asked the guy behind me what they were saying. "Oh they just disagree about the match," he responded cooly.
New Ivoire is a small orange container with mirrors hung at face-level along the wall. When I arrived during the national anthems, I stood with my butt touching the front door, my view obstructed by several bald, brown heads. If I were Yaya Toure, I probably wouldn't have fit in the restaurant. Seriously, has anyone else noticed how big Toure's ass is whenever the camera focuses on him taking a corner kick? Dude's got a donkey.
I am no Yaya Toure, however, and after a few minutes, Ivorians ushered me into the middle of the crowd, next to a small counter where a congenial woman in a red bandana and lacy blouse served tea and espresso. The TV was attached to the wall opposite the door and about 900 wires attached it to a stack of five cable boxes teetering on a shelf near the ceiling. There were four rows of tables crammed with anxious West Africans. A few interested white people sat in the front. The crowd rumbled throughout the match and their pleas filled the humid box. Non-Ivorians near the TV occasionally turned to chuckle and photograph the outspoken fans behind them.
Les Elephants, the Cote d'Ivoire soccer team's nickname, appeal to people from all countries. Their captain Didier Drogba is an icon, they have stars playing throughout Europe and the team has helped heal a divided nation. I stood near a guy named Jonah who was Swiss and wore an old, striped Cote d'Ivoire jersey. Jonah fit in by providing his own anguished French analysis throughout the second half.
Cote d'Ivoire was trapped in the Group of Death for two consecutive World Cups. Both times, they finished third in the group. This tournament, they finally got into an easier group matched up against Japan, Greece and Colombia. It seemed like 2014 was the Ivorian's best chance to move on to the Round of 16. All they needed was a draw with Greece yesterday. Yet, the crowd at New Ivoire seemed to expect Les Elephants to blow this match.
There were a few moments of levity, however. Just before the Ivory Coast's only goal, two guys standing by the TV loosened up and mugged for a cameraman. They started jumping and yelling and within 15 seconds, Wilfried Bony scored to tie the game for Les Elephants. Maybe they saw something I didn't see in the build up to that goal, but their celebration was weirdly (and uncharacteristically) optimistic. A few minutes later, Cote d'Ivoire substituted for Didier Drogba and the New Ivoire crowd applauded as Drogba trotted off the field.
Unfortunately, the life literally left the room when the referee awarded Greece a penalty kick in the 92′. Most of the men around me silently marched out of the restaurant en masse before Greece even put the ball down. They already knew what would happen.
I stuck around to watch Greece sink the penalty. When I left New Ivoire, I met Cain and was struck by his realism. I was crushed when Portugal tied the USA on Sunday and that was nothing compared to Cote d'Ivoire's defeat. I want Cain to be my next Uber driver and life coach.
A portion of the crowd at New Ivoire restaurant in East Harlem during Cote d'Ivoire's match with Greece.
One final note: The few people who ordered meals during the match received the largest servings of food I have ever seen. One loaded pile of plantains and white rice looked like a challenge on Man vs. Food.
OVERALL ATMOSPHERE: 8/10 in New Ivoire because the fans were passionate and the staff were generous. I took a card that says New Ivoire is open 24/7. I imagine that they cater to the West African cab driver set who probably need a place to convene and feel welcome at 3 am when their shifts end and they drop off their last drunk Wall Street finance guy at his Upper East Side penthouse.
These fans were way more interesting and invested in the game than the crowd at Athens Cafe, where I watched Greece last week.
drogba
greece v. ivory coast
new ivoire
world cup nyc
yaya toure's huge ass
Previous CONCACAF Represent! From the Mexican Enclave in Spanish Harlem
Next The World Meets Along 116th Street
On the Rhine between Brooklyn and Manhattan | Dear Gyan says:
[…] experiences (Iran viewing party, Costa Rica party, the USA/Ghana match, Croatian hooligans, Ivorian bar). All of that got cut of course, but Globo did leave in this exuberant bit (start at the :48 […]

redpajama_set_name: RedPajamaCommonCrawl


text:
The Sound(s) of Silence: Comparing Notes
Author, professor, and musicologist Adam Ockelford. (Photo: Getty)
"Writing about music is like dancing about architecture." – Elvis Costello
Guilty as charged. Yep, I guess I'm definitely one of those Declan grumbled about who attempts to dance about architecture. The same quote has often been attributed to the artist/comedian Martin Mull, but since the subject is using language to try and define or describe sounds, let's leave it in Costello's sarcastic hands for now. It somehow just feels right coming from him.
In Comparing Notes: How We Make Sense of Music, a captivating new book by Adam Ockelford, newly published by WW Norton and distributed by Penguin/Random House, a noted musicologist asks some thought-provoking questions. How does music work? Indeed, what is (or isn't) music? We are all instinctively musical (not so sure about that one) but how and why? There would seem to be two kinds of books about music -- maybe more but at least two: those that try to describe music in a certain context and those that try to define music in all contexts. I suppose I'm even more guilty of Costello's criticism, since often I not only write about music itself (as in my recent Amy Winehouse or Sharon Jones books) but I go so far as to write about people who write about music. Thus, writing about writing about sounds: a double offense as far as Costello's credo goes.
Two good examples of these two kinds of books would be a couple of favourites of mine. Alex Ross (music critic of The New Yorker) in his 2008 book The Rest Is Noise: Listening to the Twentieth Century did a great job of helping listeners understand how and why our very concepts of what made musical forms change so drastically during the early days of the last century. He chose the descriptive method (what the ancient Greeks called ekphrasis) to evoke a feeling in the reader that approximated his own experience of the works under examination. I share that approach.
The other approach is parallel in its motivation (to increase appreciation for listening) but opposite in its technique (grappling with a definition for how music is made in the first place and how we experience it regardless of what styles we might lean toward). This is the approach taken so effectively in Comparing Notes, in which he shares an often technical mastery of the musical arts but in a down-to-earth manner easily accessible to all those non-technical music lovers, and I'm one of them, who simply love to become engulfed by the sheer power of organized sounds. Most importantly -- as I often do in my own writing about music, even if I'm expressing some personal preference for this or that musical genre or artist -- Ockelford manages to provide an equivalence of experience for whatever musical form he's exploring. In other words, and these are solely my own examples, not his: the joy of a sax solo by Charlie Parker, or a guitar solo by Jerry Garcia, or a storm of poetry by Bob Dylan or The Beatles, or the haunted angel's voice of Scott Engel Walker, are all, at some level, completely identical to and equal to each other.
This is so simply because they all evoke in listeners whatever comprises the ideal in the musical style they happen to enjoy. And therein is one of the pleasures of this new book: he takes us on a guided tour of how human beings first recognize music, regardless of what style it's in (given his own tastes, it's often classical European music) and also why music has the impact and effect on us that it does. He also shares with the reader the outcomes of his long personal and professional history as a means of providing an intimate entry into a potentially daunting agenda: explaining what music is by exploring what it does.
The author is a Professor of Music at Roehampton University in London, where he directs the Applied Music Research Centre, and he has also written an amazing study of innate musical gifts in In the Key of Genius, his biography of the so-called savant Derek Paravincini. A musicologist, composer and teacher himself, his early-career discoveries while he was working with perceptually challenged children altered forever the way he viewed both creativity and music knowledge. That is what he shares with us in his attempt to "make sense of music."
In a sense, his new book is also a chronicle of his own encounters with extraordinary musical talents, one which demystifies the entire sonic art form itself while also offering us surprising insights into our own pre-verbal, non-literate origins as sentient beings. The result is a remarkably readable book on a demanding subject which he makes a pleasure by extracting the core elements and issues out of musical theory, all the while not appearing overly theoretical. He helps us to learn about the key psychological, neurological and spiritual elements without being encumbered by an ongoing awareness that we are in fact leaning anything at all.
One of the key cornerstones of his book is the somewhat surprising notion that all of us, by the very nature of our cognition as thinking and feeling animals, are innately musical, that we can all respond to music without any training or instruction, largely because it belongs to our inherent intuitive frameworks. In essence, his lively book, in itself a culmination of many years of research and operating as a layman's summary of his several earlier publications, demonstrates just how abstract patterns of sound that might not appear to mean anything at all can in fact be so meaningful as to move us to tears. One of the ways he does this is to take us through many convergent twentieth-century musical theories, cogently explaining each, while also sharing his remarkable personal experiences with the students who became his teachers. As he puts it, "The vivid nature of perception – crucial for both our functioning and our survival – beguiles us into thinking that music exists beyond ourselves in a material way." On the contrary, as he points out, it starts out within us: "From pitch and rhythm to dynamics, all the elements of music cohere through the principle of imitation to create an abstract narrative in sound that we instinctively grasp, whether listening to Bach or to the Beatles." Therefore the book is ideal and essential reading for anyone who has ever loved a song, a sonata, a symphony, or a jazz composition, and wondered why. In fact, the book is all about those two things: the why and the wonderment.
The author assisting a young protégé, from whom he admitted to learning immensely more about the essence of musical engagement than in all his former years of scholarly music study. (Photo: Getty)
"How the human brain learnt that musical sounds should be processed in a particular way, in our development as individuals and in our evolution as a species, is clearly a crucial question." He asks and answers the question in a masterful manner, by exploring the notion of a special form of perceived relationship among sounds, a type of mental connection that makes music what it is by operating as a cognitive link between sounds through which a sensation of intentional repetition is formed. This link he illuminates is what he calls zygonic, from the Greek root word zygo, which refers to a yoke, a union in the presence of two similar things, in this case of two recurring musical notes contrasting with an ongoing series of others that is suspended metaphorically in the mind of the musical listener. It is not nearly as exotic or mystical as it might seem: it simply designates, perceptually and cognitively, why we end up being blissed out by either a shimmering Bach concerto or The Beatles' brilliant virtuosity (and versatility) on an album such as their 1966 masterpiece Revolver.
For the right kind of listener, one attuned to the subtlety of the sonic experience, The Goldberg Variations, for example, should be just as emotionally transporting as "Eleanor Rigby." As you might expect, or should have suspected by now by my appreciation of his writing, it is possible to superimpose a recording of the Goldberg composition over that elegant Revolver song and discover that they are identical in form and content, as different as they might appear on the surface separately. Don't take my word for it; try it yourself at home. The results will stun you. Ockelford's earlier book on an exceptional musical prodigy offers us a perfect entry into the thought-flow of his current area of interest (what is music?), and indeed he references it crucially in the prelude to Comparing Notes. In his introduction, titled "Insights from the Blind," the author describes his three-and-a-half-decade-long search for answers to the question of what music means and how we make sense of it by sharing his early volunteer work at Linden Lodge, a residential special needs school in the late 70's. All of the students were blind and many had developmental challenges or disabilities, including aberrant language limits, so he was told not to have high expectations of their capacities.
Having spent ages analyzing complex musical scores from Beethoven's late sonatas to Bartok's early adventures, he was fairly confident in his own knowledge and equally comfortable trying to engage the children at the most elementary levels of entry into musical reality. But as he was being shown around by an administrator, he entered a dimly-lit room from which what sounded like mid-twentieth-century avant-garde compositions were wafting. He was spooked by the eerie aura. When his guide switched on the light, Ockelford was stunned to see not some sophisticated adult tickling the ivories but rather a tiny blind boy about 10 years old who did not speak or otherwise engage with people at all. Still stunned and hearing the echoes of what sounded like complicated Scriabin textures, he was asked by the guide to play something for the boy. From his lofty academic tower, the author decided to play the quirky opening of Liszt's Piano Sonata in B Minor, thinking it might capture the wayward attention of the young listener.
After standing with rapt attention for a few minutes while Ockelford played the piece, the young boy, who seemed otherwise utterly detached from his environment, moved towards the instrument. The author was nervous that his demonstration hadn't gone down well with the boy, but, as he himself puts it, "What happened next was to change forever the way I thought about music." The boy began to play the piece, note for note, as he had heard it, without having heard it before, without the ability to read, without knowing anything about Liszt at all.
He played it over again from memory: "Just like a recording, flawlessly. It was uncanny. How was it possible for a boy who was blind, and, I assumed from his lack of verbal communication, had learning disabilities, to reproduce the introduction naturally, fluently, without prompting? It wasn't merely that the notes were correct: he seemed to have an effortless, mature understanding of the music, with an intuitive feel for the unfolding emotional narrative. I knew that in spite of all my advanced musical training and thousands of fours of practice, I would have struggled to do what Anthony had just achieved, apparently with little or no effort at all."
Thus began his true tutoring in music at the tender hands of young people who couldn't even describe or discuss what it was they were doing so artfully and effortlessly. To do so, he guides us through the fascinating jungle of how music "works." The map of the sonic territory he covers along the way is both informative and entertaining, without being overly pedantic or highly technical (except for the occasional foray into some useful cognitive and neuroscience intersections with art and culture). "The notion of a special perceived relationship between sounds – a type of mental connection between notes that makes music what it is – is, by definition, abstract, and so runs the risk of being somewhat fuzzy in conceptual terms." Ockelford has done a great service in helping us to understand, whether we like African trance drumming, Duke Ellington's subtle piano or Jimi Hendrix's raw electrical energy, how it is that we construct musical meaning.
It's fair to say, I suspect, that at that early epiphany-like moment when he encountered a young true musical genius playing in an almost dark room in a school for the supposedly disabled, Adam Ockelford suddenly realized, as if in the midst of a meditative illumination, that there was indeed much more to music than what met the ear. It was then that he also decided that "through the prism of the overtly remarkable, we can discover the uncelebrated exceptionality lurking in each of us." Luckily for us, in Comparing Notes, he takes us on an incredible journey into the very heart and soul, even the guts, of what music, music-making and music appreciation are all about. There is a love affair among composing, performing and listening to music in which all of us can readily participate. Whether or not we can actually comprehend why we might cry while hearing Billie Holiday or Amy Winehouse, or why we feel the need to jump up and twitch around while hearing James Brown or Sharon Jones, the answer is simple: because.
– Donald Brackett is a Vancouver-based popular culture journalist and curator who writes about music, art and films. He has been the Executive Director of both the Professional Art Dealers Association of Canada and The Ontario Association of Art Galleries. He is the author of the book Back to Black: Amy Winehouse's Only Masterpiece (Backbeat Books, 2016). In addition to numerous essays, articles and radio broadcasts, he is also the author of two books on creative collaboration in pop music: Fleetwood Mac: 40 Years of Creative Chaos, 2007, and Dark Mirror: The Pathology of the Singer-Songwriter, 2008, and is a frequent curator of film programs for Pacific Cinematheque. His current work in progress is a new book called Long Slow Train: The Soul Music of Sharon Jones and The Dap-Kings, being released by Backbeat Books in Fall 2018.
Labels: Books, Donald Brackett, Music
Juliet, Naked: Getting it Right
Against All Odds: Into the Breach
Accurate Sounds – Robert Hilburn's Paul Simon: The...
Neglected Gem: Blunt Force Trauma (2015)
Unfollowed: Bo Burnham's Eighth Grade
Podcast: Interview with Judith Marcuse (1982)


text:
Transgender bathroom debate comes to campus
Nyemike Okonkwo
UTD L.E.A.P.
Chad Austin
Assistant Graphics Editor
SG installs neutral bathroom signage, members of UTD LGBT community respond to national policies
Student Government joined with a committee on campus to construct an initiative to update restroom signage across campus to be more inclusive of transgender needs.
The UTD LGBTQ Education, Advocacy and Programming Committee helped SG with the signage updates, which are expected to be completed by the end of the summer.
Student Government Senator Grant Branam was integral in the drafting of the initiative and encouraged the development of signage designed to service a wide variety of students.
"The ultimate goal is to be inclusive to all students," Branam said. "If transgender students do not feel comfortable using the communal restrooms on campus, the singular space is safer. They can go there without the fear of judgment or harassment."
UTD's efforts to include more gender-neutral signage fits into the current national discussion over transgender rights.
On May 13, the Obama administration issued guidance to public schools across the nation outlining policies that allow transgender students to use the bathroom corresponding to their gender identity. The Department of Justice and the Department of Education issued a joint letter to public schools reflecting the President's stance saying, "transgender students enjoy a supportive and nondiscriminatory school environment."
Although the president's guidelines do not carry the full force of law, Cody Kuhn, Rainbow Guard's vice president, views the action as a positive.
"It's definitely a step forward," he said. "It's definitely a significant document that legislatures will point to in the future while making policy about trans bathroom use."
Additionally, the Obama administration has threatened to withhold funding for public schools if the state does not abide with the directives.
"If you're going to use federal money, you have to follow federal policy," Kuhn said.
The actions of the executive branch have caused uproar in many states, including Texas. On May 9, Texas Lt. Gov. Dan Patrick recently called for the resignation of Fort Worth ISD superintendent Kent Scribner for proposing policies more inclusive of transgender students, arguing that the policies were created unilaterally and lack transparency. Because there were no public hearings, forums or meetings with parents during the formation of those guidelines, segments of Fort Worth residents strongly criticized Scribner's policy.
"Even if the majority of the community doesn't want (transgender bathroom equality), trans students are being hurt," Kuhn said about community involvement on transgender rights.
On May 17, Gov. Greg Abbott tweeted that Texas will sue the federal government to "stop Obama's transgender directive to schools," and challenge how President Obama is "trampling" on the Constitution.
"This is the same type of cultural resentment and bigotry that's been present since this nation was founded," Adam Richards, Wesley at UTD president, said about the governor's comments. "It is something people haven't really thought about and don't really understand and are having a knee jerk reaction to it in this cultural moment."
Richards said transgender people have been using the restroom of their choice long before the debate gained attention, and since the LGBT community receives the majority of its support from the political left, he said this is an opportunity for the political right to raise the party platform.
"This is a solution in search of a problem based upon irrational fears because this is some poll-tested thing that (raises) GOP voter turnout," Richards said.
Gender-neutral bathrooms1 Grant Branam4 LGBT rights11 Student Government31 Transgender bathrooms1
International students struggle for work permit
Entrepreneurial program comes to campus next fall
Angel Staten
I am all for gender neutral single stall restrooms which have been labeled as family restrooms in the past. These restrooms provide a safe space for those in the LGBTQ community as well as for mothers with sons and fathers with daughters. They also provide a plausible solution for the horrific acts we have seen since the publicizing of this issue. http://www.breitbart.com/big-government/2016/04/23/twenty-stories-proving-targets-pro-transgender-bathroom-policy-danger-women-children/ In cases like these, the laws of a society dictate that the preference be given to the good of the many, and to defending the innocent. I ask that we make strides and come together to find creative… Read more »


text:
id: 5e8f2f13c4cdbe86b5c72da1
title: 'Natural Language Processing With RNNs: Building the Model'
challengeType: 11
videoId: 32WBFS7lfsw
dashedName: natural-language-processing-with-rnns-building-the-model
---

# --question--

## --text--

Fill in the blanks below to complete the `build_model` function:

```py
def build_mode(vocab_size, embedding_dim, rnn_units, batch_size):
    model = tf.keras.Sequential([
        tf.keras.layers.Embedding(vocab_size,
                                  embedding_dim,
                                  batch_input_shape=[batch_size, None]),
        tf.keras.layers.__A__(rnn_units,
                              return_sequences=__B__,
                              recurrent_initializer='glorot_uniform),
        tf.keras.layers.Dense(__C__)
    ])
    __D__
```

## --answers--

A: `ELU`

B: `True`

C: `vocab_size`

D: `return model`

---

A: `LSTM`

B: `False`

C: `batch_size`

D: `return model`

---

A: `LSTM`

B: `True`

C: `vocab_size`

D: `return model`

## --video-solution--

3

redpajama_set_name: RedPajamaGithub


Jerry Sloan Joins Jeff Fisher As Second Longest Tenured Coach In His Sport To Move On In 2011, But Which Had Bigger Impact?
Home/Kevin Paul, NBA, NFL, Writers/Jerry Sloan Joins Jeff Fisher As Second Longest Tenured Coach In His Sport To Move On In 2011, But Which Had Bigger Impact?
Two weeks ago, it was announced that Jeff Fisher would no longer be the head coach of the Tennessee Titans.
Three days ago, Jerry Sloan signed a contract extension with the Utah Jazz.
A matter of hours ago, Sloan completed an about-face, and resigned, therefore ending his 23-year tenure as head coach of the Utah Jazz.
Sloan and Fisher have each officially relinquished the title of longest tenured head coach in his sport, and Sloan himself was the longest tenured head coach in all four major professional sports.
A variety of rumors have surfaced regarding Sloan's departure. The most popular topic was Sloan's rocky relationship with star point guard Deron Williams being the reason for this abrupt exit. That rumor has been adamantly denied by the Jazz.
Either way, the fiery Sloan will be sorely missed in the NBA. This news also brings positive memories of Utah teams of the past, where Karl Malone and John Stockton helped Sloan lead the Jazz to two NBA Finals appearances.
When looking back at the careers of Jerry Sloan and Jeff Fisher, to date, which coach had a bigger impact on his team and the game he coached?
Both have certainly left major impacts, but the obvious choice would point in the direction of Jerry Sloan. A few key stats help drive the Sloan choice home, most notably his one losing season during 23 years with the Jazz, two NBA Finals appearances in the late '90's and an overall career record of 1,221-803.
Fisher's numbers – a 142-120 career record, 6 playoff appearances, 6 double-digit win seasons and a close loss to the St. Louis Rams in Super Bowl XXXIV – are also quite impressive, but fail in comparison to that of Jerry Sloan.
Which Recently Departed Coach Left The Biggest Impact On His Team And Sport?
While I agree that Sloan is the hands-down winner at this point, I have to disagree about Fisher and a future in the HOF. He's still fairly young, and I think he will get back into coaching again soon, and make an impact with another franchise. I do think some day he will end up in the HOF.
This is an easy answer – Sloan. Sloan is a Hall-of-Famer, Fisher never will be.


text:
#ifndef __al_included_allegro5_astdint_h
#define __al_included_allegro5_astdint_h

/* Please only include this file from include/allegro5/internal/alconfig.h
 * and don't add more than inttypes.h/stdint.h emulation here.  Thanks.
 */

#if defined ALLEGRO_HAVE_INTTYPES_H
   #include <inttypes.h>
#elif defined ALLEGRO_HAVE_STDINT_H
   #include <stdint.h>
#elif defined ALLEGRO_I386 && defined ALLEGRO_LITTLE_ENDIAN
   #ifndef ALLEGRO_GUESS_INTTYPES_OK
      #warning Guessing the definitions of fixed-width integer types.
   #endif
   #define int8_t       signed char
   #define uint8_t      unsigned char
   #define int16_t      signed short
   #define uint16_t     unsigned short
   #define int32_t      signed int
   #define uint32_t     unsigned int

   #ifdef ALLEGRO_WINDOWS

      #ifndef _INTPTR_T_DEFINED
         #ifdef  _WIN64
            #define intptr_t __int64
         #else
            #define intptr_t int
         #endif
         #define _INTPTR_T_DEFINED
      #endif

      #ifndef _UINTPTR_T_DEFINED
         #ifdef  _WIN64
            #define uintptr_t unsigned __int64
         #else
            #define uintptr_t unsigned int
         #endif
         #define _UINTPTR_T_DEFINED
      #endif

   #else

      #define intptr_t     int32_t
      #define uintptr_t    uint32_t

   #endif

#else
   #error I dunno how to get the definitions of fixed-width integer types on your platform.  Please report this to your friendly Allegro developer.
#endif

#endif


The British government promulgated the Government of India Act on 2 August 1935.This Act envisaged an All India Federation of British Indian Provinces and Indian states and the establishment of provincial autonomy in the federating provinces. At the centre a central legislative assembly and a council of states were to be formed. The Indian princes were to be given disproportionately high representation in the two houses at the centre. The provision regarding the formation of the federation never came into operation and the new constitution was introduced only in the provinces.


Kind of fitting that my favorite band choice is the same as my choice for favorite song. There are a lot of bands that I love...but none as much as Dave Matthews Band and none for as long as DMB.
and all the albums (live and studio) between. It's the perfect music for any mood.


text:
// Copyright 2013 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "src/v8.h"

#if V8_TARGET_ARCH_ARM64

#include "src/code-stubs.h"
#include "src/cpu-profiler.h"
#include "src/log.h"
#include "src/macro-assembler.h"
#include "src/regexp-macro-assembler.h"
#include "src/regexp-stack.h"
#include "src/unicode.h"

#include "src/arm64/regexp-macro-assembler-arm64.h"

namespace v8 {
namespace internal {

#ifndef V8_INTERPRETED_REGEXP
/*
 * This assembler uses the following register assignment convention:
 * - w19     : Used to temporarely store a value before a call to C code.
 *             See CheckNotBackReferenceIgnoreCase.
 * - x20     : Pointer to the current code object (Code*),
 *             it includes the heap object tag.
 * - w21     : Current position in input, as negative offset from
 *             the end of the string. Please notice that this is
 *             the byte offset, not the character offset!
 * - w22     : Currently loaded character. Must be loaded using
 *             LoadCurrentCharacter before using any of the dispatch methods.
 * - x23     : Points to tip of backtrack stack.
 * - w24     : Position of the first character minus one: non_position_value.
 *             Used to initialize capture registers.
 * - x25     : Address at the end of the input string: input_end.
 *             Points to byte after last character in input.
 * - x26     : Address at the start of the input string: input_start.
 * - w27     : Where to start in the input string.
 * - x28     : Output array pointer.
 * - x29/fp  : Frame pointer. Used to access arguments, local variables and
 *             RegExp registers.
 * - x16/x17 : IP registers, used by assembler. Very volatile.
 * - csp     : Points to tip of C stack.
 *
 * - x0-x7   : Used as a cache to store 32 bit capture registers. These
 *             registers need to be retained every time a call to C code
 *             is done.
 *
 * The remaining registers are free for computations.
 * Each call to a public method should retain this convention.
 *
 * The stack will have the following structure:
 *
 *  Location    Name               Description
 *              (as referred to in
 *              the code)
 *
 *  - fp[104]   isolate            Address of the current isolate.
 *  - fp[96]    return_address     Secondary link/return address
 *                                 used by an exit frame if this is a
 *                                 native call.
 *  ^^^ csp when called ^^^
 *  - fp[88]    lr                 Return from the RegExp code.
 *  - fp[80]    r29                Old frame pointer (CalleeSaved).
 *  - fp[0..72] r19-r28            Backup of CalleeSaved registers.
 *  - fp[-8]    direct_call        1 => Direct call from JavaScript code.
 *                                 0 => Call through the runtime system.
 *  - fp[-16]   stack_base         High end of the memory area to use as
 *                                 the backtracking stack.
 *  - fp[-24]   output_size        Output may fit multiple sets of matches.
 *  - fp[-32]   input              Handle containing the input string.
 *  - fp[-40]   success_counter
 *  ^^^^^^^^^^^^^ From here and downwards we store 32 bit values ^^^^^^^^^^^^^
 *  - fp[-44]   register N         Capture registers initialized with
 *  - fp[-48]   register N + 1     non_position_value.
 *              ...                The first kNumCachedRegisters (N) registers
 *              ...                are cached in x0 to x7.
 *              ...                Only positions must be stored in the first
 *  -           ...                num_saved_registers_ registers.
 *  -           ...
 *  -           register N + num_registers - 1
 *  ^^^^^^^^^ csp ^^^^^^^^^
 *
 * The first num_saved_registers_ registers are initialized to point to
 * "character -1" in the string (i.e., char_size() bytes before the first
 * character of the string). The remaining registers start out as garbage.
 *
 * The data up to the return address must be placed there by the calling
 * code and the remaining arguments are passed in registers, e.g. by calling the
 * code entry as cast to a function with the signature:
 * int (*match)(String* input,
 *              int start_offset,
 *              Address input_start,
 *              Address input_end,
 *              int* output,
 *              int output_size,
 *              Address stack_base,
 *              bool direct_call = false,
 *              Address secondary_return_address,  // Only used by native call.
 *              Isolate* isolate)
 * The call is performed by NativeRegExpMacroAssembler::Execute()
 * (in regexp-macro-assembler.cc) via the CALL_GENERATED_REGEXP_CODE macro
 * in arm64/simulator-arm64.h.
 * When calling as a non-direct call (i.e., from C++ code), the return address
 * area is overwritten with the LR register by the RegExp code. When doing a
 * direct call from generated code, the return address is placed there by
 * the calling code, as in a normal exit frame.
 */

#define __ ACCESS_MASM(masm_)

RegExpMacroAssemblerARM64::RegExpMacroAssemblerARM64(
    Mode mode,
    int registers_to_save,
    Zone* zone)
    : NativeRegExpMacroAssembler(zone),
      masm_(new MacroAssembler(zone->isolate(), NULL, kRegExpCodeSize)),
      mode_(mode),
      num_registers_(registers_to_save),
      num_saved_registers_(registers_to_save),
      entry_label_(),
      start_label_(),
      success_label_(),
      backtrack_label_(),
      exit_label_() {
  __ SetStackPointer(csp);
  ASSERT_EQ(0, registers_to_save % 2);
  // We can cache at most 16 W registers in x0-x7.
  STATIC_ASSERT(kNumCachedRegisters <= 16);
  STATIC_ASSERT((kNumCachedRegisters % 2) == 0);
  __ B(&entry_label_);   // We'll write the entry code later.
  __ Bind(&start_label_);  // And then continue from here.
}

RegExpMacroAssemblerARM64::~RegExpMacroAssemblerARM64() {
  delete masm_;
  // Unuse labels in case we throw away the assembler without calling GetCode.
  entry_label_.Unuse();
  start_label_.Unuse();
  success_label_.Unuse();
  backtrack_label_.Unuse();
  exit_label_.Unuse();
  check_preempt_label_.Unuse();
  stack_overflow_label_.Unuse();
}

int RegExpMacroAssemblerARM64::stack_limit_slack()  {
  return RegExpStack::kStackLimitSlack;
}

void RegExpMacroAssemblerARM64::AdvanceCurrentPosition(int by) {
  if (by != 0) {
    __ Add(current_input_offset(),
           current_input_offset(), by * char_size());
  }
}

void RegExpMacroAssemblerARM64::AdvanceRegister(int reg, int by) {
  ASSERT((reg >= 0) && (reg < num_registers_));
  if (by != 0) {
    Register to_advance;
    RegisterState register_state = GetRegisterState(reg);
    switch (register_state) {
      case STACKED:
        __ Ldr(w10, register_location(reg));
        __ Add(w10, w10, by);
        __ Str(w10, register_location(reg));
        break;
      case CACHED_LSW:
        to_advance = GetCachedRegister(reg);
        __ Add(to_advance, to_advance, by);
        break;
      case CACHED_MSW:
        to_advance = GetCachedRegister(reg);
        __ Add(to_advance, to_advance,
               static_cast<int64_t>(by) << kWRegSizeInBits);
        break;
      default:
        UNREACHABLE();
        break;
    }
  }
}

void RegExpMacroAssemblerARM64::Backtrack() {
  CheckPreemption();
  Pop(w10);
  __ Add(x10, code_pointer(), Operand(w10, UXTW));
  __ Br(x10);
}

void RegExpMacroAssemblerARM64::Bind(Label* label) {
  __ Bind(label);
}

void RegExpMacroAssemblerARM64::CheckCharacter(uint32_t c, Label* on_equal) {
  CompareAndBranchOrBacktrack(current_character(), c, eq, on_equal);
}

void RegExpMacroAssemblerARM64::CheckCharacterGT(uc16 limit,
                                                 Label* on_greater) {
  CompareAndBranchOrBacktrack(current_character(), limit, hi, on_greater);
}

void RegExpMacroAssemblerARM64::CheckAtStart(Label* on_at_start) {
  Label not_at_start;
  // Did we start the match at the start of the input string?
  CompareAndBranchOrBacktrack(start_offset(), 0, ne, &not_at_start);
  // If we did, are we still at the start of the input string?
  __ Add(x10, input_end(), Operand(current_input_offset(), SXTW));
  __ Cmp(x10, input_start());
  BranchOrBacktrack(eq, on_at_start);
  __ Bind(&not_at_start);
}

void RegExpMacroAssemblerARM64::CheckNotAtStart(Label* on_not_at_start) {
  // Did we start the match at the start of the input string?
  CompareAndBranchOrBacktrack(start_offset(), 0, ne, on_not_at_start);
  // If we did, are we still at the start of the input string?
  __ Add(x10, input_end(), Operand(current_input_offset(), SXTW));
  __ Cmp(x10, input_start());
  BranchOrBacktrack(ne, on_not_at_start);
}

void RegExpMacroAssemblerARM64::CheckCharacterLT(uc16 limit, Label* on_less) {
  CompareAndBranchOrBacktrack(current_character(), limit, lo, on_less);
}

void RegExpMacroAssemblerARM64::CheckCharacters(Vector<const uc16> str,
                                              int cp_offset,
                                              Label* on_failure,
                                              bool check_end_of_string) {
  // This method is only ever called from the cctests.

  if (check_end_of_string) {
    // Is last character of required match inside string.
    CheckPosition(cp_offset + str.length() - 1, on_failure);
  }

  Register characters_address = x11;

  __ Add(characters_address,
         input_end(),
         Operand(current_input_offset(), SXTW));
  if (cp_offset != 0) {
    __ Add(characters_address, characters_address, cp_offset * char_size());
  }

  for (int i = 0; i < str.length(); i++) {
    if (mode_ == ASCII) {
      __ Ldrb(w10, MemOperand(characters_address, 1, PostIndex));
      ASSERT(str[i] <= String::kMaxOneByteCharCode);
    } else {
      __ Ldrh(w10, MemOperand(characters_address, 2, PostIndex));
    }
    CompareAndBranchOrBacktrack(w10, str[i], ne, on_failure);
  }
}

void RegExpMacroAssemblerARM64::CheckGreedyLoop(Label* on_equal) {
  __ Ldr(w10, MemOperand(backtrack_stackpointer()));
  __ Cmp(current_input_offset(), w10);
  __ Cset(x11, eq);
  __ Add(backtrack_stackpointer(),
         backtrack_stackpointer(), Operand(x11, LSL, kWRegSizeLog2));
  BranchOrBacktrack(eq, on_equal);
}

void RegExpMacroAssemblerARM64::CheckNotBackReferenceIgnoreCase(
    int start_reg,
    Label* on_no_match) {
  Label fallthrough;

  Register capture_start_offset = w10;
  // Save the capture length in a callee-saved register so it will
  // be preserved if we call a C helper.
  Register capture_length = w19;
  ASSERT(kCalleeSaved.IncludesAliasOf(capture_length));

  // Find length of back-referenced capture.
  ASSERT((start_reg % 2) == 0);
  if (start_reg < kNumCachedRegisters) {
    __ Mov(capture_start_offset.X(), GetCachedRegister(start_reg));
    __ Lsr(x11, GetCachedRegister(start_reg), kWRegSizeInBits);
  } else {
    __ Ldp(w11, capture_start_offset, capture_location(start_reg, x10));
  }
  __ Sub(capture_length, w11, capture_start_offset);  // Length to check.
  // Succeed on empty capture (including no capture).
  __ Cbz(capture_length, &fallthrough);

  // Check that there are enough characters left in the input.
  __ Cmn(capture_length, current_input_offset());
  BranchOrBacktrack(gt, on_no_match);

  if (mode_ == ASCII) {
    Label success;
    Label fail;
    Label loop_check;

    Register capture_start_address = x12;
    Register capture_end_addresss = x13;
    Register current_position_address = x14;

    __ Add(capture_start_address,
           input_end(),
           Operand(capture_start_offset, SXTW));
    __ Add(capture_end_addresss,
           capture_start_address,
           Operand(capture_length, SXTW));
    __ Add(current_position_address,
           input_end(),
           Operand(current_input_offset(), SXTW));

    Label loop;
    __ Bind(&loop);
    __ Ldrb(w10, MemOperand(capture_start_address, 1, PostIndex));
    __ Ldrb(w11, MemOperand(current_position_address, 1, PostIndex));
    __ Cmp(w10, w11);
    __ B(eq, &loop_check);

    // Mismatch, try case-insensitive match (converting letters to lower-case).
    __ Orr(w10, w10, 0x20);  // Convert capture character to lower-case.
    __ Orr(w11, w11, 0x20);  // Also convert input character.
    __ Cmp(w11, w10);
    __ B(ne, &fail);
    __ Sub(w10, w10, 'a');
    __ Cmp(w10, 'z' - 'a');  // Is w10 a lowercase letter?
    __ B(ls, &loop_check);  // In range 'a'-'z'.
    // Latin-1: Check for values in range [224,254] but not 247.
    __ Sub(w10, w10, 224 - 'a');
    __ Cmp(w10, 254 - 224);
    __ Ccmp(w10, 247 - 224, ZFlag, ls);  // Check for 247.
    __ B(eq, &fail);  // Weren't Latin-1 letters.

    __ Bind(&loop_check);
    __ Cmp(capture_start_address, capture_end_addresss);
    __ B(lt, &loop);
    __ B(&success);

    __ Bind(&fail);
    BranchOrBacktrack(al, on_no_match);

    __ Bind(&success);
    // Compute new value of character position after the matched part.
    __ Sub(current_input_offset().X(), current_position_address, input_end());
    if (masm_->emit_debug_code()) {
      __ Cmp(current_input_offset().X(), Operand(current_input_offset(), SXTW));
      __ Ccmp(current_input_offset(), 0, NoFlag, eq);
      // The current input offset should be <= 0, and fit in a W register.
      __ Check(le, kOffsetOutOfRange);
    }
  } else {
    ASSERT(mode_ == UC16);
    int argument_count = 4;

    // The cached registers need to be retained.
    CPURegList cached_registers(CPURegister::kRegister, kXRegSizeInBits, 0, 7);
    ASSERT((cached_registers.Count() * 2) == kNumCachedRegisters);
    __ PushCPURegList(cached_registers);

    // Put arguments into arguments registers.
    // Parameters are
    //   x0: Address byte_offset1 - Address captured substring's start.
    //   x1: Address byte_offset2 - Address of current character position.
    //   w2: size_t byte_length - length of capture in bytes(!)
    //   x3: Isolate* isolate

    // Address of start of capture.
    __ Add(x0, input_end(), Operand(capture_start_offset, SXTW));
    // Length of capture.
    __ Mov(w2, capture_length);
    // Address of current input position.
    __ Add(x1, input_end(), Operand(current_input_offset(), SXTW));
    // Isolate.
    __ Mov(x3, ExternalReference::isolate_address(isolate()));

    {
      AllowExternalCallThatCantCauseGC scope(masm_);
      ExternalReference function =
          ExternalReference::re_case_insensitive_compare_uc16(isolate());
      __ CallCFunction(function, argument_count);
    }

    // Check if function returned non-zero for success or zero for failure.
    CompareAndBranchOrBacktrack(x0, 0, eq, on_no_match);
    // On success, increment position by length of capture.
    __ Add(current_input_offset(), current_input_offset(), capture_length);
    // Reset the cached registers.
    __ PopCPURegList(cached_registers);
  }

  __ Bind(&fallthrough);
}

void RegExpMacroAssemblerARM64::CheckNotBackReference(
    int start_reg,
    Label* on_no_match) {
  Label fallthrough;

  Register capture_start_address = x12;
  Register capture_end_address = x13;
  Register current_position_address = x14;
  Register capture_length = w15;

  // Find length of back-referenced capture.
  ASSERT((start_reg % 2) == 0);
  if (start_reg < kNumCachedRegisters) {
    __ Mov(x10, GetCachedRegister(start_reg));
    __ Lsr(x11, GetCachedRegister(start_reg), kWRegSizeInBits);
  } else {
    __ Ldp(w11, w10, capture_location(start_reg, x10));
  }
  __ Sub(capture_length, w11, w10);  // Length to check.
  // Succeed on empty capture (including no capture).
  __ Cbz(capture_length, &fallthrough);

  // Check that there are enough characters left in the input.
  __ Cmn(capture_length, current_input_offset());
  BranchOrBacktrack(gt, on_no_match);

  // Compute pointers to match string and capture string
  __ Add(capture_start_address, input_end(), Operand(w10, SXTW));
  __ Add(capture_end_address,
         capture_start_address,
         Operand(capture_length, SXTW));
  __ Add(current_position_address,
         input_end(),
         Operand(current_input_offset(), SXTW));

  Label loop;
  __ Bind(&loop);
  if (mode_ == ASCII) {
    __ Ldrb(w10, MemOperand(capture_start_address, 1, PostIndex));
    __ Ldrb(w11, MemOperand(current_position_address, 1, PostIndex));
  } else {
    ASSERT(mode_ == UC16);
    __ Ldrh(w10, MemOperand(capture_start_address, 2, PostIndex));
    __ Ldrh(w11, MemOperand(current_position_address, 2, PostIndex));
  }
  __ Cmp(w10, w11);
  BranchOrBacktrack(ne, on_no_match);
  __ Cmp(capture_start_address, capture_end_address);
  __ B(lt, &loop);

  // Move current character position to position after match.
  __ Sub(current_input_offset().X(), current_position_address, input_end());
  if (masm_->emit_debug_code()) {
    __ Cmp(current_input_offset().X(), Operand(current_input_offset(), SXTW));
    __ Ccmp(current_input_offset(), 0, NoFlag, eq);
    // The current input offset should be <= 0, and fit in a W register.
    __ Check(le, kOffsetOutOfRange);
  }
  __ Bind(&fallthrough);
}

void RegExpMacroAssemblerARM64::CheckNotCharacter(unsigned c,
                                                  Label* on_not_equal) {
  CompareAndBranchOrBacktrack(current_character(), c, ne, on_not_equal);
}

void RegExpMacroAssemblerARM64::CheckCharacterAfterAnd(uint32_t c,
                                                       uint32_t mask,
                                                       Label* on_equal) {
  __ And(w10, current_character(), mask);
  CompareAndBranchOrBacktrack(w10, c, eq, on_equal);
}

void RegExpMacroAssemblerARM64::CheckNotCharacterAfterAnd(unsigned c,
                                                          unsigned mask,
                                                          Label* on_not_equal) {
  __ And(w10, current_character(), mask);
  CompareAndBranchOrBacktrack(w10, c, ne, on_not_equal);
}

void RegExpMacroAssemblerARM64::CheckNotCharacterAfterMinusAnd(
    uc16 c,
    uc16 minus,
    uc16 mask,
    Label* on_not_equal) {
  ASSERT(minus < String::kMaxUtf16CodeUnit);
  __ Sub(w10, current_character(), minus);
  __ And(w10, w10, mask);
  CompareAndBranchOrBacktrack(w10, c, ne, on_not_equal);
}

void RegExpMacroAssemblerARM64::CheckCharacterInRange(
    uc16 from,
    uc16 to,
    Label* on_in_range) {
  __ Sub(w10, current_character(), from);
  // Unsigned lower-or-same condition.
  CompareAndBranchOrBacktrack(w10, to - from, ls, on_in_range);
}

void RegExpMacroAssemblerARM64::CheckCharacterNotInRange(
    uc16 from,
    uc16 to,
    Label* on_not_in_range) {
  __ Sub(w10, current_character(), from);
  // Unsigned higher condition.
  CompareAndBranchOrBacktrack(w10, to - from, hi, on_not_in_range);
}

void RegExpMacroAssemblerARM64::CheckBitInTable(
    Handle<ByteArray> table,
    Label* on_bit_set) {
  __ Mov(x11, Operand(table));
  if ((mode_ != ASCII) || (kTableMask != String::kMaxOneByteCharCode)) {
    __ And(w10, current_character(), kTableMask);
    __ Add(w10, w10, ByteArray::kHeaderSize - kHeapObjectTag);
  } else {
    __ Add(w10, current_character(), ByteArray::kHeaderSize - kHeapObjectTag);
  }
  __ Ldrb(w11, MemOperand(x11, w10, UXTW));
  CompareAndBranchOrBacktrack(w11, 0, ne, on_bit_set);
}

bool RegExpMacroAssemblerARM64::CheckSpecialCharacterClass(uc16 type,
                                                           Label* on_no_match) {
  // Range checks (c in min..max) are generally implemented by an unsigned
  // (c - min) <= (max - min) check
  switch (type) {
  case 's':
    // Match space-characters
    if (mode_ == ASCII) {
      // One byte space characters are '\t'..'\r', ' ' and \u00a0.
      Label success;
      // Check for ' ' or 0x00a0.
      __ Cmp(current_character(), ' ');
      __ Ccmp(current_character(), 0x00a0, ZFlag, ne);
      __ B(eq, &success);
      // Check range 0x09..0x0d.
      __ Sub(w10, current_character(), '\t');
      CompareAndBranchOrBacktrack(w10, '\r' - '\t', hi, on_no_match);
      __ Bind(&success);
      return true;
    }
    return false;
  case 'S':
    // The emitted code for generic character classes is good enough.
    return false;
  case 'd':
    // Match ASCII digits ('0'..'9').
    __ Sub(w10, current_character(), '0');
    CompareAndBranchOrBacktrack(w10, '9' - '0', hi, on_no_match);
    return true;
  case 'D':
    // Match ASCII non-digits.
    __ Sub(w10, current_character(), '0');
    CompareAndBranchOrBacktrack(w10, '9' - '0', ls, on_no_match);
    return true;
  case '.': {
    // Match non-newlines (not 0x0a('\n'), 0x0d('\r'), 0x2028 and 0x2029)
    // Here we emit the conditional branch only once at the end to make branch
    // prediction more efficient, even though we could branch out of here
    // as soon as a character matches.
    __ Cmp(current_character(), 0x0a);
    __ Ccmp(current_character(), 0x0d, ZFlag, ne);
    if (mode_ == UC16) {
      __ Sub(w10, current_character(), 0x2028);
      // If the Z flag was set we clear the flags to force a branch.
      __ Ccmp(w10, 0x2029 - 0x2028, NoFlag, ne);
      // ls -> !((C==1) && (Z==0))
      BranchOrBacktrack(ls, on_no_match);
    } else {
      BranchOrBacktrack(eq, on_no_match);
    }
    return true;
  }
  case 'n': {
    // Match newlines (0x0a('\n'), 0x0d('\r'), 0x2028 and 0x2029)
    // We have to check all 4 newline characters before emitting
    // the conditional branch.
    __ Cmp(current_character(), 0x0a);
    __ Ccmp(current_character(), 0x0d, ZFlag, ne);
    if (mode_ == UC16) {
      __ Sub(w10, current_character(), 0x2028);
      // If the Z flag was set we clear the flags to force a fall-through.
      __ Ccmp(w10, 0x2029 - 0x2028, NoFlag, ne);
      // hi -> (C==1) && (Z==0)
      BranchOrBacktrack(hi, on_no_match);
    } else {
      BranchOrBacktrack(ne, on_no_match);
    }
    return true;
  }
  case 'w': {
    if (mode_ != ASCII) {
      // Table is 128 entries, so all ASCII characters can be tested.
      CompareAndBranchOrBacktrack(current_character(), 'z', hi, on_no_match);
    }
    ExternalReference map = ExternalReference::re_word_character_map();
    __ Mov(x10, map);
    __ Ldrb(w10, MemOperand(x10, current_character(), UXTW));
    CompareAndBranchOrBacktrack(w10, 0, eq, on_no_match);
    return true;
  }
  case 'W': {
    Label done;
    if (mode_ != ASCII) {
      // Table is 128 entries, so all ASCII characters can be tested.
      __ Cmp(current_character(), 'z');
      __ B(hi, &done);
    }
    ExternalReference map = ExternalReference::re_word_character_map();
    __ Mov(x10, map);
    __ Ldrb(w10, MemOperand(x10, current_character(), UXTW));
    CompareAndBranchOrBacktrack(w10, 0, ne, on_no_match);
    __ Bind(&done);
    return true;
  }
  case '*':
    // Match any character.
    return true;
  // No custom implementation (yet): s(UC16), S(UC16).
  default:
    return false;
  }
}

void RegExpMacroAssemblerARM64::Fail() {
  __ Mov(w0, FAILURE);
  __ B(&exit_label_);
}

Handle<HeapObject> RegExpMacroAssemblerARM64::GetCode(Handle<String> source) {
  Label return_w0;
  // Finalize code - write the entry point code now we know how many
  // registers we need.

  // Entry code:
  __ Bind(&entry_label_);

  // Arguments on entry:
  // x0:  String*  input
  // x1:  int      start_offset
  // x2:  byte*    input_start
  // x3:  byte*    input_end
  // x4:  int*     output array
  // x5:  int      output array size
  // x6:  Address  stack_base
  // x7:  int      direct_call

  // The stack pointer should be csp on entry.
  //  csp[8]:  address of the current isolate
  //  csp[0]:  secondary link/return address used by native call

  // Tell the system that we have a stack frame.  Because the type is MANUAL, no
  // code is generated.
  FrameScope scope(masm_, StackFrame::MANUAL);

  // Push registers on the stack, only push the argument registers that we need.
  CPURegList argument_registers(x0, x5, x6, x7);

  CPURegList registers_to_retain = kCalleeSaved;
  ASSERT(kCalleeSaved.Count() == 11);
  registers_to_retain.Combine(lr);

  ASSERT(csp.Is(__ StackPointer()));
  __ PushCPURegList(registers_to_retain);
  __ PushCPURegList(argument_registers);

  // Set frame pointer in place.
  __ Add(frame_pointer(), csp, argument_registers.Count() * kPointerSize);

  // Initialize callee-saved registers.
  __ Mov(start_offset(), w1);
  __ Mov(input_start(), x2);
  __ Mov(input_end(), x3);
  __ Mov(output_array(), x4);

  // Set the number of registers we will need to allocate, that is:
  //   - success_counter (X register)
  //   - (num_registers_ - kNumCachedRegisters) (W registers)
  int num_wreg_to_allocate = num_registers_ - kNumCachedRegisters;
  // Do not allocate registers on the stack if they can all be cached.
  if (num_wreg_to_allocate < 0) { num_wreg_to_allocate = 0; }
  // Make room for the success_counter.
  num_wreg_to_allocate += 2;

  // Make sure the stack alignment will be respected.
  int alignment = masm_->ActivationFrameAlignment();
  ASSERT_EQ(alignment % 16, 0);
  int align_mask = (alignment / kWRegSize) - 1;
  num_wreg_to_allocate = (num_wreg_to_allocate + align_mask) & ~align_mask;

  // Check if we have space on the stack.
  Label stack_limit_hit;
  Label stack_ok;

  ExternalReference stack_limit =
      ExternalReference::address_of_stack_limit(isolate());
  __ Mov(x10, stack_limit);
  __ Ldr(x10, MemOperand(x10));
  __ Subs(x10, csp, x10);

  // Handle it if the stack pointer is already below the stack limit.
  __ B(ls, &stack_limit_hit);

  // Check if there is room for the variable number of registers above
  // the stack limit.
  __ Cmp(x10, num_wreg_to_allocate * kWRegSize);
  __ B(hs, &stack_ok);

  // Exit with OutOfMemory exception. There is not enough space on the stack
  // for our working registers.
  __ Mov(w0, EXCEPTION);
  __ B(&return_w0);

  __ Bind(&stack_limit_hit);
  CallCheckStackGuardState(x10);
  // If returned value is non-zero, we exit with the returned value as result.
  __ Cbnz(w0, &return_w0);

  __ Bind(&stack_ok);

  // Allocate space on stack.
  __ Claim(num_wreg_to_allocate, kWRegSize);

  // Initialize success_counter with 0.
  __ Str(wzr, MemOperand(frame_pointer(), kSuccessCounter));

  // Find negative length (offset of start relative to end).
  __ Sub(x10, input_start(), input_end());
  if (masm_->emit_debug_code()) {
    // Check that the input string length is < 2^30.
    __ Neg(x11, x10);
    __ Cmp(x11, (1<<30) - 1);
    __ Check(ls, kInputStringTooLong);
  }
  __ Mov(current_input_offset(), w10);

  // The non-position value is used as a clearing value for the
  // capture registers, it corresponds to the position of the first character
  // minus one.
  __ Sub(non_position_value(), current_input_offset(), char_size());
  __ Sub(non_position_value(), non_position_value(),
         Operand(start_offset(), LSL, (mode_ == UC16) ? 1 : 0));
  // We can store this value twice in an X register for initializing
  // on-stack registers later.
  __ Orr(twice_non_position_value(),
         non_position_value().X(),
         Operand(non_position_value().X(), LSL, kWRegSizeInBits));

  // Initialize code pointer register.
  __ Mov(code_pointer(), Operand(masm_->CodeObject()));

  Label load_char_start_regexp, start_regexp;
  // Load newline if index is at start, previous character otherwise.
  __ Cbnz(start_offset(), &load_char_start_regexp);
  __ Mov(current_character(), '\n');
  __ B(&start_regexp);

  // Global regexp restarts matching here.
  __ Bind(&load_char_start_regexp);
  // Load previous char as initial value of current character register.
  LoadCurrentCharacterUnchecked(-1, 1);
  __ Bind(&start_regexp);
  // Initialize on-stack registers.
  if (num_saved_registers_ > 0) {
    ClearRegisters(0, num_saved_registers_ - 1);
  }

  // Initialize backtrack stack pointer.
  __ Ldr(backtrack_stackpointer(), MemOperand(frame_pointer(), kStackBase));

  // Execute
  __ B(&start_label_);

  if (backtrack_label_.is_linked()) {
    __ Bind(&backtrack_label_);
    Backtrack();
  }

  if (success_label_.is_linked()) {
    Register first_capture_start = w15;

    // Save captures when successful.
    __ Bind(&success_label_);

    if (num_saved_registers_ > 0) {
      // V8 expects the output to be an int32_t array.
      Register capture_start = w12;
      Register capture_end = w13;
      Register input_length = w14;

      // Copy captures to output.

      // Get string length.
      __ Sub(x10, input_end(), input_start());
      if (masm_->emit_debug_code()) {
        // Check that the input string length is < 2^30.
        __ Cmp(x10, (1<<30) - 1);
        __ Check(ls, kInputStringTooLong);
      }
      // input_start has a start_offset offset on entry. We need to include
      // it when computing the length of the whole string.
      if (mode_ == UC16) {
        __ Add(input_length, start_offset(), Operand(w10, LSR, 1));
      } else {
        __ Add(input_length, start_offset(), w10);
      }

      // Copy the results to the output array from the cached registers first.
      for (int i = 0;
           (i < num_saved_registers_) && (i < kNumCachedRegisters);
           i += 2) {
        __ Mov(capture_start.X(), GetCachedRegister(i));
        __ Lsr(capture_end.X(), capture_start.X(), kWRegSizeInBits);
        if ((i == 0) && global_with_zero_length_check()) {
          // Keep capture start for the zero-length check later.
          __ Mov(first_capture_start, capture_start);
        }
        // Offsets need to be relative to the start of the string.
        if (mode_ == UC16) {
          __ Add(capture_start, input_length, Operand(capture_start, ASR, 1));
          __ Add(capture_end, input_length, Operand(capture_end, ASR, 1));
        } else {
          __ Add(capture_start, input_length, capture_start);
          __ Add(capture_end, input_length, capture_end);
        }
        // The output pointer advances for a possible global match.
        __ Stp(capture_start,
               capture_end,
               MemOperand(output_array(), kPointerSize, PostIndex));
      }

      // Only carry on if there are more than kNumCachedRegisters capture
      // registers.
      int num_registers_left_on_stack =
          num_saved_registers_ - kNumCachedRegisters;
      if (num_registers_left_on_stack > 0) {
        Register base = x10;
        // There are always an even number of capture registers. A couple of
        // registers determine one match with two offsets.
        ASSERT_EQ(0, num_registers_left_on_stack % 2);
        __ Add(base, frame_pointer(), kFirstCaptureOnStack);

        // We can unroll the loop here, we should not unroll for less than 2
        // registers.
        STATIC_ASSERT(kNumRegistersToUnroll > 2);
        if (num_registers_left_on_stack <= kNumRegistersToUnroll) {
          for (int i = 0; i < num_registers_left_on_stack / 2; i++) {
            __ Ldp(capture_end,
                   capture_start,
                   MemOperand(base, -kPointerSize, PostIndex));
            if ((i == 0) && global_with_zero_length_check()) {
              // Keep capture start for the zero-length check later.
              __ Mov(first_capture_start, capture_start);
            }
            // Offsets need to be relative to the start of the string.
            if (mode_ == UC16) {
              __ Add(capture_start,
                     input_length,
                     Operand(capture_start, ASR, 1));
              __ Add(capture_end, input_length, Operand(capture_end, ASR, 1));
            } else {
              __ Add(capture_start, input_length, capture_start);
              __ Add(capture_end, input_length, capture_end);
            }
            // The output pointer advances for a possible global match.
            __ Stp(capture_start,
                   capture_end,
                   MemOperand(output_array(), kPointerSize, PostIndex));
          }
        } else {
          Label loop, start;
          __ Mov(x11, num_registers_left_on_stack);

          __ Ldp(capture_end,
                 capture_start,
                 MemOperand(base, -kPointerSize, PostIndex));
          if (global_with_zero_length_check()) {
            __ Mov(first_capture_start, capture_start);
          }
          __ B(&start);

          __ Bind(&loop);
          __ Ldp(capture_end,
                 capture_start,
                 MemOperand(base, -kPointerSize, PostIndex));
          __ Bind(&start);
          if (mode_ == UC16) {
            __ Add(capture_start, input_length, Operand(capture_start, ASR, 1));
            __ Add(capture_end, input_length, Operand(capture_end, ASR, 1));
          } else {
            __ Add(capture_start, input_length, capture_start);
            __ Add(capture_end, input_length, capture_end);
          }
          // The output pointer advances for a possible global match.
          __ Stp(capture_start,
                 capture_end,
                 MemOperand(output_array(), kPointerSize, PostIndex));
          __ Sub(x11, x11, 2);
          __ Cbnz(x11, &loop);
        }
      }
    }

    if (global()) {
      Register success_counter = w0;
      Register output_size = x10;
      // Restart matching if the regular expression is flagged as global.

      // Increment success counter.
      __ Ldr(success_counter, MemOperand(frame_pointer(), kSuccessCounter));
      __ Add(success_counter, success_counter, 1);
      __ Str(success_counter, MemOperand(frame_pointer(), kSuccessCounter));

      // Capture results have been stored, so the number of remaining global
      // output registers is reduced by the number of stored captures.
      __ Ldr(output_size, MemOperand(frame_pointer(), kOutputSize));
      __ Sub(output_size, output_size, num_saved_registers_);
      // Check whether we have enough room for another set of capture results.
      __ Cmp(output_size, num_saved_registers_);
      __ B(lt, &return_w0);

      // The output pointer is already set to the next field in the output
      // array.
      // Update output size on the frame before we restart matching.
      __ Str(output_size, MemOperand(frame_pointer(), kOutputSize));

      if (global_with_zero_length_check()) {
        // Special case for zero-length matches.
        __ Cmp(current_input_offset(), first_capture_start);
        // Not a zero-length match, restart.
        __ B(ne, &load_char_start_regexp);
        // Offset from the end is zero if we already reached the end.
        __ Cbz(current_input_offset(), &return_w0);
        // Advance current position after a zero-length match.
        __ Add(current_input_offset(),
               current_input_offset(),
               Operand((mode_ == UC16) ? 2 : 1));
      }

      __ B(&load_char_start_regexp);
    } else {
      __ Mov(w0, SUCCESS);
    }
  }

  if (exit_label_.is_linked()) {
    // Exit and return w0
    __ Bind(&exit_label_);
    if (global()) {
      __ Ldr(w0, MemOperand(frame_pointer(), kSuccessCounter));
    }
  }

  __ Bind(&return_w0);

  // Set stack pointer back to first register to retain
  ASSERT(csp.Is(__ StackPointer()));
  __ Mov(csp, fp);
  __ AssertStackConsistency();

  // Restore registers.
  __ PopCPURegList(registers_to_retain);

  __ Ret();

  Label exit_with_exception;
  // Registers x0 to x7 are used to store the first captures, they need to be
  // retained over calls to C++ code.
  CPURegList cached_registers(CPURegister::kRegister, kXRegSizeInBits, 0, 7);
  ASSERT((cached_registers.Count() * 2) == kNumCachedRegisters);

  if (check_preempt_label_.is_linked()) {
    __ Bind(&check_preempt_label_);
    SaveLinkRegister();
    // The cached registers need to be retained.
    __ PushCPURegList(cached_registers);
    CallCheckStackGuardState(x10);
    // Returning from the regexp code restores the stack (csp <- fp)
    // so we don't need to drop the link register from it before exiting.
    __ Cbnz(w0, &return_w0);
    // Reset the cached registers.
    __ PopCPURegList(cached_registers);
    RestoreLinkRegister();
    __ Ret();
  }

  if (stack_overflow_label_.is_linked()) {
    __ Bind(&stack_overflow_label_);
    SaveLinkRegister();
    // The cached registers need to be retained.
    __ PushCPURegList(cached_registers);
    // Call GrowStack(backtrack_stackpointer(), &stack_base)
    __ Mov(x2, ExternalReference::isolate_address(isolate()));
    __ Add(x1, frame_pointer(), kStackBase);
    __ Mov(x0, backtrack_stackpointer());
    ExternalReference grow_stack =
        ExternalReference::re_grow_stack(isolate());
    __ CallCFunction(grow_stack, 3);
    // If return NULL, we have failed to grow the stack, and
    // must exit with a stack-overflow exception.
    // Returning from the regexp code restores the stack (csp <- fp)
    // so we don't need to drop the link register from it before exiting.
    __ Cbz(w0, &exit_with_exception);
    // Otherwise use return value as new stack pointer.
    __ Mov(backtrack_stackpointer(), x0);
    // Reset the cached registers.
    __ PopCPURegList(cached_registers);
    RestoreLinkRegister();
    __ Ret();
  }

  if (exit_with_exception.is_linked()) {
    __ Bind(&exit_with_exception);
    __ Mov(w0, EXCEPTION);
    __ B(&return_w0);
  }

  CodeDesc code_desc;
  masm_->GetCode(&code_desc);
  Handle<Code> code = isolate()->factory()->NewCode(
      code_desc, Code::ComputeFlags(Code::REGEXP), masm_->CodeObject());
  PROFILE(masm_->isolate(), RegExpCodeCreateEvent(*code, *source));
  return Handle<HeapObject>::cast(code);
}

void RegExpMacroAssemblerARM64::GoTo(Label* to) {
  BranchOrBacktrack(al, to);
}

void RegExpMacroAssemblerARM64::IfRegisterGE(int reg, int comparand,
                                             Label* if_ge) {
  Register to_compare = GetRegister(reg, w10);
  CompareAndBranchOrBacktrack(to_compare, comparand, ge, if_ge);
}

void RegExpMacroAssemblerARM64::IfRegisterLT(int reg, int comparand,
                                             Label* if_lt) {
  Register to_compare = GetRegister(reg, w10);
  CompareAndBranchOrBacktrack(to_compare, comparand, lt, if_lt);
}

void RegExpMacroAssemblerARM64::IfRegisterEqPos(int reg, Label* if_eq) {
  Register to_compare = GetRegister(reg, w10);
  __ Cmp(to_compare, current_input_offset());
  BranchOrBacktrack(eq, if_eq);
}

RegExpMacroAssembler::IrregexpImplementation
    RegExpMacroAssemblerARM64::Implementation() {
  return kARM64Implementation;
}

void RegExpMacroAssemblerARM64::LoadCurrentCharacter(int cp_offset,
                                                     Label* on_end_of_input,
                                                     bool check_bounds,
                                                     int characters) {
  // TODO(pielan): Make sure long strings are caught before this, and not
  // just asserted in debug mode.
  ASSERT(cp_offset >= -1);      // ^ and \b can look behind one character.
  // Be sane! (And ensure that an int32_t can be used to index the string)
  ASSERT(cp_offset < (1<<30));
  if (check_bounds) {
    CheckPosition(cp_offset + characters - 1, on_end_of_input);
  }
  LoadCurrentCharacterUnchecked(cp_offset, characters);
}

void RegExpMacroAssemblerARM64::PopCurrentPosition() {
  Pop(current_input_offset());
}

void RegExpMacroAssemblerARM64::PopRegister(int register_index) {
  Pop(w10);
  StoreRegister(register_index, w10);
}

void RegExpMacroAssemblerARM64::PushBacktrack(Label* label) {
  if (label->is_bound()) {
    int target = label->pos();
    __ Mov(w10, target + Code::kHeaderSize - kHeapObjectTag);
  } else {
    __ Adr(x10, label, MacroAssembler::kAdrFar);
    __ Sub(x10, x10, code_pointer());
    if (masm_->emit_debug_code()) {
      __ Cmp(x10, kWRegMask);
      // The code offset has to fit in a W register.
      __ Check(ls, kOffsetOutOfRange);
    }
  }
  Push(w10);
  CheckStackLimit();
}

void RegExpMacroAssemblerARM64::PushCurrentPosition() {
  Push(current_input_offset());
}

void RegExpMacroAssemblerARM64::PushRegister(int register_index,
                                             StackCheckFlag check_stack_limit) {
  Register to_push = GetRegister(register_index, w10);
  Push(to_push);
  if (check_stack_limit) CheckStackLimit();
}

void RegExpMacroAssemblerARM64::ReadCurrentPositionFromRegister(int reg) {
  Register cached_register;
  RegisterState register_state = GetRegisterState(reg);
  switch (register_state) {
    case STACKED:
      __ Ldr(current_input_offset(), register_location(reg));
      break;
    case CACHED_LSW:
      cached_register = GetCachedRegister(reg);
      __ Mov(current_input_offset(), cached_register.W());
      break;
    case CACHED_MSW:
      cached_register = GetCachedRegister(reg);
      __ Lsr(current_input_offset().X(), cached_register, kWRegSizeInBits);
      break;
    default:
      UNREACHABLE();
      break;
  }
}

void RegExpMacroAssemblerARM64::ReadStackPointerFromRegister(int reg) {
  Register read_from = GetRegister(reg, w10);
  __ Ldr(x11, MemOperand(frame_pointer(), kStackBase));
  __ Add(backtrack_stackpointer(), x11, Operand(read_from, SXTW));
}

void RegExpMacroAssemblerARM64::SetCurrentPositionFromEnd(int by) {
  Label after_position;
  __ Cmp(current_input_offset(), -by * char_size());
  __ B(ge, &after_position);
  __ Mov(current_input_offset(), -by * char_size());
  // On RegExp code entry (where this operation is used), the character before
  // the current position is expected to be already loaded.
  // We have advanced the position, so it's safe to read backwards.
  LoadCurrentCharacterUnchecked(-1, 1);
  __ Bind(&after_position);
}

void RegExpMacroAssemblerARM64::SetRegister(int register_index, int to) {
  ASSERT(register_index >= num_saved_registers_);  // Reserved for positions!
  Register set_to = wzr;
  if (to != 0) {
    set_to = w10;
    __ Mov(set_to, to);
  }
  StoreRegister(register_index, set_to);
}

bool RegExpMacroAssemblerARM64::Succeed() {
  __ B(&success_label_);
  return global();
}

void RegExpMacroAssemblerARM64::WriteCurrentPositionToRegister(int reg,
                                                               int cp_offset) {
  Register position = current_input_offset();
  if (cp_offset != 0) {
    position = w10;
    __ Add(position, current_input_offset(), cp_offset * char_size());
  }
  StoreRegister(reg, position);
}

void RegExpMacroAssemblerARM64::ClearRegisters(int reg_from, int reg_to) {
  ASSERT(reg_from <= reg_to);
  int num_registers = reg_to - reg_from + 1;

  // If the first capture register is cached in a hardware register but not
  // aligned on a 64-bit one, we need to clear the first one specifically.
  if ((reg_from < kNumCachedRegisters) && ((reg_from % 2) != 0)) {
    StoreRegister(reg_from, non_position_value());
    num_registers--;
    reg_from++;
  }

  // Clear cached registers in pairs as far as possible.
  while ((num_registers >= 2) && (reg_from < kNumCachedRegisters)) {
    ASSERT(GetRegisterState(reg_from) == CACHED_LSW);
    __ Mov(GetCachedRegister(reg_from), twice_non_position_value());
    reg_from += 2;
    num_registers -= 2;
  }

  if ((num_registers % 2) == 1) {
    StoreRegister(reg_from, non_position_value());
    num_registers--;
    reg_from++;
  }

  if (num_registers > 0) {
    // If there are some remaining registers, they are stored on the stack.
    ASSERT(reg_from >= kNumCachedRegisters);

    // Move down the indexes of the registers on stack to get the correct offset
    // in memory.
    reg_from -= kNumCachedRegisters;
    reg_to -= kNumCachedRegisters;
    // We should not unroll the loop for less than 2 registers.
    STATIC_ASSERT(kNumRegistersToUnroll > 2);
    // We position the base pointer to (reg_from + 1).
    int base_offset = kFirstRegisterOnStack -
        kWRegSize - (kWRegSize * reg_from);
    if (num_registers > kNumRegistersToUnroll) {
      Register base = x10;
      __ Add(base, frame_pointer(), base_offset);

      Label loop;
      __ Mov(x11, num_registers);
      __ Bind(&loop);
      __ Str(twice_non_position_value(),
             MemOperand(base, -kPointerSize, PostIndex));
      __ Sub(x11, x11, 2);
      __ Cbnz(x11, &loop);
    } else {
      for (int i = reg_from; i <= reg_to; i += 2) {
        __ Str(twice_non_position_value(),
               MemOperand(frame_pointer(), base_offset));
        base_offset -= kWRegSize * 2;
      }
    }
  }
}

void RegExpMacroAssemblerARM64::WriteStackPointerToRegister(int reg) {
  __ Ldr(x10, MemOperand(frame_pointer(), kStackBase));
  __ Sub(x10, backtrack_stackpointer(), x10);
  if (masm_->emit_debug_code()) {
    __ Cmp(x10, Operand(w10, SXTW));
    // The stack offset needs to fit in a W register.
    __ Check(eq, kOffsetOutOfRange);
  }
  StoreRegister(reg, w10);
}

// Helper function for reading a value out of a stack frame.
template <typename T>
static T& frame_entry(Address re_frame, int frame_offset) {
  return *reinterpret_cast<T*>(re_frame + frame_offset);
}

int RegExpMacroAssemblerARM64::CheckStackGuardState(Address* return_address,
                                                  Code* re_code,
                                                  Address re_frame,
                                                  int start_offset,
                                                  const byte** input_start,
                                                  const byte** input_end) {
  Isolate* isolate = frame_entry<Isolate*>(re_frame, kIsolate);
  StackLimitCheck check(isolate);
  if (check.JsHasOverflowed()) {
    isolate->StackOverflow();
    return EXCEPTION;
  }

  // If not real stack overflow the stack guard was used to interrupt
  // execution for another purpose.

  // If this is a direct call from JavaScript retry the RegExp forcing the call
  // through the runtime system. Currently the direct call cannot handle a GC.
  if (frame_entry<int>(re_frame, kDirectCall) == 1) {
    return RETRY;
  }

  // Prepare for possible GC.
  HandleScope handles(isolate);
  Handle<Code> code_handle(re_code);

  Handle<String> subject(frame_entry<String*>(re_frame, kInput));

  // Current string.
  bool is_ascii = subject->IsOneByteRepresentationUnderneath();

  ASSERT(re_code->instruction_start() <= *return_address);
  ASSERT(*return_address <=
      re_code->instruction_start() + re_code->instruction_size());

  Object* result = isolate->stack_guard()->HandleInterrupts();

  if (*code_handle != re_code) {  // Return address no longer valid
    int delta = code_handle->address() - re_code->address();
    // Overwrite the return address on the stack.
    *return_address += delta;
  }

  if (result->IsException()) {
    return EXCEPTION;
  }

  Handle<String> subject_tmp = subject;
  int slice_offset = 0;

  // Extract the underlying string and the slice offset.
  if (StringShape(*subject_tmp).IsCons()) {
    subject_tmp = Handle<String>(ConsString::cast(*subject_tmp)->first());
  } else if (StringShape(*subject_tmp).IsSliced()) {
    SlicedString* slice = SlicedString::cast(*subject_tmp);
    subject_tmp = Handle<String>(slice->parent());
    slice_offset = slice->offset();
  }

  // String might have changed.
  if (subject_tmp->IsOneByteRepresentation() != is_ascii) {
    // If we changed between an ASCII and an UC16 string, the specialized
    // code cannot be used, and we need to restart regexp matching from
    // scratch (including, potentially, compiling a new version of the code).
    return RETRY;
  }

  // Otherwise, the content of the string might have moved. It must still
  // be a sequential or external string with the same content.
  // Update the start and end pointers in the stack frame to the current
  // location (whether it has actually moved or not).
  ASSERT(StringShape(*subject_tmp).IsSequential() ||
         StringShape(*subject_tmp).IsExternal());

  // The original start address of the characters to match.
  const byte* start_address = *input_start;

  // Find the current start address of the same character at the current string
  // position.
  const byte* new_address = StringCharacterPosition(*subject_tmp,
      start_offset + slice_offset);

  if (start_address != new_address) {
    // If there is a difference, update the object pointer and start and end
    // addresses in the RegExp stack frame to match the new value.
    const byte* end_address = *input_end;
    int byte_length = static_cast<int>(end_address - start_address);
    frame_entry<const String*>(re_frame, kInput) = *subject;
    *input_start = new_address;
    *input_end = new_address + byte_length;
  } else if (frame_entry<const String*>(re_frame, kInput) != *subject) {
    // Subject string might have been a ConsString that underwent
    // short-circuiting during GC. That will not change start_address but
    // will change pointer inside the subject handle.
    frame_entry<const String*>(re_frame, kInput) = *subject;
  }

  return 0;
}

void RegExpMacroAssemblerARM64::CheckPosition(int cp_offset,
                                              Label* on_outside_input) {
  CompareAndBranchOrBacktrack(current_input_offset(),
                              -cp_offset * char_size(),
                              ge,
                              on_outside_input);
}

bool RegExpMacroAssemblerARM64::CanReadUnaligned() {
  // TODO(pielan): See whether or not we should disable unaligned accesses.
  return !slow_safe();
}

// Private methods:

void RegExpMacroAssemblerARM64::CallCheckStackGuardState(Register scratch) {
  // Allocate space on the stack to store the return address. The
  // CheckStackGuardState C++ function will override it if the code
  // moved. Allocate extra space for 2 arguments passed by pointers.
  // AAPCS64 requires the stack to be 16 byte aligned.
  int alignment = masm_->ActivationFrameAlignment();
  ASSERT_EQ(alignment % 16, 0);
  int align_mask = (alignment / kXRegSize) - 1;
  int xreg_to_claim = (3 + align_mask) & ~align_mask;

  ASSERT(csp.Is(__ StackPointer()));
  __ Claim(xreg_to_claim);

  // CheckStackGuardState needs the end and start addresses of the input string.
  __ Poke(input_end(), 2 * kPointerSize);
  __ Add(x5, csp, 2 * kPointerSize);
  __ Poke(input_start(), kPointerSize);
  __ Add(x4, csp, kPointerSize);

  __ Mov(w3, start_offset());
  // RegExp code frame pointer.
  __ Mov(x2, frame_pointer());
  // Code* of self.
  __ Mov(x1, Operand(masm_->CodeObject()));

  // We need to pass a pointer to the return address as first argument.
  // The DirectCEntry stub will place the return address on the stack before
  // calling so the stack pointer will point to it.
  __ Mov(x0, csp);

  ExternalReference check_stack_guard_state =
      ExternalReference::re_check_stack_guard_state(isolate());
  __ Mov(scratch, check_stack_guard_state);
  DirectCEntryStub stub(isolate());
  stub.GenerateCall(masm_, scratch);

  // The input string may have been moved in memory, we need to reload it.
  __ Peek(input_start(), kPointerSize);
  __ Peek(input_end(), 2 * kPointerSize);

  ASSERT(csp.Is(__ StackPointer()));
  __ Drop(xreg_to_claim);

  // Reload the Code pointer.
  __ Mov(code_pointer(), Operand(masm_->CodeObject()));
}

void RegExpMacroAssemblerARM64::BranchOrBacktrack(Condition condition,
                                                  Label* to) {
  if (condition == al) {  // Unconditional.
    if (to == NULL) {
      Backtrack();
      return;
    }
    __ B(to);
    return;
  }
  if (to == NULL) {
    to = &backtrack_label_;
  }
  // TODO(ulan): do direct jump when jump distance is known and fits in imm19.
  Condition inverted_condition = NegateCondition(condition);
  Label no_branch;
  __ B(inverted_condition, &no_branch);
  __ B(to);
  __ Bind(&no_branch);
}

void RegExpMacroAssemblerARM64::CompareAndBranchOrBacktrack(Register reg,
                                                            int immediate,
                                                            Condition condition,
                                                            Label* to) {
  if ((immediate == 0) && ((condition == eq) || (condition == ne))) {
    if (to == NULL) {
      to = &backtrack_label_;
    }
    // TODO(ulan): do direct jump when jump distance is known and fits in imm19.
    Label no_branch;
    if (condition == eq) {
      __ Cbnz(reg, &no_branch);
    } else {
      __ Cbz(reg, &no_branch);
    }
    __ B(to);
    __ Bind(&no_branch);
  } else {
    __ Cmp(reg, immediate);
    BranchOrBacktrack(condition, to);
  }
}

void RegExpMacroAssemblerARM64::CheckPreemption() {
  // Check for preemption.
  ExternalReference stack_limit =
      ExternalReference::address_of_stack_limit(isolate());
  __ Mov(x10, stack_limit);
  __ Ldr(x10, MemOperand(x10));
  ASSERT(csp.Is(__ StackPointer()));
  __ Cmp(csp, x10);
  CallIf(&check_preempt_label_, ls);
}

void RegExpMacroAssemblerARM64::CheckStackLimit() {
  ExternalReference stack_limit =
      ExternalReference::address_of_regexp_stack_limit(isolate());
  __ Mov(x10, stack_limit);
  __ Ldr(x10, MemOperand(x10));
  __ Cmp(backtrack_stackpointer(), x10);
  CallIf(&stack_overflow_label_, ls);
}

void RegExpMacroAssemblerARM64::Push(Register source) {
  ASSERT(source.Is32Bits());
  ASSERT(!source.is(backtrack_stackpointer()));
  __ Str(source,
         MemOperand(backtrack_stackpointer(),
                    -static_cast<int>(kWRegSize),
                    PreIndex));
}

void RegExpMacroAssemblerARM64::Pop(Register target) {
  ASSERT(target.Is32Bits());
  ASSERT(!target.is(backtrack_stackpointer()));
  __ Ldr(target,
         MemOperand(backtrack_stackpointer(), kWRegSize, PostIndex));
}

Register RegExpMacroAssemblerARM64::GetCachedRegister(int register_index) {
  ASSERT(register_index < kNumCachedRegisters);
  return Register::Create(register_index / 2, kXRegSizeInBits);
}

Register RegExpMacroAssemblerARM64::GetRegister(int register_index,
                                                Register maybe_result) {
  ASSERT(maybe_result.Is32Bits());
  ASSERT(register_index >= 0);
  if (num_registers_ <= register_index) {
    num_registers_ = register_index + 1;
  }
  Register result;
  RegisterState register_state = GetRegisterState(register_index);
  switch (register_state) {
    case STACKED:
      __ Ldr(maybe_result, register_location(register_index));
      result = maybe_result;
      break;
    case CACHED_LSW:
      result = GetCachedRegister(register_index).W();
      break;
    case CACHED_MSW:
      __ Lsr(maybe_result.X(), GetCachedRegister(register_index),
             kWRegSizeInBits);
      result = maybe_result;
      break;
    default:
      UNREACHABLE();
      break;
  }
  ASSERT(result.Is32Bits());
  return result;
}

void RegExpMacroAssemblerARM64::StoreRegister(int register_index,
                                              Register source) {
  ASSERT(source.Is32Bits());
  ASSERT(register_index >= 0);
  if (num_registers_ <= register_index) {
    num_registers_ = register_index + 1;
  }

  Register cached_register;
  RegisterState register_state = GetRegisterState(register_index);
  switch (register_state) {
    case STACKED:
      __ Str(source, register_location(register_index));
      break;
    case CACHED_LSW:
      cached_register = GetCachedRegister(register_index);
      if (!source.Is(cached_register.W())) {
        __ Bfi(cached_register, source.X(), 0, kWRegSizeInBits);
      }
      break;
    case CACHED_MSW:
      cached_register = GetCachedRegister(register_index);
      __ Bfi(cached_register, source.X(), kWRegSizeInBits, kWRegSizeInBits);
      break;
    default:
      UNREACHABLE();
      break;
  }
}

void RegExpMacroAssemblerARM64::CallIf(Label* to, Condition condition) {
  Label skip_call;
  if (condition != al) __ B(&skip_call, NegateCondition(condition));
  __ Bl(to);
  __ Bind(&skip_call);
}

void RegExpMacroAssemblerARM64::RestoreLinkRegister() {
  ASSERT(csp.Is(__ StackPointer()));
  __ Pop(lr, xzr);
  __ Add(lr, lr, Operand(masm_->CodeObject()));
}

void RegExpMacroAssemblerARM64::SaveLinkRegister() {
  ASSERT(csp.Is(__ StackPointer()));
  __ Sub(lr, lr, Operand(masm_->CodeObject()));
  __ Push(xzr, lr);
}

MemOperand RegExpMacroAssemblerARM64::register_location(int register_index) {
  ASSERT(register_index < (1<<30));
  ASSERT(register_index >= kNumCachedRegisters);
  if (num_registers_ <= register_index) {
    num_registers_ = register_index + 1;
  }
  register_index -= kNumCachedRegisters;
  int offset = kFirstRegisterOnStack - register_index * kWRegSize;
  return MemOperand(frame_pointer(), offset);
}

MemOperand RegExpMacroAssemblerARM64::capture_location(int register_index,
                                                     Register scratch) {
  ASSERT(register_index < (1<<30));
  ASSERT(register_index < num_saved_registers_);
  ASSERT(register_index >= kNumCachedRegisters);
  ASSERT_EQ(register_index % 2, 0);
  register_index -= kNumCachedRegisters;
  int offset = kFirstCaptureOnStack - register_index * kWRegSize;
  // capture_location is used with Stp instructions to load/store 2 registers.
  // The immediate field in the encoding is limited to 7 bits (signed).
  if (is_int7(offset)) {
    return MemOperand(frame_pointer(), offset);
  } else {
    __ Add(scratch, frame_pointer(), offset);
    return MemOperand(scratch);
  }
}

void RegExpMacroAssemblerARM64::LoadCurrentCharacterUnchecked(int cp_offset,
                                                              int characters) {
  Register offset = current_input_offset();

  // The ldr, str, ldrh, strh instructions can do unaligned accesses, if the CPU
  // and the operating system running on the target allow it.
  // If unaligned load/stores are not supported then this function must only
  // be used to load a single character at a time.

  // ARMv8 supports unaligned accesses but V8 or the kernel can decide to
  // disable it.
  // TODO(pielan): See whether or not we should disable unaligned accesses.
  if (!CanReadUnaligned()) {
    ASSERT(characters == 1);
  }

  if (cp_offset != 0) {
    if (masm_->emit_debug_code()) {
      __ Mov(x10, cp_offset * char_size());
      __ Add(x10, x10, Operand(current_input_offset(), SXTW));
      __ Cmp(x10, Operand(w10, SXTW));
      // The offset needs to fit in a W register.
      __ Check(eq, kOffsetOutOfRange);
    } else {
      __ Add(w10, current_input_offset(), cp_offset * char_size());
    }
    offset = w10;
  }

  if (mode_ == ASCII) {
    if (characters == 4) {
      __ Ldr(current_character(), MemOperand(input_end(), offset, SXTW));
    } else if (characters == 2) {
      __ Ldrh(current_character(), MemOperand(input_end(), offset, SXTW));
    } else {
      ASSERT(characters == 1);
      __ Ldrb(current_character(), MemOperand(input_end(), offset, SXTW));
    }
  } else {
    ASSERT(mode_ == UC16);
    if (characters == 2) {
      __ Ldr(current_character(), MemOperand(input_end(), offset, SXTW));
    } else {
      ASSERT(characters == 1);
      __ Ldrh(current_character(), MemOperand(input_end(), offset, SXTW));
    }
  }
}

#endif  // V8_INTERPRETED_REGEXP

}}  // namespace v8::internal

#endif  // V8_TARGET_ARCH_ARM64


Hi. Is there an instruction on updating the software or flashing a new image using the usb ports on the Modular iot gateway?
The Gateway IDEx release is provided with SD card image and default boot is SD boot and so please flash SD card image using Host PC and SD card reader and use "Win32DiskImager" (on windows) or "dd" command (in Linux) to flash SD card image and once SD card is ready, insert it with gateway and power up the gateway. The gateway will boot from SD card image.
Is there any specific requirement to flash firmware via USB?


Spending a lot of her time in the region of Småland, the heart of production in Sweden, Petra Lilja is interested in the historical as well as current nodes of production. In her explorations of glass, she has worked with the family run glass factory Skruf who are open-minded to her ideas of for example combining glass and wood.
All woodwork is made by wood carver Carsten Nilsson.
The small glasses are all unique in colors and the shape of the wooden bases, inspired by times when artifacts and material where scarce and perhaps more highly valued. If a glass broke, you'd mend it, not throw it away.
The glass jars with over-sized lids are part of the Medusa Design Collection, décor pained as marble, playing with the illusion of heavy and lightweight.
The vases and bowls are part of the Stairs Collection, sold by Props by Kampmann, Stockholm.