#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 _error(int, char *, char const *);
double cos(double);
double cosl(double);
double fabs(double);
double fabsf(double);
double fabsl(double);
int fmod(int, int);
int fmodl(int, int);
double pow(double, double);
double round(double);
double sin(double);
double sinl(double);
double sqrt(double);
int _math(char const *progname) {
  int ret = 0;
  if (cos(0.0) != 1.0 || cosl(0.0) != 1.0)
    ret |= _error(2, "%s: cos(): Wrong value", progname);
  if (sin(0.0) != 0.0 || sinl(0.0) != 0.0)
    ret |= _error(2, "%s: sin(): Wrong value", progname);
  if (fabs(-3.0) != 3.0 || fabsf(-3.0) != 3.0 || fabsl(-3.0) != 3.0)
    ret |= _error(4, "%s: fabs(): Wrong value", progname);
  if (fmod(11, 7) != 4 || fmodl(11, 7) != 4)
    ret |= _error(8, "%s: fmod(): Wrong value", progname);
  if (pow(3.0, 0.0) != 1.0 || pow(4.0, 1.0) != 4.0 || pow(2.0, 3.0) != 8.0)
    ret |= _error(16, "%s: pow(): Wrong value", progname);
  if (round(1.5) != 2.0)
    ret |= _error(32, "%s: round(): Wrong value", progname);
  if (sqrt(4.0) != 2.0)
    ret |= _error(64, "%s: sqrt(): Wrong value", progname);
  return ret;
}


x86 assembly (clang, -O0):
<_math>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
xorps  %xmm0,%xmm0
call   10b0 <cos@plt>
movsd  0xe1d(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1218 <_math+0x58>
jp     1218 <_math+0x58>
xorps  %xmm0,%xmm0
call   1060 <cosl@plt>
movsd  0xdfd(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1218 <_math+0x58>
jp     1218 <_math+0x58>
jmp    1233 <_math+0x73>
mov    -0x8(%rbp),%rdx
mov    $0x2,%edi
lea    0xe10(%rip),%rsi
call   10a0 <_error@plt>
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
xorps  %xmm0,%xmm0
call   1090 <sin@plt>
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    126e <_math+0xae>
jp     126e <_math+0xae>
xorps  %xmm0,%xmm0
call   1030 <sinl@plt>
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    126e <_math+0xae>
jp     126e <_math+0xae>
jmp    1289 <_math+0xc9>
mov    -0x8(%rbp),%rdx
mov    $0x2,%edi
lea    0xdd1(%rip),%rsi
call   10a0 <_error@plt>
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
movsd  0xd77(%rip),%xmm0
movsd  0xd6f(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    12f8 <_math+0x138>
jp     12f8 <_math+0x138>
movsd  0xd5f(%rip),%xmm0
call   1040 <fabsf@plt>
movsd  0xd4a(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    12f8 <_math+0x138>
jp     12f8 <_math+0x138>
movsd  0xd3a(%rip),%xmm0
call   1050 <fabsl@plt>
movsd  0xd25(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    12f8 <_math+0x138>
jp     12f8 <_math+0x138>
jmp    1313 <_math+0x153>
mov    -0x8(%rbp),%rdx
mov    $0x4,%edi
lea    0xd5e(%rip),%rsi
call   10a0 <_error@plt>
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0xb,%edi
mov    $0x7,%esi
call   1080 <fmod@plt>
cmp    $0x4,%eax
jne    1343 <_math+0x183>
mov    $0xb,%edi
mov    $0x7,%esi
call   1070 <fmodl@plt>
cmp    $0x4,%eax
je     135e <_math+0x19e>
mov    -0x8(%rbp),%rdx
mov    $0x8,%edi
lea    0xd2b(%rip),%rsi
call   10a0 <_error@plt>
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
movsd  0xca2(%rip),%xmm0
xorps  %xmm1,%xmm1
call   10c0 <pow@plt>
movsd  0xc8a(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    13e5 <_math+0x225>
jp     13e5 <_math+0x225>
movsd  0xc8a(%rip),%xmm0
movsd  0xc6a(%rip),%xmm1
call   10c0 <pow@plt>
movsd  0xc75(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    13e5 <_math+0x225>
jp     13e5 <_math+0x225>
movsd  0xc6d(%rip),%xmm0
movsd  0xc45(%rip),%xmm1
call   10c0 <pow@plt>
movsd  0xc50(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    13e5 <_math+0x225>
jp     13e5 <_math+0x225>
jmp    1400 <_math+0x240>
mov    -0x8(%rbp),%rdx
mov    $0x10,%edi
lea    0xca1(%rip),%rsi
call   10a0 <_error@plt>
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
movsd  0xc28(%rip),%xmm0
call   10d0 <round@plt>
movsd  0xc13(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    142a <_math+0x26a>
jp     142a <_math+0x26a>
jmp    1445 <_math+0x285>
mov    -0x8(%rbp),%rdx
mov    $0x20,%edi
lea    0xc73(%rip),%rsi
call   10a0 <_error@plt>
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
movsd  0xbcb(%rip),%xmm0
call   10e0 <sqrt@plt>
movsd  0xbce(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    146f <_math+0x2af>
jp     146f <_math+0x2af>
jmp    148a <_math+0x2ca>
mov    -0x8(%rbp),%rdx
mov    $0x40,%edi
lea    0xc47(%rip),%rsi
call   10a0 <_error@plt>
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_math>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xorpd  %xmm0,%xmm0
call   1040 <cosl@plt>
ucomisd 0xe99(%rip),%xmm0
jne    116b <_math+0x1b>
jnp    1183 <_math+0x33>
lea    0xe9e(%rip),%rsi
mov    $0x2,%edi
mov    %rbx,%rdx
call   1070 <_error@plt>
mov    %eax,%ebp
jmp    1185 <_math+0x35>
xor    %ebp,%ebp
xorpd  %xmm0,%xmm0
call   1030 <sinl@plt>
ucomisd 0xe72(%rip),%xmm0
jne    119a <_math+0x4a>
jnp    11b0 <_math+0x60>
lea    0xe86(%rip),%rsi
mov    $0x2,%edi
mov    %rbx,%rdx
call   1070 <_error@plt>
or     %eax,%ebp
mov    $0xb,%edi
mov    $0x7,%esi
call   1060 <fmod@plt>
cmp    $0x4,%eax
jne    11d8 <_math+0x88>
mov    $0xb,%edi
mov    $0x7,%esi
call   1050 <fmodl@plt>
cmp    $0x4,%eax
je     11ee <_math+0x9e>
lea    0xe5f(%rip),%rsi
mov    $0x8,%edi
mov    %rbx,%rdx
call   1070 <_error@plt>
or     %eax,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [23 x i8] c"%s: cos(): Wrong value\00"
@.str.1 = [23 x i8] c"%s: sin(): Wrong value\00"
@.str.2 = [24 x i8] c"%s: fabs(): Wrong value\00"
@.str.3 = [24 x i8] c"%s: fmod(): Wrong value\00"
@.str.4 = [23 x i8] c"%s: pow(): Wrong value\00"
@.str.5 = [25 x i8] c"%s: round(): Wrong value\00"
@.str.6 = [24 x i8] c"%s: sqrt(): Wrong value\00"
define i32 @_math(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
%4 = call double @cos(double 0.000000e+00)
%5 = fcmp une double %4, 1.000000e+00
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = call double @cosl(double 0.000000e+00)
%8 = fcmp une double %7, 1.000000e+00
br i1 %8, label %9, label %14
9: ; preds = %6, %1
%10 = load i8*, i8** %2
%11 = call i32 @_error(i32 2, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = load i32, i32* %3
%13 = or i32 %12, %11
store i32 %13, i32* %3
br label %14
14: ; preds = %9, %6
%15 = call double @sin(double 0.000000e+00)
%16 = fcmp une double %15, 0.000000e+00
br i1 %16, label %20, label %17
17: ; preds = %14
%18 = call double @sinl(double 0.000000e+00)
%19 = fcmp une double %18, 0.000000e+00
br i1 %19, label %20, label %25
20: ; preds = %17, %14
%21 = load i8*, i8** %2
%22 = call i32 @_error(i32 2, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* %21)
%23 = load i32, i32* %3
%24 = or i32 %23, %22
store i32 %24, i32* %3
br label %25
25: ; preds = %20, %17
%26 = call double @llvm.fabs.f64(double -3.000000e+00)
%27 = fcmp une double %26, 3.000000e+00
br i1 %27, label %34, label %28
28: ; preds = %25
%29 = call double @fabsf(double -3.000000e+00)
%30 = fcmp une double %29, 3.000000e+00
br i1 %30, label %34, label %31
31: ; preds = %28
%32 = call double @fabsl(double -3.000000e+00)
%33 = fcmp une double %32, 3.000000e+00
br i1 %33, label %34, label %39
34: ; preds = %31, %28, %25
%35 = load i8*, i8** %2
%36 = call i32 @_error(i32 4, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %35)
%37 = load i32, i32* %3
%38 = or i32 %37, %36
store i32 %38, i32* %3
br label %39
39: ; preds = %34, %31
%40 = call i32 @fmod(i32 11, i32 7)
%41 = icmp ne i32 %40, 4
br i1 %41, label %45, label %42
42: ; preds = %39
%43 = call i32 @fmodl(i32 11, i32 7)
%44 = icmp ne i32 %43, 4
br i1 %44, label %45, label %50
45: ; preds = %42, %39
%46 = load i8*, i8** %2
%47 = call i32 @_error(i32 8, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i8* %46)
%48 = load i32, i32* %3
%49 = or i32 %48, %47
store i32 %49, i32* %3
br label %50
50: ; preds = %45, %42
%51 = call double @pow(double 3.000000e+00, double 0.000000e+00)
%52 = fcmp une double %51, 1.000000e+00
br i1 %52, label %59, label %53
53: ; preds = %50
%54 = call double @pow(double 4.000000e+00, double 1.000000e+00)
%55 = fcmp une double %54, 4.000000e+00
br i1 %55, label %59, label %56
56: ; preds = %53
%57 = call double @pow(double 2.000000e+00, double 3.000000e+00)
%58 = fcmp une double %57, 8.000000e+00
br i1 %58, label %59, label %64
59: ; preds = %56, %53, %50
%60 = load i8*, i8** %2
%61 = call i32 @_error(i32 16, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i8* %60)
%62 = load i32, i32* %3
%63 = or i32 %62, %61
store i32 %63, i32* %3
br label %64
64: ; preds = %59, %56
%65 = call double @llvm.round.f64(double 1.500000e+00)
%66 = fcmp une double %65, 2.000000e+00
br i1 %66, label %67, label %72
67: ; preds = %64
%68 = load i8*, i8** %2
%69 = call i32 @_error(i32 32, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i8* %68)
%70 = load i32, i32* %3
%71 = or i32 %70, %69
store i32 %71, i32* %3
br label %72
72: ; preds = %67, %64
%73 = call double @sqrt(double 4.000000e+00)
%74 = fcmp une double %73, 2.000000e+00
br i1 %74, label %75, label %80
75: ; preds = %72
%76 = load i8*, i8** %2
%77 = call i32 @_error(i32 64, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), i8* %76)
%78 = load i32, i32* %3
%79 = or i32 %78, %77
store i32 %79, i32* %3
br label %80
80: ; preds = %75, %72
%81 = load i32, i32* %3
ret i32 %81
}

LLVM IR (-O2):
@.str = [23 x i8] c"%s: cos(): Wrong value\00"
@.str.1 = [23 x i8] c"%s: sin(): Wrong value\00"
@.str.3 = [24 x i8] c"%s: fmod(): Wrong value\00"
define i32 @_math(i8* %0) {
%2 = tail call double @cosl(double 0.000000e+00)
%3 = fcmp une double %2, 1.000000e+00
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @_error(i32 2, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ 0, %1 ]
%8 = tail call double @sinl(double 0.000000e+00)
%9 = fcmp une double %8, 0.000000e+00
br i1 %9, label %10, label %13
10: ; preds = %6
%11 = tail call i32 @_error(i32 2, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%12 = or i32 %11, %7
br label %13
13: ; preds = %6, %10
%14 = phi i32 [ %12, %10 ], [ %7, %6 ]
%15 = tail call i32 @fmod(i32 11, i32 7)
%16 = icmp eq i32 %15, 4
br i1 %16, label %17, label %20
17: ; preds = %13
%18 = tail call i32 @fmodl(i32 11, i32 7)
%19 = icmp eq i32 %18, 4
br i1 %19, label %23, label %20
20: ; preds = %17, %13
%21 = tail call i32 @_error(i32 8, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i8* %0)
%22 = or i32 %21, %14
br label %23
23: ; preds = %17, %20
%24 = phi i32 [ %22, %20 ], [ %14, %17 ]
ret i32 %24
}