#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 counter;
  printf("Enter a series of values (ending with -1)\n\n");
  do {
    printf("Enter a value: ");
    scanf("%d", &counter);
    if (counter != -1) {
      if (counter % 2 == 0)
        continue;
      if (counter % 3 == 0)
        continue;
      printf("The value %d is not divisible by 2 or 3.\n\n", counter);
    }
  } while (counter != -1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeea(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0xffffffff,-0x8(%rbp)
je     11a8 <main+0x88>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    117e <main+0x5e>
jmp    11ad <main+0x8d>
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1197 <main+0x77>
jmp    11ad <main+0x8d>
mov    -0x8(%rbp),%esi
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ad <main+0x8d>
cmpl   $0xffffffff,-0x8(%rbp)
jne    113d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xeff(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb5(%rip),%r14
lea    0xebe(%rip),%r15
lea    0x4(%rsp),%rbx
lea    0xeb5(%rip),%r12
jmp    1165 <main+0x35>
cmp    $0xffffffff,%esi
je     11ac <main+0x7c>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%esi
imul   $0xaaaaaaab,%esi,%eax
add    $0x2aaaaaaa,%eax
cmp    $0x55555555,%eax
jb     1160 <main+0x30>
cmp    $0xffffffff,%esi
je     1160 <main+0x30>
mov    %esi,%eax
and    $0x1,%eax
je     1160 <main+0x30>
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%esi
jmp    1160 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [44 x i8] c"Enter a series of values (ending with -1)\0A\0A\00"
@.str.1 = [16 x i8] c"Enter a value: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [43 x i8] c"The value %d is not divisible by 2 or 3.\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %23, %0
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
%8 = icmp ne i32 %7, -1
br i1 %8, label %9, label %22
9: ; preds = %4
%10 = load i32, i32* %2
%11 = srem i32 %10, 2
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %9
br label %23
14: ; preds = %9
%15 = load i32, i32* %2
%16 = srem i32 %15, 3
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %14
br label %23
19: ; preds = %14
%20 = load i32, i32* %2
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0), i32 %20)
br label %22
22: ; preds = %19, %4
br label %23
23: ; preds = %22, %18, %13
%24 = load i32, i32* %2
%25 = icmp ne i32 %24, -1
br i1 %25, label %4, label %26
26: ; preds = %23
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [16 x i8] c"Enter a value: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [43 x i8] c"The value %d is not divisible by 2 or 3.\0A\0A\00"
@str = [43 x i8] c"Enter a series of values (ending with -1)\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
br label %4
4: ; preds = %18, %0
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
%8 = icmp eq i32 %7, -1
%9 = and i32 %7, 1
%10 = icmp eq i32 %9, 0
%11 = or i1 %8, %10
%12 = srem i32 %7, 3
%13 = icmp eq i32 %12, 0
%14 = or i1 %13, %11
br i1 %14, label %18, label %15
15: ; preds = %4
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0), i32 %7)
%17 = load i32, i32* %1
br label %18
18: ; preds = %4, %15
%19 = phi i32 [ %7, %4 ], [ %17, %15 ]
%20 = icmp eq i32 %19, -1
br i1 %20, label %21, label %4
21: ; preds = %18
ret i32 0
}