#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*/ d();
int gr(int, scalar_t__);
int /*<<< orphan*/ gw(int, scalar_t__, int);
int /*<<< orphan*/ printf(char *, int);
scalar_t__ td(int, int);
int tm(int, int);
int main(void) {
  long long t0, t1;
  d();
  gw(0, 0, 1050);
  gw(1, 0, 50);
  gw(3, 0, 2);
_1:
  gw(4, 0, gr(0, 0));
  gw(5, 0, 0);
_2:
  gw(4, 0, gr(4, 0) - 1);
  t0 = gr((tm(gr(4, 0), gr(1, 0))) + 52, (td(gr(4, 0), gr(1, 0))) + 1) - 48;
  t1 =
      (((gr((tm(gr(4, 0), gr(1, 0))) + 52, (td(gr(4, 0), gr(1, 0))) + 1) - 48) +
        (gr((tm(gr(4, 0), gr(1, 0))) + 1, (td(gr(4, 0), gr(1, 0))) + 1) - 48) +
        gr(5, 0)) %
       10) +
      48;
  gw(5, 0,
     ((gr((tm(gr(4, 0), gr(1, 0))) + 52, (td(gr(4, 0), gr(1, 0))) + 1) - 48) +
      (gr((tm(gr(4, 0), gr(1, 0))) + 1, (td(gr(4, 0), gr(1, 0))) + 1) - 48) +
      gr(5, 0)) /
         10);
  gw((tm(gr(4, 0), gr(1, 0))) + 52, (td(gr(4, 0), gr(1, 0))) + 1, t1);
  t0 += 48;
  gw((tm(gr(4, 0), gr(1, 0))) + 1, (td(gr(4, 0), gr(1, 0))) + 1, t0);
  if ((gr(4, 0)) != 0)
    goto _2;
  else
    goto _4;
_4:
  gw(3, 0, gr(3, 0) + 1);
  gw(7, 0, 0);
_5:
  if (gr((tm(gr(7, 0), gr(1, 0))) + 52, (td(gr(7, 0), gr(1, 0))) + 1) != 48)
    goto _7;
  else
    goto _6;
_6:
  gw(7, 0, gr(7, 0) + 1);
  goto _5;
_7:
  if ((gr(0, 0) - gr(7, 0)) != 1000)
    goto _1;
  else
    goto _8;
_8:
  printf("%lld ", gr(3, 0));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <d@plt>
xor    %edi,%edi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x41a,%edx
call   1040 <gw@plt>
mov    $0x1,%edi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x32,%edx
call   1040 <gw@plt>
mov    $0x3,%edi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x2,%edx
call   1040 <gw@plt>
xor    %edi,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1070 <gr@plt>
mov    %eax,%edx
mov    $0x4,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <gw@plt>
mov    $0x5,%edi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1040 <gw@plt>
mov    $0x4,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1070 <gr@plt>
mov    %eax,%edx
sub    $0x1,%edx
mov    $0x4,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <gw@plt>
mov    $0x4,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1070 <gr@plt>
mov    %eax,-0x7c(%rbp)
mov    $0x1,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1070 <gr@plt>
mov    -0x7c(%rbp),%edi
mov    %eax,%esi
call   1060 <tm@plt>
add    $0x34,%eax
mov    %eax,-0x74(%rbp)
mov    $0x4,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1070 <gr@plt>
mov    %eax,-0x78(%rbp)
mov    $0x1,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1070 <gr@plt>
mov    -0x78(%rbp),%edi
mov    %eax,%esi
call   1080 <td@plt>
mov    -0x74(%rbp),%edi
mov    %rax,%rsi
add    $0x1,%rsi
call   1070 <gr@plt>
sub    $0x30,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    $0x4,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1070 <gr@plt>
mov    %eax,-0x70(%rbp)
mov    $0x1,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1070 <gr@plt>
mov    -0x70(%rbp),%edi
mov    %eax,%esi
call   1060 <tm@plt>
add    $0x34,%eax
mov    %eax,-0x68(%rbp)
mov    $0x4,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1070 <gr@plt>
mov    %eax,-0x6c(%rbp)
mov    $0x1,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1070 <gr@plt>
mov    -0x6c(%rbp),%edi
mov    %eax,%esi
call   1080 <td@plt>
mov    -0x68(%rbp),%edi
mov    %rax,%rsi
add    $0x1,%rsi
call   1070 <gr@plt>
sub    $0x30,%eax
mov    %eax,-0x58(%rbp)
mov    $0x4,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1070 <gr@plt>
mov    %eax,-0x64(%rbp)
mov    $0x1,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1070 <gr@plt>
mov    -0x64(%rbp),%edi
mov    %eax,%esi
call   1060 <tm@plt>
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
mov    $0x4,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1070 <gr@plt>
mov    %eax,-0x60(%rbp)
mov    $0x1,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1070 <gr@plt>
mov    -0x60(%rbp),%edi
mov    %eax,%esi
call   1080 <td@plt>
mov    -0x5c(%rbp),%edi
mov    %rax,%rsi
add    $0x1,%rsi
call   1070 <gr@plt>
mov    %eax,%ecx
mov    -0x58(%rbp),%eax
sub    $0x30,%ecx
add    %ecx,%eax
mov    %eax,-0x54(%rbp)
mov    $0x5,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1070 <gr@plt>
mov    %eax,%ecx
mov    -0x54(%rbp),%eax
add    %ecx,%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%edx
movslq %edx,%rax
mov    %rax,-0x18(%rbp)
mov    $0x4,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1070 <gr@plt>
mov    %eax,-0x50(%rbp)
mov    $0x1,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1070 <gr@plt>
mov    -0x50(%rbp),%edi
mov    %eax,%esi
call   1060 <tm@plt>
add    $0x34,%eax
mov    %eax,-0x48(%rbp)
mov    $0x4,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1070 <gr@plt>
mov    %eax,-0x4c(%rbp)
mov    $0x1,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1070 <gr@plt>
mov    -0x4c(%rbp),%edi
mov    %eax,%esi
call   1080 <td@plt>
mov    -0x48(%rbp),%edi
mov    %rax,%rsi
add    $0x1,%rsi
call   1070 <gr@plt>
sub    $0x30,%eax
mov    %eax,-0x38(%rbp)
mov    $0x4,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1070 <gr@plt>
mov    %eax,-0x44(%rbp)
mov    $0x1,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1070 <gr@plt>
mov    -0x44(%rbp),%edi
mov    %eax,%esi
call   1060 <tm@plt>
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
mov    $0x4,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1070 <gr@plt>
mov    %eax,-0x40(%rbp)
mov    $0x1,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1070 <gr@plt>
mov    -0x40(%rbp),%edi
mov    %eax,%esi
call   1080 <td@plt>
mov    -0x3c(%rbp),%edi
mov    %rax,%rsi
add    $0x1,%rsi
call   1070 <gr@plt>
mov    %eax,%ecx
mov    -0x38(%rbp),%eax
sub    $0x30,%ecx
add    %ecx,%eax
mov    %eax,-0x34(%rbp)
mov    $0x5,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1070 <gr@plt>
mov    %eax,%ecx
mov    -0x34(%rbp),%eax
add    %ecx,%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
mov    $0x5,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <gw@plt>
mov    $0x4,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1070 <gr@plt>
mov    %eax,-0x30(%rbp)
mov    $0x1,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1070 <gr@plt>
mov    -0x30(%rbp),%edi
mov    %eax,%esi
call   1060 <tm@plt>
add    $0x34,%eax
mov    %eax,-0x28(%rbp)
mov    $0x4,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1070 <gr@plt>
mov    %eax,-0x2c(%rbp)
mov    $0x1,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1070 <gr@plt>
mov    -0x2c(%rbp),%edi
mov    %eax,%esi
call   1080 <td@plt>
mov    -0x28(%rbp),%edi
mov    %rax,%rsi
add    $0x1,%rsi
mov    -0x18(%rbp),%rax
mov    %eax,%edx
call   1040 <gw@plt>
mov    -0x10(%rbp),%rax
add    $0x30,%rax
mov    %rax,-0x10(%rbp)
mov    $0x4,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1070 <gr@plt>
mov    %eax,-0x24(%rbp)
mov    $0x1,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1070 <gr@plt>
mov    -0x24(%rbp),%edi
mov    %eax,%esi
call   1060 <tm@plt>
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    $0x4,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1070 <gr@plt>
mov    %eax,-0x20(%rbp)
mov    $0x1,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1070 <gr@plt>
mov    -0x20(%rbp),%edi
mov    %eax,%esi
call   1080 <td@plt>
mov    -0x1c(%rbp),%edi
mov    %rax,%rsi
add    $0x1,%rsi
mov    -0x10(%rbp),%rax
mov    %eax,%edx
call   1040 <gw@plt>
mov    $0x4,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1070 <gr@plt>
cmp    $0x0,%eax
je     1583 <main+0x423>
jmp    11da <main+0x7a>
jmp    1588 <main+0x428>
mov    $0x3,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1070 <gr@plt>
mov    %eax,%edx
add    $0x1,%edx
mov    $0x3,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <gw@plt>
mov    $0x7,%edi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1040 <gw@plt>
mov    $0x7,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1070 <gr@plt>
mov    %eax,-0x88(%rbp)
mov    $0x1,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1070 <gr@plt>
mov    -0x88(%rbp),%edi
mov    %eax,%esi
call   1060 <tm@plt>
add    $0x34,%eax
mov    %eax,-0x80(%rbp)
mov    $0x7,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1070 <gr@plt>
mov    %eax,-0x84(%rbp)
mov    $0x1,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1070 <gr@plt>
mov    -0x84(%rbp),%edi
mov    %eax,%esi
call   1080 <td@plt>
mov    -0x80(%rbp),%edi
mov    %rax,%rsi
add    $0x1,%rsi
call   1070 <gr@plt>
cmp    $0x30,%eax
je     163a <main+0x4da>
jmp    1665 <main+0x505>
jmp    163f <main+0x4df>
mov    $0x7,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1070 <gr@plt>
mov    %eax,%edx
add    $0x1,%edx
mov    $0x7,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <gw@plt>
jmp    15b9 <main+0x459>
xor    %edi,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1070 <gr@plt>
mov    %eax,-0x8c(%rbp)
mov    $0x7,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1070 <gr@plt>
mov    %eax,%ecx
mov    -0x8c(%rbp),%eax
sub    %ecx,%eax
cmp    $0x3e8,%eax
je     169e <main+0x53e>
jmp    11af <main+0x4f>
jmp    16a3 <main+0x543>
mov    $0x3,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1070 <gr@plt>
mov    %eax,%esi
lea    0x946(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
xor    %eax,%eax
call   1030 <d@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    $0x41a,%edx
call   1040 <gw@plt>
mov    $0x1,%edi
xor    %esi,%esi
mov    $0x32,%edx
call   1040 <gw@plt>
mov    $0x3,%edi
xor    %esi,%esi
mov    $0x2,%edx
call   1040 <gw@plt>
jmp    11d5 <main+0x75>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %edi,%edi
xor    %esi,%esi
call   1070 <gr@plt>
mov    %eax,%ebx
mov    $0x7,%edi
xor    %esi,%esi
call   1070 <gr@plt>
sub    %eax,%ebx
cmp    $0x3e8,%ebx
je     159e <main+0x43e>
xor    %edi,%edi
xor    %esi,%esi
call   1070 <gr@plt>
mov    $0x4,%edi
xor    %esi,%esi
mov    %eax,%edx
call   1040 <gw@plt>
mov    $0x5,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1040 <gw@plt>
nopw   0x0(%rax,%rax,1)
mov    $0x4,%edi
xor    %esi,%esi
call   1070 <gr@plt>
lea    -0x1(%rax),%edx
mov    $0x4,%edi
xor    %esi,%esi
call   1040 <gw@plt>
mov    $0x4,%edi
xor    %esi,%esi
call   1070 <gr@plt>
mov    %eax,%ebx
mov    $0x1,%edi
xor    %esi,%esi
call   1070 <gr@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1060 <tm@plt>
lea    0x34(%rax),%ebx
mov    $0x4,%edi
xor    %esi,%esi
call   1070 <gr@plt>
mov    %eax,%ebp
mov    $0x1,%edi
xor    %esi,%esi
call   1070 <gr@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1080 <td@plt>
lea    0x1(%rax),%rsi
mov    %ebx,%edi
call   1070 <gr@plt>
mov    %eax,%r14d
mov    $0x4,%edi
xor    %esi,%esi
call   1070 <gr@plt>
mov    %eax,%ebx
mov    $0x1,%edi
xor    %esi,%esi
call   1070 <gr@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1060 <tm@plt>
lea    0x34(%rax),%ebx
mov    $0x4,%edi
xor    %esi,%esi
call   1070 <gr@plt>
mov    %eax,%ebp
mov    $0x1,%edi
xor    %esi,%esi
call   1070 <gr@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1080 <td@plt>
lea    0x1(%rax),%rsi
mov    %ebx,%edi
call   1070 <gr@plt>
mov    %eax,%r15d
mov    $0x4,%edi
xor    %esi,%esi
call   1070 <gr@plt>
mov    %eax,%ebp
mov    $0x1,%edi
xor    %esi,%esi
call   1070 <gr@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1060 <tm@plt>
lea    0x1(%rax),%ebp
mov    $0x4,%edi
xor    %esi,%esi
call   1070 <gr@plt>
mov    %eax,%ebx
mov    $0x1,%edi
xor    %esi,%esi
call   1070 <gr@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1080 <td@plt>
lea    0x1(%rax),%rsi
mov    %ebp,%edi
call   1070 <gr@plt>
mov    %eax,%ebx
mov    $0x5,%edi
xor    %esi,%esi
call   1070 <gr@plt>
add    %r15d,%ebx
add    %ebx,%eax
add    $0xffffffa0,%eax
movslq %eax,%r15
imul   $0x66666667,%r15,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%r15d
add    $0x30,%r15d
mov    $0x4,%edi
xor    %esi,%esi
call   1070 <gr@plt>
mov    %eax,%ebp
mov    $0x1,%edi
xor    %esi,%esi
call   1070 <gr@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1060 <tm@plt>
lea    0x34(%rax),%ebp
mov    $0x4,%edi
xor    %esi,%esi
call   1070 <gr@plt>
mov    %eax,%ebx
mov    $0x1,%edi
xor    %esi,%esi
call   1070 <gr@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1080 <td@plt>
lea    0x1(%rax),%rsi
mov    %ebp,%edi
call   1070 <gr@plt>
mov    %eax,%r12d
mov    $0x4,%edi
xor    %esi,%esi
call   1070 <gr@plt>
mov    %eax,%ebx
mov    $0x1,%edi
xor    %esi,%esi
call   1070 <gr@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1060 <tm@plt>
lea    0x1(%rax),%ebx
mov    $0x4,%edi
xor    %esi,%esi
call   1070 <gr@plt>
mov    %eax,%ebp
mov    $0x1,%edi
xor    %esi,%esi
call   1070 <gr@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1080 <td@plt>
lea    0x1(%rax),%rsi
mov    %ebx,%edi
call   1070 <gr@plt>
mov    %eax,%ebx
mov    $0x5,%edi
xor    %esi,%esi
call   1070 <gr@plt>
add    %r12d,%ebx
add    %ebx,%eax
add    $0xffffffa0,%eax
cltq
imul   $0x66666667,%rax,%rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x22,%rdx
add    %eax,%edx
mov    $0x5,%edi
xor    %esi,%esi
call   1040 <gw@plt>
mov    $0x4,%edi
xor    %esi,%esi
call   1070 <gr@plt>
mov    %eax,%ebx
mov    $0x1,%edi
xor    %esi,%esi
call   1070 <gr@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1060 <tm@plt>
lea    0x34(%rax),%ebx
mov    $0x4,%edi
xor    %esi,%esi
call   1070 <gr@plt>
mov    %eax,%ebp
mov    $0x1,%edi
xor    %esi,%esi
call   1070 <gr@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1080 <td@plt>
lea    0x1(%rax),%rsi
mov    %ebx,%edi
mov    %r15d,%edx
call   1040 <gw@plt>
mov    $0x4,%edi
xor    %esi,%esi
call   1070 <gr@plt>
mov    %eax,%ebx
mov    $0x1,%edi
xor    %esi,%esi
call   1070 <gr@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1060 <tm@plt>
lea    0x1(%rax),%ebx
mov    $0x4,%edi
xor    %esi,%esi
call   1070 <gr@plt>
mov    %eax,%ebp
mov    $0x1,%edi
xor    %esi,%esi
call   1070 <gr@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1080 <td@plt>
lea    0x1(%rax),%rsi
mov    %ebx,%edi
mov    %r14d,%edx
call   1040 <gw@plt>
mov    $0x4,%edi
xor    %esi,%esi
call   1070 <gr@plt>
test   %eax,%eax
jne    1200 <main+0xa0>
xor    %ebx,%ebx
mov    $0x3,%edi
xor    %esi,%esi
call   1070 <gr@plt>
lea    0x1(%rax),%edx
mov    $0x3,%edi
xor    %esi,%esi
call   1040 <gw@plt>
nopl   0x0(%rax,%rax,1)
mov    $0x7,%edi
xor    %esi,%esi
mov    %ebx,%edx
call   1040 <gw@plt>
mov    $0x7,%edi
xor    %esi,%esi
call   1070 <gr@plt>
mov    %eax,%ebx
mov    $0x1,%edi
xor    %esi,%esi
call   1070 <gr@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1060 <tm@plt>
lea    0x34(%rax),%ebx
mov    $0x7,%edi
xor    %esi,%esi
call   1070 <gr@plt>
mov    %eax,%ebp
mov    $0x1,%edi
xor    %esi,%esi
call   1070 <gr@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1080 <td@plt>
lea    0x1(%rax),%rsi
mov    %ebx,%edi
call   1070 <gr@plt>
cmp    $0x30,%eax
jne    11b0 <main+0x50>
mov    $0x7,%edi
xor    %esi,%esi
call   1070 <gr@plt>
mov    %eax,%ebx
add    $0x1,%ebx
jmp    1520 <main+0x3c0>
mov    $0x3,%edi
xor    %esi,%esi
call   1070 <gr@plt>
lea    0xa4f(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%lld \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
store i32 0, i32* %1
%4 = call i32 (...) @d()
%5 = call i32 @gw(i32 0, i64 0, i32 1050)
%6 = call i32 @gw(i32 1, i64 0, i32 50)
%7 = call i32 @gw(i32 3, i64 0, i32 2)
br label %8
8: ; preds = %133, %0
%9 = call i32 @gr(i32 0, i64 0)
%10 = call i32 @gw(i32 4, i64 0, i32 %9)
%11 = call i32 @gw(i32 5, i64 0, i32 0)
br label %12
12: ; preds = %104, %8
%13 = call i32 @gr(i32 4, i64 0)
%14 = sub nsw i32 %13, 1
%15 = call i32 @gw(i32 4, i64 0, i32 %14)
%16 = call i32 @gr(i32 4, i64 0)
%17 = call i32 @gr(i32 1, i64 0)
%18 = call i32 @tm(i32 %16, i32 %17)
%19 = add nsw i32 %18, 52
%20 = call i32 @gr(i32 4, i64 0)
%21 = call i32 @gr(i32 1, i64 0)
%22 = call i64 @td(i32 %20, i32 %21)
%23 = add nsw i64 %22, 1
%24 = call i32 @gr(i32 %19, i64 %23)
%25 = sub nsw i32 %24, 48
%26 = sext i32 %25 to i64
store i64 %26, i64* %2
%27 = call i32 @gr(i32 4, i64 0)
%28 = call i32 @gr(i32 1, i64 0)
%29 = call i32 @tm(i32 %27, i32 %28)
%30 = add nsw i32 %29, 52
%31 = call i32 @gr(i32 4, i64 0)
%32 = call i32 @gr(i32 1, i64 0)
%33 = call i64 @td(i32 %31, i32 %32)
%34 = add nsw i64 %33, 1
%35 = call i32 @gr(i32 %30, i64 %34)
%36 = sub nsw i32 %35, 48
%37 = call i32 @gr(i32 4, i64 0)
%38 = call i32 @gr(i32 1, i64 0)
%39 = call i32 @tm(i32 %37, i32 %38)
%40 = add nsw i32 %39, 1
%41 = call i32 @gr(i32 4, i64 0)
%42 = call i32 @gr(i32 1, i64 0)
%43 = call i64 @td(i32 %41, i32 %42)
%44 = add nsw i64 %43, 1
%45 = call i32 @gr(i32 %40, i64 %44)
%46 = sub nsw i32 %45, 48
%47 = add nsw i32 %36, %46
%48 = call i32 @gr(i32 5, i64 0)
%49 = add nsw i32 %47, %48
%50 = srem i32 %49, 10
%51 = add nsw i32 %50, 48
%52 = sext i32 %51 to i64
store i64 %52, i64* %3
%53 = call i32 @gr(i32 4, i64 0)
%54 = call i32 @gr(i32 1, i64 0)
%55 = call i32 @tm(i32 %53, i32 %54)
%56 = add nsw i32 %55, 52
%57 = call i32 @gr(i32 4, i64 0)
%58 = call i32 @gr(i32 1, i64 0)
%59 = call i64 @td(i32 %57, i32 %58)
%60 = add nsw i64 %59, 1
%61 = call i32 @gr(i32 %56, i64 %60)
%62 = sub nsw i32 %61, 48
%63 = call i32 @gr(i32 4, i64 0)
%64 = call i32 @gr(i32 1, i64 0)
%65 = call i32 @tm(i32 %63, i32 %64)
%66 = add nsw i32 %65, 1
%67 = call i32 @gr(i32 4, i64 0)
%68 = call i32 @gr(i32 1, i64 0)
%69 = call i64 @td(i32 %67, i32 %68)
%70 = add nsw i64 %69, 1
%71 = call i32 @gr(i32 %66, i64 %70)
%72 = sub nsw i32 %71, 48
%73 = add nsw i32 %62, %72
%74 = call i32 @gr(i32 5, i64 0)
%75 = add nsw i32 %73, %74
%76 = sdiv i32 %75, 10
%77 = call i32 @gw(i32 5, i64 0, i32 %76)
%78 = call i32 @gr(i32 4, i64 0)
%79 = call i32 @gr(i32 1, i64 0)
%80 = call i32 @tm(i32 %78, i32 %79)
%81 = add nsw i32 %80, 52
%82 = call i32 @gr(i32 4, i64 0)
%83 = call i32 @gr(i32 1, i64 0)
%84 = call i64 @td(i32 %82, i32 %83)
%85 = add nsw i64 %84, 1
%86 = load i64, i64* %3
%87 = trunc i64 %86 to i32
%88 = call i32 @gw(i32 %81, i64 %85, i32 %87)
%89 = load i64, i64* %2
%90 = add nsw i64 %89, 48
store i64 %90, i64* %2
%91 = call i32 @gr(i32 4, i64 0)
%92 = call i32 @gr(i32 1, i64 0)
%93 = call i32 @tm(i32 %91, i32 %92)
%94 = add nsw i32 %93, 1
%95 = call i32 @gr(i32 4, i64 0)
%96 = call i32 @gr(i32 1, i64 0)
%97 = call i64 @td(i32 %95, i32 %96)
%98 = add nsw i64 %97, 1
%99 = load i64, i64* %2
%100 = trunc i64 %99 to i32
%101 = call i32 @gw(i32 %94, i64 %98, i32 %100)
%102 = call i32 @gr(i32 4, i64 0)
%103 = icmp ne i32 %102, 0
br i1 %103, label %104, label %105
104: ; preds = %12
br label %12
105: ; preds = %12
br label %106
106: ; preds = %105
%107 = call i32 @gr(i32 3, i64 0)
%108 = add nsw i32 %107, 1
%109 = call i32 @gw(i32 3, i64 0, i32 %108)
%110 = call i32 @gw(i32 7, i64 0, i32 0)
br label %111
111: ; preds = %124, %106
%112 = call i32 @gr(i32 7, i64 0)
%113 = call i32 @gr(i32 1, i64 0)
%114 = call i32 @tm(i32 %112, i32 %113)
%115 = add nsw i32 %114, 52
%116 = call i32 @gr(i32 7, i64 0)
%117 = call i32 @gr(i32 1, i64 0)
%118 = call i64 @td(i32 %116, i32 %117)
%119 = add nsw i64 %118, 1
%120 = call i32 @gr(i32 %115, i64 %119)
%121 = icmp ne i32 %120, 48
br i1 %121, label %122, label %123
122: ; preds = %111
br label %128
123: ; preds = %111
br label %124
124: ; preds = %123
%125 = call i32 @gr(i32 7, i64 0)
%126 = add nsw i32 %125, 1
%127 = call i32 @gw(i32 7, i64 0, i32 %126)
br label %111
128: ; preds = %122
%129 = call i32 @gr(i32 0, i64 0)
%130 = call i32 @gr(i32 7, i64 0)
%131 = sub nsw i32 %129, %130
%132 = icmp ne i32 %131, 1000
br i1 %132, label %133, label %134
133: ; preds = %128
br label %8
134: ; preds = %128
br label %135
135: ; preds = %134
%136 = call i32 @gr(i32 3, i64 0)
%137 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %136)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%lld \00"
define i32 @main() {
%1 = tail call i32 (...) @d()
%2 = tail call i32 @gw(i32 0, i64 0, i32 1050)
%3 = tail call i32 @gw(i32 1, i64 0, i32 50)
%4 = tail call i32 @gw(i32 3, i64 0, i32 2)
br label %5
5: ; preds = %110, %0
%6 = tail call i32 @gr(i32 0, i64 0)
%7 = tail call i32 @gw(i32 4, i64 0, i32 %6)
%8 = tail call i32 @gw(i32 5, i64 0, i32 0)
br label %9
9: ; preds = %9, %5
%10 = tail call i32 @gr(i32 4, i64 0)
%11 = add nsw i32 %10, -1
%12 = tail call i32 @gw(i32 4, i64 0, i32 %11)
%13 = tail call i32 @gr(i32 4, i64 0)
%14 = tail call i32 @gr(i32 1, i64 0)
%15 = tail call i32 @tm(i32 %13, i32 %14)
%16 = add nsw i32 %15, 52
%17 = tail call i32 @gr(i32 4, i64 0)
%18 = tail call i32 @gr(i32 1, i64 0)
%19 = tail call i64 @td(i32 %17, i32 %18)
%20 = add nsw i64 %19, 1
%21 = tail call i32 @gr(i32 %16, i64 %20)
%22 = tail call i32 @gr(i32 4, i64 0)
%23 = tail call i32 @gr(i32 1, i64 0)
%24 = tail call i32 @tm(i32 %22, i32 %23)
%25 = add nsw i32 %24, 52
%26 = tail call i32 @gr(i32 4, i64 0)
%27 = tail call i32 @gr(i32 1, i64 0)
%28 = tail call i64 @td(i32 %26, i32 %27)
%29 = add nsw i64 %28, 1
%30 = tail call i32 @gr(i32 %25, i64 %29)
%31 = tail call i32 @gr(i32 4, i64 0)
%32 = tail call i32 @gr(i32 1, i64 0)
%33 = tail call i32 @tm(i32 %31, i32 %32)
%34 = add nsw i32 %33, 1
%35 = tail call i32 @gr(i32 4, i64 0)
%36 = tail call i32 @gr(i32 1, i64 0)
%37 = tail call i64 @td(i32 %35, i32 %36)
%38 = add nsw i64 %37, 1
%39 = tail call i32 @gr(i32 %34, i64 %38)
%40 = tail call i32 @gr(i32 5, i64 0)
%41 = add i32 %30, -96
%42 = add i32 %41, %39
%43 = add i32 %42, %40
%44 = srem i32 %43, 10
%45 = add nsw i32 %44, 48
%46 = tail call i32 @gr(i32 4, i64 0)
%47 = tail call i32 @gr(i32 1, i64 0)
%48 = tail call i32 @tm(i32 %46, i32 %47)
%49 = add nsw i32 %48, 52
%50 = tail call i32 @gr(i32 4, i64 0)
%51 = tail call i32 @gr(i32 1, i64 0)
%52 = tail call i64 @td(i32 %50, i32 %51)
%53 = add nsw i64 %52, 1
%54 = tail call i32 @gr(i32 %49, i64 %53)
%55 = tail call i32 @gr(i32 4, i64 0)
%56 = tail call i32 @gr(i32 1, i64 0)
%57 = tail call i32 @tm(i32 %55, i32 %56)
%58 = add nsw i32 %57, 1
%59 = tail call i32 @gr(i32 4, i64 0)
%60 = tail call i32 @gr(i32 1, i64 0)
%61 = tail call i64 @td(i32 %59, i32 %60)
%62 = add nsw i64 %61, 1
%63 = tail call i32 @gr(i32 %58, i64 %62)
%64 = tail call i32 @gr(i32 5, i64 0)
%65 = add i32 %54, -96
%66 = add i32 %65, %63
%67 = add i32 %66, %64
%68 = sdiv i32 %67, 10
%69 = tail call i32 @gw(i32 5, i64 0, i32 %68)
%70 = tail call i32 @gr(i32 4, i64 0)
%71 = tail call i32 @gr(i32 1, i64 0)
%72 = tail call i32 @tm(i32 %70, i32 %71)
%73 = add nsw i32 %72, 52
%74 = tail call i32 @gr(i32 4, i64 0)
%75 = tail call i32 @gr(i32 1, i64 0)
%76 = tail call i64 @td(i32 %74, i32 %75)
%77 = add nsw i64 %76, 1
%78 = tail call i32 @gw(i32 %73, i64 %77, i32 %45)
%79 = tail call i32 @gr(i32 4, i64 0)
%80 = tail call i32 @gr(i32 1, i64 0)
%81 = tail call i32 @tm(i32 %79, i32 %80)
%82 = add nsw i32 %81, 1
%83 = tail call i32 @gr(i32 4, i64 0)
%84 = tail call i32 @gr(i32 1, i64 0)
%85 = tail call i64 @td(i32 %83, i32 %84)
%86 = add nsw i64 %85, 1
%87 = tail call i32 @gw(i32 %82, i64 %86, i32 %21)
%88 = tail call i32 @gr(i32 4, i64 0)
%89 = icmp eq i32 %88, 0
br i1 %89, label %90, label %9
90: ; preds = %9
%91 = tail call i32 @gr(i32 3, i64 0)
%92 = add nsw i32 %91, 1
%93 = tail call i32 @gw(i32 3, i64 0, i32 %92)
br label %94
94: ; preds = %107, %90
%95 = phi i32 [ %109, %107 ], [ 0, %90 ]
%96 = tail call i32 @gw(i32 7, i64 0, i32 %95)
%97 = tail call i32 @gr(i32 7, i64 0)
%98 = tail call i32 @gr(i32 1, i64 0)
%99 = tail call i32 @tm(i32 %97, i32 %98)
%100 = add nsw i32 %99, 52
%101 = tail call i32 @gr(i32 7, i64 0)
%102 = tail call i32 @gr(i32 1, i64 0)
%103 = tail call i64 @td(i32 %101, i32 %102)
%104 = add nsw i64 %103, 1
%105 = tail call i32 @gr(i32 %100, i64 %104)
%106 = icmp eq i32 %105, 48
br i1 %106, label %107, label %110
107: ; preds = %94
%108 = tail call i32 @gr(i32 7, i64 0)
%109 = add nsw i32 %108, 1
br label %94
110: ; preds = %94
%111 = tail call i32 @gr(i32 0, i64 0)
%112 = tail call i32 @gr(i32 7, i64 0)
%113 = sub nsw i32 %111, %112
%114 = icmp eq i32 %113, 1000
br i1 %114, label %115, label %5
115: ; preds = %110
%116 = tail call i32 @gr(i32 3, i64 0)
%117 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %116)
ret i32 0
}