#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 a, b, soma = 0, aux;
  printf("entre com o A: ");
  scanf("%d", &a);
  aux = a;
  printf("entre com o B: ");
  scanf("%d", &b);
  if (a % 2 == 0) {
    printf("pares entre A e B (exclusive):\n");
    for (a = a + 2; a < b; a += 2)
      printf("%d\n", a);
    for (aux = aux + 1; aux < b; aux += 2)
      soma = soma + aux;
    printf("soma dos impares entre A e B (exclusive) = %d\n", soma);
  } else {
    printf("pares entre A e B (exclusive):\n");
    for (a = a + 1; a < b; a += 2)
      printf("%d\n", a);
    for (aux = aux + 2; aux < b; aux += 2)
      soma = soma + aux;
    printf("soma dos impares entre A e B (exclusive) = %d\n", soma);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec5(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea1(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1210 <main+0xf0>
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11ce <main+0xae>
mov    -0x8(%rbp),%esi
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
jmp    11a3 <main+0x83>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11fa <main+0xda>
mov    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x14(%rbp)
jmp    11d7 <main+0xb7>
mov    -0x10(%rbp),%esi
lea    0xe3f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    128f <main+0x16f>
lea    0xe0c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1252 <main+0x132>
mov    -0x8(%rbp),%esi
lea    0xe31(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
jmp    1227 <main+0x107>
mov    -0x14(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    127e <main+0x15e>
mov    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x14(%rbp)
jmp    125b <main+0x13b>
mov    -0x10(%rbp),%esi
lea    0xdbb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec7(%rip),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    (%rsp),%r14d
lea    0xeb4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
testb  $0x1,(%rsp)
jne    11f1 <main+0xc1>
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
mov    (%rsp),%esi
add    $0x2,%esi
mov    %esi,(%rsp)
mov    0x4(%rsp),%eax
cmp    %eax,%esi
jge    11bb <main+0x8b>
lea    0xeb1(%rip),%rbx
nopl   (%rax)
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rsp),%esi
add    $0x2,%esi
mov    %esi,(%rsp)
mov    0x4(%rsp),%eax
cmp    %eax,%esi
jl     11a0 <main+0x70>
lea    0x1(%r14),%ecx
xor    %esi,%esi
cmp    %eax,%ecx
jge    1262 <main+0x132>
lea    0x3(%r14),%ecx
cmp    %ecx,%eax
cmovle %ecx,%eax
sub    %r14d,%eax
add    $0xfffffffe,%eax
shr    %eax
imul   %eax,%ecx
add    %r14d,%ecx
lea    -0x1(%rax),%edx
imul   %eax,%edx
and    $0xfffffffe,%edx
lea    (%rdx,%rcx,1),%esi
add    $0x1,%esi
jmp    1262 <main+0x132>
lea    0xe5a(%rip),%rdi
call   1030 <puts@plt>
mov    (%rsp),%esi
add    $0x1,%esi
mov    %esi,(%rsp)
mov    0x4(%rsp),%eax
cmp    %eax,%esi
jge    123b <main+0x10b>
lea    0xe39(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rsp),%esi
add    $0x2,%esi
mov    %esi,(%rsp)
mov    0x4(%rsp),%eax
cmp    %eax,%esi
jl     1220 <main+0xf0>
lea    0x2(%r14),%ecx
cmp    %ecx,%eax
cmovle %ecx,%eax
not    %r14d
add    %eax,%r14d
shr    %r14d
lea    -0x1(%r14),%eax
imul   %r14d,%eax
and    $0xfffffffe,%eax
imul   %ecx,%r14d
add    %eax,%r14d
mov    %r14d,%esi
lea    0xdba(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [16 x i8] c"entre com o A: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [16 x i8] c"entre com o B: \00"
@.str.3 = [32 x i8] c"pares entre A e B (exclusive):\0A\00"
@.str.4 = [4 x i8] c"%d\0A\00"
@.str.5 = [47 x i8] c"soma dos impares entre A e B (exclusive) = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%8 = load i32, i32* %2
store i32 %8, i32* %5
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 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* %2
%12 = srem i32 %11, 2
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %45
14: ; preds = %0
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
%16 = load i32, i32* %2
%17 = add nsw i32 %16, 2
store i32 %17, i32* %2
br label %18
18: ; preds = %25, %14
%19 = load i32, i32* %2
%20 = load i32, i32* %3
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %28
22: ; preds = %18
%23 = load i32, i32* %2
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %23)
br label %25
25: ; preds = %22
%26 = load i32, i32* %2
%27 = add nsw i32 %26, 2
store i32 %27, i32* %2
br label %18
28: ; preds = %18
%29 = load i32, i32* %5
%30 = add nsw i32 %29, 1
store i32 %30, i32* %5
br label %31
31: ; preds = %39, %28
%32 = load i32, i32* %5
%33 = load i32, i32* %3
%34 = icmp slt i32 %32, %33
br i1 %34, label %35, label %42
35: ; preds = %31
%36 = load i32, i32* %4
%37 = load i32, i32* %5
%38 = add nsw i32 %36, %37
store i32 %38, i32* %4
br label %39
39: ; preds = %35
%40 = load i32, i32* %5
%41 = add nsw i32 %40, 2
store i32 %41, i32* %5
br label %31
42: ; preds = %31
%43 = load i32, i32* %4
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.5, i64 0, i64 0), i32 %43)
br label %76
45: ; preds = %0
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
%47 = load i32, i32* %2
%48 = add nsw i32 %47, 1
store i32 %48, i32* %2
br label %49
49: ; preds = %56, %45
%50 = load i32, i32* %2
%51 = load i32, i32* %3
%52 = icmp slt i32 %50, %51
br i1 %52, label %53, label %59
53: ; preds = %49
%54 = load i32, i32* %2
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %54)
br label %56
56: ; preds = %53
%57 = load i32, i32* %2
%58 = add nsw i32 %57, 2
store i32 %58, i32* %2
br label %49
59: ; preds = %49
%60 = load i32, i32* %5
%61 = add nsw i32 %60, 2
store i32 %61, i32* %5
br label %62
62: ; preds = %70, %59
%63 = load i32, i32* %5
%64 = load i32, i32* %3
%65 = icmp slt i32 %63, %64
br i1 %65, label %66, label %73
66: ; preds = %62
%67 = load i32, i32* %4
%68 = load i32, i32* %5
%69 = add nsw i32 %67, %68
store i32 %69, i32* %4
br label %70
70: ; preds = %66
%71 = load i32, i32* %5
%72 = add nsw i32 %71, 2
store i32 %72, i32* %5
br label %62
73: ; preds = %62
%74 = load i32, i32* %4
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.5, i64 0, i64 0), i32 %74)
br label %76
76: ; preds = %73, %42
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"entre com o A: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [16 x i8] c"entre com o B: \00"
@.str.4 = [4 x i8] c"%d\0A\00"
@.str.5 = [47 x i8] c"soma dos impares entre A e B (exclusive) = %d\0A\00"
@str.6 = [31 x i8] c"pares entre A e B (exclusive):\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 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 = load i32, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%10 = load i32, i32* %1
%11 = and i32 %10, 1
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %44
13: ; preds = %0
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.6, i64 0, i64 0))
%15 = load i32, i32* %1
%16 = add nsw i32 %15, 2
store i32 %16, i32* %1
%17 = load i32, i32* %2
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %26
19: ; preds = %13, %19
%20 = phi i32 [ %23, %19 ], [ %16, %13 ]
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %20)
%22 = load i32, i32* %1
%23 = add nsw i32 %22, 2
store i32 %23, i32* %1
%24 = load i32, i32* %2
%25 = icmp slt i32 %23, %24
br i1 %25, label %19, label %26
26: ; preds = %19, %13
%27 = phi i32 [ %17, %13 ], [ %24, %19 ]
%28 = add nsw i32 %7, 1
%29 = icmp slt i32 %28, %27
br i1 %29, label %30, label %70
30: ; preds = %26
%31 = add i32 %7, 3
%32 = call i32 @llvm.smax.i32(i32 %27, i32 %31)
%33 = add i32 %32, -2
%34 = sub i32 %33, %7
%35 = lshr i32 %34, 1
%36 = mul i32 %35, %31
%37 = add i32 %7, %36
%38 = lshr i32 %34, 1
%39 = add nsw i32 %35, -1
%40 = mul i32 %38, %39
%41 = and i32 %40, -2
%42 = add i32 %37, %41
%43 = add i32 %42, 1
br label %70
44: ; preds = %0
%45 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.6, i64 0, i64 0))
%46 = load i32, i32* %1
%47 = add nsw i32 %46, 1
store i32 %47, i32* %1
%48 = load i32, i32* %2
%49 = icmp slt i32 %47, %48
br i1 %49, label %63, label %50
50: ; preds = %63, %44
%51 = phi i32 [ %48, %44 ], [ %68, %63 ]
%52 = add i32 %7, 2
%53 = call i32 @llvm.smax.i32(i32 %51, i32 %52)
%54 = xor i32 %7, -1
%55 = add i32 %53, %54
%56 = lshr i32 %55, 1
%57 = lshr i32 %55, 1
%58 = add nsw i32 %56, -1
%59 = mul i32 %57, %58
%60 = and i32 %59, -2
%61 = mul i32 %56, %52
%62 = add i32 %61, %60
br label %70
63: ; preds = %44, %63
%64 = phi i32 [ %67, %63 ], [ %47, %44 ]
%65 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %64)
%66 = load i32, i32* %1
%67 = add nsw i32 %66, 2
store i32 %67, i32* %1
%68 = load i32, i32* %2
%69 = icmp slt i32 %67, %68
br i1 %69, label %63, label %50
70: ; preds = %26, %30, %50
%71 = phi i32 [ %62, %50 ], [ 0, %26 ], [ %43, %30 ]
%72 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.5, i64 0, i64 0), i32 %71)
ret i32 0
}