#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 /*<<< orphan*/ scanf(char *, ...);
int cin(float a[100][100]) {
  int i, j, n;
  printf("\n Enter Length Of Matrix N*N : ");
  scanf("%d", &n);
  printf("\n--------------------------\n");
  for (i = 0; i < n; i++)
    for (j = 0; j < n; j++) {
      printf(" Matrix[%d][%d] : ", i + 1, j + 1);
      scanf("%f", &a[i][j]);
    }
  printf("\n----------------------------------------------------\n");
  return n;
}


x86 assembly (clang, -O0):
<cin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xed0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11e6 <cin+0xc6>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11d3 <cin+0xb3>
mov    -0xc(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
add    $0x1,%edx
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
imul   $0x190,%rax,%rax
add    %rax,%rsi
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1174 <cin+0x54>
jmp    11d8 <cin+0xb8>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1161 <cin+0x41>
lea    0xe69(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cin>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xebb(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xecd(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
jle    11e0 <cin+0xb0>
lea    0xea9(%rip),%r15
lea    0xeb5(%rip),%r12
xor    %r13d,%r13d
jmp    119f <cin+0x6f>
cs nopw 0x0(%rax,%rax,1)
movslq %eax,%rcx
add    $0x190,%r14
cmp    %rcx,%r13
jge    11e0 <cin+0xb0>
add    $0x1,%r13
test   %eax,%eax
jle    1190 <cin+0x60>
mov    %r14,%rbx
xor    %ebp,%ebp
nopl   0x0(%rax)
add    $0x1,%rbp
mov    %r15,%rdi
mov    %r13d,%esi
mov    %ebp,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
movslq 0x4(%rsp),%rax
add    $0x4,%rbx
cmp    %rax,%rbp
jl     11b0 <cin+0x80>
jmp    1190 <cin+0x60>
lea    0xe6e(%rip),%rdi
call   1030 <puts@plt>
mov    0x4(%rsp),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [32 x i8] c"\0A Enter Length Of Matrix N*N : \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.3 = [19 x i8] c" Matrix[%d][%d] : \00"
@.str.4 = [3 x i8] c"%f\00"
@str = [28 x i8] c"\0A--------------------------\00"
@str.6 = [54 x i8] c"\0A----------------------------------------------------\00"
define i32 @cin([100 x float]* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%7 = load i32, i32* %2
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %30
9: ; preds = %1, %26
%10 = phi i32 [ %27, %26 ], [ %7, %1 ]
%11 = phi i64 [ %13, %26 ], [ 0, %1 ]
%12 = icmp sgt i32 %10, 0
%13 = add nuw nsw i64 %11, 1
br i1 %12, label %14, label %26
14: ; preds = %9
%15 = trunc i64 %13 to i32
br label %16
16: ; preds = %14, %16
%17 = phi i64 [ 0, %14 ], [ %18, %16 ]
%18 = add nuw nsw i64 %17, 1
%19 = trunc i64 %18 to i32
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32 %15, i32 %19)
%21 = getelementptr inbounds [100 x float], [100 x float]* %0, i64 %11, i64 %17
%22 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %21)
%23 = load i32, i32* %2
%24 = sext i32 %23 to i64
%25 = icmp slt i64 %18, %24
br i1 %25, label %16, label %26
26: ; preds = %16, %9
%27 = phi i32 [ %10, %9 ], [ %23, %16 ]
%28 = sext i32 %27 to i64
%29 = icmp slt i64 %13, %28
br i1 %29, label %9, label %30
30: ; preds = %26, %1
%31 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.6, i64 0, i64 0))
%32 = load i32, i32* %2
ret i32 %32
}