#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 /*<<< orphan*/ system(char *);
int main() {
  int val, contatore = 0;
  printf("Inserisci una serie di interi(-1 per terminare) :\n");
  do {
    scanf("%d", &val);
    if (val > -1 && (val % 3 == 0 || val % 5 == 0 || val % 7 == 0))
      contatore++;
  } while (val != -1);
  printf("Il numero di multipli di 3 o 5 o 7 è %d", contatore);
  printf("\n");
  system("pause");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xefe(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0xffffffff,-0x8(%rbp)
jle    11b3 <main+0x83>
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     11aa <main+0x7a>
mov    -0x8(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     11aa <main+0x7a>
mov    -0x8(%rbp),%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11b3 <main+0x83>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11b8 <main+0x88>
cmpl   $0xffffffff,-0x8(%rbp)
jne    1154 <main+0x24>
mov    -0xc(%rbp),%esi
lea    0xe67(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe57(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe74(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xecf(%rip),%rdi
call   1040 <puts@plt>
xor    %ebx,%ebx
lea    0xeb8(%rip),%r14
lea    0xc(%rsp),%r15
jmp    1185 <main+0x35>
cs nopw 0x0(%rax,%rax,1)
nop
cmp    $0xffffffff,%eax
je     11d0 <main+0x80>
mov    %r14,%rdi
mov    %r15,%rsi
call   1070 <scanf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
js     1180 <main+0x30>
imul   $0xaaaaaaab,%eax,%ecx
cmp    $0x55555556,%ecx
setb   %cl
imul   $0xcccccccd,%eax,%edx
cmp    $0x33333334,%edx
setb   %dl
or     %cl,%dl
imul   $0xb6db6db7,%eax,%ecx
cmp    $0x24924925,%ecx
setb   %cl
or     %dl,%cl
movzbl %cl,%ecx
add    %ecx,%ebx
jmp    1180 <main+0x30>
lea    0xe29(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe38(%rip),%rdi
call   1050 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [51 x i8] c"Inserisci una serie di interi(-1 per terminare) :\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [41 x i8] c"Il numero di multipli di 3 o 5 o 7 \C3\A8 %d\00"
@.str.3 = [2 x i8] c"\0A\00"
@.str.4 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %25, %0
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
%8 = icmp sgt i32 %7, -1
br i1 %8, label %9, label %24
9: ; preds = %5
%10 = load i32, i32* %2
%11 = srem i32 %10, 3
%12 = icmp eq i32 %11, 0
br i1 %12, label %21, label %13
13: ; preds = %9
%14 = load i32, i32* %2
%15 = srem i32 %14, 5
%16 = icmp eq i32 %15, 0
br i1 %16, label %21, label %17
17: ; preds = %13
%18 = load i32, i32* %2
%19 = srem i32 %18, 7
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %24
21: ; preds = %17, %13, %9
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 1
store i32 %23, i32* %3
br label %24
24: ; preds = %21, %17, %5
br label %25
25: ; preds = %24
%26 = load i32, i32* %2
%27 = icmp ne i32 %26, -1
br i1 %27, label %5, label %28
28: ; preds = %25
%29 = load i32, i32* %3
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0), i32 %29)
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%32 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [41 x i8] c"Il numero di multipli di 3 o 5 o 7 \C3\A8 %d\00"
@.str.4 = [6 x i8] c"pause\00"
@str = [50 x i8] c"Inserisci una serie di interi(-1 per terminare) :\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
br label %4
4: ; preds = %20, %0
%5 = phi i32 [ 0, %0 ], [ %21, %20 ]
%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 = icmp sgt i32 %7, -1
br i1 %8, label %9, label %20
9: ; preds = %4
%10 = urem i32 %7, 3
%11 = icmp eq i32 %10, 0
%12 = urem i32 %7, 5
%13 = icmp eq i32 %12, 0
%14 = or i1 %11, %13
%15 = urem i32 %7, 7
%16 = icmp eq i32 %15, 0
%17 = select i1 %14, i1 true, i1 %16
%18 = zext i1 %17 to i32
%19 = add nsw i32 %5, %18
br label %20
20: ; preds = %9, %4
%21 = phi i32 [ %5, %4 ], [ %19, %9 ]
%22 = icmp eq i32 %7, -1
br i1 %22, label %23, label %4
23: ; preds = %20
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0), i32 %21)
%25 = call i32 @putchar(i32 10)
%26 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}