-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path02598054C74CEC9E.ll
2279 lines (2069 loc) · 117 KB
/
02598054C74CEC9E.ll
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
; ModuleID = '/usr/local/google/home/aeubanks/repos/test-suite/MultiSource/Benchmarks/7zip/C/LzFindMt.c'
source_filename = "/usr/local/google/home/aeubanks/repos/test-suite/MultiSource/Benchmarks/7zip/C/LzFindMt.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
%struct._CMtSync = type { i32, i32, i32, i32, %struct._CThread, %struct._CEvent, %struct._CEvent, %struct._CEvent, %struct._CSemaphore, %struct._CSemaphore, i32, i32, %struct.CCriticalSection, i32 }
%struct._CThread = type { i64, i32 }
%struct._CEvent = type { i32, i32, i32, %union.pthread_mutex_t, %union.pthread_cond_t }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%union.pthread_cond_t = type { %struct.__pthread_cond_s }
%struct.__pthread_cond_s = type { %union.__atomic_wide_counter, %union.__atomic_wide_counter, [2 x i32], [2 x i32], i32, i32, [2 x i32] }
%union.__atomic_wide_counter = type { i64 }
%struct._CSemaphore = type { i32, i32, i32, %union.pthread_mutex_t, %union.pthread_cond_t }
%struct.CCriticalSection = type { %union.pthread_mutex_t }
%struct._CMatchFinderMt = type { ptr, ptr, i32, i32, i32, i32, ptr, i32, i32, ptr, ptr, %struct._CMtSync, [128 x i8], ptr, i32, i32, i32, ptr, i32, i32, i32, ptr, i32, i32, i32, %struct._CMtSync, ptr, ptr }
%struct._CMatchFinder = type { ptr, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, i32, i32, ptr, ptr, i32, i32, i32, i32, i32, i32, i64, i32, i32, i32, i32, i32, i32, i32, [256 x i32] }
%struct.ISzAlloc = type { ptr, ptr }
%struct._IMatchFinder = type { ptr, ptr, ptr, ptr, ptr, ptr }
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) uwtable
define dso_local void @MtSync_Construct(ptr nocapture noundef writeonly %p) local_unnamed_addr #0 {
entry:
store i32 0, ptr %p, align 8, !tbaa !5
%csWasInitialized = getelementptr inbounds %struct._CMtSync, ptr %p, i64 0, i32 10
store i32 0, ptr %csWasInitialized, align 8, !tbaa !15
%csWasEntered = getelementptr inbounds %struct._CMtSync, ptr %p, i64 0, i32 11
store i32 0, ptr %csWasEntered, align 4, !tbaa !16
%_created = getelementptr inbounds %struct._CMtSync, ptr %p, i64 0, i32 4, i32 1
store i32 0, ptr %_created, align 8, !tbaa !17
%canStart = getelementptr inbounds %struct._CMtSync, ptr %p, i64 0, i32 5
store i32 0, ptr %canStart, align 8, !tbaa !18
%wasStarted = getelementptr inbounds %struct._CMtSync, ptr %p, i64 0, i32 6
store i32 0, ptr %wasStarted, align 8, !tbaa !19
%wasStopped = getelementptr inbounds %struct._CMtSync, ptr %p, i64 0, i32 7
store i32 0, ptr %wasStopped, align 8, !tbaa !20
%freeSemaphore = getelementptr inbounds %struct._CMtSync, ptr %p, i64 0, i32 8
store i32 0, ptr %freeSemaphore, align 8, !tbaa !21
%filledSemaphore = getelementptr inbounds %struct._CMtSync, ptr %p, i64 0, i32 9
store i32 0, ptr %filledSemaphore, align 8, !tbaa !22
ret void
}
; Function Attrs: nounwind uwtable
define dso_local void @MtSync_GetNextBlock(ptr noundef %p) local_unnamed_addr #1 {
entry:
%needStart = getelementptr inbounds %struct._CMtSync, ptr %p, i64 0, i32 1
%0 = load i32, ptr %needStart, align 4, !tbaa !23
%tobool.not = icmp eq i32 %0, 0
br i1 %tobool.not, label %if.else, label %if.then
if.then: ; preds = %entry
%numProcessedBlocks = getelementptr inbounds %struct._CMtSync, ptr %p, i64 0, i32 13
store i32 1, ptr %numProcessedBlocks, align 8, !tbaa !24
store i32 0, ptr %needStart, align 4, !tbaa !23
%stopWriting = getelementptr inbounds %struct._CMtSync, ptr %p, i64 0, i32 3
store i32 0, ptr %stopWriting, align 4, !tbaa !25
%exit = getelementptr inbounds %struct._CMtSync, ptr %p, i64 0, i32 2
store i32 0, ptr %exit, align 8, !tbaa !26
%wasStarted = getelementptr inbounds %struct._CMtSync, ptr %p, i64 0, i32 6
%call = tail call i32 @Event_Reset(ptr noundef nonnull %wasStarted) #10
%wasStopped = getelementptr inbounds %struct._CMtSync, ptr %p, i64 0, i32 7
%call2 = tail call i32 @Event_Reset(ptr noundef nonnull %wasStopped) #10
%canStart = getelementptr inbounds %struct._CMtSync, ptr %p, i64 0, i32 5
%call3 = tail call i32 @Event_Set(ptr noundef nonnull %canStart) #10
%call5 = tail call i32 @Event_Wait(ptr noundef nonnull %wasStarted) #10
br label %if.end
if.else: ; preds = %entry
%cs = getelementptr inbounds %struct._CMtSync, ptr %p, i64 0, i32 12
%call6 = tail call i32 @pthread_mutex_unlock(ptr noundef nonnull %cs) #10
%csWasEntered = getelementptr inbounds %struct._CMtSync, ptr %p, i64 0, i32 11
store i32 0, ptr %csWasEntered, align 4, !tbaa !16
%numProcessedBlocks7 = getelementptr inbounds %struct._CMtSync, ptr %p, i64 0, i32 13
%1 = load i32, ptr %numProcessedBlocks7, align 8, !tbaa !24
%inc = add i32 %1, 1
store i32 %inc, ptr %numProcessedBlocks7, align 8, !tbaa !24
%freeSemaphore = getelementptr inbounds %struct._CMtSync, ptr %p, i64 0, i32 8
%call8 = tail call i32 @Semaphore_ReleaseN(ptr noundef nonnull %freeSemaphore, i32 noundef 1) #10
br label %if.end
if.end: ; preds = %if.else, %if.then
%filledSemaphore = getelementptr inbounds %struct._CMtSync, ptr %p, i64 0, i32 9
%call9 = tail call i32 @Semaphore_Wait(ptr noundef nonnull %filledSemaphore) #10
%cs10 = getelementptr inbounds %struct._CMtSync, ptr %p, i64 0, i32 12
%call12 = tail call i32 @pthread_mutex_lock(ptr noundef nonnull %cs10) #10
%csWasEntered13 = getelementptr inbounds %struct._CMtSync, ptr %p, i64 0, i32 11
store i32 1, ptr %csWasEntered13, align 4, !tbaa !16
ret void
}
declare i32 @Event_Reset(ptr noundef) local_unnamed_addr #2
declare i32 @Event_Set(ptr noundef) local_unnamed_addr #2
declare i32 @Event_Wait(ptr noundef) local_unnamed_addr #2
; Function Attrs: nounwind
declare i32 @pthread_mutex_unlock(ptr noundef) local_unnamed_addr #3
declare i32 @Semaphore_ReleaseN(ptr noundef, i32 noundef) local_unnamed_addr #2
declare i32 @Semaphore_Wait(ptr noundef) local_unnamed_addr #2
; Function Attrs: nounwind
declare i32 @pthread_mutex_lock(ptr noundef) local_unnamed_addr #3
; Function Attrs: nounwind uwtable
define dso_local void @MtSync_StopWriting(ptr noundef %p) local_unnamed_addr #1 {
entry:
%numProcessedBlocks = getelementptr inbounds %struct._CMtSync, ptr %p, i64 0, i32 13
%0 = load i32, ptr %numProcessedBlocks, align 8, !tbaa !24
%_created = getelementptr inbounds %struct._CMtSync, ptr %p, i64 0, i32 4, i32 1
%1 = load i32, ptr %_created, align 8, !tbaa !17
%cmp.not = icmp eq i32 %1, 0
br i1 %cmp.not, label %cleanup, label %lor.lhs.false
lor.lhs.false: ; preds = %entry
%needStart = getelementptr inbounds %struct._CMtSync, ptr %p, i64 0, i32 1
%2 = load i32, ptr %needStart, align 4, !tbaa !23
%tobool.not = icmp eq i32 %2, 0
br i1 %tobool.not, label %if.end, label %cleanup
if.end: ; preds = %lor.lhs.false
%stopWriting = getelementptr inbounds %struct._CMtSync, ptr %p, i64 0, i32 3
store i32 1, ptr %stopWriting, align 4, !tbaa !25
%csWasEntered = getelementptr inbounds %struct._CMtSync, ptr %p, i64 0, i32 11
%3 = load i32, ptr %csWasEntered, align 4, !tbaa !16
%tobool1.not = icmp eq i32 %3, 0
br i1 %tobool1.not, label %if.end4, label %if.then2
if.then2: ; preds = %if.end
%cs = getelementptr inbounds %struct._CMtSync, ptr %p, i64 0, i32 12
%call = tail call i32 @pthread_mutex_unlock(ptr noundef nonnull %cs) #10
store i32 0, ptr %csWasEntered, align 4, !tbaa !16
br label %if.end4
if.end4: ; preds = %if.then2, %if.end
%freeSemaphore = getelementptr inbounds %struct._CMtSync, ptr %p, i64 0, i32 8
%call5 = tail call i32 @Semaphore_ReleaseN(ptr noundef nonnull %freeSemaphore, i32 noundef 1) #10
%wasStopped = getelementptr inbounds %struct._CMtSync, ptr %p, i64 0, i32 7
%call6 = tail call i32 @Event_Wait(ptr noundef nonnull %wasStopped) #10
%4 = load i32, ptr %numProcessedBlocks, align 8, !tbaa !24
%cmp8.not25 = icmp eq i32 %0, %4
br i1 %cmp8.not25, label %while.end, label %while.body.lr.ph
while.body.lr.ph: ; preds = %if.end4
%filledSemaphore = getelementptr inbounds %struct._CMtSync, ptr %p, i64 0, i32 9
br label %while.body
while.body: ; preds = %while.body.lr.ph, %while.body
%myNumBlocks.026 = phi i32 [ %0, %while.body.lr.ph ], [ %inc, %while.body ]
%inc = add i32 %myNumBlocks.026, 1
%call9 = tail call i32 @Semaphore_Wait(ptr noundef nonnull %filledSemaphore) #10
%call11 = tail call i32 @Semaphore_ReleaseN(ptr noundef nonnull %freeSemaphore, i32 noundef 1) #10
%5 = load i32, ptr %numProcessedBlocks, align 8, !tbaa !24
%cmp8.not = icmp eq i32 %inc, %5
br i1 %cmp8.not, label %while.end, label %while.body, !llvm.loop !27
while.end: ; preds = %while.body, %if.end4
store i32 1, ptr %needStart, align 4, !tbaa !23
br label %cleanup
cleanup: ; preds = %entry, %lor.lhs.false, %while.end
ret void
}
; Function Attrs: nounwind uwtable
define dso_local void @MtSync_Destruct(ptr noundef %p) local_unnamed_addr #1 {
entry:
%thread = getelementptr inbounds %struct._CMtSync, ptr %p, i64 0, i32 4
%_created = getelementptr inbounds %struct._CMtSync, ptr %p, i64 0, i32 4, i32 1
%0 = load i32, ptr %_created, align 8, !tbaa !17
%cmp.not = icmp eq i32 %0, 0
br i1 %cmp.not, label %if.end6, label %if.then
if.then: ; preds = %entry
tail call void @MtSync_StopWriting(ptr noundef nonnull %p)
%exit = getelementptr inbounds %struct._CMtSync, ptr %p, i64 0, i32 2
store i32 1, ptr %exit, align 8, !tbaa !26
%needStart = getelementptr inbounds %struct._CMtSync, ptr %p, i64 0, i32 1
%1 = load i32, ptr %needStart, align 4, !tbaa !23
%tobool.not = icmp eq i32 %1, 0
br i1 %tobool.not, label %if.end, label %if.then1
if.then1: ; preds = %if.then
%canStart = getelementptr inbounds %struct._CMtSync, ptr %p, i64 0, i32 5
%call = tail call i32 @Event_Set(ptr noundef nonnull %canStart) #10
br label %if.end
if.end: ; preds = %if.then1, %if.then
%call3 = tail call i32 @Thread_Wait(ptr noundef nonnull %thread) #10
%call5 = tail call i32 @Thread_Close(ptr noundef nonnull %thread) #10
br label %if.end6
if.end6: ; preds = %if.end, %entry
%csWasInitialized = getelementptr inbounds %struct._CMtSync, ptr %p, i64 0, i32 10
%2 = load i32, ptr %csWasInitialized, align 8, !tbaa !15
%tobool7.not = icmp eq i32 %2, 0
br i1 %tobool7.not, label %if.end11, label %if.then8
if.then8: ; preds = %if.end6
%cs = getelementptr inbounds %struct._CMtSync, ptr %p, i64 0, i32 12
%call9 = tail call i32 @pthread_mutex_destroy(ptr noundef nonnull %cs) #10
store i32 0, ptr %csWasInitialized, align 8, !tbaa !15
br label %if.end11
if.end11: ; preds = %if.then8, %if.end6
%canStart12 = getelementptr inbounds %struct._CMtSync, ptr %p, i64 0, i32 5
%call13 = tail call i32 @Event_Close(ptr noundef nonnull %canStart12) #10
%wasStarted = getelementptr inbounds %struct._CMtSync, ptr %p, i64 0, i32 6
%call14 = tail call i32 @Event_Close(ptr noundef nonnull %wasStarted) #10
%wasStopped = getelementptr inbounds %struct._CMtSync, ptr %p, i64 0, i32 7
%call15 = tail call i32 @Event_Close(ptr noundef nonnull %wasStopped) #10
%freeSemaphore = getelementptr inbounds %struct._CMtSync, ptr %p, i64 0, i32 8
%call16 = tail call i32 @Semaphore_Close(ptr noundef nonnull %freeSemaphore) #10
%filledSemaphore = getelementptr inbounds %struct._CMtSync, ptr %p, i64 0, i32 9
%call17 = tail call i32 @Semaphore_Close(ptr noundef nonnull %filledSemaphore) #10
store i32 0, ptr %p, align 8, !tbaa !5
ret void
}
declare i32 @Thread_Wait(ptr noundef) local_unnamed_addr #2
declare i32 @Thread_Close(ptr noundef) local_unnamed_addr #2
; Function Attrs: nounwind
declare i32 @pthread_mutex_destroy(ptr noundef) local_unnamed_addr #3
declare i32 @Event_Close(ptr noundef) local_unnamed_addr #2
declare i32 @Semaphore_Close(ptr noundef) local_unnamed_addr #2
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) uwtable
define dso_local void @MtSync_Init(ptr nocapture noundef writeonly %p) local_unnamed_addr #0 {
entry:
%needStart = getelementptr inbounds %struct._CMtSync, ptr %p, i64 0, i32 1
store i32 1, ptr %needStart, align 4, !tbaa !23
ret void
}
; Function Attrs: nounwind uwtable
define dso_local void @HashThreadFunc(ptr noundef %mt) local_unnamed_addr #1 {
entry:
%canStart = getelementptr inbounds %struct._CMatchFinderMt, ptr %mt, i64 0, i32 25, i32 5
%call135 = tail call i32 @Event_Wait(ptr noundef nonnull %canStart) #10
%wasStarted = getelementptr inbounds %struct._CMatchFinderMt, ptr %mt, i64 0, i32 25, i32 6
%call1136 = tail call i32 @Event_Set(ptr noundef nonnull %wasStarted) #10
%exit = getelementptr inbounds %struct._CMatchFinderMt, ptr %mt, i64 0, i32 25, i32 2
%0 = load i32, ptr %exit, align 8, !tbaa !26
%tobool.not132133137 = icmp eq i32 %0, 0
br i1 %tobool.not132133137, label %if.end.lr.ph.lr.ph.lr.ph, label %cleanup71
if.end.lr.ph.lr.ph.lr.ph: ; preds = %entry
%stopWriting = getelementptr inbounds %struct._CMatchFinderMt, ptr %mt, i64 0, i32 25, i32 3
%MatchFinder = getelementptr inbounds %struct._CMatchFinderMt, ptr %mt, i64 0, i32 27
%cs = getelementptr inbounds %struct._CMatchFinderMt, ptr %mt, i64 0, i32 11, i32 12
%cs13 = getelementptr inbounds %struct._CMatchFinderMt, ptr %mt, i64 0, i32 25, i32 12
%buffer = getelementptr inbounds %struct._CMatchFinderMt, ptr %mt, i64 0, i32 21
%freeSemaphore = getelementptr inbounds %struct._CMatchFinderMt, ptr %mt, i64 0, i32 25, i32 8
%hashBuf = getelementptr inbounds %struct._CMatchFinderMt, ptr %mt, i64 0, i32 13
%GetHeadsFunc = getelementptr inbounds %struct._CMatchFinderMt, ptr %mt, i64 0, i32 26
%filledSemaphore = getelementptr inbounds %struct._CMatchFinderMt, ptr %mt, i64 0, i32 25, i32 9
%numProcessedBlocks5 = getelementptr inbounds %struct._CMatchFinderMt, ptr %mt, i64 0, i32 25, i32 13
%wasStopped = getelementptr inbounds %struct._CMatchFinderMt, ptr %mt, i64 0, i32 25, i32 7
br label %if.end.lr.ph
if.end.lr.ph: ; preds = %if.end.lr.ph.backedge, %if.end.lr.ph.lr.ph.lr.ph
%numProcessedBlocks.0.ph134 = phi i32 [ 0, %if.end.lr.ph.lr.ph.lr.ph ], [ %numProcessedBlocks.0.ph134.be, %if.end.lr.ph.backedge ]
br label %if.end
if.end: ; preds = %if.end.lr.ph, %cleanup
%1 = load i32, ptr %stopWriting, align 4, !tbaa !25
%tobool3.not = icmp eq i32 %1, 0
br i1 %tobool3.not, label %if.end7, label %if.then4
if.then4: ; preds = %if.end
store i32 %numProcessedBlocks.0.ph134, ptr %numProcessedBlocks5, align 8, !tbaa !24
%call6 = tail call i32 @Event_Set(ptr noundef nonnull %wasStopped) #10
%call = tail call i32 @Event_Wait(ptr noundef nonnull %canStart) #10
%call1 = tail call i32 @Event_Set(ptr noundef nonnull %wasStarted) #10
%2 = load i32, ptr %exit, align 8, !tbaa !26
%tobool.not132133 = icmp eq i32 %2, 0
br i1 %tobool.not132133, label %if.end.lr.ph.backedge, label %cleanup71
if.end7: ; preds = %if.end
%3 = load ptr, ptr %MatchFinder, align 8, !tbaa !29
%call8 = tail call i32 @MatchFinder_NeedMove(ptr noundef %3) #10
%tobool9.not = icmp eq i32 %call8, 0
br i1 %tobool9.not, label %if.end31, label %cleanup
if.end31: ; preds = %if.end7
%call32 = tail call i32 @Semaphore_Wait(ptr noundef nonnull %freeSemaphore) #10
tail call void @MatchFinder_ReadIfRequired(ptr noundef %3) #10
%pos = getelementptr inbounds %struct._CMatchFinder, ptr %3, i64 0, i32 1
%4 = load i32, ptr %pos, align 8, !tbaa !32
%cmp = icmp ugt i32 %4, -8193
br i1 %cmp, label %if.then33, label %if.end37
if.then33: ; preds = %if.end31
%historySize = getelementptr inbounds %struct._CMatchFinder, ptr %3, i64 0, i32 23
%5 = load i32, ptr %historySize, align 8, !tbaa !34
%6 = xor i32 %5, -1
%sub35 = add i32 %4, %6
tail call void @MatchFinder_ReduceOffsets(ptr noundef nonnull %3, i32 noundef %sub35) #10
%hash = getelementptr inbounds %struct._CMatchFinder, ptr %3, i64 0, i32 8
%7 = load ptr, ptr %hash, align 8, !tbaa !35
%fixedHashSize = getelementptr inbounds %struct._CMatchFinder, ptr %3, i64 0, i32 24
%8 = load i32, ptr %fixedHashSize, align 4, !tbaa !36
%idx.ext = zext i32 %8 to i64
%add.ptr36 = getelementptr inbounds i32, ptr %7, i64 %idx.ext
%hashMask = getelementptr inbounds %struct._CMatchFinder, ptr %3, i64 0, i32 10
%9 = load i32, ptr %hashMask, align 8, !tbaa !37
%add = add i32 %9, 1
tail call void @MatchFinder_Normalize3(i32 noundef %sub35, ptr noundef %add.ptr36, i32 noundef %add) #10
%.pre = load i32, ptr %pos, align 8, !tbaa !32
br label %if.end37
if.end37: ; preds = %if.then33, %if.end31
%10 = phi i32 [ %.pre, %if.then33 ], [ %4, %if.end31 ]
%11 = load ptr, ptr %hashBuf, align 8, !tbaa !38
%inc = add i32 %numProcessedBlocks.0.ph134, 1
%and = shl i32 %numProcessedBlocks.0.ph134, 13
%mul = and i32 %and, 57344
%idx.ext38 = zext i32 %mul to i64
%add.ptr39 = getelementptr inbounds i32, ptr %11, i64 %idx.ext38
%streamPos = getelementptr inbounds %struct._CMatchFinder, ptr %3, i64 0, i32 3
%12 = load i32, ptr %streamPos, align 8, !tbaa !39
%sub41 = sub i32 %12, %10
store i32 2, ptr %add.ptr39, align 4, !tbaa !40
%arrayidx42 = getelementptr inbounds i32, ptr %add.ptr39, i64 1
store i32 %sub41, ptr %arrayidx42, align 4, !tbaa !40
%numHashBytes = getelementptr inbounds %struct._CMatchFinder, ptr %3, i64 0, i32 18
%13 = load i32, ptr %numHashBytes, align 8, !tbaa !41
%cmp43.not = icmp ult i32 %sub41, %13
br i1 %cmp43.not, label %cleanup.cont, label %if.then44
if.then44: ; preds = %if.end37
%sub46 = add i32 %sub41, 1
%add47 = sub i32 %sub46, %13
%spec.store.select = tail call i32 @llvm.umin.i32(i32 %add47, i32 8190)
%14 = load ptr, ptr %GetHeadsFunc, align 8, !tbaa !42
%15 = load ptr, ptr %3, align 8, !tbaa !43
%16 = load i32, ptr %pos, align 8, !tbaa !32
%hash53 = getelementptr inbounds %struct._CMatchFinder, ptr %3, i64 0, i32 8
%17 = load ptr, ptr %hash53, align 8, !tbaa !35
%fixedHashSize54 = getelementptr inbounds %struct._CMatchFinder, ptr %3, i64 0, i32 24
%18 = load i32, ptr %fixedHashSize54, align 4, !tbaa !36
%idx.ext55 = zext i32 %18 to i64
%add.ptr56 = getelementptr inbounds i32, ptr %17, i64 %idx.ext55
%hashMask57 = getelementptr inbounds %struct._CMatchFinder, ptr %3, i64 0, i32 10
%19 = load i32, ptr %hashMask57, align 8, !tbaa !37
%add.ptr58 = getelementptr inbounds i32, ptr %add.ptr39, i64 2
%crc = getelementptr inbounds %struct._CMatchFinder, ptr %3, i64 0, i32 28
tail call void %14(ptr noundef %15, i32 noundef %16, ptr noundef %add.ptr56, i32 noundef %19, ptr noundef nonnull %add.ptr58, i32 noundef %spec.store.select, ptr noundef nonnull %crc) #10
%20 = load i32, ptr %add.ptr39, align 4, !tbaa !40
%add60 = add i32 %20, %spec.store.select
store i32 %add60, ptr %add.ptr39, align 4, !tbaa !40
br label %cleanup.cont
cleanup: ; preds = %if.end7
%call11 = tail call i32 @pthread_mutex_lock(ptr noundef nonnull %cs) #10
%call15 = tail call i32 @pthread_mutex_lock(ptr noundef nonnull %cs13) #10
%call16 = tail call ptr @MatchFinder_GetPointerToCurrentPos(ptr noundef %3) #10
tail call void @MatchFinder_MoveBlock(ptr noundef %3) #10
%call17 = tail call ptr @MatchFinder_GetPointerToCurrentPos(ptr noundef %3) #10
%sub.ptr.lhs.cast = ptrtoint ptr %call16 to i64
%sub.ptr.rhs.cast = ptrtoint ptr %call17 to i64
%sub.ptr.sub.neg = sub i64 %sub.ptr.rhs.cast, %sub.ptr.lhs.cast
%21 = load ptr, ptr %mt, align 8, !tbaa !44
%add.ptr = getelementptr inbounds i8, ptr %21, i64 %sub.ptr.sub.neg
store ptr %add.ptr, ptr %mt, align 8, !tbaa !44
%22 = load ptr, ptr %buffer, align 8, !tbaa !45
%add.ptr22 = getelementptr inbounds i8, ptr %22, i64 %sub.ptr.sub.neg
store ptr %add.ptr22, ptr %buffer, align 8, !tbaa !45
%call26 = tail call i32 @pthread_mutex_unlock(ptr noundef nonnull %cs) #10
%call30 = tail call i32 @pthread_mutex_unlock(ptr noundef nonnull %cs13) #10
%23 = load i32, ptr %exit, align 8, !tbaa !26
%tobool.not = icmp eq i32 %23, 0
br i1 %tobool.not, label %if.end, label %cleanup71
cleanup.cont: ; preds = %if.end37, %if.then44
%num.0 = phi i32 [ %spec.store.select, %if.then44 ], [ %sub41, %if.end37 ]
%24 = load i32, ptr %pos, align 8, !tbaa !32
%add63 = add i32 %24, %num.0
store i32 %add63, ptr %pos, align 8, !tbaa !32
%25 = load ptr, ptr %3, align 8, !tbaa !43
%idx.ext65 = zext i32 %num.0 to i64
%add.ptr66 = getelementptr inbounds i8, ptr %25, i64 %idx.ext65
store ptr %add.ptr66, ptr %3, align 8, !tbaa !43
%call67 = tail call i32 @Semaphore_ReleaseN(ptr noundef nonnull %filledSemaphore, i32 noundef 1) #10
%26 = load i32, ptr %exit, align 8, !tbaa !26
%tobool.not132 = icmp eq i32 %26, 0
br i1 %tobool.not132, label %if.end.lr.ph.backedge, label %cleanup71
if.end.lr.ph.backedge: ; preds = %cleanup.cont, %if.then4
%numProcessedBlocks.0.ph134.be = phi i32 [ %inc, %cleanup.cont ], [ 0, %if.then4 ]
br label %if.end.lr.ph
cleanup71: ; preds = %if.then4, %cleanup.cont, %cleanup, %entry
ret void
}
declare i32 @MatchFinder_NeedMove(ptr noundef) local_unnamed_addr #2
declare ptr @MatchFinder_GetPointerToCurrentPos(ptr noundef) local_unnamed_addr #2
declare void @MatchFinder_MoveBlock(ptr noundef) local_unnamed_addr #2
declare void @MatchFinder_ReadIfRequired(ptr noundef) local_unnamed_addr #2
declare void @MatchFinder_ReduceOffsets(ptr noundef, i32 noundef) local_unnamed_addr #2
declare void @MatchFinder_Normalize3(i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #2
; Function Attrs: nounwind uwtable
define dso_local void @MatchFinderMt_GetNextBlock_Hash(ptr noundef %p) local_unnamed_addr #1 {
entry:
%hashSync = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 25
tail call void @MtSync_GetNextBlock(ptr noundef nonnull %hashSync)
%numProcessedBlocks = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 25, i32 13
%0 = load i32, ptr %numProcessedBlocks, align 8, !tbaa !46
%sub = shl i32 %0, 13
%and = add i32 %sub, 57344
%mul = and i32 %and, 57344
%hashBufPos = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 14
%hashBufPosLimit = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 15
store i32 %mul, ptr %hashBufPosLimit, align 4, !tbaa !47
%hashBuf = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 13
%1 = load ptr, ptr %hashBuf, align 8, !tbaa !38
%inc = or i32 %mul, 1
store i32 %inc, ptr %hashBufPos, align 8, !tbaa !48
%idxprom = zext i32 %mul to i64
%arrayidx = getelementptr inbounds i32, ptr %1, i64 %idxprom
%2 = load i32, ptr %arrayidx, align 4, !tbaa !40
%add = add i32 %2, %mul
store i32 %add, ptr %hashBufPosLimit, align 4, !tbaa !47
%inc6 = or i32 %mul, 2
store i32 %inc6, ptr %hashBufPos, align 8, !tbaa !48
%idxprom7 = zext i32 %inc to i64
%arrayidx8 = getelementptr inbounds i32, ptr %1, i64 %idxprom7
%3 = load i32, ptr %arrayidx8, align 4, !tbaa !40
%hashNumAvail = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 16
store i32 %3, ptr %hashNumAvail, align 8, !tbaa !49
ret void
}
; Function Attrs: nounwind uwtable
define dso_local void @BtGetMatches(ptr noundef %p, ptr noundef %distances) local_unnamed_addr #1 {
entry:
%matchMaxLen = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 18
%0 = load i32, ptr %matchMaxLen, align 8, !tbaa !50
%mul = shl i32 %0, 1
%sub = sub i32 16384, %mul
%hashNumAvail = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 16
%1 = load i32, ptr %hashNumAvail, align 8, !tbaa !49
%arrayidx = getelementptr inbounds i32, ptr %distances, i64 1
store i32 %1, ptr %arrayidx, align 4, !tbaa !40
%hashBufPos = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 14
%hashBufPosLimit = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 15
%hashSync.i = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 25
%numProcessedBlocks.i = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 25, i32 13
%hashBuf.i = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 13
%numHashBytes = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 19
%cmp149 = icmp ugt i32 %sub, 2
br i1 %cmp149, label %while.cond.outer.split.lr.ph, label %while.end66
while.cond.outer.split.lr.ph: ; preds = %entry
%pos16 = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 20
%cyclicBufferPos17 = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 22
%cyclicBufferSize = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 23
%buffer = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 21
%son = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 17
%cutValue = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 24
br label %while.cond.outer.split
while.cond.outer.split: ; preds = %while.cond.outer.split.lr.ph, %while.end
%numProcessed.0.ph151 = phi i32 [ 0, %while.cond.outer.split.lr.ph ], [ %add54, %while.end ]
%curPos.0.ph150 = phi i32 [ 2, %while.cond.outer.split.lr.ph ], [ %curPos.2.lcssa, %while.end ]
br label %while.cond
while.cond: ; preds = %while.cond.outer.split, %if.then
%2 = load i32, ptr %hashBufPos, align 8, !tbaa !48
%3 = load i32, ptr %hashBufPosLimit, align 4, !tbaa !47
%cmp1 = icmp eq i32 %3, %2
br i1 %cmp1, label %if.then, label %if.end11
if.then: ; preds = %while.cond
tail call void @MtSync_GetNextBlock(ptr noundef nonnull %hashSync.i)
%4 = load i32, ptr %numProcessedBlocks.i, align 8, !tbaa !46
%sub.i = shl i32 %4, 13
%and.i = add i32 %sub.i, 57344
%mul.i = and i32 %and.i, 57344
store i32 %mul.i, ptr %hashBufPosLimit, align 4, !tbaa !47
%5 = load ptr, ptr %hashBuf.i, align 8, !tbaa !38
%inc.i = or i32 %mul.i, 1
store i32 %inc.i, ptr %hashBufPos, align 8, !tbaa !48
%idxprom.i = zext i32 %mul.i to i64
%arrayidx.i = getelementptr inbounds i32, ptr %5, i64 %idxprom.i
%6 = load i32, ptr %arrayidx.i, align 4, !tbaa !40
%add.i = add i32 %6, %mul.i
store i32 %add.i, ptr %hashBufPosLimit, align 4, !tbaa !47
%inc6.i = or i32 %mul.i, 2
store i32 %inc6.i, ptr %hashBufPos, align 8, !tbaa !48
%idxprom7.i = zext i32 %inc.i to i64
%arrayidx8.i = getelementptr inbounds i32, ptr %5, i64 %idxprom7.i
%7 = load i32, ptr %arrayidx8.i, align 4, !tbaa !40
store i32 %7, ptr %hashNumAvail, align 8, !tbaa !49
%add = add i32 %7, %numProcessed.0.ph151
store i32 %add, ptr %arrayidx, align 4, !tbaa !40
%8 = load i32, ptr %hashNumAvail, align 8, !tbaa !49
%9 = load i32, ptr %numHashBytes, align 4, !tbaa !51
%cmp5.not = icmp ult i32 %8, %9
br i1 %cmp5.not, label %for.cond.preheader, label %while.cond, !llvm.loop !52
for.cond.preheader: ; preds = %if.then
%cmp8.not153 = icmp eq i32 %8, 0
br i1 %cmp8.not153, label %while.end66, label %for.body
for.body: ; preds = %for.cond.preheader, %for.body
%curPos.1154 = phi i32 [ %inc, %for.body ], [ %curPos.0.ph150, %for.cond.preheader ]
%inc = add i32 %curPos.1154, 1
%idxprom = zext i32 %curPos.1154 to i64
%arrayidx9 = getelementptr inbounds i32, ptr %distances, i64 %idxprom
store i32 0, ptr %arrayidx9, align 4, !tbaa !40
%10 = load i32, ptr %hashNumAvail, align 8, !tbaa !49
%dec = add i32 %10, -1
store i32 %dec, ptr %hashNumAvail, align 8, !tbaa !49
%cmp8.not = icmp eq i32 %dec, 0
br i1 %cmp8.not, label %while.end66, label %for.body, !llvm.loop !53
if.end11: ; preds = %while.cond
%sub14 = sub i32 %3, %2
%11 = load i32, ptr %matchMaxLen, align 8, !tbaa !50
%12 = load i32, ptr %pos16, align 8, !tbaa !54
%13 = load i32, ptr %cyclicBufferPos17, align 8, !tbaa !55
%14 = load i32, ptr %hashNumAvail, align 8, !tbaa !49
%spec.select = tail call i32 @llvm.umin.i32(i32 %11, i32 %14)
%sub24 = sub i32 %14, %spec.select
%add25 = add i32 %sub24, 1
%size.0 = tail call i32 @llvm.umin.i32(i32 %add25, i32 %sub14)
%15 = load i32, ptr %cyclicBufferSize, align 4, !tbaa !56
%sub29 = sub i32 %15, %13
%size.1 = tail call i32 @llvm.umin.i32(i32 %sub29, i32 %size.0)
%cmp34140 = icmp uge i32 %curPos.0.ph150, %sub
%cmp36.not141 = icmp eq i32 %size.1, 0
%or.cond142 = select i1 %cmp34140, i1 true, i1 %cmp36.not141
br i1 %or.cond142, label %while.end, label %while.body37.preheader
while.body37.preheader: ; preds = %if.end11
%.pre = load ptr, ptr %buffer, align 8, !tbaa !45
br label %while.body37
while.body37: ; preds = %while.body37.preheader, %while.body37
%16 = phi ptr [ %incdec.ptr, %while.body37 ], [ %.pre, %while.body37.preheader ]
%curPos.2146 = phi i32 [ %add48, %while.body37 ], [ %curPos.0.ph150, %while.body37.preheader ]
%cyclicBufferPos.0145 = phi i32 [ %inc49, %while.body37 ], [ %13, %while.body37.preheader ]
%pos.0144 = phi i32 [ %inc50, %while.body37 ], [ %12, %while.body37.preheader ]
%size.2143 = phi i32 [ %dec35, %while.body37 ], [ %size.1, %while.body37.preheader ]
%dec35 = add i32 %size.2143, -1
%idx.ext = zext i32 %curPos.2146 to i64
%add.ptr = getelementptr inbounds i32, ptr %distances, i64 %idx.ext
%17 = load ptr, ptr %hashBuf.i, align 8, !tbaa !38
%18 = load i32, ptr %hashBufPos, align 8, !tbaa !48
%inc39 = add i32 %18, 1
store i32 %inc39, ptr %hashBufPos, align 8, !tbaa !48
%idxprom40 = zext i32 %18 to i64
%arrayidx41 = getelementptr inbounds i32, ptr %17, i64 %idxprom40
%19 = load i32, ptr %arrayidx41, align 4, !tbaa !40
%sub42 = sub i32 %pos.0144, %19
%20 = load ptr, ptr %son, align 8, !tbaa !57
%21 = load i32, ptr %cyclicBufferSize, align 4, !tbaa !56
%22 = load i32, ptr %cutValue, align 8, !tbaa !58
%add.ptr44 = getelementptr inbounds i32, ptr %add.ptr, i64 1
%23 = load i32, ptr %numHashBytes, align 4, !tbaa !51
%sub46 = add i32 %23, -1
%call = tail call ptr @GetMatchesSpec1(i32 noundef %spec.select, i32 noundef %sub42, i32 noundef %pos.0144, ptr noundef %16, ptr noundef %20, i32 noundef %cyclicBufferPos.0145, i32 noundef %21, i32 noundef %22, ptr noundef nonnull %add.ptr44, i32 noundef %sub46) #10
%sub.ptr.lhs.cast = ptrtoint ptr %call to i64
%sub.ptr.rhs.cast = ptrtoint ptr %add.ptr to i64
%sub.ptr.sub = sub i64 %sub.ptr.lhs.cast, %sub.ptr.rhs.cast
%24 = lshr exact i64 %sub.ptr.sub, 2
%conv = trunc i64 %24 to i32
%sub47 = add i32 %conv, -1
store i32 %sub47, ptr %add.ptr, align 4, !tbaa !40
%add48 = add i32 %curPos.2146, %conv
%inc49 = add i32 %cyclicBufferPos.0145, 1
%inc50 = add i32 %pos.0144, 1
%25 = load ptr, ptr %buffer, align 8, !tbaa !45
%incdec.ptr = getelementptr inbounds i8, ptr %25, i64 1
store ptr %incdec.ptr, ptr %buffer, align 8, !tbaa !45
%cmp34 = icmp uge i32 %add48, %sub
%cmp36.not = icmp eq i32 %dec35, 0
%or.cond = select i1 %cmp34, i1 true, i1 %cmp36.not
br i1 %or.cond, label %while.end.loopexit, label %while.body37, !llvm.loop !59
while.end.loopexit: ; preds = %while.body37
%.pre162 = load i32, ptr %pos16, align 8, !tbaa !54
%.pre163 = load i32, ptr %hashNumAvail, align 8, !tbaa !49
%.pre164 = load i32, ptr %cyclicBufferSize, align 4, !tbaa !56
br label %while.end
while.end: ; preds = %while.end.loopexit, %if.end11
%26 = phi i32 [ %15, %if.end11 ], [ %.pre164, %while.end.loopexit ]
%27 = phi i32 [ %14, %if.end11 ], [ %.pre163, %while.end.loopexit ]
%28 = phi i32 [ %12, %if.end11 ], [ %.pre162, %while.end.loopexit ]
%pos.0.lcssa = phi i32 [ %12, %if.end11 ], [ %inc50, %while.end.loopexit ]
%cyclicBufferPos.0.lcssa = phi i32 [ %13, %if.end11 ], [ %inc49, %while.end.loopexit ]
%curPos.2.lcssa = phi i32 [ %curPos.0.ph150, %if.end11 ], [ %add48, %while.end.loopexit ]
%sub53 = sub i32 %pos.0.lcssa, %28
%add54 = add i32 %sub53, %numProcessed.0.ph151
%sub58 = sub i32 %27, %sub53
store i32 %sub58, ptr %hashNumAvail, align 8, !tbaa !49
store i32 %pos.0.lcssa, ptr %pos16, align 8, !tbaa !54
%cmp61 = icmp eq i32 %cyclicBufferPos.0.lcssa, %26
%spec.store.select = select i1 %cmp61, i32 0, i32 %cyclicBufferPos.0.lcssa
store i32 %spec.store.select, ptr %cyclicBufferPos17, align 8, !tbaa !55
%cmp = icmp ult i32 %curPos.2.lcssa, %sub
br i1 %cmp, label %while.cond.outer.split, label %while.end66, !llvm.loop !52
while.end66: ; preds = %while.end, %for.body, %entry, %for.cond.preheader
%curPos.3 = phi i32 [ %curPos.0.ph150, %for.cond.preheader ], [ 2, %entry ], [ %inc, %for.body ], [ %curPos.2.lcssa, %while.end ]
store i32 %curPos.3, ptr %distances, align 4, !tbaa !40
ret void
}
declare ptr @GetMatchesSpec1(i32 noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #2
; Function Attrs: nounwind uwtable
define dso_local void @BtFillBlock(ptr noundef %p, i32 noundef %globalBlockIndex) local_unnamed_addr #1 {
entry:
%needStart = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 25, i32 1
%0 = load i32, ptr %needStart, align 4, !tbaa !23
%tobool.not = icmp eq i32 %0, 0
br i1 %tobool.not, label %if.then, label %if.end
if.then: ; preds = %entry
%cs = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 25, i32 12
%call = tail call i32 @pthread_mutex_lock(ptr noundef nonnull %cs) #10
%csWasEntered = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 25, i32 11
store i32 1, ptr %csWasEntered, align 4, !tbaa !16
br label %if.end
if.end: ; preds = %if.then, %entry
%btBuf = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 1
%1 = load ptr, ptr %btBuf, align 8, !tbaa !60
%and = shl i32 %globalBlockIndex, 14
%mul = and i32 %and, 1032192
%idx.ext = zext i32 %mul to i64
%add.ptr = getelementptr inbounds i32, ptr %1, i64 %idx.ext
tail call void @BtGetMatches(ptr noundef nonnull %p, ptr noundef %add.ptr)
%pos = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 20
%2 = load i32, ptr %pos, align 8, !tbaa !54
%cmp = icmp ugt i32 %2, -16385
br i1 %cmp, label %if.then1, label %if.end7
if.then1: ; preds = %if.end
%cyclicBufferSize = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 23
%3 = load i32, ptr %cyclicBufferSize, align 4, !tbaa !56
%sub = sub i32 %2, %3
%son = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 17
%4 = load ptr, ptr %son, align 8, !tbaa !57
%mul4 = shl i32 %3, 1
tail call void @MatchFinder_Normalize3(i32 noundef %sub, ptr noundef %4, i32 noundef %mul4) #10
%5 = load i32, ptr %pos, align 8, !tbaa !54
%sub6 = sub i32 %5, %sub
store i32 %sub6, ptr %pos, align 8, !tbaa !54
br label %if.end7
if.end7: ; preds = %if.then1, %if.end
%6 = load i32, ptr %needStart, align 4, !tbaa !23
%tobool9.not = icmp eq i32 %6, 0
br i1 %tobool9.not, label %if.then10, label %if.end15
if.then10: ; preds = %if.end7
%cs11 = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 25, i32 12
%call13 = tail call i32 @pthread_mutex_unlock(ptr noundef nonnull %cs11) #10
%csWasEntered14 = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 25, i32 11
store i32 0, ptr %csWasEntered14, align 4, !tbaa !16
br label %if.end15
if.end15: ; preds = %if.then10, %if.end7
ret void
}
; Function Attrs: nounwind uwtable
define dso_local void @BtThreadFunc(ptr noundef %mt) local_unnamed_addr #1 {
entry:
%canStart = getelementptr inbounds %struct._CMatchFinderMt, ptr %mt, i64 0, i32 11, i32 5
%call23 = tail call i32 @Event_Wait(ptr noundef nonnull %canStart) #10
%wasStarted = getelementptr inbounds %struct._CMatchFinderMt, ptr %mt, i64 0, i32 11, i32 6
%call124 = tail call i32 @Event_Set(ptr noundef nonnull %wasStarted) #10
%exit = getelementptr inbounds %struct._CMatchFinderMt, ptr %mt, i64 0, i32 11, i32 2
%0 = load i32, ptr %exit, align 8, !tbaa !26
%tobool.not2125 = icmp eq i32 %0, 0
br i1 %tobool.not2125, label %if.end.lr.ph.lr.ph, label %cleanup9
if.end.lr.ph.lr.ph: ; preds = %entry
%stopWriting = getelementptr inbounds %struct._CMatchFinderMt, ptr %mt, i64 0, i32 11, i32 3
%freeSemaphore = getelementptr inbounds %struct._CMatchFinderMt, ptr %mt, i64 0, i32 11, i32 8
%needStart.i = getelementptr inbounds %struct._CMatchFinderMt, ptr %mt, i64 0, i32 25, i32 1
%cs.i = getelementptr inbounds %struct._CMatchFinderMt, ptr %mt, i64 0, i32 25, i32 12
%csWasEntered.i = getelementptr inbounds %struct._CMatchFinderMt, ptr %mt, i64 0, i32 25, i32 11
%btBuf.i = getelementptr inbounds %struct._CMatchFinderMt, ptr %mt, i64 0, i32 1
%pos.i = getelementptr inbounds %struct._CMatchFinderMt, ptr %mt, i64 0, i32 20
%cyclicBufferSize.i = getelementptr inbounds %struct._CMatchFinderMt, ptr %mt, i64 0, i32 23
%son.i = getelementptr inbounds %struct._CMatchFinderMt, ptr %mt, i64 0, i32 17
%filledSemaphore = getelementptr inbounds %struct._CMatchFinderMt, ptr %mt, i64 0, i32 11, i32 9
%numProcessedBlocks = getelementptr inbounds %struct._CMatchFinderMt, ptr %mt, i64 0, i32 11, i32 13
%hashSync = getelementptr inbounds %struct._CMatchFinderMt, ptr %mt, i64 0, i32 25
%wasStopped = getelementptr inbounds %struct._CMatchFinderMt, ptr %mt, i64 0, i32 11, i32 7
br label %if.end
if.end: ; preds = %if.end.backedge, %if.end.lr.ph.lr.ph
%blockIndex.022 = phi i32 [ 0, %if.end.lr.ph.lr.ph ], [ %blockIndex.022.be, %if.end.backedge ]
%1 = load i32, ptr %stopWriting, align 4, !tbaa !25
%tobool3.not = icmp eq i32 %1, 0
br i1 %tobool3.not, label %if.end6, label %if.then4
if.then4: ; preds = %if.end
store i32 %blockIndex.022, ptr %numProcessedBlocks, align 8, !tbaa !24
tail call void @MtSync_StopWriting(ptr noundef nonnull %hashSync)
%call5 = tail call i32 @Event_Set(ptr noundef nonnull %wasStopped) #10
%call = tail call i32 @Event_Wait(ptr noundef nonnull %canStart) #10
%call1 = tail call i32 @Event_Set(ptr noundef nonnull %wasStarted) #10
%2 = load i32, ptr %exit, align 8, !tbaa !26
%tobool.not21 = icmp eq i32 %2, 0
br i1 %tobool.not21, label %if.end.backedge, label %cleanup9
if.end6: ; preds = %if.end
%call7 = tail call i32 @Semaphore_Wait(ptr noundef nonnull %freeSemaphore) #10
%inc = add i32 %blockIndex.022, 1
%3 = load i32, ptr %needStart.i, align 4, !tbaa !23
%tobool.not.i = icmp eq i32 %3, 0
br i1 %tobool.not.i, label %if.then.i, label %if.end.i
if.then.i: ; preds = %if.end6
%call.i = tail call i32 @pthread_mutex_lock(ptr noundef nonnull %cs.i) #10
store i32 1, ptr %csWasEntered.i, align 4, !tbaa !16
br label %if.end.i
if.end.i: ; preds = %if.then.i, %if.end6
%4 = load ptr, ptr %btBuf.i, align 8, !tbaa !60
%and.i = shl i32 %blockIndex.022, 14
%mul.i = and i32 %and.i, 1032192
%idx.ext.i = zext i32 %mul.i to i64
%add.ptr.i = getelementptr inbounds i32, ptr %4, i64 %idx.ext.i
tail call void @BtGetMatches(ptr noundef nonnull %mt, ptr noundef %add.ptr.i)
%5 = load i32, ptr %pos.i, align 8, !tbaa !54
%cmp.i = icmp ugt i32 %5, -16385
br i1 %cmp.i, label %if.then1.i, label %if.end7.i
if.then1.i: ; preds = %if.end.i
%6 = load i32, ptr %cyclicBufferSize.i, align 4, !tbaa !56
%sub.i = sub i32 %5, %6
%7 = load ptr, ptr %son.i, align 8, !tbaa !57
%mul4.i = shl i32 %6, 1
tail call void @MatchFinder_Normalize3(i32 noundef %sub.i, ptr noundef %7, i32 noundef %mul4.i) #10
%8 = load i32, ptr %pos.i, align 8, !tbaa !54
%sub6.i = sub i32 %8, %sub.i
store i32 %sub6.i, ptr %pos.i, align 8, !tbaa !54
br label %if.end7.i
if.end7.i: ; preds = %if.then1.i, %if.end.i
%9 = load i32, ptr %needStart.i, align 4, !tbaa !23
%tobool9.not.i = icmp eq i32 %9, 0
br i1 %tobool9.not.i, label %if.then10.i, label %BtFillBlock.exit
if.then10.i: ; preds = %if.end7.i
%call13.i = tail call i32 @pthread_mutex_unlock(ptr noundef nonnull %cs.i) #10
store i32 0, ptr %csWasEntered.i, align 4, !tbaa !16
br label %BtFillBlock.exit
BtFillBlock.exit: ; preds = %if.end7.i, %if.then10.i
%call8 = tail call i32 @Semaphore_ReleaseN(ptr noundef nonnull %filledSemaphore, i32 noundef 1) #10
%10 = load i32, ptr %exit, align 8, !tbaa !26
%tobool.not = icmp eq i32 %10, 0
br i1 %tobool.not, label %if.end.backedge, label %cleanup9
if.end.backedge: ; preds = %BtFillBlock.exit, %if.then4
%blockIndex.022.be = phi i32 [ %inc, %BtFillBlock.exit ], [ 0, %if.then4 ]
br label %if.end
cleanup9: ; preds = %if.then4, %BtFillBlock.exit, %entry
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) uwtable
define dso_local void @MatchFinderMt_Construct(ptr nocapture noundef writeonly %p) local_unnamed_addr #0 {
entry:
%hashBuf = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 13
store ptr null, ptr %hashBuf, align 8, !tbaa !38
%hashSync = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 25
store i32 0, ptr %hashSync, align 8, !tbaa !5
%csWasInitialized.i = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 25, i32 10
store i32 0, ptr %csWasInitialized.i, align 8, !tbaa !15
%csWasEntered.i = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 25, i32 11
store i32 0, ptr %csWasEntered.i, align 4, !tbaa !16
%_created.i = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 25, i32 4, i32 1
store i32 0, ptr %_created.i, align 8, !tbaa !17
%canStart.i = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 25, i32 5
store i32 0, ptr %canStart.i, align 8, !tbaa !18
%wasStarted.i = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 25, i32 6
store i32 0, ptr %wasStarted.i, align 8, !tbaa !19
%wasStopped.i = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 25, i32 7
store i32 0, ptr %wasStopped.i, align 8, !tbaa !20
%freeSemaphore.i = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 25, i32 8
store i32 0, ptr %freeSemaphore.i, align 8, !tbaa !21
%filledSemaphore.i = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 25, i32 9
store i32 0, ptr %filledSemaphore.i, align 8, !tbaa !22
%btSync = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 11
store i32 0, ptr %btSync, align 8, !tbaa !5
%csWasInitialized.i3 = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 11, i32 10
store i32 0, ptr %csWasInitialized.i3, align 8, !tbaa !15
%csWasEntered.i4 = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 11, i32 11
store i32 0, ptr %csWasEntered.i4, align 4, !tbaa !16
%_created.i5 = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 11, i32 4, i32 1
store i32 0, ptr %_created.i5, align 8, !tbaa !17
%canStart.i6 = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 11, i32 5
store i32 0, ptr %canStart.i6, align 8, !tbaa !18
%wasStarted.i7 = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 11, i32 6
store i32 0, ptr %wasStarted.i7, align 8, !tbaa !19
%wasStopped.i8 = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 11, i32 7
store i32 0, ptr %wasStopped.i8, align 8, !tbaa !20
%freeSemaphore.i9 = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 11, i32 8
store i32 0, ptr %freeSemaphore.i9, align 8, !tbaa !21
%filledSemaphore.i10 = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 11, i32 9
store i32 0, ptr %filledSemaphore.i10, align 8, !tbaa !22
ret void
}
; Function Attrs: nounwind uwtable
define dso_local void @MatchFinderMt_FreeMem(ptr nocapture noundef %p, ptr noundef %alloc) local_unnamed_addr #1 {
entry:
%Free = getelementptr inbounds %struct.ISzAlloc, ptr %alloc, i64 0, i32 1
%0 = load ptr, ptr %Free, align 8, !tbaa !61
%hashBuf = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 13
%1 = load ptr, ptr %hashBuf, align 8, !tbaa !38
tail call void %0(ptr noundef %alloc, ptr noundef %1) #10
store ptr null, ptr %hashBuf, align 8, !tbaa !38
ret void
}
; Function Attrs: nounwind uwtable
define dso_local void @MatchFinderMt_Destruct(ptr noundef %p, ptr noundef %alloc) local_unnamed_addr #1 {
entry:
%hashSync = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 25
tail call void @MtSync_Destruct(ptr noundef nonnull %hashSync)
%btSync = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 11
tail call void @MtSync_Destruct(ptr noundef nonnull %btSync)
%Free.i = getelementptr inbounds %struct.ISzAlloc, ptr %alloc, i64 0, i32 1
%0 = load ptr, ptr %Free.i, align 8, !tbaa !61
%hashBuf.i = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 13
%1 = load ptr, ptr %hashBuf.i, align 8, !tbaa !38
tail call void %0(ptr noundef %alloc, ptr noundef %1) #10
store ptr null, ptr %hashBuf.i, align 8, !tbaa !38
ret void
}
; Function Attrs: nounwind uwtable
define dso_local i32 @MatchFinderMt_Create(ptr noundef %p, i32 noundef %historySize, i32 noundef %keepAddBufferBefore, i32 noundef %matchMaxLen, i32 noundef %keepAddBufferAfter, ptr noundef %alloc) local_unnamed_addr #1 {
entry:
%MatchFinder = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 27
%0 = load ptr, ptr %MatchFinder, align 8, !tbaa !29
%historySize1 = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 8
store i32 %historySize, ptr %historySize1, align 4, !tbaa !63
%1 = and i32 %matchMaxLen, 1073737728
%cmp.not = icmp eq i32 %1, 0
br i1 %cmp.not, label %if.end, label %cleanup27
if.end: ; preds = %entry
%hashBuf = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 13
%2 = load ptr, ptr %hashBuf, align 8, !tbaa !38
%cmp2 = icmp eq ptr %2, null
br i1 %cmp2, label %if.then3, label %if.end10
if.then3: ; preds = %if.end
%3 = load ptr, ptr %alloc, align 8, !tbaa !64
%call = tail call ptr %3(ptr noundef nonnull %alloc, i64 noundef 4456448) #10
store ptr %call, ptr %hashBuf, align 8, !tbaa !38
%cmp6 = icmp eq ptr %call, null
br i1 %cmp6, label %cleanup27, label %if.end8
if.end8: ; preds = %if.then3
%add.ptr = getelementptr inbounds i32, ptr %call, i64 65536
%btBuf = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 1
store ptr %add.ptr, ptr %btBuf, align 8, !tbaa !60
br label %if.end10
if.end10: ; preds = %if.end8, %if.end
%add = add i32 %keepAddBufferBefore, 1114112
%add11 = add i32 %keepAddBufferAfter, 8192
%call12 = tail call i32 @MatchFinder_Create(ptr noundef %0, i32 noundef %historySize, i32 noundef %add, i32 noundef %matchMaxLen, i32 noundef %add11, ptr noundef %alloc) #10
%tobool.not = icmp eq i32 %call12, 0
br i1 %tobool.not, label %cleanup27, label %if.end14
if.end14: ; preds = %if.end10
%hashSync = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 25
%call15 = tail call fastcc i32 @MtSync_Create(ptr noundef nonnull %hashSync, ptr noundef nonnull @HashThreadFunc2, ptr noundef nonnull %p, i32 noundef 8), !range !65
%cmp16.not = icmp eq i32 %call15, 0
br i1 %cmp16.not, label %cleanup.cont, label %cleanup27
cleanup.cont: ; preds = %if.end14
%btSync = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 11
%call20 = tail call fastcc i32 @MtSync_Create(ptr noundef nonnull %btSync, ptr noundef nonnull @BtThreadFunc2, ptr noundef nonnull %p, i32 noundef 64), !range !65
br label %cleanup27
cleanup27: ; preds = %cleanup.cont, %if.end10, %if.then3, %entry, %if.end14
%retval.2 = phi i32 [ %call15, %if.end14 ], [ 5, %entry ], [ 2, %if.then3 ], [ 2, %if.end10 ], [ %call20, %cleanup.cont ]
ret i32 %retval.2
}
declare i32 @MatchFinder_Create(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #2
; Function Attrs: nounwind uwtable
define internal fastcc i32 @MtSync_Create(ptr noundef %p, ptr noundef %startAddress, ptr noundef %obj, i32 noundef %numBlocks) unnamed_addr #1 {
entry:
%0 = load i32, ptr %p, align 8, !tbaa !5
%tobool.not.i = icmp eq i32 %0, 0
br i1 %tobool.not.i, label %if.end.i, label %if.end
if.end.i: ; preds = %entry
%cs.i = getelementptr inbounds %struct._CMtSync, ptr %p, i64 0, i32 12
%call.i = tail call i32 @CriticalSection_Init(ptr noundef nonnull %cs.i) #10
%cmp.not.i = icmp eq i32 %call.i, 0
br i1 %cmp.not.i, label %if.end2.i, label %if.then
if.end2.i: ; preds = %if.end.i
%csWasInitialized.i = getelementptr inbounds %struct._CMtSync, ptr %p, i64 0, i32 10
store i32 1, ptr %csWasInitialized.i, align 8, !tbaa !15
%canStart.i = getelementptr inbounds %struct._CMtSync, ptr %p, i64 0, i32 5
%call3.i = tail call i32 @AutoResetEvent_CreateNotSignaled(ptr noundef nonnull %canStart.i) #10
%cmp4.not.i = icmp eq i32 %call3.i, 0
br i1 %cmp4.not.i, label %if.end6.i, label %if.then
if.end6.i: ; preds = %if.end2.i
%wasStarted.i = getelementptr inbounds %struct._CMtSync, ptr %p, i64 0, i32 6
%call7.i = tail call i32 @AutoResetEvent_CreateNotSignaled(ptr noundef nonnull %wasStarted.i) #10
%cmp8.not.i = icmp eq i32 %call7.i, 0
br i1 %cmp8.not.i, label %if.end10.i, label %if.then
if.end10.i: ; preds = %if.end6.i
%wasStopped.i = getelementptr inbounds %struct._CMtSync, ptr %p, i64 0, i32 7
%call11.i = tail call i32 @AutoResetEvent_CreateNotSignaled(ptr noundef nonnull %wasStopped.i) #10
%cmp12.not.i = icmp eq i32 %call11.i, 0
br i1 %cmp12.not.i, label %if.end14.i, label %if.then
if.end14.i: ; preds = %if.end10.i
%freeSemaphore.i = getelementptr inbounds %struct._CMtSync, ptr %p, i64 0, i32 8
%call15.i = tail call i32 @Semaphore_Create(ptr noundef nonnull %freeSemaphore.i, i32 noundef %numBlocks, i32 noundef %numBlocks) #10
%cmp16.not.i = icmp eq i32 %call15.i, 0
br i1 %cmp16.not.i, label %if.end18.i, label %if.then
if.end18.i: ; preds = %if.end14.i
%filledSemaphore.i = getelementptr inbounds %struct._CMtSync, ptr %p, i64 0, i32 9
%call19.i = tail call i32 @Semaphore_Create(ptr noundef nonnull %filledSemaphore.i, i32 noundef 0, i32 noundef %numBlocks) #10
%cmp20.not.i = icmp eq i32 %call19.i, 0
br i1 %cmp20.not.i, label %if.end22.i, label %if.then
if.end22.i: ; preds = %if.end18.i
%needStart.i = getelementptr inbounds %struct._CMtSync, ptr %p, i64 0, i32 1
store i32 1, ptr %needStart.i, align 4, !tbaa !23
%thread.i = getelementptr inbounds %struct._CMtSync, ptr %p, i64 0, i32 4
%call23.i = tail call i32 @Thread_Create(ptr noundef nonnull %thread.i, ptr noundef %startAddress, ptr noundef %obj) #10
%cmp24.not.i = icmp eq i32 %call23.i, 0
br i1 %cmp24.not.i, label %if.end26.i, label %if.then
if.end26.i: ; preds = %if.end22.i
store i32 1, ptr %p, align 8, !tbaa !5
br label %if.end
if.then: ; preds = %if.end.i, %if.end2.i, %if.end6.i, %if.end10.i, %if.end14.i, %if.end18.i, %if.end22.i
tail call void @MtSync_Destruct(ptr noundef nonnull %p)
br label %if.end
if.end: ; preds = %if.end26.i, %entry, %if.then
%retval.0.i6 = phi i32 [ 12, %if.then ], [ 0, %entry ], [ 0, %if.end26.i ]
ret i32 %retval.0.i6
}
; Function Attrs: nounwind uwtable
define internal i32 @HashThreadFunc2(ptr noundef %p) #1 {
entry:
tail call void @HashThreadFunc(ptr noundef %p)
ret i32 0
}
; Function Attrs: nounwind uwtable
define internal i32 @BtThreadFunc2(ptr noundef %p) #1 {
entry:
tail call void @BtThreadFunc(ptr noundef %p)
ret i32 0
}
; Function Attrs: nounwind uwtable
define dso_local void @MatchFinderMt_Init(ptr nocapture noundef %p) #1 {
entry:
%MatchFinder = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 27
%0 = load ptr, ptr %MatchFinder, align 8, !tbaa !29
%btBufPosLimit = getelementptr inbounds %struct._CMatchFinderMt, ptr %p, i64 0, i32 3