#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);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(void) {
  int m, n, i, soma = 0, count;
  for (i = 1; i <= 999; i++) {
    scanf("%d%d", &m, &n);
    soma = 0;
    if (n <= 0 || m <= 0) {
      break;
    } else if (n > m) {
      for (count = m; count <= n; count++) {
        printf("%d ", count);
        soma += count;
      }
    } else {
      for (count = n; count <= m; count++) {
        printf("%d ", count);
        soma += count;
      }
    }
    printf("Sum=%d\n", soma);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x1,-0x10(%rbp)
cmpl   $0x3e7,-0x10(%rbp)
jg     1226 <main+0x106>
lea    0xeaf(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1179 <main+0x59>
cmpl   $0x0,-0x8(%rbp)
jg     117e <main+0x5e>
jmp    1226 <main+0x106>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    11c7 <main+0xa7>
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     11c2 <main+0xa2>
mov    -0x18(%rbp),%esi
lea    0xe5f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1190 <main+0x70>
jmp    1204 <main+0xe4>
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11ff <main+0xdf>
mov    -0x18(%rbp),%esi
lea    0xe22(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11cd <main+0xad>
jmp    1204 <main+0xe4>
jmp    1209 <main+0xe9>
mov    -0x14(%rbp),%esi
lea    0xdf6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    $0x1,%r15d
mov    %rsp,%r12
lea    0xeca(%rip),%rbx
jmp    115b <main+0x3b>
nopl   (%rax)
lea    0xec2(%rip),%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
add    $0x1,%r15d
cmp    $0x3e8,%r15d
je     11d1 <main+0xb1>
lea    0xe9e(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %r12,%rdx
call   1040 <scanf@plt>
mov    (%rsp),%r14d
test   %r14d,%r14d
jle    11d1 <main+0xb1>
mov    0x4(%rsp),%r13d
test   %r13d,%r13d
jle    11d1 <main+0xb1>
xor    %ebp,%ebp
cmp    %r13d,%r14d
jbe    11b0 <main+0x90>
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %r13d,%esi
call   1030 <printf@plt>
add    %r13d,%ebp
lea    0x1(%r13),%eax
cmp    (%rsp),%r13d
mov    %eax,%r13d
jl     1190 <main+0x70>
jmp    1140 <main+0x20>
nopl   (%rax)
mov    %rbx,%rdi
mov    %r14d,%esi
call   1030 <printf@plt>
add    %r14d,%ebp
lea    0x1(%r14),%eax
cmp    0x4(%rsp),%r14d
mov    %eax,%r14d
jl     11b0 <main+0x90>
jmp    1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [4 x i8] c"%d \00"
@.str.2 = [8 x i8] c"Sum=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %5
store i32 1, i32* %4
br label %7
7: ; preds = %58, %0
%8 = load i32, i32* %4
%9 = icmp sle i32 %8, 999
br i1 %9, label %10, label %61
10: ; preds = %7
%11 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
store i32 0, i32* %5
%12 = load i32, i32* %3
%13 = icmp sle i32 %12, 0
br i1 %13, label %17, label %14
14: ; preds = %10
%15 = load i32, i32* %2
%16 = icmp sle i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %14, %10
br label %61
18: ; preds = %14
%19 = load i32, i32* %3
%20 = load i32, i32* %2
%21 = icmp sgt i32 %19, %20
br i1 %21, label %22, label %38
22: ; preds = %18
%23 = load i32, i32* %2
store i32 %23, i32* %6
br label %24
24: ; preds = %34, %22
%25 = load i32, i32* %6
%26 = load i32, i32* %3
%27 = icmp sle i32 %25, %26
br i1 %27, label %28, label %37
28: ; preds = %24
%29 = load i32, i32* %6
%30 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %29)
%31 = load i32, i32* %6
%32 = load i32, i32* %5
%33 = add nsw i32 %32, %31
store i32 %33, i32* %5
br label %34
34: ; preds = %28
%35 = load i32, i32* %6
%36 = add nsw i32 %35, 1
store i32 %36, i32* %6
br label %24
37: ; preds = %24
br label %54
38: ; preds = %18
%39 = load i32, i32* %3
store i32 %39, i32* %6
br label %40
40: ; preds = %50, %38
%41 = load i32, i32* %6
%42 = load i32, i32* %2
%43 = icmp sle i32 %41, %42
br i1 %43, label %44, label %53
44: ; preds = %40
%45 = load i32, i32* %6
%46 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %45)
%47 = load i32, i32* %6
%48 = load i32, i32* %5
%49 = add nsw i32 %48, %47
store i32 %49, i32* %5
br label %50
50: ; preds = %44
%51 = load i32, i32* %6
%52 = add nsw i32 %51, 1
store i32 %52, i32* %6
br label %40
53: ; preds = %40
br label %54
54: ; preds = %53, %37
br label %55
55: ; preds = %54
%56 = load i32, i32* %5
%57 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %56)
br label %58
58: ; preds = %55
%59 = load i32, i32* %4
%60 = add nsw i32 %59, 1
store i32 %60, i32* %4
br label %7
61: ; preds = %17, %7
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [4 x i8] c"%d \00"
@.str.2 = [8 x i8] c"Sum=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
br label %5
5: ; preds = %0, %31
%6 = phi i32 [ 1, %0 ], [ %34, %31 ]
%7 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 1
%10 = load i32, i32* %1
%11 = icmp slt i32 %10, 1
%12 = select i1 %9, i1 true, i1 %11
br i1 %12, label %36, label %13
13: ; preds = %5
%14 = icmp ugt i32 %8, %10
br i1 %14, label %15, label %23
15: ; preds = %13, %15
%16 = phi i32 [ %20, %15 ], [ %10, %13 ]
%17 = phi i32 [ %19, %15 ], [ 0, %13 ]
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %16)
%19 = add nsw i32 %16, %17
%20 = add nsw i32 %16, 1
%21 = load i32, i32* %2
%22 = icmp slt i32 %16, %21
br i1 %22, label %15, label %31
23: ; preds = %13, %23
%24 = phi i32 [ %28, %23 ], [ %8, %13 ]
%25 = phi i32 [ %27, %23 ], [ 0, %13 ]
%26 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %24)
%27 = add nsw i32 %24, %25
%28 = add nsw i32 %24, 1
%29 = load i32, i32* %1
%30 = icmp slt i32 %24, %29
br i1 %30, label %23, label %31
31: ; preds = %23, %15
%32 = phi i32 [ %19, %15 ], [ %27, %23 ]
%33 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %32)
%34 = add nuw nsw i32 %6, 1
%35 = icmp eq i32 %34, 1000
br i1 %35, label %36, label %5
36: ; preds = %5, %31
ret i32 0
}