#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 datum {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cartesianToPolar(double *, double *, double *,
                                    struct datum *);
int /*<<< orphan*/ helmertTransform(double *, double *, double *,
                                    struct datum *, struct datum *);
int /*<<< orphan*/ polarToCartesian(double *, double *, double *,
                                    struct datum *);
void convertDatum(double *x, double *y, double *z, struct datum *fromDatum,
                  struct datum *todatum) {
  polarToCartesian(x, y, z, fromDatum);
  helmertTransform(x, y, z, fromDatum, todatum);
  cartesianToPolar(x, y, z, todatum);
}


x86 assembly (clang, -O0):
<convertDatum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1050 <polarToCartesian@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <helmertTransform@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x28(%rbp),%rcx
call   1040 <cartesianToPolar@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convertDatum>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %r8,%r14
mov    %rcx,%r15
mov    %rdx,%r12
mov    %rsi,%r13
mov    %rdi,%rbx
call   1050 <polarToCartesian@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %r12,%rdx
mov    %r15,%rcx
mov    %r14,%r8
call   1030 <helmertTransform@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %r12,%rdx
mov    %r14,%rcx
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
jmp    1040 <cartesianToPolar@plt>

LLVM IR (-O0):
%struct.datum = type { i32 }
define void @convertDatum(double* %0, double* %1, double* %2, %struct.datum* %3, %struct.datum* %4) {
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
%9 = alloca %struct.datum*
%10 = alloca %struct.datum*
store double* %0, double** %6
store double* %1, double** %7
store double* %2, double** %8
store %struct.datum* %3, %struct.datum** %9
store %struct.datum* %4, %struct.datum** %10
%11 = load double*, double** %6
%12 = load double*, double** %7
%13 = load double*, double** %8
%14 = load %struct.datum*, %struct.datum** %9
%15 = call i32 @polarToCartesian(double* %11, double* %12, double* %13, %struct.datum* %14)
%16 = load double*, double** %6
%17 = load double*, double** %7
%18 = load double*, double** %8
%19 = load %struct.datum*, %struct.datum** %9
%20 = load %struct.datum*, %struct.datum** %10
%21 = call i32 @helmertTransform(double* %16, double* %17, double* %18, %struct.datum* %19, %struct.datum* %20)
%22 = load double*, double** %6
%23 = load double*, double** %7
%24 = load double*, double** %8
%25 = load %struct.datum*, %struct.datum** %10
%26 = call i32 @cartesianToPolar(double* %22, double* %23, double* %24, %struct.datum* %25)
ret void
}

LLVM IR (-O2):
%struct.datum = type { i32 }
define void @convertDatum(double* %0, double* %1, double* %2, %struct.datum* %3, %struct.datum* %4) {
%6 = tail call i32 @polarToCartesian(double* %0, double* %1, double* %2, %struct.datum* %3)
%7 = tail call i32 @helmertTransform(double* %0, double* %1, double* %2, %struct.datum* %3, %struct.datum* %4)
%8 = tail call i32 @cartesianToPolar(double* %0, double* %1, double* %2, %struct.datum* %4)
ret void
}