#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 makemat(int **, int **, int, int);
int /*<<< orphan*/ makevec(int **, int);
int /*<<< orphan*/ matout(int **, int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, ...);
main() {
  int A[1][100] = {};
  int i, j, n, N, M, x, y;
  printf("n=");
  scanf("%d", &n);
  printf("N=");
  scanf("%d", &N);
  makevec(A, n);
  int B[100][100];
  M = makemat(A, B, n, N);
  matout(B, M, N);
  printf("yousoshitei:");
  scanf("%d %d", &x, &y);
  printf("B(%d, %d) = %d\n", x, y, B[x - 1][y - 1]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x9df0,%rsp
lea    -0x190(%rbp),%rdi
xor    %esi,%esi
mov    $0x190,%edx
call   1050 <memset@plt>
lea    0xe7b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe83(%rip),%rdi
lea    -0x19c(%rbp),%rsi
mov    $0x0,%al
call   1070 <scanf@plt>
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe60(%rip),%rdi
lea    -0x1a0(%rbp),%rsi
mov    $0x0,%al
call   1070 <scanf@plt>
lea    -0x190(%rbp),%rdi
mov    -0x19c(%rbp),%esi
call   1060 <makevec@plt>
lea    -0x190(%rbp),%rdi
lea    -0x9df0(%rbp),%rsi
mov    -0x19c(%rbp),%edx
mov    -0x1a0(%rbp),%ecx
call   1030 <makemat@plt>
mov    %eax,-0x1a4(%rbp)
lea    -0x9df0(%rbp),%rdi
mov    -0x1a4(%rbp),%esi
mov    -0x1a0(%rbp),%edx
call   1080 <matout@plt>
lea    0xdec(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xdeb(%rip),%rdi
lea    -0x1a8(%rbp),%rsi
lea    -0x1ac(%rbp),%rdx
mov    $0x0,%al
call   1070 <scanf@plt>
mov    -0x1a8(%rbp),%esi
mov    -0x1ac(%rbp),%edx
mov    -0x1a8(%rbp),%eax
sub    $0x1,%eax
movslq %eax,%rcx
lea    -0x9df0(%rbp),%rax
imul   $0x190,%rcx,%rcx
add    %rcx,%rax
mov    -0x1ac(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%ecx
lea    0xd9d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x9df0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x9de8,%rsp
lea    0x10(%rsp),%r14
mov    $0x190,%edx
mov    %r14,%rdi
xor    %esi,%esi
call   1050 <memset@plt>
lea    0xe7b(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe83(%rip),%rbx
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1070 <scanf@plt>
lea    0xe5a(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1070 <scanf@plt>
mov    0x4(%rsp),%esi
mov    %r14,%rdi
call   1060 <makevec@plt>
mov    0x4(%rsp),%edx
mov    (%rsp),%ecx
lea    0x1a0(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <makemat@plt>
mov    (%rsp),%edx
mov    %rbx,%rdi
mov    %eax,%esi
call   1080 <matout@plt>
lea    0xe0f(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe0e(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
xor    %eax,%eax
call   1070 <scanf@plt>
movslq 0xc(%rsp),%rsi
movslq 0x8(%rsp),%rdx
imul   $0x190,%rsi,%rax
add    %rbx,%rax
mov    -0x194(%rax,%rdx,4),%ecx
lea    0xde1(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x9de8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"n=\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [3 x i8] c"N=\00"
@.str.3 = [13 x i8] c"yousoshitei:\00"
@.str.4 = [6 x i8] c"%d %d\00"
@.str.5 = [16 x i8] c"B(%d, %d) = %d\0A\00"
define i32 @main() {
%1 = alloca [1 x [100 x i32]]
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [100 x [100 x i32]]
%10 = bitcast [1 x [100 x i32]]* %1 to i8*
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%12 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%14 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%15 = getelementptr inbounds [1 x [100 x i32]], [1 x [100 x i32]]* %1, i64 0, i64 0
%16 = bitcast [100 x i32]* %15 to i32**
%17 = load i32, i32* %4
%18 = call i32 @makevec(i32** %16, i32 %17)
%19 = getelementptr inbounds [1 x [100 x i32]], [1 x [100 x i32]]* %1, i64 0, i64 0
%20 = bitcast [100 x i32]* %19 to i32**
%21 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %9, i64 0, i64 0
%22 = bitcast [100 x i32]* %21 to i32**
%23 = load i32, i32* %4
%24 = load i32, i32* %5
%25 = call i32 @makemat(i32** %20, i32** %22, i32 %23, i32 %24)
store i32 %25, i32* %6
%26 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %9, i64 0, i64 0
%27 = bitcast [100 x i32]* %26 to i32**
%28 = load i32, i32* %6
%29 = load i32, i32* %5
%30 = call i32 @matout(i32** %27, i32 %28, i32 %29)
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%32 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32* %7, i32* %8)
%33 = load i32, i32* %7
%34 = load i32, i32* %8
%35 = load i32, i32* %7
%36 = sub nsw i32 %35, 1
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %9, i64 0, i64 %37
%39 = load i32, i32* %8
%40 = sub nsw i32 %39, 1
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [100 x i32], [100 x i32]* %38, i64 0, i64 %41
%43 = load i32, i32* %42
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i32 %33, i32 %34, i32 %43)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"n=\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [3 x i8] c"N=\00"
@.str.3 = [13 x i8] c"yousoshitei:\00"
@.str.4 = [6 x i8] c"%d %d\00"
@.str.5 = [16 x i8] c"B(%d, %d) = %d\0A\00"
define i32 @main() {
%1 = alloca [1 x [100 x i32]]
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [100 x [100 x i32]]
%7 = bitcast [1 x [100 x i32]]* %1 to i8*
%8 = bitcast i32* %2 to i8*
%9 = bitcast i32* %3 to i8*
%10 = bitcast i32* %4 to i8*
%11 = bitcast i32* %5 to i8*
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%13 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%15 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%16 = bitcast [1 x [100 x i32]]* %1 to i32**
%17 = load i32, i32* %2
%18 = call i32 @makevec(i32** %16, i32 %17)
%19 = bitcast [100 x [100 x i32]]* %6 to i8*
%20 = bitcast [100 x [100 x i32]]* %6 to i32**
%21 = load i32, i32* %2
%22 = load i32, i32* %3
%23 = call i32 @makemat(i32** %16, i32** %20, i32 %21, i32 %22)
%24 = load i32, i32* %3
%25 = call i32 @matout(i32** %20, i32 %23, i32 %24)
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%27 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32* %4, i32* %5)
%28 = load i32, i32* %4
%29 = load i32, i32* %5
%30 = add nsw i32 %28, -1
%31 = sext i32 %30 to i64
%32 = add nsw i32 %29, -1
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %6, i64 0, i64 %31, i64 %33
%35 = load i32, i32* %34
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i32 %28, i32 %29, i32 %35)
ret i32 0
}