#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 pow(int, int);
int /*<<< orphan*/ printf(char *, int, ...);
int main() {
  int int_min;
  int a;
  int b;
  int_min = (-1) * pow(2, sizeof(int) * 8 - 1);
  a = int_min + 100;
  b = int_min + 200;
  printf("int_min = %d\n", int_min);
  printf("%d + (%d) = %d\n", a, b, a + b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%edi
mov    $0x1f,%esi
call   1040 <pow@plt>
imul   $0xffffffff,%eax,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x64,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0xc8,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
add    -0x10(%rbp),%ecx
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    $0x2,%edi
mov    $0x1f,%esi
call   1040 <pow@plt>
mov    %eax,%ebx
mov    %eax,%esi
neg    %esi
mov    $0x64,%r14d
sub    %eax,%r14d
mov    $0xc8,%ebp
sub    %eax,%ebp
add    %eax,%ebx
lea    0xeae(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x12c,%ecx
sub    %ebx,%ecx
lea    0xea7(%rip),%rdi
mov    %r14d,%esi
mov    %ebp,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"int_min = %d\0A\00"
@.str.1 = [16 x i8] c"%d + (%d) = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @pow(i32 2, i32 31)
%2 = sub nsw i32 0, %1
%3 = sub i32 100, %1
%4 = sub i32 200, %1
%5 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %2)
%6 = add nsw i32 %3, %4
%7 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %3, i32 %4, i32 %6)
ret i32 0
}