#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*/ write(int, char *, int);
void test_main(void) {
  char buf = 123;
  write(0x01012342, &buf, 1);
  write(7, &buf, 1);
  write(2546, &buf, 1);
  write(-5, &buf, 1);
  write(-8192, &buf, 1);
  write(INT_MIN + 1, &buf, 1);
  write(INT_MAX - 1, &buf, 1);
}


x86 assembly (clang, -O0):
<test_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x7b,-0x1(%rbp)
mov    $0x1012342,%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    $0x7,%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    $0x9f2,%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    $0xfffffffb,%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    $0xffffe000,%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    0x2e5e(%rip),%rax
mov    (%rax),%edi
add    $0x1,%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    0x2e4c(%rip),%rax
mov    (%rax),%edi
sub    $0x1,%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_main>:
push   %rbx
sub    $0x10,%rsp
movb   $0x7b,0xf(%rsp)
lea    0xf(%rsp),%rbx
mov    $0x1012342,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    $0x7,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    $0x9f2,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    $0xfffffffb,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    $0xffffe000,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    0x2e60(%rip),%rax
mov    (%rax),%edi
add    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    0x2e4f(%rip),%rax
mov    (%rax),%edi
add    $0xffffffff,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@INT_MIN = global i32 0
@INT_MAX = global i32 0
define void @test_main() {
%1 = alloca i8
store i8 123, i8* %1
%2 = call i32 @write(i32 16851778, i8* %1, i32 1)
%3 = call i32 @write(i32 7, i8* %1, i32 1)
%4 = call i32 @write(i32 2546, i8* %1, i32 1)
%5 = call i32 @write(i32 -5, i8* %1, i32 1)
%6 = call i32 @write(i32 -8192, i8* %1, i32 1)
%7 = load i32, i32* @INT_MIN
%8 = add nsw i32 %7, 1
%9 = call i32 @write(i32 %8, i8* %1, i32 1)
%10 = load i32, i32* @INT_MAX
%11 = sub nsw i32 %10, 1
%12 = call i32 @write(i32 %11, i8* %1, i32 1)
ret void
}

LLVM IR (-O2):
@INT_MIN = global i32 0
@INT_MAX = global i32 0
define void @test_main() {
%1 = alloca i8
store i8 123, i8* %1
%2 = call i32 @write(i32 16851778, i8* %1, i32 1)
%3 = call i32 @write(i32 7, i8* %1, i32 1)
%4 = call i32 @write(i32 2546, i8* %1, i32 1)
%5 = call i32 @write(i32 -5, i8* %1, i32 1)
%6 = call i32 @write(i32 -8192, i8* %1, i32 1)
%7 = load i32, i32* @INT_MIN
%8 = add nsw i32 %7, 1
%9 = call i32 @write(i32 %8, i8* %1, i32 1)
%10 = load i32, i32* @INT_MAX
%11 = add nsw i32 %10, -1
%12 = call i32 @write(i32 %11, i8* %1, i32 1)
ret void
}