#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*/ getch();
int primepow(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int inp;
  printf("Please enter number whose number of zeros is sought after:\n");
  scanf("%d", &inp);
  int i, j;
  i = primepow(inp, 2);
  j = primepow(inp, 5);
  if (i < j) {
    printf("The no of zeros are\n%d", i);
  } else if (i > j) {
    printf("The no of zeroes are\n%d", j);
  }
  getch();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf04(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
mov    $0x2,%esi
call   1040 <primepow@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x5,%esi
call   1040 <primepow@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11af <main+0x6f>
mov    -0xc(%rbp),%esi
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d1 <main+0x91>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    11cc <main+0x8c>
mov    -0x10(%rbp),%esi
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d1 <main+0x91>
mov    $0x0,%al
call   1060 <getch@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
lea    0xec4(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1060 <scanf@plt>
mov    0xc(%rsp),%edi
mov    $0x2,%esi
call   1050 <primepow@plt>
mov    %eax,%ebx
mov    0xc(%rsp),%edi
mov    $0x5,%esi
call   1050 <primepow@plt>
cmp    %eax,%ebx
jge    119f <main+0x4f>
lea    0xe65(%rip),%rdi
mov    %ebx,%esi
jmp    11aa <main+0x5a>
jle    11b1 <main+0x61>
lea    0xe6f(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1070 <getch@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [60 x i8] c"Please enter number whose number of zeros is sought after:\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [23 x i8] c"The no of zeros are\0A%d\00"
@.str.3 = [24 x i8] c"The no of zeroes are\0A%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
%8 = call i32 @primepow(i32 %7, i32 2)
store i32 %8, i32* %3
%9 = load i32, i32* %2
%10 = call i32 @primepow(i32 %9, i32 5)
store i32 %10, i32* %4
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %17
14: ; preds = %0
%15 = load i32, i32* %3
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %15)
br label %25
17: ; preds = %0
%18 = load i32, i32* %3
%19 = load i32, i32* %4
%20 = icmp sgt i32 %18, %19
br i1 %20, label %21, label %24
21: ; preds = %17
%22 = load i32, i32* %4
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i32 %22)
br label %24
24: ; preds = %21, %17
br label %25
25: ; preds = %24, %14
%26 = call i32 (...) @getch()
%27 = load i32, i32* %1
ret i32 %27
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [23 x i8] c"The no of zeros are\0A%d\00"
@.str.3 = [24 x i8] c"The no of zeroes are\0A%d\00"
@str = [59 x i8] c"Please enter number whose number of zeros is sought after:\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @primepow(i32 %5, i32 2)
%7 = load i32, i32* %1
%8 = call i32 @primepow(i32 %7, i32 5)
%9 = icmp slt i32 %6, %8
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %6)
br label %16
12: ; preds = %0
%13 = icmp sgt i32 %6, %8
br i1 %13, label %14, label %16
14: ; preds = %12
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i32 %8)
br label %16
16: ; preds = %12, %14, %10
%17 = call i32 (...) @getch()
ret i32 0
}