#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)
    while (++m < n)
      sum += m;
  else
    while (++n < m)
      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    11a8 <main+0x88>
jmp    1183 <main+0x63>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmp    -0xc(%rbp),%eax
jge    11a3 <main+0x83>
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1183 <main+0x63>
jmp    11d2 <main+0xb2>
jmp    11ad <main+0x8d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmp    -0x8(%rbp),%eax
jge    11cd <main+0xad>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    11ad <main+0x8d>
jmp    11d2 <main+0xb2>
mov    -0x10(%rbp),%esi
lea    0xe63(%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
cmp    %eax,%esi
jle    1195 <main+0x75>
lea    0x1(%rax),%ecx
cmp    %ecx,%esi
cmovle %ecx,%esi
mov    %esi,%edx
sub    %eax,%edx
not    %eax
add    %esi,%eax
add    $0xfffffffe,%edx
imul   %rax,%rdx
shr    %rdx
imul   %ecx,%eax
add    %edx,%eax
mov    %esi,0xc(%rsp)
mov    %eax,%esi
jmp    11b8 <main+0x98>
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    0xe80(%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 %23
12: ; preds = %0
br label %13
13: ; preds = %18, %12
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 1
store i32 %15, i32* %2
%16 = load i32, i32* %3
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %22
18: ; preds = %13
%19 = load i32, i32* %2
%20 = load i32, i32* %4
%21 = add nsw i32 %20, %19
store i32 %21, i32* %4
br label %13
22: ; preds = %13
br label %34
23: ; preds = %0
br label %24
24: ; preds = %29, %23
%25 = load i32, i32* %3
%26 = add nsw i32 %25, 1
store i32 %26, i32* %3
%27 = load i32, i32* %2
%28 = icmp slt i32 %26, %27
br i1 %28, label %29, label %33
29: ; preds = %24
%30 = load i32, i32* %3
%31 = load i32, i32* %4
%32 = add nsw i32 %31, %30
store i32 %32, i32* %4
br label %24
33: ; preds = %24
br label %34
34: ; preds = %33, %22
%35 = load i32, i32* %4
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 %35)
%37 = load i32, i32* %1
ret i32 %37
}

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 %40
26: ; preds = %0
%27 = add nsw i32 %10, 1
%28 = call i32 @llvm.smax.i32(i32 %9, i32 %27)
%29 = xor i32 %10, -1
%30 = add i32 %28, %29
%31 = zext i32 %30 to i33
%32 = add i32 %28, -2
%33 = sub i32 %32, %10
%34 = zext i32 %33 to i33
%35 = mul i33 %31, %34
%36 = lshr i33 %35, 1
%37 = trunc i33 %36 to i32
%38 = mul i32 %30, %27
%39 = add i32 %38, %37
store i32 %28, i32* %1
br label %40
40: ; preds = %12, %26
%41 = phi i32 [ %39, %26 ], [ %25, %12 ]
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 %41)
ret i32 0
}