#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 M_PI;
int atan(float);
int /*<<< orphan*/ printf(char *, ...);
float sqrt(int);
int main() {
  float x, y;
  int step, min, sec;
  printf("  x\tstepeni\tminuti\tsekundi\n");
  for (x = 0.02; x <= 0.8; x += 0.01) {
    y = 180 / M_PI * atan(x / sqrt(1 - x * x));
    step = y;
    min = (y - step) * 60;
    sec = ((y - step) * 60 - min) * 60 + 0.5;
    printf("%5.2f\t%3d\t %2d\t %2d\n", x, step, min, sec);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xee2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  0xeab(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xea5(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     12a2 <main+0x172>
mov    $0xb4,%eax
mov    0x2e67(%rip),%rcx
cltd
idivl  (%rcx)
mov    %eax,-0x1c(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm1,%xmm0
movss  0xe54(%rip),%xmm1
addss  %xmm1,%xmm0
cvttss2si %xmm0,%edi
call   1050 <sqrt@plt>
movaps %xmm0,%xmm1
movss  -0x20(%rbp),%xmm0
divss  %xmm1,%xmm0
call   1040 <atan@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
imul   %ecx,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0xc(%rbp)
cvttss2si -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
cvtsi2ssl -0x10(%rbp),%xmm1
subss  %xmm1,%xmm0
movss  0xe03(%rip),%xmm1
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
cvtsi2ssl -0x10(%rbp),%xmm1
subss  %xmm1,%xmm0
cvtsi2ssl -0x14(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
movss  0xdd0(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  0xdc0(%rip),%xmm1
mulss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdc4(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x18(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
lea    0xdcc(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd90(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    115a <main+0x2a>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xef6(%rip),%rdi
call   1030 <puts@plt>
movss  0xea4(%rip),%xmm2
movsd  0xeac(%rip),%xmm0
mov    0x2e7d(%rip),%r14
lea    0xebe(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movss  %xmm2,0x4(%rsp)
movsd  %xmm0,0x8(%rsp)
mov    $0xb4,%eax
xor    %edx,%edx
idivl  (%r14)
mov    %eax,%ebp
movaps %xmm2,%xmm0
mulss  %xmm2,%xmm0
movss  0xe5d(%rip),%xmm1
subss  %xmm0,%xmm1
cvttss2si %xmm1,%edi
call   1060 <sqrt@plt>
movss  0x4(%rsp),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
call   1050 <atan@plt>
imul   %ebp,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
cvttss2si %xmm0,%esi
cvttps2dq %xmm0,%xmm1
cvtdq2ps %xmm1,%xmm1
subss  %xmm1,%xmm0
movss  0xe21(%rip),%xmm2
mulss  %xmm2,%xmm0
cvttss2si %xmm0,%edx
cvttps2dq %xmm0,%xmm1
cvtdq2ps %xmm1,%xmm1
subss  %xmm1,%xmm0
mulss  %xmm2,%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xe0e(%rip),%xmm0
cvttsd2si %xmm0,%ecx
mov    %rbx,%rdi
movsd  0x8(%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0xdf4(%rip),%xmm0
xorps  %xmm2,%xmm2
cvtsd2ss %xmm0,%xmm2
xorps  %xmm0,%xmm0
cvtss2sd %xmm2,%xmm0
movsd  0xde6(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    1180 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [28 x i8] c" x\09stepeni\09minuti\09sekundi\0A\00"
@M_PI = global i32 0
@.str.1 = [21 x i8] c"%5.2f\09%3d\09 %2d\09 %2d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
store float 0x3F947AE140000000, float* %2
br label %8
8: ; preds = %52, %0
%9 = load float, float* %2
%10 = fpext float %9 to double
%11 = fcmp ole double %10, 8.000000e-01
br i1 %11, label %12, label %57
12: ; preds = %8
%13 = load i32, i32* @M_PI
%14 = sdiv i32 180, %13
%15 = load float, float* %2
%16 = load float, float* %2
%17 = load float, float* %2
%18 = fneg float %16
%19 = call float @llvm.fmuladd.f32(float %18, float %17, float 1.000000e+00)
%20 = fptosi float %19 to i32
%21 = call float @sqrt(i32 %20)
%22 = fdiv float %15, %21
%23 = call i32 @atan(float %22)
%24 = mul nsw i32 %14, %23
%25 = sitofp i32 %24 to float
store float %25, float* %3
%26 = load float, float* %3
%27 = fptosi float %26 to i32
store i32 %27, i32* %4
%28 = load float, float* %3
%29 = load i32, i32* %4
%30 = sitofp i32 %29 to float
%31 = fsub float %28, %30
%32 = fmul float %31, 6.000000e+01
%33 = fptosi float %32 to i32
store i32 %33, i32* %5
%34 = load float, float* %3
%35 = load i32, i32* %4
%36 = sitofp i32 %35 to float
%37 = fsub float %34, %36
%38 = load i32, i32* %5
%39 = sitofp i32 %38 to float
%40 = fneg float %39
%41 = call float @llvm.fmuladd.f32(float %37, float 6.000000e+01, float %40)
%42 = fmul float %41, 6.000000e+01
%43 = fpext float %42 to double
%44 = fadd double %43, 5.000000e-01
%45 = fptosi double %44 to i32
store i32 %45, i32* %6
%46 = load float, float* %2
%47 = fpext float %46 to double
%48 = load i32, i32* %4
%49 = load i32, i32* %5
%50 = load i32, i32* %6
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), double %47, i32 %48, i32 %49, i32 %50)
br label %52
52: ; preds = %12
%53 = load float, float* %2
%54 = fpext float %53 to double
%55 = fadd double %54, 1.000000e-02
%56 = fptrunc double %55 to float
store float %56, float* %2
br label %8
57: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@M_PI = global i32 0
@.str.1 = [21 x i8] c"%5.2f\09%3d\09 %2d\09 %2d\0A\00"
@str = [27 x i8] c" x\09stepeni\09minuti\09sekundi\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
%3 = phi double [ 0x3F947AE140000000, %0 ], [ %30, %2 ]
%4 = phi float [ 0x3F947AE140000000, %0 ], [ %29, %2 ]
%5 = load i32, i32* @M_PI
%6 = sdiv i32 180, %5
%7 = fneg float %4
%8 = tail call float @llvm.fmuladd.f32(float %7, float %4, float 1.000000e+00)
%9 = fptosi float %8 to i32
%10 = tail call float @sqrt(i32 %9)
%11 = fdiv float %4, %10
%12 = tail call i32 @atan(float %11)
%13 = mul nsw i32 %12, %6
%14 = sitofp i32 %13 to float
%15 = fptosi float %14 to i32
%16 = sitofp i32 %15 to float
%17 = fsub float %14, %16
%18 = fmul float %17, 6.000000e+01
%19 = fptosi float %18 to i32
%20 = sitofp i32 %19 to float
%21 = fneg float %20
%22 = tail call float @llvm.fmuladd.f32(float %17, float 6.000000e+01, float %21)
%23 = fmul float %22, 6.000000e+01
%24 = fpext float %23 to double
%25 = fadd double %24, 5.000000e-01
%26 = fptosi double %25 to i32
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), double %3, i32 %15, i32 %19, i32 %26)
%28 = fadd double %3, 1.000000e-02
%29 = fptrunc double %28 to float
%30 = fpext float %29 to double
%31 = fcmp ugt double %30, 8.000000e-01
br i1 %31, label %32, label %2
32: ; preds = %2
ret i32 0
}