#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 */
scalar_t__ RAND_MAX;
int /*<<< orphan*/ printf(char *);
scalar_t__ rand();
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int /*<<< orphan*/ twoStep(float, float);
int main() {
  while (1) {
    srand(time(NULL));
    float a = 1.0;
    float rALT = (float)rand() / (float)RAND_MAX / 1.57079;
    float rAZ = (float)rand() / (float)RAND_MAX / 6.28318;
    twoStep(rALT, rAZ);
    printf("Task completed!\n\n\n\n");
    sleep(5);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
movss  0xe89(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1080 <rand@plt>
cvtsi2ss %rax,%xmm0
mov    0x2e49(%rip),%rax
cvtsi2ssq (%rax),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x2c(%rbp)
cvtss2sd %xmm0,%xmm0
movsd  0xe4f(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
mov    $0x0,%al
call   1080 <rand@plt>
cvtsi2ss %rax,%xmm0
mov    0x2e0a(%rip),%rax
cvtsi2ssq (%rax),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
cvtss2sd %xmm0,%xmm0
movsd  0xe08(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
call   1060 <twoStep@plt>
lea    0xdf4(%rip),%rdi
call   1030 <printf@plt>
mov    $0x5,%edi
call   1070 <sleep@plt>
jmp    116f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2e7d(%rip),%rbx
lea    0xe9e(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
xor    %eax,%eax
call   1080 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
xorps  %xmm1,%xmm1
cvtsi2ssq (%rbx),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
divsd  0xe4b(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x4(%rsp)
xor    %eax,%eax
call   1080 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
xorps  %xmm1,%xmm1
cvtsi2ssq (%rbx),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
divsd  0xe22(%rip),%xmm0
xorps  %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm1
movss  0x4(%rsp),%xmm0
call   1060 <twoStep@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    $0x5,%edi
call   1070 <sleep@plt>
jmp    1180 <main+0x20>

LLVM IR (-O0):
@RAND_MAX = global i64 0
@.str = [20 x i8] c"Task completed!\0A\0A\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
store i32 0, i32* %1
br label %5
5: ; preds = %0, %5
%6 = call i32 @time(i32* null)
%7 = call i32 @srand(i32 %6)
store float 1.000000e+00, float* %2
%8 = call i64 (...) @rand()
%9 = sitofp i64 %8 to float
%10 = load i64, i64* @RAND_MAX
%11 = sitofp i64 %10 to float
%12 = fdiv float %9, %11
%13 = fpext float %12 to double
%14 = fdiv double %13, 1.570790e+00
%15 = fptrunc double %14 to float
store float %15, float* %3
%16 = call i64 (...) @rand()
%17 = sitofp i64 %16 to float
%18 = load i64, i64* @RAND_MAX
%19 = sitofp i64 %18 to float
%20 = fdiv float %17, %19
%21 = fpext float %20 to double
%22 = fdiv double %21, 6.283180e+00
%23 = fptrunc double %22 to float
store float %23, float* %4
%24 = load float, float* %3
%25 = load float, float* %4
%26 = call i32 @twoStep(float %24, float %25)
%27 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%28 = call i32 @sleep(i32 5)
br label %5
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
@str = [19 x i8] c"Task completed!\0A\0A\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @time(i32* null)
%3 = tail call i32 @srand(i32 %2)
%4 = tail call i64 (...) @rand()
%5 = sitofp i64 %4 to float
%6 = load i64, i64* @RAND_MAX
%7 = sitofp i64 %6 to float
%8 = fdiv float %5, %7
%9 = fpext float %8 to double
%10 = fdiv double %9, 1.570790e+00
%11 = fptrunc double %10 to float
%12 = tail call i64 (...) @rand()
%13 = sitofp i64 %12 to float
%14 = load i64, i64* @RAND_MAX
%15 = sitofp i64 %14 to float
%16 = fdiv float %13, %15
%17 = fpext float %16 to double
%18 = fdiv double %17, 6.283180e+00
%19 = fptrunc double %18 to float
%20 = tail call i32 @twoStep(float %11, float %19)
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%22 = tail call i32 @sleep(i32 5)
br label %1
}