#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 main(void) {
  int i, j;
  double x[3] = {-33.0, 9.0, 6.0};
  double a[3][3] = {
      {2.0, 4.0, 6.0}, {3.0, 8.0, 7.0}, {5.0, 7.0, 12345678901234567890.0}};
  double y[3];
  printf("x = \n");
  for (i = 0; i < 3; i++) {
    printf("%6.2f\n", x[i]);
  }
  printf("A = \n");
  for (i = 0; i < 3; i++) {
    for (j = 0; j < 3; j++) {
      printf(" %6.5f", a[i][j]);
    }
    printf("\n");
  }
  for (i = 0; i < 3; i++) {
    y[i] = 0.0;
    for (j = 0; j < 3; j++) {
      y[i] += a[i][j] * x[j];
    }
  }
  printf("A*x = \n");
  for (i = 0; i < 3; i++) {
    printf("%6.2f\n", y[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec1(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    -0x80(%rbp),%rdi
lea    0xec2(%rip),%rsi
mov    $0x48,%edx
call   1040 <memcpy@plt>
lea    0xf0f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    11ad <main+0x8d>
movslq -0x8(%rbp),%rax
movsd  -0x30(%rbp,%rax,8),%xmm0
lea    0xed0(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    117d <main+0x5d>
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    122d <main+0x10d>
movl   $0x0,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jge    1211 <main+0xf1>
movslq -0x8(%rbp),%rcx
lea    -0x80(%rbp),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xe79(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11d3 <main+0xb3>
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11c2 <main+0xa2>
movl   $0x0,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    12c0 <main+0x1a0>
movslq -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xa0(%rbp,%rax,8)
ff ff
movl   $0x0,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jge    12ad <main+0x18d>
movslq -0x8(%rbp),%rcx
lea    -0x80(%rbp),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movslq -0xc(%rbp),%rax
movsd  -0x30(%rbp,%rax,8),%xmm2
movslq -0x8(%rbp),%rax
movsd  -0xa0(%rbp,%rax,8),%xmm1
ff ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp,%rax,8)
ff ff
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1255 <main+0x135>
jmp    12b2 <main+0x192>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1234 <main+0x114>
lea    0xdb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    1308 <main+0x1e8>
movslq -0x8(%rbp),%rax
movsd  -0xa0(%rbp,%rax,8),%xmm0
ff ff
lea    0xd75(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    12d5 <main+0x1b5>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xf3a(%rip),%rdi
call   1040 <puts@plt>
lea    0xf19(%rip),%r14
movsd  0xeb1(%rip),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movsd  0xea7(%rip),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movsd  0xe9d(%rip),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xeea(%rip),%rdi
call   1040 <puts@plt>
lea    0xed7(%rip),%rbx
movsd  0xe80(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movsd  0xe76(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    %rbx,%rdi
movsd  0xe51(%rip),%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
movsd  0xe50(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movsd  0xe46(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movsd  0xe3c(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
movsd  0xe28(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    %rbx,%rdi
movsd  0xe0b(%rip),%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
movsd  0xe0c(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe1c(%rip),%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
movsd  0xda9(%rip),%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
movsd  0xdda(%rip),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movsd  0xdd0(%rip),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.x = [3 x double] [double -3.300000e+01, double 9.000000e+00, double 6.000000e+00]
@__const.main.a = [3 x [3 x double]] [[3 x double] [double 2.000000e+00, double 4.000000e+00, double 6.000000e+00], [3 x double] [double 3.000000e+00, double 8.000000e+00, double 7.000000e+00], [3 x double] [double 5.000000e+00, double 7.000000e+00, double 0x43E56A95319D63E1]]
@.str = [6 x i8] c"x = \0A\00"
@.str.1 = [7 x i8] c"%6.2f\0A\00"
@.str.2 = [6 x i8] c"A = \0A\00"
@.str.3 = [7 x i8] c" %6.5f\00"
@.str.4 = [2 x i8] c"\0A\00"
@.str.5 = [8 x i8] c"A*x = \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [3 x double]
%5 = alloca [3 x [3 x double]]
%6 = alloca [3 x double]
store i32 0, i32* %1
%7 = bitcast [3 x double]* %4 to i8*
%8 = bitcast [3 x [3 x double]]* %5 to i8*
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
br label %10
10: ; preds = %19, %0
%11 = load i32, i32* %2
%12 = icmp slt i32 %11, 3
br i1 %12, label %13, label %22
13: ; preds = %10
%14 = load i32, i32* %2
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 %15
%17 = load double, double* %16
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %17)
br label %19
19: ; preds = %13
%20 = load i32, i32* %2
%21 = add nsw i32 %20, 1
store i32 %21, i32* %2
br label %10
22: ; preds = %10
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %2
br label %24
24: ; preds = %45, %22
%25 = load i32, i32* %2
%26 = icmp slt i32 %25, 3
br i1 %26, label %27, label %48
27: ; preds = %24
store i32 0, i32* %3
br label %28
28: ; preds = %40, %27
%29 = load i32, i32* %3
%30 = icmp slt i32 %29, 3
br i1 %30, label %31, label %43
31: ; preds = %28
%32 = load i32, i32* %2
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %5, i64 0, i64 %33
%35 = load i32, i32* %3
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [3 x double], [3 x double]* %34, i64 0, i64 %36
%38 = load double, double* %37
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), double %38)
br label %40
40: ; preds = %31
%41 = load i32, i32* %3
%42 = add nsw i32 %41, 1
store i32 %42, i32* %3
br label %28
43: ; preds = %28
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %45
45: ; preds = %43
%46 = load i32, i32* %2
%47 = add nsw i32 %46, 1
store i32 %47, i32* %2
br label %24
48: ; preds = %24
store i32 0, i32* %2
br label %49
49: ; preds = %80, %48
%50 = load i32, i32* %2
%51 = icmp slt i32 %50, 3
br i1 %51, label %52, label %83
52: ; preds = %49
%53 = load i32, i32* %2
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 %54
store double 0.000000e+00, double* %55
store i32 0, i32* %3
br label %56
56: ; preds = %76, %52
%57 = load i32, i32* %3
%58 = icmp slt i32 %57, 3
br i1 %58, label %59, label %79
59: ; preds = %56
%60 = load i32, i32* %2
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %5, i64 0, i64 %61
%63 = load i32, i32* %3
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds [3 x double], [3 x double]* %62, i64 0, i64 %64
%66 = load double, double* %65
%67 = load i32, i32* %3
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 %68
%70 = load double, double* %69
%71 = load i32, i32* %2
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 %72
%74 = load double, double* %73
%75 = call double @llvm.fmuladd.f64(double %66, double %70, double %74)
store double %75, double* %73
br label %76
76: ; preds = %59
%77 = load i32, i32* %3
%78 = add nsw i32 %77, 1
store i32 %78, i32* %3
br label %56
79: ; preds = %56
br label %80
80: ; preds = %79
%81 = load i32, i32* %2
%82 = add nsw i32 %81, 1
store i32 %82, i32* %2
br label %49
83: ; preds = %49
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %2
br label %85
85: ; preds = %94, %83
%86 = load i32, i32* %2
%87 = icmp slt i32 %86, 3
br i1 %87, label %88, label %97
88: ; preds = %85
%89 = load i32, i32* %2
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 %90
%92 = load double, double* %91
%93 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %92)
br label %94
94: ; preds = %88
%95 = load i32, i32* %2
%96 = add nsw i32 %95, 1
store i32 %96, i32* %2
br label %85
97: ; preds = %85
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [7 x i8] c"%6.2f\0A\00"
@.str.3 = [7 x i8] c" %6.5f\00"
@str = [5 x i8] c"x = \00"
@str.6 = [5 x i8] c"A = \00"
@str.7 = [7 x i8] c"A*x = \00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double -3.300000e+01)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double 9.000000e+00)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double 6.000000e+00)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.6, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), double 2.000000e+00)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), double 4.000000e+00)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), double 6.000000e+00)
%9 = tail call i32 @putchar(i32 10)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), double 3.000000e+00)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), double 8.000000e+00)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), double 7.000000e+00)
%13 = tail call i32 @putchar(i32 10)
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), double 5.000000e+00)
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), double 7.000000e+00)
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), double 0x43E56A95319D63E1)
%17 = tail call i32 @putchar(i32 10)
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.7, i64 0, i64 0))
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double 6.000000e+00)
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double 1.500000e+01)
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double 0x44100FEFE5360AE9)
ret i32 0
}