Skip to content

Instantly share code, notes, and snippets.

@color-typea
Created September 23, 2023 03:36
Show Gist options
  • Save color-typea/495faeeaa5ccc5ec0270d11c48bc83e7 to your computer and use it in GitHub Desktop.
Save color-typea/495faeeaa5ccc5ec0270d11c48bc83e7 to your computer and use it in GitHub Desktop.
; ModuleID = '~/Projects/nil/zkllvm/examples/cpp/balances_tree.cpp'
source_filename = "~/Projects/nil//zkllvm/examples/cpp/balances_tree.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 = "assigner"
%"struct.std::__1::array" = type { [64 x i64] }
%"struct.std::__1::array.0" = type { [16 x <2 x __zkllvm_field_pallas_base>] }
%"struct.std::__1::array.1" = type { [64 x <2 x __zkllvm_field_pallas_base>] }
%"struct.std::__1::array.3" = type { [8 x <2 x __zkllvm_field_pallas_base>] }
%"struct.std::__1::array.7" = type { [32 x <2 x __zkllvm_field_pallas_base>] }
%"struct.nil::crypto3::hashes::sha2<256>::process" = type { i8 }
%"struct.std::__1::array.4" = type { [4 x <2 x __zkllvm_field_pallas_base>] }
%"struct.std::__1::array.5" = type { [2 x <2 x __zkllvm_field_pallas_base>] }
%"struct.std::__1::array.6" = type { [1 x <2 x __zkllvm_field_pallas_base>] }
$_Z10hash_layerILm16EEDv2_u26__zkllvm_field_pallas_baseNSt3__15arrayIS0_XT_EEE = comdat any
$_Z10hash_layerILm64EEDv2_u26__zkllvm_field_pallas_baseNSt3__15arrayIS0_XT_EEE = comdat any
$_ZN3nil7crypto34hashINS0_6hashes4sha2ILm256EEEEENT_10block_typeES6_S6_ = comdat any
$_Z10hash_layerILm8EEDv2_u26__zkllvm_field_pallas_baseNSt3__15arrayIS0_XT_EEE = comdat any
$_ZN3nil7crypto36hashes4sha2ILm256EE7processclEDv2_u26__zkllvm_field_pallas_baseS5_ = comdat any
$_Z10hash_layerILm4EEDv2_u26__zkllvm_field_pallas_baseNSt3__15arrayIS0_XT_EEE = comdat any
$_Z10hash_layerILm2EEDv2_u26__zkllvm_field_pallas_baseNSt3__15arrayIS0_XT_EEE = comdat any
$_Z10hash_layerILm32EEDv2_u26__zkllvm_field_pallas_baseNSt3__15arrayIS0_XT_EEE = comdat any
$_ZN3nil7crypto37algebra6fields17pallas_base_field12modulus_bitsE = comdat any
$_ZN3nil7crypto37algebra6fields17pallas_base_field11number_bitsE = comdat any
$_ZN3nil7crypto37algebra6fields17pallas_base_field10value_bitsE = comdat any
$_ZN3nil7crypto37algebra6fields16vesta_base_field12modulus_bitsE = comdat any
$_ZN3nil7crypto37algebra6fields16vesta_base_field11number_bitsE = comdat any
$_ZN3nil7crypto37algebra6fields16vesta_base_field10value_bitsE = comdat any
@_ZZN3nil7crypto314multiprecision8backends11window_bitsEmE5wsize = internal unnamed_addr constant [6 x [2 x i64]] [[2 x i64] [i64 1434, i64 7], [2 x i64] [i64 539, i64 6], [2 x i64] [i64 197, i64 4], [2 x i64] [i64 70, i64 3], [2 x i64] [i64 17, i64 2], [2 x i64] zeroinitializer], align 8
@_ZN3nil7crypto37algebra6fields17pallas_base_field12modulus_bitsE = weak_odr dso_local local_unnamed_addr constant i64 255, comdat, align 8
@_ZN3nil7crypto37algebra6fields17pallas_base_field11number_bitsE = weak_odr dso_local local_unnamed_addr constant i64 255, comdat, align 8
@_ZN3nil7crypto37algebra6fields17pallas_base_field10value_bitsE = weak_odr dso_local local_unnamed_addr constant i64 255, comdat, align 8
@_ZN3nil7crypto37algebra6fields16vesta_base_field12modulus_bitsE = weak_odr dso_local local_unnamed_addr constant i64 255, comdat, align 8
@_ZN3nil7crypto37algebra6fields16vesta_base_field11number_bitsE = weak_odr dso_local local_unnamed_addr constant i64 255, comdat, align 8
@_ZN3nil7crypto37algebra6fields16vesta_base_field10value_bitsE = weak_odr dso_local local_unnamed_addr constant i64 255, comdat, align 8
; Function Attrs: mustprogress nounwind
define dso_local noundef i64 @_ZN3nil7crypto314multiprecision8backends11window_bitsEm(i64 noundef %0) local_unnamed_addr #0 {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 5, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds [6 x [2 x i64]], ptr @_ZZN3nil7crypto314multiprecision8backends11window_bitsEmE5wsize, i64 0, i64 %3
%5 = load i64, ptr %4, align 8, !tbaa !3
%6 = icmp ugt i64 %5, %0
%7 = add i64 %3, -1
br i1 %6, label %2, label %8, !llvm.loop !7
8: ; preds = %2
%9 = getelementptr inbounds [2 x i64], ptr %4, i64 0, i64 1
%10 = load i64, ptr %9, align 8, !tbaa !3
%11 = add i64 1, %10
ret i64 %11
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nounwind
define dso_local noundef zeroext i1 @_Z7is_sameDv2_u26__zkllvm_field_pallas_baseS_(<2 x __zkllvm_field_pallas_base> noundef %0, <2 x __zkllvm_field_pallas_base> noundef %1) local_unnamed_addr #0 {
%3 = icmp eq <2 x __zkllvm_field_pallas_base> %0, %1
%4 = extractelement <2 x i1> %3, i32 0
%5 = icmp eq <2 x __zkllvm_field_pallas_base> %0, %1
%6 = extractelement <2 x i1> %5, i32 1
%7 = select i1 %4, i1 %6, i1 false
ret i1 %7
}
; Function Attrs: circuit mustprogress
define dso_local noundef zeroext i1 @_Z12balance_treeNSt3__15arrayIxLm64EEEDv2_u26__zkllvm_field_pallas_basey(ptr noundef byval(%"struct.std::__1::array") align 8 %0, <2 x __zkllvm_field_pallas_base> noundef %1, i64 noundef %2) local_unnamed_addr #2 {
%4 = alloca %"struct.std::__1::array.0", align 64
%5 = alloca %"struct.std::__1::array.0", align 64
%6 = alloca %"struct.std::__1::array.1", align 64
%7 = alloca %"struct.std::__1::array.1", align 64
call void @llvm.lifetime.start.p0(i64 1024, ptr %4) #3
br label %8
8: ; preds = %3, %8
%9 = phi i64 [ 0, %3 ], [ %31, %8 ]
%10 = mul i64 4, %9
%11 = call fastcc noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3__15arrayIxLm64EEixEm(ptr noundef nonnull align 8 dereferenceable(512) %0, i64 noundef %10) #3
%12 = load i64, ptr %11, align 8, !tbaa !10
%13 = call <64 x __zkllvm_field_pallas_base> @llvm.assigner.bit.decomposition64.v64__zkllvm_field_pallas_base.i64(i64 %12, i1 true)
%14 = add i64 %10, 1
%15 = call fastcc noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3__15arrayIxLm64EEixEm(ptr noundef nonnull align 8 dereferenceable(512) %0, i64 noundef %14) #3
%16 = load i64, ptr %15, align 8, !tbaa !10
%17 = call <64 x __zkllvm_field_pallas_base> @llvm.assigner.bit.decomposition64.v64__zkllvm_field_pallas_base.i64(i64 %16, i1 true)
%18 = add i64 %10, 2
%19 = call fastcc noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3__15arrayIxLm64EEixEm(ptr noundef nonnull align 8 dereferenceable(512) %0, i64 noundef %18) #3
%20 = load i64, ptr %19, align 8, !tbaa !10
%21 = call <64 x __zkllvm_field_pallas_base> @llvm.assigner.bit.decomposition64.v64__zkllvm_field_pallas_base.i64(i64 %20, i1 true)
%22 = add i64 %10, 3
%23 = call fastcc noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3__15arrayIxLm64EEixEm(ptr noundef nonnull align 8 dereferenceable(512) %0, i64 noundef %22) #3
%24 = load i64, ptr %23, align 8, !tbaa !10
%25 = call <64 x __zkllvm_field_pallas_base> @llvm.assigner.bit.decomposition64.v64__zkllvm_field_pallas_base.i64(i64 %24, i1 true)
%26 = call __zkllvm_field_pallas_base @llvm.assigner.bit.composition128.__zkllvm_field_pallas_base.v64__zkllvm_field_pallas_base(<64 x __zkllvm_field_pallas_base> %13, <64 x __zkllvm_field_pallas_base> %17, i1 true)
%27 = call __zkllvm_field_pallas_base @llvm.assigner.bit.composition128.__zkllvm_field_pallas_base.v64__zkllvm_field_pallas_base(<64 x __zkllvm_field_pallas_base> %21, <64 x __zkllvm_field_pallas_base> %25, i1 true)
%28 = insertelement <2 x __zkllvm_field_pallas_base> undef, __zkllvm_field_pallas_base %26, i32 0
%29 = insertelement <2 x __zkllvm_field_pallas_base> %28, __zkllvm_field_pallas_base %27, i32 1
%30 = call fastcc noundef nonnull align 64 dereferenceable(64) ptr @_ZNSt3__15arrayIDv2_u26__zkllvm_field_pallas_baseLm16EEixEm(ptr noundef nonnull align 64 dereferenceable(1024) %4, i64 noundef %9) #3
store <2 x __zkllvm_field_pallas_base> %29, ptr %30, align 64, !tbaa !12
%31 = add i64 %9, 1
%32 = icmp ult i64 %31, 16
br i1 %32, label %8, label %36, !llvm.loop !13
33: ; preds = %36
call void @llvm.memcpy.p0.p0.i64(ptr align 64 %5, ptr align 64 %4, i64 1024, i1 false), !tbaa.struct !14
%34 = call noundef <2 x __zkllvm_field_pallas_base> @_Z10hash_layerILm16EEDv2_u26__zkllvm_field_pallas_baseNSt3__15arrayIS0_XT_EEE(ptr noundef byval(%"struct.std::__1::array.0") align 64 %5)
call void @llvm.lifetime.start.p0(i64 4096, ptr %6) #3
%35 = call fastcc noundef nonnull align 64 dereferenceable(64) ptr @_ZNSt3__15arrayIDv2_u26__zkllvm_field_pallas_baseLm64EEixEm(ptr noundef nonnull align 64 dereferenceable(4096) %6, i64 noundef 0) #3
store <2 x __zkllvm_field_pallas_base> %34, ptr %35, align 64, !tbaa !12
call fastcc void @_ZNKSt3__15arrayIDv2_u26__zkllvm_field_pallas_baseLm39EEixEm() #3
call fastcc void @_ZNKSt3__15arrayIDv2_u26__zkllvm_field_pallas_baseLm39EEixEm() #3
br label %49
36: ; preds = %8, %36
%37 = phi i64 [ %41, %36 ], [ 0, %8 ]
%38 = phi i64 [ %42, %36 ], [ 0, %8 ]
%39 = call fastcc noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3__15arrayIxLm64EEixEm(ptr noundef nonnull align 8 dereferenceable(512) %0, i64 noundef %38) #3
%40 = load i64, ptr %39, align 8, !tbaa !10
%41 = add i64 %37, %40
%42 = add i64 %38, 1
%43 = icmp ult i64 %42, 64
br i1 %43, label %36, label %33, !llvm.loop !15
44: ; preds = %49
call void @llvm.memcpy.p0.p0.i64(ptr align 64 %7, ptr align 64 %6, i64 4096, i1 false), !tbaa.struct !16
%45 = call noundef <2 x __zkllvm_field_pallas_base> @_Z10hash_layerILm64EEDv2_u26__zkllvm_field_pallas_baseNSt3__15arrayIS0_XT_EEE(ptr noundef byval(%"struct.std::__1::array.1") align 64 %7)
%46 = call noundef zeroext i1 @_Z7is_sameDv2_u26__zkllvm_field_pallas_baseS_(<2 x __zkllvm_field_pallas_base> noundef %1, <2 x __zkllvm_field_pallas_base> noundef %45)
%47 = icmp eq i64 %2, %41
%48 = select i1 %46, i1 %47, i1 false
call void @llvm.lifetime.end.p0(i64 4096, ptr %6) #3
call void @llvm.lifetime.end.p0(i64 1024, ptr %4) #3
ret i1 %48
49: ; preds = %33, %49
%50 = phi i64 [ 1, %33 ], [ %52, %49 ]
%51 = call fastcc noundef nonnull align 64 dereferenceable(64) ptr @_ZNSt3__15arrayIDv2_u26__zkllvm_field_pallas_baseLm64EEixEm(ptr noundef nonnull align 64 dereferenceable(4096) %6, i64 noundef %50) #3
store <2 x __zkllvm_field_pallas_base> <__zkllvm_field_pallas_base f0x9EFDE052AA15429FAE05BAD4D0B1D7C6, __zkllvm_field_pallas_base f0x4DA64D03D7A1854A588C2CB8430C0D30>, ptr %51, align 64, !tbaa !12
%52 = add i64 %50, 1
%53 = icmp ult i64 %52, 64
br i1 %53, label %49, label %44, !llvm.loop !17
}
; Function Attrs: mustprogress nounwind
define internal fastcc noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3__15arrayIxLm64EEixEm(ptr noundef nonnull align 8 dereferenceable(512) %0, i64 noundef %1) unnamed_addr #0 align 2 {
%3 = getelementptr inbounds [64 x i64], ptr %0, i64 0, i64 %1
ret ptr %3
}
; Function Attrs: nounwind
declare <64 x __zkllvm_field_pallas_base> @llvm.assigner.bit.decomposition64.v64__zkllvm_field_pallas_base.i64(i64, i1) #3
; Function Attrs: nounwind
declare __zkllvm_field_pallas_base @llvm.assigner.bit.composition128.__zkllvm_field_pallas_base.v64__zkllvm_field_pallas_base(<64 x __zkllvm_field_pallas_base>, <64 x __zkllvm_field_pallas_base>, i1) #3
; Function Attrs: mustprogress nounwind
define internal fastcc noundef nonnull align 64 dereferenceable(64) ptr @_ZNSt3__15arrayIDv2_u26__zkllvm_field_pallas_baseLm16EEixEm(ptr noundef nonnull align 64 dereferenceable(1024) %0, i64 noundef %1) unnamed_addr #0 align 2 {
%3 = getelementptr inbounds [16 x <2 x __zkllvm_field_pallas_base>], ptr %0, i64 0, i64 %1
ret ptr %3
}
; Function Attrs: mustprogress
define linkonce_odr dso_local noundef <2 x __zkllvm_field_pallas_base> @_Z10hash_layerILm16EEDv2_u26__zkllvm_field_pallas_baseNSt3__15arrayIS0_XT_EEE(ptr noundef byval(%"struct.std::__1::array.0") align 64 %0) local_unnamed_addr #4 comdat {
%2 = alloca %"struct.std::__1::array.3", align 64
%3 = alloca %"struct.std::__1::array.3", align 64
call void @llvm.lifetime.start.p0(i64 512, ptr %2) #3
br label %6
4: ; preds = %6
call void @llvm.memcpy.p0.p0.i64(ptr align 64 %3, ptr align 64 %2, i64 512, i1 false), !tbaa.struct !18
%5 = call noundef <2 x __zkllvm_field_pallas_base> @_Z10hash_layerILm8EEDv2_u26__zkllvm_field_pallas_baseNSt3__15arrayIS0_XT_EEE(ptr noundef byval(%"struct.std::__1::array.3") align 64 %3)
call void @llvm.lifetime.end.p0(i64 512, ptr %2) #3
ret <2 x __zkllvm_field_pallas_base> %5
6: ; preds = %1, %6
%7 = phi i64 [ 0, %1 ], [ %16, %6 ]
%8 = mul i64 2, %7
%9 = call fastcc noundef nonnull align 64 dereferenceable(64) ptr @_ZNSt3__15arrayIDv2_u26__zkllvm_field_pallas_baseLm16EEixEm(ptr noundef nonnull align 64 dereferenceable(1024) %0, i64 noundef %8) #3
%10 = load <2 x __zkllvm_field_pallas_base>, ptr %9, align 64, !tbaa !12
%11 = add i64 %8, 1
%12 = call fastcc noundef nonnull align 64 dereferenceable(64) ptr @_ZNSt3__15arrayIDv2_u26__zkllvm_field_pallas_baseLm16EEixEm(ptr noundef nonnull align 64 dereferenceable(1024) %0, i64 noundef %11) #3
%13 = load <2 x __zkllvm_field_pallas_base>, ptr %12, align 64, !tbaa !12
%14 = call noundef <2 x __zkllvm_field_pallas_base> @_ZN3nil7crypto34hashINS0_6hashes4sha2ILm256EEEEENT_10block_typeES6_S6_(<2 x __zkllvm_field_pallas_base> noundef %10, <2 x __zkllvm_field_pallas_base> noundef %13)
%15 = call fastcc noundef nonnull align 64 dereferenceable(64) ptr @_ZNSt3__15arrayIDv2_u26__zkllvm_field_pallas_baseLm8EEixEm(ptr noundef nonnull align 64 dereferenceable(512) %2, i64 noundef %7) #3
store <2 x __zkllvm_field_pallas_base> %14, ptr %15, align 64, !tbaa !12
%16 = add i64 %7, 1
%17 = icmp ult i64 %16, 8
br i1 %17, label %6, label %4, !llvm.loop !19
}
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5
; Function Attrs: mustprogress nounwind
define internal fastcc noundef nonnull align 64 dereferenceable(64) ptr @_ZNSt3__15arrayIDv2_u26__zkllvm_field_pallas_baseLm64EEixEm(ptr noundef nonnull align 64 dereferenceable(4096) %0, i64 noundef %1) unnamed_addr #0 align 2 {
%3 = getelementptr inbounds [64 x <2 x __zkllvm_field_pallas_base>], ptr %0, i64 0, i64 %1
ret ptr %3
}
; Function Attrs: mustprogress nounwind
define internal fastcc void @_ZNKSt3__15arrayIDv2_u26__zkllvm_field_pallas_baseLm39EEixEm() unnamed_addr #0 align 2 {
ret void
}
; Function Attrs: mustprogress
define linkonce_odr dso_local noundef <2 x __zkllvm_field_pallas_base> @_Z10hash_layerILm64EEDv2_u26__zkllvm_field_pallas_baseNSt3__15arrayIS0_XT_EEE(ptr noundef byval(%"struct.std::__1::array.1") align 64 %0) local_unnamed_addr #4 comdat {
%2 = alloca %"struct.std::__1::array.7", align 64
%3 = alloca %"struct.std::__1::array.7", align 64
call void @llvm.lifetime.start.p0(i64 2048, ptr %2) #3
br label %6
4: ; preds = %6
call void @llvm.memcpy.p0.p0.i64(ptr align 64 %3, ptr align 64 %2, i64 2048, i1 false), !tbaa.struct !20
%5 = call noundef <2 x __zkllvm_field_pallas_base> @_Z10hash_layerILm32EEDv2_u26__zkllvm_field_pallas_baseNSt3__15arrayIS0_XT_EEE(ptr noundef byval(%"struct.std::__1::array.7") align 64 %3)
call void @llvm.lifetime.end.p0(i64 2048, ptr %2) #3
ret <2 x __zkllvm_field_pallas_base> %5
6: ; preds = %1, %6
%7 = phi i64 [ 0, %1 ], [ %16, %6 ]
%8 = mul i64 2, %7
%9 = call fastcc noundef nonnull align 64 dereferenceable(64) ptr @_ZNSt3__15arrayIDv2_u26__zkllvm_field_pallas_baseLm64EEixEm(ptr noundef nonnull align 64 dereferenceable(4096) %0, i64 noundef %8) #3
%10 = load <2 x __zkllvm_field_pallas_base>, ptr %9, align 64, !tbaa !12
%11 = add i64 %8, 1
%12 = call fastcc noundef nonnull align 64 dereferenceable(64) ptr @_ZNSt3__15arrayIDv2_u26__zkllvm_field_pallas_baseLm64EEixEm(ptr noundef nonnull align 64 dereferenceable(4096) %0, i64 noundef %11) #3
%13 = load <2 x __zkllvm_field_pallas_base>, ptr %12, align 64, !tbaa !12
%14 = call noundef <2 x __zkllvm_field_pallas_base> @_ZN3nil7crypto34hashINS0_6hashes4sha2ILm256EEEEENT_10block_typeES6_S6_(<2 x __zkllvm_field_pallas_base> noundef %10, <2 x __zkllvm_field_pallas_base> noundef %13)
%15 = call fastcc noundef nonnull align 64 dereferenceable(64) ptr @_ZNSt3__15arrayIDv2_u26__zkllvm_field_pallas_baseLm32EEixEm(ptr noundef nonnull align 64 dereferenceable(2048) %2, i64 noundef %7) #3
store <2 x __zkllvm_field_pallas_base> %14, ptr %15, align 64, !tbaa !12
%16 = add i64 %7, 1
%17 = icmp ult i64 %16, 32
br i1 %17, label %6, label %4, !llvm.loop !21
}
; Function Attrs: mustprogress
define linkonce_odr dso_local noundef <2 x __zkllvm_field_pallas_base> @_ZN3nil7crypto34hashINS0_6hashes4sha2ILm256EEEEENT_10block_typeES6_S6_(<2 x __zkllvm_field_pallas_base> noundef %0, <2 x __zkllvm_field_pallas_base> noundef %1) local_unnamed_addr #4 comdat {
%3 = alloca %"struct.nil::crypto3::hashes::sha2<256>::process", align 1
call void @llvm.lifetime.start.p0(i64 1, ptr %3) #3
%4 = call noundef <2 x __zkllvm_field_pallas_base> @_ZN3nil7crypto36hashes4sha2ILm256EE7processclEDv2_u26__zkllvm_field_pallas_baseS5_(ptr noundef nonnull align 1 dereferenceable(1) %3, <2 x __zkllvm_field_pallas_base> noundef %0, <2 x __zkllvm_field_pallas_base> noundef %1)
call void @llvm.lifetime.end.p0(i64 1, ptr %3) #3
ret <2 x __zkllvm_field_pallas_base> %4
}
; Function Attrs: mustprogress nounwind
define internal fastcc noundef nonnull align 64 dereferenceable(64) ptr @_ZNSt3__15arrayIDv2_u26__zkllvm_field_pallas_baseLm8EEixEm(ptr noundef nonnull align 64 dereferenceable(512) %0, i64 noundef %1) unnamed_addr #0 align 2 {
%3 = getelementptr inbounds [8 x <2 x __zkllvm_field_pallas_base>], ptr %0, i64 0, i64 %1
ret ptr %3
}
; Function Attrs: mustprogress
define linkonce_odr dso_local noundef <2 x __zkllvm_field_pallas_base> @_Z10hash_layerILm8EEDv2_u26__zkllvm_field_pallas_baseNSt3__15arrayIS0_XT_EEE(ptr noundef byval(%"struct.std::__1::array.3") align 64 %0) local_unnamed_addr #4 comdat {
%2 = alloca %"struct.std::__1::array.4", align 64
%3 = alloca %"struct.std::__1::array.4", align 64
call void @llvm.lifetime.start.p0(i64 256, ptr %2) #3
br label %6
4: ; preds = %6
call void @llvm.memcpy.p0.p0.i64(ptr align 64 %3, ptr align 64 %2, i64 256, i1 false), !tbaa.struct !22
%5 = call noundef <2 x __zkllvm_field_pallas_base> @_Z10hash_layerILm4EEDv2_u26__zkllvm_field_pallas_baseNSt3__15arrayIS0_XT_EEE(ptr noundef byval(%"struct.std::__1::array.4") align 64 %3)
call void @llvm.lifetime.end.p0(i64 256, ptr %2) #3
ret <2 x __zkllvm_field_pallas_base> %5
6: ; preds = %1, %6
%7 = phi i64 [ 0, %1 ], [ %16, %6 ]
%8 = mul i64 2, %7
%9 = call fastcc noundef nonnull align 64 dereferenceable(64) ptr @_ZNSt3__15arrayIDv2_u26__zkllvm_field_pallas_baseLm8EEixEm(ptr noundef nonnull align 64 dereferenceable(512) %0, i64 noundef %8) #3
%10 = load <2 x __zkllvm_field_pallas_base>, ptr %9, align 64, !tbaa !12
%11 = add i64 %8, 1
%12 = call fastcc noundef nonnull align 64 dereferenceable(64) ptr @_ZNSt3__15arrayIDv2_u26__zkllvm_field_pallas_baseLm8EEixEm(ptr noundef nonnull align 64 dereferenceable(512) %0, i64 noundef %11) #3
%13 = load <2 x __zkllvm_field_pallas_base>, ptr %12, align 64, !tbaa !12
%14 = call noundef <2 x __zkllvm_field_pallas_base> @_ZN3nil7crypto34hashINS0_6hashes4sha2ILm256EEEEENT_10block_typeES6_S6_(<2 x __zkllvm_field_pallas_base> noundef %10, <2 x __zkllvm_field_pallas_base> noundef %13)
%15 = call fastcc noundef nonnull align 64 dereferenceable(64) ptr @_ZNSt3__15arrayIDv2_u26__zkllvm_field_pallas_baseLm4EEixEm(ptr noundef nonnull align 64 dereferenceable(256) %2, i64 noundef %7) #3
store <2 x __zkllvm_field_pallas_base> %14, ptr %15, align 64, !tbaa !12
%16 = add i64 %7, 1
%17 = icmp ult i64 %16, 4
br i1 %17, label %6, label %4, !llvm.loop !23
}
; Function Attrs: mustprogress nounwind
define linkonce_odr dso_local noundef <2 x __zkllvm_field_pallas_base> @_ZN3nil7crypto36hashes4sha2ILm256EE7processclEDv2_u26__zkllvm_field_pallas_baseS5_(ptr noundef nonnull align 1 dereferenceable(1) %0, <2 x __zkllvm_field_pallas_base> noundef %1, <2 x __zkllvm_field_pallas_base> noundef %2) local_unnamed_addr #0 comdat align 2 {
%4 = tail call <2 x __zkllvm_field_pallas_base> @llvm.assigner.sha2.256.v2__zkllvm_field_pallas_base(<2 x __zkllvm_field_pallas_base> %1, <2 x __zkllvm_field_pallas_base> %2)
ret <2 x __zkllvm_field_pallas_base> %4
}
; Function Attrs: nounwind
declare <2 x __zkllvm_field_pallas_base> @llvm.assigner.sha2.256.v2__zkllvm_field_pallas_base(<2 x __zkllvm_field_pallas_base>, <2 x __zkllvm_field_pallas_base>) #3
; Function Attrs: mustprogress nounwind
define internal fastcc noundef nonnull align 64 dereferenceable(64) ptr @_ZNSt3__15arrayIDv2_u26__zkllvm_field_pallas_baseLm4EEixEm(ptr noundef nonnull align 64 dereferenceable(256) %0, i64 noundef %1) unnamed_addr #0 align 2 {
%3 = getelementptr inbounds [4 x <2 x __zkllvm_field_pallas_base>], ptr %0, i64 0, i64 %1
ret ptr %3
}
; Function Attrs: mustprogress
define linkonce_odr dso_local noundef <2 x __zkllvm_field_pallas_base> @_Z10hash_layerILm4EEDv2_u26__zkllvm_field_pallas_baseNSt3__15arrayIS0_XT_EEE(ptr noundef byval(%"struct.std::__1::array.4") align 64 %0) local_unnamed_addr #4 comdat {
%2 = alloca %"struct.std::__1::array.5", align 64
%3 = alloca %"struct.std::__1::array.5", align 64
call void @llvm.lifetime.start.p0(i64 128, ptr %2) #3
br label %6
4: ; preds = %6
call void @llvm.memcpy.p0.p0.i64(ptr align 64 %3, ptr align 64 %2, i64 128, i1 false), !tbaa.struct !24
%5 = call noundef <2 x __zkllvm_field_pallas_base> @_Z10hash_layerILm2EEDv2_u26__zkllvm_field_pallas_baseNSt3__15arrayIS0_XT_EEE(ptr noundef byval(%"struct.std::__1::array.5") align 64 %3)
call void @llvm.lifetime.end.p0(i64 128, ptr %2) #3
ret <2 x __zkllvm_field_pallas_base> %5
6: ; preds = %1, %6
%7 = phi i64 [ 0, %1 ], [ %16, %6 ]
%8 = mul i64 2, %7
%9 = call fastcc noundef nonnull align 64 dereferenceable(64) ptr @_ZNSt3__15arrayIDv2_u26__zkllvm_field_pallas_baseLm4EEixEm(ptr noundef nonnull align 64 dereferenceable(256) %0, i64 noundef %8) #3
%10 = load <2 x __zkllvm_field_pallas_base>, ptr %9, align 64, !tbaa !12
%11 = add i64 %8, 1
%12 = call fastcc noundef nonnull align 64 dereferenceable(64) ptr @_ZNSt3__15arrayIDv2_u26__zkllvm_field_pallas_baseLm4EEixEm(ptr noundef nonnull align 64 dereferenceable(256) %0, i64 noundef %11) #3
%13 = load <2 x __zkllvm_field_pallas_base>, ptr %12, align 64, !tbaa !12
%14 = call noundef <2 x __zkllvm_field_pallas_base> @_ZN3nil7crypto34hashINS0_6hashes4sha2ILm256EEEEENT_10block_typeES6_S6_(<2 x __zkllvm_field_pallas_base> noundef %10, <2 x __zkllvm_field_pallas_base> noundef %13)
%15 = call fastcc noundef nonnull align 64 dereferenceable(64) ptr @_ZNSt3__15arrayIDv2_u26__zkllvm_field_pallas_baseLm2EEixEm(ptr noundef nonnull align 64 dereferenceable(128) %2, i64 noundef %7) #3
store <2 x __zkllvm_field_pallas_base> %14, ptr %15, align 64, !tbaa !12
%16 = add i64 %7, 1
%17 = icmp ult i64 %16, 2
br i1 %17, label %6, label %4, !llvm.loop !25
}
; Function Attrs: mustprogress nounwind
define internal fastcc noundef nonnull align 64 dereferenceable(64) ptr @_ZNSt3__15arrayIDv2_u26__zkllvm_field_pallas_baseLm2EEixEm(ptr noundef nonnull align 64 dereferenceable(128) %0, i64 noundef %1) unnamed_addr #0 align 2 {
%3 = getelementptr inbounds [2 x <2 x __zkllvm_field_pallas_base>], ptr %0, i64 0, i64 %1
ret ptr %3
}
; Function Attrs: mustprogress
define linkonce_odr dso_local noundef <2 x __zkllvm_field_pallas_base> @_Z10hash_layerILm2EEDv2_u26__zkllvm_field_pallas_baseNSt3__15arrayIS0_XT_EEE(ptr noundef byval(%"struct.std::__1::array.5") align 64 %0) local_unnamed_addr #4 comdat {
%2 = alloca %"struct.std::__1::array.6", align 64
call void @llvm.lifetime.start.p0(i64 64, ptr %2) #3
%3 = call fastcc noundef nonnull align 64 dereferenceable(64) ptr @_ZNSt3__15arrayIDv2_u26__zkllvm_field_pallas_baseLm2EEixEm(ptr noundef nonnull align 64 dereferenceable(128) %0, i64 noundef 0) #3
%4 = load <2 x __zkllvm_field_pallas_base>, ptr %3, align 64, !tbaa !12
%5 = call fastcc noundef nonnull align 64 dereferenceable(64) ptr @_ZNSt3__15arrayIDv2_u26__zkllvm_field_pallas_baseLm2EEixEm(ptr noundef nonnull align 64 dereferenceable(128) %0, i64 noundef 1) #3
%6 = load <2 x __zkllvm_field_pallas_base>, ptr %5, align 64, !tbaa !12
%7 = call noundef <2 x __zkllvm_field_pallas_base> @_ZN3nil7crypto34hashINS0_6hashes4sha2ILm256EEEEENT_10block_typeES6_S6_(<2 x __zkllvm_field_pallas_base> noundef %4, <2 x __zkllvm_field_pallas_base> noundef %6)
%8 = call fastcc noundef nonnull align 64 dereferenceable(64) ptr @_ZNSt3__15arrayIDv2_u26__zkllvm_field_pallas_baseLm1EEixEm(ptr noundef nonnull align 64 dereferenceable(64) %2) #3
store <2 x __zkllvm_field_pallas_base> %7, ptr %8, align 64, !tbaa !12
%9 = call fastcc noundef nonnull align 64 dereferenceable(64) ptr @_ZNSt3__15arrayIDv2_u26__zkllvm_field_pallas_baseLm1EEixEm(ptr noundef nonnull align 64 dereferenceable(64) %2) #3
%10 = load <2 x __zkllvm_field_pallas_base>, ptr %9, align 64, !tbaa !12
call void @llvm.lifetime.end.p0(i64 64, ptr %2) #3
ret <2 x __zkllvm_field_pallas_base> %10
}
; Function Attrs: mustprogress nounwind
define internal fastcc noundef nonnull align 64 dereferenceable(64) ptr @_ZNSt3__15arrayIDv2_u26__zkllvm_field_pallas_baseLm1EEixEm(ptr noundef nonnull align 64 dereferenceable(64) %0) unnamed_addr #0 align 2 {
ret ptr %0
}
; Function Attrs: mustprogress nounwind
define internal fastcc noundef nonnull align 64 dereferenceable(64) ptr @_ZNSt3__15arrayIDv2_u26__zkllvm_field_pallas_baseLm32EEixEm(ptr noundef nonnull align 64 dereferenceable(2048) %0, i64 noundef %1) unnamed_addr #0 align 2 {
%3 = getelementptr inbounds [32 x <2 x __zkllvm_field_pallas_base>], ptr %0, i64 0, i64 %1
ret ptr %3
}
; Function Attrs: mustprogress
define linkonce_odr dso_local noundef <2 x __zkllvm_field_pallas_base> @_Z10hash_layerILm32EEDv2_u26__zkllvm_field_pallas_baseNSt3__15arrayIS0_XT_EEE(ptr noundef byval(%"struct.std::__1::array.7") align 64 %0) local_unnamed_addr #4 comdat {
%2 = alloca %"struct.std::__1::array.0", align 64
%3 = alloca %"struct.std::__1::array.0", align 64
call void @llvm.lifetime.start.p0(i64 1024, ptr %2) #3
br label %6
4: ; preds = %6
call void @llvm.memcpy.p0.p0.i64(ptr align 64 %3, ptr align 64 %2, i64 1024, i1 false), !tbaa.struct !14
%5 = call noundef <2 x __zkllvm_field_pallas_base> @_Z10hash_layerILm16EEDv2_u26__zkllvm_field_pallas_baseNSt3__15arrayIS0_XT_EEE(ptr noundef byval(%"struct.std::__1::array.0") align 64 %3)
call void @llvm.lifetime.end.p0(i64 1024, ptr %2) #3
ret <2 x __zkllvm_field_pallas_base> %5
6: ; preds = %1, %6
%7 = phi i64 [ 0, %1 ], [ %16, %6 ]
%8 = mul i64 2, %7
%9 = call fastcc noundef nonnull align 64 dereferenceable(64) ptr @_ZNSt3__15arrayIDv2_u26__zkllvm_field_pallas_baseLm32EEixEm(ptr noundef nonnull align 64 dereferenceable(2048) %0, i64 noundef %8) #3
%10 = load <2 x __zkllvm_field_pallas_base>, ptr %9, align 64, !tbaa !12
%11 = add i64 %8, 1
%12 = call fastcc noundef nonnull align 64 dereferenceable(64) ptr @_ZNSt3__15arrayIDv2_u26__zkllvm_field_pallas_baseLm32EEixEm(ptr noundef nonnull align 64 dereferenceable(2048) %0, i64 noundef %11) #3
%13 = load <2 x __zkllvm_field_pallas_base>, ptr %12, align 64, !tbaa !12
%14 = call noundef <2 x __zkllvm_field_pallas_base> @_ZN3nil7crypto34hashINS0_6hashes4sha2ILm256EEEEENT_10block_typeES6_S6_(<2 x __zkllvm_field_pallas_base> noundef %10, <2 x __zkllvm_field_pallas_base> noundef %13)
%15 = call fastcc noundef nonnull align 64 dereferenceable(64) ptr @_ZNSt3__15arrayIDv2_u26__zkllvm_field_pallas_baseLm16EEixEm(ptr noundef nonnull align 64 dereferenceable(1024) %2, i64 noundef %7) #3
store <2 x __zkllvm_field_pallas_base> %14, ptr %15, align 64, !tbaa !12
%16 = add i64 %7, 1
%17 = icmp ult i64 %16, 16
br i1 %17, label %6, label %4, !llvm.loop !26
}
attributes #0 = { mustprogress nounwind "frame-pointer"="all" "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { circuit mustprogress "frame-pointer"="all" "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
attributes #3 = { nounwind }
attributes #4 = { mustprogress "frame-pointer"="all" "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
attributes #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
!llvm.module.flags = !{!0, !1}
!llvm.ident = !{!2}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 7, !"frame-pointer", i32 2}
!2 = !{!"clang version 16.0.0 (git@github.com:NilFoundation/zkllvm-circifier.git f72301483aeb1d4857e621dd763092bbfab9a96f)"}
!3 = !{!4, !4, i64 0}
!4 = !{!"long", !5, i64 0}
!5 = !{!"omnipotent char", !6, i64 0}
!6 = !{!"Simple C++ TBAA"}
!7 = distinct !{!7, !8, !9}
!8 = !{!"llvm.loop.mustprogress"}
!9 = !{!"llvm.loop.unroll.disable"}
!10 = !{!11, !11, i64 0}
!11 = !{!"long long", !5, i64 0}
!12 = !{!5, !5, i64 0}
!13 = distinct !{!13, !8, !9}
!14 = !{i64 0, i64 1024, !12}
!15 = distinct !{!15, !8, !9}
!16 = !{i64 0, i64 4096, !12}
!17 = distinct !{!17, !8, !9}
!18 = !{i64 0, i64 512, !12}
!19 = distinct !{!19, !8, !9}
!20 = !{i64 0, i64 2048, !12}
!21 = distinct !{!21, !8, !9}
!22 = !{i64 0, i64 256, !12}
!23 = distinct !{!23, !8, !9}
!24 = !{i64 0, i64 128, !12}
!25 = distinct !{!25, !8, !9}
!26 = distinct !{!26, !8, !9}
[ { "array": [{"int": 1}, {"int": 2}, {"int": 3}, {"int": 4}, {"int": 5}, {"int": 6}, {"int": 7}, {"int": 8}, {"int": 9}, {"int": 10}, {"int": 11}, {"int": 12}, {"int": 13}, {"int": 14}, {"int": 15}, {"int": 16}, {"int": 17}, {"int": 18}, {"int": 19}, {"int": 20}, {"int": 21}, {"int": 22}, {"int": 23}, {"int": 24}, {"int": 25}, {"int": 26}, {"int": 27}, {"int": 28}, {"int": 29}, {"int": 30}, {"int": 31}, {"int": 32}, {"int": 1}, {"int": 2}, {"int": 3}, {"int": 4}, {"int": 5}, {"int": 6}, {"int": 7}, {"int": 8}, {"int": 9}, {"int": 10}, {"int": 11}, {"int": 12}, {"int": 13}, {"int": 14}, {"int": 15}, {"int": 16}, {"int": 17}, {"int": 18}, {"int": 19}, {"int": 20}, {"int": 21}, {"int": 22}, {"int": 23}, {"int": 24}, {"int": 25}, {"int": 26}, {"int": 27}, {"int": 28}, {"int": 29}, {"int": 30}, {"int": 31}, {"int": 32}] },
{ "vector": [{"field": "326522724692461750427768532537390503835"},{"field": "89059515727727869117346995944635890507"}] },
{ "int": 180 }]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment