#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*/ printf(char *, int, int, char);
int main(void) {
  char s[10][10];
  int i, ii;
  for (i = 0; i < 10; ++i)
    for (ii = 0; ii < 10; ++ii) {
      s[i][ii] = '0' + i + ii;
      (printf("s[%d][%d] = %c\n", i, ii, (s[i][ii])));
    }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x74(%rbp)
cmpl   $0xa,-0x74(%rbp)
jge    11af <main+0x9f>
movl   $0x0,-0x78(%rbp)
cmpl   $0xa,-0x78(%rbp)
jge    119c <main+0x8c>
mov    -0x74(%rbp),%eax
add    $0x30,%eax
add    -0x78(%rbp),%eax
mov    %al,%dl
movslq -0x74(%rbp),%rcx
lea    -0x70(%rbp),%rax
imul   $0xa,%rcx,%rcx
add    %rcx,%rax
movslq -0x78(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x74(%rbp),%esi
mov    -0x78(%rbp),%edx
movslq -0x74(%rbp),%rcx
lea    -0x70(%rbp),%rax
imul   $0xa,%rcx,%rcx
add    %rcx,%rax
movslq -0x78(%rbp),%rcx
lea    0xe7b(%rip),%rdi
movsbl (%rax,%rcx,1),%ecx
call   1030 <printf@plt>
mov    -0x78(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x78(%rbp)
jmp    113a <main+0x2a>
jmp    11a1 <main+0x91>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    1129 <main+0x19>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
lea    0x30(%rbx),%eax
movsbl %al,%ecx
mov    %r14,%rdi
mov    %ebx,%esi
xor    %edx,%edx
call   1030 <printf@plt>
lea    0x31(%rbx),%eax
movsbl %al,%ecx
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x1,%edx
call   1030 <printf@plt>
lea    0x32(%rbx),%eax
movsbl %al,%ecx
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x2,%edx
call   1030 <printf@plt>
lea    0x33(%rbx),%eax
movsbl %al,%ecx
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x3,%edx
call   1030 <printf@plt>
lea    0x34(%rbx),%eax
movsbl %al,%ecx
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x4,%edx
call   1030 <printf@plt>
lea    0x35(%rbx),%eax
movsbl %al,%ecx
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x5,%edx
call   1030 <printf@plt>
lea    0x36(%rbx),%eax
movsbl %al,%ecx
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x6,%edx
call   1030 <printf@plt>
lea    0x37(%rbx),%eax
movsbl %al,%ecx
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x7,%edx
call   1030 <printf@plt>
lea    0x38(%rbx),%eax
movsbl %al,%ecx
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x8,%edx
call   1030 <printf@plt>
lea    0x39(%rbx),%eax
movsbl %al,%ecx
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x9,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0xa,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [16 x i8] c"s[%d][%d] = %c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x [10 x i8]]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
br label %5
5: ; preds = %38, %0
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 10
br i1 %7, label %8, label %41
8: ; preds = %5
store i32 0, i32* %4
br label %9
9: ; preds = %34, %8
%10 = load i32, i32* %4
%11 = icmp slt i32 %10, 10
br i1 %11, label %12, label %37
12: ; preds = %9
%13 = load i32, i32* %3
%14 = add nsw i32 48, %13
%15 = load i32, i32* %4
%16 = add nsw i32 %14, %15
%17 = trunc i32 %16 to i8
%18 = load i32, i32* %3
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %2, i64 0, i64 %19
%21 = load i32, i32* %4
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [10 x i8], [10 x i8]* %20, i64 0, i64 %22
store i8 %17, i8* %23
%24 = load i32, i32* %3
%25 = load i32, i32* %4
%26 = load i32, i32* %3
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %2, i64 0, i64 %27
%29 = load i32, i32* %4
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [10 x i8], [10 x i8]* %28, i64 0, i64 %30
%32 = load i8, i8* %31
%33 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %24, i32 %25, i8 signext %32)
br label %34
34: ; preds = %12
%35 = load i32, i32* %4
%36 = add nsw i32 %35, 1
store i32 %36, i32* %4
br label %9
37: ; preds = %9
br label %38
38: ; preds = %37
%39 = load i32, i32* %3
%40 = add nsw i32 %39, 1
store i32 %40, i32* %3
br label %5
41: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"s[%d][%d] = %c\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %33, %1 ]
%3 = trunc i32 %2 to i8
%4 = add i8 %3, 48
%5 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %2, i32 0, i8 signext %4)
%6 = trunc i32 %2 to i8
%7 = add i8 %6, 49
%8 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %2, i32 1, i8 signext %7)
%9 = trunc i32 %2 to i8
%10 = add i8 %9, 50
%11 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %2, i32 2, i8 signext %10)
%12 = trunc i32 %2 to i8
%13 = add i8 %12, 51
%14 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %2, i32 3, i8 signext %13)
%15 = trunc i32 %2 to i8
%16 = add i8 %15, 52
%17 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %2, i32 4, i8 signext %16)
%18 = trunc i32 %2 to i8
%19 = add i8 %18, 53
%20 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %2, i32 5, i8 signext %19)
%21 = trunc i32 %2 to i8
%22 = add i8 %21, 54
%23 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %2, i32 6, i8 signext %22)
%24 = trunc i32 %2 to i8
%25 = add i8 %24, 55
%26 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %2, i32 7, i8 signext %25)
%27 = trunc i32 %2 to i8
%28 = add i8 %27, 56
%29 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %2, i32 8, i8 signext %28)
%30 = trunc i32 %2 to i8
%31 = add i8 %30, 57
%32 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %2, i32 9, i8 signext %31)
%33 = add nuw nsw i32 %2, 1
%34 = icmp eq i32 %33, 10
br i1 %34, label %35, label %1
35: ; preds = %1
ret i32 0
}