#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*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int m, n, sum = 0;
  printf("Enter the first number (m): ");
  scanf("%d", &m);
  printf("\nEnter the second nunber (n): ");
  ;
  scanf("%d", &n);
  if (n > m)
    for (++m; m < n; m++)
      sum += m;
  else
    for (++n; n < m; n++)
      sum += n;
  printf("\nSum: %d\n", sum);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb4(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    11af <main+0x8f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11aa <main+0x8a>
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1187 <main+0x67>
jmp    11e0 <main+0xc0>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11db <main+0xbb>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11b8 <main+0x98>
jmp    11e0 <main+0xc0>
mov    -0x10(%rbp),%esi
lea    0xe55(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee3(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xed2(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0x8(%rsp),%esi
mov    0xc(%rsp),%eax
mov    %esi,%ecx
sub    %eax,%ecx
jle    1190 <main+0x70>
mov    %eax,%edx
not    %edx
add    %esi,%edx
add    $0x1,%eax
add    $0xfffffffe,%ecx
imul   %rdx,%rcx
shr    %rcx
imul   %edx,%eax
add    %ecx,%eax
mov    %esi,0xc(%rsp)
mov    %eax,%esi
jmp    11b3 <main+0x93>
lea    0x1(%rsi),%ecx
cmp    %ecx,%eax
cmovle %ecx,%eax
mov    %eax,%edx
sub    %esi,%edx
not    %esi
add    %eax,%esi
add    $0xfffffffe,%edx
imul   %rsi,%rdx
shr    %rdx
imul   %ecx,%esi
add    %edx,%esi
mov    %eax,0x8(%rsp)
lea    0xe85(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Enter the first number (m): \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [31 x i8] c"\0AEnter the second nunber (n): \00"
@.str.3 = [10 x i8] c"\0ASum: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%9 = load i32, i32* %3
%10 = load i32, i32* %2
%11 = icmp sgt i32 %9, %10
br i1 %11, label %12, label %27
12: ; preds = %0
%13 = load i32, i32* %2
%14 = add nsw i32 %13, 1
store i32 %14, i32* %2
br label %15
15: ; preds = %23, %12
%16 = load i32, i32* %2
%17 = load i32, i32* %3
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %26
19: ; preds = %15
%20 = load i32, i32* %2
%21 = load i32, i32* %4
%22 = add nsw i32 %21, %20
store i32 %22, i32* %4
br label %23
23: ; preds = %19
%24 = load i32, i32* %2
%25 = add nsw i32 %24, 1
store i32 %25, i32* %2
br label %15
26: ; preds = %15
br label %42
27: ; preds = %0
%28 = load i32, i32* %3
%29 = add nsw i32 %28, 1
store i32 %29, i32* %3
br label %30
30: ; preds = %38, %27
%31 = load i32, i32* %3
%32 = load i32, i32* %2
%33 = icmp slt i32 %31, %32
br i1 %33, label %34, label %41
34: ; preds = %30
%35 = load i32, i32* %3
%36 = load i32, i32* %4
%37 = add nsw i32 %36, %35
store i32 %37, i32* %4
br label %38
38: ; preds = %34
%39 = load i32, i32* %3
%40 = add nsw i32 %39, 1
store i32 %40, i32* %3
br label %30
41: ; preds = %30
br label %42
42: ; preds = %41, %26
%43 = load i32, i32* %4
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 %43)
%45 = load i32, i32* %1
ret i32 %45
}

LLVM IR (-O2):
@.str = [29 x i8] c"Enter the first number (m): \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [31 x i8] c"\0AEnter the second nunber (n): \00"
@.str.3 = [10 x i8] c"\0ASum: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%9 = load i32, i32* %2
%10 = load i32, i32* %1
%11 = icmp sgt i32 %9, %10
br i1 %11, label %26, label %12
12: ; preds = %0
%13 = add i32 %9, 1
%14 = call i32 @llvm.smax.i32(i32 %10, i32 %13)
%15 = xor i32 %9, -1
%16 = add i32 %14, %15
%17 = zext i32 %16 to i33
%18 = add i32 %14, -2
%19 = sub i32 %18, %9
%20 = zext i32 %19 to i33
%21 = mul i33 %17, %20
%22 = lshr i33 %21, 1
%23 = trunc i33 %22 to i32
%24 = mul i32 %16, %13
%25 = add i32 %24, %23
store i32 %14, i32* %2
br label %39
26: ; preds = %0
%27 = xor i32 %10, -1
%28 = add i32 %9, %27
%29 = add nsw i32 %10, 1
%30 = zext i32 %28 to i33
%31 = add i32 %9, -2
%32 = sub i32 %31, %10
%33 = zext i32 %32 to i33
%34 = mul i33 %30, %33
%35 = lshr i33 %34, 1
%36 = trunc i33 %35 to i32
%37 = mul i32 %28, %29
%38 = add i32 %37, %36
store i32 %9, i32* %1
br label %39
39: ; preds = %12, %26
%40 = phi i32 [ %38, %26 ], [ %25, %12 ]
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 %40)
ret i32 0
}