#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 */
struct stack {
  int dummy;
};
struct point {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ abort();
struct point *create_point(int, int);
struct stack *create_stack();
int /*<<< orphan*/ stack_push(struct stack *, struct point *);
int /*<<< orphan*/ stack_reverse(struct stack *);
int main() {
  struct stack *s = create_stack();
  struct point *p1 = create_point(10, 0);
  struct point *p2 = create_point(0, 10);
  stack_push(s, p1);
  stack_push(s, p2);
  stack_reverse(s);
  abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <create_stack@plt>
mov    %rax,-0x10(%rbp)
mov    $0xa,%edi
xor    %esi,%esi
call   1040 <create_point@plt>
mov    %rax,-0x18(%rbp)
xor    %edi,%edi
mov    $0xa,%esi
call   1040 <create_point@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1070 <stack_push@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1070 <stack_push@plt>
mov    -0x10(%rbp),%rdi
call   1060 <stack_reverse@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
xor    %eax,%eax
call   1050 <create_stack@plt>
mov    %rax,%rbx
mov    $0xa,%edi
xor    %esi,%esi
call   1040 <create_point@plt>
mov    %rax,%r14
xor    %edi,%edi
mov    $0xa,%esi
call   1040 <create_point@plt>
mov    %rax,%r15
mov    %rbx,%rdi
mov    %r14,%rsi
call   1070 <stack_push@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1070 <stack_push@plt>
mov    %rbx,%rdi
call   1060 <stack_reverse@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
%struct.stack = type { i32 }
%struct.point = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.stack*
%3 = alloca %struct.point*
%4 = alloca %struct.point*
store i32 0, i32* %1
%5 = call %struct.stack* (...) @create_stack()
store %struct.stack* %5, %struct.stack** %2
%6 = call %struct.point* @create_point(i32 10, i32 0)
store %struct.point* %6, %struct.point** %3
%7 = call %struct.point* @create_point(i32 0, i32 10)
store %struct.point* %7, %struct.point** %4
%8 = load %struct.stack*, %struct.stack** %2
%9 = load %struct.point*, %struct.point** %3
%10 = call i32 @stack_push(%struct.stack* %8, %struct.point* %9)
%11 = load %struct.stack*, %struct.stack** %2
%12 = load %struct.point*, %struct.point** %4
%13 = call i32 @stack_push(%struct.stack* %11, %struct.point* %12)
%14 = load %struct.stack*, %struct.stack** %2
%15 = call i32 @stack_reverse(%struct.stack* %14)
%16 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
%struct.stack = type { i32 }
%struct.point = type { i32 }
define i32 @main() {
%1 = tail call %struct.stack* (...) @create_stack()
%2 = tail call %struct.point* @create_point(i32 10, i32 0)
%3 = tail call %struct.point* @create_point(i32 0, i32 10)
%4 = tail call i32 @stack_push(%struct.stack* %1, %struct.point* %2)
%5 = tail call i32 @stack_push(%struct.stack* %1, %struct.point* %3)
%6 = tail call i32 @stack_reverse(%struct.stack* %1)
%7 = tail call i32 (...) @abort()
unreachable
}