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

/* Variables and functions */
double NAN;
int dhubble_deta(int);
int hubble_a(int);
double CosmosOmega(struct Cosmos *this, int a, int b) {
  if (a == 0) {
    if (b == 0) {
      return 1.;
    } else if (b == 1) {
      return -1.;
    }
  } else if (a == 1) {
    if (b == 0) {
      return -3. / 2.;
    } else if (b == 1) {
      return 2. + dhubble_deta(a) / hubble_a(a);
    }
  }
  return NAN;
}


x86 assembly (clang, -O0):
<CosmosOmega>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    117e <CosmosOmega+0x5e>
cmpl   $0x0,-0x18(%rbp)
jne    1158 <CosmosOmega+0x38>
movsd  0xeca(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1202 <CosmosOmega+0xe2>
cmpl   $0x1,-0x18(%rbp)
jne    1174 <CosmosOmega+0x54>
movsd  0xea6(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1202 <CosmosOmega+0xe2>
jmp    1179 <CosmosOmega+0x59>
jmp    11f2 <CosmosOmega+0xd2>
cmpl   $0x1,-0x14(%rbp)
jne    11ed <CosmosOmega+0xcd>
cmpl   $0x0,-0x18(%rbp)
jne    11a4 <CosmosOmega+0x84>
movsd  0xe6e(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1202 <CosmosOmega+0xe2>
cmpl   $0x1,-0x18(%rbp)
jne    11e3 <CosmosOmega+0xc3>
mov    -0x14(%rbp),%edi
call   1030 <dhubble_deta@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <hubble_a@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm1
movsd  0xe2b(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1202 <CosmosOmega+0xe2>
jmp    11e8 <CosmosOmega+0xc8>
jmp    11ed <CosmosOmega+0xcd>
jmp    11f2 <CosmosOmega+0xd2>
mov    0x2dff(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CosmosOmega>:
push   %rbx
cmp    $0x1,%esi
je     113d <CosmosOmega+0x1d>
test   %esi,%esi
jne    1171 <CosmosOmega+0x51>
test   %edx,%edx
je     117e <CosmosOmega+0x5e>
cmp    $0x1,%edx
jne    1171 <CosmosOmega+0x51>
movsd  0xedd(%rip),%xmm0
pop    %rbx
ret
test   %edx,%edx
je     1188 <CosmosOmega+0x68>
cmp    $0x1,%edx
jne    1171 <CosmosOmega+0x51>
mov    $0x1,%edi
call   1030 <dhubble_deta@plt>
mov    %eax,%ebx
mov    $0x1,%edi
call   1040 <hubble_a@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
addsd  0xe99(%rip),%xmm0
pop    %rbx
ret
mov    0x2e80(%rip),%rax
movsd  (%rax),%xmm0
pop    %rbx
ret
movsd  0xe8a(%rip),%xmm0
pop    %rbx
ret
movsd  0xe70(%rip),%xmm0
pop    %rbx
ret

LLVM IR (-O0):
%struct.Cosmos = type { i32 }
@NAN = global double 0.000000e+00
define double @CosmosOmega(%struct.Cosmos* %0, i32 %1, i32 %2) {
%4 = alloca double
%5 = alloca %struct.Cosmos*
%6 = alloca i32
%7 = alloca i32
store %struct.Cosmos* %0, %struct.Cosmos** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %6
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %20
10: ; preds = %3
%11 = load i32, i32* %7
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %10
store double 1.000000e+00, double* %4
br label %43
14: ; preds = %10
%15 = load i32, i32* %7
%16 = icmp eq i32 %15, 1
br i1 %16, label %17, label %18
17: ; preds = %14
store double -1.000000e+00, double* %4
br label %43
18: ; preds = %14
br label %19
19: ; preds = %18
br label %41
20: ; preds = %3
%21 = load i32, i32* %6
%22 = icmp eq i32 %21, 1
br i1 %22, label %23, label %40
23: ; preds = %20
%24 = load i32, i32* %7
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %27
26: ; preds = %23
store double -1.500000e+00, double* %4
br label %43
27: ; preds = %23
%28 = load i32, i32* %7
%29 = icmp eq i32 %28, 1
br i1 %29, label %30, label %38
30: ; preds = %27
%31 = load i32, i32* %6
%32 = call i32 @dhubble_deta(i32 %31)
%33 = load i32, i32* %6
%34 = call i32 @hubble_a(i32 %33)
%35 = sdiv i32 %32, %34
%36 = sitofp i32 %35 to double
%37 = fadd double 2.000000e+00, %36
store double %37, double* %4
br label %43
38: ; preds = %27
br label %39
39: ; preds = %38
br label %40
40: ; preds = %39, %20
br label %41
41: ; preds = %40, %19
%42 = load double, double* @NAN
store double %42, double* %4
br label %43
43: ; preds = %41, %30, %26, %17, %13
%44 = load double, double* %4
ret double %44
}

LLVM IR (-O2):
%struct.Cosmos = type { i32 }
@NAN = global double 0.000000e+00
define double @CosmosOmega(%struct.Cosmos* nocapture readnone %0, i32 %1, i32 %2) {
switch i32 %1, label %13 [
i32 0, label %4
i32 1, label %6
]
4: ; preds = %3
switch i32 %2, label %13 [
i32 0, label %15
i32 1, label %5
]
5: ; preds = %4
br label %15
6: ; preds = %3
switch i32 %2, label %13 [
i32 0, label %15
i32 1, label %7
]
7: ; preds = %6
%8 = tail call i32 @dhubble_deta(i32 1)
%9 = tail call i32 @hubble_a(i32 1)
%10 = sdiv i32 %8, %9
%11 = sitofp i32 %10 to double
%12 = fadd double %11, 2.000000e+00
br label %15
13: ; preds = %6, %3, %4
%14 = load double, double* @NAN
br label %15
15: ; preds = %6, %4, %13, %7, %5
%16 = phi double [ -1.000000e+00, %5 ], [ %14, %13 ], [ %12, %7 ], [ 1.000000e+00, %4 ], [ -1.500000e+00, %6 ]
ret double %16
}