#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 *, float, float, float);
float stdlib_base_hypotf(float, float);
int main() {
  float x[] = {3.0f, 4.0f, 5.0f, 12.0f};
  float y;
  int i;
  for (i = 0; i < 4; i += 2) {
    y = stdlib_base_hypotf(x[i], x[i + 1]);
    printf("hypotf(%f, %f) = %f\n", x[i], x[i + 1], y);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x28(%rbp)
cmpl   $0x4,-0x28(%rbp)
jge    11af <main+0x8f>
movslq -0x28(%rbp),%rax
movss  -0x20(%rbp,%rax,4),%xmm0
mov    -0x28(%rbp),%eax
add    $0x1,%eax
cltq
movss  -0x20(%rbp,%rax,4),%xmm1
call   1040 <stdlib_base_hypotf@plt>
movss  %xmm0,-0x24(%rbp)
movslq -0x28(%rbp),%rax
movss  -0x20(%rbp,%rax,4),%xmm0
mov    -0x28(%rbp),%eax
add    $0x1,%eax
cltq
movss  -0x20(%rbp,%rax,4),%xmm1
movss  -0x24(%rbp),%xmm2
lea    0xe74(%rip),%rdi
call   1030 <printf@plt>
mov    -0x28(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x28(%rbp)
jmp    114c <main+0x2c>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
movss  0xed7(%rip),%xmm0
movss  0xed3(%rip),%xmm1
call   1040 <stdlib_base_hypotf@plt>
movaps %xmm0,%xmm2
lea    0xed0(%rip),%rbx
mov    %rbx,%rdi
movss  0xeb5(%rip),%xmm0
movss  0xeb1(%rip),%xmm1
call   1030 <printf@plt>
movss  0xea8(%rip),%xmm0
movss  0xea4(%rip),%xmm1
call   1040 <stdlib_base_hypotf@plt>
movaps %xmm0,%xmm2
mov    %rbx,%rdi
movss  0xe8d(%rip),%xmm0
movss  0xe89(%rip),%xmm1
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.x = [4 x float] [float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 1.200000e+01]
@.str = [21 x i8] c"hypotf(%f, %f) = %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x float]
%3 = alloca float
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [4 x float]* %2 to i8*
store i32 0, i32* %4
br label %6
6: ; preds = %31, %0
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 4
br i1 %8, label %9, label %34
9: ; preds = %6
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [4 x float], [4 x float]* %2, i64 0, i64 %11
%13 = load float, float* %12
%14 = load i32, i32* %4
%15 = add nsw i32 %14, 1
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [4 x float], [4 x float]* %2, i64 0, i64 %16
%18 = load float, float* %17
%19 = call float @stdlib_base_hypotf(float %13, float %18)
store float %19, float* %3
%20 = load i32, i32* %4
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [4 x float], [4 x float]* %2, i64 0, i64 %21
%23 = load float, float* %22
%24 = load i32, i32* %4
%25 = add nsw i32 %24, 1
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [4 x float], [4 x float]* %2, i64 0, i64 %26
%28 = load float, float* %27
%29 = load float, float* %3
%30 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), float %23, float %28, float %29)
br label %31
31: ; preds = %9
%32 = load i32, i32* %4
%33 = add nsw i32 %32, 2
store i32 %33, i32* %4
br label %6
34: ; preds = %6
%35 = load i32, i32* %1
ret i32 %35
}

LLVM IR (-O2):
@.str = [21 x i8] c"hypotf(%f, %f) = %f\0A\00"
define i32 @main() {
%1 = tail call float @stdlib_base_hypotf(float 3.000000e+00, float 4.000000e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), float 3.000000e+00, float 4.000000e+00, float %1)
%3 = tail call float @stdlib_base_hypotf(float 5.000000e+00, float 1.200000e+01)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), float 5.000000e+00, float 1.200000e+01, float %3)
ret i32 0
}