#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 */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
int isConcealedSquare(uint64_t i) {
  if (i % 10 != 0)
    return 0;
  i /= 100;
  for (uint32_t a = 9; i; a--) {
    if (i % 10 != a)
      return 0;
    i /= 100;
  }
  return 1;
}


x86 assembly (clang, -O0):
<isConcealedSquare>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1127 <isConcealedSquare+0x27>
movl   $0x0,-0x4(%rbp)
jmp    1189 <isConcealedSquare+0x89>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
movl   $0x9,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1182 <isConcealedSquare+0x82>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    -0xc(%rbp),%edx
je     1166 <isConcealedSquare+0x66>
movl   $0x0,-0x4(%rbp)
jmp    1189 <isConcealedSquare+0x89>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    113c <isConcealedSquare+0x3c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isConcealedSquare>:
imul   $0xcccccccd,%edi,%ecx
add    $0x19999998,%ecx
ror    %ecx
xor    %eax,%eax
cmp    $0x19999998,%ecx
jbe    1119 <isConcealedSquare+0x19>
ret
mov    $0x9,%eax
xchg   %ax,%ax
lea    0x63(%rdi),%r8d
cmp    $0xc7,%r8d
jb     116b <isConcealedSquare+0x6b>
movslq %edi,%rdx
imul   $0x51eb851f,%rdx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rdi
add    %edx,%edi
movslq %edi,%rdx
imul   $0x66666667,%rdx,%rsi
mov    %rsi,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rsi
add    %ecx,%esi
add    %esi,%esi
lea    (%rsi,%rsi,4),%ecx
sub    %ecx,%edx
lea    -0x1(%rax),%ecx
cmp    %edx,%eax
mov    %ecx,%eax
je     1120 <isConcealedSquare+0x20>
xor    %eax,%eax
cmp    $0xc7,%r8d
setb   %al
ret

LLVM IR (-O0):
define i32 @isConcealedSquare(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = srem i32 %5, 10
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %28
9: ; preds = %1
%10 = load i32, i32* %3
%11 = sdiv i32 %10, 100
store i32 %11, i32* %3
store i32 9, i32* %4
br label %12
12: ; preds = %24, %9
%13 = load i32, i32* %3
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %27
15: ; preds = %12
%16 = load i32, i32* %3
%17 = srem i32 %16, 10
%18 = load i32, i32* %4
%19 = icmp ne i32 %17, %18
br i1 %19, label %20, label %21
20: ; preds = %15
store i32 0, i32* %2
br label %28
21: ; preds = %15
%22 = load i32, i32* %3
%23 = sdiv i32 %22, 100
store i32 %23, i32* %3
br label %24
24: ; preds = %21
%25 = load i32, i32* %4
%26 = add nsw i32 %25, -1
store i32 %26, i32* %4
br label %12
27: ; preds = %12
store i32 1, i32* %2
br label %28
28: ; preds = %27, %20, %8
%29 = load i32, i32* %2
ret i32 %29
}

LLVM IR (-O2):
define i32 @isConcealedSquare(i32 %0) {
%2 = srem i32 %0, 10
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %17
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ %0, %1 ]
%6 = phi i32 [ %14, %4 ], [ 9, %1 ]
%7 = sdiv i32 %5, 100
%8 = add i32 %5, 99
%9 = icmp ult i32 %8, 199
%10 = xor i1 %9, true
%11 = srem i32 %7, 10
%12 = icmp eq i32 %11, %6
%13 = select i1 %10, i1 %12, i1 false
%14 = add nsw i32 %6, -1
br i1 %13, label %4, label %15
15: ; preds = %4
%16 = zext i1 %9 to i32
br label %17
17: ; preds = %15, %1
%18 = phi i32 [ 0, %1 ], [ %16, %15 ]
ret i32 %18
}