-
Notifications
You must be signed in to change notification settings - Fork 0
/
0213F89C42C779EC.ll
1765 lines (1578 loc) · 116 KB
/
0213F89C42C779EC.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/Bullet/btOptimizedBvh.cpp'
source_filename = "/usr/local/google/home/aeubanks/repos/test-suite/MultiSource/Benchmarks/Bullet/btOptimizedBvh.cpp"
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.QuantizedNodeTriangleCallback = type { %class.btInternalTriangleIndexCallback, ptr, ptr }
%class.btInternalTriangleIndexCallback = type { ptr }
%struct.NodeTriangleCallback = type { %class.btInternalTriangleIndexCallback, ptr }
%class.btVector3 = type { [4 x float] }
%class.btQuantizedBvh = type <{ ptr, %class.btVector3, %class.btVector3, %class.btVector3, i32, i32, i8, [7 x i8], %class.btAlignedObjectArray, %class.btAlignedObjectArray, %class.btAlignedObjectArray.0, %class.btAlignedObjectArray.0, i32, [4 x i8], %class.btAlignedObjectArray.4, i32, [4 x i8] }>
%class.btAlignedObjectArray = type <{ %class.btAlignedAllocator, [3 x i8], i32, i32, [4 x i8], ptr, i8, [7 x i8] }>
%class.btAlignedAllocator = type { i8 }
%class.btAlignedObjectArray.0 = type <{ %class.btAlignedAllocator.1, [3 x i8], i32, i32, [4 x i8], ptr, i8, [7 x i8] }>
%class.btAlignedAllocator.1 = type { i8 }
%class.btAlignedObjectArray.4 = type <{ %class.btAlignedAllocator.5, [3 x i8], i32, i32, [4 x i8], ptr, i8, [7 x i8] }>
%class.btAlignedAllocator.5 = type { i8 }
%struct.btQuantizedBvhNode = type { [3 x i16], [3 x i16], i32 }
%struct.btOptimizedBvhNode = type { %class.btVector3, %class.btVector3, i32, i32, i32, [5 x i32] }
%class.btBvhSubtreeInfo = type { [3 x i16], [3 x i16], i32, i32, [3 x i32] }
%class.btStridingMeshInterface = type { ptr, %class.btVector3 }
$__clang_call_terminate = comdat any
$_ZN14btOptimizedBvh9serializeEPvjb = comdat any
@_ZTV14btOptimizedBvh = dso_local unnamed_addr constant { [5 x ptr] } { [5 x ptr] [ptr null, ptr @_ZTI14btOptimizedBvh, ptr @_ZN14btOptimizedBvhD2Ev, ptr @_ZN14btOptimizedBvhD0Ev, ptr @_ZN14btOptimizedBvh9serializeEPvjb] }, align 8
@_ZTVN10__cxxabiv120__si_class_type_infoE = external global ptr
@_ZTS14btOptimizedBvh = dso_local constant [17 x i8] c"14btOptimizedBvh\00", align 1
@_ZTI14btQuantizedBvh = external constant ptr
@_ZTI14btOptimizedBvh = dso_local constant { ptr, ptr, ptr } { ptr getelementptr inbounds (ptr, ptr @_ZTVN10__cxxabiv120__si_class_type_infoE, i64 2), ptr @_ZTS14btOptimizedBvh, ptr @_ZTI14btQuantizedBvh }, align 8
@_ZTVZN14btOptimizedBvh5buildEP23btStridingMeshInterfacebRK9btVector3S4_E29QuantizedNodeTriangleCallback = internal unnamed_addr constant { [5 x ptr] } { [5 x ptr] [ptr null, ptr @_ZTIZN14btOptimizedBvh5buildEP23btStridingMeshInterfacebRK9btVector3S4_E29QuantizedNodeTriangleCallback, ptr @_ZN31btInternalTriangleIndexCallbackD2Ev, ptr @_ZZN14btOptimizedBvh5buildEP23btStridingMeshInterfacebRK9btVector3S4_EN29QuantizedNodeTriangleCallbackD0Ev, ptr @_ZZN14btOptimizedBvh5buildEP23btStridingMeshInterfacebRK9btVector3S4_EN29QuantizedNodeTriangleCallback28internalProcessTriangleIndexEPS2_ii] }, align 8
@_ZTSZN14btOptimizedBvh5buildEP23btStridingMeshInterfacebRK9btVector3S4_E29QuantizedNodeTriangleCallback = internal constant [100 x i8] c"ZN14btOptimizedBvh5buildEP23btStridingMeshInterfacebRK9btVector3S4_E29QuantizedNodeTriangleCallback\00", align 1
@_ZTI31btInternalTriangleIndexCallback = external constant ptr
@_ZTIZN14btOptimizedBvh5buildEP23btStridingMeshInterfacebRK9btVector3S4_E29QuantizedNodeTriangleCallback = internal constant { ptr, ptr, ptr } { ptr getelementptr inbounds (ptr, ptr @_ZTVN10__cxxabiv120__si_class_type_infoE, i64 2), ptr @_ZTSZN14btOptimizedBvh5buildEP23btStridingMeshInterfacebRK9btVector3S4_E29QuantizedNodeTriangleCallback, ptr @_ZTI31btInternalTriangleIndexCallback }, align 8
@_ZTVZN14btOptimizedBvh5buildEP23btStridingMeshInterfacebRK9btVector3S4_E20NodeTriangleCallback = internal unnamed_addr constant { [5 x ptr] } { [5 x ptr] [ptr null, ptr @_ZTIZN14btOptimizedBvh5buildEP23btStridingMeshInterfacebRK9btVector3S4_E20NodeTriangleCallback, ptr @_ZN31btInternalTriangleIndexCallbackD2Ev, ptr @_ZZN14btOptimizedBvh5buildEP23btStridingMeshInterfacebRK9btVector3S4_EN20NodeTriangleCallbackD0Ev, ptr @_ZZN14btOptimizedBvh5buildEP23btStridingMeshInterfacebRK9btVector3S4_EN20NodeTriangleCallback28internalProcessTriangleIndexEPS2_ii] }, align 8
@_ZTSZN14btOptimizedBvh5buildEP23btStridingMeshInterfacebRK9btVector3S4_E20NodeTriangleCallback = internal constant [91 x i8] c"ZN14btOptimizedBvh5buildEP23btStridingMeshInterfacebRK9btVector3S4_E20NodeTriangleCallback\00", align 1
@_ZTIZN14btOptimizedBvh5buildEP23btStridingMeshInterfacebRK9btVector3S4_E20NodeTriangleCallback = internal constant { ptr, ptr, ptr } { ptr getelementptr inbounds (ptr, ptr @_ZTVN10__cxxabiv120__si_class_type_infoE, i64 2), ptr @_ZTSZN14btOptimizedBvh5buildEP23btStridingMeshInterfacebRK9btVector3S4_E20NodeTriangleCallback, ptr @_ZTI31btInternalTriangleIndexCallback }, align 8
@_ZN14btOptimizedBvhC1Ev = dso_local unnamed_addr alias void (ptr), ptr @_ZN14btOptimizedBvhC2Ev
@_ZN14btOptimizedBvhD1Ev = dso_local unnamed_addr alias void (ptr), ptr @_ZN14btOptimizedBvhD2Ev
; Function Attrs: uwtable
define dso_local void @_ZN14btOptimizedBvhC2Ev(ptr noundef nonnull align 8 dereferenceable(244) %this) unnamed_addr #0 align 2 {
entry:
tail call void @_ZN14btQuantizedBvhC2Ev(ptr noundef nonnull align 8 dereferenceable(244) %this)
store ptr getelementptr inbounds ({ [5 x ptr] }, ptr @_ZTV14btOptimizedBvh, i64 0, inrange i32 0, i64 2), ptr %this, align 8, !tbaa !5
ret void
}
declare void @_ZN14btQuantizedBvhC2Ev(ptr noundef nonnull align 8 dereferenceable(244)) unnamed_addr #1
declare void @_ZN14btQuantizedBvhD2Ev(ptr noundef nonnull align 8 dereferenceable(244)) unnamed_addr #1
; Function Attrs: uwtable
define dso_local void @_ZN14btOptimizedBvhD2Ev(ptr noundef nonnull align 8 dereferenceable(244) %this) unnamed_addr #0 align 2 {
entry:
tail call void @_ZN14btQuantizedBvhD2Ev(ptr noundef nonnull align 8 dereferenceable(244) %this)
ret void
}
; Function Attrs: uwtable
define dso_local void @_ZN14btOptimizedBvhD0Ev(ptr noundef nonnull align 8 dereferenceable(244) %this) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
entry:
invoke void @_ZN14btQuantizedBvhD2Ev(ptr noundef nonnull align 8 dereferenceable(244) %this)
to label %invoke.cont unwind label %lpad
invoke.cont: ; preds = %entry
tail call void @_Z21btAlignedFreeInternalPv(ptr noundef nonnull %this)
ret void
lpad: ; preds = %entry
%0 = landingpad { ptr, i32 }
cleanup
invoke void @_Z21btAlignedFreeInternalPv(ptr noundef nonnull %this)
to label %eh.resume unwind label %terminate.lpad
eh.resume: ; preds = %lpad
resume { ptr, i32 } %0
terminate.lpad: ; preds = %lpad
%1 = landingpad { ptr, i32 }
catch ptr null
%2 = extractvalue { ptr, i32 } %1, 0
tail call void @__clang_call_terminate(ptr %2) #10
unreachable
}
declare i32 @__gxx_personality_v0(...)
; Function Attrs: noinline noreturn nounwind
define linkonce_odr hidden void @__clang_call_terminate(ptr noundef %0) local_unnamed_addr #2 comdat {
%2 = tail call ptr @__cxa_begin_catch(ptr %0) #11
tail call void @_ZSt9terminatev() #10
unreachable
}
declare ptr @__cxa_begin_catch(ptr) local_unnamed_addr
declare void @_ZSt9terminatev() local_unnamed_addr
; Function Attrs: uwtable
define dso_local void @_ZN14btOptimizedBvh5buildEP23btStridingMeshInterfacebRK9btVector3S4_(ptr noundef nonnull align 8 dereferenceable(244) %this, ptr noundef %triangles, i1 noundef zeroext %useQuantizedAabbCompression, ptr noundef nonnull align 4 dereferenceable(16) %bvhAabbMin, ptr noundef nonnull align 4 dereferenceable(16) %bvhAabbMax) local_unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
entry:
%callback = alloca %struct.QuantizedNodeTriangleCallback, align 8
%callback11 = alloca %struct.NodeTriangleCallback, align 8
%aabbMin = alloca %class.btVector3, align 16
%aabbMax = alloca %class.btVector3, align 16
%frombool = zext i1 %useQuantizedAabbCompression to i8
%m_useQuantization = getelementptr inbounds %class.btQuantizedBvh, ptr %this, i64 0, i32 6
store i8 %frombool, ptr %m_useQuantization, align 8, !tbaa !8
br i1 %useQuantizedAabbCompression, label %if.then, label %if.else
if.then: ; preds = %entry
tail call void @_ZN14btQuantizedBvh21setQuantizationValuesERK9btVector3S2_f(ptr noundef nonnull align 8 dereferenceable(244) %this, ptr noundef nonnull align 4 dereferenceable(16) %bvhAabbMin, ptr noundef nonnull align 4 dereferenceable(16) %bvhAabbMax, float noundef 1.000000e+00)
call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %callback) #11
%m_quantizedLeafNodes = getelementptr inbounds %class.btQuantizedBvh, ptr %this, i64 0, i32 10
store ptr getelementptr inbounds ({ [5 x ptr] }, ptr @_ZTVZN14btOptimizedBvh5buildEP23btStridingMeshInterfacebRK9btVector3S4_E29QuantizedNodeTriangleCallback, i64 0, inrange i32 0, i64 2), ptr %callback, align 8, !tbaa !5
%m_triangleNodes.i = getelementptr inbounds %struct.QuantizedNodeTriangleCallback, ptr %callback, i64 0, i32 1
store ptr %m_quantizedLeafNodes, ptr %m_triangleNodes.i, align 8, !tbaa !22
%m_optimizedTree.i = getelementptr inbounds %struct.QuantizedNodeTriangleCallback, ptr %callback, i64 0, i32 2
store ptr %this, ptr %m_optimizedTree.i, align 8, !tbaa !23
%m_bvhAabbMin = getelementptr inbounds %class.btQuantizedBvh, ptr %this, i64 0, i32 1
%m_bvhAabbMax = getelementptr inbounds %class.btQuantizedBvh, ptr %this, i64 0, i32 2
%vtable = load ptr, ptr %triangles, align 8, !tbaa !5
%vfn = getelementptr inbounds ptr, ptr %vtable, i64 2
%0 = load ptr, ptr %vfn, align 8
invoke void %0(ptr noundef nonnull align 8 dereferenceable(24) %triangles, ptr noundef nonnull %callback, ptr noundef nonnull align 4 dereferenceable(16) %m_bvhAabbMin, ptr noundef nonnull align 4 dereferenceable(16) %m_bvhAabbMax)
to label %invoke.cont unwind label %lpad
invoke.cont: ; preds = %if.then
%m_size.i = getelementptr inbounds %class.btQuantizedBvh, ptr %this, i64 0, i32 10, i32 2
%1 = load i32, ptr %m_size.i, align 4, !tbaa !26
%mul = shl nsw i32 %1, 1
%m_size.i.i = getelementptr inbounds %class.btQuantizedBvh, ptr %this, i64 0, i32 11, i32 2
%2 = load i32, ptr %m_size.i.i, align 4, !tbaa !26
%cmp4.i = icmp slt i32 %2, %mul
br i1 %cmp4.i, label %if.then5.i, label %_ZN20btAlignedObjectArrayI18btQuantizedBvhNodeE6resizeEiRKS0_.exit
if.then5.i: ; preds = %invoke.cont
%m_capacity.i.i.i = getelementptr inbounds %class.btQuantizedBvh, ptr %this, i64 0, i32 11, i32 3
%3 = load i32, ptr %m_capacity.i.i.i, align 8, !tbaa !27
%cmp.i.i = icmp slt i32 %3, %mul
br i1 %cmp.i.i, label %if.then.i.i, label %for.body10.lr.ph.i
if.then.i.i: ; preds = %if.then5.i
%tobool.not.i.i.i = icmp eq i32 %1, 0
br i1 %tobool.not.i.i.i, label %_ZN20btAlignedObjectArrayI18btQuantizedBvhNodeE8allocateEi.exit.i.i, label %if.then.i.i.i
if.then.i.i.i: ; preds = %if.then.i.i
%conv.i.i.i.i = sext i32 %mul to i64
%mul.i.i.i.i = shl nsw i64 %conv.i.i.i.i, 4
%call.i.i.i.i74 = invoke noundef ptr @_Z22btAlignedAllocInternalmi(i64 noundef %mul.i.i.i.i, i32 noundef 16)
to label %call.i.i.i.i.noexc unwind label %lpad7
call.i.i.i.i.noexc: ; preds = %if.then.i.i.i
%.pre.i = load i32, ptr %m_size.i.i, align 4, !tbaa !26
br label %_ZN20btAlignedObjectArrayI18btQuantizedBvhNodeE8allocateEi.exit.i.i
_ZN20btAlignedObjectArrayI18btQuantizedBvhNodeE8allocateEi.exit.i.i: ; preds = %call.i.i.i.i.noexc, %if.then.i.i
%4 = phi i32 [ %.pre.i, %call.i.i.i.i.noexc ], [ %2, %if.then.i.i ]
%retval.0.i.i.i = phi ptr [ %call.i.i.i.i74, %call.i.i.i.i.noexc ], [ null, %if.then.i.i ]
%cmp7.i.i.i = icmp sgt i32 %4, 0
br i1 %cmp7.i.i.i, label %for.body.lr.ph.i.i.i, label %_ZNK20btAlignedObjectArrayI18btQuantizedBvhNodeE4copyEiiPS0_.exit.i.i
for.body.lr.ph.i.i.i: ; preds = %_ZN20btAlignedObjectArrayI18btQuantizedBvhNodeE8allocateEi.exit.i.i
%m_data.i.i.i = getelementptr inbounds %class.btQuantizedBvh, ptr %this, i64 0, i32 11, i32 5
%wide.trip.count.i.i.i = zext i32 %4 to i64
%xtraiter180 = and i64 %wide.trip.count.i.i.i, 1
%5 = icmp eq i32 %4, 1
br i1 %5, label %_ZNK20btAlignedObjectArrayI18btQuantizedBvhNodeE4copyEiiPS0_.exit.i.i.loopexit.unr-lcssa, label %for.body.lr.ph.i.i.i.new
for.body.lr.ph.i.i.i.new: ; preds = %for.body.lr.ph.i.i.i
%unroll_iter182 = and i64 %wide.trip.count.i.i.i, 4294967294
br label %for.body.i.i.i
for.body.i.i.i: ; preds = %for.body.i.i.i, %for.body.lr.ph.i.i.i.new
%indvars.iv.i.i.i = phi i64 [ 0, %for.body.lr.ph.i.i.i.new ], [ %indvars.iv.next.i.i.i.1, %for.body.i.i.i ]
%niter183 = phi i64 [ 0, %for.body.lr.ph.i.i.i.new ], [ %niter183.next.1, %for.body.i.i.i ]
%arrayidx.i.i.i = getelementptr inbounds %struct.btQuantizedBvhNode, ptr %retval.0.i.i.i, i64 %indvars.iv.i.i.i
%6 = load ptr, ptr %m_data.i.i.i, align 8, !tbaa !28
%arrayidx3.i.i.i = getelementptr inbounds %struct.btQuantizedBvhNode, ptr %6, i64 %indvars.iv.i.i.i
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(16) %arrayidx.i.i.i, ptr noundef nonnull align 4 dereferenceable(16) %arrayidx3.i.i.i, i64 16, i1 false), !tbaa.struct !29
%indvars.iv.next.i.i.i = or i64 %indvars.iv.i.i.i, 1
%arrayidx.i.i.i.1 = getelementptr inbounds %struct.btQuantizedBvhNode, ptr %retval.0.i.i.i, i64 %indvars.iv.next.i.i.i
%7 = load ptr, ptr %m_data.i.i.i, align 8, !tbaa !28
%arrayidx3.i.i.i.1 = getelementptr inbounds %struct.btQuantizedBvhNode, ptr %7, i64 %indvars.iv.next.i.i.i
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(16) %arrayidx.i.i.i.1, ptr noundef nonnull align 4 dereferenceable(16) %arrayidx3.i.i.i.1, i64 16, i1 false), !tbaa.struct !29
%indvars.iv.next.i.i.i.1 = add nuw nsw i64 %indvars.iv.i.i.i, 2
%niter183.next.1 = add i64 %niter183, 2
%niter183.ncmp.1 = icmp eq i64 %niter183.next.1, %unroll_iter182
br i1 %niter183.ncmp.1, label %_ZNK20btAlignedObjectArrayI18btQuantizedBvhNodeE4copyEiiPS0_.exit.i.i.loopexit.unr-lcssa, label %for.body.i.i.i
_ZNK20btAlignedObjectArrayI18btQuantizedBvhNodeE4copyEiiPS0_.exit.i.i.loopexit.unr-lcssa: ; preds = %for.body.i.i.i, %for.body.lr.ph.i.i.i
%indvars.iv.i.i.i.unr = phi i64 [ 0, %for.body.lr.ph.i.i.i ], [ %indvars.iv.next.i.i.i.1, %for.body.i.i.i ]
%lcmp.mod181.not = icmp eq i64 %xtraiter180, 0
br i1 %lcmp.mod181.not, label %_ZNK20btAlignedObjectArrayI18btQuantizedBvhNodeE4copyEiiPS0_.exit.i.i, label %for.body.i.i.i.epil
for.body.i.i.i.epil: ; preds = %_ZNK20btAlignedObjectArrayI18btQuantizedBvhNodeE4copyEiiPS0_.exit.i.i.loopexit.unr-lcssa
%arrayidx.i.i.i.epil = getelementptr inbounds %struct.btQuantizedBvhNode, ptr %retval.0.i.i.i, i64 %indvars.iv.i.i.i.unr
%8 = load ptr, ptr %m_data.i.i.i, align 8, !tbaa !28
%arrayidx3.i.i.i.epil = getelementptr inbounds %struct.btQuantizedBvhNode, ptr %8, i64 %indvars.iv.i.i.i.unr
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(16) %arrayidx.i.i.i.epil, ptr noundef nonnull align 4 dereferenceable(16) %arrayidx3.i.i.i.epil, i64 16, i1 false), !tbaa.struct !29
br label %_ZNK20btAlignedObjectArrayI18btQuantizedBvhNodeE4copyEiiPS0_.exit.i.i
_ZNK20btAlignedObjectArrayI18btQuantizedBvhNodeE4copyEiiPS0_.exit.i.i: ; preds = %for.body.i.i.i.epil, %_ZNK20btAlignedObjectArrayI18btQuantizedBvhNodeE4copyEiiPS0_.exit.i.i.loopexit.unr-lcssa, %_ZN20btAlignedObjectArrayI18btQuantizedBvhNodeE8allocateEi.exit.i.i
%m_data.i9.i.i = getelementptr inbounds %class.btQuantizedBvh, ptr %this, i64 0, i32 11, i32 5
%9 = load ptr, ptr %m_data.i9.i.i, align 8, !tbaa !28
%tobool.not.i10.i.i = icmp eq ptr %9, null
%m_ownsMemory.i.i.i = getelementptr inbounds %class.btQuantizedBvh, ptr %this, i64 0, i32 11, i32 6
%10 = load i8, ptr %m_ownsMemory.i.i.i, align 8, !range !32
%tobool2.not.i.i.i = icmp eq i8 %10, 0
%or.cond.i.i = select i1 %tobool.not.i10.i.i, i1 true, i1 %tobool2.not.i.i.i
br i1 %or.cond.i.i, label %if.end.i, label %if.then3.i.i.i
if.then3.i.i.i: ; preds = %_ZNK20btAlignedObjectArrayI18btQuantizedBvhNodeE4copyEiiPS0_.exit.i.i
invoke void @_Z21btAlignedFreeInternalPv(ptr noundef nonnull %9)
to label %if.end.i unwind label %lpad7
if.end.i: ; preds = %if.then3.i.i.i, %_ZNK20btAlignedObjectArrayI18btQuantizedBvhNodeE4copyEiiPS0_.exit.i.i
store i8 1, ptr %m_ownsMemory.i.i.i, align 8, !tbaa !33
store ptr %retval.0.i.i.i, ptr %m_data.i9.i.i, align 8, !tbaa !28
store i32 %mul, ptr %m_capacity.i.i.i, align 8, !tbaa !27
br label %for.body10.lr.ph.i
for.body10.lr.ph.i: ; preds = %if.end.i, %if.then5.i
%m_data11.i = getelementptr inbounds %class.btQuantizedBvh, ptr %this, i64 0, i32 11, i32 5
%11 = sext i32 %2 to i64
%wide.trip.count.i = sext i32 %mul to i64
%12 = sub nsw i64 %wide.trip.count.i, %11
%13 = xor i64 %11, -1
%14 = add nsw i64 %13, %wide.trip.count.i
%xtraiter184 = and i64 %12, 3
%lcmp.mod185.not = icmp eq i64 %xtraiter184, 0
br i1 %lcmp.mod185.not, label %for.body10.i.prol.loopexit, label %for.body10.i.prol
for.body10.i.prol: ; preds = %for.body10.lr.ph.i, %for.body10.i.prol
%indvars.iv.i.prol = phi i64 [ %indvars.iv.next.i.prol, %for.body10.i.prol ], [ %11, %for.body10.lr.ph.i ]
%prol.iter186 = phi i64 [ %prol.iter186.next, %for.body10.i.prol ], [ 0, %for.body10.lr.ph.i ]
%15 = load ptr, ptr %m_data11.i, align 8, !tbaa !28
%arrayidx13.i.prol = getelementptr inbounds %struct.btQuantizedBvhNode, ptr %15, i64 %indvars.iv.i.prol
call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(16) %arrayidx13.i.prol, i8 0, i64 16, i1 false)
%indvars.iv.next.i.prol = add nsw i64 %indvars.iv.i.prol, 1
%prol.iter186.next = add i64 %prol.iter186, 1
%prol.iter186.cmp.not = icmp eq i64 %prol.iter186.next, %xtraiter184
br i1 %prol.iter186.cmp.not, label %for.body10.i.prol.loopexit, label %for.body10.i.prol, !llvm.loop !34
for.body10.i.prol.loopexit: ; preds = %for.body10.i.prol, %for.body10.lr.ph.i
%indvars.iv.i.unr = phi i64 [ %11, %for.body10.lr.ph.i ], [ %indvars.iv.next.i.prol, %for.body10.i.prol ]
%16 = icmp ult i64 %14, 3
br i1 %16, label %_ZN20btAlignedObjectArrayI18btQuantizedBvhNodeE6resizeEiRKS0_.exit, label %for.body10.i
for.body10.i: ; preds = %for.body10.i.prol.loopexit, %for.body10.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i.3, %for.body10.i ], [ %indvars.iv.i.unr, %for.body10.i.prol.loopexit ]
%17 = load ptr, ptr %m_data11.i, align 8, !tbaa !28
%arrayidx13.i = getelementptr inbounds %struct.btQuantizedBvhNode, ptr %17, i64 %indvars.iv.i
call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(16) %arrayidx13.i, i8 0, i64 16, i1 false)
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1
%18 = load ptr, ptr %m_data11.i, align 8, !tbaa !28
%arrayidx13.i.1 = getelementptr inbounds %struct.btQuantizedBvhNode, ptr %18, i64 %indvars.iv.next.i
call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(16) %arrayidx13.i.1, i8 0, i64 16, i1 false)
%indvars.iv.next.i.1 = add nsw i64 %indvars.iv.i, 2
%19 = load ptr, ptr %m_data11.i, align 8, !tbaa !28
%arrayidx13.i.2 = getelementptr inbounds %struct.btQuantizedBvhNode, ptr %19, i64 %indvars.iv.next.i.1
call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(16) %arrayidx13.i.2, i8 0, i64 16, i1 false)
%indvars.iv.next.i.2 = add nsw i64 %indvars.iv.i, 3
%20 = load ptr, ptr %m_data11.i, align 8, !tbaa !28
%arrayidx13.i.3 = getelementptr inbounds %struct.btQuantizedBvhNode, ptr %20, i64 %indvars.iv.next.i.2
call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(16) %arrayidx13.i.3, i8 0, i64 16, i1 false)
%indvars.iv.next.i.3 = add nsw i64 %indvars.iv.i, 4
%exitcond.not.i.3 = icmp eq i64 %indvars.iv.next.i.3, %wide.trip.count.i
br i1 %exitcond.not.i.3, label %_ZN20btAlignedObjectArrayI18btQuantizedBvhNodeE6resizeEiRKS0_.exit, label %for.body10.i
_ZN20btAlignedObjectArrayI18btQuantizedBvhNodeE6resizeEiRKS0_.exit: ; preds = %for.body10.i.prol.loopexit, %for.body10.i, %invoke.cont
store i32 %mul, ptr %m_size.i.i, align 4, !tbaa !26
call void @_ZN31btInternalTriangleIndexCallbackD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %callback)
call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %callback) #11
br label %if.end
lpad: ; preds = %if.then
%21 = landingpad { ptr, i32 }
cleanup
br label %ehcleanup
lpad7: ; preds = %if.then3.i.i.i, %if.then.i.i.i
%22 = landingpad { ptr, i32 }
cleanup
br label %ehcleanup
ehcleanup: ; preds = %lpad7, %lpad
%.pn171 = phi { ptr, i32 } [ %22, %lpad7 ], [ %21, %lpad ]
invoke void @_ZN31btInternalTriangleIndexCallbackD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %callback)
to label %invoke.cont9 unwind label %terminate.lpad
invoke.cont9: ; preds = %ehcleanup
call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %callback) #11
br label %ehcleanup67
if.else: ; preds = %entry
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %callback11) #11
%m_leafNodes = getelementptr inbounds %class.btQuantizedBvh, ptr %this, i64 0, i32 8
store ptr getelementptr inbounds ({ [5 x ptr] }, ptr @_ZTVZN14btOptimizedBvh5buildEP23btStridingMeshInterfacebRK9btVector3S4_E20NodeTriangleCallback, i64 0, inrange i32 0, i64 2), ptr %callback11, align 8, !tbaa !5
%m_triangleNodes.i75 = getelementptr inbounds %struct.NodeTriangleCallback, ptr %callback11, i64 0, i32 1
store ptr %m_leafNodes, ptr %m_triangleNodes.i75, align 8, !tbaa !22
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %aabbMin) #11
store <4 x float> <float 0xC3ABC16D60000000, float 0xC3ABC16D60000000, float 0xC3ABC16D60000000, float 0.000000e+00>, ptr %aabbMin, align 16, !tbaa !36
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %aabbMax) #11
store <4 x float> <float 0x43ABC16D60000000, float 0x43ABC16D60000000, float 0x43ABC16D60000000, float 0.000000e+00>, ptr %aabbMax, align 16, !tbaa !36
%vtable28 = load ptr, ptr %triangles, align 8, !tbaa !5
%vfn29 = getelementptr inbounds ptr, ptr %vtable28, i64 2
%23 = load ptr, ptr %vfn29, align 8
invoke void %23(ptr noundef nonnull align 8 dereferenceable(24) %triangles, ptr noundef nonnull %callback11, ptr noundef nonnull align 4 dereferenceable(16) %aabbMin, ptr noundef nonnull align 4 dereferenceable(16) %aabbMax)
to label %invoke.cont31 unwind label %lpad30
invoke.cont31: ; preds = %if.else
%m_size.i79 = getelementptr inbounds %class.btQuantizedBvh, ptr %this, i64 0, i32 8, i32 2
%24 = load i32, ptr %m_size.i79, align 4, !tbaa !38
%mul35 = shl nsw i32 %24, 1
%m_size.i.i80 = getelementptr inbounds %class.btQuantizedBvh, ptr %this, i64 0, i32 9, i32 2
%25 = load i32, ptr %m_size.i.i80, align 4, !tbaa !38
%cmp4.i82 = icmp slt i32 %25, %mul35
br i1 %cmp4.i82, label %if.then5.i86, label %_ZN20btAlignedObjectArrayI18btOptimizedBvhNodeE6resizeEiRKS0_.exit
if.then5.i86: ; preds = %invoke.cont31
%m_capacity.i.i.i84 = getelementptr inbounds %class.btQuantizedBvh, ptr %this, i64 0, i32 9, i32 3
%26 = load i32, ptr %m_capacity.i.i.i84, align 8, !tbaa !39
%cmp.i.i85 = icmp slt i32 %26, %mul35
br i1 %cmp.i.i85, label %if.then.i.i88, label %for.body10.lr.ph.i113
if.then.i.i88: ; preds = %if.then5.i86
%tobool.not.i.i.i87 = icmp eq i32 %24, 0
br i1 %tobool.not.i.i.i87, label %_ZN20btAlignedObjectArrayI18btOptimizedBvhNodeE8allocateEi.exit.i.i, label %if.then.i.i.i92
if.then.i.i.i92: ; preds = %if.then.i.i88
%conv.i.i.i.i89 = sext i32 %mul35 to i64
%mul.i.i.i.i90 = shl nsw i64 %conv.i.i.i.i89, 6
%call.i.i.i.i120 = invoke noundef ptr @_Z22btAlignedAllocInternalmi(i64 noundef %mul.i.i.i.i90, i32 noundef 16)
to label %call.i.i.i.i.noexc119 unwind label %lpad37
call.i.i.i.i.noexc119: ; preds = %if.then.i.i.i92
%.pre.i91 = load i32, ptr %m_size.i.i80, align 4, !tbaa !38
br label %_ZN20btAlignedObjectArrayI18btOptimizedBvhNodeE8allocateEi.exit.i.i
_ZN20btAlignedObjectArrayI18btOptimizedBvhNodeE8allocateEi.exit.i.i: ; preds = %call.i.i.i.i.noexc119, %if.then.i.i88
%27 = phi i32 [ %.pre.i91, %call.i.i.i.i.noexc119 ], [ %25, %if.then.i.i88 ]
%retval.0.i.i.i93 = phi ptr [ %call.i.i.i.i120, %call.i.i.i.i.noexc119 ], [ null, %if.then.i.i88 ]
%cmp7.i.i.i94 = icmp sgt i32 %27, 0
br i1 %cmp7.i.i.i94, label %for.body.lr.ph.i.i.i97, label %_ZNK20btAlignedObjectArrayI18btOptimizedBvhNodeE4copyEiiPS0_.exit.i.i
for.body.lr.ph.i.i.i97: ; preds = %_ZN20btAlignedObjectArrayI18btOptimizedBvhNodeE8allocateEi.exit.i.i
%m_data.i.i.i95 = getelementptr inbounds %class.btQuantizedBvh, ptr %this, i64 0, i32 9, i32 5
%wide.trip.count.i.i.i96 = zext i32 %27 to i64
%xtraiter = and i64 %wide.trip.count.i.i.i96, 1
%28 = icmp eq i32 %27, 1
br i1 %28, label %_ZNK20btAlignedObjectArrayI18btOptimizedBvhNodeE4copyEiiPS0_.exit.i.i.loopexit.unr-lcssa, label %for.body.lr.ph.i.i.i97.new
for.body.lr.ph.i.i.i97.new: ; preds = %for.body.lr.ph.i.i.i97
%unroll_iter = and i64 %wide.trip.count.i.i.i96, 4294967294
br label %for.body.i.i.i103
for.body.i.i.i103: ; preds = %for.body.i.i.i103, %for.body.lr.ph.i.i.i97.new
%indvars.iv.i.i.i98 = phi i64 [ 0, %for.body.lr.ph.i.i.i97.new ], [ %indvars.iv.next.i.i.i101.1, %for.body.i.i.i103 ]
%niter = phi i64 [ 0, %for.body.lr.ph.i.i.i97.new ], [ %niter.next.1, %for.body.i.i.i103 ]
%arrayidx.i.i.i99 = getelementptr inbounds %struct.btOptimizedBvhNode, ptr %retval.0.i.i.i93, i64 %indvars.iv.i.i.i98
%29 = load ptr, ptr %m_data.i.i.i95, align 8, !tbaa !40
%arrayidx3.i.i.i100 = getelementptr inbounds %struct.btOptimizedBvhNode, ptr %29, i64 %indvars.iv.i.i.i98
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(64) %arrayidx.i.i.i99, ptr noundef nonnull align 4 dereferenceable(64) %arrayidx3.i.i.i100, i64 64, i1 false), !tbaa.struct !41
%indvars.iv.next.i.i.i101 = or i64 %indvars.iv.i.i.i98, 1
%arrayidx.i.i.i99.1 = getelementptr inbounds %struct.btOptimizedBvhNode, ptr %retval.0.i.i.i93, i64 %indvars.iv.next.i.i.i101
%30 = load ptr, ptr %m_data.i.i.i95, align 8, !tbaa !40
%arrayidx3.i.i.i100.1 = getelementptr inbounds %struct.btOptimizedBvhNode, ptr %30, i64 %indvars.iv.next.i.i.i101
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(64) %arrayidx.i.i.i99.1, ptr noundef nonnull align 4 dereferenceable(64) %arrayidx3.i.i.i100.1, i64 64, i1 false), !tbaa.struct !41
%indvars.iv.next.i.i.i101.1 = add nuw nsw i64 %indvars.iv.i.i.i98, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %_ZNK20btAlignedObjectArrayI18btOptimizedBvhNodeE4copyEiiPS0_.exit.i.i.loopexit.unr-lcssa, label %for.body.i.i.i103
_ZNK20btAlignedObjectArrayI18btOptimizedBvhNodeE4copyEiiPS0_.exit.i.i.loopexit.unr-lcssa: ; preds = %for.body.i.i.i103, %for.body.lr.ph.i.i.i97
%indvars.iv.i.i.i98.unr = phi i64 [ 0, %for.body.lr.ph.i.i.i97 ], [ %indvars.iv.next.i.i.i101.1, %for.body.i.i.i103 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %_ZNK20btAlignedObjectArrayI18btOptimizedBvhNodeE4copyEiiPS0_.exit.i.i, label %for.body.i.i.i103.epil
for.body.i.i.i103.epil: ; preds = %_ZNK20btAlignedObjectArrayI18btOptimizedBvhNodeE4copyEiiPS0_.exit.i.i.loopexit.unr-lcssa
%arrayidx.i.i.i99.epil = getelementptr inbounds %struct.btOptimizedBvhNode, ptr %retval.0.i.i.i93, i64 %indvars.iv.i.i.i98.unr
%31 = load ptr, ptr %m_data.i.i.i95, align 8, !tbaa !40
%arrayidx3.i.i.i100.epil = getelementptr inbounds %struct.btOptimizedBvhNode, ptr %31, i64 %indvars.iv.i.i.i98.unr
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(64) %arrayidx.i.i.i99.epil, ptr noundef nonnull align 4 dereferenceable(64) %arrayidx3.i.i.i100.epil, i64 64, i1 false), !tbaa.struct !41
br label %_ZNK20btAlignedObjectArrayI18btOptimizedBvhNodeE4copyEiiPS0_.exit.i.i
_ZNK20btAlignedObjectArrayI18btOptimizedBvhNodeE4copyEiiPS0_.exit.i.i: ; preds = %for.body.i.i.i103.epil, %_ZNK20btAlignedObjectArrayI18btOptimizedBvhNodeE4copyEiiPS0_.exit.i.i.loopexit.unr-lcssa, %_ZN20btAlignedObjectArrayI18btOptimizedBvhNodeE8allocateEi.exit.i.i
%m_data.i9.i.i104 = getelementptr inbounds %class.btQuantizedBvh, ptr %this, i64 0, i32 9, i32 5
%32 = load ptr, ptr %m_data.i9.i.i104, align 8, !tbaa !40
%tobool.not.i10.i.i105 = icmp eq ptr %32, null
%m_ownsMemory.i.i.i106 = getelementptr inbounds %class.btQuantizedBvh, ptr %this, i64 0, i32 9, i32 6
%33 = load i8, ptr %m_ownsMemory.i.i.i106, align 8, !range !32
%tobool2.not.i.i.i107 = icmp eq i8 %33, 0
%or.cond.i.i108 = select i1 %tobool.not.i10.i.i105, i1 true, i1 %tobool2.not.i.i.i107
br i1 %or.cond.i.i108, label %if.end.i110, label %if.then3.i.i.i109
if.then3.i.i.i109: ; preds = %_ZNK20btAlignedObjectArrayI18btOptimizedBvhNodeE4copyEiiPS0_.exit.i.i
invoke void @_Z21btAlignedFreeInternalPv(ptr noundef nonnull %32)
to label %if.end.i110 unwind label %lpad37
if.end.i110: ; preds = %if.then3.i.i.i109, %_ZNK20btAlignedObjectArrayI18btOptimizedBvhNodeE4copyEiiPS0_.exit.i.i
store i8 1, ptr %m_ownsMemory.i.i.i106, align 8, !tbaa !42
store ptr %retval.0.i.i.i93, ptr %m_data.i9.i.i104, align 8, !tbaa !40
store i32 %mul35, ptr %m_capacity.i.i.i84, align 8, !tbaa !39
br label %for.body10.lr.ph.i113
for.body10.lr.ph.i113: ; preds = %if.end.i110, %if.then5.i86
%m_data11.i111 = getelementptr inbounds %class.btQuantizedBvh, ptr %this, i64 0, i32 9, i32 5
%34 = sext i32 %25 to i64
%wide.trip.count.i112 = sext i32 %mul35 to i64
%35 = sub nsw i64 %wide.trip.count.i112, %34
%36 = xor i64 %34, -1
%37 = add nsw i64 %36, %wide.trip.count.i112
%xtraiter178 = and i64 %35, 3
%lcmp.mod179.not = icmp eq i64 %xtraiter178, 0
br i1 %lcmp.mod179.not, label %for.body10.i118.prol.loopexit, label %for.body10.i118.prol
for.body10.i118.prol: ; preds = %for.body10.lr.ph.i113, %for.body10.i118.prol
%indvars.iv.i114.prol = phi i64 [ %indvars.iv.next.i116.prol, %for.body10.i118.prol ], [ %34, %for.body10.lr.ph.i113 ]
%prol.iter = phi i64 [ %prol.iter.next, %for.body10.i118.prol ], [ 0, %for.body10.lr.ph.i113 ]
%38 = load ptr, ptr %m_data11.i111, align 8, !tbaa !40
%arrayidx13.i115.prol = getelementptr inbounds %struct.btOptimizedBvhNode, ptr %38, i64 %indvars.iv.i114.prol
call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(64) %arrayidx13.i115.prol, i8 0, i64 64, i1 false)
%indvars.iv.next.i116.prol = add nsw i64 %indvars.iv.i114.prol, 1
%prol.iter.next = add i64 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter178
br i1 %prol.iter.cmp.not, label %for.body10.i118.prol.loopexit, label %for.body10.i118.prol, !llvm.loop !43
for.body10.i118.prol.loopexit: ; preds = %for.body10.i118.prol, %for.body10.lr.ph.i113
%indvars.iv.i114.unr = phi i64 [ %34, %for.body10.lr.ph.i113 ], [ %indvars.iv.next.i116.prol, %for.body10.i118.prol ]
%39 = icmp ult i64 %37, 3
br i1 %39, label %_ZN20btAlignedObjectArrayI18btOptimizedBvhNodeE6resizeEiRKS0_.exit, label %for.body10.i118
for.body10.i118: ; preds = %for.body10.i118.prol.loopexit, %for.body10.i118
%indvars.iv.i114 = phi i64 [ %indvars.iv.next.i116.3, %for.body10.i118 ], [ %indvars.iv.i114.unr, %for.body10.i118.prol.loopexit ]
%40 = load ptr, ptr %m_data11.i111, align 8, !tbaa !40
%arrayidx13.i115 = getelementptr inbounds %struct.btOptimizedBvhNode, ptr %40, i64 %indvars.iv.i114
call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(64) %arrayidx13.i115, i8 0, i64 64, i1 false)
%indvars.iv.next.i116 = add nsw i64 %indvars.iv.i114, 1
%41 = load ptr, ptr %m_data11.i111, align 8, !tbaa !40
%arrayidx13.i115.1 = getelementptr inbounds %struct.btOptimizedBvhNode, ptr %41, i64 %indvars.iv.next.i116
call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(64) %arrayidx13.i115.1, i8 0, i64 64, i1 false)
%indvars.iv.next.i116.1 = add nsw i64 %indvars.iv.i114, 2
%42 = load ptr, ptr %m_data11.i111, align 8, !tbaa !40
%arrayidx13.i115.2 = getelementptr inbounds %struct.btOptimizedBvhNode, ptr %42, i64 %indvars.iv.next.i116.1
call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(64) %arrayidx13.i115.2, i8 0, i64 64, i1 false)
%indvars.iv.next.i116.2 = add nsw i64 %indvars.iv.i114, 3
%43 = load ptr, ptr %m_data11.i111, align 8, !tbaa !40
%arrayidx13.i115.3 = getelementptr inbounds %struct.btOptimizedBvhNode, ptr %43, i64 %indvars.iv.next.i116.2
call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(64) %arrayidx13.i115.3, i8 0, i64 64, i1 false)
%indvars.iv.next.i116.3 = add nsw i64 %indvars.iv.i114, 4
%exitcond.not.i117.3 = icmp eq i64 %indvars.iv.next.i116.3, %wide.trip.count.i112
br i1 %exitcond.not.i117.3, label %_ZN20btAlignedObjectArrayI18btOptimizedBvhNodeE6resizeEiRKS0_.exit, label %for.body10.i118
_ZN20btAlignedObjectArrayI18btOptimizedBvhNodeE6resizeEiRKS0_.exit: ; preds = %for.body10.i118.prol.loopexit, %for.body10.i118, %invoke.cont31
store i32 %mul35, ptr %m_size.i.i80, align 4, !tbaa !38
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %aabbMax) #11
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %aabbMin) #11
call void @_ZN31btInternalTriangleIndexCallbackD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %callback11)
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %callback11) #11
br label %if.end
lpad30: ; preds = %if.else
%44 = landingpad { ptr, i32 }
cleanup
br label %ehcleanup41
lpad37: ; preds = %if.then3.i.i.i109, %if.then.i.i.i92
%45 = landingpad { ptr, i32 }
cleanup
br label %ehcleanup41
ehcleanup41: ; preds = %lpad37, %lpad30
%.pn = phi { ptr, i32 } [ %45, %lpad37 ], [ %44, %lpad30 ]
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %aabbMax) #11
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %aabbMin) #11
invoke void @_ZN31btInternalTriangleIndexCallbackD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %callback11)
to label %invoke.cont44 unwind label %terminate.lpad
invoke.cont44: ; preds = %ehcleanup41
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %callback11) #11
br label %ehcleanup67
if.end: ; preds = %_ZN20btAlignedObjectArrayI18btOptimizedBvhNodeE6resizeEiRKS0_.exit, %_ZN20btAlignedObjectArrayI18btQuantizedBvhNodeE6resizeEiRKS0_.exit
%numLeafNodes.0 = phi i32 [ %1, %_ZN20btAlignedObjectArrayI18btQuantizedBvhNodeE6resizeEiRKS0_.exit ], [ %24, %_ZN20btAlignedObjectArrayI18btOptimizedBvhNodeE6resizeEiRKS0_.exit ]
%m_curNodeIndex = getelementptr inbounds %class.btQuantizedBvh, ptr %this, i64 0, i32 5
store i32 0, ptr %m_curNodeIndex, align 4, !tbaa !44
call void @_ZN14btQuantizedBvh9buildTreeEii(ptr noundef nonnull align 8 dereferenceable(244) %this, i32 noundef 0, i32 noundef %numLeafNodes.0)
%46 = load i8, ptr %m_useQuantization, align 8, !tbaa !8, !range !32, !noundef !45
%tobool47.not = icmp eq i8 %46, 0
br i1 %tobool47.not, label %if.end62, label %land.lhs.true
land.lhs.true: ; preds = %if.end
%m_size.i122 = getelementptr inbounds %class.btQuantizedBvh, ptr %this, i64 0, i32 14, i32 2
%47 = load i32, ptr %m_size.i122, align 4, !tbaa !46
%tobool49.not = icmp eq i32 %47, 0
br i1 %tobool49.not, label %if.then50, label %if.end62
if.then50: ; preds = %land.lhs.true
%m_capacity.i.i = getelementptr inbounds %class.btQuantizedBvh, ptr %this, i64 0, i32 14, i32 3
%48 = load i32, ptr %m_capacity.i.i, align 8, !tbaa !47
%cmp.i124 = icmp eq i32 %48, 0
br i1 %cmp.i124, label %_ZN20btAlignedObjectArrayI16btBvhSubtreeInfoE8allocateEi.exit.i.i, label %_ZN20btAlignedObjectArrayI16btBvhSubtreeInfoE6expandERKS0_.exit
_ZN20btAlignedObjectArrayI16btBvhSubtreeInfoE8allocateEi.exit.i.i: ; preds = %if.then50
%call.i.i.i.i = call noundef ptr @_Z22btAlignedAllocInternalmi(i64 noundef 32, i32 noundef 16)
%.pre.i130 = load i32, ptr %m_size.i122, align 4, !tbaa !46
%cmp7.i.i.i133 = icmp sgt i32 %.pre.i130, 0
br i1 %cmp7.i.i.i133, label %for.body.lr.ph.i.i.i136, label %_ZNK20btAlignedObjectArrayI16btBvhSubtreeInfoE4copyEiiPS0_.exit.i.i
for.body.lr.ph.i.i.i136: ; preds = %_ZN20btAlignedObjectArrayI16btBvhSubtreeInfoE8allocateEi.exit.i.i
%m_data.i.i.i134 = getelementptr inbounds %class.btQuantizedBvh, ptr %this, i64 0, i32 14, i32 5
%wide.trip.count.i.i.i135 = zext i32 %.pre.i130 to i64
%xtraiter187 = and i64 %wide.trip.count.i.i.i135, 1
%49 = icmp eq i32 %.pre.i130, 1
br i1 %49, label %_ZNK20btAlignedObjectArrayI16btBvhSubtreeInfoE4copyEiiPS0_.exit.i.i.loopexit.unr-lcssa, label %for.body.lr.ph.i.i.i136.new
for.body.lr.ph.i.i.i136.new: ; preds = %for.body.lr.ph.i.i.i136
%unroll_iter189 = and i64 %wide.trip.count.i.i.i135, 4294967294
br label %for.body.i.i.i142
for.body.i.i.i142: ; preds = %for.body.i.i.i142, %for.body.lr.ph.i.i.i136.new
%indvars.iv.i.i.i137 = phi i64 [ 0, %for.body.lr.ph.i.i.i136.new ], [ %indvars.iv.next.i.i.i140.1, %for.body.i.i.i142 ]
%niter190 = phi i64 [ 0, %for.body.lr.ph.i.i.i136.new ], [ %niter190.next.1, %for.body.i.i.i142 ]
%arrayidx.i.i.i138 = getelementptr inbounds %class.btBvhSubtreeInfo, ptr %call.i.i.i.i, i64 %indvars.iv.i.i.i137
%50 = load ptr, ptr %m_data.i.i.i134, align 8, !tbaa !48
%arrayidx3.i.i.i139 = getelementptr inbounds %class.btBvhSubtreeInfo, ptr %50, i64 %indvars.iv.i.i.i137
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(32) %arrayidx.i.i.i138, ptr noundef nonnull align 4 dereferenceable(32) %arrayidx3.i.i.i139, i64 32, i1 false), !tbaa.struct !49
%indvars.iv.next.i.i.i140 = or i64 %indvars.iv.i.i.i137, 1
%arrayidx.i.i.i138.1 = getelementptr inbounds %class.btBvhSubtreeInfo, ptr %call.i.i.i.i, i64 %indvars.iv.next.i.i.i140
%51 = load ptr, ptr %m_data.i.i.i134, align 8, !tbaa !48
%arrayidx3.i.i.i139.1 = getelementptr inbounds %class.btBvhSubtreeInfo, ptr %51, i64 %indvars.iv.next.i.i.i140
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(32) %arrayidx.i.i.i138.1, ptr noundef nonnull align 4 dereferenceable(32) %arrayidx3.i.i.i139.1, i64 32, i1 false), !tbaa.struct !49
%indvars.iv.next.i.i.i140.1 = add nuw nsw i64 %indvars.iv.i.i.i137, 2
%niter190.next.1 = add i64 %niter190, 2
%niter190.ncmp.1 = icmp eq i64 %niter190.next.1, %unroll_iter189
br i1 %niter190.ncmp.1, label %_ZNK20btAlignedObjectArrayI16btBvhSubtreeInfoE4copyEiiPS0_.exit.i.i.loopexit.unr-lcssa, label %for.body.i.i.i142
_ZNK20btAlignedObjectArrayI16btBvhSubtreeInfoE4copyEiiPS0_.exit.i.i.loopexit.unr-lcssa: ; preds = %for.body.i.i.i142, %for.body.lr.ph.i.i.i136
%indvars.iv.i.i.i137.unr = phi i64 [ 0, %for.body.lr.ph.i.i.i136 ], [ %indvars.iv.next.i.i.i140.1, %for.body.i.i.i142 ]
%lcmp.mod188.not = icmp eq i64 %xtraiter187, 0
br i1 %lcmp.mod188.not, label %_ZNK20btAlignedObjectArrayI16btBvhSubtreeInfoE4copyEiiPS0_.exit.i.i, label %for.body.i.i.i142.epil
for.body.i.i.i142.epil: ; preds = %_ZNK20btAlignedObjectArrayI16btBvhSubtreeInfoE4copyEiiPS0_.exit.i.i.loopexit.unr-lcssa
%arrayidx.i.i.i138.epil = getelementptr inbounds %class.btBvhSubtreeInfo, ptr %call.i.i.i.i, i64 %indvars.iv.i.i.i137.unr
%52 = load ptr, ptr %m_data.i.i.i134, align 8, !tbaa !48
%arrayidx3.i.i.i139.epil = getelementptr inbounds %class.btBvhSubtreeInfo, ptr %52, i64 %indvars.iv.i.i.i137.unr
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(32) %arrayidx.i.i.i138.epil, ptr noundef nonnull align 4 dereferenceable(32) %arrayidx3.i.i.i139.epil, i64 32, i1 false), !tbaa.struct !49
br label %_ZNK20btAlignedObjectArrayI16btBvhSubtreeInfoE4copyEiiPS0_.exit.i.i
_ZNK20btAlignedObjectArrayI16btBvhSubtreeInfoE4copyEiiPS0_.exit.i.i: ; preds = %for.body.i.i.i142.epil, %_ZNK20btAlignedObjectArrayI16btBvhSubtreeInfoE4copyEiiPS0_.exit.i.i.loopexit.unr-lcssa, %_ZN20btAlignedObjectArrayI16btBvhSubtreeInfoE8allocateEi.exit.i.i
%m_data.i9.i.i143 = getelementptr inbounds %class.btQuantizedBvh, ptr %this, i64 0, i32 14, i32 5
%53 = load ptr, ptr %m_data.i9.i.i143, align 8, !tbaa !48
%tobool.not.i10.i.i144 = icmp eq ptr %53, null
%m_ownsMemory.i.i.i145 = getelementptr inbounds %class.btQuantizedBvh, ptr %this, i64 0, i32 14, i32 6
%54 = load i8, ptr %m_ownsMemory.i.i.i145, align 8, !range !32
%tobool2.not.i.i.i146 = icmp eq i8 %54, 0
%or.cond.i.i147 = select i1 %tobool.not.i10.i.i144, i1 true, i1 %tobool2.not.i.i.i146
br i1 %or.cond.i.i147, label %_ZN20btAlignedObjectArrayI16btBvhSubtreeInfoE10deallocateEv.exit.i.i, label %if.then3.i.i.i148
if.then3.i.i.i148: ; preds = %_ZNK20btAlignedObjectArrayI16btBvhSubtreeInfoE4copyEiiPS0_.exit.i.i
call void @_Z21btAlignedFreeInternalPv(ptr noundef nonnull %53)
br label %_ZN20btAlignedObjectArrayI16btBvhSubtreeInfoE10deallocateEv.exit.i.i
_ZN20btAlignedObjectArrayI16btBvhSubtreeInfoE10deallocateEv.exit.i.i: ; preds = %if.then3.i.i.i148, %_ZNK20btAlignedObjectArrayI16btBvhSubtreeInfoE4copyEiiPS0_.exit.i.i
store i8 1, ptr %m_ownsMemory.i.i.i145, align 8, !tbaa !50
store ptr %call.i.i.i.i, ptr %m_data.i9.i.i143, align 8, !tbaa !48
store i32 1, ptr %m_capacity.i.i, align 8, !tbaa !47
%.pre12.i = load i32, ptr %m_size.i122, align 4, !tbaa !46
%55 = add nsw i32 %.pre12.i, 1
br label %_ZN20btAlignedObjectArrayI16btBvhSubtreeInfoE6expandERKS0_.exit
_ZN20btAlignedObjectArrayI16btBvhSubtreeInfoE6expandERKS0_.exit: ; preds = %if.then50, %_ZN20btAlignedObjectArrayI16btBvhSubtreeInfoE10deallocateEv.exit.i.i
%inc.i = phi i32 [ %55, %_ZN20btAlignedObjectArrayI16btBvhSubtreeInfoE10deallocateEv.exit.i.i ], [ 1, %if.then50 ]
store i32 %inc.i, ptr %m_size.i122, align 4, !tbaa !46
%m_data.i = getelementptr inbounds %class.btQuantizedBvh, ptr %this, i64 0, i32 14, i32 5
%56 = load ptr, ptr %m_data.i, align 8, !tbaa !48
%m_data.i150 = getelementptr inbounds %class.btQuantizedBvh, ptr %this, i64 0, i32 11, i32 5
%57 = load ptr, ptr %m_data.i150, align 8, !tbaa !28
%58 = load i16, ptr %57, align 4, !tbaa !51
store i16 %58, ptr %56, align 4, !tbaa !51
%arrayidx5.i151 = getelementptr inbounds [3 x i16], ptr %57, i64 0, i64 1
%59 = load i16, ptr %arrayidx5.i151, align 2, !tbaa !51
%arrayidx7.i152 = getelementptr inbounds [3 x i16], ptr %56, i64 0, i64 1
store i16 %59, ptr %arrayidx7.i152, align 2, !tbaa !51
%arrayidx9.i = getelementptr inbounds [3 x i16], ptr %57, i64 0, i64 2
%60 = load i16, ptr %arrayidx9.i, align 4, !tbaa !51
%arrayidx11.i = getelementptr inbounds [3 x i16], ptr %56, i64 0, i64 2
store i16 %60, ptr %arrayidx11.i, align 4, !tbaa !51
%m_quantizedAabbMax.i = getelementptr inbounds %struct.btQuantizedBvhNode, ptr %57, i64 0, i32 1
%61 = load i16, ptr %m_quantizedAabbMax.i, align 2, !tbaa !51
%m_quantizedAabbMax13.i = getelementptr inbounds %class.btBvhSubtreeInfo, ptr %56, i64 0, i32 1
store i16 %61, ptr %m_quantizedAabbMax13.i, align 2, !tbaa !51
%arrayidx16.i = getelementptr inbounds %struct.btQuantizedBvhNode, ptr %57, i64 0, i32 1, i64 1
%62 = load i16, ptr %arrayidx16.i, align 4, !tbaa !51
%arrayidx18.i = getelementptr inbounds %class.btBvhSubtreeInfo, ptr %56, i64 0, i32 1, i64 1
store i16 %62, ptr %arrayidx18.i, align 4, !tbaa !51
%arrayidx20.i = getelementptr inbounds %struct.btQuantizedBvhNode, ptr %57, i64 0, i32 1, i64 2
%63 = load i16, ptr %arrayidx20.i, align 2, !tbaa !51
%arrayidx22.i = getelementptr inbounds %class.btBvhSubtreeInfo, ptr %56, i64 0, i32 1, i64 2
store i16 %63, ptr %arrayidx22.i, align 2, !tbaa !51
%m_rootNodeIndex = getelementptr inbounds %class.btBvhSubtreeInfo, ptr %56, i64 0, i32 2
store i32 0, ptr %m_rootNodeIndex, align 4, !tbaa !53
%m_escapeIndexOrTriangleIndex.i = getelementptr inbounds %struct.btQuantizedBvhNode, ptr %57, i64 0, i32 2
%64 = load i32, ptr %m_escapeIndexOrTriangleIndex.i, align 4, !tbaa !55
%cmp.i154 = icmp sgt i32 %64, -1
%sub.i = sub nsw i32 0, %64
%spec.select = select i1 %cmp.i154, i32 1, i32 %sub.i
%m_subtreeSize = getelementptr inbounds %class.btBvhSubtreeInfo, ptr %56, i64 0, i32 3
store i32 %spec.select, ptr %m_subtreeSize, align 4, !tbaa !57
br label %if.end62
if.end62: ; preds = %_ZN20btAlignedObjectArrayI16btBvhSubtreeInfoE6expandERKS0_.exit, %land.lhs.true, %if.end
%m_size.i157 = getelementptr inbounds %class.btQuantizedBvh, ptr %this, i64 0, i32 14, i32 2
%65 = load i32, ptr %m_size.i157, align 4, !tbaa !46
%m_subtreeHeaderCount = getelementptr inbounds %class.btQuantizedBvh, ptr %this, i64 0, i32 15
store i32 %65, ptr %m_subtreeHeaderCount, align 8, !tbaa !58
%m_data.i.i = getelementptr inbounds %class.btQuantizedBvh, ptr %this, i64 0, i32 10, i32 5
%66 = load ptr, ptr %m_data.i.i, align 8, !tbaa !28
%tobool.not.i.i158 = icmp eq ptr %66, null
%m_ownsMemory.i.i = getelementptr inbounds %class.btQuantizedBvh, ptr %this, i64 0, i32 10, i32 6
%67 = load i8, ptr %m_ownsMemory.i.i, align 8, !range !32
%tobool2.not.i.i = icmp eq i8 %67, 0
%or.cond.i = select i1 %tobool.not.i.i158, i1 true, i1 %tobool2.not.i.i
br i1 %or.cond.i, label %_ZN20btAlignedObjectArrayI18btQuantizedBvhNodeE5clearEv.exit, label %if.then3.i.i
if.then3.i.i: ; preds = %if.end62
call void @_Z21btAlignedFreeInternalPv(ptr noundef nonnull %66)
br label %_ZN20btAlignedObjectArrayI18btQuantizedBvhNodeE5clearEv.exit
_ZN20btAlignedObjectArrayI18btQuantizedBvhNodeE5clearEv.exit: ; preds = %if.end62, %if.then3.i.i
%m_size.i.i159 = getelementptr inbounds %class.btQuantizedBvh, ptr %this, i64 0, i32 10, i32 2
store i8 1, ptr %m_ownsMemory.i.i, align 8, !tbaa !33
store ptr null, ptr %m_data.i.i, align 8, !tbaa !28
store i32 0, ptr %m_size.i.i159, align 4, !tbaa !26
%m_capacity.i.i160 = getelementptr inbounds %class.btQuantizedBvh, ptr %this, i64 0, i32 10, i32 3
store i32 0, ptr %m_capacity.i.i160, align 8, !tbaa !27
%m_data.i.i161 = getelementptr inbounds %class.btQuantizedBvh, ptr %this, i64 0, i32 8, i32 5
%68 = load ptr, ptr %m_data.i.i161, align 8, !tbaa !40
%tobool.not.i.i162 = icmp eq ptr %68, null
%m_ownsMemory.i.i163 = getelementptr inbounds %class.btQuantizedBvh, ptr %this, i64 0, i32 8, i32 6
%69 = load i8, ptr %m_ownsMemory.i.i163, align 8, !range !32
%tobool2.not.i.i164 = icmp eq i8 %69, 0
%or.cond.i165 = select i1 %tobool.not.i.i162, i1 true, i1 %tobool2.not.i.i164
br i1 %or.cond.i165, label %_ZN20btAlignedObjectArrayI18btOptimizedBvhNodeE5clearEv.exit, label %if.then3.i.i166
if.then3.i.i166: ; preds = %_ZN20btAlignedObjectArrayI18btQuantizedBvhNodeE5clearEv.exit
call void @_Z21btAlignedFreeInternalPv(ptr noundef nonnull %68)
br label %_ZN20btAlignedObjectArrayI18btOptimizedBvhNodeE5clearEv.exit
_ZN20btAlignedObjectArrayI18btOptimizedBvhNodeE5clearEv.exit: ; preds = %_ZN20btAlignedObjectArrayI18btQuantizedBvhNodeE5clearEv.exit, %if.then3.i.i166
%m_size.i.i167 = getelementptr inbounds %class.btQuantizedBvh, ptr %this, i64 0, i32 8, i32 2
store i8 1, ptr %m_ownsMemory.i.i163, align 8, !tbaa !42
store ptr null, ptr %m_data.i.i161, align 8, !tbaa !40
store i32 0, ptr %m_size.i.i167, align 4, !tbaa !38
%m_capacity.i.i169 = getelementptr inbounds %class.btQuantizedBvh, ptr %this, i64 0, i32 8, i32 3
store i32 0, ptr %m_capacity.i.i169, align 8, !tbaa !39
ret void
ehcleanup67: ; preds = %invoke.cont44, %invoke.cont9
%.pn171.pn = phi { ptr, i32 } [ %.pn171, %invoke.cont9 ], [ %.pn, %invoke.cont44 ]
resume { ptr, i32 } %.pn171.pn
terminate.lpad: ; preds = %ehcleanup41, %ehcleanup
%70 = landingpad { ptr, i32 }
catch ptr null
%71 = extractvalue { ptr, i32 } %70, 0
call void @__clang_call_terminate(ptr %71) #10
unreachable
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3
declare void @_ZN14btQuantizedBvh21setQuantizationValuesERK9btVector3S2_f(ptr noundef nonnull align 8 dereferenceable(244), ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(16), float noundef) local_unnamed_addr #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3
declare void @_ZN31btInternalTriangleIndexCallbackD2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #1
declare void @_ZN14btQuantizedBvh9buildTreeEii(ptr noundef nonnull align 8 dereferenceable(244), i32 noundef, i32 noundef) local_unnamed_addr #1
; Function Attrs: uwtable
define dso_local void @_ZN14btOptimizedBvh5refitEP23btStridingMeshInterfaceRK9btVector3S4_(ptr noundef nonnull align 8 dereferenceable(244) %this, ptr noundef %meshInterface, ptr noundef nonnull align 4 dereferenceable(16) %aabbMin, ptr noundef nonnull align 4 dereferenceable(16) %aabbMax) local_unnamed_addr #0 align 2 {
entry:
%m_useQuantization = getelementptr inbounds %class.btQuantizedBvh, ptr %this, i64 0, i32 6
%0 = load i8, ptr %m_useQuantization, align 8, !tbaa !8, !range !32, !noundef !45
%tobool.not = icmp eq i8 %0, 0
br i1 %tobool.not, label %if.end, label %if.then
if.then: ; preds = %entry
tail call void @_ZN14btQuantizedBvh21setQuantizationValuesERK9btVector3S2_f(ptr noundef nonnull align 8 dereferenceable(244) %this, ptr noundef nonnull align 4 dereferenceable(16) %aabbMin, ptr noundef nonnull align 4 dereferenceable(16) %aabbMax, float noundef 1.000000e+00)
%m_curNodeIndex = getelementptr inbounds %class.btQuantizedBvh, ptr %this, i64 0, i32 5
%1 = load i32, ptr %m_curNodeIndex, align 4, !tbaa !44
tail call void @_ZN14btOptimizedBvh14updateBvhNodesEP23btStridingMeshInterfaceiii(ptr noundef nonnull align 8 dereferenceable(244) %this, ptr noundef %meshInterface, i32 noundef 0, i32 noundef %1, i32 poison)
%m_size.i = getelementptr inbounds %class.btQuantizedBvh, ptr %this, i64 0, i32 14, i32 2
%2 = load i32, ptr %m_size.i, align 4, !tbaa !46
%cmp11 = icmp sgt i32 %2, 0
br i1 %cmp11, label %for.body.lr.ph, label %if.end
for.body.lr.ph: ; preds = %if.then
%m_data.i = getelementptr inbounds %class.btQuantizedBvh, ptr %this, i64 0, i32 14, i32 5
%3 = load ptr, ptr %m_data.i, align 8, !tbaa !48
%m_data.i8 = getelementptr inbounds %class.btQuantizedBvh, ptr %this, i64 0, i32 11, i32 5
%4 = load ptr, ptr %m_data.i8, align 8, !tbaa !28
%wide.trip.count = zext i32 %2 to i64
br label %for.body
for.body: ; preds = %for.body.lr.ph, %for.body
%indvars.iv = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next, %for.body ]
%arrayidx.i = getelementptr inbounds %class.btBvhSubtreeInfo, ptr %3, i64 %indvars.iv
%m_rootNodeIndex = getelementptr inbounds %class.btBvhSubtreeInfo, ptr %3, i64 %indvars.iv, i32 2
%5 = load i32, ptr %m_rootNodeIndex, align 4, !tbaa !53
%idxprom.i9 = sext i32 %5 to i64
%arrayidx.i10 = getelementptr inbounds %struct.btQuantizedBvhNode, ptr %4, i64 %idxprom.i9
%6 = load i16, ptr %arrayidx.i10, align 4, !tbaa !51
store i16 %6, ptr %arrayidx.i, align 4, !tbaa !51
%arrayidx5.i = getelementptr inbounds [3 x i16], ptr %arrayidx.i10, i64 0, i64 1
%7 = load i16, ptr %arrayidx5.i, align 2, !tbaa !51
%arrayidx7.i = getelementptr inbounds [3 x i16], ptr %arrayidx.i, i64 0, i64 1
store i16 %7, ptr %arrayidx7.i, align 2, !tbaa !51
%arrayidx9.i = getelementptr inbounds [3 x i16], ptr %arrayidx.i10, i64 0, i64 2
%8 = load i16, ptr %arrayidx9.i, align 4, !tbaa !51
%arrayidx11.i = getelementptr inbounds [3 x i16], ptr %arrayidx.i, i64 0, i64 2
store i16 %8, ptr %arrayidx11.i, align 4, !tbaa !51
%m_quantizedAabbMax.i = getelementptr inbounds %struct.btQuantizedBvhNode, ptr %4, i64 %idxprom.i9, i32 1
%9 = load i16, ptr %m_quantizedAabbMax.i, align 2, !tbaa !51
%m_quantizedAabbMax13.i = getelementptr inbounds %class.btBvhSubtreeInfo, ptr %3, i64 %indvars.iv, i32 1
store i16 %9, ptr %m_quantizedAabbMax13.i, align 2, !tbaa !51
%arrayidx16.i = getelementptr inbounds %struct.btQuantizedBvhNode, ptr %4, i64 %idxprom.i9, i32 1, i64 1
%10 = load i16, ptr %arrayidx16.i, align 4, !tbaa !51
%arrayidx18.i = getelementptr inbounds %class.btBvhSubtreeInfo, ptr %3, i64 %indvars.iv, i32 1, i64 1
store i16 %10, ptr %arrayidx18.i, align 4, !tbaa !51
%arrayidx20.i = getelementptr inbounds %struct.btQuantizedBvhNode, ptr %4, i64 %idxprom.i9, i32 1, i64 2
%11 = load i16, ptr %arrayidx20.i, align 2, !tbaa !51
%arrayidx22.i = getelementptr inbounds %class.btBvhSubtreeInfo, ptr %3, i64 %indvars.iv, i32 1, i64 2
store i16 %11, ptr %arrayidx22.i, align 2, !tbaa !51
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %if.end, label %for.body
if.end: ; preds = %for.body, %if.then, %entry
ret void
}
; Function Attrs: uwtable
define dso_local void @_ZN14btOptimizedBvh14updateBvhNodesEP23btStridingMeshInterfaceiii(ptr nocapture noundef nonnull readonly align 8 dereferenceable(244) %this, ptr noundef %meshInterface, i32 noundef %firstNode, i32 noundef %endNode, i32 %index) local_unnamed_addr #5 align 2 {
entry:
%vertexbase = alloca ptr, align 8
%numverts = alloca i32, align 4
%type = alloca i32, align 4
%stride = alloca i32, align 4
%indexbase = alloca ptr, align 8
%indexstride = alloca i32, align 4
%numfaces = alloca i32, align 4
%indicestype = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %vertexbase) #11
store ptr null, ptr %vertexbase, align 8, !tbaa !22
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %numverts) #11
store i32 0, ptr %numverts, align 4, !tbaa !31
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %type) #11
store i32 2, ptr %type, align 4, !tbaa !59
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %stride) #11
store i32 0, ptr %stride, align 4, !tbaa !31
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %indexbase) #11
store ptr null, ptr %indexbase, align 8, !tbaa !22
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %indexstride) #11
store i32 0, ptr %indexstride, align 4, !tbaa !31
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %numfaces) #11
store i32 0, ptr %numfaces, align 4, !tbaa !31
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %indicestype) #11
store i32 2, ptr %indicestype, align 4, !tbaa !59
%m_scaling.i = getelementptr inbounds %class.btStridingMeshInterface, ptr %meshInterface, i64 0, i32 1
%cmp.not.not370 = icmp sgt i32 %endNode, %firstNode
br i1 %cmp.not.not370, label %for.body.lr.ph, label %if.end155
for.body.lr.ph: ; preds = %entry
%m_data.i = getelementptr inbounds %class.btQuantizedBvh, ptr %this, i64 0, i32 11, i32 5
%arrayidx.i327 = getelementptr inbounds %class.btStridingMeshInterface, ptr %meshInterface, i64 0, i32 1, i32 0, i64 1
%arrayidx.i328 = getelementptr inbounds %class.btStridingMeshInterface, ptr %meshInterface, i64 0, i32 1, i32 0, i64 2
%m_bvhAabbMin.i = getelementptr inbounds %class.btQuantizedBvh, ptr %this, i64 0, i32 1
%arrayidx13.i.i = getelementptr inbounds %class.btQuantizedBvh, ptr %this, i64 0, i32 1, i32 0, i64 2
%m_bvhQuantization.i = getelementptr inbounds %class.btQuantizedBvh, ptr %this, i64 0, i32 3
%arrayidx13.i46.i = getelementptr inbounds %class.btQuantizedBvh, ptr %this, i64 0, i32 3, i32 0, i64 2
%0 = sext i32 %endNode to i64
%1 = sext i32 %firstNode to i64
br label %for.body
for.body: ; preds = %for.body.lr.ph, %if.end147
%indvars.iv = phi i64 [ %0, %for.body.lr.ph ], [ %indvars.iv.next, %if.end147 ]
%curNodeSubPart.0372 = phi i32 [ -1, %for.body.lr.ph ], [ %curNodeSubPart.2, %if.end147 ]
%indvars.iv.next = add nsw i64 %indvars.iv, -1
%2 = load ptr, ptr %m_data.i, align 8, !tbaa !28
%arrayidx.i = getelementptr %struct.btQuantizedBvhNode, ptr %2, i64 %indvars.iv.next
%m_escapeIndexOrTriangleIndex.i = getelementptr inbounds %struct.btQuantizedBvhNode, ptr %2, i64 %indvars.iv.next, i32 2
%3 = load i32, ptr %m_escapeIndexOrTriangleIndex.i, align 4, !tbaa !55
%cmp.i = icmp sgt i32 %3, -1
br i1 %cmp.i, label %if.then, label %if.else78
if.then: ; preds = %for.body
%shr.i = lshr i32 %3, 21
%and.i = and i32 %3, 2097151
%cmp6.not = icmp eq i32 %shr.i, %curNodeSubPart.0372
br i1 %cmp6.not, label %if.end12, label %if.then7
if.then7: ; preds = %if.then
%cmp8 = icmp sgt i32 %curNodeSubPart.0372, -1
br i1 %cmp8, label %if.then9, label %if.end
if.then9: ; preds = %if.then7
%vtable = load ptr, ptr %meshInterface, align 8, !tbaa !5
%vfn = getelementptr inbounds ptr, ptr %vtable, i64 6
%4 = load ptr, ptr %vfn, align 8
call void %4(ptr noundef nonnull align 8 dereferenceable(24) %meshInterface, i32 noundef %curNodeSubPart.0372)
br label %if.end
if.end: ; preds = %if.then9, %if.then7
%vtable10 = load ptr, ptr %meshInterface, align 8, !tbaa !5
%vfn11 = getelementptr inbounds ptr, ptr %vtable10, i64 4
%5 = load ptr, ptr %vfn11, align 8
call void %5(ptr noundef nonnull align 8 dereferenceable(24) %meshInterface, ptr noundef nonnull %vertexbase, ptr noundef nonnull align 4 dereferenceable(4) %numverts, ptr noundef nonnull align 4 dereferenceable(4) %type, ptr noundef nonnull align 4 dereferenceable(4) %stride, ptr noundef nonnull %indexbase, ptr noundef nonnull align 4 dereferenceable(4) %indexstride, ptr noundef nonnull align 4 dereferenceable(4) %numfaces, ptr noundef nonnull align 4 dereferenceable(4) %indicestype, i32 noundef %shr.i)
br label %if.end12
if.end12: ; preds = %if.end, %if.then
%curNodeSubPart.1 = phi i32 [ %shr.i, %if.end ], [ %curNodeSubPart.0372, %if.then ]
%6 = load ptr, ptr %indexbase, align 8, !tbaa !22
%7 = load i32, ptr %indexstride, align 4, !tbaa !31
%mul = mul nsw i32 %7, %and.i
%idx.ext = sext i32 %mul to i64
%add.ptr = getelementptr inbounds i8, ptr %6, i64 %idx.ext
%8 = load i32, ptr %indicestype, align 4, !tbaa !59
%cmp16 = icmp eq i32 %8, 3
%9 = load i32, ptr %type, align 4, !tbaa !59
%cmp19 = icmp eq i32 %9, 0
%10 = load ptr, ptr %vertexbase, align 8
%11 = load i32, ptr %stride, align 4
%12 = load float, ptr %m_scaling.i, align 4, !tbaa !36
br i1 %cmp19, label %if.end12.split.us, label %if.end12.split
if.end12.split.us: ; preds = %if.end12
%13 = load float, ptr %arrayidx.i327, align 4, !tbaa !36
%14 = load float, ptr %arrayidx.i328, align 4, !tbaa !36
br i1 %cmp16, label %cond.true.us, label %cond.false.us
cond.false.us: ; preds = %if.end12.split.us
%arrayidx18.us = getelementptr inbounds i32, ptr %add.ptr, i64 2
%15 = load i32, ptr %arrayidx18.us, align 4, !tbaa !31
br label %cond.end.us
cond.true.us: ; preds = %if.end12.split.us
%arrayidx.us = getelementptr inbounds i16, ptr %add.ptr, i64 2
%16 = load i16, ptr %arrayidx.us, align 2, !tbaa !51
%conv.us = zext i16 %16 to i32
br label %cond.end.us
cond.end.us: ; preds = %cond.true.us, %cond.false.us
%cond.us = phi i32 [ %conv.us, %cond.true.us ], [ %15, %cond.false.us ]
%mul21.us = mul nsw i32 %11, %cond.us
%idx.ext22.us = sext i32 %mul21.us to i64
%add.ptr23.us = getelementptr inbounds i8, ptr %10, i64 %idx.ext22.us
%17 = load <2 x float>, ptr %add.ptr23.us, align 4, !tbaa !36
%18 = insertelement <2 x float> poison, float %12, i64 0
%19 = insertelement <2 x float> %18, float %13, i64 1
%20 = fmul <2 x float> %17, %19
%arrayidx33.us = getelementptr inbounds float, ptr %add.ptr23.us, i64 2
%21 = load float, ptr %arrayidx33.us, align 4, !tbaa !36
%mul35.us = fmul float %21, %14
br i1 %cmp16, label %cond.true.us.1, label %cond.false.us.1
cond.false.us.1: ; preds = %cond.end.us
%arrayidx18.us.1 = getelementptr inbounds i32, ptr %add.ptr, i64 1
%22 = load i32, ptr %arrayidx18.us.1, align 4, !tbaa !31
br label %cond.end.us.1
cond.true.us.1: ; preds = %cond.end.us
%arrayidx.us.1 = getelementptr inbounds i16, ptr %add.ptr, i64 1
%23 = load i16, ptr %arrayidx.us.1, align 2, !tbaa !51
%conv.us.1 = zext i16 %23 to i32
br label %cond.end.us.1
cond.end.us.1: ; preds = %cond.true.us.1, %cond.false.us.1
%cond.us.1 = phi i32 [ %conv.us.1, %cond.true.us.1 ], [ %22, %cond.false.us.1 ]
%mul21.us.1 = mul nsw i32 %11, %cond.us.1
%idx.ext22.us.1 = sext i32 %mul21.us.1 to i64
%add.ptr23.us.1 = getelementptr inbounds i8, ptr %10, i64 %idx.ext22.us.1
%24 = load <2 x float>, ptr %add.ptr23.us.1, align 4, !tbaa !36
%25 = fmul <2 x float> %24, %19
%arrayidx33.us.1 = getelementptr inbounds float, ptr %add.ptr23.us.1, i64 2
%26 = load float, ptr %arrayidx33.us.1, align 4, !tbaa !36
%mul35.us.1 = fmul float %26, %14
br i1 %cmp16, label %cond.true.us.2, label %cond.false.us.2
cond.false.us.2: ; preds = %cond.end.us.1
%27 = load i32, ptr %add.ptr, align 4, !tbaa !31
br label %cond.end.us.2
cond.true.us.2: ; preds = %cond.end.us.1
%28 = load i16, ptr %add.ptr, align 2, !tbaa !51
%conv.us.2 = zext i16 %28 to i32
br label %cond.end.us.2
cond.end.us.2: ; preds = %cond.true.us.2, %cond.false.us.2
%cond.us.2 = phi i32 [ %conv.us.2, %cond.true.us.2 ], [ %27, %cond.false.us.2 ]
%mul21.us.2 = mul nsw i32 %11, %cond.us.2
%idx.ext22.us.2 = sext i32 %mul21.us.2 to i64
%add.ptr23.us.2 = getelementptr inbounds i8, ptr %10, i64 %idx.ext22.us.2
%29 = load <2 x float>, ptr %add.ptr23.us.2, align 4, !tbaa !36
%30 = fmul <2 x float> %29, %19
%arrayidx33.us.2 = getelementptr inbounds float, ptr %add.ptr23.us.2, i64 2
%31 = load float, ptr %arrayidx33.us.2, align 4, !tbaa !36
%mul35.us.2 = fmul float %31, %14
br label %for.cond.cleanup
if.end12.split: ; preds = %if.end12
%32 = load float, ptr %arrayidx.i327, align 4, !tbaa !36
%33 = insertelement <2 x float> poison, float %12, i64 0
%34 = insertelement <2 x float> %33, float %32, i64 1
%35 = fpext <2 x float> %34 to <2 x double>
%36 = load float, ptr %arrayidx.i328, align 4, !tbaa !36
%conv58 = fpext float %36 to double
br i1 %cmp16, label %cond.true, label %cond.false
for.cond.cleanup: ; preds = %cond.end.2, %cond.end.us.2
%triangleVerts.sroa.30.0 = phi float [ %mul35.us, %cond.end.us.2 ], [ %conv60, %cond.end.2 ]
%triangleVerts.sroa.19.0 = phi float [ %mul35.us.1, %cond.end.us.2 ], [ %conv60.1, %cond.end.2 ]
%triangleVerts.sroa.8.0 = phi float [ %mul35.us.2, %cond.end.us.2 ], [ %conv60.2, %cond.end.2 ]
%37 = phi <2 x float> [ %20, %cond.end.us.2 ], [ %77, %cond.end.2 ]
%38 = phi <2 x float> [ %25, %cond.end.us.2 ], [ %83, %cond.end.2 ]
%39 = phi <2 x float> [ %30, %cond.end.us.2 ], [ %89, %cond.end.2 ]
%40 = fcmp olt <2 x float> %39, <float 0x43ABC16D60000000, float 0x43ABC16D60000000>
%cmp.i20.i = fcmp olt float %triangleVerts.sroa.8.0, 0x43ABC16D60000000
%aabbMin.sroa.18.0 = select i1 %cmp.i20.i, float %triangleVerts.sroa.8.0, float 0x43ABC16D60000000
%cmp.i20.i230 = fcmp ogt float %triangleVerts.sroa.8.0, 0xC3ABC16D60000000
%aabbMax.sroa.18.0 = select i1 %cmp.i20.i230, float %triangleVerts.sroa.8.0, float 0xC3ABC16D60000000
%cmp.i20.i245 = fcmp olt float %triangleVerts.sroa.19.0, %aabbMin.sroa.18.0
%aabbMin.sroa.18.1 = select i1 %cmp.i20.i245, float %triangleVerts.sroa.19.0, float %aabbMin.sroa.18.0
%cmp.i20.i263 = fcmp olt float %aabbMax.sroa.18.0, %triangleVerts.sroa.19.0
%aabbMax.sroa.18.1 = select i1 %cmp.i20.i263, float %triangleVerts.sroa.19.0, float %aabbMax.sroa.18.0
%cmp.i20.i281 = fcmp olt float %triangleVerts.sroa.30.0, %aabbMin.sroa.18.1
%aabbMin.sroa.18.2 = select i1 %cmp.i20.i281, float %triangleVerts.sroa.30.0, float %aabbMin.sroa.18.1
%cmp.i20.i299 = fcmp olt float %aabbMax.sroa.18.1, %triangleVerts.sroa.30.0
%aabbMax.sroa.18.2 = select i1 %cmp.i20.i299, float %triangleVerts.sroa.30.0, float %aabbMax.sroa.18.1
%41 = load float, ptr %arrayidx13.i.i, align 8, !tbaa !36
%sub14.i.i = fsub float %aabbMin.sroa.18.2, %41
%42 = load float, ptr %arrayidx13.i46.i, align 8, !tbaa !36
%mul14.i.i = fmul float %sub14.i.i, %42
%conv33.i = fptoui float %mul14.i.i to i16
%43 = and i16 %conv33.i, -2
%44 = select <2 x i1> %40, <2 x float> %39, <2 x float> <float 0x43ABC16D60000000, float 0x43ABC16D60000000>
%45 = fcmp olt <2 x float> %38, %44
%46 = select <2 x i1> %45, <2 x float> %38, <2 x float> %44
%47 = fcmp olt <2 x float> %37, %46
%48 = select <2 x i1> %47, <2 x float> %37, <2 x float> %46
%49 = load <2 x float>, ptr %m_bvhAabbMin.i, align 8, !tbaa !36
%50 = fsub <2 x float> %48, %49
%51 = load <2 x float>, ptr %m_bvhQuantization.i, align 8, !tbaa !36
%52 = fmul <2 x float> %50, %51
%53 = fptoui <2 x float> %52 to <2 x i16>
%54 = and <2 x i16> %53, <i16 -2, i16 -2>
store <2 x i16> %54, ptr %arrayidx.i, align 2
%55 = getelementptr inbounds i16, ptr %arrayidx.i, i64 2
store i16 %43, ptr %55, align 2
%m_quantizedAabbMax = getelementptr inbounds %struct.btQuantizedBvhNode, ptr %2, i64 %indvars.iv.next, i32 1
%56 = load float, ptr %arrayidx13.i.i, align 8, !tbaa !36
%sub14.i.i315 = fsub float %aabbMax.sroa.18.2, %56
%57 = load float, ptr %arrayidx13.i46.i, align 8, !tbaa !36
%mul14.i.i321 = fmul float %sub14.i.i315, %57
%add15.i = fadd float %mul14.i.i321, 1.000000e+00
%conv16.i = fptoui float %add15.i to i16
%58 = or i16 %conv16.i, 1
%59 = fcmp ogt <2 x float> %39, <float 0xC3ABC16D60000000, float 0xC3ABC16D60000000>
%60 = select <2 x i1> %59, <2 x float> %39, <2 x float> <float 0xC3ABC16D60000000, float 0xC3ABC16D60000000>
%61 = fcmp olt <2 x float> %60, %38
%62 = select <2 x i1> %61, <2 x float> %38, <2 x float> %60
%63 = fcmp olt <2 x float> %62, %37
%64 = select <2 x i1> %63, <2 x float> %37, <2 x float> %62
%65 = load <2 x float>, ptr %m_bvhAabbMin.i, align 8, !tbaa !36
%66 = fsub <2 x float> %64, %65
%67 = load <2 x float>, ptr %m_bvhQuantization.i, align 8, !tbaa !36
%68 = fmul <2 x float> %66, %67
%69 = fadd <2 x float> %68, <float 1.000000e+00, float 1.000000e+00>
%70 = fptoui <2 x float> %69 to <2 x i16>
%71 = or <2 x i16> %70, <i16 1, i16 1>
store <2 x i16> %71, ptr %m_quantizedAabbMax, align 2
%72 = getelementptr inbounds i16, ptr %m_quantizedAabbMax, i64 2
store i16 %58, ptr %72, align 2
br label %if.end147
cond.true: ; preds = %if.end12.split
%arrayidx = getelementptr inbounds i16, ptr %add.ptr, i64 2
%73 = load i16, ptr %arrayidx, align 2, !tbaa !51
%conv = zext i16 %73 to i32
br label %cond.end