#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  unsigned base = 5;
  unsigned long max = (unsigned long)-1 / base;
  unsigned long max1 = (unsigned long)-1;
  printf("max = %ld, max1 = %ld\n", max, max1 / base);
  if (max != max1 / base) {
    printf("Error %d\n", (int)1);
    exit(1);
  };
  {
    printf("Success\n");
    exit(0);
  };
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
mov    $0xffffffffffffffff,%rax
xor    %edx,%edx
div    %rcx
mov    %rax,-0x10(%rbp)
movq   $0xffffffffffffffff,-0x18(%rbp)
ff
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,%rdx
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
je     11b5 <main+0x95>
lea    0xe78(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
lea    0xe65(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
movabs $0x3333333333333333,%rdx
33 33 33
mov    %rdx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec4(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"max = %ld, max1 = %ld\0A\00"
@.str.1 = [10 x i8] c"Error %d\0A\00"
@.str.2 = [9 x i8] c"Success\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
%4 = alloca i64
store i32 0, i32* %1
store i32 5, i32* %2
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = udiv i64 -1, %6
store i64 %7, i64* %3
store i64 -1, i64* %4
%8 = load i64, i64* %3
%9 = load i64, i64* %4
%10 = load i32, i32* %2
%11 = zext i32 %10 to i64
%12 = udiv i64 %9, %11
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i64 %8, i64 %12)
%14 = load i64, i64* %3
%15 = load i64, i64* %4
%16 = load i32, i32* %2
%17 = zext i32 %16 to i64
%18 = udiv i64 %15, %17
%19 = icmp ne i64 %14, %18
br i1 %19, label %20, label %23
20: ; preds = %0
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 1)
%22 = call i32 @exit(i32 1)
unreachable
23: ; preds = %0
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%25 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [23 x i8] c"max = %ld, max1 = %ld\0A\00"
@str = [8 x i8] c"Success\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i64 3689348814741910323, i64 3689348814741910323)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}