#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*/ fflush(int /*<<< orphan*/);
int printf(char *, ...);
int /*<<< orphan*/ scanf(char *, long *);
int /*<<< orphan*/ stdin;
main() {
  long int a, b, c, sum = 0;
  printf("Introduzca los límites a y b.\n");
  while (((printf("a = "), fflush(stdin), scanf("%ld", &a)) != 1) || a < 0)
    ;
  while (((printf("b = "), fflush(stdin), scanf("%ld", &b)) != 1) || b < 0)
    ;
  if (a > b) {
    long int temp = a;
    a = b;
    b = temp;
  }
  while (a % 5)
    a++;
  for (c = a; c <= b; c += 5) {
    printf("%d\t", c);
    sum += c;
  }
  printf("\nLa suma de los múltiplos de 5 es: %d", sum);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x28(%rbp)
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
lea    0xead(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x1,%ecx
mov    %al,-0x31(%rbp)
jne    119c <main+0x6c>
cmpq   $0x0,-0x10(%rbp)
setl   %al
mov    %al,-0x31(%rbp)
mov    -0x31(%rbp),%al
test   $0x1,%al
jne    11ac <main+0x7c>
jmp    11b1 <main+0x81>
jmp    1155 <main+0x25>
jmp    11b6 <main+0x86>
lea    0xe6c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e1d(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
lea    0xe4c(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1050 <scanf@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x1,%ecx
mov    %al,-0x32(%rbp)
jne    11fd <main+0xcd>
cmpq   $0x0,-0x18(%rbp)
setl   %al
mov    %al,-0x32(%rbp)
mov    -0x32(%rbp),%al
test   $0x1,%al
jne    120d <main+0xdd>
jmp    1212 <main+0xe2>
jmp    11b6 <main+0x86>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jle    1238 <main+0x108>
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    123d <main+0x10d>
mov    -0x10(%rbp),%rax
mov    $0x5,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
je     1266 <main+0x136>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    123d <main+0x10d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jg     12ab <main+0x17b>
mov    -0x20(%rbp),%rsi
lea    0xda7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
add    -0x28(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
add    $0x5,%rax
mov    %rax,-0x20(%rbp)
jmp    126e <main+0x13e>
mov    -0x28(%rbp),%rsi
lea    0xd7c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
lea    0xea0(%rip),%r14
mov    0x2e81(%rip),%r13
lea    0xe97(%rip),%r15
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x0(%r13),%edi
call   1050 <fflush@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1060 <scanf@plt>
cmp    $0x1,%eax
jne    1180 <main+0x40>
cmpq   $0x0,(%rsp)
js     1180 <main+0x40>
lea    0xe58(%rip),%r14
lea    0xe4d(%rip),%r15
lea    0x8(%rsp),%r12
nopl   (%rax)
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x0(%r13),%edi
call   1050 <fflush@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1060 <scanf@plt>
cmp    $0x1,%eax
jne    11c0 <main+0x80>
mov    0x8(%rsp),%rbx
test   %rbx,%rbx
js     11c0 <main+0x80>
mov    (%rsp),%rcx
cmp    %rbx,%rcx
jle    1204 <main+0xc4>
mov    %rbx,(%rsp)
mov    %rcx,0x8(%rsp)
mov    %rcx,%rax
jmp    120a <main+0xca>
mov    %rbx,%rax
mov    %rcx,%rbx
movabs $0xcccccccccccccccd,%rcx
cc cc cc
mov    %rbx,%rdi
imul   %rcx,%rdi
movabs $0x1999999999999999,%rdx
99 99 19
add    %rdx,%rdi
movabs $0x3333333333333333,%rsi
33 33 33
cmp    %rsi,%rdi
jb     1257 <main+0x117>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rbx
mov    %rbx,%rdi
imul   %rcx,%rdi
add    %rdx,%rdi
cmp    %rsi,%rdi
jae    1240 <main+0x100>
mov    %rbx,(%rsp)
cmp    %rax,%rbx
jle    1261 <main+0x121>
xor    %r14d,%r14d
jmp    128b <main+0x14b>
lea    0xda6(%rip),%r15
xor    %r14d,%r14d
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
add    %rbx,%r14
add    $0x5,%rbx
cmp    0x8(%rsp),%rbx
jle    1270 <main+0x130>
lea    0xd80(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Introduzca los l\C3\ADmites a y b.\0A\00"
@.str.1 = [5 x i8] c"a = \00"
@stdin = global i32 0
@.str.2 = [4 x i8] c"%ld\00"
@.str.3 = [5 x i8] c"b = \00"
@.str.4 = [4 x i8] c"%d\09\00"
@.str.5 = [39 x i8] c"\0ALa suma de los m\C3\BAltiplos de 5 es: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i32 0, i32* %1
store i64 0, i64* %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %19, %0
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%10 = load i32, i32* @stdin
%11 = call i32 @fflush(i32 %10)
%12 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i64* %2)
%13 = icmp ne i32 %12, 1
br i1 %13, label %17, label %14
14: ; preds = %8
%15 = load i64, i64* %2
%16 = icmp slt i64 %15, 0
br label %17
17: ; preds = %14, %8
%18 = phi i1 [ true, %8 ], [ %16, %14 ]
br i1 %18, label %19, label %20
19: ; preds = %17
br label %8
20: ; preds = %17
br label %21
21: ; preds = %32, %20
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%23 = load i32, i32* @stdin
%24 = call i32 @fflush(i32 %23)
%25 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i64* %3)
%26 = icmp ne i32 %25, 1
br i1 %26, label %30, label %27
27: ; preds = %21
%28 = load i64, i64* %3
%29 = icmp slt i64 %28, 0
br label %30
30: ; preds = %27, %21
%31 = phi i1 [ true, %21 ], [ %29, %27 ]
br i1 %31, label %32, label %33
32: ; preds = %30
br label %21
33: ; preds = %30
%34 = load i64, i64* %2
%35 = load i64, i64* %3
%36 = icmp sgt i64 %34, %35
br i1 %36, label %37, label %41
37: ; preds = %33
%38 = load i64, i64* %2
store i64 %38, i64* %6
%39 = load i64, i64* %3
store i64 %39, i64* %2
%40 = load i64, i64* %6
store i64 %40, i64* %3
br label %41
41: ; preds = %37, %33
br label %42
42: ; preds = %46, %41
%43 = load i64, i64* %2
%44 = srem i64 %43, 5
%45 = icmp ne i64 %44, 0
br i1 %45, label %46, label %49
46: ; preds = %42
%47 = load i64, i64* %2
%48 = add nsw i64 %47, 1
store i64 %48, i64* %2
br label %42
49: ; preds = %42
%50 = load i64, i64* %2
store i64 %50, i64* %4
br label %51
51: ; preds = %61, %49
%52 = load i64, i64* %4
%53 = load i64, i64* %3
%54 = icmp sle i64 %52, %53
br i1 %54, label %55, label %64
55: ; preds = %51
%56 = load i64, i64* %4
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i64 %56)
%58 = load i64, i64* %4
%59 = load i64, i64* %5
%60 = add nsw i64 %59, %58
store i64 %60, i64* %5
br label %61
61: ; preds = %55
%62 = load i64, i64* %4
%63 = add nsw i64 %62, 5
store i64 %63, i64* %4
br label %51
64: ; preds = %51
%65 = load i64, i64* %5
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.5, i64 0, i64 0), i64 %65)
%67 = load i32, i32* %1
ret i32 %67
}

LLVM IR (-O2):
@.str.1 = [5 x i8] c"a = \00"
@stdin = global i32 0
@.str.2 = [4 x i8] c"%ld\00"
@.str.3 = [5 x i8] c"b = \00"
@.str.4 = [4 x i8] c"%d\09\00"
@.str.5 = [39 x i8] c"\0ALa suma de los m\C3\BAltiplos de 5 es: %d\00"
@str = [31 x i8] c"Introduzca los l\C3\ADmites a y b.\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = bitcast i64* %1 to i8*
%4 = bitcast i64* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %6, %0
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* @stdin
%9 = call i32 @fflush(i32 %8)
%10 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i64* %1)
%11 = icmp ne i32 %10, 1
%12 = load i64, i64* %1
%13 = icmp slt i64 %12, 0
%14 = select i1 %11, i1 true, i1 %13
br i1 %14, label %6, label %15
15: ; preds = %6, %15
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%17 = load i32, i32* @stdin
%18 = call i32 @fflush(i32 %17)
%19 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i64* %2)
%20 = icmp ne i32 %19, 1
%21 = load i64, i64* %2
%22 = icmp slt i64 %21, 0
%23 = select i1 %20, i1 true, i1 %22
br i1 %23, label %15, label %24
24: ; preds = %15
%25 = load i64, i64* %1
%26 = icmp sgt i64 %25, %21
br i1 %26, label %27, label %28
27: ; preds = %24
store i64 %21, i64* %1
store i64 %25, i64* %2
br label %28
28: ; preds = %27, %24
%29 = phi i64 [ %25, %27 ], [ %21, %24 ]
%30 = phi i64 [ %21, %27 ], [ %25, %24 ]
%31 = srem i64 %30, 5
%32 = icmp eq i64 %31, 0
br i1 %32, label %34, label %37
33: ; preds = %37
store i64 %39, i64* %1
br label %34
34: ; preds = %33, %28
%35 = phi i64 [ %39, %33 ], [ %30, %28 ]
%36 = icmp sgt i64 %35, %29
br i1 %36, label %50, label %42
37: ; preds = %28, %37
%38 = phi i64 [ %39, %37 ], [ %30, %28 ]
%39 = add nsw i64 %38, 1
%40 = srem i64 %39, 5
%41 = icmp eq i64 %40, 0
br i1 %41, label %33, label %37
42: ; preds = %34, %42
%43 = phi i64 [ %47, %42 ], [ %35, %34 ]
%44 = phi i64 [ %46, %42 ], [ 0, %34 ]
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i64 %43)
%46 = add nsw i64 %43, %44
%47 = add nsw i64 %43, 5
%48 = load i64, i64* %2
%49 = icmp sgt i64 %47, %48
br i1 %49, label %50, label %42
50: ; preds = %42, %34
%51 = phi i64 [ 0, %34 ], [ %46, %42 ]
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.5, i64 0, i64 0), i64 %51)
ret i32 0
}