#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*/ draw(int, int, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *, ...);
int main(int argc, char const *argv[]) {
  int t;
  scanf("%d", &t);
  int input_array[t][3];
  for (int i = 0; i < t; ++i) {
    scanf("%d %d %d", &input_array[i][0], &input_array[i][1],
          &input_array[i][2]);
  }
  for (int i = 0; i < t; ++i) {
    draw(input_array[i][0], input_array[i][1], input_array[i][2]);
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb9(%rip),%rdi
xor    %eax,%eax
lea    -0x14(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x14(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
lea    (%rax,%rax,2),%rcx
lea    0xf(,%rcx,4),%rdx
movabs $0x1ffffffff0,%rcx
and    %rcx,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x38(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11ee <main+0xbe>
mov    -0x38(%rbp),%rcx
movslq -0x2c(%rbp),%rax
imul   $0xc,%rax,%rax
mov    %rcx,%rsi
add    %rax,%rsi
movslq -0x2c(%rbp),%rax
imul   $0xc,%rax,%rax
mov    %rcx,%rdx
add    %rax,%rdx
add    $0x4,%rdx
movslq -0x2c(%rbp),%rax
imul   $0xc,%rax,%rax
add    %rax,%rcx
add    $0x8,%rcx
lea    0xe27(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1193 <main+0x63>
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1253 <main+0x123>
mov    -0x38(%rbp),%rax
movslq -0x30(%rbp),%rcx
imul   $0xc,%rcx,%rdx
mov    %rax,%rcx
add    %rdx,%rcx
mov    (%rcx),%edi
movslq -0x30(%rbp),%rcx
imul   $0xc,%rcx,%rdx
mov    %rax,%rcx
add    %rdx,%rcx
mov    0x4(%rcx),%esi
movslq -0x30(%rbp),%rcx
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
mov    0x8(%rax),%edx
call   1030 <draw@plt>
lea    0xdc9(%rip),%rdi
call   1040 <printf@plt>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    11f5 <main+0xc5>
movl   $0x0,-0x4(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xec1(%rip),%rdi
lea    -0x2c(%rbp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %rsp,%r15
mov    -0x2c(%rbp),%eax
lea    (%rax,%rax,2),%rax
lea    0xf(,%rax,4),%rax
movabs $0x1ffffffff0,%rcx
and    %rax,%rcx
mov    %rsp,%r12
sub    %rcx,%r12
mov    %r12,%rsp
cmpl   $0x0,-0x2c(%rbp)
jle    11ee <main+0xbe>
lea    0xe7b(%rip),%r14
mov    %r12,%rbx
xor    %r13d,%r13d
nopl   0x0(%rax,%rax,1)
lea    0x4(%rbx),%rdx
lea    0x8(%rbx),%rcx
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
add    $0x1,%r13
movslq -0x2c(%rbp),%rax
add    $0xc,%rbx
cmp    %rax,%r13
jl     1190 <main+0x60>
test   %eax,%eax
jle    11ee <main+0xbe>
add    $0x8,%r12
xor    %ebx,%ebx
mov    -0x8(%r12),%edi
mov    -0x4(%r12),%esi
mov    (%r12),%edx
call   1040 <draw@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
movslq -0x2c(%rbp),%rax
add    $0xc,%r12
cmp    %rax,%rbx
jl     11c0 <main+0x90>
mov    %r15,%rsp
xor    %eax,%eax
lea    -0x28(%rbp),%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 = [9 x i8] c"%d %d %d\00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
%12 = load i32, i32* %6
%13 = zext i32 %12 to i64
%14 = call i8* @llvm.stacksave()
store i8* %14, i8** %7
%15 = alloca [3 x i32], i64 %13
store i64 %13, i64* %8
store i32 0, i32* %9
br label %16
16: ; preds = %34, %2
%17 = load i32, i32* %9
%18 = load i32, i32* %6
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %37
20: ; preds = %16
%21 = load i32, i32* %9
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [3 x i32], [3 x i32]* %15, i64 %22
%24 = getelementptr inbounds [3 x i32], [3 x i32]* %23, i64 0, i64 0
%25 = load i32, i32* %9
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [3 x i32], [3 x i32]* %15, i64 %26
%28 = getelementptr inbounds [3 x i32], [3 x i32]* %27, i64 0, i64 1
%29 = load i32, i32* %9
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [3 x i32], [3 x i32]* %15, i64 %30
%32 = getelementptr inbounds [3 x i32], [3 x i32]* %31, i64 0, i64 2
%33 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %24, i32* %28, i32* %32)
br label %34
34: ; preds = %20
%35 = load i32, i32* %9
%36 = add nsw i32 %35, 1
store i32 %36, i32* %9
br label %16
37: ; preds = %16
store i32 0, i32* %10
br label %38
38: ; preds = %60, %37
%39 = load i32, i32* %10
%40 = load i32, i32* %6
%41 = icmp slt i32 %39, %40
br i1 %41, label %42, label %63
42: ; preds = %38
%43 = load i32, i32* %10
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [3 x i32], [3 x i32]* %15, i64 %44
%46 = getelementptr inbounds [3 x i32], [3 x i32]* %45, i64 0, i64 0
%47 = load i32, i32* %46
%48 = load i32, i32* %10
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [3 x i32], [3 x i32]* %15, i64 %49
%51 = getelementptr inbounds [3 x i32], [3 x i32]* %50, i64 0, i64 1
%52 = load i32, i32* %51
%53 = load i32, i32* %10
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [3 x i32], [3 x i32]* %15, i64 %54
%56 = getelementptr inbounds [3 x i32], [3 x i32]* %55, i64 0, i64 2
%57 = load i32, i32* %56
%58 = call i32 @draw(i32 %47, i32 %52, i32 %57)
%59 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %60
60: ; preds = %42
%61 = load i32, i32* %10
%62 = add nsw i32 %61, 1
store i32 %62, i32* %10
br label %38
63: ; preds = %38
store i32 0, i32* %3
%64 = load i8*, i8** %7
%65 = load i32, i32* %3
ret i32 %65
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [9 x i8] c"%d %d %d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = load i32, i32* %3
%7 = zext i32 %6 to i64
%8 = call i8* @llvm.stacksave()
%9 = alloca [3 x i32], i64 %7
%10 = load i32, i32* %3
%11 = icmp sgt i32 %10, 0
br i1 %11, label %14, label %24
12: ; preds = %14
%13 = icmp sgt i32 %21, 0
br i1 %13, label %25, label %24
14: ; preds = %2, %14
%15 = phi i64 [ %20, %14 ], [ 0, %2 ]
%16 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 %15, i64 0
%17 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 %15, i64 1
%18 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 %15, i64 2
%19 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %16, i32* %17, i32* %18)
%20 = add nuw nsw i64 %15, 1
%21 = load i32, i32* %3
%22 = sext i32 %21 to i64
%23 = icmp slt i64 %20, %22
br i1 %23, label %14, label %12
24: ; preds = %25, %2, %12
ret i32 0
25: ; preds = %12, %25
%26 = phi i64 [ %35, %25 ], [ 0, %12 ]
%27 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 %26, i64 0
%28 = load i32, i32* %27
%29 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 %26, i64 1
%30 = load i32, i32* %29
%31 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 %26, i64 2
%32 = load i32, i32* %31
%33 = call i32 @draw(i32 %28, i32 %30, i32 %32)
%34 = call i32 @putchar(i32 10)
%35 = add nuw nsw i64 %26, 1
%36 = load i32, i32* %3
%37 = sext i32 %36 to i64
%38 = icmp slt i64 %35, %37
br i1 %38, label %25, label %24
}