; LLVM IR from unitreerobotics/kinect_teleoperate :: src/extern/glfw/src/examples (boing)

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

@glad_glBegin = external dso_local global ptr, align 8
@glad_glColor3f = external dso_local global ptr, align 8
@glad_glDisable = external dso_local global ptr, align 8
@glad_glEnd = external dso_local global ptr, align 8
@glad_glPopMatrix = external dso_local global ptr, align 8
@glad_glPushMatrix = external dso_local global ptr, align 8
@glad_glTranslatef = external dso_local global ptr, align 8
@glad_glVertex3f = external dso_local global ptr, align 8

; 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 speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #1

; Function Attrs: nounwind uwtable
define dso_local void @DrawGrid() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca float, align 4
  %6 = alloca float, align 4
  %7 = alloca float, align 4
  %8 = alloca float, align 4
  %9 = alloca float, align 4
  %10 = alloca float, align 4
  %11 = alloca float, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  store i32 12, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  store i32 12, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  store float 2.000000e+00, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  store float 2.625000e+01, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  store float -4.000000e+01, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  %12 = load ptr, ptr @glad_glPushMatrix, align 8, !tbaa !11
  call void %12()
  %13 = load ptr, ptr @glad_glDisable, align 8, !tbaa !11
  call void %13(i32 noundef 2884)
  %14 = load ptr, ptr @glad_glTranslatef, align 8, !tbaa !11
  call void %14(float noundef 0.000000e+00, float noundef 0.000000e+00, float noundef 1.470000e+02)
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %15

15:                                               ; preds = %39, %0
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %17 = icmp sle i32 %16, 12
  br i1 %17, label %18, label %42

18:                                               ; preds = %15
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = sitofp i32 %19 to float
  %21 = call float @llvm.fmuladd.f32(float %20, float 2.625000e+01, float -1.575000e+02)
  store float %21, ptr %8, align 4, !tbaa !9
  %22 = load float, ptr %8, align 4, !tbaa !9
  %23 = fadd float %22, 2.000000e+00
  store float %23, ptr %9, align 4, !tbaa !9
  store float 1.575000e+02, ptr %10, align 4, !tbaa !9
  store float -1.595000e+02, ptr %11, align 4, !tbaa !9
  %24 = load ptr, ptr @glad_glBegin, align 8, !tbaa !11
  call void %24(i32 noundef 9)
  %25 = load ptr, ptr @glad_glColor3f, align 8, !tbaa !11
  call void %25(float noundef 0x3FE3333340000000, float noundef 0x3FB99999A0000000, float noundef 0x3FE3333340000000)
  %26 = load ptr, ptr @glad_glVertex3f, align 8, !tbaa !11
  %27 = load float, ptr %9, align 4, !tbaa !9
  %28 = load float, ptr %10, align 4, !tbaa !9
  call void %26(float noundef %27, float noundef %28, float noundef -4.000000e+01)
  %29 = load ptr, ptr @glad_glVertex3f, align 8, !tbaa !11
  %30 = load float, ptr %8, align 4, !tbaa !9
  %31 = load float, ptr %10, align 4, !tbaa !9
  call void %29(float noundef %30, float noundef %31, float noundef -4.000000e+01)
  %32 = load ptr, ptr @glad_glVertex3f, align 8, !tbaa !11
  %33 = load float, ptr %8, align 4, !tbaa !9
  %34 = load float, ptr %11, align 4, !tbaa !9
  call void %32(float noundef %33, float noundef %34, float noundef -4.000000e+01)
  %35 = load ptr, ptr @glad_glVertex3f, align 8, !tbaa !11
  %36 = load float, ptr %9, align 4, !tbaa !9
  %37 = load float, ptr %11, align 4, !tbaa !9
  call void %35(float noundef %36, float noundef %37, float noundef -4.000000e+01)
  %38 = load ptr, ptr @glad_glEnd, align 8, !tbaa !11
  call void %38()
  br label %39

39:                                               ; preds = %18
  %40 = load i32, ptr %2, align 4, !tbaa !5
  %41 = add nsw i32 %40, 1
  store i32 %41, ptr %2, align 4, !tbaa !5
  br label %15, !llvm.loop !13

42:                                               ; preds = %15
  store i32 0, ptr %1, align 4, !tbaa !5
  br label %43

43:                                               ; preds = %68, %42
  %44 = load i32, ptr %1, align 4, !tbaa !5
  %45 = icmp sle i32 %44, 12
  br i1 %45, label %46, label %71

46:                                               ; preds = %43
  %47 = load i32, ptr %1, align 4, !tbaa !5
  %48 = sitofp i32 %47 to float
  %49 = fneg float %48
  %50 = call float @llvm.fmuladd.f32(float %49, float 2.625000e+01, float 1.575000e+02)
  store float %50, ptr %10, align 4, !tbaa !9
  %51 = load float, ptr %10, align 4, !tbaa !9
  %52 = fsub float %51, 2.000000e+00
  store float %52, ptr %11, align 4, !tbaa !9
  store float -1.575000e+02, ptr %8, align 4, !tbaa !9
  store float 1.595000e+02, ptr %9, align 4, !tbaa !9
  %53 = load ptr, ptr @glad_glBegin, align 8, !tbaa !11
  call void %53(i32 noundef 9)
  %54 = load ptr, ptr @glad_glColor3f, align 8, !tbaa !11
  call void %54(float noundef 0x3FE3333340000000, float noundef 0x3FB99999A0000000, float noundef 0x3FE3333340000000)
  %55 = load ptr, ptr @glad_glVertex3f, align 8, !tbaa !11
  %56 = load float, ptr %9, align 4, !tbaa !9
  %57 = load float, ptr %10, align 4, !tbaa !9
  call void %55(float noundef %56, float noundef %57, float noundef -4.000000e+01)
  %58 = load ptr, ptr @glad_glVertex3f, align 8, !tbaa !11
  %59 = load float, ptr %8, align 4, !tbaa !9
  %60 = load float, ptr %10, align 4, !tbaa !9
  call void %58(float noundef %59, float noundef %60, float noundef -4.000000e+01)
  %61 = load ptr, ptr @glad_glVertex3f, align 8, !tbaa !11
  %62 = load float, ptr %8, align 4, !tbaa !9
  %63 = load float, ptr %11, align 4, !tbaa !9
  call void %61(float noundef %62, float noundef %63, float noundef -4.000000e+01)
  %64 = load ptr, ptr @glad_glVertex3f, align 8, !tbaa !11
  %65 = load float, ptr %9, align 4, !tbaa !9
  %66 = load float, ptr %11, align 4, !tbaa !9
  call void %64(float noundef %65, float noundef %66, float noundef -4.000000e+01)
  %67 = load ptr, ptr @glad_glEnd, align 8, !tbaa !11
  call void %67()
  br label %68

68:                                               ; preds = %46
  %69 = load i32, ptr %1, align 4, !tbaa !5
  %70 = add nsw i32 %69, 1
  store i32 %70, ptr %1, align 4, !tbaa !5
  br label %43, !llvm.loop !15

71:                                               ; preds = %43
  %72 = load ptr, ptr @glad_glPopMatrix, align 8, !tbaa !11
  call void %72()
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #3
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { 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 #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 = !{!10, !10, i64 0}
!10 = !{!"float", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}


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

@glad_glBegin = external dso_local local_unnamed_addr global ptr, align 8
@glad_glColor3f = external dso_local local_unnamed_addr global ptr, align 8
@glad_glDisable = external dso_local local_unnamed_addr global ptr, align 8
@glad_glEnd = external dso_local local_unnamed_addr global ptr, align 8
@glad_glPopMatrix = external dso_local local_unnamed_addr global ptr, align 8
@glad_glPushMatrix = external dso_local local_unnamed_addr global ptr, align 8
@glad_glTranslatef = external dso_local local_unnamed_addr global ptr, align 8
@glad_glVertex3f = external dso_local local_unnamed_addr global ptr, align 8

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #0

; Function Attrs: nounwind uwtable
define dso_local void @DrawGrid() local_unnamed_addr #1 {
  %1 = load ptr, ptr @glad_glPushMatrix, align 8, !tbaa !5
  tail call void %1() #2
  %2 = load ptr, ptr @glad_glDisable, align 8, !tbaa !5
  tail call void %2(i32 noundef 2884) #2
  %3 = load ptr, ptr @glad_glTranslatef, align 8, !tbaa !5
  tail call void %3(float noundef 0.000000e+00, float noundef 0.000000e+00, float noundef 1.470000e+02) #2
  br label %4

4:                                                ; preds = %0, %4
  %.02324 = phi i32 [ 0, %0 ], [ %15, %4 ]
  %5 = uitofp nneg i32 %.02324 to float
  %6 = tail call float @llvm.fmuladd.f32(float %5, float 2.625000e+01, float -1.575000e+02)
  %7 = fadd float %6, 2.000000e+00
  %8 = load ptr, ptr @glad_glBegin, align 8, !tbaa !5
  tail call void %8(i32 noundef 9) #2
  %9 = load ptr, ptr @glad_glColor3f, align 8, !tbaa !5
  tail call void %9(float noundef 0x3FE3333340000000, float noundef 0x3FB99999A0000000, float noundef 0x3FE3333340000000) #2
  %10 = load ptr, ptr @glad_glVertex3f, align 8, !tbaa !5
  tail call void %10(float noundef %7, float noundef 1.575000e+02, float noundef -4.000000e+01) #2
  %11 = load ptr, ptr @glad_glVertex3f, align 8, !tbaa !5
  tail call void %11(float noundef %6, float noundef 1.575000e+02, float noundef -4.000000e+01) #2
  %12 = load ptr, ptr @glad_glVertex3f, align 8, !tbaa !5
  tail call void %12(float noundef %6, float noundef -1.595000e+02, float noundef -4.000000e+01) #2
  %13 = load ptr, ptr @glad_glVertex3f, align 8, !tbaa !5
  tail call void %13(float noundef %7, float noundef -1.595000e+02, float noundef -4.000000e+01) #2
  %14 = load ptr, ptr @glad_glEnd, align 8, !tbaa !5
  tail call void %14() #2
  %15 = add nuw nsw i32 %.02324, 1
  %exitcond.not = icmp eq i32 %15, 13
  br i1 %exitcond.not, label %.preheader, label %4, !llvm.loop !9

.preheader:                                       ; preds = %4, %.preheader
  %.025 = phi i32 [ %27, %.preheader ], [ 0, %4 ]
  %16 = uitofp nneg i32 %.025 to float
  %17 = fneg float %16
  %18 = tail call float @llvm.fmuladd.f32(float %17, float 2.625000e+01, float 1.575000e+02)
  %19 = fadd float %18, -2.000000e+00
  %20 = load ptr, ptr @glad_glBegin, align 8, !tbaa !5
  tail call void %20(i32 noundef 9) #2
  %21 = load ptr, ptr @glad_glColor3f, align 8, !tbaa !5
  tail call void %21(float noundef 0x3FE3333340000000, float noundef 0x3FB99999A0000000, float noundef 0x3FE3333340000000) #2
  %22 = load ptr, ptr @glad_glVertex3f, align 8, !tbaa !5
  tail call void %22(float noundef 1.595000e+02, float noundef %18, float noundef -4.000000e+01) #2
  %23 = load ptr, ptr @glad_glVertex3f, align 8, !tbaa !5
  tail call void %23(float noundef -1.575000e+02, float noundef %18, float noundef -4.000000e+01) #2
  %24 = load ptr, ptr @glad_glVertex3f, align 8, !tbaa !5
  tail call void %24(float noundef -1.575000e+02, float noundef %19, float noundef -4.000000e+01) #2
  %25 = load ptr, ptr @glad_glVertex3f, align 8, !tbaa !5
  tail call void %25(float noundef 1.595000e+02, float noundef %19, float noundef -4.000000e+01) #2
  %26 = load ptr, ptr @glad_glEnd, align 8, !tbaa !5
  tail call void %26() #2
  %27 = add nuw nsw i32 %.025, 1
  %exitcond26.not = icmp eq i32 %27, 13
  br i1 %exitcond26.not, label %28, label %.preheader, !llvm.loop !11

28:                                               ; preds = %.preheader
  %29 = load ptr, ptr @glad_glPopMatrix, align 8, !tbaa !5
  tail call void %29() #2
  ret void
}

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


; Effective O3 passes: GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass