#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 *, ...);
int main() {
  float area_rect, area_circ, area_tria;
  float radius, length, breadth, base, height;
  printf("Enter radius of circle: ");
  scanf("%f", &radius);
  printf("Enter length and breadth of rectangle: ");
  scanf("%f %f", &length, &breadth);
  printf("Enter base and height of triangle: ");
  scanf("%f %f", &base, &height);
  area_rect = length * breadth;
  area_circ = 3.14 * radius * radius;
  area_tria = 0.5 * base * height;
  printf("Area of rectangle: %0.2f\n", area_rect);
  printf("Area of circle: %0.2f\n", area_circ);
  printf("Area of triangle: %0.2f\n", area_tria);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf10(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeed(%rip),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec9(%rip),%rdi
lea    -0x20(%rbp),%rsi
lea    -0x24(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
movss  -0x18(%rbp),%xmm0
mulss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe51(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0x14(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x20(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe1e(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0x24(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe6f(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe72(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe72(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xee4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf1a(%rip),%rdi
lea    0x1c(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xedc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef6(%rip),%rbx
lea    0x18(%rsp),%rsi
lea    0x14(%rsp),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xee1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
movss  0x18(%rsp),%xmm0
mulss  0x14(%rsp),%xmm0
movss  0x1c(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xe51(%rip),%xmm2
mulsd  %xmm1,%xmm2
mulsd  %xmm1,%xmm2
xorps  %xmm1,%xmm1
cvtsd2ss %xmm2,%xmm1
movss  %xmm1,0x8(%rsp)
movss  0x10(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  0xe32(%rip),%xmm1
movss  0xc(%rsp),%xmm2
cvtss2sd %xmm2,%xmm2
mulsd  %xmm1,%xmm2
xorps  %xmm1,%xmm1
cvtsd2ss %xmm2,%xmm1
movss  %xmm1,0x4(%rsp)
cvtss2sd %xmm0,%xmm0
lea    0xe7f(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe81(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe80(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Enter radius of circle: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [40 x i8] c"Enter length and breadth of rectangle: \00"
@.str.3 = [6 x i8] c"%f %f\00"
@.str.4 = [36 x i8] c"Enter base and height of triangle: \00"
@.str.5 = [26 x i8] c"Area of rectangle: %0.2f\0A\00"
@.str.6 = [23 x i8] c"Area of circle: %0.2f\0A\00"
@.str.7 = [25 x i8] c"Area of triangle: %0.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
store i32 0, i32* %1
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%11 = call i32 (i8*, float*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %5)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 (i8*, float*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), float* %6, float* %7)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0))
%15 = call i32 (i8*, float*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), float* %8, float* %9)
%16 = load float, float* %6
%17 = load float, float* %7
%18 = fmul float %16, %17
store float %18, float* %2
%19 = load float, float* %5
%20 = fpext float %19 to double
%21 = fmul double 3.140000e+00, %20
%22 = load float, float* %5
%23 = fpext float %22 to double
%24 = fmul double %21, %23
%25 = fptrunc double %24 to float
store float %25, float* %3
%26 = load float, float* %8
%27 = fpext float %26 to double
%28 = fmul double 5.000000e-01, %27
%29 = load float, float* %9
%30 = fpext float %29 to double
%31 = fmul double %28, %30
%32 = fptrunc double %31 to float
store float %32, float* %4
%33 = load float, float* %2
%34 = fpext float %33 to double
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), double %34)
%36 = load float, float* %3
%37 = fpext float %36 to double
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0), double %37)
%39 = load float, float* %4
%40 = fpext float %39 to double
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0), double %40)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"Enter radius of circle: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [40 x i8] c"Enter length and breadth of rectangle: \00"
@.str.3 = [6 x i8] c"%f %f\00"
@.str.4 = [36 x i8] c"Enter base and height of triangle: \00"
@.str.5 = [26 x i8] c"Area of rectangle: %0.2f\0A\00"
@.str.6 = [23 x i8] c"Area of circle: %0.2f\0A\00"
@.str.7 = [25 x i8] c"Area of triangle: %0.2f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = bitcast float* %1 to i8*
%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 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%12 = call i32 (i8*, float*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
%14 = call i32 (i8*, float*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), float* %2, float* %3)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0))
%16 = call i32 (i8*, float*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), float* %4, float* %5)
%17 = load float, float* %2
%18 = load float, float* %3
%19 = fmul float %17, %18
%20 = load float, float* %1
%21 = fpext float %20 to double
%22 = fmul double %21, 3.140000e+00
%23 = fmul double %22, %21
%24 = fptrunc double %23 to float
%25 = load float, float* %4
%26 = fpext float %25 to double
%27 = fmul double %26, 5.000000e-01
%28 = load float, float* %5
%29 = fpext float %28 to double
%30 = fmul double %27, %29
%31 = fptrunc double %30 to float
%32 = fpext float %19 to double
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), double %32)
%34 = fpext float %24 to double
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0), double %34)
%36 = fpext float %31 to double
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0), double %36)
ret i32 0
}