#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*/ Zero(void *, int);
int /*<<< orphan*/ printf(char *, int, int, char);
main() {
  int i, j;
  char us[5][4] = {'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a',
                   'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a'};
  Zero((void *)us[4], 4);
  for (i = 0; i < 5; i++)
    for (j = 0; j < 4; j++)
      printf("us[%d][%d] is %c\n", i, j, us[i][j]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec5(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
add    $0x10,%rdi
mov    $0x4,%esi
call   1040 <Zero@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    11cc <main+0xac>
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    11b9 <main+0x99>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
movslq -0x8(%rbp),%rcx
lea    -0x20(%rbp),%rax
shl    $0x2,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
lea    0xe72(%rip),%rdi
movsbl (%rax,%rcx,1),%ecx
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1178 <main+0x58>
jmp    11be <main+0x9e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1167 <main+0x47>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movaps 0xed4(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x61616161,0x10(%rsp)
61
lea    0x10(%rsp),%rdi
mov    $0x4,%esi
call   1040 <Zero@plt>
movsbl (%rsp),%ecx
lea    0xebe(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <printf@plt>
movsbl 0x1(%rsp),%ecx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <printf@plt>
movsbl 0x2(%rsp),%ecx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x2,%edx
call   1030 <printf@plt>
movsbl 0x3(%rsp),%ecx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x3,%edx
call   1030 <printf@plt>
movsbl 0x4(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <printf@plt>
movsbl 0x5(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <printf@plt>
movsbl 0x6(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <printf@plt>
movsbl 0x7(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x3,%edx
call   1030 <printf@plt>
movsbl 0x8(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %edx,%edx
call   1030 <printf@plt>
movsbl 0x9(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <printf@plt>
movsbl 0xa(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x2,%edx
call   1030 <printf@plt>
movsbl 0xb(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x3,%edx
call   1030 <printf@plt>
movsbl 0xc(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %edx,%edx
call   1030 <printf@plt>
movsbl 0xd(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x1,%edx
call   1030 <printf@plt>
movsbl 0xe(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x2,%edx
call   1030 <printf@plt>
movsbl 0xf(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x3,%edx
call   1030 <printf@plt>
movsbl 0x10(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x4,%esi
xor    %edx,%edx
call   1030 <printf@plt>
movsbl 0x11(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <printf@plt>
movsbl 0x12(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x2,%edx
call   1030 <printf@plt>
movsbl 0x13(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x3,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [18 x i8] c"us[%d][%d] is %c\0A\00"
define i32 @main() {
%1 = alloca [5 x [4 x i8]]
%2 = getelementptr inbounds [5 x [4 x i8]], [5 x [4 x i8]]* %1, i64 0, i64 0, i64 0
%3 = getelementptr inbounds [5 x [4 x i8]], [5 x [4 x i8]]* %1, i64 0, i64 4, i64 0
%4 = call i32 @Zero(i8* %3, i32 4)
%5 = load i8, i8* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, i8 signext %5)
%7 = getelementptr inbounds [5 x [4 x i8]], [5 x [4 x i8]]* %1, i64 0, i64 0, i64 1
%8 = load i8, i8* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 0, i32 1, i8 signext %8)
%10 = getelementptr inbounds [5 x [4 x i8]], [5 x [4 x i8]]* %1, i64 0, i64 0, i64 2
%11 = load i8, i8* %10
%12 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 0, i32 2, i8 signext %11)
%13 = getelementptr inbounds [5 x [4 x i8]], [5 x [4 x i8]]* %1, i64 0, i64 0, i64 3
%14 = load i8, i8* %13
%15 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 0, i32 3, i8 signext %14)
%16 = getelementptr inbounds [5 x [4 x i8]], [5 x [4 x i8]]* %1, i64 0, i64 1, i64 0
%17 = load i8, i8* %16
%18 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 1, i32 0, i8 signext %17)
%19 = getelementptr inbounds [5 x [4 x i8]], [5 x [4 x i8]]* %1, i64 0, i64 1, i64 1
%20 = load i8, i8* %19
%21 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 1, i32 1, i8 signext %20)
%22 = getelementptr inbounds [5 x [4 x i8]], [5 x [4 x i8]]* %1, i64 0, i64 1, i64 2
%23 = load i8, i8* %22
%24 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 1, i32 2, i8 signext %23)
%25 = getelementptr inbounds [5 x [4 x i8]], [5 x [4 x i8]]* %1, i64 0, i64 1, i64 3
%26 = load i8, i8* %25
%27 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 1, i32 3, i8 signext %26)
%28 = getelementptr inbounds [5 x [4 x i8]], [5 x [4 x i8]]* %1, i64 0, i64 2, i64 0
%29 = load i8, i8* %28
%30 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 2, i32 0, i8 signext %29)
%31 = getelementptr inbounds [5 x [4 x i8]], [5 x [4 x i8]]* %1, i64 0, i64 2, i64 1
%32 = load i8, i8* %31
%33 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 2, i32 1, i8 signext %32)
%34 = getelementptr inbounds [5 x [4 x i8]], [5 x [4 x i8]]* %1, i64 0, i64 2, i64 2
%35 = load i8, i8* %34
%36 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 2, i32 2, i8 signext %35)
%37 = getelementptr inbounds [5 x [4 x i8]], [5 x [4 x i8]]* %1, i64 0, i64 2, i64 3
%38 = load i8, i8* %37
%39 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 2, i32 3, i8 signext %38)
%40 = getelementptr inbounds [5 x [4 x i8]], [5 x [4 x i8]]* %1, i64 0, i64 3, i64 0
%41 = load i8, i8* %40
%42 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 3, i32 0, i8 signext %41)
%43 = getelementptr inbounds [5 x [4 x i8]], [5 x [4 x i8]]* %1, i64 0, i64 3, i64 1
%44 = load i8, i8* %43
%45 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 3, i32 1, i8 signext %44)
%46 = getelementptr inbounds [5 x [4 x i8]], [5 x [4 x i8]]* %1, i64 0, i64 3, i64 2
%47 = load i8, i8* %46
%48 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 3, i32 2, i8 signext %47)
%49 = getelementptr inbounds [5 x [4 x i8]], [5 x [4 x i8]]* %1, i64 0, i64 3, i64 3
%50 = load i8, i8* %49
%51 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 3, i32 3, i8 signext %50)
%52 = load i8, i8* %3
%53 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 4, i32 0, i8 signext %52)
%54 = getelementptr inbounds [5 x [4 x i8]], [5 x [4 x i8]]* %1, i64 0, i64 4, i64 1
%55 = load i8, i8* %54
%56 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 4, i32 1, i8 signext %55)
%57 = getelementptr inbounds [5 x [4 x i8]], [5 x [4 x i8]]* %1, i64 0, i64 4, i64 2
%58 = load i8, i8* %57
%59 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 4, i32 2, i8 signext %58)
%60 = getelementptr inbounds [5 x [4 x i8]], [5 x [4 x i8]]* %1, i64 0, i64 4, i64 3
%61 = load i8, i8* %60
%62 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 4, i32 3, i8 signext %61)
ret i32 0
}