#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 *, ...);
int main() {
  int a, b;
  int addint, multint;
  float x, y;
  float add, sub, sq;
  printf("enter any two float numbers : ");
  scanf("%f%f", &x, &y);
  add = x + y;
  sub = x - y;
  sq = x * x;
  printf("addition: %f\n", add);
  printf("subtraction: %f\n", sub);
  printf("square :%f\n", sq);
  printf("enter any two int numbers: ");
  scanf("%d%d", &a, &b);
  addint = a + b;
  multint = a * b;
  printf("addition: %d\n", addint);
  printf("multiplication: %d\n", multint);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
movss  -0x18(%rbp),%xmm0
addss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x18(%rbp),%xmm0
subss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x18(%rbp),%xmm0
mulss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x20(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe94(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe8b(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x28(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe85(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe91(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%esi
lea    0xe6a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xe67(%rip),%rdi
mov    $0x0,%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    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee5(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
movss  0x14(%rsp),%xmm2
movss  0x10(%rsp),%xmm0
movaps %xmm2,%xmm1
addss  %xmm0,%xmm1
movaps %xmm2,%xmm3
subss  %xmm0,%xmm3
movss  %xmm3,0x8(%rsp)
mulss  %xmm2,%xmm2
movss  %xmm2,0xc(%rsp)
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
lea    0xea1(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe97(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe90(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe8e(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe9c(%rip),%rdi
lea    0x1c(%rsp),%rsi
lea    0x18(%rsp),%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x1c(%rsp),%eax
mov    0x18(%rsp),%ebx
lea    (%rbx,%rax,1),%esi
imul   %eax,%ebx
lea    0xe7b(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe7b(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"enter any two float numbers : \00"
@.str.1 = [5 x i8] c"%f%f\00"
@.str.2 = [14 x i8] c"addition: %f\0A\00"
@.str.3 = [17 x i8] c"subtraction: %f\0A\00"
@.str.4 = [12 x i8] c"square :%f\0A\00"
@.str.5 = [28 x i8] c"enter any two int numbers: \00"
@.str.6 = [5 x i8] c"%d%d\00"
@.str.7 = [14 x i8] c"addition: %d\0A\00"
@.str.8 = [20 x i8] c"multiplication: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
store i32 0, i32* %1
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), float* %6, float* %7)
%13 = load float, float* %6
%14 = load float, float* %7
%15 = fadd float %13, %14
store float %15, float* %8
%16 = load float, float* %6
%17 = load float, float* %7
%18 = fsub float %16, %17
store float %18, float* %9
%19 = load float, float* %6
%20 = load float, float* %6
%21 = fmul float %19, %20
store float %21, float* %10
%22 = load float, float* %8
%23 = fpext float %22 to double
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), double %23)
%25 = load float, float* %9
%26 = fpext float %25 to double
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), double %26)
%28 = load float, float* %10
%29 = fpext float %28 to double
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), double %29)
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0))
%32 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32* %2, i32* %3)
%33 = load i32, i32* %2
%34 = load i32, i32* %3
%35 = add nsw i32 %33, %34
store i32 %35, i32* %4
%36 = load i32, i32* %2
%37 = load i32, i32* %3
%38 = mul nsw i32 %36, %37
store i32 %38, i32* %5
%39 = load i32, i32* %4
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i32 %39)
%41 = load i32, i32* %5
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.8, i64 0, i64 0), i32 %41)
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"enter any two float numbers : \00"
@.str.1 = [5 x i8] c"%f%f\00"
@.str.2 = [14 x i8] c"addition: %f\0A\00"
@.str.3 = [17 x i8] c"subtraction: %f\0A\00"
@.str.4 = [12 x i8] c"square :%f\0A\00"
@.str.5 = [28 x i8] c"enter any two int numbers: \00"
@.str.6 = [5 x i8] c"%d%d\00"
@.str.7 = [14 x i8] c"addition: %d\0A\00"
@.str.8 = [20 x i8] c"multiplication: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca float
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast float* %3 to i8*
%8 = bitcast float* %4 to i8*
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), float* %3, float* %4)
%11 = load float, float* %3
%12 = load float, float* %4
%13 = fadd float %11, %12
%14 = fsub float %11, %12
%15 = fmul float %11, %11
%16 = fpext float %13 to double
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), double %16)
%18 = fpext float %14 to double
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), double %18)
%20 = fpext float %15 to double
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), double %20)
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0))
%23 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32* %1, i32* %2)
%24 = load i32, i32* %1
%25 = load i32, i32* %2
%26 = add nsw i32 %25, %24
%27 = mul nsw i32 %25, %24
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i32 %26)
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.8, i64 0, i64 0), i32 %27)
ret i32 0
}