#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*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, ...);
int /*<<< orphan*/ stdin;
int strlen(char *);
int main(int argc, char *argv[]) {
  int i, N, ans;
  fflush(stdin);
  scanf("%d", &N);
  while (N--) {
    char ascii[128] = {0}, string[600] = {0};
    scanf("%s", string);
    for (i = 0; i < strlen(string); i++)
      ascii[string[i]]++;
    ans = ((ascii['M'] /
            1) < (((ascii['A'] /
                    3) < (((ascii['R'] /
                            2) < (((ascii['G'] / 1) <
                                           (((ascii['I'] / 1) < (ascii['T'] / 1)
                                                 ? (ascii['I'] / 1)
                                                 : (ascii['T'] / 1)))
                                       ? (ascii['G'] / 1)
                                       : (((ascii['I'] / 1) < (ascii['T'] / 1)
                                               ? (ascii['I'] / 1)
                                               : (ascii['T'] / 1)))))
                               ? (ascii['R'] / 2)
                               : (((ascii['G'] / 1) <
                                           (((ascii['I'] / 1) < (ascii['T'] / 1)
                                                 ? (ascii['I'] / 1)
                                                 : (ascii['T'] / 1)))
                                       ? (ascii['G'] / 1)
                                       : (((ascii['I'] / 1) < (ascii['T'] / 1)
                                               ? (ascii['I'] / 1)
                                               : (ascii['T'] / 1)))))))
                       ? (ascii['A'] / 3)
                       : (((ascii['R'] /
                            2) < (((ascii['G'] / 1) <
                                           (((ascii['I'] / 1) < (ascii['T'] / 1)
                                                 ? (ascii['I'] / 1)
                                                 : (ascii['T'] / 1)))
                                       ? (ascii['G'] / 1)
                                       : (((ascii['I'] / 1) < (ascii['T'] / 1)
                                               ? (ascii['I'] / 1)
                                               : (ascii['T'] / 1)))))
                               ? (ascii['R'] / 2)
                               : (((ascii['G'] / 1) <
                                           (((ascii['I'] / 1) < (ascii['T'] / 1)
                                                 ? (ascii['I'] / 1)
                                                 : (ascii['T'] / 1)))
                                       ? (ascii['G'] / 1)
                                       : (((ascii['I'] / 1) < (ascii['T'] / 1)
                                               ? (ascii['I'] / 1)
                                               : (ascii['T'] / 1)))))))))
               ? (ascii['M'] / 1)
               : (((ascii['A'] /
                    3) < (((ascii['R'] /
                            2) < (((ascii['G'] / 1) <
                                           (((ascii['I'] / 1) < (ascii['T'] / 1)
                                                 ? (ascii['I'] / 1)
                                                 : (ascii['T'] / 1)))
                                       ? (ascii['G'] / 1)
                                       : (((ascii['I'] / 1) < (ascii['T'] / 1)
                                               ? (ascii['I'] / 1)
                                               : (ascii['T'] / 1)))))
                               ? (ascii['R'] / 2)
                               : (((ascii['G'] / 1) <
                                           (((ascii['I'] / 1) < (ascii['T'] / 1)
                                                 ? (ascii['I'] / 1)
                                                 : (ascii['T'] / 1)))
                                       ? (ascii['G'] / 1)
                                       : (((ascii['I'] / 1) < (ascii['T'] / 1)
                                               ? (ascii['I'] / 1)
                                               : (ascii['T'] / 1)))))))
                       ? (ascii['A'] / 3)
                       : (((ascii['R'] /
                            2) < (((ascii['G'] / 1) <
                                           (((ascii['I'] / 1) < (ascii['T'] / 1)
                                                 ? (ascii['I'] / 1)
                                                 : (ascii['T'] / 1)))
                                       ? (ascii['G'] / 1)
                                       : (((ascii['I'] / 1) < (ascii['T'] / 1)
                                               ? (ascii['I'] / 1)
                                               : (ascii['T'] / 1)))))
                               ? (ascii['R'] / 2)
                               : (((ascii['G'] / 1) <
                                           (((ascii['I'] / 1) < (ascii['T'] / 1)
                                                 ? (ascii['I'] / 1)
                                                 : (ascii['T'] / 1)))
                                       ? (ascii['G'] / 1)
                                       : (((ascii['I'] / 1) < (ascii['T'] / 1)
                                               ? (ascii['I'] / 1)
                                               : (ascii['T'] / 1))))))))));
    printf("%d\n", ans);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
lea    0xe82(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1070 <scanf@plt>
mov    -0x18(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x18(%rbp)
cmp    $0x0,%eax
je     1c04 <main+0xab4>
lea    -0xa0(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1050 <memset@plt>
lea    -0x300(%rbp),%rdi
xor    %esi,%esi
mov    $0x258,%edx
call   1050 <memset@plt>
lea    -0x300(%rbp),%rsi
lea    0xe32(%rip),%rdi
mov    $0x0,%al
call   1070 <scanf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x304(%rbp)
lea    -0x300(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x304(%rbp),%eax
cmp    %ecx,%eax
jge    1230 <main+0xe0>
movslq -0x14(%rbp),%rax
movsbq -0x300(%rbp,%rax,1),%rax
ff ff
mov    -0xa0(%rbp,%rax,1),%cl
add    $0x1,%cl
mov    %cl,-0xa0(%rbp,%rax,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11df <main+0x8f>
movsbl -0x53(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x318(%rbp)
movsbl -0x5f(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,-0x314(%rbp)
movsbl -0x4e(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x310(%rbp)
movsbl -0x59(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x30c(%rbp)
movsbl -0x57(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x308(%rbp)
movsbl -0x4c(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x308(%rbp),%eax
cmp    %ecx,%eax
jge    12bd <main+0x16d>
movsbl -0x57(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x31c(%rbp)
jmp    12cf <main+0x17f>
movsbl -0x4c(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x31c(%rbp)
mov    -0x30c(%rbp),%eax
mov    -0x31c(%rbp),%ecx
cmp    %ecx,%eax
jge    12fa <main+0x1aa>
movsbl -0x59(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x320(%rbp)
jmp    135d <main+0x20d>
movsbl -0x57(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x324(%rbp)
movsbl -0x4c(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x324(%rbp),%eax
cmp    %ecx,%eax
jge    133f <main+0x1ef>
movsbl -0x57(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x328(%rbp)
jmp    1351 <main+0x201>
movsbl -0x4c(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x328(%rbp)
mov    -0x328(%rbp),%eax
mov    %eax,-0x320(%rbp)
mov    -0x310(%rbp),%eax
mov    -0x320(%rbp),%ecx
cmp    %ecx,%eax
jge    1388 <main+0x238>
movsbl -0x4e(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x32c(%rbp)
jmp    148b <main+0x33b>
movsbl -0x59(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x334(%rbp)
movsbl -0x57(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x330(%rbp)
movsbl -0x4c(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x330(%rbp),%eax
cmp    %ecx,%eax
jge    13df <main+0x28f>
movsbl -0x57(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x338(%rbp)
jmp    13f1 <main+0x2a1>
movsbl -0x4c(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x338(%rbp)
mov    -0x334(%rbp),%eax
mov    -0x338(%rbp),%ecx
cmp    %ecx,%eax
jge    141c <main+0x2cc>
movsbl -0x59(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x33c(%rbp)
jmp    147f <main+0x32f>
movsbl -0x57(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x340(%rbp)
movsbl -0x4c(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x340(%rbp),%eax
cmp    %ecx,%eax
jge    1461 <main+0x311>
movsbl -0x57(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x344(%rbp)
jmp    1473 <main+0x323>
movsbl -0x4c(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x344(%rbp)
mov    -0x344(%rbp),%eax
mov    %eax,-0x33c(%rbp)
mov    -0x33c(%rbp),%eax
mov    %eax,-0x32c(%rbp)
mov    -0x314(%rbp),%eax
mov    -0x32c(%rbp),%ecx
cmp    %ecx,%eax
jge    14b6 <main+0x366>
movsbl -0x5f(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,-0x348(%rbp)
jmp    16f9 <main+0x5a9>
movsbl -0x4e(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x354(%rbp)
movsbl -0x59(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x350(%rbp)
movsbl -0x57(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x34c(%rbp)
movsbl -0x4c(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x34c(%rbp),%eax
cmp    %ecx,%eax
jge    151f <main+0x3cf>
movsbl -0x57(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x358(%rbp)
jmp    1531 <main+0x3e1>
movsbl -0x4c(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x358(%rbp)
mov    -0x350(%rbp),%eax
mov    -0x358(%rbp),%ecx
cmp    %ecx,%eax
jge    155c <main+0x40c>
movsbl -0x59(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x35c(%rbp)
jmp    15bf <main+0x46f>
movsbl -0x57(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x360(%rbp)
movsbl -0x4c(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x360(%rbp),%eax
cmp    %ecx,%eax
jge    15a1 <main+0x451>
movsbl -0x57(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x364(%rbp)
jmp    15b3 <main+0x463>
movsbl -0x4c(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x364(%rbp)
mov    -0x364(%rbp),%eax
mov    %eax,-0x35c(%rbp)
mov    -0x354(%rbp),%eax
mov    -0x35c(%rbp),%ecx
cmp    %ecx,%eax
jge    15ea <main+0x49a>
movsbl -0x4e(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x368(%rbp)
jmp    16ed <main+0x59d>
movsbl -0x59(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x370(%rbp)
movsbl -0x57(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x36c(%rbp)
movsbl -0x4c(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x36c(%rbp),%eax
cmp    %ecx,%eax
jge    1641 <main+0x4f1>
movsbl -0x57(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x374(%rbp)
jmp    1653 <main+0x503>
movsbl -0x4c(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x374(%rbp)
mov    -0x370(%rbp),%eax
mov    -0x374(%rbp),%ecx
cmp    %ecx,%eax
jge    167e <main+0x52e>
movsbl -0x59(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x378(%rbp)
jmp    16e1 <main+0x591>
movsbl -0x57(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x37c(%rbp)
movsbl -0x4c(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x37c(%rbp),%eax
cmp    %ecx,%eax
jge    16c3 <main+0x573>
movsbl -0x57(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x380(%rbp)
jmp    16d5 <main+0x585>
movsbl -0x4c(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x380(%rbp)
mov    -0x380(%rbp),%eax
mov    %eax,-0x378(%rbp)
mov    -0x378(%rbp),%eax
mov    %eax,-0x368(%rbp)
mov    -0x368(%rbp),%eax
mov    %eax,-0x348(%rbp)
mov    -0x318(%rbp),%eax
mov    -0x348(%rbp),%ecx
cmp    %ecx,%eax
jge    1724 <main+0x5d4>
movsbl -0x53(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x384(%rbp)
jmp    1be7 <main+0xa97>
movsbl -0x5f(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,-0x394(%rbp)
movsbl -0x4e(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x390(%rbp)
movsbl -0x59(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x38c(%rbp)
movsbl -0x57(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x388(%rbp)
movsbl -0x4c(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x388(%rbp),%eax
cmp    %ecx,%eax
jge    179f <main+0x64f>
movsbl -0x57(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x398(%rbp)
jmp    17b1 <main+0x661>
movsbl -0x4c(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x398(%rbp)
mov    -0x38c(%rbp),%eax
mov    -0x398(%rbp),%ecx
cmp    %ecx,%eax
jge    17dc <main+0x68c>
movsbl -0x59(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x39c(%rbp)
jmp    183f <main+0x6ef>
movsbl -0x57(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x3a0(%rbp)
movsbl -0x4c(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x3a0(%rbp),%eax
cmp    %ecx,%eax
jge    1821 <main+0x6d1>
movsbl -0x57(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x3a4(%rbp)
jmp    1833 <main+0x6e3>
movsbl -0x4c(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x3a4(%rbp)
mov    -0x3a4(%rbp),%eax
mov    %eax,-0x39c(%rbp)
mov    -0x390(%rbp),%eax
mov    -0x39c(%rbp),%ecx
cmp    %ecx,%eax
jge    186a <main+0x71a>
movsbl -0x4e(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x3a8(%rbp)
jmp    196d <main+0x81d>
movsbl -0x59(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x3b0(%rbp)
movsbl -0x57(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x3ac(%rbp)
movsbl -0x4c(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x3ac(%rbp),%eax
cmp    %ecx,%eax
jge    18c1 <main+0x771>
movsbl -0x57(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x3b4(%rbp)
jmp    18d3 <main+0x783>
movsbl -0x4c(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x3b4(%rbp)
mov    -0x3b0(%rbp),%eax
mov    -0x3b4(%rbp),%ecx
cmp    %ecx,%eax
jge    18fe <main+0x7ae>
movsbl -0x59(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x3b8(%rbp)
jmp    1961 <main+0x811>
movsbl -0x57(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x3bc(%rbp)
movsbl -0x4c(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x3bc(%rbp),%eax
cmp    %ecx,%eax
jge    1943 <main+0x7f3>
movsbl -0x57(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x3c0(%rbp)
jmp    1955 <main+0x805>
movsbl -0x4c(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x3c0(%rbp)
mov    -0x3c0(%rbp),%eax
mov    %eax,-0x3b8(%rbp)
mov    -0x3b8(%rbp),%eax
mov    %eax,-0x3a8(%rbp)
mov    -0x394(%rbp),%eax
mov    -0x3a8(%rbp),%ecx
cmp    %ecx,%eax
jge    1998 <main+0x848>
movsbl -0x5f(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,-0x3c4(%rbp)
jmp    1bdb <main+0xa8b>
movsbl -0x4e(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x3d0(%rbp)
movsbl -0x59(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x3cc(%rbp)
movsbl -0x57(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x3c8(%rbp)
movsbl -0x4c(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x3c8(%rbp),%eax
cmp    %ecx,%eax
jge    1a01 <main+0x8b1>
movsbl -0x57(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x3d4(%rbp)
jmp    1a13 <main+0x8c3>
movsbl -0x4c(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x3d4(%rbp)
mov    -0x3cc(%rbp),%eax
mov    -0x3d4(%rbp),%ecx
cmp    %ecx,%eax
jge    1a3e <main+0x8ee>
movsbl -0x59(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x3d8(%rbp)
jmp    1aa1 <main+0x951>
movsbl -0x57(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x3dc(%rbp)
movsbl -0x4c(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x3dc(%rbp),%eax
cmp    %ecx,%eax
jge    1a83 <main+0x933>
movsbl -0x57(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x3e0(%rbp)
jmp    1a95 <main+0x945>
movsbl -0x4c(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x3e0(%rbp)
mov    -0x3e0(%rbp),%eax
mov    %eax,-0x3d8(%rbp)
mov    -0x3d0(%rbp),%eax
mov    -0x3d8(%rbp),%ecx
cmp    %ecx,%eax
jge    1acc <main+0x97c>
movsbl -0x4e(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x3e4(%rbp)
jmp    1bcf <main+0xa7f>
movsbl -0x59(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x3ec(%rbp)
movsbl -0x57(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x3e8(%rbp)
movsbl -0x4c(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x3e8(%rbp),%eax
cmp    %ecx,%eax
jge    1b23 <main+0x9d3>
movsbl -0x57(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x3f0(%rbp)
jmp    1b35 <main+0x9e5>
movsbl -0x4c(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x3f0(%rbp)
mov    -0x3ec(%rbp),%eax
mov    -0x3f0(%rbp),%ecx
cmp    %ecx,%eax
jge    1b60 <main+0xa10>
movsbl -0x59(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x3f4(%rbp)
jmp    1bc3 <main+0xa73>
movsbl -0x57(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x3f8(%rbp)
movsbl -0x4c(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x3f8(%rbp),%eax
cmp    %ecx,%eax
jge    1ba5 <main+0xa55>
movsbl -0x57(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x3fc(%rbp)
jmp    1bb7 <main+0xa67>
movsbl -0x4c(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x3fc(%rbp)
mov    -0x3fc(%rbp),%eax
mov    %eax,-0x3f4(%rbp)
mov    -0x3f4(%rbp),%eax
mov    %eax,-0x3e4(%rbp)
mov    -0x3e4(%rbp),%eax
mov    %eax,-0x3c4(%rbp)
mov    -0x3c4(%rbp),%eax
mov    %eax,-0x384(%rbp)
mov    -0x384(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0x40c(%rip),%rdi
call   1040 <printf@plt>
jmp    1189 <main+0x39>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x2e8,%rsp
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
lea    0xe8e(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
subl   $0x1,0xc(%rsp)
jae    1195 <main+0x45>
xor    %eax,%eax
add    $0x2e8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x90(%rsp),%rbx
lea    0xe5f(%rip),%r14
lea    0xe5b(%rip),%r15
jmp    11cf <main+0x7f>
nopl   (%rax)
cmp    %r8b,%al
movzbl %r8b,%ecx
movzbl %al,%eax
cmovg  %ecx,%eax
movsbl %al,%esi
mov    %r15,%rdi
call   1040 <printf@plt>
subl   $0x1,0xc(%rsp)
jb     1185 <main+0x35>
xorps  %xmm0,%xmm0
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
xor    %ebp,%ebp
mov    $0x258,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <memset@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    $0x0,%esi
mov    $0x0,%ecx
mov    $0x0,%edi
mov    $0x0,%edx
mov    $0x0,%r8d
test   %eax,%eax
jle    128d <main+0x13d>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbq 0x90(%rsp,%rbp,1),%rax
addb   $0x1,0x10(%rsp,%rax,1)
add    $0x1,%rbp
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbp
jl     1250 <main+0x100>
mov    0x5d(%rsp),%r8b
mov    0x51(%rsp),%dl
mov    0x57(%rsp),%cl
mov    0x62(%rsp),%dil
mov    0x59(%rsp),%sil
mov    0x64(%rsp),%bpl
movsbl %dl,%eax
imul   $0x56,%eax,%eax
movzwl %ax,%eax
mov    %eax,%edx
shr    $0xf,%edx
shr    $0x8,%eax
add    %dl,%al
mov    %edi,%edx
shr    $0x7,%dl
add    %dil,%dl
sar    %dl
cmp    %bpl,%sil
movzbl %sil,%edi
movzbl %bpl,%esi
cmovl  %edi,%esi
cmp    %cl,%dl
movzbl %dl,%edi
movzbl %cl,%ebp
cmovl  %edi,%ebp
cmp    %sil,%bpl
mov    %ebp,%edx
cmovge %esi,%edx
cmp    %al,%dl
jg     11b0 <main+0x60>
setg   %r9b
cmp    %sil,%bpl
movzbl %sil,%r10d
movzbl %bpl,%ebp
mov    %r10d,%edx
cmovl  %ebp,%edx
cmp    %r8b,%dl
movzbl %r8b,%edx
movzbl %al,%eax
cmovg  %edx,%eax
setg   %dl
or     %r9b,%dl
cmove  %ebp,%eax
jne    11bd <main+0x6d>
cmp    %sil,%cl
jl     11bd <main+0x6d>
cmp    %sil,%dil
cmovl  %edi,%r10d
mov    %r10d,%eax
jmp    11bd <main+0x6d>

LLVM IR (-O0):
@stdin = global i32 0
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [128 x i8]
%10 = alloca [600 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = load i32, i32* @stdin
%12 = call i32 @fflush(i32 %11)
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %7)
br label %14
14: ; preds = %570, %2
%15 = load i32, i32* %7
%16 = add nsw i32 %15, -1
store i32 %16, i32* %7
%17 = icmp ne i32 %15, 0
br i1 %17, label %18, label %574
18: ; preds = %14
%19 = bitcast [128 x i8]* %9 to i8*
%20 = bitcast [600 x i8]* %10 to i8*
%21 = getelementptr inbounds [600 x i8], [600 x i8]* %10, i64 0, i64 0
%22 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %21)
store i32 0, i32* %6
br label %23
23: ; preds = %37, %18
%24 = load i32, i32* %6
%25 = getelementptr inbounds [600 x i8], [600 x i8]* %10, i64 0, i64 0
%26 = call i32 @strlen(i8* %25)
%27 = icmp slt i32 %24, %26
br i1 %27, label %28, label %40
28: ; preds = %23
%29 = load i32, i32* %6
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [600 x i8], [600 x i8]* %10, i64 0, i64 %30
%32 = load i8, i8* %31
%33 = sext i8 %32 to i64
%34 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 %33
%35 = load i8, i8* %34
%36 = add i8 %35, 1
store i8 %36, i8* %34
br label %37
37: ; preds = %28
%38 = load i32, i32* %6
%39 = add nsw i32 %38, 1
store i32 %39, i32* %6
br label %23
40: ; preds = %23
%41 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 77
%42 = load i8, i8* %41
%43 = sext i8 %42 to i32
%44 = sdiv i32 %43, 1
%45 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 65
%46 = load i8, i8* %45
%47 = sext i8 %46 to i32
%48 = sdiv i32 %47, 3
%49 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 82
%50 = load i8, i8* %49
%51 = sext i8 %50 to i32
%52 = sdiv i32 %51, 2
%53 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 71
%54 = load i8, i8* %53
%55 = sext i8 %54 to i32
%56 = sdiv i32 %55, 1
%57 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 73
%58 = load i8, i8* %57
%59 = sext i8 %58 to i32
%60 = sdiv i32 %59, 1
%61 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 84
%62 = load i8, i8* %61
%63 = sext i8 %62 to i32
%64 = sdiv i32 %63, 1
%65 = icmp slt i32 %60, %64
br i1 %65, label %66, label %71
66: ; preds = %40
%67 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 73
%68 = load i8, i8* %67
%69 = sext i8 %68 to i32
%70 = sdiv i32 %69, 1
br label %76
71: ; preds = %40
%72 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 84
%73 = load i8, i8* %72
%74 = sext i8 %73 to i32
%75 = sdiv i32 %74, 1
br label %76
76: ; preds = %71, %66
%77 = phi i32 [ %70, %66 ], [ %75, %71 ]
%78 = icmp slt i32 %56, %77
br i1 %78, label %79, label %84
79: ; preds = %76
%80 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 71
%81 = load i8, i8* %80
%82 = sext i8 %81 to i32
%83 = sdiv i32 %82, 1
br label %106
84: ; preds = %76
%85 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 73
%86 = load i8, i8* %85
%87 = sext i8 %86 to i32
%88 = sdiv i32 %87, 1
%89 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 84
%90 = load i8, i8* %89
%91 = sext i8 %90 to i32
%92 = sdiv i32 %91, 1
%93 = icmp slt i32 %88, %92
br i1 %93, label %94, label %99
94: ; preds = %84
%95 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 73
%96 = load i8, i8* %95
%97 = sext i8 %96 to i32
%98 = sdiv i32 %97, 1
br label %104
99: ; preds = %84
%100 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 84
%101 = load i8, i8* %100
%102 = sext i8 %101 to i32
%103 = sdiv i32 %102, 1
br label %104
104: ; preds = %99, %94
%105 = phi i32 [ %98, %94 ], [ %103, %99 ]
br label %106
106: ; preds = %104, %79
%107 = phi i32 [ %83, %79 ], [ %105, %104 ]
%108 = icmp slt i32 %52, %107
br i1 %108, label %109, label %114
109: ; preds = %106
%110 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 82
%111 = load i8, i8* %110
%112 = sext i8 %111 to i32
%113 = sdiv i32 %112, 2
br label %170
114: ; preds = %106
%115 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 71
%116 = load i8, i8* %115
%117 = sext i8 %116 to i32
%118 = sdiv i32 %117, 1
%119 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 73
%120 = load i8, i8* %119
%121 = sext i8 %120 to i32
%122 = sdiv i32 %121, 1
%123 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 84
%124 = load i8, i8* %123
%125 = sext i8 %124 to i32
%126 = sdiv i32 %125, 1
%127 = icmp slt i32 %122, %126
br i1 %127, label %128, label %133
128: ; preds = %114
%129 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 73
%130 = load i8, i8* %129
%131 = sext i8 %130 to i32
%132 = sdiv i32 %131, 1
br label %138
133: ; preds = %114
%134 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 84
%135 = load i8, i8* %134
%136 = sext i8 %135 to i32
%137 = sdiv i32 %136, 1
br label %138
138: ; preds = %133, %128
%139 = phi i32 [ %132, %128 ], [ %137, %133 ]
%140 = icmp slt i32 %118, %139
br i1 %140, label %141, label %146
141: ; preds = %138
%142 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 71
%143 = load i8, i8* %142
%144 = sext i8 %143 to i32
%145 = sdiv i32 %144, 1
br label %168
146: ; preds = %138
%147 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 73
%148 = load i8, i8* %147
%149 = sext i8 %148 to i32
%150 = sdiv i32 %149, 1
%151 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 84
%152 = load i8, i8* %151
%153 = sext i8 %152 to i32
%154 = sdiv i32 %153, 1
%155 = icmp slt i32 %150, %154
br i1 %155, label %156, label %161
156: ; preds = %146
%157 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 73
%158 = load i8, i8* %157
%159 = sext i8 %158 to i32
%160 = sdiv i32 %159, 1
br label %166
161: ; preds = %146
%162 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 84
%163 = load i8, i8* %162
%164 = sext i8 %163 to i32
%165 = sdiv i32 %164, 1
br label %166
166: ; preds = %161, %156
%167 = phi i32 [ %160, %156 ], [ %165, %161 ]
br label %168
168: ; preds = %166, %141
%169 = phi i32 [ %145, %141 ], [ %167, %166 ]
br label %170
170: ; preds = %168, %109
%171 = phi i32 [ %113, %109 ], [ %169, %168 ]
%172 = icmp slt i32 %48, %171
br i1 %172, label %173, label %178
173: ; preds = %170
%174 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 65
%175 = load i8, i8* %174
%176 = sext i8 %175 to i32
%177 = sdiv i32 %176, 3
br label %302
178: ; preds = %170
%179 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 82
%180 = load i8, i8* %179
%181 = sext i8 %180 to i32
%182 = sdiv i32 %181, 2
%183 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 71
%184 = load i8, i8* %183
%185 = sext i8 %184 to i32
%186 = sdiv i32 %185, 1
%187 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 73
%188 = load i8, i8* %187
%189 = sext i8 %188 to i32
%190 = sdiv i32 %189, 1
%191 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 84
%192 = load i8, i8* %191
%193 = sext i8 %192 to i32
%194 = sdiv i32 %193, 1
%195 = icmp slt i32 %190, %194
br i1 %195, label %196, label %201
196: ; preds = %178
%197 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 73
%198 = load i8, i8* %197
%199 = sext i8 %198 to i32
%200 = sdiv i32 %199, 1
br label %206
201: ; preds = %178
%202 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 84
%203 = load i8, i8* %202
%204 = sext i8 %203 to i32
%205 = sdiv i32 %204, 1
br label %206
206: ; preds = %201, %196
%207 = phi i32 [ %200, %196 ], [ %205, %201 ]
%208 = icmp slt i32 %186, %207
br i1 %208, label %209, label %214
209: ; preds = %206
%210 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 71
%211 = load i8, i8* %210
%212 = sext i8 %211 to i32
%213 = sdiv i32 %212, 1
br label %236
214: ; preds = %206
%215 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 73
%216 = load i8, i8* %215
%217 = sext i8 %216 to i32
%218 = sdiv i32 %217, 1
%219 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 84
%220 = load i8, i8* %219
%221 = sext i8 %220 to i32
%222 = sdiv i32 %221, 1
%223 = icmp slt i32 %218, %222
br i1 %223, label %224, label %229
224: ; preds = %214
%225 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 73
%226 = load i8, i8* %225
%227 = sext i8 %226 to i32
%228 = sdiv i32 %227, 1
br label %234
229: ; preds = %214
%230 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 84
%231 = load i8, i8* %230
%232 = sext i8 %231 to i32
%233 = sdiv i32 %232, 1
br label %234
234: ; preds = %229, %224
%235 = phi i32 [ %228, %224 ], [ %233, %229 ]
br label %236
236: ; preds = %234, %209
%237 = phi i32 [ %213, %209 ], [ %235, %234 ]
%238 = icmp slt i32 %182, %237
br i1 %238, label %239, label %244
239: ; preds = %236
%240 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 82
%241 = load i8, i8* %240
%242 = sext i8 %241 to i32
%243 = sdiv i32 %242, 2
br label %300
244: ; preds = %236
%245 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 71
%246 = load i8, i8* %245
%247 = sext i8 %246 to i32
%248 = sdiv i32 %247, 1
%249 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 73
%250 = load i8, i8* %249
%251 = sext i8 %250 to i32
%252 = sdiv i32 %251, 1
%253 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 84
%254 = load i8, i8* %253
%255 = sext i8 %254 to i32
%256 = sdiv i32 %255, 1
%257 = icmp slt i32 %252, %256
br i1 %257, label %258, label %263
258: ; preds = %244
%259 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 73
%260 = load i8, i8* %259
%261 = sext i8 %260 to i32
%262 = sdiv i32 %261, 1
br label %268
263: ; preds = %244
%264 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 84
%265 = load i8, i8* %264
%266 = sext i8 %265 to i32
%267 = sdiv i32 %266, 1
br label %268
268: ; preds = %263, %258
%269 = phi i32 [ %262, %258 ], [ %267, %263 ]
%270 = icmp slt i32 %248, %269
br i1 %270, label %271, label %276
271: ; preds = %268
%272 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 71
%273 = load i8, i8* %272
%274 = sext i8 %273 to i32
%275 = sdiv i32 %274, 1
br label %298
276: ; preds = %268
%277 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 73
%278 = load i8, i8* %277
%279 = sext i8 %278 to i32
%280 = sdiv i32 %279, 1
%281 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 84
%282 = load i8, i8* %281
%283 = sext i8 %282 to i32
%284 = sdiv i32 %283, 1
%285 = icmp slt i32 %280, %284
br i1 %285, label %286, label %291
286: ; preds = %276
%287 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 73
%288 = load i8, i8* %287
%289 = sext i8 %288 to i32
%290 = sdiv i32 %289, 1
br label %296
291: ; preds = %276
%292 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 84
%293 = load i8, i8* %292
%294 = sext i8 %293 to i32
%295 = sdiv i32 %294, 1
br label %296
296: ; preds = %291, %286
%297 = phi i32 [ %290, %286 ], [ %295, %291 ]
br label %298
298: ; preds = %296, %271
%299 = phi i32 [ %275, %271 ], [ %297, %296 ]
br label %300
300: ; preds = %298, %239
%301 = phi i32 [ %243, %239 ], [ %299, %298 ]
br label %302
302: ; preds = %300, %173
%303 = phi i32 [ %177, %173 ], [ %301, %300 ]
%304 = icmp slt i32 %44, %303
br i1 %304, label %305, label %310
305: ; preds = %302
%306 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 77
%307 = load i8, i8* %306
%308 = sext i8 %307 to i32
%309 = sdiv i32 %308, 1
br label %570
310: ; preds = %302
%311 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 65
%312 = load i8, i8* %311
%313 = sext i8 %312 to i32
%314 = sdiv i32 %313, 3
%315 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 82
%316 = load i8, i8* %315
%317 = sext i8 %316 to i32
%318 = sdiv i32 %317, 2
%319 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 71
%320 = load i8, i8* %319
%321 = sext i8 %320 to i32
%322 = sdiv i32 %321, 1
%323 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 73
%324 = load i8, i8* %323
%325 = sext i8 %324 to i32
%326 = sdiv i32 %325, 1
%327 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 84
%328 = load i8, i8* %327
%329 = sext i8 %328 to i32
%330 = sdiv i32 %329, 1
%331 = icmp slt i32 %326, %330
br i1 %331, label %332, label %337
332: ; preds = %310
%333 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 73
%334 = load i8, i8* %333
%335 = sext i8 %334 to i32
%336 = sdiv i32 %335, 1
br label %342
337: ; preds = %310
%338 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 84
%339 = load i8, i8* %338
%340 = sext i8 %339 to i32
%341 = sdiv i32 %340, 1
br label %342
342: ; preds = %337, %332
%343 = phi i32 [ %336, %332 ], [ %341, %337 ]
%344 = icmp slt i32 %322, %343
br i1 %344, label %345, label %350
345: ; preds = %342
%346 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 71
%347 = load i8, i8* %346
%348 = sext i8 %347 to i32
%349 = sdiv i32 %348, 1
br label %372
350: ; preds = %342
%351 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 73
%352 = load i8, i8* %351
%353 = sext i8 %352 to i32
%354 = sdiv i32 %353, 1
%355 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 84
%356 = load i8, i8* %355
%357 = sext i8 %356 to i32
%358 = sdiv i32 %357, 1
%359 = icmp slt i32 %354, %358
br i1 %359, label %360, label %365
360: ; preds = %350
%361 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 73
%362 = load i8, i8* %361
%363 = sext i8 %362 to i32
%364 = sdiv i32 %363, 1
br label %370
365: ; preds = %350
%366 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 84
%367 = load i8, i8* %366
%368 = sext i8 %367 to i32
%369 = sdiv i32 %368, 1
br label %370
370: ; preds = %365, %360
%371 = phi i32 [ %364, %360 ], [ %369, %365 ]
br label %372
372: ; preds = %370, %345
%373 = phi i32 [ %349, %345 ], [ %371, %370 ]
%374 = icmp slt i32 %318, %373
br i1 %374, label %375, label %380
375: ; preds = %372
%376 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 82
%377 = load i8, i8* %376
%378 = sext i8 %377 to i32
%379 = sdiv i32 %378, 2
br label %436
380: ; preds = %372
%381 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 71
%382 = load i8, i8* %381
%383 = sext i8 %382 to i32
%384 = sdiv i32 %383, 1
%385 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 73
%386 = load i8, i8* %385
%387 = sext i8 %386 to i32
%388 = sdiv i32 %387, 1
%389 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 84
%390 = load i8, i8* %389
%391 = sext i8 %390 to i32
%392 = sdiv i32 %391, 1
%393 = icmp slt i32 %388, %392
br i1 %393, label %394, label %399
394: ; preds = %380
%395 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 73
%396 = load i8, i8* %395
%397 = sext i8 %396 to i32
%398 = sdiv i32 %397, 1
br label %404
399: ; preds = %380
%400 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 84
%401 = load i8, i8* %400
%402 = sext i8 %401 to i32
%403 = sdiv i32 %402, 1
br label %404
404: ; preds = %399, %394
%405 = phi i32 [ %398, %394 ], [ %403, %399 ]
%406 = icmp slt i32 %384, %405
br i1 %406, label %407, label %412
407: ; preds = %404
%408 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 71
%409 = load i8, i8* %408
%410 = sext i8 %409 to i32
%411 = sdiv i32 %410, 1
br label %434
412: ; preds = %404
%413 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 73
%414 = load i8, i8* %413
%415 = sext i8 %414 to i32
%416 = sdiv i32 %415, 1
%417 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 84
%418 = load i8, i8* %417
%419 = sext i8 %418 to i32
%420 = sdiv i32 %419, 1
%421 = icmp slt i32 %416, %420
br i1 %421, label %422, label %427
422: ; preds = %412
%423 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 73
%424 = load i8, i8* %423
%425 = sext i8 %424 to i32
%426 = sdiv i32 %425, 1
br label %432
427: ; preds = %412
%428 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 84
%429 = load i8, i8* %428
%430 = sext i8 %429 to i32
%431 = sdiv i32 %430, 1
br label %432
432: ; preds = %427, %422
%433 = phi i32 [ %426, %422 ], [ %431, %427 ]
br label %434
434: ; preds = %432, %407
%435 = phi i32 [ %411, %407 ], [ %433, %432 ]
br label %436
436: ; preds = %434, %375
%437 = phi i32 [ %379, %375 ], [ %435, %434 ]
%438 = icmp slt i32 %314, %437
br i1 %438, label %439, label %444
439: ; preds = %436
%440 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 65
%441 = load i8, i8* %440
%442 = sext i8 %441 to i32
%443 = sdiv i32 %442, 3
br label %568
444: ; preds = %436
%445 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 82
%446 = load i8, i8* %445
%447 = sext i8 %446 to i32
%448 = sdiv i32 %447, 2
%449 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 71
%450 = load i8, i8* %449
%451 = sext i8 %450 to i32
%452 = sdiv i32 %451, 1
%453 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 73
%454 = load i8, i8* %453
%455 = sext i8 %454 to i32
%456 = sdiv i32 %455, 1
%457 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 84
%458 = load i8, i8* %457
%459 = sext i8 %458 to i32
%460 = sdiv i32 %459, 1
%461 = icmp slt i32 %456, %460
br i1 %461, label %462, label %467
462: ; preds = %444
%463 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 73
%464 = load i8, i8* %463
%465 = sext i8 %464 to i32
%466 = sdiv i32 %465, 1
br label %472
467: ; preds = %444
%468 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 84
%469 = load i8, i8* %468
%470 = sext i8 %469 to i32
%471 = sdiv i32 %470, 1
br label %472
472: ; preds = %467, %462
%473 = phi i32 [ %466, %462 ], [ %471, %467 ]
%474 = icmp slt i32 %452, %473
br i1 %474, label %475, label %480
475: ; preds = %472
%476 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 71
%477 = load i8, i8* %476
%478 = sext i8 %477 to i32
%479 = sdiv i32 %478, 1
br label %502
480: ; preds = %472
%481 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 73
%482 = load i8, i8* %481
%483 = sext i8 %482 to i32
%484 = sdiv i32 %483, 1
%485 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 84
%486 = load i8, i8* %485
%487 = sext i8 %486 to i32
%488 = sdiv i32 %487, 1
%489 = icmp slt i32 %484, %488
br i1 %489, label %490, label %495
490: ; preds = %480
%491 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 73
%492 = load i8, i8* %491
%493 = sext i8 %492 to i32
%494 = sdiv i32 %493, 1
br label %500
495: ; preds = %480
%496 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 84
%497 = load i8, i8* %496
%498 = sext i8 %497 to i32
%499 = sdiv i32 %498, 1
br label %500
500: ; preds = %495, %490
%501 = phi i32 [ %494, %490 ], [ %499, %495 ]
br label %502
502: ; preds = %500, %475
%503 = phi i32 [ %479, %475 ], [ %501, %500 ]
%504 = icmp slt i32 %448, %503
br i1 %504, label %505, label %510
505: ; preds = %502
%506 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 82
%507 = load i8, i8* %506
%508 = sext i8 %507 to i32
%509 = sdiv i32 %508, 2
br label %566
510: ; preds = %502
%511 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 71
%512 = load i8, i8* %511
%513 = sext i8 %512 to i32
%514 = sdiv i32 %513, 1
%515 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 73
%516 = load i8, i8* %515
%517 = sext i8 %516 to i32
%518 = sdiv i32 %517, 1
%519 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 84
%520 = load i8, i8* %519
%521 = sext i8 %520 to i32
%522 = sdiv i32 %521, 1
%523 = icmp slt i32 %518, %522
br i1 %523, label %524, label %529
524: ; preds = %510
%525 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 73
%526 = load i8, i8* %525
%527 = sext i8 %526 to i32
%528 = sdiv i32 %527, 1
br label %534
529: ; preds = %510
%530 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 84
%531 = load i8, i8* %530
%532 = sext i8 %531 to i32
%533 = sdiv i32 %532, 1
br label %534
534: ; preds = %529, %524
%535 = phi i32 [ %528, %524 ], [ %533, %529 ]
%536 = icmp slt i32 %514, %535
br i1 %536, label %537, label %542
537: ; preds = %534
%538 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 71
%539 = load i8, i8* %538
%540 = sext i8 %539 to i32
%541 = sdiv i32 %540, 1
br label %564
542: ; preds = %534
%543 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 73
%544 = load i8, i8* %543
%545 = sext i8 %544 to i32
%546 = sdiv i32 %545, 1
%547 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 84
%548 = load i8, i8* %547
%549 = sext i8 %548 to i32
%550 = sdiv i32 %549, 1
%551 = icmp slt i32 %546, %550
br i1 %551, label %552, label %557
552: ; preds = %542
%553 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 73
%554 = load i8, i8* %553
%555 = sext i8 %554 to i32
%556 = sdiv i32 %555, 1
br label %562
557: ; preds = %542
%558 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 84
%559 = load i8, i8* %558
%560 = sext i8 %559 to i32
%561 = sdiv i32 %560, 1
br label %562
562: ; preds = %557, %552
%563 = phi i32 [ %556, %552 ], [ %561, %557 ]
br label %564
564: ; preds = %562, %537
%565 = phi i32 [ %541, %537 ], [ %563, %562 ]
br label %566
566: ; preds = %564, %505
%567 = phi i32 [ %509, %505 ], [ %565, %564 ]
br label %568
568: ; preds = %566, %439
%569 = phi i32 [ %443, %439 ], [ %567, %566 ]
br label %570
570: ; preds = %568, %305
%571 = phi i32 [ %309, %305 ], [ %569, %568 ]
store i32 %571, i32* %8
%572 = load i32, i32* %8
%573 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %572)
br label %14
574: ; preds = %14
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca [128 x i8]
%5 = alloca [600 x i8]
%6 = bitcast i32* %3 to i8*
%7 = load i32, i32* @stdin
%8 = tail call i32 @fflush(i32 %7)
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%10 = load i32, i32* %3
%11 = add nsw i32 %10, -1
store i32 %11, i32* %3
%12 = icmp eq i32 %10, 0
br i1 %12, label %83, label %13
13: ; preds = %2
%14 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%15 = getelementptr inbounds [600 x i8], [600 x i8]* %5, i64 0, i64 0
%16 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 77
%17 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 65
%18 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 82
%19 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 71
%20 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 73
%21 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 84
br label %22
22: ; preds = %13, %76
%23 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %15)
%24 = call i32 @strlen(i8* %15)
%25 = icmp sgt i32 %24, 0
br i1 %25, label %26, label %45
26: ; preds = %22, %26
%27 = phi i64 [ %34, %26 ], [ 0, %22 ]
%28 = getelementptr inbounds [600 x i8], [600 x i8]* %5, i64 0, i64 %27
%29 = load i8, i8* %28
%30 = sext i8 %29 to i64
%31 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 %30
%32 = load i8, i8* %31
%33 = add i8 %32, 1
store i8 %33, i8* %31
%34 = add nuw nsw i64 %27, 1
%35 = call i32 @strlen(i8* %15)
%36 = sext i32 %35 to i64
%37 = icmp slt i64 %34, %36
br i1 %37, label %26, label %38
38: ; preds = %26
%39 = load i8, i8* %16
%40 = load i8, i8* %17
%41 = load i8, i8* %18
%42 = load i8, i8* %19
%43 = load i8, i8* %20
%44 = load i8, i8* %21
br label %45
45: ; preds = %38, %22
%46 = phi i8 [ %44, %38 ], [ 0, %22 ]
%47 = phi i8 [ %43, %38 ], [ 0, %22 ]
%48 = phi i8 [ %42, %38 ], [ 0, %22 ]
%49 = phi i8 [ %41, %38 ], [ 0, %22 ]
%50 = phi i8 [ %40, %38 ], [ 0, %22 ]
%51 = phi i8 [ %39, %38 ], [ 0, %22 ]
%52 = sdiv i8 %50, 3
%53 = sdiv i8 %49, 2
%54 = icmp slt i8 %47, %46
%55 = select i1 %54, i8 %47, i8 %46
%56 = icmp slt i8 %53, %48
%57 = select i1 %56, i8 %53, i8 %48
%58 = icmp slt i8 %57, %55
%59 = select i1 %58, i8 %57, i8 %55
%60 = icmp sgt i8 %59, %52
br i1 %60, label %70, label %61
61: ; preds = %45
%62 = icmp slt i8 %48, %55
%63 = icmp slt i8 %57, %55
%64 = select i1 %63, i8 %57, i8 %55
%65 = icmp sgt i8 %64, %51
%66 = select i1 %65, i1 true, i1 %60
%67 = select i1 %65, i8 %51, i8 %52
%68 = select i1 %66, i1 true, i1 %62
%69 = select i1 %66, i8 %67, i8 %57
br i1 %68, label %76, label %73
70: ; preds = %45
%71 = icmp sgt i8 %52, %51
%72 = select i1 %71, i8 %51, i8 %52
br label %76
73: ; preds = %61
%74 = icmp slt i8 %53, %55
%75 = select i1 %74, i8 %53, i8 %55
br label %76
76: ; preds = %70, %61, %73
%77 = phi i8 [ %69, %61 ], [ %75, %73 ], [ %72, %70 ]
%78 = sext i8 %77 to i32
%79 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %78)
%80 = load i32, i32* %3
%81 = add nsw i32 %80, -1
store i32 %81, i32* %3
%82 = icmp eq i32 %80, 0
br i1 %82, label %83, label %22
83: ; preds = %76, %2
ret i32 0
}