#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 */
scalar_t__ c(int);
scalar_t__ d(int);
scalar_t__ h(int);
int pow(scalar_t__, int);
scalar_t__ t2_cos_theta(int, int, int);
double t2_g(int i, int j, int k) {
  return 1 + pow(c(i), 2) / pow(d(i), 2) -
         pow(c(i), 2) / (pow(d(i), 2) + pow((h(i) - t2_cos_theta(i, j, k)), 2));
}


x86 assembly (clang, -O0):
<t2_g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <c@plt>
mov    %rax,%rdi
mov    $0x2,%esi
call   1060 <pow@plt>
mov    %eax,-0x24(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <d@plt>
mov    %rax,%rdi
mov    $0x2,%esi
call   1060 <pow@plt>
mov    %eax,%ecx
mov    -0x24(%rbp),%eax
cltd
idiv   %ecx
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <c@plt>
mov    %rax,%rdi
mov    $0x2,%esi
call   1060 <pow@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <d@plt>
mov    %rax,%rdi
mov    $0x2,%esi
call   1060 <pow@plt>
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <h@plt>
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1070 <t2_cos_theta@plt>
mov    -0x20(%rbp),%rdi
sub    %rax,%rdi
mov    $0x2,%esi
call   1060 <pow@plt>
mov    -0x18(%rbp),%ecx
mov    %eax,%edx
mov    -0x14(%rbp),%eax
add    %edx,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t2_g>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %edx,0x4(%rsp)
mov    %esi,%r15d
mov    %edi,%ebx
call   1050 <c@plt>
mov    %rax,%rdi
mov    $0x2,%esi
call   1060 <pow@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <d@plt>
mov    %rax,%rdi
mov    $0x2,%esi
call   1060 <pow@plt>
mov    %eax,%ecx
mov    %ebp,%eax
cltd
idiv   %ecx
mov    %eax,%ebp
mov    %ebx,%edi
call   1050 <c@plt>
mov    %rax,%rdi
mov    $0x2,%esi
call   1060 <pow@plt>
mov    %eax,%r12d
mov    %ebx,%edi
call   1030 <d@plt>
mov    %rax,%rdi
mov    $0x2,%esi
call   1060 <pow@plt>
mov    %eax,%r13d
mov    %ebx,%edi
call   1040 <h@plt>
mov    %rax,%r14
mov    %ebx,%edi
mov    %r15d,%esi
mov    0x4(%rsp),%edx
call   1070 <t2_cos_theta@plt>
sub    %rax,%r14
mov    %r14,%rdi
mov    $0x2,%esi
call   1060 <pow@plt>
mov    %eax,%ecx
add    %r13d,%ecx
mov    %r12d,%eax
cltd
idiv   %ecx
sub    %eax,%ebp
add    $0x1,%ebp
cvtsi2sd %ebp,%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define double @t2_g(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = call i64 @c(i32 %7)
%9 = call i32 @pow(i64 %8, i32 2)
%10 = load i32, i32* %4
%11 = call i64 @d(i32 %10)
%12 = call i32 @pow(i64 %11, i32 2)
%13 = sdiv i32 %9, %12
%14 = add nsw i32 1, %13
%15 = load i32, i32* %4
%16 = call i64 @c(i32 %15)
%17 = call i32 @pow(i64 %16, i32 2)
%18 = load i32, i32* %4
%19 = call i64 @d(i32 %18)
%20 = call i32 @pow(i64 %19, i32 2)
%21 = load i32, i32* %4
%22 = call i64 @h(i32 %21)
%23 = load i32, i32* %4
%24 = load i32, i32* %5
%25 = load i32, i32* %6
%26 = call i64 @t2_cos_theta(i32 %23, i32 %24, i32 %25)
%27 = sub nsw i64 %22, %26
%28 = call i32 @pow(i64 %27, i32 2)
%29 = add nsw i32 %20, %28
%30 = sdiv i32 %17, %29
%31 = sub nsw i32 %14, %30
%32 = sitofp i32 %31 to double
ret double %32
}

LLVM IR (-O2):
define double @t2_g(i32 %0, i32 %1, i32 %2) {
%4 = tail call i64 @c(i32 %0)
%5 = tail call i32 @pow(i64 %4, i32 2)
%6 = tail call i64 @d(i32 %0)
%7 = tail call i32 @pow(i64 %6, i32 2)
%8 = sdiv i32 %5, %7
%9 = add nsw i32 %8, 1
%10 = tail call i64 @c(i32 %0)
%11 = tail call i32 @pow(i64 %10, i32 2)
%12 = tail call i64 @d(i32 %0)
%13 = tail call i32 @pow(i64 %12, i32 2)
%14 = tail call i64 @h(i32 %0)
%15 = tail call i64 @t2_cos_theta(i32 %0, i32 %1, i32 %2)
%16 = sub nsw i64 %14, %15
%17 = tail call i32 @pow(i64 %16, i32 2)
%18 = add nsw i32 %17, %13
%19 = sdiv i32 %11, %18
%20 = sub i32 %9, %19
%21 = sitofp i32 %20 to double
ret double %21
}