; LLVM IR from Mohamed-Ouarar/C_piscine :: C00/ex06 - ft_print_comb2 (ft_print_comb2)

; 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 [2 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @print(i8 noundef signext %0, i8 noundef signext %1) #0 {
  %3 = alloca i8, align 1
  %4 = alloca i8, align 1
  %5 = alloca i8, align 1
  %6 = alloca i8, align 1
  %7 = alloca i8, align 1
  %8 = alloca i8, align 1
  store i8 %0, ptr %3, align 1, !tbaa !5
  store i8 %1, ptr %4, align 1, !tbaa !5
  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 1, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #3
  %9 = load i8, ptr %3, align 1, !tbaa !5
  %10 = sext i8 %9 to i32
  %11 = sdiv i32 %10, 10
  %12 = add nsw i32 %11, 48
  %13 = trunc i32 %12 to i8
  store i8 %13, ptr %5, align 1, !tbaa !5
  %14 = load i8, ptr %3, align 1, !tbaa !5
  %15 = sext i8 %14 to i32
  %16 = srem i32 %15, 10
  %17 = add nsw i32 %16, 48
  %18 = trunc i32 %17 to i8
  store i8 %18, ptr %6, align 1, !tbaa !5
  %19 = load i8, ptr %4, align 1, !tbaa !5
  %20 = sext i8 %19 to i32
  %21 = sdiv i32 %20, 10
  %22 = add nsw i32 %21, 48
  %23 = trunc i32 %22 to i8
  store i8 %23, ptr %7, align 1, !tbaa !5
  %24 = load i8, ptr %4, align 1, !tbaa !5
  %25 = sext i8 %24 to i32
  %26 = srem i32 %25, 10
  %27 = add nsw i32 %26, 48
  %28 = trunc i32 %27 to i8
  store i8 %28, ptr %8, align 1, !tbaa !5
  %29 = call i64 @write(i32 noundef 1, ptr noundef %5, i64 noundef 1)
  %30 = call i64 @write(i32 noundef 1, ptr noundef %6, i64 noundef 1)
  %31 = call i64 @write(i32 noundef 1, ptr noundef @.str, i64 noundef 1)
  %32 = call i64 @write(i32 noundef 1, ptr noundef %7, i64 noundef 1)
  %33 = call i64 @write(i32 noundef 1, ptr noundef %8, i64 noundef 1)
  %34 = load i8, ptr %3, align 1, !tbaa !5
  %35 = sext i8 %34 to i32
  %36 = icmp eq i32 %35, 98
  br i1 %36, label %37, label %41

37:                                               ; preds = %2
  %38 = load i8, ptr %4, align 1, !tbaa !5
  %39 = sext i8 %38 to i32
  %40 = icmp eq i32 %39, 99
  br i1 %40, label %43, label %41

41:                                               ; preds = %37, %2
  %42 = call i64 @write(i32 noundef 1, ptr noundef @.str.1, i64 noundef 2)
  br label %43

43:                                               ; preds = %41, %37
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 1, 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
  ret void
}

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

declare i64 @write(i32 noundef, ptr noundef, i64 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}


; 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
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: nofree nounwind uwtable
define dso_local void @print(i8 noundef signext %0, i8 noundef signext %1) local_unnamed_addr #0 {
  %3 = alloca i8, align 1
  %4 = alloca i8, align 1
  %5 = alloca i8, align 1
  %6 = alloca i8, align 1
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %3) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #3
  %7 = sdiv i8 %0, 10
  %8 = add nsw i8 %7, 48
  store i8 %8, ptr %3, align 1, !tbaa !5
  %9 = srem i8 %0, 10
  %10 = add nsw i8 %9, 48
  store i8 %10, ptr %4, align 1, !tbaa !5
  %11 = sdiv i8 %1, 10
  %12 = add nsw i8 %11, 48
  store i8 %12, ptr %5, align 1, !tbaa !5
  %13 = srem i8 %1, 10
  %14 = add nsw i8 %13, 48
  store i8 %14, ptr %6, align 1, !tbaa !5
  %15 = call i64 @write(i32 noundef 1, ptr noundef nonnull %3, i64 noundef 1) #3
  %16 = call i64 @write(i32 noundef 1, ptr noundef nonnull %4, i64 noundef 1) #3
  %17 = tail call i64 @write(i32 noundef 1, ptr noundef nonnull @.str, i64 noundef 1) #3
  %18 = call i64 @write(i32 noundef 1, ptr noundef nonnull %5, i64 noundef 1) #3
  %19 = call i64 @write(i32 noundef 1, ptr noundef nonnull %6, i64 noundef 1) #3
  %20 = icmp eq i8 %0, 98
  %21 = icmp eq i8 %1, 99
  %or.cond = and i1 %20, %21
  br i1 %or.cond, label %24, label %22

22:                                               ; preds = %2
  %23 = tail call i64 @write(i32 noundef 1, ptr noundef nonnull @.str.1, i64 noundef 2) #3
  br label %24

24:                                               ; preds = %2, %22
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #3
  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
declare noundef i64 @write(i32 noundef, ptr nocapture noundef readonly, i64 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 = { 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree "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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}


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