Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PTX backend crash on larger (?) input programs #70

Open
1 of 3 tasks
tomsmeding opened this issue Jun 8, 2021 · 3 comments
Open
1 of 3 tasks

PTX backend crash on larger (?) input programs #70

tomsmeding opened this issue Jun 8, 2021 · 3 comments

Comments

@tomsmeding
Copy link
Member

tomsmeding commented Jun 8, 2021

I am submitting a...

  • bug report
  • feature request
  • support request => you might also like to ask your question on the mailing list or gitter chat.

Description

The PTX backend crashes or gives other unrecoverable errors (like a "CUDA Exception: Invalid argument") sometimes for larger (?) input programs.

In the repository https://github.com/tomsmeding/acc-gpu-crash (commit as of the time of writing: https://github.com/tomsmeding/acc-gpu-crash/tree/d3df383c685f19c5bba8d8a1959ee048c51b0361) there are two programs in the modules N1 (smaller) and N2 (larger) that produce various kinds of crashes on different machines. N2 reproducibly crashes, while N1 seems to run fine on certain machines while crashing on others. In the linked commit, Main.hs runs the program from N2. Both N1 and N2 run fine in the interpreter.
The repository includes a script test.sh that builds the program using stack and runs it under cuda-memcheck until it returns with a non-zero exit code. (Environment variables for Jizo have been included.)

For posterity, the source files are included here in spoilers.

N1.hs
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE MultiParamTypeClasses #-}
module N1 (program1) where

import Data.Array.Accelerate
import Prelude ()


class (Slice slix, Shape sl, Shape sh) => SliceExt slix sl sh where
    indexFull :: Exp slix -> Exp sl -> Exp sh
    indexSlice :: Exp slix -> Exp sh -> Exp sl

instance SliceExt Z Z Z where
    indexFull Z_ Z_ = Z_
    indexSlice Z_ Z_ = Z_

instance SliceExt slix sl sh => SliceExt (slix :. All) (sl :. Int) (sh :. Int) where
    indexFull (slix ::. _) (sl ::. n) = indexFull slix sl ::. n
    indexSlice (slix ::. _) (sh ::. n) = indexSlice slix sh ::. n

instance SliceExt slix sl sh => SliceExt (slix :. Int) sl (sh :. Int) where
    indexFull (slix ::. n) sl = indexFull slix sl ::. n
    indexSlice (slix ::. _) (sh ::. _) = indexSlice slix sh

{-# NOINLINE program1 #-}
program1 :: Acc (Array DIM2 Float)
program1 =
    let a5 = use (fromList (Z :. 5) [-0.649014,1.1811659,-0.758453,-1.109613,-0.845551] :: Array (Z :. Int) Float)
        a6 = use (fromList (Z :. 5 :. 2) [0.345561,0.396767,0.538817,0.419195,0.68522,0.204452,0.878117,2.7388e-2,0.670468,0.417305] :: Array (Z :. Int :. Int) Float)
        a8 = use (fromList (Z :. 1000 :. 2) [1.270848,6.6009e-2,0.45129,-0.32221,0.788409,0.928736,-0.49079,1.7972009,0.590697,-0.635786,0.603347,-0.535248,-0.15508,0.612122,-1.044343,-0.345632,-1.171405,-0.685587,0.926216,-1.481675,-0.558058,-2.8453e-2,-1.476292,0.2589,-2.018691,0.19974,0.425864,-1.270043,-0.485219,0.594308,-0.276465,-1.857583,4.0731e-2,0.28297,6.3561e-2,0.43343,0.42286,1.299528,-1.049793,-1.786412,0.816043,-0.328209,-1.214566,1.111833,-0.507497,0.89873,0.377216,1.452392,0.446945,0.645825,-0.623677,-0.595236,1.6113241,-0.348998,0.164167,-1.636577,0.581366,-0.128906,0.432859,-0.245109,-1.08543,1.680802,0.176412,-2.07144,0.211089,-0.582848,1.8169e-2,1.494778,-0.424797,1.686243,0.36549,-1.097061,1.930213,0.622936,0.657284,-1.463383,0.853935,0.580489,-0.918601,0.794865,0.517535,0.494614,0.66393,-0.710172,-1.306838,-0.741589,-1.467659,-0.391675,0.841659,8.2784e-2,0.314671,0.789805,-0.801224,-0.325654,0.284676,1.309618,0.160373,-2.118188,0.707081,-1.043414,1.068207,-0.317234,1.479677,0.699088,0.159099,-0.945481,-0.793007,-2.049239,-2.358835,-1.659269,-0.958124,0.22573,0.217665,-0.823239,-1.012768,1.215258,0.156275,-0.400257,-0.441779,0.448102,-1.6645911,0.21489,0.549563,1.392338,-0.619228,-1.2601e-2,0.773612,1.629212,-1.409975,-1.747283,-0.472246,-6.0088e-2,0.438879,0.201222,-0.583298,0.764797,0.14077,-0.372937,0.105467,1.270624,0.49913,-0.397025,-1.789968,-0.266894,0.178431,-0.434192,0.464513,-1.121445,-0.359075,0.532267,-1.643508,0.466899,0.112107,1.496544,-0.586502,-1.7189319,0.74104,1.087696,0.75667,1.629694,-1.374993,-1.052011,0.477518,1.222177,2.370732,0.114586,0.279069,0.75208,-0.260257,-2.5993e-2,9.6724e-2,0.144143,1.856209,1.100335,-0.364107,0.471993,-0.839107,-0.523633,-1.388766,4.248e-3,-1.404783,2.629018,0.819529,-1.443411,-0.499729,-0.517959,-1.802747,0.988435,-0.360753,1.132659,0.409018,0.819121,0.319661,2.415006,-0.114032,0.118016,0.999691,-0.357659,-5.5026e-2,0.241456,-2.73518,0.193514,-0.145396,1.454576,-0.396689,1.728903,0.251893,-0.618553,0.976329,0.130991,-0.364357,-9.3312e-2,0.489806,1.401431,-0.274223,0.675816,0.190581,0.670363,0.208357,0.327875,-0.823197,0.331906,0.343914,0.379748,1.088939,0.994859,0.20861,-0.399188,0.506011,-0.127763,-0.254921,-7.8043e-2,-0.314649,-0.308418,0.401268,-0.129421,1.327683,0.670787,-0.691715,-4.9218e-2,-0.326731,0.303248,2.0565,1.707191,0.510742,-0.187689,-0.589429,1.143276,0.130368,0.586463,0.103399,0.264541,5.4799e-2,0.221252,9.1006e-2,-0.150115,-0.561297,-1.799185,-0.470727,-0.902588,0.547841,-0.735208,1.475863,0.505823,0.692664,0.134881,-1.06878,-0.167592,-0.462884,-1.263564,0.420394,-0.324321,1.341096,1.213663,-0.502785,-1.116363,-0.922072,-1.042e-3,0.15349,-0.90397,-0.938332,0.433891,-0.153153,0.402438,-0.652552,-1.957691,6.7693e-2,-4.732e-2,-0.696919,0.457548,7.9304e-2,0.479593,-2.360392,0.444008,-0.324989,9.7206e-2,1.114805,-1.157063,-0.475713,0.522585,0.887144,1.6548e-2,0.902542,1.154784,0.872534,-0.469163,0.596529,0.836092,0.304493,1.155324,-1.571514,1.636478,0.554831,-0.585432,-0.510444,0.492702,-0.650826,0.926873,-0.188116,0.320829,1.420298,-1.189962,-0.928444,1.309552,0.115346,2.828126,0.274099,0.115688,-1.070368,-0.709702,-1.513138,-1.136958,1.272192,-1.144058,-0.526164,1.5781779,0.578636,0.578573,-1.422806,-0.190392,0.186023,1.483995,-0.679469,-0.530061,-0.859494,1.306356,-8.633e-2,-2.150373,2.5232e-2,-1.135619,0.714953,-0.616843,-0.955457,0.13556,0.637969,-0.366977,1.06141,5.6378e-2,8.5413e-2,1.836021,0.675363,-1.545835,0.353632,-9.244e-2,0.638395,-0.86296,-0.886446,-1.223166,-0.185643,-1.720509,0.151805,0.816508,0.577798,1.063851,-0.803239,0.798627,-0.315092,1.186064,8.4939e-2,-1.424976,-1.454111,-1.8093159,-1.462947,-0.138068,-1.005592,-2.733304,1.692405,-0.283386,1.122142,-0.306948,-0.168531,-8.1308e-2,-3.7718e-2,2.091389,-0.41063,2.95757,-1.687389,0.290257,-1.469352,0.449062,-1.695895,6.0461e-2,-1.147612,1.9939361,0.920892,1.6227009,-0.487547,-1.195582,-1.4194701,0.46822,1.329924,2.304717,0.851429,0.521839,3.201293,-0.330453,-0.896356,-0.99395,-1.871669,1.497869,-1.632447,-0.851817,1.0774,-0.440099,3.327984,0.103796,-0.773079,0.677374,-0.696817,-7.5351e-2,2.6019e-2,2.005536,-1.129631,0.654237,1.419167,-0.825613,5.3107e-2,-0.855855,1.768118,0.182871,0.431022,-0.228818,0.393997,-0.525875,-2.44696,0.155245,-0.834079,7.8468e-2,1.31271,-0.135124,-1.409995,-0.162703,2.109836,1.4625859,0.914106,1.512145,-0.454165,-1.139403,-0.705497,-0.331098,-1.520792,0.165279,-0.48787,0.586965,-0.903369,0.371008,-1.260143,0.222889,-0.413064,-1.016668,-0.326023,0.283502,-1.1569e-2,3.6267e-2,-1.098303,0.375683,0.170055,1.139668,1.657464,0.338248,-1.8189709,-0.802271,-0.574424,-0.234256,-0.305201,1.639446,-1.897236,1.3185201,0.532359,0.601598,0.467189,0.208181,-5.7599e-2,-3.065186,-0.612494,-1.6162e-2,0.7769,-9.0006e-2,-0.148789,-0.887773,-0.776091,0.629228,-1.31584,0.898735,-0.825132,-0.575501,2.5326e-2,0.562567,-0.172096,-0.648153,-0.153145,1.7124e-2,0.827807,0.698925,-1.006189,-2.244176,0.102301,0.901808,-3.005798,0.659237,0.760341,-0.169916,0.708616,0.628756,-0.763568,1.187671,1.163956,0.43791,0.764358,0.172088,-0.635979,0.263635,0.557991,-0.323506,0.23893,-0.668543,0.54218,-0.734938,0.616388,-0.228798,0.821,-0.155227,-1.308308,0.777575,-1.180115,0.287776,0.449292,-0.536068,-0.920966,-0.686498,-1.09287,-0.488991,-0.918765,-2.031704,0.639006,1.135888,-0.785609,-1.012202,-1.008377,1.52116,0.66327,7.1216e-2,-0.584426,1.01464,-0.226944,0.644054,0.200877,-2.9035e-2,-0.992314,1.983578,-0.939563,-1.609478,-0.219788,-0.27741,-0.880145,0.583931,-0.36393,0.41669,1.286826,-1.4039149,0.444248,1.440858,0.332877,0.515995,-0.232061,0.602345,0.612538,-0.392011,0.710826,-1.8948231,1.358329,-0.911798,-0.149636,-0.40114,-0.577582,2.003854,-0.509643,8.8893e-2,-1.9698e-2,-0.738074,-1.152164,-1.947602,2.6296e-2,-0.825893,-0.717992,-1.940978,0.987546,-1.6631169,2.063314,-2.082036,0.273162,-2.376736,0.379466,-0.99132,9.4217e-2,0.643802,-0.782961,0.148621,-0.920779,1.191122,0.980936,-0.723429,2.334377,-2.551227,0.902509,0.227135,-0.351252,0.527464,0.874846,3.068098,-0.618881,0.757522,1.028627,5.284e-2,0.210857,1.152476,-0.352294,0.51556,0.962176,0.387157,-0.225196,0.249426,-1.916009,0.711205,1.5629029,-0.825379,-0.568134,-0.723674,-1.008999,0.730514,8.521e-2,-0.427966,-0.596362,-0.745602,0.642888,-0.193149,-0.12576,-7.3857e-2,1.122151,-0.252944,-0.395011,0.393903,-0.678536,-0.165741,-0.509151,0.489158,1.226135,-0.152181,0.838969,-6.6415e-2,0.882032,-0.614498,-0.113187,0.752232,0.502254,1.7715139,2.5691e-2,-5.188e-3,1.034393,-1.6025829,0.322434,2.312027,2.5913e-2,-0.50997,1.390458,-1.457564,0.666306,0.22473,2.098755,0.479445,0.650313,-1.7261469,1.6036711,-0.54618,-0.510315,2.098672,1.02184,-0.204025,-1.148959,1.057324,-7.0703e-2,-1.6616449,1.725458,0.981133,-1.8408e-2,1.300162,-0.282012,0.242475,-0.273552,1.8418e-2,-1.537433,2.541337,-0.42599,-1.305117,-0.607644,-1.881951,0.389123,2.7765e-2,1.4656e-2,1.476658,0.2532,0.653493,-0.165081,0.53632,-0.559253,-0.431607,-1.8708279,-0.473182,-1.195105,-0.294704,0.711937,-0.31718,1.345581,0.431573,-0.290225,0.804784,0.349499,-0.674941,1.159802,-3.8383e-2,-0.497727,-0.165461,0.255275,-0.514031,1.049777,-0.297014,0.207544,-1.6294e-2,0.885397,1.70028,-1.692024,0.187102,1.299425,-0.177342,1.266924,-0.642952,0.58898,0.491726,-0.317791,-1.080348,-0.236695,1.037509,-0.505673,1.14925,-1.6583381,-0.658551,-1.174728,0.405981,0.561162,0.763683,-0.251252,0.580274,-0.859688,-0.241693,-0.235381,-0.518473,-0.949763,0.239594,0.558733,0.350337,0.275183,-1.081674,-1.534654,2.4216e-2,1.5714281,-2.038232,-0.205198,-0.179022,-1.0316e-2,-1.244388,-0.704389,-1.0942659,1.129088,1.118448,-0.225268,7.1858e-2,-1.379221,2.9911e-2,-0.397478,1.6917751,0.755117,0.523884,-0.474369,-1.975e-2,3.137981,1.552722,6.2457e-2,0.446259,0.216111,-0.165013,-0.261181,0.128395,0.842844,0.764314,0.220261,1.04058,-1.32476,0.635503,-1.677369,-0.31441,-0.596958,0.417571,-2.304534,-0.775047,-1.620703,0.427633,0.236062,-0.179066,-0.206452,1.218866,-3.9144e-2,7.8823e-2,-0.684109,0.108209,-0.19316,-0.181832,-0.400381,-0.209644,-0.103754,1.330781,-0.541981,0.979114,0.275543,1.4491379,-0.307006,-0.726711,1.278873,-2.764208,-0.568166,2.763304,6.0634e-2,-2.063403,3.064e-2,0.326295,0.731459,1.354879,-0.215322,0.536494,0.574383,-1.5417e-2,5.9954e-2,-0.917658,-0.524292,-1.050423,0.30608,-5.759e-2,-0.177815,1.48189,0.131511,-5.2032e-2,-0.550095,-1.733962,-0.387419,-2.365146,-0.571256,1.0069e-2,1.255723,-0.820761,0.30546,-2.9e-5,-2.243771,-1.863345,-0.195606,1.225722,-0.603548,0.678204,-0.726321,-1.072731,-1.302486,-0.22962,-0.656655,0.381522,-1.4487879,-0.978113,-1.224376,-1.077053,0.623583,-0.457896,-0.561759,0.136208,1.021503,1.936089,1.5613561,1.359023,-1.864756,-1.717061,-6.1872e-2,-0.705292,1.107436,-4.4768e-2,0.118538,0.87822,-7.9947e-2,0.590146,-0.554747,-0.615667,-0.68904,0.116539,-0.855605,0.796908,-2.464211,-0.474592,0.563042,-0.552889,-0.294927,0.124951,0.109075,-1.119832,0.472949,1.7786369,0.800018,-0.658022,0.107852,-0.517307,0.119842,1.930902,-0.532678,0.922536,-1.036749,0.27965,-0.523115,0.546274,0.705333,0.46846,-0.100024,-1.067891,-2.588719,-0.448819,-1.440259,0.934778,0.375977,-0.251271,0.496861,9.2671e-2,-1.964326,-0.401108,-1.093911,-0.678303,-1.970043,0.30721,4.692e-2,0.215869,-0.237293,1.666002,-0.222967,-1.370886,0.856108,0.721929,0.712895,0.644424,-1.29445,-0.82793,-0.564768,-0.228959,0.855717,-1.301764,-7.3907e-2,-2.197588,0.864011,0.645328,-1.193955,-3.4896e-2,-0.712788,2.619028,2.79465,0.629131,1.825779,-0.151243,1.098892,-0.350638,-1.181074,1.6136861,0.412021,-1.347839,1.385443,0.700463,0.322197,0.174338,-0.73382,0.22769,1.197335,-1.436389,-1.569608,1.14647,0.454343,0.142179,-0.800425,-1.156936,0.907952,-0.318833,-1.3671579,0.556305,-0.706028,1.149258,1.3797,-1.7873e-2,0.268011,3.3642e-2,0.388377,0.689099,-0.878603,1.070225,0.16491,-1.385081,-0.990824,0.378418,-1.299425,-0.983455,-1.006416,1.5848429,0.483581,0.959621,-0.545966,0.265402,0.337074,0.375951,-1.049269,1.073903,1.400704,7.8071e-2,-1.111087,0.929832,-1.4069281,-0.490442,0.796461,0.320721,1.824993,0.125838,1.283284,0.940283,-0.912691,-0.537827,0.273043,-0.188873,-2.040028,0.543943,-0.989055,-1.3856909,1.05535,-1.763258,-0.91417,-2.565918,1.4272981,9.8617e-2,-0.67137,0.860693,3.3095e-2,-0.177832,0.471082,-0.714685,-1.025397,-0.631256,-0.370778,0.503666,0.334579,-1.210928,2.202782,0.739613,0.51102,0.60955,-1.249831,-6.9658e-2,-0.194669,0.408094,-0.131232,0.345063,0.567662,0.682841,0.23988,-2.55074,0.455502,1.103101,1.460408,-1.147892,-1.129392,-0.42935,-0.575551,1.140118,0.279726,0.777319,-6.7074e-2,-1.127798,-2.228271,-0.578479,-1.641291,0.776947,0.372653,0.654082,-1.7981e-2,-0.764111,-0.630582,-0.123164,-0.763382,-1.43145,1.092311,0.974652,-0.548736,0.660927,-0.274718,1.5416651,0.450625,0.36228,-0.810577,0.156968,0.47419,-0.593522,1.777381,1.9001,-0.729995,0.567137,1.77529,-1.285679,1.749748,-1.2583361,0.989469,0.27894,-0.465374,-0.488536,0.665811,0.418114,1.462554,0.335251,2.40299,0.393666,-1.466521,-0.126054,-0.763374,2.121088,-0.416574,2.264181,8.2321e-2,-0.520006,-1.180747,-0.633615,-2.151889,0.402166,-0.195042,2.230828,2.399944,-0.692402,-0.162229,-5.7558e-2,0.174049,0.444863,-4.2691e-2,-0.19824,-0.367308,1.4657841,-1.7867739,1.093514,-0.856303,1.1065919,-0.290524,1.46904,-0.865654,-1.404295,0.847919,9.7521e-2,-0.333159,-0.993646,-1.143566,0.669345,1.569589,0.447966,-4.865e-2,2.059576,-1.2816e-2,-0.286836,-0.521384,2.739217,-0.477739,-4.075e-3,-0.164889,1.203063,-0.317745,-0.406169,0.633019,-0.497037,-0.728185,1.249597,0.92506,0.197087,-0.651183,0.539552,0.602599,-0.562677,-1.017254,2.45415,-0.112744,1.013038,-1.171895,0.553411,-0.142873,-0.187075,-1.131094,-0.841685,0.412923,0.270514,1.111905,-2.417977,0.984978,3.924e-3,-0.924147,-0.438564,-0.810727,1.351216,0.66382,1.175967,-0.407248,0.781496,0.16296,1.138742,-4.2322e-2,0.442418,0.646699,-0.517053,6.4634e-2,-0.307538,0.347724,1.005793,-0.208019,-0.597408,1.6408651,0.227081,-0.377023,0.428138,-0.132049,-0.886515,-0.180674,-0.24024,-0.936197,1.330593,0.440625,0.276915,0.760755,0.13696,0.545831,1.667585,1.737473,-1.254637,-1.294533,-0.964987,0.469358,-1.701826,-1.7836909,7.115e-3,-2.014121,-0.376815,0.11562,-0.140702,0.140048,0.131192,-0.40737,0.694377,0.52641,0.340887,7.1898e-2,-0.437718,0.415835,1.695116,0.367122,1.598791,-0.207826,0.488457,-0.84155,0.258079,3.4554e-2,-3.050739,5.527e-2,1.042438,-1.433486,0.207367,0.843444,0.623283,0.665856,-1.747095,-0.69142,1.021363,1.361615,0.280825,1.374338,1.401148,1.897727,2.216864,-2.64849,-1.212331,-0.780223,0.98407,-0.838865,0.916415,0.992718,-2.9265e-2,-0.358391,-0.447419,-0.325338,1.405591,0.968044,-0.821511,-1.800446,1.79877,0.759408,-0.32473,1.347627,-0.170958,-0.292201,1.9901149,1.830936,7.1057e-2,1.224062,1.908328,5.2218e-2,-0.318805,0.704243,-9.4564e-2,0.422375,1.586618,1.089697,-0.571568,-3.003727,-0.657189,0.112422,-0.416402,0.62239,1.481456,-0.837786,1.864841,2.002386,2.486594,-1.42535,-1.046819,-2.50074,-0.492231,-1.227192,-0.360028,-0.703424,1.6750281,-4.4736e-2,-0.748775,8.743e-3,0.775834,-1.089363,0.740386,1.525118,0.281176,1.7184219,-0.659537,-0.153709,-2.031314,-0.410772,1.5248699,-0.626564,1.411051,1.258134,1.6079099,-1.425969,1.002946,0.341494,-0.952398,-0.975116,-1.012157,-9.5074e-2,-2.479539,-0.655143,-1.031135,0.795973,0.20681,1.756088,-0.780688,0.390976,-0.93417,5.8291e-2,0.606265,2.046584,-1.207664,-0.560016,-0.512375,-2.24073,-2.918004,-1.3986e-2,-1.009882,-0.576508,0.503709,-0.47409,-0.577089,0.276813,-0.272422,0.613664,-1.254e-2,7.6242e-2,-0.371311,-0.500867,-0.674091,0.877008,1.125489,2.060458,-1.421852,1.120649,1.349898,-0.594968,-1.047639,0.306388,-1.251986,-0.202246,-0.856533,1.020165,-2.0325e-2,1.820871,0.912521,-5.9429e-2,1.132902,-0.674413,0.218215,0.845352,-0.342654,-2.320527,-9.413e-3,-5.606e-2,0.230135,-1.3299379,-0.748974,-1.675668,0.629524,0.722468,-0.790339,0.567432,-0.943679,-2.49556,-1.327819,1.342124,0.989372,-0.649975,1.590874,0.952475,-0.344123,-0.146827,0.412927,-1.5626581,-0.726911,-0.941348,-0.956505,0.477306,0.1041,-0.436985,0.370328,-0.911606,-1.519799,-0.118869,-1.167352,-1.037996,0.921823,-1.4819341,0.897508,-0.662986,-2.423165,0.2268,1.168007,1.9324191,-0.710893,-1.242518,0.4437,0.853337,1.5209479,0.33765,1.0888801,0.995861,-0.214627,0.282503,1.1797e-2,0.576552,0.372862,2.4421e-2,1.07646,1.0723e-2,0.602749,-0.579144,-1.775316,1.291527,0.67796,-1.079676,0.111742,1.109128,-0.427147,-1.256312,0.325869,-1.034902,0.501229,0.202837,0.817382,-1.7169139,-1.548145,0.391017,-0.522497,-1.295524,-0.463986,0.561743,-0.492543,1.828971,1.012713,2.605925,0.410401,-0.350495,0.614012,-0.753268,-0.395643,6.061e-2,0.386044,1.994117,-1.486058,0.910305,1.671051,0.291376,1.378265,-0.869301,1.410504,-0.645844,1.26368,-2.036335,-1.228401,2.687157,0.414916,-0.326202,-0.922502,0.295902,-1.709542,-0.565747,-0.85119,0.488239,0.50928,0.466828,1.551865,0.574965,0.305468,-0.271609,1.6368539,-0.918329,1.7476721,-0.483806,0.140414,0.59412,-0.667448,-1.384475,2.8276e-2,0.661311,1.0740271,-0.25585,1.405784,-4.7369e-2,0.473397,0.193933,-1.876394,-1.079883,1.766644,0.490159,0.582447,-0.550393,0.127244,0.538919,0.162896,-0.66167,-0.309354,-1.97015,2.52586,2.609092,-2.419333,0.619488,-0.46013,0.380081,-0.298418,0.321933,-0.598987,-0.719758,1.488091,1.4254761,0.381774,-0.651108,1.343363,0.168173,0.740556,-0.920689,1.476007,-0.389367,0.35296,0.480556,0.524088,-0.664521,0.731553,0.976035,0.228538,-1.455245,-1.215925,-0.7461,-1.240074,-1.707062,0.516365,-1.6225951,-1.476807,0.676145,1.748286,0.272745,2.226886,-0.930689,1.97394,-0.993759,0.781592,0.97075,0.408482,-3.1097e-2,2.13268,-0.691374,2.425006,0.382084,1.5841069,-1.47333,0.591686,0.209364,-3.5218e-2,-1.168597,-1.016285,-0.864086,-1.137366,1.266779,5.286e-3,-1.93759,1.546082,0.108398,1.271763,4.8317e-2,-0.21634,1.303939,-1.142741,1.311316,2.051579,-0.256556,-1.146276,0.871247,-1.006372,1.732616,-0.489749,-0.583404,1.098543,2.364612,0.179033,1.251404,-0.419145,1.768947,-0.569489,-0.96324,1.9307079,-0.120077,0.812505,0.377595,0.479006,-1.209788,2.543659,1.287611,0.144309,1.5268669,-1.006607,0.211452,-0.316528,0.304727,-0.789559,1.390947,-1.297785,-1.154026,-1.414346,-0.471536,-0.270746,1.7715731,-0.761872,0.463136,4.3234e-2,-0.272297,-0.666099,-0.835331,-1.363822,0.399226,0.1033,-0.140875,0.804887,-0.702804,1.640874,0.544116,0.817136,-0.493178,-0.443245,-0.112355,1.5730929,0.900909,-4.3938e-2,0.336218,1.127386,1.497695,0.5367,0.979811,-0.162961,0.884796,0.328296,8.1479e-2,1.6435239,0.285768,1.028139,-2.110324,0.154457,0.551292,1.6134009,-0.308444,1.74185,-0.624393,-0.950797,0.834728,1.096844,1.8092461,-1.263602,-0.319194,-1.358907,-0.485726,1.031327,0.916304,-0.135149,-0.311103,0.408386,7.3391e-2,0.154629,0.190425,-0.20427,0.710342,-0.798033,0.4156,0.945823,-2.378711,1.121962,-1.7296159,0.158246,0.348852,-0.559672,1.5545471,0.47164,-0.354604,0.811241,-1.303937,0.233458,-2.260891,0.175106,-1.429811,0.396795,0.476348,5.1929e-2,0.460365,0.503732,0.874039,0.147663,-0.160934,-0.339859,0.602541,0.188172,-1.001894,0.174502,0.949861,-0.946103,0.935831,1.018231,-1.045e-3,-0.833251,-0.628753,1.104887,-1.252976,-0.202311,0.290009,-0.742517,0.111719,0.533326,-0.40915,-4.6343e-2,-1.8329e-2,1.212681,0.438186,-0.149976,0.776052,-7.4962e-2,6.7911e-2,0.361587,-0.970316,0.697745,0.50942,1.5208321,-1.790393,-0.146924,1.818151,0.435166,1.160993,-0.290255,0.698371,1.6539841,-1.565575,0.824243,0.926859,-0.667728,-1.164535,-1.264703,1.593097,-1.507024,1.429962,1.427478,-0.95206,-0.462469,1.866076,0.296429,-0.147214,2.8662e-2,0.241104,-0.213853,-0.987176,-1.286907,-1.55095,-2.281599,0.19728,1.048936,-0.573408,-0.885769,-0.185063,0.249932,-0.266165,0.25379,3.45622,1.207095,0.385583,-5.5108e-2,0.386697,-0.885567,2.326527,-1.029277,1.001018,0.67325,0.946184,-0.842216,-1.390835,-0.295268,0.918067,-0.127028,1.23177,-0.120328,0.249015,1.49568,0.609435,-0.88214,-0.117904,-0.712492,7.9739e-2,-0.410533,-1.222103,0.657596,0.400276,1.415698,-0.869836,0.72335,1.185977,0.408701,-1.312178,-0.600989,-7.5575e-2,0.140535,-8.2945e-2,-0.117098,0.194508,1.2710509,0.90454,0.428682,0.270236,1.469233,0.274202,0.372474,-0.807852,0.903695,-1.619173,-1.997339,-1.644271,0.279665,-0.515162,-0.505147,-1.898762,-1.109476,0.85315,4.1763e-2,-1.234451,0.106958,2.061705,2.146114,-0.194492,-0.252709,0.825097,-0.98763,-0.227893,-1.154347,0.470981,-0.234181,0.19478,1.281048,0.488917,-0.196327,-0.697157,0.956338,-1.8828,1.191959,0.282994,1.278309,0.255343,-0.867477,-0.645494,4.4413e-2,2.25746,-1.484112,4.4252e-2,-0.284302,1.739499,1.157655,-0.248293,-0.569306,-2.366017,-1.182801,-0.463968,0.158839,0.965232,-0.847756,2.336049,0.56246,1.4652569,3.114171,-0.205564,3.2179e-2,7.7148e-2,-0.492201,-0.999449,-0.458503,0.792946,0.560063,0.783679,8.6632e-2,-0.920055,0.203042,-0.36707,-0.580465,0.782823,-0.229527,-0.140884,1.029897,0.748527,-1.197893,-1.218873,-0.762116,-1.324856,-1.6074e-2,1.37832,0.852484,0.143564,-1.261026,-1.5983989,0.828816,-1.243628,0.14456,1.2098451,-0.587588,-1.729234,-1.5343649,-0.573974,1.238075,-1.001345,-1.359229,-2.460609,0.936906,-0.555396,-0.324581,-1.422083,-0.295702,-0.205674,-6.0862e-2,-0.224466,-1.2796891,0.388815,-0.447613] :: Array (Z :. Int :. Int) Float)
        a26 =
          fold
            (\x169 x170 -> x169 + x170)
            (0.0 :: Exp Float)
            (generate
               (let shp = (let T2 (T2 (T2 _ x13) x14) x15 = let I3 x16 x17 x18 = indexFull (I3 (let T2 (T2 _ x19) _ = let I2 x20 x21 = shape a8 in T2 (T2 (constant ()) x20) x21 in x19) (constant All) (constant All)) (shape a6) in T2 (T2 (T2 (constant ()) x16) x17) x18
                               T2 (T2 (T2 _ x22) x23) x24 = let I3 x25 x26 x27 = indexFull (I3 (constant All) (let T2 _ x28 = let I1 x29 = shape a5 in T2 (constant ()) x29 in x28) (constant All)) (shape a8) in T2 (T2 (T2 (constant ()) x25) x26) x27
                           in I3 (min x22 x13) (min x23 x14) (min x24 x15))
                    T2 (T2 (T2 _ x137) x138) x139 =
                        let I3 x140 x141 x142 =
                                let T2 (T2 (T2 (T2 _ x113) x114) x115) _ =
                                        let I4 x117 x118 x119 x120 = indexFull (I4 (constant All) (constant All) (let T2 _ x101 = let I2 x102 x103 = shape a8 in T2 (T2 (constant ()) x102) x103 in x101) (constant All)) shp :: Exp DIM4 in T2 (T2 (T2 (T2 (constant ()) x117) x118) x119) x120
                                    T2 (T2 (T2 (T2 _ x121) x122) x123) _ =
                                        let I4 x125 x126 x127 x128 =
                                                (let T2 x79 x80 = let T2 (T2 _ x81) x82 = let I2 x83 x84 = shape a8 in T2 (T2 (constant ()) x83) x84 in T2 x81 x82 in I4 x79 (let T2 _ x85 = let I1 x86 = shape a5 in T2 (constant ()) x86 in x85) x80 x80)
                                        in T2 (T2 (T2 (T2 (constant ()) x125) x126) x127) x128
                                in I3 (min x121 x113) (min x122 x114) (min x123 x115)
                        in T2 (T2 (T2 (constant ()) x140) x141) x142
                    T2 (T2 (T2 _ x143) x144) x145 =
                      let T2 (T2 (T2 _ x146) x147) x148 = let I3 x149 x150 x151 = shp in T2 (T2 (T2 (constant ()) x149) x150) x151
                          T2 (T2 (T2 _ x152) x153) x154 = let I3 x155 x156 x157 = (indexFull (I3 (let T2 (T2 _ x42) _ = let I2 x43 x44 = shape a8 in T2 (T2 (constant ()) x43) x44 in x42) (constant All) (constant All)) (I2 (let I1 x2 = shape a5 in x2) (let I2 _ x5 = shape a8 in x5))) in T2 (T2 (T2 (constant ()) x155) x156) x157
                      in T2 (T2 (T2 (constant ()) (min x152 x146)) (min x153 x147)) (min x154 x148)
                in I3 (min x143 x137) (min x144 x138) (min x145 x139))
               (const 0))
        a27 =
          generate
            (let T2 (T2 _ x177) x178 = let I2 x179 x180 = shape a26 in T2 (T2 (constant ()) x179) x180
                 T2 (T2 _ x181) x182 =
                   let I2 x183 x184 =
                         indexFull
                           (I2 (let T2 (T2 _ x185) _ = let I2 x186 x187 = shape a8 in T2 (T2 (constant ()) x186) x187 in x185) (constant All))
                           (shape a5)
                   in T2 (T2 (constant ()) x183) x184
             in I2 (min x181 x177) (min x182 x178))
            (\(I2 x192 x193) ->
               let T2 x194 _ =
                     let x195 =
                           let T2 _ x196 = let I1 x197 = indexSlice (I2 (let T2 (T2 _ x198) _ = let I2 x199 x200 = shape a8 in T2 (T2 (constant ()) x199) x200 in x198) (constant All)) (I2 x192 x193) in T2 (constant ()) x197
                               T2 x201 _ =
                                 let x202 = a5 ! I1 x196
                                     x203 = 0
                                     x204 = x202 + x203
                                 in T2 x204 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (constant ()) x202) x203) x202) x203) x204) x202) x203) x202) x203)
                           in x201
                         x205 =
                           let x206 = a26 ! I2 x192 x193
                               T2 x207 _ = let x208 = (0.5 :: Exp Float) * x206 in T2 x208 (T2 (T2 (T2 (T2 (T2 (T2 (constant ()) x206) x208) x206) (0.5 :: Exp Float)) x206) (0.5 :: Exp Float))
                           in x207
                         x209 = x195 - x205
                     in T2 x209 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (constant ()) x195) x205) x195) x205) x209) x195) x205) x195) x205)
               in x194)
        a28 = fold1 (\x210 x211 -> max x210 x211) a27
        a29 =
          generate
            (let T2 (T2 _ x212) x213 = let I2 x214 x215 = indexFull (I2 (constant All) (let T2 _ x216 = let I2 x217 x218 = shape a27 in T2 (T2 (constant ()) x217) x218 in x216)) (shape a28) in T2 (T2 (constant ()) x214) x215
                 T2 (T2 _ x219) x220 = let I2 x221 x222 = shape a27 in T2 (T2 (constant ()) x221) x222
             in I2 (min x219 x212) (min x220 x213))
            (\(I2 x223 x224) ->
               let T2 x225 _ =
                     let x226 = a27 ! I2 x223 x224
                         x227 = a28 ! indexSlice (I2 (constant All) (let T2 _ x228 = let I2 x229 x230 = shape a27 in T2 (T2 (constant ()) x229) x230 in x228)) (I2 x223 x224)
                         x231 = x226 - x227
                     in T2 x231 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (constant ()) x226) x227) x226) x227) x231) x226) x227) x226) x227)
               in x225)
        a30 =
          fold
            (\x232 x233 -> x232 + x233)
            (0.0 :: Exp Float)
            (generate
               (shape a29)
               (\(I2 x234 x235) ->
                  let x236 = a29 ! I2 x234 x235
                      T2 x237 _ = let x238 = exp x236 in T2 x238 (T2 (T2 (T2 (constant ()) x236) x238) x236)
                  in x237))
        a43 = generate Z_ (\Z_ -> let x351 = 1.0 :: Exp Float in T2 (T2 x351 x351) (constant ()))
        a44 = map (\(T2 (T2 x352 _) _) -> x352) a43
        a46 = generate Z_ (\Z_ -> let x354 = a44 ! Z_ in T2 (T2 x354 (-x354)) (constant ()))
        a47 = map (\(T2 (T2 x355 _) _) -> x355) a46
        a49 =
          generate
            (let T2 _ x357 = let I1 x358 = shape a28 in T2 (constant ()) x358
                 T2 _ x359 = let I1 x360 = shape a30 in T2 (constant ()) x360
                 T2 _ x361 =
                   let T2 _ x362 = let I1 x363 = shape a28 in T2 (constant ()) x363
                       T2 _ x364 = let I1 x365 = shape a30 in T2 (constant ()) x365
                   in T2 (constant ()) (min x364 x362)
             in I1 (min x361 (min x359 x357)))
            (\(I1 x366) ->
               let x367 =
                     cond
                       ((<) x366
                            (let T2 _ x375 =
                                   let I1 x376 =
                                         indexFull
                                           (I1 (let T2 _ x377 =
                                                      let T2 _ x378 = let I1 x379 = shape a28 in T2 (constant ()) x379
                                                          T2 _ x380 = let I1 x381 = shape a30 in T2 (constant ()) x381
                                                      in T2 (constant ()) (min x380 x378)
                                                in x377))
                                           Z_
                                   in T2 (constant ()) x376
                             in x375))
                       (a47 ! Z_)
                       (0.0 :: Exp Float)
               in T2 (T2 x367 x367) (constant ()))
        a50 = map (\(T2 (T2 x382 _) _) -> x382) a49
        a51 = map (\(T2 (T2 _ x383) _) -> x383) a49
        a52 =
          generate
            (let T2 (T2 _ x384) x385 = let I2 x386 x387 = indexFull (I2 (constant All) (let T2 _ x388 = let I2 x389 x390 = shape a27 in T2 (T2 (constant ()) x389) x390 in x388)) (shape a28) in T2 (T2 (constant ()) x386) x387
                 T2 (T2 _ x391) x392 = let I2 x393 x394 = shape a27 in T2 (T2 (constant ()) x393) x394
                 T2 (T2 _ x395) x396 = let I2 x397 x398 = shape a29 in T2 (T2 (constant ()) x397) x398
             in I2 (min x395 (min x391 x384)) (min x396 (min x392 x385)))
            (\(I2 x399 x400) ->
               let x401 =
                     cond
                       (let T2 x402 x403 =
                              let T2 (T2 _ x404) x405 =
                                    let T2 (T2 _ x406) x407 = let I2 x408 x409 = shape a29 in T2 (T2 (constant ()) x408) x409
                                        T2 (T2 _ x410) x411 = let I2 x412 x413 = shape a29 in T2 (T2 (constant ()) x412) x413
                                    in T2 (T2 (constant ()) (min x410 x406)) (min x411 x407)
                              in T2 x404 x405
                        in x399 < x402 && x400 < x403)
                       (let T2 x414 _ =
                              let T2 (T2 _ x415) _ =
                                    let x416 = a29 ! I2 x399 x400
                                        T2 _ (T2 (T2 (T2 _ x417) x418) x419) = let x420 = exp x416 in T2 x420 (T2 (T2 (T2 (constant ()) x416) x420) x416)
                                    in T2 (T2 (T2 (constant ()) x417) x418) x419
                              in T2 ((*) (cond
                                            (let T2 x456 x457 = let T2 (T2 _ x458) x459 = let I2 x460 x461 = indexFull (I2 (constant All) (let T2 _ x462 = let I2 x463 x464 = shape a29 in T2 (T2 (constant ()) x463) x464 in x462)) (shape a30) in T2 (T2 (constant ()) x460) x461 in T2 x458 x459 in x399 < x456 && x400 < x457)
                                            (let T2 _ x465 = let I1 x466 = indexSlice (I2 (constant All) (let T2 _ x467 = let I2 x468 x469 = shape a29 in T2 (T2 (constant ()) x468) x469 in x467)) (I2 x399 x400) in T2 (constant ()) x466
                                             in cond
                                                  ((<) x465
                                                       (let T2 _ x475 =
                                                              let T2 _ x476 = let I1 x477 = shape a30 in T2 (constant ()) x477
                                                                  T2 _ x478 = let I1 x479 = shape a30 in T2 (constant ()) x479
                                                              in T2 (constant ()) (min x478 x476)
                                                        in x475))
                                                  (let T2 x480 _ =
                                                         let T2 _ x481 =
                                                               let x482 = a30 ! I1 x465
                                                                   T2 _ (T2 (T2 (T2 _ x483) x484) x485) = let x486 = log x482 in T2 x486 (T2 (T2 (T2 (constant ()) x482) x486) x482)
                                                               in T2 (T2 (T2 (constant ()) x483) x484) x485
                                                         in T2 (cond (x465 < (let T2 _ x487 = let I1 x488 = shape a30 in T2 (constant ()) x488 in x487)) (cond (x465 < (let T2 _ x489 = let I1 x490 = shape a50 in T2 (constant ()) x490 in x489)) (a50 ! I1 x465) (0.0 :: Exp Float)) (0.0 :: Exp Float) / x481) (constant ())
                                                   in x480)
                                                  (0.0 :: Exp Float))
                                            (0.0 :: Exp Float))
                                         x415)
                                    (constant ())
                        in x414)
                       (0.0 :: Exp Float)
               in T2 (T2 x401 (-x401)) (constant ()))
        a54 = map (\(T2 (T2 _ x492) _) -> x492) a52
        a56 = fold1 (\x507 x508 -> x507 + x508) (generate (indexFull (I2 (constant All) (let T2 _ x509 = let I2 x510 x511 = shape a27 in T2 (T2 (constant ()) x510) x511 in x509)) (shape a28)) (\(I2 x512 x513) -> cond (let T2 x514 x515 = let T2 (T2 _ x516) x517 = let I2 x518 x519 = indexFull (I2 (constant All) (let T2 _ x520 = let I2 x521 x522 = shape a27 in T2 (T2 (constant ()) x521) x522 in x520)) (shape a28) in T2 (T2 (constant ()) x518) x519 in T2 x516 x517 in x512 < x514 && x513 < x515) (cond (let T2 x523 x524 = let T2 (T2 _ x525) x526 = let I2 x527 x528 = shape a54 in T2 (T2 (constant ()) x527) x528 in T2 x525 x526 in x512 < x523 && x513 < x524) (a54 ! I2 x512 x513) (0.0 :: Exp Float)) (0.0 :: Exp Float)))
        a57 = generate (shape a28) (\(I1 x529) -> cond (x529 < (let T2 _ x530 = let I1 x531 = shape a56 in T2 (constant ()) x531 in x530)) (a56 ! I1 x529) (0.0 :: Exp Float))
        a58 = generate (shape a28) (\(I1 x532) -> cond (x532 < (let T2 _ x533 = let I1 x534 = shape a28 in T2 (constant ()) x534 in x533)) (cond (x532 < (let T2 _ x535 = let I1 x536 = shape a51 in T2 (constant ()) x536 in x535)) (a51 ! I1 x532) (0.0 :: Exp Float)) (0.0 :: Exp Float))
        a59 = scanl1 (\x537 x538 -> max x537 x538) a27
        a60 = backpermute (let T2 x539 x540 = let T2 (T2 _ x541) x542 = let I2 x543 x544 = shape a59 in T2 (T2 (constant ()) x543) x544 in T2 x541 x542 in I2 x539 ((-1 :: Exp Int) + x540)) (\(I2 x545 x546) -> I2 x545 x546) a59
        a61 =
          scanr
            (\x547 x548 -> x547 * x548)
            (1.0 :: Exp Float)
            (generate
               (let T2 x549 x550 = let T2 (T2 _ x551) x552 = let I2 x553 x554 = shape a27 in T2 (T2 (constant ()) x553) x554 in T2 x551 x552
                    T2 (T2 _ x555) x556 = let I2 x557 x558 = shape a60 in T2 (T2 (constant ()) x557) x558
                in I2 (min x555 x549) (min x556 ((-1 :: Exp Int) + x550)))
               (\(I2 x559 x560) -> let T2 x561 _ = cond (a60 ! I2 x559 x560 > a27 ! I2 x559 ((1 :: Exp Int) + x560)) (T2 (1.0 :: Exp Float) (0.0 :: Exp Float)) (T2 (0.0 :: Exp Float) (1.0 :: Exp Float)) in x561))
    in
          generate
            (shape a27)
            (\(I2 x562 x563) ->
               cond
                 (let T2 x564 x565 =
                        let T2 (T2 _ x566) x567 =
                              let T2 (T2 _ x568) x569 =
                                    let T2 x570 x571 =
                                          let T2 (T2 _ x572) x573 =
                                                let T2 x574 x575 = let T2 (T2 _ x576) x577 = let I2 x578 x579 = shape a27 in T2 (T2 (constant ()) x578) x579 in T2 x576 x577
                                                    T2 (T2 _ x580) x581 = let I2 x582 x583 = shape a60 in T2 (T2 (constant ()) x582) x583
                                                in T2 (T2 (constant ()) (min x580 x574)) (min x581 ((-1 :: Exp Int) + x575))
                                          in T2 x572 x573
                                        T2 (T2 _ x584) x585 = let I2 x586 x587 = shape a61 in T2 (T2 (constant ()) x586) x587
                                    in T2 (T2 (constant ()) (min x570 x584)) (min ((1 :: Exp Int) + x571) x585)
                                  T2 (T2 _ x588) x589 =
                                    let I2 x590 x591 =
                                          indexFull
                                            (I2 (constant All)
                                                (let T2 _ x592 =
                                                       let T2 x593 x594 =
                                                             let T2 (T2 _ x595) x596 =
                                                                   let T2 x597 x598 = let T2 (T2 _ x599) x600 = let I2 x601 x602 = shape a27 in T2 (T2 (constant ()) x601) x602 in T2 x599 x600
                                                                       T2 (T2 _ x603) x604 = let I2 x605 x606 = shape a60 in T2 (T2 (constant ()) x605) x606
                                                                   in T2 (T2 (constant ()) (min x603 x597)) (min x604 ((-1 :: Exp Int) + x598))
                                                             in T2 x595 x596
                                                           T2 (T2 _ x607) x608 = let I2 x609 x610 = shape a61 in T2 (T2 (constant ()) x609) x610
                                                       in T2 (T2 (constant ()) (min x593 x607)) (min ((1 :: Exp Int) + x594) x608)
                                                 in x592))
                                            (shape a28)
                                    in T2 (T2 (constant ()) x590) x591
                              in T2 (T2 (constant ()) (min x588 x568)) (min x589 x569)
                        in T2 x566 x567
                  in x562 < x564 && x563 < x565)
                 ((*) (let T2 _ x644 =
                             let I1 x645 =
                                   indexSlice
                                     (I2 (constant All)
                                         (let T2 _ x646 =
                                                let T2 x647 x648 =
                                                      let T2 (T2 _ x649) x650 =
                                                            let T2 x651 x652 = let T2 (T2 _ x653) x654 = let I2 x655 x656 = shape a27 in T2 (T2 (constant ()) x655) x656 in T2 x653 x654
                                                                T2 (T2 _ x657) x658 = let I2 x659 x660 = shape a60 in T2 (T2 (constant ()) x659) x660
                                                            in T2 (T2 (constant ()) (min x657 x651)) (min x658 ((-1 :: Exp Int) + x652))
                                                      in T2 x649 x650
                                                    T2 (T2 _ x661) x662 = let I2 x663 x664 = shape a61 in T2 (T2 (constant ()) x663) x664
                                                in T2 (T2 (constant ()) (min x647 x661)) (min ((1 :: Exp Int) + x648) x662)
                                          in x646))
                                     (I2 x562 x563)
                             in T2 (constant ()) x645
                       in cond (x644 < max (let T2 _ x665 = let I1 x666 = shape a58 in T2 (constant ()) x666 in x665) (let T2 _ x667 = let I1 x668 = shape a57 in T2 (constant ()) x668 in x667)) (cond ((0 :: Exp Int) == (let T2 _ x669 = let I1 x670 = shape a58 in T2 (constant ()) x670 in x669)) (a57 ! I1 x644) (cond ((0 :: Exp Int) == (let T2 _ x671 = let I1 x672 = shape a57 in T2 (constant ()) x672 in x671)) (a58 ! I1 x644) (a58 ! I1 x644 + a57 ! I1 x644))) (0.0 :: Exp Float))
                      ((*) (cond
                              (x563 > (0 :: Exp Int))
                              (let x675 = (-1 :: Exp Int) + x563
                                   T2 _ x676 = cond (a60 ! I2 x562 x675 > a27 ! I2 x562 ((1 :: Exp Int) + x675)) (T2 (1.0 :: Exp Float) (0.0 :: Exp Float)) (T2 (0.0 :: Exp Float) (1.0 :: Exp Float))
                               in x676)
                              (1.0 :: Exp Float))
                           (a61 ! I2 x562 x563)))
                 (0.0 :: Exp Float))
N2.hs
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TypeApplications #-}
module N2 (program2) where

import Data.Array.Accelerate
import Prelude ()


class (Slice slix, Shape sl, Shape sh) => SliceExt slix sl sh where
    indexFull :: Exp slix -> Exp sl -> Exp sh
    indexSlice :: Exp slix -> Exp sh -> Exp sl

instance SliceExt Z Z Z where
    indexFull Z_ Z_ = Z_
    indexSlice Z_ Z_ = Z_

instance SliceExt slix sl sh => SliceExt (slix :. All) (sl :. Int) (sh :. Int) where
    indexFull (slix ::. _) (sl ::. n) = indexFull slix sl ::. n
    indexSlice (slix ::. _) (sh ::. n) = indexSlice slix sh ::. n

instance SliceExt slix sl sh => SliceExt (slix :. Int) sl (sh :. Int) where
    indexFull (slix ::. n) sl = indexFull slix sl ::. n
    indexSlice (slix ::. _) (sh ::. _) = indexSlice slix sh

{-# NOINLINE program2 #-}
program2 :: Acc ((((), Vector Float), Matrix Float), Matrix Float)
program2 =
    let T2 (T2 _ _) (T2 (T2 (T2 _ a2) a3) a4) =
          let a5 = use (fromList (Z :. 5) [-0.649014,1.1811659,-0.758453,-1.109613,-0.845551] :: Array (Z :. Int) Float)
              a6 = use (fromList (Z :. 5 :. 2) [0.345561,0.396767,0.538817,0.419195,0.68522,0.204452,0.878117,2.7388e-2,0.670468,0.417305] :: Array (Z :. Int :. Int) Float)
              a7 = use (fromList (Z :. 5 :. 3) [0.166813,-1.965419,-1.270071,1.175171,2.02916,-0.275157,0.603658,1.781252,1.773658,-1.865123,-1.051107,-0.417382,1.402162,-1.3677471,-0.292535] :: Array (Z :. Int :. Int) Float)
              a8 = use (fromList (Z :. 1000 :. 2) [1.270848,6.6009e-2,0.45129,-0.32221,0.788409,0.928736,-0.49079,1.7972009,0.590697,-0.635786,0.603347,-0.535248,-0.15508,0.612122,-1.044343,-0.345632,-1.171405,-0.685587,0.926216,-1.481675,-0.558058,-2.8453e-2,-1.476292,0.2589,-2.018691,0.19974,0.425864,-1.270043,-0.485219,0.594308,-0.276465,-1.857583,4.0731e-2,0.28297,6.3561e-2,0.43343,0.42286,1.299528,-1.049793,-1.786412,0.816043,-0.328209,-1.214566,1.111833,-0.507497,0.89873,0.377216,1.452392,0.446945,0.645825,-0.623677,-0.595236,1.6113241,-0.348998,0.164167,-1.636577,0.581366,-0.128906,0.432859,-0.245109,-1.08543,1.680802,0.176412,-2.07144,0.211089,-0.582848,1.8169e-2,1.494778,-0.424797,1.686243,0.36549,-1.097061,1.930213,0.622936,0.657284,-1.463383,0.853935,0.580489,-0.918601,0.794865,0.517535,0.494614,0.66393,-0.710172,-1.306838,-0.741589,-1.467659,-0.391675,0.841659,8.2784e-2,0.314671,0.789805,-0.801224,-0.325654,0.284676,1.309618,0.160373,-2.118188,0.707081,-1.043414,1.068207,-0.317234,1.479677,0.699088,0.159099,-0.945481,-0.793007,-2.049239,-2.358835,-1.659269,-0.958124,0.22573,0.217665,-0.823239,-1.012768,1.215258,0.156275,-0.400257,-0.441779,0.448102,-1.6645911,0.21489,0.549563,1.392338,-0.619228,-1.2601e-2,0.773612,1.629212,-1.409975,-1.747283,-0.472246,-6.0088e-2,0.438879,0.201222,-0.583298,0.764797,0.14077,-0.372937,0.105467,1.270624,0.49913,-0.397025,-1.789968,-0.266894,0.178431,-0.434192,0.464513,-1.121445,-0.359075,0.532267,-1.643508,0.466899,0.112107,1.496544,-0.586502,-1.7189319,0.74104,1.087696,0.75667,1.629694,-1.374993,-1.052011,0.477518,1.222177,2.370732,0.114586,0.279069,0.75208,-0.260257,-2.5993e-2,9.6724e-2,0.144143,1.856209,1.100335,-0.364107,0.471993,-0.839107,-0.523633,-1.388766,4.248e-3,-1.404783,2.629018,0.819529,-1.443411,-0.499729,-0.517959,-1.802747,0.988435,-0.360753,1.132659,0.409018,0.819121,0.319661,2.415006,-0.114032,0.118016,0.999691,-0.357659,-5.5026e-2,0.241456,-2.73518,0.193514,-0.145396,1.454576,-0.396689,1.728903,0.251893,-0.618553,0.976329,0.130991,-0.364357,-9.3312e-2,0.489806,1.401431,-0.274223,0.675816,0.190581,0.670363,0.208357,0.327875,-0.823197,0.331906,0.343914,0.379748,1.088939,0.994859,0.20861,-0.399188,0.506011,-0.127763,-0.254921,-7.8043e-2,-0.314649,-0.308418,0.401268,-0.129421,1.327683,0.670787,-0.691715,-4.9218e-2,-0.326731,0.303248,2.0565,1.707191,0.510742,-0.187689,-0.589429,1.143276,0.130368,0.586463,0.103399,0.264541,5.4799e-2,0.221252,9.1006e-2,-0.150115,-0.561297,-1.799185,-0.470727,-0.902588,0.547841,-0.735208,1.475863,0.505823,0.692664,0.134881,-1.06878,-0.167592,-0.462884,-1.263564,0.420394,-0.324321,1.341096,1.213663,-0.502785,-1.116363,-0.922072,-1.042e-3,0.15349,-0.90397,-0.938332,0.433891,-0.153153,0.402438,-0.652552,-1.957691,6.7693e-2,-4.732e-2,-0.696919,0.457548,7.9304e-2,0.479593,-2.360392,0.444008,-0.324989,9.7206e-2,1.114805,-1.157063,-0.475713,0.522585,0.887144,1.6548e-2,0.902542,1.154784,0.872534,-0.469163,0.596529,0.836092,0.304493,1.155324,-1.571514,1.636478,0.554831,-0.585432,-0.510444,0.492702,-0.650826,0.926873,-0.188116,0.320829,1.420298,-1.189962,-0.928444,1.309552,0.115346,2.828126,0.274099,0.115688,-1.070368,-0.709702,-1.513138,-1.136958,1.272192,-1.144058,-0.526164,1.5781779,0.578636,0.578573,-1.422806,-0.190392,0.186023,1.483995,-0.679469,-0.530061,-0.859494,1.306356,-8.633e-2,-2.150373,2.5232e-2,-1.135619,0.714953,-0.616843,-0.955457,0.13556,0.637969,-0.366977,1.06141,5.6378e-2,8.5413e-2,1.836021,0.675363,-1.545835,0.353632,-9.244e-2,0.638395,-0.86296,-0.886446,-1.223166,-0.185643,-1.720509,0.151805,0.816508,0.577798,1.063851,-0.803239,0.798627,-0.315092,1.186064,8.4939e-2,-1.424976,-1.454111,-1.8093159,-1.462947,-0.138068,-1.005592,-2.733304,1.692405,-0.283386,1.122142,-0.306948,-0.168531,-8.1308e-2,-3.7718e-2,2.091389,-0.41063,2.95757,-1.687389,0.290257,-1.469352,0.449062,-1.695895,6.0461e-2,-1.147612,1.9939361,0.920892,1.6227009,-0.487547,-1.195582,-1.4194701,0.46822,1.329924,2.304717,0.851429,0.521839,3.201293,-0.330453,-0.896356,-0.99395,-1.871669,1.497869,-1.632447,-0.851817,1.0774,-0.440099,3.327984,0.103796,-0.773079,0.677374,-0.696817,-7.5351e-2,2.6019e-2,2.005536,-1.129631,0.654237,1.419167,-0.825613,5.3107e-2,-0.855855,1.768118,0.182871,0.431022,-0.228818,0.393997,-0.525875,-2.44696,0.155245,-0.834079,7.8468e-2,1.31271,-0.135124,-1.409995,-0.162703,2.109836,1.4625859,0.914106,1.512145,-0.454165,-1.139403,-0.705497,-0.331098,-1.520792,0.165279,-0.48787,0.586965,-0.903369,0.371008,-1.260143,0.222889,-0.413064,-1.016668,-0.326023,0.283502,-1.1569e-2,3.6267e-2,-1.098303,0.375683,0.170055,1.139668,1.657464,0.338248,-1.8189709,-0.802271,-0.574424,-0.234256,-0.305201,1.639446,-1.897236,1.3185201,0.532359,0.601598,0.467189,0.208181,-5.7599e-2,-3.065186,-0.612494,-1.6162e-2,0.7769,-9.0006e-2,-0.148789,-0.887773,-0.776091,0.629228,-1.31584,0.898735,-0.825132,-0.575501,2.5326e-2,0.562567,-0.172096,-0.648153,-0.153145,1.7124e-2,0.827807,0.698925,-1.006189,-2.244176,0.102301,0.901808,-3.005798,0.659237,0.760341,-0.169916,0.708616,0.628756,-0.763568,1.187671,1.163956,0.43791,0.764358,0.172088,-0.635979,0.263635,0.557991,-0.323506,0.23893,-0.668543,0.54218,-0.734938,0.616388,-0.228798,0.821,-0.155227,-1.308308,0.777575,-1.180115,0.287776,0.449292,-0.536068,-0.920966,-0.686498,-1.09287,-0.488991,-0.918765,-2.031704,0.639006,1.135888,-0.785609,-1.012202,-1.008377,1.52116,0.66327,7.1216e-2,-0.584426,1.01464,-0.226944,0.644054,0.200877,-2.9035e-2,-0.992314,1.983578,-0.939563,-1.609478,-0.219788,-0.27741,-0.880145,0.583931,-0.36393,0.41669,1.286826,-1.4039149,0.444248,1.440858,0.332877,0.515995,-0.232061,0.602345,0.612538,-0.392011,0.710826,-1.8948231,1.358329,-0.911798,-0.149636,-0.40114,-0.577582,2.003854,-0.509643,8.8893e-2,-1.9698e-2,-0.738074,-1.152164,-1.947602,2.6296e-2,-0.825893,-0.717992,-1.940978,0.987546,-1.6631169,2.063314,-2.082036,0.273162,-2.376736,0.379466,-0.99132,9.4217e-2,0.643802,-0.782961,0.148621,-0.920779,1.191122,0.980936,-0.723429,2.334377,-2.551227,0.902509,0.227135,-0.351252,0.527464,0.874846,3.068098,-0.618881,0.757522,1.028627,5.284e-2,0.210857,1.152476,-0.352294,0.51556,0.962176,0.387157,-0.225196,0.249426,-1.916009,0.711205,1.5629029,-0.825379,-0.568134,-0.723674,-1.008999,0.730514,8.521e-2,-0.427966,-0.596362,-0.745602,0.642888,-0.193149,-0.12576,-7.3857e-2,1.122151,-0.252944,-0.395011,0.393903,-0.678536,-0.165741,-0.509151,0.489158,1.226135,-0.152181,0.838969,-6.6415e-2,0.882032,-0.614498,-0.113187,0.752232,0.502254,1.7715139,2.5691e-2,-5.188e-3,1.034393,-1.6025829,0.322434,2.312027,2.5913e-2,-0.50997,1.390458,-1.457564,0.666306,0.22473,2.098755,0.479445,0.650313,-1.7261469,1.6036711,-0.54618,-0.510315,2.098672,1.02184,-0.204025,-1.148959,1.057324,-7.0703e-2,-1.6616449,1.725458,0.981133,-1.8408e-2,1.300162,-0.282012,0.242475,-0.273552,1.8418e-2,-1.537433,2.541337,-0.42599,-1.305117,-0.607644,-1.881951,0.389123,2.7765e-2,1.4656e-2,1.476658,0.2532,0.653493,-0.165081,0.53632,-0.559253,-0.431607,-1.8708279,-0.473182,-1.195105,-0.294704,0.711937,-0.31718,1.345581,0.431573,-0.290225,0.804784,0.349499,-0.674941,1.159802,-3.8383e-2,-0.497727,-0.165461,0.255275,-0.514031,1.049777,-0.297014,0.207544,-1.6294e-2,0.885397,1.70028,-1.692024,0.187102,1.299425,-0.177342,1.266924,-0.642952,0.58898,0.491726,-0.317791,-1.080348,-0.236695,1.037509,-0.505673,1.14925,-1.6583381,-0.658551,-1.174728,0.405981,0.561162,0.763683,-0.251252,0.580274,-0.859688,-0.241693,-0.235381,-0.518473,-0.949763,0.239594,0.558733,0.350337,0.275183,-1.081674,-1.534654,2.4216e-2,1.5714281,-2.038232,-0.205198,-0.179022,-1.0316e-2,-1.244388,-0.704389,-1.0942659,1.129088,1.118448,-0.225268,7.1858e-2,-1.379221,2.9911e-2,-0.397478,1.6917751,0.755117,0.523884,-0.474369,-1.975e-2,3.137981,1.552722,6.2457e-2,0.446259,0.216111,-0.165013,-0.261181,0.128395,0.842844,0.764314,0.220261,1.04058,-1.32476,0.635503,-1.677369,-0.31441,-0.596958,0.417571,-2.304534,-0.775047,-1.620703,0.427633,0.236062,-0.179066,-0.206452,1.218866,-3.9144e-2,7.8823e-2,-0.684109,0.108209,-0.19316,-0.181832,-0.400381,-0.209644,-0.103754,1.330781,-0.541981,0.979114,0.275543,1.4491379,-0.307006,-0.726711,1.278873,-2.764208,-0.568166,2.763304,6.0634e-2,-2.063403,3.064e-2,0.326295,0.731459,1.354879,-0.215322,0.536494,0.574383,-1.5417e-2,5.9954e-2,-0.917658,-0.524292,-1.050423,0.30608,-5.759e-2,-0.177815,1.48189,0.131511,-5.2032e-2,-0.550095,-1.733962,-0.387419,-2.365146,-0.571256,1.0069e-2,1.255723,-0.820761,0.30546,-2.9e-5,-2.243771,-1.863345,-0.195606,1.225722,-0.603548,0.678204,-0.726321,-1.072731,-1.302486,-0.22962,-0.656655,0.381522,-1.4487879,-0.978113,-1.224376,-1.077053,0.623583,-0.457896,-0.561759,0.136208,1.021503,1.936089,1.5613561,1.359023,-1.864756,-1.717061,-6.1872e-2,-0.705292,1.107436,-4.4768e-2,0.118538,0.87822,-7.9947e-2,0.590146,-0.554747,-0.615667,-0.68904,0.116539,-0.855605,0.796908,-2.464211,-0.474592,0.563042,-0.552889,-0.294927,0.124951,0.109075,-1.119832,0.472949,1.7786369,0.800018,-0.658022,0.107852,-0.517307,0.119842,1.930902,-0.532678,0.922536,-1.036749,0.27965,-0.523115,0.546274,0.705333,0.46846,-0.100024,-1.067891,-2.588719,-0.448819,-1.440259,0.934778,0.375977,-0.251271,0.496861,9.2671e-2,-1.964326,-0.401108,-1.093911,-0.678303,-1.970043,0.30721,4.692e-2,0.215869,-0.237293,1.666002,-0.222967,-1.370886,0.856108,0.721929,0.712895,0.644424,-1.29445,-0.82793,-0.564768,-0.228959,0.855717,-1.301764,-7.3907e-2,-2.197588,0.864011,0.645328,-1.193955,-3.4896e-2,-0.712788,2.619028,2.79465,0.629131,1.825779,-0.151243,1.098892,-0.350638,-1.181074,1.6136861,0.412021,-1.347839,1.385443,0.700463,0.322197,0.174338,-0.73382,0.22769,1.197335,-1.436389,-1.569608,1.14647,0.454343,0.142179,-0.800425,-1.156936,0.907952,-0.318833,-1.3671579,0.556305,-0.706028,1.149258,1.3797,-1.7873e-2,0.268011,3.3642e-2,0.388377,0.689099,-0.878603,1.070225,0.16491,-1.385081,-0.990824,0.378418,-1.299425,-0.983455,-1.006416,1.5848429,0.483581,0.959621,-0.545966,0.265402,0.337074,0.375951,-1.049269,1.073903,1.400704,7.8071e-2,-1.111087,0.929832,-1.4069281,-0.490442,0.796461,0.320721,1.824993,0.125838,1.283284,0.940283,-0.912691,-0.537827,0.273043,-0.188873,-2.040028,0.543943,-0.989055,-1.3856909,1.05535,-1.763258,-0.91417,-2.565918,1.4272981,9.8617e-2,-0.67137,0.860693,3.3095e-2,-0.177832,0.471082,-0.714685,-1.025397,-0.631256,-0.370778,0.503666,0.334579,-1.210928,2.202782,0.739613,0.51102,0.60955,-1.249831,-6.9658e-2,-0.194669,0.408094,-0.131232,0.345063,0.567662,0.682841,0.23988,-2.55074,0.455502,1.103101,1.460408,-1.147892,-1.129392,-0.42935,-0.575551,1.140118,0.279726,0.777319,-6.7074e-2,-1.127798,-2.228271,-0.578479,-1.641291,0.776947,0.372653,0.654082,-1.7981e-2,-0.764111,-0.630582,-0.123164,-0.763382,-1.43145,1.092311,0.974652,-0.548736,0.660927,-0.274718,1.5416651,0.450625,0.36228,-0.810577,0.156968,0.47419,-0.593522,1.777381,1.9001,-0.729995,0.567137,1.77529,-1.285679,1.749748,-1.2583361,0.989469,0.27894,-0.465374,-0.488536,0.665811,0.418114,1.462554,0.335251,2.40299,0.393666,-1.466521,-0.126054,-0.763374,2.121088,-0.416574,2.264181,8.2321e-2,-0.520006,-1.180747,-0.633615,-2.151889,0.402166,-0.195042,2.230828,2.399944,-0.692402,-0.162229,-5.7558e-2,0.174049,0.444863,-4.2691e-2,-0.19824,-0.367308,1.4657841,-1.7867739,1.093514,-0.856303,1.1065919,-0.290524,1.46904,-0.865654,-1.404295,0.847919,9.7521e-2,-0.333159,-0.993646,-1.143566,0.669345,1.569589,0.447966,-4.865e-2,2.059576,-1.2816e-2,-0.286836,-0.521384,2.739217,-0.477739,-4.075e-3,-0.164889,1.203063,-0.317745,-0.406169,0.633019,-0.497037,-0.728185,1.249597,0.92506,0.197087,-0.651183,0.539552,0.602599,-0.562677,-1.017254,2.45415,-0.112744,1.013038,-1.171895,0.553411,-0.142873,-0.187075,-1.131094,-0.841685,0.412923,0.270514,1.111905,-2.417977,0.984978,3.924e-3,-0.924147,-0.438564,-0.810727,1.351216,0.66382,1.175967,-0.407248,0.781496,0.16296,1.138742,-4.2322e-2,0.442418,0.646699,-0.517053,6.4634e-2,-0.307538,0.347724,1.005793,-0.208019,-0.597408,1.6408651,0.227081,-0.377023,0.428138,-0.132049,-0.886515,-0.180674,-0.24024,-0.936197,1.330593,0.440625,0.276915,0.760755,0.13696,0.545831,1.667585,1.737473,-1.254637,-1.294533,-0.964987,0.469358,-1.701826,-1.7836909,7.115e-3,-2.014121,-0.376815,0.11562,-0.140702,0.140048,0.131192,-0.40737,0.694377,0.52641,0.340887,7.1898e-2,-0.437718,0.415835,1.695116,0.367122,1.598791,-0.207826,0.488457,-0.84155,0.258079,3.4554e-2,-3.050739,5.527e-2,1.042438,-1.433486,0.207367,0.843444,0.623283,0.665856,-1.747095,-0.69142,1.021363,1.361615,0.280825,1.374338,1.401148,1.897727,2.216864,-2.64849,-1.212331,-0.780223,0.98407,-0.838865,0.916415,0.992718,-2.9265e-2,-0.358391,-0.447419,-0.325338,1.405591,0.968044,-0.821511,-1.800446,1.79877,0.759408,-0.32473,1.347627,-0.170958,-0.292201,1.9901149,1.830936,7.1057e-2,1.224062,1.908328,5.2218e-2,-0.318805,0.704243,-9.4564e-2,0.422375,1.586618,1.089697,-0.571568,-3.003727,-0.657189,0.112422,-0.416402,0.62239,1.481456,-0.837786,1.864841,2.002386,2.486594,-1.42535,-1.046819,-2.50074,-0.492231,-1.227192,-0.360028,-0.703424,1.6750281,-4.4736e-2,-0.748775,8.743e-3,0.775834,-1.089363,0.740386,1.525118,0.281176,1.7184219,-0.659537,-0.153709,-2.031314,-0.410772,1.5248699,-0.626564,1.411051,1.258134,1.6079099,-1.425969,1.002946,0.341494,-0.952398,-0.975116,-1.012157,-9.5074e-2,-2.479539,-0.655143,-1.031135,0.795973,0.20681,1.756088,-0.780688,0.390976,-0.93417,5.8291e-2,0.606265,2.046584,-1.207664,-0.560016,-0.512375,-2.24073,-2.918004,-1.3986e-2,-1.009882,-0.576508,0.503709,-0.47409,-0.577089,0.276813,-0.272422,0.613664,-1.254e-2,7.6242e-2,-0.371311,-0.500867,-0.674091,0.877008,1.125489,2.060458,-1.421852,1.120649,1.349898,-0.594968,-1.047639,0.306388,-1.251986,-0.202246,-0.856533,1.020165,-2.0325e-2,1.820871,0.912521,-5.9429e-2,1.132902,-0.674413,0.218215,0.845352,-0.342654,-2.320527,-9.413e-3,-5.606e-2,0.230135,-1.3299379,-0.748974,-1.675668,0.629524,0.722468,-0.790339,0.567432,-0.943679,-2.49556,-1.327819,1.342124,0.989372,-0.649975,1.590874,0.952475,-0.344123,-0.146827,0.412927,-1.5626581,-0.726911,-0.941348,-0.956505,0.477306,0.1041,-0.436985,0.370328,-0.911606,-1.519799,-0.118869,-1.167352,-1.037996,0.921823,-1.4819341,0.897508,-0.662986,-2.423165,0.2268,1.168007,1.9324191,-0.710893,-1.242518,0.4437,0.853337,1.5209479,0.33765,1.0888801,0.995861,-0.214627,0.282503,1.1797e-2,0.576552,0.372862,2.4421e-2,1.07646,1.0723e-2,0.602749,-0.579144,-1.775316,1.291527,0.67796,-1.079676,0.111742,1.109128,-0.427147,-1.256312,0.325869,-1.034902,0.501229,0.202837,0.817382,-1.7169139,-1.548145,0.391017,-0.522497,-1.295524,-0.463986,0.561743,-0.492543,1.828971,1.012713,2.605925,0.410401,-0.350495,0.614012,-0.753268,-0.395643,6.061e-2,0.386044,1.994117,-1.486058,0.910305,1.671051,0.291376,1.378265,-0.869301,1.410504,-0.645844,1.26368,-2.036335,-1.228401,2.687157,0.414916,-0.326202,-0.922502,0.295902,-1.709542,-0.565747,-0.85119,0.488239,0.50928,0.466828,1.551865,0.574965,0.305468,-0.271609,1.6368539,-0.918329,1.7476721,-0.483806,0.140414,0.59412,-0.667448,-1.384475,2.8276e-2,0.661311,1.0740271,-0.25585,1.405784,-4.7369e-2,0.473397,0.193933,-1.876394,-1.079883,1.766644,0.490159,0.582447,-0.550393,0.127244,0.538919,0.162896,-0.66167,-0.309354,-1.97015,2.52586,2.609092,-2.419333,0.619488,-0.46013,0.380081,-0.298418,0.321933,-0.598987,-0.719758,1.488091,1.4254761,0.381774,-0.651108,1.343363,0.168173,0.740556,-0.920689,1.476007,-0.389367,0.35296,0.480556,0.524088,-0.664521,0.731553,0.976035,0.228538,-1.455245,-1.215925,-0.7461,-1.240074,-1.707062,0.516365,-1.6225951,-1.476807,0.676145,1.748286,0.272745,2.226886,-0.930689,1.97394,-0.993759,0.781592,0.97075,0.408482,-3.1097e-2,2.13268,-0.691374,2.425006,0.382084,1.5841069,-1.47333,0.591686,0.209364,-3.5218e-2,-1.168597,-1.016285,-0.864086,-1.137366,1.266779,5.286e-3,-1.93759,1.546082,0.108398,1.271763,4.8317e-2,-0.21634,1.303939,-1.142741,1.311316,2.051579,-0.256556,-1.146276,0.871247,-1.006372,1.732616,-0.489749,-0.583404,1.098543,2.364612,0.179033,1.251404,-0.419145,1.768947,-0.569489,-0.96324,1.9307079,-0.120077,0.812505,0.377595,0.479006,-1.209788,2.543659,1.287611,0.144309,1.5268669,-1.006607,0.211452,-0.316528,0.304727,-0.789559,1.390947,-1.297785,-1.154026,-1.414346,-0.471536,-0.270746,1.7715731,-0.761872,0.463136,4.3234e-2,-0.272297,-0.666099,-0.835331,-1.363822,0.399226,0.1033,-0.140875,0.804887,-0.702804,1.640874,0.544116,0.817136,-0.493178,-0.443245,-0.112355,1.5730929,0.900909,-4.3938e-2,0.336218,1.127386,1.497695,0.5367,0.979811,-0.162961,0.884796,0.328296,8.1479e-2,1.6435239,0.285768,1.028139,-2.110324,0.154457,0.551292,1.6134009,-0.308444,1.74185,-0.624393,-0.950797,0.834728,1.096844,1.8092461,-1.263602,-0.319194,-1.358907,-0.485726,1.031327,0.916304,-0.135149,-0.311103,0.408386,7.3391e-2,0.154629,0.190425,-0.20427,0.710342,-0.798033,0.4156,0.945823,-2.378711,1.121962,-1.7296159,0.158246,0.348852,-0.559672,1.5545471,0.47164,-0.354604,0.811241,-1.303937,0.233458,-2.260891,0.175106,-1.429811,0.396795,0.476348,5.1929e-2,0.460365,0.503732,0.874039,0.147663,-0.160934,-0.339859,0.602541,0.188172,-1.001894,0.174502,0.949861,-0.946103,0.935831,1.018231,-1.045e-3,-0.833251,-0.628753,1.104887,-1.252976,-0.202311,0.290009,-0.742517,0.111719,0.533326,-0.40915,-4.6343e-2,-1.8329e-2,1.212681,0.438186,-0.149976,0.776052,-7.4962e-2,6.7911e-2,0.361587,-0.970316,0.697745,0.50942,1.5208321,-1.790393,-0.146924,1.818151,0.435166,1.160993,-0.290255,0.698371,1.6539841,-1.565575,0.824243,0.926859,-0.667728,-1.164535,-1.264703,1.593097,-1.507024,1.429962,1.427478,-0.95206,-0.462469,1.866076,0.296429,-0.147214,2.8662e-2,0.241104,-0.213853,-0.987176,-1.286907,-1.55095,-2.281599,0.19728,1.048936,-0.573408,-0.885769,-0.185063,0.249932,-0.266165,0.25379,3.45622,1.207095,0.385583,-5.5108e-2,0.386697,-0.885567,2.326527,-1.029277,1.001018,0.67325,0.946184,-0.842216,-1.390835,-0.295268,0.918067,-0.127028,1.23177,-0.120328,0.249015,1.49568,0.609435,-0.88214,-0.117904,-0.712492,7.9739e-2,-0.410533,-1.222103,0.657596,0.400276,1.415698,-0.869836,0.72335,1.185977,0.408701,-1.312178,-0.600989,-7.5575e-2,0.140535,-8.2945e-2,-0.117098,0.194508,1.2710509,0.90454,0.428682,0.270236,1.469233,0.274202,0.372474,-0.807852,0.903695,-1.619173,-1.997339,-1.644271,0.279665,-0.515162,-0.505147,-1.898762,-1.109476,0.85315,4.1763e-2,-1.234451,0.106958,2.061705,2.146114,-0.194492,-0.252709,0.825097,-0.98763,-0.227893,-1.154347,0.470981,-0.234181,0.19478,1.281048,0.488917,-0.196327,-0.697157,0.956338,-1.8828,1.191959,0.282994,1.278309,0.255343,-0.867477,-0.645494,4.4413e-2,2.25746,-1.484112,4.4252e-2,-0.284302,1.739499,1.157655,-0.248293,-0.569306,-2.366017,-1.182801,-0.463968,0.158839,0.965232,-0.847756,2.336049,0.56246,1.4652569,3.114171,-0.205564,3.2179e-2,7.7148e-2,-0.492201,-0.999449,-0.458503,0.792946,0.560063,0.783679,8.6632e-2,-0.920055,0.203042,-0.36707,-0.580465,0.782823,-0.229527,-0.140884,1.029897,0.748527,-1.197893,-1.218873,-0.762116,-1.324856,-1.6074e-2,1.37832,0.852484,0.143564,-1.261026,-1.5983989,0.828816,-1.243628,0.14456,1.2098451,-0.587588,-1.729234,-1.5343649,-0.573974,1.238075,-1.001345,-1.359229,-2.460609,0.936906,-0.555396,-0.324581,-1.422083,-0.295702,-0.205674,-6.0862e-2,-0.224466,-1.2796891,0.388815,-0.447613] :: Array (Z :. Int :. Int) Float)
              a9 = use (fromList Z [1.0] :: Array Z Float)
              a10 = use (fromList Z [0] :: Array Z Int)
              a11 = unit (1.0 :: Exp Float)
              T2 (T2 (T2 _ a12) a13) a14 = T2 (T2 (T2 (use ()) a5) a6) a7
              a15 = backpermute (I2 (let T2 _ x1 = let I1 x2 = shape a12 in T2 (constant ()) x2 in x1) (let T2 _ x3 = let I2 x4 x5 = shape a8 in T2 (T2 (constant ()) x4) x5 in x3)) (\(I2 x6 x7) -> I2 x6 x7) a14
              a16 = fold (\x8 x9 -> x8 + x9) (0.0 :: Exp Float) a15
              a17 = map (\x10 -> let T2 x11 _ = let x12 = exp x10 in T2 x12 (T2 (T2 (T2 (constant ()) x10) x12) x10) in x11) a15
              a18 =
                generate
                  (let T2 (T2 (T2 _ x13) x14) x15 = let I3 x16 x17 x18 = indexFull (I3 (let T2 (T2 _ x19) _ = let I2 x20 x21 = shape a8 in T2 (T2 (constant ()) x20) x21 in x19) (constant All) (constant All)) (shape a13) in T2 (T2 (T2 (constant ()) x16) x17) x18
                       T2 (T2 (T2 _ x22) x23) x24 = let I3 x25 x26 x27 = indexFull (I3 (constant All) (let T2 _ x28 = let I1 x29 = shape a12 in T2 (constant ()) x29 in x28) (constant All)) (shape a8) in T2 (T2 (T2 (constant ()) x25) x26) x27
                   in I3 (min x22 x13) (min x23 x14) (min x24 x15))
                  (\(I3 x30 x31 x32) ->
                     let T2 x33 _ =
                           let x34 = a8 ! indexSlice (I3 (constant All) (let T2 _ x35 = let I1 x36 = shape a12 in T2 (constant ()) x36 in x35) (constant All)) (I3 x30 x31 x32)
                               x37 = a13 ! indexSlice (I3 (let T2 (T2 _ x38) _ = let I2 x39 x40 = shape a8 in T2 (T2 (constant ()) x39) x40 in x38) (constant All) (constant All)) (I3 x30 x31 x32)
                               x41 = x34 - x37
                           in T2 x41 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (constant ()) x34) x37) x34) x37) x41) x34) x37) x34) x37)
                     in x33)
              a19 = backpermute (indexFull (I3 (let T2 (T2 _ x42) _ = let I2 x43 x44 = shape a8 in T2 (T2 (constant ()) x43) x44 in x42) (constant All) (constant All)) (shape a17)) (\(I3 x45 x46 x47) -> indexSlice (I3 (let T2 (T2 _ x48) _ = let I2 x49 x50 = shape a8 in T2 (T2 (constant ()) x49) x50 in x48) (constant All) (constant All)) (I3 x45 x46 x47)) a17
              a20 =
                generate
                  (I2 (let T2 _ x51 = let I1 x52 = shape a12 in T2 (constant ()) x52 in x51) ((1 :: Exp Int) + ((let T2 _ x53 = let I2 x54 x55 = shape a14 in T2 (T2 (constant ()) x54) x55 in x53) - (let T2 _ x56 = let I2 x57 x58 = shape a8 in T2 (T2 (constant ()) x57) x58 in x56))))
                  (\(I2 x59 x60) ->
                     let T2 x61 _ =
                           let x62 = (0 :: Exp Int) == x60
                               T2 x63 (T2 x64 x65) = cond x62 (T2 (0.0 :: Exp Float) (T2 (0.0 :: Exp Float) (0.0 :: Exp Float))) (T2 (1.0 :: Exp Float) (T2 (0.0 :: Exp Float) (1.0 :: Exp Float)))
                           in T2 x63 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (constant ()) x59) x60) x59) x59) x60) x63) x62) x60) (0 :: Exp Int)) x60) (0 :: Exp Int)) x64) x65)
                     in x61)
              a21 = backpermute (I2 (let T2 _ x66 = let I1 x67 = shape a12 in T2 (constant ()) x67 in x66) ((1 :: Exp Int) + ((let T2 _ x68 = let I2 x69 x70 = shape a14 in T2 (T2 (constant ()) x69) x70 in x68) - (let T2 _ x71 = let I2 x72 x73 = shape a8 in T2 (T2 (constant ()) x72) x73 in x71)))) (\(I2 x74 x75) -> I2 x74 ((-1 :: Exp Int) + (x75 + (let T2 _ x76 = let I2 x77 x78 = shape a8 in T2 (T2 (constant ()) x77) x78 in x76)))) a14
              a22 =
                generate
                  (let T2 x79 x80 = let T2 (T2 _ x81) x82 = let I2 x83 x84 = shape a8 in T2 (T2 (constant ()) x83) x84 in T2 x81 x82 in I4 x79 (let T2 _ x85 = let I1 x86 = shape a12 in T2 (constant ()) x86 in x85) x80 x80)
                  (\(I4 _ x87 x88 x89) ->
                     let T2 (T2 _ x90) x91 = cond (x88 > x89) (T2 (T2 (constant ()) x87) ((1 :: Exp Int) + ((-1 :: Exp Int) + (((let x92 = let T2 _ x93 = let I2 x94 x95 = shape a8 in T2 (T2 (constant ()) x94) x95 in x93 in div (x92 * ((-1 :: Exp Int) + x92)) (2 :: Exp Int) - div (let x96 = (-1 :: Exp Int) + x92 in (x96 - x89) * ((1 :: Exp Int) + (x96 - x89))) (2 :: Exp Int)) + x88) - x89)))) (T2 (T2 (constant ()) x87) (0 :: Exp Int))
                         T2 x97 _ =
                           let x98 = a20 ! I2 x90 x91
                               x99 = a21 ! I2 x90 x91
                               x100 = x98 * x99
                           in T2 x100 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (constant ()) x98) x99) x98) x99) x100) x98) x99) x98) x99)
                     in x97)
              a23 = backpermute (indexFull (I4 (constant All) (constant All) (let T2 _ x101 = let I2 x102 x103 = shape a8 in T2 (T2 (constant ()) x102) x103 in x101) (constant All)) (shape a18)) (\(I4 x104 x105 x106 x107) -> indexSlice (I4 (constant All) (constant All) (let T2 _ x108 = let I2 x109 x110 = shape a8 in T2 (T2 (constant ()) x109) x110 in x108) (constant All)) (I4 x104 x105 x106 x107)) a18
              a24 =
                fold
                  (\x111 x112 -> x111 + x112)
                  (0.0 :: Exp Float)
                  (generate
                     (let T2 (T2 (T2 (T2 _ x113) x114) x115) x116 = let I4 x117 x118 x119 x120 = shape a23 in T2 (T2 (T2 (T2 (constant ()) x117) x118) x119) x120
                          T2 (T2 (T2 (T2 _ x121) x122) x123) x124 = let I4 x125 x126 x127 x128 = shape a22 in T2 (T2 (T2 (T2 (constant ()) x125) x126) x127) x128
                      in I4 (min x121 x113) (min x122 x114) (min x123 x115) (min x124 x116))
                     (\(I4 x129 x130 x131 x132) ->
                        let T2 x133 _ =
                              let x134 = a22 ! I4 x129 x130 x131 x132
                                  x135 = a23 ! I4 x129 x130 x131 x132
                                  x136 = x134 * x135
                              in T2 x136 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (constant ()) x134) x135) x134) x135) x136) x134) x135) x134) x135)
                        in x133))
              a25 =
                generate
                  (let T2 (T2 (T2 _ x137) x138) x139 = let I3 x140 x141 x142 = shape a24 in T2 (T2 (T2 (constant ()) x140) x141) x142
                       T2 (T2 (T2 _ x143) x144) x145 =
                         let T2 (T2 (T2 _ x146) x147) x148 = let I3 x149 x150 x151 = shape a18 in T2 (T2 (T2 (constant ()) x149) x150) x151
                             T2 (T2 (T2 _ x152) x153) x154 = let I3 x155 x156 x157 = shape a19 in T2 (T2 (T2 (constant ()) x155) x156) x157
                         in T2 (T2 (T2 (constant ()) (min x152 x146)) (min x153 x147)) (min x154 x148)
                   in I3 (min x143 x137) (min x144 x138) (min x145 x139))
                  (\(I3 x158 x159 x160) ->
                     let T2 x161 _ =
                           let x162 =
                                 let T2 x163 _ =
                                       let x164 = a19 ! I3 x158 x159 x160
                                           x165 = a18 ! I3 x158 x159 x160
                                           x166 = x164 * x165
                                       in T2 x166 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (constant ()) x164) x165) x164) x165) x166) x164) x165) x164) x165)
                                 in x163
                               x167 = a24 ! I3 x158 x159 x160
                               x168 = x162 + x167
                           in T2 x168 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (constant ()) x162) x167) x162) x167) x168) x162) x167) x162) x167)
                     in x161)
              a26 =
                fold
                  (\x169 x170 -> x169 + x170)
                  (0.0 :: Exp Float)
                  (generate
                     (shape a25)
                     (\(I3 x171 x172 x173) ->
                        let x174 = a25 ! I3 x171 x172 x173
                            T2 x175 _ = let x176 = x174 * x174 in T2 x176 (T2 (T2 (T2 (T2 (T2 (T2 (constant ()) x174) x176) x174) x174) x174) x174)
                        in x175))
              a27 =
                generate
                  (let T2 (T2 _ x177) x178 = let I2 x179 x180 = shape a26 in T2 (T2 (constant ()) x179) x180
                       T2 (T2 _ x181) x182 =
                         let I2 x183 x184 =
                               indexFull
                                 (I2 (let T2 (T2 _ x185) _ = let I2 x186 x187 = shape a8 in T2 (T2 (constant ()) x186) x187 in x185) (constant All))
                                 (let T2 _ x188 = let I1 x189 = shape a16 in T2 (constant ()) x189
                                      T2 _ x190 = let I1 x191 = shape a12 in T2 (constant ()) x191
                                  in I1 (min x190 x188))
                         in T2 (T2 (constant ()) x183) x184
                   in I2 (min x181 x177) (min x182 x178))
                  (\(I2 x192 x193) ->
                     let T2 x194 _ =
                           let x195 =
                                 let T2 _ x196 = let I1 x197 = indexSlice (I2 (let T2 (T2 _ x198) _ = let I2 x199 x200 = shape a8 in T2 (T2 (constant ()) x199) x200 in x198) (constant All)) (I2 x192 x193) in T2 (constant ()) x197
                                     T2 x201 _ =
                                       let x202 = a12 ! I1 x196
                                           x203 = a16 ! I1 x196
                                           x204 = x202 + x203
                                       in T2 x204 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (constant ()) x202) x203) x202) x203) x204) x202) x203) x202) x203)
                                 in x201
                               x205 =
                                 let x206 = a26 ! I2 x192 x193
                                     T2 x207 _ = let x208 = (0.5 :: Exp Float) * x206 in T2 x208 (T2 (T2 (T2 (T2 (T2 (T2 (constant ()) x206) x208) x206) (0.5 :: Exp Float)) x206) (0.5 :: Exp Float))
                                 in x207
                               x209 = x195 - x205
                           in T2 x209 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (constant ()) x195) x205) x195) x205) x209) x195) x205) x195) x205)
                     in x194)
              a28 = fold1 (\x210 x211 -> max x210 x211) a27
              a29 =
                generate
                  (let T2 (T2 _ x212) x213 = let I2 x214 x215 = indexFull (I2 (constant All) (let T2 _ x216 = let I2 x217 x218 = shape a27 in T2 (T2 (constant ()) x217) x218 in x216)) (shape a28) in T2 (T2 (constant ()) x214) x215
                       T2 (T2 _ x219) x220 = let I2 x221 x222 = shape a27 in T2 (T2 (constant ()) x221) x222
                   in I2 (min x219 x212) (min x220 x213))
                  (\(I2 x223 x224) ->
                     let T2 x225 _ =
                           let x226 = a27 ! I2 x223 x224
                               x227 = a28 ! indexSlice (I2 (constant All) (let T2 _ x228 = let I2 x229 x230 = shape a27 in T2 (T2 (constant ()) x229) x230 in x228)) (I2 x223 x224)
                               x231 = x226 - x227
                           in T2 x231 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (constant ()) x226) x227) x226) x227) x231) x226) x227) x226) x227)
                     in x225)
              a30 =
                fold
                  (\x232 x233 -> x232 + x233)
                  (0.0 :: Exp Float)
                  (generate
                     (shape a29)
                     (\(I2 x234 x235) ->
                        let x236 = a29 ! I2 x234 x235
                            T2 x237 _ = let x238 = exp x236 in T2 x238 (T2 (T2 (T2 (constant ()) x236) x238) x236)
                        in x237))
              a31 =
                fold
                  (\x239 x240 -> x239 + x240)
                  (0.0 :: Exp Float)
                  (generate
                     (let T2 _ x241 = let I1 x242 = shape a28 in T2 (constant ()) x242
                          T2 _ x243 = let I1 x244 = shape a30 in T2 (constant ()) x244
                      in I1 (min x243 x241))
                     (\(I1 x245) ->
                        let T2 x246 _ =
                              let x247 =
                                    let x248 = a30 ! I1 x245
                                        T2 x249 _ = let x250 = log x248 in T2 x250 (T2 (T2 (T2 (constant ()) x248) x250) x248)
                                    in x249
                                  x251 = a28 ! I1 x245
                                  x252 = x247 + x251
                              in T2 x252 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (constant ()) x247) x251) x247) x251) x252) x247) x251) x247) x251)
                        in x246))
              a32 = fold1 (\x253 x254 -> max x253 x254) a12
              a33 =
                generate
                  (let T2 _ x255 = let I1 x256 = indexFull (I1 (let T2 _ x257 = let I1 x258 = shape a12 in T2 (constant ()) x258 in x257)) Z_ in T2 (constant ()) x256
                       T2 _ x259 = let I1 x260 = shape a12 in T2 (constant ()) x260
                   in I1 (min x259 x255))
                  (\(I1 x261) ->
                     let T2 x262 _ =
                           let x263 = a12 ! I1 x261
                               x264 = a32 ! Z_
                               x265 = x263 - x264
                           in T2 x265 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (constant ()) x263) x264) x263) x264) x265) x263) x264) x263) x264)
                     in x262)
              a34 =
                fold
                  (\x266 x267 -> x266 + x267)
                  (0.0 :: Exp Float)
                  (generate
                     (shape a33)
                     (\(I1 x268) ->
                        let x269 = a33 ! I1 x268
                            T2 x270 _ = let x271 = exp x269 in T2 x271 (T2 (T2 (T2 (constant ()) x269) x271) x269)
                        in x270))
              a35 =
                generate
                  Z_
                  (\Z_ ->
                     let T2 x272 _ =
                           let x273 =
                                 let x274 = a34 ! Z_
                                     T2 x275 _ = let x276 = log x274 in T2 x276 (T2 (T2 (T2 (constant ()) x274) x276) x274)
                                 in x275
                               x277 = a32 ! Z_
                               x278 = x273 + x277
                           in T2 x278 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (constant ()) x273) x277) x273) x277) x278) x273) x277) x273) x277)
                     in x272)
              a36 =
                fold
                  (\x279 x280 -> x279 + x280)
                  (0.0 :: Exp Float)
                  (generate
                     (shape a17)
                     (\(I2 x281 x282) ->
                        let x283 = a17 ! I2 x281 x282
                            T2 x284 _ = let x285 = x283 * x283 in T2 x285 (T2 (T2 (T2 (T2 (T2 (T2 (constant ()) x283) x285) x283) x283) x283) x283)
                        in x284))
              a37 = backpermute (I2 (let T2 _ x286 = let I1 x287 = shape a12 in T2 (constant ()) x287 in x286) ((let T2 _ x288 = let I2 x289 x290 = shape a14 in T2 (T2 (constant ()) x289) x290 in x288) - (let T2 _ x291 = let I2 x292 x293 = shape a8 in T2 (T2 (constant ()) x292) x293 in x291))) (\(I2 x294 x295) -> I2 x294 (x295 + (let T2 _ x296 = let I2 x297 x298 = shape a8 in T2 (T2 (constant ()) x297) x298 in x296))) a14
              a38 =
                fold
                  (\x299 x300 -> x299 + x300)
                  (0.0 :: Exp Float)
                  (generate
                     (shape a37)
                     (\(I2 x301 x302) ->
                        let x303 = a37 ! I2 x301 x302
                            T2 x304 _ = let x305 = x303 * x303 in T2 x305 (T2 (T2 (T2 (T2 (T2 (T2 (constant ()) x303) x305) x303) x303) x303) x303)
                        in x304))
              a39 =
                generate
                  (let T2 _ x306 = let I1 x307 = shape a38 in T2 (constant ()) x307
                       T2 _ x308 = let I1 x309 = shape a36 in T2 (constant ()) x309
                   in I1 (min x308 x306))
                  (\(I1 x310) ->
                     let T2 x311 _ =
                           let x312 = a36 ! I1 x310
                               x313 = a38 ! I1 x310
                               x314 = x312 + x313
                           in T2 x314 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (constant ()) x312) x313) x312) x313) x314) x312) x313) x312) x313)
                     in x311)
              a40 =
                map
                  (\x315 ->
                     let T2 x316 _ =
                           let x317 = (0.5 :: Exp Float) * x315
                               x318 = x317 * x315
                           in T2 x318 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (constant ()) x315) x318) x317) x315) x317) (0.5 :: Exp Float)) x315) (0.5 :: Exp Float)) x315) x315)
                     in x316)
                  a9
              a41 = map (\x319 -> let T2 x320 _ = let x321 = fromIntegral x319 in T2 x321 (T2 (T2 (T2 (constant ()) x319) x321) x319) in x320) a10
              a42 =
                fold
                  (\x322 x323 -> x322 + x323)
                  (0.0 :: Exp Float)
                  (generate
                     (let T2 _ x324 =
                            let T2 _ x325 = let I1 x326 = indexFull (I1 (let T2 _ x327 = let I1 x328 = shape a12 in T2 (constant ()) x328 in x327)) Z_ in T2 (constant ()) x326
                                T2 _ x329 = let I1 x330 = shape a16 in T2 (constant ()) x330
                            in T2 (constant ()) (min x329 x325)
                          T2 _ x331 =
                            let T2 _ x332 = let I1 x333 = indexFull (I1 (let T2 _ x334 = let I1 x335 = shape a12 in T2 (constant ()) x335 in x334)) Z_ in T2 (constant ()) x333
                                T2 _ x336 = let I1 x337 = shape a39 in T2 (constant ()) x337
                            in T2 (constant ()) (min x336 x332)
                      in I1 (min x331 x324))
                     (\(I1 x338) ->
                        let T2 x339 _ =
                              let x340 =
                                    let T2 x341 _ =
                                          let x342 = a39 ! I1 x338
                                              x343 = a40 ! Z_
                                              x344 = x342 * x343
                                          in T2 x344 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (constant ()) x342) x343) x342) x343) x344) x342) x343) x342) x343)
                                    in x341
                                  x345 =
                                    let T2 x346 _ =
                                          let x347 = a16 ! I1 x338
                                              x348 = a41 ! Z_
                                              x349 = x347 * x348
                                          in T2 x349 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (constant ()) x347) x348) x347) x348) x349) x347) x348) x347) x348)
                                    in x346
                                  x350 = x340 - x345
                              in T2 x350 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (constant ()) x340) x345) x340) x345) x350) x340) x345) x340) x345)
                        in x339))
              a43 = generate Z_ (\Z_ -> let x351 = a11 ! Z_ in T2 (T2 x351 x351) (constant ()))
              a44 = map (\(T2 (T2 x352 _) _) -> x352) a43
              a45 = map (\(T2 (T2 _ x353) _) -> x353) a43
              a46 = generate Z_ (\Z_ -> let x354 = a44 ! Z_ in T2 (T2 x354 (-x354)) (constant ()))
              a47 = map (\(T2 (T2 x355 _) _) -> x355) a46
              a48 = map (\(T2 (T2 _ x356) _) -> x356) a46
              a49 =
                generate
                  (let T2 _ x357 = let I1 x358 = shape a28 in T2 (constant ()) x358
                       T2 _ x359 = let I1 x360 = shape a30 in T2 (constant ()) x360
                       T2 _ x361 =
                         let T2 _ x362 = let I1 x363 = shape a28 in T2 (constant ()) x363
                             T2 _ x364 = let I1 x365 = shape a30 in T2 (constant ()) x365
                         in T2 (constant ()) (min x364 x362)
                   in I1 (min x361 (min x359 x357)))
                  (\(I1 x366) ->
                     let x367 =
                           cond
                             ((<) x366
                                  (let T2 _ x375 =
                                         let I1 x376 =
                                               indexFull
                                                 (I1 (let T2 _ x377 =
                                                            let T2 _ x378 = let I1 x379 = shape a28 in T2 (constant ()) x379
                                                                T2 _ x380 = let I1 x381 = shape a30 in T2 (constant ()) x381
                                                            in T2 (constant ()) (min x380 x378)
                                                      in x377))
                                                 Z_
                                         in T2 (constant ()) x376
                                   in x375))
                             (a47 ! Z_)
                             (0.0 :: Exp Float)
                     in T2 (T2 x367 x367) (constant ()))
              a50 = map (\(T2 (T2 x382 _) _) -> x382) a49
              a51 = map (\(T2 (T2 _ x383) _) -> x383) a49
              a52 =
                generate
                  (let T2 (T2 _ x384) x385 = let I2 x386 x387 = indexFull (I2 (constant All) (let T2 _ x388 = let I2 x389 x390 = shape a27 in T2 (T2 (constant ()) x389) x390 in x388)) (shape a28) in T2 (T2 (constant ()) x386) x387
                       T2 (T2 _ x391) x392 = let I2 x393 x394 = shape a27 in T2 (T2 (constant ()) x393) x394
                       T2 (T2 _ x395) x396 = let I2 x397 x398 = shape a29 in T2 (T2 (constant ()) x397) x398
                   in I2 (min x395 (min x391 x384)) (min x396 (min x392 x385)))
                  (\(I2 x399 x400) ->
                     let x401 =
                           cond
                             (let T2 x402 x403 =
                                    let T2 (T2 _ x404) x405 =
                                          let T2 (T2 _ x406) x407 = let I2 x408 x409 = shape a29 in T2 (T2 (constant ()) x408) x409
                                              T2 (T2 _ x410) x411 = let I2 x412 x413 = shape a29 in T2 (T2 (constant ()) x412) x413
                                          in T2 (T2 (constant ()) (min x410 x406)) (min x411 x407)
                                    in T2 x404 x405
                              in x399 < x402 && x400 < x403)
                             (let T2 x414 _ =
                                    let T2 (T2 _ x415) _ =
                                          let x416 = a29 ! I2 x399 x400
                                              T2 _ (T2 (T2 (T2 _ x417) x418) x419) = let x420 = exp x416 in T2 x420 (T2 (T2 (T2 (constant ()) x416) x420) x416)
                                          in T2 (T2 (T2 (constant ()) x417) x418) x419
                                    in T2 ((*) (cond
                                                  (let T2 x456 x457 = let T2 (T2 _ x458) x459 = let I2 x460 x461 = indexFull (I2 (constant All) (let T2 _ x462 = let I2 x463 x464 = shape a29 in T2 (T2 (constant ()) x463) x464 in x462)) (shape a30) in T2 (T2 (constant ()) x460) x461 in T2 x458 x459 in x399 < x456 && x400 < x457)
                                                  (let T2 _ x465 = let I1 x466 = indexSlice (I2 (constant All) (let T2 _ x467 = let I2 x468 x469 = shape a29 in T2 (T2 (constant ()) x468) x469 in x467)) (I2 x399 x400) in T2 (constant ()) x466
                                                   in cond
                                                        ((<) x465
                                                             (let T2 _ x475 =
                                                                    let T2 _ x476 = let I1 x477 = shape a30 in T2 (constant ()) x477
                                                                        T2 _ x478 = let I1 x479 = shape a30 in T2 (constant ()) x479
                                                                    in T2 (constant ()) (min x478 x476)
                                                              in x475))
                                                        (let T2 x480 _ =
                                                               let T2 _ x481 =
                                                                     let x482 = a30 ! I1 x465
                                                                         T2 _ (T2 (T2 (T2 _ x483) x484) x485) = let x486 = log x482 in T2 x486 (T2 (T2 (T2 (constant ()) x482) x486) x482)
                                                                     in T2 (T2 (T2 (constant ()) x483) x484) x485
                                                               in T2 (cond (x465 < (let T2 _ x487 = let I1 x488 = shape a30 in T2 (constant ()) x488 in x487)) (cond (x465 < (let T2 _ x489 = let I1 x490 = shape a50 in T2 (constant ()) x490 in x489)) (a50 ! I1 x465) (0.0 :: Exp Float)) (0.0 :: Exp Float) / x481) (constant ())
                                                         in x480)
                                                        (0.0 :: Exp Float))
                                                  (0.0 :: Exp Float))
                                               x415)
                                          (constant ())
                              in x414)
                             (0.0 :: Exp Float)
                     in T2 (T2 x401 (-x401)) (constant ()))
              a53 = map (\(T2 (T2 x491 _) _) -> x491) a52
              a54 = map (\(T2 (T2 _ x492) _) -> x492) a52
              a55 = generate (shape a27) (\(I2 x493 x494) -> cond (let T2 x495 x496 = let T2 (T2 _ x497) x498 = let I2 x499 x500 = shape a27 in T2 (T2 (constant ()) x499) x500 in T2 x497 x498 in x493 < x495 && x494 < x496) (cond (let T2 x501 x502 = let T2 (T2 _ x503) x504 = let I2 x505 x506 = shape a53 in T2 (T2 (constant ()) x505) x506 in T2 x503 x504 in x493 < x501 && x494 < x502) (a53 ! I2 x493 x494) (0.0 :: Exp Float)) (0.0 :: Exp Float))
              a56 = fold1 (\x507 x508 -> x507 + x508) (generate (indexFull (I2 (constant All) (let T2 _ x509 = let I2 x510 x511 = shape a27 in T2 (T2 (constant ()) x510) x511 in x509)) (shape a28)) (\(I2 x512 x513) -> cond (let T2 x514 x515 = let T2 (T2 _ x516) x517 = let I2 x518 x519 = indexFull (I2 (constant All) (let T2 _ x520 = let I2 x521 x522 = shape a27 in T2 (T2 (constant ()) x521) x522 in x520)) (shape a28) in T2 (T2 (constant ()) x518) x519 in T2 x516 x517 in x512 < x514 && x513 < x515) (cond (let T2 x523 x524 = let T2 (T2 _ x525) x526 = let I2 x527 x528 = shape a54 in T2 (T2 (constant ()) x527) x528 in T2 x525 x526 in x512 < x523 && x513 < x524) (a54 ! I2 x512 x513) (0.0 :: Exp Float)) (0.0 :: Exp Float)))
              a57 = generate (shape a28) (\(I1 x529) -> cond (x529 < (let T2 _ x530 = let I1 x531 = shape a56 in T2 (constant ()) x531 in x530)) (a56 ! I1 x529) (0.0 :: Exp Float))
              a58 = generate (shape a28) (\(I1 x532) -> cond (x532 < (let T2 _ x533 = let I1 x534 = shape a28 in T2 (constant ()) x534 in x533)) (cond (x532 < (let T2 _ x535 = let I1 x536 = shape a51 in T2 (constant ()) x536 in x535)) (a51 ! I1 x532) (0.0 :: Exp Float)) (0.0 :: Exp Float))
              a59 = scanl1 (\x537 x538 -> max x537 x538) a27
              a60 = backpermute (let T2 x539 x540 = let T2 (T2 _ x541) x542 = let I2 x543 x544 = shape a59 in T2 (T2 (constant ()) x543) x544 in T2 x541 x542 in I2 x539 ((-1 :: Exp Int) + x540)) (\(I2 x545 x546) -> I2 x545 x546) a59
              a61 =
                scanr
                  (\x547 x548 -> x547 * x548)
                  (1.0 :: Exp Float)
                  (generate
                     (let T2 x549 x550 = let T2 (T2 _ x551) x552 = let I2 x553 x554 = shape a27 in T2 (T2 (constant ()) x553) x554 in T2 x551 x552
                          T2 (T2 _ x555) x556 = let I2 x557 x558 = shape a60 in T2 (T2 (constant ()) x557) x558
                      in I2 (min x555 x549) (min x556 ((-1 :: Exp Int) + x550)))
                     (\(I2 x559 x560) -> let T2 x561 _ = cond (a60 ! I2 x559 x560 > a27 ! I2 x559 ((1 :: Exp Int) + x560)) (T2 (1.0 :: Exp Float) (0.0 :: Exp Float)) (T2 (0.0 :: Exp Float) (1.0 :: Exp Float)) in x561))
              a62 =
                generate
                  (shape a27)
                  (\(I2 x562 x563) ->
                     cond
                       (let T2 x564 x565 =
                              let T2 (T2 _ x566) x567 =
                                    let T2 (T2 _ x568) x569 =
                                          let T2 x570 x571 =
                                                let T2 (T2 _ x572) x573 =
                                                      let T2 x574 x575 = let T2 (T2 _ x576) x577 = let I2 x578 x579 = shape a27 in T2 (T2 (constant ()) x578) x579 in T2 x576 x577
                                                          T2 (T2 _ x580) x581 = let I2 x582 x583 = shape a60 in T2 (T2 (constant ()) x582) x583
                                                      in T2 (T2 (constant ()) (min x580 x574)) (min x581 ((-1 :: Exp Int) + x575))
                                                in T2 x572 x573
                                              T2 (T2 _ x584) x585 = let I2 x586 x587 = shape a61 in T2 (T2 (constant ()) x586) x587
                                          in T2 (T2 (constant ()) (min x570 x584)) (min ((1 :: Exp Int) + x571) x585)
                                        T2 (T2 _ x588) x589 =
                                          let I2 x590 x591 =
                                                indexFull
                                                  (I2 (constant All)
                                                      (let T2 _ x592 =
                                                             let T2 x593 x594 =
                                                                   let T2 (T2 _ x595) x596 =
                                                                         let T2 x597 x598 = let T2 (T2 _ x599) x600 = let I2 x601 x602 = shape a27 in T2 (T2 (constant ()) x601) x602 in T2 x599 x600
                                                                             T2 (T2 _ x603) x604 = let I2 x605 x606 = shape a60 in T2 (T2 (constant ()) x605) x606
                                                                         in T2 (T2 (constant ()) (min x603 x597)) (min x604 ((-1 :: Exp Int) + x598))
                                                                   in T2 x595 x596
                                                                 T2 (T2 _ x607) x608 = let I2 x609 x610 = shape a61 in T2 (T2 (constant ()) x609) x610
                                                             in T2 (T2 (constant ()) (min x593 x607)) (min ((1 :: Exp Int) + x594) x608)
                                                       in x592))
                                                  (shape a28)
                                          in T2 (T2 (constant ()) x590) x591
                                    in T2 (T2 (constant ()) (min x588 x568)) (min x589 x569)
                              in T2 x566 x567
                        in x562 < x564 && x563 < x565)
                       ((*) (let T2 _ x644 =
                                   let I1 x645 =
                                         indexSlice
                                           (I2 (constant All)
                                               (let T2 _ x646 =
                                                      let T2 x647 x648 =
                                                            let T2 (T2 _ x649) x650 =
                                                                  let T2 x651 x652 = let T2 (T2 _ x653) x654 = let I2 x655 x656 = shape a27 in T2 (T2 (constant ()) x655) x656 in T2 x653 x654
                                                                      T2 (T2 _ x657) x658 = let I2 x659 x660 = shape a60 in T2 (T2 (constant ()) x659) x660
                                                                  in T2 (T2 (constant ()) (min x657 x651)) (min x658 ((-1 :: Exp Int) + x652))
                                                            in T2 x649 x650
                                                          T2 (T2 _ x661) x662 = let I2 x663 x664 = shape a61 in T2 (T2 (constant ()) x663) x664
                                                      in T2 (T2 (constant ()) (min x647 x661)) (min ((1 :: Exp Int) + x648) x662)
                                                in x646))
                                           (I2 x562 x563)
                                   in T2 (constant ()) x645
                             in cond (x644 < max (let T2 _ x665 = let I1 x666 = shape a58 in T2 (constant ()) x666 in x665) (let T2 _ x667 = let I1 x668 = shape a57 in T2 (constant ()) x668 in x667)) (cond ((0 :: Exp Int) == (let T2 _ x669 = let I1 x670 = shape a58 in T2 (constant ()) x670 in x669)) (a57 ! I1 x644) (cond ((0 :: Exp Int) == (let T2 _ x671 = let I1 x672 = shape a57 in T2 (constant ()) x672 in x671)) (a58 ! I1 x644) (a58 ! I1 x644 + a57 ! I1 x644))) (0.0 :: Exp Float))
                            ((*) (cond
                                    (x563 > (0 :: Exp Int))
                                    (let x675 = (-1 :: Exp Int) + x563
                                         T2 _ x676 = cond (a60 ! I2 x562 x675 > a27 ! I2 x562 ((1 :: Exp Int) + x675)) (T2 (1.0 :: Exp Float) (0.0 :: Exp Float)) (T2 (0.0 :: Exp Float) (1.0 :: Exp Float))
                                     in x676)
                                    (1.0 :: Exp Float))
                                 (a61 ! I2 x562 x563)))
                       (0.0 :: Exp Float))
              a63 =
                generate
                  (let T2 (T2 _ x677) x678 = let I2 x679 x680 = shape a26 in T2 (T2 (constant ()) x679) x680
                       T2 (T2 _ x681) x682 =
                         let I2 x683 x684 =
                               indexFull
                                 (I2 (let T2 (T2 _ x685) _ = let I2 x686 x687 = shape a8 in T2 (T2 (constant ()) x686) x687 in x685) (constant All))
                                 (let T2 _ x688 = let I1 x689 = shape a16 in T2 (constant ()) x689
                                      T2 _ x690 = let I1 x691 = shape a12 in T2 (constant ()) x691
                                  in I1 (min x690 x688))
                         in T2 (T2 (constant ()) x683) x684
                       T2 (T2 _ x692) x693 = let I2 x694 x695 = shape a27 in T2 (T2 (constant ()) x694) x695
                   in I2 (min x692 (min x681 x677)) (min x693 (min x682 x678)))
                  (\(I2 x696 x697) ->
                     let x698 =
                           cond
                             (let T2 x699 x700 =
                                    let T2 (T2 _ x701) x702 =
                                          let T2 x703 x704 = let T2 (T2 _ x705) x706 = let I2 x707 x708 = shape a62 in T2 (T2 (constant ()) x707) x708 in T2 x705 x706
                                              T2 x709 x710 = let T2 (T2 _ x711) x712 = let I2 x713 x714 = shape a55 in T2 (T2 (constant ()) x713) x714 in T2 x711 x712
                                          in T2 (T2 (constant ()) (max x703 x709)) (max x704 x710)
                                    in T2 x701 x702
                              in x696 < x699 && x697 < x700)
                             (cond ((0 :: Exp Int) == (let T2 (T2 _ x715) _ = let I2 x716 x717 = shape a62 in T2 (T2 (constant ()) x716) x717 in x715) && (0 :: Exp Int) == (let T2 _ x718 = let I2 x719 x720 = shape a62 in T2 (T2 (constant ()) x719) x720 in x718)) (a55 ! I2 x696 x697) (cond ((0 :: Exp Int) == (let T2 (T2 _ x721) _ = let I2 x722 x723 = shape a55 in T2 (T2 (constant ()) x722) x723 in x721) && (0 :: Exp Int) == (let T2 _ x724 = let I2 x725 x726 = shape a55 in T2 (T2 (constant ()) x725) x726 in x724)) (a62 ! I2 x696 x697) (a62 ! I2 x696 x697 + a55 ! I2 x696 x697)))
                             (0.0 :: Exp Float)
                     in T2 (T2 x698 (-x698)) (constant ()))
              a64 = map (\(T2 (T2 x727 _) _) -> x727) a63
              a65 = map (\(T2 (T2 _ x728) _) -> x728) a63
              a66 =
                fold1
                  (\x729 x730 -> x729 + x730)
                  (generate
                     (let T2 (T2 _ x731) x732 =
                            let I2 x733 x734 =
                                  indexFull
                                    (I2 (let T2 (T2 _ x735) _ = let I2 x736 x737 = shape a8 in T2 (T2 (constant ()) x736) x737 in x735) (constant All))
                                    (let T2 _ x738 = let I1 x739 = shape a16 in T2 (constant ()) x739
                                         T2 _ x740 = let I1 x741 = shape a12 in T2 (constant ()) x741
                                     in I1 (min x740 x738))
                            in T2 (T2 (constant ()) x733) x734
                      in I2 x732 x731)
                     (\(I2 x742 x743) ->
                        cond
                          (let T2 x744 x745 =
                                 let T2 (T2 _ x746) x747 =
                                       let I2 x748 x749 =
                                             indexFull
                                               (I2 (let T2 (T2 _ x750) _ = let I2 x751 x752 = shape a8 in T2 (T2 (constant ()) x751) x752 in x750) (constant All))
                                               (let T2 _ x753 = let I1 x754 = shape a16 in T2 (constant ()) x754
                                                    T2 _ x755 = let I1 x756 = shape a12 in T2 (constant ()) x756
                                                in I1 (min x755 x753))
                                       in T2 (T2 (constant ()) x748) x749
                                 in T2 x746 x747
                           in x743 < x744 && x742 < x745)
                          (cond (let T2 x757 x758 = let T2 (T2 _ x759) x760 = let I2 x761 x762 = shape a64 in T2 (T2 (constant ()) x761) x762 in T2 x759 x760 in x743 < x757 && x742 < x758) (a64 ! I2 x743 x742) (0.0 :: Exp Float))
                          (0.0 :: Exp Float)))
              a67 =
                generate
                  (let T2 _ x763 = let I1 x764 = shape a16 in T2 (constant ()) x764
                       T2 _ x765 = let I1 x766 = shape a12 in T2 (constant ()) x766
                       T2 _ x767 =
                         let T2 _ x768 = let I1 x769 = shape a16 in T2 (constant ()) x769
                             T2 _ x770 = let I1 x771 = shape a12 in T2 (constant ()) x771
                         in T2 (constant ()) (min x770 x768)
                   in I1 (min x767 (min x765 x763)))
                  (\(I1 x772) -> let x773 = cond (x772 < (let T2 _ x774 = let I1 x775 = shape a66 in T2 (constant ()) x775 in x774)) (a66 ! I1 x772) (0.0 :: Exp Float) in T2 (T2 x773 x773) (constant ()))
              a68 = map (\(T2 (T2 x776 _) _) -> x776) a67
              a69 = map (\(T2 (T2 _ x777) _) -> x777) a67
              a70 = generate (shape a12) (\(I1 x778) -> cond (x778 < (let T2 _ x779 = let I1 x780 = shape a12 in T2 (constant ()) x780 in x779)) (cond (x778 < (let T2 _ x781 = let I1 x782 = shape a68 in T2 (constant ()) x782 in x781)) (a68 ! I1 x778) (0.0 :: Exp Float)) (0.0 :: Exp Float))
              a71 = generate (shape a16) (\(I1 x783) -> cond (x783 < (let T2 _ x784 = let I1 x785 = shape a16 in T2 (constant ()) x785 in x784)) (cond (x783 < (let T2 _ x786 = let I1 x787 = shape a69 in T2 (constant ()) x787 in x786)) (a69 ! I1 x783) (0.0 :: Exp Float)) (0.0 :: Exp Float))
              a72 =
                generate
                  (let T2 (T2 (T2 _ x788) x789) x790 = let I3 x791 x792 x793 = shape a24 in T2 (T2 (T2 (constant ()) x791) x792) x793
                       T2 (T2 (T2 _ x794) x795) x796 =
                         let T2 (T2 (T2 _ x797) x798) x799 = let I3 x800 x801 x802 = shape a18 in T2 (T2 (T2 (constant ()) x800) x801) x802
                             T2 (T2 (T2 _ x803) x804) x805 = let I3 x806 x807 x808 = shape a19 in T2 (T2 (T2 (constant ()) x806) x807) x808
                         in T2 (T2 (T2 (constant ()) (min x803 x797)) (min x804 x798)) (min x805 x799)
                       T2 (T2 (T2 _ x809) x810) x811 = let I3 x812 x813 x814 = shape a25 in T2 (T2 (T2 (constant ()) x812) x813) x814
                   in I3 (min x809 (min x794 x788)) (min x810 (min x795 x789)) (min x811 (min x796 x790)))
                  (\(I3 x815 x816 x817) ->
                     let x818 =
                           cond
                             (let T2 (T2 x819 x820) x821 =
                                    let T2 (T2 (T2 _ x822) x823) x824 =
                                          let T2 (T2 (T2 _ x825) x826) x827 = let I3 x828 x829 x830 = shape a25 in T2 (T2 (T2 (constant ()) x828) x829) x830
                                              T2 (T2 (T2 _ x831) x832) x833 = let I3 x834 x835 x836 = shape a25 in T2 (T2 (T2 (constant ()) x834) x835) x836
                                          in T2 (T2 (T2 (constant ()) (min x831 x825)) (min x832 x826)) (min x833 x827)
                                    in T2 (T2 x822 x823) x824
                              in (x815 < x819 && x816 < x820) && x817 < x821)
                             (let T2 x837 _ =
                                    let x838 =
                                          cond
                                            (let T2 (T2 x839 x840) x841 = let T2 (T2 (T2 _ x842) x843) x844 = let I3 x845 x846 x847 = indexFull (I3 (constant All) (constant All) (let T2 _ x848 = let I3 x849 x850 x851 = shape a25 in T2 (T2 (T2 (constant ()) x849) x850) x851 in x848)) (shape a26) in T2 (T2 (T2 (constant ()) x845) x846) x847 in T2 (T2 x842 x843) x844 in (x815 < x839 && x816 < x840) && x817 < x841)
                                            (let T2 (T2 _ x852) x853 = let I2 x854 x855 = indexSlice (I3 (constant All) (constant All) (let T2 _ x856 = let I3 x857 x858 x859 = shape a25 in T2 (T2 (T2 (constant ()) x857) x858) x859 in x856)) (I3 x815 x816 x817) in T2 (T2 (constant ()) x854) x855
                                             in cond
                                                  (let T2 x860 x861 =
                                                         let T2 (T2 _ x862) x863 =
                                                               let T2 (T2 _ x864) x865 = let I2 x866 x867 = shape a26 in T2 (T2 (constant ()) x866) x867
                                                                   T2 (T2 _ x868) x869 = let I2 x870 x871 = shape a26 in T2 (T2 (constant ()) x870) x871
                                                               in T2 (T2 (constant ()) (min x868 x864)) (min x869 x865)
                                                         in T2 x862 x863
                                                   in x852 < x860 && x853 < x861)
                                                  (let T2 x872 _ =
                                                         let T2 (T2 (T2 _ x873) _) _ =
                                                               let x874 = a26 ! I2 x852 x853
                                                                   T2 _ (T2 (T2 (T2 (T2 (T2 (T2 _ x875) x876) x877) x878) x879) x880) = let x881 = (0.5 :: Exp Float) * x874 in T2 x881 (T2 (T2 (T2 (T2 (T2 (T2 (constant ()) x874) x881) x874) (0.5 :: Exp Float)) x874) (0.5 :: Exp Float))
                                                               in T2 (T2 (T2 (T2 (T2 (T2 (constant ()) x875) x876) x877) x878) x879) x880
                                                         in T2 (x873 * cond (let T2 x882 x883 = let T2 (T2 _ x884) x885 = let I2 x886 x887 = shape a26 in T2 (T2 (constant ()) x886) x887 in T2 x884 x885 in x852 < x882 && x853 < x883) (cond (let T2 x888 x889 = let T2 (T2 _ x890) x891 = let I2 x892 x893 = shape a65 in T2 (T2 (constant ()) x892) x893 in T2 x890 x891 in x852 < x888 && x853 < x889) (a65 ! I2 x852 x853) (0.0 :: Exp Float)) (0.0 :: Exp Float)) (constant ())
                                                   in x872)
                                                  (0.0 :: Exp Float))
                                            (0.0 :: Exp Float)
                                        T2 (T2 (T2 (T2 _ x894) x895) _) _ =
                                          let x896 = a25 ! I3 x815 x816 x817
                                              T2 _ (T2 (T2 (T2 (T2 (T2 (T2 _ x897) x898) x899) x900) x901) x902) = let x903 = x896 * x896 in T2 x903 (T2 (T2 (T2 (T2 (T2 (T2 (constant ()) x896) x903) x896) x896) x896) x896)
                                          in T2 (T2 (T2 (T2 (T2 (T2 (constant ()) x897) x898) x899) x900) x901) x902
                                    in T2 (x894 * x838 + x895 * x838) (constant ())
                              in x837)
                             (0.0 :: Exp Float)
                     in T2 (T2 x818 x818) (constant ()))
              a73 = map (\(T2 (T2 x904 _) _) -> x904) a72
              a74 = map (\(T2 (T2 _ x905) _) -> x905) a72
              a75 =
                generate
                  (let T2 (T2 (T2 _ x906) x907) x908 = let I3 x909 x910 x911 = shape a18 in T2 (T2 (T2 (constant ()) x909) x910) x911
                       T2 (T2 (T2 _ x912) x913) x914 = let I3 x915 x916 x917 = shape a19 in T2 (T2 (T2 (constant ()) x915) x916) x917
                       T2 (T2 (T2 _ x918) x919) x920 =
                         let T2 (T2 (T2 _ x921) x922) x923 = let I3 x924 x925 x926 = shape a18 in T2 (T2 (T2 (constant ()) x924) x925) x926
                             T2 (T2 (T2 _ x927) x928) x929 = let I3 x930 x931 x932 = shape a19 in T2 (T2 (T2 (constant ()) x930) x931) x932
                         in T2 (T2 (T2 (constant ()) (min x927 x921)) (min x928 x922)) (min x929 x923)
                   in I3 (min x918 (min x912 x906)) (min x919 (min x913 x907)) (min x920 (min x914 x908)))
                  (\(I3 x933 x934 x935) ->
                     let x936 =
                           cond
                             (let T2 (T2 x937 x938) x939 =
                                    let T2 (T2 (T2 _ x940) x941) x942 =
                                          let T2 (T2 (T2 _ x943) x944) x945 = let I3 x946 x947 x948 = shape a18 in T2 (T2 (T2 (constant ()) x946) x947) x948
                                              T2 (T2 (T2 _ x949) x950) x951 = let I3 x952 x953 x954 = shape a19 in T2 (T2 (T2 (constant ()) x952) x953) x954
                                          in T2 (T2 (T2 (constant ()) (min x949 x943)) (min x950 x944)) (min x951 x945)
                                    in T2 (T2 x940 x941) x942
                              in (x933 < x937 && x934 < x938) && x935 < x939)
                             (cond (let T2 (T2 x955 x956) x957 = let T2 (T2 (T2 _ x958) x959) x960 = let I3 x961 x962 x963 = shape a73 in T2 (T2 (T2 (constant ()) x961) x962) x963 in T2 (T2 x958 x959) x960 in (x933 < x955 && x934 < x956) && x935 < x957) (a73 ! I3 x933 x934 x935) (0.0 :: Exp Float))
                             (0.0 :: Exp Float)
                         T2 (T2 (T2 (T2 _ x964) x965) _) _ =
                           let T2 _ (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 _ x966) x967) x968) x969) x970) x971) x972) x973) x974) =
                                 let x975 = a19 ! I3 x933 x934 x935
                                     x976 = a18 ! I3 x933 x934 x935
                                     x977 = x975 * x976
                                 in T2 x977 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (constant ()) x975) x976) x975) x976) x977) x975) x976) x975) x976)
                           in T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (constant ()) x966) x967) x968) x969) x970) x971) x972) x973) x974
                     in T2 (T2 (x965 * x936) (x964 * x936)) (constant ()))
              a76 = map (\(T2 (T2 x978 _) _) -> x978) a75
              a77 = map (\(T2 (T2 _ x979) _) -> x979) a75
              a78 = fold1 (\x980 x981 -> x980 + x981) (generate (let T2 (T2 (T2 _ x982) x983) x984 = let I3 x985 x986 x987 = shape a19 in T2 (T2 (T2 (constant ()) x985) x986) x987 in I3 x983 x984 x982) (\(I3 x988 x989 x990) -> cond (let T2 (T2 x991 x992) x993 = let T2 (T2 (T2 _ x994) x995) x996 = let I3 x997 x998 x999 = shape a19 in T2 (T2 (T2 (constant ()) x997) x998) x999 in T2 (T2 x994 x995) x996 in (x990 < x991 && x988 < x992) && x989 < x993) (cond (let T2 (T2 x1000 x1001) x1002 = let T2 (T2 (T2 _ x1003) x1004) x1005 = let I3 x1006 x1007 x1008 = shape a76 in T2 (T2 (T2 (constant ()) x1006) x1007) x1008 in T2 (T2 x1003 x1004) x1005 in (x990 < x1000 && x988 < x1001) && x989 < x1002) (a76 ! I3 x990 x988 x989) (0.0 :: Exp Float)) (0.0 :: Exp Float)))
              a79 = generate (shape a17) (\(I2 x1009 x1010) -> cond (let T2 x1011 x1012 = let T2 (T2 _ x1013) x1014 = let I2 x1015 x1016 = shape a78 in T2 (T2 (constant ()) x1015) x1016 in T2 x1013 x1014 in x1009 < x1011 && x1010 < x1012) (a78 ! I2 x1009 x1010) (0.0 :: Exp Float))
              a80 = generate (shape a18) (\(I3 x1017 x1018 x1019) -> cond (let T2 (T2 x1020 x1021) x1022 = let T2 (T2 (T2 _ x1023) x1024) x1025 = let I3 x1026 x1027 x1028 = shape a18 in T2 (T2 (T2 (constant ()) x1026) x1027) x1028 in T2 (T2 x1023 x1024) x1025 in (x1017 < x1020 && x1018 < x1021) && x1019 < x1022) (cond (let T2 (T2 x1029 x1030) x1031 = let T2 (T2 (T2 _ x1032) x1033) x1034 = let I3 x1035 x1036 x1037 = shape a77 in T2 (T2 (T2 (constant ()) x1035) x1036) x1037 in T2 (T2 x1032 x1033) x1034 in (x1017 < x1029 && x1018 < x1030) && x1019 < x1031) (a77 ! I3 x1017 x1018 x1019) (0.0 :: Exp Float)) (0.0 :: Exp Float))
              a81 =
                generate
                  (let T2 (T2 (T2 (T2 _ x1038) x1039) x1040) x1041 = let I4 x1042 x1043 x1044 x1045 = shape a23 in T2 (T2 (T2 (T2 (constant ()) x1042) x1043) x1044) x1045
                       T2 (T2 (T2 (T2 _ x1046) x1047) x1048) x1049 = let I4 x1050 x1051 x1052 x1053 = shape a22 in T2 (T2 (T2 (T2 (constant ()) x1050) x1051) x1052) x1053
                       T2 (T2 (T2 (T2 _ x1054) x1055) x1056) x1057 =
                         let T2 (T2 (T2 (T2 _ x1058) x1059) x1060) x1061 = let I4 x1062 x1063 x1064 x1065 = shape a23 in T2 (T2 (T2 (T2 (constant ()) x1062) x1063) x1064) x1065
                             T2 (T2 (T2 (T2 _ x1066) x1067) x1068) x1069 = let I4 x1070 x1071 x1072 x1073 = shape a22 in T2 (T2 (T2 (T2 (constant ()) x1070) x1071) x1072) x1073
                         in T2 (T2 (T2 (T2 (constant ()) (min x1066 x1058)) (min x1067 x1059)) (min x1068 x1060)) (min x1069 x1061)
                   in I4 (min x1054 (min x1046 x1038)) (min x1055 (min x1047 x1039)) (min x1056 (min x1048 x1040)) (min x1057 (min x1049 x1041)))
                  (\(I4 x1074 x1075 x1076 x1077) ->
                     let x1078 =
                           cond
                             (let T2 (T2 (T2 x1079 x1080) x1081) x1082 =
                                    let T2 (T2 (T2 (T2 _ x1083) x1084) x1085) x1086 =
                                          let I4 x1087 x1088 x1089 x1090 =
                                                indexFull
                                                  (I4 (constant All)
                                                      (constant All)
                                                      (constant All)
                                                      (let T2 _ x1091 =
                                                             let T2 (T2 (T2 (T2 _ x1092) x1093) x1094) x1095 = let I4 x1096 x1097 x1098 x1099 = shape a23 in T2 (T2 (T2 (T2 (constant ()) x1096) x1097) x1098) x1099
                                                                 T2 (T2 (T2 (T2 _ x1100) x1101) x1102) x1103 = let I4 x1104 x1105 x1106 x1107 = shape a22 in T2 (T2 (T2 (T2 (constant ()) x1104) x1105) x1106) x1107
                                                             in T2 (T2 (T2 (T2 (constant ()) (min x1100 x1092)) (min x1101 x1093)) (min x1102 x1094)) (min x1103 x1095)
                                                       in x1091))
                                                  (shape a24)
                                          in T2 (T2 (T2 (T2 (constant ()) x1087) x1088) x1089) x1090
                                    in T2 (T2 (T2 x1083 x1084) x1085) x1086
                              in ((x1074 < x1079 && x1075 < x1080) && x1076 < x1081) && x1077 < x1082)
                             (let T2 (T2 (T2 _ x1108) x1109) x1110 =
                                    let I3 x1111 x1112 x1113 =
                                          indexSlice
                                            (I4 (constant All)
                                                (constant All)
                                                (constant All)
                                                (let T2 _ x1114 =
                                                       let T2 (T2 (T2 (T2 _ x1115) x1116) x1117) x1118 = let I4 x1119 x1120 x1121 x1122 = shape a23 in T2 (T2 (T2 (T2 (constant ()) x1119) x1120) x1121) x1122
                                                           T2 (T2 (T2 (T2 _ x1123) x1124) x1125) x1126 = let I4 x1127 x1128 x1129 x1130 = shape a22 in T2 (T2 (T2 (T2 (constant ()) x1127) x1128) x1129) x1130
                                                       in T2 (T2 (T2 (T2 (constant ()) (min x1123 x1115)) (min x1124 x1116)) (min x1125 x1117)) (min x1126 x1118)
                                                 in x1114))
                                            (I4 x1074 x1075 x1076 x1077)
                                    in T2 (T2 (T2 (constant ()) x1111) x1112) x1113
                              in cond (let T2 (T2 x1131 x1132) x1133 = let T2 (T2 (T2 _ x1134) x1135) x1136 = let I3 x1137 x1138 x1139 = shape a24 in T2 (T2 (T2 (constant ()) x1137) x1138) x1139 in T2 (T2 x1134 x1135) x1136 in (x1108 < x1131 && x1109 < x1132) && x1110 < x1133) (cond (let T2 (T2 x1140 x1141) x1142 = let T2 (T2 (T2 _ x1143) x1144) x1145 = let I3 x1146 x1147 x1148 = shape a74 in T2 (T2 (T2 (constant ()) x1146) x1147) x1148 in T2 (T2 x1143 x1144) x1145 in (x1108 < x1140 && x1109 < x1141) && x1110 < x1142) (a74 ! I3 x1108 x1109 x1110) (0.0 :: Exp Float)) (0.0 :: Exp Float))
                             (0.0 :: Exp Float)
                         T2 (T2 (T2 (T2 _ x1149) x1150) _) _ =
                           let T2 _ (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 _ x1151) x1152) x1153) x1154) x1155) x1156) x1157) x1158) x1159) =
                                 let x1160 = a22 ! I4 x1074 x1075 x1076 x1077
                                     x1161 = a23 ! I4 x1074 x1075 x1076 x1077
                                     x1162 = x1160 * x1161
                                 in T2 x1162 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (constant ()) x1160) x1161) x1160) x1161) x1162) x1160) x1161) x1160) x1161)
                           in T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (constant ()) x1151) x1152) x1153) x1154) x1155) x1156) x1157) x1158) x1159
                     in T2 (T2 (x1150 * x1078) (x1149 * x1078)) (constant ()))
              a82 = map (\(T2 (T2 x1163 _) _) -> x1163) a81
              a83 = map (\(T2 (T2 _ x1164) _) -> x1164) a81
              a84 =
                permute
                  (\x1165 x1166 -> x1165 + x1166)
                  (generate
                     (let T2 (T2 _ x1167) x1168 = let I2 x1169 x1170 = shape a21 in T2 (T2 (constant ()) x1169) x1170
                          T2 (T2 _ x1171) x1172 = let I2 x1173 x1174 = shape a20 in T2 (T2 (constant ()) x1173) x1174
                      in I2 (min x1171 x1167) (min x1172 x1168))
                     (\(I2 _ _) -> 0.0 :: Exp Float))
                  (\(I4 _ x1175 x1176 x1177) -> Just_ (cond (x1176 > x1177) (I2 x1175 ((1 :: Exp Int) + ((-1 :: Exp Int) + (((let x1178 = let T2 _ x1179 = let I2 x1180 x1181 = shape a8 in T2 (T2 (constant ()) x1180) x1181 in x1179 in div (x1178 * ((-1 :: Exp Int) + x1178)) (2 :: Exp Int) - div (let x1182 = (-1 :: Exp Int) + x1178 in (x1182 - x1177) * ((1 :: Exp Int) + (x1182 - x1177))) (2 :: Exp Int)) + x1176) - x1177)))) (I2 x1175 (0 :: Exp Int))))
                  (generate (shape a22) (\(I4 x1183 x1184 x1185 x1186) -> cond (let T2 (T2 (T2 x1187 x1188) x1189) x1190 = let T2 (T2 (T2 (T2 _ x1191) x1192) x1193) x1194 = let I4 x1195 x1196 x1197 x1198 = shape a22 in T2 (T2 (T2 (T2 (constant ()) x1195) x1196) x1197) x1198 in T2 (T2 (T2 x1191 x1192) x1193) x1194 in ((x1183 < x1187 && x1184 < x1188) && x1185 < x1189) && x1186 < x1190) (cond (let T2 (T2 (T2 x1199 x1200) x1201) x1202 = let T2 (T2 (T2 (T2 _ x1203) x1204) x1205) x1206 = let I4 x1207 x1208 x1209 x1210 = shape a82 in T2 (T2 (T2 (T2 (constant ()) x1207) x1208) x1209) x1210 in T2 (T2 (T2 x1203 x1204) x1205) x1206 in ((x1183 < x1199 && x1184 < x1200) && x1185 < x1201) && x1186 < x1202) (a82 ! I4 x1183 x1184 x1185 x1186) (0.0 :: Exp Float)) (0.0 :: Exp Float)))
              a85 =
                permute
                  (\x1211 x1212 -> x1211 + x1212)
                  (generate (shape a14) (\(I2 _ _) -> 0.0 :: Exp Float))
                  (\(I2 x1213 x1214) -> Just_ (I2 x1213 ((-1 :: Exp Int) + (x1214 + (let T2 _ x1215 = let I2 x1216 x1217 = shape a8 in T2 (T2 (constant ()) x1216) x1217 in x1215)))))
                  (generate
                     (shape a21)
                     (\(I2 x1218 x1219) ->
                        cond
                          (let T2 x1220 x1221 = let T2 (T2 _ x1222) x1223 = let I2 x1224 x1225 = shape a21 in T2 (T2 (constant ()) x1224) x1225 in T2 x1222 x1223 in x1218 < x1220 && x1219 < x1221)
                          (cond
                             (let T2 x1226 x1227 =
                                    let T2 (T2 _ x1228) x1229 =
                                          let T2 (T2 _ x1230) x1231 = let I2 x1232 x1233 = shape a21 in T2 (T2 (constant ()) x1232) x1233
                                              T2 (T2 _ x1234) x1235 = let I2 x1236 x1237 = shape a20 in T2 (T2 (constant ()) x1236) x1237
                                              T2 (T2 _ x1238) x1239 =
                                                let T2 (T2 _ x1240) x1241 = let I2 x1242 x1243 = shape a21 in T2 (T2 (constant ()) x1242) x1243
                                                    T2 (T2 _ x1244) x1245 = let I2 x1246 x1247 = shape a20 in T2 (T2 (constant ()) x1246) x1247
                                                in T2 (T2 (constant ()) (min x1244 x1240)) (min x1245 x1241)
                                          in T2 (T2 (constant ()) (min x1238 (min x1234 x1230))) (min x1239 (min x1235 x1231))
                                    in T2 x1228 x1229
                              in x1218 < x1226 && x1219 < x1227)
                             (let T2 (T2 _ x1248) _ =
                                    let x1249 = cond (let T2 x1250 x1251 = let T2 (T2 _ x1252) x1253 = let I2 x1254 x1255 = shape a84 in T2 (T2 (constant ()) x1254) x1255 in T2 x1252 x1253 in x1218 < x1250 && x1219 < x1251) (a84 ! I2 x1218 x1219) (0.0 :: Exp Float)
                                        T2 (T2 (T2 (T2 _ x1256) x1257) _) _ =
                                          let T2 _ (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 _ x1258) x1259) x1260) x1261) x1262) x1263) x1264) x1265) x1266) =
                                                let x1267 = a20 ! I2 x1218 x1219
                                                    x1268 = a21 ! I2 x1218 x1219
                                                    x1269 = x1267 * x1268
                                                in T2 x1269 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (constant ()) x1267) x1268) x1267) x1268) x1269) x1267) x1268) x1267) x1268)
                                          in T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (constant ()) x1258) x1259) x1260) x1261) x1262) x1263) x1264) x1265) x1266
                                    in T2 (T2 (x1257 * x1249) (x1256 * x1249)) (constant ())
                              in x1248)
                             (0.0 :: Exp Float))
                          (0.0 :: Exp Float)))
              a86 = generate (shape a14) (\(I2 x1270 x1271) -> cond (let T2 x1272 x1273 = let T2 (T2 _ x1274) x1275 = let I2 x1276 x1277 = shape a85 in T2 (T2 (constant ()) x1276) x1277 in T2 x1274 x1275 in x1270 < x1272 && x1271 < x1273) (a85 ! I2 x1270 x1271) (0.0 :: Exp Float))
              a87 = fold1 (\x1278 x1279 -> x1278 + x1279) (generate (let T2 (T2 (T2 (T2 _ x1280) x1281) x1282) x1283 = let I4 x1284 x1285 x1286 x1287 = shape a23 in T2 (T2 (T2 (T2 (constant ()) x1284) x1285) x1286) x1287 in I4 x1280 x1281 x1283 x1282) (\(I4 x1288 x1289 x1290 x1291) -> cond (let T2 (T2 (T2 x1292 x1293) x1294) x1295 = let T2 (T2 (T2 (T2 _ x1296) x1297) x1298) x1299 = let I4 x1300 x1301 x1302 x1303 = shape a23 in T2 (T2 (T2 (T2 (constant ()) x1300) x1301) x1302) x1303 in T2 (T2 (T2 x1296 x1297) x1298) x1299 in ((x1288 < x1292 && x1289 < x1293) && x1291 < x1294) && x1290 < x1295) (cond (let T2 (T2 (T2 x1304 x1305) x1306) x1307 = let T2 (T2 (T2 (T2 _ x1308) x1309) x1310) x1311 = let I4 x1312 x1313 x1314 x1315 = shape a83 in T2 (T2 (T2 (T2 (constant ()) x1312) x1313) x1314) x1315 in T2 (T2 (T2 x1308 x1309) x1310) x1311 in ((x1288 < x1304 && x1289 < x1305) && x1291 < x1306) && x1290 < x1307) (a83 ! I4 x1288 x1289 x1291 x1290) (0.0 :: Exp Float)) (0.0 :: Exp Float)))
              a88 = generate (shape a18) (\(I3 x1316 x1317 x1318) -> cond (let T2 (T2 x1319 x1320) x1321 = let T2 (T2 (T2 _ x1322) x1323) x1324 = let I3 x1325 x1326 x1327 = shape a87 in T2 (T2 (T2 (constant ()) x1325) x1326) x1327 in T2 (T2 x1322 x1323) x1324 in (x1316 < x1319 && x1317 < x1320) && x1318 < x1321) (a87 ! I3 x1316 x1317 x1318) (0.0 :: Exp Float))
              a89 =
                fold1
                  (\x1328 x1329 -> x1328 + x1329)
                  (generate
                     (let T2 (T2 (T2 _ x1330) x1331) x1332 = let I3 x1333 x1334 x1335 = indexFull (I3 (let T2 (T2 _ x1336) _ = let I2 x1337 x1338 = shape a8 in T2 (T2 (constant ()) x1337) x1338 in x1336) (constant All) (constant All)) (shape a13) in T2 (T2 (T2 (constant ()) x1333) x1334) x1335 in I3 x1331 x1332 x1330)
                     (\(I3 x1339 x1340 x1341) ->
                        cond
                          (let T2 (T2 x1342 x1343) x1344 = let T2 (T2 (T2 _ x1345) x1346) x1347 = let I3 x1348 x1349 x1350 = indexFull (I3 (let T2 (T2 _ x1351) _ = let I2 x1352 x1353 = shape a8 in T2 (T2 (constant ()) x1352) x1353 in x1351) (constant All) (constant All)) (shape a13) in T2 (T2 (T2 (constant ()) x1348) x1349) x1350 in T2 (T2 x1345 x1346) x1347 in (x1341 < x1342 && x1339 < x1343) && x1340 < x1344)
                          (cond
                             (let T2 (T2 x1354 x1355) x1356 =
                                    let T2 (T2 (T2 _ x1357) x1358) x1359 =
                                          let T2 (T2 (T2 _ x1360) x1361) x1362 = let I3 x1363 x1364 x1365 = indexFull (I3 (let T2 (T2 _ x1366) _ = let I2 x1367 x1368 = shape a8 in T2 (T2 (constant ()) x1367) x1368 in x1366) (constant All) (constant All)) (shape a13) in T2 (T2 (T2 (constant ()) x1363) x1364) x1365
                                              T2 (T2 (T2 _ x1369) x1370) x1371 = let I3 x1372 x1373 x1374 = indexFull (I3 (constant All) (let T2 _ x1375 = let I1 x1376 = shape a12 in T2 (constant ()) x1376 in x1375) (constant All)) (shape a8) in T2 (T2 (T2 (constant ()) x1372) x1373) x1374
                                              T2 (T2 (T2 _ x1377) x1378) x1379 = let I3 x1380 x1381 x1382 = shape a18 in T2 (T2 (T2 (constant ()) x1380) x1381) x1382
                                          in T2 (T2 (T2 (constant ()) (min x1377 (min x1369 x1360))) (min x1378 (min x1370 x1361))) (min x1379 (min x1371 x1362))
                                    in T2 (T2 x1357 x1358) x1359
                              in (x1341 < x1354 && x1339 < x1355) && x1340 < x1356)
                             (let T2 (T2 _ x1383) _ =
                                    let x1384 =
                                          cond
                                            (let T2 (T2 x1385 x1386) x1387 =
                                                   let T2 (T2 (T2 _ x1388) x1389) x1390 =
                                                         let T2 (T2 x1391 x1392) x1393 = let T2 (T2 (T2 _ x1394) x1395) x1396 = let I3 x1397 x1398 x1399 = shape a88 in T2 (T2 (T2 (constant ()) x1397) x1398) x1399 in T2 (T2 x1394 x1395) x1396
                                                             T2 (T2 x1400 x1401) x1402 = let T2 (T2 (T2 _ x1403) x1404) x1405 = let I3 x1406 x1407 x1408 = shape a80 in T2 (T2 (T2 (constant ()) x1406) x1407) x1408 in T2 (T2 x1403 x1404) x1405
                                                         in T2 (T2 (T2 (constant ()) (max x1391 x1400)) (max x1392 x1401)) (max x1393 x1402)
                                                   in T2 (T2 x1388 x1389) x1390
                                             in (x1341 < x1385 && x1339 < x1386) && x1340 < x1387)
                                            (cond (((0 :: Exp Int) == (let T2 (T2 (T2 _ x1409) _) _ = let I3 x1410 x1411 x1412 = shape a88 in T2 (T2 (T2 (constant ()) x1410) x1411) x1412 in x1409) && (0 :: Exp Int) == (let T2 (T2 _ x1413) _ = let I3 x1414 x1415 x1416 = shape a88 in T2 (T2 (T2 (constant ()) x1414) x1415) x1416 in x1413)) && (0 :: Exp Int) == (let T2 _ x1417 = let I3 x1418 x1419 x1420 = shape a88 in T2 (T2 (T2 (constant ()) x1418) x1419) x1420 in x1417)) (a80 ! I3 x1341 x1339 x1340) (cond (((0 :: Exp Int) == (let T2 (T2 (T2 _ x1421) _) _ = let I3 x1422 x1423 x1424 = shape a80 in T2 (T2 (T2 (constant ()) x1422) x1423) x1424 in x1421) && (0 :: Exp Int) == (let T2 (T2 _ x1425) _ = let I3 x1426 x1427 x1428 = shape a80 in T2 (T2 (T2 (constant ()) x1426) x1427) x1428 in x1425)) && (0 :: Exp Int) == (let T2 _ x1429 = let I3 x1430 x1431 x1432 = shape a80 in T2 (T2 (T2 (constant ()) x1430) x1431) x1432 in x1429)) (a88 ! I3 x1341 x1339 x1340) (a88 ! I3 x1341 x1339 x1340 + a80 ! I3 x1341 x1339 x1340)))
                                            (0.0 :: Exp Float)
                                    in T2 (T2 x1384 (-x1384)) (constant ())
                              in x1383)
                             (0.0 :: Exp Float))
                          (0.0 :: Exp Float)))
              a90 = generate (shape a13) (\(I2 x1433 x1434) -> cond (let T2 x1435 x1436 = let T2 (T2 _ x1437) x1438 = let I2 x1439 x1440 = shape a89 in T2 (T2 (constant ()) x1439) x1440 in T2 x1437 x1438 in x1433 < x1435 && x1434 < x1436) (a89 ! I2 x1433 x1434) (0.0 :: Exp Float))
              a91 =
                generate
                  Z_
                  (\Z_ ->
                     let x1441 =
                           let T2 x1442 _ =
                                 let T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 _ x1443) _) _) _) _) _) _) _) _ =
                                       let x1444 = a35 ! Z_
                                           T2 _ (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 _ x1445) x1446) x1447) x1448) x1449) x1450) x1451) x1452) x1453) x1454) x1455) =
                                             let T2 x1456 x1457 = let T2 (T2 _ x1458) x1459 = let I2 x1460 x1461 = shape a8 in T2 (T2 (constant ()) x1460) x1461 in T2 x1458 x1459
                                                 x1462 = fromIntegral x1456
                                                 x1463 = x1462 * x1444
                                             in T2 x1463 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (constant ()) x1444) x1463) x1462) x1444) x1456) x1457) x1456) x1456) x1462) x1456) x1444)
                                       in T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (constant ()) x1445) x1446) x1447) x1448) x1449) x1450) x1451) x1452) x1453) x1454) x1455
                                 in T2 (x1443 * a48 ! Z_) (constant ())
                           in x1442
                     in T2 (T2 x1441 x1441) (constant ()))
              a92 = map (\(T2 (T2 x1464 _) _) -> x1464) a91
              a93 = map (\(T2 (T2 _ x1465) _) -> x1465) a91
              a94 =
                generate
                  (let T2 _ x1466 = let I1 x1467 = indexFull (I1 (let T2 _ x1468 = let I1 x1469 = shape a12 in T2 (constant ()) x1469 in x1468)) Z_ in T2 (constant ()) x1467
                       T2 _ x1470 = let I1 x1471 = shape a12 in T2 (constant ()) x1471
                       T2 _ x1472 = let I1 x1473 = shape a33 in T2 (constant ()) x1473
                   in I1 (min x1472 (min x1470 x1466)))
                  (\(I1 x1474) ->
                     let x1475 =
                           cond
                             ((<) x1474
                                  (let T2 _ x1481 =
                                         let T2 _ x1482 = let I1 x1483 = shape a33 in T2 (constant ()) x1483
                                             T2 _ x1484 = let I1 x1485 = shape a33 in T2 (constant ()) x1485
                                         in T2 (constant ()) (min x1484 x1482)
                                   in x1481))
                             (let T2 x1486 _ =
                                    let T2 (T2 _ x1487) _ =
                                          let x1488 = a33 ! I1 x1474
                                              T2 _ (T2 (T2 (T2 _ x1489) x1490) x1491) = let x1492 = exp x1488 in T2 x1492 (T2 (T2 (T2 (constant ()) x1488) x1492) x1488)
                                          in T2 (T2 (T2 (constant ()) x1489) x1490) x1491
                                    in T2 ((*) (cond
                                                  (x1474 < (let T2 _ x1504 = let I1 x1505 = indexFull (I1 (let T2 _ x1506 = let I1 x1507 = shape a33 in T2 (constant ()) x1507 in x1506)) Z_ in T2 (constant ()) x1505 in x1504))
                                                  (let T2 x1508 _ =
                                                         let T2 _ x1509 =
                                                               let x1510 = a34 ! Z_
                                                                   T2 _ (T2 (T2 (T2 _ x1511) x1512) x1513) = let x1514 = log x1510 in T2 x1514 (T2 (T2 (T2 (constant ()) x1510) x1514) x1510)
                                                               in T2 (T2 (T2 (constant ()) x1511) x1512) x1513
                                                         in T2 (a92 ! Z_ / x1509) (constant ())
                                                   in x1508)
                                                  (0.0 :: Exp Float))
                                               x1487)
                                          (constant ())
                              in x1486)
                             (0.0 :: Exp Float)
                     in T2 (T2 x1475 (-x1475)) (constant ()))
              a95 = map (\(T2 (T2 x1515 _) _) -> x1515) a94
              a96 = map (\(T2 (T2 _ x1516) _) -> x1516) a94
              a97 = generate (shape a12) (\(I1 x1517) -> cond (x1517 < (let T2 _ x1518 = let I1 x1519 = shape a12 in T2 (constant ()) x1519 in x1518)) (cond (x1517 < (let T2 _ x1520 = let I1 x1521 = shape a95 in T2 (constant ()) x1521 in x1520)) (a95 ! I1 x1517) (0.0 :: Exp Float)) (0.0 :: Exp Float))
              a98 = fold1 (\x1522 x1523 -> x1522 + x1523) (generate (indexFull (I1 (let T2 _ x1524 = let I1 x1525 = shape a12 in T2 (constant ()) x1525 in x1524)) Z_) (\(I1 x1526) -> cond (x1526 < (let T2 _ x1527 = let I1 x1528 = indexFull (I1 (let T2 _ x1529 = let I1 x1530 = shape a12 in T2 (constant ()) x1530 in x1529)) Z_ in T2 (constant ()) x1528 in x1527)) (cond (x1526 < (let T2 _ x1531 = let I1 x1532 = shape a96 in T2 (constant ()) x1532 in x1531)) (a96 ! I1 x1526) (0.0 :: Exp Float)) (0.0 :: Exp Float)))
              a99 = scanl1 (\x1533 x1534 -> max x1533 x1534) a12
              a100 = backpermute (I1 ((-1 :: Exp Int) + (let T2 _ x1535 = let I1 x1536 = shape a99 in T2 (constant ()) x1536 in x1535))) (\(I1 x1537) -> I1 x1537) a99
              a101 = scanr (\x1538 x1539 -> x1538 * x1539) (1.0 :: Exp Float) (generate (let T2 _ x1540 = let I1 x1541 = shape a100 in T2 (constant ()) x1541 in I1 (min x1540 ((-1 :: Exp Int) + (let T2 _ x1542 = let I1 x1543 = shape a12 in T2 (constant ()) x1543 in x1542)))) (\(I1 x1544) -> let T2 x1545 _ = cond (a100 ! I1 x1544 > a12 ! I1 ((1 :: Exp Int) + x1544)) (T2 (1.0 :: Exp Float) (0.0 :: Exp Float)) (T2 (0.0 :: Exp Float) (1.0 :: Exp Float)) in x1545))
              a102 =
                generate
                  (shape a12)
                  (\(I1 x1546) ->
                     cond
                       ((<) x1546
                            (let T2 _ x1566 =
                                   let T2 _ x1567 = let T2 _ x1568 = let I1 x1569 = shape a101 in T2 (constant ()) x1569 in T2 (constant ()) (min ((1 :: Exp Int) + (let T2 _ x1570 = let T2 _ x1571 = let I1 x1572 = shape a100 in T2 (constant ()) x1572 in T2 (constant ()) (min x1571 ((-1 :: Exp Int) + (let T2 _ x1573 = let I1 x1574 = shape a12 in T2 (constant ()) x1574 in x1573))) in x1570)) x1568)
                                       T2 _ x1575 = let I1 x1576 = indexFull (I1 (let T2 _ x1577 = let T2 _ x1578 = let I1 x1579 = shape a101 in T2 (constant ()) x1579 in T2 (constant ()) (min ((1 :: Exp Int) + (let T2 _ x1580 = let T2 _ x1581 = let I1 x1582 = shape a100 in T2 (constant ()) x1582 in T2 (constant ()) (min x1581 ((-1 :: Exp Int) + (let T2 _ x1583 = let I1 x1584 = shape a12 in T2 (constant ()) x1584 in x1583))) in x1580)) x1578) in x1577)) Z_ in T2 (constant ()) x1576
                                   in T2 (constant ()) (min x1575 x1567)
                             in x1566))
                       ((*) (a93 ! Z_ + a98 ! Z_)
                            ((*) (cond
                                    (x1546 > (0 :: Exp Int))
                                    (let x1591 = (-1 :: Exp Int) + x1546
                                         T2 _ x1592 = cond (a100 ! I1 x1591 > a12 ! I1 ((1 :: Exp Int) + x1591)) (T2 (1.0 :: Exp Float) (0.0 :: Exp Float)) (T2 (0.0 :: Exp Float) (1.0 :: Exp Float))
                                     in x1592)
                                    (1.0 :: Exp Float))
                                 (a101 ! I1 x1546)))
                       (0.0 :: Exp Float))
              a103 =
                generate
                  (let T2 _ x1593 =
                         let T2 _ x1594 = let I1 x1595 = indexFull (I1 (let T2 _ x1596 = let I1 x1597 = shape a12 in T2 (constant ()) x1597 in x1596)) Z_ in T2 (constant ()) x1595
                             T2 _ x1598 = let I1 x1599 = shape a16 in T2 (constant ()) x1599
                         in T2 (constant ()) (min x1598 x1594)
                       T2 _ x1600 =
                         let T2 _ x1601 = let I1 x1602 = indexFull (I1 (let T2 _ x1603 = let I1 x1604 = shape a12 in T2 (constant ()) x1604 in x1603)) Z_ in T2 (constant ()) x1602
                             T2 _ x1605 = let I1 x1606 = shape a39 in T2 (constant ()) x1606
                         in T2 (constant ()) (min x1605 x1601)
                       T2 _ x1607 =
                         let T2 _ x1608 =
                               let T2 _ x1609 = let I1 x1610 = indexFull (I1 (let T2 _ x1611 = let I1 x1612 = shape a12 in T2 (constant ()) x1612 in x1611)) Z_ in T2 (constant ()) x1610
                                   T2 _ x1613 = let I1 x1614 = shape a16 in T2 (constant ()) x1614
                               in T2 (constant ()) (min x1613 x1609)
                             T2 _ x1615 =
                               let T2 _ x1616 = let I1 x1617 = indexFull (I1 (let T2 _ x1618 = let I1 x1619 = shape a12 in T2 (constant ()) x1619 in x1618)) Z_ in T2 (constant ()) x1617
                                   T2 _ x1620 = let I1 x1621 = shape a39 in T2 (constant ()) x1621
                               in T2 (constant ()) (min x1620 x1616)
                         in T2 (constant ()) (min x1615 x1608)
                   in I1 (min x1607 (min x1600 x1593)))
                  (\(I1 x1622) ->
                     let x1623 =
                           cond
                             ((<) x1622
                                  (let T2 _ x1641 =
                                         let I1 x1642 =
                                               indexFull
                                                 (I1 (let T2 _ x1643 =
                                                            let T2 _ x1644 =
                                                                  let T2 _ x1645 = let I1 x1646 = indexFull (I1 (let T2 _ x1647 = let I1 x1648 = shape a12 in T2 (constant ()) x1648 in x1647)) Z_ in T2 (constant ()) x1646
                                                                      T2 _ x1649 = let I1 x1650 = shape a16 in T2 (constant ()) x1650
                                                                  in T2 (constant ()) (min x1649 x1645)
                                                                T2 _ x1651 =
                                                                  let T2 _ x1652 = let I1 x1653 = indexFull (I1 (let T2 _ x1654 = let I1 x1655 = shape a12 in T2 (constant ()) x1655 in x1654)) Z_ in T2 (constant ()) x1653
                                                                      T2 _ x1656 = let I1 x1657 = shape a39 in T2 (constant ()) x1657
                                                                  in T2 (constant ()) (min x1656 x1652)
                                                            in T2 (constant ()) (min x1651 x1644)
                                                      in x1643))
                                                 Z_
                                         in T2 (constant ()) x1642
                                   in x1641))
                             (a45 ! Z_)
                             (0.0 :: Exp Float)
                     in T2 (T2 x1623 (-x1623)) (constant ()))
              a104 = map (\(T2 (T2 x1658 _) _) -> x1658) a103
              a105 = map (\(T2 (T2 _ x1659) _) -> x1659) a103
              a106 =
                generate
                  (let T2 _ x1660 = let I1 x1661 = shape a38 in T2 (constant ()) x1661
                       T2 _ x1662 = let I1 x1663 = shape a36 in T2 (constant ()) x1663
                       T2 _ x1664 = let I1 x1665 = shape a39 in T2 (constant ()) x1665
                   in I1 (min x1664 (min x1662 x1660)))
                  (\(I1 x1666) ->
                     let x1667 =
                           cond
                             (x1666 < (let T2 _ x1668 = let I1 x1669 = shape a39 in T2 (constant ()) x1669 in x1668))
                             (cond
                                ((<) x1666
                                     (let T2 _ x1684 =
                                            let T2 _ x1685 = let I1 x1686 = indexFull (I1 (let T2 _ x1687 = let I1 x1688 = shape a12 in T2 (constant ()) x1688 in x1687)) Z_ in T2 (constant ()) x1686
                                                T2 _ x1689 = let I1 x1690 = shape a39 in T2 (constant ()) x1690
                                                T2 _ x1691 =
                                                  let T2 _ x1692 = let I1 x1693 = indexFull (I1 (let T2 _ x1694 = let I1 x1695 = shape a12 in T2 (constant ()) x1695 in x1694)) Z_ in T2 (constant ()) x1693
                                                      T2 _ x1696 = let I1 x1697 = shape a39 in T2 (constant ()) x1697
                                                  in T2 (constant ()) (min x1696 x1692)
                                            in T2 (constant ()) (min x1691 (min x1689 x1685))
                                      in x1684))
                                (let T2 (T2 x1698 _) _ =
                                       let x1699 =
                                             cond
                                               ((<) x1666
                                                    (let T2 _ x1707 =
                                                           let T2 _ x1708 = let I1 x1709 = indexFull (I1 (let T2 _ x1710 = let I1 x1711 = shape a12 in T2 (constant ()) x1711 in x1710)) Z_ in T2 (constant ()) x1709
                                                               T2 _ x1712 = let I1 x1713 = shape a39 in T2 (constant ()) x1713
                                                           in T2 (constant ()) (min x1712 x1708)
                                                     in x1707))
                                               (cond (x1666 < (let T2 _ x1714 = let I1 x1715 = shape a104 in T2 (constant ()) x1715 in x1714)) (a104 ! I1 x1666) (0.0 :: Exp Float))
                                               (0.0 :: Exp Float)
                                           T2 (T2 (T2 (T2 _ x1716) x1717) _) _ =
                                             let T2 _ (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 _ x1718) x1719) x1720) x1721) x1722) x1723) x1724) x1725) x1726) =
                                                   let x1727 = a39 ! I1 x1666
                                                       x1728 = a40 ! Z_
                                                       x1729 = x1727 * x1728
                                                   in T2 x1729 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (constant ()) x1727) x1728) x1727) x1728) x1729) x1727) x1728) x1727) x1728)
                                             in T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (constant ()) x1718) x1719) x1720) x1721) x1722) x1723) x1724) x1725) x1726
                                       in T2 (T2 (x1717 * x1699) (x1716 * x1699)) (constant ())
                                 in x1698)
                                (0.0 :: Exp Float))
                             (0.0 :: Exp Float)
                     in T2 (T2 x1667 x1667) (constant ()))
              a107 = map (\(T2 (T2 x1730 _) _) -> x1730) a106
              a108 = map (\(T2 (T2 _ x1731) _) -> x1731) a106
              a109 =
                generate
                  (shape a17)
                  (\(I2 x1732 x1733) ->
                     cond
                       (let T2 x1734 x1735 =
                              let T2 (T2 _ x1736) x1737 =
                                    let T2 (T2 _ x1738) x1739 = let I2 x1740 x1741 = shape a17 in T2 (T2 (constant ()) x1740) x1741
                                        T2 (T2 _ x1742) x1743 = let I2 x1744 x1745 = shape a17 in T2 (T2 (constant ()) x1744) x1745
                                    in T2 (T2 (constant ()) (min x1742 x1738)) (min x1743 x1739)
                              in T2 x1736 x1737
                        in x1732 < x1734 && x1733 < x1735)
                       (let T2 x1746 _ =
                              let x1747 = cond (let T2 x1748 x1749 = let T2 (T2 _ x1750) x1751 = let I2 x1752 x1753 = indexFull (I2 (constant All) (let T2 _ x1754 = let I2 x1755 x1756 = shape a17 in T2 (T2 (constant ()) x1755) x1756 in x1754)) (shape a36) in T2 (T2 (constant ()) x1752) x1753 in T2 x1750 x1751 in x1732 < x1748 && x1733 < x1749) (let T2 _ x1757 = let I1 x1758 = indexSlice (I2 (constant All) (let T2 _ x1759 = let I2 x1760 x1761 = shape a17 in T2 (T2 (constant ()) x1760) x1761 in x1759)) (I2 x1732 x1733) in T2 (constant ()) x1758 in cond (x1757 < (let T2 _ x1762 = let I1 x1763 = shape a36 in T2 (constant ()) x1763 in x1762)) (cond (x1757 < (let T2 _ x1764 = let I1 x1765 = shape a107 in T2 (constant ()) x1765 in x1764)) (a107 ! I1 x1757) (0.0 :: Exp Float)) (0.0 :: Exp Float)) (0.0 :: Exp Float)
                                  T2 (T2 (T2 (T2 _ x1766) x1767) _) _ =
                                    let x1768 = a17 ! I2 x1732 x1733
                                        T2 _ (T2 (T2 (T2 (T2 (T2 (T2 _ x1769) x1770) x1771) x1772) x1773) x1774) = let x1775 = x1768 * x1768 in T2 x1775 (T2 (T2 (T2 (T2 (T2 (T2 (constant ()) x1768) x1775) x1768) x1768) x1768) x1768)
                                    in T2 (T2 (T2 (T2 (T2 (T2 (constant ()) x1769) x1770) x1771) x1772) x1773) x1774
                              in T2 (x1766 * x1747 + x1767 * x1747) (constant ())
                        in x1746)
                       (0.0 :: Exp Float))
              a110 =
                permute
                  (\x1776 x1777 -> x1776 + x1777)
                  (generate (shape a14) (\(I2 _ _) -> 0.0 :: Exp Float))
                  (\(I2 x1778 x1779) -> Just_ (I2 x1778 (x1779 + (let T2 _ x1780 = let I2 x1781 x1782 = shape a8 in T2 (T2 (constant ()) x1781) x1782 in x1780))))
                  (generate
                     (shape a37)
                     (\(I2 x1783 x1784) ->
                        cond
                          (let T2 x1785 x1786 =
                                 let T2 (T2 _ x1787) x1788 =
                                       let T2 (T2 _ x1789) x1790 = let I2 x1791 x1792 = shape a37 in T2 (T2 (constant ()) x1791) x1792
                                           T2 (T2 _ x1793) x1794 = let I2 x1795 x1796 = shape a37 in T2 (T2 (constant ()) x1795) x1796
                                       in T2 (T2 (constant ()) (min x1793 x1789)) (min x1794 x1790)
                                 in T2 x1787 x1788
                           in x1783 < x1785 && x1784 < x1786)
                          (let T2 x1797 _ =
                                 let x1798 = cond (let T2 x1799 x1800 = let T2 (T2 _ x1801) x1802 = let I2 x1803 x1804 = indexFull (I2 (constant All) (let T2 _ x1805 = let I2 x1806 x1807 = shape a37 in T2 (T2 (constant ()) x1806) x1807 in x1805)) (shape a38) in T2 (T2 (constant ()) x1803) x1804 in T2 x1801 x1802 in x1783 < x1799 && x1784 < x1800) (let T2 _ x1808 = let I1 x1809 = indexSlice (I2 (constant All) (let T2 _ x1810 = let I2 x1811 x1812 = shape a37 in T2 (T2 (constant ()) x1811) x1812 in x1810)) (I2 x1783 x1784) in T2 (constant ()) x1809 in cond (x1808 < (let T2 _ x1813 = let I1 x1814 = shape a38 in T2 (constant ()) x1814 in x1813)) (cond (x1808 < (let T2 _ x1815 = let I1 x1816 = shape a108 in T2 (constant ()) x1816 in x1815)) (a108 ! I1 x1808) (0.0 :: Exp Float)) (0.0 :: Exp Float)) (0.0 :: Exp Float)
                                     T2 (T2 (T2 (T2 _ x1817) x1818) _) _ =
                                       let x1819 = a37 ! I2 x1783 x1784
                                           T2 _ (T2 (T2 (T2 (T2 (T2 (T2 _ x1820) x1821) x1822) x1823) x1824) x1825) = let x1826 = x1819 * x1819 in T2 x1826 (T2 (T2 (T2 (T2 (T2 (T2 (constant ()) x1819) x1826) x1819) x1819) x1819) x1819)
                                       in T2 (T2 (T2 (T2 (T2 (T2 (constant ()) x1820) x1821) x1822) x1823) x1824) x1825
                                 in T2 (x1817 * x1798 + x1818 * x1798) (constant ())
                           in x1797)
                          (0.0 :: Exp Float)))
              a111 = generate (shape a14) (\(I2 x1827 x1828) -> cond (let T2 x1829 x1830 = let T2 (T2 _ x1831) x1832 = let I2 x1833 x1834 = shape a110 in T2 (T2 (constant ()) x1833) x1834 in T2 x1831 x1832 in x1827 < x1829 && x1828 < x1830) (a110 ! I2 x1827 x1828) (0.0 :: Exp Float))
              a112 =
                generate
                  (shape a16)
                  (\(I1 x1835) ->
                     cond
                       (x1835 < (let T2 _ x1836 = let I1 x1837 = shape a16 in T2 (constant ()) x1837 in x1836))
                       (cond
                          ((<) x1835
                               (let T2 _ x1852 =
                                      let T2 _ x1853 = let I1 x1854 = indexFull (I1 (let T2 _ x1855 = let I1 x1856 = shape a12 in T2 (constant ()) x1856 in x1855)) Z_ in T2 (constant ()) x1854
                                          T2 _ x1857 = let I1 x1858 = shape a16 in T2 (constant ()) x1858
                                          T2 _ x1859 =
                                            let T2 _ x1860 = let I1 x1861 = indexFull (I1 (let T2 _ x1862 = let I1 x1863 = shape a12 in T2 (constant ()) x1863 in x1862)) Z_ in T2 (constant ()) x1861
                                                T2 _ x1864 = let I1 x1865 = shape a16 in T2 (constant ()) x1865
                                            in T2 (constant ()) (min x1864 x1860)
                                      in T2 (constant ()) (min x1859 (min x1857 x1853))
                                in x1852))
                          (let T2 (T2 x1866 _) _ =
                                 let x1867 =
                                       cond
                                         ((<) x1835
                                              (let T2 _ x1875 =
                                                     let T2 _ x1876 = let I1 x1877 = indexFull (I1 (let T2 _ x1878 = let I1 x1879 = shape a12 in T2 (constant ()) x1879 in x1878)) Z_ in T2 (constant ()) x1877
                                                         T2 _ x1880 = let I1 x1881 = shape a16 in T2 (constant ()) x1881
                                                     in T2 (constant ()) (min x1880 x1876)
                                               in x1875))
                                         (cond (x1835 < (let T2 _ x1882 = let I1 x1883 = shape a105 in T2 (constant ()) x1883 in x1882)) (a105 ! I1 x1835) (0.0 :: Exp Float))
                                         (0.0 :: Exp Float)
                                     T2 (T2 (T2 (T2 _ x1884) x1885) _) _ =
                                       let T2 _ (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 _ x1886) x1887) x1888) x1889) x1890) x1891) x1892) x1893) x1894) =
                                             let x1895 = a16 ! I1 x1835
                                                 x1896 = a41 ! Z_
                                                 x1897 = x1895 * x1896
                                             in T2 x1897 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (constant ()) x1895) x1896) x1895) x1896) x1897) x1895) x1896) x1895) x1896)
                                       in T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (constant ()) x1886) x1887) x1888) x1889) x1890) x1891) x1892) x1893) x1894
                                 in T2 (T2 (x1885 * x1867) (x1884 * x1867)) (constant ())
                           in x1866)
                          (0.0 :: Exp Float))
                       (0.0 :: Exp Float))
              a113 =
                generate
                  (shape a15)
                  (\(I2 x1898 x1899) ->
                     cond
                       (let T2 x1900 x1901 =
                              let T2 (T2 _ x1902) x1903 =
                                    let T2 (T2 _ x1904) x1905 = let I2 x1906 x1907 = shape a15 in T2 (T2 (constant ()) x1906) x1907
                                        T2 (T2 _ x1908) x1909 = let I2 x1910 x1911 = shape a17 in T2 (T2 (constant ()) x1910) x1911
                                    in T2 (T2 (constant ()) (min x1908 x1904)) (min x1909 x1905)
                              in T2 x1902 x1903
                        in x1898 < x1900 && x1899 < x1901)
                       (let T2 x1912 _ =
                              let T2 (T2 _ x1913) _ =
                                    let x1914 = a15 ! I2 x1898 x1899
                                        T2 _ (T2 (T2 (T2 _ x1915) x1916) x1917) = let x1918 = exp x1914 in T2 x1918 (T2 (T2 (T2 (constant ()) x1914) x1918) x1914)
                                    in T2 (T2 (T2 (constant ()) x1915) x1916) x1917
                              in T2 ((*) (cond
                                            (let T2 x1947 x1948 =
                                                   let T2 (T2 _ x1949) x1950 =
                                                         let T2 x1951 x1952 = let T2 (T2 _ x1953) x1954 = let I2 x1955 x1956 = shape a109 in T2 (T2 (constant ()) x1955) x1956 in T2 x1953 x1954
                                                             T2 x1957 x1958 = let T2 (T2 _ x1959) x1960 = let I2 x1961 x1962 = shape a79 in T2 (T2 (constant ()) x1961) x1962 in T2 x1959 x1960
                                                         in T2 (T2 (constant ()) (max x1951 x1957)) (max x1952 x1958)
                                                   in T2 x1949 x1950
                                             in x1898 < x1947 && x1899 < x1948)
                                            (cond ((0 :: Exp Int) == (let T2 (T2 _ x1963) _ = let I2 x1964 x1965 = shape a109 in T2 (T2 (constant ()) x1964) x1965 in x1963) && (0 :: Exp Int) == (let T2 _ x1966 = let I2 x1967 x1968 = shape a109 in T2 (T2 (constant ()) x1967) x1968 in x1966)) (a79 ! I2 x1898 x1899) (cond ((0 :: Exp Int) == (let T2 (T2 _ x1969) _ = let I2 x1970 x1971 = shape a79 in T2 (T2 (constant ()) x1970) x1971 in x1969) && (0 :: Exp Int) == (let T2 _ x1972 = let I2 x1973 x1974 = shape a79 in T2 (T2 (constant ()) x1973) x1974 in x1972)) (a109 ! I2 x1898 x1899) (a109 ! I2 x1898 x1899 + a79 ! I2 x1898 x1899)))
                                            (0.0 :: Exp Float))
                                         x1913)
                                    (constant ())
                        in x1912)
                       (0.0 :: Exp Float))
              a114 = generate (shape a15) (\(I2 x1975 x1976) -> cond (let T2 x1977 x1978 = let T2 (T2 _ x1979) x1980 = let I2 x1981 x1982 = indexFull (I2 (constant All) (let T2 _ x1983 = let I2 x1984 x1985 = shape a15 in T2 (T2 (constant ()) x1984) x1985 in x1983)) (shape a16) in T2 (T2 (constant ()) x1981) x1982 in T2 x1979 x1980 in x1975 < x1977 && x1976 < x1978) (let T2 _ x1986 = let I1 x1987 = indexSlice (I2 (constant All) (let T2 _ x1988 = let I2 x1989 x1990 = shape a15 in T2 (T2 (constant ()) x1989) x1990 in x1988)) (I2 x1975 x1976) in T2 (constant ()) x1987 in cond (x1986 < max (let T2 _ x1991 = let I1 x1992 = shape a112 in T2 (constant ()) x1992 in x1991) (let T2 _ x1993 = let I1 x1994 = shape a71 in T2 (constant ()) x1994 in x1993)) (cond ((0 :: Exp Int) == (let T2 _ x1995 = let I1 x1996 = shape a112 in T2 (constant ()) x1996 in x1995)) (a71 ! I1 x1986) (cond ((0 :: Exp Int) == (let T2 _ x1997 = let I1 x1998 = shape a71 in T2 (constant ()) x1998 in x1997)) (a112 ! I1 x1986) (a112 ! I1 x1986 + a71 ! I1 x1986))) (0.0 :: Exp Float)) (0.0 :: Exp Float))
              a115 =
                permute
                  (\x1999 x2000 -> x1999 + x2000)
                  (generate (shape a14) (\(I2 _ _) -> 0.0 :: Exp Float))
                  (\(I2 x2001 x2002) -> Just_ (I2 x2001 x2002))
                  (generate
                     (shape a15)
                     (\(I2 x2003 x2004) ->
                        cond
                          (let T2 x2005 x2006 =
                                 let T2 (T2 _ x2007) x2008 =
                                       let T2 x2009 x2010 = let T2 (T2 _ x2011) x2012 = let I2 x2013 x2014 = shape a114 in T2 (T2 (constant ()) x2013) x2014 in T2 x2011 x2012
                                           T2 x2015 x2016 = let T2 (T2 _ x2017) x2018 = let I2 x2019 x2020 = shape a113 in T2 (T2 (constant ()) x2019) x2020 in T2 x2017 x2018
                                       in T2 (T2 (constant ()) (max x2009 x2015)) (max x2010 x2016)
                                 in T2 x2007 x2008
                           in x2003 < x2005 && x2004 < x2006)
                          (cond ((0 :: Exp Int) == (let T2 (T2 _ x2021) _ = let I2 x2022 x2023 = shape a114 in T2 (T2 (constant ()) x2022) x2023 in x2021) && (0 :: Exp Int) == (let T2 _ x2024 = let I2 x2025 x2026 = shape a114 in T2 (T2 (constant ()) x2025) x2026 in x2024)) (a113 ! I2 x2003 x2004) (cond ((0 :: Exp Int) == (let T2 (T2 _ x2027) _ = let I2 x2028 x2029 = shape a113 in T2 (T2 (constant ()) x2028) x2029 in x2027) && (0 :: Exp Int) == (let T2 _ x2030 = let I2 x2031 x2032 = shape a113 in T2 (T2 (constant ()) x2031) x2032 in x2030)) (a114 ! I2 x2003 x2004) (a114 ! I2 x2003 x2004 + a113 ! I2 x2003 x2004)))
                          (0.0 :: Exp Float)))
              a116 = generate (shape a14) (\(I2 x2033 x2034) -> cond (let T2 x2035 x2036 = let T2 (T2 _ x2037) x2038 = let I2 x2039 x2040 = shape a115 in T2 (T2 (constant ()) x2039) x2040 in T2 x2037 x2038 in x2033 < x2035 && x2034 < x2036) (a115 ! I2 x2033 x2034) (0.0 :: Exp Float))
              a117 = generate (I1 (max (let T2 _ x2041 = let I1 x2042 = shape a97 in T2 (constant ()) x2042 in x2041) (let T2 _ x2043 = let I1 x2044 = shape a70 in T2 (constant ()) x2044 in x2043))) (\(I1 x2045) -> cond ((0 :: Exp Int) == (let T2 _ x2046 = let I1 x2047 = shape a97 in T2 (constant ()) x2047 in x2046)) (a70 ! I1 x2045) (cond ((0 :: Exp Int) == (let T2 _ x2048 = let I1 x2049 = shape a70 in T2 (constant ()) x2049 in x2048)) (a97 ! I1 x2045) (a97 ! I1 x2045 + a70 ! I1 x2045)))
              a118 = generate (shape a12) (\(I1 x2050) -> cond (x2050 < max (let T2 _ x2051 = let I1 x2052 = shape a102 in T2 (constant ()) x2052 in x2051) (let T2 _ x2053 = let I1 x2054 = shape a117 in T2 (constant ()) x2054 in x2053)) (cond ((0 :: Exp Int) == (let T2 _ x2055 = let I1 x2056 = shape a102 in T2 (constant ()) x2056 in x2055)) (a117 ! I1 x2050) (cond ((0 :: Exp Int) == (let T2 _ x2057 = let I1 x2058 = shape a117 in T2 (constant ()) x2058 in x2057)) (a102 ! I1 x2050) (a102 ! I1 x2050 + a117 ! I1 x2050))) (0.0 :: Exp Float))
              a119 = generate (shape a12) (\(I1 _) -> 0.0 :: Exp Float)
              a120 = generate (shape a13) (\(I2 _ _) -> 0.0 :: Exp Float)
              a121 = generate (shape a12) (\(I1 x2059) -> cond (x2059 < (let T2 _ x2060 = let I1 x2061 = shape a12 in T2 (constant ()) x2061 in x2060)) (cond (x2059 < (let T2 _ x2062 = let I1 x2063 = shape a12 in T2 (constant ()) x2063 in x2062)) (cond (x2059 < max (let T2 _ x2064 = let I1 x2065 = shape a118 in T2 (constant ()) x2065 in x2064) (let T2 _ x2066 = let I1 x2067 = shape a119 in T2 (constant ()) x2067 in x2066)) (cond ((0 :: Exp Int) == (let T2 _ x2068 = let I1 x2069 = shape a118 in T2 (constant ()) x2069 in x2068)) (a119 ! I1 x2059) (cond ((0 :: Exp Int) == (let T2 _ x2070 = let I1 x2071 = shape a119 in T2 (constant ()) x2071 in x2070)) (a118 ! I1 x2059) (a118 ! I1 x2059 + a119 ! I1 x2059))) (0.0 :: Exp Float)) (0.0 :: Exp Float)) (0.0 :: Exp Float))
              a122 =
                generate
                  (shape a13)
                  (\(I2 x2072 x2073) ->
                     cond
                       (let T2 x2074 x2075 = let T2 (T2 _ x2076) x2077 = let I2 x2078 x2079 = shape a13 in T2 (T2 (constant ()) x2078) x2079 in T2 x2076 x2077 in x2072 < x2074 && x2073 < x2075)
                       (cond
                          (let T2 x2080 x2081 =
                                 let T2 (T2 _ x2082) x2083 =
                                       let T2 x2084 x2085 = let T2 (T2 _ x2086) x2087 = let I2 x2088 x2089 = shape a120 in T2 (T2 (constant ()) x2088) x2089 in T2 x2086 x2087
                                           T2 x2090 x2091 = let T2 (T2 _ x2092) x2093 = let I2 x2094 x2095 = shape a90 in T2 (T2 (constant ()) x2094) x2095 in T2 x2092 x2093
                                       in T2 (T2 (constant ()) (max x2084 x2090)) (max x2085 x2091)
                                 in T2 x2082 x2083
                           in x2072 < x2080 && x2073 < x2081)
                          (cond ((0 :: Exp Int) == (let T2 (T2 _ x2096) _ = let I2 x2097 x2098 = shape a120 in T2 (T2 (constant ()) x2097) x2098 in x2096) && (0 :: Exp Int) == (let T2 _ x2099 = let I2 x2100 x2101 = shape a120 in T2 (T2 (constant ()) x2100) x2101 in x2099)) (a90 ! I2 x2072 x2073) (cond ((0 :: Exp Int) == (let T2 (T2 _ x2102) _ = let I2 x2103 x2104 = shape a90 in T2 (T2 (constant ()) x2103) x2104 in x2102) && (0 :: Exp Int) == (let T2 _ x2105 = let I2 x2106 x2107 = shape a90 in T2 (T2 (constant ()) x2106) x2107 in x2105)) (a120 ! I2 x2072 x2073) (a120 ! I2 x2072 x2073 + a90 ! I2 x2072 x2073)))
                          (0.0 :: Exp Float))
                       (0.0 :: Exp Float))
              a123 =
                generate
                  (let T2 x2108 x2109 = let T2 (T2 _ x2110) x2111 = let I2 x2112 x2113 = shape a111 in T2 (T2 (constant ()) x2112) x2113 in T2 x2110 x2111
                       T2 x2114 x2115 = let T2 (T2 _ x2116) x2117 = let I2 x2118 x2119 = shape a86 in T2 (T2 (constant ()) x2118) x2119 in T2 x2116 x2117
                   in I2 (max x2108 x2114) (max x2109 x2115))
                  (\(I2 x2120 x2121) -> cond ((0 :: Exp Int) == (let T2 (T2 _ x2122) _ = let I2 x2123 x2124 = shape a111 in T2 (T2 (constant ()) x2123) x2124 in x2122) && (0 :: Exp Int) == (let T2 _ x2125 = let I2 x2126 x2127 = shape a111 in T2 (T2 (constant ()) x2126) x2127 in x2125)) (a86 ! I2 x2120 x2121) (cond ((0 :: Exp Int) == (let T2 (T2 _ x2128) _ = let I2 x2129 x2130 = shape a86 in T2 (T2 (constant ()) x2129) x2130 in x2128) && (0 :: Exp Int) == (let T2 _ x2131 = let I2 x2132 x2133 = shape a86 in T2 (T2 (constant ()) x2132) x2133 in x2131)) (a111 ! I2 x2120 x2121) (a111 ! I2 x2120 x2121 + a86 ! I2 x2120 x2121)))
              a124 =
                generate
                  (shape a14)
                  (\(I2 x2134 x2135) ->
                     cond
                       (let T2 x2136 x2137 =
                              let T2 (T2 _ x2138) x2139 =
                                    let T2 x2140 x2141 = let T2 (T2 _ x2142) x2143 = let I2 x2144 x2145 = shape a116 in T2 (T2 (constant ()) x2144) x2145 in T2 x2142 x2143
                                        T2 x2146 x2147 = let T2 (T2 _ x2148) x2149 = let I2 x2150 x2151 = shape a123 in T2 (T2 (constant ()) x2150) x2151 in T2 x2148 x2149
                                    in T2 (T2 (constant ()) (max x2140 x2146)) (max x2141 x2147)
                              in T2 x2138 x2139
                        in x2134 < x2136 && x2135 < x2137)
                       (cond ((0 :: Exp Int) == (let T2 (T2 _ x2152) _ = let I2 x2153 x2154 = shape a116 in T2 (T2 (constant ()) x2153) x2154 in x2152) && (0 :: Exp Int) == (let T2 _ x2155 = let I2 x2156 x2157 = shape a116 in T2 (T2 (constant ()) x2156) x2157 in x2155)) (a123 ! I2 x2134 x2135) (cond ((0 :: Exp Int) == (let T2 (T2 _ x2158) _ = let I2 x2159 x2160 = shape a123 in T2 (T2 (constant ()) x2159) x2160 in x2158) && (0 :: Exp Int) == (let T2 _ x2161 = let I2 x2162 x2163 = shape a123 in T2 (T2 (constant ()) x2162) x2163 in x2161)) (a116 ! I2 x2134 x2135) (a116 ! I2 x2134 x2135 + a123 ! I2 x2134 x2135)))
                       (0.0 :: Exp Float))
              a125 = generate (shape a12) (\(I1 _) -> 0.0 :: Exp Float)
              a126 = generate (shape a12) (\(I1 _) -> 0.0 :: Exp Float)
              a127 = generate (I1 (max (let T2 _ x2164 = let I1 x2165 = shape a126 in T2 (constant ()) x2165 in x2164) (let T2 _ x2166 = let I1 x2167 = shape a121 in T2 (constant ()) x2167 in x2166))) (\(I1 x2168) -> cond ((0 :: Exp Int) == (let T2 _ x2169 = let I1 x2170 = shape a126 in T2 (constant ()) x2170 in x2169)) (a121 ! I1 x2168) (cond ((0 :: Exp Int) == (let T2 _ x2171 = let I1 x2172 = shape a121 in T2 (constant ()) x2172 in x2171)) (a126 ! I1 x2168) (a126 ! I1 x2168 + a121 ! I1 x2168)))
              a128 = generate (shape a13) (\(I2 _ _) -> 0.0 :: Exp Float)
              a129 = generate (shape a13) (\(I2 _ _) -> 0.0 :: Exp Float)
              a130 =
                generate
                  (let T2 x2173 x2174 = let T2 (T2 _ x2175) x2176 = let I2 x2177 x2178 = shape a122 in T2 (T2 (constant ()) x2177) x2178 in T2 x2175 x2176
                       T2 x2179 x2180 = let T2 (T2 _ x2181) x2182 = let I2 x2183 x2184 = shape a129 in T2 (T2 (constant ()) x2183) x2184 in T2 x2181 x2182
                   in I2 (max x2173 x2179) (max x2174 x2180))
                  (\(I2 x2185 x2186) -> cond ((0 :: Exp Int) == (let T2 (T2 _ x2187) _ = let I2 x2188 x2189 = shape a122 in T2 (T2 (constant ()) x2188) x2189 in x2187) && (0 :: Exp Int) == (let T2 _ x2190 = let I2 x2191 x2192 = shape a122 in T2 (T2 (constant ()) x2191) x2192 in x2190)) (a129 ! I2 x2185 x2186) (cond ((0 :: Exp Int) == (let T2 (T2 _ x2193) _ = let I2 x2194 x2195 = shape a129 in T2 (T2 (constant ()) x2194) x2195 in x2193) && (0 :: Exp Int) == (let T2 _ x2196 = let I2 x2197 x2198 = shape a129 in T2 (T2 (constant ()) x2197) x2198 in x2196)) (a122 ! I2 x2185 x2186) (a122 ! I2 x2185 x2186 + a129 ! I2 x2185 x2186)))
              a131 = generate (shape a14) (\(I2 _ _) -> 0.0 :: Exp Float)
              a132 = generate (shape a14) (\(I2 _ _) -> 0.0 :: Exp Float)
              a133 =
                generate
                  (let T2 x2199 x2200 = let T2 (T2 _ x2201) x2202 = let I2 x2203 x2204 = shape a131 in T2 (T2 (constant ()) x2203) x2204 in T2 x2201 x2202
                       T2 x2205 x2206 = let T2 (T2 _ x2207) x2208 = let I2 x2209 x2210 = shape a132 in T2 (T2 (constant ()) x2209) x2210 in T2 x2207 x2208
                   in I2 (max x2199 x2205) (max x2200 x2206))
                  (\(I2 x2211 x2212) -> cond ((0 :: Exp Int) == (let T2 (T2 _ x2213) _ = let I2 x2214 x2215 = shape a131 in T2 (T2 (constant ()) x2214) x2215 in x2213) && (0 :: Exp Int) == (let T2 _ x2216 = let I2 x2217 x2218 = shape a131 in T2 (T2 (constant ()) x2217) x2218 in x2216)) (a132 ! I2 x2211 x2212) (cond ((0 :: Exp Int) == (let T2 (T2 _ x2219) _ = let I2 x2220 x2221 = shape a132 in T2 (T2 (constant ()) x2220) x2221 in x2219) && (0 :: Exp Int) == (let T2 _ x2222 = let I2 x2223 x2224 = shape a132 in T2 (T2 (constant ()) x2223) x2224 in x2222)) (a131 ! I2 x2211 x2212) (a131 ! I2 x2211 x2212 + a132 ! I2 x2211 x2212)))
              a134 = generate (shape a12) (\(I1 x2225) -> cond (x2225 < (let T2 _ x2226 = let I1 x2227 = shape a12 in T2 (constant ()) x2227 in x2226)) (cond (x2225 < (let T2 _ x2228 = let I1 x2229 = shape a12 in T2 (constant ()) x2229 in x2228)) (cond (x2225 < (let T2 _ x2230 = let I1 x2231 = shape a12 in T2 (constant ()) x2231 in x2230)) (cond (x2225 < max (let T2 _ x2232 = let I1 x2233 = shape a125 in T2 (constant ()) x2233 in x2232) (let T2 _ x2234 = let I1 x2235 = shape a127 in T2 (constant ()) x2235 in x2234)) (cond ((0 :: Exp Int) == (let T2 _ x2236 = let I1 x2237 = shape a125 in T2 (constant ()) x2237 in x2236)) (a127 ! I1 x2225) (cond ((0 :: Exp Int) == (let T2 _ x2238 = let I1 x2239 = shape a127 in T2 (constant ()) x2239 in x2238)) (a125 ! I1 x2225) (a125 ! I1 x2225 + a127 ! I1 x2225))) (0.0 :: Exp Float)) (0.0 :: Exp Float)) (0.0 :: Exp Float)) (0.0 :: Exp Float))
              a135 =
                generate
                  (shape a13)
                  (\(I2 x2240 x2241) ->
                     cond
                       (let T2 x2242 x2243 = let T2 (T2 _ x2244) x2245 = let I2 x2246 x2247 = shape a13 in T2 (T2 (constant ()) x2246) x2247 in T2 x2244 x2245 in x2240 < x2242 && x2241 < x2243)
                       (cond
                          (let T2 x2248 x2249 = let T2 (T2 _ x2250) x2251 = let I2 x2252 x2253 = shape a13 in T2 (T2 (constant ()) x2252) x2253 in T2 x2250 x2251 in x2240 < x2248 && x2241 < x2249)
                          (cond
                             (let T2 x2254 x2255 =
                                    let T2 (T2 _ x2256) x2257 =
                                          let T2 x2258 x2259 = let T2 (T2 _ x2260) x2261 = let I2 x2262 x2263 = shape a128 in T2 (T2 (constant ()) x2262) x2263 in T2 x2260 x2261
                                              T2 x2264 x2265 = let T2 (T2 _ x2266) x2267 = let I2 x2268 x2269 = shape a130 in T2 (T2 (constant ()) x2268) x2269 in T2 x2266 x2267
                                          in T2 (T2 (constant ()) (max x2258 x2264)) (max x2259 x2265)
                                    in T2 x2256 x2257
                              in x2240 < x2254 && x2241 < x2255)
                             (cond ((0 :: Exp Int) == (let T2 (T2 _ x2270) _ = let I2 x2271 x2272 = shape a128 in T2 (T2 (constant ()) x2271) x2272 in x2270) && (0 :: Exp Int) == (let T2 _ x2273 = let I2 x2274 x2275 = shape a128 in T2 (T2 (constant ()) x2274) x2275 in x2273)) (a130 ! I2 x2240 x2241) (cond ((0 :: Exp Int) == (let T2 (T2 _ x2276) _ = let I2 x2277 x2278 = shape a130 in T2 (T2 (constant ()) x2277) x2278 in x2276) && (0 :: Exp Int) == (let T2 _ x2279 = let I2 x2280 x2281 = shape a130 in T2 (T2 (constant ()) x2280) x2281 in x2279)) (a128 ! I2 x2240 x2241) (a128 ! I2 x2240 x2241 + a130 ! I2 x2240 x2241)))
                             (0.0 :: Exp Float))
                          (0.0 :: Exp Float))
                       (0.0 :: Exp Float))
              a136 =
                generate
                  (shape a14)
                  (\(I2 x2282 x2283) ->
                     cond
                       (let T2 x2284 x2285 = let T2 (T2 _ x2286) x2287 = let I2 x2288 x2289 = shape a14 in T2 (T2 (constant ()) x2288) x2289 in T2 x2286 x2287 in x2282 < x2284 && x2283 < x2285)
                       (cond
                          (let T2 x2290 x2291 =
                                 let T2 (T2 _ x2292) x2293 =
                                       let T2 x2294 x2295 = let T2 (T2 _ x2296) x2297 = let I2 x2298 x2299 = shape a124 in T2 (T2 (constant ()) x2298) x2299 in T2 x2296 x2297
                                           T2 x2300 x2301 = let T2 (T2 _ x2302) x2303 = let I2 x2304 x2305 = shape a133 in T2 (T2 (constant ()) x2304) x2305 in T2 x2302 x2303
                                       in T2 (T2 (constant ()) (max x2294 x2300)) (max x2295 x2301)
                                 in T2 x2292 x2293
                           in x2282 < x2290 && x2283 < x2291)
                          (cond ((0 :: Exp Int) == (let T2 (T2 _ x2306) _ = let I2 x2307 x2308 = shape a124 in T2 (T2 (constant ()) x2307) x2308 in x2306) && (0 :: Exp Int) == (let T2 _ x2309 = let I2 x2310 x2311 = shape a124 in T2 (T2 (constant ()) x2310) x2311 in x2309)) (a133 ! I2 x2282 x2283) (cond ((0 :: Exp Int) == (let T2 (T2 _ x2312) _ = let I2 x2313 x2314 = shape a133 in T2 (T2 (constant ()) x2313) x2314 in x2312) && (0 :: Exp Int) == (let T2 _ x2315 = let I2 x2316 x2317 = shape a133 in T2 (T2 (constant ()) x2316) x2317 in x2315)) (a124 ! I2 x2282 x2283) (a124 ! I2 x2282 x2283 + a133 ! I2 x2282 x2283)))
                          (0.0 :: Exp Float))
                       (0.0 :: Exp Float))
              a137 = generate (shape a12) (\(I1 _) -> 0.0 :: Exp Float)
              a138 = generate (shape a12) (\(I1 _) -> 0.0 :: Exp Float)
              a139 = generate (shape a12) (\(I1 _) -> 0.0 :: Exp Float)
              a140 = generate (I1 (max (let T2 _ x2318 = let I1 x2319 = shape a134 in T2 (constant ()) x2319 in x2318) (let T2 _ x2320 = let I1 x2321 = shape a139 in T2 (constant ()) x2321 in x2320))) (\(I1 x2322) -> cond ((0 :: Exp Int) == (let T2 _ x2323 = let I1 x2324 = shape a134 in T2 (constant ()) x2324 in x2323)) (a139 ! I1 x2322) (cond ((0 :: Exp Int) == (let T2 _ x2325 = let I1 x2326 = shape a139 in T2 (constant ()) x2326 in x2325)) (a134 ! I1 x2322) (a134 ! I1 x2322 + a139 ! I1 x2322)))
              a141 = generate (I1 (max (let T2 _ x2327 = let I1 x2328 = shape a138 in T2 (constant ()) x2328 in x2327) (let T2 _ x2329 = let I1 x2330 = shape a140 in T2 (constant ()) x2330 in x2329))) (\(I1 x2331) -> cond ((0 :: Exp Int) == (let T2 _ x2332 = let I1 x2333 = shape a138 in T2 (constant ()) x2333 in x2332)) (a140 ! I1 x2331) (cond ((0 :: Exp Int) == (let T2 _ x2334 = let I1 x2335 = shape a140 in T2 (constant ()) x2335 in x2334)) (a138 ! I1 x2331) (a138 ! I1 x2331 + a140 ! I1 x2331)))
              a142 = generate (shape a13) (\(I2 _ _) -> 0.0 :: Exp Float)
              a143 = generate (shape a13) (\(I2 _ _) -> 0.0 :: Exp Float)
              a144 = generate (shape a13) (\(I2 _ _) -> 0.0 :: Exp Float)
              a145 =
                generate
                  (let T2 x2336 x2337 = let T2 (T2 _ x2338) x2339 = let I2 x2340 x2341 = shape a143 in T2 (T2 (constant ()) x2340) x2341 in T2 x2338 x2339
                       T2 x2342 x2343 = let T2 (T2 _ x2344) x2345 = let I2 x2346 x2347 = shape a144 in T2 (T2 (constant ()) x2346) x2347 in T2 x2344 x2345
                   in I2 (max x2336 x2342) (max x2337 x2343))
                  (\(I2 x2348 x2349) -> cond ((0 :: Exp Int) == (let T2 (T2 _ x2350) _ = let I2 x2351 x2352 = shape a143 in T2 (T2 (constant ()) x2351) x2352 in x2350) && (0 :: Exp Int) == (let T2 _ x2353 = let I2 x2354 x2355 = shape a143 in T2 (T2 (constant ()) x2354) x2355 in x2353)) (a144 ! I2 x2348 x2349) (cond ((0 :: Exp Int) == (let T2 (T2 _ x2356) _ = let I2 x2357 x2358 = shape a144 in T2 (T2 (constant ()) x2357) x2358 in x2356) && (0 :: Exp Int) == (let T2 _ x2359 = let I2 x2360 x2361 = shape a144 in T2 (T2 (constant ()) x2360) x2361 in x2359)) (a143 ! I2 x2348 x2349) (a143 ! I2 x2348 x2349 + a144 ! I2 x2348 x2349)))
              a146 =
                generate
                  (let T2 x2362 x2363 = let T2 (T2 _ x2364) x2365 = let I2 x2366 x2367 = shape a135 in T2 (T2 (constant ()) x2366) x2367 in T2 x2364 x2365
                       T2 x2368 x2369 = let T2 (T2 _ x2370) x2371 = let I2 x2372 x2373 = shape a145 in T2 (T2 (constant ()) x2372) x2373 in T2 x2370 x2371
                   in I2 (max x2362 x2368) (max x2363 x2369))
                  (\(I2 x2374 x2375) -> cond ((0 :: Exp Int) == (let T2 (T2 _ x2376) _ = let I2 x2377 x2378 = shape a135 in T2 (T2 (constant ()) x2377) x2378 in x2376) && (0 :: Exp Int) == (let T2 _ x2379 = let I2 x2380 x2381 = shape a135 in T2 (T2 (constant ()) x2380) x2381 in x2379)) (a145 ! I2 x2374 x2375) (cond ((0 :: Exp Int) == (let T2 (T2 _ x2382) _ = let I2 x2383 x2384 = shape a145 in T2 (T2 (constant ()) x2383) x2384 in x2382) && (0 :: Exp Int) == (let T2 _ x2385 = let I2 x2386 x2387 = shape a145 in T2 (T2 (constant ()) x2386) x2387 in x2385)) (a135 ! I2 x2374 x2375) (a135 ! I2 x2374 x2375 + a145 ! I2 x2374 x2375)))
              a147 = generate (shape a14) (\(I2 _ _) -> 0.0 :: Exp Float)
              a148 = generate (shape a14) (\(I2 _ _) -> 0.0 :: Exp Float)
              a149 = generate (shape a14) (\(I2 _ _) -> 0.0 :: Exp Float)
              a150 =
                generate
                  (let T2 x2388 x2389 = let T2 (T2 _ x2390) x2391 = let I2 x2392 x2393 = shape a148 in T2 (T2 (constant ()) x2392) x2393 in T2 x2390 x2391
                       T2 x2394 x2395 = let T2 (T2 _ x2396) x2397 = let I2 x2398 x2399 = shape a149 in T2 (T2 (constant ()) x2398) x2399 in T2 x2396 x2397
                   in I2 (max x2388 x2394) (max x2389 x2395))
                  (\(I2 x2400 x2401) -> cond ((0 :: Exp Int) == (let T2 (T2 _ x2402) _ = let I2 x2403 x2404 = shape a148 in T2 (T2 (constant ()) x2403) x2404 in x2402) && (0 :: Exp Int) == (let T2 _ x2405 = let I2 x2406 x2407 = shape a148 in T2 (T2 (constant ()) x2406) x2407 in x2405)) (a149 ! I2 x2400 x2401) (cond ((0 :: Exp Int) == (let T2 (T2 _ x2408) _ = let I2 x2409 x2410 = shape a149 in T2 (T2 (constant ()) x2409) x2410 in x2408) && (0 :: Exp Int) == (let T2 _ x2411 = let I2 x2412 x2413 = shape a149 in T2 (T2 (constant ()) x2412) x2413 in x2411)) (a148 ! I2 x2400 x2401) (a148 ! I2 x2400 x2401 + a149 ! I2 x2400 x2401)))
              a151 =
                generate
                  (let T2 x2414 x2415 = let T2 (T2 _ x2416) x2417 = let I2 x2418 x2419 = shape a147 in T2 (T2 (constant ()) x2418) x2419 in T2 x2416 x2417
                       T2 x2420 x2421 = let T2 (T2 _ x2422) x2423 = let I2 x2424 x2425 = shape a150 in T2 (T2 (constant ()) x2424) x2425 in T2 x2422 x2423
                   in I2 (max x2414 x2420) (max x2415 x2421))
                  (\(I2 x2426 x2427) -> cond ((0 :: Exp Int) == (let T2 (T2 _ x2428) _ = let I2 x2429 x2430 = shape a147 in T2 (T2 (constant ()) x2429) x2430 in x2428) && (0 :: Exp Int) == (let T2 _ x2431 = let I2 x2432 x2433 = shape a147 in T2 (T2 (constant ()) x2432) x2433 in x2431)) (a150 ! I2 x2426 x2427) (cond ((0 :: Exp Int) == (let T2 (T2 _ x2434) _ = let I2 x2435 x2436 = shape a150 in T2 (T2 (constant ()) x2435) x2436 in x2434) && (0 :: Exp Int) == (let T2 _ x2437 = let I2 x2438 x2439 = shape a150 in T2 (T2 (constant ()) x2438) x2439 in x2437)) (a147 ! I2 x2426 x2427) (a147 ! I2 x2426 x2427 + a150 ! I2 x2426 x2427)))
              a152 = generate (shape a12) (\(I1 x2440) -> cond (x2440 < (let T2 _ x2441 = let I1 x2442 = shape a12 in T2 (constant ()) x2442 in x2441)) (cond (x2440 < (let T2 _ x2443 = let I1 x2444 = shape a12 in T2 (constant ()) x2444 in x2443)) (cond (x2440 < (let T2 _ x2445 = let I1 x2446 = shape a12 in T2 (constant ()) x2446 in x2445)) (cond (x2440 < (let T2 _ x2447 = let I1 x2448 = shape a12 in T2 (constant ()) x2448 in x2447)) (cond (x2440 < max (let T2 _ x2449 = let I1 x2450 = shape a137 in T2 (constant ()) x2450 in x2449) (let T2 _ x2451 = let I1 x2452 = shape a141 in T2 (constant ()) x2452 in x2451)) (cond ((0 :: Exp Int) == (let T2 _ x2453 = let I1 x2454 = shape a137 in T2 (constant ()) x2454 in x2453)) (a141 ! I1 x2440) (cond ((0 :: Exp Int) == (let T2 _ x2455 = let I1 x2456 = shape a141 in T2 (constant ()) x2456 in x2455)) (a137 ! I1 x2440) (a137 ! I1 x2440 + a141 ! I1 x2440))) (0.0 :: Exp Float)) (0.0 :: Exp Float)) (0.0 :: Exp Float)) (0.0 :: Exp Float)) (0.0 :: Exp Float))
              a153 =
                generate
                  (shape a13)
                  (\(I2 x2457 x2458) ->
                     cond
                       (let T2 x2459 x2460 = let T2 (T2 _ x2461) x2462 = let I2 x2463 x2464 = shape a13 in T2 (T2 (constant ()) x2463) x2464 in T2 x2461 x2462 in x2457 < x2459 && x2458 < x2460)
                       (cond
                          (let T2 x2465 x2466 = let T2 (T2 _ x2467) x2468 = let I2 x2469 x2470 = shape a13 in T2 (T2 (constant ()) x2469) x2470 in T2 x2467 x2468 in x2457 < x2465 && x2458 < x2466)
                          (cond
                             (let T2 x2471 x2472 = let T2 (T2 _ x2473) x2474 = let I2 x2475 x2476 = shape a13 in T2 (T2 (constant ()) x2475) x2476 in T2 x2473 x2474 in x2457 < x2471 && x2458 < x2472)
                             (cond
                                (let T2 x2477 x2478 =
                                       let T2 (T2 _ x2479) x2480 =
                                             let T2 x2481 x2482 = let T2 (T2 _ x2483) x2484 = let I2 x2485 x2486 = shape a142 in T2 (T2 (constant ()) x2485) x2486 in T2 x2483 x2484
                                                 T2 x2487 x2488 = let T2 (T2 _ x2489) x2490 = let I2 x2491 x2492 = shape a146 in T2 (T2 (constant ()) x2491) x2492 in T2 x2489 x2490
                                             in T2 (T2 (constant ()) (max x2481 x2487)) (max x2482 x2488)
                                       in T2 x2479 x2480
                                 in x2457 < x2477 && x2458 < x2478)
                                (cond ((0 :: Exp Int) == (let T2 (T2 _ x2493) _ = let I2 x2494 x2495 = shape a142 in T2 (T2 (constant ()) x2494) x2495 in x2493) && (0 :: Exp Int) == (let T2 _ x2496 = let I2 x2497 x2498 = shape a142 in T2 (T2 (constant ()) x2497) x2498 in x2496)) (a146 ! I2 x2457 x2458) (cond ((0 :: Exp Int) == (let T2 (T2 _ x2499) _ = let I2 x2500 x2501 = shape a146 in T2 (T2 (constant ()) x2500) x2501 in x2499) && (0 :: Exp Int) == (let T2 _ x2502 = let I2 x2503 x2504 = shape a146 in T2 (T2 (constant ()) x2503) x2504 in x2502)) (a142 ! I2 x2457 x2458) (a142 ! I2 x2457 x2458 + a146 ! I2 x2457 x2458)))
                                (0.0 :: Exp Float))
                             (0.0 :: Exp Float))
                          (0.0 :: Exp Float))
                       (0.0 :: Exp Float))
              a154 =
                generate
                  (shape a14)
                  (\(I2 x2505 x2506) ->
                     cond
                       (let T2 x2507 x2508 = let T2 (T2 _ x2509) x2510 = let I2 x2511 x2512 = shape a14 in T2 (T2 (constant ()) x2511) x2512 in T2 x2509 x2510 in x2505 < x2507 && x2506 < x2508)
                       (cond
                          (let T2 x2513 x2514 = let T2 (T2 _ x2515) x2516 = let I2 x2517 x2518 = shape a14 in T2 (T2 (constant ()) x2517) x2518 in T2 x2515 x2516 in x2505 < x2513 && x2506 < x2514)
                          (cond
                             (let T2 x2519 x2520 =
                                    let T2 (T2 _ x2521) x2522 =
                                          let T2 x2523 x2524 = let T2 (T2 _ x2525) x2526 = let I2 x2527 x2528 = shape a136 in T2 (T2 (constant ()) x2527) x2528 in T2 x2525 x2526
                                              T2 x2529 x2530 = let T2 (T2 _ x2531) x2532 = let I2 x2533 x2534 = shape a151 in T2 (T2 (constant ()) x2533) x2534 in T2 x2531 x2532
                                          in T2 (T2 (constant ()) (max x2523 x2529)) (max x2524 x2530)
                                    in T2 x2521 x2522
                              in x2505 < x2519 && x2506 < x2520)
                             (cond ((0 :: Exp Int) == (let T2 (T2 _ x2535) _ = let I2 x2536 x2537 = shape a136 in T2 (T2 (constant ()) x2536) x2537 in x2535) && (0 :: Exp Int) == (let T2 _ x2538 = let I2 x2539 x2540 = shape a136 in T2 (T2 (constant ()) x2539) x2540 in x2538)) (a151 ! I2 x2505 x2506) (cond ((0 :: Exp Int) == (let T2 (T2 _ x2541) _ = let I2 x2542 x2543 = shape a151 in T2 (T2 (constant ()) x2542) x2543 in x2541) && (0 :: Exp Int) == (let T2 _ x2544 = let I2 x2545 x2546 = shape a151 in T2 (T2 (constant ()) x2545) x2546 in x2544)) (a136 ! I2 x2505 x2506) (a136 ! I2 x2505 x2506 + a151 ! I2 x2505 x2506)))
                             (0.0 :: Exp Float))
                          (0.0 :: Exp Float))
                       (0.0 :: Exp Float))
              a155 = generate (shape a12) (\(I1 _) -> 0.0 :: Exp Float)
              a156 = generate (shape a12) (\(I1 _) -> 0.0 :: Exp Float)
              a157 = generate (shape a12) (\(I1 _) -> 0.0 :: Exp Float)
              a158 = generate (shape a12) (\(I1 _) -> 0.0 :: Exp Float)
              a159 = generate (I1 (max (let T2 _ x2547 = let I1 x2548 = shape a152 in T2 (constant ()) x2548 in x2547) (let T2 _ x2549 = let I1 x2550 = shape a158 in T2 (constant ()) x2550 in x2549))) (\(I1 x2551) -> cond ((0 :: Exp Int) == (let T2 _ x2552 = let I1 x2553 = shape a152 in T2 (constant ()) x2553 in x2552)) (a158 ! I1 x2551) (cond ((0 :: Exp Int) == (let T2 _ x2554 = let I1 x2555 = shape a158 in T2 (constant ()) x2555 in x2554)) (a152 ! I1 x2551) (a152 ! I1 x2551 + a158 ! I1 x2551)))
              a160 = generate (I1 (max (let T2 _ x2556 = let I1 x2557 = shape a157 in T2 (constant ()) x2557 in x2556) (let T2 _ x2558 = let I1 x2559 = shape a159 in T2 (constant ()) x2559 in x2558))) (\(I1 x2560) -> cond ((0 :: Exp Int) == (let T2 _ x2561 = let I1 x2562 = shape a157 in T2 (constant ()) x2562 in x2561)) (a159 ! I1 x2560) (cond ((0 :: Exp Int) == (let T2 _ x2563 = let I1 x2564 = shape a159 in T2 (constant ()) x2564 in x2563)) (a157 ! I1 x2560) (a157 ! I1 x2560 + a159 ! I1 x2560)))
              a161 = generate (I1 (max (let T2 _ x2565 = let I1 x2566 = shape a156 in T2 (constant ()) x2566 in x2565) (let T2 _ x2567 = let I1 x2568 = shape a160 in T2 (constant ()) x2568 in x2567))) (\(I1 x2569) -> cond ((0 :: Exp Int) == (let T2 _ x2570 = let I1 x2571 = shape a156 in T2 (constant ()) x2571 in x2570)) (a160 ! I1 x2569) (cond ((0 :: Exp Int) == (let T2 _ x2572 = let I1 x2573 = shape a160 in T2 (constant ()) x2573 in x2572)) (a156 ! I1 x2569) (a156 ! I1 x2569 + a160 ! I1 x2569)))
              a162 = generate (shape a13) (\(I2 _ _) -> 0.0 :: Exp Float)
              a163 = generate (shape a13) (\(I2 _ _) -> 0.0 :: Exp Float)
              a164 = generate (shape a13) (\(I2 _ _) -> 0.0 :: Exp Float)
              a165 = generate (shape a13) (\(I2 _ _) -> 0.0 :: Exp Float)
              a166 =
                generate
                  (let T2 x2574 x2575 = let T2 (T2 _ x2576) x2577 = let I2 x2578 x2579 = shape a164 in T2 (T2 (constant ()) x2578) x2579 in T2 x2576 x2577
                       T2 x2580 x2581 = let T2 (T2 _ x2582) x2583 = let I2 x2584 x2585 = shape a165 in T2 (T2 (constant ()) x2584) x2585 in T2 x2582 x2583
                   in I2 (max x2574 x2580) (max x2575 x2581))
                  (\(I2 x2586 x2587) -> cond ((0 :: Exp Int) == (let T2 (T2 _ x2588) _ = let I2 x2589 x2590 = shape a164 in T2 (T2 (constant ()) x2589) x2590 in x2588) && (0 :: Exp Int) == (let T2 _ x2591 = let I2 x2592 x2593 = shape a164 in T2 (T2 (constant ()) x2592) x2593 in x2591)) (a165 ! I2 x2586 x2587) (cond ((0 :: Exp Int) == (let T2 (T2 _ x2594) _ = let I2 x2595 x2596 = shape a165 in T2 (T2 (constant ()) x2595) x2596 in x2594) && (0 :: Exp Int) == (let T2 _ x2597 = let I2 x2598 x2599 = shape a165 in T2 (T2 (constant ()) x2598) x2599 in x2597)) (a164 ! I2 x2586 x2587) (a164 ! I2 x2586 x2587 + a165 ! I2 x2586 x2587)))
              a167 =
                generate
                  (let T2 x2600 x2601 = let T2 (T2 _ x2602) x2603 = let I2 x2604 x2605 = shape a153 in T2 (T2 (constant ()) x2604) x2605 in T2 x2602 x2603
                       T2 x2606 x2607 = let T2 (T2 _ x2608) x2609 = let I2 x2610 x2611 = shape a166 in T2 (T2 (constant ()) x2610) x2611 in T2 x2608 x2609
                   in I2 (max x2600 x2606) (max x2601 x2607))
                  (\(I2 x2612 x2613) -> cond ((0 :: Exp Int) == (let T2 (T2 _ x2614) _ = let I2 x2615 x2616 = shape a153 in T2 (T2 (constant ()) x2615) x2616 in x2614) && (0 :: Exp Int) == (let T2 _ x2617 = let I2 x2618 x2619 = shape a153 in T2 (T2 (constant ()) x2618) x2619 in x2617)) (a166 ! I2 x2612 x2613) (cond ((0 :: Exp Int) == (let T2 (T2 _ x2620) _ = let I2 x2621 x2622 = shape a166 in T2 (T2 (constant ()) x2621) x2622 in x2620) && (0 :: Exp Int) == (let T2 _ x2623 = let I2 x2624 x2625 = shape a166 in T2 (T2 (constant ()) x2624) x2625 in x2623)) (a153 ! I2 x2612 x2613) (a153 ! I2 x2612 x2613 + a166 ! I2 x2612 x2613)))
              a168 =
                generate
                  (let T2 x2626 x2627 = let T2 (T2 _ x2628) x2629 = let I2 x2630 x2631 = shape a163 in T2 (T2 (constant ()) x2630) x2631 in T2 x2628 x2629
                       T2 x2632 x2633 = let T2 (T2 _ x2634) x2635 = let I2 x2636 x2637 = shape a167 in T2 (T2 (constant ()) x2636) x2637 in T2 x2634 x2635
                   in I2 (max x2626 x2632) (max x2627 x2633))
                  (\(I2 x2638 x2639) -> cond ((0 :: Exp Int) == (let T2 (T2 _ x2640) _ = let I2 x2641 x2642 = shape a163 in T2 (T2 (constant ()) x2641) x2642 in x2640) && (0 :: Exp Int) == (let T2 _ x2643 = let I2 x2644 x2645 = shape a163 in T2 (T2 (constant ()) x2644) x2645 in x2643)) (a167 ! I2 x2638 x2639) (cond ((0 :: Exp Int) == (let T2 (T2 _ x2646) _ = let I2 x2647 x2648 = shape a167 in T2 (T2 (constant ()) x2647) x2648 in x2646) && (0 :: Exp Int) == (let T2 _ x2649 = let I2 x2650 x2651 = shape a167 in T2 (T2 (constant ()) x2650) x2651 in x2649)) (a163 ! I2 x2638 x2639) (a163 ! I2 x2638 x2639 + a167 ! I2 x2638 x2639)))
              a169 = generate (shape a14) (\(I2 _ _) -> 0.0 :: Exp Float)
              a170 = generate (shape a14) (\(I2 _ _) -> 0.0 :: Exp Float)
              a171 = generate (shape a14) (\(I2 _ _) -> 0.0 :: Exp Float)
              a172 = generate (shape a14) (\(I2 _ _) -> 0.0 :: Exp Float)
              a173 =
                generate
                  (let T2 x2652 x2653 = let T2 (T2 _ x2654) x2655 = let I2 x2656 x2657 = shape a171 in T2 (T2 (constant ()) x2656) x2657 in T2 x2654 x2655
                       T2 x2658 x2659 = let T2 (T2 _ x2660) x2661 = let I2 x2662 x2663 = shape a172 in T2 (T2 (constant ()) x2662) x2663 in T2 x2660 x2661
                   in I2 (max x2652 x2658) (max x2653 x2659))
                  (\(I2 x2664 x2665) -> cond ((0 :: Exp Int) == (let T2 (T2 _ x2666) _ = let I2 x2667 x2668 = shape a171 in T2 (T2 (constant ()) x2667) x2668 in x2666) && (0 :: Exp Int) == (let T2 _ x2669 = let I2 x2670 x2671 = shape a171 in T2 (T2 (constant ()) x2670) x2671 in x2669)) (a172 ! I2 x2664 x2665) (cond ((0 :: Exp Int) == (let T2 (T2 _ x2672) _ = let I2 x2673 x2674 = shape a172 in T2 (T2 (constant ()) x2673) x2674 in x2672) && (0 :: Exp Int) == (let T2 _ x2675 = let I2 x2676 x2677 = shape a172 in T2 (T2 (constant ()) x2676) x2677 in x2675)) (a171 ! I2 x2664 x2665) (a171 ! I2 x2664 x2665 + a172 ! I2 x2664 x2665)))
              a174 =
                generate
                  (let T2 x2678 x2679 = let T2 (T2 _ x2680) x2681 = let I2 x2682 x2683 = shape a170 in T2 (T2 (constant ()) x2682) x2683 in T2 x2680 x2681
                       T2 x2684 x2685 = let T2 (T2 _ x2686) x2687 = let I2 x2688 x2689 = shape a173 in T2 (T2 (constant ()) x2688) x2689 in T2 x2686 x2687
                   in I2 (max x2678 x2684) (max x2679 x2685))
                  (\(I2 x2690 x2691) -> cond ((0 :: Exp Int) == (let T2 (T2 _ x2692) _ = let I2 x2693 x2694 = shape a170 in T2 (T2 (constant ()) x2693) x2694 in x2692) && (0 :: Exp Int) == (let T2 _ x2695 = let I2 x2696 x2697 = shape a170 in T2 (T2 (constant ()) x2696) x2697 in x2695)) (a173 ! I2 x2690 x2691) (cond ((0 :: Exp Int) == (let T2 (T2 _ x2698) _ = let I2 x2699 x2700 = shape a173 in T2 (T2 (constant ()) x2699) x2700 in x2698) && (0 :: Exp Int) == (let T2 _ x2701 = let I2 x2702 x2703 = shape a173 in T2 (T2 (constant ()) x2702) x2703 in x2701)) (a170 ! I2 x2690 x2691) (a170 ! I2 x2690 x2691 + a173 ! I2 x2690 x2691)))
              a175 =
                generate
                  (let T2 x2704 x2705 = let T2 (T2 _ x2706) x2707 = let I2 x2708 x2709 = shape a154 in T2 (T2 (constant ()) x2708) x2709 in T2 x2706 x2707
                       T2 x2710 x2711 = let T2 (T2 _ x2712) x2713 = let I2 x2714 x2715 = shape a174 in T2 (T2 (constant ()) x2714) x2715 in T2 x2712 x2713
                   in I2 (max x2704 x2710) (max x2705 x2711))
                  (\(I2 x2716 x2717) -> cond ((0 :: Exp Int) == (let T2 (T2 _ x2718) _ = let I2 x2719 x2720 = shape a154 in T2 (T2 (constant ()) x2719) x2720 in x2718) && (0 :: Exp Int) == (let T2 _ x2721 = let I2 x2722 x2723 = shape a154 in T2 (T2 (constant ()) x2722) x2723 in x2721)) (a174 ! I2 x2716 x2717) (cond ((0 :: Exp Int) == (let T2 (T2 _ x2724) _ = let I2 x2725 x2726 = shape a174 in T2 (T2 (constant ()) x2725) x2726 in x2724) && (0 :: Exp Int) == (let T2 _ x2727 = let I2 x2728 x2729 = shape a174 in T2 (T2 (constant ()) x2728) x2729 in x2727)) (a154 ! I2 x2716 x2717) (a154 ! I2 x2716 x2717 + a174 ! I2 x2716 x2717)))
              a176 = generate (shape a12) (\(I1 x2730) -> cond (x2730 < (let T2 _ x2731 = let I1 x2732 = shape a12 in T2 (constant ()) x2732 in x2731)) (cond (x2730 < (let T2 _ x2733 = let I1 x2734 = shape a12 in T2 (constant ()) x2734 in x2733)) (cond (x2730 < (let T2 _ x2735 = let I1 x2736 = shape a12 in T2 (constant ()) x2736 in x2735)) (cond (x2730 < (let T2 _ x2737 = let I1 x2738 = shape a12 in T2 (constant ()) x2738 in x2737)) (cond (x2730 < (let T2 _ x2739 = let I1 x2740 = shape a12 in T2 (constant ()) x2740 in x2739)) (cond (x2730 < max (let T2 _ x2741 = let I1 x2742 = shape a155 in T2 (constant ()) x2742 in x2741) (let T2 _ x2743 = let I1 x2744 = shape a161 in T2 (constant ()) x2744 in x2743)) (cond ((0 :: Exp Int) == (let T2 _ x2745 = let I1 x2746 = shape a155 in T2 (constant ()) x2746 in x2745)) (a161 ! I1 x2730) (cond ((0 :: Exp Int) == (let T2 _ x2747 = let I1 x2748 = shape a161 in T2 (constant ()) x2748 in x2747)) (a155 ! I1 x2730) (a155 ! I1 x2730 + a161 ! I1 x2730))) (0.0 :: Exp Float)) (0.0 :: Exp Float)) (0.0 :: Exp Float)) (0.0 :: Exp Float)) (0.0 :: Exp Float)) (0.0 :: Exp Float))
              a177 =
                generate
                  (shape a13)
                  (\(I2 x2749 x2750) ->
                     cond
                       (let T2 x2751 x2752 = let T2 (T2 _ x2753) x2754 = let I2 x2755 x2756 = shape a13 in T2 (T2 (constant ()) x2755) x2756 in T2 x2753 x2754 in x2749 < x2751 && x2750 < x2752)
                       (cond
                          (let T2 x2757 x2758 = let T2 (T2 _ x2759) x2760 = let I2 x2761 x2762 = shape a13 in T2 (T2 (constant ()) x2761) x2762 in T2 x2759 x2760 in x2749 < x2757 && x2750 < x2758)
                          (cond
                             (let T2 x2763 x2764 = let T2 (T2 _ x2765) x2766 = let I2 x2767 x2768 = shape a13 in T2 (T2 (constant ()) x2767) x2768 in T2 x2765 x2766 in x2749 < x2763 && x2750 < x2764)
                             (cond
                                (let T2 x2769 x2770 = let T2 (T2 _ x2771) x2772 = let I2 x2773 x2774 = shape a13 in T2 (T2 (constant ()) x2773) x2774 in T2 x2771 x2772 in x2749 < x2769 && x2750 < x2770)
                                (cond
                                   (let T2 x2775 x2776 =
                                          let T2 (T2 _ x2777) x2778 =
                                                let T2 x2779 x2780 = let T2 (T2 _ x2781) x2782 = let I2 x2783 x2784 = shape a162 in T2 (T2 (constant ()) x2783) x2784 in T2 x2781 x2782
                                                    T2 x2785 x2786 = let T2 (T2 _ x2787) x2788 = let I2 x2789 x2790 = shape a168 in T2 (T2 (constant ()) x2789) x2790 in T2 x2787 x2788
                                                in T2 (T2 (constant ()) (max x2779 x2785)) (max x2780 x2786)
                                          in T2 x2777 x2778
                                    in x2749 < x2775 && x2750 < x2776)
                                   (cond ((0 :: Exp Int) == (let T2 (T2 _ x2791) _ = let I2 x2792 x2793 = shape a162 in T2 (T2 (constant ()) x2792) x2793 in x2791) && (0 :: Exp Int) == (let T2 _ x2794 = let I2 x2795 x2796 = shape a162 in T2 (T2 (constant ()) x2795) x2796 in x2794)) (a168 ! I2 x2749 x2750) (cond ((0 :: Exp Int) == (let T2 (T2 _ x2797) _ = let I2 x2798 x2799 = shape a168 in T2 (T2 (constant ()) x2798) x2799 in x2797) && (0 :: Exp Int) == (let T2 _ x2800 = let I2 x2801 x2802 = shape a168 in T2 (T2 (constant ()) x2801) x2802 in x2800)) (a162 ! I2 x2749 x2750) (a162 ! I2 x2749 x2750 + a168 ! I2 x2749 x2750)))
                                   (0.0 :: Exp Float))
                                (0.0 :: Exp Float))
                             (0.0 :: Exp Float))
                          (0.0 :: Exp Float))
                       (0.0 :: Exp Float))
              a178 =
                generate
                  (shape a14)
                  (\(I2 x2803 x2804) ->
                     cond
                       (let T2 x2805 x2806 = let T2 (T2 _ x2807) x2808 = let I2 x2809 x2810 = shape a14 in T2 (T2 (constant ()) x2809) x2810 in T2 x2807 x2808 in x2803 < x2805 && x2804 < x2806)
                       (cond
                          (let T2 x2811 x2812 = let T2 (T2 _ x2813) x2814 = let I2 x2815 x2816 = shape a14 in T2 (T2 (constant ()) x2815) x2816 in T2 x2813 x2814 in x2803 < x2811 && x2804 < x2812)
                          (cond
                             (let T2 x2817 x2818 = let T2 (T2 _ x2819) x2820 = let I2 x2821 x2822 = shape a14 in T2 (T2 (constant ()) x2821) x2822 in T2 x2819 x2820 in x2803 < x2817 && x2804 < x2818)
                             (cond
                                (let T2 x2823 x2824 =
                                       let T2 (T2 _ x2825) x2826 =
                                             let T2 x2827 x2828 = let T2 (T2 _ x2829) x2830 = let I2 x2831 x2832 = shape a169 in T2 (T2 (constant ()) x2831) x2832 in T2 x2829 x2830
                                                 T2 x2833 x2834 = let T2 (T2 _ x2835) x2836 = let I2 x2837 x2838 = shape a175 in T2 (T2 (constant ()) x2837) x2838 in T2 x2835 x2836
                                             in T2 (T2 (constant ()) (max x2827 x2833)) (max x2828 x2834)
                                       in T2 x2825 x2826
                                 in x2803 < x2823 && x2804 < x2824)
                                (cond ((0 :: Exp Int) == (let T2 (T2 _ x2839) _ = let I2 x2840 x2841 = shape a169 in T2 (T2 (constant ()) x2840) x2841 in x2839) && (0 :: Exp Int) == (let T2 _ x2842 = let I2 x2843 x2844 = shape a169 in T2 (T2 (constant ()) x2843) x2844 in x2842)) (a175 ! I2 x2803 x2804) (cond ((0 :: Exp Int) == (let T2 (T2 _ x2845) _ = let I2 x2846 x2847 = shape a175 in T2 (T2 (constant ()) x2846) x2847 in x2845) && (0 :: Exp Int) == (let T2 _ x2848 = let I2 x2849 x2850 = shape a175 in T2 (T2 (constant ()) x2849) x2850 in x2848)) (a169 ! I2 x2803 x2804) (a169 ! I2 x2803 x2804 + a175 ! I2 x2803 x2804)))
                                (0.0 :: Exp Float))
                             (0.0 :: Exp Float))
                          (0.0 :: Exp Float))
                       (0.0 :: Exp Float))
              a179 = generate (shape a12) (\(I1 _) -> 0.0 :: Exp Float)
              a180 = generate (shape a12) (\(I1 _) -> 0.0 :: Exp Float)
              a181 = generate (shape a12) (\(I1 _) -> 0.0 :: Exp Float)
              a182 = generate (shape a12) (\(I1 _) -> 0.0 :: Exp Float)
              a183 = generate (shape a12) (\(I1 _) -> 0.0 :: Exp Float)
              a184 = generate (I1 (max (let T2 _ x2851 = let I1 x2852 = shape a176 in T2 (constant ()) x2852 in x2851) (let T2 _ x2853 = let I1 x2854 = shape a183 in T2 (constant ()) x2854 in x2853))) (\(I1 x2855) -> cond ((0 :: Exp Int) == (let T2 _ x2856 = let I1 x2857 = shape a176 in T2 (constant ()) x2857 in x2856)) (a183 ! I1 x2855) (cond ((0 :: Exp Int) == (let T2 _ x2858 = let I1 x2859 = shape a183 in T2 (constant ()) x2859 in x2858)) (a176 ! I1 x2855) (a176 ! I1 x2855 + a183 ! I1 x2855)))
              a185 = generate (I1 (max (let T2 _ x2860 = let I1 x2861 = shape a182 in T2 (constant ()) x2861 in x2860) (let T2 _ x2862 = let I1 x2863 = shape a184 in T2 (constant ()) x2863 in x2862))) (\(I1 x2864) -> cond ((0 :: Exp Int) == (let T2 _ x2865 = let I1 x2866 = shape a182 in T2 (constant ()) x2866 in x2865)) (a184 ! I1 x2864) (cond ((0 :: Exp Int) == (let T2 _ x2867 = let I1 x2868 = shape a184 in T2 (constant ()) x2868 in x2867)) (a182 ! I1 x2864) (a182 ! I1 x2864 + a184 ! I1 x2864)))
              a186 = generate (I1 (max (let T2 _ x2869 = let I1 x2870 = shape a181 in T2 (constant ()) x2870 in x2869) (let T2 _ x2871 = let I1 x2872 = shape a185 in T2 (constant ()) x2872 in x2871))) (\(I1 x2873) -> cond ((0 :: Exp Int) == (let T2 _ x2874 = let I1 x2875 = shape a181 in T2 (constant ()) x2875 in x2874)) (a185 ! I1 x2873) (cond ((0 :: Exp Int) == (let T2 _ x2876 = let I1 x2877 = shape a185 in T2 (constant ()) x2877 in x2876)) (a181 ! I1 x2873) (a181 ! I1 x2873 + a185 ! I1 x2873)))
              a187 = generate (I1 (max (let T2 _ x2878 = let I1 x2879 = shape a180 in T2 (constant ()) x2879 in x2878) (let T2 _ x2880 = let I1 x2881 = shape a186 in T2 (constant ()) x2881 in x2880))) (\(I1 x2882) -> cond ((0 :: Exp Int) == (let T2 _ x2883 = let I1 x2884 = shape a180 in T2 (constant ()) x2884 in x2883)) (a186 ! I1 x2882) (cond ((0 :: Exp Int) == (let T2 _ x2885 = let I1 x2886 = shape a186 in T2 (constant ()) x2886 in x2885)) (a180 ! I1 x2882) (a180 ! I1 x2882 + a186 ! I1 x2882)))
              a188 = generate (shape a13) (\(I2 _ _) -> 0.0 :: Exp Float)
              a189 = generate (shape a13) (\(I2 _ _) -> 0.0 :: Exp Float)
              a190 = generate (shape a13) (\(I2 _ _) -> 0.0 :: Exp Float)
              a191 = generate (shape a13) (\(I2 _ _) -> 0.0 :: Exp Float)
              a192 = generate (shape a13) (\(I2 _ _) -> 0.0 :: Exp Float)
              a193 =
                generate
                  (let T2 x2887 x2888 = let T2 (T2 _ x2889) x2890 = let I2 x2891 x2892 = shape a191 in T2 (T2 (constant ()) x2891) x2892 in T2 x2889 x2890
                       T2 x2893 x2894 = let T2 (T2 _ x2895) x2896 = let I2 x2897 x2898 = shape a192 in T2 (T2 (constant ()) x2897) x2898 in T2 x2895 x2896
                   in I2 (max x2887 x2893) (max x2888 x2894))
                  (\(I2 x2899 x2900) -> cond ((0 :: Exp Int) == (let T2 (T2 _ x2901) _ = let I2 x2902 x2903 = shape a191 in T2 (T2 (constant ()) x2902) x2903 in x2901) && (0 :: Exp Int) == (let T2 _ x2904 = let I2 x2905 x2906 = shape a191 in T2 (T2 (constant ()) x2905) x2906 in x2904)) (a192 ! I2 x2899 x2900) (cond ((0 :: Exp Int) == (let T2 (T2 _ x2907) _ = let I2 x2908 x2909 = shape a192 in T2 (T2 (constant ()) x2908) x2909 in x2907) && (0 :: Exp Int) == (let T2 _ x2910 = let I2 x2911 x2912 = shape a192 in T2 (T2 (constant ()) x2911) x2912 in x2910)) (a191 ! I2 x2899 x2900) (a191 ! I2 x2899 x2900 + a192 ! I2 x2899 x2900)))
              a194 =
                generate
                  (let T2 x2913 x2914 = let T2 (T2 _ x2915) x2916 = let I2 x2917 x2918 = shape a177 in T2 (T2 (constant ()) x2917) x2918 in T2 x2915 x2916
                       T2 x2919 x2920 = let T2 (T2 _ x2921) x2922 = let I2 x2923 x2924 = shape a193 in T2 (T2 (constant ()) x2923) x2924 in T2 x2921 x2922
                   in I2 (max x2913 x2919) (max x2914 x2920))
                  (\(I2 x2925 x2926) -> cond ((0 :: Exp Int) == (let T2 (T2 _ x2927) _ = let I2 x2928 x2929 = shape a177 in T2 (T2 (constant ()) x2928) x2929 in x2927) && (0 :: Exp Int) == (let T2 _ x2930 = let I2 x2931 x2932 = shape a177 in T2 (T2 (constant ()) x2931) x2932 in x2930)) (a193 ! I2 x2925 x2926) (cond ((0 :: Exp Int) == (let T2 (T2 _ x2933) _ = let I2 x2934 x2935 = shape a193 in T2 (T2 (constant ()) x2934) x2935 in x2933) && (0 :: Exp Int) == (let T2 _ x2936 = let I2 x2937 x2938 = shape a193 in T2 (T2 (constant ()) x2937) x2938 in x2936)) (a177 ! I2 x2925 x2926) (a177 ! I2 x2925 x2926 + a193 ! I2 x2925 x2926)))
              a195 =
                generate
                  (let T2 x2939 x2940 = let T2 (T2 _ x2941) x2942 = let I2 x2943 x2944 = shape a190 in T2 (T2 (constant ()) x2943) x2944 in T2 x2941 x2942
                       T2 x2945 x2946 = let T2 (T2 _ x2947) x2948 = let I2 x2949 x2950 = shape a194 in T2 (T2 (constant ()) x2949) x2950 in T2 x2947 x2948
                   in I2 (max x2939 x2945) (max x2940 x2946))
                  (\(I2 x2951 x2952) -> cond ((0 :: Exp Int) == (let T2 (T2 _ x2953) _ = let I2 x2954 x2955 = shape a190 in T2 (T2 (constant ()) x2954) x2955 in x2953) && (0 :: Exp Int) == (let T2 _ x2956 = let I2 x2957 x2958 = shape a190 in T2 (T2 (constant ()) x2957) x2958 in x2956)) (a194 ! I2 x2951 x2952) (cond ((0 :: Exp Int) == (let T2 (T2 _ x2959) _ = let I2 x2960 x2961 = shape a194 in T2 (T2 (constant ()) x2960) x2961 in x2959) && (0 :: Exp Int) == (let T2 _ x2962 = let I2 x2963 x2964 = shape a194 in T2 (T2 (constant ()) x2963) x2964 in x2962)) (a190 ! I2 x2951 x2952) (a190 ! I2 x2951 x2952 + a194 ! I2 x2951 x2952)))
              a196 =
                generate
                  (let T2 x2965 x2966 = let T2 (T2 _ x2967) x2968 = let I2 x2969 x2970 = shape a189 in T2 (T2 (constant ()) x2969) x2970 in T2 x2967 x2968
                       T2 x2971 x2972 = let T2 (T2 _ x2973) x2974 = let I2 x2975 x2976 = shape a195 in T2 (T2 (constant ()) x2975) x2976 in T2 x2973 x2974
                   in I2 (max x2965 x2971) (max x2966 x2972))
                  (\(I2 x2977 x2978) -> cond ((0 :: Exp Int) == (let T2 (T2 _ x2979) _ = let I2 x2980 x2981 = shape a189 in T2 (T2 (constant ()) x2980) x2981 in x2979) && (0 :: Exp Int) == (let T2 _ x2982 = let I2 x2983 x2984 = shape a189 in T2 (T2 (constant ()) x2983) x2984 in x2982)) (a195 ! I2 x2977 x2978) (cond ((0 :: Exp Int) == (let T2 (T2 _ x2985) _ = let I2 x2986 x2987 = shape a195 in T2 (T2 (constant ()) x2986) x2987 in x2985) && (0 :: Exp Int) == (let T2 _ x2988 = let I2 x2989 x2990 = shape a195 in T2 (T2 (constant ()) x2989) x2990 in x2988)) (a189 ! I2 x2977 x2978) (a189 ! I2 x2977 x2978 + a195 ! I2 x2977 x2978)))
              a197 = generate (shape a14) (\(I2 _ _) -> 0.0 :: Exp Float)
              a198 = generate (shape a14) (\(I2 _ _) -> 0.0 :: Exp Float)
              a199 = generate (shape a14) (\(I2 _ _) -> 0.0 :: Exp Float)
              a200 = generate (shape a14) (\(I2 _ _) -> 0.0 :: Exp Float)
              a201 = generate (shape a14) (\(I2 _ _) -> 0.0 :: Exp Float)
              a202 =
                generate
                  (let T2 x2991 x2992 = let T2 (T2 _ x2993) x2994 = let I2 x2995 x2996 = shape a200 in T2 (T2 (constant ()) x2995) x2996 in T2 x2993 x2994
                       T2 x2997 x2998 = let T2 (T2 _ x2999) x3000 = let I2 x3001 x3002 = shape a201 in T2 (T2 (constant ()) x3001) x3002 in T2 x2999 x3000
                   in I2 (max x2991 x2997) (max x2992 x2998))
                  (\(I2 x3003 x3004) -> cond ((0 :: Exp Int) == (let T2 (T2 _ x3005) _ = let I2 x3006 x3007 = shape a200 in T2 (T2 (constant ()) x3006) x3007 in x3005) && (0 :: Exp Int) == (let T2 _ x3008 = let I2 x3009 x3010 = shape a200 in T2 (T2 (constant ()) x3009) x3010 in x3008)) (a201 ! I2 x3003 x3004) (cond ((0 :: Exp Int) == (let T2 (T2 _ x3011) _ = let I2 x3012 x3013 = shape a201 in T2 (T2 (constant ()) x3012) x3013 in x3011) && (0 :: Exp Int) == (let T2 _ x3014 = let I2 x3015 x3016 = shape a201 in T2 (T2 (constant ()) x3015) x3016 in x3014)) (a200 ! I2 x3003 x3004) (a200 ! I2 x3003 x3004 + a201 ! I2 x3003 x3004)))
              a203 =
                generate
                  (let T2 x3017 x3018 = let T2 (T2 _ x3019) x3020 = let I2 x3021 x3022 = shape a199 in T2 (T2 (constant ()) x3021) x3022 in T2 x3019 x3020
                       T2 x3023 x3024 = let T2 (T2 _ x3025) x3026 = let I2 x3027 x3028 = shape a202 in T2 (T2 (constant ()) x3027) x3028 in T2 x3025 x3026
                   in I2 (max x3017 x3023) (max x3018 x3024))
                  (\(I2 x3029 x3030) -> cond ((0 :: Exp Int) == (let T2 (T2 _ x3031) _ = let I2 x3032 x3033 = shape a199 in T2 (T2 (constant ()) x3032) x3033 in x3031) && (0 :: Exp Int) == (let T2 _ x3034 = let I2 x3035 x3036 = shape a199 in T2 (T2 (constant ()) x3035) x3036 in x3034)) (a202 ! I2 x3029 x3030) (cond ((0 :: Exp Int) == (let T2 (T2 _ x3037) _ = let I2 x3038 x3039 = shape a202 in T2 (T2 (constant ()) x3038) x3039 in x3037) && (0 :: Exp Int) == (let T2 _ x3040 = let I2 x3041 x3042 = shape a202 in T2 (T2 (constant ()) x3041) x3042 in x3040)) (a199 ! I2 x3029 x3030) (a199 ! I2 x3029 x3030 + a202 ! I2 x3029 x3030)))
              a204 =
                generate
                  (let T2 x3043 x3044 = let T2 (T2 _ x3045) x3046 = let I2 x3047 x3048 = shape a178 in T2 (T2 (constant ()) x3047) x3048 in T2 x3045 x3046
                       T2 x3049 x3050 = let T2 (T2 _ x3051) x3052 = let I2 x3053 x3054 = shape a203 in T2 (T2 (constant ()) x3053) x3054 in T2 x3051 x3052
                   in I2 (max x3043 x3049) (max x3044 x3050))
                  (\(I2 x3055 x3056) -> cond ((0 :: Exp Int) == (let T2 (T2 _ x3057) _ = let I2 x3058 x3059 = shape a178 in T2 (T2 (constant ()) x3058) x3059 in x3057) && (0 :: Exp Int) == (let T2 _ x3060 = let I2 x3061 x3062 = shape a178 in T2 (T2 (constant ()) x3061) x3062 in x3060)) (a203 ! I2 x3055 x3056) (cond ((0 :: Exp Int) == (let T2 (T2 _ x3063) _ = let I2 x3064 x3065 = shape a203 in T2 (T2 (constant ()) x3064) x3065 in x3063) && (0 :: Exp Int) == (let T2 _ x3066 = let I2 x3067 x3068 = shape a203 in T2 (T2 (constant ()) x3067) x3068 in x3066)) (a178 ! I2 x3055 x3056) (a178 ! I2 x3055 x3056 + a203 ! I2 x3055 x3056)))
              a205 =
                generate
                  (let T2 x3069 x3070 = let T2 (T2 _ x3071) x3072 = let I2 x3073 x3074 = shape a198 in T2 (T2 (constant ()) x3073) x3074 in T2 x3071 x3072
                       T2 x3075 x3076 = let T2 (T2 _ x3077) x3078 = let I2 x3079 x3080 = shape a204 in T2 (T2 (constant ()) x3079) x3080 in T2 x3077 x3078
                   in I2 (max x3069 x3075) (max x3070 x3076))
                  (\(I2 x3081 x3082) -> cond ((0 :: Exp Int) == (let T2 (T2 _ x3083) _ = let I2 x3084 x3085 = shape a198 in T2 (T2 (constant ()) x3084) x3085 in x3083) && (0 :: Exp Int) == (let T2 _ x3086 = let I2 x3087 x3088 = shape a198 in T2 (T2 (constant ()) x3087) x3088 in x3086)) (a204 ! I2 x3081 x3082) (cond ((0 :: Exp Int) == (let T2 (T2 _ x3089) _ = let I2 x3090 x3091 = shape a204 in T2 (T2 (constant ()) x3090) x3091 in x3089) && (0 :: Exp Int) == (let T2 _ x3092 = let I2 x3093 x3094 = shape a204 in T2 (T2 (constant ()) x3093) x3094 in x3092)) (a198 ! I2 x3081 x3082) (a198 ! I2 x3081 x3082 + a204 ! I2 x3081 x3082)))
              a206 = generate (shape a12) (\(I1 x3095) -> cond (x3095 < (let T2 _ x3096 = let I1 x3097 = shape a12 in T2 (constant ()) x3097 in x3096)) (cond (x3095 < (let T2 _ x3098 = let I1 x3099 = shape a12 in T2 (constant ()) x3099 in x3098)) (cond (x3095 < (let T2 _ x3100 = let I1 x3101 = shape a12 in T2 (constant ()) x3101 in x3100)) (cond (x3095 < (let T2 _ x3102 = let I1 x3103 = shape a12 in T2 (constant ()) x3103 in x3102)) (cond (x3095 < (let T2 _ x3104 = let I1 x3105 = shape a12 in T2 (constant ()) x3105 in x3104)) (cond (x3095 < (let T2 _ x3106 = let I1 x3107 = shape a12 in T2 (constant ()) x3107 in x3106)) (cond (x3095 < max (let T2 _ x3108 = let I1 x3109 = shape a179 in T2 (constant ()) x3109 in x3108) (let T2 _ x3110 = let I1 x3111 = shape a187 in T2 (constant ()) x3111 in x3110)) (cond ((0 :: Exp Int) == (let T2 _ x3112 = let I1 x3113 = shape a179 in T2 (constant ()) x3113 in x3112)) (a187 ! I1 x3095) (cond ((0 :: Exp Int) == (let T2 _ x3114 = let I1 x3115 = shape a187 in T2 (constant ()) x3115 in x3114)) (a179 ! I1 x3095) (a179 ! I1 x3095 + a187 ! I1 x3095))) (0.0 :: Exp Float)) (0.0 :: Exp Float)) (0.0 :: Exp Float)) (0.0 :: Exp Float)) (0.0 :: Exp Float)) (0.0 :: Exp Float)) (0.0 :: Exp Float))
              a207 =
                generate
                  (shape a13)
                  (\(I2 x3116 x3117) ->
                     cond
                       (let T2 x3118 x3119 = let T2 (T2 _ x3120) x3121 = let I2 x3122 x3123 = shape a13 in T2 (T2 (constant ()) x3122) x3123 in T2 x3120 x3121 in x3116 < x3118 && x3117 < x3119)
                       (cond
                          (let T2 x3124 x3125 = let T2 (T2 _ x3126) x3127 = let I2 x3128 x3129 = shape a13 in T2 (T2 (constant ()) x3128) x3129 in T2 x3126 x3127 in x3116 < x3124 && x3117 < x3125)
                          (cond
                             (let T2 x3130 x3131 = let T2 (T2 _ x3132) x3133 = let I2 x3134 x3135 = shape a13 in T2 (T2 (constant ()) x3134) x3135 in T2 x3132 x3133 in x3116 < x3130 && x3117 < x3131)
                             (cond
                                (let T2 x3136 x3137 = let T2 (T2 _ x3138) x3139 = let I2 x3140 x3141 = shape a13 in T2 (T2 (constant ()) x3140) x3141 in T2 x3138 x3139 in x3116 < x3136 && x3117 < x3137)
                                (cond
                                   (let T2 x3142 x3143 = let T2 (T2 _ x3144) x3145 = let I2 x3146 x3147 = shape a13 in T2 (T2 (constant ()) x3146) x3147 in T2 x3144 x3145 in x3116 < x3142 && x3117 < x3143)
                                   (cond
                                      (let T2 x3148 x3149 =
                                             let T2 (T2 _ x3150) x3151 =
                                                   let T2 x3152 x3153 = let T2 (T2 _ x3154) x3155 = let I2 x3156 x3157 = shape a188 in T2 (T2 (constant ()) x3156) x3157 in T2 x3154 x3155
                                                       T2 x3158 x3159 = let T2 (T2 _ x3160) x3161 = let I2 x3162 x3163 = shape a196 in T2 (T2 (constant ()) x3162) x3163 in T2 x3160 x3161
                                                   in T2 (T2 (constant ()) (max x3152 x3158)) (max x3153 x3159)
                                             in T2 x3150 x3151
                                       in x3116 < x3148 && x3117 < x3149)
                                      (cond ((0 :: Exp Int) == (let T2 (T2 _ x3164) _ = let I2 x3165 x3166 = shape a188 in T2 (T2 (constant ()) x3165) x3166 in x3164) && (0 :: Exp Int) == (let T2 _ x3167 = let I2 x3168 x3169 = shape a188 in T2 (T2 (constant ()) x3168) x3169 in x3167)) (a196 ! I2 x3116 x3117) (cond ((0 :: Exp Int) == (let T2 (T2 _ x3170) _ = let I2 x3171 x3172 = shape a196 in T2 (T2 (constant ()) x3171) x3172 in x3170) && (0 :: Exp Int) == (let T2 _ x3173 = let I2 x3174 x3175 = shape a196 in T2 (T2 (constant ()) x3174) x3175 in x3173)) (a188 ! I2 x3116 x3117) (a188 ! I2 x3116 x3117 + a196 ! I2 x3116 x3117)))
                                      (0.0 :: Exp Float))
                                   (0.0 :: Exp Float))
                                (0.0 :: Exp Float))
                             (0.0 :: Exp Float))
                          (0.0 :: Exp Float))
                       (0.0 :: Exp Float))
              a208 = generate (shape a12) (\(I1 _) -> 0.0 :: Exp Float)
              a209 = generate (shape a13) (\(I2 _ _) -> 0.0 :: Exp Float)
              a210 = generate (shape a12) (\(I1 x3176) -> cond (x3176 < (let T2 _ x3177 = let I1 x3178 = shape a12 in T2 (constant ()) x3178 in x3177)) (cond (x3176 < (let T2 _ x3179 = let I1 x3180 = shape a12 in T2 (constant ()) x3180 in x3179)) (cond (x3176 < max (let T2 _ x3181 = let I1 x3182 = shape a208 in T2 (constant ()) x3182 in x3181) (let T2 _ x3183 = let I1 x3184 = shape a206 in T2 (constant ()) x3184 in x3183)) (cond ((0 :: Exp Int) == (let T2 _ x3185 = let I1 x3186 = shape a208 in T2 (constant ()) x3186 in x3185)) (a206 ! I1 x3176) (cond ((0 :: Exp Int) == (let T2 _ x3187 = let I1 x3188 = shape a206 in T2 (constant ()) x3188 in x3187)) (a208 ! I1 x3176) (a208 ! I1 x3176 + a206 ! I1 x3176))) (0.0 :: Exp Float)) (0.0 :: Exp Float)) (0.0 :: Exp Float))
              a211 =
                generate
                  (shape a13)
                  (\(I2 x3189 x3190) ->
                     cond
                       (let T2 x3191 x3192 = let T2 (T2 _ x3193) x3194 = let I2 x3195 x3196 = shape a13 in T2 (T2 (constant ()) x3195) x3196 in T2 x3193 x3194 in x3189 < x3191 && x3190 < x3192)
                       (cond
                          (let T2 x3197 x3198 =
                                 let T2 (T2 _ x3199) x3200 =
                                       let T2 x3201 x3202 = let T2 (T2 _ x3203) x3204 = let I2 x3205 x3206 = shape a207 in T2 (T2 (constant ()) x3205) x3206 in T2 x3203 x3204
                                           T2 x3207 x3208 = let T2 (T2 _ x3209) x3210 = let I2 x3211 x3212 = shape a209 in T2 (T2 (constant ()) x3211) x3212 in T2 x3209 x3210
                                       in T2 (T2 (constant ()) (max x3201 x3207)) (max x3202 x3208)
                                 in T2 x3199 x3200
                           in x3189 < x3197 && x3190 < x3198)
                          (cond ((0 :: Exp Int) == (let T2 (T2 _ x3213) _ = let I2 x3214 x3215 = shape a207 in T2 (T2 (constant ()) x3214) x3215 in x3213) && (0 :: Exp Int) == (let T2 _ x3216 = let I2 x3217 x3218 = shape a207 in T2 (T2 (constant ()) x3217) x3218 in x3216)) (a209 ! I2 x3189 x3190) (cond ((0 :: Exp Int) == (let T2 (T2 _ x3219) _ = let I2 x3220 x3221 = shape a209 in T2 (T2 (constant ()) x3220) x3221 in x3219) && (0 :: Exp Int) == (let T2 _ x3222 = let I2 x3223 x3224 = shape a209 in T2 (T2 (constant ()) x3223) x3224 in x3222)) (a207 ! I2 x3189 x3190) (a207 ! I2 x3189 x3190 + a209 ! I2 x3189 x3190)))
                          (0.0 :: Exp Float))
                       (0.0 :: Exp Float))
              a212 =
                generate
                  (shape a14)
                  (\(I2 x3225 x3226) ->
                     cond
                       (let T2 x3227 x3228 = let T2 (T2 _ x3229) x3230 = let I2 x3231 x3232 = shape a14 in T2 (T2 (constant ()) x3231) x3232 in T2 x3229 x3230 in x3225 < x3227 && x3226 < x3228)
                       (cond
                          (let T2 x3233 x3234 = let T2 (T2 _ x3235) x3236 = let I2 x3237 x3238 = shape a14 in T2 (T2 (constant ()) x3237) x3238 in T2 x3235 x3236 in x3225 < x3233 && x3226 < x3234)
                          (cond
                             (let T2 x3239 x3240 = let T2 (T2 _ x3241) x3242 = let I2 x3243 x3244 = shape a14 in T2 (T2 (constant ()) x3243) x3244 in T2 x3241 x3242 in x3225 < x3239 && x3226 < x3240)
                             (cond
                                (let T2 x3245 x3246 = let T2 (T2 _ x3247) x3248 = let I2 x3249 x3250 = shape a14 in T2 (T2 (constant ()) x3249) x3250 in T2 x3247 x3248 in x3225 < x3245 && x3226 < x3246)
                                (cond
                                   (let T2 x3251 x3252 =
                                          let T2 (T2 _ x3253) x3254 =
                                                let T2 x3255 x3256 = let T2 (T2 _ x3257) x3258 = let I2 x3259 x3260 = shape a197 in T2 (T2 (constant ()) x3259) x3260 in T2 x3257 x3258
                                                    T2 x3261 x3262 = let T2 (T2 _ x3263) x3264 = let I2 x3265 x3266 = shape a205 in T2 (T2 (constant ()) x3265) x3266 in T2 x3263 x3264
                                                in T2 (T2 (constant ()) (max x3255 x3261)) (max x3256 x3262)
                                          in T2 x3253 x3254
                                    in x3225 < x3251 && x3226 < x3252)
                                   (cond ((0 :: Exp Int) == (let T2 (T2 _ x3267) _ = let I2 x3268 x3269 = shape a197 in T2 (T2 (constant ()) x3268) x3269 in x3267) && (0 :: Exp Int) == (let T2 _ x3270 = let I2 x3271 x3272 = shape a197 in T2 (T2 (constant ()) x3271) x3272 in x3270)) (a205 ! I2 x3225 x3226) (cond ((0 :: Exp Int) == (let T2 (T2 _ x3273) _ = let I2 x3274 x3275 = shape a205 in T2 (T2 (constant ()) x3274) x3275 in x3273) && (0 :: Exp Int) == (let T2 _ x3276 = let I2 x3277 x3278 = shape a205 in T2 (T2 (constant ()) x3277) x3278 in x3276)) (a197 ! I2 x3225 x3226) (a197 ! I2 x3225 x3226 + a205 ! I2 x3225 x3226)))
                                   (0.0 :: Exp Float))
                                (0.0 :: Exp Float))
                             (0.0 :: Exp Float))
                          (0.0 :: Exp Float))
                       (0.0 :: Exp Float))
              a213 = generate (shape a12) (\(I1 _) -> 0.0 :: Exp Float)
              a214 = generate (shape a12) (\(I1 _) -> 0.0 :: Exp Float)
              a215 = generate (I1 (max (let T2 _ x3279 = let I1 x3280 = shape a214 in T2 (constant ()) x3280 in x3279) (let T2 _ x3281 = let I1 x3282 = shape a210 in T2 (constant ()) x3282 in x3281))) (\(I1 x3283) -> cond ((0 :: Exp Int) == (let T2 _ x3284 = let I1 x3285 = shape a214 in T2 (constant ()) x3285 in x3284)) (a210 ! I1 x3283) (cond ((0 :: Exp Int) == (let T2 _ x3286 = let I1 x3287 = shape a210 in T2 (constant ()) x3287 in x3286)) (a214 ! I1 x3283) (a214 ! I1 x3283 + a210 ! I1 x3283)))
              a216 = generate (shape a13) (\(I2 _ _) -> 0.0 :: Exp Float)
              a217 = generate (shape a13) (\(I2 _ _) -> 0.0 :: Exp Float)
              a218 =
                generate
                  (let T2 x3288 x3289 = let T2 (T2 _ x3290) x3291 = let I2 x3292 x3293 = shape a211 in T2 (T2 (constant ()) x3292) x3293 in T2 x3290 x3291
                       T2 x3294 x3295 = let T2 (T2 _ x3296) x3297 = let I2 x3298 x3299 = shape a217 in T2 (T2 (constant ()) x3298) x3299 in T2 x3296 x3297
                   in I2 (max x3288 x3294) (max x3289 x3295))
                  (\(I2 x3300 x3301) -> cond ((0 :: Exp Int) == (let T2 (T2 _ x3302) _ = let I2 x3303 x3304 = shape a211 in T2 (T2 (constant ()) x3303) x3304 in x3302) && (0 :: Exp Int) == (let T2 _ x3305 = let I2 x3306 x3307 = shape a211 in T2 (T2 (constant ()) x3306) x3307 in x3305)) (a217 ! I2 x3300 x3301) (cond ((0 :: Exp Int) == (let T2 (T2 _ x3308) _ = let I2 x3309 x3310 = shape a217 in T2 (T2 (constant ()) x3309) x3310 in x3308) && (0 :: Exp Int) == (let T2 _ x3311 = let I2 x3312 x3313 = shape a217 in T2 (T2 (constant ()) x3312) x3313 in x3311)) (a211 ! I2 x3300 x3301) (a211 ! I2 x3300 x3301 + a217 ! I2 x3300 x3301)))
              a219 = generate (shape a14) (\(I2 _ _) -> 0.0 :: Exp Float)
              a220 = generate (shape a14) (\(I2 _ _) -> 0.0 :: Exp Float)
              a221 =
                generate
                  (let T2 x3314 x3315 = let T2 (T2 _ x3316) x3317 = let I2 x3318 x3319 = shape a219 in T2 (T2 (constant ()) x3318) x3319 in T2 x3316 x3317
                       T2 x3320 x3321 = let T2 (T2 _ x3322) x3323 = let I2 x3324 x3325 = shape a220 in T2 (T2 (constant ()) x3324) x3325 in T2 x3322 x3323
                   in I2 (max x3314 x3320) (max x3315 x3321))
                  (\(I2 x3326 x3327) -> cond ((0 :: Exp Int) == (let T2 (T2 _ x3328) _ = let I2 x3329 x3330 = shape a219 in T2 (T2 (constant ()) x3329) x3330 in x3328) && (0 :: Exp Int) == (let T2 _ x3331 = let I2 x3332 x3333 = shape a219 in T2 (T2 (constant ()) x3332) x3333 in x3331)) (a220 ! I2 x3326 x3327) (cond ((0 :: Exp Int) == (let T2 (T2 _ x3334) _ = let I2 x3335 x3336 = shape a220 in T2 (T2 (constant ()) x3335) x3336 in x3334) && (0 :: Exp Int) == (let T2 _ x3337 = let I2 x3338 x3339 = shape a220 in T2 (T2 (constant ()) x3338) x3339 in x3337)) (a219 ! I2 x3326 x3327) (a219 ! I2 x3326 x3327 + a220 ! I2 x3326 x3327)))
              a222 = generate (shape a12) (\(I1 x3340) -> cond (x3340 < (let T2 _ x3341 = let I1 x3342 = shape a12 in T2 (constant ()) x3342 in x3341)) (cond (x3340 < (let T2 _ x3343 = let I1 x3344 = shape a12 in T2 (constant ()) x3344 in x3343)) (cond (x3340 < (let T2 _ x3345 = let I1 x3346 = shape a12 in T2 (constant ()) x3346 in x3345)) (cond (x3340 < max (let T2 _ x3347 = let I1 x3348 = shape a213 in T2 (constant ()) x3348 in x3347) (let T2 _ x3349 = let I1 x3350 = shape a215 in T2 (constant ()) x3350 in x3349)) (cond ((0 :: Exp Int) == (let T2 _ x3351 = let I1 x3352 = shape a213 in T2 (constant ()) x3352 in x3351)) (a215 ! I1 x3340) (cond ((0 :: Exp Int) == (let T2 _ x3353 = let I1 x3354 = shape a215 in T2 (constant ()) x3354 in x3353)) (a213 ! I1 x3340) (a213 ! I1 x3340 + a215 ! I1 x3340))) (0.0 :: Exp Float)) (0.0 :: Exp Float)) (0.0 :: Exp Float)) (0.0 :: Exp Float))
              a223 =
                generate
                  (shape a13)
                  (\(I2 x3355 x3356) ->
                     cond
                       (let T2 x3357 x3358 = let T2 (T2 _ x3359) x3360 = let I2 x3361 x3362 = shape a13 in T2 (T2 (constant ()) x3361) x3362 in T2 x3359 x3360 in x3355 < x3357 && x3356 < x3358)
                       (cond
                          (let T2 x3363 x3364 = let T2 (T2 _ x3365) x3366 = let I2 x3367 x3368 = shape a13 in T2 (T2 (constant ()) x3367) x3368 in T2 x3365 x3366 in x3355 < x3363 && x3356 < x3364)
                          (cond
                             (let T2 x3369 x3370 =
                                    let T2 (T2 _ x3371) x3372 =
                                          let T2 x3373 x3374 = let T2 (T2 _ x3375) x3376 = let I2 x3377 x3378 = shape a216 in T2 (T2 (constant ()) x3377) x3378 in T2 x3375 x3376
                                              T2 x3379 x3380 = let T2 (T2 _ x3381) x3382 = let I2 x3383 x3384 = shape a218 in T2 (T2 (constant ()) x3383) x3384 in T2 x3381 x3382
                                          in T2 (T2 (constant ()) (max x3373 x3379)) (max x3374 x3380)
                                    in T2 x3371 x3372
                              in x3355 < x3369 && x3356 < x3370)
                             (cond ((0 :: Exp Int) == (let T2 (T2 _ x3385) _ = let I2 x3386 x3387 = shape a216 in T2 (T2 (constant ()) x3386) x3387 in x3385) && (0 :: Exp Int) == (let T2 _ x3388 = let I2 x3389 x3390 = shape a216 in T2 (T2 (constant ()) x3389) x3390 in x3388)) (a218 ! I2 x3355 x3356) (cond ((0 :: Exp Int) == (let T2 (T2 _ x3391) _ = let I2 x3392 x3393 = shape a218 in T2 (T2 (constant ()) x3392) x3393 in x3391) && (0 :: Exp Int) == (let T2 _ x3394 = let I2 x3395 x3396 = shape a218 in T2 (T2 (constant ()) x3395) x3396 in x3394)) (a216 ! I2 x3355 x3356) (a216 ! I2 x3355 x3356 + a218 ! I2 x3355 x3356)))
                             (0.0 :: Exp Float))
                          (0.0 :: Exp Float))
                       (0.0 :: Exp Float))
              a224 =
                generate
                  (shape a14)
                  (\(I2 x3397 x3398) ->
                     cond
                       (let T2 x3399 x3400 = let T2 (T2 _ x3401) x3402 = let I2 x3403 x3404 = shape a14 in T2 (T2 (constant ()) x3403) x3404 in T2 x3401 x3402 in x3397 < x3399 && x3398 < x3400)
                       (cond
                          (let T2 x3405 x3406 =
                                 let T2 (T2 _ x3407) x3408 =
                                       let T2 x3409 x3410 = let T2 (T2 _ x3411) x3412 = let I2 x3413 x3414 = shape a212 in T2 (T2 (constant ()) x3413) x3414 in T2 x3411 x3412
                                           T2 x3415 x3416 = let T2 (T2 _ x3417) x3418 = let I2 x3419 x3420 = shape a221 in T2 (T2 (constant ()) x3419) x3420 in T2 x3417 x3418
                                       in T2 (T2 (constant ()) (max x3409 x3415)) (max x3410 x3416)
                                 in T2 x3407 x3408
                           in x3397 < x3405 && x3398 < x3406)
                          (cond ((0 :: Exp Int) == (let T2 (T2 _ x3421) _ = let I2 x3422 x3423 = shape a212 in T2 (T2 (constant ()) x3422) x3423 in x3421) && (0 :: Exp Int) == (let T2 _ x3424 = let I2 x3425 x3426 = shape a212 in T2 (T2 (constant ()) x3425) x3426 in x3424)) (a221 ! I2 x3397 x3398) (cond ((0 :: Exp Int) == (let T2 (T2 _ x3427) _ = let I2 x3428 x3429 = shape a221 in T2 (T2 (constant ()) x3428) x3429 in x3427) && (0 :: Exp Int) == (let T2 _ x3430 = let I2 x3431 x3432 = shape a221 in T2 (T2 (constant ()) x3431) x3432 in x3430)) (a212 ! I2 x3397 x3398) (a212 ! I2 x3397 x3398 + a221 ! I2 x3397 x3398)))
                          (0.0 :: Exp Float))
                       (0.0 :: Exp Float))
          in T2 (T2 (use ())
                    (generate
                       Z_
                       (\Z_ ->
                          let T2 x3433 _ =
                                let x3434 =
                                      let T2 x3435 _ =
                                            let x3436 = a31 ! Z_
                                                x3437 =
                                                  let x3438 = a35 ! Z_
                                                      T2 x3439 _ =
                                                        let T2 x3440 x3441 = let T2 (T2 _ x3442) x3443 = let I2 x3444 x3445 = shape a8 in T2 (T2 (constant ()) x3444) x3445 in T2 x3442 x3443
                                                            x3446 = fromIntegral x3440
                                                            x3447 = x3446 * x3438
                                                        in T2 x3447 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (constant ()) x3438) x3447) x3446) x3438) x3440) x3441) x3440) x3440) x3446) x3440) x3438)
                                                  in x3439
                                                x3448 = x3436 - x3437
                                            in T2 x3448 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (constant ()) x3436) x3437) x3436) x3437) x3448) x3436) x3437) x3436) x3437)
                                      in x3435
                                    x3449 =
                                      let x3450 = a42 ! Z_
                                          T2 x3451 _ = let x3452 = (12.655121 :: Exp Float) + x3450 in T2 x3452 (T2 (T2 (T2 (T2 (T2 (T2 (constant ()) x3450) x3452) x3450) (-12.655121 :: Exp Float)) x3450) (-12.655121 :: Exp Float))
                                      in x3451
                                    x3453 = (-1837.8771 :: Exp Float) + x3434
                                    x3454 = x3453 + x3449
                                in T2 x3454 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (T2 (constant ()) x3434) x3449) x3434) x3449) x3454) x3453) x3449) x3453) (-1837.8771 :: Exp Float)) x3434) (-1837.8771 :: Exp Float)) (1837.8771 :: Exp Float)) x3434) x3449)
                          in x3433)))
                (let a225 = generate (shape a12) (\(I1 _) -> 0.0 :: Exp Float)
                     a226 = generate (shape a13) (\(I2 _ _) -> 0.0 :: Exp Float)
                     a227 = generate (shape a12) (\(I1 _) -> 0.0 :: Exp Float)
                     a228 = generate (shape a14) (\(I2 _ _) -> 0.0 :: Exp Float)
                     a229 = generate (I1 (max (let T2 _ x3455 = let I1 x3456 = shape a225 in T2 (constant ()) x3456 in x3455) (let T2 _ x3457 = let I1 x3458 = shape a227 in T2 (constant ()) x3458 in x3457))) (\(I1 x3459) -> cond ((0 :: Exp Int) == (let T2 _ x3460 = let I1 x3461 = shape a225 in T2 (constant ()) x3461 in x3460)) (a227 ! I1 x3459) (cond ((0 :: Exp Int) == (let T2 _ x3462 = let I1 x3463 = shape a227 in T2 (constant ()) x3463 in x3462)) (a225 ! I1 x3459) (a225 ! I1 x3459 + a227 ! I1 x3459)))
                     a230 =
                       generate
                         (let T2 x3464 x3465 = let T2 (T2 _ x3466) x3467 = let I2 x3468 x3469 = shape a226 in T2 (T2 (constant ()) x3468) x3469 in T2 x3466 x3467
                              T2 x3470 x3471 = let T2 (T2 _ x3472) x3473 = let I2 x3474 x3475 = shape a223 in T2 (T2 (constant ()) x3474) x3475 in T2 x3472 x3473
                          in I2 (max x3464 x3470) (max x3465 x3471))
                         (\(I2 x3476 x3477) -> cond ((0 :: Exp Int) == (let T2 (T2 _ x3478) _ = let I2 x3479 x3480 = shape a226 in T2 (T2 (constant ()) x3479) x3480 in x3478) && (0 :: Exp Int) == (let T2 _ x3481 = let I2 x3482 x3483 = shape a226 in T2 (T2 (constant ()) x3482) x3483 in x3481)) (a223 ! I2 x3476 x3477) (cond ((0 :: Exp Int) == (let T2 (T2 _ x3484) _ = let I2 x3485 x3486 = shape a223 in T2 (T2 (constant ()) x3485) x3486 in x3484) && (0 :: Exp Int) == (let T2 _ x3487 = let I2 x3488 x3489 = shape a223 in T2 (T2 (constant ()) x3488) x3489 in x3487)) (a226 ! I2 x3476 x3477) (a226 ! I2 x3476 x3477 + a223 ! I2 x3476 x3477)))
                     a231 =
                       generate
                         (let T2 x3490 x3491 = let T2 (T2 _ x3492) x3493 = let I2 x3494 x3495 = shape a224 in T2 (T2 (constant ()) x3494) x3495 in T2 x3492 x3493
                              T2 x3496 x3497 = let T2 (T2 _ x3498) x3499 = let I2 x3500 x3501 = shape a228 in T2 (T2 (constant ()) x3500) x3501 in T2 x3498 x3499
                          in I2 (max x3490 x3496) (max x3491 x3497))
                         (\(I2 x3502 x3503) -> cond ((0 :: Exp Int) == (let T2 (T2 _ x3504) _ = let I2 x3505 x3506 = shape a224 in T2 (T2 (constant ()) x3505) x3506 in x3504) && (0 :: Exp Int) == (let T2 _ x3507 = let I2 x3508 x3509 = shape a224 in T2 (T2 (constant ()) x3508) x3509 in x3507)) (a228 ! I2 x3502 x3503) (cond ((0 :: Exp Int) == (let T2 (T2 _ x3510) _ = let I2 x3511 x3512 = shape a228 in T2 (T2 (constant ()) x3511) x3512 in x3510) && (0 :: Exp Int) == (let T2 _ x3513 = let I2 x3514 x3515 = shape a228 in T2 (T2 (constant ()) x3514) x3515 in x3513)) (a224 ! I2 x3502 x3503) (a224 ! I2 x3502 x3503 + a228 ! I2 x3502 x3503)))
                     a232 = generate (shape a13) (\(I2 _ _) -> 0.0 :: Exp Float)
                     a233 = generate (shape a14) (\(I2 _ _) -> 0.0 :: Exp Float)
                 in T2 (T2 (T2 (use ()) (generate (shape a12) (\(I1 x3516) -> cond (x3516 < max (let T2 _ x3517 = let I1 x3518 = shape a229 in T2 (constant ()) x3518 in x3517) (let T2 _ x3519 = let I1 x3520 = shape a222 in T2 (constant ()) x3520 in x3519)) (cond ((0 :: Exp Int) == (let T2 _ x3521 = let I1 x3522 = shape a229 in T2 (constant ()) x3522 in x3521)) (a222 ! I1 x3516) (cond ((0 :: Exp Int) == (let T2 _ x3523 = let I1 x3524 = shape a222 in T2 (constant ()) x3524 in x3523)) (a229 ! I1 x3516) (a229 ! I1 x3516 + a222 ! I1 x3516))) (0.0 :: Exp Float))))
                           (generate
                              (shape a13)
                              (\(I2 x3525 x3526) ->
                                 cond
                                   (let T2 x3527 x3528 =
                                          let T2 (T2 _ x3529) x3530 =
                                                let T2 x3531 x3532 = let T2 (T2 _ x3533) x3534 = let I2 x3535 x3536 = shape a230 in T2 (T2 (constant ()) x3535) x3536 in T2 x3533 x3534
                                                    T2 x3537 x3538 = let T2 (T2 _ x3539) x3540 = let I2 x3541 x3542 = shape a232 in T2 (T2 (constant ()) x3541) x3542 in T2 x3539 x3540
                                                in T2 (T2 (constant ()) (max x3531 x3537)) (max x3532 x3538)
                                          in T2 x3529 x3530
                                    in x3525 < x3527 && x3526 < x3528)
                                   (cond ((0 :: Exp Int) == (let T2 (T2 _ x3543) _ = let I2 x3544 x3545 = shape a230 in T2 (T2 (constant ()) x3544) x3545 in x3543) && (0 :: Exp Int) == (let T2 _ x3546 = let I2 x3547 x3548 = shape a230 in T2 (T2 (constant ()) x3547) x3548 in x3546)) (a232 ! I2 x3525 x3526) (cond ((0 :: Exp Int) == (let T2 (T2 _ x3549) _ = let I2 x3550 x3551 = shape a232 in T2 (T2 (constant ()) x3550) x3551 in x3549) && (0 :: Exp Int) == (let T2 _ x3552 = let I2 x3553 x3554 = shape a232 in T2 (T2 (constant ()) x3553) x3554 in x3552)) (a230 ! I2 x3525 x3526) (a230 ! I2 x3525 x3526 + a232 ! I2 x3525 x3526)))
                                   (0.0 :: Exp Float))))
                       (generate
                          (shape a14)
                          (\(I2 x3555 x3556) ->
                             cond
                               (let T2 x3557 x3558 =
                                      let T2 (T2 _ x3559) x3560 =
                                            let T2 x3561 x3562 = let T2 (T2 _ x3563) x3564 = let I2 x3565 x3566 = shape a231 in T2 (T2 (constant ()) x3565) x3566 in T2 x3563 x3564
                                                T2 x3567 x3568 = let T2 (T2 _ x3569) x3570 = let I2 x3571 x3572 = shape a233 in T2 (T2 (constant ()) x3571) x3572 in T2 x3569 x3570
                                            in T2 (T2 (constant ()) (max x3561 x3567)) (max x3562 x3568)
                                      in T2 x3559 x3560
                                in x3555 < x3557 && x3556 < x3558)
                               (cond ((0 :: Exp Int) == (let T2 (T2 _ x3573) _ = let I2 x3574 x3575 = shape a231 in T2 (T2 (constant ()) x3574) x3575 in x3573) && (0 :: Exp Int) == (let T2 _ x3576 = let I2 x3577 x3578 = shape a231 in T2 (T2 (constant ()) x3577) x3578 in x3576)) (a233 ! I2 x3555 x3556) (cond ((0 :: Exp Int) == (let T2 (T2 _ x3579) _ = let I2 x3580 x3581 = shape a233 in T2 (T2 (constant ()) x3580) x3581 in x3579) && (0 :: Exp Int) == (let T2 _ x3582 = let I2 x3583 x3584 = shape a233 in T2 (T2 (constant ()) x3583) x3584 in x3582)) (a231 ! I2 x3555 x3556) (a231 ! I2 x3555 x3556 + a233 ! I2 x3555 x3556)))
                               (0.0 :: Exp Float))))
    in T2 (T2 (T2 (use ()) a2) a3) a4

Expected behaviour

No crash.

Current behaviour

Crash (non-deterministically on some machines).

Steps to reproduce (for bugs)

  1. git clone https://github.com/tomsmeding/acc-gpu-crash
  2. cd acc-gpu-crash
  3. ./test.sh

Your environment

  • Version used: 1.3.0.0 from hackage as well as master brach commits of accelerate and accelerate-llvm
  • Backend(s) used and version: accelerate-llvm-ptx
  • GHC version: 8.10.4
  • Operating system and version: Arch linux (nvidia 465.31), Ubuntu (jizo) (nvidia 465.27)
  • Link to your project: https://github.com/tomsmeding/acc-gpu-crash
  • If this is a bug with the GPU backend, include the output of nvidia-device-query: see below
nvidia-device-query on my Arch linux machine
CUDA device query (Driver API, statically linked)
CUDA driver version 11.3
CUDA API version 11.3
Detected 1 CUDA capable device

Device 0: NVIDIA GeForce GTX 1050 Ti
  CUDA capability:                          6.1
  CUDA cores:                               768 cores in 6 multiprocessors (128 cores/MP)
  Global memory:                            4 GB
  Constant memory:                          64 kB
  Shared memory per block:                  48 kB
  Registers per block:                      65536
  Warp size:                                32
  Maximum threads per multiprocessor:       2048
  Maximum threads per block:                1024
  Maximum grid dimensions:                  2147483647 x 65535 x 65535
  Maximum block dimensions:                 1024 x 1024 x 64
  GPU clock rate:                           1.392 GHz
  Memory clock rate:                        3.504 GHz
  Memory bus width:                         128-bit
  L2 cache size:                            1 MB
  Maximum texture dimensions
    1D:                                     131072
    2D:                                     131072 x 65536
    3D:                                     16384 x 16384 x 16384
  Texture alignment:                        512 B
  Maximum memory pitch:                     2 GB
  Concurrent kernel execution:              Yes
  Concurrent copy and execution:            Yes, with 2 copy engines
  Runtime limit on kernel execution:        Yes
  Integrated GPU sharing host memory:       No
  Host page-locked memory mapping:          Yes
  ECC memory support:                       No
  Unified addressing (UVA):                 Yes
  Single to double precision performance:   32 : 1
  Supports compute pre-emption:             Yes
  Supports cooperative launch:              Yes
  Supports multi-device cooperative launch: Yes
  PCI bus/location:                         1/0
  Compute mode:                             Default
    Multiple contexts are allowed on the device simultaneously
nvidia-device-query on Jizo
CUDA device query (Driver API, statically linked)
CUDA driver version 11.3
CUDA API version 10.1
Detected 1 CUDA capable device

Device 0: NVIDIA GeForce RTX 2080 Ti
  CUDA capability:                          7.5
  CUDA cores:                               4352 cores in 68 multiprocessors (64 cores/MP)
  Global memory:                            11 GB
  Constant memory:                          64 kB
  Shared memory per block:                  48 kB
  Registers per block:                      65536
  Warp size:                                32
  Maximum threads per multiprocessor:       1024
  Maximum threads per block:                1024
  Maximum grid dimensions:                  2147483647 x 65535 x 65535
  Maximum block dimensions:                 1024 x 1024 x 64
  GPU clock rate:                           1.65 GHz
  Memory clock rate:                        7.0 GHz
  Memory bus width:                         352-bit
  L2 cache size:                            6 MB
  Maximum texture dimensions
    1D:                                     131072
    2D:                                     131072 x 65536
    3D:                                     16384 x 16384 x 16384
  Texture alignment:                        512 B
  Maximum memory pitch:                     2 GB
  Concurrent kernel execution:              Yes
  Concurrent copy and execution:            Yes, with 3 copy engines
  Runtime limit on kernel execution:        Yes
  Integrated GPU sharing host memory:       No
  Host page-locked memory mapping:          Yes
  ECC memory support:                       No
  Unified addressing (UVA):                 Yes
  Single to double precision performance:   32 : 1
  Supports compute pre-emption:             Yes
  Supports cooperative launch:              Yes
  Supports multi-device cooperative launch: Yes
  PCI bus/location:                         66/0
  Compute mode:                             Default
    Multiple contexts are allowed on the device simultaneously
nvidia-device-query on Robbert's Arch linux (Manjaro, really) machine
CUDA device query (Driver API, statically linked)
CUDA driver version 11.3
CUDA API version 10.2
Detected 1 CUDA capable device

Device 0: NVIDIA GeForce RTX 2080 SUPER
  CUDA capability:                          7.5
  CUDA cores:                               3072 cores in 48 multiprocessors (64 cores/MP)
  Global memory:                            8 GB
  Constant memory:                          64 kB
  Shared memory per block:                  48 kB
  Registers per block:                      65536
  Warp size:                                32
  Maximum threads per multiprocessor:       1024
  Maximum threads per block:                1024
  Maximum grid dimensions:                  2147483647 x 65535 x 65535
  Maximum block dimensions:                 1024 x 1024 x 64
  GPU clock rate:                           1.845 GHz
  Memory clock rate:                        7.751 GHz
  Memory bus width:                         256-bit
  L2 cache size:                            4 MB
  Maximum texture dimensions               
    1D:                                     131072
    2D:                                     131072 x 65536
    3D:                                     16384 x 16384 x 16384
  Texture alignment:                        512 B
  Maximum memory pitch:                     2 GB
  Concurrent kernel execution:              Yes
  Concurrent copy and execution:            Yes, with 3 copy engines
  Runtime limit on kernel execution:        Yes
  Integrated GPU sharing host memory:       No
  Host page-locked memory mapping:          Yes
  ECC memory support:                       No
  Unified addressing (UVA):                 Yes
  Single to double precision performance:   32 : 1
  Supports compute pre-emption:             Yes
  Supports cooperative launch:              Yes
  Supports multi-device cooperative launch: Yes
  PCI bus/location:                         5/0
  Compute mode:                             Default
    Multiple contexts are allowed on the device simultaneously
@ivogabe
Copy link
Contributor

ivogabe commented Nov 19, 2023

Could be fixed in #97

@tomsmeding
Copy link
Member Author

This is hard to test; both on jizo (4090) and on my desktop (1050), the occasional cuda exceptions in the reproducer in the issue description above are absolutely drowned out by segfaults inside libcuda.so:

Thread 1 "acc-gpu-crash" received signal SIGSEGV, Segmentation fault.
0x00007ffff42300cd in ?? () from /usr/lib/libcuda.so.1
(cuda-gdb) bt
#0  0x00007ffff42300cd in ?? () from /usr/lib/libcuda.so.1
#1  0x00007ffff4400c9e in ?? () from /usr/lib/libcuda.so.1
#2  0x00007ffff44fcc96 in ?? () from /usr/lib/libcuda.so.1
#3  0x00007ffff412fa26 in ?? () from /usr/lib/libcuda.so.1
#4  0x00007ffff4130230 in ?? () from /usr/lib/libcuda.so.1
#5  0x00007ffff4132dcc in ?? () from /usr/lib/libcuda.so.1
#6  0x00007ffff4334660 in ?? () from /usr/lib/libcuda.so.1
#7  0x00000000007e272e in ?? ()
#8  0x0000000000000001 in ?? ()
#9  0x0000000000000000 in ?? ()

I can, very occasionally, reproduce a different error with accelerate-llvm master:

warning: Cuda API error detected: cuLaunchKernel returned (0x1)

acc-gpu-crash:
*** Internal error in package accelerate ***
*** Please submit a bug report at https://github.com/AccelerateHS/accelerate/issues

CUDA Exception: invalid argument
CallStack (from HasCallStack):
  internalError: Data.Array.Accelerate.LLVM.PTX.State:55:9

and I haven't seen that yet with the scan-syncthreads branch, but due to the low frequency that doesn't prove much.

@tomsmeding
Copy link
Member Author

tomsmeding commented Sep 4, 2024

I just tried again. After a whole bunch of libcuda.so crashes, I tried running the executable under rr which immediately failed with "acc-gpu-crash: CUDA Exception: no CUDA-capable device is detected". Then I tried again outside rr and now I'm getting invalid argument exceptions again, for the acc-gpu-crash reproducer with newest accelerate master (AccelerateHS/accelerate@237303a) and the scan-syncthreads branch of accelerate-llvm.

It does seem that running the program under rr makes libcuda.so behave. (? that be memory errors for you?)

The syncthreads call probably fixes a bug, but it clearly doesn't fix everything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants