#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ allPrimeFactorsFromNtoN(unsigned int, unsigned int,
                                           unsigned int *);
unsigned int intPow(int, unsigned int);
unsigned leastCommonMultipleFromNtoN(unsigned lowerBound, unsigned upperBound) {
  unsigned totalFactorCount[upperBound + 1];
  for (int i = 2; i <= upperBound; ++i)
    totalFactorCount[i] = 0;
  allPrimeFactorsFromNtoN(lowerBound, upperBound, totalFactorCount);
  unsigned leastCommonMultiple = 1;
  for (int i = 2; i <= upperBound; ++i) {
    leastCommonMultiple *= intPow(i, totalFactorCount[i]);
  }
  return leastCommonMultiple;
}


x86 assembly (clang, -O0):
<leastCommonMultipleFromNtoN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x30(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x18(%rbp)
movl   $0x2,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
ja     1188 <leastCommonMultipleFromNtoN+0x68>
mov    -0x30(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    115f <leastCommonMultipleFromNtoN+0x3f>
mov    -0x30(%rbp),%rdx
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <allPrimeFactorsFromNtoN@plt>
movl   $0x1,-0x20(%rbp)
movl   $0x2,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x8(%rbp),%eax
ja     11d9 <leastCommonMultipleFromNtoN+0xb9>
mov    -0x30(%rbp),%rax
mov    -0x24(%rbp),%edi
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
call   1040 <intPow@plt>
imul   -0x20(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11a5 <leastCommonMultipleFromNtoN+0x85>
mov    -0x20(%rbp),%eax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<leastCommonMultipleFromNtoN>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %edi,%r15d
lea    0x1(%r14),%r13d
mov    %rsp,%r12
lea    0xf(,%r13,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r12
mov    %r12,%rsp
cmp    $0x1,%esi
ja     1178 <leastCommonMultipleFromNtoN+0x48>
mov    %r15d,%edi
mov    %r14d,%esi
mov    %r12,%rdx
call   1040 <allPrimeFactorsFromNtoN@plt>
mov    $0x1,%r14d
jmp    11c8 <leastCommonMultipleFromNtoN+0x98>
lea    0x8(%r12),%rdi
lea    -0x2(%r14),%eax
lea    0x4(,%rax,4),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    %r15d,%edi
mov    %r14d,%esi
mov    %r12,%rdx
call   1040 <allPrimeFactorsFromNtoN@plt>
mov    $0x1,%r14d
mov    $0x2,%ebx
nopl   0x0(%rax)
mov    (%r12,%rbx,4),%esi
mov    %ebx,%edi
call   1050 <intPow@plt>
imul   %eax,%r14d
add    $0x1,%rbx
cmp    %rbx,%r13
jne    11b0 <leastCommonMultipleFromNtoN+0x80>
mov    %r14d,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @leastCommonMultipleFromNtoN(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%10 = load i32, i32* %4
%11 = add i32 %10, 1
%12 = zext i32 %11 to i64
%13 = call i8* @llvm.stacksave()
store i8* %13, i8** %5
%14 = alloca i32, i64 %12
store i64 %12, i64* %6
store i32 2, i32* %7
br label %15
15: ; preds = %23, %2
%16 = load i32, i32* %7
%17 = load i32, i32* %4
%18 = icmp ule i32 %16, %17
br i1 %18, label %19, label %26
19: ; preds = %15
%20 = load i32, i32* %7
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i32, i32* %14, i64 %21
store i32 0, i32* %22
br label %23
23: ; preds = %19
%24 = load i32, i32* %7
%25 = add nsw i32 %24, 1
store i32 %25, i32* %7
br label %15
26: ; preds = %15
%27 = load i32, i32* %3
%28 = load i32, i32* %4
%29 = call i32 @allPrimeFactorsFromNtoN(i32 %27, i32 %28, i32* %14)
store i32 1, i32* %8
store i32 2, i32* %9
br label %30
30: ; preds = %43, %26
%31 = load i32, i32* %9
%32 = load i32, i32* %4
%33 = icmp ule i32 %31, %32
br i1 %33, label %34, label %46
34: ; preds = %30
%35 = load i32, i32* %9
%36 = load i32, i32* %9
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds i32, i32* %14, i64 %37
%39 = load i32, i32* %38
%40 = call i32 @intPow(i32 %35, i32 %39)
%41 = load i32, i32* %8
%42 = mul i32 %41, %40
store i32 %42, i32* %8
br label %43
43: ; preds = %34
%44 = load i32, i32* %9
%45 = add nsw i32 %44, 1
store i32 %45, i32* %9
br label %30
46: ; preds = %30
%47 = load i32, i32* %8
%48 = load i8*, i8** %5
ret i32 %47
}

LLVM IR (-O2):
define i32 @leastCommonMultipleFromNtoN(i32 %0, i32 %1) {
%3 = add i32 %1, 1
%4 = zext i32 %3 to i64
%5 = alloca i32, i64 %4
%6 = icmp ult i32 %1, 2
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 @allPrimeFactorsFromNtoN(i32 %0, i32 %1, i32* %5)
br label %17
9: ; preds = %2
%10 = getelementptr i32, i32* %5, i64 2
%11 = bitcast i32* %10 to i8*
%12 = add i32 %1, -2
%13 = zext i32 %12 to i64
%14 = shl nuw nsw i64 %13, 2
%15 = add nuw nsw i64 %14, 4
%16 = call i32 @allPrimeFactorsFromNtoN(i32 %0, i32 %1, i32* %5)
br label %19
17: ; preds = %19, %7
%18 = phi i32 [ 1, %7 ], [ %26, %19 ]
ret i32 %18
19: ; preds = %9, %19
%20 = phi i64 [ 2, %9 ], [ %27, %19 ]
%21 = phi i32 [ 1, %9 ], [ %26, %19 ]
%22 = getelementptr inbounds i32, i32* %5, i64 %20
%23 = load i32, i32* %22
%24 = trunc i64 %20 to i32
%25 = call i32 @intPow(i32 %24, i32 %23)
%26 = mul i32 %25, %21
%27 = add nuw nsw i64 %20, 1
%28 = icmp eq i64 %27, %4
br i1 %28, label %17, label %19
}