#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*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ proxyc(int, char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ stdin;
int main() {
  int t, d;
  char s[1001], *c;
  scanf("%d", &t);
  while (t--) {
    scanf("%d ", &d);
    fgets(s, d + 1, stdin);
    proxyc(d, s);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     11a5 <main+0x75>
lea    0xe96(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
lea    -0x400(%rbp),%rdi
mov    -0xc(%rbp),%esi
add    $0x1,%esi
mov    0x2e5e(%rip),%rax
mov    (%rax),%edx
call   1040 <fgets@plt>
mov    -0xc(%rbp),%edi
lea    -0x400(%rbp),%rsi
call   1030 <proxyc@plt>
jmp    1152 <main+0x22>
xor    %eax,%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x408,%rsp
lea    0xebb(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
subl   $0x1,0xc(%rsp)
jb     11a1 <main+0x71>
lea    0xea6(%rip),%r14
lea    0x8(%rsp),%r15
mov    0x2e7f(%rip),%r12
lea    0x10(%rsp),%rbx
xchg   %ax,%ax
mov    %r14,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
mov    0x8(%rsp),%esi
add    $0x1,%esi
mov    (%r12),%edx
mov    %rbx,%rdi
call   1040 <fgets@plt>
mov    0x8(%rsp),%edi
mov    %rbx,%rsi
call   1030 <proxyc@plt>
subl   $0x1,0xc(%rsp)
jae    1170 <main+0x40>
xor    %eax,%eax
add    $0x408,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d \00"
@stdin = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [1001 x i8]
%5 = alloca i8*
store i32 0, i32* %1
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %7
7: ; preds = %11, %0
%8 = load i32, i32* %2
%9 = add nsw i32 %8, -1
store i32 %9, i32* %2
%10 = icmp ne i32 %8, 0
br i1 %10, label %11, label %21
11: ; preds = %7
%12 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%13 = getelementptr inbounds [1001 x i8], [1001 x i8]* %4, i64 0, i64 0
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
%16 = load i32, i32* @stdin
%17 = call i32 @fgets(i8* %13, i32 %15, i32 %16)
%18 = load i32, i32* %3
%19 = getelementptr inbounds [1001 x i8], [1001 x i8]* %4, i64 0, i64 0
%20 = call i32 @proxyc(i32 %18, i8* %19)
br label %7
21: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d \00"
@stdin = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [1001 x i8]
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = getelementptr inbounds [1001 x i8], [1001 x i8]* %3, i64 0, i64 0
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%8 = load i32, i32* %1
%9 = add nsw i32 %8, -1
store i32 %9, i32* %1
%10 = icmp eq i32 %8, 0
br i1 %10, label %22, label %11
11: ; preds = %0, %11
%12 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%13 = load i32, i32* %2
%14 = add nsw i32 %13, 1
%15 = load i32, i32* @stdin
%16 = call i32 @fgets(i8* %6, i32 %14, i32 %15)
%17 = load i32, i32* %2
%18 = call i32 @proxyc(i32 %17, i8* %6)
%19 = load i32, i32* %1
%20 = add nsw i32 %19, -1
store i32 %20, i32* %1
%21 = icmp eq i32 %19, 0
br i1 %21, label %22, label %11
22: ; preds = %11, %0
ret i32 0
}