#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)
    do {
      sum += ++m;
    } while (m < n - 1);
  else
    do {
      sum += ++n;
    } while (n < m - 1);
  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)
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jl     1183 <main+0x63>
jmp    11d2 <main+0xb2>
jmp    11ad <main+0x8d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jl     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),%eax
mov    0xc(%rsp),%ecx
cmp    %ecx,%eax
jle    119d <main+0x7d>
add    $0xffffffff,%eax
lea    0x1(%rcx),%edx
cmp    %edx,%eax
cmovle %edx,%eax
mov    %ecx,%edx
not    %edx
add    %eax,%edx
lea    0x2(%rcx),%edi
imul   %edx,%edi
add    %ecx,%edi
mov    %eax,%esi
sub    %ecx,%esi
add    $0xfffffffe,%esi
imul   %rdx,%rsi
shr    %rsi
add    %edi,%esi
mov    %eax,0xc(%rsp)
jmp    11ca <main+0xaa>
add    $0xffffffff,%ecx
lea    0x1(%rax),%edx
cmp    %edx,%ecx
cmovle %edx,%ecx
mov    %eax,%edx
not    %edx
add    %ecx,%edx
lea    0x2(%rax),%edi
imul   %edx,%edi
add    %eax,%edi
mov    %ecx,%esi
sub    %eax,%esi
add    $0xfffffffe,%esi
imul   %rdx,%rsi
shr    %rsi
add    %edi,%esi
mov    %ecx,0x8(%rsp)
add    $0x1,%esi
lea    0xe6b(%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 %24
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* %4
%17 = add nsw i32 %16, %15
store i32 %17, i32* %4
br label %18
18: ; preds = %13
%19 = load i32, i32* %2
%20 = load i32, i32* %3
%21 = sub nsw i32 %20, 1
%22 = icmp slt i32 %19, %21
br i1 %22, label %13, label %23
23: ; preds = %18
br label %36
24: ; preds = %0
br label %25
25: ; preds = %30, %24
%26 = load i32, i32* %3
%27 = add nsw i32 %26, 1
store i32 %27, i32* %3
%28 = load i32, i32* %4
%29 = add nsw i32 %28, %27
store i32 %29, i32* %4
br label %30
30: ; preds = %25
%31 = load i32, i32* %3
%32 = load i32, i32* %2
%33 = sub nsw i32 %32, 1
%34 = icmp slt i32 %31, %33
br i1 %34, label %25, label %35
35: ; preds = %30
br label %36
36: ; preds = %35, %23
%37 = load i32, i32* %4
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 %37)
%39 = load i32, i32* %1
ret i32 %39
}

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 %29, label %12
12: ; preds = %0
%13 = add i32 %10, -1
%14 = add i32 %9, 1
%15 = call i32 @llvm.smax.i32(i32 %13, i32 %14)
%16 = xor i32 %9, -1
%17 = add i32 %15, %16
%18 = add i32 %9, 2
%19 = mul i32 %17, %18
%20 = add i32 %9, %19
%21 = zext i32 %17 to i33
%22 = add i32 %15, -2
%23 = sub i32 %22, %9
%24 = zext i32 %23 to i33
%25 = mul i33 %21, %24
%26 = lshr i33 %25, 1
%27 = trunc i33 %26 to i32
%28 = add i32 %20, %27
store i32 %15, i32* %2
br label %46
29: ; preds = %0
%30 = add nsw i32 %9, -1
%31 = add nsw i32 %10, 1
%32 = call i32 @llvm.smax.i32(i32 %30, i32 %31)
%33 = xor i32 %10, -1
%34 = add i32 %32, %33
%35 = add i32 %10, 2
%36 = mul i32 %34, %35
%37 = add i32 %10, %36
%38 = zext i32 %34 to i33
%39 = add i32 %32, -2
%40 = sub i32 %39, %10
%41 = zext i32 %40 to i33
%42 = mul i33 %38, %41
%43 = lshr i33 %42, 1
%44 = trunc i33 %43 to i32
%45 = add i32 %37, %44
store i32 %32, i32* %1
br label %46
46: ; preds = %12, %29
%47 = phi i32 [ %45, %29 ], [ %28, %12 ]
%48 = add i32 %47, 1
%49 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 %48)
ret i32 0
}