; LLVM IR from zhechkoz/PwIN :: jitmenot (main)

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

%struct.test_chain = type { ptr, ptr, ptr, ptr, ptr }

@this_arch = external dso_local global i32, align 4
@arch_strings = external dso_local global [1 x ptr], align 8
@stderr = external global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [1 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

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

; 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 @print_usage(ptr noundef) #2

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

; Function Attrs: nounwind uwtable
declare dso_local void @test_chain_free_all(ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #2 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %struct.test_chain, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 0, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 0, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 0, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 40, ptr %9) #7
  call void @llvm.memset.p0.i64(ptr align 8 %9, i8 0, i64 40, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  store ptr null, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %13

13:                                               ; preds = %30, %2
  %14 = load i32, ptr %11, align 4, !tbaa !5
  %15 = sext i32 %14 to i64
  %16 = icmp ult i64 %15, 1
  br i1 %16, label %18, label %17

17:                                               ; preds = %13
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %33

18:                                               ; preds = %13
  %19 = call i64 @getauxval(i64 noundef 15) #7
  %20 = inttoptr i64 %19 to ptr
  %21 = load i32, ptr %11, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [1 x ptr], ptr @arch_strings, i64 0, i64 %22
  %24 = load ptr, ptr %23, align 8, !tbaa !9
  %25 = call i32 @strcmp(ptr noundef %20, ptr noundef %24) #8
  %26 = icmp ne i32 %25, 0
  br i1 %26, label %29, label %27

27:                                               ; preds = %18
  %28 = load i32, ptr %11, align 4, !tbaa !5
  store i32 %28, ptr @this_arch, align 4, !tbaa !5
  br label %29

29:                                               ; preds = %27, %18
  br label %30

30:                                               ; preds = %29
  %31 = load i32, ptr %11, align 4, !tbaa !5
  %32 = add nsw i32 %31, 1
  store i32 %32, ptr %11, align 4, !tbaa !5
  br label %13, !llvm.loop !11

33:                                               ; preds = %17
  %34 = load i32, ptr @this_arch, align 4, !tbaa !5
  %35 = icmp eq i32 %34, -1
  br i1 %35, label %36, label %39

36:                                               ; preds = %33
  %37 = load ptr, ptr @stderr, align 8, !tbaa !9
  %38 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %37, ptr noundef @.str.3) #7
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %12, align 4
  br label %154

39:                                               ; preds = %33
  br label %40

40:                                               ; preds = %53, %39
  %41 = load i32, ptr %4, align 4, !tbaa !5
  %42 = load ptr, ptr %5, align 8, !tbaa !9
  %43 = call i32 @getopt(i32 noundef %41, ptr noundef %42, ptr noundef @.str.4) #7
  store i32 %43, ptr %8, align 4, !tbaa !5
  %44 = icmp ne i32 %43, -1
  br i1 %44, label %45, label %54

45:                                               ; preds = %40
  %46 = load i32, ptr %8, align 4, !tbaa !5
  switch i32 %46, label %49 [
    i32 118, label %47
    i32 104, label %48
  ]

47:                                               ; preds = %45
  store i32 1, ptr %7, align 4, !tbaa !5
  br label %53

48:                                               ; preds = %45
  br label %49

49:                                               ; preds = %48, %45
  %50 = load ptr, ptr %5, align 8, !tbaa !9
  %51 = getelementptr inbounds ptr, ptr %50, i64 0
  %52 = load ptr, ptr %51, align 8, !tbaa !9
  call void @print_usage(ptr noundef %52)
  call void @exit(i32 noundef 1) #9
  unreachable

53:                                               ; preds = %47
  br label %40, !llvm.loop !13

54:                                               ; preds = %40
  %55 = getelementptr inbounds %struct.test_chain, ptr %9, i32 0, i32 3
  store ptr @.str.5, ptr %55, align 8, !tbaa !14
  %56 = getelementptr inbounds %struct.test_chain, ptr %9, i32 0, i32 2
  store ptr @.str.6, ptr %56, align 8, !tbaa !16
  %57 = call i32 @register_test_jitbr(ptr noundef %9)
  %58 = load i32, ptr %6, align 4, !tbaa !5
  %59 = or i32 %58, %57
  store i32 %59, ptr %6, align 4, !tbaa !5
  %60 = call i32 @register_test_jitlib(ptr noundef %9)
  %61 = load i32, ptr %6, align 4, !tbaa !5
  %62 = or i32 %61, %60
  store i32 %62, ptr %6, align 4, !tbaa !5
  %63 = call i32 @register_test_pageperm(ptr noundef %9)
  %64 = load i32, ptr %6, align 4, !tbaa !5
  %65 = or i32 %64, %63
  store i32 %65, ptr %6, align 4, !tbaa !5
  %66 = call i32 @register_test_vmleave(ptr noundef %9)
  %67 = load i32, ptr %6, align 4, !tbaa !5
  %68 = or i32 %67, %66
  store i32 %68, ptr %6, align 4, !tbaa !5
  %69 = call i32 @register_test_find_constant(ptr noundef %9)
  %70 = load i32, ptr %6, align 4, !tbaa !5
  %71 = or i32 %70, %69
  store i32 %71, ptr %6, align 4, !tbaa !5
  %72 = call i32 @register_test_mapname(ptr noundef %9)
  %73 = load i32, ptr %6, align 4, !tbaa !5
  %74 = or i32 %73, %72
  store i32 %74, ptr %6, align 4, !tbaa !5
  %75 = call i32 @register_test_smc(ptr noundef %9)
  %76 = load i32, ptr %6, align 4, !tbaa !5
  %77 = or i32 %76, %75
  store i32 %77, ptr %6, align 4, !tbaa !5
  %78 = call i32 @register_test_ripfxsave(ptr noundef %9)
  %79 = load i32, ptr %6, align 4, !tbaa !5
  %80 = or i32 %79, %78
  store i32 %80, ptr %6, align 4, !tbaa !5
  %81 = call i32 @register_test_testripsiginfo(ptr noundef %9)
  %82 = load i32, ptr %6, align 4, !tbaa !5
  %83 = or i32 %82, %81
  store i32 %83, ptr %6, align 4, !tbaa !5
  %84 = call i32 @register_test_ripsyscall(ptr noundef %9)
  %85 = load i32, ptr %6, align 4, !tbaa !5
  %86 = or i32 %85, %84
  store i32 %86, ptr %6, align 4, !tbaa !5
  %87 = call i32 @register_test_testnx(ptr noundef %9)
  %88 = load i32, ptr %6, align 4, !tbaa !5
  %89 = or i32 %88, %87
  store i32 %89, ptr %6, align 4, !tbaa !5
  %90 = call i32 @register_test_envvar(ptr noundef %9)
  %91 = load i32, ptr %6, align 4, !tbaa !5
  %92 = or i32 %91, %90
  store i32 %92, ptr %6, align 4, !tbaa !5
  %93 = call i32 @register_test_fsbase(ptr noundef %9)
  %94 = load i32, ptr %6, align 4, !tbaa !5
  %95 = or i32 %94, %93
  store i32 %95, ptr %6, align 4, !tbaa !5
  %96 = call i32 @register_test_enter(ptr noundef %9)
  %97 = load i32, ptr %6, align 4, !tbaa !5
  %98 = or i32 %97, %96
  store i32 %98, ptr %6, align 4, !tbaa !5
  %99 = load i32, ptr %6, align 4, !tbaa !5
  %100 = icmp ne i32 %99, 0
  br i1 %100, label %101, label %105

101:                                              ; preds = %54
  %102 = load ptr, ptr @stderr, align 8, !tbaa !9
  %103 = load i32, ptr %6, align 4, !tbaa !5
  %104 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %102, ptr noundef @.str.7, i32 noundef %103) #7
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %12, align 4
  br label %154

105:                                              ; preds = %54
  %106 = getelementptr inbounds %struct.test_chain, ptr %9, i32 0, i32 4
  %107 = load ptr, ptr %106, align 8, !tbaa !17
  store ptr %107, ptr %10, align 8, !tbaa !9
  br label %108

108:                                              ; preds = %146, %105
  %109 = load ptr, ptr %10, align 8, !tbaa !9
  %110 = icmp ne ptr %109, null
  br i1 %110, label %111, label %150

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

114:                                              ; preds = %111
  %115 = load ptr, ptr %10, align 8, !tbaa !9
  %116 = getelementptr inbounds %struct.test_chain, ptr %115, i32 0, i32 2
  %117 = load ptr, ptr %116, align 8, !tbaa !16
  %118 = call i32 @puts(ptr noundef %117)
  br label %119

119:                                              ; preds = %114, %111
  %120 = load ptr, ptr %10, align 8, !tbaa !9
  %121 = getelementptr inbounds %struct.test_chain, ptr %120, i32 0, i32 3
  %122 = load ptr, ptr %121, align 8, !tbaa !14
  %123 = call i32 (ptr, ...) @printf(ptr noundef @.str.8, ptr noundef %122)
  %124 = load ptr, ptr %10, align 8, !tbaa !9
  %125 = getelementptr inbounds %struct.test_chain, ptr %124, i32 0, i32 0
  %126 = load ptr, ptr %125, align 8, !tbaa !18
  %127 = call i32 %126()
  switch i32 %127, label %134 [
    i32 0, label %128
    i32 2, label %130
    i32 1, label %132
  ]

128:                                              ; preds = %119
  %129 = call i32 @puts(ptr noundef @.str.9)
  br label %140

130:                                              ; preds = %119
  %131 = call i32 @puts(ptr noundef @.str.10)
  br label %140

132:                                              ; preds = %119
  %133 = call i32 @puts(ptr noundef @.str.11)
  br label %140

134:                                              ; preds = %119
  %135 = load ptr, ptr @stderr, align 8, !tbaa !9
  %136 = load ptr, ptr %10, align 8, !tbaa !9
  %137 = getelementptr inbounds %struct.test_chain, ptr %136, i32 0, i32 3
  %138 = load ptr, ptr %137, align 8, !tbaa !14
  %139 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %135, ptr noundef @.str.12, ptr noundef %138) #7
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %12, align 4
  br label %154

140:                                              ; preds = %132, %130, %128
  %141 = load i32, ptr %7, align 4, !tbaa !5
  %142 = icmp ne i32 %141, 0
  br i1 %142, label %143, label %145

143:                                              ; preds = %140
  %144 = call i32 @puts(ptr noundef @.str.13)
  br label %145

145:                                              ; preds = %143, %140
  br label %146

146:                                              ; preds = %145
  %147 = load ptr, ptr %10, align 8, !tbaa !9
  %148 = getelementptr inbounds %struct.test_chain, ptr %147, i32 0, i32 4
  %149 = load ptr, ptr %148, align 8, !tbaa !17
  store ptr %149, ptr %10, align 8, !tbaa !9
  br label %108, !llvm.loop !19

150:                                              ; preds = %108
  %151 = call i32 @puts(ptr noundef @.str.13)
  %152 = getelementptr inbounds %struct.test_chain, ptr %9, i32 0, i32 4
  %153 = load ptr, ptr %152, align 8, !tbaa !17
  call void @test_chain_free_all(ptr noundef %153)
  store i32 0, ptr %12, align 4
  br label %154

154:                                              ; preds = %150, %134, %101, %36
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  %155 = load i32, ptr %12, align 4
  switch i32 %155, label %158 [
    i32 0, label %156
    i32 1, label %156
  ]

156:                                              ; preds = %154, %154
  %157 = load i32, ptr %3, align 4
  ret i32 %157

158:                                              ; preds = %154
  unreachable
}

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

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

; Function Attrs: nounwind
declare i64 @getauxval(i64 noundef) #1

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

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

declare i32 @register_test_jitbr(ptr noundef) #3

declare i32 @register_test_jitlib(ptr noundef) #3

declare i32 @register_test_pageperm(ptr noundef) #3

declare i32 @register_test_vmleave(ptr noundef) #3

declare i32 @register_test_find_constant(ptr noundef) #3

declare i32 @register_test_mapname(ptr noundef) #3

declare i32 @register_test_smc(ptr noundef) #3

declare i32 @register_test_ripfxsave(ptr noundef) #3

declare i32 @register_test_testripsiginfo(ptr noundef) #3

declare i32 @register_test_ripsyscall(ptr noundef) #3

declare i32 @register_test_testnx(ptr noundef) #3

declare i32 @register_test_envvar(ptr noundef) #3

declare i32 @register_test_fsbase(ptr noundef) #3

declare i32 @register_test_enter(ptr noundef) #3

declare i32 @puts(ptr noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #3 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind willreturn memory(read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(read) }
attributes #9 = { noreturn 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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!15, !10, i64 24}
!15 = !{!"test_chain", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32}
!16 = !{!15, !10, i64 16}
!17 = !{!15, !10, i64 32}
!18 = !{!15, !10, i64 0}
!19 = distinct !{!19, !12}


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

%struct.test_chain = type { ptr, ptr, ptr, ptr, ptr }

@this_arch = external dso_local local_unnamed_addr global i32, align 4
@arch_strings = external dso_local local_unnamed_addr global [1 x ptr], align 8
@stderr = external local_unnamed_addr global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [1 x i8], align 1
@switch.table.main.1 = private unnamed_addr constant [3 x ptr] [ptr @.str.9, ptr @.str.11, ptr @.str.10], align 8

; 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 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
declare dso_local void @print_usage(ptr noundef) local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
declare dso_local void @test_chain_free_all(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @main(i32 noundef %0, ptr noundef %1) local_unnamed_addr #2 {
  %3 = alloca %struct.test_chain, align 8
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %3) #8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(40) %3, i8 0, i64 40, i1 false)
  %4 = tail call i64 @getauxval(i64 noundef 15) #8
  %5 = inttoptr i64 %4 to ptr
  %6 = load ptr, ptr @arch_strings, align 8, !tbaa !5
  %7 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %5, ptr noundef nonnull dereferenceable(1) %6) #9
  %.not41 = icmp eq i32 %7, 0
  br i1 %.not41, label %.thread, label %8

.thread:                                          ; preds = %2
  store i32 0, ptr @this_arch, align 4, !tbaa !9
  br label %.preheader.preheader

8:                                                ; preds = %2
  %.pre = load i32, ptr @this_arch, align 4, !tbaa !9
  %9 = icmp eq i32 %.pre, -1
  br i1 %9, label %11, label %.preheader.preheader

.preheader.preheader:                             ; preds = %.thread, %8
  %10 = tail call i32 @getopt(i32 noundef %0, ptr noundef %1, ptr noundef nonnull @.str.4) #8
  switch i32 %10, label %.loopexit [
    i32 -1, label %.loopexit52
    i32 118, label %.preheader
  ]

11:                                               ; preds = %8
  %12 = load ptr, ptr @stderr, align 8, !tbaa !5
  %13 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %12, ptr noundef nonnull @.str.3) #10
  br label %81

.preheader:                                       ; preds = %.preheader.preheader, %.preheader
  %14 = tail call i32 @getopt(i32 noundef %0, ptr noundef %1, ptr noundef nonnull @.str.4) #8
  switch i32 %14, label %.loopexit [
    i32 -1, label %.loopexit52
    i32 118, label %.preheader
  ], !llvm.loop !11

.loopexit:                                        ; preds = %.preheader, %.preheader.preheader
  %15 = load ptr, ptr %1, align 8, !tbaa !5
  tail call void @print_usage(ptr noundef %15)
  tail call void @exit(i32 noundef 1) #11
  unreachable

.loopexit52:                                      ; preds = %.preheader, %.preheader.preheader
  %.not40.lcssa50 = phi i1 [ true, %.preheader.preheader ], [ false, %.preheader ]
  %16 = getelementptr inbounds i8, ptr %3, i64 24
  store ptr @.str.5, ptr %16, align 8, !tbaa !14
  %17 = getelementptr inbounds i8, ptr %3, i64 16
  store ptr @.str.6, ptr %17, align 8, !tbaa !16
  %18 = call i32 @register_test_jitbr(ptr noundef nonnull %3) #8
  %19 = call i32 @register_test_jitlib(ptr noundef nonnull %3) #8
  %20 = or i32 %19, %18
  %21 = call i32 @register_test_pageperm(ptr noundef nonnull %3) #8
  %22 = or i32 %20, %21
  %23 = call i32 @register_test_vmleave(ptr noundef nonnull %3) #8
  %24 = or i32 %22, %23
  %25 = call i32 @register_test_find_constant(ptr noundef nonnull %3) #8
  %26 = or i32 %24, %25
  %27 = call i32 @register_test_mapname(ptr noundef nonnull %3) #8
  %28 = or i32 %26, %27
  %29 = call i32 @register_test_smc(ptr noundef nonnull %3) #8
  %30 = or i32 %28, %29
  %31 = call i32 @register_test_ripfxsave(ptr noundef nonnull %3) #8
  %32 = or i32 %30, %31
  %33 = call i32 @register_test_testripsiginfo(ptr noundef nonnull %3) #8
  %34 = or i32 %32, %33
  %35 = call i32 @register_test_ripsyscall(ptr noundef nonnull %3) #8
  %36 = or i32 %34, %35
  %37 = call i32 @register_test_testnx(ptr noundef nonnull %3) #8
  %38 = or i32 %36, %37
  %39 = call i32 @register_test_envvar(ptr noundef nonnull %3) #8
  %40 = or i32 %38, %39
  %41 = call i32 @register_test_fsbase(ptr noundef nonnull %3) #8
  %42 = or i32 %40, %41
  %43 = call i32 @register_test_enter(ptr noundef nonnull %3) #8
  %44 = or i32 %42, %43
  %.not38 = icmp eq i32 %44, 0
  br i1 %.not38, label %48, label %45

45:                                               ; preds = %.loopexit52
  %46 = load ptr, ptr @stderr, align 8, !tbaa !5
  %47 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %46, ptr noundef nonnull @.str.7, i32 noundef %44) #10
  br label %81

48:                                               ; preds = %.loopexit52
  %49 = getelementptr inbounds i8, ptr %3, i64 32
  %50 = load ptr, ptr %49, align 8, !tbaa !17
  %.not3944 = icmp eq ptr %50, null
  br i1 %.not3944, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %48
  br i1 %.not40.lcssa50, label %.lr.ph.split.us, label %.lr.ph.split

.lr.ph.split.us:                                  ; preds = %.lr.ph, %switch.lookup
  %.03245.us = phi ptr [ %60, %switch.lookup ], [ %50, %.lr.ph ]
  %51 = getelementptr inbounds i8, ptr %.03245.us, i64 24
  %52 = load ptr, ptr %51, align 8, !tbaa !14
  %53 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, ptr noundef %52)
  %54 = load ptr, ptr %.03245.us, align 8, !tbaa !18
  %55 = call i32 %54() #8
  %56 = icmp ult i32 %55, 3
  br i1 %56, label %switch.lookup, label %.split.us

switch.lookup:                                    ; preds = %.lr.ph.split.us
  %57 = zext nneg i32 %55 to i64
  %switch.gep = getelementptr inbounds [3 x ptr], ptr @switch.table.main.1, i64 0, i64 %57
  %switch.load = load ptr, ptr %switch.gep, align 8
  %58 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %switch.load)
  %59 = getelementptr inbounds i8, ptr %.03245.us, i64 32
  %60 = load ptr, ptr %59, align 8, !tbaa !17
  %.not39.us = icmp eq ptr %60, null
  br i1 %.not39.us, label %._crit_edge, label %.lr.ph.split.us, !llvm.loop !19

.lr.ph.split:                                     ; preds = %.lr.ph, %switch.lookup63
  %.03245 = phi ptr [ %78, %switch.lookup63 ], [ %50, %.lr.ph ]
  %61 = getelementptr inbounds i8, ptr %.03245, i64 16
  %62 = load ptr, ptr %61, align 8, !tbaa !16
  %63 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %62)
  %64 = getelementptr inbounds i8, ptr %.03245, i64 24
  %65 = load ptr, ptr %64, align 8, !tbaa !14
  %66 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, ptr noundef %65)
  %67 = load ptr, ptr %.03245, align 8, !tbaa !18
  %68 = call i32 %67() #8
  %69 = icmp ult i32 %68, 3
  br i1 %69, label %switch.lookup63, label %.split.us

.split.us:                                        ; preds = %.lr.ph.split, %.lr.ph.split.us
  %.us-phi = phi ptr [ %.03245.us, %.lr.ph.split.us ], [ %.03245, %.lr.ph.split ]
  %70 = getelementptr inbounds i8, ptr %.us-phi, i64 24
  %71 = load ptr, ptr @stderr, align 8, !tbaa !5
  %72 = load ptr, ptr %70, align 8, !tbaa !14
  %73 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %71, ptr noundef nonnull @.str.12, ptr noundef %72) #10
  br label %81

switch.lookup63:                                  ; preds = %.lr.ph.split
  %74 = zext nneg i32 %68 to i64
  %switch.gep64 = getelementptr inbounds [3 x ptr], ptr @switch.table.main.1, i64 0, i64 %74
  %switch.load65 = load ptr, ptr %switch.gep64, align 8
  %75 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %switch.load65)
  %76 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.13)
  %77 = getelementptr inbounds i8, ptr %.03245, i64 32
  %78 = load ptr, ptr %77, align 8, !tbaa !17
  %.not39 = icmp eq ptr %78, null
  br i1 %.not39, label %._crit_edge, label %.lr.ph.split, !llvm.loop !19

._crit_edge:                                      ; preds = %switch.lookup63, %switch.lookup, %48
  %79 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.13)
  %80 = load ptr, ptr %49, align 8, !tbaa !17
  call void @test_chain_free_all(ptr noundef %80)
  br label %81

81:                                               ; preds = %._crit_edge, %.split.us, %45, %11
  %.034 = phi i32 [ -1, %11 ], [ -1, %45 ], [ -1, %.split.us ], [ 0, %._crit_edge ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %3) #8
  ret i32 %.034
}

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

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

; Function Attrs: nounwind
declare i64 @getauxval(i64 noundef) local_unnamed_addr #5

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

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

declare i32 @register_test_jitbr(ptr noundef) local_unnamed_addr #7

declare i32 @register_test_jitlib(ptr noundef) local_unnamed_addr #7

declare i32 @register_test_pageperm(ptr noundef) local_unnamed_addr #7

declare i32 @register_test_vmleave(ptr noundef) local_unnamed_addr #7

declare i32 @register_test_find_constant(ptr noundef) local_unnamed_addr #7

declare i32 @register_test_mapname(ptr noundef) local_unnamed_addr #7

declare i32 @register_test_smc(ptr noundef) local_unnamed_addr #7

declare i32 @register_test_ripfxsave(ptr noundef) local_unnamed_addr #7

declare i32 @register_test_testripsiginfo(ptr noundef) local_unnamed_addr #7

declare i32 @register_test_ripsyscall(ptr noundef) local_unnamed_addr #7

declare i32 @register_test_testnx(ptr noundef) local_unnamed_addr #7

declare i32 @register_test_envvar(ptr noundef) local_unnamed_addr #7

declare i32 @register_test_fsbase(ptr noundef) local_unnamed_addr #7

declare i32 @register_test_enter(ptr noundef) local_unnamed_addr #7

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

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 = { 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 #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { 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 #5 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 #7 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nounwind }
attributes #9 = { nounwind willreturn memory(read) }
attributes #10 = { cold nounwind }
attributes #11 = { noreturn 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 = !{!"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 = distinct !{!11, !12, !13}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.peeled.count", i32 1}
!14 = !{!15, !6, i64 24}
!15 = !{!"test_chain", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!16 = !{!15, !6, i64 16}
!17 = !{!15, !6, i64 32}
!18 = !{!15, !6, i64 0}
!19 = distinct !{!19, !12}


; Effective O3 passes: ConstantMergePass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopFullUnrollPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass