#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)
      break;
    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 (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)
jne    116a <main+0x4a>
jmp    11bc <main+0x9c>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1183 <main+0x63>
jmp    11ad <main+0x8d>
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    119c <main+0x7c>
jmp    11ad <main+0x8d>
mov    -0x8(%rbp),%esi
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%al
test   $0x1,%al
jne    113d <main+0x1d>
jmp    11bc <main+0x9c>
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),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb7(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%esi
cmp    $0xffffffff,%esi
je     11e0 <main+0xb0>
lea    0xe8d(%rip),%r14
lea    0xe96(%rip),%r15
lea    0x4(%rsp),%rbx
lea    0xe8d(%rip),%r12
jmp    11ae <main+0x7e>
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%esi
cmp    $0xffffffff,%esi
je     11e0 <main+0xb0>
test   $0x1,%sil
je     1190 <main+0x60>
movslq %esi,%rax
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
lea    (%rax,%rax,2),%eax
mov    %esi,%ecx
sub    %eax,%ecx
je     1190 <main+0x60>
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1190 <main+0x60>
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 eq i32 %7, -1
br i1 %8, label %9, label %10
9: ; preds = %4
br label %24
10: ; preds = %4
%11 = load i32, i32* %2
%12 = srem i32 %11, 2
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %10
br label %23
15: ; preds = %10
%16 = load i32, i32* %2
%17 = srem i32 %16, 3
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %15
br label %23
20: ; preds = %15
%21 = load i32, i32* %2
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0), i32 %21)
br label %23
23: ; preds = %20, %19, %14
br i1 true, label %4, label %24
24: ; preds = %23, %9
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))
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = icmp eq i32 %6, -1
br i1 %7, label %22, label %8
8: ; preds = %0, %17
%9 = phi i32 [ %20, %17 ], [ %6, %0 ]
%10 = and i32 %9, 1
%11 = icmp eq i32 %10, 0
%12 = srem i32 %9, 3
%13 = icmp eq i32 %12, 0
%14 = or i1 %11, %13
br i1 %14, label %17, label %15
15: ; preds = %8
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0), i32 %9)
br label %17
17: ; preds = %8, %15
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%20 = load i32, i32* %1
%21 = icmp eq i32 %20, -1
br i1 %21, label %22, label %8
22: ; preds = %17, %0
ret i32 0
}