; LLVM IR from chdb-io/chdb :: examples (chdbDlopen)

; 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.local_result = type { ptr, i64, ptr, double, i64, i64 }

@.str = external hidden unnamed_addr constant [14 x i8], align 1
@stderr = external global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [18 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca [10 x ptr], align 16
  %10 = alloca i32, align 4
  %11 = alloca [50 x i8], align 16
  %12 = alloca [100 x i8], align 16
  %13 = alloca [1000 x i8], align 16
  %14 = alloca [200 x i8], align 16
  %15 = alloca [200 x i8], align 16
  %16 = alloca ptr, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  %17 = call ptr @dlopen(ptr noundef @.str, i32 noundef 1) #6
  store ptr %17, ptr %2, align 8, !tbaa !5
  %18 = load ptr, ptr %2, align 8, !tbaa !5
  %19 = icmp ne ptr %18, null
  br i1 %19, label %24, label %20

20:                                               ; preds = %0
  %21 = load ptr, ptr @stderr, align 8, !tbaa !5
  %22 = call ptr @dlerror() #6
  %23 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %21, ptr noundef @.str.1, ptr noundef %22) #6
  call void @exit(i32 noundef 1) #7
  unreachable

24:                                               ; preds = %0
  %25 = load ptr, ptr %2, align 8, !tbaa !5
  %26 = call ptr @dlsym(ptr noundef %25, ptr noundef @.str.2) #6
  store ptr %26, ptr %3, align 8, !tbaa !5
  %27 = load ptr, ptr %3, align 8, !tbaa !5
  %28 = icmp ne ptr %27, null
  br i1 %28, label %35, label %29

29:                                               ; preds = %24
  %30 = load ptr, ptr @stderr, align 8, !tbaa !5
  %31 = call ptr @dlerror() #6
  %32 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %30, ptr noundef @.str.3, ptr noundef %31) #6
  %33 = load ptr, ptr %2, align 8, !tbaa !5
  %34 = call i32 @dlclose(ptr noundef %33) #6
  call void @exit(i32 noundef 1) #7
  unreachable

35:                                               ; preds = %24
  %36 = load ptr, ptr %2, align 8, !tbaa !5
  %37 = call ptr @dlsym(ptr noundef %36, ptr noundef @.str.4) #6
  store ptr %37, ptr %4, align 8, !tbaa !5
  %38 = load ptr, ptr %4, align 8, !tbaa !5
  %39 = icmp ne ptr %38, null
  br i1 %39, label %46, label %40

40:                                               ; preds = %35
  %41 = load ptr, ptr @stderr, align 8, !tbaa !5
  %42 = call ptr @dlerror() #6
  %43 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %41, ptr noundef @.str.5, ptr noundef %42) #6
  %44 = load ptr, ptr %2, align 8, !tbaa !5
  %45 = call i32 @dlclose(ptr noundef %44) #6
  call void @exit(i32 noundef 1) #7
  unreachable

46:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  store ptr @.str.6, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  store ptr @.str.7, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  store ptr @.str.8, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  store ptr @.str.8, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 80, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !9
  %47 = load i32, ptr %10, align 4, !tbaa !9
  %48 = add nsw i32 %47, 1
  store i32 %48, ptr %10, align 4, !tbaa !9
  %49 = sext i32 %47 to i64
  %50 = getelementptr inbounds [10 x ptr], ptr %9, i64 0, i64 %49
  store ptr @.str.9, ptr %50, align 8, !tbaa !5
  %51 = load i32, ptr %10, align 4, !tbaa !9
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr %10, align 4, !tbaa !9
  %53 = sext i32 %51 to i64
  %54 = getelementptr inbounds [10 x ptr], ptr %9, i64 0, i64 %53
  store ptr @.str.10, ptr %54, align 8, !tbaa !5
  %55 = load ptr, ptr %5, align 8, !tbaa !5
  %56 = call i32 @strcmp(ptr noundef %55, ptr noundef @.str.11) #8
  %57 = icmp eq i32 %56, 0
  br i1 %57, label %62, label %58

58:                                               ; preds = %46
  %59 = load ptr, ptr %5, align 8, !tbaa !5
  %60 = call i32 @strcmp(ptr noundef %59, ptr noundef @.str.12) #8
  %61 = icmp eq i32 %60, 0
  br i1 %61, label %62, label %75

62:                                               ; preds = %58, %46
  %63 = load i32, ptr %10, align 4, !tbaa !9
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr %10, align 4, !tbaa !9
  %65 = sext i32 %63 to i64
  %66 = getelementptr inbounds [10 x ptr], ptr %9, i64 0, i64 %65
  store ptr @.str.13, ptr %66, align 8, !tbaa !5
  %67 = load i32, ptr %10, align 4, !tbaa !9
  %68 = add nsw i32 %67, 1
  store i32 %68, ptr %10, align 4, !tbaa !9
  %69 = sext i32 %67 to i64
  %70 = getelementptr inbounds [10 x ptr], ptr %9, i64 0, i64 %69
  store ptr @.str.14, ptr %70, align 8, !tbaa !5
  %71 = load i32, ptr %10, align 4, !tbaa !9
  %72 = add nsw i32 %71, 1
  store i32 %72, ptr %10, align 4, !tbaa !9
  %73 = sext i32 %71 to i64
  %74 = getelementptr inbounds [10 x ptr], ptr %9, i64 0, i64 %73
  store ptr @.str.15, ptr %74, align 8, !tbaa !5
  br label %85

75:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 50, ptr %11) #6
  %76 = getelementptr inbounds [50 x i8], ptr %11, i64 0, i64 0
  %77 = load ptr, ptr %5, align 8, !tbaa !5
  %78 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %76, ptr noundef @.str.16, ptr noundef %77) #6
  %79 = getelementptr inbounds [50 x i8], ptr %11, i64 0, i64 0
  %80 = call noalias ptr @strdup(ptr noundef %79) #6
  %81 = load i32, ptr %10, align 4, !tbaa !9
  %82 = add nsw i32 %81, 1
  store i32 %82, ptr %10, align 4, !tbaa !9
  %83 = sext i32 %81 to i64
  %84 = getelementptr inbounds [10 x ptr], ptr %9, i64 0, i64 %83
  store ptr %80, ptr %84, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 50, ptr %11) #6
  br label %85

85:                                               ; preds = %75, %62
  %86 = load ptr, ptr %7, align 8, !tbaa !5
  %87 = icmp ne ptr %86, null
  br i1 %87, label %88, label %102

88:                                               ; preds = %85
  %89 = load ptr, ptr %7, align 8, !tbaa !5
  %90 = load i8, ptr %89, align 1, !tbaa !11
  %91 = sext i8 %90 to i32
  %92 = icmp ne i32 %91, 0
  br i1 %92, label %93, label %102

93:                                               ; preds = %88
  call void @llvm.lifetime.start.p0(i64 100, ptr %12) #6
  %94 = getelementptr inbounds [100 x i8], ptr %12, i64 0, i64 0
  %95 = load ptr, ptr %7, align 8, !tbaa !5
  %96 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %94, ptr noundef @.str.17, ptr noundef %95) #6
  %97 = getelementptr inbounds [100 x i8], ptr %12, i64 0, i64 0
  %98 = load i32, ptr %10, align 4, !tbaa !9
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr %10, align 4, !tbaa !9
  %100 = sext i32 %98 to i64
  %101 = getelementptr inbounds [10 x ptr], ptr %9, i64 0, i64 %100
  store ptr %97, ptr %101, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 100, ptr %12) #6
  br label %102

102:                                              ; preds = %93, %88, %85
  call void @llvm.lifetime.start.p0(i64 1000, ptr %13) #6
  %103 = getelementptr inbounds [1000 x i8], ptr %13, i64 0, i64 0
  %104 = load ptr, ptr %6, align 8, !tbaa !5
  %105 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %103, ptr noundef @.str.18, ptr noundef %104) #6
  %106 = getelementptr inbounds [1000 x i8], ptr %13, i64 0, i64 0
  %107 = load i32, ptr %10, align 4, !tbaa !9
  %108 = add nsw i32 %107, 1
  store i32 %108, ptr %10, align 4, !tbaa !9
  %109 = sext i32 %107 to i64
  %110 = getelementptr inbounds [10 x ptr], ptr %9, i64 0, i64 %109
  store ptr %106, ptr %110, align 8, !tbaa !5
  %111 = load ptr, ptr %8, align 8, !tbaa !5
  %112 = icmp ne ptr %111, null
  br i1 %112, label %113, label %139

113:                                              ; preds = %102
  %114 = load ptr, ptr %8, align 8, !tbaa !5
  %115 = load i8, ptr %114, align 1, !tbaa !11
  %116 = sext i8 %115 to i32
  %117 = icmp ne i32 %116, 0
  br i1 %117, label %118, label %139

118:                                              ; preds = %113
  %119 = load i32, ptr %10, align 4, !tbaa !9
  %120 = add nsw i32 %119, 1
  store i32 %120, ptr %10, align 4, !tbaa !9
  %121 = sext i32 %119 to i64
  %122 = getelementptr inbounds [10 x ptr], ptr %9, i64 0, i64 %121
  store ptr @.str.19, ptr %122, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 200, ptr %14) #6
  %123 = getelementptr inbounds [200 x i8], ptr %14, i64 0, i64 0
  %124 = load ptr, ptr %8, align 8, !tbaa !5
  %125 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %123, ptr noundef @.str.20, ptr noundef %124) #6
  %126 = getelementptr inbounds [200 x i8], ptr %14, i64 0, i64 0
  %127 = load i32, ptr %10, align 4, !tbaa !9
  %128 = add nsw i32 %127, 1
  store i32 %128, ptr %10, align 4, !tbaa !9
  %129 = sext i32 %127 to i64
  %130 = getelementptr inbounds [10 x ptr], ptr %9, i64 0, i64 %129
  store ptr %126, ptr %130, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 200, ptr %15) #6
  %131 = getelementptr inbounds [200 x i8], ptr %15, i64 0, i64 0
  %132 = load ptr, ptr %8, align 8, !tbaa !5
  %133 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %131, ptr noundef @.str.21, ptr noundef %132) #6
  %134 = getelementptr inbounds [200 x i8], ptr %15, i64 0, i64 0
  %135 = load i32, ptr %10, align 4, !tbaa !9
  %136 = add nsw i32 %135, 1
  store i32 %136, ptr %10, align 4, !tbaa !9
  %137 = sext i32 %135 to i64
  %138 = getelementptr inbounds [10 x ptr], ptr %9, i64 0, i64 %137
  store ptr %134, ptr %138, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 200, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 200, ptr %14) #6
  br label %139

139:                                              ; preds = %118, %113, %102
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %140 = load ptr, ptr %3, align 8, !tbaa !5
  %141 = load i32, ptr %10, align 4, !tbaa !9
  %142 = getelementptr inbounds [10 x ptr], ptr %9, i64 0, i64 0
  %143 = call ptr %140(i32 noundef %141, ptr noundef %142)
  store ptr %143, ptr %16, align 8, !tbaa !5
  %144 = load ptr, ptr %16, align 8, !tbaa !5
  %145 = icmp ne ptr %144, null
  br i1 %145, label %146, label %165

146:                                              ; preds = %139
  %147 = load ptr, ptr %16, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.local_result, ptr %147, i32 0, i32 0
  %149 = load ptr, ptr %148, align 8, !tbaa !12
  %150 = call i32 (ptr, ...) @printf(ptr noundef @.str.22, ptr noundef %149)
  %151 = load ptr, ptr %16, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.local_result, ptr %151, i32 0, i32 3
  %153 = load double, ptr %152, align 8, !tbaa !16
  %154 = call i32 (ptr, ...) @printf(ptr noundef @.str.23, double noundef %153)
  %155 = load ptr, ptr %16, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.local_result, ptr %155, i32 0, i32 4
  %157 = load i64, ptr %156, align 8, !tbaa !17
  %158 = call i32 (ptr, ...) @printf(ptr noundef @.str.24, i64 noundef %157)
  %159 = load ptr, ptr %16, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.local_result, ptr %159, i32 0, i32 5
  %161 = load i64, ptr %160, align 8, !tbaa !18
  %162 = call i32 (ptr, ...) @printf(ptr noundef @.str.25, i64 noundef %161)
  %163 = load ptr, ptr %4, align 8, !tbaa !5
  %164 = load ptr, ptr %16, align 8, !tbaa !5
  call void %163(ptr noundef %164)
  br label %165

165:                                              ; preds = %146, %139
  %166 = load ptr, ptr %2, align 8, !tbaa !5
  %167 = call i32 @dlclose(ptr noundef %166) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 1000, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  ret i32 0
}

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

; Function Attrs: nounwind
declare ptr @dlopen(ptr noundef, i32 noundef) #2

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

; Function Attrs: nounwind
declare ptr @dlerror() #2

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

; Function Attrs: nounwind
declare ptr @dlsym(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind
declare i32 @dlclose(ptr noundef) #2

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strcmp(ptr noundef, ptr noundef) #4

; Function Attrs: nounwind
declare i32 @sprintf(ptr noundef, ptr noundef, ...) #2

; Function Attrs: nounwind
declare noalias ptr @strdup(ptr noundef) #2

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

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

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


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

@.str = external hidden unnamed_addr constant [14 x i8], align 1
@stderr = external local_unnamed_addr global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [18 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca [10 x ptr], align 16
  %2 = alloca [50 x i8], align 16
  %3 = alloca [100 x i8], align 16
  %4 = alloca [1000 x i8], align 16
  %5 = alloca [200 x i8], align 16
  %6 = alloca [200 x i8], align 16
  %7 = tail call ptr @dlopen(ptr noundef nonnull @.str, i32 noundef 1) #7
  %.not = icmp eq ptr %7, null
  br i1 %.not, label %8, label %12

8:                                                ; preds = %0
  %9 = load ptr, ptr @stderr, align 8, !tbaa !5
  %10 = tail call ptr @dlerror() #7
  %11 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %9, ptr noundef nonnull @.str.1, ptr noundef %10) #8
  tail call void @exit(i32 noundef 1) #9
  unreachable

12:                                               ; preds = %0
  %13 = tail call ptr @dlsym(ptr noundef nonnull %7, ptr noundef nonnull @.str.2) #7
  %.not42 = icmp eq ptr %13, null
  br i1 %.not42, label %14, label %19

14:                                               ; preds = %12
  %15 = load ptr, ptr @stderr, align 8, !tbaa !5
  %16 = tail call ptr @dlerror() #7
  %17 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %15, ptr noundef nonnull @.str.3, ptr noundef %16) #8
  %18 = tail call i32 @dlclose(ptr noundef nonnull %7) #7
  tail call void @exit(i32 noundef 1) #9
  unreachable

19:                                               ; preds = %12
  %20 = tail call ptr @dlsym(ptr noundef nonnull %7, ptr noundef nonnull @.str.4) #7
  %.not43 = icmp eq ptr %20, null
  br i1 %.not43, label %21, label %26

21:                                               ; preds = %19
  %22 = load ptr, ptr @stderr, align 8, !tbaa !5
  %23 = tail call ptr @dlerror() #7
  %24 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %22, ptr noundef nonnull @.str.5, ptr noundef %23) #8
  %25 = tail call i32 @dlclose(ptr noundef nonnull %7) #7
  tail call void @exit(i32 noundef 1) #9
  unreachable

26:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %1) #7
  store ptr @.str.9, ptr %1, align 16, !tbaa !5
  %27 = getelementptr inbounds i8, ptr %1, i64 8
  store ptr @.str.10, ptr %27, align 8, !tbaa !5
  %28 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) @.str.6, ptr noundef nonnull dereferenceable(1) @.str.11) #10
  %29 = icmp eq i32 %28, 0
  br i1 %29, label %33, label %30

30:                                               ; preds = %26
  %31 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) @.str.6, ptr noundef nonnull dereferenceable(1) @.str.12) #10
  %32 = icmp eq i32 %31, 0
  br i1 %32, label %33, label %37

33:                                               ; preds = %30, %26
  %34 = getelementptr inbounds i8, ptr %1, i64 16
  store ptr @.str.13, ptr %34, align 16, !tbaa !5
  %35 = getelementptr inbounds i8, ptr %1, i64 24
  store ptr @.str.14, ptr %35, align 8, !tbaa !5
  %36 = getelementptr inbounds i8, ptr %1, i64 32
  store ptr @.str.15, ptr %36, align 16, !tbaa !5
  br label %41

37:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 50, ptr nonnull %2) #7
  %38 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) @.str.16, ptr noundef nonnull @.str.6) #7
  %39 = call noalias ptr @strdup(ptr noundef nonnull %2) #7
  %40 = getelementptr inbounds i8, ptr %1, i64 16
  store ptr %39, ptr %40, align 16, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 50, ptr nonnull %2) #7
  br label %41

41:                                               ; preds = %33, %37
  %.0 = phi i32 [ 5, %33 ], [ 3, %37 ]
  %42 = load i8, ptr @.str.8, align 1, !tbaa !9
  %.not44 = icmp eq i8 %42, 0
  %43 = add nuw nsw i32 %.0, 1
  %44 = zext nneg i32 %.0 to i64
  %45 = getelementptr inbounds [10 x ptr], ptr %1, i64 0, i64 %44
  br i1 %.not44, label %.thread, label %47

.thread:                                          ; preds = %41
  call void @llvm.lifetime.start.p0(i64 1000, ptr nonnull %4) #7
  %46 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %4, ptr noundef nonnull dereferenceable(1) @.str.18, ptr noundef nonnull @.str.7) #7
  store ptr %4, ptr %45, align 8, !tbaa !5
  br label %64

47:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %3) #7
  %48 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %3, ptr noundef nonnull dereferenceable(1) @.str.17, ptr noundef nonnull @.str.8) #7
  store ptr %3, ptr %45, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 1000, ptr nonnull %4) #7
  %49 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %4, ptr noundef nonnull dereferenceable(1) @.str.18, ptr noundef nonnull @.str.7) #7
  %50 = add nuw nsw i32 %.0, 2
  %51 = zext nneg i32 %43 to i64
  %52 = getelementptr inbounds [10 x ptr], ptr %1, i64 0, i64 %51
  store ptr %4, ptr %52, align 16, !tbaa !5
  %53 = add nuw nsw i32 %.0, 3
  %54 = zext nneg i32 %50 to i64
  %55 = getelementptr inbounds [10 x ptr], ptr %1, i64 0, i64 %54
  store ptr @.str.19, ptr %55, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 200, ptr nonnull %5) #7
  %56 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %5, ptr noundef nonnull dereferenceable(1) @.str.20, ptr noundef nonnull @.str.8) #7
  %57 = add nuw nsw i32 %.0, 4
  %58 = zext nneg i32 %53 to i64
  %59 = getelementptr inbounds [10 x ptr], ptr %1, i64 0, i64 %58
  store ptr %5, ptr %59, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 200, ptr nonnull %6) #7
  %60 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %6, ptr noundef nonnull dereferenceable(1) @.str.21, ptr noundef nonnull @.str.8) #7
  %61 = add nuw nsw i32 %.0, 5
  %62 = zext nneg i32 %57 to i64
  %63 = getelementptr inbounds [10 x ptr], ptr %1, i64 0, i64 %62
  store ptr %6, ptr %63, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %5) #7
  br label %64

64:                                               ; preds = %.thread, %47
  %.2 = phi i32 [ %61, %47 ], [ %43, %.thread ]
  %65 = call ptr %13(i32 noundef %.2, ptr noundef nonnull %1) #7
  %.not46 = icmp eq ptr %65, null
  br i1 %.not46, label %78, label %66

66:                                               ; preds = %64
  %67 = load ptr, ptr %65, align 8, !tbaa !10
  %68 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.22, ptr noundef %67)
  %69 = getelementptr inbounds i8, ptr %65, i64 24
  %70 = load double, ptr %69, align 8, !tbaa !14
  %71 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.23, double noundef %70)
  %72 = getelementptr inbounds i8, ptr %65, i64 32
  %73 = load i64, ptr %72, align 8, !tbaa !15
  %74 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.24, i64 noundef %73)
  %75 = getelementptr inbounds i8, ptr %65, i64 40
  %76 = load i64, ptr %75, align 8, !tbaa !16
  %77 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.25, i64 noundef %76)
  call void %20(ptr noundef nonnull %65) #7
  br label %78

78:                                               ; preds = %66, %64
  %79 = call i32 @dlclose(ptr noundef nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 1000, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %1) #7
  ret i32 0
}

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

; Function Attrs: nounwind
declare ptr @dlopen(ptr noundef, i32 noundef) local_unnamed_addr #2

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

; Function Attrs: nounwind
declare ptr @dlerror() local_unnamed_addr #2

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

; Function Attrs: nounwind
declare ptr @dlsym(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind
declare i32 @dlclose(ptr noundef) local_unnamed_addr #2

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

; Function Attrs: nofree nounwind
declare noundef i32 @sprintf(ptr noalias nocapture noundef writeonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite)
declare noalias ptr @strdup(ptr nocapture noundef readonly) local_unnamed_addr #6

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

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 = { 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 #4 = { 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 #5 = { 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 #6 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { nounwind }
attributes #8 = { cold nounwind }
attributes #9 = { noreturn nounwind }
attributes #10 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !6, i64 0}
!11 = !{!"local_result", !6, i64 0, !12, i64 8, !6, i64 16, !13, i64 24, !12, i64 32, !12, i64 40}
!12 = !{!"long", !7, i64 0}
!13 = !{!"double", !7, i64 0}
!14 = !{!11, !13, i64 24}
!15 = !{!11, !12, i64 32}
!16 = !{!11, !12, i64 40}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass