program main
  implicit none

  integer s,a,b,c,d

  read(*,*)s
  a = s/1000
  b = s/100 - a*10
  c = s/10 - a*100 - b*10
  d = s - a*1000 - b*100 - c*10
  
  if ((a == b) .or. (b == c)) then
    write(*,*)"Bad"
    stop
  else if (c == d) then
    write(*,*)"Bad"
    stop
  end if
  write(*,*)"Good"
end program main
; 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"

@_QQcl.1d2b0337397eb42f194337ba7ec97742 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_3914/source.f\00"
@_QQcl.426164 = linkonce constant [3 x i8] c"Bad"
@_QQcl.476F6F64 = linkonce constant [4 x i8] c"Good"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

define void @_QQmain() local_unnamed_addr {
  %1 = alloca i32, align 4
  %2 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.1d2b0337397eb42f194337ba7ec97742, i32 6)
  %3 = call i1 @_FortranAioInputInteger(ptr %2, ptr nonnull %1, i32 4)
  %4 = call i32 @_FortranAioEndIoStatement(ptr %2)
  %5 = load i32, ptr %1, align 4, !tbaa !3
  %6 = sdiv i32 %5, 1000
  %7 = sdiv i32 %5, 100
  %.neg = mul nsw i32 %6, -10
  %8 = add nsw i32 %.neg, %7
  %9 = sdiv i32 %5, 10
  %.neg11 = mul nsw i32 %6, -100
  %10 = add nsw i32 %.neg11, %9
  %.neg12 = mul nsw i32 %8, -10
  %11 = add nsw i32 %10, %.neg12
  %12 = icmp eq i32 %6, %8
  %13 = icmp eq i32 %8, %11
  %14 = or i1 %12, %13
  br i1 %14, label %15, label %20

15:                                               ; preds = %0
  %16 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.1d2b0337397eb42f194337ba7ec97742, i32 13)
  %17 = call i1 @_FortranAioOutputAscii(ptr %16, ptr nonnull @_QQcl.426164, i64 3)
  %18 = call i32 @_FortranAioEndIoStatement(ptr %16)
  %19 = call {} @_FortranAStopStatement(i32 0, i1 false, i1 false)
  unreachable

20:                                               ; preds = %0
  %.neg14 = mul i32 %8, -100
  %.neg13 = mul nsw i32 %6, -1000
  %21 = add i32 %.neg13, %5
  %22 = add i32 %21, %.neg14
  %.neg15 = mul i32 %11, -10
  %23 = add i32 %22, %.neg15
  %24 = icmp eq i32 %11, %23
  br i1 %24, label %25, label %30

25:                                               ; preds = %20
  %26 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.1d2b0337397eb42f194337ba7ec97742, i32 16)
  %27 = call i1 @_FortranAioOutputAscii(ptr %26, ptr nonnull @_QQcl.426164, i64 3)
  %28 = call i32 @_FortranAioEndIoStatement(ptr %26)
  %29 = call {} @_FortranAStopStatement(i32 0, i1 false, i1 false)
  unreachable

30:                                               ; preds = %20
  %31 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.1d2b0337397eb42f194337ba7ec97742, i32 19)
  %32 = call i1 @_FortranAioOutputAscii(ptr %31, ptr nonnull @_QQcl.476F6F64, i64 4)
  %33 = call i32 @_FortranAioEndIoStatement(ptr %31)
  ret void
}

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

declare i1 @_FortranAioInputInteger(ptr, ptr, i32) local_unnamed_addr

declare i32 @_FortranAioEndIoStatement(ptr) local_unnamed_addr

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

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

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

!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"}
