#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, double);
int /*<<< orphan*/ scanf(char *, double *);
int main(void) {
  double a[100];
  int i;
  for (i = 0; i < 100; i++) {
    scanf("%lf", &a[i]);
    if (a[i] <= 10.0) {
      printf("A[%d] = %.1f\n", i, a[i]);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x340,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x334(%rbp)
cmpl   $0x64,-0x334(%rbp)
jge    11c3 <main+0xa3>
movslq -0x334(%rbp),%rax
lea    -0x330(%rbp),%rsi
shl    $0x3,%rax
add    %rax,%rsi
lea    0xea3(%rip),%rdi
call   1040 <scanf@plt>
movslq -0x334(%rbp),%rax
movsd  0xe87(%rip),%xmm0
ucomisd -0x330(%rbp,%rax,8),%xmm0
ff ff
jb     11aa <main+0x8a>
mov    -0x334(%rbp),%esi
movslq -0x334(%rbp),%rax
movsd  -0x330(%rbp,%rax,8),%xmm0
ff ff
lea    0xe67(%rip),%rdi
call   1030 <printf@plt>
jmp    11af <main+0x8f>
mov    -0x334(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x334(%rbp)
jmp    113c <main+0x1c>
xor    %eax,%eax
add    $0x340,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x328,%rsp
xor    %r12d,%r12d
lea    0xed0(%rip),%r15
lea    0xecd(%rip),%r14
xor    %ebx,%ebx
jmp    115e <main+0x3e>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%rbx
add    $0x8,%r12
cmp    $0x64,%rbx
je     1189 <main+0x69>
lea    (%rsp,%r12,1),%rsi
mov    %r15,%rdi
call   1040 <scanf@plt>
movsd  (%rsp,%rbx,8),%xmm0
movsd  0xe89(%rip),%xmm1
ucomisd %xmm0,%xmm1
jb     1150 <main+0x30>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
jmp    1150 <main+0x30>
xor    %eax,%eax
add    $0x328,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [14 x i8] c"A[%d] = %.1f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x double]
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
br label %4
4: ; preds = %25, %0
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 100
br i1 %6, label %7, label %28
7: ; preds = %4
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [100 x double], [100 x double]* %2, i64 0, i64 %9
%11 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %10)
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [100 x double], [100 x double]* %2, i64 0, i64 %13
%15 = load double, double* %14
%16 = fcmp ole double %15, 1.000000e+01
br i1 %16, label %17, label %24
17: ; preds = %7
%18 = load i32, i32* %3
%19 = load i32, i32* %3
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [100 x double], [100 x double]* %2, i64 0, i64 %20
%22 = load double, double* %21
%23 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %18, double %22)
br label %24
24: ; preds = %17, %7
br label %25
25: ; preds = %24
%26 = load i32, i32* %3
%27 = add nsw i32 %26, 1
store i32 %27, i32* %3
br label %4
28: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [14 x i8] c"A[%d] = %.1f\0A\00"
define i32 @main() {
%1 = alloca [100 x double]
%2 = bitcast [100 x double]* %1 to i8*
br label %3
3: ; preds = %0, %12
%4 = phi i64 [ 0, %0 ], [ %13, %12 ]
%5 = getelementptr inbounds [100 x double], [100 x double]* %1, i64 0, i64 %4
%6 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %5)
%7 = load double, double* %5
%8 = fcmp ugt double %7, 1.000000e+01
br i1 %8, label %12, label %9
9: ; preds = %3
%10 = trunc i64 %4 to i32
%11 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %10, double %7)
br label %12
12: ; preds = %3, %9
%13 = add nuw nsw i64 %4, 1
%14 = icmp eq i64 %13, 100
br i1 %14, label %15, label %3
15: ; preds = %12
ret i32 0
}