#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 *);
void main() {
  int i;
  float area, h, w;
  printf("FIND THE AREA OF RECTANGLE\n");
  for (i = 0; i < 35; i++)
    printf("+");
  printf("\n\n> Height : ");
  scanf("%f", &h);
  printf("> Width: ");
  scanf("%f", &w);
  area = (h * w) / 2;
  for (i = 0; i < 35; i++)
    printf("+");
  printf("\n\nThe Area of Rectangle is : %.2f", area);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x23,-0x4(%rbp)
jge    1163 <main+0x43>
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    113d <main+0x1d>
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb8(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe9a(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0xc(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
movss  0xe4f(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x23,-0x4(%rbp)
jge    11e7 <main+0xc7>
lea    0xe4e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    11c1 <main+0xa1>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe46(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xef5(%rip),%rdi
call   1040 <puts@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
lea    0xd4e(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xd4e(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xd3d(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
movss  0xc(%rsp),%xmm0
mulss  0x8(%rsp),%xmm0
movss  %xmm0,0x4(%rsp)
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0x2b,%edi
call   1030 <putchar@plt>
movss  0x4(%rsp),%xmm0
mulss  0xb96(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xbaa(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"FIND THE AREA OF RECTANGLE\0A\00"
@.str.1 = [2 x i8] c"+\00"
@.str.2 = [14 x i8] c"\0A\0A> Height : \00"
@.str.3 = [3 x i8] c"%f\00"
@.str.4 = [10 x i8] c"> Width: \00"
@.str.5 = [34 x i8] c"\0A\0AThe Area of Rectangle is : %.2f\00"
define void @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %1
br label %6
6: ; preds = %11, %0
%7 = load i32, i32* %1
%8 = icmp slt i32 %7, 35
br i1 %8, label %9, label %14
9: ; preds = %6
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9
%12 = load i32, i32* %1
%13 = add nsw i32 %12, 1
store i32 %13, i32* %1
br label %6
14: ; preds = %6
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %3)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %4)
%19 = load float, float* %3
%20 = load float, float* %4
%21 = fmul float %19, %20
%22 = fdiv float %21, 2.000000e+00
store float %22, float* %2
store i32 0, i32* %1
br label %23
23: ; preds = %28, %14
%24 = load i32, i32* %1
%25 = icmp slt i32 %24, 35
br i1 %25, label %26, label %31
26: ; preds = %23
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %28
28: ; preds = %26
%29 = load i32, i32* %1
%30 = add nsw i32 %29, 1
store i32 %30, i32* %1
br label %23
31: ; preds = %23
%32 = load float, float* %2
%33 = fpext float %32 to double
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.5, i64 0, i64 0), double %33)
ret void
}

LLVM IR (-O2):
@.str.2 = [14 x i8] c"\0A\0A> Height : \00"
@.str.3 = [3 x i8] c"%f\00"
@.str.4 = [10 x i8] c"> Width: \00"
@.str.5 = [34 x i8] c"\0A\0AThe Area of Rectangle is : %.2f\00"
@str = [27 x i8] c"FIND THE AREA OF RECTANGLE\00"
define void @main() {
%1 = alloca float
%2 = alloca float
%3 = bitcast float* %1 to i8*
%4 = bitcast float* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @putchar(i32 43)
%7 = tail call i32 @putchar(i32 43)
%8 = tail call i32 @putchar(i32 43)
%9 = tail call i32 @putchar(i32 43)
%10 = tail call i32 @putchar(i32 43)
%11 = tail call i32 @putchar(i32 43)
%12 = tail call i32 @putchar(i32 43)
%13 = tail call i32 @putchar(i32 43)
%14 = tail call i32 @putchar(i32 43)
%15 = tail call i32 @putchar(i32 43)
%16 = tail call i32 @putchar(i32 43)
%17 = tail call i32 @putchar(i32 43)
%18 = tail call i32 @putchar(i32 43)
%19 = tail call i32 @putchar(i32 43)
%20 = tail call i32 @putchar(i32 43)
%21 = tail call i32 @putchar(i32 43)
%22 = tail call i32 @putchar(i32 43)
%23 = tail call i32 @putchar(i32 43)
%24 = tail call i32 @putchar(i32 43)
%25 = tail call i32 @putchar(i32 43)
%26 = tail call i32 @putchar(i32 43)
%27 = tail call i32 @putchar(i32 43)
%28 = tail call i32 @putchar(i32 43)
%29 = tail call i32 @putchar(i32 43)
%30 = tail call i32 @putchar(i32 43)
%31 = tail call i32 @putchar(i32 43)
%32 = tail call i32 @putchar(i32 43)
%33 = tail call i32 @putchar(i32 43)
%34 = tail call i32 @putchar(i32 43)
%35 = tail call i32 @putchar(i32 43)
%36 = tail call i32 @putchar(i32 43)
%37 = tail call i32 @putchar(i32 43)
%38 = tail call i32 @putchar(i32 43)
%39 = tail call i32 @putchar(i32 43)
%40 = tail call i32 @putchar(i32 43)
%41 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%42 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %1)
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%44 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %2)
%45 = load float, float* %1
%46 = load float, float* %2
%47 = call i32 @putchar(i32 43)
%48 = call i32 @putchar(i32 43)
%49 = call i32 @putchar(i32 43)
%50 = call i32 @putchar(i32 43)
%51 = call i32 @putchar(i32 43)
%52 = call i32 @putchar(i32 43)
%53 = call i32 @putchar(i32 43)
%54 = call i32 @putchar(i32 43)
%55 = call i32 @putchar(i32 43)
%56 = call i32 @putchar(i32 43)
%57 = call i32 @putchar(i32 43)
%58 = call i32 @putchar(i32 43)
%59 = call i32 @putchar(i32 43)
%60 = call i32 @putchar(i32 43)
%61 = call i32 @putchar(i32 43)
%62 = call i32 @putchar(i32 43)
%63 = call i32 @putchar(i32 43)
%64 = call i32 @putchar(i32 43)
%65 = call i32 @putchar(i32 43)
%66 = call i32 @putchar(i32 43)
%67 = call i32 @putchar(i32 43)
%68 = call i32 @putchar(i32 43)
%69 = call i32 @putchar(i32 43)
%70 = call i32 @putchar(i32 43)
%71 = call i32 @putchar(i32 43)
%72 = call i32 @putchar(i32 43)
%73 = call i32 @putchar(i32 43)
%74 = call i32 @putchar(i32 43)
%75 = call i32 @putchar(i32 43)
%76 = call i32 @putchar(i32 43)
%77 = call i32 @putchar(i32 43)
%78 = call i32 @putchar(i32 43)
%79 = call i32 @putchar(i32 43)
%80 = call i32 @putchar(i32 43)
%81 = call i32 @putchar(i32 43)
%82 = fmul float %45, %46
%83 = fmul float %82, 5.000000e-01
%84 = fpext float %83 to double
%85 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.5, i64 0, i64 0), double %84)
ret void
}