#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*/ scanf(char *, int *, ...);
void le_entrada(int *n, double A[][800], double B[]) {
  int i, j, k;
  int linhas;
  double x;
  scanf("%d ", n);
  linhas = (*n) * (*n);
  for (k = 0; k < linhas; k++) {
    scanf("%d %d %lf ", &i, &j, &x);
    A[i][j] = x;
  }
  for (k = 0; k < (*n); k++) {
    scanf("%d %lf ", &i, &x);
    B[i] = x;
  }
}


x86 assembly (clang, -O0):
<le_entrada>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <scanf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
imul   (%rcx),%eax
mov    %eax,-0x28(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    11a1 <le_entrada+0x91>
lea    0xea4(%rip),%rdi
lea    -0x1c(%rbp),%rsi
lea    -0x20(%rbp),%rdx
lea    -0x30(%rbp),%rcx
mov    $0x0,%al
call   1030 <scanf@plt>
movsd  -0x30(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
imul   $0x1900,%rcx,%rcx
add    %rcx,%rax
movslq -0x20(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    114d <le_entrada+0x3d>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    -0x8(%rbp),%rcx
cmp    (%rcx),%eax
jge    11ed <le_entrada+0xdd>
lea    0xe49(%rip),%rdi
lea    -0x1c(%rbp),%rsi
lea    -0x30(%rbp),%rdx
mov    $0x0,%al
call   1030 <scanf@plt>
movsd  -0x30(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11a8 <le_entrada+0x98>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<le_entrada>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rdx,%rbx
mov    %rsi,%r13
mov    %rdi,%r15
lea    0xed2(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <scanf@plt>
mov    (%r15),%eax
mov    %eax,%r14d
imul   %eax,%r14d
test   %r14d,%r14d
je     11a4 <le_entrada+0x94>
mov    %rbx,0x20(%rsp)
lea    0xc(%rsp),%rbx
lea    0x1c(%rsp),%rbp
lea    0x10(%rsp),%r12
nopl   0x0(%rax,%rax,1)
lea    0xe9d(%rip),%rdi
mov    %rbx,%rsi
mov    %rbp,%rdx
mov    %r12,%rcx
xor    %eax,%eax
call   1030 <scanf@plt>
movsd  0x10(%rsp),%xmm0
movslq 0xc(%rsp),%rax
movslq 0x1c(%rsp),%rcx
imul   $0x1900,%rax,%rax
add    %r13,%rax
movsd  %xmm0,(%rax,%rcx,8)
add    $0xffffffff,%r14d
jne    1160 <le_entrada+0x50>
mov    (%r15),%eax
mov    0x20(%rsp),%rbx
test   %eax,%eax
jle    11e8 <le_entrada+0xd8>
lea    0xe58(%rip),%r12
lea    0xc(%rsp),%r14
lea    0x10(%rsp),%r13
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    %r14,%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1030 <scanf@plt>
movsd  0x10(%rsp),%xmm0
movslq 0xc(%rsp),%rax
movsd  %xmm0,(%rbx,%rax,8)
add    $0x1,%ebp
cmp    (%r15),%ebp
jl     11c0 <le_entrada+0xb0>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [11 x i8] c"%d %d %lf \00"
@.str.2 = [8 x i8] c"%d %lf \00"
define void @le_entrada(i32* %0, [800 x double]* %1, double* %2) {
%4 = alloca i32*
%5 = alloca [800 x double]*
%6 = alloca double*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca double
store i32* %0, i32** %4
store [800 x double]* %1, [800 x double]** %5
store double* %2, double** %6
%12 = load i32*, i32** %4
%13 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %12)
%14 = load i32*, i32** %4
%15 = load i32, i32* %14
%16 = load i32*, i32** %4
%17 = load i32, i32* %16
%18 = mul nsw i32 %15, %17
store i32 %18, i32* %10
store i32 0, i32* %9
br label %19
19: ; preds = %33, %3
%20 = load i32, i32* %9
%21 = load i32, i32* %10
%22 = icmp slt i32 %20, %21
br i1 %22, label %23, label %36
23: ; preds = %19
%24 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32* %7, i32* %8, double* %11)
%25 = load double, double* %11
%26 = load [800 x double]*, [800 x double]** %5
%27 = load i32, i32* %7
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [800 x double], [800 x double]* %26, i64 %28
%30 = load i32, i32* %8
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [800 x double], [800 x double]* %29, i64 0, i64 %31
store double %25, double* %32
br label %33
33: ; preds = %23
%34 = load i32, i32* %9
%35 = add nsw i32 %34, 1
store i32 %35, i32* %9
br label %19
36: ; preds = %19
store i32 0, i32* %9
br label %37
37: ; preds = %49, %36
%38 = load i32, i32* %9
%39 = load i32*, i32** %4
%40 = load i32, i32* %39
%41 = icmp slt i32 %38, %40
br i1 %41, label %42, label %52
42: ; preds = %37
%43 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32* %7, double* %11)
%44 = load double, double* %11
%45 = load double*, double** %6
%46 = load i32, i32* %7
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds double, double* %45, i64 %47
store double %44, double* %48
br label %49
49: ; preds = %42
%50 = load i32, i32* %9
%51 = add nsw i32 %50, 1
store i32 %51, i32* %9
br label %37
52: ; preds = %37
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
@.str.1 = [11 x i8] c"%d %d %lf \00"
@.str.2 = [8 x i8] c"%d %lf \00"
define void @le_entrada(i32* %0, [800 x double]* nocapture writeonly %1, double* nocapture writeonly %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca double
%7 = bitcast i32* %4 to i8*
%8 = bitcast i32* %5 to i8*
%9 = bitcast double* %6 to i8*
%10 = tail call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %0)
%11 = load i32, i32* %0
%12 = mul i32 %11, %11
%13 = icmp eq i32 %12, 0
br i1 %13, label %16, label %19
14: ; preds = %19
%15 = load i32, i32* %0
br label %16
16: ; preds = %14, %3
%17 = phi i32 [ %15, %14 ], [ %11, %3 ]
%18 = icmp sgt i32 %17, 0
br i1 %18, label %30, label %40
19: ; preds = %3, %19
%20 = phi i32 [ %28, %19 ], [ 0, %3 ]
%21 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32* %4, i32* %5, double* %6)
%22 = load double, double* %6
%23 = load i32, i32* %4
%24 = sext i32 %23 to i64
%25 = load i32, i32* %5
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [800 x double], [800 x double]* %1, i64 %24, i64 %26
store double %22, double* %27
%28 = add nuw i32 %20, 1
%29 = icmp eq i32 %28, %12
br i1 %29, label %14, label %19
30: ; preds = %16, %30
%31 = phi i32 [ %37, %30 ], [ 0, %16 ]
%32 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32* %4, double* %6)
%33 = load double, double* %6
%34 = load i32, i32* %4
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds double, double* %2, i64 %35
store double %33, double* %36
%37 = add nuw nsw i32 %31, 1
%38 = load i32, i32* %0
%39 = icmp slt i32 %37, %38
br i1 %39, label %30, label %40
40: ; preds = %30, %16
ret void
}