#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 int /*<<< orphan*/ s;
typedef int /*<<< orphan*/ b;
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, ...);
int strlen(char *);
void main() {
  int a[] = {1, 2, 3, 4, 5};
  int len = sizeof(a) / sizeof(a[0]);
  printf("len %d\n", len);
  int b[][2] = {{1, 2}, {3, 4}, {4, 5}};
  int rows = sizeof(b) / sizeof(b[0]);
  int cols = sizeof(b[0]) / sizeof(b[0][0]);
  printf("rows %d cols %d\n", rows, cols);
  char *s[] = {"hello", "mister", "how do you do"};
  int row = sizeof(s) / sizeof(s[0]);
  int col = strlen(s[0]);
  printf("rows %d cols %d\n", row, col);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecc(%rip),%eax
mov    %eax,-0x10(%rbp)
movl   $0x5,-0x24(%rbp)
mov    -0x24(%rbp),%esi
lea    0xee0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0xeba(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xeb7(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xeb4(%rip),%rax
mov    %rax,-0x30(%rbp)
movl   $0x3,-0x44(%rbp)
movl   $0x2,-0x48(%rbp)
mov    -0x44(%rbp),%esi
mov    -0x48(%rbp),%edx
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2c57(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0x2c54(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    0x2c51(%rip),%rax
mov    %rax,-0x50(%rbp)
movl   $0x3,-0x64(%rbp)
mov    -0x60(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x68(%rbp)
mov    -0x64(%rbp),%esi
mov    -0x68(%rbp),%edx
lea    0xe5d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xecd(%rip),%rbx
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x2,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec3(%rip),%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    %eax,%edx
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@__const.main.a = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
@.str = [8 x i8] c"len %d\0A\00"
@__const.main.b = [3 x [2 x i32]] [[2 x i32] [i32 1, i32 2], [2 x i32] [i32 3, i32 4], [2 x i32] [i32 4, i32 5]]
@.str.1 = [17 x i8] c"rows %d cols %d\0A\00"
@.str.2 = [6 x i8] c"hello\00"
@.str.3 = [7 x i8] c"mister\00"
@.str.4 = [14 x i8] c"how do you do\00"
@__const.main.s = [3 x i8*] [i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i32 0, i32 0)]
define void @main() {
%1 = alloca [5 x i32]
%2 = alloca i32
%3 = alloca [3 x [2 x i32]]
%4 = alloca i32
%5 = alloca i32
%6 = alloca [3 x i8*]
%7 = alloca i32
%8 = alloca i32
%9 = bitcast [5 x i32]* %1 to i8*
store i32 5, i32* %2
%10 = load i32, i32* %2
%11 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = bitcast [3 x [2 x i32]]* %3 to i8*
store i32 3, i32* %4
store i32 2, i32* %5
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %13, i32 %14)
%16 = bitcast [3 x i8*]* %6 to i8*
store i32 3, i32* %7
%17 = getelementptr inbounds [3 x i8*], [3 x i8*]* %6, i64 0, i64 0
%18 = load i8*, i8** %17
%19 = call i32 @strlen(i8* %18)
store i32 %19, i32* %8
%20 = load i32, i32* %7
%21 = load i32, i32* %8
%22 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %20, i32 %21)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"len %d\0A\00"
@.str.1 = [17 x i8] c"rows %d cols %d\0A\00"
@.str.2 = [6 x i8] c"hello\00"
define void @main() {
%1 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 5)
%2 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 3, i32 2)
%3 = tail call i32 @strlen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 3, i32 %3)
ret void
}