#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 scanf(char *, int *, int *);
int main(void) {
  int i, j, a, adj[8][8];
  for (i = 0; i < 8; i++)
    for (j = 0; j < 8; j++)
      adj[i][j] = 0;
  for (i = 0; i < 8; i++)
    adj[i][i] = 1;
  printf("\nEnter vertex pairs - Press <ctrl-z> to end\n");
  while (scanf("%d%d", &i, &j) == 2) {
    adj[i][j] = 1;
    adj[j][i] = 1;
  }
  printf("\n\n");
  printf("The adjacency matrix is:\n");
  for (i = 0; i < 8; i++)
    if (i == 0)
      printf("%6d", i);
    else
      printf("%3d", i);
  printf("\n");
  for (i = 0; i < 8; i++) {
    printf("%3d", i);
    for (j = 0; j < 8; j++)
      printf("%3d", adj[i][j]);
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jge    1192 <main+0x72>
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jge    117f <main+0x5f>
movslq -0x8(%rbp),%rcx
lea    -0x110(%rbp),%rax
shl    $0x5,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114a <main+0x2a>
jmp    1184 <main+0x64>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1139 <main+0x19>
movl   $0x0,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jge    11ce <main+0xae>
movslq -0x8(%rbp),%rcx
lea    -0x110(%rbp),%rax
shl    $0x5,%rcx
add    %rcx,%rax
movslq -0x8(%rbp),%rcx
movl   $0x1,(%rax,%rcx,4)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1199 <main+0x79>
lea    0xe2b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe4a(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
cmp    $0x2,%eax
jne    1238 <main+0x118>
movslq -0x8(%rbp),%rcx
lea    -0x110(%rbp),%rax
shl    $0x5,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
movl   $0x1,(%rax,%rcx,4)
movslq -0xc(%rbp),%rcx
lea    -0x110(%rbp),%rax
shl    $0x5,%rcx
add    %rcx,%rax
movslq -0x8(%rbp),%rcx
movl   $0x1,(%rax,%rcx,4)
jmp    11dc <main+0xbc>
lea    0xdf3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xde8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jge    12a9 <main+0x189>
cmpl   $0x0,-0x8(%rbp)
jne    1285 <main+0x165>
mov    -0x8(%rbp),%esi
lea    0xdd6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1296 <main+0x176>
mov    -0x8(%rbp),%esi
lea    0xdc4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    129b <main+0x17b>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    125b <main+0x13b>
lea    0xd83(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jge    133b <main+0x21b>
mov    -0x8(%rbp),%esi
lea    0xd81(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jge    131f <main+0x1ff>
movslq -0x8(%rbp),%rcx
lea    -0x110(%rbp),%rax
shl    $0x5,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xd49(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    12e0 <main+0x1c0>
lea    0xd0d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    12be <main+0x19e>
mov    -0x4(%rbp),%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x110,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0x100(%rsp)
movaps %xmm0,0xf0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x20(%rsp)
movl   $0x8,0xc(%rsp)
movl   $0x1,0x10(%rsp)
movl   $0x1,0x34(%rsp)
movl   $0x1,0x58(%rsp)
movl   $0x1,0x7c(%rsp)
movl   $0x1,0xa0(%rsp)
movl   $0x1,0xc4(%rsp)
movl   $0x1,0xe8(%rsp)
movl   $0x1,0x10c(%rsp)
movl   $0x8,0x8(%rsp)
lea    0xdf0(%rip),%rdi
call   1040 <puts@plt>
lea    0xdd7(%rip),%rdi
lea    0x8(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1060 <scanf@plt>
cmp    $0x2,%eax
jne    1294 <main+0x154>
lea    0xdbc(%rip),%r14
lea    0x8(%rsp),%r15
lea    0xc(%rsp),%rbx
xchg   %ax,%ax
movslq 0x8(%rsp),%rax
movslq 0xc(%rsp),%rcx
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rsp,%rdx
add    $0x10,%rdx
movl   $0x1,(%rdx,%rcx,4)
shl    $0x5,%rcx
add    %rsp,%rcx
add    $0x10,%rcx
movl   $0x1,(%rcx,%rax,4)
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1060 <scanf@plt>
cmp    $0x2,%eax
je     1250 <main+0x110>
lea    0xd9e(%rip),%rdi
call   1040 <puts@plt>
lea    0xd94(%rip),%rdi
call   1040 <puts@plt>
movl   $0x0,0x8(%rsp)
lea    0xd4a(%rip),%r14
lea    0xd47(%rip),%rbx
xor    %esi,%esi
jmp    12ea <main+0x1aa>
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x8(%rsp),%eax
lea    0x1(%rax),%esi
mov    %esi,0x8(%rsp)
cmp    $0x7,%eax
jge    12f5 <main+0x1b5>
test   %esi,%esi
jne    12d0 <main+0x190>
mov    %r14,%rdi
xor    %esi,%esi
jmp    12d3 <main+0x193>
mov    $0xa,%edi
call   1030 <putchar@plt>
movl   $0x0,0x8(%rsp)
lea    0xcfb(%rip),%rbx
xor    %esi,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movl   $0x0,0xc(%rsp)
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movslq 0x8(%rsp),%rcx
cltq
shl    $0x5,%rcx
add    %rsp,%rcx
add    $0x10,%rcx
mov    (%rcx,%rax,4),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0xc(%rsp),%ecx
lea    0x1(%rcx),%eax
mov    %eax,0xc(%rsp)
cmp    $0x7,%ecx
jl     1330 <main+0x1f0>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x8(%rsp),%eax
lea    0x1(%rax),%esi
mov    %esi,0x8(%rsp)
cmp    $0x7,%eax
jl     1310 <main+0x1d0>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [45 x i8] c"\0AEnter vertex pairs - Press <ctrl-z> to end\0A\00"
@.str.1 = [5 x i8] c"%d%d\00"
@.str.2 = [3 x i8] c"\0A\0A\00"
@.str.3 = [26 x i8] c"The adjacency matrix is:\0A\00"
@.str.4 = [4 x i8] c"%6d\00"
@.str.5 = [4 x i8] c"%3d\00"
@.str.6 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [8 x [8 x i32]]
store i32 0, i32* %1
store i32 0, i32* %2
br label %6
6: ; preds = %24, %0
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 8
br i1 %8, label %9, label %27
9: ; preds = %6
store i32 0, i32* %3
br label %10
10: ; preds = %20, %9
%11 = load i32, i32* %3
%12 = icmp slt i32 %11, 8
br i1 %12, label %13, label %23
13: ; preds = %10
%14 = load i32, i32* %2
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %5, i64 0, i64 %15
%17 = load i32, i32* %3
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [8 x i32], [8 x i32]* %16, i64 0, i64 %18
store i32 0, i32* %19
br label %20
20: ; preds = %13
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %10
23: ; preds = %10
br label %24
24: ; preds = %23
%25 = load i32, i32* %2
%26 = add nsw i32 %25, 1
store i32 %26, i32* %2
br label %6
27: ; preds = %6
store i32 0, i32* %2
br label %28
28: ; preds = %38, %27
%29 = load i32, i32* %2
%30 = icmp slt i32 %29, 8
br i1 %30, label %31, label %41
31: ; preds = %28
%32 = load i32, i32* %2
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %5, i64 0, i64 %33
%35 = load i32, i32* %2
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [8 x i32], [8 x i32]* %34, i64 0, i64 %36
store i32 1, i32* %37
br label %38
38: ; preds = %31
%39 = load i32, i32* %2
%40 = add nsw i32 %39, 1
store i32 %40, i32* %2
br label %28
41: ; preds = %28
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
br label %43
43: ; preds = %46, %41
%44 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3)
%45 = icmp eq i32 %44, 2
br i1 %45, label %46, label %59
46: ; preds = %43
%47 = load i32, i32* %2
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %5, i64 0, i64 %48
%50 = load i32, i32* %3
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds [8 x i32], [8 x i32]* %49, i64 0, i64 %51
store i32 1, i32* %52
%53 = load i32, i32* %3
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %5, i64 0, i64 %54
%56 = load i32, i32* %2
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds [8 x i32], [8 x i32]* %55, i64 0, i64 %57
store i32 1, i32* %58
br label %43
59: ; preds = %43
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %2
br label %62
62: ; preds = %75, %59
%63 = load i32, i32* %2
%64 = icmp slt i32 %63, 8
br i1 %64, label %65, label %78
65: ; preds = %62
%66 = load i32, i32* %2
%67 = icmp eq i32 %66, 0
br i1 %67, label %68, label %71
68: ; preds = %65
%69 = load i32, i32* %2
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %69)
br label %74
71: ; preds = %65
%72 = load i32, i32* %2
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %72)
br label %74
74: ; preds = %71, %68
br label %75
75: ; preds = %74
%76 = load i32, i32* %2
%77 = add nsw i32 %76, 1
store i32 %77, i32* %2
br label %62
78: ; preds = %62
%79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %2
br label %80
80: ; preds = %103, %78
%81 = load i32, i32* %2
%82 = icmp slt i32 %81, 8
br i1 %82, label %83, label %106
83: ; preds = %80
%84 = load i32, i32* %2
%85 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %84)
store i32 0, i32* %3
br label %86
86: ; preds = %98, %83
%87 = load i32, i32* %3
%88 = icmp slt i32 %87, 8
br i1 %88, label %89, label %101
89: ; preds = %86
%90 = load i32, i32* %2
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %5, i64 0, i64 %91
%93 = load i32, i32* %3
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds [8 x i32], [8 x i32]* %92, i64 0, i64 %94
%96 = load i32, i32* %95
%97 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %96)
br label %98
98: ; preds = %89
%99 = load i32, i32* %3
%100 = add nsw i32 %99, 1
store i32 %100, i32* %3
br label %86
101: ; preds = %86
%102 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
br label %103
103: ; preds = %101
%104 = load i32, i32* %2
%105 = add nsw i32 %104, 1
store i32 %105, i32* %2
br label %80
106: ; preds = %80
%107 = load i32, i32* %1
ret i32 %107
}

LLVM IR (-O2):
@.str.1 = [5 x i8] c"%d%d\00"
@.str.4 = [4 x i8] c"%6d\00"
@.str.5 = [4 x i8] c"%3d\00"
@str = [44 x i8] c"\0AEnter vertex pairs - Press <ctrl-z> to end\00"
@str.7 = [2 x i8] c"\0A\00"
@str.8 = [25 x i8] c"The adjacency matrix is:\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [8 x [8 x i32]]
%4 = bitcast [8 x [8 x i32]]* %3 to i8*
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
store i32 8, i32* %2
%7 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %3, i64 0, i64 0, i64 0
store i32 1, i32* %7
%8 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %3, i64 0, i64 1, i64 1
store i32 1, i32* %8
%9 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %3, i64 0, i64 2, i64 2
store i32 1, i32* %9
%10 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %3, i64 0, i64 3, i64 3
store i32 1, i32* %10
%11 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %3, i64 0, i64 4, i64 4
store i32 1, i32* %11
%12 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %3, i64 0, i64 5, i64 5
store i32 1, i32* %12
%13 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %3, i64 0, i64 6, i64 6
store i32 1, i32* %13
%14 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %3, i64 0, i64 7, i64 7
store i32 1, i32* %14
store i32 8, i32* %1
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%17 = icmp eq i32 %16, 2
br i1 %17, label %18, label %27
18: ; preds = %0, %18
%19 = load i32, i32* %1
%20 = sext i32 %19 to i64
%21 = load i32, i32* %2
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %3, i64 0, i64 %20, i64 %22
store i32 1, i32* %23
%24 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %3, i64 0, i64 %22, i64 %20
store i32 1, i32* %24
%25 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%26 = icmp eq i32 %25, 2
br i1 %26, label %18, label %27
27: ; preds = %18, %0
%28 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.7, i64 0, i64 0))
%29 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.8, i64 0, i64 0))
store i32 0, i32* %1
br label %30
30: ; preds = %27, %37
%31 = phi i32 [ 0, %27 ], [ %39, %37 ]
%32 = icmp eq i32 %31, 0
br i1 %32, label %33, label %35
33: ; preds = %30
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 0)
br label %37
35: ; preds = %30
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %31)
br label %37
37: ; preds = %33, %35
%38 = load i32, i32* %1
%39 = add nsw i32 %38, 1
store i32 %39, i32* %1
%40 = icmp slt i32 %38, 7
br i1 %40, label %30, label %41
41: ; preds = %37
%42 = call i32 @putchar(i32 10)
store i32 0, i32* %1
br label %43
43: ; preds = %41, %57
%44 = phi i32 [ 0, %41 ], [ %60, %57 ]
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %44)
store i32 0, i32* %2
br label %46
46: ; preds = %43, %46
%47 = phi i32 [ 0, %43 ], [ %55, %46 ]
%48 = load i32, i32* %1
%49 = sext i32 %48 to i64
%50 = sext i32 %47 to i64
%51 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %3, i64 0, i64 %49, i64 %50
%52 = load i32, i32* %51
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %52)
%54 = load i32, i32* %2
%55 = add nsw i32 %54, 1
store i32 %55, i32* %2
%56 = icmp slt i32 %54, 7
br i1 %56, label %46, label %57
57: ; preds = %46
%58 = call i32 @putchar(i32 10)
%59 = load i32, i32* %1
%60 = add nsw i32 %59, 1
store i32 %60, i32* %1
%61 = icmp slt i32 %59, 7
br i1 %61, label %43, label %62
62: ; preds = %57
ret i32 0
}