void printgrid(char g[11][11]) {
  int i;
  for (i = 0; i < 11; i++) {
    printf("%.*s\n", 11, g[i]);
  }
}


x86 assembly (clang, -O0):
<printgrid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xb,-0xc(%rbp)
jge    115d <printgrid+0x4d>
mov    -0x8(%rbp),%rdx
movslq -0xc(%rbp),%rax
imul   $0xb,%rax,%rax
add    %rax,%rdx
lea    0xebd(%rip),%rdi
mov    $0xb,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <printgrid+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printgrid>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xee2(%rip),%r14
mov    %r14,%rdi
mov    $0xb,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xb(%rbx),%rdx
mov    %r14,%rdi
mov    $0xb,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x16(%rbx),%rdx
mov    %r14,%rdi
mov    $0xb,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x21(%rbx),%rdx
mov    %r14,%rdi
mov    $0xb,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x2c(%rbx),%rdx
mov    %r14,%rdi
mov    $0xb,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x37(%rbx),%rdx
mov    %r14,%rdi
mov    $0xb,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x42(%rbx),%rdx
mov    %r14,%rdi
mov    $0xb,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x4d(%rbx),%rdx
mov    %r14,%rdi
mov    $0xb,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x58(%rbx),%rdx
mov    %r14,%rdi
mov    $0xb,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x63(%rbx),%rdx
mov    %r14,%rdi
mov    $0xb,%esi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x6e,%rbx
mov    %r14,%rdi
mov    $0xb,%esi
mov    %rbx,%rdx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%.*s\0A\00"
define void @printgrid([11 x i8]* %0) {
%2 = alloca [11 x i8]*
%3 = alloca i32
store [11 x i8]* %0, [11 x i8]** %2
store i32 0, i32* %3
br label %4
4: ; preds = %14, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 11
br i1 %6, label %7, label %17
7: ; preds = %4
%8 = load [11 x i8]*, [11 x i8]** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [11 x i8], [11 x i8]* %8, i64 %10
%12 = getelementptr inbounds [11 x i8], [11 x i8]* %11, i64 0, i64 0
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 11, i8* %12)
br label %14
14: ; preds = %7
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %4
17: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%.*s\0A\00"
define void @printgrid([11 x i8]* %0) {
%2 = getelementptr inbounds [11 x i8], [11 x i8]* %0, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 11, i8* %2)
%4 = getelementptr inbounds [11 x i8], [11 x i8]* %0, i64 1, i64 0
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 11, i8* %4)
%6 = getelementptr inbounds [11 x i8], [11 x i8]* %0, i64 2, i64 0
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 11, i8* %6)
%8 = getelementptr inbounds [11 x i8], [11 x i8]* %0, i64 3, i64 0
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 11, i8* %8)
%10 = getelementptr inbounds [11 x i8], [11 x i8]* %0, i64 4, i64 0
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 11, i8* %10)
%12 = getelementptr inbounds [11 x i8], [11 x i8]* %0, i64 5, i64 0
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 11, i8* %12)
%14 = getelementptr inbounds [11 x i8], [11 x i8]* %0, i64 6, i64 0
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 11, i8* %14)
%16 = getelementptr inbounds [11 x i8], [11 x i8]* %0, i64 7, i64 0
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 11, i8* %16)
%18 = getelementptr inbounds [11 x i8], [11 x i8]* %0, i64 8, i64 0
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 11, i8* %18)
%20 = getelementptr inbounds [11 x i8], [11 x i8]* %0, i64 9, i64 0
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 11, i8* %20)
%22 = getelementptr inbounds [11 x i8], [11 x i8]* %0, i64 10, i64 0
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 11, i8* %22)
ret void
}