#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 INT_MAX;
int INT_MIN;
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("%d\n", INT_MAX + 1);
  printf("%d\n", INT_MIN - 1);
  printf("%d\n", INT_MIN * INT_MIN);
  printf("%d\n", INT_MIN * INT_MAX);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%esi
add    $0x1,%esi
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%esi
sub    $0x1,%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e8a(%rip),%rax
mov    (%rax),%esi
mov    0x2e81(%rip),%rax
imul   (%rax),%esi
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e6b(%rip),%rax
mov    (%rax),%esi
mov    0x2e6a(%rip),%rax
imul   (%rax),%esi
lea    0xe78(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    0x2ecc(%rip),%r14
mov    (%r14),%esi
add    $0x1,%esi
lea    0xed7(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x2ea8(%rip),%r15
mov    (%r15),%esi
add    $0xffffffff,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    (%r15),%esi
imul   %esi,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    (%r14),%esi
imul   (%r15),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@INT_MAX = global i32 0
@INT_MIN = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @INT_MAX
%3 = add nsw i32 %2, 1
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @INT_MIN
%6 = sub nsw i32 %5, 1
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* @INT_MIN
%9 = load i32, i32* @INT_MIN
%10 = mul nsw i32 %8, %9
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = load i32, i32* @INT_MIN
%13 = load i32, i32* @INT_MAX
%14 = mul nsw i32 %12, %13
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@INT_MAX = global i32 0
@INT_MIN = global i32 0
define i32 @main() {
%1 = load i32, i32* @INT_MAX
%2 = add nsw i32 %1, 1
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = load i32, i32* @INT_MIN
%5 = add nsw i32 %4, -1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* @INT_MIN
%8 = mul nsw i32 %7, %7
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i32, i32* @INT_MIN
%11 = load i32, i32* @INT_MAX
%12 = mul nsw i32 %11, %10
%13 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
ret i32 0
}