#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 scanf(char *, int *, int *);
int main(void) {
  int m, n;
  int min, max, soma;
  while (scanf("%d %d\n", &m, &n), m > 0 && n > 0) {
    min = ((m) < (n) ? (m) : (n));
    max = ((m) > (n) ? (m) : (n)) + 1;
    soma = 0;
    while (min < max) {
      printf("%d ", min);
      soma += min++;
    }
    printf("Sum=%d\n", soma);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x19(%rbp)
jle    115c <main+0x3c>
cmpl   $0x0,-0xc(%rbp)
setg   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    116c <main+0x4c>
jmp    1201 <main+0xe1>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1183 <main+0x63>
mov    -0x8(%rbp),%eax
mov    %eax,-0x20(%rbp)
jmp    1189 <main+0x69>
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    11a6 <main+0x86>
mov    -0x8(%rbp),%eax
mov    %eax,-0x24(%rbp)
jmp    11ac <main+0x8c>
mov    -0xc(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11ed <main+0xcd>
mov    -0x10(%rbp),%esi
lea    0xe35(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x10(%rbp)
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    11bc <main+0x9c>
mov    -0x18(%rbp),%esi
lea    0xe14(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xece(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
jle    11d7 <main+0xb7>
mov    (%rsp),%r15d
test   %r15d,%r15d
jle    11d7 <main+0xb7>
lea    0xea8(%rip),%rbx
lea    0x4(%rsp),%r12
mov    %rsp,%r13
nopw   0x0(%rax,%rax,1)
cmp    %r15d,%eax
mov    %r15d,%ebp
cmova  %eax,%r15d
cmovb  %eax,%ebp
add    $0x1,%r15d
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
add    %ebp,%r14d
add    $0x1,%ebp
cmp    %ebp,%r15d
jne    1190 <main+0x70>
lea    0xe5f(%rip),%rdi
mov    %r14d,%esi
call   1030 <printf@plt>
lea    0xe45(%rip),%rdi
mov    %r12,%rsi
mov    %r13,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
jle    11d7 <main+0xb7>
mov    (%rsp),%r15d
test   %r15d,%r15d
jg     1170 <main+0x50>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%d %d\0A\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
br label %7
7: ; preds = %47, %0
%8 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%9 = load i32, i32* %2
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp sgt i32 %12, 0
br label %14
14: ; preds = %11, %7
%15 = phi i1 [ false, %7 ], [ %13, %11 ]
br i1 %15, label %16, label %50
16: ; preds = %14
%17 = load i32, i32* %2
%18 = load i32, i32* %3
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %22
20: ; preds = %16
%21 = load i32, i32* %2
br label %24
22: ; preds = %16
%23 = load i32, i32* %3
br label %24
24: ; preds = %22, %20
%25 = phi i32 [ %21, %20 ], [ %23, %22 ]
store i32 %25, i32* %4
%26 = load i32, i32* %2
%27 = load i32, i32* %3
%28 = icmp sgt i32 %26, %27
br i1 %28, label %29, label %31
29: ; preds = %24
%30 = load i32, i32* %2
br label %33
31: ; preds = %24
%32 = load i32, i32* %3
br label %33
33: ; preds = %31, %29
%34 = phi i32 [ %30, %29 ], [ %32, %31 ]
%35 = add nsw i32 %34, 1
store i32 %35, i32* %5
store i32 0, i32* %6
br label %36
36: ; preds = %40, %33
%37 = load i32, i32* %4
%38 = load i32, i32* %5
%39 = icmp slt i32 %37, %38
br i1 %39, label %40, label %47
40: ; preds = %36
%41 = load i32, i32* %4
%42 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %41)
%43 = load i32, i32* %4
%44 = add nsw i32 %43, 1
store i32 %44, i32* %4
%45 = load i32, i32* %6
%46 = add nsw i32 %45, %43
store i32 %46, i32* %6
br label %36
47: ; preds = %36
%48 = load i32, i32* %6
%49 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %48)
br label %7
50: ; preds = %14
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d %d\0A\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*
%5 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = icmp sgt i32 %6, 0
%8 = load i32, i32* %2
%9 = icmp sgt i32 %8, 0
%10 = select i1 %7, i1 %9, i1 false
br i1 %10, label %11, label %33
11: ; preds = %0, %25
%12 = phi i32 [ %30, %25 ], [ %8, %0 ]
%13 = phi i32 [ %28, %25 ], [ %6, %0 ]
%14 = icmp ult i32 %13, %12
%15 = select i1 %14, i32 %13, i32 %12
%16 = icmp ugt i32 %13, %12
%17 = select i1 %16, i32 %13, i32 %12
br label %18
18: ; preds = %11, %18
%19 = phi i32 [ %23, %18 ], [ 0, %11 ]
%20 = phi i32 [ %22, %18 ], [ %15, %11 ]
%21 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %20)
%22 = add i32 %20, 1
%23 = add nsw i32 %19, %20
%24 = icmp eq i32 %20, %17
br i1 %24, label %25, label %18
25: ; preds = %18
%26 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %23)
%27 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%28 = load i32, i32* %1
%29 = icmp sgt i32 %28, 0
%30 = load i32, i32* %2
%31 = icmp sgt i32 %30, 0
%32 = select i1 %29, i1 %31, i1 false
br i1 %32, label %11, label %33
33: ; preds = %25, %0
ret i32 0
}