#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 */
struct timeval {
  double tv_sec;
  double tv_usec;
};

/* Variables and functions */
float cosx_opt(float);
float cosx_orig(float);
int gcd_opt(int, int);
int gcd_orig(int, int);
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
unsigned int msb_orig(unsigned int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  struct timeval t1, t2;
  double elapsedTime;
  int a, b, x, y, gcd, lcm;
  printf("\nGCD LCM calculator\n");
  printf("Enter two integers\n");
  scanf("%d%d", &x, &y);
  a = x;
  b = y;
  int counter;
  gettimeofday(&t1, NULL);
  for (counter = 0; counter < 1000000; counter++) {
    gcd = gcd_orig(a, b);
  }
  gettimeofday(&t2, NULL);
  lcm = (x * y) / gcd;
  printf("Least common multiple of %d and %d = %d\n", x, y, lcm);
  elapsedTime = (t2.tv_sec - t1.tv_sec) * 1000.0;
  elapsedTime += (t2.tv_usec - t1.tv_usec) / 1000.0;
  printf("Unoptimized time is %f ms\n", elapsedTime);
  gettimeofday(&t1, NULL);
  for (counter = 0; counter < 1000000; counter++) {
    gcd = gcd_opt(a, b);
  }
  gettimeofday(&t2, NULL);
  lcm = (x * y) / gcd;
  printf("Least common multiple of %d and %d = %d\n", x, y, lcm);
  elapsedTime = (t2.tv_sec - t1.tv_sec) * 1000.0;
  elapsedTime += (t2.tv_usec - t1.tv_usec) / 1000.0;
  printf("Optimized time is %f ms\n", elapsedTime);
  unsigned int v, inp, msb;
  printf("\nMSB of larger integer \n");
  printf("Enter two integers\n");
  scanf("%d%d", &x, &y);
  if (x > y)
    inp = x;
  else
    inp = y;
  v = inp;
  printf("The larger integer is %d\n", inp);
  gettimeofday(&t1, NULL);
  for (counter = 0; counter < 1000000; counter++) {
    msb = msb_orig(v);
  }
  gettimeofday(&t2, NULL);
  printf("MSB is %d\n", msb);
  elapsedTime = (t2.tv_sec - t1.tv_sec) * 1000.0;
  elapsedTime += (t2.tv_usec - t1.tv_usec) / 1000.0;
  printf("Unoptimized time is %f ms\n", elapsedTime);
  gettimeofday(&t1, NULL);
  for (counter = 0; counter < 1000000; counter++) {
    msb = msb_orig(v);
  }
  gettimeofday(&t2, NULL);
  printf("MSB is %d\n", msb);
  elapsedTime = (t2.tv_sec - t1.tv_sec) * 1000.0;
  elapsedTime += (t2.tv_usec - t1.tv_usec) / 1000.0;
  printf("Optimized time is %f ms\n", elapsedTime);
  float uinp, inangle, cosx;
  printf("\ncos of angle in degrees \n");
  printf("Enter angle\n");
  scanf("%f", &uinp);
  inangle = uinp;
  gettimeofday(&t1, NULL);
  for (counter = 0; counter < 1000000; counter++) {
    cosx = cosx_orig(inangle);
  }
  gettimeofday(&t2, NULL);
  printf("cos of of %f = %f\n", inangle, cosx);
  elapsedTime = (t2.tv_sec - t1.tv_sec) * 1000.0;
  elapsedTime += (t2.tv_usec - t1.tv_usec) / 1000.0;
  printf("Unoptimized time is %f ms\n", elapsedTime);
  gettimeofday(&t1, NULL);
  for (counter = 0; counter < 1000000; counter++) {
    cosx = cosx_opt(inangle);
  }
  gettimeofday(&t2, NULL);
  printf("cos of of %f = %f\n", inangle, cosx);
  elapsedTime = (t2.tv_sec - t1.tv_sec) * 1000.0;
  elapsedTime += (t2.tv_usec - t1.tv_usec) / 1000.0;
  printf("Optimized time is %f ms\n", elapsedTime);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe72(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe7f(%rip),%rdi
lea    -0x3c(%rbp),%rsi
lea    -0x40(%rbp),%rdx
mov    $0x0,%al
call   1080 <scanf@plt>
mov    -0x3c(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x40(%rbp),%eax
mov    %eax,-0x38(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <gettimeofday@plt>
movl   $0x0,-0x4c(%rbp)
cmpl   $0xf4240,-0x4c(%rbp)
jge    120a <main+0x8a>
mov    -0x34(%rbp),%edi
mov    -0x38(%rbp),%esi
call   1090 <gcd_orig@plt>
mov    %eax,-0x44(%rbp)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    11e1 <main+0x61>
lea    -0x28(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <gettimeofday@plt>
mov    -0x3c(%rbp),%eax
imul   -0x40(%rbp),%eax
cltd
idivl  -0x44(%rbp)
mov    %eax,-0x48(%rbp)
mov    -0x3c(%rbp),%esi
mov    -0x40(%rbp),%edx
mov    -0x48(%rbp),%ecx
lea    0xe01(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsd  -0x28(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  0xdb2(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  0xd97(%rip),%xmm1
divsd  %xmm1,%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
lea    0xddc(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <gettimeofday@plt>
movl   $0x0,-0x4c(%rbp)
cmpl   $0xf4240,-0x4c(%rbp)
jge    12c7 <main+0x147>
mov    -0x34(%rbp),%edi
mov    -0x38(%rbp),%esi
call   1060 <gcd_opt@plt>
mov    %eax,-0x44(%rbp)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    129e <main+0x11e>
lea    -0x28(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <gettimeofday@plt>
mov    -0x3c(%rbp),%eax
imul   -0x40(%rbp),%eax
cltd
idivl  -0x44(%rbp)
mov    %eax,-0x48(%rbp)
mov    -0x3c(%rbp),%esi
mov    -0x40(%rbp),%edx
mov    -0x48(%rbp),%ecx
lea    0xd44(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsd  -0x28(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  0xcf5(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  0xcda(%rip),%xmm1
divsd  %xmm1,%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
lea    0xd3a(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xd45(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xcc1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xcc7(%rip),%rdi
lea    -0x3c(%rbp),%rsi
lea    -0x40(%rbp),%rdx
mov    $0x0,%al
call   1080 <scanf@plt>
mov    -0x3c(%rbp),%eax
cmp    -0x40(%rbp),%eax
jle    1390 <main+0x210>
mov    -0x3c(%rbp),%eax
mov    %eax,-0x54(%rbp)
jmp    1396 <main+0x216>
mov    -0x40(%rbp),%eax
mov    %eax,-0x54(%rbp)
mov    -0x54(%rbp),%eax
mov    %eax,-0x50(%rbp)
mov    -0x54(%rbp),%esi
lea    0xd06(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <gettimeofday@plt>
movl   $0x0,-0x4c(%rbp)
cmpl   $0xf4240,-0x4c(%rbp)
jge    13e7 <main+0x267>
mov    -0x50(%rbp),%edi
call   1030 <msb_orig@plt>
mov    %eax,-0x58(%rbp)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    13c1 <main+0x241>
lea    -0x28(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <gettimeofday@plt>
mov    -0x58(%rbp),%esi
lea    0xcc8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsd  -0x28(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  0xbe9(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  0xbce(%rip),%xmm1
divsd  %xmm1,%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
lea    0xc13(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <gettimeofday@plt>
movl   $0x0,-0x4c(%rbp)
cmpl   $0xf4240,-0x4c(%rbp)
jge    148d <main+0x30d>
mov    -0x50(%rbp),%edi
call   1030 <msb_orig@plt>
mov    %eax,-0x58(%rbp)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    1467 <main+0x2e7>
lea    -0x28(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <gettimeofday@plt>
mov    -0x58(%rbp),%esi
lea    0xc22(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsd  -0x28(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  0xb43(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  0xb28(%rip),%xmm1
divsd  %xmm1,%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
lea    0xb88(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xbd1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xbde(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xbdd(%rip),%rdi
lea    -0x5c(%rbp),%rsi
mov    $0x0,%al
call   1080 <scanf@plt>
movss  -0x5c(%rbp),%xmm0
movss  %xmm0,-0x60(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <gettimeofday@plt>
movl   $0x0,-0x4c(%rbp)
cmpl   $0xf4240,-0x4c(%rbp)
jge    156f <main+0x3ef>
movss  -0x60(%rbp),%xmm0
call   10a0 <cosx_orig@plt>
movss  %xmm0,-0x64(%rbp)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    1545 <main+0x3c5>
lea    -0x28(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <gettimeofday@plt>
movss  -0x60(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x64(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xb67(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  -0x28(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  0xa52(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  0xa37(%rip),%xmm1
divsd  %xmm1,%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
lea    0xa7c(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <gettimeofday@plt>
movl   $0x0,-0x4c(%rbp)
cmpl   $0xf4240,-0x4c(%rbp)
jge    1628 <main+0x4a8>
movss  -0x60(%rbp),%xmm0
call   1070 <cosx_opt@plt>
movss  %xmm0,-0x64(%rbp)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    15fe <main+0x47e>
lea    -0x28(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <gettimeofday@plt>
movss  -0x60(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x64(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xaae(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  -0x28(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  0x999(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  0x97e(%rip),%xmm1
divsd  %xmm1,%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
lea    0x9de(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x48,%rsp
lea    0xf04(%rip),%rdi
call   1030 <puts@plt>
lea    0xf24(%rip),%rdi
call   1030 <puts@plt>
lea    0xe4f(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
xor    %eax,%eax
call   1090 <scanf@plt>
mov    0x14(%rsp),%r14d
mov    0x10(%rsp),%r15d
lea    0x28(%rsp),%rdi
xor    %esi,%esi
call   1060 <gettimeofday@plt>
mov    $0xf4240,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14d,%edi
mov    %r15d,%esi
call   10a0 <gcd_orig@plt>
add    $0xffffffff,%ebp
jne    11f0 <main+0x60>
mov    %eax,%ebx
lea    0x18(%rsp),%rdi
xor    %esi,%esi
call   1060 <gettimeofday@plt>
mov    0x14(%rsp),%esi
mov    0x10(%rsp),%ecx
mov    %ecx,%eax
imul   %esi,%eax
cltd
idiv   %ebx
lea    0xde8(%rip),%rdi
mov    %ecx,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
movsd  0x18(%rsp),%xmm1
movsd  0x20(%rsp),%xmm0
subsd  0x28(%rsp),%xmm1
movsd  0xdb6(%rip),%xmm2
mulsd  %xmm2,%xmm1
subsd  0x30(%rsp),%xmm0
divsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
lea    0xdd3(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
lea    0x28(%rsp),%rdi
xor    %esi,%esi
call   1060 <gettimeofday@plt>
mov    $0xf4240,%ebp
nopl   0x0(%rax,%rax,1)
mov    %r14d,%edi
mov    %r15d,%esi
call   1070 <gcd_opt@plt>
add    $0xffffffff,%ebp
jne    1280 <main+0xf0>
mov    %eax,%ebx
lea    0x18(%rsp),%rdi
xor    %esi,%esi
call   1060 <gettimeofday@plt>
mov    0x14(%rsp),%esi
mov    0x10(%rsp),%ecx
mov    %ecx,%eax
imul   %esi,%eax
cltd
idiv   %ebx
lea    0xd58(%rip),%rdi
mov    %ecx,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
movsd  0x18(%rsp),%xmm1
movsd  0x20(%rsp),%xmm0
subsd  0x28(%rsp),%xmm1
movsd  0xd26(%rip),%xmm2
mulsd  %xmm2,%xmm1
subsd  0x30(%rsp),%xmm0
divsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
lea    0xd5e(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xdb8(%rip),%rdi
call   1030 <puts@plt>
lea    0xdc4(%rip),%rdi
call   1030 <puts@plt>
lea    0xcef(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
xor    %eax,%eax
call   1090 <scanf@plt>
mov    0x14(%rsp),%eax
mov    0x10(%rsp),%r14d
cmp    %r14d,%eax
cmovg  %eax,%r14d
lea    0xd29(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x28(%rsp),%rdi
xor    %esi,%esi
call   1060 <gettimeofday@plt>
mov    $0xf4240,%ebx
nopl   0x0(%rax)
mov    %r14d,%edi
call   1040 <msb_orig@plt>
add    $0xffffffff,%ebx
jne    1360 <main+0x1d0>
mov    %eax,%ebp
lea    0x18(%rsp),%rdi
xor    %esi,%esi
call   1060 <gettimeofday@plt>
lea    0xd02(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
movsd  0x18(%rsp),%xmm1
movsd  0x20(%rsp),%xmm0
subsd  0x28(%rsp),%xmm1
movsd  0xc5b(%rip),%xmm2
mulsd  %xmm2,%xmm1
subsd  0x30(%rsp),%xmm0
divsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
lea    0xc78(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
lea    0x28(%rsp),%rdi
xor    %esi,%esi
call   1060 <gettimeofday@plt>
mov    $0xf4240,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    %r14d,%edi
call   1040 <msb_orig@plt>
add    $0xffffffff,%ebx
jne    13e0 <main+0x250>
mov    %eax,%ebp
lea    0x18(%rsp),%rdi
xor    %esi,%esi
call   1060 <gettimeofday@plt>
lea    0xc82(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
movsd  0x18(%rsp),%xmm1
movsd  0x20(%rsp),%xmm0
subsd  0x28(%rsp),%xmm1
movsd  0xbdb(%rip),%xmm2
mulsd  %xmm2,%xmm1
subsd  0x30(%rsp),%xmm0
divsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
lea    0xc13(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xc98(%rip),%rdi
call   1030 <puts@plt>
lea    0xca6(%rip),%rdi
call   1030 <puts@plt>
lea    0xc2b(%rip),%rdi
lea    0x44(%rsp),%rsi
xor    %eax,%eax
call   1090 <scanf@plt>
movss  0x44(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
lea    0x28(%rsp),%rdi
xor    %esi,%esi
call   1060 <gettimeofday@plt>
mov    $0xf4240,%ebx
nopl   (%rax)
movss  0xc(%rsp),%xmm0
call   10b0 <cosx_orig@plt>
add    $0xffffffff,%ebx
jne    1490 <main+0x300>
lea    0x18(%rsp),%rdi
xor    %esi,%esi
movss  %xmm0,0x38(%rsp)
call   1060 <gettimeofday@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0x38(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xbc5(%rip),%rdi
movsd  %xmm0,0x38(%rsp)
mov    $0x2,%al
call   1050 <printf@plt>
movsd  0x18(%rsp),%xmm1
movsd  0x20(%rsp),%xmm0
subsd  0x28(%rsp),%xmm1
movsd  0xb0c(%rip),%xmm2
mulsd  %xmm2,%xmm1
subsd  0x30(%rsp),%xmm0
divsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
lea    0xb29(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
lea    0x28(%rsp),%rdi
xor    %esi,%esi
call   1060 <gettimeofday@plt>
mov    $0xf4240,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
movss  0xc(%rsp),%xmm0
call   1080 <cosx_opt@plt>
add    $0xffffffff,%ebx
jne    1530 <main+0x3a0>
lea    0x18(%rsp),%rdi
xor    %esi,%esi
movss  %xmm0,0xc(%rsp)
call   1060 <gettimeofday@plt>
movss  0xc(%rsp),%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
lea    0xb2c(%rip),%rdi
movsd  0x38(%rsp),%xmm0
mov    $0x2,%al
call   1050 <printf@plt>
movsd  0x18(%rsp),%xmm1
movsd  0x20(%rsp),%xmm0
subsd  0x28(%rsp),%xmm1
movsd  0xa73(%rip),%xmm2
mulsd  %xmm2,%xmm1
subsd  0x30(%rsp),%xmm0
divsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
lea    0xaab(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.timeval = type { double, double }
@.str = [21 x i8] c"\0AGCD LCM calculator\0A\00"
@.str.1 = [20 x i8] c"Enter two integers\0A\00"
@.str.2 = [5 x i8] c"%d%d\00"
@.str.3 = [41 x i8] c"Least common multiple of %d and %d = %d\0A\00"
@.str.4 = [27 x i8] c"Unoptimized time is %f ms\0A\00"
@.str.5 = [25 x i8] c"Optimized time is %f ms\0A\00"
@.str.6 = [25 x i8] c"\0AMSB of larger integer \0A\00"
@.str.7 = [26 x i8] c"The larger integer is %d\0A\00"
@.str.8 = [11 x i8] c"MSB is %d\0A\00"
@.str.9 = [27 x i8] c"\0Acos of angle in degrees \0A\00"
@.str.10 = [13 x i8] c"Enter angle\0A\00"
@.str.11 = [3 x i8] c"%f\00"
@.str.12 = [19 x i8] c"cos of of %f = %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.timeval
%3 = alloca %struct.timeval
%4 = alloca double
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca float
%16 = alloca float
%17 = alloca float
store i32 0, i32* %1
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%20 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32* %7, i32* %8)
%21 = load i32, i32* %7
store i32 %21, i32* %5
%22 = load i32, i32* %8
store i32 %22, i32* %6
%23 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
store i32 0, i32* %11
br label %24
24: ; preds = %31, %0
%25 = load i32, i32* %11
%26 = icmp slt i32 %25, 1000000
br i1 %26, label %27, label %34
27: ; preds = %24
%28 = load i32, i32* %5
%29 = load i32, i32* %6
%30 = call i32 @gcd_orig(i32 %28, i32 %29)
store i32 %30, i32* %9
br label %31
31: ; preds = %27
%32 = load i32, i32* %11
%33 = add nsw i32 %32, 1
store i32 %33, i32* %11
br label %24
34: ; preds = %24
%35 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
%36 = load i32, i32* %7
%37 = load i32, i32* %8
%38 = mul nsw i32 %36, %37
%39 = load i32, i32* %9
%40 = sdiv i32 %38, %39
store i32 %40, i32* %10
%41 = load i32, i32* %7
%42 = load i32, i32* %8
%43 = load i32, i32* %10
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0), i32 %41, i32 %42, i32 %43)
%45 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%46 = load double, double* %45
%47 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%48 = load double, double* %47
%49 = fsub double %46, %48
%50 = fmul double %49, 1.000000e+03
store double %50, double* %4
%51 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%52 = load double, double* %51
%53 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
%54 = load double, double* %53
%55 = fsub double %52, %54
%56 = fdiv double %55, 1.000000e+03
%57 = load double, double* %4
%58 = fadd double %57, %56
store double %58, double* %4
%59 = load double, double* %4
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), double %59)
%61 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
store i32 0, i32* %11
br label %62
62: ; preds = %69, %34
%63 = load i32, i32* %11
%64 = icmp slt i32 %63, 1000000
br i1 %64, label %65, label %72
65: ; preds = %62
%66 = load i32, i32* %5
%67 = load i32, i32* %6
%68 = call i32 @gcd_opt(i32 %66, i32 %67)
store i32 %68, i32* %9
br label %69
69: ; preds = %65
%70 = load i32, i32* %11
%71 = add nsw i32 %70, 1
store i32 %71, i32* %11
br label %62
72: ; preds = %62
%73 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
%74 = load i32, i32* %7
%75 = load i32, i32* %8
%76 = mul nsw i32 %74, %75
%77 = load i32, i32* %9
%78 = sdiv i32 %76, %77
store i32 %78, i32* %10
%79 = load i32, i32* %7
%80 = load i32, i32* %8
%81 = load i32, i32* %10
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0), i32 %79, i32 %80, i32 %81)
%83 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%84 = load double, double* %83
%85 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%86 = load double, double* %85
%87 = fsub double %84, %86
%88 = fmul double %87, 1.000000e+03
store double %88, double* %4
%89 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%90 = load double, double* %89
%91 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
%92 = load double, double* %91
%93 = fsub double %90, %92
%94 = fdiv double %93, 1.000000e+03
%95 = load double, double* %4
%96 = fadd double %95, %94
store double %96, double* %4
%97 = load double, double* %4
%98 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), double %97)
%99 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0))
%100 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%101 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32* %7, i32* %8)
%102 = load i32, i32* %7
%103 = load i32, i32* %8
%104 = icmp sgt i32 %102, %103
br i1 %104, label %105, label %107
105: ; preds = %72
%106 = load i32, i32* %7
store i32 %106, i32* %13
br label %109
107: ; preds = %72
%108 = load i32, i32* %8
store i32 %108, i32* %13
br label %109
109: ; preds = %107, %105
%110 = load i32, i32* %13
store i32 %110, i32* %12
%111 = load i32, i32* %13
%112 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0), i32 %111)
%113 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
store i32 0, i32* %11
br label %114
114: ; preds = %120, %109
%115 = load i32, i32* %11
%116 = icmp slt i32 %115, 1000000
br i1 %116, label %117, label %123
117: ; preds = %114
%118 = load i32, i32* %12
%119 = call i32 @msb_orig(i32 %118)
store i32 %119, i32* %14
br label %120
120: ; preds = %117
%121 = load i32, i32* %11
%122 = add nsw i32 %121, 1
store i32 %122, i32* %11
br label %114
123: ; preds = %114
%124 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
%125 = load i32, i32* %14
%126 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i32 %125)
%127 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%128 = load double, double* %127
%129 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%130 = load double, double* %129
%131 = fsub double %128, %130
%132 = fmul double %131, 1.000000e+03
store double %132, double* %4
%133 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%134 = load double, double* %133
%135 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
%136 = load double, double* %135
%137 = fsub double %134, %136
%138 = fdiv double %137, 1.000000e+03
%139 = load double, double* %4
%140 = fadd double %139, %138
store double %140, double* %4
%141 = load double, double* %4
%142 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), double %141)
%143 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
store i32 0, i32* %11
br label %144
144: ; preds = %150, %123
%145 = load i32, i32* %11
%146 = icmp slt i32 %145, 1000000
br i1 %146, label %147, label %153
147: ; preds = %144
%148 = load i32, i32* %12
%149 = call i32 @msb_orig(i32 %148)
store i32 %149, i32* %14
br label %150
150: ; preds = %147
%151 = load i32, i32* %11
%152 = add nsw i32 %151, 1
store i32 %152, i32* %11
br label %144
153: ; preds = %144
%154 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
%155 = load i32, i32* %14
%156 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i32 %155)
%157 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%158 = load double, double* %157
%159 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%160 = load double, double* %159
%161 = fsub double %158, %160
%162 = fmul double %161, 1.000000e+03
store double %162, double* %4
%163 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%164 = load double, double* %163
%165 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
%166 = load double, double* %165
%167 = fsub double %164, %166
%168 = fdiv double %167, 1.000000e+03
%169 = load double, double* %4
%170 = fadd double %169, %168
store double %170, double* %4
%171 = load double, double* %4
%172 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), double %171)
%173 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0))
%174 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0))
%175 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), float* %15)
%176 = load float, float* %15
store float %176, float* %16
%177 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
store i32 0, i32* %11
br label %178
178: ; preds = %184, %153
%179 = load i32, i32* %11
%180 = icmp slt i32 %179, 1000000
br i1 %180, label %181, label %187
181: ; preds = %178
%182 = load float, float* %16
%183 = call float @cosx_orig(float %182)
store float %183, float* %17
br label %184
184: ; preds = %181
%185 = load i32, i32* %11
%186 = add nsw i32 %185, 1
store i32 %186, i32* %11
br label %178
187: ; preds = %178
%188 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
%189 = load float, float* %16
%190 = fpext float %189 to double
%191 = load float, float* %17
%192 = fpext float %191 to double
%193 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.12, i64 0, i64 0), double %190, double %192)
%194 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%195 = load double, double* %194
%196 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%197 = load double, double* %196
%198 = fsub double %195, %197
%199 = fmul double %198, 1.000000e+03
store double %199, double* %4
%200 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%201 = load double, double* %200
%202 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
%203 = load double, double* %202
%204 = fsub double %201, %203
%205 = fdiv double %204, 1.000000e+03
%206 = load double, double* %4
%207 = fadd double %206, %205
store double %207, double* %4
%208 = load double, double* %4
%209 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), double %208)
%210 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
store i32 0, i32* %11
br label %211
211: ; preds = %217, %187
%212 = load i32, i32* %11
%213 = icmp slt i32 %212, 1000000
br i1 %213, label %214, label %220
214: ; preds = %211
%215 = load float, float* %16
%216 = call float @cosx_opt(float %215)
store float %216, float* %17
br label %217
217: ; preds = %214
%218 = load i32, i32* %11
%219 = add nsw i32 %218, 1
store i32 %219, i32* %11
br label %211
220: ; preds = %211
%221 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
%222 = load float, float* %16
%223 = fpext float %222 to double
%224 = load float, float* %17
%225 = fpext float %224 to double
%226 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.12, i64 0, i64 0), double %223, double %225)
%227 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%228 = load double, double* %227
%229 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%230 = load double, double* %229
%231 = fsub double %228, %230
%232 = fmul double %231, 1.000000e+03
store double %232, double* %4
%233 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%234 = load double, double* %233
%235 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
%236 = load double, double* %235
%237 = fsub double %234, %236
%238 = fdiv double %237, 1.000000e+03
%239 = load double, double* %4
%240 = fadd double %239, %238
store double %240, double* %4
%241 = load double, double* %4
%242 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), double %241)
ret i32 0
}

LLVM IR (-O2):
%struct.timeval = type { double, double }
@.str.2 = [5 x i8] c"%d%d\00"
@.str.3 = [41 x i8] c"Least common multiple of %d and %d = %d\0A\00"
@.str.4 = [27 x i8] c"Unoptimized time is %f ms\0A\00"
@.str.5 = [25 x i8] c"Optimized time is %f ms\0A\00"
@.str.7 = [26 x i8] c"The larger integer is %d\0A\00"
@.str.8 = [11 x i8] c"MSB is %d\0A\00"
@.str.11 = [3 x i8] c"%f\00"
@.str.12 = [19 x i8] c"cos of of %f = %f\0A\00"
@str = [20 x i8] c"\0AGCD LCM calculator\00"
@str.14 = [24 x i8] c"\0AMSB of larger integer \00"
@str.15 = [19 x i8] c"Enter two integers\00"
@str.16 = [26 x i8] c"\0Acos of angle in degrees \00"
@str.17 = [12 x i8] c"Enter angle\00"
define i32 @main() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timeval
%3 = alloca i32
%4 = alloca i32
%5 = alloca float
%6 = bitcast %struct.timeval* %1 to i8*
%7 = bitcast %struct.timeval* %2 to i8*
%8 = bitcast i32* %3 to i8*
%9 = bitcast i32* %4 to i8*
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.15, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32* %3, i32* %4)
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
br label %16
16: ; preds = %0, %16
%17 = phi i32 [ 0, %0 ], [ %19, %16 ]
%18 = call i32 @gcd_orig(i32 %13, i32 %14)
%19 = add nuw nsw i32 %17, 1
%20 = icmp eq i32 %19, 1000000
br i1 %20, label %21, label %16
21: ; preds = %16
%22 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
%23 = load i32, i32* %3
%24 = load i32, i32* %4
%25 = mul nsw i32 %24, %23
%26 = sdiv i32 %25, %18
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0), i32 %23, i32 %24, i32 %26)
%28 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
%29 = load double, double* %28
%30 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%31 = load double, double* %30
%32 = fsub double %29, %31
%33 = fmul double %32, 1.000000e+03
%34 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
%35 = load double, double* %34
%36 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%37 = load double, double* %36
%38 = fsub double %35, %37
%39 = fdiv double %38, 1.000000e+03
%40 = fadd double %33, %39
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), double %40)
%42 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
br label %43
43: ; preds = %21, %43
%44 = phi i32 [ 0, %21 ], [ %46, %43 ]
%45 = call i32 @gcd_opt(i32 %13, i32 %14)
%46 = add nuw nsw i32 %44, 1
%47 = icmp eq i32 %46, 1000000
br i1 %47, label %48, label %43
48: ; preds = %43
%49 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
%50 = load i32, i32* %3
%51 = load i32, i32* %4
%52 = mul nsw i32 %51, %50
%53 = sdiv i32 %52, %45
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0), i32 %50, i32 %51, i32 %53)
%55 = load double, double* %28
%56 = load double, double* %30
%57 = fsub double %55, %56
%58 = fmul double %57, 1.000000e+03
%59 = load double, double* %34
%60 = load double, double* %36
%61 = fsub double %59, %60
%62 = fdiv double %61, 1.000000e+03
%63 = fadd double %58, %62
%64 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), double %63)
%65 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.14, i64 0, i64 0))
%66 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.15, i64 0, i64 0))
%67 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32* %3, i32* %4)
%68 = load i32, i32* %3
%69 = load i32, i32* %4
%70 = icmp sgt i32 %68, %69
%71 = select i1 %70, i32 %68, i32 %69
%72 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0), i32 %71)
%73 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
br label %74
74: ; preds = %48, %74
%75 = phi i32 [ 0, %48 ], [ %77, %74 ]
%76 = call i32 @msb_orig(i32 %71)
%77 = add nuw nsw i32 %75, 1
%78 = icmp eq i32 %77, 1000000
br i1 %78, label %79, label %74
79: ; preds = %74
%80 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
%81 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i32 %76)
%82 = load double, double* %28
%83 = load double, double* %30
%84 = fsub double %82, %83
%85 = fmul double %84, 1.000000e+03
%86 = load double, double* %34
%87 = load double, double* %36
%88 = fsub double %86, %87
%89 = fdiv double %88, 1.000000e+03
%90 = fadd double %85, %89
%91 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), double %90)
%92 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
br label %93
93: ; preds = %79, %93
%94 = phi i32 [ 0, %79 ], [ %96, %93 ]
%95 = call i32 @msb_orig(i32 %71)
%96 = add nuw nsw i32 %94, 1
%97 = icmp eq i32 %96, 1000000
br i1 %97, label %98, label %93
98: ; preds = %93
%99 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
%100 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i32 %95)
%101 = load double, double* %28
%102 = load double, double* %30
%103 = fsub double %101, %102
%104 = fmul double %103, 1.000000e+03
%105 = load double, double* %34
%106 = load double, double* %36
%107 = fsub double %105, %106
%108 = fdiv double %107, 1.000000e+03
%109 = fadd double %104, %108
%110 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), double %109)
%111 = bitcast float* %5 to i8*
%112 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.16, i64 0, i64 0))
%113 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.17, i64 0, i64 0))
%114 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), float* %5)
%115 = load float, float* %5
%116 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
br label %117
117: ; preds = %98, %117
%118 = phi i32 [ 0, %98 ], [ %120, %117 ]
%119 = call float @cosx_orig(float %115)
%120 = add nuw nsw i32 %118, 1
%121 = icmp eq i32 %120, 1000000
br i1 %121, label %122, label %117
122: ; preds = %117
%123 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
%124 = fpext float %115 to double
%125 = fpext float %119 to double
%126 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.12, i64 0, i64 0), double %124, double %125)
%127 = load double, double* %28
%128 = load double, double* %30
%129 = fsub double %127, %128
%130 = fmul double %129, 1.000000e+03
%131 = load double, double* %34
%132 = load double, double* %36
%133 = fsub double %131, %132
%134 = fdiv double %133, 1.000000e+03
%135 = fadd double %130, %134
%136 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), double %135)
%137 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
br label %138
138: ; preds = %122, %138
%139 = phi i32 [ 0, %122 ], [ %141, %138 ]
%140 = call float @cosx_opt(float %115)
%141 = add nuw nsw i32 %139, 1
%142 = icmp eq i32 %141, 1000000
br i1 %142, label %143, label %138
143: ; preds = %138
%144 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
%145 = fpext float %140 to double
%146 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.12, i64 0, i64 0), double %124, double %145)
%147 = load double, double* %28
%148 = load double, double* %30
%149 = fsub double %147, %148
%150 = fmul double %149, 1.000000e+03
%151 = load double, double* %34
%152 = load double, double* %36
%153 = fsub double %151, %152
%154 = fdiv double %153, 1.000000e+03
%155 = fadd double %150, %154
%156 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), double %155)
ret i32 0
}