#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*/ putchar(char);
void Picture(int Image[], int Size) {
  int Row, Col, Tst;
  for (Row = 0; Row < Size; Row++) {
    putchar('\n');
    Tst = Image[Row];
    for (Col = 0; Col < Size; Col++) {
      putchar(' ');
      putchar(Col == Tst ? 'Q' : '.');
    }
  }
  putchar('\n');
  putchar('\n');
}


x86 assembly (clang, -O0):
<Picture>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11a5 <Picture+0x95>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1192 <Picture+0x82>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%esi
mov    $0x2e,%eax
mov    $0x51,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1151 <Picture+0x41>
jmp    1197 <Picture+0x87>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <Picture+0x16>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Picture>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,(%rsp)
test   %esi,%esi
jle    118d <Picture+0x7d>
mov    %esi,%ebx
mov    %esi,%r15d
xor    %r12d,%r12d
mov    $0x51,%r13d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    (%rsp),%rax
mov    (%rax,%r12,4),%ebp
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x20,%edi
call   1030 <putchar@plt>
cmp    %r14d,%ebp
mov    $0x2e,%edi
cmove  %r13d,%edi
call   1030 <putchar@plt>
add    $0x1,%r14d
cmp    %r14d,%ebx
jne    1160 <Picture+0x50>
add    $0x1,%r12
cmp    %r15,%r12
jne    1140 <Picture+0x30>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @Picture(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %8
8: ; preds = %36, %2
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %39
12: ; preds = %8
%13 = call i32 @putchar(i8 signext 10)
%14 = load i32*, i32** %3
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
%18 = load i32, i32* %17
store i32 %18, i32* %7
store i32 0, i32* %6
br label %19
19: ; preds = %32, %12
%20 = load i32, i32* %6
%21 = load i32, i32* %4
%22 = icmp slt i32 %20, %21
br i1 %22, label %23, label %35
23: ; preds = %19
%24 = call i32 @putchar(i8 signext 32)
%25 = load i32, i32* %6
%26 = load i32, i32* %7
%27 = icmp eq i32 %25, %26
%28 = zext i1 %27 to i64
%29 = select i1 %27, i32 81, i32 46
%30 = trunc i32 %29 to i8
%31 = call i32 @putchar(i8 signext %30)
br label %32
32: ; preds = %23
%33 = load i32, i32* %6
%34 = add nsw i32 %33, 1
store i32 %34, i32* %6
br label %19
35: ; preds = %19
br label %36
36: ; preds = %35
%37 = load i32, i32* %5
%38 = add nsw i32 %37, 1
store i32 %38, i32* %5
br label %8
39: ; preds = %8
%40 = call i32 @putchar(i8 signext 10)
%41 = call i32 @putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @Picture(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %22
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %19, %4
%7 = phi i64 [ 0, %4 ], [ %20, %19 ]
%8 = tail call i32 @putchar(i8 signext 10)
%9 = getelementptr inbounds i32, i32* %0, i64 %7
%10 = load i32, i32* %9
br label %11
11: ; preds = %6, %11
%12 = phi i32 [ %17, %11 ], [ 0, %6 ]
%13 = tail call i32 @putchar(i8 signext 32)
%14 = icmp eq i32 %12, %10
%15 = select i1 %14, i8 81, i8 46
%16 = tail call i32 @putchar(i8 signext %15)
%17 = add nuw nsw i32 %12, 1
%18 = icmp eq i32 %17, %1
br i1 %18, label %19, label %11
19: ; preds = %11
%20 = add nuw nsw i64 %7, 1
%21 = icmp eq i64 %20, %5
br i1 %21, label %22, label %6
22: ; preds = %19, %2
%23 = tail call i32 @putchar(i8 signext 10)
%24 = tail call i32 @putchar(i8 signext 10)
ret void
}