; LLVM IR from solettaproject/soletta-machine-learning :: examples (test_memory)

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

@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [93 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [9 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #0 {
  %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 i32, align 4
  %10 = alloca [20 x i8], align 16
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = 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) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 20, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %14 = load i32, ptr %4, align 4, !tbaa !5
  %15 = icmp slt i32 %14, 5
  br i1 %15, label %16, label %32

16:                                               ; preds = %2
  %17 = load ptr, ptr @stderr, align 8, !tbaa !9
  %18 = load ptr, ptr %5, align 8, !tbaa !9
  %19 = getelementptr inbounds ptr, ptr %18, i64 0
  %20 = load ptr, ptr %19, align 8, !tbaa !9
  %21 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %17, ptr noundef @.str, ptr noundef %20) #5
  %22 = load ptr, ptr @stderr, align 8, !tbaa !9
  %23 = load ptr, ptr %5, align 8, !tbaa !9
  %24 = getelementptr inbounds ptr, ptr %23, i64 0
  %25 = load ptr, ptr %24, align 8, !tbaa !9
  %26 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %22, ptr noundef @.str.1, ptr noundef %25) #5
  %27 = load ptr, ptr @stderr, align 8, !tbaa !9
  %28 = load ptr, ptr %5, align 8, !tbaa !9
  %29 = getelementptr inbounds ptr, ptr %28, i64 0
  %30 = load ptr, ptr %29, align 8, !tbaa !9
  %31 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %27, ptr noundef @.str.2, ptr noundef %30) #5
  store i32 1, ptr %3, align 4
  store i32 1, ptr %13, align 4
  br label %131

32:                                               ; preds = %2
  %33 = load ptr, ptr %5, align 8, !tbaa !9
  %34 = getelementptr inbounds ptr, ptr %33, i64 2
  %35 = load ptr, ptr %34, align 8, !tbaa !9
  %36 = call i32 @atoi(ptr noundef %35) #6
  store i32 %36, ptr %6, align 4, !tbaa !5
  %37 = load ptr, ptr %5, align 8, !tbaa !9
  %38 = getelementptr inbounds ptr, ptr %37, i64 3
  %39 = load ptr, ptr %38, align 8, !tbaa !9
  %40 = call i32 @atoi(ptr noundef %39) #6
  store i32 %40, ptr %7, align 4, !tbaa !5
  %41 = load ptr, ptr %5, align 8, !tbaa !9
  %42 = getelementptr inbounds ptr, ptr %41, i64 4
  %43 = load ptr, ptr %42, align 8, !tbaa !9
  %44 = call i32 @atoi(ptr noundef %43) #6
  store i32 %44, ptr %8, align 4, !tbaa !5
  %45 = load ptr, ptr %5, align 8, !tbaa !9
  %46 = getelementptr inbounds ptr, ptr %45, i64 5
  %47 = load ptr, ptr %46, align 8, !tbaa !9
  %48 = call i32 @atoi(ptr noundef %47) #6
  store i32 %48, ptr %9, align 4, !tbaa !5
  %49 = load i32, ptr %4, align 4, !tbaa !5
  %50 = icmp sgt i32 %49, 6
  br i1 %50, label %51, label %57

51:                                               ; preds = %32
  %52 = load ptr, ptr %5, align 8, !tbaa !9
  %53 = getelementptr inbounds ptr, ptr %52, i64 6
  %54 = load ptr, ptr %53, align 8, !tbaa !9
  %55 = call i64 @atol(ptr noundef %54) #6
  %56 = trunc i64 %55 to i32
  call void @srand(i32 noundef %56) #5
  br label %60

57:                                               ; preds = %32
  %58 = call i64 @time(ptr noundef null) #5
  %59 = trunc i64 %58 to i32
  call void @srand(i32 noundef %59) #5
  br label %60

60:                                               ; preds = %57, %51
  %61 = load i32, ptr %9, align 4, !tbaa !5
  %62 = icmp ult i32 %61, 1
  br i1 %62, label %63, label %66

63:                                               ; preds = %60
  %64 = load ptr, ptr @stderr, align 8, !tbaa !9
  %65 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %64, ptr noundef @.str.3) #5
  store i32 1, ptr %3, align 4
  store i32 1, ptr %13, align 4
  br label %131

66:                                               ; preds = %60
  %67 = load ptr, ptr %5, align 8, !tbaa !9
  %68 = getelementptr inbounds ptr, ptr %67, i64 1
  %69 = load ptr, ptr %68, align 8, !tbaa !9
  %70 = call i32 @atoi(ptr noundef %69) #6
  %71 = call ptr @_sml_new(i32 noundef %70)
  store ptr %71, ptr %12, align 8, !tbaa !9
  %72 = load ptr, ptr %12, align 8, !tbaa !9
  %73 = icmp ne ptr %72, null
  br i1 %73, label %77, label %74

74:                                               ; preds = %66
  %75 = load ptr, ptr @stderr, align 8, !tbaa !9
  %76 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %75, ptr noundef @.str.4) #5
  store i32 1, ptr %3, align 4
  store i32 1, ptr %13, align 4
  br label %131

77:                                               ; preds = %66
  %78 = load ptr, ptr %12, align 8, !tbaa !9
  %79 = call zeroext i1 @sml_set_read_state_callback(ptr noundef %78, ptr noundef @_read_state_cb, ptr noundef %8)
  %80 = load ptr, ptr %12, align 8, !tbaa !9
  %81 = call zeroext i1 @sml_set_stabilization_hits(ptr noundef %80, i16 noundef zeroext 0)
  br label %82

82:                                               ; preds = %85, %77
  %83 = load i32, ptr %6, align 4, !tbaa !5
  %84 = icmp ne i32 %83, 0
  br i1 %84, label %85, label %102

85:                                               ; preds = %82
  %86 = getelementptr inbounds [20 x i8], ptr %10, i64 0, i64 0
  %87 = load i32, ptr %6, align 4, !tbaa !5
  %88 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %86, i64 noundef 20, ptr noundef @.str.5, i32 noundef %87) #5
  %89 = load ptr, ptr %12, align 8, !tbaa !9
  %90 = getelementptr inbounds [20 x i8], ptr %10, i64 0, i64 0
  %91 = call ptr @sml_new_input(ptr noundef %89, ptr noundef %90)
  store ptr %91, ptr %11, align 8, !tbaa !9
  %92 = load ptr, ptr %12, align 8, !tbaa !9
  %93 = load ptr, ptr %11, align 8, !tbaa !9
  %94 = call zeroext i1 @sml_variable_set_range(ptr noundef %92, ptr noundef %93, float noundef 0.000000e+00, float noundef 0x41E0000000000000)
  %95 = load ptr, ptr %12, align 8, !tbaa !9
  %96 = load ptr, ptr %11, align 8, !tbaa !9
  %97 = getelementptr inbounds [20 x i8], ptr %10, i64 0, i64 0
  %98 = load i32, ptr %6, align 4, !tbaa !5
  %99 = load i32, ptr %9, align 4, !tbaa !5
  call void @_add_terms(ptr noundef %95, ptr noundef %96, ptr noundef %97, i32 noundef %98, i32 noundef %99)
  %100 = load i32, ptr %6, align 4, !tbaa !5
  %101 = add i32 %100, -1
  store i32 %101, ptr %6, align 4, !tbaa !5
  br label %82, !llvm.loop !11

102:                                              ; preds = %82
  br label %103

103:                                              ; preds = %106, %102
  %104 = load i32, ptr %7, align 4, !tbaa !5
  %105 = icmp ne i32 %104, 0
  br i1 %105, label %106, label %123

106:                                              ; preds = %103
  %107 = getelementptr inbounds [20 x i8], ptr %10, i64 0, i64 0
  %108 = load i32, ptr %7, align 4, !tbaa !5
  %109 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %107, i64 noundef 20, ptr noundef @.str.6, i32 noundef %108) #5
  %110 = load ptr, ptr %12, align 8, !tbaa !9
  %111 = getelementptr inbounds [20 x i8], ptr %10, i64 0, i64 0
  %112 = call ptr @sml_new_output(ptr noundef %110, ptr noundef %111)
  store ptr %112, ptr %11, align 8, !tbaa !9
  %113 = load ptr, ptr %12, align 8, !tbaa !9
  %114 = load ptr, ptr %11, align 8, !tbaa !9
  %115 = call zeroext i1 @sml_variable_set_range(ptr noundef %113, ptr noundef %114, float noundef 0.000000e+00, float noundef 0x41E0000000000000)
  %116 = load ptr, ptr %12, align 8, !tbaa !9
  %117 = load ptr, ptr %11, align 8, !tbaa !9
  %118 = getelementptr inbounds [20 x i8], ptr %10, i64 0, i64 0
  %119 = load i32, ptr %7, align 4, !tbaa !5
  %120 = load i32, ptr %9, align 4, !tbaa !5
  call void @_add_terms(ptr noundef %116, ptr noundef %117, ptr noundef %118, i32 noundef %119, i32 noundef %120)
  %121 = load i32, ptr %7, align 4, !tbaa !5
  %122 = add i32 %121, -1
  store i32 %122, ptr %7, align 4, !tbaa !5
  br label %103, !llvm.loop !13

123:                                              ; preds = %103
  br label %124

124:                                              ; preds = %128, %123
  %125 = load ptr, ptr %12, align 8, !tbaa !9
  %126 = call i32 @sml_process(ptr noundef %125)
  %127 = icmp eq i32 %126, 0
  br i1 %127, label %128, label %129

128:                                              ; preds = %124
  br label %124, !llvm.loop !14

129:                                              ; preds = %124
  %130 = load ptr, ptr %12, align 8, !tbaa !9
  call void @sml_free(ptr noundef %130)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %13, align 4
  br label %131

131:                                              ; preds = %129, %74, %63, %16
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 20, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  %132 = load i32, ptr %3, align 4
  ret i32 %132
}

; 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 i32 @fprintf(ptr noundef, ptr noundef, ...) #2

; Function Attrs: inlinehint nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr noundef nonnull) #3

; Function Attrs: nounwind
declare void @srand(i32 noundef) #2

; Function Attrs: inlinehint nounwind willreturn memory(read) uwtable
declare i64 @atol(ptr noundef nonnull) #3

; Function Attrs: nounwind
declare i64 @time(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden ptr @_sml_new(i32 noundef) #0

declare zeroext i1 @sml_set_read_state_callback(ptr noundef, ptr noundef, ptr noundef) #4

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @_read_state_cb(ptr noundef, ptr noundef) #0

declare zeroext i1 @sml_set_stabilization_hits(ptr noundef, i16 noundef zeroext) #4

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

declare ptr @sml_new_input(ptr noundef, ptr noundef) #4

declare zeroext i1 @sml_variable_set_range(ptr noundef, ptr noundef, float noundef, float noundef) #4

; Function Attrs: nounwind uwtable
declare hidden void @_add_terms(ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef) #0

declare ptr @sml_new_output(ptr noundef, ptr noundef) #4

declare i32 @sml_process(ptr noundef) #4

declare void @sml_free(ptr noundef) #4

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

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 = { inlinehint nounwind willreturn memory(read) 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 = { "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 = { 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, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !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"

@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [93 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [9 x i8], align 1

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

6:                                                ; preds = %2
  %7 = load ptr, ptr @stderr, align 8, !tbaa !5
  %8 = load ptr, ptr %1, align 8, !tbaa !5
  %9 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %7, ptr noundef nonnull @.str, ptr noundef %8) #7
  %10 = load ptr, ptr @stderr, align 8, !tbaa !5
  %11 = load ptr, ptr %1, align 8, !tbaa !5
  %12 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %10, ptr noundef nonnull @.str.1, ptr noundef %11) #7
  %13 = load ptr, ptr @stderr, align 8, !tbaa !5
  %14 = load ptr, ptr %1, align 8, !tbaa !5
  %15 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %13, ptr noundef nonnull @.str.2, ptr noundef %14) #7
  br label %64

16:                                               ; preds = %2
  %17 = getelementptr inbounds i8, ptr %1, i64 16
  %18 = load ptr, ptr %17, align 8, !tbaa !5
  %19 = tail call i32 @atoi(ptr nocapture noundef %18) #8
  %20 = getelementptr inbounds i8, ptr %1, i64 24
  %21 = load ptr, ptr %20, align 8, !tbaa !5
  %22 = tail call i32 @atoi(ptr nocapture noundef %21) #8
  %23 = getelementptr inbounds i8, ptr %1, i64 32
  %24 = load ptr, ptr %23, align 8, !tbaa !5
  %25 = tail call i32 @atoi(ptr nocapture noundef %24) #8
  store i32 %25, ptr %3, align 4, !tbaa !9
  %26 = getelementptr inbounds i8, ptr %1, i64 40
  %27 = load ptr, ptr %26, align 8, !tbaa !5
  %28 = tail call i32 @atoi(ptr nocapture noundef %27) #8
  %29 = icmp ugt i32 %0, 6
  br i1 %29, label %30, label %34

30:                                               ; preds = %16
  %31 = getelementptr inbounds i8, ptr %1, i64 48
  %32 = load ptr, ptr %31, align 8, !tbaa !5
  %33 = tail call i64 @atol(ptr nocapture noundef %32) #8
  br label %36

34:                                               ; preds = %16
  %35 = tail call i64 @time(ptr noundef null) #6
  br label %36

36:                                               ; preds = %34, %30
  %.sink50 = phi i64 [ %35, %34 ], [ %33, %30 ]
  %37 = trunc i64 %.sink50 to i32
  tail call void @srand(i32 noundef %37) #6
  %38 = icmp eq i32 %28, 0
  br i1 %38, label %39, label %42

39:                                               ; preds = %36
  %40 = load ptr, ptr @stderr, align 8, !tbaa !5
  %41 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %40, ptr noundef nonnull @.str.3) #7
  br label %64

42:                                               ; preds = %36
  %43 = getelementptr inbounds i8, ptr %1, i64 8
  %44 = load ptr, ptr %43, align 8, !tbaa !5
  %45 = tail call i32 @atoi(ptr nocapture noundef %44) #8
  %46 = tail call ptr @_sml_new(i32 noundef %45)
  %.not = icmp eq ptr %46, null
  br i1 %.not, label %47, label %50

47:                                               ; preds = %42
  %48 = load ptr, ptr @stderr, align 8, !tbaa !5
  %49 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %48, ptr noundef nonnull @.str.4) #7
  br label %64

50:                                               ; preds = %42
  %51 = call zeroext i1 @sml_set_read_state_callback(ptr noundef nonnull %46, ptr noundef nonnull @_read_state_cb, ptr noundef nonnull %3) #6
  %52 = call zeroext i1 @sml_set_stabilization_hits(ptr noundef nonnull %46, i16 noundef zeroext 0) #6
  %.not4245 = icmp eq i32 %19, 0
  br i1 %.not4245, label %.preheader44, label %.lr.ph

.preheader44:                                     ; preds = %.lr.ph, %50
  %.not4347 = icmp eq i32 %22, 0
  br i1 %.not4347, label %.preheader.preheader, label %.lr.ph49

.lr.ph:                                           ; preds = %50, %.lr.ph
  %.03746 = phi i32 [ %56, %.lr.ph ], [ %19, %50 ]
  %53 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %4, i64 noundef 20, ptr noundef nonnull @.str.5, i32 noundef %.03746) #6
  %54 = call ptr @sml_new_input(ptr noundef nonnull %46, ptr noundef nonnull %4) #6
  %55 = call zeroext i1 @sml_variable_set_range(ptr noundef nonnull %46, ptr noundef %54, float noundef 0.000000e+00, float noundef 0x41E0000000000000) #6
  call void @_add_terms(ptr noundef nonnull %46, ptr noundef %54, ptr noundef nonnull %4, i32 noundef %.03746, i32 noundef %28)
  %56 = add i32 %.03746, -1
  %.not42 = icmp eq i32 %56, 0
  br i1 %.not42, label %.preheader44, label %.lr.ph, !llvm.loop !11

.lr.ph49:                                         ; preds = %.preheader44, %.lr.ph49
  %.03848 = phi i32 [ %60, %.lr.ph49 ], [ %22, %.preheader44 ]
  %57 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %4, i64 noundef 20, ptr noundef nonnull @.str.6, i32 noundef %.03848) #6
  %58 = call ptr @sml_new_output(ptr noundef nonnull %46, ptr noundef nonnull %4) #6
  %59 = call zeroext i1 @sml_variable_set_range(ptr noundef nonnull %46, ptr noundef %58, float noundef 0.000000e+00, float noundef 0x41E0000000000000) #6
  call void @_add_terms(ptr noundef nonnull %46, ptr noundef %58, ptr noundef nonnull %4, i32 noundef %.03848, i32 noundef %28)
  %60 = add i32 %.03848, -1
  %.not43 = icmp eq i32 %60, 0
  br i1 %.not43, label %.preheader.preheader, label %.lr.ph49, !llvm.loop !13

.preheader.preheader:                             ; preds = %.lr.ph49, %.preheader44
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %.preheader
  %61 = call i32 @sml_process(ptr noundef nonnull %46) #6
  %62 = icmp eq i32 %61, 0
  br i1 %62, label %.preheader, label %63, !llvm.loop !14

63:                                               ; preds = %.preheader
  call void @sml_free(ptr noundef nonnull %46) #6
  br label %64

64:                                               ; preds = %63, %47, %39, %6
  %.0 = phi i32 [ 1, %6 ], [ 1, %39 ], [ 0, %63 ], [ 1, %47 ]
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  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: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr nocapture noundef nonnull) local_unnamed_addr #3

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

; Function Attrs: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare i64 @atol(ptr nocapture noundef nonnull) local_unnamed_addr #3

; Function Attrs: nounwind
declare i64 @time(ptr noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare hidden ptr @_sml_new(i32 noundef) local_unnamed_addr #0

declare zeroext i1 @sml_set_read_state_callback(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #5

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @_read_state_cb(ptr noundef, ptr noundef) #0

declare zeroext i1 @sml_set_stabilization_hits(ptr noundef, i16 noundef zeroext) local_unnamed_addr #5

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

declare ptr @sml_new_input(ptr noundef, ptr noundef) local_unnamed_addr #5

declare zeroext i1 @sml_variable_set_range(ptr noundef, ptr noundef, float noundef, float noundef) local_unnamed_addr #5

; Function Attrs: nounwind uwtable
declare hidden void @_add_terms(ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

declare ptr @sml_new_output(ptr noundef, ptr noundef) local_unnamed_addr #5

declare i32 @sml_process(ptr noundef) local_unnamed_addr #5

declare void @sml_free(ptr noundef) local_unnamed_addr #5

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

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 = { 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 = { inlinehint mustprogress nofree nounwind willreturn memory(read) 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 "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 = { cold 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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}


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