; LLVM IR from scvalencia/MNIST_ASCII_challenge :: src (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.raw_MNIST_line = type { i32, ptr }

@MNIST_array = external dso_local global [42000 x %struct.raw_MNIST_line], align 16
@.str.11 = external hidden unnamed_addr constant [3 x i8], align 1
@min_digits = external dso_local global i32, align 4
@max_digits = external dso_local global i32, align 4
@.str.13 = external hidden unnamed_addr constant [2 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #1

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @receive_CAPTCHA(i32 noundef, ptr noundef) #3

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @randr(i32 noundef, i32 noundef) #3

; Function Attrs: nounwind uwtable
declare dso_local signext i8 @classify_brightness(i32 noundef) #3

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @display_MNIST_captcha() #3 {
  %1 = alloca i32, align 4
  %2 = alloca ptr, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %struct.raw_MNIST_line, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i8, align 1
  %14 = alloca i8, align 1
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #5
  %15 = load i32, ptr @min_digits, align 4, !tbaa !5
  %16 = load i32, ptr @max_digits, align 4, !tbaa !5
  %17 = sub nsw i32 %16, 1
  %18 = call i32 @randr(i32 noundef %15, i32 noundef %17)
  store i32 %18, ptr %1, align 4, !tbaa !5
  %19 = load i32, ptr %1, align 4, !tbaa !5
  %20 = zext i32 %19 to i64
  %21 = call ptr @llvm.stacksave.p0()
  store ptr %21, ptr %2, align 8
  %22 = alloca %struct.raw_MNIST_line, i64 %20, align 16
  store i64 %20, ptr %3, align 8
  %23 = load i32, ptr %1, align 4, !tbaa !5
  %24 = zext i32 %23 to i64
  %25 = alloca i32, i64 %24, align 16
  store i64 %24, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %26

26:                                               ; preds = %44, %0
  %27 = load i32, ptr %5, align 4, !tbaa !5
  %28 = load i32, ptr %1, align 4, !tbaa !5
  %29 = icmp slt i32 %27, %28
  br i1 %29, label %31, label %30

30:                                               ; preds = %26
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %47

31:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %32 = call i32 @randr(i32 noundef 0, i32 noundef 41999)
  store i32 %32, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #5
  %33 = load i32, ptr %6, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [42000 x %struct.raw_MNIST_line], ptr @MNIST_array, i64 0, i64 %34
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %7, ptr align 16 %35, i64 16, i1 false), !tbaa.struct !9
  %36 = load i32, ptr %5, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds %struct.raw_MNIST_line, ptr %22, i64 %37
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %38, ptr align 8 %7, i64 16, i1 false), !tbaa.struct !9
  %39 = getelementptr inbounds %struct.raw_MNIST_line, ptr %7, i32 0, i32 0
  %40 = load i32, ptr %39, align 8, !tbaa !12
  %41 = load i32, ptr %5, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds i32, ptr %25, i64 %42
  store i32 %40, ptr %43, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %44

44:                                               ; preds = %31
  %45 = load i32, ptr %5, align 4, !tbaa !5
  %46 = add nsw i32 %45, 1
  store i32 %46, ptr %5, align 4, !tbaa !5
  br label %26, !llvm.loop !14

47:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %48

48:                                               ; preds = %89, %47
  %49 = load i32, ptr %8, align 4, !tbaa !5
  %50 = icmp slt i32 %49, 784
  br i1 %50, label %52, label %51

51:                                               ; preds = %48
  store i32 5, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %92

52:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %53

53:                                               ; preds = %84, %52
  %54 = load i32, ptr %10, align 4, !tbaa !5
  %55 = load i32, ptr %1, align 4, !tbaa !5
  %56 = icmp slt i32 %54, %55
  br i1 %56, label %58, label %57

57:                                               ; preds = %53
  store i32 8, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %87

58:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %59

59:                                               ; preds = %80, %58
  %60 = load i32, ptr %11, align 4, !tbaa !5
  %61 = icmp ne i32 %60, 28
  br i1 %61, label %63, label %62

62:                                               ; preds = %59
  store i32 11, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %83

63:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %64 = load i32, ptr %10, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds %struct.raw_MNIST_line, ptr %22, i64 %65
  %67 = getelementptr inbounds %struct.raw_MNIST_line, ptr %66, i32 0, i32 1
  %68 = load ptr, ptr %67, align 8, !tbaa !16
  %69 = load i32, ptr %11, align 4, !tbaa !5
  %70 = load i32, ptr %8, align 4, !tbaa !5
  %71 = add nsw i32 %69, %70
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds i32, ptr %68, i64 %72
  %74 = load i32, ptr %73, align 4, !tbaa !5
  store i32 %74, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #5
  %75 = load i32, ptr %12, align 4, !tbaa !5
  %76 = call signext i8 @classify_brightness(i32 noundef %75)
  store i8 %76, ptr %13, align 1, !tbaa !17
  %77 = load i8, ptr %13, align 1, !tbaa !17
  %78 = sext i8 %77 to i32
  %79 = call i32 (ptr, ...) @printf(ptr noundef @.str.11, i32 noundef %78)
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %80

80:                                               ; preds = %63
  %81 = load i32, ptr %11, align 4, !tbaa !5
  %82 = add nsw i32 %81, 1
  store i32 %82, ptr %11, align 4, !tbaa !5
  br label %59, !llvm.loop !18

83:                                               ; preds = %62
  br label %84

84:                                               ; preds = %83
  %85 = load i32, ptr %10, align 4, !tbaa !5
  %86 = add nsw i32 %85, 1
  store i32 %86, ptr %10, align 4, !tbaa !5
  br label %53, !llvm.loop !19

87:                                               ; preds = %57
  %88 = call i32 (ptr, ...) @printf(ptr noundef @.str.13)
  br label %89

89:                                               ; preds = %87
  %90 = load i32, ptr %8, align 4, !tbaa !5
  %91 = add nsw i32 %90, 28
  store i32 %91, ptr %8, align 4, !tbaa !5
  br label %48, !llvm.loop !20

92:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 1, ptr %14) #5
  %93 = load i32, ptr %1, align 4, !tbaa !5
  %94 = call zeroext i1 @receive_CAPTCHA(i32 noundef %93, ptr noundef %22)
  %95 = zext i1 %94 to i8
  store i8 %95, ptr %14, align 1, !tbaa !21
  %96 = load i8, ptr %14, align 1, !tbaa !21, !range !23, !noundef !24
  %97 = trunc i8 %96 to i1
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #5
  %98 = load ptr, ptr %2, align 8
  call void @llvm.stackrestore.p0(ptr %98)
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #5
  ret i1 %97
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind willreturn }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "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 }

!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 = !{i64 0, i64 4, !5, i64 8, i64 8, !10}
!10 = !{!11, !11, i64 0}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!13, !6, i64 0}
!13 = !{!"raw_MNIST_line", !6, i64 0, !11, i64 8}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!13, !11, i64 8}
!17 = !{!7, !7, i64 0}
!18 = distinct !{!18, !15}
!19 = distinct !{!19, !15}
!20 = distinct !{!20, !15}
!21 = !{!22, !22, i64 0}
!22 = !{!"_Bool", !7, i64 0}
!23 = !{i8 0, i8 2}
!24 = !{}


; 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.raw_MNIST_line = type { i32, ptr }

@MNIST_array = external dso_local local_unnamed_addr global [42000 x %struct.raw_MNIST_line], align 16
@.str.11 = external hidden unnamed_addr constant [3 x i8], align 1
@min_digits = external dso_local local_unnamed_addr global i32, align 4
@max_digits = external dso_local local_unnamed_addr global i32, align 4
@.str.13 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @receive_CAPTCHA(i32 noundef, ptr noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @randr(i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local signext i8 @classify_brightness(i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @display_MNIST_captcha() local_unnamed_addr #1 {
  %1 = load i32, ptr @min_digits, align 4, !tbaa !5
  %2 = load i32, ptr @max_digits, align 4, !tbaa !5
  %3 = add nsw i32 %2, -1
  %4 = tail call i32 @randr(i32 noundef %1, i32 noundef %3)
  %5 = zext i32 %4 to i64
  %6 = alloca %struct.raw_MNIST_line, i64 %5, align 16
  %7 = icmp sgt i32 %4, 0
  br i1 %7, label %.lr.ph, label %.preheader28.preheader

.preheader29:                                     ; preds = %.lr.ph
  br i1 %7, label %.preheader28.us, label %.preheader28.preheader

.preheader28.preheader:                           ; preds = %0, %.preheader29
  %8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13)
  %9 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13)
  %10 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13)
  %11 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13)
  %12 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13)
  %13 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13)
  %14 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13)
  %15 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13)
  %16 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13)
  %17 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13)
  %18 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13)
  %19 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13)
  %20 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13)
  %21 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13)
  %22 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13)
  %23 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13)
  %24 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13)
  %25 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13)
  %26 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13)
  %27 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13)
  %28 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13)
  %29 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13)
  %30 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13)
  %31 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13)
  %32 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13)
  %33 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13)
  %34 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13)
  %35 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13)
  br label %.split.us

.preheader28.us:                                  ; preds = %.preheader29, %._crit_edge.us
  %indvars.iv44 = phi i64 [ %indvars.iv.next45, %._crit_edge.us ], [ 0, %.preheader29 ]
  %36 = or disjoint i64 %indvars.iv44, 1
  %37 = or disjoint i64 %indvars.iv44, 2
  %38 = or disjoint i64 %indvars.iv44, 3
  br label %.preheader.us

.preheader.us:                                    ; preds = %.preheader28.us, %.preheader.us
  %indvars.iv39 = phi i64 [ 0, %.preheader28.us ], [ %indvars.iv.next40, %.preheader.us ]
  %39 = getelementptr inbounds %struct.raw_MNIST_line, ptr %6, i64 %indvars.iv39, i32 1
  %40 = load ptr, ptr %39, align 8, !tbaa !9
  %41 = getelementptr inbounds i32, ptr %40, i64 %indvars.iv44
  %42 = load i32, ptr %41, align 4, !tbaa !5
  %43 = tail call signext i8 @classify_brightness(i32 noundef %42)
  %44 = sext i8 %43 to i32
  %45 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, i32 noundef %44)
  %46 = getelementptr inbounds i32, ptr %40, i64 %36
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = tail call signext i8 @classify_brightness(i32 noundef %47)
  %49 = sext i8 %48 to i32
  %50 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, i32 noundef %49)
  %51 = getelementptr inbounds i32, ptr %40, i64 %37
  %52 = load i32, ptr %51, align 4, !tbaa !5
  %53 = tail call signext i8 @classify_brightness(i32 noundef %52)
  %54 = sext i8 %53 to i32
  %55 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, i32 noundef %54)
  %56 = getelementptr inbounds i32, ptr %40, i64 %38
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = tail call signext i8 @classify_brightness(i32 noundef %57)
  %59 = sext i8 %58 to i32
  %60 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, i32 noundef %59)
  %61 = getelementptr inbounds i32, ptr %40, i64 %indvars.iv44
  %62 = getelementptr inbounds i8, ptr %61, i64 16
  %63 = load i32, ptr %62, align 4, !tbaa !5
  %64 = tail call signext i8 @classify_brightness(i32 noundef %63)
  %65 = sext i8 %64 to i32
  %66 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, i32 noundef %65)
  %67 = getelementptr inbounds i32, ptr %40, i64 %indvars.iv44
  %68 = getelementptr inbounds i8, ptr %67, i64 20
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = tail call signext i8 @classify_brightness(i32 noundef %69)
  %71 = sext i8 %70 to i32
  %72 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, i32 noundef %71)
  %73 = getelementptr inbounds i32, ptr %40, i64 %indvars.iv44
  %74 = getelementptr inbounds i8, ptr %73, i64 24
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = tail call signext i8 @classify_brightness(i32 noundef %75)
  %77 = sext i8 %76 to i32
  %78 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, i32 noundef %77)
  %79 = getelementptr inbounds i32, ptr %40, i64 %indvars.iv44
  %80 = getelementptr inbounds i8, ptr %79, i64 28
  %81 = load i32, ptr %80, align 4, !tbaa !5
  %82 = tail call signext i8 @classify_brightness(i32 noundef %81)
  %83 = sext i8 %82 to i32
  %84 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, i32 noundef %83)
  %85 = getelementptr inbounds i32, ptr %40, i64 %indvars.iv44
  %86 = getelementptr inbounds i8, ptr %85, i64 32
  %87 = load i32, ptr %86, align 4, !tbaa !5
  %88 = tail call signext i8 @classify_brightness(i32 noundef %87)
  %89 = sext i8 %88 to i32
  %90 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, i32 noundef %89)
  %91 = getelementptr inbounds i32, ptr %40, i64 %indvars.iv44
  %92 = getelementptr inbounds i8, ptr %91, i64 36
  %93 = load i32, ptr %92, align 4, !tbaa !5
  %94 = tail call signext i8 @classify_brightness(i32 noundef %93)
  %95 = sext i8 %94 to i32
  %96 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, i32 noundef %95)
  %97 = getelementptr inbounds i32, ptr %40, i64 %indvars.iv44
  %98 = getelementptr inbounds i8, ptr %97, i64 40
  %99 = load i32, ptr %98, align 4, !tbaa !5
  %100 = tail call signext i8 @classify_brightness(i32 noundef %99)
  %101 = sext i8 %100 to i32
  %102 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, i32 noundef %101)
  %103 = getelementptr inbounds i32, ptr %40, i64 %indvars.iv44
  %104 = getelementptr inbounds i8, ptr %103, i64 44
  %105 = load i32, ptr %104, align 4, !tbaa !5
  %106 = tail call signext i8 @classify_brightness(i32 noundef %105)
  %107 = sext i8 %106 to i32
  %108 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, i32 noundef %107)
  %109 = getelementptr inbounds i32, ptr %40, i64 %indvars.iv44
  %110 = getelementptr inbounds i8, ptr %109, i64 48
  %111 = load i32, ptr %110, align 4, !tbaa !5
  %112 = tail call signext i8 @classify_brightness(i32 noundef %111)
  %113 = sext i8 %112 to i32
  %114 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, i32 noundef %113)
  %115 = getelementptr inbounds i32, ptr %40, i64 %indvars.iv44
  %116 = getelementptr inbounds i8, ptr %115, i64 52
  %117 = load i32, ptr %116, align 4, !tbaa !5
  %118 = tail call signext i8 @classify_brightness(i32 noundef %117)
  %119 = sext i8 %118 to i32
  %120 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, i32 noundef %119)
  %121 = getelementptr inbounds i32, ptr %40, i64 %indvars.iv44
  %122 = getelementptr inbounds i8, ptr %121, i64 56
  %123 = load i32, ptr %122, align 4, !tbaa !5
  %124 = tail call signext i8 @classify_brightness(i32 noundef %123)
  %125 = sext i8 %124 to i32
  %126 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, i32 noundef %125)
  %127 = getelementptr inbounds i32, ptr %40, i64 %indvars.iv44
  %128 = getelementptr inbounds i8, ptr %127, i64 60
  %129 = load i32, ptr %128, align 4, !tbaa !5
  %130 = tail call signext i8 @classify_brightness(i32 noundef %129)
  %131 = sext i8 %130 to i32
  %132 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, i32 noundef %131)
  %133 = getelementptr inbounds i32, ptr %40, i64 %indvars.iv44
  %134 = getelementptr inbounds i8, ptr %133, i64 64
  %135 = load i32, ptr %134, align 4, !tbaa !5
  %136 = tail call signext i8 @classify_brightness(i32 noundef %135)
  %137 = sext i8 %136 to i32
  %138 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, i32 noundef %137)
  %139 = getelementptr inbounds i32, ptr %40, i64 %indvars.iv44
  %140 = getelementptr inbounds i8, ptr %139, i64 68
  %141 = load i32, ptr %140, align 4, !tbaa !5
  %142 = tail call signext i8 @classify_brightness(i32 noundef %141)
  %143 = sext i8 %142 to i32
  %144 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, i32 noundef %143)
  %145 = getelementptr inbounds i32, ptr %40, i64 %indvars.iv44
  %146 = getelementptr inbounds i8, ptr %145, i64 72
  %147 = load i32, ptr %146, align 4, !tbaa !5
  %148 = tail call signext i8 @classify_brightness(i32 noundef %147)
  %149 = sext i8 %148 to i32
  %150 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, i32 noundef %149)
  %151 = getelementptr inbounds i32, ptr %40, i64 %indvars.iv44
  %152 = getelementptr inbounds i8, ptr %151, i64 76
  %153 = load i32, ptr %152, align 4, !tbaa !5
  %154 = tail call signext i8 @classify_brightness(i32 noundef %153)
  %155 = sext i8 %154 to i32
  %156 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, i32 noundef %155)
  %157 = getelementptr inbounds i32, ptr %40, i64 %indvars.iv44
  %158 = getelementptr inbounds i8, ptr %157, i64 80
  %159 = load i32, ptr %158, align 4, !tbaa !5
  %160 = tail call signext i8 @classify_brightness(i32 noundef %159)
  %161 = sext i8 %160 to i32
  %162 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, i32 noundef %161)
  %163 = getelementptr inbounds i32, ptr %40, i64 %indvars.iv44
  %164 = getelementptr inbounds i8, ptr %163, i64 84
  %165 = load i32, ptr %164, align 4, !tbaa !5
  %166 = tail call signext i8 @classify_brightness(i32 noundef %165)
  %167 = sext i8 %166 to i32
  %168 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, i32 noundef %167)
  %169 = getelementptr inbounds i32, ptr %40, i64 %indvars.iv44
  %170 = getelementptr inbounds i8, ptr %169, i64 88
  %171 = load i32, ptr %170, align 4, !tbaa !5
  %172 = tail call signext i8 @classify_brightness(i32 noundef %171)
  %173 = sext i8 %172 to i32
  %174 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, i32 noundef %173)
  %175 = getelementptr inbounds i32, ptr %40, i64 %indvars.iv44
  %176 = getelementptr inbounds i8, ptr %175, i64 92
  %177 = load i32, ptr %176, align 4, !tbaa !5
  %178 = tail call signext i8 @classify_brightness(i32 noundef %177)
  %179 = sext i8 %178 to i32
  %180 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, i32 noundef %179)
  %181 = getelementptr inbounds i32, ptr %40, i64 %indvars.iv44
  %182 = getelementptr inbounds i8, ptr %181, i64 96
  %183 = load i32, ptr %182, align 4, !tbaa !5
  %184 = tail call signext i8 @classify_brightness(i32 noundef %183)
  %185 = sext i8 %184 to i32
  %186 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, i32 noundef %185)
  %187 = getelementptr inbounds i32, ptr %40, i64 %indvars.iv44
  %188 = getelementptr inbounds i8, ptr %187, i64 100
  %189 = load i32, ptr %188, align 4, !tbaa !5
  %190 = tail call signext i8 @classify_brightness(i32 noundef %189)
  %191 = sext i8 %190 to i32
  %192 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, i32 noundef %191)
  %193 = getelementptr inbounds i32, ptr %40, i64 %indvars.iv44
  %194 = getelementptr inbounds i8, ptr %193, i64 104
  %195 = load i32, ptr %194, align 4, !tbaa !5
  %196 = tail call signext i8 @classify_brightness(i32 noundef %195)
  %197 = sext i8 %196 to i32
  %198 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, i32 noundef %197)
  %199 = getelementptr inbounds i32, ptr %40, i64 %indvars.iv44
  %200 = getelementptr inbounds i8, ptr %199, i64 108
  %201 = load i32, ptr %200, align 4, !tbaa !5
  %202 = tail call signext i8 @classify_brightness(i32 noundef %201)
  %203 = sext i8 %202 to i32
  %204 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, i32 noundef %203)
  %indvars.iv.next40 = add nuw nsw i64 %indvars.iv39, 1
  %exitcond43.not = icmp eq i64 %indvars.iv.next40, %5
  br i1 %exitcond43.not, label %._crit_edge.us, label %.preheader.us, !llvm.loop !12

._crit_edge.us:                                   ; preds = %.preheader.us
  %205 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13)
  %indvars.iv.next45 = add nuw nsw i64 %indvars.iv44, 28
  %206 = icmp ult i64 %indvars.iv44, 756
  br i1 %206, label %.preheader28.us, label %.split.us, !llvm.loop !14

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %207 = tail call i32 @randr(i32 noundef 0, i32 noundef 41999)
  %208 = sext i32 %207 to i64
  %209 = getelementptr inbounds [42000 x %struct.raw_MNIST_line], ptr @MNIST_array, i64 0, i64 %208
  %.sroa.0.0.copyload = load i32, ptr %209, align 16, !tbaa !5
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %209, i64 4
  %210 = getelementptr inbounds %struct.raw_MNIST_line, ptr %6, i64 %indvars.iv
  store i32 %.sroa.0.0.copyload, ptr %210, align 16, !tbaa !5
  %.sroa.5.0..sroa_idx13 = getelementptr inbounds i8, ptr %210, i64 4
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %.sroa.5.0..sroa_idx13, ptr noundef nonnull align 4 dereferenceable(12) %.sroa.5.0..sroa_idx, i64 12, i1 false)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %5
  br i1 %exitcond.not, label %.preheader29, label %.lr.ph, !llvm.loop !15

.split.us:                                        ; preds = %._crit_edge.us, %.preheader28.preheader
  %211 = call zeroext i1 @receive_CAPTCHA(i32 noundef %4, ptr noundef nonnull %6)
  ret i1 %211
}

attributes #0 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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" }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 8}
!10 = !{!"raw_MNIST_line", !6, i64 0, !11, i64 8}
!11 = !{!"any pointer", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,SROAPass,SimplifyCFGPass,TailCallElimPass