; LLVM IR from stamparm/cryptospecs :: symmetrical/sources (camellia)

; 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"

@SIGMA = external dso_local constant [48 x i8], align 16
@KSFT1 = external dso_local constant [26 x i32], align 16
@KIDX1 = external dso_local constant [26 x i32], align 16
@KSFT2 = external dso_local constant [34 x i32], align 16
@KIDX2 = external dso_local constant [34 x i32], align 16

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

; Function Attrs: nounwind uwtable
define dso_local void @Camellia_Ekeygen(i32 noundef %0, ptr noundef %1, ptr noundef %2) #1 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca [64 x i8], align 16
  %8 = alloca [20 x i64], align 16
  %9 = alloca i32, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  store ptr %2, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 64, ptr %7) #2
  call void @llvm.lifetime.start.p0(i64 160, ptr %8) #2
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #2
  %10 = load i32, ptr %4, align 4, !tbaa !5
  %11 = icmp eq i32 %10, 128
  br i1 %11, label %12, label %40

12:                                               ; preds = %3
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %13

13:                                               ; preds = %25, %12
  %14 = load i32, ptr %9, align 4, !tbaa !5
  %15 = icmp slt i32 %14, 16
  br i1 %15, label %16, label %28

16:                                               ; preds = %13
  %17 = load ptr, ptr %5, align 8, !tbaa !9
  %18 = load i32, ptr %9, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds i8, ptr %17, i64 %19
  %21 = load i8, ptr %20, align 1, !tbaa !11
  %22 = load i32, ptr %9, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [64 x i8], ptr %7, i64 0, i64 %23
  store i8 %21, ptr %24, align 1, !tbaa !11
  br label %25

25:                                               ; preds = %16
  %26 = load i32, ptr %9, align 4, !tbaa !5
  %27 = add nsw i32 %26, 1
  store i32 %27, ptr %9, align 4, !tbaa !5
  br label %13, !llvm.loop !12

28:                                               ; preds = %13
  store i32 16, ptr %9, align 4, !tbaa !5
  br label %29

29:                                               ; preds = %36, %28
  %30 = load i32, ptr %9, align 4, !tbaa !5
  %31 = icmp slt i32 %30, 32
  br i1 %31, label %32, label %39

32:                                               ; preds = %29
  %33 = load i32, ptr %9, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [64 x i8], ptr %7, i64 0, i64 %34
  store i8 0, ptr %35, align 1, !tbaa !11
  br label %36

36:                                               ; preds = %32
  %37 = load i32, ptr %9, align 4, !tbaa !5
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %9, align 4, !tbaa !5
  br label %29, !llvm.loop !14

39:                                               ; preds = %29
  br label %102

40:                                               ; preds = %3
  %41 = load i32, ptr %4, align 4, !tbaa !5
  %42 = icmp eq i32 %41, 192
  br i1 %42, label %43, label %80

43:                                               ; preds = %40
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %44

44:                                               ; preds = %56, %43
  %45 = load i32, ptr %9, align 4, !tbaa !5
  %46 = icmp slt i32 %45, 24
  br i1 %46, label %47, label %59

47:                                               ; preds = %44
  %48 = load ptr, ptr %5, align 8, !tbaa !9
  %49 = load i32, ptr %9, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds i8, ptr %48, i64 %50
  %52 = load i8, ptr %51, align 1, !tbaa !11
  %53 = load i32, ptr %9, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [64 x i8], ptr %7, i64 0, i64 %54
  store i8 %52, ptr %55, align 1, !tbaa !11
  br label %56

56:                                               ; preds = %47
  %57 = load i32, ptr %9, align 4, !tbaa !5
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr %9, align 4, !tbaa !5
  br label %44, !llvm.loop !15

59:                                               ; preds = %44
  store i32 24, ptr %9, align 4, !tbaa !5
  br label %60

60:                                               ; preds = %76, %59
  %61 = load i32, ptr %9, align 4, !tbaa !5
  %62 = icmp slt i32 %61, 32
  br i1 %62, label %63, label %79

63:                                               ; preds = %60
  %64 = load ptr, ptr %5, align 8, !tbaa !9
  %65 = load i32, ptr %9, align 4, !tbaa !5
  %66 = sub nsw i32 %65, 8
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds i8, ptr %64, i64 %67
  %69 = load i8, ptr %68, align 1, !tbaa !11
  %70 = zext i8 %69 to i32
  %71 = xor i32 %70, 255
  %72 = trunc i32 %71 to i8
  %73 = load i32, ptr %9, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [64 x i8], ptr %7, i64 0, i64 %74
  store i8 %72, ptr %75, align 1, !tbaa !11
  br label %76

76:                                               ; preds = %63
  %77 = load i32, ptr %9, align 4, !tbaa !5
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr %9, align 4, !tbaa !5
  br label %60, !llvm.loop !16

79:                                               ; preds = %60
  br label %101

80:                                               ; preds = %40
  %81 = load i32, ptr %4, align 4, !tbaa !5
  %82 = icmp eq i32 %81, 256
  br i1 %82, label %83, label %100

83:                                               ; preds = %80
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %84

84:                                               ; preds = %96, %83
  %85 = load i32, ptr %9, align 4, !tbaa !5
  %86 = icmp slt i32 %85, 32
  br i1 %86, label %87, label %99

87:                                               ; preds = %84
  %88 = load ptr, ptr %5, align 8, !tbaa !9
  %89 = load i32, ptr %9, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds i8, ptr %88, i64 %90
  %92 = load i8, ptr %91, align 1, !tbaa !11
  %93 = load i32, ptr %9, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [64 x i8], ptr %7, i64 0, i64 %94
  store i8 %92, ptr %95, align 1, !tbaa !11
  br label %96

96:                                               ; preds = %87
  %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 %84, !llvm.loop !17

99:                                               ; preds = %84
  br label %100

100:                                              ; preds = %99, %80
  br label %101

101:                                              ; preds = %100, %79
  br label %102

102:                                              ; preds = %101, %39
  %103 = getelementptr inbounds [64 x i8], ptr %7, i64 0, i64 0
  %104 = getelementptr inbounds i8, ptr %103, i64 0
  %105 = getelementptr inbounds [64 x i8], ptr %7, i64 0, i64 0
  %106 = getelementptr inbounds i8, ptr %105, i64 16
  %107 = getelementptr inbounds [64 x i8], ptr %7, i64 0, i64 0
  %108 = getelementptr inbounds i8, ptr %107, i64 32
  call void @XorBlock(ptr noundef %104, ptr noundef %106, ptr noundef %108)
  %109 = getelementptr inbounds [64 x i8], ptr %7, i64 0, i64 0
  %110 = getelementptr inbounds i8, ptr %109, i64 32
  %111 = getelementptr inbounds [64 x i8], ptr %7, i64 0, i64 0
  %112 = getelementptr inbounds i8, ptr %111, i64 40
  call void @Camellia_Feistel(ptr noundef %110, ptr noundef @SIGMA, ptr noundef %112)
  %113 = getelementptr inbounds [64 x i8], ptr %7, i64 0, i64 0
  %114 = getelementptr inbounds i8, ptr %113, i64 40
  %115 = getelementptr inbounds [64 x i8], ptr %7, i64 0, i64 0
  %116 = getelementptr inbounds i8, ptr %115, i64 32
  call void @Camellia_Feistel(ptr noundef %114, ptr noundef getelementptr inbounds (i8, ptr @SIGMA, i64 8), ptr noundef %116)
  %117 = getelementptr inbounds [64 x i8], ptr %7, i64 0, i64 0
  %118 = getelementptr inbounds i8, ptr %117, i64 32
  %119 = getelementptr inbounds [64 x i8], ptr %7, i64 0, i64 0
  %120 = getelementptr inbounds i8, ptr %119, i64 0
  %121 = getelementptr inbounds [64 x i8], ptr %7, i64 0, i64 0
  %122 = getelementptr inbounds i8, ptr %121, i64 32
  call void @XorBlock(ptr noundef %118, ptr noundef %120, ptr noundef %122)
  %123 = getelementptr inbounds [64 x i8], ptr %7, i64 0, i64 0
  %124 = getelementptr inbounds i8, ptr %123, i64 32
  %125 = getelementptr inbounds [64 x i8], ptr %7, i64 0, i64 0
  %126 = getelementptr inbounds i8, ptr %125, i64 40
  call void @Camellia_Feistel(ptr noundef %124, ptr noundef getelementptr inbounds (i8, ptr @SIGMA, i64 16), ptr noundef %126)
  %127 = getelementptr inbounds [64 x i8], ptr %7, i64 0, i64 0
  %128 = getelementptr inbounds i8, ptr %127, i64 40
  %129 = getelementptr inbounds [64 x i8], ptr %7, i64 0, i64 0
  %130 = getelementptr inbounds i8, ptr %129, i64 32
  call void @Camellia_Feistel(ptr noundef %128, ptr noundef getelementptr inbounds (i8, ptr @SIGMA, i64 24), ptr noundef %130)
  %131 = getelementptr inbounds [64 x i8], ptr %7, i64 0, i64 0
  %132 = getelementptr inbounds i8, ptr %131, i64 0
  %133 = getelementptr inbounds [20 x i64], ptr %8, i64 0, i64 0
  %134 = getelementptr inbounds i64, ptr %133, i64 0
  call void @ByteWord(ptr noundef %132, ptr noundef %134)
  %135 = getelementptr inbounds [64 x i8], ptr %7, i64 0, i64 0
  %136 = getelementptr inbounds i8, ptr %135, i64 32
  %137 = getelementptr inbounds [20 x i64], ptr %8, i64 0, i64 0
  %138 = getelementptr inbounds i64, ptr %137, i64 4
  call void @ByteWord(ptr noundef %136, ptr noundef %138)
  %139 = load i32, ptr %4, align 4, !tbaa !5
  %140 = icmp eq i32 %139, 128
  br i1 %140, label %141, label %187

141:                                              ; preds = %102
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %142

142:                                              ; preds = %183, %141
  %143 = load i32, ptr %9, align 4, !tbaa !5
  %144 = icmp slt i32 %143, 26
  br i1 %144, label %145, label %186

145:                                              ; preds = %142
  %146 = getelementptr inbounds [20 x i64], ptr %8, i64 0, i64 0
  %147 = load i32, ptr %9, align 4, !tbaa !5
  %148 = add nsw i32 %147, 0
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [26 x i32], ptr @KIDX1, i64 0, i64 %149
  %151 = load i32, ptr %150, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds i64, ptr %146, i64 %152
  %154 = load i32, ptr %9, align 4, !tbaa !5
  %155 = add nsw i32 %154, 0
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [26 x i32], ptr @KSFT1, i64 0, i64 %156
  %158 = load i32, ptr %157, align 4, !tbaa !5
  %159 = getelementptr inbounds [20 x i64], ptr %8, i64 0, i64 0
  %160 = getelementptr inbounds i64, ptr %159, i64 16
  call void @RotBlock(ptr noundef %153, i32 noundef %158, ptr noundef %160)
  %161 = getelementptr inbounds [20 x i64], ptr %8, i64 0, i64 0
  %162 = load i32, ptr %9, align 4, !tbaa !5
  %163 = add nsw i32 %162, 1
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds [26 x i32], ptr @KIDX1, i64 0, i64 %164
  %166 = load i32, ptr %165, align 4, !tbaa !5
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds i64, ptr %161, i64 %167
  %169 = load i32, ptr %9, align 4, !tbaa !5
  %170 = add nsw i32 %169, 1
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [26 x i32], ptr @KSFT1, i64 0, i64 %171
  %173 = load i32, ptr %172, align 4, !tbaa !5
  %174 = getelementptr inbounds [20 x i64], ptr %8, i64 0, i64 0
  %175 = getelementptr inbounds i64, ptr %174, i64 18
  call void @RotBlock(ptr noundef %168, i32 noundef %173, ptr noundef %175)
  %176 = getelementptr inbounds [20 x i64], ptr %8, i64 0, i64 0
  %177 = getelementptr inbounds i64, ptr %176, i64 16
  %178 = load ptr, ptr %6, align 8, !tbaa !9
  %179 = load i32, ptr %9, align 4, !tbaa !5
  %180 = mul nsw i32 %179, 8
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds i8, ptr %178, i64 %181
  call void @WordByte(ptr noundef %177, ptr noundef %182)
  br label %183

183:                                              ; preds = %145
  %184 = load i32, ptr %9, align 4, !tbaa !5
  %185 = add nsw i32 %184, 2
  store i32 %185, ptr %9, align 4, !tbaa !5
  br label %142, !llvm.loop !18

186:                                              ; preds = %142
  br label %255

187:                                              ; preds = %102
  %188 = getelementptr inbounds [64 x i8], ptr %7, i64 0, i64 0
  %189 = getelementptr inbounds i8, ptr %188, i64 32
  %190 = getelementptr inbounds [64 x i8], ptr %7, i64 0, i64 0
  %191 = getelementptr inbounds i8, ptr %190, i64 16
  %192 = getelementptr inbounds [64 x i8], ptr %7, i64 0, i64 0
  %193 = getelementptr inbounds i8, ptr %192, i64 48
  call void @XorBlock(ptr noundef %189, ptr noundef %191, ptr noundef %193)
  %194 = getelementptr inbounds [64 x i8], ptr %7, i64 0, i64 0
  %195 = getelementptr inbounds i8, ptr %194, i64 48
  %196 = getelementptr inbounds [64 x i8], ptr %7, i64 0, i64 0
  %197 = getelementptr inbounds i8, ptr %196, i64 56
  call void @Camellia_Feistel(ptr noundef %195, ptr noundef getelementptr inbounds (i8, ptr @SIGMA, i64 32), ptr noundef %197)
  %198 = getelementptr inbounds [64 x i8], ptr %7, i64 0, i64 0
  %199 = getelementptr inbounds i8, ptr %198, i64 56
  %200 = getelementptr inbounds [64 x i8], ptr %7, i64 0, i64 0
  %201 = getelementptr inbounds i8, ptr %200, i64 48
  call void @Camellia_Feistel(ptr noundef %199, ptr noundef getelementptr inbounds (i8, ptr @SIGMA, i64 40), ptr noundef %201)
  %202 = getelementptr inbounds [64 x i8], ptr %7, i64 0, i64 0
  %203 = getelementptr inbounds i8, ptr %202, i64 16
  %204 = getelementptr inbounds [20 x i64], ptr %8, i64 0, i64 0
  %205 = getelementptr inbounds i64, ptr %204, i64 8
  call void @ByteWord(ptr noundef %203, ptr noundef %205)
  %206 = getelementptr inbounds [64 x i8], ptr %7, i64 0, i64 0
  %207 = getelementptr inbounds i8, ptr %206, i64 48
  %208 = getelementptr inbounds [20 x i64], ptr %8, i64 0, i64 0
  %209 = getelementptr inbounds i64, ptr %208, i64 12
  call void @ByteWord(ptr noundef %207, ptr noundef %209)
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %210

210:                                              ; preds = %251, %187
  %211 = load i32, ptr %9, align 4, !tbaa !5
  %212 = icmp slt i32 %211, 34
  br i1 %212, label %213, label %254

213:                                              ; preds = %210
  %214 = getelementptr inbounds [20 x i64], ptr %8, i64 0, i64 0
  %215 = load i32, ptr %9, align 4, !tbaa !5
  %216 = add nsw i32 %215, 0
  %217 = sext i32 %216 to i64
  %218 = getelementptr inbounds [34 x i32], ptr @KIDX2, i64 0, i64 %217
  %219 = load i32, ptr %218, align 4, !tbaa !5
  %220 = sext i32 %219 to i64
  %221 = getelementptr inbounds i64, ptr %214, i64 %220
  %222 = load i32, ptr %9, align 4, !tbaa !5
  %223 = add nsw i32 %222, 0
  %224 = sext i32 %223 to i64
  %225 = getelementptr inbounds [34 x i32], ptr @KSFT2, i64 0, i64 %224
  %226 = load i32, ptr %225, align 4, !tbaa !5
  %227 = getelementptr inbounds [20 x i64], ptr %8, i64 0, i64 0
  %228 = getelementptr inbounds i64, ptr %227, i64 16
  call void @RotBlock(ptr noundef %221, i32 noundef %226, ptr noundef %228)
  %229 = getelementptr inbounds [20 x i64], ptr %8, i64 0, i64 0
  %230 = load i32, ptr %9, align 4, !tbaa !5
  %231 = add nsw i32 %230, 1
  %232 = sext i32 %231 to i64
  %233 = getelementptr inbounds [34 x i32], ptr @KIDX2, i64 0, i64 %232
  %234 = load i32, ptr %233, align 4, !tbaa !5
  %235 = sext i32 %234 to i64
  %236 = getelementptr inbounds i64, ptr %229, i64 %235
  %237 = load i32, ptr %9, align 4, !tbaa !5
  %238 = add nsw i32 %237, 1
  %239 = sext i32 %238 to i64
  %240 = getelementptr inbounds [34 x i32], ptr @KSFT2, i64 0, i64 %239
  %241 = load i32, ptr %240, align 4, !tbaa !5
  %242 = getelementptr inbounds [20 x i64], ptr %8, i64 0, i64 0
  %243 = getelementptr inbounds i64, ptr %242, i64 18
  call void @RotBlock(ptr noundef %236, i32 noundef %241, ptr noundef %243)
  %244 = getelementptr inbounds [20 x i64], ptr %8, i64 0, i64 0
  %245 = getelementptr inbounds i64, ptr %244, i64 16
  %246 = load ptr, ptr %6, align 8, !tbaa !9
  %247 = load i32, ptr %9, align 4, !tbaa !5
  %248 = shl i32 %247, 3
  %249 = sext i32 %248 to i64
  %250 = getelementptr inbounds i8, ptr %246, i64 %249
  call void @WordByte(ptr noundef %245, ptr noundef %250)
  br label %251

251:                                              ; preds = %213
  %252 = load i32, ptr %9, align 4, !tbaa !5
  %253 = add nsw i32 %252, 2
  store i32 %253, ptr %9, align 4, !tbaa !5
  br label %210, !llvm.loop !19

254:                                              ; preds = %210
  br label %255

255:                                              ; preds = %254, %186
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #2
  call void @llvm.lifetime.end.p0(i64 160, ptr %8) #2
  call void @llvm.lifetime.end.p0(i64 64, ptr %7) #2
  ret void
}

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

; Function Attrs: nounwind uwtable
declare dso_local void @XorBlock(ptr noundef, ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local void @Camellia_Feistel(ptr noundef, ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local void @ByteWord(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local void @RotBlock(ptr noundef, i32 noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local void @WordByte(ptr noundef, ptr noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { nounwind }

!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 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !13}
!17 = distinct !{!17, !13}
!18 = distinct !{!18, !13}
!19 = distinct !{!19, !13}


; 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"

@SIGMA = external dso_local constant [48 x i8], align 16
@KSFT1 = external dso_local local_unnamed_addr constant [26 x i32], align 16
@KIDX1 = external dso_local local_unnamed_addr constant [26 x i32], align 16
@KSFT2 = external dso_local local_unnamed_addr constant [34 x i32], align 16
@KIDX2 = external dso_local local_unnamed_addr constant [34 x i32], align 16

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

; Function Attrs: nounwind uwtable
define dso_local void @Camellia_Ekeygen(i32 noundef %0, ptr nocapture noundef readonly %1, ptr noundef %2) local_unnamed_addr #1 {
  %4 = alloca [64 x i8], align 16
  %5 = alloca [20 x i64], align 16
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %4) #4
  call void @llvm.lifetime.start.p0(i64 160, ptr nonnull %5) #4
  %6 = icmp eq i32 %0, 128
  br i1 %6, label %.preheader46.preheader, label %7

.preheader46.preheader:                           ; preds = %3
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %4, ptr noundef nonnull align 1 dereferenceable(16) %1, i64 16, i1 false), !tbaa !5
  %scevgep = getelementptr inbounds i8, ptr %4, i64 16
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %scevgep, i8 0, i64 16, i1 false), !tbaa !5
  br label %.loopexit45

7:                                                ; preds = %3
  switch i32 %0, label %.loopexit45 [
    i32 192, label %.preheader49.preheader
    i32 256, label %.preheader50.preheader
  ]

.preheader50.preheader:                           ; preds = %7
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %4, ptr noundef nonnull align 1 dereferenceable(32) %1, i64 32, i1 false), !tbaa !5
  br label %.loopexit45

.preheader49.preheader:                           ; preds = %7
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(24) %4, ptr noundef nonnull align 1 dereferenceable(24) %1, i64 24, i1 false), !tbaa !5
  %gep = getelementptr i8, ptr %1, i64 16
  %8 = getelementptr inbounds i8, ptr %4, i64 24
  %9 = load <8 x i8>, ptr %gep, align 1, !tbaa !5
  %10 = xor <8 x i8> %9, <i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1>
  store <8 x i8> %10, ptr %8, align 8, !tbaa !5
  br label %.loopexit45

.loopexit45:                                      ; preds = %.preheader50.preheader, %.preheader49.preheader, %.preheader46.preheader, %7
  %11 = getelementptr inbounds i8, ptr %4, i64 16
  %12 = getelementptr inbounds i8, ptr %4, i64 32
  call void @XorBlock(ptr noundef nonnull %4, ptr noundef nonnull %11, ptr noundef nonnull %12)
  %13 = getelementptr inbounds i8, ptr %4, i64 40
  call void @Camellia_Feistel(ptr noundef nonnull %12, ptr noundef nonnull @SIGMA, ptr noundef nonnull %13)
  call void @Camellia_Feistel(ptr noundef nonnull %13, ptr noundef nonnull getelementptr inbounds (i8, ptr @SIGMA, i64 8), ptr noundef nonnull %12)
  call void @XorBlock(ptr noundef nonnull %12, ptr noundef nonnull %4, ptr noundef nonnull %12)
  call void @Camellia_Feistel(ptr noundef nonnull %12, ptr noundef nonnull getelementptr inbounds (i8, ptr @SIGMA, i64 16), ptr noundef nonnull %13)
  call void @Camellia_Feistel(ptr noundef nonnull %13, ptr noundef nonnull getelementptr inbounds (i8, ptr @SIGMA, i64 24), ptr noundef nonnull %12)
  call void @ByteWord(ptr noundef nonnull %4, ptr noundef nonnull %5)
  %14 = getelementptr inbounds i8, ptr %5, i64 32
  call void @ByteWord(ptr noundef nonnull %12, ptr noundef nonnull %14)
  br i1 %6, label %.preheader, label %133

.preheader:                                       ; preds = %.loopexit45
  %15 = getelementptr inbounds i8, ptr %5, i64 128
  %16 = getelementptr inbounds i8, ptr %5, i64 144
  %17 = load i32, ptr @KIDX1, align 16, !tbaa !8
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds i64, ptr %5, i64 %18
  %20 = load i32, ptr @KSFT1, align 16, !tbaa !8
  call void @RotBlock(ptr noundef nonnull %19, i32 noundef %20, ptr noundef nonnull %15)
  %21 = load i32, ptr getelementptr inbounds (i8, ptr @KIDX1, i64 4), align 4, !tbaa !8
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds i64, ptr %5, i64 %22
  %24 = load i32, ptr getelementptr inbounds (i8, ptr @KSFT1, i64 4), align 4, !tbaa !8
  call void @RotBlock(ptr noundef nonnull %23, i32 noundef %24, ptr noundef nonnull %16)
  call void @WordByte(ptr noundef nonnull %15, ptr noundef %2)
  %25 = load i32, ptr getelementptr inbounds (i8, ptr @KIDX1, i64 8), align 8, !tbaa !8
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds i64, ptr %5, i64 %26
  %28 = load i32, ptr getelementptr inbounds (i8, ptr @KSFT1, i64 8), align 8, !tbaa !8
  call void @RotBlock(ptr noundef nonnull %27, i32 noundef %28, ptr noundef nonnull %15)
  %29 = load i32, ptr getelementptr inbounds (i8, ptr @KIDX1, i64 12), align 4, !tbaa !8
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds i64, ptr %5, i64 %30
  %32 = load i32, ptr getelementptr inbounds (i8, ptr @KSFT1, i64 12), align 4, !tbaa !8
  call void @RotBlock(ptr noundef nonnull %31, i32 noundef %32, ptr noundef nonnull %16)
  %33 = getelementptr inbounds i8, ptr %2, i64 16
  call void @WordByte(ptr noundef nonnull %15, ptr noundef nonnull %33)
  %34 = load i32, ptr getelementptr inbounds (i8, ptr @KIDX1, i64 16), align 16, !tbaa !8
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds i64, ptr %5, i64 %35
  %37 = load i32, ptr getelementptr inbounds (i8, ptr @KSFT1, i64 16), align 16, !tbaa !8
  call void @RotBlock(ptr noundef nonnull %36, i32 noundef %37, ptr noundef nonnull %15)
  %38 = load i32, ptr getelementptr inbounds (i8, ptr @KIDX1, i64 20), align 4, !tbaa !8
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds i64, ptr %5, i64 %39
  %41 = load i32, ptr getelementptr inbounds (i8, ptr @KSFT1, i64 20), align 4, !tbaa !8
  call void @RotBlock(ptr noundef nonnull %40, i32 noundef %41, ptr noundef nonnull %16)
  %42 = getelementptr inbounds i8, ptr %2, i64 32
  call void @WordByte(ptr noundef nonnull %15, ptr noundef nonnull %42)
  %43 = load i32, ptr getelementptr inbounds (i8, ptr @KIDX1, i64 24), align 8, !tbaa !8
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds i64, ptr %5, i64 %44
  %46 = load i32, ptr getelementptr inbounds (i8, ptr @KSFT1, i64 24), align 8, !tbaa !8
  call void @RotBlock(ptr noundef nonnull %45, i32 noundef %46, ptr noundef nonnull %15)
  %47 = load i32, ptr getelementptr inbounds (i8, ptr @KIDX1, i64 28), align 4, !tbaa !8
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds i64, ptr %5, i64 %48
  %50 = load i32, ptr getelementptr inbounds (i8, ptr @KSFT1, i64 28), align 4, !tbaa !8
  call void @RotBlock(ptr noundef nonnull %49, i32 noundef %50, ptr noundef nonnull %16)
  %51 = getelementptr inbounds i8, ptr %2, i64 48
  call void @WordByte(ptr noundef nonnull %15, ptr noundef nonnull %51)
  %52 = load i32, ptr getelementptr inbounds (i8, ptr @KIDX1, i64 32), align 16, !tbaa !8
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds i64, ptr %5, i64 %53
  %55 = load i32, ptr getelementptr inbounds (i8, ptr @KSFT1, i64 32), align 16, !tbaa !8
  call void @RotBlock(ptr noundef nonnull %54, i32 noundef %55, ptr noundef nonnull %15)
  %56 = load i32, ptr getelementptr inbounds (i8, ptr @KIDX1, i64 36), align 4, !tbaa !8
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds i64, ptr %5, i64 %57
  %59 = load i32, ptr getelementptr inbounds (i8, ptr @KSFT1, i64 36), align 4, !tbaa !8
  call void @RotBlock(ptr noundef nonnull %58, i32 noundef %59, ptr noundef nonnull %16)
  %60 = getelementptr inbounds i8, ptr %2, i64 64
  call void @WordByte(ptr noundef nonnull %15, ptr noundef nonnull %60)
  %61 = load i32, ptr getelementptr inbounds (i8, ptr @KIDX1, i64 40), align 8, !tbaa !8
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds i64, ptr %5, i64 %62
  %64 = load i32, ptr getelementptr inbounds (i8, ptr @KSFT1, i64 40), align 8, !tbaa !8
  call void @RotBlock(ptr noundef nonnull %63, i32 noundef %64, ptr noundef nonnull %15)
  %65 = load i32, ptr getelementptr inbounds (i8, ptr @KIDX1, i64 44), align 4, !tbaa !8
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds i64, ptr %5, i64 %66
  %68 = load i32, ptr getelementptr inbounds (i8, ptr @KSFT1, i64 44), align 4, !tbaa !8
  call void @RotBlock(ptr noundef nonnull %67, i32 noundef %68, ptr noundef nonnull %16)
  %69 = getelementptr inbounds i8, ptr %2, i64 80
  call void @WordByte(ptr noundef nonnull %15, ptr noundef nonnull %69)
  %70 = load i32, ptr getelementptr inbounds (i8, ptr @KIDX1, i64 48), align 16, !tbaa !8
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds i64, ptr %5, i64 %71
  %73 = load i32, ptr getelementptr inbounds (i8, ptr @KSFT1, i64 48), align 16, !tbaa !8
  call void @RotBlock(ptr noundef nonnull %72, i32 noundef %73, ptr noundef nonnull %15)
  %74 = load i32, ptr getelementptr inbounds (i8, ptr @KIDX1, i64 52), align 4, !tbaa !8
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds i64, ptr %5, i64 %75
  %77 = load i32, ptr getelementptr inbounds (i8, ptr @KSFT1, i64 52), align 4, !tbaa !8
  call void @RotBlock(ptr noundef nonnull %76, i32 noundef %77, ptr noundef nonnull %16)
  %78 = getelementptr inbounds i8, ptr %2, i64 96
  call void @WordByte(ptr noundef nonnull %15, ptr noundef nonnull %78)
  %79 = load i32, ptr getelementptr inbounds (i8, ptr @KIDX1, i64 56), align 8, !tbaa !8
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds i64, ptr %5, i64 %80
  %82 = load i32, ptr getelementptr inbounds (i8, ptr @KSFT1, i64 56), align 8, !tbaa !8
  call void @RotBlock(ptr noundef nonnull %81, i32 noundef %82, ptr noundef nonnull %15)
  %83 = load i32, ptr getelementptr inbounds (i8, ptr @KIDX1, i64 60), align 4, !tbaa !8
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds i64, ptr %5, i64 %84
  %86 = load i32, ptr getelementptr inbounds (i8, ptr @KSFT1, i64 60), align 4, !tbaa !8
  call void @RotBlock(ptr noundef nonnull %85, i32 noundef %86, ptr noundef nonnull %16)
  %87 = getelementptr inbounds i8, ptr %2, i64 112
  call void @WordByte(ptr noundef nonnull %15, ptr noundef nonnull %87)
  %88 = load i32, ptr getelementptr inbounds (i8, ptr @KIDX1, i64 64), align 16, !tbaa !8
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds i64, ptr %5, i64 %89
  %91 = load i32, ptr getelementptr inbounds (i8, ptr @KSFT1, i64 64), align 16, !tbaa !8
  call void @RotBlock(ptr noundef nonnull %90, i32 noundef %91, ptr noundef nonnull %15)
  %92 = load i32, ptr getelementptr inbounds (i8, ptr @KIDX1, i64 68), align 4, !tbaa !8
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds i64, ptr %5, i64 %93
  %95 = load i32, ptr getelementptr inbounds (i8, ptr @KSFT1, i64 68), align 4, !tbaa !8
  call void @RotBlock(ptr noundef nonnull %94, i32 noundef %95, ptr noundef nonnull %16)
  %96 = getelementptr inbounds i8, ptr %2, i64 128
  call void @WordByte(ptr noundef nonnull %15, ptr noundef nonnull %96)
  %97 = load i32, ptr getelementptr inbounds (i8, ptr @KIDX1, i64 72), align 8, !tbaa !8
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds i64, ptr %5, i64 %98
  %100 = load i32, ptr getelementptr inbounds (i8, ptr @KSFT1, i64 72), align 8, !tbaa !8
  call void @RotBlock(ptr noundef nonnull %99, i32 noundef %100, ptr noundef nonnull %15)
  %101 = load i32, ptr getelementptr inbounds (i8, ptr @KIDX1, i64 76), align 4, !tbaa !8
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds i64, ptr %5, i64 %102
  %104 = load i32, ptr getelementptr inbounds (i8, ptr @KSFT1, i64 76), align 4, !tbaa !8
  call void @RotBlock(ptr noundef nonnull %103, i32 noundef %104, ptr noundef nonnull %16)
  %105 = getelementptr inbounds i8, ptr %2, i64 144
  call void @WordByte(ptr noundef nonnull %15, ptr noundef nonnull %105)
  %106 = load i32, ptr getelementptr inbounds (i8, ptr @KIDX1, i64 80), align 16, !tbaa !8
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds i64, ptr %5, i64 %107
  %109 = load i32, ptr getelementptr inbounds (i8, ptr @KSFT1, i64 80), align 16, !tbaa !8
  call void @RotBlock(ptr noundef nonnull %108, i32 noundef %109, ptr noundef nonnull %15)
  %110 = load i32, ptr getelementptr inbounds (i8, ptr @KIDX1, i64 84), align 4, !tbaa !8
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds i64, ptr %5, i64 %111
  %113 = load i32, ptr getelementptr inbounds (i8, ptr @KSFT1, i64 84), align 4, !tbaa !8
  call void @RotBlock(ptr noundef nonnull %112, i32 noundef %113, ptr noundef nonnull %16)
  %114 = getelementptr inbounds i8, ptr %2, i64 160
  call void @WordByte(ptr noundef nonnull %15, ptr noundef nonnull %114)
  %115 = load i32, ptr getelementptr inbounds (i8, ptr @KIDX1, i64 88), align 8, !tbaa !8
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds i64, ptr %5, i64 %116
  %118 = load i32, ptr getelementptr inbounds (i8, ptr @KSFT1, i64 88), align 8, !tbaa !8
  call void @RotBlock(ptr noundef nonnull %117, i32 noundef %118, ptr noundef nonnull %15)
  %119 = load i32, ptr getelementptr inbounds (i8, ptr @KIDX1, i64 92), align 4, !tbaa !8
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds i64, ptr %5, i64 %120
  %122 = load i32, ptr getelementptr inbounds (i8, ptr @KSFT1, i64 92), align 4, !tbaa !8
  call void @RotBlock(ptr noundef nonnull %121, i32 noundef %122, ptr noundef nonnull %16)
  %123 = getelementptr inbounds i8, ptr %2, i64 176
  call void @WordByte(ptr noundef nonnull %15, ptr noundef nonnull %123)
  %124 = load i32, ptr getelementptr inbounds (i8, ptr @KIDX1, i64 96), align 16, !tbaa !8
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds i64, ptr %5, i64 %125
  %127 = load i32, ptr getelementptr inbounds (i8, ptr @KSFT1, i64 96), align 16, !tbaa !8
  call void @RotBlock(ptr noundef nonnull %126, i32 noundef %127, ptr noundef nonnull %15)
  %128 = load i32, ptr getelementptr inbounds (i8, ptr @KIDX1, i64 100), align 4, !tbaa !8
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds i64, ptr %5, i64 %129
  %131 = load i32, ptr getelementptr inbounds (i8, ptr @KSFT1, i64 100), align 4, !tbaa !8
  call void @RotBlock(ptr noundef nonnull %130, i32 noundef %131, ptr noundef nonnull %16)
  %132 = getelementptr inbounds i8, ptr %2, i64 192
  call void @WordByte(ptr noundef nonnull %15, ptr noundef nonnull %132)
  br label %.loopexit

133:                                              ; preds = %.loopexit45
  %134 = getelementptr inbounds i8, ptr %4, i64 48
  call void @XorBlock(ptr noundef nonnull %12, ptr noundef nonnull %11, ptr noundef nonnull %134)
  %135 = getelementptr inbounds i8, ptr %4, i64 56
  call void @Camellia_Feistel(ptr noundef nonnull %134, ptr noundef nonnull getelementptr inbounds (i8, ptr @SIGMA, i64 32), ptr noundef nonnull %135)
  call void @Camellia_Feistel(ptr noundef nonnull %135, ptr noundef nonnull getelementptr inbounds (i8, ptr @SIGMA, i64 40), ptr noundef nonnull %134)
  %136 = getelementptr inbounds i8, ptr %5, i64 64
  call void @ByteWord(ptr noundef nonnull %11, ptr noundef nonnull %136)
  %137 = getelementptr inbounds i8, ptr %5, i64 96
  call void @ByteWord(ptr noundef nonnull %134, ptr noundef nonnull %137)
  %138 = getelementptr inbounds i8, ptr %5, i64 128
  %139 = getelementptr inbounds i8, ptr %5, i64 144
  br label %140

140:                                              ; preds = %133, %140
  %indvars.iv = phi i64 [ 0, %133 ], [ %indvars.iv.next, %140 ]
  %141 = getelementptr inbounds [34 x i32], ptr @KIDX2, i64 0, i64 %indvars.iv
  %142 = load i32, ptr %141, align 8, !tbaa !8
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds i64, ptr %5, i64 %143
  %145 = getelementptr inbounds [34 x i32], ptr @KSFT2, i64 0, i64 %indvars.iv
  %146 = load i32, ptr %145, align 8, !tbaa !8
  call void @RotBlock(ptr noundef nonnull %144, i32 noundef %146, ptr noundef nonnull %138)
  %147 = or disjoint i64 %indvars.iv, 1
  %148 = getelementptr inbounds [34 x i32], ptr @KIDX2, i64 0, i64 %147
  %149 = load i32, ptr %148, align 4, !tbaa !8
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds i64, ptr %5, i64 %150
  %152 = getelementptr inbounds [34 x i32], ptr @KSFT2, i64 0, i64 %147
  %153 = load i32, ptr %152, align 4, !tbaa !8
  call void @RotBlock(ptr noundef nonnull %151, i32 noundef %153, ptr noundef nonnull %139)
  %154 = shl nuw nsw i64 %indvars.iv, 3
  %155 = getelementptr inbounds i8, ptr %2, i64 %154
  call void @WordByte(ptr noundef nonnull %138, ptr noundef %155)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 2
  %156 = icmp ult i64 %indvars.iv, 32
  br i1 %156, label %140, label %.loopexit, !llvm.loop !10

.loopexit:                                        ; preds = %140, %.preheader
  call void @llvm.lifetime.end.p0(i64 160, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %4) #4
  ret void
}

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

; Function Attrs: nounwind uwtable
declare dso_local void @XorBlock(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @Camellia_Feistel(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @ByteWord(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @RotBlock(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @WordByte(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: 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) #2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nounwind }

!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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopIdiomRecognizePass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass