#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 */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i = 0;
  uint32_t a[(32)], *atop = a;
  (*(atop)) = 0;
  (*(++(atop)) = 0xDEADBEEF);
  printf("%08X\n", (*(atop)));
  (*(++(atop)) = 0xCAFEBABE);
  printf("%08X\n", (*(atop)));
  (*(atop)--);
  printf("%08X\n", (*(atop)));
  (*(++(atop)) = 1);
  (*(++(atop)) = 2);
  (*(++(atop)) = 3);
  (*(++(atop)) = 4);
  (*(++(atop)) = 5);
  (*(++(atop)) = 6);
  while ((atop) != a) {
    printf("A: %08X\n", (*(atop)--));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    -0x90(%rbp),%rax
mov    %rax,-0x98(%rbp)
mov    -0x98(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x98(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x98(%rbp)
movl   $0xdeadbeef,0x4(%rax)
mov    -0x98(%rbp),%rax
mov    (%rax),%esi
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
mov    -0x98(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x98(%rbp)
movl   $0xcafebabe,0x4(%rax)
mov    -0x98(%rbp),%rax
mov    (%rax),%esi
lea    0xe62(%rip),%rdi
call   1030 <printf@plt>
mov    -0x98(%rbp),%rax
add    $0xfffffffffffffffc,%rax
mov    %rax,-0x98(%rbp)
mov    -0x98(%rbp),%rax
mov    (%rax),%esi
lea    0xe3b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x98(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x98(%rbp)
movl   $0x1,0x4(%rax)
mov    -0x98(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x98(%rbp)
movl   $0x2,0x4(%rax)
mov    -0x98(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x98(%rbp)
movl   $0x3,0x4(%rax)
mov    -0x98(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x98(%rbp)
movl   $0x4,0x4(%rax)
mov    -0x98(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x98(%rbp)
movl   $0x5,0x4(%rax)
mov    -0x98(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x98(%rbp)
movl   $0x6,0x4(%rax)
mov    -0x98(%rbp),%rax
lea    -0x90(%rbp),%rcx
cmp    %rcx,%rax
je     12b4 <main+0x1a4>
mov    -0x98(%rbp),%rax
mov    %rax,%rcx
add    $0xfffffffffffffffc,%rcx
mov    %rcx,-0x98(%rbp)
mov    (%rax),%esi
lea    0xd56(%rip),%rdi
call   1030 <printf@plt>
jmp    1275 <main+0x165>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xeeb(%rip),%rbx
mov    %rbx,%rdi
mov    $0xdeadbeef,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xcafebabe,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xdeadbeef,%esi
call   1030 <printf@plt>
lea    0xeba(%rip),%rbx
mov    %rbx,%rdi
mov    $0x6,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xdeadbeef,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%08X\0A\00"
@.str.1 = [9 x i8] c"A: %08X\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [32 x i32]
%4 = alloca i32*
store i32 0, i32* %1
store i32 0, i32* %2
%5 = getelementptr inbounds [32 x i32], [32 x i32]* %3, i64 0, i64 0
store i32* %5, i32** %4
%6 = load i32*, i32** %4
store i32 0, i32* %6
%7 = load i32*, i32** %4
%8 = getelementptr inbounds i32, i32* %7, i32 1
store i32* %8, i32** %4
store i32 -559038737, i32* %8
%9 = load i32*, i32** %4
%10 = load i32, i32* %9
%11 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = load i32*, i32** %4
%13 = getelementptr inbounds i32, i32* %12, i32 1
store i32* %13, i32** %4
store i32 -889275714, i32* %13
%14 = load i32*, i32** %4
%15 = load i32, i32* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = load i32*, i32** %4
%18 = getelementptr inbounds i32, i32* %17, i32 -1
store i32* %18, i32** %4
%19 = load i32, i32* %17
%20 = load i32*, i32** %4
%21 = load i32, i32* %20
%22 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %21)
%23 = load i32*, i32** %4
%24 = getelementptr inbounds i32, i32* %23, i32 1
store i32* %24, i32** %4
store i32 1, i32* %24
%25 = load i32*, i32** %4
%26 = getelementptr inbounds i32, i32* %25, i32 1
store i32* %26, i32** %4
store i32 2, i32* %26
%27 = load i32*, i32** %4
%28 = getelementptr inbounds i32, i32* %27, i32 1
store i32* %28, i32** %4
store i32 3, i32* %28
%29 = load i32*, i32** %4
%30 = getelementptr inbounds i32, i32* %29, i32 1
store i32* %30, i32** %4
store i32 4, i32* %30
%31 = load i32*, i32** %4
%32 = getelementptr inbounds i32, i32* %31, i32 1
store i32* %32, i32** %4
store i32 5, i32* %32
%33 = load i32*, i32** %4
%34 = getelementptr inbounds i32, i32* %33, i32 1
store i32* %34, i32** %4
store i32 6, i32* %34
br label %35
35: ; preds = %39, %0
%36 = load i32*, i32** %4
%37 = getelementptr inbounds [32 x i32], [32 x i32]* %3, i64 0, i64 0
%38 = icmp ne i32* %36, %37
br i1 %38, label %39, label %44
39: ; preds = %35
%40 = load i32*, i32** %4
%41 = getelementptr inbounds i32, i32* %40, i32 -1
store i32* %41, i32** %4
%42 = load i32, i32* %40
%43 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %42)
br label %35
44: ; preds = %35
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%08X\0A\00"
@.str.1 = [9 x i8] c"A: %08X\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 -559038737)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 -889275714)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 -559038737)
%4 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 6)
%5 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 5)
%6 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 4)
%7 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 3)
%8 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 2)
%9 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 1)
%10 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 -559038737)
ret i32 0
}