#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 *, char *);
int main() {
  char cards[13];
  int i = 0, a, b, n;
  while (i < 13) {
    scanf("%[^\n]s", cards);
    if (cards[i] == '2')
      cards[i] = 2;
    if (cards[i] == '3')
      cards[i] = 3;
    if (cards[i] == '4')
      cards[i] = 4;
    if (cards[i] == '5')
      cards[i] = 5;
    if (cards[i] == '6')
      cards[i] = 6;
    if (cards[i] == '7')
      cards[i] = 7;
    if (cards[i] == '8')
      cards[i] = 8;
    if (cards[i] == '9')
      cards[i] = 9;
    if (cards[i] == 'T')
      cards[i] = 10;
    if (cards[i] == 'J')
      cards[i] = 11;
    if (cards[i] == 'Q')
      cards[i] = 12;
    if (cards[i] == 'K')
      cards[i] = 13;
    if (cards[i] == 'A')
      cards[i] = 14;
    i++;
  }
  n = 13;
  for (i = 0; i < n; i++)
    for (b = n - 1; b > i; b--) {
      if (cards[b - 1] > cards[b]) {
        a = cards[b - 1];
        cards[b - 1] = cards[b];
        cards[b] = a;
      }
    }
  for (i = 0; i < 8; i++) {
    printf("\n%d", cards[i]);
  }
  for (i = 8; i < n; i++) {
    if (cards[i] == 10)
      cards[i] = 'T';
    if (cards[i] == 11)
      cards[i] = 'J';
    if (cards[i] == 12)
      cards[i] = 'Q';
    if (cards[i] == 13)
      cards[i] = 'K';
    if (cards[i] == 14)
      cards[i] = 'A';
    printf("\n%c", cards[i]);
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0xd,-0x18(%rbp)
jge    12bd <main+0x19d>
lea    -0x11(%rbp),%rsi
lea    0xeb5(%rip),%rdi
call   1040 <scanf@plt>
movslq -0x18(%rbp),%rax
movsbl -0x11(%rbp,%rax,1),%eax
cmp    $0x32,%eax
jne    116b <main+0x4b>
movslq -0x18(%rbp),%rax
movb   $0x2,-0x11(%rbp,%rax,1)
movslq -0x18(%rbp),%rax
movsbl -0x11(%rbp,%rax,1),%eax
cmp    $0x33,%eax
jne    1186 <main+0x66>
movslq -0x18(%rbp),%rax
movb   $0x3,-0x11(%rbp,%rax,1)
movslq -0x18(%rbp),%rax
movsbl -0x11(%rbp,%rax,1),%eax
cmp    $0x34,%eax
jne    11a1 <main+0x81>
movslq -0x18(%rbp),%rax
movb   $0x4,-0x11(%rbp,%rax,1)
movslq -0x18(%rbp),%rax
movsbl -0x11(%rbp,%rax,1),%eax
cmp    $0x35,%eax
jne    11bc <main+0x9c>
movslq -0x18(%rbp),%rax
movb   $0x5,-0x11(%rbp,%rax,1)
movslq -0x18(%rbp),%rax
movsbl -0x11(%rbp,%rax,1),%eax
cmp    $0x36,%eax
jne    11d7 <main+0xb7>
movslq -0x18(%rbp),%rax
movb   $0x6,-0x11(%rbp,%rax,1)
movslq -0x18(%rbp),%rax
movsbl -0x11(%rbp,%rax,1),%eax
cmp    $0x37,%eax
jne    11f2 <main+0xd2>
movslq -0x18(%rbp),%rax
movb   $0x7,-0x11(%rbp,%rax,1)
movslq -0x18(%rbp),%rax
movsbl -0x11(%rbp,%rax,1),%eax
cmp    $0x38,%eax
jne    120d <main+0xed>
movslq -0x18(%rbp),%rax
movb   $0x8,-0x11(%rbp,%rax,1)
movslq -0x18(%rbp),%rax
movsbl -0x11(%rbp,%rax,1),%eax
cmp    $0x39,%eax
jne    1228 <main+0x108>
movslq -0x18(%rbp),%rax
movb   $0x9,-0x11(%rbp,%rax,1)
movslq -0x18(%rbp),%rax
movsbl -0x11(%rbp,%rax,1),%eax
cmp    $0x54,%eax
jne    1243 <main+0x123>
movslq -0x18(%rbp),%rax
movb   $0xa,-0x11(%rbp,%rax,1)
movslq -0x18(%rbp),%rax
movsbl -0x11(%rbp,%rax,1),%eax
cmp    $0x4a,%eax
jne    125e <main+0x13e>
movslq -0x18(%rbp),%rax
movb   $0xb,-0x11(%rbp,%rax,1)
movslq -0x18(%rbp),%rax
movsbl -0x11(%rbp,%rax,1),%eax
cmp    $0x51,%eax
jne    1279 <main+0x159>
movslq -0x18(%rbp),%rax
movb   $0xc,-0x11(%rbp,%rax,1)
movslq -0x18(%rbp),%rax
movsbl -0x11(%rbp,%rax,1),%eax
cmp    $0x4b,%eax
jne    1294 <main+0x174>
movslq -0x18(%rbp),%rax
movb   $0xd,-0x11(%rbp,%rax,1)
movslq -0x18(%rbp),%rax
movsbl -0x11(%rbp,%rax,1),%eax
cmp    $0x41,%eax
jne    12af <main+0x18f>
movslq -0x18(%rbp),%rax
movb   $0xe,-0x11(%rbp,%rax,1)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1136 <main+0x16>
movl   $0xd,-0x24(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1361 <main+0x241>
mov    -0x24(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x18(%rbp),%eax
jle    134e <main+0x22e>
mov    -0x20(%rbp),%eax
sub    $0x1,%eax
cltq
movsbl -0x11(%rbp,%rax,1),%eax
movslq -0x20(%rbp),%rcx
movsbl -0x11(%rbp,%rcx,1),%ecx
cmp    %ecx,%eax
jle    133b <main+0x21b>
mov    -0x20(%rbp),%eax
sub    $0x1,%eax
cltq
movsbl -0x11(%rbp,%rax,1),%eax
mov    %eax,-0x1c(%rbp)
movslq -0x20(%rbp),%rax
mov    -0x11(%rbp,%rax,1),%cl
mov    -0x20(%rbp),%eax
sub    $0x1,%eax
cltq
mov    %cl,-0x11(%rbp,%rax,1)
mov    -0x1c(%rbp),%eax
mov    %al,%cl
movslq -0x20(%rbp),%rax
mov    %cl,-0x11(%rbp,%rax,1)
jmp    1340 <main+0x220>
mov    -0x20(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x20(%rbp)
jmp    12e0 <main+0x1c0>
jmp    1353 <main+0x233>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    12cb <main+0x1ab>
movl   $0x0,-0x18(%rbp)
cmpl   $0x8,-0x18(%rbp)
jge    1397 <main+0x277>
movslq -0x18(%rbp),%rax
movsbl -0x11(%rbp,%rax,1),%esi
lea    0xc85(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1368 <main+0x248>
movl   $0x8,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1456 <main+0x336>
movslq -0x18(%rbp),%rax
movsbl -0x11(%rbp,%rax,1),%eax
cmp    $0xa,%eax
jne    13c5 <main+0x2a5>
movslq -0x18(%rbp),%rax
movb   $0x54,-0x11(%rbp,%rax,1)
movslq -0x18(%rbp),%rax
movsbl -0x11(%rbp,%rax,1),%eax
cmp    $0xb,%eax
jne    13e0 <main+0x2c0>
movslq -0x18(%rbp),%rax
movb   $0x4a,-0x11(%rbp,%rax,1)
movslq -0x18(%rbp),%rax
movsbl -0x11(%rbp,%rax,1),%eax
cmp    $0xc,%eax
jne    13fb <main+0x2db>
movslq -0x18(%rbp),%rax
movb   $0x51,-0x11(%rbp,%rax,1)
movslq -0x18(%rbp),%rax
movsbl -0x11(%rbp,%rax,1),%eax
cmp    $0xd,%eax
jne    1416 <main+0x2f6>
movslq -0x18(%rbp),%rax
movb   $0x4b,-0x11(%rbp,%rax,1)
movslq -0x18(%rbp),%rax
movsbl -0x11(%rbp,%rax,1),%eax
cmp    $0xe,%eax
jne    1431 <main+0x311>
movslq -0x18(%rbp),%rax
movb   $0x41,-0x11(%rbp,%rax,1)
movslq -0x18(%rbp),%rax
movsbl -0x11(%rbp,%rax,1),%esi
lea    0xbca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    139e <main+0x27e>
lea    0xbb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
xor    %ebx,%ebx
lea    0xf48(%rip),%r14
lea    0xb(%rsp),%r15
lea    0xeb0(%rip),%r12
mov    %r14,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
movzbl 0xb(%rsp,%rbx,1),%ecx
add    $0xce,%cl
cmp    $0x22,%cl
ja     11b4 <main+0x84>
mov    $0xa,%sil
mov    $0x8,%dil
mov    $0x6,%r8b
mov    $0x4,%dl
mov    $0x2,%al
movzbl %cl,%ecx
movslq (%r12,%rcx,4),%rcx
add    %r12,%rcx
jmp    *%rcx
mov    $0x3,%al
jmp    11b0 <main+0x80>
mov    $0x5,%dl
mov    %edx,%eax
jmp    11b0 <main+0x80>
mov    $0x7,%r8b
mov    %r8d,%eax
jmp    11b0 <main+0x80>
mov    $0x9,%dil
mov    %edi,%eax
jmp    11b0 <main+0x80>
mov    $0xe,%al
jmp    11b0 <main+0x80>
mov    $0xb,%sil
mov    %esi,%eax
jmp    11b0 <main+0x80>
mov    $0xd,%al
jmp    11b0 <main+0x80>
mov    $0xc,%al
nopl   0x0(%rax,%rax,1)
mov    %al,0xb(%rsp,%rbx,1)
add    $0x1,%rbx
cmp    $0xd,%rbx
jne    1150 <main+0x20>
xor    %eax,%eax
jmp    11da <main+0xaa>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%rax
cmp    $0xd,%rax
je     1211 <main+0xe1>
cmp    $0xb,%rax
ja     11d0 <main+0xa0>
mov    $0xc,%edx
mov    0x17(%rsp),%bl
jmp    1200 <main+0xd0>
nopl   0x0(%rax,%rax,1)
mov    %bl,0xa(%rsp,%rdx,1)
mov    %cl,0xb(%rsp,%rdx,1)
mov    %rsi,%rdx
cmp    %rax,%rsi
jbe    11d0 <main+0xa0>
lea    -0x1(%rdx),%rsi
movzbl 0xa(%rsp,%rdx,1),%ecx
cmp    %bl,%cl
jg     11f0 <main+0xc0>
mov    %ecx,%ebx
jmp    11f8 <main+0xc8>
movabs $0x414b514a54,%r14
movsbl 0xb(%rsp),%esi
lea    0xe6c(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0xc(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0xd(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0xe(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0xf(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0x10(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0x11(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0x12(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x13(%rsp),%al
lea    -0xa(%rax),%ecx
cmp    $0x4,%cl
ja     12b6 <main+0x186>
movzbl %cl,%ecx
shl    $0x3,%ecx
mov    %r14,%rax
shr    %cl,%rax
mov    %al,0x13(%rsp)
movsbl %al,%esi
lea    0xdd7(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x14(%rsp),%al
lea    -0xa(%rax),%ecx
cmp    $0x4,%cl
ja     12e3 <main+0x1b3>
movzbl %cl,%ecx
shl    $0x3,%ecx
mov    %r14,%rax
shr    %cl,%rax
mov    %al,0x14(%rsp)
movsbl %al,%esi
lea    0xdaa(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x15(%rsp),%al
lea    -0xa(%rax),%ecx
cmp    $0x4,%cl
ja     1310 <main+0x1e0>
movzbl %cl,%ecx
shl    $0x3,%ecx
mov    %r14,%rax
shr    %cl,%rax
mov    %al,0x15(%rsp)
movsbl %al,%esi
lea    0xd7d(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x16(%rsp),%al
lea    -0xa(%rax),%ecx
cmp    $0x4,%cl
ja     133d <main+0x20d>
movzbl %cl,%ecx
shl    $0x3,%ecx
mov    %r14,%rax
shr    %cl,%rax
mov    %al,0x16(%rsp)
movsbl %al,%esi
lea    0xd50(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x17(%rsp),%al
lea    -0xa(%rax),%ecx
cmp    $0x4,%cl
ja     136b <main+0x23b>
movzbl %cl,%ecx
shl    $0x3,%ecx
shr    %cl,%r14
mov    %r14b,0x17(%rsp)
mov    %r14d,%eax
movsbl %al,%esi
lea    0xd22(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%[^\0A]s\00"
@.str.1 = [4 x i8] c"\0A%d\00"
@.str.2 = [4 x i8] c"\0A%c\00"
@.str.3 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [13 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
br label %7
7: ; preds = %155, %0
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 13
br i1 %9, label %10, label %158
10: ; preds = %7
%11 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 0
%12 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 %14
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 50
br i1 %18, label %19, label %23
19: ; preds = %10
%20 = load i32, i32* %3
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 %21
store i8 2, i8* %22
br label %23
23: ; preds = %19, %10
%24 = load i32, i32* %3
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 %25
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = icmp eq i32 %28, 51
br i1 %29, label %30, label %34
30: ; preds = %23
%31 = load i32, i32* %3
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 %32
store i8 3, i8* %33
br label %34
34: ; preds = %30, %23
%35 = load i32, i32* %3
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 %36
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
%40 = icmp eq i32 %39, 52
br i1 %40, label %41, label %45
41: ; preds = %34
%42 = load i32, i32* %3
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 %43
store i8 4, i8* %44
br label %45
45: ; preds = %41, %34
%46 = load i32, i32* %3
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 %47
%49 = load i8, i8* %48
%50 = sext i8 %49 to i32
%51 = icmp eq i32 %50, 53
br i1 %51, label %52, label %56
52: ; preds = %45
%53 = load i32, i32* %3
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 %54
store i8 5, i8* %55
br label %56
56: ; preds = %52, %45
%57 = load i32, i32* %3
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 %58
%60 = load i8, i8* %59
%61 = sext i8 %60 to i32
%62 = icmp eq i32 %61, 54
br i1 %62, label %63, label %67
63: ; preds = %56
%64 = load i32, i32* %3
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 %65
store i8 6, i8* %66
br label %67
67: ; preds = %63, %56
%68 = load i32, i32* %3
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 %69
%71 = load i8, i8* %70
%72 = sext i8 %71 to i32
%73 = icmp eq i32 %72, 55
br i1 %73, label %74, label %78
74: ; preds = %67
%75 = load i32, i32* %3
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 %76
store i8 7, i8* %77
br label %78
78: ; preds = %74, %67
%79 = load i32, i32* %3
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 %80
%82 = load i8, i8* %81
%83 = sext i8 %82 to i32
%84 = icmp eq i32 %83, 56
br i1 %84, label %85, label %89
85: ; preds = %78
%86 = load i32, i32* %3
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 %87
store i8 8, i8* %88
br label %89
89: ; preds = %85, %78
%90 = load i32, i32* %3
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 %91
%93 = load i8, i8* %92
%94 = sext i8 %93 to i32
%95 = icmp eq i32 %94, 57
br i1 %95, label %96, label %100
96: ; preds = %89
%97 = load i32, i32* %3
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 %98
store i8 9, i8* %99
br label %100
100: ; preds = %96, %89
%101 = load i32, i32* %3
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 %102
%104 = load i8, i8* %103
%105 = sext i8 %104 to i32
%106 = icmp eq i32 %105, 84
br i1 %106, label %107, label %111
107: ; preds = %100
%108 = load i32, i32* %3
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 %109
store i8 10, i8* %110
br label %111
111: ; preds = %107, %100
%112 = load i32, i32* %3
%113 = sext i32 %112 to i64
%114 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 %113
%115 = load i8, i8* %114
%116 = sext i8 %115 to i32
%117 = icmp eq i32 %116, 74
br i1 %117, label %118, label %122
118: ; preds = %111
%119 = load i32, i32* %3
%120 = sext i32 %119 to i64
%121 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 %120
store i8 11, i8* %121
br label %122
122: ; preds = %118, %111
%123 = load i32, i32* %3
%124 = sext i32 %123 to i64
%125 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 %124
%126 = load i8, i8* %125
%127 = sext i8 %126 to i32
%128 = icmp eq i32 %127, 81
br i1 %128, label %129, label %133
129: ; preds = %122
%130 = load i32, i32* %3
%131 = sext i32 %130 to i64
%132 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 %131
store i8 12, i8* %132
br label %133
133: ; preds = %129, %122
%134 = load i32, i32* %3
%135 = sext i32 %134 to i64
%136 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 %135
%137 = load i8, i8* %136
%138 = sext i8 %137 to i32
%139 = icmp eq i32 %138, 75
br i1 %139, label %140, label %144
140: ; preds = %133
%141 = load i32, i32* %3
%142 = sext i32 %141 to i64
%143 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 %142
store i8 13, i8* %143
br label %144
144: ; preds = %140, %133
%145 = load i32, i32* %3
%146 = sext i32 %145 to i64
%147 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 %146
%148 = load i8, i8* %147
%149 = sext i8 %148 to i32
%150 = icmp eq i32 %149, 65
br i1 %150, label %151, label %155
151: ; preds = %144
%152 = load i32, i32* %3
%153 = sext i32 %152 to i64
%154 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 %153
store i8 14, i8* %154
br label %155
155: ; preds = %151, %144
%156 = load i32, i32* %3
%157 = add nsw i32 %156, 1
store i32 %157, i32* %3
br label %7
158: ; preds = %7
store i32 13, i32* %6
store i32 0, i32* %3
br label %159
159: ; preds = %208, %158
%160 = load i32, i32* %3
%161 = load i32, i32* %6
%162 = icmp slt i32 %160, %161
br i1 %162, label %163, label %211
163: ; preds = %159
%164 = load i32, i32* %6
%165 = sub nsw i32 %164, 1
store i32 %165, i32* %5
br label %166
166: ; preds = %204, %163
%167 = load i32, i32* %5
%168 = load i32, i32* %3
%169 = icmp sgt i32 %167, %168
br i1 %169, label %170, label %207
170: ; preds = %166
%171 = load i32, i32* %5
%172 = sub nsw i32 %171, 1
%173 = sext i32 %172 to i64
%174 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 %173
%175 = load i8, i8* %174
%176 = sext i8 %175 to i32
%177 = load i32, i32* %5
%178 = sext i32 %177 to i64
%179 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 %178
%180 = load i8, i8* %179
%181 = sext i8 %180 to i32
%182 = icmp sgt i32 %176, %181
br i1 %182, label %183, label %203
183: ; preds = %170
%184 = load i32, i32* %5
%185 = sub nsw i32 %184, 1
%186 = sext i32 %185 to i64
%187 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 %186
%188 = load i8, i8* %187
%189 = sext i8 %188 to i32
store i32 %189, i32* %4
%190 = load i32, i32* %5
%191 = sext i32 %190 to i64
%192 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 %191
%193 = load i8, i8* %192
%194 = load i32, i32* %5
%195 = sub nsw i32 %194, 1
%196 = sext i32 %195 to i64
%197 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 %196
store i8 %193, i8* %197
%198 = load i32, i32* %4
%199 = trunc i32 %198 to i8
%200 = load i32, i32* %5
%201 = sext i32 %200 to i64
%202 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 %201
store i8 %199, i8* %202
br label %203
203: ; preds = %183, %170
br label %204
204: ; preds = %203
%205 = load i32, i32* %5
%206 = add nsw i32 %205, -1
store i32 %206, i32* %5
br label %166
207: ; preds = %166
br label %208
208: ; preds = %207
%209 = load i32, i32* %3
%210 = add nsw i32 %209, 1
store i32 %210, i32* %3
br label %159
211: ; preds = %159
store i32 0, i32* %3
br label %212
212: ; preds = %222, %211
%213 = load i32, i32* %3
%214 = icmp slt i32 %213, 8
br i1 %214, label %215, label %225
215: ; preds = %212
%216 = load i32, i32* %3
%217 = sext i32 %216 to i64
%218 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 %217
%219 = load i8, i8* %218
%220 = sext i8 %219 to i32
%221 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %220)
br label %222
222: ; preds = %215
%223 = load i32, i32* %3
%224 = add nsw i32 %223, 1
store i32 %224, i32* %3
br label %212
225: ; preds = %212
store i32 8, i32* %3
br label %226
226: ; preds = %292, %225
%227 = load i32, i32* %3
%228 = load i32, i32* %6
%229 = icmp slt i32 %227, %228
br i1 %229, label %230, label %295
230: ; preds = %226
%231 = load i32, i32* %3
%232 = sext i32 %231 to i64
%233 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 %232
%234 = load i8, i8* %233
%235 = sext i8 %234 to i32
%236 = icmp eq i32 %235, 10
br i1 %236, label %237, label %241
237: ; preds = %230
%238 = load i32, i32* %3
%239 = sext i32 %238 to i64
%240 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 %239
store i8 84, i8* %240
br label %241
241: ; preds = %237, %230
%242 = load i32, i32* %3
%243 = sext i32 %242 to i64
%244 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 %243
%245 = load i8, i8* %244
%246 = sext i8 %245 to i32
%247 = icmp eq i32 %246, 11
br i1 %247, label %248, label %252
248: ; preds = %241
%249 = load i32, i32* %3
%250 = sext i32 %249 to i64
%251 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 %250
store i8 74, i8* %251
br label %252
252: ; preds = %248, %241
%253 = load i32, i32* %3
%254 = sext i32 %253 to i64
%255 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 %254
%256 = load i8, i8* %255
%257 = sext i8 %256 to i32
%258 = icmp eq i32 %257, 12
br i1 %258, label %259, label %263
259: ; preds = %252
%260 = load i32, i32* %3
%261 = sext i32 %260 to i64
%262 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 %261
store i8 81, i8* %262
br label %263
263: ; preds = %259, %252
%264 = load i32, i32* %3
%265 = sext i32 %264 to i64
%266 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 %265
%267 = load i8, i8* %266
%268 = sext i8 %267 to i32
%269 = icmp eq i32 %268, 13
br i1 %269, label %270, label %274
270: ; preds = %263
%271 = load i32, i32* %3
%272 = sext i32 %271 to i64
%273 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 %272
store i8 75, i8* %273
br label %274
274: ; preds = %270, %263
%275 = load i32, i32* %3
%276 = sext i32 %275 to i64
%277 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 %276
%278 = load i8, i8* %277
%279 = sext i8 %278 to i32
%280 = icmp eq i32 %279, 14
br i1 %280, label %281, label %285
281: ; preds = %274
%282 = load i32, i32* %3
%283 = sext i32 %282 to i64
%284 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 %283
store i8 65, i8* %284
br label %285
285: ; preds = %281, %274
%286 = load i32, i32* %3
%287 = sext i32 %286 to i64
%288 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 %287
%289 = load i8, i8* %288
%290 = sext i8 %289 to i32
%291 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %290)
br label %292
292: ; preds = %285
%293 = load i32, i32* %3
%294 = add nsw i32 %293, 1
store i32 %294, i32* %3
br label %226
295: ; preds = %226
%296 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

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