#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 BUFSIZ;
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[BUFSIZ];
  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    $0x40,%rsp
mov    0x2e79(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x38(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x10(%rbp)
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x38(%rbp),%rdi
mov    0x2e4b(%rip),%rax
mov    (%rax),%edx
mov    $0x50,%esi
call   1040 <fgets@plt>
mov    -0x38(%rbp),%rdi
lea    0xe8c(%rip),%rsi
lea    -0x14(%rbp),%rdx
call   1060 <sscanf@plt>
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x38(%rbp),%rdi
mov    0x2e12(%rip),%rax
mov    (%rax),%edx
mov    $0x50,%esi
call   1040 <fgets@plt>
mov    -0x38(%rbp),%rdi
lea    0xe53(%rip),%rsi
lea    -0x2c(%rbp),%rdx
call   1060 <sscanf@plt>
movss  -0x2c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xdf9(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     121e <main+0xce>
movss  0xe17(%rip),%xmm0
movss  %xmm0,-0x2c(%rbp)
lea    0xe33(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x38(%rbp),%rdi
mov    0x2db1(%rip),%rax
mov    (%rax),%edx
mov    $0x50,%esi
call   1040 <fgets@plt>
mov    -0x38(%rbp),%rdi
lea    0xdf2(%rip),%rsi
lea    -0x24(%rbp),%rdx
call   1060 <sscanf@plt>
movss  -0x24(%rbp),%xmm0
call   1050 <fabs@plt>
movss  %xmm0,-0x24(%rbp)
lea    0xe01(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x38(%rbp),%rdi
mov    0x2d69(%rip),%rax
mov    (%rax),%edx
mov    $0x50,%esi
call   1040 <fgets@plt>
mov    -0x38(%rbp),%rdi
lea    0xdaa(%rip),%rsi
lea    -0x28(%rbp),%rdx
call   1060 <sscanf@plt>
movss  -0x2c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xd78(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x2c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd52(%rip),%xmm1
divsd  %xmm0,%xmm1
movss  -0x28(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x20(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd1f(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd0b(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm0
mulss  -0x20(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xcd6(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0x20(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1070 <sqrt@plt>
movss  %xmm0,-0x18(%rbp)
movss  -0x24(%rbp),%xmm0
mulss  -0x20(%rbp),%xmm0
mulss  -0x20(%rbp),%xmm0
call   1070 <sqrt@plt>
movss  %xmm0,-0x1c(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x18(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x1c(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
movss  -0x28(%rbp),%xmm3
cvtss2sd %xmm3,%xmm3
lea    0xce8(%rip),%rdi
mov    $0x4,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    0x2e74(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
lea    0xef0(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e5e(%rip),%r15
mov    (%r15),%edx
mov    %rbx,%rdi
mov    $0x50,%esi
call   1050 <fgets@plt>
lea    0xe9f(%rip),%r14
lea    -0x2c(%rbp),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <sscanf@plt>
lea    0xec2(%rip),%rdi
call   1030 <puts@plt>
mov    (%r15),%edx
mov    %rbx,%rdi
mov    $0x50,%esi
call   1050 <fgets@plt>
lea    -0x24(%rbp),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <sscanf@plt>
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe14(%rip),%xmm1
ucomisd %xmm0,%xmm1
jb     11f9 <main+0xa9>
movl   $0x38d1b717,-0x24(%rbp)
lea    0xe8d(%rip),%rdi
call   1030 <puts@plt>
mov    (%r15),%edx
mov    %rbx,%rdi
mov    $0x50,%esi
call   1050 <fgets@plt>
lea    0xe24(%rip),%r14
lea    -0x1c(%rbp),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <sscanf@plt>
movss  -0x1c(%rbp),%xmm0
andps  0xdf9(%rip),%xmm0
movss  %xmm0,-0x1c(%rbp)
lea    0xe5f(%rip),%rdi
call   1030 <puts@plt>
mov    (%r15),%edx
mov    %rbx,%rdi
mov    $0x50,%esi
call   1050 <fgets@plt>
lea    -0x28(%rbp),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <sscanf@plt>
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd90(%rip),%xmm1
divsd  %xmm0,%xmm1
cvtsd2ss %xmm1,%xmm1
movsd  0xd88(%rip),%xmm2
divsd  %xmm0,%xmm2
movss  -0x28(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  %xmm2,%xmm0
cvtss2sd %xmm1,%xmm1
mulsd  0xd73(%rip),%xmm1
divsd  0xd73(%rip),%xmm1
cvtsd2ss %xmm1,%xmm3
mulss  %xmm3,%xmm3
movss  -0x1c(%rbp),%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,-0x28(%rbp)
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     12f1 <main+0x1a1>
xorps  %xmm2,%xmm2
sqrtss %xmm0,%xmm2
jmp    1306 <main+0x1b6>
movss  %xmm3,-0x20(%rbp)
call   1070 <sqrt@plt>
xorps  %xmm1,%xmm1
movss  -0x20(%rbp),%xmm3
movaps %xmm0,%xmm2
movss  -0x1c(%rbp),%xmm0
mulss  %xmm3,%xmm0
mulss  %xmm3,%xmm0
ucomiss %xmm1,%xmm0
jb     131e <main+0x1ce>
sqrtss %xmm0,%xmm0
jmp    132d <main+0x1dd>
movss  %xmm2,-0x20(%rbp)
call   1070 <sqrt@plt>
movss  -0x20(%rbp),%xmm2
movss  -0x2c(%rbp),%xmm1
cvtss2sd %xmm1,%xmm4
xorps  %xmm1,%xmm1
cvtss2sd %xmm2,%xmm1
xorps  %xmm2,%xmm2
cvtss2sd %xmm0,%xmm2
movss  -0x28(%rbp),%xmm0
xorps  %xmm3,%xmm3
cvtss2sd %xmm0,%xmm3
lea    0xcec(%rip),%rdi
movaps %xmm4,%xmm0
mov    $0x4,%al
call   1040 <printf@plt>
lea    -0x18(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

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