#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 */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, ...);
float sqrt(float);
int /*<<< orphan*/ sscanf(char *, char *, ...);
int main(int argc, char *argv[]) {
  int npix_lambda;
  int npix_spat;
  int npix;
  int n_read;
  int n_bin;
  float t;
  float wfpcflux;
  float sens;
  float slit_width;
  float cs;
  float bsky;
  float sn;
  char line[1000];
  printf("Enter WF/PC-2 flux in ergs/sec/cm^2/Ang/arcsec^2:  ");
  gets(line);
  sscanf(line, "%f", &wfpcflux);
  printf("Enter STIS slit width in arcsec:  ");
  gets(line);
  sscanf(line, "%f", &slit_width);
  printf("Enter number of CCD reads:  ");
  gets(line);
  sscanf(line, "%d", &n_read);
  printf("Enter number of spectral pixels in a resolution element:  ");
  gets(line);
  sscanf(line, "%d", &npix_lambda);
  printf("Enter number of spatial pixels in a resolution element:  ");
  gets(line);
  sscanf(line, "%d", &npix_spat);
  printf("Enter binning:  ");
  gets(line);
  sscanf(line, "%d", &n_bin);
  printf("Enter exposure time in sec:  ");
  gets(line);
  sscanf(line, "%f", &t);
  npix = npix_lambda * npix_spat;
  sens = 9.6e14 * 0.05 * slit_width;
  cs = wfpcflux * sens * npix;
  bsky = 1.0e-17 * sens;
  sn = cs * t /
       sqrt(cs * t + (bsky + 0.007) * npix * t +
            npix * n_read * 4.0 * 4.0 / n_bin);
  printf("\nFor this observation the parameters are:\n");
  printf("  WF/PC-2 Flux      = %g erg/sec/cm^2/Ang/arcsec^2\n", wfpcflux);
  printf("  Sensitivity       = %g\n\n", sens);
  printf("So in one resolution element of %d x %d pixels:\n", npix_lambda,
         npix_spat);
  printf("  Source counts     = %g cts\n", cs * t);
  printf("  Sky counts        = %g cts\n", bsky * npix * t);
  printf("  Dark counts       = %g cts\n", 0.007 * npix * t);
  printf("  Read noise counts = %g cts\n\n", npix * n_read * 4.0 * 4.0 / n_bin);
  printf("Which gives a S/N of %6.2f:1 in %6.0f sec\n", sn, t);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x440,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x430(%rbp),%rdi
call   1040 <gets@plt>
lea    -0x430(%rbp),%rdi
lea    0xed3(%rip),%rsi
lea    -0x2c(%rbp),%rdx
mov    $0x0,%al
call   1050 <sscanf@plt>
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x430(%rbp),%rdi
call   1040 <gets@plt>
lea    -0x430(%rbp),%rdi
lea    0xea0(%rip),%rsi
lea    -0x34(%rbp),%rdx
mov    $0x0,%al
call   1050 <sscanf@plt>
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x430(%rbp),%rdi
call   1040 <gets@plt>
lea    -0x430(%rbp),%rdi
lea    0xeb0(%rip),%rsi
lea    -0x20(%rbp),%rdx
mov    $0x0,%al
call   1050 <sscanf@plt>
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x430(%rbp),%rdi
call   1040 <gets@plt>
lea    -0x430(%rbp),%rdi
lea    0xe7d(%rip),%rsi
lea    -0x14(%rbp),%rdx
mov    $0x0,%al
call   1050 <sscanf@plt>
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x430(%rbp),%rdi
call   1040 <gets@plt>
lea    -0x430(%rbp),%rdi
lea    0xe4a(%rip),%rsi
lea    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1050 <sscanf@plt>
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x430(%rbp),%rdi
call   1040 <gets@plt>
lea    -0x430(%rbp),%rdi
lea    0xe17(%rip),%rsi
lea    -0x24(%rbp),%rdx
mov    $0x0,%al
call   1050 <sscanf@plt>
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x430(%rbp),%rdi
call   1040 <gets@plt>
lea    -0x430(%rbp),%rdi
lea    0xda1(%rip),%rsi
lea    -0x28(%rbp),%rdx
mov    $0x0,%al
call   1050 <sscanf@plt>
mov    -0x14(%rbp),%eax
imul   -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
movss  -0x34(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xd3f(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x30(%rbp)
movss  -0x2c(%rbp),%xmm0
mulss  -0x30(%rbp),%xmm0
cvtsi2ssl -0x1c(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x38(%rbp)
movss  -0x30(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xd01(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x3c(%rbp)
movss  -0x38(%rbp),%xmm0
mulss  -0x28(%rbp),%xmm0
movss  %xmm0,-0x434(%rbp)
ff
movss  -0x38(%rbp),%xmm0
mulss  -0x28(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movss  -0x3c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xcbb(%rip),%xmm2
addsd  %xmm2,%xmm0
cvtsi2sdl -0x1c(%rbp),%xmm2
mulsd  %xmm2,%xmm0
movss  -0x28(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x1c(%rbp),%eax
imul   -0x20(%rbp),%eax
cvtsi2sd %eax,%xmm1
movsd  0xc82(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xc76(%rip),%xmm2
mulsd  %xmm2,%xmm1
cvtsi2sdl -0x24(%rbp),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1060 <sqrt@plt>
movaps %xmm0,%xmm1
movss  -0x434(%rbp),%xmm0
ff
divss  %xmm1,%xmm0
movss  %xmm0,-0x40(%rbp)
lea    0xd7f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x2c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd93(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x30(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdb0(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xdb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x38(%rbp),%xmm0
mulss  -0x28(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdcc(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x3c(%rbp),%xmm0
cvtsi2ssl -0x1c(%rbp),%xmm1
mulss  %xmm1,%xmm0
mulss  -0x28(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdc5(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
cvtsi2sdl -0x1c(%rbp),%xmm1
movsd  0xbb2(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0x28(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
lea    0xdb7(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
imul   -0x20(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xb78(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xb6c(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x24(%rbp),%xmm1
divsd  %xmm1,%xmm0
lea    0xd9b(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x40(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x28(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xd9a(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x440,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x430,%rsp
lea    0xebd(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x40(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <gets@plt>
lea    0xed6(%rip),%r14
lea    0xc(%rsp),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <sscanf@plt>
lea    0xec0(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1050 <gets@plt>
lea    0x2c(%rsp),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <sscanf@plt>
lea    0xebb(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1050 <gets@plt>
lea    0xec2(%rip),%r15
lea    0x14(%rsp),%rdx
mov    %rbx,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1060 <sscanf@plt>
lea    0xeac(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1050 <gets@plt>
lea    0x1c(%rsp),%rdx
mov    %rbx,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1060 <sscanf@plt>
lea    0xebf(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1050 <gets@plt>
lea    0x18(%rsp),%rdx
mov    %rbx,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1060 <sscanf@plt>
lea    0xed1(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1050 <gets@plt>
lea    0x10(%rsp),%rdx
mov    %rbx,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1060 <sscanf@plt>
lea    0xeba(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1050 <gets@plt>
lea    0x4(%rsp),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <sscanf@plt>
mov    0x18(%rsp),%ebx
imul   0x1c(%rsp),%ebx
movss  0x2c(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xd5e(%rip),%xmm0
cvtsd2ss %xmm0,%xmm2
cvtss2sd %xmm2,%xmm1
xorps  %xmm0,%xmm0
cvtsi2ss %ebx,%xmm0
mulss  0xc(%rsp),%xmm2
movss  %xmm0,0x28(%rsp)
mulss  %xmm0,%xmm2
movsd  0xd3f(%rip),%xmm0
movsd  %xmm1,0x30(%rsp)
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm3
movss  0x4(%rsp),%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movss  %xmm2,0x24(%rsp)
mulss  %xmm2,%xmm0
movss  %xmm0,0x8(%rsp)
cvtss2sd %xmm0,%xmm0
movss  %xmm3,0x20(%rsp)
xorps  %xmm2,%xmm2
cvtss2sd %xmm3,%xmm2
addsd  0xd03(%rip),%xmm2
xorps  %xmm3,%xmm3
cvtsi2sd %ebx,%xmm3
movsd  %xmm3,0x38(%rsp)
mulsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    0x14(%rsp),%eax
imul   %ebx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0xcdc(%rip),%xmm2
mulsd  %xmm2,%xmm0
mulsd  %xmm2,%xmm0
xorps  %xmm2,%xmm2
cvtsi2sdl 0x10(%rsp),%xmm2
divsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
xorpd  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1368 <main+0x218>
sqrtss %xmm0,%xmm0
jmp    136d <main+0x21d>
call   1070 <sqrt@plt>
movss  0x8(%rsp),%xmm1
divss  %xmm0,%xmm1
movss  %xmm1,0x8(%rsp)
lea    0xede(%rip),%rdi
call   1030 <puts@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xda4(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xdca(%rip),%rdi
movsd  0x30(%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
mov    0x1c(%rsp),%esi
mov    0x18(%rsp),%edx
lea    0xdc9(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movss  0x24(%rsp),%xmm0
mulss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xddc(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x28(%rsp),%xmm0
mulss  0x20(%rsp),%xmm0
mulss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdd6(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0x38(%rsp),%xmm1
mulsd  0xbf5(%rip),%xmm1
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  %xmm1,%xmm0
lea    0xdca(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
imul   0x14(%rsp),%ebx
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
movsd  0xbcd(%rip),%xmm1
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sdl 0x10(%rsp),%xmm1
divsd  %xmm1,%xmm0
lea    0xdb1(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0x4(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xdae(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x430,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [52 x i8] c"Enter WF/PC-2 flux in ergs/sec/cm^2/Ang/arcsec^2: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [35 x i8] c"Enter STIS slit width in arcsec: \00"
@.str.3 = [29 x i8] c"Enter number of CCD reads: \00"
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [59 x i8] c"Enter number of spectral pixels in a resolution element: \00"
@.str.6 = [58 x i8] c"Enter number of spatial pixels in a resolution element: \00"
@.str.7 = [17 x i8] c"Enter binning: \00"
@.str.8 = [30 x i8] c"Enter exposure time in sec: \00"
@.str.9 = [43 x i8] c"\0AFor this observation the parameters are:\0A\00"
@.str.10 = [52 x i8] c" WF/PC-2 Flux = %g erg/sec/cm^2/Ang/arcsec^2\0A\00"
@.str.11 = [27 x i8] c" Sensitivity = %g\0A\0A\00"
@.str.12 = [49 x i8] c"So in one resolution element of %d x %d pixels:\0A\00"
@.str.13 = [30 x i8] c" Source counts = %g cts\0A\00"
@.str.14 = [30 x i8] c" Sky counts = %g cts\0A\00"
@.str.15 = [30 x i8] c" Dark counts = %g cts\0A\00"
@.str.16 = [31 x i8] c" Read noise counts = %g cts\0A\0A\00"
@.str.17 = [43 x i8] c"Which gives a S/N of %6.2f:1 in %6.0f sec\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca float
%12 = alloca float
%13 = alloca float
%14 = alloca float
%15 = alloca float
%16 = alloca float
%17 = alloca float
%18 = alloca [1000 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%20 = getelementptr inbounds [1000 x i8], [1000 x i8]* %18, i64 0, i64 0
%21 = call i32 @gets(i8* %20)
%22 = getelementptr inbounds [1000 x i8], [1000 x i8]* %18, i64 0, i64 0
%23 = call i32 (i8*, i8*, ...) @sscanf(i8* %22, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %12)
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
%25 = getelementptr inbounds [1000 x i8], [1000 x i8]* %18, i64 0, i64 0
%26 = call i32 @gets(i8* %25)
%27 = getelementptr inbounds [1000 x i8], [1000 x i8]* %18, i64 0, i64 0
%28 = call i32 (i8*, i8*, ...) @sscanf(i8* %27, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %14)
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
%30 = getelementptr inbounds [1000 x i8], [1000 x i8]* %18, i64 0, i64 0
%31 = call i32 @gets(i8* %30)
%32 = getelementptr inbounds [1000 x i8], [1000 x i8]* %18, i64 0, i64 0
%33 = call i32 (i8*, i8*, ...) @sscanf(i8* %32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %9)
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.5, i64 0, i64 0))
%35 = getelementptr inbounds [1000 x i8], [1000 x i8]* %18, i64 0, i64 0
%36 = call i32 @gets(i8* %35)
%37 = getelementptr inbounds [1000 x i8], [1000 x i8]* %18, i64 0, i64 0
%38 = call i32 (i8*, i8*, ...) @sscanf(i8* %37, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %6)
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.6, i64 0, i64 0))
%40 = getelementptr inbounds [1000 x i8], [1000 x i8]* %18, i64 0, i64 0
%41 = call i32 @gets(i8* %40)
%42 = getelementptr inbounds [1000 x i8], [1000 x i8]* %18, i64 0, i64 0
%43 = call i32 (i8*, i8*, ...) @sscanf(i8* %42, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %7)
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0))
%45 = getelementptr inbounds [1000 x i8], [1000 x i8]* %18, i64 0, i64 0
%46 = call i32 @gets(i8* %45)
%47 = getelementptr inbounds [1000 x i8], [1000 x i8]* %18, i64 0, i64 0
%48 = call i32 (i8*, i8*, ...) @sscanf(i8* %47, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %10)
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.8, i64 0, i64 0))
%50 = getelementptr inbounds [1000 x i8], [1000 x i8]* %18, i64 0, i64 0
%51 = call i32 @gets(i8* %50)
%52 = getelementptr inbounds [1000 x i8], [1000 x i8]* %18, i64 0, i64 0
%53 = call i32 (i8*, i8*, ...) @sscanf(i8* %52, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %11)
%54 = load i32, i32* %6
%55 = load i32, i32* %7
%56 = mul nsw i32 %54, %55
store i32 %56, i32* %8
%57 = load float, float* %14
%58 = fpext float %57 to double
%59 = fmul double 4.800000e+13, %58
%60 = fptrunc double %59 to float
store float %60, float* %13
%61 = load float, float* %12
%62 = load float, float* %13
%63 = fmul float %61, %62
%64 = load i32, i32* %8
%65 = sitofp i32 %64 to float
%66 = fmul float %63, %65
store float %66, float* %15
%67 = load float, float* %13
%68 = fpext float %67 to double
%69 = fmul double 1.000000e-17, %68
%70 = fptrunc double %69 to float
store float %70, float* %16
%71 = load float, float* %15
%72 = load float, float* %11
%73 = fmul float %71, %72
%74 = load float, float* %15
%75 = load float, float* %11
%76 = fmul float %74, %75
%77 = fpext float %76 to double
%78 = load float, float* %16
%79 = fpext float %78 to double
%80 = fadd double %79, 7.000000e-03
%81 = load i32, i32* %8
%82 = sitofp i32 %81 to double
%83 = fmul double %80, %82
%84 = load float, float* %11
%85 = fpext float %84 to double
%86 = call double @llvm.fmuladd.f64(double %83, double %85, double %77)
%87 = load i32, i32* %8
%88 = load i32, i32* %9
%89 = mul nsw i32 %87, %88
%90 = sitofp i32 %89 to double
%91 = fmul double %90, 4.000000e+00
%92 = fmul double %91, 4.000000e+00
%93 = load i32, i32* %10
%94 = sitofp i32 %93 to double
%95 = fdiv double %92, %94
%96 = fadd double %86, %95
%97 = fptrunc double %96 to float
%98 = call float @sqrt(float %97)
%99 = fdiv float %73, %98
store float %99, float* %17
%100 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.9, i64 0, i64 0))
%101 = load float, float* %12
%102 = fpext float %101 to double
%103 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.10, i64 0, i64 0), double %102)
%104 = load float, float* %13
%105 = fpext float %104 to double
%106 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.11, i64 0, i64 0), double %105)
%107 = load i32, i32* %6
%108 = load i32, i32* %7
%109 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.12, i64 0, i64 0), i32 %107, i32 %108)
%110 = load float, float* %15
%111 = load float, float* %11
%112 = fmul float %110, %111
%113 = fpext float %112 to double
%114 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.13, i64 0, i64 0), double %113)
%115 = load float, float* %16
%116 = load i32, i32* %8
%117 = sitofp i32 %116 to float
%118 = fmul float %115, %117
%119 = load float, float* %11
%120 = fmul float %118, %119
%121 = fpext float %120 to double
%122 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.14, i64 0, i64 0), double %121)
%123 = load i32, i32* %8
%124 = sitofp i32 %123 to double
%125 = fmul double 7.000000e-03, %124
%126 = load float, float* %11
%127 = fpext float %126 to double
%128 = fmul double %125, %127
%129 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.15, i64 0, i64 0), double %128)
%130 = load i32, i32* %8
%131 = load i32, i32* %9
%132 = mul nsw i32 %130, %131
%133 = sitofp i32 %132 to double
%134 = fmul double %133, 4.000000e+00
%135 = fmul double %134, 4.000000e+00
%136 = load i32, i32* %10
%137 = sitofp i32 %136 to double
%138 = fdiv double %135, %137
%139 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.16, i64 0, i64 0), double %138)
%140 = load float, float* %17
%141 = fpext float %140 to double
%142 = load float, float* %11
%143 = fpext float %142 to double
%144 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.17, i64 0, i64 0), double %141, double %143)
ret i32 0
}

LLVM IR (-O2):
@.str = [52 x i8] c"Enter WF/PC-2 flux in ergs/sec/cm^2/Ang/arcsec^2: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [35 x i8] c"Enter STIS slit width in arcsec: \00"
@.str.3 = [29 x i8] c"Enter number of CCD reads: \00"
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [59 x i8] c"Enter number of spectral pixels in a resolution element: \00"
@.str.6 = [58 x i8] c"Enter number of spatial pixels in a resolution element: \00"
@.str.7 = [17 x i8] c"Enter binning: \00"
@.str.8 = [30 x i8] c"Enter exposure time in sec: \00"
@.str.10 = [52 x i8] c" WF/PC-2 Flux = %g erg/sec/cm^2/Ang/arcsec^2\0A\00"
@.str.11 = [27 x i8] c" Sensitivity = %g\0A\0A\00"
@.str.12 = [49 x i8] c"So in one resolution element of %d x %d pixels:\0A\00"
@.str.13 = [30 x i8] c" Source counts = %g cts\0A\00"
@.str.14 = [30 x i8] c" Sky counts = %g cts\0A\00"
@.str.15 = [30 x i8] c" Dark counts = %g cts\0A\00"
@.str.16 = [31 x i8] c" Read noise counts = %g cts\0A\0A\00"
@.str.17 = [43 x i8] c"Which gives a S/N of %6.2f:1 in %6.0f sec\0A\00"
@str = [42 x i8] c"\0AFor this observation the parameters are:\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca [1000 x i8]
%11 = bitcast i32* %3 to i8*
%12 = bitcast i32* %4 to i8*
%13 = bitcast i32* %5 to i8*
%14 = bitcast i32* %6 to i8*
%15 = bitcast float* %7 to i8*
%16 = bitcast float* %8 to i8*
%17 = bitcast float* %9 to i8*
%18 = getelementptr inbounds [1000 x i8], [1000 x i8]* %10, i64 0, i64 0
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%20 = call i32 @gets(i8* %18)
%21 = call i32 (i8*, i8*, ...) @sscanf(i8* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %8)
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
%23 = call i32 @gets(i8* %18)
%24 = call i32 (i8*, i8*, ...) @sscanf(i8* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %9)
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
%26 = call i32 @gets(i8* %18)
%27 = call i32 (i8*, i8*, ...) @sscanf(i8* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %5)
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @.str.5, i64 0, i64 0))
%29 = call i32 @gets(i8* %18)
%30 = call i32 (i8*, i8*, ...) @sscanf(i8* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %3)
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str.6, i64 0, i64 0))
%32 = call i32 @gets(i8* %18)
%33 = call i32 (i8*, i8*, ...) @sscanf(i8* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %4)
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0))
%35 = call i32 @gets(i8* %18)
%36 = call i32 (i8*, i8*, ...) @sscanf(i8* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %6)
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.8, i64 0, i64 0))
%38 = call i32 @gets(i8* %18)
%39 = call i32 (i8*, i8*, ...) @sscanf(i8* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %7)
%40 = load i32, i32* %3
%41 = load i32, i32* %4
%42 = mul nsw i32 %41, %40
%43 = load float, float* %9
%44 = fpext float %43 to double
%45 = fmul double %44, 4.800000e+13
%46 = fptrunc double %45 to float
%47 = load float, float* %8
%48 = fmul float %47, %46
%49 = sitofp i32 %42 to float
%50 = fmul float %48, %49
%51 = fpext float %46 to double
%52 = fmul double %51, 1.000000e-17
%53 = fptrunc double %52 to float
%54 = load float, float* %7
%55 = fmul float %54, %50
%56 = fpext float %55 to double
%57 = fpext float %53 to double
%58 = fadd double %57, 7.000000e-03
%59 = sitofp i32 %42 to double
%60 = fmul double %58, %59
%61 = fpext float %54 to double
%62 = call double @llvm.fmuladd.f64(double %60, double %61, double %56)
%63 = load i32, i32* %5
%64 = mul nsw i32 %63, %42
%65 = sitofp i32 %64 to double
%66 = fmul double %65, 4.000000e+00
%67 = fmul double %66, 4.000000e+00
%68 = load i32, i32* %6
%69 = sitofp i32 %68 to double
%70 = fdiv double %67, %69
%71 = fadd double %70, %62
%72 = fptrunc double %71 to float
%73 = call float @sqrt(float %72)
%74 = fdiv float %55, %73
%75 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
%76 = load float, float* %8
%77 = fpext float %76 to double
%78 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str.10, i64 0, i64 0), double %77)
%79 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.11, i64 0, i64 0), double %51)
%80 = load i32, i32* %3
%81 = load i32, i32* %4
%82 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.12, i64 0, i64 0), i32 %80, i32 %81)
%83 = load float, float* %7
%84 = fmul float %50, %83
%85 = fpext float %84 to double
%86 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.13, i64 0, i64 0), double %85)
%87 = fmul float %49, %53
%88 = load float, float* %7
%89 = fmul float %87, %88
%90 = fpext float %89 to double
%91 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.14, i64 0, i64 0), double %90)
%92 = fmul double %59, 7.000000e-03
%93 = load float, float* %7
%94 = fpext float %93 to double
%95 = fmul double %92, %94
%96 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.15, i64 0, i64 0), double %95)
%97 = load i32, i32* %5
%98 = mul nsw i32 %97, %42
%99 = sitofp i32 %98 to double
%100 = fmul double %99, 4.000000e+00
%101 = fmul double %100, 4.000000e+00
%102 = load i32, i32* %6
%103 = sitofp i32 %102 to double
%104 = fdiv double %101, %103
%105 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.16, i64 0, i64 0), double %104)
%106 = fpext float %74 to double
%107 = load float, float* %7
%108 = fpext float %107 to double
%109 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.17, i64 0, i64 0), double %106, double %108)
ret i32 0
}