#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;
int 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 radius\n");
  fgets(line, 80, stdin);
  sscanf(line, "%f", &r);
  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 = r * r * r;
  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    0xea9(%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    0xe8c(%rip),%rsi
lea    -0x54(%rbp),%rdx
call   1060 <sscanf@plt>
lea    0xe7f(%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    0xe53(%rip),%rsi
lea    -0x60(%rbp),%rdx
call   1060 <sscanf@plt>
lea    0xe53(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x50(%rbp),%rdi
mov    0x2e05(%rip),%rax
mov    (%rax),%edx
mov    $0x50,%esi
call   1040 <fgets@plt>
lea    -0x50(%rbp),%rdi
lea    0xe1a(%rip),%rsi
lea    -0x64(%rbp),%rdx
call   1060 <sscanf@plt>
movss  -0x64(%rbp),%xmm0
call   1050 <fabs@plt>
movss  %xmm0,-0x64(%rbp)
lea    0xe21(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x50(%rbp),%rdi
mov    0x2dbd(%rip),%rax
mov    (%rax),%edx
mov    $0x50,%esi
call   1040 <fgets@plt>
lea    -0x50(%rbp),%rdi
lea    0xdd2(%rip),%rsi
lea    -0x68(%rbp),%rdx
call   1060 <sscanf@plt>
movss  -0x60(%rbp),%xmm0
mulss  -0x60(%rbp),%xmm0
mulss  -0x60(%rbp),%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  0xd81(%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    0xd67(%rip),%rdi
mov    $0x4,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x70,%rsp
lea    0xede(%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    0xe88(%rip),%r14
lea    0x1c(%rsp),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <sscanf@plt>
lea    0xeaa(%rip),%rdi
call   1030 <puts@plt>
mov    (%r15),%edx
mov    %rbx,%rdi
mov    $0x50,%esi
call   1050 <fgets@plt>
lea    0x10(%rsp),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <sscanf@plt>
lea    0xe8a(%rip),%rdi
call   1030 <puts@plt>
mov    (%r15),%edx
mov    %rbx,%rdi
mov    $0x50,%esi
call   1050 <fgets@plt>
lea    0xc(%rsp),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <sscanf@plt>
movss  0xc(%rsp),%xmm0
andps  0xe03(%rip),%xmm0
movss  %xmm0,0xc(%rsp)
lea    0xe60(%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  0x10(%rsp),%xmm0
movaps %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm1,%xmm1
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm2
mulsd  %xmm0,%xmm2
xorps  %xmm0,%xmm0
cvtsd2ss %xmm2,%xmm0
movss  %xmm1,0x10(%rsp)
xorps  %xmm3,%xmm3
ucomiss %xmm3,%xmm0
jb     1278 <main+0x128>
xorps  %xmm2,%xmm2
sqrtss %xmm0,%xmm2
jmp    1283 <main+0x133>
call   1070 <sqrt@plt>
xorps  %xmm3,%xmm3
movaps %xmm0,%xmm2
movss  0x10(%rsp),%xmm1
movss  0xc(%rsp),%xmm0
mulss  %xmm1,%xmm0
mulss  %xmm1,%xmm0
ucomiss %xmm3,%xmm0
jb     12a2 <main+0x152>
sqrtss %xmm0,%xmm0
jmp    12b3 <main+0x163>
movss  %xmm2,0x14(%rsp)
call   1070 <sqrt@plt>
movss  0x14(%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    0xd34(%rip),%rdi
movaps %xmm4,%xmm0
mov    $0x4,%al
call   1040 <printf@plt>
xor    %eax,%eax
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 = [13 x i8] c" the radius\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 i32 @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 ([13 x i8], [13 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* %5)
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
%22 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%23 = load i32, i32* @stdin
%24 = call i32 @fgets(i8* %22, i32 80, i32 %23)
%25 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%26 = call i32 @sscanf(i8* %25, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %6)
%27 = load float, float* %6
%28 = call float @fabs(float %27)
store float %28, float* %6
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
%30 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%31 = load i32, i32* @stdin
%32 = call i32 @fgets(i8* %30, i32 80, i32 %31)
%33 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%34 = call i32 @sscanf(i8* %33, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %7)
%35 = load float, float* %5
%36 = load float, float* %5
%37 = fmul float %35, %36
%38 = load float, float* %5
%39 = fmul float %37, %38
store float %39, float* %5
%40 = load float, float* %5
%41 = load float, float* %5
%42 = fmul float %41, %40
store float %42, float* %5
%43 = load float, float* %6
%44 = fpext float %43 to double
%45 = fmul double 2.000000e+00, %44
%46 = load float, float* %5
%47 = fpext float %46 to double
%48 = fmul double %45, %47
%49 = fptrunc double %48 to float
%50 = call float @sqrt(float %49)
store float %50, float* %3
%51 = load float, float* %6
%52 = load float, float* %5
%53 = fmul float %51, %52
%54 = load float, float* %5
%55 = fmul float %53, %54
%56 = call float @sqrt(float %55)
store float %56, float* %4
%57 = load float, float* %2
%58 = fpext float %57 to double
%59 = load float, float* %3
%60 = fpext float %59 to double
%61 = load float, float* %4
%62 = fpext float %61 to double
%63 = load float, float* %7
%64 = fpext float %63 to double
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0), double %58, double %60, double %62, double %64)
ret i32 0
}

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 = [12 x i8] c" the radius\00"
@str.7 = [21 x i8] c" the potential depth\00"
@str.8 = [14 x i8] c" the ion mass\00"
define i32 @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 ([12 x i8], [12 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* %3)
%19 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.7, i64 0, i64 0))
%20 = load i32, i32* @stdin
%21 = call i32 @fgets(i8* %6, i32 80, i32 %20)
%22 = call i32 @sscanf(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %4)
%23 = load float, float* %4
%24 = call float @llvm.fabs.f32(float %23)
store float %24, float* %4
%25 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.8, i64 0, i64 0))
%26 = load i32, i32* @stdin
%27 = call i32 @fgets(i8* %6, i32 80, i32 %26)
%28 = call i32 @sscanf(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %5)
%29 = load float, float* %3
%30 = fmul float %29, %29
%31 = fmul float %29, %30
%32 = fmul float %31, %31
store float %32, float* %3
%33 = load float, float* %4
%34 = fpext float %33 to double
%35 = fmul double %34, 2.000000e+00
%36 = fpext float %32 to double
%37 = fmul double %35, %36
%38 = fptrunc double %37 to float
%39 = call float @sqrt(float %38)
%40 = load float, float* %4
%41 = load float, float* %3
%42 = fmul float %40, %41
%43 = fmul float %41, %42
%44 = call float @sqrt(float %43)
%45 = load float, float* %2
%46 = fpext float %45 to double
%47 = fpext float %39 to double
%48 = fpext float %44 to double
%49 = load float, float* %5
%50 = fpext float %49 to double
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0), double %46, double %47, double %48, double %50)
ret i32 0
}