-
Notifications
You must be signed in to change notification settings - Fork 147
/
p384_scalar_64.c
3924 lines (3898 loc) · 139 KB
/
p384_scalar_64.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* Autogenerated: 'src/ExtractionOCaml/word_by_word_montgomery' --inline --static --use-value-barrier p384_scalar 64 '2^384 - 1388124618062372383947042015309946732620727252194336364173' mul square add sub opp from_montgomery to_montgomery nonzero selectznz to_bytes from_bytes one msat divstep divstep_precomp */
/* curve description: p384_scalar */
/* machine_wordsize = 64 (from "64") */
/* requested operations: mul, square, add, sub, opp, from_montgomery, to_montgomery, nonzero, selectznz, to_bytes, from_bytes, one, msat, divstep, divstep_precomp */
/* m = 0xffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973 (from "2^384 - 1388124618062372383947042015309946732620727252194336364173") */
/* */
/* NOTE: In addition to the bounds specified above each function, all */
/* functions synthesized for this Montgomery arithmetic require the */
/* input to be strictly less than the prime modulus (m), and also */
/* require the input to be in the unique saturated representation. */
/* All functions also ensure that these two properties are true of */
/* return values. */
/* */
/* Computed values: */
/* eval z = z[0] + (z[1] << 64) + (z[2] << 128) + (z[3] << 192) + (z[4] << 256) + (z[5] << 0x140) */
/* bytes_eval z = z[0] + (z[1] << 8) + (z[2] << 16) + (z[3] << 24) + (z[4] << 32) + (z[5] << 40) + (z[6] << 48) + (z[7] << 56) + (z[8] << 64) + (z[9] << 72) + (z[10] << 80) + (z[11] << 88) + (z[12] << 96) + (z[13] << 104) + (z[14] << 112) + (z[15] << 120) + (z[16] << 128) + (z[17] << 136) + (z[18] << 144) + (z[19] << 152) + (z[20] << 160) + (z[21] << 168) + (z[22] << 176) + (z[23] << 184) + (z[24] << 192) + (z[25] << 200) + (z[26] << 208) + (z[27] << 216) + (z[28] << 224) + (z[29] << 232) + (z[30] << 240) + (z[31] << 248) + (z[32] << 256) + (z[33] << 0x108) + (z[34] << 0x110) + (z[35] << 0x118) + (z[36] << 0x120) + (z[37] << 0x128) + (z[38] << 0x130) + (z[39] << 0x138) + (z[40] << 0x140) + (z[41] << 0x148) + (z[42] << 0x150) + (z[43] << 0x158) + (z[44] << 0x160) + (z[45] << 0x168) + (z[46] << 0x170) + (z[47] << 0x178) */
/* twos_complement_eval z = let x1 := z[0] + (z[1] << 64) + (z[2] << 128) + (z[3] << 192) + (z[4] << 256) + (z[5] << 0x140) in */
/* if x1 & (2^384-1) < 2^383 then x1 & (2^384-1) else (x1 & (2^384-1)) - 2^384 */
#include <stdint.h>
typedef unsigned char fiat_p384_scalar_uint1;
typedef signed char fiat_p384_scalar_int1;
#if defined(__GNUC__) || defined(__clang__)
# define FIAT_P384_SCALAR_FIAT_EXTENSION __extension__
# define FIAT_P384_SCALAR_FIAT_INLINE __inline__
#else
# define FIAT_P384_SCALAR_FIAT_EXTENSION
# define FIAT_P384_SCALAR_FIAT_INLINE
#endif
FIAT_P384_SCALAR_FIAT_EXTENSION typedef signed __int128 fiat_p384_scalar_int128;
FIAT_P384_SCALAR_FIAT_EXTENSION typedef unsigned __int128 fiat_p384_scalar_uint128;
/* The type fiat_p384_scalar_montgomery_domain_field_element is a field element in the Montgomery domain. */
/* Bounds: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] */
typedef uint64_t fiat_p384_scalar_montgomery_domain_field_element[6];
/* The type fiat_p384_scalar_non_montgomery_domain_field_element is a field element NOT in the Montgomery domain. */
/* Bounds: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] */
typedef uint64_t fiat_p384_scalar_non_montgomery_domain_field_element[6];
#if (-1 & 3) != 3
#error "This code only works on a two's complement system"
#endif
#if !defined(FIAT_P384_SCALAR_NO_ASM) && (defined(__GNUC__) || defined(__clang__))
static __inline__ uint64_t fiat_p384_scalar_value_barrier_u64(uint64_t a) {
__asm__("" : "+r"(a) : /* no inputs */);
return a;
}
#else
# define fiat_p384_scalar_value_barrier_u64(x) (x)
#endif
/*
* The function fiat_p384_scalar_addcarryx_u64 is an addition with carry.
*
* Postconditions:
* out1 = (arg1 + arg2 + arg3) mod 2^64
* out2 = ⌊(arg1 + arg2 + arg3) / 2^64⌋
*
* Input Bounds:
* arg1: [0x0 ~> 0x1]
* arg2: [0x0 ~> 0xffffffffffffffff]
* arg3: [0x0 ~> 0xffffffffffffffff]
* Output Bounds:
* out1: [0x0 ~> 0xffffffffffffffff]
* out2: [0x0 ~> 0x1]
*/
static FIAT_P384_SCALAR_FIAT_INLINE void fiat_p384_scalar_addcarryx_u64(uint64_t* out1, fiat_p384_scalar_uint1* out2, fiat_p384_scalar_uint1 arg1, uint64_t arg2, uint64_t arg3) {
fiat_p384_scalar_uint128 x1;
uint64_t x2;
fiat_p384_scalar_uint1 x3;
x1 = ((arg1 + (fiat_p384_scalar_uint128)arg2) + arg3);
x2 = (uint64_t)(x1 & UINT64_C(0xffffffffffffffff));
x3 = (fiat_p384_scalar_uint1)(x1 >> 64);
*out1 = x2;
*out2 = x3;
}
/*
* The function fiat_p384_scalar_subborrowx_u64 is a subtraction with borrow.
*
* Postconditions:
* out1 = (-arg1 + arg2 + -arg3) mod 2^64
* out2 = -⌊(-arg1 + arg2 + -arg3) / 2^64⌋
*
* Input Bounds:
* arg1: [0x0 ~> 0x1]
* arg2: [0x0 ~> 0xffffffffffffffff]
* arg3: [0x0 ~> 0xffffffffffffffff]
* Output Bounds:
* out1: [0x0 ~> 0xffffffffffffffff]
* out2: [0x0 ~> 0x1]
*/
static FIAT_P384_SCALAR_FIAT_INLINE void fiat_p384_scalar_subborrowx_u64(uint64_t* out1, fiat_p384_scalar_uint1* out2, fiat_p384_scalar_uint1 arg1, uint64_t arg2, uint64_t arg3) {
fiat_p384_scalar_int128 x1;
fiat_p384_scalar_int1 x2;
uint64_t x3;
x1 = ((arg2 - (fiat_p384_scalar_int128)arg1) - arg3);
x2 = (fiat_p384_scalar_int1)(x1 >> 64);
x3 = (uint64_t)(x1 & UINT64_C(0xffffffffffffffff));
*out1 = x3;
*out2 = (fiat_p384_scalar_uint1)(0x0 - x2);
}
/*
* The function fiat_p384_scalar_mulx_u64 is a multiplication, returning the full double-width result.
*
* Postconditions:
* out1 = (arg1 * arg2) mod 2^64
* out2 = ⌊arg1 * arg2 / 2^64⌋
*
* Input Bounds:
* arg1: [0x0 ~> 0xffffffffffffffff]
* arg2: [0x0 ~> 0xffffffffffffffff]
* Output Bounds:
* out1: [0x0 ~> 0xffffffffffffffff]
* out2: [0x0 ~> 0xffffffffffffffff]
*/
static FIAT_P384_SCALAR_FIAT_INLINE void fiat_p384_scalar_mulx_u64(uint64_t* out1, uint64_t* out2, uint64_t arg1, uint64_t arg2) {
fiat_p384_scalar_uint128 x1;
uint64_t x2;
uint64_t x3;
x1 = ((fiat_p384_scalar_uint128)arg1 * arg2);
x2 = (uint64_t)(x1 & UINT64_C(0xffffffffffffffff));
x3 = (uint64_t)(x1 >> 64);
*out1 = x2;
*out2 = x3;
}
/*
* The function fiat_p384_scalar_cmovznz_u64 is a single-word conditional move.
*
* Postconditions:
* out1 = (if arg1 = 0 then arg2 else arg3)
*
* Input Bounds:
* arg1: [0x0 ~> 0x1]
* arg2: [0x0 ~> 0xffffffffffffffff]
* arg3: [0x0 ~> 0xffffffffffffffff]
* Output Bounds:
* out1: [0x0 ~> 0xffffffffffffffff]
*/
static FIAT_P384_SCALAR_FIAT_INLINE void fiat_p384_scalar_cmovznz_u64(uint64_t* out1, fiat_p384_scalar_uint1 arg1, uint64_t arg2, uint64_t arg3) {
fiat_p384_scalar_uint1 x1;
uint64_t x2;
uint64_t x3;
x1 = (!(!arg1));
x2 = ((fiat_p384_scalar_int1)(0x0 - x1) & UINT64_C(0xffffffffffffffff));
x3 = ((fiat_p384_scalar_value_barrier_u64(x2) & arg3) | (fiat_p384_scalar_value_barrier_u64((~x2)) & arg2));
*out1 = x3;
}
/*
* The function fiat_p384_scalar_mul multiplies two field elements in the Montgomery domain.
*
* Preconditions:
* 0 ≤ eval arg1 < m
* 0 ≤ eval arg2 < m
* Postconditions:
* eval (from_montgomery out1) mod m = (eval (from_montgomery arg1) * eval (from_montgomery arg2)) mod m
* 0 ≤ eval out1 < m
*
*/
static FIAT_P384_SCALAR_FIAT_INLINE void fiat_p384_scalar_mul(fiat_p384_scalar_montgomery_domain_field_element out1, const fiat_p384_scalar_montgomery_domain_field_element arg1, const fiat_p384_scalar_montgomery_domain_field_element arg2) {
uint64_t x1;
uint64_t x2;
uint64_t x3;
uint64_t x4;
uint64_t x5;
uint64_t x6;
uint64_t x7;
uint64_t x8;
uint64_t x9;
uint64_t x10;
uint64_t x11;
uint64_t x12;
uint64_t x13;
uint64_t x14;
uint64_t x15;
uint64_t x16;
uint64_t x17;
uint64_t x18;
uint64_t x19;
fiat_p384_scalar_uint1 x20;
uint64_t x21;
fiat_p384_scalar_uint1 x22;
uint64_t x23;
fiat_p384_scalar_uint1 x24;
uint64_t x25;
fiat_p384_scalar_uint1 x26;
uint64_t x27;
fiat_p384_scalar_uint1 x28;
uint64_t x29;
uint64_t x30;
uint64_t x31;
uint64_t x32;
uint64_t x33;
uint64_t x34;
uint64_t x35;
uint64_t x36;
uint64_t x37;
uint64_t x38;
uint64_t x39;
uint64_t x40;
uint64_t x41;
uint64_t x42;
uint64_t x43;
uint64_t x44;
fiat_p384_scalar_uint1 x45;
uint64_t x46;
fiat_p384_scalar_uint1 x47;
uint64_t x48;
fiat_p384_scalar_uint1 x49;
uint64_t x50;
fiat_p384_scalar_uint1 x51;
uint64_t x52;
fiat_p384_scalar_uint1 x53;
uint64_t x54;
uint64_t x55;
fiat_p384_scalar_uint1 x56;
uint64_t x57;
fiat_p384_scalar_uint1 x58;
uint64_t x59;
fiat_p384_scalar_uint1 x60;
uint64_t x61;
fiat_p384_scalar_uint1 x62;
uint64_t x63;
fiat_p384_scalar_uint1 x64;
uint64_t x65;
fiat_p384_scalar_uint1 x66;
uint64_t x67;
fiat_p384_scalar_uint1 x68;
uint64_t x69;
uint64_t x70;
uint64_t x71;
uint64_t x72;
uint64_t x73;
uint64_t x74;
uint64_t x75;
uint64_t x76;
uint64_t x77;
uint64_t x78;
uint64_t x79;
uint64_t x80;
uint64_t x81;
fiat_p384_scalar_uint1 x82;
uint64_t x83;
fiat_p384_scalar_uint1 x84;
uint64_t x85;
fiat_p384_scalar_uint1 x86;
uint64_t x87;
fiat_p384_scalar_uint1 x88;
uint64_t x89;
fiat_p384_scalar_uint1 x90;
uint64_t x91;
uint64_t x92;
fiat_p384_scalar_uint1 x93;
uint64_t x94;
fiat_p384_scalar_uint1 x95;
uint64_t x96;
fiat_p384_scalar_uint1 x97;
uint64_t x98;
fiat_p384_scalar_uint1 x99;
uint64_t x100;
fiat_p384_scalar_uint1 x101;
uint64_t x102;
fiat_p384_scalar_uint1 x103;
uint64_t x104;
fiat_p384_scalar_uint1 x105;
uint64_t x106;
uint64_t x107;
uint64_t x108;
uint64_t x109;
uint64_t x110;
uint64_t x111;
uint64_t x112;
uint64_t x113;
uint64_t x114;
uint64_t x115;
uint64_t x116;
uint64_t x117;
uint64_t x118;
uint64_t x119;
uint64_t x120;
fiat_p384_scalar_uint1 x121;
uint64_t x122;
fiat_p384_scalar_uint1 x123;
uint64_t x124;
fiat_p384_scalar_uint1 x125;
uint64_t x126;
fiat_p384_scalar_uint1 x127;
uint64_t x128;
fiat_p384_scalar_uint1 x129;
uint64_t x130;
uint64_t x131;
fiat_p384_scalar_uint1 x132;
uint64_t x133;
fiat_p384_scalar_uint1 x134;
uint64_t x135;
fiat_p384_scalar_uint1 x136;
uint64_t x137;
fiat_p384_scalar_uint1 x138;
uint64_t x139;
fiat_p384_scalar_uint1 x140;
uint64_t x141;
fiat_p384_scalar_uint1 x142;
uint64_t x143;
fiat_p384_scalar_uint1 x144;
uint64_t x145;
uint64_t x146;
uint64_t x147;
uint64_t x148;
uint64_t x149;
uint64_t x150;
uint64_t x151;
uint64_t x152;
uint64_t x153;
uint64_t x154;
uint64_t x155;
uint64_t x156;
uint64_t x157;
uint64_t x158;
fiat_p384_scalar_uint1 x159;
uint64_t x160;
fiat_p384_scalar_uint1 x161;
uint64_t x162;
fiat_p384_scalar_uint1 x163;
uint64_t x164;
fiat_p384_scalar_uint1 x165;
uint64_t x166;
fiat_p384_scalar_uint1 x167;
uint64_t x168;
uint64_t x169;
fiat_p384_scalar_uint1 x170;
uint64_t x171;
fiat_p384_scalar_uint1 x172;
uint64_t x173;
fiat_p384_scalar_uint1 x174;
uint64_t x175;
fiat_p384_scalar_uint1 x176;
uint64_t x177;
fiat_p384_scalar_uint1 x178;
uint64_t x179;
fiat_p384_scalar_uint1 x180;
uint64_t x181;
fiat_p384_scalar_uint1 x182;
uint64_t x183;
uint64_t x184;
uint64_t x185;
uint64_t x186;
uint64_t x187;
uint64_t x188;
uint64_t x189;
uint64_t x190;
uint64_t x191;
uint64_t x192;
uint64_t x193;
uint64_t x194;
uint64_t x195;
uint64_t x196;
uint64_t x197;
fiat_p384_scalar_uint1 x198;
uint64_t x199;
fiat_p384_scalar_uint1 x200;
uint64_t x201;
fiat_p384_scalar_uint1 x202;
uint64_t x203;
fiat_p384_scalar_uint1 x204;
uint64_t x205;
fiat_p384_scalar_uint1 x206;
uint64_t x207;
uint64_t x208;
fiat_p384_scalar_uint1 x209;
uint64_t x210;
fiat_p384_scalar_uint1 x211;
uint64_t x212;
fiat_p384_scalar_uint1 x213;
uint64_t x214;
fiat_p384_scalar_uint1 x215;
uint64_t x216;
fiat_p384_scalar_uint1 x217;
uint64_t x218;
fiat_p384_scalar_uint1 x219;
uint64_t x220;
fiat_p384_scalar_uint1 x221;
uint64_t x222;
uint64_t x223;
uint64_t x224;
uint64_t x225;
uint64_t x226;
uint64_t x227;
uint64_t x228;
uint64_t x229;
uint64_t x230;
uint64_t x231;
uint64_t x232;
uint64_t x233;
uint64_t x234;
uint64_t x235;
fiat_p384_scalar_uint1 x236;
uint64_t x237;
fiat_p384_scalar_uint1 x238;
uint64_t x239;
fiat_p384_scalar_uint1 x240;
uint64_t x241;
fiat_p384_scalar_uint1 x242;
uint64_t x243;
fiat_p384_scalar_uint1 x244;
uint64_t x245;
uint64_t x246;
fiat_p384_scalar_uint1 x247;
uint64_t x248;
fiat_p384_scalar_uint1 x249;
uint64_t x250;
fiat_p384_scalar_uint1 x251;
uint64_t x252;
fiat_p384_scalar_uint1 x253;
uint64_t x254;
fiat_p384_scalar_uint1 x255;
uint64_t x256;
fiat_p384_scalar_uint1 x257;
uint64_t x258;
fiat_p384_scalar_uint1 x259;
uint64_t x260;
uint64_t x261;
uint64_t x262;
uint64_t x263;
uint64_t x264;
uint64_t x265;
uint64_t x266;
uint64_t x267;
uint64_t x268;
uint64_t x269;
uint64_t x270;
uint64_t x271;
uint64_t x272;
uint64_t x273;
uint64_t x274;
fiat_p384_scalar_uint1 x275;
uint64_t x276;
fiat_p384_scalar_uint1 x277;
uint64_t x278;
fiat_p384_scalar_uint1 x279;
uint64_t x280;
fiat_p384_scalar_uint1 x281;
uint64_t x282;
fiat_p384_scalar_uint1 x283;
uint64_t x284;
uint64_t x285;
fiat_p384_scalar_uint1 x286;
uint64_t x287;
fiat_p384_scalar_uint1 x288;
uint64_t x289;
fiat_p384_scalar_uint1 x290;
uint64_t x291;
fiat_p384_scalar_uint1 x292;
uint64_t x293;
fiat_p384_scalar_uint1 x294;
uint64_t x295;
fiat_p384_scalar_uint1 x296;
uint64_t x297;
fiat_p384_scalar_uint1 x298;
uint64_t x299;
uint64_t x300;
uint64_t x301;
uint64_t x302;
uint64_t x303;
uint64_t x304;
uint64_t x305;
uint64_t x306;
uint64_t x307;
uint64_t x308;
uint64_t x309;
uint64_t x310;
uint64_t x311;
uint64_t x312;
fiat_p384_scalar_uint1 x313;
uint64_t x314;
fiat_p384_scalar_uint1 x315;
uint64_t x316;
fiat_p384_scalar_uint1 x317;
uint64_t x318;
fiat_p384_scalar_uint1 x319;
uint64_t x320;
fiat_p384_scalar_uint1 x321;
uint64_t x322;
uint64_t x323;
fiat_p384_scalar_uint1 x324;
uint64_t x325;
fiat_p384_scalar_uint1 x326;
uint64_t x327;
fiat_p384_scalar_uint1 x328;
uint64_t x329;
fiat_p384_scalar_uint1 x330;
uint64_t x331;
fiat_p384_scalar_uint1 x332;
uint64_t x333;
fiat_p384_scalar_uint1 x334;
uint64_t x335;
fiat_p384_scalar_uint1 x336;
uint64_t x337;
uint64_t x338;
uint64_t x339;
uint64_t x340;
uint64_t x341;
uint64_t x342;
uint64_t x343;
uint64_t x344;
uint64_t x345;
uint64_t x346;
uint64_t x347;
uint64_t x348;
uint64_t x349;
uint64_t x350;
uint64_t x351;
fiat_p384_scalar_uint1 x352;
uint64_t x353;
fiat_p384_scalar_uint1 x354;
uint64_t x355;
fiat_p384_scalar_uint1 x356;
uint64_t x357;
fiat_p384_scalar_uint1 x358;
uint64_t x359;
fiat_p384_scalar_uint1 x360;
uint64_t x361;
uint64_t x362;
fiat_p384_scalar_uint1 x363;
uint64_t x364;
fiat_p384_scalar_uint1 x365;
uint64_t x366;
fiat_p384_scalar_uint1 x367;
uint64_t x368;
fiat_p384_scalar_uint1 x369;
uint64_t x370;
fiat_p384_scalar_uint1 x371;
uint64_t x372;
fiat_p384_scalar_uint1 x373;
uint64_t x374;
fiat_p384_scalar_uint1 x375;
uint64_t x376;
uint64_t x377;
uint64_t x378;
uint64_t x379;
uint64_t x380;
uint64_t x381;
uint64_t x382;
uint64_t x383;
uint64_t x384;
uint64_t x385;
uint64_t x386;
uint64_t x387;
uint64_t x388;
uint64_t x389;
fiat_p384_scalar_uint1 x390;
uint64_t x391;
fiat_p384_scalar_uint1 x392;
uint64_t x393;
fiat_p384_scalar_uint1 x394;
uint64_t x395;
fiat_p384_scalar_uint1 x396;
uint64_t x397;
fiat_p384_scalar_uint1 x398;
uint64_t x399;
uint64_t x400;
fiat_p384_scalar_uint1 x401;
uint64_t x402;
fiat_p384_scalar_uint1 x403;
uint64_t x404;
fiat_p384_scalar_uint1 x405;
uint64_t x406;
fiat_p384_scalar_uint1 x407;
uint64_t x408;
fiat_p384_scalar_uint1 x409;
uint64_t x410;
fiat_p384_scalar_uint1 x411;
uint64_t x412;
fiat_p384_scalar_uint1 x413;
uint64_t x414;
uint64_t x415;
uint64_t x416;
uint64_t x417;
uint64_t x418;
uint64_t x419;
uint64_t x420;
uint64_t x421;
uint64_t x422;
uint64_t x423;
uint64_t x424;
uint64_t x425;
uint64_t x426;
uint64_t x427;
uint64_t x428;
fiat_p384_scalar_uint1 x429;
uint64_t x430;
fiat_p384_scalar_uint1 x431;
uint64_t x432;
fiat_p384_scalar_uint1 x433;
uint64_t x434;
fiat_p384_scalar_uint1 x435;
uint64_t x436;
fiat_p384_scalar_uint1 x437;
uint64_t x438;
uint64_t x439;
fiat_p384_scalar_uint1 x440;
uint64_t x441;
fiat_p384_scalar_uint1 x442;
uint64_t x443;
fiat_p384_scalar_uint1 x444;
uint64_t x445;
fiat_p384_scalar_uint1 x446;
uint64_t x447;
fiat_p384_scalar_uint1 x448;
uint64_t x449;
fiat_p384_scalar_uint1 x450;
uint64_t x451;
fiat_p384_scalar_uint1 x452;
uint64_t x453;
uint64_t x454;
fiat_p384_scalar_uint1 x455;
uint64_t x456;
fiat_p384_scalar_uint1 x457;
uint64_t x458;
fiat_p384_scalar_uint1 x459;
uint64_t x460;
fiat_p384_scalar_uint1 x461;
uint64_t x462;
fiat_p384_scalar_uint1 x463;
uint64_t x464;
fiat_p384_scalar_uint1 x465;
uint64_t x466;
fiat_p384_scalar_uint1 x467;
uint64_t x468;
uint64_t x469;
uint64_t x470;
uint64_t x471;
uint64_t x472;
uint64_t x473;
x1 = (arg1[1]);
x2 = (arg1[2]);
x3 = (arg1[3]);
x4 = (arg1[4]);
x5 = (arg1[5]);
x6 = (arg1[0]);
fiat_p384_scalar_mulx_u64(&x7, &x8, x6, (arg2[5]));
fiat_p384_scalar_mulx_u64(&x9, &x10, x6, (arg2[4]));
fiat_p384_scalar_mulx_u64(&x11, &x12, x6, (arg2[3]));
fiat_p384_scalar_mulx_u64(&x13, &x14, x6, (arg2[2]));
fiat_p384_scalar_mulx_u64(&x15, &x16, x6, (arg2[1]));
fiat_p384_scalar_mulx_u64(&x17, &x18, x6, (arg2[0]));
fiat_p384_scalar_addcarryx_u64(&x19, &x20, 0x0, x18, x15);
fiat_p384_scalar_addcarryx_u64(&x21, &x22, x20, x16, x13);
fiat_p384_scalar_addcarryx_u64(&x23, &x24, x22, x14, x11);
fiat_p384_scalar_addcarryx_u64(&x25, &x26, x24, x12, x9);
fiat_p384_scalar_addcarryx_u64(&x27, &x28, x26, x10, x7);
x29 = (x28 + x8);
fiat_p384_scalar_mulx_u64(&x30, &x31, x17, UINT64_C(0x6ed46089e88fdc45));
fiat_p384_scalar_mulx_u64(&x32, &x33, x30, UINT64_C(0xffffffffffffffff));
fiat_p384_scalar_mulx_u64(&x34, &x35, x30, UINT64_C(0xffffffffffffffff));
fiat_p384_scalar_mulx_u64(&x36, &x37, x30, UINT64_C(0xffffffffffffffff));
fiat_p384_scalar_mulx_u64(&x38, &x39, x30, UINT64_C(0xc7634d81f4372ddf));
fiat_p384_scalar_mulx_u64(&x40, &x41, x30, UINT64_C(0x581a0db248b0a77a));
fiat_p384_scalar_mulx_u64(&x42, &x43, x30, UINT64_C(0xecec196accc52973));
fiat_p384_scalar_addcarryx_u64(&x44, &x45, 0x0, x43, x40);
fiat_p384_scalar_addcarryx_u64(&x46, &x47, x45, x41, x38);
fiat_p384_scalar_addcarryx_u64(&x48, &x49, x47, x39, x36);
fiat_p384_scalar_addcarryx_u64(&x50, &x51, x49, x37, x34);
fiat_p384_scalar_addcarryx_u64(&x52, &x53, x51, x35, x32);
x54 = (x53 + x33);
fiat_p384_scalar_addcarryx_u64(&x55, &x56, 0x0, x17, x42);
fiat_p384_scalar_addcarryx_u64(&x57, &x58, x56, x19, x44);
fiat_p384_scalar_addcarryx_u64(&x59, &x60, x58, x21, x46);
fiat_p384_scalar_addcarryx_u64(&x61, &x62, x60, x23, x48);
fiat_p384_scalar_addcarryx_u64(&x63, &x64, x62, x25, x50);
fiat_p384_scalar_addcarryx_u64(&x65, &x66, x64, x27, x52);
fiat_p384_scalar_addcarryx_u64(&x67, &x68, x66, x29, x54);
fiat_p384_scalar_mulx_u64(&x69, &x70, x1, (arg2[5]));
fiat_p384_scalar_mulx_u64(&x71, &x72, x1, (arg2[4]));
fiat_p384_scalar_mulx_u64(&x73, &x74, x1, (arg2[3]));
fiat_p384_scalar_mulx_u64(&x75, &x76, x1, (arg2[2]));
fiat_p384_scalar_mulx_u64(&x77, &x78, x1, (arg2[1]));
fiat_p384_scalar_mulx_u64(&x79, &x80, x1, (arg2[0]));
fiat_p384_scalar_addcarryx_u64(&x81, &x82, 0x0, x80, x77);
fiat_p384_scalar_addcarryx_u64(&x83, &x84, x82, x78, x75);
fiat_p384_scalar_addcarryx_u64(&x85, &x86, x84, x76, x73);
fiat_p384_scalar_addcarryx_u64(&x87, &x88, x86, x74, x71);
fiat_p384_scalar_addcarryx_u64(&x89, &x90, x88, x72, x69);
x91 = (x90 + x70);
fiat_p384_scalar_addcarryx_u64(&x92, &x93, 0x0, x57, x79);
fiat_p384_scalar_addcarryx_u64(&x94, &x95, x93, x59, x81);
fiat_p384_scalar_addcarryx_u64(&x96, &x97, x95, x61, x83);
fiat_p384_scalar_addcarryx_u64(&x98, &x99, x97, x63, x85);
fiat_p384_scalar_addcarryx_u64(&x100, &x101, x99, x65, x87);
fiat_p384_scalar_addcarryx_u64(&x102, &x103, x101, x67, x89);
fiat_p384_scalar_addcarryx_u64(&x104, &x105, x103, x68, x91);
fiat_p384_scalar_mulx_u64(&x106, &x107, x92, UINT64_C(0x6ed46089e88fdc45));
fiat_p384_scalar_mulx_u64(&x108, &x109, x106, UINT64_C(0xffffffffffffffff));
fiat_p384_scalar_mulx_u64(&x110, &x111, x106, UINT64_C(0xffffffffffffffff));
fiat_p384_scalar_mulx_u64(&x112, &x113, x106, UINT64_C(0xffffffffffffffff));
fiat_p384_scalar_mulx_u64(&x114, &x115, x106, UINT64_C(0xc7634d81f4372ddf));
fiat_p384_scalar_mulx_u64(&x116, &x117, x106, UINT64_C(0x581a0db248b0a77a));
fiat_p384_scalar_mulx_u64(&x118, &x119, x106, UINT64_C(0xecec196accc52973));
fiat_p384_scalar_addcarryx_u64(&x120, &x121, 0x0, x119, x116);
fiat_p384_scalar_addcarryx_u64(&x122, &x123, x121, x117, x114);
fiat_p384_scalar_addcarryx_u64(&x124, &x125, x123, x115, x112);
fiat_p384_scalar_addcarryx_u64(&x126, &x127, x125, x113, x110);
fiat_p384_scalar_addcarryx_u64(&x128, &x129, x127, x111, x108);
x130 = (x129 + x109);
fiat_p384_scalar_addcarryx_u64(&x131, &x132, 0x0, x92, x118);
fiat_p384_scalar_addcarryx_u64(&x133, &x134, x132, x94, x120);
fiat_p384_scalar_addcarryx_u64(&x135, &x136, x134, x96, x122);
fiat_p384_scalar_addcarryx_u64(&x137, &x138, x136, x98, x124);
fiat_p384_scalar_addcarryx_u64(&x139, &x140, x138, x100, x126);
fiat_p384_scalar_addcarryx_u64(&x141, &x142, x140, x102, x128);
fiat_p384_scalar_addcarryx_u64(&x143, &x144, x142, x104, x130);
x145 = ((uint64_t)x144 + x105);
fiat_p384_scalar_mulx_u64(&x146, &x147, x2, (arg2[5]));
fiat_p384_scalar_mulx_u64(&x148, &x149, x2, (arg2[4]));
fiat_p384_scalar_mulx_u64(&x150, &x151, x2, (arg2[3]));
fiat_p384_scalar_mulx_u64(&x152, &x153, x2, (arg2[2]));
fiat_p384_scalar_mulx_u64(&x154, &x155, x2, (arg2[1]));
fiat_p384_scalar_mulx_u64(&x156, &x157, x2, (arg2[0]));
fiat_p384_scalar_addcarryx_u64(&x158, &x159, 0x0, x157, x154);
fiat_p384_scalar_addcarryx_u64(&x160, &x161, x159, x155, x152);
fiat_p384_scalar_addcarryx_u64(&x162, &x163, x161, x153, x150);
fiat_p384_scalar_addcarryx_u64(&x164, &x165, x163, x151, x148);
fiat_p384_scalar_addcarryx_u64(&x166, &x167, x165, x149, x146);
x168 = (x167 + x147);
fiat_p384_scalar_addcarryx_u64(&x169, &x170, 0x0, x133, x156);
fiat_p384_scalar_addcarryx_u64(&x171, &x172, x170, x135, x158);
fiat_p384_scalar_addcarryx_u64(&x173, &x174, x172, x137, x160);
fiat_p384_scalar_addcarryx_u64(&x175, &x176, x174, x139, x162);
fiat_p384_scalar_addcarryx_u64(&x177, &x178, x176, x141, x164);
fiat_p384_scalar_addcarryx_u64(&x179, &x180, x178, x143, x166);
fiat_p384_scalar_addcarryx_u64(&x181, &x182, x180, x145, x168);
fiat_p384_scalar_mulx_u64(&x183, &x184, x169, UINT64_C(0x6ed46089e88fdc45));
fiat_p384_scalar_mulx_u64(&x185, &x186, x183, UINT64_C(0xffffffffffffffff));
fiat_p384_scalar_mulx_u64(&x187, &x188, x183, UINT64_C(0xffffffffffffffff));
fiat_p384_scalar_mulx_u64(&x189, &x190, x183, UINT64_C(0xffffffffffffffff));
fiat_p384_scalar_mulx_u64(&x191, &x192, x183, UINT64_C(0xc7634d81f4372ddf));
fiat_p384_scalar_mulx_u64(&x193, &x194, x183, UINT64_C(0x581a0db248b0a77a));
fiat_p384_scalar_mulx_u64(&x195, &x196, x183, UINT64_C(0xecec196accc52973));
fiat_p384_scalar_addcarryx_u64(&x197, &x198, 0x0, x196, x193);
fiat_p384_scalar_addcarryx_u64(&x199, &x200, x198, x194, x191);
fiat_p384_scalar_addcarryx_u64(&x201, &x202, x200, x192, x189);
fiat_p384_scalar_addcarryx_u64(&x203, &x204, x202, x190, x187);
fiat_p384_scalar_addcarryx_u64(&x205, &x206, x204, x188, x185);
x207 = (x206 + x186);
fiat_p384_scalar_addcarryx_u64(&x208, &x209, 0x0, x169, x195);
fiat_p384_scalar_addcarryx_u64(&x210, &x211, x209, x171, x197);
fiat_p384_scalar_addcarryx_u64(&x212, &x213, x211, x173, x199);
fiat_p384_scalar_addcarryx_u64(&x214, &x215, x213, x175, x201);
fiat_p384_scalar_addcarryx_u64(&x216, &x217, x215, x177, x203);
fiat_p384_scalar_addcarryx_u64(&x218, &x219, x217, x179, x205);
fiat_p384_scalar_addcarryx_u64(&x220, &x221, x219, x181, x207);
x222 = ((uint64_t)x221 + x182);
fiat_p384_scalar_mulx_u64(&x223, &x224, x3, (arg2[5]));
fiat_p384_scalar_mulx_u64(&x225, &x226, x3, (arg2[4]));
fiat_p384_scalar_mulx_u64(&x227, &x228, x3, (arg2[3]));
fiat_p384_scalar_mulx_u64(&x229, &x230, x3, (arg2[2]));
fiat_p384_scalar_mulx_u64(&x231, &x232, x3, (arg2[1]));
fiat_p384_scalar_mulx_u64(&x233, &x234, x3, (arg2[0]));
fiat_p384_scalar_addcarryx_u64(&x235, &x236, 0x0, x234, x231);
fiat_p384_scalar_addcarryx_u64(&x237, &x238, x236, x232, x229);
fiat_p384_scalar_addcarryx_u64(&x239, &x240, x238, x230, x227);
fiat_p384_scalar_addcarryx_u64(&x241, &x242, x240, x228, x225);
fiat_p384_scalar_addcarryx_u64(&x243, &x244, x242, x226, x223);
x245 = (x244 + x224);
fiat_p384_scalar_addcarryx_u64(&x246, &x247, 0x0, x210, x233);
fiat_p384_scalar_addcarryx_u64(&x248, &x249, x247, x212, x235);
fiat_p384_scalar_addcarryx_u64(&x250, &x251, x249, x214, x237);
fiat_p384_scalar_addcarryx_u64(&x252, &x253, x251, x216, x239);
fiat_p384_scalar_addcarryx_u64(&x254, &x255, x253, x218, x241);
fiat_p384_scalar_addcarryx_u64(&x256, &x257, x255, x220, x243);
fiat_p384_scalar_addcarryx_u64(&x258, &x259, x257, x222, x245);
fiat_p384_scalar_mulx_u64(&x260, &x261, x246, UINT64_C(0x6ed46089e88fdc45));
fiat_p384_scalar_mulx_u64(&x262, &x263, x260, UINT64_C(0xffffffffffffffff));
fiat_p384_scalar_mulx_u64(&x264, &x265, x260, UINT64_C(0xffffffffffffffff));
fiat_p384_scalar_mulx_u64(&x266, &x267, x260, UINT64_C(0xffffffffffffffff));
fiat_p384_scalar_mulx_u64(&x268, &x269, x260, UINT64_C(0xc7634d81f4372ddf));
fiat_p384_scalar_mulx_u64(&x270, &x271, x260, UINT64_C(0x581a0db248b0a77a));
fiat_p384_scalar_mulx_u64(&x272, &x273, x260, UINT64_C(0xecec196accc52973));
fiat_p384_scalar_addcarryx_u64(&x274, &x275, 0x0, x273, x270);
fiat_p384_scalar_addcarryx_u64(&x276, &x277, x275, x271, x268);
fiat_p384_scalar_addcarryx_u64(&x278, &x279, x277, x269, x266);
fiat_p384_scalar_addcarryx_u64(&x280, &x281, x279, x267, x264);
fiat_p384_scalar_addcarryx_u64(&x282, &x283, x281, x265, x262);
x284 = (x283 + x263);
fiat_p384_scalar_addcarryx_u64(&x285, &x286, 0x0, x246, x272);
fiat_p384_scalar_addcarryx_u64(&x287, &x288, x286, x248, x274);
fiat_p384_scalar_addcarryx_u64(&x289, &x290, x288, x250, x276);
fiat_p384_scalar_addcarryx_u64(&x291, &x292, x290, x252, x278);
fiat_p384_scalar_addcarryx_u64(&x293, &x294, x292, x254, x280);
fiat_p384_scalar_addcarryx_u64(&x295, &x296, x294, x256, x282);
fiat_p384_scalar_addcarryx_u64(&x297, &x298, x296, x258, x284);
x299 = ((uint64_t)x298 + x259);
fiat_p384_scalar_mulx_u64(&x300, &x301, x4, (arg2[5]));
fiat_p384_scalar_mulx_u64(&x302, &x303, x4, (arg2[4]));
fiat_p384_scalar_mulx_u64(&x304, &x305, x4, (arg2[3]));
fiat_p384_scalar_mulx_u64(&x306, &x307, x4, (arg2[2]));
fiat_p384_scalar_mulx_u64(&x308, &x309, x4, (arg2[1]));
fiat_p384_scalar_mulx_u64(&x310, &x311, x4, (arg2[0]));
fiat_p384_scalar_addcarryx_u64(&x312, &x313, 0x0, x311, x308);
fiat_p384_scalar_addcarryx_u64(&x314, &x315, x313, x309, x306);
fiat_p384_scalar_addcarryx_u64(&x316, &x317, x315, x307, x304);
fiat_p384_scalar_addcarryx_u64(&x318, &x319, x317, x305, x302);
fiat_p384_scalar_addcarryx_u64(&x320, &x321, x319, x303, x300);
x322 = (x321 + x301);
fiat_p384_scalar_addcarryx_u64(&x323, &x324, 0x0, x287, x310);
fiat_p384_scalar_addcarryx_u64(&x325, &x326, x324, x289, x312);
fiat_p384_scalar_addcarryx_u64(&x327, &x328, x326, x291, x314);
fiat_p384_scalar_addcarryx_u64(&x329, &x330, x328, x293, x316);
fiat_p384_scalar_addcarryx_u64(&x331, &x332, x330, x295, x318);
fiat_p384_scalar_addcarryx_u64(&x333, &x334, x332, x297, x320);
fiat_p384_scalar_addcarryx_u64(&x335, &x336, x334, x299, x322);
fiat_p384_scalar_mulx_u64(&x337, &x338, x323, UINT64_C(0x6ed46089e88fdc45));
fiat_p384_scalar_mulx_u64(&x339, &x340, x337, UINT64_C(0xffffffffffffffff));
fiat_p384_scalar_mulx_u64(&x341, &x342, x337, UINT64_C(0xffffffffffffffff));
fiat_p384_scalar_mulx_u64(&x343, &x344, x337, UINT64_C(0xffffffffffffffff));
fiat_p384_scalar_mulx_u64(&x345, &x346, x337, UINT64_C(0xc7634d81f4372ddf));
fiat_p384_scalar_mulx_u64(&x347, &x348, x337, UINT64_C(0x581a0db248b0a77a));
fiat_p384_scalar_mulx_u64(&x349, &x350, x337, UINT64_C(0xecec196accc52973));
fiat_p384_scalar_addcarryx_u64(&x351, &x352, 0x0, x350, x347);
fiat_p384_scalar_addcarryx_u64(&x353, &x354, x352, x348, x345);
fiat_p384_scalar_addcarryx_u64(&x355, &x356, x354, x346, x343);
fiat_p384_scalar_addcarryx_u64(&x357, &x358, x356, x344, x341);
fiat_p384_scalar_addcarryx_u64(&x359, &x360, x358, x342, x339);
x361 = (x360 + x340);
fiat_p384_scalar_addcarryx_u64(&x362, &x363, 0x0, x323, x349);
fiat_p384_scalar_addcarryx_u64(&x364, &x365, x363, x325, x351);
fiat_p384_scalar_addcarryx_u64(&x366, &x367, x365, x327, x353);
fiat_p384_scalar_addcarryx_u64(&x368, &x369, x367, x329, x355);
fiat_p384_scalar_addcarryx_u64(&x370, &x371, x369, x331, x357);
fiat_p384_scalar_addcarryx_u64(&x372, &x373, x371, x333, x359);
fiat_p384_scalar_addcarryx_u64(&x374, &x375, x373, x335, x361);
x376 = ((uint64_t)x375 + x336);
fiat_p384_scalar_mulx_u64(&x377, &x378, x5, (arg2[5]));
fiat_p384_scalar_mulx_u64(&x379, &x380, x5, (arg2[4]));
fiat_p384_scalar_mulx_u64(&x381, &x382, x5, (arg2[3]));
fiat_p384_scalar_mulx_u64(&x383, &x384, x5, (arg2[2]));
fiat_p384_scalar_mulx_u64(&x385, &x386, x5, (arg2[1]));
fiat_p384_scalar_mulx_u64(&x387, &x388, x5, (arg2[0]));
fiat_p384_scalar_addcarryx_u64(&x389, &x390, 0x0, x388, x385);
fiat_p384_scalar_addcarryx_u64(&x391, &x392, x390, x386, x383);
fiat_p384_scalar_addcarryx_u64(&x393, &x394, x392, x384, x381);
fiat_p384_scalar_addcarryx_u64(&x395, &x396, x394, x382, x379);
fiat_p384_scalar_addcarryx_u64(&x397, &x398, x396, x380, x377);
x399 = (x398 + x378);
fiat_p384_scalar_addcarryx_u64(&x400, &x401, 0x0, x364, x387);
fiat_p384_scalar_addcarryx_u64(&x402, &x403, x401, x366, x389);
fiat_p384_scalar_addcarryx_u64(&x404, &x405, x403, x368, x391);
fiat_p384_scalar_addcarryx_u64(&x406, &x407, x405, x370, x393);
fiat_p384_scalar_addcarryx_u64(&x408, &x409, x407, x372, x395);
fiat_p384_scalar_addcarryx_u64(&x410, &x411, x409, x374, x397);
fiat_p384_scalar_addcarryx_u64(&x412, &x413, x411, x376, x399);
fiat_p384_scalar_mulx_u64(&x414, &x415, x400, UINT64_C(0x6ed46089e88fdc45));
fiat_p384_scalar_mulx_u64(&x416, &x417, x414, UINT64_C(0xffffffffffffffff));
fiat_p384_scalar_mulx_u64(&x418, &x419, x414, UINT64_C(0xffffffffffffffff));
fiat_p384_scalar_mulx_u64(&x420, &x421, x414, UINT64_C(0xffffffffffffffff));
fiat_p384_scalar_mulx_u64(&x422, &x423, x414, UINT64_C(0xc7634d81f4372ddf));
fiat_p384_scalar_mulx_u64(&x424, &x425, x414, UINT64_C(0x581a0db248b0a77a));
fiat_p384_scalar_mulx_u64(&x426, &x427, x414, UINT64_C(0xecec196accc52973));
fiat_p384_scalar_addcarryx_u64(&x428, &x429, 0x0, x427, x424);
fiat_p384_scalar_addcarryx_u64(&x430, &x431, x429, x425, x422);
fiat_p384_scalar_addcarryx_u64(&x432, &x433, x431, x423, x420);
fiat_p384_scalar_addcarryx_u64(&x434, &x435, x433, x421, x418);
fiat_p384_scalar_addcarryx_u64(&x436, &x437, x435, x419, x416);
x438 = (x437 + x417);
fiat_p384_scalar_addcarryx_u64(&x439, &x440, 0x0, x400, x426);
fiat_p384_scalar_addcarryx_u64(&x441, &x442, x440, x402, x428);
fiat_p384_scalar_addcarryx_u64(&x443, &x444, x442, x404, x430);
fiat_p384_scalar_addcarryx_u64(&x445, &x446, x444, x406, x432);
fiat_p384_scalar_addcarryx_u64(&x447, &x448, x446, x408, x434);
fiat_p384_scalar_addcarryx_u64(&x449, &x450, x448, x410, x436);
fiat_p384_scalar_addcarryx_u64(&x451, &x452, x450, x412, x438);
x453 = ((uint64_t)x452 + x413);
fiat_p384_scalar_subborrowx_u64(&x454, &x455, 0x0, x441, UINT64_C(0xecec196accc52973));
fiat_p384_scalar_subborrowx_u64(&x456, &x457, x455, x443, UINT64_C(0x581a0db248b0a77a));
fiat_p384_scalar_subborrowx_u64(&x458, &x459, x457, x445, UINT64_C(0xc7634d81f4372ddf));
fiat_p384_scalar_subborrowx_u64(&x460, &x461, x459, x447, UINT64_C(0xffffffffffffffff));
fiat_p384_scalar_subborrowx_u64(&x462, &x463, x461, x449, UINT64_C(0xffffffffffffffff));
fiat_p384_scalar_subborrowx_u64(&x464, &x465, x463, x451, UINT64_C(0xffffffffffffffff));
fiat_p384_scalar_subborrowx_u64(&x466, &x467, x465, x453, 0x0);
fiat_p384_scalar_cmovznz_u64(&x468, x467, x454, x441);
fiat_p384_scalar_cmovznz_u64(&x469, x467, x456, x443);
fiat_p384_scalar_cmovznz_u64(&x470, x467, x458, x445);
fiat_p384_scalar_cmovznz_u64(&x471, x467, x460, x447);
fiat_p384_scalar_cmovznz_u64(&x472, x467, x462, x449);
fiat_p384_scalar_cmovznz_u64(&x473, x467, x464, x451);
out1[0] = x468;
out1[1] = x469;
out1[2] = x470;
out1[3] = x471;
out1[4] = x472;
out1[5] = x473;
}
/*
* The function fiat_p384_scalar_square squares a field element in the Montgomery domain.
*
* Preconditions:
* 0 ≤ eval arg1 < m
* Postconditions:
* eval (from_montgomery out1) mod m = (eval (from_montgomery arg1) * eval (from_montgomery arg1)) mod m
* 0 ≤ eval out1 < m
*
*/
static FIAT_P384_SCALAR_FIAT_INLINE void fiat_p384_scalar_square(fiat_p384_scalar_montgomery_domain_field_element out1, const fiat_p384_scalar_montgomery_domain_field_element arg1) {
uint64_t x1;
uint64_t x2;
uint64_t x3;
uint64_t x4;
uint64_t x5;
uint64_t x6;
uint64_t x7;
uint64_t x8;
uint64_t x9;
uint64_t x10;
uint64_t x11;
uint64_t x12;
uint64_t x13;
uint64_t x14;
uint64_t x15;
uint64_t x16;
uint64_t x17;
uint64_t x18;
uint64_t x19;
fiat_p384_scalar_uint1 x20;
uint64_t x21;
fiat_p384_scalar_uint1 x22;
uint64_t x23;
fiat_p384_scalar_uint1 x24;
uint64_t x25;
fiat_p384_scalar_uint1 x26;
uint64_t x27;
fiat_p384_scalar_uint1 x28;
uint64_t x29;
uint64_t x30;
uint64_t x31;
uint64_t x32;
uint64_t x33;
uint64_t x34;
uint64_t x35;
uint64_t x36;
uint64_t x37;
uint64_t x38;
uint64_t x39;
uint64_t x40;
uint64_t x41;
uint64_t x42;
uint64_t x43;
uint64_t x44;
fiat_p384_scalar_uint1 x45;
uint64_t x46;
fiat_p384_scalar_uint1 x47;
uint64_t x48;
fiat_p384_scalar_uint1 x49;
uint64_t x50;
fiat_p384_scalar_uint1 x51;
uint64_t x52;
fiat_p384_scalar_uint1 x53;
uint64_t x54;
uint64_t x55;
fiat_p384_scalar_uint1 x56;
uint64_t x57;
fiat_p384_scalar_uint1 x58;
uint64_t x59;
fiat_p384_scalar_uint1 x60;
uint64_t x61;
fiat_p384_scalar_uint1 x62;
uint64_t x63;
fiat_p384_scalar_uint1 x64;
uint64_t x65;
fiat_p384_scalar_uint1 x66;
uint64_t x67;
fiat_p384_scalar_uint1 x68;
uint64_t x69;
uint64_t x70;
uint64_t x71;
uint64_t x72;
uint64_t x73;
uint64_t x74;
uint64_t x75;
uint64_t x76;
uint64_t x77;
uint64_t x78;
uint64_t x79;
uint64_t x80;
uint64_t x81;
fiat_p384_scalar_uint1 x82;
uint64_t x83;
fiat_p384_scalar_uint1 x84;
uint64_t x85;
fiat_p384_scalar_uint1 x86;
uint64_t x87;
fiat_p384_scalar_uint1 x88;
uint64_t x89;
fiat_p384_scalar_uint1 x90;