#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 X = 0, Y = 0, par = 0, impar = 1;
  printf("Insira o VALOR DE X: ");
  scanf("%d", &X);
  printf("Insira o VALOR DE Y: ");
  scanf("%d", &Y);
  if (Y <= X) {
    printf("X não pode ser maior que Y\n");
    return 0;
  }
  for (int cont = X; cont <= Y; cont++) {
    if (cont % 2 == 0)
      par += cont;
    else
      impar *= cont;
  }
  printf("A soma dos números pares nesse intervalo é %d\n", par);
  printf("A multiplicação dos números impares nesse intervalo é %d\n", impar);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb6(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe98(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11ad <main+0x8d>
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1220 <main+0x100>
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     11fe <main+0xde>
mov    -0x18(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11e1 <main+0xc1>
mov    -0x18(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    11eb <main+0xcb>
mov    -0x18(%rbp),%eax
imul   -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    11f0 <main+0xd0>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11b3 <main+0x93>
mov    -0x10(%rbp),%esi
lea    0xe44(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
movl   $0x0,0x4(%rsp)
movl   $0x0,(%rsp)
lea    0xef7(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xefd(%rip),%rbp
lea    0x4(%rsp),%rsi
mov    %rbp,%rdi
call   1050 <scanf@plt>
lea    0xeec(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rsp,%rsi
mov    %rbp,%rdi
call   1050 <scanf@plt>
mov    (%rsp),%eax
mov    0x4(%rsp),%ecx
cmp    %ecx,%eax
jle    11a5 <main+0x75>
add    $0x1,%eax
mov    %eax,%esi
sub    %ecx,%esi
mov    $0x1,%edx
cmp    $0x8,%esi
jae    11b6 <main+0x86>
mov    $0x1,%ebp
jmp    1300 <main+0x1d0>
lea    0xf32(%rip),%rdi
call   1030 <puts@plt>
jmp    133c <main+0x20c>
mov    %esi,%r8d
and    $0xfffffff8,%r8d
movd   %ecx,%xmm0
add    %r8d,%ecx
pshufd $0x0,%xmm0,%xmm6
paddd  0xe2f(%rip),%xmm6
pxor   %xmm8,%xmm8
movdqa 0xe31(%rip),%xmm11
movdqa 0xe38(%rip),%xmm9
movdqa 0xe3f(%rip),%xmm10
mov    %r8d,%edi
movdqa %xmm11,%xmm1
movdqa %xmm11,%xmm0
pxor   %xmm13,%xmm13
pxor   %xmm12,%xmm12
nopl   0x0(%rax,%rax,1)
movdqa %xmm6,%xmm2
paddd  %xmm9,%xmm2
movdqa %xmm6,%xmm5
pand   %xmm11,%xmm5
pcmpeqd %xmm8,%xmm5
movdqa %xmm5,%xmm4
movdqa %xmm5,%xmm7
pandn  %xmm6,%xmm7
psubd  %xmm5,%xmm7
movdqa %xmm5,%xmm3
pandn  %xmm2,%xmm3
psubd  %xmm5,%xmm3
pand   %xmm6,%xmm5
paddd  %xmm5,%xmm13
pand   %xmm2,%xmm4
paddd  %xmm4,%xmm12
pshufd $0xf5,%xmm7,%xmm2
pmuludq %xmm1,%xmm7
pshufd $0xf5,%xmm1,%xmm1
pshufd $0xe8,%xmm7,%xmm4
pmuludq %xmm2,%xmm1
pshufd $0xe8,%xmm1,%xmm2
movdqa %xmm4,%xmm1
punpckldq %xmm2,%xmm1
pshufd $0xf5,%xmm3,%xmm2
pmuludq %xmm0,%xmm3
pshufd $0xf5,%xmm0,%xmm0
pshufd $0xe8,%xmm3,%xmm3
pmuludq %xmm2,%xmm0
pshufd $0xe8,%xmm0,%xmm2
movdqa %xmm3,%xmm0
punpckldq %xmm2,%xmm0
paddd  %xmm10,%xmm6
add    $0xfffffff8,%edi
jne    1210 <main+0xe0>
paddd  %xmm13,%xmm12
pshufd $0xee,%xmm12,%xmm2
paddd  %xmm12,%xmm2
pshufd $0x55,%xmm2,%xmm3
paddd  %xmm2,%xmm3
movd   %xmm3,%ebx
pshufd $0xf5,%xmm1,%xmm2
pshufd $0xf5,%xmm0,%xmm3
pmuludq %xmm2,%xmm3
pmuludq %xmm1,%xmm0
pshufd $0xee,%xmm0,%xmm1
pmuludq %xmm0,%xmm1
pshufd $0xaa,%xmm3,%xmm0
pmuludq %xmm3,%xmm0
pmuludq %xmm1,%xmm0
movd   %xmm0,%ebp
cmp    %r8d,%esi
je     131c <main+0x1ec>
nopl   0x0(%rax)
test   $0x1,%cl
mov    $0x0,%esi
cmove  %ecx,%esi
mov    %ecx,%edi
cmove  %edx,%edi
add    %esi,%ebx
imul   %edi,%ebp
add    $0x1,%ecx
cmp    %ecx,%eax
jne    1300 <main+0x1d0>
lea    0xd4c(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xd6d(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Insira o VALOR DE X: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [22 x i8] c"Insira o VALOR DE Y: \00"
@.str.3 = [29 x i8] c"X n\C3\A3o pode ser maior que Y\0A\00"
@.str.4 = [49 x i8] c"A soma dos n\C3\BAmeros pares nesse intervalo \C3\A9 %d\0A\00"
@.str.5 = [62 x i8] c"A multiplica\C3\A7\C3\A3o dos n\C3\BAmeros impares nesse intervalo \C3\A9 %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* %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 1, i32* %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, 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 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%11 = load i32, i32* %3
%12 = load i32, i32* %2
%13 = icmp sle i32 %11, %12
br i1 %13, label %14, label %16
14: ; preds = %0
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %1
br label %43
16: ; preds = %0
%17 = load i32, i32* %2
store i32 %17, i32* %6
br label %18
18: ; preds = %35, %16
%19 = load i32, i32* %6
%20 = load i32, i32* %3
%21 = icmp sle i32 %19, %20
br i1 %21, label %22, label %38
22: ; preds = %18
%23 = load i32, i32* %6
%24 = srem i32 %23, 2
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %30
26: ; preds = %22
%27 = load i32, i32* %6
%28 = load i32, i32* %4
%29 = add nsw i32 %28, %27
store i32 %29, i32* %4
br label %34
30: ; preds = %22
%31 = load i32, i32* %6
%32 = load i32, i32* %5
%33 = mul nsw i32 %32, %31
store i32 %33, i32* %5
br label %34
34: ; preds = %30, %26
br label %35
35: ; preds = %34
%36 = load i32, i32* %6
%37 = add nsw i32 %36, 1
store i32 %37, i32* %6
br label %18
38: ; preds = %18
%39 = load i32, i32* %4
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.4, i64 0, i64 0), i32 %39)
%41 = load i32, i32* %5
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.5, i64 0, i64 0), i32 %41)
br label %43
43: ; preds = %38, %14
%44 = load i32, i32* %1
ret i32 %44
}

LLVM IR (-O2):
@.str = [22 x i8] c"Insira o VALOR DE X: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [22 x i8] c"Insira o VALOR DE Y: \00"
@.str.4 = [49 x i8] c"A soma dos n\C3\BAmeros pares nesse intervalo \C3\A9 %d\0A\00"
@.str.5 = [62 x i8] c"A multiplica\C3\A7\C3\A3o dos n\C3\BAmeros impares nesse intervalo \C3\A9 %d\0A\00"
@str = [28 x i8] c"X n\C3\A3o pode ser maior que Y\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 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 ([22 x i8], [22 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 %12, label %55
12: ; preds = %0
%13 = add i32 %9, 1
%14 = sub i32 %13, %10
%15 = icmp ult i32 %14, 8
br i1 %15, label %51, label %16
16: ; preds = %12
%17 = and i32 %14, -8
%18 = add i32 %10, %17
%19 = insertelement <4 x i32> poison, i32 %10, i64 0
%20 = shufflevector <4 x i32> %19, <4 x i32> poison, <4 x i32> zeroinitializer
%21 = add <4 x i32> %20, <i32 0, i32 1, i32 2, i32 3>
br label %22
22: ; preds = %22, %16
%23 = phi i32 [ 0, %16 ], [ %42, %22 ]
%24 = phi <4 x i32> [ %21, %16 ], [ %43, %22 ]
%25 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %16 ], [ %40, %22 ]
%26 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %16 ], [ %41, %22 ]
%27 = phi <4 x i32> [ zeroinitializer, %16 ], [ %36, %22 ]
%28 = phi <4 x i32> [ zeroinitializer, %16 ], [ %37, %22 ]
%29 = add <4 x i32> %24, <i32 4, i32 4, i32 4, i32 4>
%30 = and <4 x i32> %24, <i32 1, i32 1, i32 1, i32 1>
%31 = and <4 x i32> %24, <i32 1, i32 1, i32 1, i32 1>
%32 = icmp eq <4 x i32> %30, zeroinitializer
%33 = icmp eq <4 x i32> %31, zeroinitializer
%34 = select <4 x i1> %32, <4 x i32> %24, <4 x i32> zeroinitializer
%35 = select <4 x i1> %33, <4 x i32> %29, <4 x i32> zeroinitializer
%36 = add <4 x i32> %34, %27
%37 = add <4 x i32> %35, %28
%38 = select <4 x i1> %32, <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32> %24
%39 = select <4 x i1> %33, <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32> %29
%40 = mul <4 x i32> %38, %25
%41 = mul <4 x i32> %39, %26
%42 = add nuw i32 %23, 8
%43 = add <4 x i32> %24, <i32 8, i32 8, i32 8, i32 8>
%44 = icmp eq i32 %42, %17
br i1 %44, label %45, label %22
45: ; preds = %22
%46 = add <4 x i32> %37, %36
%47 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %46)
%48 = mul <4 x i32> %41, %40
%49 = call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %48)
%50 = icmp eq i32 %14, %17
br i1 %50, label %57, label %51
51: ; preds = %12, %45
%52 = phi i32 [ %10, %12 ], [ %18, %45 ]
%53 = phi i32 [ 1, %12 ], [ %49, %45 ]
%54 = phi i32 [ 0, %12 ], [ %47, %45 ]
br label %62
55: ; preds = %0
%56 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
br label %74
57: ; preds = %62, %45
%58 = phi i32 [ %47, %45 ], [ %69, %62 ]
%59 = phi i32 [ %49, %45 ], [ %71, %62 ]
%60 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.4, i64 0, i64 0), i32 %58)
%61 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @.str.5, i64 0, i64 0), i32 %59)
br label %74
62: ; preds = %51, %62
%63 = phi i32 [ %72, %62 ], [ %52, %51 ]
%64 = phi i32 [ %71, %62 ], [ %53, %51 ]
%65 = phi i32 [ %69, %62 ], [ %54, %51 ]
%66 = and i32 %63, 1
%67 = icmp eq i32 %66, 0
%68 = select i1 %67, i32 %63, i32 0
%69 = add nsw i32 %68, %65
%70 = select i1 %67, i32 1, i32 %63
%71 = mul nsw i32 %70, %64
%72 = add i32 %63, 1
%73 = icmp eq i32 %63, %9
br i1 %73, label %57, label %62
74: ; preds = %57, %55
ret i32 0
}