#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 */
unsigned long long max_1(unsigned int, unsigned int);
unsigned long long max_2(unsigned int, unsigned int);
unsigned long long max_3(unsigned int, unsigned int);
unsigned long long max_4(unsigned int, unsigned int);
int /*<<< orphan*/ printf(char *, unsigned int, unsigned int, unsigned int,
                          unsigned long long, unsigned long long,
                          unsigned long long, unsigned long long);
int main(void) {
  unsigned i, j;
  for (i = 0; i < 64; i++)
    for (j = i; j < 64; j++) {
      unsigned bits = j - i + 1;
      unsigned long long m1, m2, m3, m4;
      m1 = max_1(i, j);
      m2 = max_2(i, j);
      m3 = max_3(i, j);
      m4 = max_4(i, j);
      if (m3 != m4)
        printf("%u-%u (%u): %18llu %18llu %18llu %18llu\n", i, j, bits, m1, m2,
               m3, m4);
    }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x40,-0x8(%rbp)
jae    122a <main+0xda>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x40,-0xc(%rbp)
jae    1217 <main+0xc7>
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <max_1@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1060 <max_2@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <max_3@plt>
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1070 <max_4@plt>
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x30(%rbp),%rax
je     1204 <main+0xb4>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
mov    -0x28(%rbp),%r10
mov    -0x30(%rbp),%rax
lea    0xe0a(%rip),%rdi
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1050 <printf@plt>
jmp    1209 <main+0xb9>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1176 <main+0x26>
jmp    121c <main+0xcc>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1166 <main+0x16>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
xor    %r15d,%r15d
jmp    116a <main+0x1a>
add    $0x1,%r15d
cmp    $0x40,%r15d
je     11e3 <main+0x93>
mov    $0x1,%ebp
mov    %r15d,%ebx
jmp    118b <main+0x3b>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%ebx
add    $0x1,%ebp
cmp    $0x40,%ebx
je     1160 <main+0x10>
mov    %r15d,%edi
mov    %ebx,%esi
call   1040 <max_1@plt>
mov    %rax,%r12
mov    %r15d,%edi
mov    %ebx,%esi
call   1060 <max_2@plt>
mov    %rax,%r13
mov    %r15d,%edi
mov    %ebx,%esi
call   1030 <max_3@plt>
mov    %rax,%r14
mov    %r15d,%edi
mov    %ebx,%esi
call   1070 <max_4@plt>
cmp    %rax,%r14
je     1180 <main+0x30>
lea    0xe38(%rip),%rdi
mov    %r15d,%esi
mov    %ebx,%edx
mov    %ebp,%ecx
mov    %r12,%r8
mov    %r13,%r9
push   %rax
push   %r14
call   1050 <printf@plt>
add    $0x10,%rsp
jmp    1180 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [41 x i8] c"%u-%u (%u): %18llu %18llu %18llu %18llu\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i32 0, i32* %1
store i32 0, i32* %2
br label %9
9: ; preds = %51, %0
%10 = load i32, i32* %2
%11 = icmp ult i32 %10, 64
br i1 %11, label %12, label %54
12: ; preds = %9
%13 = load i32, i32* %2
store i32 %13, i32* %3
br label %14
14: ; preds = %47, %12
%15 = load i32, i32* %3
%16 = icmp ult i32 %15, 64
br i1 %16, label %17, label %50
17: ; preds = %14
%18 = load i32, i32* %3
%19 = load i32, i32* %2
%20 = sub i32 %18, %19
%21 = add i32 %20, 1
store i32 %21, i32* %4
%22 = load i32, i32* %2
%23 = load i32, i32* %3
%24 = call i64 @max_1(i32 %22, i32 %23)
store i64 %24, i64* %5
%25 = load i32, i32* %2
%26 = load i32, i32* %3
%27 = call i64 @max_2(i32 %25, i32 %26)
store i64 %27, i64* %6
%28 = load i32, i32* %2
%29 = load i32, i32* %3
%30 = call i64 @max_3(i32 %28, i32 %29)
store i64 %30, i64* %7
%31 = load i32, i32* %2
%32 = load i32, i32* %3
%33 = call i64 @max_4(i32 %31, i32 %32)
store i64 %33, i64* %8
%34 = load i64, i64* %7
%35 = load i64, i64* %8
%36 = icmp ne i64 %34, %35
br i1 %36, label %37, label %46
37: ; preds = %17
%38 = load i32, i32* %2
%39 = load i32, i32* %3
%40 = load i32, i32* %4
%41 = load i64, i64* %5
%42 = load i64, i64* %6
%43 = load i64, i64* %7
%44 = load i64, i64* %8
%45 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %38, i32 %39, i32 %40, i64 %41, i64 %42, i64 %43, i64 %44)
br label %46
46: ; preds = %37, %17
br label %47
47: ; preds = %46
%48 = load i32, i32* %3
%49 = add i32 %48, 1
store i32 %49, i32* %3
br label %14
50: ; preds = %14
br label %51
51: ; preds = %50
%52 = load i32, i32* %2
%53 = add i32 %52, 1
store i32 %53, i32* %2
br label %9
54: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
@.str = [41 x i8] c"%u-%u (%u): %18llu %18llu %18llu %18llu\0A\00"
define i32 @main() {
br label %1
1: ; preds = %17, %0
%2 = phi i32 [ 0, %0 ], [ %18, %17 ]
%3 = sub nsw i32 1, %2
br label %4
4: ; preds = %1, %14
%5 = phi i32 [ %2, %1 ], [ %15, %14 ]
%6 = tail call i64 @max_1(i32 %2, i32 %5)
%7 = tail call i64 @max_2(i32 %2, i32 %5)
%8 = tail call i64 @max_3(i32 %2, i32 %5)
%9 = tail call i64 @max_4(i32 %2, i32 %5)
%10 = icmp eq i64 %8, %9
br i1 %10, label %14, label %11
11: ; preds = %4
%12 = add nsw i32 %3, %5
%13 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %5, i32 %12, i64 %6, i64 %7, i64 %8, i64 %9)
br label %14
14: ; preds = %11, %4
%15 = add nuw nsw i32 %5, 1
%16 = icmp eq i32 %15, 64
br i1 %16, label %17, label %4
17: ; preds = %14
%18 = add nuw nsw i32 %2, 1
%19 = icmp eq i32 %18, 64
br i1 %19, label %20, label %1
20: ; preds = %17
ret i32 0
}