program prob1
    implicit none
    character(len=107)::a,b
    integer::la, lb, i
    read(*,*) a,b
    la = len_trim(a)
    lb = len_trim(b)
    if(la > lb) then
        write(*,'(a)') "GREATER"
        stop
    else if(la < lb) then
        write(*,'(a)') "LESS"
        stop
    else
        do i = 1, la
            if(a(i:i) > b(i:i)) then
                write(*,'(a)') 'GREATER'
                stop
            else if(a(i:i) < b(i:i)) then
                write(*,'(a)') "LESS"
                stop
            end if
        end do
    end if
    write(*,'(a)') 'EQUAL'
    stop
end program
; ModuleID = 'FIRModule'
source_filename = "FIRModule"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"

@_QFEa = internal global [107 x i8] undef
@_QFEb = internal global [107 x i8] undef
@_QQcl.fe754ecb995e8068bcd4227b768006e0 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_7364/source.f\00"
@_QQcl.286129 = linkonce constant [3 x i8] c"(a)"
@_QQcl.47524541544552 = linkonce constant [7 x i8] c"GREATER"
@_QQcl.4C455353 = linkonce constant [4 x i8] c"LESS"
@_QQcl.455155414C = linkonce constant [5 x i8] c"EQUAL"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

; Function Attrs: noreturn
define void @_QQmain() local_unnamed_addr #0 {
  %1 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.fe754ecb995e8068bcd4227b768006e0, i32 5)
  %2 = tail call i1 @_FortranAioInputAscii(ptr %1, ptr nonnull @_QFEa, i64 107)
  %3 = tail call i1 @_FortranAioInputAscii(ptr %1, ptr nonnull @_QFEb, i64 107)
  %4 = tail call i32 @_FortranAioEndIoStatement(ptr %1)
  br label %5

5:                                                ; preds = %0, %5
  %6 = phi i64 [ 106, %0 ], [ %10, %5 ]
  %7 = getelementptr [107 x [1 x i8]], ptr @_QFEa, i64 0, i64 %6
  %8 = load i8, ptr %7, align 1, !tbaa !3
  %9 = icmp eq i8 %8, 32
  %10 = add nsw i64 %6, -1
  %11 = icmp ne i64 %6, 0
  %12 = and i1 %9, %11
  br i1 %12, label %5, label %13

13:                                               ; preds = %5
  %14 = trunc i64 %6 to i32
  %15 = add i32 %14, 1
  br label %16

16:                                               ; preds = %13, %16
  %17 = phi i64 [ 106, %13 ], [ %21, %16 ]
  %18 = getelementptr [107 x [1 x i8]], ptr @_QFEb, i64 0, i64 %17
  %19 = load i8, ptr %18, align 1, !tbaa !3
  %20 = icmp eq i8 %19, 32
  %21 = add nsw i64 %17, -1
  %22 = icmp ne i64 %17, 0
  %23 = and i1 %20, %22
  br i1 %23, label %16, label %24

24:                                               ; preds = %16
  %25 = select i1 %9, i32 0, i32 %15
  %26 = trunc i64 %17 to i32
  %27 = add i32 %26, 1
  %28 = select i1 %20, i32 0, i32 %27
  %29 = icmp sgt i32 %25, %28
  br i1 %29, label %30, label %35

30:                                               ; preds = %24
  %31 = tail call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.286129, i64 3, ptr null, i32 -1, ptr nonnull @_QQcl.fe754ecb995e8068bcd4227b768006e0, i32 9)
  %32 = tail call i1 @_FortranAioOutputAscii(ptr %31, ptr nonnull @_QQcl.47524541544552, i64 7)
  %33 = tail call i32 @_FortranAioEndIoStatement(ptr %31)
  %34 = tail call {} @_FortranAStopStatement(i32 0, i1 false, i1 false)
  unreachable

35:                                               ; preds = %24
  %36 = icmp slt i32 %25, %28
  br i1 %36, label %39, label %.preheader

.preheader:                                       ; preds = %35
  %37 = icmp sgt i32 %25, 0
  br i1 %37, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %.preheader
  %38 = add nuw i32 %25, 1
  %wide.trip.count = zext i32 %38 to i64
  br label %.lr.ph

39:                                               ; preds = %35
  %40 = tail call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.286129, i64 3, ptr null, i32 -1, ptr nonnull @_QQcl.fe754ecb995e8068bcd4227b768006e0, i32 12)
  %41 = tail call i1 @_FortranAioOutputAscii(ptr %40, ptr nonnull @_QQcl.4C455353, i64 4)
  %42 = tail call i32 @_FortranAioEndIoStatement(ptr %40)
  %43 = tail call {} @_FortranAStopStatement(i32 0, i1 false, i1 false)
  unreachable

.lr.ph:                                           ; preds = %.lr.ph.preheader, %62
  %indvars.iv = phi i64 [ 1, %.lr.ph.preheader ], [ %indvars.iv.next, %62 ]
  %44 = add nsw i64 %indvars.iv, -1
  %45 = getelementptr [107 x [1 x i8]], ptr @_QFEa, i64 0, i64 %44
  %46 = getelementptr [107 x [1 x i8]], ptr @_QFEb, i64 0, i64 %44
  %47 = tail call i32 @_FortranACharacterCompareScalar1(ptr %45, ptr %46, i64 1, i64 1)
  %48 = icmp sgt i32 %47, 0
  br i1 %48, label %49, label %54

49:                                               ; preds = %.lr.ph
  %50 = tail call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.286129, i64 3, ptr null, i32 -1, ptr nonnull @_QQcl.fe754ecb995e8068bcd4227b768006e0, i32 17)
  %51 = tail call i1 @_FortranAioOutputAscii(ptr %50, ptr nonnull @_QQcl.47524541544552, i64 7)
  %52 = tail call i32 @_FortranAioEndIoStatement(ptr %50)
  %53 = tail call {} @_FortranAStopStatement(i32 0, i1 false, i1 false)
  unreachable

54:                                               ; preds = %.lr.ph
  %55 = tail call i32 @_FortranACharacterCompareScalar1(ptr %45, ptr %46, i64 1, i64 1)
  %56 = icmp slt i32 %55, 0
  br i1 %56, label %57, label %62

57:                                               ; preds = %54
  %58 = tail call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.286129, i64 3, ptr null, i32 -1, ptr nonnull @_QQcl.fe754ecb995e8068bcd4227b768006e0, i32 20)
  %59 = tail call i1 @_FortranAioOutputAscii(ptr %58, ptr nonnull @_QQcl.4C455353, i64 4)
  %60 = tail call i32 @_FortranAioEndIoStatement(ptr %58)
  %61 = tail call {} @_FortranAStopStatement(i32 0, i1 false, i1 false)
  unreachable

62:                                               ; preds = %54
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %62, %.preheader
  %63 = tail call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.286129, i64 3, ptr null, i32 -1, ptr nonnull @_QQcl.fe754ecb995e8068bcd4227b768006e0, i32 25)
  %64 = tail call i1 @_FortranAioOutputAscii(ptr %63, ptr nonnull @_QQcl.455155414C, i64 5)
  %65 = tail call i32 @_FortranAioEndIoStatement(ptr %63)
  %66 = tail call {} @_FortranAStopStatement(i32 0, i1 false, i1 false)
  unreachable
}

declare ptr @_FortranAioBeginExternalListInput(i32, ptr, i32) local_unnamed_addr

declare i1 @_FortranAioInputAscii(ptr, ptr, i64) local_unnamed_addr

declare i32 @_FortranAioEndIoStatement(ptr) local_unnamed_addr

declare ptr @_FortranAioBeginExternalFormattedOutput(ptr, i64, ptr, i32, ptr, i32) local_unnamed_addr

declare i1 @_FortranAioOutputAscii(ptr, ptr, i64) local_unnamed_addr

declare {} @_FortranAStopStatement(i32, i1, i1) local_unnamed_addr

declare i32 @_FortranACharacterCompareScalar1(ptr, ptr, i64, i64) local_unnamed_addr

attributes #0 = { noreturn }

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

!0 = !{i32 2, !"Debug Info Version", i32 3}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{!4, !4, i64 0}
!4 = !{!"any data access", !5, i64 0}
!5 = !{!"any access", !6, i64 0}
!6 = !{!"Flang Type TBAA Root"}
