#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 main() {
  int sum = 23;
  int n = 10;
  int n_max = 1000;
  while (n < n_max) {
    if (n % 5 == 0)
      sum += n;
    else if (n % 3 == 0)
      sum += n;
    n++;
  }
  printf("%d\n", sum);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x17,-0x8(%rbp)
movl   $0xa,-0xc(%rbp)
movl   $0x3e8,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1192 <main+0x82>
mov    -0xc(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1162 <main+0x52>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1184 <main+0x74>
mov    -0xc(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    117f <main+0x6f>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1184 <main+0x74>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1134 <main+0x24>
mov    -0x8(%rbp),%esi
lea    0xe64(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movdqa 0xee6(%rip),%xmm8
movdqa 0xeee(%rip),%xmm2
pxor   %xmm3,%xmm3
movdqa 0xef2(%rip),%xmm1
mov    $0x3d8,%eax
movdqa 0xf14(%rip),%xmm15
movdqa 0xf1b(%rip),%xmm10
movdqa 0xf22(%rip),%xmm11
movdqa 0xf2a(%rip),%xmm5
movdqa 0xf31(%rip),%xmm12
movdqa 0xf38(%rip),%xmm13
movdqa 0xf3f(%rip),%xmm14
pxor   %xmm7,%xmm7
cs nopw 0x0(%rax,%rax,1)
nop
movdqa %xmm8,%xmm0
pmullw 0xeb3(%rip),%xmm0
movdqa %xmm0,%xmm6
psubusw %xmm15,%xmm6
pcmpeqw %xmm3,%xmm6
movdqa %xmm8,%xmm4
pmullw %xmm11,%xmm4
movdqa %xmm4,%xmm9
psubusw %xmm5,%xmm9
pcmpeqw %xmm3,%xmm9
por    %xmm6,%xmm9
paddw  %xmm10,%xmm0
psubusw %xmm15,%xmm0
pcmpeqw %xmm3,%xmm0
paddw  %xmm12,%xmm4
psubusw %xmm5,%xmm4
pcmpeqw %xmm3,%xmm4
por    %xmm0,%xmm4
punpcklwd %xmm9,%xmm0
psrad  $0x10,%xmm0
pand   %xmm2,%xmm0
paddd  %xmm0,%xmm1
movdqa %xmm2,%xmm0
paddd  0xe3b(%rip),%xmm0
punpcklwd %xmm4,%xmm4
psrad  $0x10,%xmm4
pand   %xmm0,%xmm4
paddd  %xmm4,%xmm7
paddd  %xmm13,%xmm2
paddw  %xmm14,%xmm8
add    $0xfffffff8,%eax
jne    1180 <main+0x70>
paddd  %xmm1,%xmm7
pshufd $0xee,%xmm7,%xmm0
paddd  %xmm7,%xmm0
pshufd $0x55,%xmm0,%xmm1
paddd  %xmm0,%xmm1
movd   %xmm1,%esi
add    $0xbae,%esi
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %23, %1 ]
%3 = phi <4 x i32> [ <i32 23, i32 0, i32 0, i32 0>, %0 ], [ %21, %1 ]
%4 = phi <4 x i32> [ zeroinitializer, %0 ], [ %22, %1 ]
%5 = phi <4 x i32> [ <i32 10, i32 11, i32 12, i32 13>, %0 ], [ %24, %1 ]
%6 = phi <4 x i16> [ <i16 10, i16 11, i16 12, i16 13>, %0 ], [ %25, %1 ]
%7 = add <4 x i32> %5, <i32 4, i32 4, i32 4, i32 4>
%8 = add <4 x i16> %6, <i16 4, i16 4, i16 4, i16 4>
%9 = urem <4 x i16> %6, <i16 5, i16 5, i16 5, i16 5>
%10 = urem <4 x i16> %8, <i16 5, i16 5, i16 5, i16 5>
%11 = icmp eq <4 x i16> %9, zeroinitializer
%12 = icmp eq <4 x i16> %10, zeroinitializer
%13 = urem <4 x i16> %6, <i16 3, i16 3, i16 3, i16 3>
%14 = urem <4 x i16> %8, <i16 3, i16 3, i16 3, i16 3>
%15 = icmp eq <4 x i16> %13, zeroinitializer
%16 = icmp eq <4 x i16> %14, zeroinitializer
%17 = or <4 x i1> %11, %15
%18 = select <4 x i1> %17, <4 x i32> %5, <4 x i32> zeroinitializer
%19 = or <4 x i1> %12, %16
%20 = select <4 x i1> %19, <4 x i32> %7, <4 x i32> zeroinitializer
%21 = add <4 x i32> %18, %3
%22 = add <4 x i32> %20, %4
%23 = add nuw i32 %2, 8
%24 = add <4 x i32> %5, <i32 8, i32 8, i32 8, i32 8>
%25 = add <4 x i16> %6, <i16 8, i16 8, i16 8, i16 8>
%26 = icmp eq i32 %23, 984
br i1 %26, label %27, label %1
27: ; preds = %1
%28 = add <4 x i32> %22, %21
%29 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %28)
%30 = add nsw i32 0, %29
%31 = add nsw i32 995, %30
%32 = add nsw i32 %31, 996
%33 = add nsw i32 0, %32
%34 = add nsw i32 0, %33
%35 = add nsw i32 %34, 999
%36 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %35)
ret i32 0
}