#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 main() {
  int x, y, i, j, sum = 0;
  scanf("%d%d", &x, &y);
  while (y <= 0) {
    scanf("%d", &y);
  }
  for (j = 1; j <= y; j++) {
    sum = sum + x;
    x++;
  }
  printf("%d\n", sum);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x18(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
cmpl   $0x0,-0xc(%rbp)
jg     116d <main+0x4d>
lea    0xea5(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
jmp    114c <main+0x2c>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     11a0 <main+0x80>
mov    -0x18(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1174 <main+0x54>
mov    -0x18(%rbp),%esi
lea    0xe5b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
mov    (%rsp),%eax
test   %eax,%eax
jg     1164 <main+0x44>
lea    0xeba(%rip),%r14
mov    %rsp,%rbx
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    (%rsp),%eax
test   %eax,%eax
jle    1150 <main+0x30>
mov    0x4(%rsp),%ecx
lea    -0x1(%rax),%edx
lea    0x1(%rcx),%edi
imul   %edx,%edi
add    %ecx,%edi
lea    -0x2(%rax),%esi
imul   %rdx,%rsi
shr    %rsi
add    %edi,%esi
add    %ecx,%eax
mov    %eax,0x4(%rsp)
lea    0xe79(%rip),%rdi
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 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"%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* %6
%7 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
br label %8
8: ; preds = %11, %0
%9 = load i32, i32* %3
%10 = icmp sle i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
br label %8
13: ; preds = %8
store i32 1, i32* %5
br label %14
14: ; preds = %24, %13
%15 = load i32, i32* %5
%16 = load i32, i32* %3
%17 = icmp sle i32 %15, %16
br i1 %17, label %18, label %27
18: ; preds = %14
%19 = load i32, i32* %6
%20 = load i32, i32* %2
%21 = add nsw i32 %19, %20
store i32 %21, i32* %6
%22 = load i32, i32* %2
%23 = add nsw i32 %22, 1
store i32 %23, i32* %2
br label %24
24: ; preds = %18
%25 = load i32, i32* %5
%26 = add nsw i32 %25, 1
store i32 %26, i32* %5
br label %14
27: ; preds = %14
%28 = load i32, i32* %6
%29 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %28)
%30 = load i32, i32* %1
ret i32 %30
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"%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 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 1
br i1 %7, label %8, label %12
8: ; preds = %0, %8
%9 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%10 = load i32, i32* %2
%11 = icmp slt i32 %10, 1
br i1 %11, label %8, label %12
12: ; preds = %8, %0
%13 = phi i32 [ %6, %0 ], [ %10, %8 ]
%14 = load i32, i32* %1
%15 = add nsw i32 %13, -1
%16 = add i32 %14, 1
%17 = mul i32 %15, %16
%18 = add i32 %14, %17
%19 = zext i32 %15 to i33
%20 = add nsw i32 %13, -2
%21 = zext i32 %20 to i33
%22 = mul i33 %19, %21
%23 = lshr i33 %22, 1
%24 = trunc i33 %23 to i32
%25 = add i32 %18, %24
%26 = add i32 %13, %14
store i32 %26, i32* %1
%27 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %25)
ret i32 0
}