; LLVM IR from gost-engine/engine :: gostsum (main)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.gost_subst_block = type { [16 x i8], [16 x i8], [16 x i8], [16 x i8], [16 x i8], [16 x i8], [16 x i8], [16 x i8] }
%struct.gost_hash_ctx = type { i64, ptr, i32, [32 x i8], [32 x i8], [32 x i8] }

@stderr = external global ptr, align 8
@GostR3411_94_CryptoProParamSet = external global %struct.gost_subst_block, align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@GostR3411_94_TestParamSet = external global %struct.gost_subst_block, align 1
@optarg = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [18 x i8], align 1
@optopt = external global i32, align 4
@optind = external global i32, align 4
@.str.4 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @help() #0

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #1

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #2

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca %struct.gost_hash_ctx, align 8
  %14 = alloca [65 x i8], align 16
  %15 = alloca [65 x i8], align 16
  %16 = alloca [4096 x i8], align 16
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca [65 x i8], align 16
  %20 = alloca [65 x i8], align 16
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  store ptr @GostR3411_94_CryptoProParamSet, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  store ptr null, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 120, ptr %13) #6
  br label %21

21:                                               ; preds = %51, %2
  %22 = load i32, ptr %4, align 4, !tbaa !5
  %23 = load ptr, ptr %5, align 8, !tbaa !9
  %24 = call i32 @getopt(i32 noundef %22, ptr noundef %23, ptr noundef @.str.1) #6
  store i32 %24, ptr %6, align 4, !tbaa !5
  %25 = icmp ne i32 %24, -1
  br i1 %25, label %26, label %52

26:                                               ; preds = %21
  %27 = load i32, ptr %6, align 4, !tbaa !5
  switch i32 %27, label %47 [
    i32 118, label %28
    i32 116, label %29
    i32 98, label %30
    i32 99, label %33
  ]

28:                                               ; preds = %26
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %51

29:                                               ; preds = %26
  store ptr @GostR3411_94_TestParamSet, ptr %11, align 8, !tbaa !9
  br label %51

30:                                               ; preds = %26
  %31 = load i32, ptr %10, align 4, !tbaa !5
  %32 = or i32 %31, 0
  store i32 %32, ptr %10, align 4, !tbaa !5
  br label %51

33:                                               ; preds = %26
  %34 = load ptr, ptr @optarg, align 8, !tbaa !9
  %35 = icmp ne ptr %34, null
  br i1 %35, label %36, label %44

36:                                               ; preds = %33
  %37 = load ptr, ptr @optarg, align 8, !tbaa !9
  %38 = call noalias ptr @fopen(ptr noundef %37, ptr noundef @.str.2)
  store ptr %38, ptr %12, align 8, !tbaa !9
  %39 = load ptr, ptr %12, align 8, !tbaa !9
  %40 = icmp ne ptr %39, null
  br i1 %40, label %43, label %41

41:                                               ; preds = %36
  %42 = load ptr, ptr @optarg, align 8, !tbaa !9
  call void @perror(ptr noundef %42)
  call void @exit(i32 noundef 2) #7
  unreachable

43:                                               ; preds = %36
  br label %46

44:                                               ; preds = %33
  %45 = load ptr, ptr @stdin, align 8, !tbaa !9
  store ptr %45, ptr %12, align 8, !tbaa !9
  br label %46

46:                                               ; preds = %44, %43
  br label %51

47:                                               ; preds = %26
  %48 = load ptr, ptr @stderr, align 8, !tbaa !9
  %49 = load i32, ptr @optopt, align 4, !tbaa !5
  %50 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %48, ptr noundef @.str.3, i32 noundef %49) #6
  call void @help()
  br label %51

51:                                               ; preds = %47, %46, %30, %29, %28
  br label %21, !llvm.loop !11

52:                                               ; preds = %21
  %53 = load ptr, ptr %11, align 8, !tbaa !9
  %54 = call i32 @init_gost_hash_ctx(ptr noundef %13, ptr noundef %53)
  %55 = load ptr, ptr %12, align 8, !tbaa !9
  %56 = icmp ne ptr %55, null
  br i1 %56, label %57, label %165

57:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 65, ptr %14) #6
  call void @llvm.lifetime.start.p0(i64 65, ptr %15) #6
  call void @llvm.lifetime.start.p0(i64 4096, ptr %16) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 0, ptr %17, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  store i32 0, ptr %18, align 4, !tbaa !5
  store i32 0, ptr %9, align 4, !tbaa !5
  %58 = load ptr, ptr %12, align 8, !tbaa !9
  %59 = load ptr, ptr @stdin, align 8, !tbaa !9
  %60 = icmp eq ptr %58, %59
  br i1 %60, label %61, label %81

61:                                               ; preds = %57
  %62 = load i32, ptr @optind, align 4, !tbaa !5
  %63 = load i32, ptr %4, align 4, !tbaa !5
  %64 = icmp slt i32 %62, %63
  br i1 %64, label %65, label %81

65:                                               ; preds = %61
  %66 = load ptr, ptr %5, align 8, !tbaa !9
  %67 = load i32, ptr @optind, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds ptr, ptr %66, i64 %68
  %70 = load ptr, ptr %69, align 8, !tbaa !9
  %71 = call noalias ptr @fopen(ptr noundef %70, ptr noundef @.str.2)
  store ptr %71, ptr %12, align 8, !tbaa !9
  %72 = load ptr, ptr %12, align 8, !tbaa !9
  %73 = icmp ne ptr %72, null
  br i1 %73, label %80, label %74

74:                                               ; preds = %65
  %75 = load ptr, ptr %5, align 8, !tbaa !9
  %76 = load i32, ptr @optind, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds ptr, ptr %75, i64 %77
  %79 = load ptr, ptr %78, align 8, !tbaa !9
  call void @perror(ptr noundef %79)
  call void @exit(i32 noundef 2) #7
  unreachable

80:                                               ; preds = %65
  br label %81

81:                                               ; preds = %80, %61, %57
  br label %82

82:                                               ; preds = %129, %96, %81
  %83 = load ptr, ptr %12, align 8, !tbaa !9
  %84 = getelementptr inbounds [65 x i8], ptr %14, i64 0, i64 0
  %85 = getelementptr inbounds [4096 x i8], ptr %16, i64 0, i64 0
  %86 = call i32 @get_line(ptr noundef %83, ptr noundef %84, ptr noundef %85)
  %87 = icmp ne i32 %86, 0
  br i1 %87, label %88, label %130

88:                                               ; preds = %82
  %89 = load i32, ptr %18, align 4, !tbaa !5
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %18, align 4, !tbaa !5
  %91 = getelementptr inbounds [4096 x i8], ptr %16, i64 0, i64 0
  %92 = getelementptr inbounds [65 x i8], ptr %15, i64 0, i64 0
  %93 = load i32, ptr %10, align 4, !tbaa !5
  %94 = call i32 @hash_file(ptr noundef %13, ptr noundef %91, ptr noundef %92, i32 noundef %93)
  %95 = icmp ne i32 %94, 0
  br i1 %95, label %99, label %96

96:                                               ; preds = %88
  %97 = load i32, ptr %9, align 4, !tbaa !5
  %98 = add nsw i32 %97, 1
  store i32 %98, ptr %9, align 4, !tbaa !5
  br label %82, !llvm.loop !13

99:                                               ; preds = %88
  %100 = getelementptr inbounds [65 x i8], ptr %15, i64 0, i64 0
  %101 = getelementptr inbounds [65 x i8], ptr %14, i64 0, i64 0
  %102 = call i32 @strncmp(ptr noundef %100, ptr noundef %101, i64 noundef 65) #8
  %103 = icmp eq i32 %102, 0
  br i1 %103, label %104, label %112

104:                                              ; preds = %99
  %105 = load i32, ptr %8, align 4, !tbaa !5
  %106 = icmp ne i32 %105, 0
  br i1 %106, label %107, label %111

107:                                              ; preds = %104
  %108 = load ptr, ptr @stderr, align 8, !tbaa !9
  %109 = getelementptr inbounds [4096 x i8], ptr %16, i64 0, i64 0
  %110 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %108, ptr noundef @.str.4, ptr noundef %109) #6
  br label %111

111:                                              ; preds = %107, %104
  br label %129

112:                                              ; preds = %99
  %113 = load i32, ptr %8, align 4, !tbaa !5
  %114 = icmp ne i32 %113, 0
  br i1 %114, label %115, label %119

115:                                              ; preds = %112
  %116 = load ptr, ptr @stderr, align 8, !tbaa !9
  %117 = getelementptr inbounds [4096 x i8], ptr %16, i64 0, i64 0
  %118 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %116, ptr noundef @.str.5, ptr noundef %117) #6
  br label %126

119:                                              ; preds = %112
  %120 = load ptr, ptr @stderr, align 8, !tbaa !9
  %121 = load ptr, ptr %5, align 8, !tbaa !9
  %122 = getelementptr inbounds ptr, ptr %121, i64 0
  %123 = load ptr, ptr %122, align 8, !tbaa !9
  %124 = getelementptr inbounds [4096 x i8], ptr %16, i64 0, i64 0
  %125 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %120, ptr noundef @.str.6, ptr noundef %123, ptr noundef %124) #6
  br label %126

126:                                              ; preds = %119, %115
  %127 = load i32, ptr %17, align 4, !tbaa !5
  %128 = add nsw i32 %127, 1
  store i32 %128, ptr %17, align 4, !tbaa !5
  br label %129

129:                                              ; preds = %126, %111
  br label %82, !llvm.loop !13

130:                                              ; preds = %82
  %131 = load i32, ptr %9, align 4, !tbaa !5
  %132 = icmp ne i32 %131, 0
  br i1 %132, label %133, label %141

133:                                              ; preds = %130
  %134 = load ptr, ptr @stderr, align 8, !tbaa !9
  %135 = load ptr, ptr %5, align 8, !tbaa !9
  %136 = getelementptr inbounds ptr, ptr %135, i64 0
  %137 = load ptr, ptr %136, align 8, !tbaa !9
  %138 = load i32, ptr %9, align 4, !tbaa !5
  %139 = load i32, ptr %18, align 4, !tbaa !5
  %140 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %134, ptr noundef @.str.7, ptr noundef %137, i32 noundef %138, i32 noundef %139) #6
  br label %141

141:                                              ; preds = %133, %130
  %142 = load i32, ptr %8, align 4, !tbaa !5
  %143 = icmp ne i32 %142, 0
  br i1 %143, label %144, label %155

144:                                              ; preds = %141
  %145 = load i32, ptr %17, align 4, !tbaa !5
  %146 = icmp ne i32 %145, 0
  br i1 %146, label %147, label %155

147:                                              ; preds = %144
  %148 = load ptr, ptr @stderr, align 8, !tbaa !9
  %149 = load ptr, ptr %5, align 8, !tbaa !9
  %150 = getelementptr inbounds ptr, ptr %149, i64 0
  %151 = load ptr, ptr %150, align 8, !tbaa !9
  %152 = load i32, ptr %17, align 4, !tbaa !5
  %153 = load i32, ptr %18, align 4, !tbaa !5
  %154 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %148, ptr noundef @.str.8, ptr noundef %151, i32 noundef %152, i32 noundef %153) #6
  br label %155

155:                                              ; preds = %147, %144, %141
  %156 = load i32, ptr %17, align 4, !tbaa !5
  %157 = icmp ne i32 %156, 0
  br i1 %157, label %161, label %158

158:                                              ; preds = %155
  %159 = load i32, ptr %9, align 4, !tbaa !5
  %160 = icmp ne i32 %159, 0
  br label %161

161:                                              ; preds = %158, %155
  %162 = phi i1 [ true, %155 ], [ %160, %158 ]
  %163 = zext i1 %162 to i64
  %164 = select i1 %162, i32 1, i32 0
  call void @exit(i32 noundef %164) #7
  unreachable

165:                                              ; preds = %52
  %166 = load i32, ptr @optind, align 4, !tbaa !5
  %167 = load i32, ptr %4, align 4, !tbaa !5
  %168 = icmp eq i32 %166, %167
  br i1 %168, label %169, label %179

169:                                              ; preds = %165
  call void @llvm.lifetime.start.p0(i64 65, ptr %19) #6
  %170 = load ptr, ptr @stdin, align 8, !tbaa !9
  %171 = call i32 @fileno(ptr noundef %170) #6
  %172 = getelementptr inbounds [65 x i8], ptr %19, i64 0, i64 0
  %173 = call i32 @hash_stream(ptr noundef %13, i32 noundef %171, ptr noundef %172)
  %174 = icmp ne i32 %173, 0
  br i1 %174, label %176, label %175

175:                                              ; preds = %169
  call void @perror(ptr noundef @.str.9)
  call void @exit(i32 noundef 1) #7
  unreachable

176:                                              ; preds = %169
  %177 = getelementptr inbounds [65 x i8], ptr %19, i64 0, i64 0
  %178 = call i32 (ptr, ...) @printf(ptr noundef @.str.10, ptr noundef %177)
  call void @exit(i32 noundef 0) #7
  unreachable

179:                                              ; preds = %165
  %180 = load i32, ptr @optind, align 4, !tbaa !5
  store i32 %180, ptr %7, align 4, !tbaa !5
  br label %181

181:                                              ; preds = %207, %179
  %182 = load i32, ptr %7, align 4, !tbaa !5
  %183 = load i32, ptr %4, align 4, !tbaa !5
  %184 = icmp slt i32 %182, %183
  br i1 %184, label %185, label %210

185:                                              ; preds = %181
  call void @llvm.lifetime.start.p0(i64 65, ptr %20) #6
  %186 = load ptr, ptr %5, align 8, !tbaa !9
  %187 = load i32, ptr %7, align 4, !tbaa !5
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds ptr, ptr %186, i64 %188
  %190 = load ptr, ptr %189, align 8, !tbaa !9
  %191 = getelementptr inbounds [65 x i8], ptr %20, i64 0, i64 0
  %192 = load i32, ptr %10, align 4, !tbaa !5
  %193 = call i32 @hash_file(ptr noundef %13, ptr noundef %190, ptr noundef %191, i32 noundef %192)
  %194 = icmp ne i32 %193, 0
  br i1 %194, label %198, label %195

195:                                              ; preds = %185
  %196 = load i32, ptr %9, align 4, !tbaa !5
  %197 = add nsw i32 %196, 1
  store i32 %197, ptr %9, align 4, !tbaa !5
  br label %206

198:                                              ; preds = %185
  %199 = getelementptr inbounds [65 x i8], ptr %20, i64 0, i64 0
  %200 = load ptr, ptr %5, align 8, !tbaa !9
  %201 = load i32, ptr %7, align 4, !tbaa !5
  %202 = sext i32 %201 to i64
  %203 = getelementptr inbounds ptr, ptr %200, i64 %202
  %204 = load ptr, ptr %203, align 8, !tbaa !9
  %205 = call i32 (ptr, ...) @printf(ptr noundef @.str.11, ptr noundef %199, ptr noundef %204)
  br label %206

206:                                              ; preds = %198, %195
  call void @llvm.lifetime.end.p0(i64 65, ptr %20) #6
  br label %207

207:                                              ; preds = %206
  %208 = load i32, ptr %7, align 4, !tbaa !5
  %209 = add nsw i32 %208, 1
  store i32 %209, ptr %7, align 4, !tbaa !5
  br label %181, !llvm.loop !14

210:                                              ; preds = %181
  %211 = load i32, ptr %9, align 4, !tbaa !5
  %212 = icmp ne i32 %211, 0
  %213 = zext i1 %212 to i64
  %214 = select i1 %212, i32 1, i32 0
  call void @exit(i32 noundef %214) #7
  unreachable
}

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3

; Function Attrs: nounwind
declare i32 @getopt(i32 noundef, ptr noundef, ptr noundef) #1

declare noalias ptr @fopen(ptr noundef, ptr noundef) #4

declare void @perror(ptr noundef) #4

declare i32 @init_gost_hash_ctx(ptr noundef, ptr noundef) #4

; Function Attrs: nounwind uwtable
declare dso_local i32 @get_line(ptr noundef, ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @hash_file(ptr noundef, ptr noundef, ptr noundef, i32 noundef) #0

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strncmp(ptr noundef, ptr noundef, i64 noundef) #5

; Function Attrs: nounwind uwtable
declare dso_local i32 @hash_stream(ptr noundef, i32 noundef, ptr noundef) #0

; Function Attrs: nounwind
declare i32 @fileno(ptr noundef) #1

declare i32 @printf(ptr noundef, ...) #4

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind willreturn memory(read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }
attributes #7 = { noreturn nounwind }
attributes #8 = { nounwind willreturn memory(read) }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.gost_subst_block = type { [16 x i8], [16 x i8], [16 x i8], [16 x i8], [16 x i8], [16 x i8], [16 x i8], [16 x i8] }
%struct.gost_hash_ctx = type { i64, ptr, i32, [32 x i8], [32 x i8], [32 x i8] }

@stderr = external local_unnamed_addr global ptr, align 8
@GostR3411_94_CryptoProParamSet = external global %struct.gost_subst_block, align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@GostR3411_94_TestParamSet = external global %struct.gost_subst_block, align 1
@optarg = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external local_unnamed_addr global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [18 x i8], align 1
@optopt = external local_unnamed_addr global i32, align 4
@optind = external local_unnamed_addr global i32, align 4
@.str.4 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @help() local_unnamed_addr #0

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #1

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #2

; Function Attrs: noreturn nounwind uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr noundef %1) local_unnamed_addr #3 {
  %3 = alloca %struct.gost_hash_ctx, align 8
  %4 = alloca [65 x i8], align 16
  %5 = alloca [65 x i8], align 16
  %6 = alloca [4096 x i8], align 16
  %7 = alloca [65 x i8], align 16
  %8 = alloca [65 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %3) #8
  br label %.outer

.outer:                                           ; preds = %10, %2
  %.not71 = phi i1 [ true, %2 ], [ false, %10 ]
  %9 = phi i1 [ false, %2 ], [ true, %10 ]
  %.045.ph = phi ptr [ @GostR3411_94_CryptoProParamSet, %2 ], [ %.045.ph204, %10 ]
  %.043.ph = phi ptr [ null, %2 ], [ %.043.ph207, %10 ]
  br label %.outer203

.outer203:                                        ; preds = %.outer, %12
  %.045.ph204 = phi ptr [ %.045.ph, %.outer ], [ @GostR3411_94_TestParamSet, %12 ]
  %.043.ph205 = phi ptr [ %.043.ph, %.outer ], [ %.043.ph207, %12 ]
  br label %.outer206

.outer206:                                        ; preds = %.outer206.backedge, %.outer203
  %.043.ph207 = phi ptr [ %.043.ph205, %.outer203 ], [ %.043.ph207.be, %.outer206.backedge ]
  br label %10

10:                                               ; preds = %.backedge, %.outer206
  %11 = tail call i32 @getopt(i32 noundef %0, ptr noundef %1, ptr noundef nonnull @.str.1) #8
  switch i32 %11, label %21 [
    i32 -1, label %25
    i32 118, label %.outer
    i32 116, label %12
    i32 98, label %.backedge
    i32 99, label %13
  ], !llvm.loop !5

12:                                               ; preds = %10
  br label %.outer203, !llvm.loop !5

13:                                               ; preds = %10
  %14 = load ptr, ptr @optarg, align 8, !tbaa !7
  %.not73 = icmp eq ptr %14, null
  br i1 %.not73, label %19, label %15

15:                                               ; preds = %13
  %16 = tail call noalias ptr @fopen(ptr noundef nonnull %14, ptr noundef nonnull @.str.2)
  %.not74 = icmp eq ptr %16, null
  br i1 %.not74, label %17, label %.outer206.backedge

.outer206.backedge:                               ; preds = %15, %19
  %.043.ph207.be = phi ptr [ %20, %19 ], [ %16, %15 ]
  br label %.outer206, !llvm.loop !5

17:                                               ; preds = %15
  %18 = load ptr, ptr @optarg, align 8, !tbaa !7
  tail call void @perror(ptr noundef %18) #9
  tail call void @exit(i32 noundef 2) #10
  unreachable

19:                                               ; preds = %13
  %20 = load ptr, ptr @stdin, align 8, !tbaa !7
  br label %.outer206.backedge

21:                                               ; preds = %10
  %22 = load ptr, ptr @stderr, align 8, !tbaa !7
  %23 = load i32, ptr @optopt, align 4, !tbaa !11
  %24 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %22, ptr noundef nonnull @.str.3, i32 noundef %23) #11
  tail call void @help()
  br label %.backedge

.backedge:                                        ; preds = %10, %21
  br label %10, !llvm.loop !5

25:                                               ; preds = %10
  %26 = call i32 @init_gost_hash_ctx(ptr noundef nonnull %3, ptr noundef nonnull %.045.ph204) #8
  %.not62 = icmp eq ptr %.043.ph207, null
  br i1 %.not62, label %87, label %27

27:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 65, ptr nonnull %4) #8
  call void @llvm.lifetime.start.p0(i64 65, ptr nonnull %5) #8
  call void @llvm.lifetime.start.p0(i64 4096, ptr nonnull %6) #8
  %28 = load ptr, ptr @stdin, align 8, !tbaa !7
  %29 = icmp eq ptr %.043.ph207, %28
  br i1 %29, label %30, label %43

30:                                               ; preds = %27
  %31 = load i32, ptr @optind, align 4, !tbaa !11
  %32 = icmp slt i32 %31, %0
  br i1 %32, label %33, label %43

33:                                               ; preds = %30
  %34 = sext i32 %31 to i64
  %35 = getelementptr inbounds ptr, ptr %1, i64 %34
  %36 = load ptr, ptr %35, align 8, !tbaa !7
  %37 = call noalias ptr @fopen(ptr noundef %36, ptr noundef nonnull @.str.2)
  %.not66 = icmp eq ptr %37, null
  br i1 %.not66, label %38, label %43

38:                                               ; preds = %33
  %39 = load i32, ptr @optind, align 4, !tbaa !11
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds ptr, ptr %1, i64 %40
  %42 = load ptr, ptr %41, align 8, !tbaa !7
  call void @perror(ptr noundef %42) #9
  call void @exit(i32 noundef 2) #10
  unreachable

43:                                               ; preds = %33, %30, %27
  %.2 = phi ptr [ %37, %33 ], [ %.043.ph207, %30 ], [ %.043.ph207, %27 ]
  %44 = call i32 @get_line(ptr noundef nonnull %.2, ptr noundef nonnull %4, ptr noundef nonnull %6)
  %.not678092 = icmp eq i32 %44, 0
  br i1 %.not678092, label %.thread, label %.lr.ph.lr.ph

.lr.ph.lr.ph:                                     ; preds = %43
  br i1 %.not71, label %.lr.ph.us.us, label %.lr.ph

.lr.ph.us.us:                                     ; preds = %.lr.ph.lr.ph, %.split.us.us.split.us.us
  %.0.ph95.us.us = phi i32 [ %46, %.split.us.us.split.us.us ], [ 0, %.lr.ph.lr.ph ]
  %.042.ph94.us.us = phi i32 [ %.04281.us.us.us.us, %.split.us.us.split.us.us ], [ 0, %.lr.ph.lr.ph ]
  %.049.ph93.us.us = phi i32 [ %58, %.split.us.us.split.us.us ], [ 0, %.lr.ph.lr.ph ]
  br label %45

45:                                               ; preds = %56, %.lr.ph.us.us
  %.082.us.us.us.us = phi i32 [ %.0.ph95.us.us, %.lr.ph.us.us ], [ %46, %56 ]
  %.04281.us.us.us.us = phi i32 [ %.042.ph94.us.us, %.lr.ph.us.us ], [ %.1.us.us.us.us, %56 ]
  %46 = add nsw i32 %.082.us.us.us.us, 1
  %47 = call i32 @hash_file(ptr noundef nonnull %3, ptr noundef nonnull %6, ptr noundef nonnull %5, i32 noundef 0)
  %.not70.us.us.us.us = icmp eq i32 %47, 0
  br i1 %.not70.us.us.us.us, label %.split.us.us.split.us.us, label %48

48:                                               ; preds = %45
  %49 = call i32 @strncmp(ptr noundef nonnull dereferenceable(1) %5, ptr noundef nonnull dereferenceable(1) %4, i64 noundef 65) #12
  %50 = icmp eq i32 %49, 0
  br i1 %50, label %56, label %51

51:                                               ; preds = %48
  %52 = load ptr, ptr @stderr, align 8, !tbaa !7
  %53 = load ptr, ptr %1, align 8, !tbaa !7
  %54 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %52, ptr noundef nonnull @.str.6, ptr noundef %53, ptr noundef nonnull %6) #11
  %55 = add nsw i32 %.04281.us.us.us.us, 1
  br label %56

56:                                               ; preds = %48, %51
  %.1.us.us.us.us = phi i32 [ %55, %51 ], [ %.04281.us.us.us.us, %48 ]
  %57 = call i32 @get_line(ptr noundef nonnull %.2, ptr noundef nonnull %4, ptr noundef nonnull %6)
  %.not67.us.us.us.us = icmp eq i32 %57, 0
  br i1 %.not67.us.us.us.us, label %.outer._crit_edge, label %45, !llvm.loop !13

.split.us.us.split.us.us:                         ; preds = %45
  %58 = add nuw nsw i32 %.049.ph93.us.us, 1
  %59 = call i32 @get_line(ptr noundef nonnull %.2, ptr noundef nonnull %4, ptr noundef nonnull %6)
  %.not6780.us.us = icmp eq i32 %59, 0
  br i1 %.not6780.us.us, label %.outer._crit_edge.thread, label %.lr.ph.us.us, !llvm.loop !13

.lr.ph:                                           ; preds = %.lr.ph.lr.ph, %.split
  %.0.ph95 = phi i32 [ %61, %.split ], [ 0, %.lr.ph.lr.ph ]
  %.042.ph94 = phi i32 [ %.04281, %.split ], [ 0, %.lr.ph.lr.ph ]
  %.049.ph93 = phi i32 [ %63, %.split ], [ 0, %.lr.ph.lr.ph ]
  br label %60

60:                                               ; preds = %.lr.ph, %74
  %.082 = phi i32 [ %.0.ph95, %.lr.ph ], [ %61, %74 ]
  %.04281 = phi i32 [ %.042.ph94, %.lr.ph ], [ %.1, %74 ]
  %61 = add nsw i32 %.082, 1
  %62 = call i32 @hash_file(ptr noundef nonnull %3, ptr noundef nonnull %6, ptr noundef nonnull %5, i32 noundef 0)
  %.not70 = icmp eq i32 %62, 0
  br i1 %.not70, label %.split, label %65

.split:                                           ; preds = %60
  %63 = add nuw nsw i32 %.049.ph93, 1
  %64 = call i32 @get_line(ptr noundef nonnull %.2, ptr noundef nonnull %4, ptr noundef nonnull %6)
  %.not6780 = icmp eq i32 %64, 0
  br i1 %.not6780, label %.outer._crit_edge.thread, label %.lr.ph, !llvm.loop !13

65:                                               ; preds = %60
  %66 = call i32 @strncmp(ptr noundef nonnull dereferenceable(1) %5, ptr noundef nonnull dereferenceable(1) %4, i64 noundef 65) #12
  %67 = icmp eq i32 %66, 0
  %68 = load ptr, ptr @stderr, align 8, !tbaa !7
  br i1 %67, label %69, label %71

69:                                               ; preds = %65
  %70 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %68, ptr noundef nonnull @.str.4, ptr noundef nonnull %6) #11
  br label %74

71:                                               ; preds = %65
  %72 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %68, ptr noundef nonnull @.str.5, ptr noundef nonnull %6) #11
  %73 = add nsw i32 %.04281, 1
  br label %74

74:                                               ; preds = %69, %71
  %.1 = phi i32 [ %.04281, %69 ], [ %73, %71 ]
  %75 = call i32 @get_line(ptr noundef nonnull %.2, ptr noundef nonnull %4, ptr noundef nonnull %6)
  %.not67 = icmp eq i32 %75, 0
  br i1 %.not67, label %.outer._crit_edge, label %60, !llvm.loop !13

.outer._crit_edge:                                ; preds = %74, %56
  %.049.ph.lcssa = phi i32 [ %.049.ph93.us.us, %56 ], [ %.049.ph93, %74 ]
  %.042.lcssa = phi i32 [ %.1.us.us.us.us, %56 ], [ %.1, %74 ]
  %.0.lcssa = phi i32 [ %46, %56 ], [ %61, %74 ]
  %.not69 = icmp eq i32 %.049.ph.lcssa, 0
  br i1 %.not69, label %79, label %.outer._crit_edge.thread

.outer._crit_edge.thread:                         ; preds = %.split, %.split.us.us.split.us.us, %.outer._crit_edge
  %.0.lcssa151 = phi i32 [ %.0.lcssa, %.outer._crit_edge ], [ %46, %.split.us.us.split.us.us ], [ %61, %.split ]
  %.042.lcssa149 = phi i32 [ %.042.lcssa, %.outer._crit_edge ], [ %.04281.us.us.us.us, %.split.us.us.split.us.us ], [ %.04281, %.split ]
  %.049.ph.lcssa147 = phi i32 [ %.049.ph.lcssa, %.outer._crit_edge ], [ %58, %.split.us.us.split.us.us ], [ %63, %.split ]
  %76 = load ptr, ptr @stderr, align 8, !tbaa !7
  %77 = load ptr, ptr %1, align 8, !tbaa !7
  %78 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %76, ptr noundef nonnull @.str.7, ptr noundef %77, i32 noundef %.049.ph.lcssa147, i32 noundef %.0.lcssa151) #11
  br label %79

79:                                               ; preds = %.outer._crit_edge.thread, %.outer._crit_edge
  %.0.lcssa152 = phi i32 [ %.0.lcssa151, %.outer._crit_edge.thread ], [ %.0.lcssa, %.outer._crit_edge ]
  %.042.lcssa150 = phi i32 [ %.042.lcssa149, %.outer._crit_edge.thread ], [ %.042.lcssa, %.outer._crit_edge ]
  %.049.ph.lcssa148 = phi i32 [ %.049.ph.lcssa147, %.outer._crit_edge.thread ], [ 0, %.outer._crit_edge ]
  %80 = icmp ne i32 %.042.lcssa150, 0
  %or.cond = select i1 %9, i1 %80, i1 false
  br i1 %or.cond, label %81, label %.thread

81:                                               ; preds = %79
  %82 = load ptr, ptr @stderr, align 8, !tbaa !7
  %83 = load ptr, ptr %1, align 8, !tbaa !7
  %84 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %82, ptr noundef nonnull @.str.8, ptr noundef %83, i32 noundef %.042.lcssa150, i32 noundef %.0.lcssa152) #11
  br label %.thread

.thread:                                          ; preds = %43, %81, %79
  %.049.ph.lcssa148163 = phi i32 [ %.049.ph.lcssa148, %81 ], [ %.049.ph.lcssa148, %79 ], [ 0, %43 ]
  %.042.lcssa150162 = phi i32 [ 1, %81 ], [ %.042.lcssa150, %79 ], [ 0, %43 ]
  %85 = or i32 %.042.lcssa150162, %.049.ph.lcssa148163
  %.not68 = icmp ne i32 %85, 0
  %86 = zext i1 %.not68 to i32
  call void @exit(i32 noundef %86) #10
  unreachable

87:                                               ; preds = %25
  %88 = load i32, ptr @optind, align 4, !tbaa !11
  %89 = icmp eq i32 %88, %0
  br i1 %89, label %92, label %.preheader

.preheader:                                       ; preds = %87
  %90 = icmp slt i32 %88, %0
  br i1 %90, label %.lr.ph117.preheader, label %._crit_edge118

.lr.ph117.preheader:                              ; preds = %.preheader
  %91 = sext i32 %88 to i64
  br label %.lr.ph117

92:                                               ; preds = %87
  call void @llvm.lifetime.start.p0(i64 65, ptr nonnull %7) #8
  %93 = load ptr, ptr @stdin, align 8, !tbaa !7
  %94 = call i32 @fileno(ptr noundef %93) #8
  %95 = call i32 @hash_stream(ptr noundef nonnull %3, i32 noundef %94, ptr noundef nonnull %7)
  %.not65 = icmp eq i32 %95, 0
  br i1 %.not65, label %96, label %97

96:                                               ; preds = %92
  call void @perror(ptr noundef nonnull @.str.9) #9
  call void @exit(i32 noundef 1) #10
  unreachable

97:                                               ; preds = %92
  %98 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10, ptr noundef nonnull %7)
  call void @exit(i32 noundef 0) #10
  unreachable

.lr.ph117:                                        ; preds = %.lr.ph117.preheader, %107
  %indvars.iv = phi i64 [ %91, %.lr.ph117.preheader ], [ %indvars.iv.next, %107 ]
  %.150116 = phi i32 [ 0, %.lr.ph117.preheader ], [ %.251, %107 ]
  call void @llvm.lifetime.start.p0(i64 65, ptr nonnull %8) #8
  %99 = getelementptr inbounds ptr, ptr %1, i64 %indvars.iv
  %100 = load ptr, ptr %99, align 8, !tbaa !7
  %101 = call i32 @hash_file(ptr noundef nonnull %3, ptr noundef %100, ptr noundef nonnull %8, i32 noundef 0)
  %.not64 = icmp eq i32 %101, 0
  br i1 %.not64, label %102, label %104

102:                                              ; preds = %.lr.ph117
  %103 = add nsw i32 %.150116, 1
  br label %107

104:                                              ; preds = %.lr.ph117
  %105 = load ptr, ptr %99, align 8, !tbaa !7
  %106 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, ptr noundef nonnull %8, ptr noundef %105)
  br label %107

107:                                              ; preds = %104, %102
  %.251 = phi i32 [ %.150116, %104 ], [ %103, %102 ]
  call void @llvm.lifetime.end.p0(i64 65, ptr nonnull %8) #8
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %lftr.wideiv = trunc i64 %indvars.iv.next to i32
  %exitcond.not = icmp eq i32 %lftr.wideiv, %0
  br i1 %exitcond.not, label %._crit_edge118.loopexit, label %.lr.ph117, !llvm.loop !14

._crit_edge118.loopexit:                          ; preds = %107
  %108 = icmp ne i32 %.251, 0
  %109 = zext i1 %108 to i32
  br label %._crit_edge118

._crit_edge118:                                   ; preds = %._crit_edge118.loopexit, %.preheader
  %.150.lcssa = phi i32 [ 0, %.preheader ], [ %109, %._crit_edge118.loopexit ]
  call void @exit(i32 noundef %.150.lcssa) #10
  unreachable
}

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #4

; Function Attrs: nounwind
declare i32 @getopt(i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #5

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #1

; Function Attrs: nofree nounwind
declare void @perror(ptr nocapture noundef readonly) local_unnamed_addr #1

declare i32 @init_gost_hash_ctx(ptr noundef, ptr noundef) local_unnamed_addr #6

; Function Attrs: nounwind uwtable
declare dso_local i32 @get_line(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @hash_file(ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strncmp(ptr nocapture noundef, ptr nocapture noundef, i64 noundef) local_unnamed_addr #7

; Function Attrs: nounwind uwtable
declare dso_local i32 @hash_stream(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nofree nounwind
declare noundef i32 @fileno(ptr nocapture noundef) local_unnamed_addr #1

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #4

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { noreturn nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nounwind }
attributes #9 = { cold }
attributes #10 = { noreturn nounwind }
attributes #11 = { cold nounwind }
attributes #12 = { nounwind willreturn memory(read) }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !9, i64 0}
!13 = distinct !{!13, !6}
!14 = distinct !{!14, !6}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass