#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 *, int *, int *, int *, int *, int *,
                         int *, int *, int *, int *, int *, int *, int *, int *,
                         int *, int *);
int main(void) {
  int a11, a12, a13, a14, a21, a22, a23, a24, a31, a32, a33, a34, a41, a42, a43,
      a44;
  int rowSum1, rowSum2, rowSum3, rowSum4, diagonalSum1, diagonalSum2;
  printf("Enter the numbers from 0 to 16 in any order:\n");
  scanf("%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d", &a11, &a12, &a13, &a14, &a21, &a22,
        &a23, &a24, &a31, &a32, &a33, &a34, &a41, &a42, &a43, &a44);
  rowSum1 = a11 + a12 + a13 + a14;
  rowSum2 = a21 + a22 + a23 + a24;
  rowSum3 = a31 + a32 + a33 + a34;
  rowSum4 = a41 + a42 + a43 + a44;
  diagonalSum1 = a11 + a22 + a33 + a44;
  diagonalSum2 = a14 + a23 + a32 + a41;
  printf("%-4.d%-4.d%-4.d%-4.d\n%-4.d%-4.d%-4.d%-4.d\n%-4.d%-4.d%-4.d%-4.d\n%-"
         "4.d%-4.d%-4.d%-4.d\n",
         a11, a12, a13, a14, a21, a22, a23, a24, a31, a32, a33, a34, a41, a42,
         a43, a44);
  printf("Row sums: %d %d %d %d\nDiagonal sums: %d %d\n", rowSum1, rowSum2,
         rowSum3, rowSum4, diagonalSum1, diagonalSum2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xe8,%rsp
movl   $0x0,-0x2c(%rbp)
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
lea    -0x30(%rbp),%rsi
lea    -0x34(%rbp),%rdx
lea    -0x38(%rbp),%rcx
lea    -0x3c(%rbp),%r8
lea    -0x40(%rbp),%r9
lea    -0x44(%rbp),%rax
mov    %rax,-0xb0(%rbp)
lea    -0x48(%rbp),%rax
mov    %rax,-0xa8(%rbp)
lea    -0x4c(%rbp),%rax
mov    %rax,-0xa0(%rbp)
lea    -0x50(%rbp),%r13
lea    -0x54(%rbp),%r12
lea    -0x58(%rbp),%r15
lea    -0x5c(%rbp),%r14
lea    -0x60(%rbp),%rbx
lea    -0x64(%rbp),%r11
lea    -0x68(%rbp),%r10
lea    -0x6c(%rbp),%rax
mov    %rax,-0x98(%rbp)
mov    -0xb0(%rbp),%rax
mov    %rax,(%rsp)
mov    -0xa8(%rbp),%rax
mov    %rax,0x8(%rsp)
mov    -0xa0(%rbp),%rax
mov    %rax,0x10(%rsp)
mov    -0x98(%rbp),%rax
mov    %r13,0x18(%rsp)
mov    %r12,0x20(%rsp)
mov    %r15,0x28(%rsp)
mov    %r14,0x30(%rsp)
mov    %rbx,0x38(%rsp)
mov    %r11,0x40(%rsp)
mov    %r10,0x48(%rsp)
mov    %rax,0x50(%rsp)
call   1040 <scanf@plt>
mov    -0x30(%rbp),%eax
add    -0x34(%rbp),%eax
add    -0x38(%rbp),%eax
add    -0x3c(%rbp),%eax
mov    %eax,-0x70(%rbp)
mov    -0x40(%rbp),%eax
add    -0x44(%rbp),%eax
add    -0x48(%rbp),%eax
add    -0x4c(%rbp),%eax
mov    %eax,-0x74(%rbp)
mov    -0x50(%rbp),%eax
add    -0x54(%rbp),%eax
add    -0x58(%rbp),%eax
add    -0x5c(%rbp),%eax
mov    %eax,-0x78(%rbp)
mov    -0x60(%rbp),%eax
add    -0x64(%rbp),%eax
add    -0x68(%rbp),%eax
add    -0x6c(%rbp),%eax
mov    %eax,-0x7c(%rbp)
mov    -0x30(%rbp),%eax
add    -0x44(%rbp),%eax
add    -0x58(%rbp),%eax
add    -0x6c(%rbp),%eax
mov    %eax,-0x80(%rbp)
mov    -0x3c(%rbp),%eax
add    -0x48(%rbp),%eax
add    -0x54(%rbp),%eax
add    -0x60(%rbp),%eax
mov    %eax,-0x84(%rbp)
mov    -0x30(%rbp),%esi
mov    -0x34(%rbp),%edx
mov    -0x38(%rbp),%ecx
mov    -0x3c(%rbp),%r8d
mov    -0x40(%rbp),%r9d
mov    -0x44(%rbp),%eax
mov    -0x48(%rbp),%edi
mov    %edi,-0x90(%rbp)
mov    -0x4c(%rbp),%edi
mov    %edi,-0x8c(%rbp)
mov    -0x50(%rbp),%r13d
mov    -0x54(%rbp),%r12d
mov    -0x58(%rbp),%r15d
mov    -0x5c(%rbp),%r14d
mov    -0x60(%rbp),%ebx
mov    -0x64(%rbp),%r11d
mov    -0x68(%rbp),%r10d
mov    -0x6c(%rbp),%edi
mov    %edi,-0x88(%rbp)
lea    0xd9e(%rip),%rdi
mov    %eax,(%rsp)
mov    -0x90(%rbp),%eax
mov    %eax,0x8(%rsp)
mov    -0x8c(%rbp),%eax
mov    %eax,0x10(%rsp)
mov    -0x88(%rbp),%eax
mov    %r13d,0x18(%rsp)
mov    %r12d,0x20(%rsp)
mov    %r15d,0x28(%rsp)
mov    %r14d,0x30(%rsp)
mov    %ebx,0x38(%rsp)
mov    %r11d,0x40(%rsp)
mov    %r10d,0x48(%rsp)
mov    %eax,0x50(%rsp)
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x70(%rbp),%esi
mov    -0x74(%rbp),%edx
mov    -0x78(%rbp),%ecx
mov    -0x7c(%rbp),%r8d
mov    -0x80(%rbp),%r9d
mov    -0x84(%rbp),%eax
lea    0xd8b(%rip),%rdi
mov    %eax,(%rsp)
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xe8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
lea    0xf5a(%rip),%rdi
call   1030 <puts@plt>
sub    $0x8,%rsp
lea    0x10(%rsp),%rax
lea    0x14(%rsp),%rbp
lea    0x18(%rsp),%rbx
lea    0x1c(%rsp),%r15
lea    0x20(%rsp),%r12
lea    0x24(%rsp),%r13
lea    0x28(%rsp),%r10
lea    0x2c(%rsp),%r11
lea    0x30(%rsp),%r14
lea    0xe7b(%rip),%rdi
lea    0x4c(%rsp),%rsi
lea    0x48(%rsp),%rdx
lea    0x44(%rsp),%rcx
lea    0x40(%rsp),%r8
lea    0x3c(%rsp),%r9
push   %rax
push   %rbp
push   %rbx
push   %r15
push   %r12
push   %r13
push   %r10
push   %r11
push   %r14
lea    0x7c(%rsp),%rax
push   %rax
lea    0x88(%rsp),%rax
push   %rax
call   1050 <scanf@plt>
add    $0x60,%rsp
mov    0x44(%rsp),%esi
mov    0x40(%rsp),%edx
lea    (%rdx,%rsi,1),%eax
mov    0x3c(%rsp),%ecx
add    %ecx,%eax
mov    0x38(%rsp),%r8d
add    %r8d,%eax
mov    %eax,0x4(%rsp)
mov    0x34(%rsp),%r9d
mov    0x30(%rsp),%eax
lea    (%rax,%r9,1),%r15d
mov    %rax,%r13
mov    %rax,0x70(%rsp)
mov    0x2c(%rsp),%edi
add    %edi,%r15d
mov    %rdi,0x60(%rsp)
mov    0x28(%rsp),%ebp
mov    %rbp,0x80(%rsp)
add    %ebp,%r15d
mov    0x24(%rsp),%ebp
mov    %rbp,0x78(%rsp)
mov    0x20(%rsp),%eax
lea    (%rax,%rbp,1),%r12d
mov    %rax,0x50(%rsp)
mov    0x1c(%rsp),%ebp
add    %ebp,%r12d
mov    0x18(%rsp),%ebx
mov    %rbx,0x68(%rsp)
add    %ebx,%r12d
mov    0x14(%rsp),%r10d
mov    0x10(%rsp),%ebx
mov    %rbx,0x58(%rsp)
lea    (%rbx,%r10,1),%r14d
mov    0xc(%rsp),%ebx
mov    %rbx,0x48(%rsp)
add    %ebx,%r14d
mov    0x8(%rsp),%r11d
add    %r11d,%r14d
lea    (%rsi,%r13,1),%ebx
add    %ebp,%ebx
add    %r11d,%ebx
lea    (%rdi,%r8,1),%r13d
add    %eax,%r13d
add    %r10d,%r13d
sub    $0x8,%rsp
lea    0xda2(%rip),%rdi
xor    %eax,%eax
push   %r11
push   0x58(%rsp)
push   0x70(%rsp)
push   %r10
push   0x90(%rsp)
push   %rbp
push   0x88(%rsp)
push   0xb8(%rsp)
push   0xc8(%rsp)
push   0xb0(%rsp)
push   0xc8(%rsp)
call   1040 <printf@plt>
add    $0x58,%rsp
lea    0xdae(%rip),%rdi
mov    0xc(%rsp),%esi
mov    %r15d,%edx
mov    %r12d,%ecx
mov    %r14d,%r8d
mov    %ebx,%r9d
xor    %eax,%eax
push   %r13
call   1040 <printf@plt>
add    $0x10,%rsp
xor    %eax,%eax
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [46 x i8] c"Enter the numbers from 0 to 16 in any order:\0A\00"
@.str.1 = [33 x i8] c"%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d\00"
@.str.2 = [85 x i8] c"%-4.d%-4.d%-4.d%-4.d\0A%-4.d%-4.d%-4.d%-4.d\0A%-4.d%-4.d%-4.d%-4.d\0A%-4.d%-4.d%-4.d%-4.d\0A\00"
@.str.3 = [44 x i8] c"Row sums: %d %d %d %d\0ADiagonal sums: %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 i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
store i32 0, i32* %1
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%25 = call i32 @scanf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3, i32* %4, i32* %5, i32* %6, i32* %7, i32* %8, i32* %9, i32* %10, i32* %11, i32* %12, i32* %13, i32* %14, i32* %15, i32* %16, i32* %17)
%26 = load i32, i32* %2
%27 = load i32, i32* %3
%28 = add nsw i32 %26, %27
%29 = load i32, i32* %4
%30 = add nsw i32 %28, %29
%31 = load i32, i32* %5
%32 = add nsw i32 %30, %31
store i32 %32, i32* %18
%33 = load i32, i32* %6
%34 = load i32, i32* %7
%35 = add nsw i32 %33, %34
%36 = load i32, i32* %8
%37 = add nsw i32 %35, %36
%38 = load i32, i32* %9
%39 = add nsw i32 %37, %38
store i32 %39, i32* %19
%40 = load i32, i32* %10
%41 = load i32, i32* %11
%42 = add nsw i32 %40, %41
%43 = load i32, i32* %12
%44 = add nsw i32 %42, %43
%45 = load i32, i32* %13
%46 = add nsw i32 %44, %45
store i32 %46, i32* %20
%47 = load i32, i32* %14
%48 = load i32, i32* %15
%49 = add nsw i32 %47, %48
%50 = load i32, i32* %16
%51 = add nsw i32 %49, %50
%52 = load i32, i32* %17
%53 = add nsw i32 %51, %52
store i32 %53, i32* %21
%54 = load i32, i32* %2
%55 = load i32, i32* %7
%56 = add nsw i32 %54, %55
%57 = load i32, i32* %12
%58 = add nsw i32 %56, %57
%59 = load i32, i32* %17
%60 = add nsw i32 %58, %59
store i32 %60, i32* %22
%61 = load i32, i32* %5
%62 = load i32, i32* %8
%63 = add nsw i32 %61, %62
%64 = load i32, i32* %11
%65 = add nsw i32 %63, %64
%66 = load i32, i32* %14
%67 = add nsw i32 %65, %66
store i32 %67, i32* %23
%68 = load i32, i32* %2
%69 = load i32, i32* %3
%70 = load i32, i32* %4
%71 = load i32, i32* %5
%72 = load i32, i32* %6
%73 = load i32, i32* %7
%74 = load i32, i32* %8
%75 = load i32, i32* %9
%76 = load i32, i32* %10
%77 = load i32, i32* %11
%78 = load i32, i32* %12
%79 = load i32, i32* %13
%80 = load i32, i32* %14
%81 = load i32, i32* %15
%82 = load i32, i32* %16
%83 = load i32, i32* %17
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str.2, i64 0, i64 0), i32 %68, i32 %69, i32 %70, i32 %71, i32 %72, i32 %73, i32 %74, i32 %75, i32 %76, i32 %77, i32 %78, i32 %79, i32 %80, i32 %81, i32 %82, i32 %83)
%85 = load i32, i32* %18
%86 = load i32, i32* %19
%87 = load i32, i32* %20
%88 = load i32, i32* %21
%89 = load i32, i32* %22
%90 = load i32, i32* %23
%91 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0), i32 %85, i32 %86, i32 %87, i32 %88, i32 %89, i32 %90)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [33 x i8] c"%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d\00"
@.str.2 = [85 x i8] c"%-4.d%-4.d%-4.d%-4.d\0A%-4.d%-4.d%-4.d%-4.d\0A%-4.d%-4.d%-4.d%-4.d\0A%-4.d%-4.d%-4.d%-4.d\0A\00"
@.str.3 = [44 x i8] c"Row sums: %d %d %d %d\0ADiagonal sums: %d %d\0A\00"
@str = [45 x i8] c"Enter the numbers from 0 to 16 in any order:\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = bitcast i32* %1 to i8*
%18 = bitcast i32* %2 to i8*
%19 = bitcast i32* %3 to i8*
%20 = bitcast i32* %4 to i8*
%21 = bitcast i32* %5 to i8*
%22 = bitcast i32* %6 to i8*
%23 = bitcast i32* %7 to i8*
%24 = bitcast i32* %8 to i8*
%25 = bitcast i32* %9 to i8*
%26 = bitcast i32* %10 to i8*
%27 = bitcast i32* %11 to i8*
%28 = bitcast i32* %12 to i8*
%29 = bitcast i32* %13 to i8*
%30 = bitcast i32* %14 to i8*
%31 = bitcast i32* %15 to i8*
%32 = bitcast i32* %16 to i8*
%33 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
%34 = call i32 @scanf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6, i32* %7, i32* %8, i32* %9, i32* %10, i32* %11, i32* %12, i32* %13, i32* %14, i32* %15, i32* %16)
%35 = load i32, i32* %1
%36 = load i32, i32* %2
%37 = add nsw i32 %36, %35
%38 = load i32, i32* %3
%39 = add nsw i32 %37, %38
%40 = load i32, i32* %4
%41 = add nsw i32 %39, %40
%42 = load i32, i32* %5
%43 = load i32, i32* %6
%44 = add nsw i32 %43, %42
%45 = load i32, i32* %7
%46 = add nsw i32 %44, %45
%47 = load i32, i32* %8
%48 = add nsw i32 %46, %47
%49 = load i32, i32* %9
%50 = load i32, i32* %10
%51 = add nsw i32 %50, %49
%52 = load i32, i32* %11
%53 = add nsw i32 %51, %52
%54 = load i32, i32* %12
%55 = add nsw i32 %53, %54
%56 = load i32, i32* %13
%57 = load i32, i32* %14
%58 = add nsw i32 %57, %56
%59 = load i32, i32* %15
%60 = add nsw i32 %58, %59
%61 = load i32, i32* %16
%62 = add nsw i32 %60, %61
%63 = add nsw i32 %43, %35
%64 = add nsw i32 %63, %52
%65 = add nsw i32 %64, %61
%66 = add nsw i32 %45, %40
%67 = add nsw i32 %66, %50
%68 = add nsw i32 %67, %56
%69 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([85 x i8], [85 x i8]* @.str.2, i64 0, i64 0), i32 %35, i32 %36, i32 %38, i32 %40, i32 %42, i32 %43, i32 %45, i32 %47, i32 %49, i32 %50, i32 %52, i32 %54, i32 %56, i32 %57, i32 %59, i32 %61)
%70 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0), i32 %41, i32 %48, i32 %55, i32 %62, i32 %65, i32 %68)
ret i32 0
}