#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 */
double pow(double, double);
double two_single(int a, int b, double theta) {
  if (a == 0 && b == 0)
    return 1.0 / (1.0 + theta);
  else
    return pow(theta / (1.0 + theta), (double)(a + b)) / (1.0 + theta);
}


x86 assembly (clang, -O0):
<two_single>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    115a <two_single+0x4a>
cmpl   $0x0,-0x10(%rbp)
jne    115a <two_single+0x4a>
movsd  0xec1(%rip),%xmm1
addsd  -0x18(%rbp),%xmm1
movsd  0xeb4(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1195 <two_single+0x85>
movsd  -0x18(%rbp),%xmm0
movsd  0xe99(%rip),%xmm1
addsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
cvtsi2sd %eax,%xmm1
call   1030 <pow@plt>
movsd  0xe79(%rip),%xmm1
addsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<two_single>:
push   %rax
mov    %esi,%eax
or     %edi,%eax
movsd  0xee3(%rip),%xmm1
movapd %xmm0,%xmm2
addsd  %xmm1,%xmm2
je     1147 <two_single+0x37>
divsd  %xmm2,%xmm0
add    %edi,%esi
xorps  %xmm1,%xmm1
cvtsi2sd %esi,%xmm1
movsd  %xmm2,(%rsp)
call   1030 <pow@plt>
movsd  (%rsp),%xmm2
movapd %xmm0,%xmm1
divsd  %xmm2,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @two_single(i32 %0, i32 %1, double %2) {
%4 = alloca double
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
store i32 %0, i32* %5
store i32 %1, i32* %6
store double %2, double* %7
%8 = load i32, i32* %5
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %17
10: ; preds = %3
%11 = load i32, i32* %6
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %10
%14 = load double, double* %7
%15 = fadd double 1.000000e+00, %14
%16 = fdiv double 1.000000e+00, %15
store double %16, double* %4
br label %30
17: ; preds = %10, %3
%18 = load double, double* %7
%19 = load double, double* %7
%20 = fadd double 1.000000e+00, %19
%21 = fdiv double %18, %20
%22 = load i32, i32* %5
%23 = load i32, i32* %6
%24 = add nsw i32 %22, %23
%25 = sitofp i32 %24 to double
%26 = call double @pow(double %21, double %25)
%27 = load double, double* %7
%28 = fadd double 1.000000e+00, %27
%29 = fdiv double %26, %28
store double %29, double* %4
br label %30
30: ; preds = %17, %13
%31 = load double, double* %4
ret double %31
}

LLVM IR (-O2):
define double @two_single(i32 %0, i32 %1, double %2) {
%4 = or i32 %1, %0
%5 = icmp eq i32 %4, 0
%6 = fadd double %2, 1.000000e+00
br i1 %5, label %12, label %7
7: ; preds = %3
%8 = fdiv double %2, %6
%9 = add nsw i32 %1, %0
%10 = sitofp i32 %9 to double
%11 = tail call double @pow(double %8, double %10)
br label %12
12: ; preds = %3, %7
%13 = phi double [ %11, %7 ], [ 1.000000e+00, %3 ]
%14 = fdiv double %13, %6
ret double %14
}