program main

  implicit none

  integer(8) :: i, j , ii, jj
  integer(8) :: ij, k, tmp, jjtmp

  read(*,*) i, j

  if( i > j ) then
    ii = i
    jj = j
  else
    ii = j
    jj = i
  end if

  do
    tmp = int( mod(ii,jj) )
    if( tmp == 0 ) then
      jjtmp = jj
      exit
    end if
    ii = jj
    jj = tmp
  end do

  tmp  = i*j/jjtmp
  !tmp  = int( i*j/jjtmp )
  write( 6, "(1p,I20)") tmp
  !print*, tmp

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.5f23bf2fb5faaa5fd3c80e9710b02a1c = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_2814/source.f\00"
@_QQcl.2831702C49323029 = linkonce constant [8 x i8] c"(1p,I20)"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

define void @_QQmain() local_unnamed_addr {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.5f23bf2fb5faaa5fd3c80e9710b02a1c, i32 8)
  %4 = call i1 @_FortranAioInputInteger(ptr %3, ptr nonnull %1, i32 8)
  %5 = call i1 @_FortranAioInputInteger(ptr %3, ptr nonnull %2, i32 8)
  %6 = call i32 @_FortranAioEndIoStatement(ptr %3)
  %7 = load i64, ptr %1, align 8, !tbaa !3
  %8 = load i64, ptr %2, align 8, !tbaa !3
  %. = call i64 @llvm.smin.i64(i64 %7, i64 %8)
  %.13 = call i64 @llvm.smax.i64(i64 %7, i64 %8)
  br label %9

9:                                                ; preds = %9, %0
  %.08 = phi i64 [ %12, %9 ], [ %., %0 ]
  %.0 = phi i64 [ %.08, %9 ], [ %.13, %0 ]
  %10 = srem i64 %.0, %.08
  %sext = shl i64 %10, 32
  %11 = icmp eq i64 %sext, 0
  %12 = ashr exact i64 %sext, 32
  br i1 %11, label %13, label %9

13:                                               ; preds = %9
  %14 = mul i64 %8, %7
  %15 = sdiv i64 %14, %.08
  %16 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.2831702C49323029, i64 8, ptr null, i32 6, ptr nonnull @_QQcl.5f23bf2fb5faaa5fd3c80e9710b02a1c, i32 30)
  %17 = call i1 @_FortranAioOutputInteger64(ptr %16, i64 %15)
  %18 = call i32 @_FortranAioEndIoStatement(ptr %16)
  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 @_FortranAioBeginExternalFormattedOutput(ptr, i64, ptr, i32, ptr, i32) local_unnamed_addr

declare i1 @_FortranAioOutputInteger64(ptr, i64) local_unnamed_addr

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #0

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #0

attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

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