; LLVM IR from gem5/gem5 :: src/systemc/tests/systemc/misc/sim_tests/cycle_dw8051_demo (cycle_model)

; 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.cycle_model = type <{ %"class.sc_core::sc_module", %"class.sc_core::sc_in", ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, [65536 x i32], [65536 x i32], [2048 x i32], i32, [8 x i32], [4 x i8], ptr, i32, i32, i32, [4 x i8] }>
%"class.sc_core::sc_module" = type { %"class.sc_core::sc_object", %"class.sc_core::sc_process_host", %"class.sc_core::sc_sensitive", %"class.sc_core::sc_sensitive_pos", %"class.sc_core::sc_sensitive_neg", i8, ptr, i32, ptr, ptr }
%"class.sc_core::sc_object" = type { ptr, ptr, %"class.std::vector", %"class.std::vector.0", %"class.std::__cxx11::basic_string", ptr, ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<sc_core::sc_event *, std::allocator<sc_core::sc_event *>>::_Vector_impl" }
%"struct.std::_Vector_base<sc_core::sc_event *, std::allocator<sc_core::sc_event *>>::_Vector_impl" = type { %"struct.std::_Vector_base<sc_core::sc_event *, std::allocator<sc_core::sc_event *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<sc_core::sc_event *, std::allocator<sc_core::sc_event *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<sc_core::sc_object *, std::allocator<sc_core::sc_object *>>::_Vector_impl" }
%"struct.std::_Vector_base<sc_core::sc_object *, std::allocator<sc_core::sc_object *>>::_Vector_impl" = type { %"struct.std::_Vector_base<sc_core::sc_object *, std::allocator<sc_core::sc_object *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<sc_core::sc_object *, std::allocator<sc_core::sc_object *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.sc_core::sc_process_host" = type { ptr }
%"class.sc_core::sc_sensitive" = type { ptr, i32, ptr }
%"class.sc_core::sc_sensitive_pos" = type { ptr, i32, ptr }
%"class.sc_core::sc_sensitive_neg" = type { ptr, i32, ptr }
%"class.sc_core::sc_in" = type { %"class.sc_core::sc_port", ptr, ptr, ptr, ptr }
%"class.sc_core::sc_port" = type { %"class.sc_core::sc_port_b" }
%"class.sc_core::sc_port_b" = type { %"class.sc_core::sc_port_base", ptr, %"class.std::vector.8" }
%"class.sc_core::sc_port_base" = type { %"class.sc_core::sc_object", ptr }
%"class.std::vector.8" = type { %"struct.std::_Vector_base.9" }
%"struct.std::_Vector_base.9" = type { %"struct.std::_Vector_base<sc_core::sc_signal_in_if<bool> *, std::allocator<sc_core::sc_signal_in_if<bool> *>>::_Vector_impl" }
%"struct.std::_Vector_base<sc_core::sc_signal_in_if<bool> *, std::allocator<sc_core::sc_signal_in_if<bool> *>>::_Vector_impl" = type { %"struct.std::_Vector_base<sc_core::sc_signal_in_if<bool> *, std::allocator<sc_core::sc_signal_in_if<bool> *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<sc_core::sc_signal_in_if<bool> *, std::allocator<sc_core::sc_signal_in_if<bool> *>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [2 x i8], align 1
@stderr = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [61 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11cycle_model9parse_hexEPc(ptr noundef nonnull align 8 dereferenceable(533052) %0, ptr noundef %1) #0 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca [65536 x i8], align 16
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca [3 x i8], align 1
  %9 = alloca i32, align 4
  %10 = alloca [5 x i8], align 1
  %11 = alloca i32, align 4
  %12 = alloca [3 x i8], align 1
  %13 = alloca i32, align 4
  %14 = alloca [3 x i8], align 1
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %17 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 65536, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = call noalias ptr @fopen(ptr noundef %18, ptr noundef @.str)
  store ptr %19, ptr %6, align 8, !tbaa !5
  %20 = load ptr, ptr %6, align 8, !tbaa !5
  %21 = icmp eq ptr %20, null
  br i1 %21, label %22, label %26

22:                                               ; preds = %2
  %23 = load ptr, ptr @stderr, align 8, !tbaa !5
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %23, ptr noundef @.str.2, ptr noundef %24) #5
  call void @exit(i32 noundef -1) #6
  unreachable

26:                                               ; preds = %2
  br label %27

27:                                               ; preds = %129, %37, %26
  %28 = getelementptr inbounds [65536 x i8], ptr %5, i64 0, i64 0
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = call ptr @fgets(ptr noundef %28, i32 noundef 65536, ptr noundef %29)
  %31 = icmp ne ptr %30, null
  br i1 %31, label %32, label %130

32:                                               ; preds = %27
  %33 = getelementptr inbounds [65536 x i8], ptr %5, i64 0, i64 0
  %34 = load i8, ptr %33, align 16, !tbaa !9
  %35 = sext i8 %34 to i32
  %36 = icmp ne i32 %35, 58
  br i1 %36, label %37, label %38

37:                                               ; preds = %32
  br label %27, !llvm.loop !10

38:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 3, ptr %8) #5
  %39 = getelementptr inbounds [3 x i8], ptr %8, i64 0, i64 0
  %40 = getelementptr inbounds [65536 x i8], ptr %5, i64 0, i64 1
  %41 = call ptr @strncpy(ptr noundef %39, ptr noundef %40, i64 noundef 2) #5
  %42 = icmp eq ptr %41, null
  br i1 %42, label %43, label %46

43:                                               ; preds = %38
  %44 = load ptr, ptr @stderr, align 8, !tbaa !5
  %45 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %44, ptr noundef @.str.3) #5
  call void @exit(i32 noundef -1) #6
  unreachable

46:                                               ; preds = %38
  %47 = getelementptr inbounds [3 x i8], ptr %8, i64 0, i64 2
  store i8 0, ptr %47, align 1, !tbaa !9
  %48 = getelementptr inbounds [3 x i8], ptr %8, i64 0, i64 0
  %49 = call i64 @strtol(ptr noundef %48, ptr noundef null, i32 noundef 16) #5
  %50 = trunc i64 %49 to i32
  store i32 %50, ptr %7, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 5, ptr %10) #5
  %51 = getelementptr inbounds [5 x i8], ptr %10, i64 0, i64 0
  %52 = getelementptr inbounds [65536 x i8], ptr %5, i64 0, i64 3
  %53 = call ptr @strncpy(ptr noundef %51, ptr noundef %52, i64 noundef 4) #5
  %54 = icmp eq ptr %53, null
  br i1 %54, label %55, label %58

55:                                               ; preds = %46
  %56 = load ptr, ptr @stderr, align 8, !tbaa !5
  %57 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %56, ptr noundef @.str.4) #5
  call void @exit(i32 noundef -1) #6
  unreachable

58:                                               ; preds = %46
  %59 = getelementptr inbounds [5 x i8], ptr %10, i64 0, i64 4
  store i8 0, ptr %59, align 1, !tbaa !9
  %60 = getelementptr inbounds [5 x i8], ptr %10, i64 0, i64 0
  %61 = call i64 @strtol(ptr noundef %60, ptr noundef null, i32 noundef 16) #5
  %62 = trunc i64 %61 to i32
  store i32 %62, ptr %9, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 3, ptr %12) #5
  %63 = getelementptr inbounds [3 x i8], ptr %12, i64 0, i64 0
  %64 = getelementptr inbounds [65536 x i8], ptr %5, i64 0, i64 7
  %65 = call ptr @strncpy(ptr noundef %63, ptr noundef %64, i64 noundef 2) #5
  %66 = icmp eq ptr %65, null
  br i1 %66, label %67, label %70

67:                                               ; preds = %58
  %68 = load ptr, ptr @stderr, align 8, !tbaa !5
  %69 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %68, ptr noundef @.str.5) #5
  call void @exit(i32 noundef -1) #6
  unreachable

70:                                               ; preds = %58
  %71 = getelementptr inbounds [3 x i8], ptr %12, i64 0, i64 2
  store i8 0, ptr %71, align 1, !tbaa !9
  %72 = getelementptr inbounds [3 x i8], ptr %12, i64 0, i64 0
  %73 = call i64 @strtol(ptr noundef %72, ptr noundef null, i32 noundef 16) #5
  %74 = trunc i64 %73 to i32
  store i32 %74, ptr %11, align 4, !tbaa !12
  %75 = load i32, ptr %11, align 4, !tbaa !12
  %76 = icmp eq i32 %75, 1
  br i1 %76, label %77, label %80

77:                                               ; preds = %70
  %78 = load ptr, ptr %6, align 8, !tbaa !5
  %79 = call i32 @fclose(ptr noundef %78)
  store i32 1, ptr %13, align 4
  br label %127

80:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 3, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 0, ptr %15, align 4, !tbaa !12
  br label %81

81:                                               ; preds = %110, %80
  %82 = load i32, ptr %15, align 4, !tbaa !12
  %83 = load i32, ptr %7, align 4, !tbaa !12
  %84 = icmp slt i32 %82, %83
  br i1 %84, label %86, label %85

85:                                               ; preds = %81
  store i32 4, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %113

86:                                               ; preds = %81
  %87 = getelementptr inbounds [3 x i8], ptr %14, i64 0, i64 0
  %88 = load i32, ptr %15, align 4, !tbaa !12
  %89 = mul nsw i32 2, %88
  %90 = add nsw i32 %89, 9
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [65536 x i8], ptr %5, i64 0, i64 %91
  %93 = call ptr @strncpy(ptr noundef %87, ptr noundef %92, i64 noundef 2) #5
  %94 = icmp eq ptr %93, null
  br i1 %94, label %95, label %99

95:                                               ; preds = %86
  %96 = load ptr, ptr @stderr, align 8, !tbaa !5
  %97 = load i32, ptr %15, align 4, !tbaa !12
  %98 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %96, ptr noundef @.str.6, i32 noundef %97) #5
  call void @exit(i32 noundef -1) #6
  unreachable

99:                                               ; preds = %86
  %100 = getelementptr inbounds [3 x i8], ptr %14, i64 0, i64 2
  store i8 0, ptr %100, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %101 = getelementptr inbounds [3 x i8], ptr %14, i64 0, i64 0
  %102 = call i64 @strtol(ptr noundef %101, ptr noundef null, i32 noundef 16) #5
  %103 = trunc i64 %102 to i32
  store i32 %103, ptr %16, align 4, !tbaa !12
  %104 = load i32, ptr %16, align 4, !tbaa !12
  %105 = getelementptr inbounds %struct.cycle_model, ptr %17, i32 0, i32 14
  %106 = load i32, ptr %9, align 4, !tbaa !12
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr %9, align 4, !tbaa !12
  %108 = sext i32 %106 to i64
  %109 = getelementptr inbounds [65536 x i32], ptr %105, i64 0, i64 %108
  store i32 %104, ptr %109, align 4, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %110

110:                                              ; preds = %99
  %111 = load i32, ptr %15, align 4, !tbaa !12
  %112 = add nsw i32 %111, 1
  store i32 %112, ptr %15, align 4, !tbaa !12
  br label %81, !llvm.loop !14

113:                                              ; preds = %85
  %114 = load i32, ptr %7, align 4, !tbaa !12
  %115 = mul nsw i32 2, %114
  %116 = add nsw i32 %115, 9
  %117 = add nsw i32 %116, 2
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [65536 x i8], ptr %5, i64 0, i64 %118
  %120 = load i8, ptr %119, align 1, !tbaa !9
  %121 = sext i8 %120 to i32
  %122 = icmp ne i32 %121, 10
  br i1 %122, label %123, label %126

123:                                              ; preds = %113
  %124 = load ptr, ptr @stderr, align 8, !tbaa !5
  %125 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %124, ptr noundef @.str.7) #5
  call void @exit(i32 noundef -1) #6
  unreachable

126:                                              ; preds = %113
  call void @llvm.lifetime.end.p0(i64 3, ptr %14) #5
  store i32 0, ptr %13, align 4
  br label %127

127:                                              ; preds = %126, %77
  call void @llvm.lifetime.end.p0(i64 3, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 5, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 3, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  %128 = load i32, ptr %13, align 4
  switch i32 %128, label %133 [
    i32 0, label %129
  ]

129:                                              ; preds = %127
  br label %27, !llvm.loop !10

130:                                              ; preds = %27
  %131 = load ptr, ptr @stderr, align 8, !tbaa !5
  %132 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %131, ptr noundef @.str.8) #5
  call void @exit(i32 noundef -1) #6
  unreachable

133:                                              ; preds = %127
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 65536, ptr %5) #5
  ret void
}

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

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

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

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

declare ptr @fgets(ptr noundef, i32 noundef, ptr noundef) #2

; Function Attrs: nounwind
declare ptr @strncpy(ptr noundef, ptr noundef, i64 noundef) #3

; Function Attrs: nounwind
declare i64 @strtol(ptr noundef, ptr noundef, i32 noundef) #3

declare i32 @fclose(ptr noundef) #2

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

attributes #0 = { mustprogress 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 = { "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 "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 = { nounwind }
attributes #6 = { 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++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = distinct !{!14, !11}


; 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 [2 x i8], align 1
@stderr = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [61 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN11cycle_model9parse_hexEPc(ptr nocapture noundef nonnull writeonly align 8 dereferenceable(533052) %0, ptr noundef %1) local_unnamed_addr #0 align 2 {
  %3 = alloca [65536 x i8], align 16
  %4 = alloca [3 x i8], align 1
  %5 = alloca [5 x i8], align 1
  %6 = alloca [3 x i8], align 1
  %7 = alloca [3 x i8], align 1
  call void @llvm.lifetime.start.p0(i64 65536, ptr nonnull %3) #6
  %8 = tail call noalias ptr @fopen(ptr noundef %1, ptr noundef nonnull @.str)
  %9 = icmp eq ptr %8, null
  br i1 %9, label %19, label %.preheader

.preheader:                                       ; preds = %2
  %10 = call ptr @fgets(ptr noundef nonnull %3, i32 noundef 65536, ptr noundef nonnull %8)
  %.not23 = icmp eq ptr %10, null
  br i1 %.not23, label %._crit_edge25, label %.lr.ph24

.lr.ph24:                                         ; preds = %.preheader
  %11 = getelementptr inbounds i8, ptr %3, i64 1
  %12 = getelementptr inbounds i8, ptr %4, i64 2
  %13 = getelementptr inbounds i8, ptr %3, i64 3
  %14 = getelementptr inbounds i8, ptr %5, i64 4
  %15 = getelementptr inbounds i8, ptr %3, i64 7
  %16 = getelementptr inbounds i8, ptr %6, i64 2
  %17 = getelementptr inbounds i8, ptr %7, i64 2
  %18 = getelementptr inbounds i8, ptr %0, i64 512
  br label %22

19:                                               ; preds = %2
  %20 = load ptr, ptr @stderr, align 8, !tbaa !5
  %21 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %20, ptr noundef nonnull @.str.2, ptr noundef %1) #7
  tail call void @exit(i32 noundef -1) #8
  unreachable

22:                                               ; preds = %.lr.ph24, %.backedge
  %23 = load i8, ptr %3, align 16, !tbaa !9
  %.not18 = icmp eq i8 %23, 58
  br i1 %.not18, label %25, label %.backedge

.backedge:                                        ; preds = %52, %22
  %24 = call ptr @fgets(ptr noundef nonnull %3, i32 noundef 65536, ptr noundef nonnull %8)
  %.not = icmp eq ptr %24, null
  br i1 %.not, label %._crit_edge25, label %22, !llvm.loop !10

25:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %4) #6
  %26 = call ptr @strncpy(ptr noundef nonnull dereferenceable(1) %4, ptr noundef nonnull dereferenceable(1) %11, i64 noundef 2) #6
  store i8 0, ptr %12, align 1, !tbaa !9
  %27 = call i64 @strtol(ptr nocapture noundef nonnull %4, ptr noundef null, i32 noundef 16) #6
  %28 = trunc i64 %27 to i32
  call void @llvm.lifetime.start.p0(i64 5, ptr nonnull %5) #6
  %29 = call ptr @strncpy(ptr noundef nonnull dereferenceable(1) %5, ptr noundef nonnull dereferenceable(1) %13, i64 noundef 4) #6
  store i8 0, ptr %14, align 1, !tbaa !9
  %30 = call i64 @strtol(ptr nocapture noundef nonnull %5, ptr noundef null, i32 noundef 16) #6
  call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %6) #6
  %31 = call ptr @strncpy(ptr noundef nonnull dereferenceable(1) %6, ptr noundef nonnull dereferenceable(1) %15, i64 noundef 2) #6
  store i8 0, ptr %16, align 1, !tbaa !9
  %32 = call i64 @strtol(ptr nocapture noundef nonnull %6, ptr noundef null, i32 noundef 16) #6
  %33 = and i64 %32, 4294967295
  %.not20 = icmp eq i64 %33, 1
  br i1 %.not20, label %.loopexit, label %34

34:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %7) #6
  %35 = icmp sgt i32 %28, 0
  br i1 %35, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %34
  %sext = shl i64 %30, 32
  %36 = ashr exact i64 %sext, 32
  %wide.trip.count = and i64 %27, 2147483647
  br label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %34
  %37 = shl nsw i32 %28, 1
  %38 = add nsw i32 %37, 11
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [65536 x i8], ptr %3, i64 0, i64 %39
  %41 = load i8, ptr %40, align 1, !tbaa !9
  %.not19 = icmp eq i8 %41, 10
  br i1 %.not19, label %52, label %49

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv26 = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next27, %.lr.ph ]
  %indvars.iv = phi i64 [ %36, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %42 = shl nuw nsw i64 %indvars.iv26, 1
  %43 = add nuw nsw i64 %42, 9
  %44 = getelementptr inbounds [65536 x i8], ptr %3, i64 0, i64 %43
  %45 = call ptr @strncpy(ptr noundef nonnull dereferenceable(1) %7, ptr noundef nonnull dereferenceable(1) %44, i64 noundef 2) #6
  store i8 0, ptr %17, align 1, !tbaa !9
  %46 = call i64 @strtol(ptr nocapture noundef nonnull %7, ptr noundef null, i32 noundef 16) #6
  %47 = trunc i64 %46 to i32
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %48 = getelementptr inbounds [65536 x i32], ptr %18, i64 0, i64 %indvars.iv
  store i32 %47, ptr %48, align 4, !tbaa !12
  %indvars.iv.next27 = add nuw nsw i64 %indvars.iv26, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next27, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !14

49:                                               ; preds = %._crit_edge
  %50 = load ptr, ptr @stderr, align 8, !tbaa !5
  %51 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %50, ptr noundef nonnull @.str.7) #7
  call void @exit(i32 noundef -1) #8
  unreachable

52:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 5, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %4) #6
  br label %.backedge

._crit_edge25:                                    ; preds = %.backedge, %.preheader
  %53 = load ptr, ptr @stderr, align 8, !tbaa !5
  %54 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %53, ptr noundef nonnull @.str.8) #7
  call void @exit(i32 noundef -1) #8
  unreachable

.loopexit:                                        ; preds = %25
  %55 = call i32 @fclose(ptr noundef nonnull %8)
  call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 5, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 65536, ptr nonnull %3) #6
  ret void
}

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

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

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

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

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strncpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly, i64 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nofree nounwind willreturn
declare i64 @strtol(ptr noundef readonly, ptr nocapture noundef, i32 noundef) local_unnamed_addr #5

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture 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) #1

attributes #0 = { mustprogress 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 = { 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 #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 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "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 "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 = { cold nounwind }
attributes #8 = { 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++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = distinct !{!14, !11}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass