; LLVM IR from Ayon-SSP/The-SDE-Prep :: 1]_Data Structures/3]_Stack (infixtopostfix)

; 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.4 = external hidden unnamed_addr constant [30 x i8], align 1
@__const.main.test = external hidden unnamed_addr constant [20 x i8], align 16
@.str.5 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [19 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: nounwind uwtable
declare dso_local i32 @precedence(i8 noundef signext) #1

; Function Attrs: nounwind uwtable
declare dso_local ptr @push(ptr noundef, i8 noundef signext) #1

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @isEmpty(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local ptr @pop(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @Top(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local void @reverse(ptr noundef) #1

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #3

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #1 {
  %1 = alloca i32, align 4
  %2 = alloca ptr, align 8
  %3 = alloca [20 x i8], align 16
  %4 = alloca [20 x i8], align 16
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #5
  store ptr null, ptr %2, align 8, !tbaa !5
  %7 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  call void @llvm.lifetime.start.p0(i64 20, ptr %3) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %3, ptr align 16 @__const.main.test, i64 20, i1 false)
  call void @llvm.lifetime.start.p0(i64 20, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 0, ptr %5, align 4, !tbaa !9
  %8 = getelementptr inbounds [20 x i8], ptr %3, i64 0, i64 0
  call void @reverse(ptr noundef %8)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %9

9:                                                ; preds = %143, %0
  %10 = load i32, ptr %6, align 4, !tbaa !9
  %11 = sext i32 %10 to i64
  %12 = getelementptr inbounds [20 x i8], ptr %3, i64 0, i64 0
  %13 = call i64 @strlen(ptr noundef %12) #6
  %14 = sub i64 %13, 1
  %15 = icmp ule i64 %11, %14
  br i1 %15, label %17, label %16

16:                                               ; preds = %9
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %146

17:                                               ; preds = %9
  %18 = load i32, ptr %6, align 4, !tbaa !9
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [20 x i8], ptr %3, i64 0, i64 %19
  %21 = load i8, ptr %20, align 1, !tbaa !11
  %22 = sext i8 %21 to i32
  %23 = icmp sle i32 %22, 122
  br i1 %23, label %24, label %31

24:                                               ; preds = %17
  %25 = load i32, ptr %6, align 4, !tbaa !9
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [20 x i8], ptr %3, i64 0, i64 %26
  %28 = load i8, ptr %27, align 1, !tbaa !11
  %29 = sext i8 %28 to i32
  %30 = icmp sge i32 %29, 97
  br i1 %30, label %45, label %31

31:                                               ; preds = %24, %17
  %32 = load i32, ptr %6, align 4, !tbaa !9
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [20 x i8], ptr %3, i64 0, i64 %33
  %35 = load i8, ptr %34, align 1, !tbaa !11
  %36 = sext i8 %35 to i32
  %37 = icmp sle i32 %36, 90
  br i1 %37, label %38, label %55

38:                                               ; preds = %31
  %39 = load i32, ptr %6, align 4, !tbaa !9
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [20 x i8], ptr %3, i64 0, i64 %40
  %42 = load i8, ptr %41, align 1, !tbaa !11
  %43 = sext i8 %42 to i32
  %44 = icmp sge i32 %43, 65
  br i1 %44, label %45, label %55

45:                                               ; preds = %38, %24
  %46 = load i32, ptr %6, align 4, !tbaa !9
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [20 x i8], ptr %3, i64 0, i64 %47
  %49 = load i8, ptr %48, align 1, !tbaa !11
  %50 = load i32, ptr %5, align 4, !tbaa !9
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [20 x i8], ptr %4, i64 0, i64 %51
  store i8 %49, ptr %52, align 1, !tbaa !11
  %53 = load i32, ptr %5, align 4, !tbaa !9
  %54 = add nsw i32 %53, 1
  store i32 %54, ptr %5, align 4, !tbaa !9
  br label %142

55:                                               ; preds = %38, %31
  %56 = load i32, ptr %6, align 4, !tbaa !9
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [20 x i8], ptr %3, i64 0, i64 %57
  %59 = load i8, ptr %58, align 1, !tbaa !11
  %60 = sext i8 %59 to i32
  %61 = icmp eq i32 %60, 40
  br i1 %61, label %62, label %69

62:                                               ; preds = %55
  %63 = load ptr, ptr %2, align 8, !tbaa !5
  %64 = load i32, ptr %6, align 4, !tbaa !9
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [20 x i8], ptr %3, i64 0, i64 %65
  %67 = load i8, ptr %66, align 1, !tbaa !11
  %68 = call ptr @push(ptr noundef %63, i8 noundef signext %67)
  store ptr %68, ptr %2, align 8, !tbaa !5
  br label %141

69:                                               ; preds = %55
  %70 = load i32, ptr %6, align 4, !tbaa !9
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [20 x i8], ptr %3, i64 0, i64 %71
  %73 = load i8, ptr %72, align 1, !tbaa !11
  %74 = sext i8 %73 to i32
  %75 = icmp eq i32 %74, 41
  br i1 %75, label %76, label %105

76:                                               ; preds = %69
  br label %77

77:                                               ; preds = %87, %76
  %78 = load ptr, ptr %2, align 8, !tbaa !5
  %79 = call i32 @isEmpty(ptr noundef %78)
  %80 = icmp ne i32 %79, 0
  br i1 %80, label %85, label %81

81:                                               ; preds = %77
  %82 = load ptr, ptr %2, align 8, !tbaa !5
  %83 = call i32 @Top(ptr noundef %82)
  %84 = icmp ne i32 %83, 40
  br label %85

85:                                               ; preds = %81, %77
  %86 = phi i1 [ false, %77 ], [ %84, %81 ]
  br i1 %86, label %87, label %97

87:                                               ; preds = %85
  %88 = load ptr, ptr %2, align 8, !tbaa !5
  %89 = call i32 @Top(ptr noundef %88)
  %90 = trunc i32 %89 to i8
  %91 = load i32, ptr %5, align 4, !tbaa !9
  %92 = add nsw i32 %91, 1
  store i32 %92, ptr %5, align 4, !tbaa !9
  %93 = sext i32 %91 to i64
  %94 = getelementptr inbounds [20 x i8], ptr %4, i64 0, i64 %93
  store i8 %90, ptr %94, align 1, !tbaa !11
  %95 = load ptr, ptr %2, align 8, !tbaa !5
  %96 = call ptr @pop(ptr noundef %95)
  store ptr %96, ptr %2, align 8, !tbaa !5
  br label %77, !llvm.loop !12

97:                                               ; preds = %85
  %98 = load ptr, ptr %2, align 8, !tbaa !5
  %99 = call i32 @isEmpty(ptr noundef %98)
  %100 = icmp ne i32 %99, 0
  br i1 %100, label %104, label %101

101:                                              ; preds = %97
  %102 = load ptr, ptr %2, align 8, !tbaa !5
  %103 = call ptr @pop(ptr noundef %102)
  store ptr %103, ptr %2, align 8, !tbaa !5
  br label %104

104:                                              ; preds = %101, %97
  br label %140

105:                                              ; preds = %69
  br label %106

106:                                              ; preds = %123, %105
  %107 = load ptr, ptr %2, align 8, !tbaa !5
  %108 = call i32 @isEmpty(ptr noundef %107)
  %109 = icmp ne i32 %108, 0
  br i1 %109, label %121, label %110

110:                                              ; preds = %106
  %111 = load ptr, ptr %2, align 8, !tbaa !5
  %112 = call i32 @Top(ptr noundef %111)
  %113 = trunc i32 %112 to i8
  %114 = call i32 @precedence(i8 noundef signext %113)
  %115 = load i32, ptr %6, align 4, !tbaa !9
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [20 x i8], ptr %3, i64 0, i64 %116
  %118 = load i8, ptr %117, align 1, !tbaa !11
  %119 = call i32 @precedence(i8 noundef signext %118)
  %120 = icmp sge i32 %114, %119
  br label %121

121:                                              ; preds = %110, %106
  %122 = phi i1 [ false, %106 ], [ %120, %110 ]
  br i1 %122, label %123, label %133

123:                                              ; preds = %121
  %124 = load ptr, ptr %2, align 8, !tbaa !5
  %125 = call i32 @Top(ptr noundef %124)
  %126 = trunc i32 %125 to i8
  %127 = load i32, ptr %5, align 4, !tbaa !9
  %128 = add nsw i32 %127, 1
  store i32 %128, ptr %5, align 4, !tbaa !9
  %129 = sext i32 %127 to i64
  %130 = getelementptr inbounds [20 x i8], ptr %4, i64 0, i64 %129
  store i8 %126, ptr %130, align 1, !tbaa !11
  %131 = load ptr, ptr %2, align 8, !tbaa !5
  %132 = call ptr @pop(ptr noundef %131)
  store ptr %132, ptr %2, align 8, !tbaa !5
  br label %106, !llvm.loop !14

133:                                              ; preds = %121
  %134 = load ptr, ptr %2, align 8, !tbaa !5
  %135 = load i32, ptr %6, align 4, !tbaa !9
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [20 x i8], ptr %3, i64 0, i64 %136
  %138 = load i8, ptr %137, align 1, !tbaa !11
  %139 = call ptr @push(ptr noundef %134, i8 noundef signext %138)
  store ptr %139, ptr %2, align 8, !tbaa !5
  br label %140

140:                                              ; preds = %133, %104
  br label %141

141:                                              ; preds = %140, %62
  br label %142

142:                                              ; preds = %141, %45
  br label %143

143:                                              ; preds = %142
  %144 = load i32, ptr %6, align 4, !tbaa !9
  %145 = add nsw i32 %144, 1
  store i32 %145, ptr %6, align 4, !tbaa !9
  br label %9, !llvm.loop !15

146:                                              ; preds = %16
  br label %147

147:                                              ; preds = %152, %146
  %148 = load ptr, ptr %2, align 8, !tbaa !5
  %149 = call i32 @isEmpty(ptr noundef %148)
  %150 = icmp ne i32 %149, 0
  %151 = xor i1 %150, true
  br i1 %151, label %152, label %162

152:                                              ; preds = %147
  %153 = load ptr, ptr %2, align 8, !tbaa !5
  %154 = call i32 @Top(ptr noundef %153)
  %155 = trunc i32 %154 to i8
  %156 = load i32, ptr %5, align 4, !tbaa !9
  %157 = add nsw i32 %156, 1
  store i32 %157, ptr %5, align 4, !tbaa !9
  %158 = sext i32 %156 to i64
  %159 = getelementptr inbounds [20 x i8], ptr %4, i64 0, i64 %158
  store i8 %155, ptr %159, align 1, !tbaa !11
  %160 = load ptr, ptr %2, align 8, !tbaa !5
  %161 = call ptr @pop(ptr noundef %160)
  store ptr %161, ptr %2, align 8, !tbaa !5
  br label %147, !llvm.loop !16

162:                                              ; preds = %147
  %163 = load i32, ptr %5, align 4, !tbaa !9
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds [20 x i8], ptr %4, i64 0, i64 %164
  store i8 0, ptr %165, align 1, !tbaa !11
  %166 = getelementptr inbounds [20 x i8], ptr %4, i64 0, i64 0
  call void @reverse(ptr noundef %166)
  %167 = call i32 (ptr, ...) @printf(ptr noundef @.str.5)
  %168 = getelementptr inbounds [20 x i8], ptr %4, i64 0, i64 0
  %169 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, ptr noundef %168)
  %170 = call i32 (ptr, ...) @printf(ptr noundef @.str.7)
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 20, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 20, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  ret i32 0
}

; 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) #4

attributes #0 = { nocallback nofree nosync 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 = { "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 willreturn memory(read) "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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!"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 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !13}


; 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.4 = external hidden unnamed_addr constant [30 x i8], align 1
@__const.main.test = external hidden unnamed_addr constant [20 x i8], align 16
@.str.5 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [19 x i8], align 1

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local ptr @push(ptr noundef, i8 noundef signext) 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 @isEmpty(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local ptr @pop(ptr noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
declare dso_local void @reverse(ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = alloca [20 x i8], align 16
  %2 = alloca [20 x i8], align 16
  %3 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %1) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(20) %1, ptr noundef nonnull align 16 dereferenceable(20) @__const.main.test, i64 20, i1 false)
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %2) #5
  call void @reverse(ptr noundef nonnull %1)
  br label %6

.preheader:                                       ; preds = %45
  %4 = call i32 @isEmpty(ptr noundef %.338)
  %.not4473 = icmp eq i32 %4, 0
  br i1 %.not4473, label %.lr.ph76.preheader, label %._crit_edge

.lr.ph76.preheader:                               ; preds = %.preheader
  %5 = sext i32 %.3 to i64
  br label %.lr.ph76

6:                                                ; preds = %0, %45
  %indvars.iv83 = phi i64 [ 0, %0 ], [ %indvars.iv.next84, %45 ]
  %.03471 = phi i32 [ 0, %0 ], [ %.3, %45 ]
  %.03570 = phi ptr [ null, %0 ], [ %.338, %45 ]
  %7 = getelementptr inbounds [20 x i8], ptr %1, i64 0, i64 %indvars.iv83
  %8 = load i8, ptr %7, align 1, !tbaa !5
  %9 = and i8 %8, -33
  %10 = add i8 %9, -65
  %or.cond51 = icmp ult i8 %10, 26
  br i1 %or.cond51, label %11, label %15

11:                                               ; preds = %6
  %12 = sext i32 %.03471 to i64
  %13 = getelementptr inbounds [20 x i8], ptr %2, i64 0, i64 %12
  store i8 %8, ptr %13, align 1, !tbaa !5
  %14 = add nsw i32 %.03471, 1
  br label %45

15:                                               ; preds = %6
  switch i8 %8, label %.preheader52 [
    i8 40, label %20
    i8 41, label %.preheader53
  ]

.preheader53:                                     ; preds = %15
  %16 = call i32 @isEmpty(ptr noundef %.03570)
  %.not4754 = icmp eq i32 %16, 0
  br i1 %.not4754, label %.lr.ph.preheader, label %.critedge

.lr.ph.preheader:                                 ; preds = %.preheader53
  %17 = sext i32 %.03471 to i64
  br label %.lr.ph

.preheader52:                                     ; preds = %15
  %18 = call i32 @isEmpty(ptr noundef %.03570)
  %.not4561 = icmp eq i32 %18, 0
  br i1 %.not4561, label %.lr.ph64.preheader, label %.critedge2

.lr.ph64.preheader:                               ; preds = %.preheader52
  %19 = sext i32 %.03471 to i64
  br label %.lr.ph64

20:                                               ; preds = %15
  %21 = call ptr @push(ptr noundef %.03570, i8 noundef signext 40)
  br label %45

.lr.ph:                                           ; preds = %.lr.ph.preheader, %23
  %indvars.iv = phi i64 [ %17, %.lr.ph.preheader ], [ %indvars.iv.next, %23 ]
  %.13655 = phi ptr [ %.03570, %.lr.ph.preheader ], [ %27, %23 ]
  %22 = call i32 @Top(ptr noundef %.13655)
  %.not48 = icmp eq i32 %22, 40
  br i1 %.not48, label %.critedge.loopexit, label %23

23:                                               ; preds = %.lr.ph
  %24 = call i32 @Top(ptr noundef %.13655)
  %25 = trunc i32 %24 to i8
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %26 = getelementptr inbounds [20 x i8], ptr %2, i64 0, i64 %indvars.iv
  store i8 %25, ptr %26, align 1, !tbaa !5
  %27 = call ptr @pop(ptr noundef %.13655)
  %28 = call i32 @isEmpty(ptr noundef %27)
  %.not47 = icmp eq i32 %28, 0
  br i1 %.not47, label %.lr.ph, label %.critedge.loopexit, !llvm.loop !8

.critedge.loopexit:                               ; preds = %23, %.lr.ph
  %.136.lcssa.ph = phi ptr [ %.13655, %.lr.ph ], [ %27, %23 ]
  %.1.lcssa.ph.in = phi i64 [ %indvars.iv, %.lr.ph ], [ %indvars.iv.next, %23 ]
  %.1.lcssa.ph = trunc i64 %.1.lcssa.ph.in to i32
  br label %.critedge

.critedge:                                        ; preds = %.critedge.loopexit, %.preheader53
  %.136.lcssa = phi ptr [ %.03570, %.preheader53 ], [ %.136.lcssa.ph, %.critedge.loopexit ]
  %.1.lcssa = phi i32 [ %.03471, %.preheader53 ], [ %.1.lcssa.ph, %.critedge.loopexit ]
  %29 = call i32 @isEmpty(ptr noundef %.136.lcssa)
  %.not49 = icmp eq i32 %29, 0
  br i1 %.not49, label %30, label %45

30:                                               ; preds = %.critedge
  %31 = call ptr @pop(ptr noundef %.136.lcssa)
  br label %45

.lr.ph64:                                         ; preds = %.lr.ph64.preheader, %37
  %indvars.iv79 = phi i64 [ %19, %.lr.ph64.preheader ], [ %indvars.iv.next80, %37 ]
  %.23762 = phi ptr [ %.03570, %.lr.ph64.preheader ], [ %41, %37 ]
  %32 = call i32 @Top(ptr noundef %.23762)
  %33 = trunc i32 %32 to i8
  %34 = call i32 @precedence(i8 noundef signext %33)
  %35 = load i8, ptr %7, align 1, !tbaa !5
  %36 = call i32 @precedence(i8 noundef signext %35)
  %.not46 = icmp slt i32 %34, %36
  br i1 %.not46, label %.critedge2.loopexit, label %37

37:                                               ; preds = %.lr.ph64
  %38 = call i32 @Top(ptr noundef %.23762)
  %39 = trunc i32 %38 to i8
  %indvars.iv.next80 = add nsw i64 %indvars.iv79, 1
  %40 = getelementptr inbounds [20 x i8], ptr %2, i64 0, i64 %indvars.iv79
  store i8 %39, ptr %40, align 1, !tbaa !5
  %41 = call ptr @pop(ptr noundef %.23762)
  %42 = call i32 @isEmpty(ptr noundef %41)
  %.not45 = icmp eq i32 %42, 0
  br i1 %.not45, label %.lr.ph64, label %.critedge2.loopexit, !llvm.loop !10

.critedge2.loopexit:                              ; preds = %37, %.lr.ph64
  %.237.lcssa.ph = phi ptr [ %.23762, %.lr.ph64 ], [ %41, %37 ]
  %.2.lcssa.ph.in = phi i64 [ %indvars.iv79, %.lr.ph64 ], [ %indvars.iv.next80, %37 ]
  %.2.lcssa.ph = trunc i64 %.2.lcssa.ph.in to i32
  br label %.critedge2

.critedge2:                                       ; preds = %.critedge2.loopexit, %.preheader52
  %.237.lcssa = phi ptr [ %.03570, %.preheader52 ], [ %.237.lcssa.ph, %.critedge2.loopexit ]
  %.2.lcssa = phi i32 [ %.03471, %.preheader52 ], [ %.2.lcssa.ph, %.critedge2.loopexit ]
  %43 = load i8, ptr %7, align 1, !tbaa !5
  %44 = call ptr @push(ptr noundef %.237.lcssa, i8 noundef signext %43)
  br label %45

45:                                               ; preds = %11, %.critedge2, %30, %.critedge, %20
  %.338 = phi ptr [ %.03570, %11 ], [ %21, %20 ], [ %.136.lcssa, %.critedge ], [ %31, %30 ], [ %44, %.critedge2 ]
  %.3 = phi i32 [ %14, %11 ], [ %.03471, %20 ], [ %.1.lcssa, %.critedge ], [ %.1.lcssa, %30 ], [ %.2.lcssa, %.critedge2 ]
  %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1
  %46 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %1) #6
  %47 = add i64 %46, -1
  %.not.not = icmp ugt i64 %47, %indvars.iv83
  br i1 %.not.not, label %6, label %.preheader, !llvm.loop !11

.lr.ph76:                                         ; preds = %.lr.ph76.preheader, %.lr.ph76
  %indvars.iv87 = phi i64 [ %5, %.lr.ph76.preheader ], [ %indvars.iv.next88, %.lr.ph76 ]
  %.43974 = phi ptr [ %.338, %.lr.ph76.preheader ], [ %51, %.lr.ph76 ]
  %48 = call i32 @Top(ptr noundef %.43974)
  %49 = trunc i32 %48 to i8
  %indvars.iv.next88 = add nsw i64 %indvars.iv87, 1
  %50 = getelementptr inbounds [20 x i8], ptr %2, i64 0, i64 %indvars.iv87
  store i8 %49, ptr %50, align 1, !tbaa !5
  %51 = call ptr @pop(ptr noundef %.43974)
  %52 = call i32 @isEmpty(ptr noundef %51)
  %.not44 = icmp eq i32 %52, 0
  br i1 %.not44, label %.lr.ph76, label %._crit_edge.loopexit, !llvm.loop !12

._crit_edge.loopexit:                             ; preds = %.lr.ph76
  %53 = trunc nsw i64 %indvars.iv.next88 to i32
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader
  %.4.lcssa = phi i32 [ %.3, %.preheader ], [ %53, %._crit_edge.loopexit ]
  %54 = sext i32 %.4.lcssa to i64
  %55 = getelementptr inbounds [20 x i8], ptr %2, i64 0, i64 %54
  store i8 0, ptr %55, align 1, !tbaa !5
  call void @reverse(ptr noundef nonnull %2)
  %56 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5)
  %57 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, ptr noundef nonnull %2)
  %58 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7)
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %1) #5
  ret i32 0
}

; 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) #4

attributes #0 = { mustprogress nocallback nofree nosync 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" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "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 nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !9}
!11 = distinct !{!11, !9}
!12 = distinct !{!12, !9}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass