#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() {
  int x1, x2, soma = 0;
  scanf("%d%d", &x1, &x2);
  while (x1 <= x2) {
    soma += x1;
    printf("%d+", x1);
    x1 += 2;
  }
  printf("\b=%d\n", soma);
  return 0;
}


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
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     117c <main+0x5c>
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
jmp    114a <main+0x2a>
mov    -0x10(%rbp),%esi
lea    0xe83(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
mov    %rsp,%rsi
lea    0x4(%rsp),%rdx
call   1040 <scanf@plt>
mov    (%rsp),%esi
xor    %ebx,%ebx
cmp    0x4(%rsp),%esi
jg     1169 <main+0x49>
xor    %ebx,%ebx
lea    0xeb9(%rip),%r14
nopl   0x0(%rax)
add    %esi,%ebx
mov    %r14,%rdi
call   1030 <printf@plt>
mov    (%rsp),%esi
add    $0x2,%esi
mov    %esi,(%rsp)
cmp    0x4(%rsp),%esi
jle    1150 <main+0x30>
lea    0xe99(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [4 x i8] c"%d+\00"
@.str.2 = [6 x i8] c"\08=%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 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
br label %6
6: ; preds = %10, %0
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = icmp sle i32 %7, %8
br i1 %9, label %10, label %18
10: ; preds = %6
%11 = load i32, i32* %2
%12 = load i32, i32* %4
%13 = add nsw i32 %12, %11
store i32 %13, i32* %4
%14 = load i32, i32* %2
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %14)
%16 = load i32, i32* %2
%17 = add nsw i32 %16, 2
store i32 %17, i32* %2
br label %6
18: ; preds = %6
%19 = load i32, i32* %4
%20 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %19)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [4 x i8] c"%d+\00"
@.str.2 = [6 x i8] c"\08=%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 ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = icmp sgt i32 %6, %7
br i1 %8, label %18, label %9
9: ; preds = %0, %9
%10 = phi i32 [ %15, %9 ], [ %6, %0 ]
%11 = phi i32 [ %12, %9 ], [ 0, %0 ]
%12 = add nsw i32 %10, %11
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%14 = load i32, i32* %1
%15 = add nsw i32 %14, 2
store i32 %15, i32* %1
%16 = load i32, i32* %2
%17 = icmp sgt i32 %15, %16
br i1 %17, label %18, label %9
18: ; preds = %9, %0
%19 = phi i32 [ 0, %0 ], [ %12, %9 ]
%20 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %19)
ret i32 0
}