#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 *, ...);
main() {
  int N, i, j, k;
  int end = 0;
  int A[17] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8};
  printf("A=");
  for (i = 0; i < 17; i++) {
    printf("%d ", A[i]);
  }
  printf("\nN=");
  scanf("%d", &N);
  int B[N][N];
  printf("B=\n");
  for (i = 0; i < N; i++) {
    for (j = 0; j < N; j++) {
      k = N * i + j;
      if (k < 17) {
        B[i][j] = A[k];
      } else {
        B[i][j] = 0;
      }
    }
  }
  for (i = 0; i < N; i++) {
    for (j = 0; j < N; j++) {
      printf("%2d", B[i][j]);
      if (j == (N - 1)) {
        printf("\n");
      }
    }
    if (B[i][j] == 0) {
      break;
    }
  }
  printf("yousositei:");
  scanf("%d %d", &i, &j);
  printf("B(%d,%d)=%d\n", i, j, B[i - 1][j - 1]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x18(%rbp)
lea    -0x60(%rbp),%rdi
lea    0xeac(%rip),%rsi
mov    $0x44,%edx
call   1040 <memcpy@plt>
lea    0xedf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x11,-0xc(%rbp)
jge    11a1 <main+0x71>
movslq -0xc(%rbp),%rax
mov    -0x60(%rbp,%rax,4),%esi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1173 <main+0x43>
lea    0xea3(%rip),%rdi
xor    %eax,%eax
mov    %al,-0x89(%rbp)
call   1030 <printf@plt>
mov    -0x89(%rbp),%al
lea    0xea4(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
mov    %rcx,%rax
mov    %rax,-0x88(%rbp)
mov    %rsp,%rdx
mov    %rdx,-0x68(%rbp)
mov    %rcx,%rdx
imul   %rdx,%rdx
lea    0xf(,%rdx,4),%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rdx
sub    %rsi,%rdx
mov    %rdx,-0x80(%rbp)
mov    %rdx,%rsp
mov    %rcx,-0x70(%rbp)
mov    %rax,-0x78(%rbp)
lea    0xe3f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    12cd <main+0x19d>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    12ba <main+0x18a>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x11,-0x14(%rbp)
jge    1282 <main+0x152>
mov    -0x80(%rbp),%rax
mov    -0x88(%rbp),%rsi
movslq -0x14(%rbp),%rcx
mov    -0x60(%rbp,%rcx,4),%edx
movslq -0xc(%rbp),%rcx
imul   %rsi,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
jmp    12a7 <main+0x177>
mov    -0x80(%rbp),%rax
mov    -0x88(%rbp),%rdx
movslq -0xc(%rbp),%rcx
imul   %rdx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
jmp    12ac <main+0x17c>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1231 <main+0x101>
jmp    12bf <main+0x18f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    121e <main+0xee>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1394 <main+0x264>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1354 <main+0x224>
mov    -0x80(%rbp),%rax
mov    -0x88(%rbp),%rdx
movslq -0xc(%rbp),%rcx
imul   %rdx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xd38(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jne    1341 <main+0x211>
lea    0xd17(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1346 <main+0x216>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    12e7 <main+0x1b7>
mov    -0x80(%rbp),%rax
mov    -0x88(%rbp),%rdx
movslq -0xc(%rbp),%rcx
imul   %rdx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    1381 <main+0x251>
jmp    1394 <main+0x264>
jmp    1386 <main+0x256>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    12d4 <main+0x1a4>
lea    0xcbc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xcba(%rip),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
mov    $0x0,%al
call   1050 <scanf@plt>
mov    -0x88(%rbp),%rdi
mov    -0x80(%rbp),%rax
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
imul   %rdi,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%ecx
lea    0xc79(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x68(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
lea    0xeec(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xee1(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xddf(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xde8(%rip),%rdi
lea    -0x34(%rbp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    %rsp,-0x50(%rbp)
mov    -0x34(%rbp),%r13d
mov    %r13,%rax
imul   %r13,%rax
mov    %rsp,%r12
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r12
mov    %r12,%rsp
lea    0xdc2(%rip),%rdi
call   1040 <puts@plt>
mov    -0x34(%rbp),%r14d
test   %r14d,%r14d
mov    %r12,-0x40(%rbp)
jle    1450 <main+0x310>
mov    %r14d,%r15d
and    $0xfffffffe,%r15d
lea    0x4(%r12),%rdx
lea    0x0(,%r13,4),%rax
mov    %rax,-0x48(%rbp)
mov    $0x1,%r8d
xor    %r9d,%r9d
lea    0xd12(%rip),%r10
jmp    1308 <main+0x1c8>
lea    (%r12,%rdi,4),%rax
mov    %r11d,(%rax,%rsi,4)
add    $0x1,%r9
add    %r14,%r8
add    -0x48(%rbp),%rdx
cmp    %r14,%r9
je     1386 <main+0x246>
cmp    $0x1,%r14d
jne    1340 <main+0x200>
xor    %esi,%esi
test   $0x1,%r14b
je     12f8 <main+0x1b8>
mov    %r9,%rdi
imul   %r13,%rdi
mov    %r9,%rbx
imul   %r14,%rbx
add    %rsi,%rbx
xor    %r11d,%r11d
cmp    $0x10,%rbx
ja     12f0 <main+0x1b0>
mov    (%r10,%rbx,4),%r11d
jmp    12f0 <main+0x1b0>
cs nopw 0x0(%rax,%rax,1)
mov    %r8,%rdi
xor    %esi,%esi
jmp    1360 <main+0x220>
nopw   0x0(%rax,%rax,1)
mov    %ebx,(%rdx,%rsi,4)
add    $0x2,%rsi
add    $0x2,%rdi
cmp    %rsi,%r15
je     1310 <main+0x1d0>
lea    -0x1(%rdi),%rax
xor    %ebx,%ebx
mov    $0x0,%ecx
cmp    $0x10,%rax
ja     1376 <main+0x236>
mov    -0x4(%r10,%rdi,4),%ecx
mov    %ecx,-0x4(%rdx,%rsi,4)
cmp    $0x10,%rdi
ja     1350 <main+0x210>
mov    (%r10,%rdi,4),%ebx
jmp    1350 <main+0x210>
mov    %r14d,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
test   %r14d,%r14d
jle    145b <main+0x31b>
lea    0xcae(%rip),%rbx
mov    -0x40(%rbp),%r12
xor    %r15d,%r15d
mov    %r13,-0x58(%rbp)
nopl   0x0(%rax)
movl   $0x0,-0x2c(%rbp)
mov    %r15d,%ecx
imul   %r13,%rcx
mov    $0x0,%r13d
test   %r14d,%r14d
jle    1424 <main+0x2e4>
mov    %rcx,-0x60(%rbp)
xor    %r13d,%r13d
jmp    13ed <main+0x2ad>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%r13
mov    %r13d,-0x2c(%rbp)
cmp    %r14d,%r13d
jge    1420 <main+0x2e0>
mov    (%r12,%r13,4),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    -0x34(%rbp),%r14d
lea    -0x1(%r14),%eax
cmp    %eax,%r13d
jne    13e0 <main+0x2a0>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x34(%rbp),%r14d
jmp    13e0 <main+0x2a0>
nopl   0x0(%rax,%rax,1)
mov    -0x60(%rbp),%rcx
mov    -0x40(%rbp),%rax
lea    (%rax,%rcx,4),%rax
movslq %r13d,%rcx
cmpl   $0x0,(%rax,%rcx,4)
mov    -0x58(%rbp),%r13
je     145b <main+0x31b>
add    $0x1,%r15d
mov    %r15d,-0x30(%rbp)
add    -0x48(%rbp),%r12
cmp    %r14d,%r15d
jl     13b0 <main+0x270>
jmp    145b <main+0x31b>
mov    %r14d,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
lea    0xbf1(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xbef(%rip),%rdi
lea    -0x30(%rbp),%rsi
lea    -0x2c(%rbp),%rdx
xor    %eax,%eax
call   1060 <scanf@plt>
movslq -0x30(%rbp),%rsi
movslq -0x2c(%rbp),%rdx
mov    %rsi,%rax
add    $0xffffffffffffffff,%rax
imul   %r13,%rax
mov    -0x40(%rbp),%rcx
lea    (%rcx,%rax,4),%rax
mov    -0x4(%rax,%rdx,4),%ecx
lea    0xbc0(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    -0x50(%rbp),%rsp
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.A = [17 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8]
@.str = [3 x i8] c"A=\00"
@.str.1 = [4 x i8] c"%d \00"
@.str.2 = [4 x i8] c"\0AN=\00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [4 x i8] c"B=\0A\00"
@.str.5 = [4 x i8] c"%2d\00"
@.str.6 = [2 x i8] c"\0A\00"
@.str.7 = [12 x i8] c"yousositei:\00"
@.str.8 = [6 x i8] c"%d %d\00"
@.str.9 = [13 x i8] c"B(%d,%d)=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [17 x i32]
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i64
store i32 0, i32* %1
store i32 0, i32* %6
%11 = bitcast [17 x i32]* %7 to i8*
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %13
13: ; preds = %22, %0
%14 = load i32, i32* %3
%15 = icmp slt i32 %14, 17
br i1 %15, label %16, label %25
16: ; preds = %13
%17 = load i32, i32* %3
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [17 x i32], [17 x i32]* %7, i64 0, i64 %18
%20 = load i32, i32* %19
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %20)
br label %22
22: ; preds = %16
%23 = load i32, i32* %3
%24 = add nsw i32 %23, 1
store i32 %24, i32* %3
br label %13
25: ; preds = %13
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%27 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %2)
%28 = load i32, i32* %2
%29 = zext i32 %28 to i64
%30 = load i32, i32* %2
%31 = zext i32 %30 to i64
%32 = call i8* @llvm.stacksave()
store i8* %32, i8** %8
%33 = mul nuw i64 %29, %31
%34 = alloca i32, i64 %33
store i64 %29, i64* %9
store i64 %31, i64* %10
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %3
br label %36
36: ; preds = %78, %25
%37 = load i32, i32* %3
%38 = load i32, i32* %2
%39 = icmp slt i32 %37, %38
br i1 %39, label %40, label %81
40: ; preds = %36
store i32 0, i32* %4
br label %41
41: ; preds = %74, %40
%42 = load i32, i32* %4
%43 = load i32, i32* %2
%44 = icmp slt i32 %42, %43
br i1 %44, label %45, label %77
45: ; preds = %41
%46 = load i32, i32* %2
%47 = load i32, i32* %3
%48 = mul nsw i32 %46, %47
%49 = load i32, i32* %4
%50 = add nsw i32 %48, %49
store i32 %50, i32* %5
%51 = load i32, i32* %5
%52 = icmp slt i32 %51, 17
br i1 %52, label %53, label %65
53: ; preds = %45
%54 = load i32, i32* %5
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [17 x i32], [17 x i32]* %7, i64 0, i64 %55
%57 = load i32, i32* %56
%58 = load i32, i32* %3
%59 = sext i32 %58 to i64
%60 = mul nsw i64 %59, %31
%61 = getelementptr inbounds i32, i32* %34, i64 %60
%62 = load i32, i32* %4
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds i32, i32* %61, i64 %63
store i32 %57, i32* %64
br label %73
65: ; preds = %45
%66 = load i32, i32* %3
%67 = sext i32 %66 to i64
%68 = mul nsw i64 %67, %31
%69 = getelementptr inbounds i32, i32* %34, i64 %68
%70 = load i32, i32* %4
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds i32, i32* %69, i64 %71
store i32 0, i32* %72
br label %73
73: ; preds = %65, %53
br label %74
74: ; preds = %73
%75 = load i32, i32* %4
%76 = add nsw i32 %75, 1
store i32 %76, i32* %4
br label %41
77: ; preds = %41
br label %78
78: ; preds = %77
%79 = load i32, i32* %3
%80 = add nsw i32 %79, 1
store i32 %80, i32* %3
br label %36
81: ; preds = %36
store i32 0, i32* %3
br label %82
82: ; preds = %123, %81
%83 = load i32, i32* %3
%84 = load i32, i32* %2
%85 = icmp slt i32 %83, %84
br i1 %85, label %86, label %126
86: ; preds = %82
store i32 0, i32* %4
br label %87
87: ; preds = %108, %86
%88 = load i32, i32* %4
%89 = load i32, i32* %2
%90 = icmp slt i32 %88, %89
br i1 %90, label %91, label %111
91: ; preds = %87
%92 = load i32, i32* %3
%93 = sext i32 %92 to i64
%94 = mul nsw i64 %93, %31
%95 = getelementptr inbounds i32, i32* %34, i64 %94
%96 = load i32, i32* %4
%97 = sext i32 %96 to i64
%98 = getelementptr inbounds i32, i32* %95, i64 %97
%99 = load i32, i32* %98
%100 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %99)
%101 = load i32, i32* %4
%102 = load i32, i32* %2
%103 = sub nsw i32 %102, 1
%104 = icmp eq i32 %101, %103
br i1 %104, label %105, label %107
105: ; preds = %91
%106 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
br label %107
107: ; preds = %105, %91
br label %108
108: ; preds = %107
%109 = load i32, i32* %4
%110 = add nsw i32 %109, 1
store i32 %110, i32* %4
br label %87
111: ; preds = %87
%112 = load i32, i32* %3
%113 = sext i32 %112 to i64
%114 = mul nsw i64 %113, %31
%115 = getelementptr inbounds i32, i32* %34, i64 %114
%116 = load i32, i32* %4
%117 = sext i32 %116 to i64
%118 = getelementptr inbounds i32, i32* %115, i64 %117
%119 = load i32, i32* %118
%120 = icmp eq i32 %119, 0
br i1 %120, label %121, label %122
121: ; preds = %111
br label %126
122: ; preds = %111
br label %123
123: ; preds = %122
%124 = load i32, i32* %3
%125 = add nsw i32 %124, 1
store i32 %125, i32* %3
br label %82
126: ; preds = %121, %82
%127 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0))
%128 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i32* %3, i32* %4)
%129 = load i32, i32* %3
%130 = load i32, i32* %4
%131 = load i32, i32* %3
%132 = sub nsw i32 %131, 1
%133 = sext i32 %132 to i64
%134 = mul nsw i64 %133, %31
%135 = getelementptr inbounds i32, i32* %34, i64 %134
%136 = load i32, i32* %4
%137 = sub nsw i32 %136, 1
%138 = sext i32 %137 to i64
%139 = getelementptr inbounds i32, i32* %135, i64 %138
%140 = load i32, i32* %139
%141 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i32 %129, i32 %130, i32 %140)
%142 = load i8*, i8** %8
%143 = load i32, i32* %1
ret i32 %143
}

LLVM IR (-O2):
@__const.main.A = [17 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8]
@.str = [3 x i8] c"A=\00"
@.str.1 = [4 x i8] c"%d \00"
@.str.2 = [4 x i8] c"\0AN=\00"
@.str.3 = [3 x i8] c"%d\00"
@.str.5 = [4 x i8] c"%2d\00"
@.str.7 = [12 x i8] c"yousositei:\00"
@.str.8 = [6 x i8] c"%d %d\00"
@.str.9 = [13 x i8] c"B(%d,%d)=%d\0A\00"
@str = [3 x i8] c"B=\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 1)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 2)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 3)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 4)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 5)
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 6)
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 7)
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 8)
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 9)
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 1)
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 2)
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 3)
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 4)
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 5)
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 6)
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 7)
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 8)
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%26 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %1)
%27 = load i32, i32* %1
%28 = zext i32 %27 to i64
%29 = call i8* @llvm.stacksave()
%30 = mul nuw i64 %28, %28
%31 = alloca i32, i64 %30
%32 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
%33 = load i32, i32* %1
%34 = icmp sgt i32 %33, 0
br i1 %34, label %36, label %35
35: ; preds = %0
store i32 %33, i32* %3
store i32 0, i32* %2
br label %121
36: ; preds = %0
%37 = zext i32 %33 to i64
%38 = zext i32 %33 to i64
%39 = and i64 %38, 1
%40 = icmp eq i32 %33, 1
%41 = and i64 %38, 4294967294
%42 = icmp eq i64 %39, 0
br label %43
43: ; preds = %83, %36
%44 = phi i64 [ 0, %36 ], [ %84, %83 ]
%45 = mul nsw i64 %44, %37
%46 = mul nuw nsw i64 %44, %28
%47 = getelementptr inbounds i32, i32* %31, i64 %46
br i1 %40, label %72, label %49
48: ; preds = %83
store i32 %33, i32* %3
store i32 0, i32* %2
br i1 %34, label %88, label %121
49: ; preds = %43, %66
%50 = phi i64 [ %69, %66 ], [ 0, %43 ]
%51 = phi i64 [ %70, %66 ], [ 0, %43 ]
%52 = add nuw nsw i64 %50, %45
%53 = icmp ult i64 %52, 17
br i1 %53, label %54, label %57
54: ; preds = %49
%55 = getelementptr inbounds [17 x i32], [17 x i32]* @__const.main.A, i64 0, i64 %52
%56 = load i32, i32* %55
br label %57
57: ; preds = %49, %54
%58 = phi i32 [ %56, %54 ], [ 0, %49 ]
%59 = getelementptr inbounds i32, i32* %47, i64 %50
store i32 %58, i32* %59
%60 = or i64 %50, 1
%61 = add nuw nsw i64 %60, %45
%62 = icmp ult i64 %61, 17
br i1 %62, label %63, label %66
63: ; preds = %57
%64 = getelementptr inbounds [17 x i32], [17 x i32]* @__const.main.A, i64 0, i64 %61
%65 = load i32, i32* %64
br label %66
66: ; preds = %63, %57
%67 = phi i32 [ %65, %63 ], [ 0, %57 ]
%68 = getelementptr inbounds i32, i32* %47, i64 %60
store i32 %67, i32* %68
%69 = add nuw nsw i64 %50, 2
%70 = add i64 %51, 2
%71 = icmp eq i64 %70, %41
br i1 %71, label %72, label %49
72: ; preds = %66, %43
%73 = phi i64 [ 0, %43 ], [ %69, %66 ]
br i1 %42, label %83, label %74
74: ; preds = %72
%75 = add nuw nsw i64 %73, %45
%76 = icmp ult i64 %75, 17
br i1 %76, label %77, label %80
77: ; preds = %74
%78 = getelementptr inbounds [17 x i32], [17 x i32]* @__const.main.A, i64 0, i64 %75
%79 = load i32, i32* %78
br label %80
80: ; preds = %77, %74
%81 = phi i32 [ %79, %77 ], [ 0, %74 ]
%82 = getelementptr inbounds i32, i32* %47, i64 %73
store i32 %81, i32* %82
br label %83
83: ; preds = %72, %80
%84 = add nuw nsw i64 %44, 1
%85 = icmp eq i64 %84, %38
br i1 %85, label %48, label %43
86: ; preds = %112
store i32 %120, i32* %2
%87 = icmp slt i32 %120, %113
br i1 %87, label %88, label %121
88: ; preds = %48, %86
%89 = phi i32 [ %113, %86 ], [ %33, %48 ]
%90 = phi i32 [ %120, %86 ], [ 0, %48 ]
store i32 0, i32* %3
%91 = icmp sgt i32 %89, 0
%92 = zext i32 %90 to i64
%93 = mul nuw nsw i64 %92, %28
br i1 %91, label %94, label %112
94: ; preds = %88
%95 = getelementptr inbounds i32, i32* %31, i64 %93
br label %96
96: ; preds = %94, %108
%97 = phi i32 [ %110, %108 ], [ 0, %94 ]
%98 = zext i32 %97 to i64
%99 = getelementptr inbounds i32, i32* %95, i64 %98
%100 = load i32, i32* %99
%101 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %100)
%102 = load i32, i32* %1
%103 = add nsw i32 %102, -1
%104 = icmp eq i32 %97, %103
br i1 %104, label %105, label %108
105: ; preds = %96
%106 = call i32 @putchar(i32 10)
%107 = load i32, i32* %1
br label %108
108: ; preds = %96, %105
%109 = phi i32 [ %102, %96 ], [ %107, %105 ]
%110 = add nuw nsw i32 %97, 1
store i32 %110, i32* %3
%111 = icmp slt i32 %110, %109
br i1 %111, label %96, label %112
112: ; preds = %108, %88
%113 = phi i32 [ %89, %88 ], [ %109, %108 ]
%114 = phi i32 [ 0, %88 ], [ %110, %108 ]
%115 = getelementptr inbounds i32, i32* %31, i64 %93
%116 = sext i32 %114 to i64
%117 = getelementptr inbounds i32, i32* %115, i64 %116
%118 = load i32, i32* %117
%119 = icmp eq i32 %118, 0
%120 = add nuw nsw i32 %90, 1
br i1 %119, label %121, label %86
121: ; preds = %86, %112, %35, %48
%122 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0))
%123 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i32* %2, i32* %3)
%124 = load i32, i32* %2
%125 = load i32, i32* %3
%126 = add nsw i32 %124, -1
%127 = sext i32 %126 to i64
%128 = mul nsw i64 %127, %28
%129 = getelementptr inbounds i32, i32* %31, i64 %128
%130 = add nsw i32 %125, -1
%131 = sext i32 %130 to i64
%132 = getelementptr inbounds i32, i32* %129, i64 %131
%133 = load i32, i32* %132
%134 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i32 %124, i32 %125, i32 %133)
ret i32 0
}