#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*/ cos(double);
double pop();
int /*<<< orphan*/ pow(double, double);
int /*<<< orphan*/ push(int /*<<< orphan*/);
int /*<<< orphan*/ sin(double);
scalar_t__ strcmp(char *, char *);
void sinCosPow(char *s) {
  double op2;
  if (0 == strcmp(s, "sin")) {
    push(sin(pop()));
  }
  if (0 == strcmp(s, "cos")) {
    push(cos(pop()));
  }
  if (0 == strcmp(s, "pow")) {
    op2 = pop();
    push(pow(pop(), op2));
  }
  return;
}


x86 assembly (clang, -O0):
<sinCosPow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe89(%rip),%rsi
call   1040 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    119d <sinCosPow+0x3d>
mov    $0x0,%al
call   1030 <pop@plt>
call   1050 <sin@plt>
mov    %eax,%edi
call   1070 <push@plt>
mov    -0x8(%rbp),%rdi
lea    0xe5c(%rip),%rsi
call   1040 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    11ce <sinCosPow+0x6e>
mov    $0x0,%al
call   1030 <pop@plt>
call   1060 <cos@plt>
mov    %eax,%edi
call   1070 <push@plt>
mov    -0x8(%rbp),%rdi
lea    0xe2f(%rip),%rsi
call   1040 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    1210 <sinCosPow+0xb0>
mov    $0x0,%al
call   1030 <pop@plt>
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <pop@plt>
movsd  -0x10(%rbp),%xmm1
call   1080 <pow@plt>
mov    %eax,%edi
call   1070 <push@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sinCosPow>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xe91(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    118c <sinCosPow+0x2c>
xor    %eax,%eax
call   1030 <pop@plt>
call   1050 <sin@plt>
mov    %eax,%edi
call   1070 <push@plt>
lea    0xe71(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    11b3 <sinCosPow+0x53>
xor    %eax,%eax
call   1030 <pop@plt>
call   1060 <cos@plt>
mov    %eax,%edi
call   1070 <push@plt>
lea    0xe4e(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     11cd <sinCosPow+0x6d>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
call   1030 <pop@plt>
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <pop@plt>
movsd  0x8(%rsp),%xmm1
call   1080 <pow@plt>
mov    %eax,%edi
add    $0x10,%rsp
pop    %rbx
jmp    1070 <push@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"sin\00"
@.str.1 = [4 x i8] c"cos\00"
@.str.2 = [4 x i8] c"pow\00"
define void @sinCosPow(i8* %0) {
%2 = alloca i8*
%3 = alloca double
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 0, %5
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = call double (...) @pop()
%9 = call i32 @sin(double %8)
%10 = call i32 @push(i32 %9)
br label %11
11: ; preds = %7, %1
%12 = load i8*, i8** %2
%13 = call i64 @strcmp(i8* %12, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%14 = icmp eq i64 0, %13
br i1 %14, label %15, label %19
15: ; preds = %11
%16 = call double (...) @pop()
%17 = call i32 @cos(double %16)
%18 = call i32 @push(i32 %17)
br label %19
19: ; preds = %15, %11
%20 = load i8*, i8** %2
%21 = call i64 @strcmp(i8* %20, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%22 = icmp eq i64 0, %21
br i1 %22, label %23, label %29
23: ; preds = %19
%24 = call double (...) @pop()
store double %24, double* %3
%25 = call double (...) @pop()
%26 = load double, double* %3
%27 = call i32 @pow(double %25, double %26)
%28 = call i32 @push(i32 %27)
br label %29
29: ; preds = %23, %19
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"sin\00"
@.str.1 = [4 x i8] c"cos\00"
@.str.2 = [4 x i8] c"pow\00"
define void @sinCosPow(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call double (...) @pop()
%6 = tail call i32 @sin(double %5)
%7 = tail call i32 @push(i32 %6)
br label %8
8: ; preds = %4, %1
%9 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %8
%12 = tail call double (...) @pop()
%13 = tail call i32 @cos(double %12)
%14 = tail call i32 @push(i32 %13)
br label %15
15: ; preds = %11, %8
%16 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %23
18: ; preds = %15
%19 = tail call double (...) @pop()
%20 = tail call double (...) @pop()
%21 = tail call i32 @pow(double %20, double %19)
%22 = tail call i32 @push(i32 %21)
br label %23
23: ; preds = %18, %15
ret void
}