#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 */
long MultOrd(int, int);
int /*<<< orphan*/ printf(char *, long, ...);
int main() {
  long int i, j, currlen, currid, templen;
  currlen = 0;
  currid = 0;
  for (i = 3; i < 1000; i++) {
    j = i;
    while (!(j % 5))
      j /= 5;
    while (!(j % 2))
      j /= 2;
    templen = MultOrd(10, j);
    if (templen > currlen) {
      currlen = templen;
      currid = i;
      printf("%ld\t%ld\n", currlen, currid);
    }
  }
  printf("%ld\n", currid);
  printf("%ld\n", MultOrd(10, 989));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
movq   $0x3,-0x10(%rbp)
cmpq   $0x3e8,-0x10(%rbp)
jge    1236 <main+0x116>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    $0x5,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1181 <main+0x61>
jmp    1198 <main+0x78>
mov    -0x18(%rbp),%rax
mov    $0x5,%ecx
cqto
idiv   %rcx
mov    %rax,-0x18(%rbp)
jmp    115d <main+0x3d>
jmp    119d <main+0x7d>
mov    -0x18(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    11c1 <main+0xa1>
jmp    11d8 <main+0xb8>
mov    -0x18(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,-0x18(%rbp)
jmp    119d <main+0x7d>
mov    -0x18(%rbp),%rax
mov    %eax,%esi
mov    $0xa,%edi
call   1030 <MultOrd@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
cmp    -0x20(%rbp),%rax
jle    1220 <main+0x100>
mov    -0x30(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
lea    0xde7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1225 <main+0x105>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1147 <main+0x27>
mov    -0x28(%rbp),%rsi
lea    0xdc3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xa,%edi
mov    $0x3dd,%esi
call   1030 <MultOrd@plt>
mov    %rax,%rsi
lea    0xda3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    $0x3,%ebx
movabs $0xcccccccccccccccd,%r13
cc cc cc
movabs $0x3333333333333333,%rbp
33 33 33
movabs $0x6666666666666667,%r14
66 66 66
movabs $0x1999999999999999,%r15
99 99 19
xor    %eax,%eax
mov    %rax,0x8(%rsp)
xor    %eax,%eax
mov    %rax,0x10(%rsp)
jmp    1181 <main+0x61>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbx
cmp    $0x3e8,%rbx
je     1210 <main+0xf0>
mov    %rbx,%rax
imul   %r13,%rax
mov    %rbx,%rdx
cmp    %rbp,%rax
ja     11b2 <main+0x92>
mov    %rdx,%rax
imul   %r14
mov    %rdx,%rax
shr    $0x3f,%rax
sar    %rdx
add    %rax,%rdx
mov    %rdx,%rax
imul   %r13,%rax
add    %r15,%rax
cmp    %rbp,%rax
jb     1190 <main+0x70>
test   $0x1,%dl
jne    11d4 <main+0xb4>
nopw   0x0(%rax,%rax,1)
mov    %rdx,%rax
shr    $0x3f,%rax
add    %rdx,%rax
sar    %rax
mov    %rax,%rdx
test   $0x1,%al
je     11c0 <main+0xa0>
mov    $0xa,%edi
mov    %edx,%esi
call   1030 <MultOrd@plt>
cmp    0x10(%rsp),%rax
jle    1170 <main+0x50>
mov    %rax,%r12
lea    0xe0f(%rip),%rdi
mov    %rax,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,0x10(%rsp)
mov    %rbx,%rax
mov    %rbx,0x8(%rsp)
jmp    1170 <main+0x50>
lea    0xded(%rip),%rbx
mov    %rbx,%rdi
mov    0x8(%rsp),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
mov    $0x3dd,%esi
call   1030 <MultOrd@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%ld\09%ld\0A\00"
@.str.1 = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i32 0, i32* %1
store i64 0, i64* %4
store i64 0, i64* %5
store i64 3, i64* %2
br label %7
7: ; preds = %43, %0
%8 = load i64, i64* %2
%9 = icmp slt i64 %8, 1000
br i1 %9, label %10, label %46
10: ; preds = %7
%11 = load i64, i64* %2
store i64 %11, i64* %3
br label %12
12: ; preds = %17, %10
%13 = load i64, i64* %3
%14 = srem i64 %13, 5
%15 = icmp ne i64 %14, 0
%16 = xor i1 %15, true
br i1 %16, label %17, label %20
17: ; preds = %12
%18 = load i64, i64* %3
%19 = sdiv i64 %18, 5
store i64 %19, i64* %3
br label %12
20: ; preds = %12
br label %21
21: ; preds = %26, %20
%22 = load i64, i64* %3
%23 = srem i64 %22, 2
%24 = icmp ne i64 %23, 0
%25 = xor i1 %24, true
br i1 %25, label %26, label %29
26: ; preds = %21
%27 = load i64, i64* %3
%28 = sdiv i64 %27, 2
store i64 %28, i64* %3
br label %21
29: ; preds = %21
%30 = load i64, i64* %3
%31 = trunc i64 %30 to i32
%32 = call i64 @MultOrd(i32 10, i32 %31)
store i64 %32, i64* %6
%33 = load i64, i64* %6
%34 = load i64, i64* %4
%35 = icmp sgt i64 %33, %34
br i1 %35, label %36, label %42
36: ; preds = %29
%37 = load i64, i64* %6
store i64 %37, i64* %4
%38 = load i64, i64* %2
store i64 %38, i64* %5
%39 = load i64, i64* %4
%40 = load i64, i64* %5
%41 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 %39, i64 %40)
br label %42
42: ; preds = %36, %29
br label %43
43: ; preds = %42
%44 = load i64, i64* %2
%45 = add nsw i64 %44, 1
store i64 %45, i64* %2
br label %7
46: ; preds = %7
%47 = load i64, i64* %5
%48 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %47)
%49 = call i64 @MultOrd(i32 10, i32 989)
%50 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %49)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%ld\09%ld\0A\00"
@.str.1 = [5 x i8] c"%ld\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %28
%2 = phi i64 [ 3, %0 ], [ %31, %28 ]
%3 = phi i64 [ 0, %0 ], [ %30, %28 ]
%4 = phi i64 [ 0, %0 ], [ %29, %28 ]
%5 = urem i64 %2, 5
%6 = icmp eq i64 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %11, %1
%8 = phi i64 [ %2, %1 ], [ %13, %11 ]
%9 = and i64 %8, 1
%10 = icmp eq i64 %9, 0
br i1 %10, label %16, label %21
11: ; preds = %1, %11
%12 = phi i64 [ %13, %11 ], [ %2, %1 ]
%13 = sdiv i64 %12, 5
%14 = srem i64 %13, 5
%15 = icmp eq i64 %14, 0
br i1 %15, label %11, label %7
16: ; preds = %7, %16
%17 = phi i64 [ %18, %16 ], [ %8, %7 ]
%18 = sdiv i64 %17, 2
%19 = and i64 %18, 1
%20 = icmp eq i64 %19, 0
br i1 %20, label %16, label %21
21: ; preds = %16, %7
%22 = phi i64 [ %8, %7 ], [ %18, %16 ]
%23 = trunc i64 %22 to i32
%24 = tail call i64 @MultOrd(i32 10, i32 %23)
%25 = icmp sgt i64 %24, %4
br i1 %25, label %26, label %28
26: ; preds = %21
%27 = tail call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 %24, i64 %2)
br label %28
28: ; preds = %21, %26
%29 = phi i64 [ %24, %26 ], [ %4, %21 ]
%30 = phi i64 [ %2, %26 ], [ %3, %21 ]
%31 = add nuw nsw i64 %2, 1
%32 = icmp eq i64 %31, 1000
br i1 %32, label %33, label %1
33: ; preds = %28
%34 = tail call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %30)
%35 = tail call i64 @MultOrd(i32 10, i32 989)
%36 = tail call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %35)
ret i32 0
}