#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*/ scanf(char *, int *);
int main() {
  int userInput = 0;
  scanf("%d", &userInput);
  if (userInput % 3 != 0)
    return -1;
  if (userInput % 5 != 0)
    return -2;
  if (userInput % 8 != 0)
    return -3;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xed3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1156 <main+0x46>
movl   $0xffffffff,-0x4(%rbp)
jmp    119d <main+0x8d>
mov    -0x8(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1176 <main+0x66>
movl   $0xfffffffe,-0x4(%rbp)
jmp    119d <main+0x8d>
mov    -0x8(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1196 <main+0x86>
movl   $0xfffffffd,-0x4(%rbp)
jmp    119d <main+0x8d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xee0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <scanf@plt>
mov    0x4(%rsp),%ecx
imul   $0xaaaaaaab,%ecx,%edx
add    $0x2aaaaaaa,%edx
mov    $0xffffffff,%eax
cmp    $0x55555554,%edx
jbe    1149 <main+0x39>
pop    %rcx
ret
imul   $0xcccccccd,%ecx,%edx
add    $0x19999999,%edx
mov    $0xfffffffe,%eax
cmp    $0x33333332,%edx
ja     1147 <main+0x37>
xor    %eax,%eax
test   $0x7,%cl
sete   %al
lea    (%rax,%rax,2),%eax
add    $0xfffffffd,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = srem i32 %4, 3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %0
store i32 -1, i32* %1
br label %19
8: ; preds = %0
%9 = load i32, i32* %2
%10 = srem i32 %9, 5
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 -2, i32* %1
br label %19
13: ; preds = %8
%14 = load i32, i32* %2
%15 = srem i32 %14, 8
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %13
store i32 -3, i32* %1
br label %19
18: ; preds = %13
store i32 0, i32* %1
br label %19
19: ; preds = %18, %17, %12, %7
%20 = load i32, i32* %1
ret i32 %20
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = srem i32 %4, 3
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %0
%8 = srem i32 %4, 5
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %7
%11 = and i32 %4, 7
%12 = icmp eq i32 %11, 0
%13 = select i1 %12, i32 0, i32 -3
br label %14
14: ; preds = %10, %7, %0
%15 = phi i32 [ -1, %0 ], [ -2, %7 ], [ %13, %10 ]
ret i32 %15
}