#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*/ printf(char *, ...);
void mathTest() {
  printf("mathTest Called\n");
  int a = 100, b = 200, c;
  float fa = 1.3, fb = 99.996;
  double da = 999999.22;
  long long int lli = 1234567890123456;
  short sa = 0;
  char ca = 'A';
  printf("Swap\n");
  c = a;
  a = b;
  b = c;
  printf("a=%d, b=%d\n", a, b);
  printf("Simple math\n");
  c = a + b;
  c = a + 5;
  c = c + 10;
  c = a - b;
  c = a * b;
  c = a * 10;
  c = a / b;
  c = a % b;
  fa = fa + fb;
  fa = fa - fb;
  fa = fa * fb;
  fa = 3.222222222 * fb;
  fa = fb / 0.354647;
  da = da + 5;
  da = da - 5;
  da = 5 * da;
  da = da / 5;
  lli = lli + 100;
  lli = lli - 100;
  lli = lli * 100;
  lli = lli / 100;
  sa = sa + 32;
  sa = sa - 10;
  sa = sa * 2;
  sa = sa / 2;
  ca = ca + 2;
  ca = ca - 'B';
  printf("Simple Binary\n");
  c = a >> 2;
  c = a << 2;
  c = ~a;
  c = a & b;
  c = a | b;
  c = a ^ b;
  lli = lli >> 4;
  lli = lli << 4;
  lli = ~lli;
  lli = lli & 0xFFFFF0FF;
  lli = lli | 0xFFFFF0FF;
  lli = lli ^ 0xFFFFF0FF;
}


x86 assembly (clang, -O0):
<mathTest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    0xf09(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x64,-0x4(%rbp)
movl   $0xc8,-0x8(%rbp)
movss  0xee8(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  0xed7(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movsd  0xec2(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movabs $0x462d53c8abac0,%rax
mov    %rax,-0x28(%rbp)
movw   $0x0,-0x2a(%rbp)
movb   $0x41,-0x2b(%rbp)
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xa,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
imul   $0xa,-0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
movss  -0x10(%rbp),%xmm0
addss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
subss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
mulss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xdd4(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdae(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movsd  0xd91(%rip),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xd7a(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xd69(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xd52(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x28(%rbp),%rax
add    $0x64,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
sub    $0x64,%rax
mov    %rax,-0x28(%rbp)
imul   $0x64,-0x28(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    $0x64,%ecx
cqto
idiv   %rcx
mov    %rax,-0x28(%rbp)
movswl -0x2a(%rbp),%eax
add    $0x20,%eax
mov    %ax,-0x2a(%rbp)
movswl -0x2a(%rbp),%eax
sub    $0xa,%eax
mov    %ax,-0x2a(%rbp)
movswl -0x2a(%rbp),%eax
shl    $0x1,%eax
mov    %ax,-0x2a(%rbp)
movswl -0x2a(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %ax,-0x2a(%rbp)
movsbl -0x2b(%rbp),%eax
add    $0x2,%eax
mov    %al,-0x2b(%rbp)
movsbl -0x2b(%rbp),%eax
sub    $0x42,%eax
mov    %al,-0x2b(%rbp)
lea    0xd22(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x28(%rbp),%rax
sar    $0x4,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
shl    $0x4,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
xor    $0xffffffffffffffff,%rax
mov    %rax,-0x28(%rbp)
movabs $0xfffff0ff,%rax
and    -0x28(%rbp),%rax
mov    %rax,-0x28(%rbp)
movabs $0xfffff0ff,%rax
or     -0x28(%rbp),%rax
mov    %rax,-0x28(%rbp)
movabs $0xfffff0ff,%rax
xor    -0x28(%rbp),%rax
mov    %rax,-0x28(%rbp)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mathTest>:
push   %rax
lea    0xee4(%rip),%rdi
call   1030 <puts@plt>
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xec0(%rip),%rdi
mov    $0xc8,%esi
mov    $0x64,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec9(%rip),%rdi
call   1030 <puts@plt>
lea    0xec9(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"mathTest Called\0A\00"
@.str.1 = [6 x i8] c"Swap\0A\00"
@.str.2 = [12 x i8] c"a=%d, b=%d\0A\00"
@.str.3 = [13 x i8] c"Simple math\0A\00"
@.str.4 = [15 x i8] c"Simple Binary\0A\00"
define void @mathTest() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = alloca float
%6 = alloca double
%7 = alloca i64
%8 = alloca i16
%9 = alloca i8
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
store i32 100, i32* %1
store i32 200, i32* %2
store float 0x3FF4CCCCC0000000, float* %4
store float 0x4058FFBE80000000, float* %5
store double 0x412E847E70A3D70A, double* %6
store i64 1234567890123456, i64* %7
store i16 0, i16* %8
store i8 65, i8* %9
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%12 = load i32, i32* %1
store i32 %12, i32* %3
%13 = load i32, i32* %2
store i32 %13, i32* %1
%14 = load i32, i32* %3
store i32 %14, i32* %2
%15 = load i32, i32* %1
%16 = load i32, i32* %2
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %15, i32 %16)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%19 = load i32, i32* %1
%20 = load i32, i32* %2
%21 = add nsw i32 %19, %20
store i32 %21, i32* %3
%22 = load i32, i32* %1
%23 = add nsw i32 %22, 5
store i32 %23, i32* %3
%24 = load i32, i32* %3
%25 = add nsw i32 %24, 10
store i32 %25, i32* %3
%26 = load i32, i32* %1
%27 = load i32, i32* %2
%28 = sub nsw i32 %26, %27
store i32 %28, i32* %3
%29 = load i32, i32* %1
%30 = load i32, i32* %2
%31 = mul nsw i32 %29, %30
store i32 %31, i32* %3
%32 = load i32, i32* %1
%33 = mul nsw i32 %32, 10
store i32 %33, i32* %3
%34 = load i32, i32* %1
%35 = load i32, i32* %2
%36 = sdiv i32 %34, %35
store i32 %36, i32* %3
%37 = load i32, i32* %1
%38 = load i32, i32* %2
%39 = srem i32 %37, %38
store i32 %39, i32* %3
%40 = load float, float* %4
%41 = load float, float* %5
%42 = fadd float %40, %41
store float %42, float* %4
%43 = load float, float* %4
%44 = load float, float* %5
%45 = fsub float %43, %44
store float %45, float* %4
%46 = load float, float* %4
%47 = load float, float* %5
%48 = fmul float %46, %47
store float %48, float* %4
%49 = load float, float* %5
%50 = fpext float %49 to double
%51 = fmul double 0x4009C71C71BF79C2, %50
%52 = fptrunc double %51 to float
store float %52, float* %4
%53 = load float, float* %5
%54 = fpext float %53 to double
%55 = fdiv double %54, 3.546470e-01
%56 = fptrunc double %55 to float
store float %56, float* %4
%57 = load double, double* %6
%58 = fadd double %57, 5.000000e+00
store double %58, double* %6
%59 = load double, double* %6
%60 = fsub double %59, 5.000000e+00
store double %60, double* %6
%61 = load double, double* %6
%62 = fmul double 5.000000e+00, %61
store double %62, double* %6
%63 = load double, double* %6
%64 = fdiv double %63, 5.000000e+00
store double %64, double* %6
%65 = load i64, i64* %7
%66 = add nsw i64 %65, 100
store i64 %66, i64* %7
%67 = load i64, i64* %7
%68 = sub nsw i64 %67, 100
store i64 %68, i64* %7
%69 = load i64, i64* %7
%70 = mul nsw i64 %69, 100
store i64 %70, i64* %7
%71 = load i64, i64* %7
%72 = sdiv i64 %71, 100
store i64 %72, i64* %7
%73 = load i16, i16* %8
%74 = sext i16 %73 to i32
%75 = add nsw i32 %74, 32
%76 = trunc i32 %75 to i16
store i16 %76, i16* %8
%77 = load i16, i16* %8
%78 = sext i16 %77 to i32
%79 = sub nsw i32 %78, 10
%80 = trunc i32 %79 to i16
store i16 %80, i16* %8
%81 = load i16, i16* %8
%82 = sext i16 %81 to i32
%83 = mul nsw i32 %82, 2
%84 = trunc i32 %83 to i16
store i16 %84, i16* %8
%85 = load i16, i16* %8
%86 = sext i16 %85 to i32
%87 = sdiv i32 %86, 2
%88 = trunc i32 %87 to i16
store i16 %88, i16* %8
%89 = load i8, i8* %9
%90 = sext i8 %89 to i32
%91 = add nsw i32 %90, 2
%92 = trunc i32 %91 to i8
store i8 %92, i8* %9
%93 = load i8, i8* %9
%94 = sext i8 %93 to i32
%95 = sub nsw i32 %94, 66
%96 = trunc i32 %95 to i8
store i8 %96, i8* %9
%97 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
%98 = load i32, i32* %1
%99 = ashr i32 %98, 2
store i32 %99, i32* %3
%100 = load i32, i32* %1
%101 = shl i32 %100, 2
store i32 %101, i32* %3
%102 = load i32, i32* %1
%103 = xor i32 %102, -1
store i32 %103, i32* %3
%104 = load i32, i32* %1
%105 = load i32, i32* %2
%106 = and i32 %104, %105
store i32 %106, i32* %3
%107 = load i32, i32* %1
%108 = load i32, i32* %2
%109 = or i32 %107, %108
store i32 %109, i32* %3
%110 = load i32, i32* %1
%111 = load i32, i32* %2
%112 = xor i32 %110, %111
store i32 %112, i32* %3
%113 = load i64, i64* %7
%114 = ashr i64 %113, 4
store i64 %114, i64* %7
%115 = load i64, i64* %7
%116 = shl i64 %115, 4
store i64 %116, i64* %7
%117 = load i64, i64* %7
%118 = xor i64 %117, -1
store i64 %118, i64* %7
%119 = load i64, i64* %7
%120 = and i64 %119, 4294963455
store i64 %120, i64* %7
%121 = load i64, i64* %7
%122 = or i64 %121, 4294963455
store i64 %122, i64* %7
%123 = load i64, i64* %7
%124 = xor i64 %123, 4294963455
store i64 %124, i64* %7
ret void
}

LLVM IR (-O2):
@.str.2 = [12 x i8] c"a=%d, b=%d\0A\00"
@str = [16 x i8] c"mathTest Called\00"
@str.5 = [5 x i8] c"Swap\00"
@str.6 = [12 x i8] c"Simple math\00"
@str.7 = [14 x i8] c"Simple Binary\00"
define void @mathTest() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.5, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 200, i32 100)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.6, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.7, i64 0, i64 0))
ret void
}