#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_BIT;
int /*<<< orphan*/ _test_MAX_smallerlong_biggerullong(int, int);
int _test_various_MAX_smallerlong_biggerullong() {
  _test_MAX_smallerlong_biggerullong(0, 1);
  _test_MAX_smallerlong_biggerullong(0, 2);
  _test_MAX_smallerlong_biggerullong(
      0,
      ((((int)(((int)(((int)1) << ((sizeof(int) * CHAR_BIT) - 2))) +
               ((int)(((int)(((int)1) << ((sizeof(int) * CHAR_BIT) - 2))) -
                      1)))) > ((int)(~((int)0))))
           ? ((int)(((int)(((int)1) << ((sizeof(int) * CHAR_BIT) - 2))) +
                    ((int)(((int)(((int)1) << ((sizeof(int) * CHAR_BIT) - 2))) -
                           1))))
           : ((int)(~((int)0)))));
  _test_MAX_smallerlong_biggerullong(
      0,
      ((((long)(((long)(((long)1) << ((sizeof(long) * CHAR_BIT) - 2))) +
                ((long)(((long)(((long)1) << ((sizeof(long) * CHAR_BIT) - 2))) -
                        1)))) > ((long)(~((long)0))))
           ? ((long)(((long)(((long)1) << ((sizeof(long) * CHAR_BIT) - 2))) +
                     ((long)(((long)(((long)1)
                                     << ((sizeof(long) * CHAR_BIT) - 2))) -
                             1))))
           : ((long)(~((long)0)))));
  _test_MAX_smallerlong_biggerullong(2, 3);
  _test_MAX_smallerlong_biggerullong(
      ((((long)(((long)(((long)1) << ((sizeof(long) * CHAR_BIT) - 2))) +
                ((long)(((long)(((long)1) << ((sizeof(long) * CHAR_BIT) - 2))) -
                        1)))) > ((long)(~((long)0))))
           ? ((long)(((long)(((long)1) << ((sizeof(long) * CHAR_BIT) - 2))) +
                     ((long)(((long)(((long)1)
                                     << ((sizeof(long) * CHAR_BIT) - 2))) -
                             1))))
           : ((long)(~((long)0)))) -
          1,
      ((((long)(((long)(((long)1) << ((sizeof(long) * CHAR_BIT) - 2))) +
                ((long)(((long)(((long)1) << ((sizeof(long) * CHAR_BIT) - 2))) -
                        1)))) > ((long)(~((long)0))))
           ? ((long)(((long)(((long)1) << ((sizeof(long) * CHAR_BIT) - 2))) +
                     ((long)(((long)(((long)1)
                                     << ((sizeof(long) * CHAR_BIT) - 2))) -
                             1))))
           : ((long)(~((long)0)))));
  _test_MAX_smallerlong_biggerullong(
      ((((long)(((long)(((long)1) << ((sizeof(long) * CHAR_BIT) - 2))) +
                ((long)(((long)(((long)1) << ((sizeof(long) * CHAR_BIT) - 2))) -
                        1)))) > ((long)(~((long)0))))
           ? ((long)(((long)(((long)1) << ((sizeof(long) * CHAR_BIT) - 2))) +
                     ((long)(((long)(((long)1)
                                     << ((sizeof(long) * CHAR_BIT) - 2))) -
                             1))))
           : ((long)(~((long)0)))) -
          2,
      ((((long)(((long)(((long)1) << ((sizeof(long) * CHAR_BIT) - 2))) +
                ((long)(((long)(((long)1) << ((sizeof(long) * CHAR_BIT) - 2))) -
                        1)))) > ((long)(~((long)0))))
           ? ((long)(((long)(((long)1) << ((sizeof(long) * CHAR_BIT) - 2))) +
                     ((long)(((long)(((long)1)
                                     << ((sizeof(long) * CHAR_BIT) - 2))) -
                             1))))
           : ((long)(~((long)0)))) -
          1);
  _test_MAX_smallerlong_biggerullong(
      ((((int)(((int)(((int)1) << ((sizeof(int) * CHAR_BIT) - 2))) +
               ((int)(((int)(((int)1) << ((sizeof(int) * CHAR_BIT) - 2))) -
                      1)))) > ((int)(~((int)0))))
           ? ((int)(((int)(((int)1) << ((sizeof(int) * CHAR_BIT) - 2))) +
                    ((int)(((int)(((int)1) << ((sizeof(int) * CHAR_BIT) - 2))) -
                           1))))
           : ((int)(~((int)0)))) -
          1,
      ((((int)(((int)(((int)1) << ((sizeof(int) * CHAR_BIT) - 2))) +
               ((int)(((int)(((int)1) << ((sizeof(int) * CHAR_BIT) - 2))) -
                      1)))) > ((int)(~((int)0))))
           ? ((int)(((int)(((int)1) << ((sizeof(int) * CHAR_BIT) - 2))) +
                    ((int)(((int)(((int)1) << ((sizeof(int) * CHAR_BIT) - 2))) -
                           1))))
           : ((int)(~((int)0)))));
  _test_MAX_smallerlong_biggerullong(
      ((((int)(((int)(((int)1) << ((sizeof(int) * CHAR_BIT) - 2))) +
               ((int)(((int)(((int)1) << ((sizeof(int) * CHAR_BIT) - 2))) -
                      1)))) > ((int)(~((int)0))))
           ? ((int)(((int)(((int)1) << ((sizeof(int) * CHAR_BIT) - 2))) +
                    ((int)(((int)(((int)1) << ((sizeof(int) * CHAR_BIT) - 2))) -
                           1))))
           : ((int)(~((int)0)))) -
          2,
      ((((int)(((int)(((int)1) << ((sizeof(int) * CHAR_BIT) - 2))) +
               ((int)(((int)(((int)1) << ((sizeof(int) * CHAR_BIT) - 2))) -
                      1)))) > ((int)(~((int)0))))
           ? ((int)(((int)(((int)1) << ((sizeof(int) * CHAR_BIT) - 2))) +
                    ((int)(((int)(((int)1) << ((sizeof(int) * CHAR_BIT) - 2))) -
                           1))))
           : ((int)(~((int)0)))) -
          1);
  return 0;
}


x86 assembly (clang, -O0):
<_test_various_MAX_smallerlong_biggerullong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <_test_MAX_smallerlong_biggerullong@plt>
xor    %edi,%edi
mov    $0x2,%esi
call   1030 <_test_MAX_smallerlong_biggerullong@plt>
mov    0x2ea9(%rip),%rax
movslq (%rax),%rax
shl    $0x2,%rax
sub    $0x2,%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    0x2e8e(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x2,%rcx
sub    $0x2,%rcx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
sub    $0x1,%ecx
add    %ecx,%eax
cmp    $0xffffffff,%eax
jle    11b7 <_test_various_MAX_smallerlong_biggerullong+0xa7>
mov    0x2e65(%rip),%rax
movslq (%rax),%rax
shl    $0x2,%rax
sub    $0x2,%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    0x2e4a(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x2,%rcx
sub    $0x2,%rcx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
sub    $0x1,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    11c4 <_test_various_MAX_smallerlong_biggerullong+0xb4>
mov    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    11c4 <_test_various_MAX_smallerlong_biggerullong+0xb4>
mov    -0x4(%rbp),%esi
xor    %edi,%edi
call   1030 <_test_MAX_smallerlong_biggerullong@plt>
mov    0x2e0b(%rip),%rax
movslq (%rax),%rcx
shl    $0x3,%rcx
sub    $0x2,%rcx
mov    $0x1,%eax
shl    %cl,%rax
mov    0x2df1(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x3,%rcx
sub    $0x2,%rcx
mov    $0x1,%edx
shl    %cl,%rdx
mov    %rdx,%rcx
sub    $0x1,%rcx
add    %rcx,%rax
cmp    $0xffffffffffffffff,%rax
jle    125d <_test_various_MAX_smallerlong_biggerullong+0x14d>
mov    0x2dc3(%rip),%rax
movslq (%rax),%rcx
shl    $0x3,%rcx
sub    $0x2,%rcx
mov    $0x1,%eax
shl    %cl,%rax
mov    0x2da9(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x3,%rcx
sub    $0x2,%rcx
mov    $0x1,%edx
shl    %cl,%rdx
mov    %rdx,%rcx
sub    $0x1,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    126d <_test_various_MAX_smallerlong_biggerullong+0x15d>
mov    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
jmp    126d <_test_various_MAX_smallerlong_biggerullong+0x15d>
mov    -0x10(%rbp),%rax
mov    %eax,%esi
xor    %edi,%edi
call   1030 <_test_MAX_smallerlong_biggerullong@plt>
mov    $0x2,%edi
mov    $0x3,%esi
call   1030 <_test_MAX_smallerlong_biggerullong@plt>
mov    0x2d50(%rip),%rax
movslq (%rax),%rcx
shl    $0x3,%rcx
sub    $0x2,%rcx
mov    $0x1,%eax
shl    %cl,%rax
mov    0x2d36(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x3,%rcx
sub    $0x2,%rcx
mov    $0x1,%edx
shl    %cl,%rdx
mov    %rdx,%rcx
sub    $0x1,%rcx
add    %rcx,%rax
cmp    $0xffffffffffffffff,%rax
jle    1318 <_test_various_MAX_smallerlong_biggerullong+0x208>
mov    0x2d08(%rip),%rax
movslq (%rax),%rcx
shl    $0x3,%rcx
sub    $0x2,%rcx
mov    $0x1,%eax
shl    %cl,%rax
mov    0x2cee(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x3,%rcx
sub    $0x2,%rcx
mov    $0x1,%edx
shl    %cl,%rdx
mov    %rdx,%rcx
sub    $0x1,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
jmp    1328 <_test_various_MAX_smallerlong_biggerullong+0x218>
mov    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
jmp    1328 <_test_various_MAX_smallerlong_biggerullong+0x218>
mov    -0x18(%rbp),%rax
sub    $0x1,%rax
mov    %eax,-0x1c(%rbp)
mov    0x2ca6(%rip),%rax
movslq (%rax),%rcx
shl    $0x3,%rcx
sub    $0x2,%rcx
mov    $0x1,%eax
shl    %cl,%rax
mov    0x2c8c(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x3,%rcx
sub    $0x2,%rcx
mov    $0x1,%edx
shl    %cl,%rdx
mov    %rdx,%rcx
sub    $0x1,%rcx
add    %rcx,%rax
cmp    $0xffffffffffffffff,%rax
jle    13c2 <_test_various_MAX_smallerlong_biggerullong+0x2b2>
mov    0x2c5e(%rip),%rax
movslq (%rax),%rcx
shl    $0x3,%rcx
sub    $0x2,%rcx
mov    $0x1,%eax
shl    %cl,%rax
mov    0x2c44(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x3,%rcx
sub    $0x2,%rcx
mov    $0x1,%edx
shl    %cl,%rdx
mov    %rdx,%rcx
sub    $0x1,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
jmp    13d2 <_test_various_MAX_smallerlong_biggerullong+0x2c2>
mov    $0xffffffffffffffff,%rax
mov    %rax,-0x28(%rbp)
jmp    13d2 <_test_various_MAX_smallerlong_biggerullong+0x2c2>
mov    -0x1c(%rbp),%edi
mov    -0x28(%rbp),%rax
mov    %eax,%esi
call   1030 <_test_MAX_smallerlong_biggerullong@plt>
mov    0x2bf9(%rip),%rax
movslq (%rax),%rcx
shl    $0x3,%rcx
sub    $0x2,%rcx
mov    $0x1,%eax
shl    %cl,%rax
mov    0x2bdf(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x3,%rcx
sub    $0x2,%rcx
mov    $0x1,%edx
shl    %cl,%rdx
mov    %rdx,%rcx
sub    $0x1,%rcx
add    %rcx,%rax
cmp    $0xffffffffffffffff,%rax
jle    146f <_test_various_MAX_smallerlong_biggerullong+0x35f>
mov    0x2bb1(%rip),%rax
movslq (%rax),%rcx
shl    $0x3,%rcx
sub    $0x2,%rcx
mov    $0x1,%eax
shl    %cl,%rax
mov    0x2b97(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x3,%rcx
sub    $0x2,%rcx
mov    $0x1,%edx
shl    %cl,%rdx
mov    %rdx,%rcx
sub    $0x1,%rcx
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
jmp    147f <_test_various_MAX_smallerlong_biggerullong+0x36f>
mov    $0xffffffffffffffff,%rax
mov    %rax,-0x30(%rbp)
jmp    147f <_test_various_MAX_smallerlong_biggerullong+0x36f>
mov    -0x30(%rbp),%rax
sub    $0x2,%rax
mov    %eax,-0x34(%rbp)
mov    0x2b4f(%rip),%rax
movslq (%rax),%rcx
shl    $0x3,%rcx
sub    $0x2,%rcx
mov    $0x1,%eax
shl    %cl,%rax
mov    0x2b35(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x3,%rcx
sub    $0x2,%rcx
mov    $0x1,%edx
shl    %cl,%rdx
mov    %rdx,%rcx
sub    $0x1,%rcx
add    %rcx,%rax
cmp    $0xffffffffffffffff,%rax
jle    1519 <_test_various_MAX_smallerlong_biggerullong+0x409>
mov    0x2b07(%rip),%rax
movslq (%rax),%rcx
shl    $0x3,%rcx
sub    $0x2,%rcx
mov    $0x1,%eax
shl    %cl,%rax
mov    0x2aed(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x3,%rcx
sub    $0x2,%rcx
mov    $0x1,%edx
shl    %cl,%rdx
mov    %rdx,%rcx
sub    $0x1,%rcx
add    %rcx,%rax
mov    %rax,-0x40(%rbp)
jmp    1529 <_test_various_MAX_smallerlong_biggerullong+0x419>
mov    $0xffffffffffffffff,%rax
mov    %rax,-0x40(%rbp)
jmp    1529 <_test_various_MAX_smallerlong_biggerullong+0x419>
mov    -0x34(%rbp),%edi
mov    -0x40(%rbp),%rax
sub    $0x1,%rax
mov    %eax,%esi
call   1030 <_test_MAX_smallerlong_biggerullong@plt>
mov    0x2a9e(%rip),%rax
movslq (%rax),%rax
shl    $0x2,%rax
sub    $0x2,%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    0x2a83(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x2,%rcx
sub    $0x2,%rcx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
sub    $0x1,%ecx
add    %ecx,%eax
cmp    $0xffffffff,%eax
jle    15c2 <_test_various_MAX_smallerlong_biggerullong+0x4b2>
mov    0x2a5a(%rip),%rax
movslq (%rax),%rax
shl    $0x2,%rax
sub    $0x2,%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    0x2a3f(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x2,%rcx
sub    $0x2,%rcx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
sub    $0x1,%ecx
add    %ecx,%eax
mov    %eax,-0x44(%rbp)
jmp    15cf <_test_various_MAX_smallerlong_biggerullong+0x4bf>
mov    $0xffffffff,%eax
mov    %eax,-0x44(%rbp)
jmp    15cf <_test_various_MAX_smallerlong_biggerullong+0x4bf>
mov    -0x44(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x48(%rbp)
mov    0x2a01(%rip),%rax
movslq (%rax),%rax
shl    $0x2,%rax
sub    $0x2,%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    0x29e6(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x2,%rcx
sub    $0x2,%rcx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
sub    $0x1,%ecx
add    %ecx,%eax
cmp    $0xffffffff,%eax
jle    165f <_test_various_MAX_smallerlong_biggerullong+0x54f>
mov    0x29bd(%rip),%rax
movslq (%rax),%rax
shl    $0x2,%rax
sub    $0x2,%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    0x29a2(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x2,%rcx
sub    $0x2,%rcx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
sub    $0x1,%ecx
add    %ecx,%eax
mov    %eax,-0x4c(%rbp)
jmp    166c <_test_various_MAX_smallerlong_biggerullong+0x55c>
mov    $0xffffffff,%eax
mov    %eax,-0x4c(%rbp)
jmp    166c <_test_various_MAX_smallerlong_biggerullong+0x55c>
mov    -0x48(%rbp),%edi
mov    -0x4c(%rbp),%esi
call   1030 <_test_MAX_smallerlong_biggerullong@plt>
mov    0x2962(%rip),%rax
movslq (%rax),%rax
shl    $0x2,%rax
sub    $0x2,%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    0x2947(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x2,%rcx
sub    $0x2,%rcx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
sub    $0x1,%ecx
add    %ecx,%eax
cmp    $0xffffffff,%eax
jle    16fe <_test_various_MAX_smallerlong_biggerullong+0x5ee>
mov    0x291e(%rip),%rax
movslq (%rax),%rax
shl    $0x2,%rax
sub    $0x2,%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    0x2903(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x2,%rcx
sub    $0x2,%rcx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
sub    $0x1,%ecx
add    %ecx,%eax
mov    %eax,-0x50(%rbp)
jmp    170b <_test_various_MAX_smallerlong_biggerullong+0x5fb>
mov    $0xffffffff,%eax
mov    %eax,-0x50(%rbp)
jmp    170b <_test_various_MAX_smallerlong_biggerullong+0x5fb>
mov    -0x50(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x54(%rbp)
mov    0x28c5(%rip),%rax
movslq (%rax),%rax
shl    $0x2,%rax
sub    $0x2,%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    0x28aa(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x2,%rcx
sub    $0x2,%rcx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
sub    $0x1,%ecx
add    %ecx,%eax
cmp    $0xffffffff,%eax
jle    179b <_test_various_MAX_smallerlong_biggerullong+0x68b>
mov    0x2881(%rip),%rax
movslq (%rax),%rax
shl    $0x2,%rax
sub    $0x2,%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    0x2866(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x2,%rcx
sub    $0x2,%rcx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
sub    $0x1,%ecx
add    %ecx,%eax
mov    %eax,-0x58(%rbp)
jmp    17a8 <_test_various_MAX_smallerlong_biggerullong+0x698>
mov    $0xffffffff,%eax
mov    %eax,-0x58(%rbp)
jmp    17a8 <_test_various_MAX_smallerlong_biggerullong+0x698>
mov    -0x54(%rbp),%edi
mov    -0x58(%rbp),%esi
sub    $0x1,%esi
call   1030 <_test_MAX_smallerlong_biggerullong@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_test_various_MAX_smallerlong_biggerullong>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <_test_MAX_smallerlong_biggerullong@plt>
mov    $0x2,%r14d
xor    %edi,%edi
mov    $0x2,%esi
call   1030 <_test_MAX_smallerlong_biggerullong@plt>
mov    0x2ea3(%rip),%r15
mov    (%r15),%cl
shl    $0x2,%cl
add    $0xfe,%cl
mov    $0x2,%esi
shl    %cl,%esi
add    $0xffffffff,%esi
mov    $0xffffffff,%ebx
cmovs  %ebx,%esi
xor    %edi,%edi
call   1030 <_test_MAX_smallerlong_biggerullong@plt>
mov    (%r15),%cl
shl    $0x3,%cl
add    $0xfe,%cl
mov    $0x2,%esi
shl    %cl,%rsi
mov    $0x2,%ebp
add    $0xffffffffffffffff,%rsi
cmovs  %ebx,%esi
xor    %edi,%edi
call   1030 <_test_MAX_smallerlong_biggerullong@plt>
mov    $0x2,%edi
mov    $0x3,%esi
call   1030 <_test_MAX_smallerlong_biggerullong@plt>
mov    (%r15),%cl
shl    $0x3,%cl
add    $0xfe,%cl
mov    $0x2,%edi
shl    %cl,%rdi
lea    -0x1(%rdi),%rsi
add    $0xfffffffe,%edi
test   %rsi,%rsi
mov    $0xfffffffe,%r12d
cmovs  %r12d,%edi
cmovs  %ebx,%esi
call   1030 <_test_MAX_smallerlong_biggerullong@plt>
mov    (%r15),%cl
shl    $0x3,%cl
add    $0xfe,%cl
shl    %cl,%rbp
lea    -0x3(%rbp),%edi
lea    -0x2(%rbp),%esi
add    $0xffffffffffffffff,%rbp
mov    $0xfffffffd,%ebp
cmovs  %ebp,%edi
cmovs  %r12d,%esi
call   1030 <_test_MAX_smallerlong_biggerullong@plt>
mov    (%r15),%cl
shl    $0x2,%cl
add    $0xfe,%cl
mov    $0x2,%edi
shl    %cl,%edi
lea    -0x1(%rdi),%eax
add    $0xfffffffe,%edi
test   %eax,%eax
cmovs  %r12d,%edi
cmovns %eax,%ebx
mov    %ebx,%esi
call   1030 <_test_MAX_smallerlong_biggerullong@plt>
mov    (%r15),%cl
shl    $0x2,%cl
add    $0xfe,%cl
shl    %cl,%r14d
lea    -0x3(%r14),%edi
lea    -0x2(%r14),%esi
add    $0xffffffff,%r14d
cmovs  %ebp,%edi
cmovs  %r12d,%esi
call   1030 <_test_MAX_smallerlong_biggerullong@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@CHAR_BIT = global i32 0
define i32 @_test_various_MAX_smallerlong_biggerullong() {
%1 = call i32 @_test_MAX_smallerlong_biggerullong(i32 0, i32 1)
%2 = call i32 @_test_MAX_smallerlong_biggerullong(i32 0, i32 2)
%3 = load i32, i32* @CHAR_BIT
%4 = sext i32 %3 to i64
%5 = mul i64 4, %4
%6 = sub i64 %5, 2
%7 = trunc i64 %6 to i32
%8 = shl i32 1, %7
%9 = load i32, i32* @CHAR_BIT
%10 = sext i32 %9 to i64
%11 = mul i64 4, %10
%12 = sub i64 %11, 2
%13 = trunc i64 %12 to i32
%14 = shl i32 1, %13
%15 = sub nsw i32 %14, 1
%16 = add nsw i32 %8, %15
%17 = icmp sgt i32 %16, -1
br i1 %17, label %18, label %33
18: ; preds = %0
%19 = load i32, i32* @CHAR_BIT
%20 = sext i32 %19 to i64
%21 = mul i64 4, %20
%22 = sub i64 %21, 2
%23 = trunc i64 %22 to i32
%24 = shl i32 1, %23
%25 = load i32, i32* @CHAR_BIT
%26 = sext i32 %25 to i64
%27 = mul i64 4, %26
%28 = sub i64 %27, 2
%29 = trunc i64 %28 to i32
%30 = shl i32 1, %29
%31 = sub nsw i32 %30, 1
%32 = add nsw i32 %24, %31
br label %34
33: ; preds = %0
br label %34
34: ; preds = %33, %18
%35 = phi i32 [ %32, %18 ], [ -1, %33 ]
%36 = call i32 @_test_MAX_smallerlong_biggerullong(i32 0, i32 %35)
%37 = load i32, i32* @CHAR_BIT
%38 = sext i32 %37 to i64
%39 = mul i64 8, %38
%40 = sub i64 %39, 2
%41 = shl i64 1, %40
%42 = load i32, i32* @CHAR_BIT
%43 = sext i32 %42 to i64
%44 = mul i64 8, %43
%45 = sub i64 %44, 2
%46 = shl i64 1, %45
%47 = sub nsw i64 %46, 1
%48 = add nsw i64 %41, %47
%49 = icmp sgt i64 %48, -1
br i1 %49, label %50, label %63
50: ; preds = %34
%51 = load i32, i32* @CHAR_BIT
%52 = sext i32 %51 to i64
%53 = mul i64 8, %52
%54 = sub i64 %53, 2
%55 = shl i64 1, %54
%56 = load i32, i32* @CHAR_BIT
%57 = sext i32 %56 to i64
%58 = mul i64 8, %57
%59 = sub i64 %58, 2
%60 = shl i64 1, %59
%61 = sub nsw i64 %60, 1
%62 = add nsw i64 %55, %61
br label %64
63: ; preds = %34
br label %64
64: ; preds = %63, %50
%65 = phi i64 [ %62, %50 ], [ -1, %63 ]
%66 = trunc i64 %65 to i32
%67 = call i32 @_test_MAX_smallerlong_biggerullong(i32 0, i32 %66)
%68 = call i32 @_test_MAX_smallerlong_biggerullong(i32 2, i32 3)
%69 = load i32, i32* @CHAR_BIT
%70 = sext i32 %69 to i64
%71 = mul i64 8, %70
%72 = sub i64 %71, 2
%73 = shl i64 1, %72
%74 = load i32, i32* @CHAR_BIT
%75 = sext i32 %74 to i64
%76 = mul i64 8, %75
%77 = sub i64 %76, 2
%78 = shl i64 1, %77
%79 = sub nsw i64 %78, 1
%80 = add nsw i64 %73, %79
%81 = icmp sgt i64 %80, -1
br i1 %81, label %82, label %95
82: ; preds = %64
%83 = load i32, i32* @CHAR_BIT
%84 = sext i32 %83 to i64
%85 = mul i64 8, %84
%86 = sub i64 %85, 2
%87 = shl i64 1, %86
%88 = load i32, i32* @CHAR_BIT
%89 = sext i32 %88 to i64
%90 = mul i64 8, %89
%91 = sub i64 %90, 2
%92 = shl i64 1, %91
%93 = sub nsw i64 %92, 1
%94 = add nsw i64 %87, %93
br label %96
95: ; preds = %64
br label %96
96: ; preds = %95, %82
%97 = phi i64 [ %94, %82 ], [ -1, %95 ]
%98 = sub nsw i64 %97, 1
%99 = trunc i64 %98 to i32
%100 = load i32, i32* @CHAR_BIT
%101 = sext i32 %100 to i64
%102 = mul i64 8, %101
%103 = sub i64 %102, 2
%104 = shl i64 1, %103
%105 = load i32, i32* @CHAR_BIT
%106 = sext i32 %105 to i64
%107 = mul i64 8, %106
%108 = sub i64 %107, 2
%109 = shl i64 1, %108
%110 = sub nsw i64 %109, 1
%111 = add nsw i64 %104, %110
%112 = icmp sgt i64 %111, -1
br i1 %112, label %113, label %126
113: ; preds = %96
%114 = load i32, i32* @CHAR_BIT
%115 = sext i32 %114 to i64
%116 = mul i64 8, %115
%117 = sub i64 %116, 2
%118 = shl i64 1, %117
%119 = load i32, i32* @CHAR_BIT
%120 = sext i32 %119 to i64
%121 = mul i64 8, %120
%122 = sub i64 %121, 2
%123 = shl i64 1, %122
%124 = sub nsw i64 %123, 1
%125 = add nsw i64 %118, %124
br label %127
126: ; preds = %96
br label %127
127: ; preds = %126, %113
%128 = phi i64 [ %125, %113 ], [ -1, %126 ]
%129 = trunc i64 %128 to i32
%130 = call i32 @_test_MAX_smallerlong_biggerullong(i32 %99, i32 %129)
%131 = load i32, i32* @CHAR_BIT
%132 = sext i32 %131 to i64
%133 = mul i64 8, %132
%134 = sub i64 %133, 2
%135 = shl i64 1, %134
%136 = load i32, i32* @CHAR_BIT
%137 = sext i32 %136 to i64
%138 = mul i64 8, %137
%139 = sub i64 %138, 2
%140 = shl i64 1, %139
%141 = sub nsw i64 %140, 1
%142 = add nsw i64 %135, %141
%143 = icmp sgt i64 %142, -1
br i1 %143, label %144, label %157
144: ; preds = %127
%145 = load i32, i32* @CHAR_BIT
%146 = sext i32 %145 to i64
%147 = mul i64 8, %146
%148 = sub i64 %147, 2
%149 = shl i64 1, %148
%150 = load i32, i32* @CHAR_BIT
%151 = sext i32 %150 to i64
%152 = mul i64 8, %151
%153 = sub i64 %152, 2
%154 = shl i64 1, %153
%155 = sub nsw i64 %154, 1
%156 = add nsw i64 %149, %155
br label %158
157: ; preds = %127
br label %158
158: ; preds = %157, %144
%159 = phi i64 [ %156, %144 ], [ -1, %157 ]
%160 = sub nsw i64 %159, 2
%161 = trunc i64 %160 to i32
%162 = load i32, i32* @CHAR_BIT
%163 = sext i32 %162 to i64
%164 = mul i64 8, %163
%165 = sub i64 %164, 2
%166 = shl i64 1, %165
%167 = load i32, i32* @CHAR_BIT
%168 = sext i32 %167 to i64
%169 = mul i64 8, %168
%170 = sub i64 %169, 2
%171 = shl i64 1, %170
%172 = sub nsw i64 %171, 1
%173 = add nsw i64 %166, %172
%174 = icmp sgt i64 %173, -1
br i1 %174, label %175, label %188
175: ; preds = %158
%176 = load i32, i32* @CHAR_BIT
%177 = sext i32 %176 to i64
%178 = mul i64 8, %177
%179 = sub i64 %178, 2
%180 = shl i64 1, %179
%181 = load i32, i32* @CHAR_BIT
%182 = sext i32 %181 to i64
%183 = mul i64 8, %182
%184 = sub i64 %183, 2
%185 = shl i64 1, %184
%186 = sub nsw i64 %185, 1
%187 = add nsw i64 %180, %186
br label %189
188: ; preds = %158
br label %189
189: ; preds = %188, %175
%190 = phi i64 [ %187, %175 ], [ -1, %188 ]
%191 = sub nsw i64 %190, 1
%192 = trunc i64 %191 to i32
%193 = call i32 @_test_MAX_smallerlong_biggerullong(i32 %161, i32 %192)
%194 = load i32, i32* @CHAR_BIT
%195 = sext i32 %194 to i64
%196 = mul i64 4, %195
%197 = sub i64 %196, 2
%198 = trunc i64 %197 to i32
%199 = shl i32 1, %198
%200 = load i32, i32* @CHAR_BIT
%201 = sext i32 %200 to i64
%202 = mul i64 4, %201
%203 = sub i64 %202, 2
%204 = trunc i64 %203 to i32
%205 = shl i32 1, %204
%206 = sub nsw i32 %205, 1
%207 = add nsw i32 %199, %206
%208 = icmp sgt i32 %207, -1
br i1 %208, label %209, label %224
209: ; preds = %189
%210 = load i32, i32* @CHAR_BIT
%211 = sext i32 %210 to i64
%212 = mul i64 4, %211
%213 = sub i64 %212, 2
%214 = trunc i64 %213 to i32
%215 = shl i32 1, %214
%216 = load i32, i32* @CHAR_BIT
%217 = sext i32 %216 to i64
%218 = mul i64 4, %217
%219 = sub i64 %218, 2
%220 = trunc i64 %219 to i32
%221 = shl i32 1, %220
%222 = sub nsw i32 %221, 1
%223 = add nsw i32 %215, %222
br label %225
224: ; preds = %189
br label %225
225: ; preds = %224, %209
%226 = phi i32 [ %223, %209 ], [ -1, %224 ]
%227 = sub nsw i32 %226, 1
%228 = load i32, i32* @CHAR_BIT
%229 = sext i32 %228 to i64
%230 = mul i64 4, %229
%231 = sub i64 %230, 2
%232 = trunc i64 %231 to i32
%233 = shl i32 1, %232
%234 = load i32, i32* @CHAR_BIT
%235 = sext i32 %234 to i64
%236 = mul i64 4, %235
%237 = sub i64 %236, 2
%238 = trunc i64 %237 to i32
%239 = shl i32 1, %238
%240 = sub nsw i32 %239, 1
%241 = add nsw i32 %233, %240
%242 = icmp sgt i32 %241, -1
br i1 %242, label %243, label %258
243: ; preds = %225
%244 = load i32, i32* @CHAR_BIT
%245 = sext i32 %244 to i64
%246 = mul i64 4, %245
%247 = sub i64 %246, 2
%248 = trunc i64 %247 to i32
%249 = shl i32 1, %248
%250 = load i32, i32* @CHAR_BIT
%251 = sext i32 %250 to i64
%252 = mul i64 4, %251
%253 = sub i64 %252, 2
%254 = trunc i64 %253 to i32
%255 = shl i32 1, %254
%256 = sub nsw i32 %255, 1
%257 = add nsw i32 %249, %256
br label %259
258: ; preds = %225
br label %259
259: ; preds = %258, %243
%260 = phi i32 [ %257, %243 ], [ -1, %258 ]
%261 = call i32 @_test_MAX_smallerlong_biggerullong(i32 %227, i32 %260)
%262 = load i32, i32* @CHAR_BIT
%263 = sext i32 %262 to i64
%264 = mul i64 4, %263
%265 = sub i64 %264, 2
%266 = trunc i64 %265 to i32
%267 = shl i32 1, %266
%268 = load i32, i32* @CHAR_BIT
%269 = sext i32 %268 to i64
%270 = mul i64 4, %269
%271 = sub i64 %270, 2
%272 = trunc i64 %271 to i32
%273 = shl i32 1, %272
%274 = sub nsw i32 %273, 1
%275 = add nsw i32 %267, %274
%276 = icmp sgt i32 %275, -1
br i1 %276, label %277, label %292
277: ; preds = %259
%278 = load i32, i32* @CHAR_BIT
%279 = sext i32 %278 to i64
%280 = mul i64 4, %279
%281 = sub i64 %280, 2
%282 = trunc i64 %281 to i32
%283 = shl i32 1, %282
%284 = load i32, i32* @CHAR_BIT
%285 = sext i32 %284 to i64
%286 = mul i64 4, %285
%287 = sub i64 %286, 2
%288 = trunc i64 %287 to i32
%289 = shl i32 1, %288
%290 = sub nsw i32 %289, 1
%291 = add nsw i32 %283, %290
br label %293
292: ; preds = %259
br label %293
293: ; preds = %292, %277
%294 = phi i32 [ %291, %277 ], [ -1, %292 ]
%295 = sub nsw i32 %294, 2
%296 = load i32, i32* @CHAR_BIT
%297 = sext i32 %296 to i64
%298 = mul i64 4, %297
%299 = sub i64 %298, 2
%300 = trunc i64 %299 to i32
%301 = shl i32 1, %300
%302 = load i32, i32* @CHAR_BIT
%303 = sext i32 %302 to i64
%304 = mul i64 4, %303
%305 = sub i64 %304, 2
%306 = trunc i64 %305 to i32
%307 = shl i32 1, %306
%308 = sub nsw i32 %307, 1
%309 = add nsw i32 %301, %308
%310 = icmp sgt i32 %309, -1
br i1 %310, label %311, label %326
311: ; preds = %293
%312 = load i32, i32* @CHAR_BIT
%313 = sext i32 %312 to i64
%314 = mul i64 4, %313
%315 = sub i64 %314, 2
%316 = trunc i64 %315 to i32
%317 = shl i32 1, %316
%318 = load i32, i32* @CHAR_BIT
%319 = sext i32 %318 to i64
%320 = mul i64 4, %319
%321 = sub i64 %320, 2
%322 = trunc i64 %321 to i32
%323 = shl i32 1, %322
%324 = sub nsw i32 %323, 1
%325 = add nsw i32 %317, %324
br label %327
326: ; preds = %293
br label %327
327: ; preds = %326, %311
%328 = phi i32 [ %325, %311 ], [ -1, %326 ]
%329 = sub nsw i32 %328, 1
%330 = call i32 @_test_MAX_smallerlong_biggerullong(i32 %295, i32 %329)
ret i32 0
}

LLVM IR (-O2):
@CHAR_BIT = global i32 0
define i32 @_test_various_MAX_smallerlong_biggerullong() {
%1 = tail call i32 @_test_MAX_smallerlong_biggerullong(i32 0, i32 1)
%2 = tail call i32 @_test_MAX_smallerlong_biggerullong(i32 0, i32 2)
%3 = load i32, i32* @CHAR_BIT
%4 = shl i32 %3, 2
%5 = add i32 %4, -2
%6 = shl i32 2, %5
%7 = add i32 %6, -1
%8 = icmp sgt i32 %7, -1
%9 = select i1 %8, i32 %7, i32 -1
%10 = tail call i32 @_test_MAX_smallerlong_biggerullong(i32 0, i32 %9)
%11 = load i32, i32* @CHAR_BIT
%12 = sext i32 %11 to i64
%13 = shl nsw i64 %12, 3
%14 = add nsw i64 %13, -2
%15 = shl i64 2, %14
%16 = add i64 %15, -1
%17 = icmp sgt i64 %16, -1
%18 = select i1 %17, i64 %16, i64 -1
%19 = trunc i64 %18 to i32
%20 = tail call i32 @_test_MAX_smallerlong_biggerullong(i32 0, i32 %19)
%21 = tail call i32 @_test_MAX_smallerlong_biggerullong(i32 2, i32 3)
%22 = load i32, i32* @CHAR_BIT
%23 = sext i32 %22 to i64
%24 = shl nsw i64 %23, 3
%25 = add nsw i64 %24, -2
%26 = shl i64 2, %25
%27 = add i64 %26, -1
%28 = icmp sgt i64 %27, -1
%29 = trunc i64 %26 to i32
%30 = add i32 %29, -2
%31 = select i1 %28, i32 %30, i32 -2
%32 = icmp sgt i64 %27, -1
%33 = select i1 %32, i64 %27, i64 -1
%34 = trunc i64 %33 to i32
%35 = tail call i32 @_test_MAX_smallerlong_biggerullong(i32 %31, i32 %34)
%36 = load i32, i32* @CHAR_BIT
%37 = sext i32 %36 to i64
%38 = shl nsw i64 %37, 3
%39 = add nsw i64 %38, -2
%40 = shl i64 2, %39
%41 = add i64 %40, -1
%42 = icmp sgt i64 %41, -1
%43 = trunc i64 %40 to i32
%44 = add i32 %43, -3
%45 = select i1 %42, i32 %44, i32 -3
%46 = add i32 %43, -2
%47 = select i1 %42, i32 %46, i32 -2
%48 = tail call i32 @_test_MAX_smallerlong_biggerullong(i32 %45, i32 %47)
%49 = load i32, i32* @CHAR_BIT
%50 = shl i32 %49, 2
%51 = add i32 %50, -2
%52 = shl i32 2, %51
%53 = add i32 %52, -1
%54 = icmp sgt i32 %53, -1
%55 = add i32 %52, -2
%56 = select i1 %54, i32 %55, i32 -2
%57 = select i1 %54, i32 %53, i32 -1
%58 = tail call i32 @_test_MAX_smallerlong_biggerullong(i32 %56, i32 %57)
%59 = load i32, i32* @CHAR_BIT
%60 = shl i32 %59, 2
%61 = add i32 %60, -2
%62 = shl i32 2, %61
%63 = add i32 %62, -1
%64 = icmp sgt i32 %63, -1
%65 = add i32 %62, -3
%66 = select i1 %64, i32 %65, i32 -3
%67 = add i32 %62, -2
%68 = select i1 %64, i32 %67, i32 -2
%69 = tail call i32 @_test_MAX_smallerlong_biggerullong(i32 %66, i32 %68)
ret i32 0
}