#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 *);
void main() {
  int cNum, xNumIng;
  unsigned long long nRes = 0;
  printf("Ingrese el numero: ");
  scanf("%d", &xNumIng);
  for (cNum = 1; xNumIng > cNum; ++cNum) {
    if ((cNum % 3 == 0) || (cNum % 5 == 0)) {
      nRes += cNum;
    }
  }
  printf("\nEl resultado es: %llu\n", nRes);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x10(%rbp)
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jle    11a8 <main+0x88>
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1189 <main+0x69>
mov    -0x4(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1195 <main+0x75>
movslq -0x4(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    119a <main+0x7a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1155 <main+0x35>
mov    -0x10(%rbp),%rsi
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xf94(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf98(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%r8d
cmp    $0x2,%r8d
jl     12e2 <main+0x1c2>
lea    -0x1(%r8),%rdx
cmp    $0x4,%rdx
jae    116b <main+0x4b>
mov    $0x1,%eax
xor    %ebx,%ebx
jmp    12f9 <main+0x1d9>
mov    %rdx,%rsi
and    $0xfffffffffffffffc,%rsi
lea    0x1(%rsi),%rax
movdqa 0xe81(%rip),%xmm14
pxor   %xmm0,%xmm0
movdqa 0xe85(%rip),%xmm2
movdqa 0xe9c(%rip),%xmm10
movdqa 0xea3(%rip),%xmm13
movdqa 0xeaa(%rip),%xmm12
pcmpeqd %xmm7,%xmm7
movdqa 0xebd(%rip),%xmm15
movdqa 0xec4(%rip),%xmm11
mov    %rsi,%rdi
pxor   %xmm6,%xmm6
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movdqa %xmm14,%xmm3
pmuludq %xmm10,%xmm3
pshufd $0xe8,%xmm3,%xmm3
pshufd $0xf5,%xmm14,%xmm5
movdqa %xmm5,%xmm4
pmuludq %xmm10,%xmm4
pshufd $0xe8,%xmm4,%xmm4
punpckldq %xmm4,%xmm3
movdqa %xmm3,%xmm4
pxor   %xmm13,%xmm4
pcmpgtd %xmm12,%xmm4
pxor   %xmm7,%xmm4
movdqa %xmm14,%xmm1
pmuludq %xmm15,%xmm1
pshufd $0xe8,%xmm1,%xmm8
pmuludq %xmm15,%xmm5
pshufd $0xe8,%xmm5,%xmm1
punpckldq %xmm1,%xmm8
movdqa %xmm8,%xmm9
pxor   %xmm13,%xmm9
pcmpgtd %xmm11,%xmm9
pxor   %xmm7,%xmm9
por    %xmm4,%xmm9
paddd  0xe17(%rip),%xmm3
pxor   %xmm13,%xmm3
pcmpgtd %xmm12,%xmm3
pxor   %xmm7,%xmm3
paddd  0xe30(%rip),%xmm8
pxor   %xmm13,%xmm8
pcmpgtd %xmm11,%xmm8
pxor   %xmm7,%xmm8
por    %xmm3,%xmm8
pxor   %xmm1,%xmm1
pcmpgtd %xmm9,%xmm1
punpckldq %xmm1,%xmm9
pxor   %xmm1,%xmm1
pcmpgtd %xmm8,%xmm1
punpckldq %xmm1,%xmm8
movdqa %xmm2,%xmm1
paddq  0xd84(%rip),%xmm1
pand   %xmm1,%xmm8
paddq  %xmm8,%xmm6
pand   %xmm2,%xmm9
paddq  %xmm9,%xmm0
paddq  0xde8(%rip),%xmm2
paddd  0xdef(%rip),%xmm14
add    $0xfffffffffffffffc,%rdi
jne    11d0 <main+0xb0>
paddq  %xmm0,%xmm6
pshufd $0xee,%xmm6,%xmm0
paddq  %xmm6,%xmm0
movq   %xmm0,%rbx
cmp    %rsi,%rdx
jne    12f9 <main+0x1d9>
lea    0xdee(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret
mov    $0xcccccccd,%r9d
mov    $0xaaaaaaab,%esi
jmp    1325 <main+0x205>
cs nopw 0x0(%rax,%rax,1)
lea    (%rdi,%rdi,2),%edx
cmp    %edx,%eax
cmove  %rax,%rcx
add    %rcx,%rbx
add    $0x1,%rax
cmp    %rax,%r8
je     12e2 <main+0x1c2>
mov    %eax,%edi
mov    %rdi,%rcx
imul   %r9,%rcx
shr    $0x22,%rcx
lea    (%rcx,%rcx,4),%edx
imul   %rsi,%rdi
shr    $0x21,%rdi
mov    %rax,%rcx
cmp    %edx,%eax
je     1310 <main+0x1f0>
xor    %ecx,%ecx
jmp    1310 <main+0x1f0>

LLVM IR (-O0):
@.str = [20 x i8] c"Ingrese el numero: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [24 x i8] c"\0AEl resultado es: %llu\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
store i64 0, i64* %3
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
store i32 1, i32* %1
br label %6
6: ; preds = %24, %0
%7 = load i32, i32* %2
%8 = load i32, i32* %1
%9 = icmp sgt i32 %7, %8
br i1 %9, label %10, label %27
10: ; preds = %6
%11 = load i32, i32* %1
%12 = srem i32 %11, 3
%13 = icmp eq i32 %12, 0
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = load i32, i32* %1
%16 = srem i32 %15, 5
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %23
18: ; preds = %14, %10
%19 = load i32, i32* %1
%20 = sext i32 %19 to i64
%21 = load i64, i64* %3
%22 = add i64 %21, %20
store i64 %22, i64* %3
br label %23
23: ; preds = %18, %14
br label %24
24: ; preds = %23
%25 = load i32, i32* %1
%26 = add nsw i32 %25, 1
store i32 %26, i32* %1
br label %6
27: ; preds = %6
%28 = load i64, i64* %3
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i64 %28)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"Ingrese el numero: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [24 x i8] c"\0AEl resultado es: %llu\0A\00"
define void @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp sgt i32 %5, 1
br i1 %6, label %7, label %60
7: ; preds = %0
%8 = zext i32 %5 to i64
%9 = add nsw i64 %8, -1
%10 = icmp ult i64 %9, 4
br i1 %10, label %44, label %11
11: ; preds = %7
%12 = and i64 %9, -4
%13 = or i64 %12, 1
br label %14
14: ; preds = %14, %11
%15 = phi i64 [ 0, %11 ], [ %36, %14 ]
%16 = phi <2 x i64> [ <i64 1, i64 2>, %11 ], [ %37, %14 ]
%17 = phi <2 x i64> [ zeroinitializer, %11 ], [ %34, %14 ]
%18 = phi <2 x i64> [ zeroinitializer, %11 ], [ %35, %14 ]
%19 = phi <2 x i32> [ <i32 1, i32 2>, %11 ], [ %38, %14 ]
%20 = add <2 x i64> %16, <i64 2, i64 2>
%21 = add <2 x i32> %19, <i32 2, i32 2>
%22 = urem <2 x i32> %19, <i32 3, i32 3>
%23 = urem <2 x i32> %21, <i32 3, i32 3>
%24 = icmp eq <2 x i32> %22, zeroinitializer
%25 = icmp eq <2 x i32> %23, zeroinitializer
%26 = urem <2 x i32> %19, <i32 5, i32 5>
%27 = urem <2 x i32> %21, <i32 5, i32 5>
%28 = icmp eq <2 x i32> %26, zeroinitializer
%29 = icmp eq <2 x i32> %27, zeroinitializer
%30 = or <2 x i1> %24, %28
%31 = or <2 x i1> %25, %29
%32 = select <2 x i1> %30, <2 x i64> %16, <2 x i64> zeroinitializer
%33 = select <2 x i1> %31, <2 x i64> %20, <2 x i64> zeroinitializer
%34 = add <2 x i64> %32, %17
%35 = add <2 x i64> %33, %18
%36 = add nuw i64 %15, 4
%37 = add <2 x i64> %16, <i64 4, i64 4>
%38 = add <2 x i32> %19, <i32 4, i32 4>
%39 = icmp eq i64 %36, %12
br i1 %39, label %40, label %14
40: ; preds = %14
%41 = add <2 x i64> %35, %34
%42 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %41)
%43 = icmp eq i64 %9, %12
br i1 %43, label %60, label %44
44: ; preds = %7, %40
%45 = phi i64 [ 1, %7 ], [ %13, %40 ]
%46 = phi i64 [ 0, %7 ], [ %42, %40 ]
br label %47
47: ; preds = %44, %47
%48 = phi i64 [ %58, %47 ], [ %45, %44 ]
%49 = phi i64 [ %57, %47 ], [ %46, %44 ]
%50 = trunc i64 %48 to i32
%51 = urem i32 %50, 3
%52 = icmp eq i32 %51, 0
%53 = urem i32 %50, 5
%54 = icmp eq i32 %53, 0
%55 = or i1 %52, %54
%56 = select i1 %55, i64 %48, i64 0
%57 = add i64 %56, %49
%58 = add nuw nsw i64 %48, 1
%59 = icmp eq i64 %58, %8
br i1 %59, label %60, label %47
60: ; preds = %47, %40, %0
%61 = phi i64 [ 0, %0 ], [ %42, %40 ], [ %57, %47 ]
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i64 %61)
ret void
}