#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*/ printf(char *);
int /*<<< orphan*/ scanf(char *, unsigned long long *);
int main() {
  unsigned long long int egn, temp, sum = 0, a = 0, b = 0, c = 0, day, mounth,
                                    year, n;
  int i = 0;
  scanf("%llu", &egn);
  temp = egn;
  for (i = 0; temp > 0; i++)
    temp = temp / 10;
  if (i != 10)
    return -1;
  temp = egn;
  n = temp % 10;
  temp = temp / 10;
  sum = (temp % 10) * 6 + ((temp / 10) % 10) * 3 + ((temp / 100) % 10) * 7 +
        ((temp / 1000) % 10) * 9 + ((temp / 10000) % 10) * 10 +
        ((temp / 100000) % 10) * 5 + ((temp / 1000000) % 10) * 8 +
        ((temp / 10000000) % 10) * 4 + ((temp / 100000000) % 10) * 2;
  sum = sum % 11;
  if (sum == 10)
    sum = 0;
  if (n == sum)
    a = 1;
  temp = egn / 10000;
  day = temp % 10 + ((temp / 10) % 10) * 10;
  temp = temp / 100;
  mounth = temp % 10 + ((temp / 10) % 10) * 10;
  temp = temp / 100;
  year = temp % 10 + ((temp / 10) % 10) * 10;
  if (year >= 0 && year <= 16)
    mounth = mounth - 40;
  if (mounth > 0 && mounth < 13)
    b = 1;
  if (mounth == 2) {
    if (day > 0 && day < 30)
      c = 1;
  } else {
    if (day > 0 && day < 32)
      c = 1;
  }
  if (a == 1 && b == 1 && c == 1)
    printf("1 \n");
  else
    printf("0 \n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
movl   $0x0,-0x5c(%rbp)
lea    0xea0(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x5c(%rbp)
cmpq   $0x0,-0x18(%rbp)
jbe    11a3 <main+0x83>
mov    -0x18(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x18(%rbp)
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    1178 <main+0x58>
cmpl   $0xa,-0x5c(%rbp)
je     11b9 <main+0x99>
movl   $0xffffffff,-0x4(%rbp)
jmp    1558 <main+0x438>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %rdx,-0x58(%rbp)
mov    -0x18(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
imul   $0x6,%rdx,%rax
mov    %rax,-0xa0(%rbp)
mov    -0x18(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    -0xa0(%rbp),%rax
imul   $0x3,%rdx,%rcx
add    %rcx,%rax
mov    %rax,-0x98(%rbp)
mov    -0x18(%rbp),%rax
mov    $0x64,%ecx
xor    %edx,%edx
div    %rcx
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    -0x98(%rbp),%rax
imul   $0x7,%rdx,%rcx
add    %rcx,%rax
mov    %rax,-0x90(%rbp)
mov    -0x18(%rbp),%rax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %rcx
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    -0x90(%rbp),%rax
imul   $0x9,%rdx,%rcx
add    %rcx,%rax
mov    %rax,-0x88(%rbp)
mov    -0x18(%rbp),%rax
mov    $0x2710,%ecx
xor    %edx,%edx
div    %rcx
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    -0x88(%rbp),%rax
imul   $0xa,%rdx,%rcx
add    %rcx,%rax
mov    %rax,-0x80(%rbp)
mov    -0x18(%rbp),%rax
mov    $0x186a0,%ecx
xor    %edx,%edx
div    %rcx
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    -0x80(%rbp),%rax
imul   $0x5,%rdx,%rcx
add    %rcx,%rax
mov    %rax,-0x78(%rbp)
mov    -0x18(%rbp),%rax
mov    $0xf4240,%ecx
xor    %edx,%edx
div    %rcx
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    -0x78(%rbp),%rax
shl    $0x3,%rdx
add    %rdx,%rax
mov    %rax,-0x70(%rbp)
mov    -0x18(%rbp),%rax
mov    $0x989680,%ecx
xor    %edx,%edx
div    %rcx
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    -0x70(%rbp),%rax
shl    $0x2,%rdx
add    %rdx,%rax
mov    %rax,-0x68(%rbp)
mov    -0x18(%rbp),%rax
mov    $0x5f5e100,%ecx
xor    %edx,%edx
div    %rcx
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    -0x68(%rbp),%rax
shl    $0x1,%rdx
add    %rdx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    $0xb,%ecx
xor    %edx,%edx
div    %rcx
mov    %rdx,-0x20(%rbp)
cmpq   $0xa,-0x20(%rbp)
jne    1370 <main+0x250>
movq   $0x0,-0x20(%rbp)
mov    -0x58(%rbp),%rax
cmp    -0x20(%rbp),%rax
jne    1386 <main+0x266>
movq   $0x1,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x2710,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %rdx,-0xb8(%rbp)
mov    -0x18(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %rdx,%rax
mov    -0xb8(%rbp),%rdx
imul   $0xa,%rax,%rax
add    %rax,%rdx
mov    %rdx,-0x40(%rbp)
mov    -0x18(%rbp),%rax
mov    $0x64,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %rdx,-0xb0(%rbp)
mov    -0x18(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %rdx,%rax
mov    -0xb0(%rbp),%rdx
imul   $0xa,%rax,%rax
add    %rax,%rdx
mov    %rdx,-0x48(%rbp)
mov    -0x18(%rbp),%rax
mov    $0x64,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %rdx,-0xa8(%rbp)
mov    -0x18(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %rdx,%rax
mov    -0xa8(%rbp),%rdx
imul   $0xa,%rax,%rax
add    %rax,%rdx
mov    %rdx,-0x50(%rbp)
cmpq   $0x0,-0x50(%rbp)
jb     14a4 <main+0x384>
cmpq   $0x10,-0x50(%rbp)
ja     14a4 <main+0x384>
mov    -0x48(%rbp),%rax
sub    $0x28,%rax
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
jbe    14c2 <main+0x3a2>
cmpq   $0xd,-0x48(%rbp)
jae    14c2 <main+0x3a2>
movq   $0x1,-0x30(%rbp)
cmpq   $0x2,-0x48(%rbp)
jne    14f0 <main+0x3d0>
cmpq   $0x0,-0x40(%rbp)
jbe    14eb <main+0x3cb>
cmpq   $0x1e,-0x40(%rbp)
jae    14eb <main+0x3cb>
movq   $0x1,-0x38(%rbp)
jmp    1513 <main+0x3f3>
cmpq   $0x0,-0x40(%rbp)
jbe    150e <main+0x3ee>
cmpq   $0x20,-0x40(%rbp)
jae    150e <main+0x3ee>
movq   $0x1,-0x38(%rbp)
jmp    1513 <main+0x3f3>
cmpq   $0x1,-0x28(%rbp)
jne    1545 <main+0x425>
cmpq   $0x1,-0x30(%rbp)
jne    1545 <main+0x425>
cmpq   $0x1,-0x38(%rbp)
jne    1545 <main+0x425>
lea    0xaca(%rip),%rdi
call   1030 <printf@plt>
jmp    1551 <main+0x431>
lea    0xabd(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x8(%rsp),%rcx
mov    $0xffffffff,%ebp
test   %rcx,%rcx
je     13e0 <main+0x2c0>
mov    $0xa,%ebx
movabs $0xcccccccccccccccd,%rdi
cc cc cc
mov    %rcx,%rsi
xchg   %ax,%ax
mov    %rsi,%rax
mul    %rdi
shr    $0x3,%rdx
add    $0xffffffff,%ebx
cmp    $0x9,%rsi
mov    %rdx,%rsi
ja     1160 <main+0x40>
test   %ebx,%ebx
jne    13e0 <main+0x2c0>
mov    %rcx,%rax
mul    %rdi
mov    %rdx,%rsi
shr    $0x3,%rsi
lea    (%rsi,%rsi,1),%rax
lea    (%rax,%rax,4),%rax
mov    %rcx,%r10
sub    %rax,%r10
mov    %rsi,%rax
mul    %rdi
shr    $0x2,%rdx
and    $0xfffffffffffffffe,%rdx
lea    (%rdx,%rdx,4),%rax
sub    %rax,%rsi
lea    (%rsi,%rsi,2),%rbp
mov    %rcx,%rax
shr    $0x2,%rax
movabs $0x28f5c28f5c28f5c3,%rdx
c2 f5 28
mul    %rdx
mov    %rdx,%rsi
shr    $0x2,%rsi
mov    %rsi,%rax
mul    %rdi
shr    $0x2,%rdx
and    $0xfffffffffffffffe,%rdx
lea    (%rdx,%rdx,4),%rax
sub    %rax,%rsi
lea    (%rsi,%rsi,2),%rax
lea    (%rax,%rbp,2),%ebp
mov    %rcx,%rax
shr    $0x3,%rax
movabs $0x20c49ba5e353f7cf,%rdx
9b c4 20
mul    %rdx
mov    %rdx,%rsi
shr    $0x4,%rsi
mov    %rsi,%rax
mul    %rdi
shr    $0x2,%rdx
and    $0xfffffffffffffffe,%rdx
lea    (%rdx,%rdx,4),%rax
sub    %rax,%rsi
lea    0x0(,%rsi,8),%ebx
sub    %esi,%ebx
movabs $0x346dc5d63886594b,%rdx
c5 6d 34
mov    %rcx,%rax
mul    %rdx
mov    %rdx,%r8
add    %ebp,%ebx
shr    $0xb,%r8
mov    %r8,%rax
mul    %rdi
shr    $0x2,%rdx
and    $0xfffffffffffffffe,%rdx
lea    (%rdx,%rdx,4),%rax
sub    %rax,%r8
mov    %rcx,%rax
shr    $0x5,%rax
movabs $0xa7c5ac471b47843,%rdx
5a 7c 0a
mul    %rdx
mov    %rdx,%rsi
lea    (%r8,%r8,8),%rbp
shr    $0x7,%rsi
mov    %rsi,%rax
mul    %rdi
add    %ebx,%ebp
shr    $0x2,%rdx
and    $0xfffffffffffffffe,%rdx
lea    (%rdx,%rdx,4),%rax
sub    %rax,%rsi
add    %rsi,%rsi
lea    (%rsi,%rsi,4),%r14
lea    (%r14,%rbp,1),%esi
movabs $0x431bde82d7b634db,%rdx
de 1b 43
mov    %rcx,%rax
mul    %rdx
mov    %rdx,%r9
shr    $0x12,%r9
mov    %r9,%rax
mul    %rdi
shr    $0x2,%rdx
and    $0xfffffffffffffffe,%rdx
lea    (%rdx,%rdx,4),%rax
sub    %rax,%r9
lea    (%r9,%r9,4),%rbx
add    %esi,%ebx
movabs $0xd6bf94d5e57a42bd,%rdx
94 bf d6
mov    %rcx,%rax
mul    %rdx
mov    %rdx,%r11
shr    $0x17,%r11
mov    %r11,%rax
mul    %rdi
shr    $0x2,%rdx
and    $0xfffffffffffffffe,%rdx
lea    (%rdx,%rdx,4),%rbp
movabs $0xabcc77118461cefd,%rdx
77 cc ab
mov    %rcx,%rax
mul    %rdx
mov    %rdx,%rsi
sub    %rbp,%r11
shr    $0x1a,%rsi
mov    %rsi,%rax
mul    %rdi
lea    (%rbx,%r11,8),%ebx
shr    $0x2,%rdx
and    $0xfffffffffffffffe,%rdx
lea    (%rdx,%rdx,4),%rbp
shr    $0x9,%rcx
movabs $0x44b82fa09b5a53,%rdx
mov    %rcx,%rax
mul    %rdx
mov    %rdx,%rcx
sub    %rbp,%rsi
shr    $0xb,%rcx
mov    %rcx,%rax
mul    %rdi
lea    (%rbx,%rsi,4),%eax
shr    $0x2,%rdx
and    $0xfffffffffffffffe,%rdx
lea    (%rdx,%rdx,4),%rdx
sub    %rdx,%rcx
lea    (%rax,%rcx,2),%eax
movzwl %ax,%edx
imul   $0xba2f,%edx,%edx
shr    $0x13,%edx
lea    (%rdx,%rdx,4),%edi
lea    (%rdx,%rdi,2),%edx
sub    %edx,%eax
xor    %ebp,%ebp
cmp    $0xa,%ax
cmove  %ebp,%eax
lea    (%r11,%r11,4),%rdx
lea    (%r9,%rdx,2),%rdi
lea    (%rcx,%rcx,4),%rcx
lea    (%rsi,%rcx,2),%rcx
cmp    $0x11,%rcx
lea    -0x28(%r9,%rdx,2),%rcx
cmovae %rdi,%rcx
lea    -0x1(%rcx),%rdx
lea    (%r14,%r8,1),%rsi
add    $0xffffffffffffffff,%rsi
xor    %edi,%edi
cmp    $0x1d,%rsi
setb   %dil
xor    %ebx,%ebx
cmp    $0x1f,%rsi
setb   %bl
cmp    $0x2,%rcx
cmove  %edi,%ebx
cmp    $0xc,%rdx
lea    0xc48(%rip),%rdi
lea    0xc3e(%rip),%rcx
cmovae %rcx,%rdi
movzwl %ax,%eax
cmp    %rax,%r10
cmovne %rcx,%rdi
test   %bl,%bl
cmove  %rcx,%rdi
call   1030 <puts@plt>
mov    %ebp,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%llu\00"
@.str.1 = [4 x i8] c"1 \0A\00"
@.str.2 = [4 x i8] c"0 \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i32
store i32 0, i32* %1
store i64 0, i64* %4
store i64 0, i64* %5
store i64 0, i64* %6
store i64 0, i64* %7
store i32 0, i32* %12
%13 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %2)
%14 = load i64, i64* %2
store i64 %14, i64* %3
store i32 0, i32* %12
br label %15
15: ; preds = %21, %0
%16 = load i64, i64* %3
%17 = icmp ugt i64 %16, 0
br i1 %17, label %18, label %24
18: ; preds = %15
%19 = load i64, i64* %3
%20 = udiv i64 %19, 10
store i64 %20, i64* %3
br label %21
21: ; preds = %18
%22 = load i32, i32* %12
%23 = add nsw i32 %22, 1
store i32 %23, i32* %12
br label %15
24: ; preds = %15
%25 = load i32, i32* %12
%26 = icmp ne i32 %25, 10
br i1 %26, label %27, label %28
27: ; preds = %24
store i32 -1, i32* %1
br label %163
28: ; preds = %24
%29 = load i64, i64* %2
store i64 %29, i64* %3
%30 = load i64, i64* %3
%31 = urem i64 %30, 10
store i64 %31, i64* %11
%32 = load i64, i64* %3
%33 = udiv i64 %32, 10
store i64 %33, i64* %3
%34 = load i64, i64* %3
%35 = urem i64 %34, 10
%36 = mul i64 %35, 6
%37 = load i64, i64* %3
%38 = udiv i64 %37, 10
%39 = urem i64 %38, 10
%40 = mul i64 %39, 3
%41 = add i64 %36, %40
%42 = load i64, i64* %3
%43 = udiv i64 %42, 100
%44 = urem i64 %43, 10
%45 = mul i64 %44, 7
%46 = add i64 %41, %45
%47 = load i64, i64* %3
%48 = udiv i64 %47, 1000
%49 = urem i64 %48, 10
%50 = mul i64 %49, 9
%51 = add i64 %46, %50
%52 = load i64, i64* %3
%53 = udiv i64 %52, 10000
%54 = urem i64 %53, 10
%55 = mul i64 %54, 10
%56 = add i64 %51, %55
%57 = load i64, i64* %3
%58 = udiv i64 %57, 100000
%59 = urem i64 %58, 10
%60 = mul i64 %59, 5
%61 = add i64 %56, %60
%62 = load i64, i64* %3
%63 = udiv i64 %62, 1000000
%64 = urem i64 %63, 10
%65 = mul i64 %64, 8
%66 = add i64 %61, %65
%67 = load i64, i64* %3
%68 = udiv i64 %67, 10000000
%69 = urem i64 %68, 10
%70 = mul i64 %69, 4
%71 = add i64 %66, %70
%72 = load i64, i64* %3
%73 = udiv i64 %72, 100000000
%74 = urem i64 %73, 10
%75 = mul i64 %74, 2
%76 = add i64 %71, %75
store i64 %76, i64* %4
%77 = load i64, i64* %4
%78 = urem i64 %77, 11
store i64 %78, i64* %4
%79 = load i64, i64* %4
%80 = icmp eq i64 %79, 10
br i1 %80, label %81, label %82
81: ; preds = %28
store i64 0, i64* %4
br label %82
82: ; preds = %81, %28
%83 = load i64, i64* %11
%84 = load i64, i64* %4
%85 = icmp eq i64 %83, %84
br i1 %85, label %86, label %87
86: ; preds = %82
store i64 1, i64* %5
br label %87
87: ; preds = %86, %82
%88 = load i64, i64* %2
%89 = udiv i64 %88, 10000
store i64 %89, i64* %3
%90 = load i64, i64* %3
%91 = urem i64 %90, 10
%92 = load i64, i64* %3
%93 = udiv i64 %92, 10
%94 = urem i64 %93, 10
%95 = mul i64 %94, 10
%96 = add i64 %91, %95
store i64 %96, i64* %8
%97 = load i64, i64* %3
%98 = udiv i64 %97, 100
store i64 %98, i64* %3
%99 = load i64, i64* %3
%100 = urem i64 %99, 10
%101 = load i64, i64* %3
%102 = udiv i64 %101, 10
%103 = urem i64 %102, 10
%104 = mul i64 %103, 10
%105 = add i64 %100, %104
store i64 %105, i64* %9
%106 = load i64, i64* %3
%107 = udiv i64 %106, 100
store i64 %107, i64* %3
%108 = load i64, i64* %3
%109 = urem i64 %108, 10
%110 = load i64, i64* %3
%111 = udiv i64 %110, 10
%112 = urem i64 %111, 10
%113 = mul i64 %112, 10
%114 = add i64 %109, %113
store i64 %114, i64* %10
%115 = load i64, i64* %10
%116 = icmp uge i64 %115, 0
br i1 %116, label %117, label %123
117: ; preds = %87
%118 = load i64, i64* %10
%119 = icmp ule i64 %118, 16
br i1 %119, label %120, label %123
120: ; preds = %117
%121 = load i64, i64* %9
%122 = sub i64 %121, 40
store i64 %122, i64* %9
br label %123
123: ; preds = %120, %117, %87
%124 = load i64, i64* %9
%125 = icmp ugt i64 %124, 0
br i1 %125, label %126, label %130
126: ; preds = %123
%127 = load i64, i64* %9
%128 = icmp ult i64 %127, 13
br i1 %128, label %129, label %130
129: ; preds = %126
store i64 1, i64* %6
br label %130
130: ; preds = %129, %126, %123
%131 = load i64, i64* %9
%132 = icmp eq i64 %131, 2
br i1 %132, label %133, label %141
133: ; preds = %130
%134 = load i64, i64* %8
%135 = icmp ugt i64 %134, 0
br i1 %135, label %136, label %140
136: ; preds = %133
%137 = load i64, i64* %8
%138 = icmp ult i64 %137, 30
br i1 %138, label %139, label %140
139: ; preds = %136
store i64 1, i64* %7
br label %140
140: ; preds = %139, %136, %133
br label %149
141: ; preds = %130
%142 = load i64, i64* %8
%143 = icmp ugt i64 %142, 0
br i1 %143, label %144, label %148
144: ; preds = %141
%145 = load i64, i64* %8
%146 = icmp ult i64 %145, 32
br i1 %146, label %147, label %148
147: ; preds = %144
store i64 1, i64* %7
br label %148
148: ; preds = %147, %144, %141
br label %149
149: ; preds = %148, %140
%150 = load i64, i64* %5
%151 = icmp eq i64 %150, 1
br i1 %151, label %152, label %160
152: ; preds = %149
%153 = load i64, i64* %6
%154 = icmp eq i64 %153, 1
br i1 %154, label %155, label %160
155: ; preds = %152
%156 = load i64, i64* %7
%157 = icmp eq i64 %156, 1
br i1 %157, label %158, label %160
158: ; preds = %155
%159 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %162
160: ; preds = %155, %152, %149
%161 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %162
162: ; preds = %160, %158
store i32 0, i32* %1
br label %163
163: ; preds = %162, %27
%164 = load i32, i32* %1
ret i32 %164
}

LLVM IR (-O2):
@.str = [5 x i8] c"%llu\00"
@str = [3 x i8] c"0 \00"
@str.3 = [3 x i8] c"1 \00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %1)
%4 = load i64, i64* %1
%5 = icmp eq i64 %4, 0
br i1 %5, label %76, label %6
6: ; preds = %0, %6
%7 = phi i32 [ %10, %6 ], [ 0, %0 ]
%8 = phi i64 [ %9, %6 ], [ %4, %0 ]
%9 = udiv i64 %8, 10
%10 = add nuw nsw i32 %7, 1
%11 = icmp ult i64 %8, 10
br i1 %11, label %12, label %6
12: ; preds = %6
%13 = icmp eq i32 %10, 10
br i1 %13, label %14, label %76
14: ; preds = %12
%15 = urem i64 %4, 10
%16 = udiv i64 %4, 10
%17 = urem i64 %16, 10
%18 = mul nuw nsw i64 %17, 6
%19 = udiv i64 %4, 100
%20 = urem i64 %19, 10
%21 = mul nuw nsw i64 %20, 3
%22 = add nuw nsw i64 %18, %21
%23 = udiv i64 %4, 1000
%24 = urem i64 %23, 10
%25 = mul nuw nsw i64 %24, 7
%26 = add nuw nsw i64 %22, %25
%27 = udiv i64 %4, 10000
%28 = urem i64 %27, 10
%29 = mul nuw nsw i64 %28, 9
%30 = add nuw nsw i64 %26, %29
%31 = udiv i64 %4, 100000
%32 = urem i64 %31, 10
%33 = mul nuw nsw i64 %32, 10
%34 = add nuw nsw i64 %30, %33
%35 = udiv i64 %4, 1000000
%36 = urem i64 %35, 10
%37 = mul nuw nsw i64 %36, 5
%38 = add nuw nsw i64 %34, %37
%39 = udiv i64 %4, 10000000
%40 = urem i64 %39, 10
%41 = shl nuw nsw i64 %40, 3
%42 = add nuw nsw i64 %38, %41
%43 = udiv i64 %4, 100000000
%44 = urem i64 %43, 10
%45 = shl nuw nsw i64 %44, 2
%46 = add nuw nsw i64 %42, %45
%47 = udiv i64 %4, 1000000000
%48 = urem i64 %47, 10
%49 = shl nuw nsw i64 %48, 1
%50 = add nuw nsw i64 %46, %49
%51 = trunc i64 %50 to i16
%52 = urem i16 %51, 11
%53 = icmp eq i16 %52, 10
%54 = select i1 %53, i16 0, i16 %52
%55 = zext i16 %54 to i64
%56 = icmp eq i64 %15, %55
%57 = add nuw nsw i64 %33, %28
%58 = mul nuw nsw i64 %40, 10
%59 = add nuw nsw i64 %58, %36
%60 = mul nuw nsw i64 %48, 10
%61 = add nuw nsw i64 %60, %44
%62 = icmp ult i64 %61, 17
%63 = add nsw i64 %59, -40
%64 = select i1 %62, i64 %63, i64 %59
%65 = add nsw i64 %64, -1
%66 = icmp ult i64 %65, 12
%67 = icmp eq i64 %64, 2
%68 = add nsw i64 %57, -1
%69 = icmp ult i64 %68, 29
%70 = icmp ult i64 %68, 31
%71 = select i1 %67, i1 %69, i1 %70
%72 = select i1 %56, i1 %66, i1 false
%73 = and i1 %71, %72
%74 = select i1 %73, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0)
%75 = call i32 @puts(i8* dereferenceable(1) %74)
br label %76
76: ; preds = %14, %0, %12
%77 = phi i32 [ -1, %12 ], [ -1, %0 ], [ 0, %14 ]
ret i32 %77
}