#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__ isDivisible(char *, unsigned int, unsigned int);
unsigned int no_of_digits(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ rewind(int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, ...);
int /*<<< orphan*/ stdin;
int main() {
  char str[1000];
  unsigned int digits, k;
  scanf("%s", str);
  rewind(stdin);
  digits = no_of_digits(str);
  scanf("%d", &k);
  if (isDivisible(str, digits, k))
    printf("\nDivisible");
  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    0xe90(%rip),%rdi
mov    $0x0,%al
call   1070 <scanf@plt>
mov    0x2e6a(%rip),%rax
mov    (%rax),%edi
call   1050 <rewind@plt>
lea    -0x3f0(%rbp),%rdi
call   1060 <no_of_digits@plt>
mov    %eax,-0x3f4(%rbp)
lea    0xe65(%rip),%rdi
lea    -0x3f8(%rbp),%rsi
mov    $0x0,%al
call   1070 <scanf@plt>
lea    -0x3f0(%rbp),%rdi
mov    -0x3f4(%rbp),%esi
mov    -0x3f8(%rbp),%edx
call   1030 <isDivisible@plt>
cmp    $0x0,%rax
je     11df <main+0x8f>
lea    0xe31(%rip),%rdi
call   1040 <printf@plt>
jmp    11eb <main+0x9b>
lea    0xe2b(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x3f8,%rsp
lea    0xea0(%rip),%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
call   1050 <rewind@plt>
mov    %rbx,%rdi
call   1060 <no_of_digits@plt>
mov    %eax,%ebp
lea    0xe75(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
mov    0xc(%rsp),%edx
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <isDivisible@plt>
test   %rax,%rax
lea    0xe5f(%rip),%rax
lea    0xe4d(%rip),%rdi
cmove  %rax,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x3f8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@stdin = global i32 0
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [11 x i8] c"\0ADivisible\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 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%6 = load i32, i32* @stdin
%7 = call i32 @rewind(i32 %6)
%8 = call i32 @no_of_digits(i8* %3)
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%10 = load i32, i32* %2
%11 = call i64 @isDivisible(i8* %3, i32 %8, i32 %10)
%12 = icmp eq i64 %11, 0
%13 = select i1 %12, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0)
%14 = call i32 @printf(i8* dereferenceable(1) %13)
ret i32 0
}