#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 */
float arc_seno(double);
int /*<<< orphan*/ exit(int);
float floor(float);
int /*<<< orphan*/ printf(char *, float, float);
float seno(double);
double strtod(char *, int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  char func = 's';
  double rad = 0;
  if (argc < 3) {
    exit(1);
  }
  func = argv[1][1];
  rad = strtod(argv[2], NULL);
  if (func == 's') {
    printf("seno (%.2lf) = %.2lf\n", floor(rad * 100.0f) / 100.0f,
           floor(seno(rad) * 100.0f) / 100.0f);
  } else if (func == 'a') {
    printf("arc_seno (%.2lf) = %.2lf\n", floor(rad * 100.0f) / 100.0f,
           floor(arc_seno(rad) * 100.0f) / 100.0f);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x73,-0x11(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    1196 <main+0x36>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x1(%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <strtod@plt>
movsd  %xmm0,-0x20(%rbp)
movsbl -0x11(%rbp),%eax
cmp    $0x73,%eax
jne    122e <main+0xce>
movsd  0xe39(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
call   1080 <floor@plt>
movss  0xe1b(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x24(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1060 <seno@plt>
movss  0xe00(%rip),%xmm1
mulss  %xmm1,%xmm0
call   1080 <floor@plt>
movaps %xmm0,%xmm1
movss  -0x24(%rbp),%xmm0
movss  0xde7(%rip),%xmm2
divss  %xmm2,%xmm1
lea    0xdf0(%rip),%rdi
call   1050 <printf@plt>
jmp    12a2 <main+0x142>
movsbl -0x11(%rbp),%eax
cmp    $0x61,%eax
jne    129d <main+0x13d>
movsd  0xdc5(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
call   1080 <floor@plt>
movss  0xda7(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <arc_seno@plt>
movss  0xd8c(%rip),%xmm1
mulss  %xmm1,%xmm0
call   1080 <floor@plt>
movaps %xmm0,%xmm1
movss  -0x28(%rbp),%xmm0
movss  0xd73(%rip),%xmm2
divss  %xmm2,%xmm1
lea    0xd78(%rip),%rdi
call   1050 <printf@plt>
jmp    12a2 <main+0x142>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
cmp    $0x2,%edi
jle    1241 <main+0xe1>
mov    0x8(%rsi),%rax
mov    0x10(%rsi),%rdi
mov    0x1(%rax),%bl
xor    %esi,%esi
call   1040 <strtod@plt>
cmp    $0x61,%bl
je     11df <main+0x7f>
cmp    $0x73,%bl
jne    1239 <main+0xd9>
movsd  %xmm0,0x8(%rsp)
mulsd  0xe64(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
call   1060 <floorf@plt>
divss  0xe5b(%rip),%xmm0
movss  %xmm0,0x4(%rsp)
movsd  0x8(%rsp),%xmm0
call   1070 <seno@plt>
mulss  0xe42(%rip),%xmm0
call   1060 <floorf@plt>
movaps %xmm0,%xmm1
divss  0xe32(%rip),%xmm1
lea    0xe33(%rip),%rdi
jmp    122e <main+0xce>
movsd  %xmm0,0x8(%rsp)
mulsd  0xe13(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
call   1060 <floorf@plt>
divss  0xe0a(%rip),%xmm0
movss  %xmm0,0x4(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <arc_seno@plt>
mulss  0xdf1(%rip),%xmm0
call   1060 <floorf@plt>
movaps %xmm0,%xmm1
divss  0xde1(%rip),%xmm1
lea    0xdde(%rip),%rdi
movss  0x4(%rsp),%xmm0
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret
mov    $0x1,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"seno (%.2lf) = %.2lf\0A\00"
@.str.1 = [26 x i8] c"arc_seno (%.2lf) = %.2lf\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
%7 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8 115, i8* %6
store double 0.000000e+00, double* %7
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 3
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = getelementptr inbounds i8, i8* %15, i64 1
%17 = load i8, i8* %16
store i8 %17, i8* %6
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 2
%20 = load i8*, i8** %19
%21 = call double @strtod(i8* %20, i32* null)
store double %21, double* %7
%22 = load i8, i8* %6
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 115
br i1 %24, label %25, label %37
25: ; preds = %12
%26 = load double, double* %7
%27 = fmul double %26, 1.000000e+02
%28 = fptrunc double %27 to float
%29 = call float @floor(float %28)
%30 = fdiv float %29, 1.000000e+02
%31 = load double, double* %7
%32 = call float @seno(double %31)
%33 = fmul float %32, 1.000000e+02
%34 = call float @floor(float %33)
%35 = fdiv float %34, 1.000000e+02
%36 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), float %30, float %35)
br label %54
37: ; preds = %12
%38 = load i8, i8* %6
%39 = sext i8 %38 to i32
%40 = icmp eq i32 %39, 97
br i1 %40, label %41, label %53
41: ; preds = %37
%42 = load double, double* %7
%43 = fmul double %42, 1.000000e+02
%44 = fptrunc double %43 to float
%45 = call float @floor(float %44)
%46 = fdiv float %45, 1.000000e+02
%47 = load double, double* %7
%48 = call float @arc_seno(double %47)
%49 = fmul float %48, 1.000000e+02
%50 = call float @floor(float %49)
%51 = fdiv float %50, 1.000000e+02
%52 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), float %46, float %51)
br label %53
53: ; preds = %41, %37
br label %54
54: ; preds = %53, %25
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"seno (%.2lf) = %.2lf\0A\00"
@.str.1 = [26 x i8] c"arc_seno (%.2lf) = %.2lf\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 3
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @exit(i32 1)
unreachable
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = getelementptr inbounds i8*, i8** %1, i64 2
%12 = load i8*, i8** %11
%13 = tail call double @strtod(i8* nocapture %12, i32* null)
switch i8 %10, label %34 [
i8 115, label %14
i8 97, label %24
]
14: ; preds = %6
%15 = fmul double %13, 1.000000e+02
%16 = fptrunc double %15 to float
%17 = tail call float @llvm.floor.f32(float %16)
%18 = fdiv float %17, 1.000000e+02
%19 = tail call float @seno(double %13)
%20 = fmul float %19, 1.000000e+02
%21 = tail call float @llvm.floor.f32(float %20)
%22 = fdiv float %21, 1.000000e+02
%23 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), float %18, float %22)
br label %34
24: ; preds = %6
%25 = fmul double %13, 1.000000e+02
%26 = fptrunc double %25 to float
%27 = tail call float @llvm.floor.f32(float %26)
%28 = fdiv float %27, 1.000000e+02
%29 = tail call float @arc_seno(double %13)
%30 = fmul float %29, 1.000000e+02
%31 = tail call float @llvm.floor.f32(float %30)
%32 = fdiv float %31, 1.000000e+02
%33 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), float %28, float %32)
br label %34
34: ; preds = %6, %24, %14
ret i32 0
}