#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 cos(double);
int /*<<< orphan*/ my_clear();
double pop();
double pow(double, double);
int /*<<< orphan*/ printt();
int /*<<< orphan*/ push(double);
double sin(double);
scalar_t__ strcmp(char *, char *);
double tan(double);
void lower_case(char s[]) {
  double op1, op2;
  if (strcmp(s, "pow") == 0) {
    push(pow(pop(), pop()));
  }
  if (strcmp(s, "sin") == 0) {
    push(sin(pop()));
  }
  if (strcmp(s, "cos") == 0) {
    push(cos(pop()));
  }
  if (strcmp(s, "tan") == 0) {
    push(tan(pop()));
  }
  if (strcmp(s, "p") == 0) {
    printt();
  }
  if (strcmp(s, "c") == 0) {
    my_clear();
  }
  if (strcmp(s, "s") == 0) {
    op2 = pop();
    op1 = pop();
    push(op2);
    push(op1);
  }
  if (strcmp(s, "d") == 0) {
    op2 = pop();
    push(op2);
    push(op2);
  }
}


x86 assembly (clang, -O0):
<lower_case>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe59(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    11db <lower_case+0x4b>
mov    $0x0,%al
call   1040 <pop@plt>
movsd  %xmm0,-0x20(%rbp)
mov    $0x0,%al
call   1040 <pop@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
call   10b0 <pow@plt>
call   10a0 <push@plt>
mov    -0x8(%rbp),%rdi
lea    0xe1e(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1206 <lower_case+0x76>
mov    $0x0,%al
call   1040 <pop@plt>
call   1060 <sin@plt>
call   10a0 <push@plt>
mov    -0x8(%rbp),%rdi
lea    0xdf7(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1231 <lower_case+0xa1>
mov    $0x0,%al
call   1040 <pop@plt>
call   1090 <cos@plt>
call   10a0 <push@plt>
mov    -0x8(%rbp),%rdi
lea    0xdd0(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    125c <lower_case+0xcc>
mov    $0x0,%al
call   1040 <pop@plt>
call   1080 <tan@plt>
call   10a0 <push@plt>
mov    -0x8(%rbp),%rdi
lea    0xda9(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    127d <lower_case+0xed>
mov    $0x0,%al
call   1030 <printt@plt>
mov    -0x8(%rbp),%rdi
lea    0xd8a(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    129e <lower_case+0x10e>
mov    $0x0,%al
call   1070 <my_clear@plt>
mov    -0x8(%rbp),%rdi
lea    0xd61(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    12e4 <lower_case+0x154>
mov    $0x0,%al
call   1040 <pop@plt>
movsd  %xmm0,-0x18(%rbp)
mov    $0x0,%al
call   1040 <pop@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x18(%rbp),%xmm0
call   10a0 <push@plt>
movsd  -0x10(%rbp),%xmm0
call   10a0 <push@plt>
mov    -0x8(%rbp),%rdi
lea    0xd25(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    131e <lower_case+0x18e>
mov    $0x0,%al
call   1040 <pop@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   10a0 <push@plt>
movsd  -0x18(%rbp),%xmm0
call   10a0 <push@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lower_case>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xe61(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    11ce <lower_case+0x3e>
xor    %eax,%eax
call   1040 <pop@plt>
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1040 <pop@plt>
movaps %xmm0,%xmm1
movsd  (%rsp),%xmm0
call   10b0 <pow@plt>
call   10a0 <push@plt>
lea    0xe2f(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    11f3 <lower_case+0x63>
xor    %eax,%eax
call   1040 <pop@plt>
call   1060 <sin@plt>
call   10a0 <push@plt>
lea    0xe0e(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    1218 <lower_case+0x88>
xor    %eax,%eax
call   1040 <pop@plt>
call   1090 <cos@plt>
call   10a0 <push@plt>
lea    0xded(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    123d <lower_case+0xad>
xor    %eax,%eax
call   1040 <pop@plt>
call   1080 <tan@plt>
call   10a0 <push@plt>
lea    0xdcc(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    1258 <lower_case+0xc8>
xor    %eax,%eax
call   1030 <printt@plt>
lea    0xdb3(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    1273 <lower_case+0xe3>
xor    %eax,%eax
call   1070 <my_clear@plt>
lea    0xd90(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    12b5 <lower_case+0x125>
xor    %eax,%eax
call   1040 <pop@plt>
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1040 <pop@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
call   10a0 <push@plt>
movsd  0x8(%rsp),%xmm0
call   10a0 <push@plt>
lea    0xd58(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
je     12cf <lower_case+0x13f>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
call   1040 <pop@plt>
movsd  %xmm0,(%rsp)
call   10a0 <push@plt>
movsd  (%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
jmp    10a0 <push@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"pow\00"
@.str.1 = [4 x i8] c"sin\00"
@.str.2 = [4 x i8] c"cos\00"
@.str.3 = [4 x i8] c"tan\00"
@.str.4 = [2 x i8] c"p\00"
@.str.5 = [2 x i8] c"c\00"
@.str.6 = [2 x i8] c"s\00"
@.str.7 = [2 x i8] c"d\00"
define void @lower_case(i8* %0) {
%2 = alloca i8*
%3 = alloca double
%4 = alloca double
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = call double (...) @pop()
%10 = call double (...) @pop()
%11 = call double @pow(double %9, double %10)
%12 = call i32 @push(double %11)
br label %13
13: ; preds = %8, %1
%14 = load i8*, i8** %2
%15 = call i64 @strcmp(i8* %14, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %21
17: ; preds = %13
%18 = call double (...) @pop()
%19 = call double @sin(double %18)
%20 = call i32 @push(double %19)
br label %21
21: ; preds = %17, %13
%22 = load i8*, i8** %2
%23 = call i64 @strcmp(i8* %22, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %29
25: ; preds = %21
%26 = call double (...) @pop()
%27 = call double @cos(double %26)
%28 = call i32 @push(double %27)
br label %29
29: ; preds = %25, %21
%30 = load i8*, i8** %2
%31 = call i64 @strcmp(i8* %30, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%32 = icmp eq i64 %31, 0
br i1 %32, label %33, label %37
33: ; preds = %29
%34 = call double (...) @pop()
%35 = call double @tan(double %34)
%36 = call i32 @push(double %35)
br label %37
37: ; preds = %33, %29
%38 = load i8*, i8** %2
%39 = call i64 @strcmp(i8* %38, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%40 = icmp eq i64 %39, 0
br i1 %40, label %41, label %43
41: ; preds = %37
%42 = call i32 (...) @printt()
br label %43
43: ; preds = %41, %37
%44 = load i8*, i8** %2
%45 = call i64 @strcmp(i8* %44, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%46 = icmp eq i64 %45, 0
br i1 %46, label %47, label %49
47: ; preds = %43
%48 = call i32 (...) @my_clear()
br label %49
49: ; preds = %47, %43
%50 = load i8*, i8** %2
%51 = call i64 @strcmp(i8* %50, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%52 = icmp eq i64 %51, 0
br i1 %52, label %53, label %60
53: ; preds = %49
%54 = call double (...) @pop()
store double %54, double* %4
%55 = call double (...) @pop()
store double %55, double* %3
%56 = load double, double* %4
%57 = call i32 @push(double %56)
%58 = load double, double* %3
%59 = call i32 @push(double %58)
br label %60
60: ; preds = %53, %49
%61 = load i8*, i8** %2
%62 = call i64 @strcmp(i8* %61, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%63 = icmp eq i64 %62, 0
br i1 %63, label %64, label %70
64: ; preds = %60
%65 = call double (...) @pop()
store double %65, double* %4
%66 = load double, double* %4
%67 = call i32 @push(double %66)
%68 = load double, double* %4
%69 = call i32 @push(double %68)
br label %70
70: ; preds = %64, %60
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"pow\00"
@.str.1 = [4 x i8] c"sin\00"
@.str.2 = [4 x i8] c"cos\00"
@.str.3 = [4 x i8] c"tan\00"
@.str.4 = [2 x i8] c"p\00"
@.str.5 = [2 x i8] c"c\00"
@.str.6 = [2 x i8] c"s\00"
@.str.7 = [2 x i8] c"d\00"
define void @lower_case(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 %9
4: ; preds = %1
%5 = tail call double (...) @pop()
%6 = tail call double (...) @pop()
%7 = tail call double @pow(double %5, double %6)
%8 = tail call i32 @push(double %7)
br label %9
9: ; preds = %4, %1
%10 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %9
%13 = tail call double (...) @pop()
%14 = tail call double @sin(double %13)
%15 = tail call i32 @push(double %14)
br label %16
16: ; preds = %12, %9
%17 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %23
19: ; preds = %16
%20 = tail call double (...) @pop()
%21 = tail call double @cos(double %20)
%22 = tail call i32 @push(double %21)
br label %23
23: ; preds = %19, %16
%24 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%25 = icmp eq i64 %24, 0
br i1 %25, label %26, label %30
26: ; preds = %23
%27 = tail call double (...) @pop()
%28 = tail call double @tan(double %27)
%29 = tail call i32 @push(double %28)
br label %30
30: ; preds = %26, %23
%31 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%32 = icmp eq i64 %31, 0
br i1 %32, label %33, label %35
33: ; preds = %30
%34 = tail call i32 (...) @printt()
br label %35
35: ; preds = %33, %30
%36 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%37 = icmp eq i64 %36, 0
br i1 %37, label %38, label %40
38: ; preds = %35
%39 = tail call i32 (...) @my_clear()
br label %40
40: ; preds = %38, %35
%41 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%42 = icmp eq i64 %41, 0
br i1 %42, label %43, label %48
43: ; preds = %40
%44 = tail call double (...) @pop()
%45 = tail call double (...) @pop()
%46 = tail call i32 @push(double %44)
%47 = tail call i32 @push(double %45)
br label %48
48: ; preds = %43, %40
%49 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%50 = icmp eq i64 %49, 0
br i1 %50, label %51, label %55
51: ; preds = %48
%52 = tail call double (...) @pop()
%53 = tail call i32 @push(double %52)
%54 = tail call i32 @push(double %52)
br label %55
55: ; preds = %51, %48
ret void
}