#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 atan2(float, float);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *, float *);
int main(void) {
  float a, b, output;
  printf("Input x,y\n");
  scanf("%f %f", &a, &b);
  output = atan2(b, a) * 180 / M_PI;
  if (output < 0)
    output += 360;
  printf("%f\n", output);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xebb(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1050 <scanf@plt>
movss  -0xc(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <atan2@plt>
imul   $0xb4,%eax,%eax
mov    0x2e6b(%rip),%rcx
cltd
idivl  (%rcx)
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    11a8 <main+0x78>
movss  0xe62(%rip),%xmm0
addss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe5d(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec6(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb0(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1060 <scanf@plt>
movss  (%rsp),%xmm0
movss  0x4(%rsp),%xmm1
call   1040 <atan2@plt>
imul   $0xb4,%eax,%eax
mov    0x2e6a(%rip),%rcx
cltd
idivl  (%rcx)
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
test   %eax,%eax
jns    1194 <main+0x54>
addss  0xe6c(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe6b(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"Input x,y\0A\00"
@.str.1 = [6 x i8] c"%f %f\00"
@M_PI = global i32 0
@.str.2 = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), float* %2, float* %3)
%7 = load float, float* %3
%8 = load float, float* %2
%9 = call i32 @atan2(float %7, float %8)
%10 = mul nsw i32 %9, 180
%11 = load i32, i32* @M_PI
%12 = sdiv i32 %10, %11
%13 = sitofp i32 %12 to float
store float %13, float* %4
%14 = load float, float* %4
%15 = fcmp olt float %14, 0.000000e+00
br i1 %15, label %16, label %19
16: ; preds = %0
%17 = load float, float* %4
%18 = fadd float %17, 3.600000e+02
store float %18, float* %4
br label %19
19: ; preds = %16, %0
%20 = load float, float* %4
%21 = fpext float %20 to double
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double %21)
%23 = load i32, i32* %1
ret i32 %23
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"%f %f\00"
@M_PI = global i32 0
@.str.2 = [4 x i8] c"%f\0A\00"
@str = [10 x i8] c"Input x,y\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = bitcast float* %1 to i8*
%4 = bitcast float* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), float* %1, float* %2)
%7 = load float, float* %2
%8 = load float, float* %1
%9 = call i32 @atan2(float %7, float %8)
%10 = mul nsw i32 %9, 180
%11 = load i32, i32* @M_PI
%12 = sdiv i32 %10, %11
%13 = sitofp i32 %12 to float
%14 = icmp slt i32 %12, 0
%15 = fadd float %13, 3.600000e+02
%16 = select i1 %14, float %15, float %13
%17 = fpext float %16 to double
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double %17)
ret i32 0
}