#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*/ naive_printf(char *, ...);
int /*<<< orphan*/ naive_scanf(char *, ...);
int program_main() {
  int i;
  int n, m;
  char s[81];
  naive_scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    naive_scanf("%d", &m);
    naive_scanf("%s", s);
    naive_printf("%d ", i);
    if (m > 1) {
      s[m - 1] = '\0';
      naive_printf("%s%s\n", s, s + m);
    } else {
      naive_printf("%s\n", s + 1);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<program_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
lea    0xed1(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1030 <naive_scanf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11e4 <program_main+0xc4>
lea    0xeac(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1030 <naive_scanf@plt>
lea    -0x60(%rbp),%rsi
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1030 <naive_scanf@plt>
mov    -0x4(%rbp),%esi
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1040 <naive_printf@plt>
cmpl   $0x1,-0xc(%rbp)
jle    11bb <program_main+0x9b>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
cltq
movb   $0x0,-0x60(%rbp,%rax,1)
lea    -0x60(%rbp),%rsi
lea    -0x60(%rbp),%rdx
movslq -0xc(%rbp),%rax
add    %rax,%rdx
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1040 <naive_printf@plt>
jmp    11d1 <program_main+0xb1>
lea    -0x60(%rbp),%rsi
add    $0x1,%rsi
lea    0xe42(%rip),%rdi
mov    $0x0,%al
call   1040 <naive_printf@plt>
jmp    11d6 <program_main+0xb6>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <program_main+0x21>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<program_main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
lea    0xecb(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1030 <naive_scanf@plt>
cmpl   $0x0,0x8(%rsp)
jle    11e6 <program_main+0xc6>
lea    0xead(%rip),%r15
lea    0xc(%rsp),%r12
lea    0xea4(%rip),%r13
lea    0x10(%rsp),%rbx
lea    0xe9b(%rip),%rbp
xor    %r14d,%r14d
jmp    118a <program_main+0x6a>
lea    0xe95(%rip),%rdi
lea    0x11(%rsp),%rsi
xor    %eax,%eax
call   1040 <naive_printf@plt>
cmp    0x8(%rsp),%r14d
jge    11e6 <program_main+0xc6>
add    $0x1,%r14d
mov    %r15,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1030 <naive_scanf@plt>
mov    %r13,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <naive_scanf@plt>
mov    %rbp,%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <naive_printf@plt>
mov    0xc(%rsp),%eax
cmp    $0x2,%eax
jl     1170 <program_main+0x50>
lea    -0x1(%rax),%ecx
movb   $0x0,0x10(%rsp,%rcx,1)
lea    (%rsp,%rax,1),%rdx
add    $0x10,%rdx
lea    0xe35(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <naive_printf@plt>
cmp    0x8(%rsp),%r14d
jl     118a <program_main+0x6a>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [4 x i8] c"%d \00"
@.str.3 = [6 x i8] c"%s%s\0A\00"
@.str.4 = [4 x i8] c"%s\0A\00"
define i32 @program_main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [81 x i8]
%5 = call i32 (i8*, ...) @naive_scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
store i32 1, i32* %1
br label %6
6: ; preds = %34, %0
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = icmp sle i32 %7, %8
br i1 %9, label %10, label %37
10: ; preds = %6
%11 = call i32 (i8*, ...) @naive_scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%12 = getelementptr inbounds [81 x i8], [81 x i8]* %4, i64 0, i64 0
%13 = call i32 (i8*, ...) @naive_scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %12)
%14 = load i32, i32* %1
%15 = call i32 (i8*, ...) @naive_printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %14)
%16 = load i32, i32* %3
%17 = icmp sgt i32 %16, 1
br i1 %17, label %18, label %29
18: ; preds = %10
%19 = load i32, i32* %3
%20 = sub nsw i32 %19, 1
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [81 x i8], [81 x i8]* %4, i64 0, i64 %21
store i8 0, i8* %22
%23 = getelementptr inbounds [81 x i8], [81 x i8]* %4, i64 0, i64 0
%24 = getelementptr inbounds [81 x i8], [81 x i8]* %4, i64 0, i64 0
%25 = load i32, i32* %3
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8, i8* %24, i64 %26
%28 = call i32 (i8*, ...) @naive_printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* %23, i8* %27)
br label %33
29: ; preds = %10
%30 = getelementptr inbounds [81 x i8], [81 x i8]* %4, i64 0, i64 0
%31 = getelementptr inbounds i8, i8* %30, i64 1
%32 = call i32 (i8*, ...) @naive_printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %31)
br label %33
33: ; preds = %29, %18
br label %34
34: ; preds = %33
%35 = load i32, i32* %1
%36 = add nsw i32 %35, 1
store i32 %36, i32* %1
br label %6
37: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [4 x i8] c"%d \00"
@.str.3 = [6 x i8] c"%s%s\0A\00"
@.str.4 = [4 x i8] c"%s\0A\00"
define i32 @program_main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [81 x i8]
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = getelementptr inbounds [81 x i8], [81 x i8]* %3, i64 0, i64 0
%7 = call i32 (i8*, ...) @naive_scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%8 = load i32, i32* %1
%9 = icmp slt i32 %8, 1
br i1 %9, label %32, label %10
10: ; preds = %0
%11 = getelementptr inbounds [81 x i8], [81 x i8]* %3, i64 0, i64 1
br label %12
12: ; preds = %10, %28
%13 = phi i32 [ 1, %10 ], [ %29, %28 ]
%14 = call i32 (i8*, ...) @naive_scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%15 = call i32 (i8*, ...) @naive_scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%16 = call i32 (i8*, ...) @naive_printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %13)
%17 = load i32, i32* %2
%18 = icmp sgt i32 %17, 1
br i1 %18, label %19, label %26
19: ; preds = %12
%20 = add nsw i32 %17, -1
%21 = zext i32 %20 to i64
%22 = getelementptr inbounds [81 x i8], [81 x i8]* %3, i64 0, i64 %21
store i8 0, i8* %22
%23 = zext i32 %17 to i64
%24 = getelementptr inbounds [81 x i8], [81 x i8]* %3, i64 0, i64 %23
%25 = call i32 (i8*, ...) @naive_printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* %6, i8* %24)
br label %28
26: ; preds = %12
%27 = call i32 (i8*, ...) @naive_printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %11)
br label %28
28: ; preds = %19, %26
%29 = add nuw nsw i32 %13, 1
%30 = load i32, i32* %1
%31 = icmp slt i32 %13, %30
br i1 %31, label %12, label %32
32: ; preds = %28, %0
ret i32 0
}