#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*/ printf(char *, int, ...);
int tadd_ok(int, int);
int main() {
  int *p;
  int arr[] = {1, 2};
  int *p2;
  p2 = &arr[0];
  printf("A[0] is %d %p %d\n", arr[0], p2, *p2);
  int x = 1073741824 * 2 + 10;
  printf("%d is x\n", x);
  int t = tadd_ok(1073741824 * 2 - 1, -10);
  printf("%u \n", t);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x8000000a,-0x24(%rbp)
mov    -0x24(%rbp),%esi
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x7fffffff,%edi
mov    $0xfffffff6,%esi
call   1030 <tadd_ok@plt>
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%esi
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movabs $0x200000001,%rax
mov    %rax,(%rsp)
lea    0xeca(%rip),%rdi
mov    %rsp,%rdx
mov    $0x1,%esi
mov    $0x1,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec1(%rip),%rdi
mov    $0x8000000a,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x7fffffff,%edi
mov    $0xfffffff6,%esi
call   1030 <tadd_ok@plt>
lea    0xea8(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.arr = [2 x i32] [i32 1, i32 2]
@.str = [18 x i8] c"A[0] is %d %p %d\0A\00"
@.str.1 = [9 x i8] c"%d is x\0A\00"
@.str.2 = [5 x i8] c"%u \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca [2 x i32]
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = bitcast [2 x i32]* %3 to i8*
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
store i32* %8, i32** %4
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%10 = load i32, i32* %9
%11 = load i32*, i32** %4
%12 = load i32*, i32** %4
%13 = load i32, i32* %12
%14 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %10, i32* %11, i32 %13)
store i32 -2147483638, i32* %5
%15 = load i32, i32* %5
%16 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %15)
%17 = call i32 @tadd_ok(i32 2147483647, i32 -10)
store i32 %17, i32* %6
%18 = load i32, i32* %6
%19 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %18)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"A[0] is %d %p %d\0A\00"
@.str.1 = [9 x i8] c"%d is x\0A\00"
@.str.2 = [5 x i8] c"%u \0A\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
store i64 8589934593, i64* %1
%3 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 1, i64* %1, i32 1)
%4 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 -2147483638)
%5 = call i32 @tadd_ok(i32 2147483647, i32 -10)
%6 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}