#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 cos(double);
int pow(int, double);
int /*<<< orphan*/ printf(char *, double, double);
int /*<<< orphan*/ scanf(char *, double *, double *);
int sin(double);
int main(void) {
  double a, b, z1, z2;
  scanf("%lf %lf", &a, &b);
  z1 = (pow((cos(a) - cos(b)), 2)) - (pow((sin(a) - sin(b)), 2));
  z2 = -4 * (pow(sin((a - b) / 2), 2.0)) * cos(a + b);
  printf("z1 = %lf\nz2 = %lf\n", z1, z2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xea2(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1050 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
call   1060 <cos@plt>
mov    %eax,-0x38(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1060 <cos@plt>
mov    -0x38(%rbp),%edi
sub    %eax,%edi
movsd  0xe69(%rip),%xmm0
call   1070 <pow@plt>
mov    %eax,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <sin@plt>
mov    %eax,-0x34(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <sin@plt>
mov    -0x34(%rbp),%edi
sub    %eax,%edi
movsd  0xe3d(%rip),%xmm0
call   1070 <pow@plt>
mov    %eax,%ecx
mov    -0x30(%rbp),%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  0xe16(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1040 <sin@plt>
mov    %eax,%edi
movsd  0xe03(%rip),%xmm0
call   1070 <pow@plt>
imul   $0xfffffffc,%eax,%eax
mov    %eax,-0x2c(%rbp)
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
call   1060 <cos@plt>
mov    %eax,%ecx
mov    -0x2c(%rbp),%eax
imul   %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
lea    0xdd4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
lea    0xeb3(%rip),%rdi
lea    0x8(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
movsd  0x8(%rsp),%xmm0
call   1060 <cos@plt>
mov    %eax,%ebx
movsd  (%rsp),%xmm0
call   1060 <cos@plt>
sub    %eax,%ebx
movsd  0xe75(%rip),%xmm0
mov    %ebx,%edi
call   1070 <pow@plt>
mov    %eax,%ebx
movsd  0x8(%rsp),%xmm0
call   1040 <sin@plt>
mov    %eax,%ebp
movsd  (%rsp),%xmm0
call   1040 <sin@plt>
sub    %eax,%ebp
mov    %ebp,%edi
movsd  0xe49(%rip),%xmm0
call   1070 <pow@plt>
sub    %eax,%ebx
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
subsd  (%rsp),%xmm0
mulsd  0xe2a(%rip),%xmm0
call   1040 <sin@plt>
mov    %eax,%edi
movsd  0xe13(%rip),%xmm0
call   1070 <pow@plt>
mov    %eax,%ebx
movsd  0x8(%rsp),%xmm0
addsd  (%rsp),%xmm0
call   1060 <cos@plt>
imul   %ebx,%eax
shl    $0x2,%eax
neg    %eax
cvtsi2sd %eax,%xmm1
lea    0xe01(%rip),%rdi
movsd  0x10(%rsp),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%lf %lf\00"
@.str.1 = [19 x i8] c"z1 = %lf\0Az2 = %lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
store i32 0, i32* %1
%6 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double* %2, double* %3)
%7 = load double, double* %2
%8 = call i32 @cos(double %7)
%9 = load double, double* %3
%10 = call i32 @cos(double %9)
%11 = sub nsw i32 %8, %10
%12 = call i32 @pow(i32 %11, double 2.000000e+00)
%13 = load double, double* %2
%14 = call i32 @sin(double %13)
%15 = load double, double* %3
%16 = call i32 @sin(double %15)
%17 = sub nsw i32 %14, %16
%18 = call i32 @pow(i32 %17, double 2.000000e+00)
%19 = sub nsw i32 %12, %18
%20 = sitofp i32 %19 to double
store double %20, double* %4
%21 = load double, double* %2
%22 = load double, double* %3
%23 = fsub double %21, %22
%24 = fdiv double %23, 2.000000e+00
%25 = call i32 @sin(double %24)
%26 = call i32 @pow(i32 %25, double 2.000000e+00)
%27 = mul nsw i32 -4, %26
%28 = load double, double* %2
%29 = load double, double* %3
%30 = fadd double %28, %29
%31 = call i32 @cos(double %30)
%32 = mul nsw i32 %27, %31
%33 = sitofp i32 %32 to double
store double %33, double* %5
%34 = load double, double* %4
%35 = load double, double* %5
%36 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), double %34, double %35)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"%lf %lf\00"
@.str.1 = [19 x i8] c"z1 = %lf\0Az2 = %lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = bitcast double* %1 to i8*
%4 = bitcast double* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double* %1, double* %2)
%6 = load double, double* %1
%7 = call i32 @cos(double %6)
%8 = load double, double* %2
%9 = call i32 @cos(double %8)
%10 = sub nsw i32 %7, %9
%11 = call i32 @pow(i32 %10, double 2.000000e+00)
%12 = load double, double* %1
%13 = call i32 @sin(double %12)
%14 = load double, double* %2
%15 = call i32 @sin(double %14)
%16 = sub nsw i32 %13, %15
%17 = call i32 @pow(i32 %16, double 2.000000e+00)
%18 = sub nsw i32 %11, %17
%19 = sitofp i32 %18 to double
%20 = load double, double* %1
%21 = load double, double* %2
%22 = fsub double %20, %21
%23 = fmul double %22, 5.000000e-01
%24 = call i32 @sin(double %23)
%25 = call i32 @pow(i32 %24, double 2.000000e+00)
%26 = mul nsw i32 %25, -4
%27 = load double, double* %1
%28 = load double, double* %2
%29 = fadd double %27, %28
%30 = call i32 @cos(double %29)
%31 = mul nsw i32 %26, %30
%32 = sitofp i32 %31 to double
%33 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), double %19, double %32)
ret i32 0
}