#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 *, ...);
void f1(char (*array)[4]) {
  int i = 0;
  int j = 0;
  printf("\nHere, in function f1 we print every string of passed array:\n");
  for (i = 0; i < 3; i++) {
    printf("array [ %d - th string ] = %s;\n", i, array[i]);
  }
  printf(
      "\nAnd now in function f1 we print every symbol on its own string:\n\n");
  for (i = 0; i < 3; i++) {
    for (j = 0; j < 4; j++) {
      printf("array [ %d ] [ %d ] = %c;\n", i, j, array[i][j]);
    }
    printf("==============================\n\n");
  }
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jge    1177 <f1+0x67>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%rdx
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdx
lea    0xedc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113f <f1+0x2f>
lea    0xee0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jge    11fc <f1+0xec>
movl   $0x0,-0x10(%rbp)
cmpl   $0x4,-0x10(%rbp)
jge    11e0 <f1+0xd0>
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    119d <f1+0x8d>
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    118c <f1+0x7c>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
lea    0xf0c(%rip),%rdi
call   1030 <puts@plt>
lea    0xec5(%rip),%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x4(%rbx),%rdx
mov    %r14,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x8(%rbx),%rdx
mov    %r14,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf01(%rip),%rdi
call   1030 <puts@plt>
movsbl (%rbx),%ecx
lea    0xe9a(%rip),%r14
mov    %r14,%rdi
xor    %esi,%esi
xor    %edx,%edx
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0x1(%rbx),%ecx
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x1,%edx
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0x2(%rbx),%ecx
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x2,%edx
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0x3(%rbx),%ecx
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x3,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee0(%rip),%r15
mov    %r15,%rdi
call   1030 <puts@plt>
movsbl 0x4(%rbx),%ecx
mov    %r14,%rdi
mov    $0x1,%esi
xor    %edx,%edx
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0x5(%rbx),%ecx
mov    %r14,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0x6(%rbx),%ecx
mov    %r14,%rdi
mov    $0x1,%esi
mov    $0x2,%edx
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0x7(%rbx),%ecx
mov    %r14,%rdi
mov    $0x1,%esi
mov    $0x3,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
movsbl 0x8(%rbx),%ecx
mov    %r14,%rdi
mov    $0x2,%esi
xor    %edx,%edx
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0x9(%rbx),%ecx
mov    %r14,%rdi
mov    $0x2,%esi
mov    $0x1,%edx
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0xa(%rbx),%ecx
mov    %r14,%rdi
mov    $0x2,%esi
mov    $0x2,%edx
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0xb(%rbx),%ecx
mov    %r14,%rdi
mov    $0x2,%esi
mov    $0x3,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [62 x i8] c"\0AHere, in function f1 we print every string of passed array:\0A\00"
@.str.1 = [32 x i8] c"array [ %d - th string ] = %s;\0A\00"
@.str.2 = [67 x i8] c"\0AAnd now in function f1 we print every symbol on its own string:\0A\0A\00"
@.str.3 = [27 x i8] c"array [ %d ] [ %d ] = %c;\0A\00"
@.str.4 = [33 x i8] c"==============================\0A\0A\00"
define void @f1([4 x i8]* %0) {
%2 = alloca [4 x i8]*
%3 = alloca i32
%4 = alloca i32
store [4 x i8]* %0, [4 x i8]** %2
store i32 0, i32* %3
store i32 0, i32* %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %6
6: ; preds = %17, %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 3
br i1 %8, label %9, label %20
9: ; preds = %6
%10 = load i32, i32* %3
%11 = load [4 x i8]*, [4 x i8]** %2
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [4 x i8], [4 x i8]* %11, i64 %13
%15 = getelementptr inbounds [4 x i8], [4 x i8]* %14, i64 0, i64 0
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %10, i8* %15)
br label %17
17: ; preds = %9
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %6
20: ; preds = %6
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %3
br label %22
22: ; preds = %47, %20
%23 = load i32, i32* %3
%24 = icmp slt i32 %23, 3
br i1 %24, label %25, label %50
25: ; preds = %22
store i32 0, i32* %4
br label %26
26: ; preds = %42, %25
%27 = load i32, i32* %4
%28 = icmp slt i32 %27, 4
br i1 %28, label %29, label %45
29: ; preds = %26
%30 = load i32, i32* %3
%31 = load i32, i32* %4
%32 = load [4 x i8]*, [4 x i8]** %2
%33 = load i32, i32* %3
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [4 x i8], [4 x i8]* %32, i64 %34
%36 = load i32, i32* %4
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [4 x i8], [4 x i8]* %35, i64 0, i64 %37
%39 = load i8, i8* %38
%40 = sext i8 %39 to i32
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i32 %30, i32 %31, i32 %40)
br label %42
42: ; preds = %29
%43 = load i32, i32* %4
%44 = add nsw i32 %43, 1
store i32 %44, i32* %4
br label %26
45: ; preds = %26
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0))
br label %47
47: ; preds = %45
%48 = load i32, i32* %3
%49 = add nsw i32 %48, 1
store i32 %49, i32* %3
br label %22
50: ; preds = %22
ret void
}

LLVM IR (-O2):
@.str.1 = [32 x i8] c"array [ %d - th string ] = %s;\0A\00"
@.str.3 = [27 x i8] c"array [ %d ] [ %d ] = %c;\0A\00"
@str = [61 x i8] c"\0AHere, in function f1 we print every string of passed array:\00"
@str.5 = [66 x i8] c"\0AAnd now in function f1 we print every symbol on its own string:\0A\00"
@str.6 = [32 x i8] c"==============================\0A\00"
define void @f1([4 x i8]* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str, i64 0, i64 0))
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %0, i64 0, i64 0
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 0, i8* %3)
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %0, i64 1, i64 0
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 1, i8* %5)
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %0, i64 2, i64 0
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 2, i8* %7)
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @str.5, i64 0, i64 0))
%10 = load i8, i8* %3
%11 = sext i8 %10 to i32
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i32 0, i32 0, i32 %11)
%13 = getelementptr inbounds [4 x i8], [4 x i8]* %0, i64 0, i64 1
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i32 0, i32 1, i32 %15)
%17 = getelementptr inbounds [4 x i8], [4 x i8]* %0, i64 0, i64 2
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i32 0, i32 2, i32 %19)
%21 = getelementptr inbounds [4 x i8], [4 x i8]* %0, i64 0, i64 3
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i32 0, i32 3, i32 %23)
%25 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.6, i64 0, i64 0))
%26 = load i8, i8* %5
%27 = sext i8 %26 to i32
%28 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i32 1, i32 0, i32 %27)
%29 = getelementptr inbounds [4 x i8], [4 x i8]* %0, i64 1, i64 1
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i32 1, i32 1, i32 %31)
%33 = getelementptr inbounds [4 x i8], [4 x i8]* %0, i64 1, i64 2
%34 = load i8, i8* %33
%35 = sext i8 %34 to i32
%36 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i32 1, i32 2, i32 %35)
%37 = getelementptr inbounds [4 x i8], [4 x i8]* %0, i64 1, i64 3
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
%40 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i32 1, i32 3, i32 %39)
%41 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.6, i64 0, i64 0))
%42 = load i8, i8* %7
%43 = sext i8 %42 to i32
%44 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i32 2, i32 0, i32 %43)
%45 = getelementptr inbounds [4 x i8], [4 x i8]* %0, i64 2, i64 1
%46 = load i8, i8* %45
%47 = sext i8 %46 to i32
%48 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i32 2, i32 1, i32 %47)
%49 = getelementptr inbounds [4 x i8], [4 x i8]* %0, i64 2, i64 2
%50 = load i8, i8* %49
%51 = sext i8 %50 to i32
%52 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i32 2, i32 2, i32 %51)
%53 = getelementptr inbounds [4 x i8], [4 x i8]* %0, i64 2, i64 3
%54 = load i8, i8* %53
%55 = sext i8 %54 to i32
%56 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i32 2, i32 3, i32 %55)
%57 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.6, i64 0, i64 0))
ret void
}