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

/* Variables and functions */
int /*<<< orphan*/ add_radiation_pressure_large_n(struct CARandCtx *,
                                                  double const *, double, int,
                                                  double *);
int /*<<< orphan*/ add_radiation_pressure_small_n(struct CARandCtx *,
                                                  double const *, double, int,
                                                  double *);
int /*<<< orphan*/ ca_rand_poisson(struct CARandCtx *, int, double, int *);
void add_radiation_pressure_one(struct CARandCtx *ctx, const double *hbar_k,
                                double hbar_k_nrm, double nbar, double *f) {
  int actual_n;
  ca_rand_poisson(ctx, 1, nbar, &actual_n);
  if (actual_n > 128) {
    add_radiation_pressure_large_n(ctx, hbar_k, hbar_k_nrm, actual_n, f);
  } else {
    add_radiation_pressure_small_n(ctx, hbar_k, hbar_k_nrm, actual_n, f);
  }
}


x86 assembly (clang, -O0):
<add_radiation_pressure_one>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
movsd  -0x20(%rbp),%xmm0
mov    $0x1,%esi
lea    -0x2c(%rbp),%rdx
call   1030 <ca_rand_poisson@plt>
cmpl   $0x80,-0x2c(%rbp)
jle    1190 <add_radiation_pressure_one+0x60>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movsd  -0x18(%rbp),%xmm0
mov    -0x2c(%rbp),%edx
mov    -0x28(%rbp),%rcx
call   1040 <add_radiation_pressure_large_n@plt>
jmp    11a9 <add_radiation_pressure_one+0x79>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movsd  -0x18(%rbp),%xmm0
mov    -0x2c(%rbp),%edx
mov    -0x28(%rbp),%rcx
call   1050 <add_radiation_pressure_small_n@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_radiation_pressure_one>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
movsd  %xmm0,0x8(%rsp)
mov    %rsi,%r15
mov    %rdi,%rbx
lea    0x4(%rsp),%rdx
mov    $0x1,%esi
movaps %xmm1,%xmm0
call   1030 <ca_rand_poisson@plt>
mov    0x4(%rsp),%edx
mov    %rbx,%rdi
mov    %r15,%rsi
cmp    $0x81,%edx
jl     117c <add_radiation_pressure_one+0x4c>
movsd  0x8(%rsp),%xmm0
mov    %r14,%rcx
call   1040 <add_radiation_pressure_large_n@plt>
jmp    118a <add_radiation_pressure_one+0x5a>
movsd  0x8(%rsp),%xmm0
mov    %r14,%rcx
call   1050 <add_radiation_pressure_small_n@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.CARandCtx = type { i32 }
define void @add_radiation_pressure_one(%struct.CARandCtx* %0, double* %1, double %2, double %3, double* %4) {
%6 = alloca %struct.CARandCtx*
%7 = alloca double*
%8 = alloca double
%9 = alloca double
%10 = alloca double*
%11 = alloca i32
store %struct.CARandCtx* %0, %struct.CARandCtx** %6
store double* %1, double** %7
store double %2, double* %8
store double %3, double* %9
store double* %4, double** %10
%12 = load %struct.CARandCtx*, %struct.CARandCtx** %6
%13 = load double, double* %9
%14 = call i32 @ca_rand_poisson(%struct.CARandCtx* %12, i32 1, double %13, i32* %11)
%15 = load i32, i32* %11
%16 = icmp sgt i32 %15, 128
br i1 %16, label %17, label %24
17: ; preds = %5
%18 = load %struct.CARandCtx*, %struct.CARandCtx** %6
%19 = load double*, double** %7
%20 = load double, double* %8
%21 = load i32, i32* %11
%22 = load double*, double** %10
%23 = call i32 @add_radiation_pressure_large_n(%struct.CARandCtx* %18, double* %19, double %20, i32 %21, double* %22)
br label %31
24: ; preds = %5
%25 = load %struct.CARandCtx*, %struct.CARandCtx** %6
%26 = load double*, double** %7
%27 = load double, double* %8
%28 = load i32, i32* %11
%29 = load double*, double** %10
%30 = call i32 @add_radiation_pressure_small_n(%struct.CARandCtx* %25, double* %26, double %27, i32 %28, double* %29)
br label %31
31: ; preds = %24, %17
ret void
}

LLVM IR (-O2):
%struct.CARandCtx = type { i32 }
define void @add_radiation_pressure_one(%struct.CARandCtx* %0, double* %1, double %2, double %3, double* %4) {
%6 = alloca i32
%7 = bitcast i32* %6 to i8*
%8 = call i32 @ca_rand_poisson(%struct.CARandCtx* %0, i32 1, double %3, i32* %6)
%9 = load i32, i32* %6
%10 = icmp sgt i32 %9, 128
br i1 %10, label %11, label %13
11: ; preds = %5
%12 = call i32 @add_radiation_pressure_large_n(%struct.CARandCtx* %0, double* %1, double %2, i32 %9, double* %4)
br label %15
13: ; preds = %5
%14 = call i32 @add_radiation_pressure_small_n(%struct.CARandCtx* %0, double* %1, double %2, i32 %9, double* %4)
br label %15
15: ; preds = %13, %11
ret void
}