#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*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *, float *);
int main() {
  float a = 0, b = 0;
  printf("calculate area of square which permiter a and the area of circle "
         "whose radius b\n");
  printf("please input a,b\n");
  scanf("%f,%f", &a, &b);
  if ((a / 4) * (a / 4) > (3.14 * b * b))
    printf("area square %.2f >area circle %.2f", ((a / 4) * (a / 4)),
           (3.14 * b * b));
  else
    printf("area square %.2f <area circle %.2f", ((a / 4) * (a / 4)),
           (3.14 * b * b));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf09(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf0d(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
movss  0xe8c(%rip),%xmm1
divss  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm1
movss  0xe7b(%rip),%xmm2
divss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm2
movsd  0xe56(%rip),%xmm1
mulsd  %xmm2,%xmm1
movss  -0xc(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
mulsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jbe    1224 <main+0x104>
movss  -0x8(%rbp),%xmm0
movss  0xe36(%rip),%xmm1
divss  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm1
movss  0xe25(%rip),%xmm2
divss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm2
movsd  0xe00(%rip),%xmm1
mulsd  %xmm2,%xmm1
movss  -0xc(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
mulsd  %xmm2,%xmm1
lea    0xe5d(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
jmp    127e <main+0x15e>
movss  -0x8(%rbp),%xmm0
movss  0xdd7(%rip),%xmm1
divss  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm1
movss  0xdc6(%rip),%xmm2
divss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm2
movsd  0xda1(%rip),%xmm1
mulsd  %xmm2,%xmm1
movss  -0xc(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
mulsd  %xmm2,%xmm1
lea    0xe21(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
movl   $0x0,(%rsp)
lea    0xf15(%rip),%rdi
call   1030 <puts@plt>
lea    0xf59(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb1(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
movss  0x4(%rsp),%xmm0
mulss  0xe86(%rip),%xmm0
mulss  %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
movss  (%rsp),%xmm1
cvtss2sd %xmm1,%xmm2
movsd  0xe75(%rip),%xmm1
mulsd  %xmm2,%xmm1
mulsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
lea    0xe70(%rip),%rax
lea    0xe8c(%rip),%rdi
cmova  %rax,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [81 x i8] c"calculate area of square which permiter a and the area of circle whose radius b\0A\00"
@.str.1 = [18 x i8] c"please input a,b\0A\00"
@.str.2 = [6 x i8] c"%f,%f\00"
@.str.3 = [35 x i8] c"area square %.2f >area circle %.2f\00"
@.str.4 = [35 x i8] c"area square %.2f <area circle %.2f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store i32 0, i32* %1
store float 0.000000e+00, float* %2
store float 0.000000e+00, float* %3
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), float* %2, float* %3)
%7 = load float, float* %2
%8 = fdiv float %7, 4.000000e+00
%9 = load float, float* %2
%10 = fdiv float %9, 4.000000e+00
%11 = fmul float %8, %10
%12 = fpext float %11 to double
%13 = load float, float* %3
%14 = fpext float %13 to double
%15 = fmul double 3.140000e+00, %14
%16 = load float, float* %3
%17 = fpext float %16 to double
%18 = fmul double %15, %17
%19 = fcmp ogt double %12, %18
br i1 %19, label %20, label %34
20: ; preds = %0
%21 = load float, float* %2
%22 = fdiv float %21, 4.000000e+00
%23 = load float, float* %2
%24 = fdiv float %23, 4.000000e+00
%25 = fmul float %22, %24
%26 = fpext float %25 to double
%27 = load float, float* %3
%28 = fpext float %27 to double
%29 = fmul double 3.140000e+00, %28
%30 = load float, float* %3
%31 = fpext float %30 to double
%32 = fmul double %29, %31
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), double %26, double %32)
br label %48
34: ; preds = %0
%35 = load float, float* %2
%36 = fdiv float %35, 4.000000e+00
%37 = load float, float* %2
%38 = fdiv float %37, 4.000000e+00
%39 = fmul float %36, %38
%40 = fpext float %39 to double
%41 = load float, float* %3
%42 = fpext float %41 to double
%43 = fmul double 3.140000e+00, %42
%44 = load float, float* %3
%45 = fpext float %44 to double
%46 = fmul double %43, %45
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0), double %40, double %46)
br label %48
48: ; preds = %34, %20
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [6 x i8] c"%f,%f\00"
@.str.3 = [35 x i8] c"area square %.2f >area circle %.2f\00"
@.str.4 = [35 x i8] c"area square %.2f <area circle %.2f\00"
@str = [80 x i8] c"calculate area of square which permiter a and the area of circle whose radius b\00"
@str.5 = [17 x i8] c"please input a,b\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = bitcast float* %1 to i8*
store float 0.000000e+00, float* %1
%4 = bitcast float* %2 to i8*
store float 0.000000e+00, float* %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([80 x i8], [80 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.5, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), float* %1, float* %2)
%8 = load float, float* %1
%9 = fmul float %8, 2.500000e-01
%10 = fmul float %9, %9
%11 = fpext float %10 to double
%12 = load float, float* %2
%13 = fpext float %12 to double
%14 = fmul double %13, 3.140000e+00
%15 = fmul double %14, %13
%16 = fcmp olt double %15, %11
%17 = select i1 %16, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0)
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %17, double %11, double %15)
ret i32 0
}