#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 *, ...);
float scanf(char *, float *);
int main() {
  float x, y, z;
  x = 10;
  y = 10;
  z = x + 3 * x / (y - 4);
  printf("Type a number X: \n");
  float X, Y;
  float X1 = scanf("%f", &X);
  printf("Type a number Y: \n");
  float Y1 = scanf("%f", &Y);
  float Z = X + 3 * X / (Y - 4);
  printf("The result for x = %.4f and y = %.4f is %.4f.\n", X, Y, Z);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xed1(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xec4(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xeae(%rip),%xmm1
mulss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
movss  0xe98(%rip),%xmm3
subss  %xmm3,%xmm2
divss  %xmm2,%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
lea    0xe8c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe91(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
movss  %xmm0,-0x1c(%rbp)
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe6e(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
movss  %xmm0,-0x20(%rbp)
movss  -0x14(%rbp),%xmm0
movss  0xe38(%rip),%xmm1
mulss  -0x14(%rbp),%xmm1
movss  -0x18(%rbp),%xmm2
movss  0xe22(%rip),%xmm3
subss  %xmm3,%xmm2
divss  %xmm2,%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x18(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x24(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xe24(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xefe(%rip),%rdi
call   1030 <puts@plt>
lea    0xec0(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xef0(%rip),%rdi
call   1030 <puts@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
movss  0xc(%rsp),%xmm0
movss  0xe84(%rip),%xmm2
mulss  %xmm0,%xmm2
movss  0x8(%rsp),%xmm1
movss  0xe76(%rip),%xmm3
addss  %xmm1,%xmm3
divss  %xmm3,%xmm2
addss  %xmm0,%xmm2
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
cvtss2sd %xmm2,%xmm2
lea    0xe5e(%rip),%rdi
mov    $0x3,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Type a number X: \0A\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [19 x i8] c"Type a number Y: \0A\00"
@.str.3 = [47 x i8] c"The result for x = %.4f and y = %.4f is %.4f.\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
store float 1.000000e+01, float* %2
store float 1.000000e+01, float* %3
%10 = load float, float* %2
%11 = load float, float* %2
%12 = fmul float 3.000000e+00, %11
%13 = load float, float* %3
%14 = fsub float %13, 4.000000e+00
%15 = fdiv float %12, %14
%16 = fadd float %10, %15
store float %16, float* %4
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%18 = call float @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %5)
store float %18, float* %7
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%20 = call float @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %6)
store float %20, float* %8
%21 = load float, float* %5
%22 = load float, float* %5
%23 = fmul float 3.000000e+00, %22
%24 = load float, float* %6
%25 = fsub float %24, 4.000000e+00
%26 = fdiv float %23, %25
%27 = fadd float %21, %26
store float %27, float* %9
%28 = load float, float* %5
%29 = fpext float %28 to double
%30 = load float, float* %6
%31 = fpext float %30 to double
%32 = load float, float* %9
%33 = fpext float %32 to double
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, i64 0, i64 0), double %29, double %31, double %33)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%f\00"
@.str.3 = [47 x i8] c"The result for x = %.4f and y = %.4f is %.4f.\0A\00"
@str = [18 x i8] c"Type a number X: \00"
@str.4 = [18 x i8] c"Type a number Y: \00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%4 = bitcast float* %1 to i8*
%5 = bitcast float* %2 to i8*
%6 = call float @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.4, i64 0, i64 0))
%8 = call float @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%9 = load float, float* %1
%10 = fmul float %9, 3.000000e+00
%11 = load float, float* %2
%12 = fadd float %11, -4.000000e+00
%13 = fdiv float %10, %12
%14 = fadd float %9, %13
%15 = fpext float %9 to double
%16 = fpext float %11 to double
%17 = fpext float %14 to double
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, i64 0, i64 0), double %15, double %16, double %17)
ret i32 0
}