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

/* Variables and functions */
int /*<<< orphan*/ lonlat_from_ijh(double *, struct rpc *, double, double,
                                   double);
int /*<<< orphan*/ utm_from_lonlat_and_zone(double *, double, double, int);
void getxyz(double xyz[3], struct rpc *r, double i, double j, double h,
            int zone) {
  double ll[3];
  lonlat_from_ijh(ll, r, i, j, h);
  utm_from_lonlat_and_zone(xyz, ll[1], ll[0], zone);
  xyz[2] = h;
}


x86 assembly (clang, -O0):
<getxyz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
movsd  %xmm2,-0x28(%rbp)
mov    %edx,-0x2c(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
call   1030 <lonlat_from_ijh@plt>
mov    -0x8(%rbp),%rdi
movsd  -0x48(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
mov    -0x2c(%rbp),%esi
call   1040 <utm_from_lonlat_and_zone@plt>
movsd  -0x28(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getxyz>:
push   %rbp
push   %rbx
sub    $0x28,%rsp
mov    %edx,%ebp
movsd  %xmm2,0x8(%rsp)
mov    %rdi,%rbx
lea    0x10(%rsp),%rdi
call   1030 <lonlat_from_ijh@plt>
movsd  0x10(%rsp),%xmm1
movsd  0x18(%rsp),%xmm0
mov    %rbx,%rdi
mov    %ebp,%esi
call   1040 <utm_from_lonlat_and_zone@plt>
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x10(%rbx)
add    $0x28,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.rpc = type { i32 }
define void @getxyz(double* %0, %struct.rpc* %1, double %2, double %3, double %4, i32 %5) {
%7 = alloca double*
%8 = alloca %struct.rpc*
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca i32
%13 = alloca [3 x double]
store double* %0, double** %7
store %struct.rpc* %1, %struct.rpc** %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store i32 %5, i32* %12
%14 = getelementptr inbounds [3 x double], [3 x double]* %13, i64 0, i64 0
%15 = load %struct.rpc*, %struct.rpc** %8
%16 = load double, double* %9
%17 = load double, double* %10
%18 = load double, double* %11
%19 = call i32 @lonlat_from_ijh(double* %14, %struct.rpc* %15, double %16, double %17, double %18)
%20 = load double*, double** %7
%21 = getelementptr inbounds [3 x double], [3 x double]* %13, i64 0, i64 1
%22 = load double, double* %21
%23 = getelementptr inbounds [3 x double], [3 x double]* %13, i64 0, i64 0
%24 = load double, double* %23
%25 = load i32, i32* %12
%26 = call i32 @utm_from_lonlat_and_zone(double* %20, double %22, double %24, i32 %25)
%27 = load double, double* %11
%28 = load double*, double** %7
%29 = getelementptr inbounds double, double* %28, i64 2
store double %27, double* %29
ret void
}

LLVM IR (-O2):
%struct.rpc = type { i32 }
define void @getxyz(double* %0, %struct.rpc* %1, double %2, double %3, double %4, i32 %5) {
%7 = alloca [3 x double]
%8 = bitcast [3 x double]* %7 to i8*
%9 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%10 = call i32 @lonlat_from_ijh(double* %9, %struct.rpc* %1, double %2, double %3, double %4)
%11 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 1
%12 = load double, double* %11
%13 = load double, double* %9
%14 = call i32 @utm_from_lonlat_and_zone(double* %0, double %12, double %13, i32 %5)
%15 = getelementptr inbounds double, double* %0, i64 2
store double %4, double* %15
ret void
}