#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 */
float fabs(float);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
float sqrt(float);
int /*<<< orphan*/ sscanf(char *, char *, float *);
int /*<<< orphan*/ stdin;
void main() {
  char line[80];
  float q, a, b, r, emin;
  float mass;
  float ion;
  printf("the charge\n");
  fgets(line, 80, stdin);
  sscanf(line, "%f", &q);
  printf(" the ionic strength\n");
  fgets(line, 80, stdin);
  sscanf(line, "%f", &ion);
  if (ion <= 1.e-4)
    ion = 1.e-4;
  printf(" the potential depth\n");
  fgets(line, 80, stdin);
  sscanf(line, "%f", &emin);
  emin = fabs(emin);
  printf(" the ion mass\n");
  fgets(line, 80, stdin);
  sscanf(line, "%f", &mass);
  r = 10.84 * 1000. / 18. / ion;
  mass += 1000. / ion;
  r = r * 0.75 / 3.14159265;
  r *= r;
  a = sqrt(2. * emin * r);
  b = sqrt(emin * r * r);
  printf("atom 0 0 0 myserial uber.ion %f %f %f %f;\n", q, a, b, mass);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x50(%rbp),%rdi
mov    0x2e77(%rip),%rax
mov    (%rax),%edx
mov    $0x50,%esi
call   1040 <fgets@plt>
lea    -0x50(%rbp),%rdi
lea    0xeb8(%rip),%rsi
lea    -0x54(%rbp),%rdx
call   1060 <sscanf@plt>
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x50(%rbp),%rdi
mov    0x2e3e(%rip),%rax
mov    (%rax),%edx
mov    $0x50,%esi
call   1040 <fgets@plt>
lea    -0x50(%rbp),%rdi
lea    0xe7f(%rip),%rsi
lea    -0x6c(%rbp),%rdx
call   1060 <sscanf@plt>
movss  -0x6c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe25(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     11f2 <main+0xa2>
movss  0xe43(%rip),%xmm0
movss  %xmm0,-0x6c(%rbp)
lea    0xe5f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x50(%rbp),%rdi
mov    0x2ddd(%rip),%rax
mov    (%rax),%edx
mov    $0x50,%esi
call   1040 <fgets@plt>
lea    -0x50(%rbp),%rdi
lea    0xe1e(%rip),%rsi
lea    -0x64(%rbp),%rdx
call   1060 <sscanf@plt>
movss  -0x64(%rbp),%xmm0
call   1050 <fabs@plt>
movss  %xmm0,-0x64(%rbp)
lea    0xe2d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x50(%rbp),%rdi
mov    0x2d95(%rip),%rax
mov    (%rax),%edx
mov    $0x50,%esi
call   1040 <fgets@plt>
lea    -0x50(%rbp),%rdi
lea    0xdd6(%rip),%rsi
lea    -0x68(%rbp),%rdx
call   1060 <sscanf@plt>
movss  -0x6c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xda4(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x60(%rbp)
movss  -0x6c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd7e(%rip),%xmm1
divsd  %xmm0,%xmm1
movss  -0x68(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x68(%rbp)
movss  -0x60(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd4b(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd37(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x60(%rbp)
movss  -0x60(%rbp),%xmm0
mulss  -0x60(%rbp),%xmm0
movss  %xmm0,-0x60(%rbp)
movss  -0x64(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xd02(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0x60(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1070 <sqrt@plt>
movss  %xmm0,-0x58(%rbp)
movss  -0x64(%rbp),%xmm0
mulss  -0x60(%rbp),%xmm0
mulss  -0x60(%rbp),%xmm0
call   1070 <sqrt@plt>
movss  %xmm0,-0x5c(%rbp)
movss  -0x54(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x58(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x5c(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
movss  -0x68(%rbp),%xmm3
cvtss2sd %xmm3,%xmm3
lea    0xd14(%rip),%rdi
mov    $0x4,%al
call   1030 <printf@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x70,%rsp
lea    0xf0e(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e7c(%rip),%r15
mov    (%r15),%edx
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x50,%esi
call   1050 <fgets@plt>
lea    0xeb8(%rip),%r14
lea    0x1c(%rsp),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <sscanf@plt>
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
mov    (%r15),%edx
mov    %rbx,%rdi
mov    $0x50,%esi
call   1050 <fgets@plt>
lea    0x14(%rsp),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <sscanf@plt>
movss  0x14(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe2a(%rip),%xmm1
ucomisd %xmm0,%xmm1
jb     11e4 <main+0x94>
movl   $0x38d1b717,0x14(%rsp)
38
lea    0xea2(%rip),%rdi
call   1030 <puts@plt>
mov    (%r15),%edx
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x50,%esi
call   1050 <fgets@plt>
lea    0xe34(%rip),%r14
lea    0xc(%rsp),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <sscanf@plt>
movss  0xc(%rsp),%xmm0
andps  0xe07(%rip),%xmm0
movss  %xmm0,0xc(%rsp)
lea    0xe6c(%rip),%rdi
call   1030 <puts@plt>
mov    (%r15),%edx
mov    %rbx,%rdi
mov    $0x50,%esi
call   1050 <fgets@plt>
lea    0x18(%rsp),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <sscanf@plt>
movss  0x14(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd9b(%rip),%xmm1
divsd  %xmm0,%xmm1
cvtsd2ss %xmm1,%xmm1
movsd  0xd93(%rip),%xmm2
divsd  %xmm0,%xmm2
movss  0x18(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  %xmm2,%xmm0
cvtss2sd %xmm1,%xmm1
mulsd  0xd7d(%rip),%xmm1
divsd  0xd7d(%rip),%xmm1
cvtsd2ss %xmm1,%xmm3
mulss  %xmm3,%xmm3
movss  0xc(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
addsd  %xmm1,%xmm1
xorps  %xmm2,%xmm2
cvtss2sd %xmm3,%xmm2
mulsd  %xmm1,%xmm2
xorps  %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm2,%xmm0
movss  %xmm1,0x18(%rsp)
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     12e9 <main+0x199>
xorps  %xmm2,%xmm2
sqrtss %xmm0,%xmm2
jmp    1300 <main+0x1b0>
movss  %xmm3,0x10(%rsp)
call   1070 <sqrt@plt>
xorps  %xmm1,%xmm1
movss  0x10(%rsp),%xmm3
movaps %xmm0,%xmm2
movss  0xc(%rsp),%xmm0
mulss  %xmm3,%xmm0
mulss  %xmm3,%xmm0
ucomiss %xmm1,%xmm0
jb     1319 <main+0x1c9>
sqrtss %xmm0,%xmm0
jmp    132a <main+0x1da>
movss  %xmm2,0x10(%rsp)
call   1070 <sqrt@plt>
movss  0x10(%rsp),%xmm2
movss  0x1c(%rsp),%xmm1
cvtss2sd %xmm1,%xmm4
xorps  %xmm1,%xmm1
cvtss2sd %xmm2,%xmm1
xorps  %xmm2,%xmm2
cvtss2sd %xmm0,%xmm2
movss  0x18(%rsp),%xmm0
xorps  %xmm3,%xmm3
cvtss2sd %xmm0,%xmm3
lea    0xced(%rip),%rdi
movaps %xmm4,%xmm0
mov    $0x4,%al
call   1040 <printf@plt>
add    $0x70,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [12 x i8] c"the charge\0A\00"
@stdin = global i32 0
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [21 x i8] c" the ionic strength\0A\00"
@.str.3 = [22 x i8] c" the potential depth\0A\00"
@.str.4 = [15 x i8] c" the ion mass\0A\00"
@.str.5 = [43 x i8] c"atom 0 0 0 myserial uber.ion %f %f %f %f;\0A\00"
define void @main() {
%1 = alloca [80 x i8]
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%10 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%11 = load i32, i32* @stdin
%12 = call i32 @fgets(i8* %10, i32 80, i32 %11)
%13 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%14 = call i32 @sscanf(i8* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%16 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%17 = load i32, i32* @stdin
%18 = call i32 @fgets(i8* %16, i32 80, i32 %17)
%19 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%20 = call i32 @sscanf(i8* %19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %8)
%21 = load float, float* %8
%22 = fpext float %21 to double
%23 = fcmp ole double %22, 1.000000e-04
br i1 %23, label %24, label %25
24: ; preds = %0
store float 0x3F1A36E2E0000000, float* %8
br label %25
25: ; preds = %24, %0
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
%27 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%28 = load i32, i32* @stdin
%29 = call i32 @fgets(i8* %27, i32 80, i32 %28)
%30 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%31 = call i32 @sscanf(i8* %30, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %6)
%32 = load float, float* %6
%33 = call float @fabs(float %32)
store float %33, float* %6
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
%35 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%36 = load i32, i32* @stdin
%37 = call i32 @fgets(i8* %35, i32 80, i32 %36)
%38 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%39 = call i32 @sscanf(i8* %38, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %7)
%40 = load float, float* %8
%41 = fpext float %40 to double
%42 = fdiv double 0x4082D1C71C71C71C, %41
%43 = fptrunc double %42 to float
store float %43, float* %5
%44 = load float, float* %8
%45 = fpext float %44 to double
%46 = fdiv double 1.000000e+03, %45
%47 = load float, float* %7
%48 = fpext float %47 to double
%49 = fadd double %48, %46
%50 = fptrunc double %49 to float
store float %50, float* %7
%51 = load float, float* %5
%52 = fpext float %51 to double
%53 = fmul double %52, 7.500000e-01
%54 = fdiv double %53, 0x400921FB53C8D4F1
%55 = fptrunc double %54 to float
store float %55, float* %5
%56 = load float, float* %5
%57 = load float, float* %5
%58 = fmul float %57, %56
store float %58, float* %5
%59 = load float, float* %6
%60 = fpext float %59 to double
%61 = fmul double 2.000000e+00, %60
%62 = load float, float* %5
%63 = fpext float %62 to double
%64 = fmul double %61, %63
%65 = fptrunc double %64 to float
%66 = call float @sqrt(float %65)
store float %66, float* %3
%67 = load float, float* %6
%68 = load float, float* %5
%69 = fmul float %67, %68
%70 = load float, float* %5
%71 = fmul float %69, %70
%72 = call float @sqrt(float %71)
store float %72, float* %4
%73 = load float, float* %2
%74 = fpext float %73 to double
%75 = load float, float* %3
%76 = fpext float %75 to double
%77 = load float, float* %4
%78 = fpext float %77 to double
%79 = load float, float* %7
%80 = fpext float %79 to double
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0), double %74, double %76, double %78, double %80)
ret void
}

LLVM IR (-O2):
@stdin = global i32 0
@.str.1 = [3 x i8] c"%f\00"
@.str.5 = [43 x i8] c"atom 0 0 0 myserial uber.ion %f %f %f %f;\0A\00"
@str = [11 x i8] c"the charge\00"
@str.6 = [20 x i8] c" the ionic strength\00"
@str.7 = [21 x i8] c" the potential depth\00"
@str.8 = [14 x i8] c" the ion mass\00"
define void @main() {
%1 = alloca [80 x i8]
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%7 = bitcast float* %2 to i8*
%8 = bitcast float* %3 to i8*
%9 = bitcast float* %4 to i8*
%10 = bitcast float* %5 to i8*
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%12 = load i32, i32* @stdin
%13 = call i32 @fgets(i8* %6, i32 80, i32 %12)
%14 = call i32 @sscanf(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.6, i64 0, i64 0))
%16 = load i32, i32* @stdin
%17 = call i32 @fgets(i8* %6, i32 80, i32 %16)
%18 = call i32 @sscanf(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %5)
%19 = load float, float* %5
%20 = fpext float %19 to double
%21 = fcmp ugt double %20, 1.000000e-04
br i1 %21, label %23, label %22
22: ; preds = %0
store float 0x3F1A36E2E0000000, float* %5
br label %23
23: ; preds = %22, %0
%24 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.7, i64 0, i64 0))
%25 = load i32, i32* @stdin
%26 = call i32 @fgets(i8* %6, i32 80, i32 %25)
%27 = call i32 @sscanf(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%28 = load float, float* %3
%29 = call float @llvm.fabs.f32(float %28)
store float %29, float* %3
%30 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.8, i64 0, i64 0))
%31 = load i32, i32* @stdin
%32 = call i32 @fgets(i8* %6, i32 80, i32 %31)
%33 = call i32 @sscanf(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %4)
%34 = load float, float* %5
%35 = fpext float %34 to double
%36 = fdiv double 0x4082D1C71C71C71C, %35
%37 = fptrunc double %36 to float
%38 = fdiv double 1.000000e+03, %35
%39 = load float, float* %4
%40 = fpext float %39 to double
%41 = fadd double %38, %40
%42 = fptrunc double %41 to float
store float %42, float* %4
%43 = fpext float %37 to double
%44 = fmul double %43, 7.500000e-01
%45 = fdiv double %44, 0x400921FB53C8D4F1
%46 = fptrunc double %45 to float
%47 = fmul float %46, %46
%48 = load float, float* %3
%49 = fpext float %48 to double
%50 = fmul double %49, 2.000000e+00
%51 = fpext float %47 to double
%52 = fmul double %50, %51
%53 = fptrunc double %52 to float
%54 = call float @sqrt(float %53)
%55 = load float, float* %3
%56 = fmul float %55, %47
%57 = fmul float %47, %56
%58 = call float @sqrt(float %57)
%59 = load float, float* %2
%60 = fpext float %59 to double
%61 = fpext float %54 to double
%62 = fpext float %58 to double
%63 = load float, float* %4
%64 = fpext float %63 to double
%65 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0), double %60, double %61, double %62, double %64)
ret void
}