; LLVM IR from jgaeddert/liquid-dsp :: sandbox (fec_rep3_test)

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

@.str = external hidden unnamed_addr constant [30 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [13 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i8, align 1
  %3 = alloca i8, align 1
  %4 = alloca i8, align 1
  %5 = alloca i8, align 1
  %6 = alloca i8, align 1
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 1, ptr %2) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %3) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %4) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  store i32 0, ptr %7, align 4, !tbaa !5
  store i8 0, ptr %2, align 1, !tbaa !9
  br label %9

9:                                                ; preds = %99, %0
  %10 = load i8, ptr %2, align 1, !tbaa !9
  %11 = zext i8 %10 to i32
  %12 = icmp slt i32 %11, 2
  br i1 %12, label %13, label %102

13:                                               ; preds = %9
  store i8 0, ptr %3, align 1, !tbaa !9
  br label %14

14:                                               ; preds = %95, %13
  %15 = load i8, ptr %3, align 1, !tbaa !9
  %16 = zext i8 %15 to i32
  %17 = icmp slt i32 %16, 2
  br i1 %17, label %18, label %98

18:                                               ; preds = %14
  store i8 0, ptr %4, align 1, !tbaa !9
  br label %19

19:                                               ; preds = %91, %18
  %20 = load i8, ptr %4, align 1, !tbaa !9
  %21 = zext i8 %20 to i32
  %22 = icmp slt i32 %21, 2
  br i1 %22, label %23, label %94

23:                                               ; preds = %19
  %24 = load i8, ptr %2, align 1, !tbaa !9
  %25 = zext i8 %24 to i32
  %26 = load i8, ptr %3, align 1, !tbaa !9
  %27 = zext i8 %26 to i32
  %28 = add nsw i32 %25, %27
  %29 = load i8, ptr %4, align 1, !tbaa !9
  %30 = zext i8 %29 to i32
  %31 = add nsw i32 %28, %30
  %32 = icmp slt i32 %31, 2
  %33 = zext i1 %32 to i64
  %34 = select i1 %32, i32 0, i32 1
  %35 = trunc i32 %34 to i8
  store i8 %35, ptr %5, align 1, !tbaa !9
  %36 = load i8, ptr %3, align 1, !tbaa !9
  %37 = zext i8 %36 to i32
  %38 = load i8, ptr %4, align 1, !tbaa !9
  %39 = zext i8 %38 to i32
  %40 = and i32 %37, %39
  %41 = load i8, ptr %2, align 1, !tbaa !9
  %42 = zext i8 %41 to i32
  %43 = load i8, ptr %3, align 1, !tbaa !9
  %44 = zext i8 %43 to i32
  %45 = and i32 %42, %44
  %46 = or i32 %40, %45
  %47 = load i8, ptr %2, align 1, !tbaa !9
  %48 = zext i8 %47 to i32
  %49 = load i8, ptr %4, align 1, !tbaa !9
  %50 = zext i8 %49 to i32
  %51 = and i32 %48, %50
  %52 = or i32 %46, %51
  %53 = trunc i32 %52 to i8
  store i8 %53, ptr %6, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  %54 = load i8, ptr %2, align 1, !tbaa !9
  %55 = zext i8 %54 to i32
  %56 = load i8, ptr %3, align 1, !tbaa !9
  %57 = zext i8 %56 to i32
  %58 = xor i32 %55, %57
  %59 = load i8, ptr %2, align 1, !tbaa !9
  %60 = zext i8 %59 to i32
  %61 = load i8, ptr %4, align 1, !tbaa !9
  %62 = zext i8 %61 to i32
  %63 = xor i32 %60, %62
  %64 = or i32 %58, %63
  %65 = load i8, ptr %3, align 1, !tbaa !9
  %66 = zext i8 %65 to i32
  %67 = load i8, ptr %4, align 1, !tbaa !9
  %68 = zext i8 %67 to i32
  %69 = xor i32 %66, %68
  %70 = or i32 %64, %69
  store i32 %70, ptr %8, align 4, !tbaa !5
  %71 = load i8, ptr %5, align 1, !tbaa !9
  %72 = zext i8 %71 to i32
  %73 = load i8, ptr %6, align 1, !tbaa !9
  %74 = zext i8 %73 to i32
  %75 = icmp ne i32 %72, %74
  %76 = zext i1 %75 to i32
  %77 = load i32, ptr %7, align 4, !tbaa !5
  %78 = add i32 %77, %76
  store i32 %78, ptr %7, align 4, !tbaa !5
  %79 = load i8, ptr %2, align 1, !tbaa !9
  %80 = zext i8 %79 to i32
  %81 = load i8, ptr %3, align 1, !tbaa !9
  %82 = zext i8 %81 to i32
  %83 = load i8, ptr %4, align 1, !tbaa !9
  %84 = zext i8 %83 to i32
  %85 = load i8, ptr %5, align 1, !tbaa !9
  %86 = zext i8 %85 to i32
  %87 = load i8, ptr %6, align 1, !tbaa !9
  %88 = zext i8 %87 to i32
  %89 = load i32, ptr %8, align 4, !tbaa !5
  %90 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %80, i32 noundef %82, i32 noundef %84, i32 noundef %86, i32 noundef %88, i32 noundef %89)
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  br label %91

91:                                               ; preds = %23
  %92 = load i8, ptr %4, align 1, !tbaa !9
  %93 = add i8 %92, 1
  store i8 %93, ptr %4, align 1, !tbaa !9
  br label %19, !llvm.loop !10

94:                                               ; preds = %19
  br label %95

95:                                               ; preds = %94
  %96 = load i8, ptr %3, align 1, !tbaa !9
  %97 = add i8 %96, 1
  store i8 %97, ptr %3, align 1, !tbaa !9
  br label %14, !llvm.loop !12

98:                                               ; preds = %14
  br label %99

99:                                               ; preds = %98
  %100 = load i8, ptr %2, align 1, !tbaa !9
  %101 = add i8 %100, 1
  store i8 %101, ptr %2, align 1, !tbaa !9
  br label %9, !llvm.loop !13

102:                                              ; preds = %9
  %103 = load i32, ptr %7, align 4, !tbaa !5
  %104 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %103)
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %2) #3
  ret i32 0
}

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

declare i32 @printf(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 = { 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 = { "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 }

!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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !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 [30 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [13 x i8], align 1

; Function Attrs: nofree nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
.preheader37:
  %0 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 0, i32 noundef 0, i32 noundef 0, i32 noundef 0, i32 noundef 0, i32 noundef 0)
  %1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 0, i32 noundef 0, i32 noundef 1, i32 noundef 0, i32 noundef 0, i32 noundef 1)
  %2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 0, i32 noundef 1, i32 noundef 0, i32 noundef 0, i32 noundef 0, i32 noundef 1)
  %3 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 0, i32 noundef 1, i32 noundef 1, i32 noundef 1, i32 noundef 1, i32 noundef 1)
  %4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 1, i32 noundef 0, i32 noundef 0, i32 noundef 0, i32 noundef 0, i32 noundef 1)
  %5 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 1, i32 noundef 0, i32 noundef 1, i32 noundef 1, i32 noundef 1, i32 noundef 1)
  %6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 1, i32 noundef 1, i32 noundef 0, i32 noundef 1, i32 noundef 1, i32 noundef 1)
  %7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 1, i32 noundef 1, i32 noundef 1, i32 noundef 1, i32 noundef 1, i32 noundef 0)
  %8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 0)
  ret i32 0
}

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

attributes #0 = { nofree 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 = { 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)"}


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