#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 */
struct cc_context {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cc_init_full(struct cc_context *, unsigned int const,
                                double const, double const, unsigned int,
                                unsigned int);
void cc_init(struct cc_context *ctx, const unsigned int px_in_w,
             const double rd_view_h, const double rd_view_v) {
  unsigned int px_pano_h =
      (unsigned int)((rd_view_h / 1.57079632679489661923) * (double)px_in_w);
  unsigned int px_pano_v =
      (unsigned int)((rd_view_v / 1.57079632679489661923) * (double)px_in_w);
  cc_init_full(ctx, px_in_w, rd_view_h, rd_view_v, px_pano_h, px_pano_v);
}


x86 assembly (clang, -O0):
<cc_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xeca(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0xc(%rbp),%eax
cvtsi2sd %rax,%xmm2
mulsd  %xmm2,%xmm0
cvttsd2si %xmm0,%rax
mov    %eax,-0x24(%rbp)
movsd  -0x20(%rbp),%xmm0
divsd  %xmm1,%xmm0
mov    -0xc(%rbp),%eax
cvtsi2sd %rax,%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
mov    %eax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mov    -0x24(%rbp),%edx
mov    -0x28(%rbp),%ecx
call   1030 <cc_init_full@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cc_init>:
movsd  0xee8(%rip),%xmm2
movapd %xmm0,%xmm3
mov    %esi,%eax
cvtsi2sd %rax,%xmm4
divsd  %xmm2,%xmm3
mulsd  %xmm4,%xmm3
cvttsd2si %xmm3,%rdx
movapd %xmm1,%xmm3
divsd  %xmm2,%xmm3
mulsd  %xmm4,%xmm3
cvttsd2si %xmm3,%rcx
jmp    1030 <cc_init_full@plt>

LLVM IR (-O0):
%struct.cc_context = type { i32 }
define void @cc_init(%struct.cc_context* %0, i32 %1, double %2, double %3) {
%5 = alloca %struct.cc_context*
%6 = alloca i32
%7 = alloca double
%8 = alloca double
%9 = alloca i32
%10 = alloca i32
store %struct.cc_context* %0, %struct.cc_context** %5
store i32 %1, i32* %6
store double %2, double* %7
store double %3, double* %8
%11 = load double, double* %7
%12 = fdiv double %11, 0x3FF921FB54442D18
%13 = load i32, i32* %6
%14 = uitofp i32 %13 to double
%15 = fmul double %12, %14
%16 = fptoui double %15 to i32
store i32 %16, i32* %9
%17 = load double, double* %8
%18 = fdiv double %17, 0x3FF921FB54442D18
%19 = load i32, i32* %6
%20 = uitofp i32 %19 to double
%21 = fmul double %18, %20
%22 = fptoui double %21 to i32
store i32 %22, i32* %10
%23 = load %struct.cc_context*, %struct.cc_context** %5
%24 = load i32, i32* %6
%25 = load double, double* %7
%26 = load double, double* %8
%27 = load i32, i32* %9
%28 = load i32, i32* %10
%29 = call i32 @cc_init_full(%struct.cc_context* %23, i32 %24, double %25, double %26, i32 %27, i32 %28)
ret void
}

LLVM IR (-O2):
%struct.cc_context = type { i32 }
define void @cc_init(%struct.cc_context* %0, i32 %1, double %2, double %3) {
%5 = fdiv double %2, 0x3FF921FB54442D18
%6 = uitofp i32 %1 to double
%7 = fmul double %5, %6
%8 = fptoui double %7 to i32
%9 = fdiv double %3, 0x3FF921FB54442D18
%10 = fmul double %9, %6
%11 = fptoui double %10 to i32
%12 = tail call i32 @cc_init_full(%struct.cc_context* %0, i32 %1, double %2, double %3, i32 %8, i32 %11)
ret void
}