#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 */
typedef size_t int32_t;

/* Variables and functions */
int /*<<< orphan*/ printSquareIndex(size_t, char *);
int /*<<< orphan*/ printf(char *, ...);
void printSquareArray(int32_t *squares, int32_t count) {
  char sqStr[4];
  printf("[");
  for (int32_t i = 0; i < count; i++) {
    if (i > 0) {
      printf(", ");
    }
    printSquareIndex(squares[i], sqStr);
    printf("\"%s\"", sqStr);
  }
  printf("]");
}


x86 assembly (clang, -O0):
<printSquareArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    11a5 <printSquareArray+0x85>
cmpq   $0x0,-0x20(%rbp)
jbe    116d <printSquareArray+0x4d>
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    -0x14(%rbp),%rsi
call   1030 <printSquareIndex@plt>
lea    -0x14(%rbp),%rsi
lea    0xe78(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1146 <printSquareArray+0x26>
lea    0xe5e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printSquareArray>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r12
mov    %rdi,%r14
mov    $0x5b,%edi
call   1030 <putchar@plt>
test   %r12,%r12
je     11bc <printSquareArray+0x8c>
mov    (%r14),%rdi
lea    0x4(%rsp),%rbx
mov    %rbx,%rsi
call   1040 <printSquareIndex@plt>
lea    0xe9c(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    $0x1,%r12
je     11bc <printSquareArray+0x8c>
mov    $0x1,%ebp
lea    0xe7d(%rip),%r15
lea    0x4(%rsp),%rbx
lea    0xe74(%rip),%r13
nop
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%r14,%rbp,8),%rdi
mov    %rbx,%rsi
call   1040 <printSquareIndex@plt>
mov    %r13,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%r12
jne    1190 <printSquareArray+0x60>
mov    $0x5d,%edi
call   1030 <putchar@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"[\00"
@.str.1 = [3 x i8] c", \00"
@.str.2 = [5 x i8] c"\22%s\22\00"
@.str.3 = [2 x i8] c"]\00"
define void @printSquareArray(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
%5 = alloca [4 x i8]
%6 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i64 0, i64* %6
br label %8
8: ; preds = %26, %2
%9 = load i64, i64* %6
%10 = load i64, i64* %4
%11 = icmp ult i64 %9, %10
br i1 %11, label %12, label %29
12: ; preds = %8
%13 = load i64, i64* %6
%14 = icmp ugt i64 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %17
17: ; preds = %15, %12
%18 = load i64*, i64** %3
%19 = load i64, i64* %6
%20 = getelementptr inbounds i64, i64* %18, i64 %19
%21 = load i64, i64* %20
%22 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%23 = call i32 @printSquareIndex(i64 %21, i8* %22)
%24 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %24)
br label %26
26: ; preds = %17
%27 = load i64, i64* %6
%28 = add i64 %27, 1
store i64 %28, i64* %6
br label %8
29: ; preds = %8
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c", \00"
@.str.2 = [5 x i8] c"\22%s\22\00"
define void @printSquareArray(i64* nocapture %0, i64 %1) {
%3 = alloca [4 x i8]
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @putchar(i32 91)
%6 = icmp eq i64 %1, 0
br i1 %6, label %12, label %7
7: ; preds = %2
%8 = load i64, i64* %0
%9 = call i32 @printSquareIndex(i64 %8, i8* %4)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %4)
%11 = icmp eq i64 %1, 1
br i1 %11, label %12, label %14
12: ; preds = %14, %7, %2
%13 = call i32 @putchar(i32 93)
ret void
14: ; preds = %7, %14
%15 = phi i64 [ %21, %14 ], [ 1, %7 ]
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%17 = getelementptr inbounds i64, i64* %0, i64 %15
%18 = load i64, i64* %17
%19 = call i32 @printSquareIndex(i64 %18, i8* %4)
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %4)
%21 = add nuw i64 %15, 1
%22 = icmp eq i64 %21, %1
br i1 %22, label %12, label %14
}