#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);
int /*<<< orphan*/ scanf(char *, char *);
void get_array(char a[8][15], int n) {
  int i;
  printf("Enter %d words not upto %d characters each.\n", 8, 15);
  for (i = 0; i < 8; i++)
    scanf("%s", a[i]);
}


x86 assembly (clang, -O0):
<get_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x8,%esi
mov    $0xf,%edx
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0x8,-0x10(%rbp)
jge    117f <get_array+0x5f>
mov    -0x8(%rbp),%rsi
movslq -0x10(%rbp),%rax
imul   $0xf,%rax,%rax
add    %rax,%rsi
lea    0xec1(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    114c <get_array+0x2c>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_array>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed2(%rip),%rdi
mov    $0x8,%esi
mov    $0xf,%edx
call   1030 <printf@plt>
lea    0xee9(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
lea    0xf(%rbx),%rsi
mov    %r14,%rdi
call   1040 <scanf@plt>
lea    0x1e(%rbx),%rsi
mov    %r14,%rdi
call   1040 <scanf@plt>
lea    0x2d(%rbx),%rsi
mov    %r14,%rdi
call   1040 <scanf@plt>
lea    0x3c(%rbx),%rsi
mov    %r14,%rdi
call   1040 <scanf@plt>
lea    0x4b(%rbx),%rsi
mov    %r14,%rdi
call   1040 <scanf@plt>
lea    0x5a(%rbx),%rsi
mov    %r14,%rdi
call   1040 <scanf@plt>
add    $0x69,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <scanf@plt>

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

LLVM IR (-O2):
@.str = [45 x i8] c"Enter %d words not upto %d characters each.\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define void @get_array([15 x i8]* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 8, i32 15)
%4 = getelementptr inbounds [15 x i8], [15 x i8]* %0, i64 0, i64 0
%5 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [15 x i8], [15 x i8]* %0, i64 1, i64 0
%7 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = getelementptr inbounds [15 x i8], [15 x i8]* %0, i64 2, i64 0
%9 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%10 = getelementptr inbounds [15 x i8], [15 x i8]* %0, i64 3, i64 0
%11 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %10)
%12 = getelementptr inbounds [15 x i8], [15 x i8]* %0, i64 4, i64 0
%13 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %12)
%14 = getelementptr inbounds [15 x i8], [15 x i8]* %0, i64 5, i64 0
%15 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %14)
%16 = getelementptr inbounds [15 x i8], [15 x i8]* %0, i64 6, i64 0
%17 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %16)
%18 = getelementptr inbounds [15 x i8], [15 x i8]* %0, i64 7, i64 0
%19 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %18)
ret void
}