#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 CHAR_MAX;
int CHAR_MIN;
double DBL_MAX;
double FLT_MAX;
float INFINITY;
int INT_MAX;
int INT_MIN;
char *LONG_MAX;
char *LONG_MIN;
int SCHAR_MAX;
int SCHAR_MIN;
int SHRT_MAX;
int SHRT_MIN;
int UCHAR_MAX;
int UINT_MAX;
char *ULONG_MAX;
int USHRT_MAX;
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  printf("Values from limits.h:\n");
  printf("max value of char:          %d\n", CHAR_MAX);
  printf("min calue of char:          %d\n", CHAR_MIN);
  printf("max value of int:           %d\n", INT_MAX);
  printf("min value of int:           %d\n", INT_MIN);
  printf("max value of long:          %ld\n", LONG_MAX);
  printf("min value of long:          %ld\n", LONG_MIN);
  printf("max value of signed char:   %d\n", SCHAR_MAX);
  printf("min value of signed char:   %d\n", SCHAR_MIN);
  printf("max value of short:         %d\n", SHRT_MAX);
  printf("min value of short:         %d\n", SHRT_MIN);
  printf("max value of unsigned char: %d\n", UCHAR_MAX);
  printf("max value of unsigned int:  %u\n", UINT_MAX);
  printf("max value of unsigned long: %lu\n\n", ULONG_MAX);
  printf("\n\n");
  printf("Calculations: \n");
  printf("-------------\n\n");
  char done;
  short adv_s;
  int adv_i;
  long adv_l;
  char c = 0;
  char last_c;
  while (!(c < last_c)) {
    last_c = c;
    c++;
  }
  printf("calculated char max  : %d\n", last_c);
  printf("calculated char min  : %d\n", c);
  printf("limits.h char max    : %d\n", CHAR_MAX);
  printf("limits.h char min    : %d\n\n", CHAR_MIN);
  unsigned char uc = 0;
  unsigned char last_uc;
  while (!(uc < last_uc)) {
    last_uc = uc;
    uc++;
  }
  printf("calculated uchar max : %d\n", last_uc);
  printf("calculated uchar min : %d\n", uc);
  printf("limits.h uchar max   : %d\n", UCHAR_MAX);
  printf("expected uchar min   : 0\n\n");
  short s = 1;
  short last_s;
  adv_s = 1000;
  done = 0;
  while (!done) {
    last_s = s;
    s += adv_s;
    while (s < last_s) {
      adv_s /= 2;
      if (adv_s == 0) {
        done = 1;
        break;
      }
      s = last_s + adv_s;
    }
  }
  printf("calculated short max : %d\n", last_s);
  printf("calculated short min : %d\n", s);
  printf("limits.h short max   : %d\n", SHRT_MAX);
  printf("limits.h short min   : %d\n\n", SHRT_MIN);
  unsigned short us = 1;
  unsigned short last_us;
  adv_s = 1000;
  done = 0;
  while (!done) {
    last_us = us;
    us += adv_s;
    while (us < last_us) {
      adv_s /= 2;
      if (adv_s == 0) {
        done = 1;
        break;
      }
      us = last_us + adv_s;
    }
  }
  printf("calculated ushort max: %d\n", last_us);
  printf("calculated ushort min: %d\n", us);
  printf("limits.h ushort max  : %d\n", USHRT_MAX);
  printf("expected ushort min  : 0\n\n");
  int i = 1;
  int last_i;
  adv_i = 100000;
  done = 0;
  while (!done) {
    last_i = i;
    i += adv_i;
    while (i < last_i) {
      adv_i /= 2;
      if (adv_i == 0) {
        done = 1;
        break;
      }
      i = last_i + adv_i;
    }
  }
  printf("calculated int max   : %d\n", last_i);
  printf("calculated int min   : %d\n", i);
  printf("limits.h int max     : %d\n", INT_MAX);
  printf("limits.h int min     : %d\n\n", INT_MIN);
  long l = 1;
  long last_l;
  adv_l = 100000000000000;
  done = 0;
  while (!done) {
    last_l = l;
    l += adv_l;
    while (l < last_l) {
      adv_l /= 2;
      if (adv_l == 0) {
        done = 1;
        break;
      }
      l = last_l + adv_l;
    }
  }
  printf("calculated long max  : %ld\n", last_l);
  printf("calculated long min  : %ld\n", l);
  printf("limits.h long max    : %ld\n", LONG_MAX);
  printf("limits.h long min    : %ld\n\n", LONG_MIN);
  unsigned long ul = 1;
  unsigned long last_ul;
  adv_l = 100000000000000;
  done = 0;
  while (!done) {
    last_ul = ul;
    ul += adv_l;
    while (ul < last_ul) {
      adv_l /= 2;
      if (adv_l == 0) {
        done = 1;
        break;
      }
      ul = last_ul + adv_l;
    }
  }
  printf("calculated ulong max : %lu\n", last_ul);
  printf("calculated ulong min : %lu\n", ul);
  printf("limits.h ulong max   : %lu\n", ULONG_MAX);
  printf("expected ulong min   : 0\n\n");
  float f = 1.0;
  float last_f;
  float step = 9.0;
  while (1) {
    last_f = f;
    f *= (1.0 + step);
    while (f == INFINITY) {
      step /= 2.0;
      f = last_f * (1.0 + step);
    }
    if (!(f > last_f))
      break;
  }
  printf("calculated float max : %e\n", last_f);
  printf("limits.h float max   : %e\n", FLT_MAX);
  printf("diff                 : %e\n", FLT_MAX - last_f);
  printf("The expected value?  : %s\n\n", (FLT_MAX == last_f) ? "yes" : "no");
  double d = 1.0;
  double last_d;
  double step_d = 9.0;
  while (1) {
    last_d = d;
    d *= (1.0 + step_d);
    while (d == INFINITY) {
      step_d /= 2.0;
      d = last_d + step_d * last_d;
    }
    if (!(d > last_d))
      break;
  }
  printf("calculated double max: %e\n", last_d);
  printf("limits.h double max  : %e\n", DBL_MAX);
  printf("diff                 : %e\n", DBL_MAX - last_d);
  printf("The expected value?  : %s\n\n", (DBL_MAX == last_d) ? "yes" : "no");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xef7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
lea    0xef7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e82(%rip),%rax
mov    (%rax),%esi
lea    0xf00(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e5b(%rip),%rax
mov    (%rax),%esi
lea    0xf09(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e2c(%rip),%rax
mov    (%rax),%esi
lea    0xf12(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2ded(%rip),%rax
mov    (%rax),%rsi
lea    0xf1a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e05(%rip),%rax
mov    (%rax),%rsi
lea    0xf23(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2dc5(%rip),%rax
mov    (%rax),%esi
lea    0xf2d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2db6(%rip),%rax
mov    (%rax),%esi
lea    0xf36(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2d7f(%rip),%rax
mov    (%rax),%esi
lea    0xf3f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2d70(%rip),%rax
mov    (%rax),%esi
lea    0xf48(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2dd1(%rip),%rax
mov    (%rax),%esi
lea    0xf51(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2d82(%rip),%rax
mov    (%rax),%esi
lea    0xf5a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2d0b(%rip),%rax
mov    (%rax),%rsi
lea    0xf62(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf93(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf68(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf6a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movb   $0x0,-0x19(%rbp)
movsbl -0x19(%rbp),%eax
movsbl -0x1a(%rbp),%ecx
cmp    %ecx,%eax
setl   %al
xor    $0xff,%al
test   $0x1,%al
jne    12a8 <main+0x198>
jmp    12bb <main+0x1ab>
mov    -0x19(%rbp),%al
mov    %al,-0x1a(%rbp)
mov    -0x19(%rbp),%al
add    $0x1,%al
mov    %al,-0x19(%rbp)
jmp    128c <main+0x17c>
movsbl -0x1a(%rbp),%esi
lea    0xf35(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0x19(%rbp),%esi
lea    0xf3e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2cf2(%rip),%rax
mov    (%rax),%esi
lea    0xf42(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2cd3(%rip),%rax
mov    (%rax),%esi
lea    0xf46(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movb   $0x0,-0x1b(%rbp)
movzbl -0x1b(%rbp),%eax
movzbl -0x1c(%rbp),%ecx
cmp    %ecx,%eax
setl   %al
xor    $0xff,%al
test   $0x1,%al
jne    132d <main+0x21d>
jmp    1340 <main+0x230>
mov    -0x1b(%rbp),%al
mov    %al,-0x1c(%rbp)
mov    -0x1b(%rbp),%al
add    $0x1,%al
mov    %al,-0x1b(%rbp)
jmp    1311 <main+0x201>
movzbl -0x1c(%rbp),%esi
lea    0xf1d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movzbl -0x1b(%rbp),%esi
lea    0xf26(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2c85(%rip),%rax
mov    (%rax),%esi
lea    0xf2a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf37(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movw   $0x1,-0x1e(%rbp)
movw   $0x3e8,-0x8(%rbp)
movb   $0x0,-0x5(%rbp)
cmpb   $0x0,-0x5(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    13af <main+0x29f>
jmp    1413 <main+0x303>
mov    -0x1e(%rbp),%ax
mov    %ax,-0x20(%rbp)
movswl -0x8(%rbp),%ecx
movswl -0x1e(%rbp),%eax
add    %ecx,%eax
mov    %ax,-0x1e(%rbp)
movswl -0x1e(%rbp),%eax
movswl -0x20(%rbp),%ecx
cmp    %ecx,%eax
jge    140e <main+0x2fe>
movswl -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %ax,-0x8(%rbp)
movswl -0x8(%rbp),%eax
cmp    $0x0,%eax
jne    13fb <main+0x2eb>
movb   $0x1,-0x5(%rbp)
jmp    140e <main+0x2fe>
movswl -0x20(%rbp),%eax
movswl -0x8(%rbp),%ecx
add    %ecx,%eax
mov    %ax,-0x1e(%rbp)
jmp    13c5 <main+0x2b5>
jmp    1399 <main+0x289>
movswl -0x20(%rbp),%esi
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movswl -0x1e(%rbp),%esi
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2b32(%rip),%rax
mov    (%rax),%esi
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2b23(%rip),%rax
mov    (%rax),%esi
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movw   $0x1,-0x22(%rbp)
movw   $0x3e8,-0x8(%rbp)
movb   $0x0,-0x5(%rbp)
cmpb   $0x0,-0x5(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    148b <main+0x37b>
jmp    14ef <main+0x3df>
mov    -0x22(%rbp),%ax
mov    %ax,-0x24(%rbp)
movswl -0x8(%rbp),%ecx
movzwl -0x22(%rbp),%eax
add    %ecx,%eax
mov    %ax,-0x22(%rbp)
movzwl -0x22(%rbp),%eax
movzwl -0x24(%rbp),%ecx
cmp    %ecx,%eax
jge    14ea <main+0x3da>
movswl -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %ax,-0x8(%rbp)
movswl -0x8(%rbp),%eax
cmp    $0x0,%eax
jne    14d7 <main+0x3c7>
movb   $0x1,-0x5(%rbp)
jmp    14ea <main+0x3da>
movzwl -0x24(%rbp),%eax
movswl -0x8(%rbp),%ecx
add    %ecx,%eax
mov    %ax,-0x22(%rbp)
jmp    14a1 <main+0x391>
jmp    1475 <main+0x365>
movzwl -0x24(%rbp),%esi
lea    0xe47(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movzwl -0x22(%rbp),%esi
lea    0xe50(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2aae(%rip),%rax
mov    (%rax),%esi
lea    0xe54(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe61(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x28(%rbp)
movl   $0x186a0,-0xc(%rbp)
movb   $0x0,-0x5(%rbp)
cmpb   $0x0,-0x5(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1560 <main+0x450>
jmp    15af <main+0x49f>
mov    -0x28(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0xc(%rbp),%eax
add    -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    15aa <main+0x49a>
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    159c <main+0x48c>
movb   $0x1,-0x5(%rbp)
jmp    15aa <main+0x49a>
mov    -0x2c(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x28(%rbp)
jmp    156f <main+0x45f>
jmp    154a <main+0x43a>
mov    -0x2c(%rbp),%esi
lea    0xdf4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%esi
lea    0xdfe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x29e8(%rip),%rax
mov    (%rax),%esi
lea    0xe02(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x29b9(%rip),%rax
mov    (%rax),%esi
lea    0xe06(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movq   $0x1,-0x38(%rbp)
movabs $0x5af3107a4000,%rax
mov    %rax,-0x18(%rbp)
movb   $0x0,-0x5(%rbp)
cmpb   $0x0,-0x5(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    162f <main+0x51f>
jmp    168d <main+0x57d>
mov    -0x38(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x18(%rbp),%rax
add    -0x38(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
cmp    -0x40(%rbp),%rax
jge    1688 <main+0x578>
mov    -0x18(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1677 <main+0x567>
movb   $0x1,-0x5(%rbp)
jmp    1688 <main+0x578>
mov    -0x40(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x38(%rbp)
jmp    1643 <main+0x533>
jmp    1619 <main+0x509>
mov    -0x40(%rbp),%rsi
lea    0xd82(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x38(%rbp),%rsi
lea    0xd8c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x28c8(%rip),%rax
mov    (%rax),%rsi
lea    0xd90(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x28e0(%rip),%rax
mov    (%rax),%rsi
lea    0xd94(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movq   $0x1,-0x48(%rbp)
movabs $0x5af3107a4000,%rax
mov    %rax,-0x18(%rbp)
movb   $0x0,-0x5(%rbp)
cmpb   $0x0,-0x5(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1711 <main+0x601>
jmp    176f <main+0x65f>
mov    -0x48(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x18(%rbp),%rax
add    -0x48(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
cmp    -0x50(%rbp),%rax
jae    176a <main+0x65a>
mov    -0x18(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1759 <main+0x649>
movb   $0x1,-0x5(%rbp)
jmp    176a <main+0x65a>
mov    -0x50(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x48(%rbp)
jmp    1725 <main+0x615>
jmp    16fb <main+0x5eb>
mov    -0x50(%rbp),%rsi
lea    0xd11(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x48(%rbp),%rsi
lea    0xd1b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x27be(%rip),%rax
mov    (%rax),%rsi
lea    0xd1f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xd2d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  0x843(%rip),%xmm0
movss  %xmm0,-0x54(%rbp)
movss  0x832(%rip),%xmm0
movss  %xmm0,-0x5c(%rbp)
movss  -0x54(%rbp),%xmm0
movss  %xmm0,-0x58(%rbp)
movss  -0x5c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0x81a(%rip),%xmm1
addsd  %xmm0,%xmm1
movss  -0x54(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x54(%rbp)
movss  -0x54(%rbp),%xmm0
mov    0x27cc(%rip),%rax
ucomiss (%rax),%xmm0
jne    1871 <main+0x761>
jp     1871 <main+0x761>
movss  -0x5c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0x7e4(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x5c(%rbp)
movss  -0x58(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x5c(%rbp),%xmm1
cvtss2sd %xmm1,%xmm2
movsd  0x7ad(%rip),%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x54(%rbp)
jmp    1808 <main+0x6f8>
movss  -0x54(%rbp),%xmm0
ucomiss -0x58(%rbp),%xmm0
ja     1885 <main+0x775>
jmp    188a <main+0x77a>
jmp    17d3 <main+0x6c3>
movss  -0x58(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xc60(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x26f8(%rip),%rax
movsd  (%rax),%xmm0
lea    0xc62(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x26df(%rip),%rax
movsd  (%rax),%xmm0
movss  -0x58(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
subsd  %xmm1,%xmm0
lea    0xc57(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x26b9(%rip),%rax
movsd  (%rax),%xmm0
movss  -0x58(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xc70(%rip),%rsi
lea    0xc65(%rip),%rax
ucomisd %xmm1,%xmm0
setnp  %dl
sete   %cl
test   %dl,%cl
cmovne %rax,%rsi
lea    0xc32(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  0x6e0(%rip),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0x6db(%rip),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  0x6bc(%rip),%xmm0
addsd  -0x78(%rbp),%xmm0
mulsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
mov    0x2679(%rip),%rax
movss  (%rax),%xmm1
cvtss2sd %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    19b6 <main+0x8a6>
jp     19b6 <main+0x8a6>
movsd  -0x78(%rbp),%xmm0
movsd  0x68c(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x70(%rbp),%xmm1
movsd  -0x78(%rbp),%xmm0
movsd  -0x70(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
jmp    195b <main+0x84b>
movsd  -0x68(%rbp),%xmm0
ucomisd -0x70(%rbp),%xmm0
ja     19cb <main+0x8bb>
jmp    19d0 <main+0x8c0>
jmp    193a <main+0x82a>
movsd  -0x70(%rbp),%xmm0
lea    0xb92(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x257e(%rip),%rax
movsd  (%rax),%xmm0
lea    0xb94(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2565(%rip),%rax
movsd  (%rax),%xmm0
subsd  -0x70(%rbp),%xmm0
lea    0xb1d(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2547(%rip),%rax
movsd  (%rax),%xmm0
movsd  -0x70(%rbp),%xmm1
lea    0xb3a(%rip),%rsi
lea    0xb2f(%rip),%rax
ucomisd %xmm1,%xmm0
setnp  %dl
sete   %cl
test   %dl,%cl
cmovne %rax,%rsi
lea    0xafc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0x11ee(%rip),%rdi
call   1030 <puts@plt>
mov    0x2ea2(%rip),%r12
mov    (%r12),%esi
lea    0xeb7(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2e81(%rip),%r13
mov    0x0(%r13),%esi
lea    0xebe(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2e58(%rip),%rax
mov    (%rax),%esi
lea    0xec7(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2e29(%rip),%rax
mov    (%rax),%esi
lea    0xed0(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2df2(%rip),%rax
mov    (%rax),%rsi
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2e02(%rip),%rax
mov    (%rax),%rsi
lea    0xee1(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2dca(%rip),%rax
mov    (%rax),%esi
lea    0xeeb(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2dbb(%rip),%rax
mov    (%rax),%esi
lea    0xef4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2d84(%rip),%r14
mov    (%r14),%esi
lea    0xefc(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2d74(%rip),%r15
mov    (%r15),%esi
lea    0xf04(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2dc4(%rip),%rbp
mov    0x0(%rbp),%esi
lea    0xf0c(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2d7c(%rip),%rax
mov    (%rax),%esi
lea    0xf15(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2d15(%rip),%rax
mov    (%rax),%rsi
lea    0xf1d(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf9c(%rip),%rdi
call   1030 <puts@plt>
lea    0x10b7(%rip),%rdi
call   1030 <puts@plt>
lea    0x10ba(%rip),%rdi
call   1030 <puts@plt>
mov    $0xff,%al
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%ecx
add    $0x1,%al
cmp    %cl,%al
jge    12a0 <main+0x180>
movsbl %cl,%esi
movsbl %al,%ebx
lea    0xeef(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xefc(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%r12),%esi
lea    0xf03(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x0(%r13),%esi
lea    0xf0c(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xff,%al
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%ecx
add    $0x1,%al
cmp    %cl,%al
jae    1300 <main+0x1e0>
movzbl %cl,%esi
movzbl %al,%ebx
lea    0xefc(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf09(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x0(%rbp),%esi
lea    0xf11(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x1010(%rip),%rdi
call   1030 <puts@plt>
mov    $0x3e8,%cx
mov    $0x1,%ax
jmp    1378 <main+0x258>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzwl %cx,%edx
mov    %edx,%ecx
shr    $0xf,%ecx
add    %edx,%ecx
movswl %cx,%ecx
shr    %ecx
add    $0x1,%edx
cmp    $0x2,%dx
jbe    1384 <main+0x264>
lea    (%rcx,%rax,1),%ebx
cmp    %ax,%bx
jl     1360 <main+0x240>
mov    %ebx,%eax
jmp    1378 <main+0x258>
movswl %ax,%esi
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movswl %bx,%esi
lea    0xede(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%r14),%esi
lea    0xee8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%r15),%esi
lea    0xef2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x3e8,%cx
mov    $0x1,%ax
jmp    13f8 <main+0x2d8>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzwl %cx,%edx
mov    %edx,%ecx
shr    $0xf,%ecx
add    %edx,%ecx
movswl %cx,%ecx
shr    %ecx
add    $0x1,%edx
cmp    $0x2,%dx
jbe    1403 <main+0x2e3>
mov    %ecx,%ebx
add    %ax,%bx
jb     13e0 <main+0x2c0>
mov    %ebx,%eax
jmp    13f8 <main+0x2d8>
movzwl %ax,%esi
lea    0xec2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzwl %bx,%esi
lea    0xecc(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2ba4(%rip),%rax
mov    (%rax),%esi
lea    0xed0(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf2b(%rip),%rdi
call   1030 <puts@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Values from limits.h:\0A\00"
@.str.1 = [32 x i8] c"max value of char: %d\0A\00"
@CHAR_MAX = global i32 0
@.str.2 = [32 x i8] c"min calue of char: %d\0A\00"
@CHAR_MIN = global i32 0
@.str.3 = [32 x i8] c"max value of int: %d\0A\00"
@INT_MAX = global i32 0
@.str.4 = [32 x i8] c"min value of int: %d\0A\00"
@INT_MIN = global i32 0
@.str.5 = [33 x i8] c"max value of long: %ld\0A\00"
@LONG_MAX = global i8* null
@.str.6 = [33 x i8] c"min value of long: %ld\0A\00"
@LONG_MIN = global i8* null
@.str.7 = [32 x i8] c"max value of signed char: %d\0A\00"
@SCHAR_MAX = global i32 0
@.str.8 = [32 x i8] c"min value of signed char: %d\0A\00"
@SCHAR_MIN = global i32 0
@.str.9 = [32 x i8] c"max value of short: %d\0A\00"
@SHRT_MAX = global i32 0
@.str.10 = [32 x i8] c"min value of short: %d\0A\00"
@SHRT_MIN = global i32 0
@.str.11 = [32 x i8] c"max value of unsigned char: %d\0A\00"
@UCHAR_MAX = global i32 0
@.str.12 = [32 x i8] c"max value of unsigned int: %u\0A\00"
@UINT_MAX = global i32 0
@.str.13 = [34 x i8] c"max value of unsigned long: %lu\0A\0A\00"
@ULONG_MAX = global i8* null
@.str.14 = [3 x i8] c"\0A\0A\00"
@.str.15 = [16 x i8] c"Calculations: \0A\00"
@.str.16 = [16 x i8] c"-------------\0A\0A\00"
@.str.17 = [27 x i8] c"calculated char max : %d\0A\00"
@.str.18 = [27 x i8] c"calculated char min : %d\0A\00"
@.str.19 = [27 x i8] c"limits.h char max : %d\0A\00"
@.str.20 = [28 x i8] c"limits.h char min : %d\0A\0A\00"
@.str.21 = [27 x i8] c"calculated uchar max : %d\0A\00"
@.str.22 = [27 x i8] c"calculated uchar min : %d\0A\00"
@.str.23 = [27 x i8] c"limits.h uchar max : %d\0A\00"
@.str.24 = [27 x i8] c"expected uchar min : 0\0A\0A\00"
@.str.25 = [27 x i8] c"calculated short max : %d\0A\00"
@.str.26 = [27 x i8] c"calculated short min : %d\0A\00"
@.str.27 = [27 x i8] c"limits.h short max : %d\0A\00"
@.str.28 = [28 x i8] c"limits.h short min : %d\0A\0A\00"
@.str.29 = [27 x i8] c"calculated ushort max: %d\0A\00"
@.str.30 = [27 x i8] c"calculated ushort min: %d\0A\00"
@.str.31 = [27 x i8] c"limits.h ushort max : %d\0A\00"
@USHRT_MAX = global i32 0
@.str.32 = [27 x i8] c"expected ushort min : 0\0A\0A\00"
@.str.33 = [27 x i8] c"calculated int max : %d\0A\00"
@.str.34 = [27 x i8] c"calculated int min : %d\0A\00"
@.str.35 = [27 x i8] c"limits.h int max : %d\0A\00"
@.str.36 = [28 x i8] c"limits.h int min : %d\0A\0A\00"
@.str.37 = [28 x i8] c"calculated long max : %ld\0A\00"
@.str.38 = [28 x i8] c"calculated long min : %ld\0A\00"
@.str.39 = [28 x i8] c"limits.h long max : %ld\0A\00"
@.str.40 = [29 x i8] c"limits.h long min : %ld\0A\0A\00"
@.str.41 = [28 x i8] c"calculated ulong max : %lu\0A\00"
@.str.42 = [28 x i8] c"calculated ulong min : %lu\0A\00"
@.str.43 = [28 x i8] c"limits.h ulong max : %lu\0A\00"
@.str.44 = [27 x i8] c"expected ulong min : 0\0A\0A\00"
@INFINITY = global float 0.000000e+00
@.str.45 = [27 x i8] c"calculated float max : %e\0A\00"
@.str.46 = [27 x i8] c"limits.h float max : %e\0A\00"
@FLT_MAX = global double 0.000000e+00
@.str.47 = [27 x i8] c"diff : %e\0A\00"
@.str.48 = [28 x i8] c"The expected value? : %s\0A\0A\00"
@.str.49 = [4 x i8] c"yes\00"
@.str.50 = [3 x i8] c"no\00"
@.str.51 = [27 x i8] c"calculated double max: %e\0A\00"
@.str.52 = [27 x i8] c"limits.h double max : %e\0A\00"
@DBL_MAX = global double 0.000000e+00
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i16
%4 = alloca i32
%5 = alloca i64
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
%10 = alloca i16
%11 = alloca i16
%12 = alloca i16
%13 = alloca i16
%14 = alloca i32
%15 = alloca i32
%16 = alloca i64
%17 = alloca i64
%18 = alloca i64
%19 = alloca i64
%20 = alloca float
%21 = alloca float
%22 = alloca float
%23 = alloca double
%24 = alloca double
%25 = alloca double
store i32 0, i32* %1
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%27 = load i32, i32* @CHAR_MAX
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %27)
%29 = load i32, i32* @CHAR_MIN
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i32 %29)
%31 = load i32, i32* @INT_MAX
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), i32 %31)
%33 = load i32, i32* @INT_MIN
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0), i32 %33)
%35 = load i8*, i8** @LONG_MAX
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0), i8* %35)
%37 = load i8*, i8** @LONG_MIN
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.6, i64 0, i64 0), i8* %37)
%39 = load i32, i32* @SCHAR_MAX
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.7, i64 0, i64 0), i32 %39)
%41 = load i32, i32* @SCHAR_MIN
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.8, i64 0, i64 0), i32 %41)
%43 = load i32, i32* @SHRT_MAX
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.9, i64 0, i64 0), i32 %43)
%45 = load i32, i32* @SHRT_MIN
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.10, i64 0, i64 0), i32 %45)
%47 = load i32, i32* @UCHAR_MAX
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.11, i64 0, i64 0), i32 %47)
%49 = load i32, i32* @UINT_MAX
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.12, i64 0, i64 0), i32 %49)
%51 = load i8*, i8** @ULONG_MAX
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.13, i64 0, i64 0), i8* %51)
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0))
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.15, i64 0, i64 0))
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.16, i64 0, i64 0))
store i8 0, i8* %6
br label %56
56: ; preds = %63, %0
%57 = load i8, i8* %6
%58 = sext i8 %57 to i32
%59 = load i8, i8* %7
%60 = sext i8 %59 to i32
%61 = icmp slt i32 %58, %60
%62 = xor i1 %61, true
br i1 %62, label %63, label %67
63: ; preds = %56
%64 = load i8, i8* %6
store i8 %64, i8* %7
%65 = load i8, i8* %6
%66 = add i8 %65, 1
store i8 %66, i8* %6
br label %56
67: ; preds = %56
%68 = load i8, i8* %7
%69 = sext i8 %68 to i32
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.17, i64 0, i64 0), i32 %69)
%71 = load i8, i8* %6
%72 = sext i8 %71 to i32
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.18, i64 0, i64 0), i32 %72)
%74 = load i32, i32* @CHAR_MAX
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.19, i64 0, i64 0), i32 %74)
%76 = load i32, i32* @CHAR_MIN
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.20, i64 0, i64 0), i32 %76)
store i8 0, i8* %8
br label %78
78: ; preds = %85, %67
%79 = load i8, i8* %8
%80 = zext i8 %79 to i32
%81 = load i8, i8* %9
%82 = zext i8 %81 to i32
%83 = icmp slt i32 %80, %82
%84 = xor i1 %83, true
br i1 %84, label %85, label %89
85: ; preds = %78
%86 = load i8, i8* %8
store i8 %86, i8* %9
%87 = load i8, i8* %8
%88 = add i8 %87, 1
store i8 %88, i8* %8
br label %78
89: ; preds = %78
%90 = load i8, i8* %9
%91 = zext i8 %90 to i32
%92 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.21, i64 0, i64 0), i32 %91)
%93 = load i8, i8* %8
%94 = zext i8 %93 to i32
%95 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.22, i64 0, i64 0), i32 %94)
%96 = load i32, i32* @UCHAR_MAX
%97 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.23, i64 0, i64 0), i32 %96)
%98 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.24, i64 0, i64 0))
store i16 1, i16* %10
store i16 1000, i16* %3
store i8 0, i8* %2
br label %99
99: ; preds = %133, %89
%100 = load i8, i8* %2
%101 = icmp ne i8 %100, 0
%102 = xor i1 %101, true
br i1 %102, label %103, label %134
103: ; preds = %99
%104 = load i16, i16* %10
store i16 %104, i16* %11
%105 = load i16, i16* %3
%106 = sext i16 %105 to i32
%107 = load i16, i16* %10
%108 = sext i16 %107 to i32
%109 = add nsw i32 %108, %106
%110 = trunc i32 %109 to i16
store i16 %110, i16* %10
br label %111
111: ; preds = %126, %103
%112 = load i16, i16* %10
%113 = sext i16 %112 to i32
%114 = load i16, i16* %11
%115 = sext i16 %114 to i32
%116 = icmp slt i32 %113, %115
br i1 %116, label %117, label %133
117: ; preds = %111
%118 = load i16, i16* %3
%119 = sext i16 %118 to i32
%120 = sdiv i32 %119, 2
%121 = trunc i32 %120 to i16
store i16 %121, i16* %3
%122 = load i16, i16* %3
%123 = sext i16 %122 to i32
%124 = icmp eq i32 %123, 0
br i1 %124, label %125, label %126
125: ; preds = %117
store i8 1, i8* %2
br label %133
126: ; preds = %117
%127 = load i16, i16* %11
%128 = sext i16 %127 to i32
%129 = load i16, i16* %3
%130 = sext i16 %129 to i32
%131 = add nsw i32 %128, %130
%132 = trunc i32 %131 to i16
store i16 %132, i16* %10
br label %111
133: ; preds = %125, %111
br label %99
134: ; preds = %99
%135 = load i16, i16* %11
%136 = sext i16 %135 to i32
%137 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.25, i64 0, i64 0), i32 %136)
%138 = load i16, i16* %10
%139 = sext i16 %138 to i32
%140 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.26, i64 0, i64 0), i32 %139)
%141 = load i32, i32* @SHRT_MAX
%142 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.27, i64 0, i64 0), i32 %141)
%143 = load i32, i32* @SHRT_MIN
%144 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.28, i64 0, i64 0), i32 %143)
store i16 1, i16* %12
store i16 1000, i16* %3
store i8 0, i8* %2
br label %145
145: ; preds = %179, %134
%146 = load i8, i8* %2
%147 = icmp ne i8 %146, 0
%148 = xor i1 %147, true
br i1 %148, label %149, label %180
149: ; preds = %145
%150 = load i16, i16* %12
store i16 %150, i16* %13
%151 = load i16, i16* %3
%152 = sext i16 %151 to i32
%153 = load i16, i16* %12
%154 = zext i16 %153 to i32
%155 = add nsw i32 %154, %152
%156 = trunc i32 %155 to i16
store i16 %156, i16* %12
br label %157
157: ; preds = %172, %149
%158 = load i16, i16* %12
%159 = zext i16 %158 to i32
%160 = load i16, i16* %13
%161 = zext i16 %160 to i32
%162 = icmp slt i32 %159, %161
br i1 %162, label %163, label %179
163: ; preds = %157
%164 = load i16, i16* %3
%165 = sext i16 %164 to i32
%166 = sdiv i32 %165, 2
%167 = trunc i32 %166 to i16
store i16 %167, i16* %3
%168 = load i16, i16* %3
%169 = sext i16 %168 to i32
%170 = icmp eq i32 %169, 0
br i1 %170, label %171, label %172
171: ; preds = %163
store i8 1, i8* %2
br label %179
172: ; preds = %163
%173 = load i16, i16* %13
%174 = zext i16 %173 to i32
%175 = load i16, i16* %3
%176 = sext i16 %175 to i32
%177 = add nsw i32 %174, %176
%178 = trunc i32 %177 to i16
store i16 %178, i16* %12
br label %157
179: ; preds = %171, %157
br label %145
180: ; preds = %145
%181 = load i16, i16* %13
%182 = zext i16 %181 to i32
%183 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.29, i64 0, i64 0), i32 %182)
%184 = load i16, i16* %12
%185 = zext i16 %184 to i32
%186 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.30, i64 0, i64 0), i32 %185)
%187 = load i32, i32* @USHRT_MAX
%188 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.31, i64 0, i64 0), i32 %187)
%189 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.32, i64 0, i64 0))
store i32 1, i32* %14
store i32 100000, i32* %4
store i8 0, i8* %2
br label %190
190: ; preds = %213, %180
%191 = load i8, i8* %2
%192 = icmp ne i8 %191, 0
%193 = xor i1 %192, true
br i1 %193, label %194, label %214
194: ; preds = %190
%195 = load i32, i32* %14
store i32 %195, i32* %15
%196 = load i32, i32* %4
%197 = load i32, i32* %14
%198 = add nsw i32 %197, %196
store i32 %198, i32* %14
br label %199
199: ; preds = %209, %194
%200 = load i32, i32* %14
%201 = load i32, i32* %15
%202 = icmp slt i32 %200, %201
br i1 %202, label %203, label %213
203: ; preds = %199
%204 = load i32, i32* %4
%205 = sdiv i32 %204, 2
store i32 %205, i32* %4
%206 = load i32, i32* %4
%207 = icmp eq i32 %206, 0
br i1 %207, label %208, label %209
208: ; preds = %203
store i8 1, i8* %2
br label %213
209: ; preds = %203
%210 = load i32, i32* %15
%211 = load i32, i32* %4
%212 = add nsw i32 %210, %211
store i32 %212, i32* %14
br label %199
213: ; preds = %208, %199
br label %190
214: ; preds = %190
%215 = load i32, i32* %15
%216 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.33, i64 0, i64 0), i32 %215)
%217 = load i32, i32* %14
%218 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.34, i64 0, i64 0), i32 %217)
%219 = load i32, i32* @INT_MAX
%220 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.35, i64 0, i64 0), i32 %219)
%221 = load i32, i32* @INT_MIN
%222 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.36, i64 0, i64 0), i32 %221)
store i64 1, i64* %16
store i64 100000000000000, i64* %5
store i8 0, i8* %2
br label %223
223: ; preds = %246, %214
%224 = load i8, i8* %2
%225 = icmp ne i8 %224, 0
%226 = xor i1 %225, true
br i1 %226, label %227, label %247
227: ; preds = %223
%228 = load i64, i64* %16
store i64 %228, i64* %17
%229 = load i64, i64* %5
%230 = load i64, i64* %16
%231 = add nsw i64 %230, %229
store i64 %231, i64* %16
br label %232
232: ; preds = %242, %227
%233 = load i64, i64* %16
%234 = load i64, i64* %17
%235 = icmp slt i64 %233, %234
br i1 %235, label %236, label %246
236: ; preds = %232
%237 = load i64, i64* %5
%238 = sdiv i64 %237, 2
store i64 %238, i64* %5
%239 = load i64, i64* %5
%240 = icmp eq i64 %239, 0
br i1 %240, label %241, label %242
241: ; preds = %236
store i8 1, i8* %2
br label %246
242: ; preds = %236
%243 = load i64, i64* %17
%244 = load i64, i64* %5
%245 = add nsw i64 %243, %244
store i64 %245, i64* %16
br label %232
246: ; preds = %241, %232
br label %223
247: ; preds = %223
%248 = load i64, i64* %17
%249 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.37, i64 0, i64 0), i64 %248)
%250 = load i64, i64* %16
%251 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.38, i64 0, i64 0), i64 %250)
%252 = load i8*, i8** @LONG_MAX
%253 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.39, i64 0, i64 0), i8* %252)
%254 = load i8*, i8** @LONG_MIN
%255 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.40, i64 0, i64 0), i8* %254)
store i64 1, i64* %18
store i64 100000000000000, i64* %5
store i8 0, i8* %2
br label %256
256: ; preds = %279, %247
%257 = load i8, i8* %2
%258 = icmp ne i8 %257, 0
%259 = xor i1 %258, true
br i1 %259, label %260, label %280
260: ; preds = %256
%261 = load i64, i64* %18
store i64 %261, i64* %19
%262 = load i64, i64* %5
%263 = load i64, i64* %18
%264 = add i64 %263, %262
store i64 %264, i64* %18
br label %265
265: ; preds = %275, %260
%266 = load i64, i64* %18
%267 = load i64, i64* %19
%268 = icmp ult i64 %266, %267
br i1 %268, label %269, label %279
269: ; preds = %265
%270 = load i64, i64* %5
%271 = sdiv i64 %270, 2
store i64 %271, i64* %5
%272 = load i64, i64* %5
%273 = icmp eq i64 %272, 0
br i1 %273, label %274, label %275
274: ; preds = %269
store i8 1, i8* %2
br label %279
275: ; preds = %269
%276 = load i64, i64* %19
%277 = load i64, i64* %5
%278 = add i64 %276, %277
store i64 %278, i64* %18
br label %265
279: ; preds = %274, %265
br label %256
280: ; preds = %256
%281 = load i64, i64* %19
%282 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.41, i64 0, i64 0), i64 %281)
%283 = load i64, i64* %18
%284 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.42, i64 0, i64 0), i64 %283)
%285 = load i8*, i8** @ULONG_MAX
%286 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.43, i64 0, i64 0), i8* %285)
%287 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.44, i64 0, i64 0))
store float 1.000000e+00, float* %20
store float 9.000000e+00, float* %22
br label %288
288: ; preds = %280, %318
%289 = load float, float* %20
store float %289, float* %21
%290 = load float, float* %22
%291 = fpext float %290 to double
%292 = fadd double 1.000000e+00, %291
%293 = load float, float* %20
%294 = fpext float %293 to double
%295 = fmul double %294, %292
%296 = fptrunc double %295 to float
store float %296, float* %20
br label %297
297: ; preds = %301, %288
%298 = load float, float* %20
%299 = load float, float* @INFINITY
%300 = fcmp oeq float %298, %299
br i1 %300, label %301, label %313
301: ; preds = %297
%302 = load float, float* %22
%303 = fpext float %302 to double
%304 = fdiv double %303, 2.000000e+00
%305 = fptrunc double %304 to float
store float %305, float* %22
%306 = load float, float* %21
%307 = fpext float %306 to double
%308 = load float, float* %22
%309 = fpext float %308 to double
%310 = fadd double 1.000000e+00, %309
%311 = fmul double %307, %310
%312 = fptrunc double %311 to float
store float %312, float* %20
br label %297
313: ; preds = %297
%314 = load float, float* %20
%315 = load float, float* %21
%316 = fcmp ogt float %314, %315
br i1 %316, label %318, label %317
317: ; preds = %313
br label %319
318: ; preds = %313
br label %288
319: ; preds = %317
%320 = load float, float* %21
%321 = fpext float %320 to double
%322 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.45, i64 0, i64 0), double %321)
%323 = load double, double* @FLT_MAX
%324 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.46, i64 0, i64 0), double %323)
%325 = load double, double* @FLT_MAX
%326 = load float, float* %21
%327 = fpext float %326 to double
%328 = fsub double %325, %327
%329 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.47, i64 0, i64 0), double %328)
%330 = load double, double* @FLT_MAX
%331 = load float, float* %21
%332 = fpext float %331 to double
%333 = fcmp oeq double %330, %332
%334 = zext i1 %333 to i64
%335 = select i1 %333, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.49, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.50, i64 0, i64 0)
%336 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.48, i64 0, i64 0), i8* %335)
store double 1.000000e+00, double* %23
store double 9.000000e+00, double* %25
br label %337
337: ; preds = %319, %360
%338 = load double, double* %23
store double %338, double* %24
%339 = load double, double* %25
%340 = fadd double 1.000000e+00, %339
%341 = load double, double* %23
%342 = fmul double %341, %340
store double %342, double* %23
br label %343
343: ; preds = %348, %337
%344 = load double, double* %23
%345 = load float, float* @INFINITY
%346 = fpext float %345 to double
%347 = fcmp oeq double %344, %346
br i1 %347, label %348, label %355
348: ; preds = %343
%349 = load double, double* %25
%350 = fdiv double %349, 2.000000e+00
store double %350, double* %25
%351 = load double, double* %24
%352 = load double, double* %25
%353 = load double, double* %24
%354 = call double @llvm.fmuladd.f64(double %352, double %353, double %351)
store double %354, double* %23
br label %343
355: ; preds = %343
%356 = load double, double* %23
%357 = load double, double* %24
%358 = fcmp ogt double %356, %357
br i1 %358, label %360, label %359
359: ; preds = %355
br label %361
360: ; preds = %355
br label %337
361: ; preds = %359
%362 = load double, double* %24
%363 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.51, i64 0, i64 0), double %362)
%364 = load double, double* @DBL_MAX
%365 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.52, i64 0, i64 0), double %364)
%366 = load double, double* @DBL_MAX
%367 = load double, double* %24
%368 = fsub double %366, %367
%369 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.47, i64 0, i64 0), double %368)
%370 = load double, double* @DBL_MAX
%371 = load double, double* %24
%372 = fcmp oeq double %370, %371
%373 = zext i1 %372 to i64
%374 = select i1 %372, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.49, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.50, i64 0, i64 0)
%375 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.48, i64 0, i64 0), i8* %374)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [32 x i8] c"max value of char: %d\0A\00"
@CHAR_MAX = global i32 0
@.str.2 = [32 x i8] c"min calue of char: %d\0A\00"
@CHAR_MIN = global i32 0
@.str.3 = [32 x i8] c"max value of int: %d\0A\00"
@INT_MAX = global i32 0
@.str.4 = [32 x i8] c"min value of int: %d\0A\00"
@INT_MIN = global i32 0
@.str.5 = [33 x i8] c"max value of long: %ld\0A\00"
@LONG_MAX = global i8* null
@.str.6 = [33 x i8] c"min value of long: %ld\0A\00"
@LONG_MIN = global i8* null
@.str.7 = [32 x i8] c"max value of signed char: %d\0A\00"
@SCHAR_MAX = global i32 0
@.str.8 = [32 x i8] c"min value of signed char: %d\0A\00"
@SCHAR_MIN = global i32 0
@.str.9 = [32 x i8] c"max value of short: %d\0A\00"
@SHRT_MAX = global i32 0
@.str.10 = [32 x i8] c"min value of short: %d\0A\00"
@SHRT_MIN = global i32 0
@.str.11 = [32 x i8] c"max value of unsigned char: %d\0A\00"
@UCHAR_MAX = global i32 0
@.str.12 = [32 x i8] c"max value of unsigned int: %u\0A\00"
@UINT_MAX = global i32 0
@.str.13 = [34 x i8] c"max value of unsigned long: %lu\0A\0A\00"
@ULONG_MAX = global i8* null
@.str.17 = [27 x i8] c"calculated char max : %d\0A\00"
@.str.18 = [27 x i8] c"calculated char min : %d\0A\00"
@.str.19 = [27 x i8] c"limits.h char max : %d\0A\00"
@.str.20 = [28 x i8] c"limits.h char min : %d\0A\0A\00"
@.str.21 = [27 x i8] c"calculated uchar max : %d\0A\00"
@.str.22 = [27 x i8] c"calculated uchar min : %d\0A\00"
@.str.23 = [27 x i8] c"limits.h uchar max : %d\0A\00"
@.str.25 = [27 x i8] c"calculated short max : %d\0A\00"
@.str.26 = [27 x i8] c"calculated short min : %d\0A\00"
@.str.27 = [27 x i8] c"limits.h short max : %d\0A\00"
@.str.28 = [28 x i8] c"limits.h short min : %d\0A\0A\00"
@.str.29 = [27 x i8] c"calculated ushort max: %d\0A\00"
@.str.30 = [27 x i8] c"calculated ushort min: %d\0A\00"
@.str.31 = [27 x i8] c"limits.h ushort max : %d\0A\00"
@USHRT_MAX = global i32 0
@INFINITY = global float 0.000000e+00
@FLT_MAX = global double 0.000000e+00
@DBL_MAX = global double 0.000000e+00
@str = [22 x i8] c"Values from limits.h:\00"
@str.53 = [2 x i8] c"\0A\00"
@str.54 = [15 x i8] c"Calculations: \00"
@str.55 = [15 x i8] c"-------------\0A\00"
@str.56 = [26 x i8] c"expected uchar min : 0\0A\00"
@str.57 = [26 x i8] c"expected ushort min : 0\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @CHAR_MAX
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = load i32, i32* @CHAR_MIN
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i32 %4)
%6 = load i32, i32* @INT_MAX
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), i32 %6)
%8 = load i32, i32* @INT_MIN
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0), i32 %8)
%10 = load i8*, i8** @LONG_MAX
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0), i8* %10)
%12 = load i8*, i8** @LONG_MIN
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.6, i64 0, i64 0), i8* %12)
%14 = load i32, i32* @SCHAR_MAX
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.7, i64 0, i64 0), i32 %14)
%16 = load i32, i32* @SCHAR_MIN
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.8, i64 0, i64 0), i32 %16)
%18 = load i32, i32* @SHRT_MAX
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.9, i64 0, i64 0), i32 %18)
%20 = load i32, i32* @SHRT_MIN
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.10, i64 0, i64 0), i32 %20)
%22 = load i32, i32* @UCHAR_MAX
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.11, i64 0, i64 0), i32 %22)
%24 = load i32, i32* @UINT_MAX
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.12, i64 0, i64 0), i32 %24)
%26 = load i8*, i8** @ULONG_MAX
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.13, i64 0, i64 0), i8* %26)
%28 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.53, i64 0, i64 0))
%29 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.54, i64 0, i64 0))
%30 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.55, i64 0, i64 0))
br label %31
31: ; preds = %31, %0
%32 = phi i8 [ 0, %0 ], [ %35, %31 ]
%33 = phi i8 [ undef, %0 ], [ %32, %31 ]
%34 = icmp slt i8 %32, %33
%35 = add i8 %32, 1
br i1 %34, label %36, label %31
36: ; preds = %31
%37 = sext i8 %33 to i32
%38 = sext i8 %32 to i32
%39 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.17, i64 0, i64 0), i32 %37)
%40 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.18, i64 0, i64 0), i32 %38)
%41 = load i32, i32* @CHAR_MAX
%42 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.19, i64 0, i64 0), i32 %41)
%43 = load i32, i32* @CHAR_MIN
%44 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.20, i64 0, i64 0), i32 %43)
br label %45
45: ; preds = %45, %36
%46 = phi i8 [ 0, %36 ], [ %49, %45 ]
%47 = phi i8 [ undef, %36 ], [ %46, %45 ]
%48 = icmp ult i8 %46, %47
%49 = add i8 %46, 1
br i1 %48, label %50, label %45
50: ; preds = %45
%51 = zext i8 %47 to i32
%52 = zext i8 %46 to i32
%53 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.21, i64 0, i64 0), i32 %51)
%54 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.22, i64 0, i64 0), i32 %52)
%55 = load i32, i32* @UCHAR_MAX
%56 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.23, i64 0, i64 0), i32 %55)
%57 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.56, i64 0, i64 0))
br label %58
58: ; preds = %61, %50
%59 = phi i16 [ 1, %50 ], [ %63, %61 ]
%60 = phi i16 [ 1000, %50 ], [ %62, %61 ]
br label %61
61: ; preds = %58, %65
%62 = phi i16 [ %66, %65 ], [ %60, %58 ]
%63 = add i16 %62, %59
%64 = icmp slt i16 %63, %59
br i1 %64, label %65, label %58
65: ; preds = %61
%66 = sdiv i16 %62, 2
%67 = add i16 %62, 1
%68 = icmp ult i16 %67, 3
br i1 %68, label %69, label %61
69: ; preds = %65
%70 = sext i16 %59 to i32
%71 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.25, i64 0, i64 0), i32 %70)
%72 = sext i16 %63 to i32
%73 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.26, i64 0, i64 0), i32 %72)
%74 = load i32, i32* @SHRT_MAX
%75 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.27, i64 0, i64 0), i32 %74)
%76 = load i32, i32* @SHRT_MIN
%77 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.28, i64 0, i64 0), i32 %76)
br label %78
78: ; preds = %81, %69
%79 = phi i16 [ 1, %69 ], [ %83, %81 ]
%80 = phi i16 [ 1000, %69 ], [ %82, %81 ]
br label %81
81: ; preds = %78, %85
%82 = phi i16 [ %86, %85 ], [ %80, %78 ]
%83 = add i16 %82, %79
%84 = icmp ult i16 %83, %79
br i1 %84, label %85, label %78
85: ; preds = %81
%86 = sdiv i16 %82, 2
%87 = add i16 %82, 1
%88 = icmp ult i16 %87, 3
br i1 %88, label %89, label %81
89: ; preds = %85
%90 = zext i16 %79 to i32
%91 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.29, i64 0, i64 0), i32 %90)
%92 = zext i16 %83 to i32
%93 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.30, i64 0, i64 0), i32 %92)
%94 = load i32, i32* @USHRT_MAX
%95 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.31, i64 0, i64 0), i32 %94)
%96 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.57, i64 0, i64 0))
unreachable
}