; LLVM IR from guanzhi/GmSSL :: tests (aestest)

; 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.anon = type { ptr, ptr, ptr, ptr, ptr, ptr }
%struct.AES_KEY = type { [60 x i32], i64 }

@.str.1 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [9 x i8], align 1
@stdout = external global ptr, align 8
@aes_gcm_tests = external dso_local global [7 x %struct.anon], align 16
@.str.41 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.43 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.45 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.46 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.47 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.48 = external hidden unnamed_addr constant [8 x i8], align 1
@__FUNCTION__.test_aes_gcm = external hidden unnamed_addr constant [13 x i8], align 1

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

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

declare i32 @aes_set_encrypt_key(ptr noundef, ptr noundef, i64 noundef) #1

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

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

declare i32 @hex_to_bytes(ptr noundef, i64 noundef, ptr noundef, ptr noundef) #1

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #2

declare i32 @format_bytes(ptr noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef, i64 noundef) #1

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

21:                                               ; preds = %192, %0
  %22 = load i32, ptr %19, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = icmp ult i64 %23, 7
  br i1 %24, label %25, label %195

25:                                               ; preds = %21
  %26 = load i32, ptr %19, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [7 x %struct.anon], ptr @aes_gcm_tests, i64 0, i64 %27
  %29 = getelementptr inbounds %struct.anon, ptr %28, i32 0, i32 0
  %30 = load ptr, ptr %29, align 16, !tbaa !9
  %31 = load i32, ptr %19, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [7 x %struct.anon], ptr @aes_gcm_tests, i64 0, i64 %32
  %34 = getelementptr inbounds %struct.anon, ptr %33, i32 0, i32 0
  %35 = load ptr, ptr %34, align 16, !tbaa !9
  %36 = call i64 @strlen(ptr noundef %35) #5
  %37 = getelementptr inbounds [32 x i8], ptr %3, i64 0, i64 0
  %38 = call i32 @hex_to_bytes(ptr noundef %30, i64 noundef %36, ptr noundef %37, ptr noundef %9)
  %39 = load i32, ptr %19, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [7 x %struct.anon], ptr @aes_gcm_tests, i64 0, i64 %40
  %42 = getelementptr inbounds %struct.anon, ptr %41, i32 0, i32 1
  %43 = load ptr, ptr %42, align 8, !tbaa !12
  %44 = load i32, ptr %19, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [7 x %struct.anon], ptr @aes_gcm_tests, i64 0, i64 %45
  %47 = getelementptr inbounds %struct.anon, ptr %46, i32 0, i32 1
  %48 = load ptr, ptr %47, align 8, !tbaa !12
  %49 = call i64 @strlen(ptr noundef %48) #5
  %50 = getelementptr inbounds [64 x i8], ptr %4, i64 0, i64 0
  %51 = call i32 @hex_to_bytes(ptr noundef %43, i64 noundef %49, ptr noundef %50, ptr noundef %10)
  %52 = load i32, ptr %19, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [7 x %struct.anon], ptr @aes_gcm_tests, i64 0, i64 %53
  %55 = getelementptr inbounds %struct.anon, ptr %54, i32 0, i32 2
  %56 = load ptr, ptr %55, align 16, !tbaa !13
  %57 = load i32, ptr %19, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [7 x %struct.anon], ptr @aes_gcm_tests, i64 0, i64 %58
  %60 = getelementptr inbounds %struct.anon, ptr %59, i32 0, i32 2
  %61 = load ptr, ptr %60, align 16, !tbaa !13
  %62 = call i64 @strlen(ptr noundef %61) #5
  %63 = getelementptr inbounds [32 x i8], ptr %5, i64 0, i64 0
  %64 = call i32 @hex_to_bytes(ptr noundef %56, i64 noundef %62, ptr noundef %63, ptr noundef %11)
  %65 = load i32, ptr %19, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [7 x %struct.anon], ptr @aes_gcm_tests, i64 0, i64 %66
  %68 = getelementptr inbounds %struct.anon, ptr %67, i32 0, i32 3
  %69 = load ptr, ptr %68, align 8, !tbaa !14
  %70 = load i32, ptr %19, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [7 x %struct.anon], ptr @aes_gcm_tests, i64 0, i64 %71
  %73 = getelementptr inbounds %struct.anon, ptr %72, i32 0, i32 3
  %74 = load ptr, ptr %73, align 8, !tbaa !14
  %75 = call i64 @strlen(ptr noundef %74) #5
  %76 = getelementptr inbounds [64 x i8], ptr %6, i64 0, i64 0
  %77 = call i32 @hex_to_bytes(ptr noundef %69, i64 noundef %75, ptr noundef %76, ptr noundef %12)
  %78 = load i32, ptr %19, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [7 x %struct.anon], ptr @aes_gcm_tests, i64 0, i64 %79
  %81 = getelementptr inbounds %struct.anon, ptr %80, i32 0, i32 4
  %82 = load ptr, ptr %81, align 16, !tbaa !15
  %83 = load i32, ptr %19, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [7 x %struct.anon], ptr @aes_gcm_tests, i64 0, i64 %84
  %86 = getelementptr inbounds %struct.anon, ptr %85, i32 0, i32 4
  %87 = load ptr, ptr %86, align 16, !tbaa !15
  %88 = call i64 @strlen(ptr noundef %87) #5
  %89 = getelementptr inbounds [64 x i8], ptr %7, i64 0, i64 0
  %90 = call i32 @hex_to_bytes(ptr noundef %82, i64 noundef %88, ptr noundef %89, ptr noundef %13)
  %91 = load i32, ptr %19, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [7 x %struct.anon], ptr @aes_gcm_tests, i64 0, i64 %92
  %94 = getelementptr inbounds %struct.anon, ptr %93, i32 0, i32 5
  %95 = load ptr, ptr %94, align 8, !tbaa !16
  %96 = load i32, ptr %19, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [7 x %struct.anon], ptr @aes_gcm_tests, i64 0, i64 %97
  %99 = getelementptr inbounds %struct.anon, ptr %98, i32 0, i32 5
  %100 = load ptr, ptr %99, align 8, !tbaa !16
  %101 = call i64 @strlen(ptr noundef %100) #5
  %102 = getelementptr inbounds [16 x i8], ptr %8, i64 0, i64 0
  %103 = call i32 @hex_to_bytes(ptr noundef %95, i64 noundef %101, ptr noundef %102, ptr noundef %14)
  %104 = getelementptr inbounds [32 x i8], ptr %3, i64 0, i64 0
  %105 = load i64, ptr %9, align 8, !tbaa !17
  %106 = call i32 @aes_set_encrypt_key(ptr noundef %15, ptr noundef %104, i64 noundef %105)
  %107 = getelementptr inbounds [64 x i8], ptr %6, i64 0, i64 0
  %108 = load i64, ptr %12, align 8, !tbaa !17
  %109 = getelementptr inbounds [32 x i8], ptr %5, i64 0, i64 0
  %110 = load i64, ptr %11, align 8, !tbaa !17
  %111 = getelementptr inbounds [64 x i8], ptr %4, i64 0, i64 0
  %112 = load i64, ptr %10, align 8, !tbaa !17
  %113 = getelementptr inbounds [64 x i8], ptr %16, i64 0, i64 0
  %114 = load i64, ptr %14, align 8, !tbaa !17
  %115 = getelementptr inbounds [16 x i8], ptr %17, i64 0, i64 0
  %116 = call i32 @aes_gcm_encrypt(ptr noundef %15, ptr noundef %107, i64 noundef %108, ptr noundef %109, i64 noundef %110, ptr noundef %111, i64 noundef %112, ptr noundef %113, i64 noundef %114, ptr noundef %115)
  %117 = load i32, ptr %19, align 4, !tbaa !5
  %118 = add nsw i32 %117, 1
  %119 = call i32 (ptr, ...) @printf(ptr noundef @.str.41, i32 noundef %118)
  %120 = getelementptr inbounds [64 x i8], ptr %6, i64 0, i64 0
  %121 = load i64, ptr %12, align 8, !tbaa !17
  %122 = getelementptr inbounds [32 x i8], ptr %5, i64 0, i64 0
  %123 = load i64, ptr %11, align 8, !tbaa !17
  %124 = getelementptr inbounds [64 x i8], ptr %16, i64 0, i64 0
  %125 = load i64, ptr %10, align 8, !tbaa !17
  %126 = getelementptr inbounds [16 x i8], ptr %17, i64 0, i64 0
  %127 = load i64, ptr %14, align 8, !tbaa !17
  %128 = getelementptr inbounds [64 x i8], ptr %18, i64 0, i64 0
  %129 = call i32 @aes_gcm_decrypt(ptr noundef %15, ptr noundef %120, i64 noundef %121, ptr noundef %122, i64 noundef %123, ptr noundef %124, i64 noundef %125, ptr noundef %126, i64 noundef %127, ptr noundef %128)
  %130 = icmp ne i32 %129, 1
  br i1 %130, label %137, label %131

131:                                              ; preds = %25
  %132 = getelementptr inbounds [64 x i8], ptr %18, i64 0, i64 0
  %133 = getelementptr inbounds [64 x i8], ptr %4, i64 0, i64 0
  %134 = load i64, ptr %10, align 8, !tbaa !17
  %135 = call i32 @memcmp(ptr noundef %132, ptr noundef %133, i64 noundef %134) #5
  %136 = icmp ne i32 %135, 0
  br i1 %136, label %137, label %189

137:                                              ; preds = %131, %25
  %138 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  %139 = load ptr, ptr @stdout, align 8, !tbaa !19
  %140 = load i32, ptr %19, align 4, !tbaa !5
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [7 x %struct.anon], ptr @aes_gcm_tests, i64 0, i64 %141
  %143 = getelementptr inbounds %struct.anon, ptr %142, i32 0, i32 0
  %144 = load ptr, ptr %143, align 16, !tbaa !9
  %145 = call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef %139, i32 noundef 0, i32 noundef 2, ptr noundef @.str.42, ptr noundef %144)
  %146 = load ptr, ptr @stdout, align 8, !tbaa !19
  %147 = load i32, ptr %19, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [7 x %struct.anon], ptr @aes_gcm_tests, i64 0, i64 %148
  %150 = getelementptr inbounds %struct.anon, ptr %149, i32 0, i32 1
  %151 = load ptr, ptr %150, align 8, !tbaa !12
  %152 = call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef %146, i32 noundef 0, i32 noundef 2, ptr noundef @.str.43, ptr noundef %151)
  %153 = load ptr, ptr @stdout, align 8, !tbaa !19
  %154 = load i32, ptr %19, align 4, !tbaa !5
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [7 x %struct.anon], ptr @aes_gcm_tests, i64 0, i64 %155
  %157 = getelementptr inbounds %struct.anon, ptr %156, i32 0, i32 2
  %158 = load ptr, ptr %157, align 16, !tbaa !13
  %159 = call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef %153, i32 noundef 0, i32 noundef 2, ptr noundef @.str.44, ptr noundef %158)
  %160 = load ptr, ptr @stdout, align 8, !tbaa !19
  %161 = load i32, ptr %19, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [7 x %struct.anon], ptr @aes_gcm_tests, i64 0, i64 %162
  %164 = getelementptr inbounds %struct.anon, ptr %163, i32 0, i32 3
  %165 = load ptr, ptr %164, align 8, !tbaa !14
  %166 = call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef %160, i32 noundef 0, i32 noundef 2, ptr noundef @.str.45, ptr noundef %165)
  %167 = load ptr, ptr @stdout, align 8, !tbaa !19
  %168 = load i32, ptr %19, align 4, !tbaa !5
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds [7 x %struct.anon], ptr @aes_gcm_tests, i64 0, i64 %169
  %171 = getelementptr inbounds %struct.anon, ptr %170, i32 0, i32 4
  %172 = load ptr, ptr %171, align 16, !tbaa !15
  %173 = call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef %167, i32 noundef 0, i32 noundef 2, ptr noundef @.str.46, ptr noundef %172)
  %174 = load ptr, ptr @stdout, align 8, !tbaa !19
  %175 = getelementptr inbounds [64 x i8], ptr %16, i64 0, i64 0
  %176 = load i64, ptr %10, align 8, !tbaa !17
  %177 = call i32 @format_bytes(ptr noundef %174, i32 noundef 0, i32 noundef 2, ptr noundef @.str.47, ptr noundef %175, i64 noundef %176)
  %178 = load ptr, ptr @stdout, align 8, !tbaa !19
  %179 = load i32, ptr %19, align 4, !tbaa !5
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds [7 x %struct.anon], ptr @aes_gcm_tests, i64 0, i64 %180
  %182 = getelementptr inbounds %struct.anon, ptr %181, i32 0, i32 5
  %183 = load ptr, ptr %182, align 8, !tbaa !16
  %184 = call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef %178, i32 noundef 0, i32 noundef 2, ptr noundef @.str.48, ptr noundef %183)
  %185 = load ptr, ptr @stdout, align 8, !tbaa !19
  %186 = getelementptr inbounds [16 x i8], ptr %17, i64 0, i64 0
  %187 = load i64, ptr %14, align 8, !tbaa !17
  %188 = call i32 @format_bytes(ptr noundef %185, i32 noundef 0, i32 noundef 2, ptr noundef @.str.47, ptr noundef %186, i64 noundef %187)
  store i32 -1, ptr %1, align 4
  store i32 1, ptr %20, align 4
  br label %197

189:                                              ; preds = %131
  %190 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  br label %191

191:                                              ; preds = %189
  br label %192

192:                                              ; preds = %191
  %193 = load i32, ptr %19, align 4, !tbaa !5
  %194 = add nsw i32 %193, 1
  store i32 %194, ptr %19, align 4, !tbaa !5
  br label %21, !llvm.loop !20

195:                                              ; preds = %21
  %196 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, ptr noundef @__FUNCTION__.test_aes_gcm)
  store i32 1, ptr %1, align 4
  store i32 1, ptr %20, align 4
  br label %197

197:                                              ; preds = %195, %137
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 248, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  %198 = load i32, ptr %1, align 4
  ret i32 %198
}

declare i32 @aes_gcm_encrypt(ptr noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef, ptr noundef) #1

declare i32 @aes_gcm_decrypt(ptr noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef, ptr noundef) #1

declare i32 @format_print(ptr noundef, i32 noundef, i32 noundef, ptr noundef, ...) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 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 #3 = { 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 = { nounwind }
attributes #5 = { 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, !11, i64 0}
!10 = !{!"", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!10, !11, i64 8}
!13 = !{!10, !11, i64 16}
!14 = !{!10, !11, i64 24}
!15 = !{!10, !11, i64 32}
!16 = !{!10, !11, i64 40}
!17 = !{!18, !18, i64 0}
!18 = !{!"long", !7, i64 0}
!19 = !{!11, !11, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}


; 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.anon = type { ptr, ptr, ptr, ptr, ptr, ptr }
%struct.AES_KEY = type { [60 x i32], i64 }

@.str.1 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [9 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@aes_gcm_tests = external dso_local local_unnamed_addr global [7 x %struct.anon], align 16
@.str.41 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.43 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.45 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.46 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.47 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.48 = external hidden unnamed_addr constant [8 x i8], align 1
@__FUNCTION__.test_aes_gcm = external hidden unnamed_addr constant [13 x i8], align 1

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

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

declare i32 @aes_set_encrypt_key(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

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

declare i32 @hex_to_bytes(ptr noundef, i64 noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3

declare i32 @format_bytes(ptr noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 2) i32 @test_aes_gcm() local_unnamed_addr #4 {
  %1 = alloca [32 x i8], align 16
  %2 = alloca [64 x i8], align 16
  %3 = alloca [32 x i8], align 16
  %4 = alloca [64 x i8], align 16
  %5 = alloca [64 x i8], align 16
  %6 = alloca [16 x i8], align 16
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca %struct.AES_KEY, align 8
  %14 = alloca [64 x i8], align 16
  %15 = alloca [16 x i8], align 16
  %16 = alloca [64 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #6
  call void @llvm.lifetime.start.p0(i64 248, ptr nonnull %13) #6
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %14) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %15) #6
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %16) #6
  br label %17

17:                                               ; preds = %0, %89
  %indvars.iv = phi i64 [ 0, %0 ], [ %indvars.iv.next, %89 ]
  %18 = getelementptr inbounds [7 x %struct.anon], ptr @aes_gcm_tests, i64 0, i64 %indvars.iv
  %19 = load ptr, ptr %18, align 16, !tbaa !5
  %20 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %19) #7
  %21 = call i32 @hex_to_bytes(ptr noundef %19, i64 noundef %20, ptr noundef nonnull %1, ptr noundef nonnull %7) #6
  %22 = getelementptr inbounds i8, ptr %18, i64 8
  %23 = load ptr, ptr %22, align 8, !tbaa !10
  %24 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %23) #7
  %25 = call i32 @hex_to_bytes(ptr noundef %23, i64 noundef %24, ptr noundef nonnull %2, ptr noundef nonnull %8) #6
  %26 = getelementptr inbounds i8, ptr %18, i64 16
  %27 = load ptr, ptr %26, align 16, !tbaa !11
  %28 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %27) #7
  %29 = call i32 @hex_to_bytes(ptr noundef %27, i64 noundef %28, ptr noundef nonnull %3, ptr noundef nonnull %9) #6
  %30 = getelementptr inbounds i8, ptr %18, i64 24
  %31 = load ptr, ptr %30, align 8, !tbaa !12
  %32 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %31) #7
  %33 = call i32 @hex_to_bytes(ptr noundef %31, i64 noundef %32, ptr noundef nonnull %4, ptr noundef nonnull %10) #6
  %34 = getelementptr inbounds i8, ptr %18, i64 32
  %35 = load ptr, ptr %34, align 16, !tbaa !13
  %36 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %35) #7
  %37 = call i32 @hex_to_bytes(ptr noundef %35, i64 noundef %36, ptr noundef nonnull %5, ptr noundef nonnull %11) #6
  %38 = getelementptr inbounds i8, ptr %18, i64 40
  %39 = load ptr, ptr %38, align 8, !tbaa !14
  %40 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %39) #7
  %41 = call i32 @hex_to_bytes(ptr noundef %39, i64 noundef %40, ptr noundef nonnull %6, ptr noundef nonnull %12) #6
  %42 = load i64, ptr %7, align 8, !tbaa !15
  %43 = call i32 @aes_set_encrypt_key(ptr noundef nonnull %13, ptr noundef nonnull %1, i64 noundef %42) #6
  %44 = load i64, ptr %10, align 8, !tbaa !15
  %45 = load i64, ptr %9, align 8, !tbaa !15
  %46 = load i64, ptr %8, align 8, !tbaa !15
  %47 = load i64, ptr %12, align 8, !tbaa !15
  %48 = call i32 @aes_gcm_encrypt(ptr noundef nonnull %13, ptr noundef nonnull %4, i64 noundef %44, ptr noundef nonnull %3, i64 noundef %45, ptr noundef nonnull %2, i64 noundef %46, ptr noundef nonnull %14, i64 noundef %47, ptr noundef nonnull %15) #6
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %49 = trunc nuw nsw i64 %indvars.iv.next to i32
  %50 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.41, i32 noundef %49)
  %51 = load i64, ptr %10, align 8, !tbaa !15
  %52 = load i64, ptr %9, align 8, !tbaa !15
  %53 = load i64, ptr %8, align 8, !tbaa !15
  %54 = load i64, ptr %12, align 8, !tbaa !15
  %55 = call i32 @aes_gcm_decrypt(ptr noundef nonnull %13, ptr noundef nonnull %4, i64 noundef %51, ptr noundef nonnull %3, i64 noundef %52, ptr noundef nonnull %14, i64 noundef %53, ptr noundef nonnull %15, i64 noundef %54, ptr noundef nonnull %16) #6
  %.not = icmp eq i32 %55, 1
  br i1 %.not, label %56, label %58

56:                                               ; preds = %17
  %57 = load i64, ptr %8, align 8, !tbaa !15
  %bcmp = call i32 @bcmp(ptr nonnull %16, ptr nonnull %2, i64 %57)
  %.not24 = icmp eq i32 %bcmp, 0
  br i1 %.not24, label %89, label %58

58:                                               ; preds = %56, %17
  %59 = getelementptr inbounds i8, ptr %18, i64 8
  %60 = getelementptr inbounds i8, ptr %18, i64 16
  %61 = getelementptr inbounds i8, ptr %18, i64 24
  %62 = getelementptr inbounds i8, ptr %18, i64 32
  %63 = getelementptr inbounds i8, ptr %18, i64 40
  %64 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %65 = load ptr, ptr @stdout, align 8, !tbaa !17
  %66 = load ptr, ptr %18, align 16, !tbaa !5
  %67 = call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef %65, i32 noundef 0, i32 noundef 2, ptr noundef nonnull @.str.42, ptr noundef %66) #6
  %68 = load ptr, ptr @stdout, align 8, !tbaa !17
  %69 = load ptr, ptr %59, align 8, !tbaa !10
  %70 = call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef %68, i32 noundef 0, i32 noundef 2, ptr noundef nonnull @.str.43, ptr noundef %69) #6
  %71 = load ptr, ptr @stdout, align 8, !tbaa !17
  %72 = load ptr, ptr %60, align 16, !tbaa !11
  %73 = call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef %71, i32 noundef 0, i32 noundef 2, ptr noundef nonnull @.str.44, ptr noundef %72) #6
  %74 = load ptr, ptr @stdout, align 8, !tbaa !17
  %75 = load ptr, ptr %61, align 8, !tbaa !12
  %76 = call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef %74, i32 noundef 0, i32 noundef 2, ptr noundef nonnull @.str.45, ptr noundef %75) #6
  %77 = load ptr, ptr @stdout, align 8, !tbaa !17
  %78 = load ptr, ptr %62, align 16, !tbaa !13
  %79 = call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef %77, i32 noundef 0, i32 noundef 2, ptr noundef nonnull @.str.46, ptr noundef %78) #6
  %80 = load ptr, ptr @stdout, align 8, !tbaa !17
  %81 = load i64, ptr %8, align 8, !tbaa !15
  %82 = call i32 @format_bytes(ptr noundef %80, i32 noundef 0, i32 noundef 2, ptr noundef nonnull @.str.47, ptr noundef nonnull %14, i64 noundef %81) #6
  %83 = load ptr, ptr @stdout, align 8, !tbaa !17
  %84 = load ptr, ptr %63, align 8, !tbaa !14
  %85 = call i32 (ptr, i32, i32, ptr, ...) @format_print(ptr noundef %83, i32 noundef 0, i32 noundef 2, ptr noundef nonnull @.str.48, ptr noundef %84) #6
  %86 = load ptr, ptr @stdout, align 8, !tbaa !17
  %87 = load i64, ptr %12, align 8, !tbaa !15
  %88 = call i32 @format_bytes(ptr noundef %86, i32 noundef 0, i32 noundef 2, ptr noundef nonnull @.str.47, ptr noundef nonnull %15, i64 noundef %87) #6
  br label %93

89:                                               ; preds = %56
  %90 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  %exitcond.not = icmp eq i64 %indvars.iv.next, 7
  br i1 %exitcond.not, label %91, label %17, !llvm.loop !18

91:                                               ; preds = %89
  %92 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, ptr noundef nonnull @__FUNCTION__.test_aes_gcm)
  br label %93

93:                                               ; preds = %91, %58
  %.022 = phi i32 [ -1, %58 ], [ 1, %91 ]
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %16) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %15) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %14) #6
  call void @llvm.lifetime.end.p0(i64 248, ptr nonnull %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #6
  ret i32 %.022
}

declare i32 @aes_gcm_encrypt(ptr noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #2

declare i32 @aes_gcm_decrypt(ptr noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #2

declare i32 @format_print(ptr noundef, i32 noundef, i32 noundef, ptr noundef, ...) local_unnamed_addr #2

; Function Attrs: nofree nounwind willreturn memory(argmem: read)
declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #5

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 = { 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 #4 = { 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 #5 = { nofree nounwind willreturn memory(argmem: read) }
attributes #6 = { nounwind }
attributes #7 = { 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, !7, i64 0}
!6 = !{!"", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!6, !7, i64 8}
!11 = !{!6, !7, i64 16}
!12 = !{!6, !7, i64 24}
!13 = !{!6, !7, i64 32}
!14 = !{!6, !7, i64 40}
!15 = !{!16, !16, i64 0}
!16 = !{!"long", !8, i64 0}
!17 = !{!7, !7, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,LCSSAPass,LICMPass,LoopRotatePass,LoopUnrollPass,SROAPass,SimplifyCFGPass