#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*/ KtoP(float *, float *, float, float);
int /*<<< orphan*/ PtoK(float *, float *, float, float);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *, float *);
main() {
  float u, v, x, y;
  printf("enter u, v\n");
  scanf("%f %f", &u, &v);
  PtoK(&x, &y, u, v);
  printf("x, y: %f %f\n", x, y);
  KtoP(&u, &v, x, y);
  printf("u, v: %f %f\n", u, v);
  PtoK(&x, &y, u, v);
  printf("x, y: %f %f\n", x, y);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xeaf(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1060 <scanf@plt>
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
lea    -0xc(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <PtoK@plt>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x10(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe78(%rip),%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <KtoP@plt>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe4e(%rip),%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
lea    -0xc(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <PtoK@plt>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x10(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe0a(%rip),%rdi
mov    $0x2,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xebc(%rip),%rdi
call   1030 <puts@plt>
lea    0xe90(%rip),%rdi
lea    0xc(%rsp),%rbx
lea    0x8(%rsp),%r13
mov    %rbx,%rsi
mov    %r13,%rdx
call   1070 <scanf@plt>
movss  0xc(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
lea    0x4(%rsp),%r15
mov    %rsp,%r14
mov    %r15,%rdi
mov    %r14,%rsi
call   1050 <PtoK@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  (%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe48(%rip),%r12
mov    %r12,%rdi
mov    $0x2,%al
call   1060 <printf@plt>
movss  0x4(%rsp),%xmm0
movss  (%rsp),%xmm1
mov    %rbx,%rdi
mov    %r13,%rsi
call   1040 <KtoP@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0x8(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe1a(%rip),%rdi
mov    $0x2,%al
call   1060 <printf@plt>
movss  0xc(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
mov    %r15,%rdi
mov    %r14,%rsi
call   1050 <PtoK@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  (%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
mov    %r12,%rdi
mov    $0x2,%al
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [12 x i8] c"enter u, v\0A\00"
@.str.1 = [6 x i8] c"%f %f\00"
@.str.2 = [13 x i8] c"x, y: %f %f\0A\00"
@.str.3 = [13 x i8] c"u, v: %f %f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 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* %1
%8 = load float, float* %2
%9 = call i32 @PtoK(float* %3, float* %4, float %7, float %8)
%10 = load float, float* %3
%11 = fpext float %10 to double
%12 = load float, float* %4
%13 = fpext float %12 to double
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), double %11, double %13)
%15 = load float, float* %3
%16 = load float, float* %4
%17 = call i32 @KtoP(float* %1, float* %2, float %15, float %16)
%18 = load float, float* %1
%19 = fpext float %18 to double
%20 = load float, float* %2
%21 = fpext float %20 to double
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), double %19, double %21)
%23 = load float, float* %1
%24 = load float, float* %2
%25 = call i32 @PtoK(float* %3, float* %4, float %23, float %24)
%26 = load float, float* %3
%27 = fpext float %26 to double
%28 = load float, float* %4
%29 = fpext float %28 to double
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), double %27, double %29)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"%f %f\00"
@.str.2 = [13 x i8] c"x, y: %f %f\0A\00"
@.str.3 = [13 x i8] c"u, v: %f %f\0A\00"
@str = [11 x i8] c"enter u, v\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = bitcast float* %1 to i8*
%6 = bitcast float* %2 to i8*
%7 = bitcast float* %3 to i8*
%8 = bitcast float* %4 to i8*
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), float* %1, float* %2)
%11 = load float, float* %1
%12 = load float, float* %2
%13 = call i32 @PtoK(float* %3, float* %4, float %11, float %12)
%14 = load float, float* %3
%15 = fpext float %14 to double
%16 = load float, float* %4
%17 = fpext float %16 to double
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), double %15, double %17)
%19 = load float, float* %3
%20 = load float, float* %4
%21 = call i32 @KtoP(float* %1, float* %2, float %19, float %20)
%22 = load float, float* %1
%23 = fpext float %22 to double
%24 = load float, float* %2
%25 = fpext float %24 to double
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), double %23, double %25)
%27 = load float, float* %1
%28 = load float, float* %2
%29 = call i32 @PtoK(float* %3, float* %4, float %27, float %28)
%30 = load float, float* %3
%31 = fpext float %30 to double
%32 = load float, float* %4
%33 = fpext float %32 to double
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), double %31, double %33)
ret i32 0
}