#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(float);
int pow(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int sin(float);
void main() {
  float a;
  printf("a = ");
  scanf("%f", &a);
  float z = (sin(2 * a) + sin(5 * a) - sin(3 * a)) /
            (cos(a) + 1 - 2 * pow(sin(2 * a), 2));
  printf("\nz1 = %f", z);
  z = 2 * sin(a);
  printf("\nz2 = %f\n", z);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeaa(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
movss  0xe82(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
call   1040 <sin@plt>
mov    %eax,-0x18(%rbp)
movss  0xe75(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
call   1040 <sin@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
movss  0xe55(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
call   1040 <sin@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
call   1060 <cos@plt>
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
movss  0xe25(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
call   1040 <sin@plt>
mov    %eax,%edi
mov    $0x2,%esi
call   1070 <pow@plt>
mov    -0x10(%rbp),%ecx
mov    %eax,%edx
mov    -0xc(%rbp),%eax
shl    $0x1,%edx
sub    %edx,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdf7(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x4(%rbp),%xmm0
call   1040 <sin@plt>
shl    $0x1,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdd3(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xeae(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeab(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
movss  0x4(%rsp),%xmm0
addss  %xmm0,%xmm0
call   1040 <sin@plt>
mov    %eax,%ebp
movss  0x4(%rsp),%xmm0
mulss  0xe6f(%rip),%xmm0
call   1040 <sin@plt>
mov    %eax,%ebx
add    %ebp,%ebx
movss  0x4(%rsp),%xmm0
mulss  0xe5c(%rip),%xmm0
call   1040 <sin@plt>
sub    %eax,%ebx
movss  0x4(%rsp),%xmm0
call   1060 <cos@plt>
mov    %eax,%ebp
movss  0x4(%rsp),%xmm0
addss  %xmm0,%xmm0
call   1040 <sin@plt>
mov    %eax,%edi
mov    $0x2,%esi
call   1070 <pow@plt>
add    %eax,%eax
neg    %eax
lea    (%rax,%rbp,1),%ecx
add    $0x1,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe15(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  0x4(%rsp),%xmm0
call   1040 <sin@plt>
add    %eax,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdf8(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

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