#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 EXIT_SUCCESS;
int /*<<< orphan*/ checkIntInput(unsigned long long *);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int zeroes = 0;
  unsigned long long powerOfFive, n;
  printf("Enter two numbers: ");
  checkIntInput(&n);
  for (powerOfFive = 5; powerOfFive <= n; powerOfFive *= 5) {
    zeroes += n / powerOfFive;
  }
  printf("There is %d in %llu!", zeroes, n);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x18(%rbp),%rdi
call   1030 <checkIntInput@plt>
movq   $0x5,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
ja     118a <main+0x6a>
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
imul   $0x5,-0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1155 <main+0x35>
mov    -0x8(%rbp),%esi
mov    -0x18(%rbp),%rdx
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2e3a(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x8(%rsp),%rdi
call   1030 <checkIntInput@plt>
mov    0x8(%rsp),%rcx
cmp    $0x5,%rcx
jae    116c <main+0x4c>
lea    0xec3(%rip),%rdi
mov    %ebx,%esi
mov    %rcx,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2e7c(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbx
ret
mov    $0x5,%esi
jmp    1193 <main+0x73>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rcx,%rax
xor    %edx,%edx
div    %rsi
add    %eax,%ebx
lea    (%rsi,%rsi,4),%rsi
cmp    %rcx,%rsi
ja     114a <main+0x2a>
mov    %rcx,%rax
or     %rsi,%rax
shr    $0x20,%rax
jne    1180 <main+0x60>
mov    %ecx,%eax
xor    %edx,%edx
div    %esi
jmp    1188 <main+0x68>

LLVM IR (-O0):
@.str = [20 x i8] c"Enter two numbers: \00"
@.str.1 = [21 x i8] c"There is %d in %llu!\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
%4 = alloca i64
store i32 0, i32* %1
store i32 0, i32* %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @checkIntInput(i64* %4)
store i64 5, i64* %3
br label %7
7: ; preds = %19, %0
%8 = load i64, i64* %3
%9 = load i64, i64* %4
%10 = icmp ule i64 %8, %9
br i1 %10, label %11, label %22
11: ; preds = %7
%12 = load i64, i64* %4
%13 = load i64, i64* %3
%14 = udiv i64 %12, %13
%15 = load i32, i32* %2
%16 = sext i32 %15 to i64
%17 = add i64 %16, %14
%18 = trunc i64 %17 to i32
store i32 %18, i32* %2
br label %19
19: ; preds = %11
%20 = load i64, i64* %3
%21 = mul i64 %20, 5
store i64 %21, i64* %3
br label %7
22: ; preds = %7
%23 = load i32, i32* %2
%24 = load i64, i64* %4
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %23, i64 %24)
%26 = load i32, i32* @EXIT_SUCCESS
ret i32 %26
}

LLVM IR (-O2):
@.str = [20 x i8] c"Enter two numbers: \00"
@.str.1 = [21 x i8] c"There is %d in %llu!\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @checkIntInput(i64* %1)
%5 = load i64, i64* %1
%6 = icmp ult i64 %5, 5
br i1 %6, label %15, label %7
7: ; preds = %0, %7
%8 = phi i64 [ %13, %7 ], [ 5, %0 ]
%9 = phi i32 [ %12, %7 ], [ 0, %0 ]
%10 = udiv i64 %5, %8
%11 = trunc i64 %10 to i32
%12 = add i32 %9, %11
%13 = mul i64 %8, 5
%14 = icmp ugt i64 %13, %5
br i1 %14, label %15, label %7
15: ; preds = %7, %0
%16 = phi i32 [ 0, %0 ], [ %12, %7 ]
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %16, i64 %5)
%18 = load i32, i32* @EXIT_SUCCESS
ret i32 %18
}