#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 */
scalar_t__ is_divisible(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *, unsigned int *);
int main() {
  char str[1000];
  unsigned int k;
  scanf("%s%d", str, &k);
  if ((k % 3) == 0)
    printf("is Divisible");
  else if (is_divisible(str))
    printf("Divisible by 3");
  else
    printf("Not Divisible");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rsi
lea    0xeb0(%rip),%rdi
lea    -0x3f4(%rbp),%rdx
call   1050 <scanf@plt>
mov    -0x3f4(%rbp),%eax
mov    $0x3,%ecx
xor    %edx,%edx
div    %ecx
cmp    $0x0,%edx
jne    1185 <main+0x55>
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
jmp    11bd <main+0x8d>
lea    -0x3f0(%rbp),%rdi
call   1040 <is_divisible@plt>
cmp    $0x0,%rax
je     11ac <main+0x7c>
lea    0xe70(%rip),%rdi
call   1030 <printf@plt>
jmp    11b8 <main+0x88>
lea    0xe6e(%rip),%rdi
call   1030 <printf@plt>
jmp    11bd <main+0x8d>
mov    -0x4(%rbp),%eax
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x3f8,%rsp
lea    0xec2(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1050 <scanf@plt>
imul   $0xaaaaaaab,0xc(%rsp),%eax
aa
cmp    $0x55555556,%eax
jb     117d <main+0x4d>
lea    0x10(%rsp),%rdi
call   1040 <is_divisible@plt>
test   %rax,%rax
lea    0xeb1(%rip),%rax
lea    0xe9b(%rip),%rdi
cmove  %rax,%rdi
jmp    1184 <main+0x54>
lea    0xe81(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x3f8,%rsp
ret

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

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