#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 */
double acos(int);
int cos(int);
int pow(double, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  double a, x, G, F, Y;
  int c;
  printf("Введите a: ");
  scanf("%lf", &a);
  printf("Введите х: ");
  scanf("%lf", &x);
  printf("enter c = 1 or 2 or 3: ");
  scanf("%d", &c);
  switch (c) {
  case 1:
    G = (4 * (-18 * pow(a, 2) + 3 * a * x + 10 * pow(x, 2))) /
        (15 * pow(a, 2) + 29 * a * x + 12 * pow(x, 2));
    printf("G = %lf\n\n", G);
    break;
  case 2:
    F = 1 / (cos(5 * pow(a, 2) + 14 * a * x - 3 * pow(x, 2)));
    printf("F = %lf\n\n", F);
    break;
  case 3:
    Y = acos(9 * pow(a, 2) + 42 * a * x + 40 * pow(x, 2) + 1);
    printf("Y = %lf\n\n", Y);
    break;
  default:
    printf("error");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
xor    %eax,%eax
mov    %al,-0x39(%rbp)
call   1030 <printf@plt>
mov    -0x39(%rbp),%al
lea    0xec9(%rip),%rdi
mov    %rdi,-0x48(%rbp)
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x39(%rbp),%al
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x48(%rbp),%rdi
mov    -0x39(%rbp),%al
lea    -0x18(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x39(%rbp),%al
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
mov    -0x39(%rbp),%al
lea    0xeb4(%rip),%rdi
lea    -0x34(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x34(%rbp),%eax
mov    %eax,-0x38(%rbp)
sub    $0x1,%eax
je     11fe <main+0xae>
jmp    11dc <main+0x8c>
mov    -0x38(%rbp),%eax
sub    $0x2,%eax
je     12e0 <main+0x190>
jmp    11ed <main+0x9d>
mov    -0x38(%rbp),%eax
sub    $0x3,%eax
je     1368 <main+0x218>
jmp    13ee <main+0x29e>
movsd  -0x10(%rbp),%xmm0
mov    $0x2,%edi
call   1070 <pow@plt>
imul   $0xffffffee,%eax,%eax
cvtsi2sd %eax,%xmm1
movsd  0xe09(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    $0x2,%edi
call   1070 <pow@plt>
movsd  -0x60(%rbp),%xmm1
imul   $0xa,%eax,%eax
cvtsi2sd %eax,%xmm0
addsd  %xmm0,%xmm1
movsd  0xdc3(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x2,%edi
call   1070 <pow@plt>
imul   $0xf,%eax,%eax
cvtsi2sd %eax,%xmm1
movsd  0xd94(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    $0x2,%edi
call   1070 <pow@plt>
movsd  -0x58(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm0
imul   $0xc,%eax,%eax
cvtsi2sd %eax,%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
lea    0xda2(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    13fc <main+0x2ac>
movsd  -0x10(%rbp),%xmm0
mov    $0x2,%edi
call   1070 <pow@plt>
imul   $0x5,%eax,%eax
cvtsi2sd %eax,%xmm1
movsd  0xd12(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    $0x2,%edi
call   1070 <pow@plt>
movsd  -0x68(%rbp),%xmm0
imul   $0x3,%eax,%eax
cvtsi2sd %eax,%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1060 <cos@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
lea    0xd24(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    13fc <main+0x2ac>
movsd  -0x10(%rbp),%xmm0
mov    $0x2,%edi
call   1070 <pow@plt>
imul   $0x9,%eax,%eax
cvtsi2sd %eax,%xmm1
movsd  0xc82(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    $0x2,%edi
call   1070 <pow@plt>
movsd  -0x70(%rbp),%xmm0
imul   $0x28,%eax,%eax
cvtsi2sd %eax,%xmm1
addsd  %xmm1,%xmm0
movsd  0xc3c(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <acos@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
lea    0xca8(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    13fc <main+0x2ac>
lea    0xc9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed9(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xec7(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xebe(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec8(%rip),%rdi
lea    0x24(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0x24(%rsp),%eax
cmp    $0x3,%eax
je     12af <main+0x15f>
cmp    $0x2,%eax
je     131f <main+0x1cf>
cmp    $0x1,%eax
jne    13a1 <main+0x251>
movsd  0x8(%rsp),%xmm0
mov    $0x2,%edi
call   1070 <pow@plt>
add    %eax,%eax
lea    (%rax,%rax,8),%eax
neg    %eax
cvtsi2sd %eax,%xmm1
movsd  0x8(%rsp),%xmm2
mulsd  0xe19(%rip),%xmm2
movsd  0x18(%rsp),%xmm0
mulsd  %xmm0,%xmm2
addsd  %xmm1,%xmm2
movsd  %xmm2,0x10(%rsp)
mov    $0x2,%edi
call   1070 <pow@plt>
add    %eax,%eax
lea    (%rax,%rax,4),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  0x10(%rsp),%xmm0
mulsd  0xde9(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
mov    $0x2,%edi
call   1070 <pow@plt>
lea    (%rax,%rax,4),%eax
lea    (%rax,%rax,2),%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  0x8(%rsp),%xmm2
mulsd  0xdc0(%rip),%xmm2
movsd  0x18(%rsp),%xmm0
mulsd  %xmm0,%xmm2
addsd  %xmm1,%xmm2
movsd  %xmm2,0x28(%rsp)
mov    $0x2,%edi
call   1070 <pow@plt>
shl    $0x2,%eax
lea    (%rax,%rax,2),%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
addsd  0x28(%rsp),%xmm1
movsd  0x10(%rsp),%xmm0
divsd  %xmm1,%xmm0
lea    0xdcc(%rip),%rdi
jmp    1398 <main+0x248>
movsd  0x8(%rsp),%xmm0
mov    $0x2,%edi
call   1070 <pow@plt>
lea    (%rax,%rax,8),%eax
cvtsi2sd %eax,%xmm1
movsd  0x8(%rsp),%xmm2
mulsd  0xd2c(%rip),%xmm2
movsd  0x18(%rsp),%xmm0
mulsd  %xmm0,%xmm2
addsd  %xmm1,%xmm2
movsd  %xmm2,0x10(%rsp)
mov    $0x2,%edi
call   1070 <pow@plt>
shl    $0x3,%eax
lea    (%rax,%rax,4),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  0x10(%rsp),%xmm0
addsd  0xcfb(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1040 <acos@plt>
lea    0xd6d(%rip),%rdi
jmp    1398 <main+0x248>
movsd  0x8(%rsp),%xmm0
mov    $0x2,%edi
call   1070 <pow@plt>
lea    (%rax,%rax,4),%eax
cvtsi2sd %eax,%xmm1
movsd  0x8(%rsp),%xmm2
mulsd  0xccc(%rip),%xmm2
movsd  0x18(%rsp),%xmm0
mulsd  %xmm0,%xmm2
addsd  %xmm1,%xmm2
movsd  %xmm2,0x10(%rsp)
mov    $0x2,%edi
call   1070 <pow@plt>
lea    (%rax,%rax,2),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
call   1060 <cos@plt>
lea    0x1(%rax),%ecx
xor    %edx,%edx
cmp    $0x3,%ecx
cmovb  %eax,%edx
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
lea    0xce8(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    13af <main+0x25f>
lea    0xcec(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"\D0\92\D0\B2\D0\B5\D0\B4\D0\B8\D1\82\D0\B5 a: \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [20 x i8] c"\D0\92\D0\B2\D0\B5\D0\B4\D0\B8\D1\82\D0\B5 \D1\85: \00"
@.str.3 = [24 x i8] c"enter c = 1 or 2 or 3: \00"
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [10 x i8] c"G = %lf\0A\0A\00"
@.str.6 = [10 x i8] c"F = %lf\0A\0A\00"
@.str.7 = [10 x i8] c"Y = %lf\0A\0A\00"
@.str.8 = [6 x i8] c"error\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca i32
store i32 0, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %3)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %7)
%14 = load i32, i32* %7
switch i32 %14, label %85 [
i32 1, label %15
i32 2, label %46
i32 3, label %66
]
15: ; preds = %0
%16 = load double, double* %2
%17 = call i32 @pow(double %16, i32 2)
%18 = mul nsw i32 -18, %17
%19 = sitofp i32 %18 to double
%20 = load double, double* %2
%21 = fmul double 3.000000e+00, %20
%22 = load double, double* %3
%23 = call double @llvm.fmuladd.f64(double %21, double %22, double %19)
%24 = load double, double* %3
%25 = call i32 @pow(double %24, i32 2)
%26 = mul nsw i32 10, %25
%27 = sitofp i32 %26 to double
%28 = fadd double %23, %27
%29 = fmul double 4.000000e+00, %28
%30 = load double, double* %2
%31 = call i32 @pow(double %30, i32 2)
%32 = mul nsw i32 15, %31
%33 = sitofp i32 %32 to double
%34 = load double, double* %2
%35 = fmul double 2.900000e+01, %34
%36 = load double, double* %3
%37 = call double @llvm.fmuladd.f64(double %35, double %36, double %33)
%38 = load double, double* %3
%39 = call i32 @pow(double %38, i32 2)
%40 = mul nsw i32 12, %39
%41 = sitofp i32 %40 to double
%42 = fadd double %37, %41
%43 = fdiv double %29, %42
store double %43, double* %4
%44 = load double, double* %4
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), double %44)
br label %87
46: ; preds = %0
%47 = load double, double* %2
%48 = call i32 @pow(double %47, i32 2)
%49 = mul nsw i32 5, %48
%50 = sitofp i32 %49 to double
%51 = load double, double* %2
%52 = fmul double 1.400000e+01, %51
%53 = load double, double* %3
%54 = call double @llvm.fmuladd.f64(double %52, double %53, double %50)
%55 = load double, double* %3
%56 = call i32 @pow(double %55, i32 2)
%57 = mul nsw i32 3, %56
%58 = sitofp i32 %57 to double
%59 = fsub double %54, %58
%60 = fptosi double %59 to i32
%61 = call i32 @cos(i32 %60)
%62 = sdiv i32 1, %61
%63 = sitofp i32 %62 to double
store double %63, double* %5
%64 = load double, double* %5
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), double %64)
br label %87
66: ; preds = %0
%67 = load double, double* %2
%68 = call i32 @pow(double %67, i32 2)
%69 = mul nsw i32 9, %68
%70 = sitofp i32 %69 to double
%71 = load double, double* %2
%72 = fmul double 4.200000e+01, %71
%73 = load double, double* %3
%74 = call double @llvm.fmuladd.f64(double %72, double %73, double %70)
%75 = load double, double* %3
%76 = call i32 @pow(double %75, i32 2)
%77 = mul nsw i32 40, %76
%78 = sitofp i32 %77 to double
%79 = fadd double %74, %78
%80 = fadd double %79, 1.000000e+00
%81 = fptosi double %80 to i32
%82 = call double @acos(i32 %81)
store double %82, double* %6
%83 = load double, double* %6
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), double %83)
br label %87
85: ; preds = %0
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
br label %87
87: ; preds = %85, %66, %46, %15
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"\D0\92\D0\B2\D0\B5\D0\B4\D0\B8\D1\82\D0\B5 a: \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [20 x i8] c"\D0\92\D0\B2\D0\B5\D0\B4\D0\B8\D1\82\D0\B5 \D1\85: \00"
@.str.3 = [24 x i8] c"enter c = 1 or 2 or 3: \00"
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [10 x i8] c"G = %lf\0A\0A\00"
@.str.6 = [10 x i8] c"F = %lf\0A\0A\00"
@.str.7 = [10 x i8] c"Y = %lf\0A\0A\00"
@.str.8 = [6 x i8] c"error\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca i32
%4 = bitcast double* %1 to i8*
%5 = bitcast double* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %3)
%13 = load i32, i32* %3
switch i32 %13, label %79 [
i32 1, label %14
i32 2, label %42
i32 3, label %62
]
14: ; preds = %0
%15 = load double, double* %1
%16 = call i32 @pow(double %15, i32 2)
%17 = mul nsw i32 %16, -18
%18 = sitofp i32 %17 to double
%19 = load double, double* %1
%20 = fmul double %19, 3.000000e+00
%21 = load double, double* %2
%22 = call double @llvm.fmuladd.f64(double %20, double %21, double %18)
%23 = call i32 @pow(double %21, i32 2)
%24 = mul nsw i32 %23, 10
%25 = sitofp i32 %24 to double
%26 = fadd double %22, %25
%27 = fmul double %26, 4.000000e+00
%28 = load double, double* %1
%29 = call i32 @pow(double %28, i32 2)
%30 = mul nsw i32 %29, 15
%31 = sitofp i32 %30 to double
%32 = load double, double* %1
%33 = fmul double %32, 2.900000e+01
%34 = load double, double* %2
%35 = call double @llvm.fmuladd.f64(double %33, double %34, double %31)
%36 = call i32 @pow(double %34, i32 2)
%37 = mul nsw i32 %36, 12
%38 = sitofp i32 %37 to double
%39 = fadd double %35, %38
%40 = fdiv double %27, %39
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), double %40)
br label %81
42: ; preds = %0
%43 = load double, double* %1
%44 = call i32 @pow(double %43, i32 2)
%45 = mul nsw i32 %44, 5
%46 = sitofp i32 %45 to double
%47 = load double, double* %1
%48 = fmul double %47, 1.400000e+01
%49 = load double, double* %2
%50 = call double @llvm.fmuladd.f64(double %48, double %49, double %46)
%51 = call i32 @pow(double %49, i32 2)
%52 = mul nsw i32 %51, 3
%53 = sitofp i32 %52 to double
%54 = fsub double %50, %53
%55 = fptosi double %54 to i32
%56 = call i32 @cos(i32 %55)
%57 = add i32 %56, 1
%58 = icmp ult i32 %57, 3
%59 = select i1 %58, i32 %56, i32 0
%60 = sitofp i32 %59 to double
%61 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), double %60)
br label %81
62: ; preds = %0
%63 = load double, double* %1
%64 = call i32 @pow(double %63, i32 2)
%65 = mul nsw i32 %64, 9
%66 = sitofp i32 %65 to double
%67 = load double, double* %1
%68 = fmul double %67, 4.200000e+01
%69 = load double, double* %2
%70 = call double @llvm.fmuladd.f64(double %68, double %69, double %66)
%71 = call i32 @pow(double %69, i32 2)
%72 = mul nsw i32 %71, 40
%73 = sitofp i32 %72 to double
%74 = fadd double %70, %73
%75 = fadd double %74, 1.000000e+00
%76 = fptosi double %75 to i32
%77 = call double @acos(i32 %76)
%78 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), double %77)
br label %81
79: ; preds = %0
%80 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
br label %81
81: ; preds = %79, %62, %42, %14
ret i32 0
}