#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*/ SIGINT;
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ raise(int /*<<< orphan*/);
void _t_path_parent(int *n, int *p) {
  if (*p == -9999) {
    puts("unable to take parent of root\n");
    puts("\n");
    raise(SIGINT);
    ;
  }
  while (*p != -9999) {
    *n++ = *p++;
  }
  *--n = -9999;
}


x86 assembly (clang, -O0):
<_t_path_parent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0xffffd8f1,(%rax)
jne    1166 <_t_path_parent+0x46>
lea    0xeb9(%rip),%rdi
call   1040 <puts@plt>
lea    0xeca(%rip),%rdi
call   1040 <puts@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
jmp    116b <_t_path_parent+0x4b>
mov    -0x10(%rbp),%rax
cmpl   $0xffffd8f1,(%rax)
je     11a2 <_t_path_parent+0x82>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x8(%rbp)
mov    %ecx,(%rax)
jmp    116b <_t_path_parent+0x4b>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0xfffffffffffffffc,%rcx
mov    %rcx,-0x8(%rbp)
movl   $0xffffd8f1,-0x4(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_t_path_parent>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    (%rsi),%eax
cmp    $0xffffd8f1,%eax
jne    1162 <_t_path_parent+0x42>
lea    0xec6(%rip),%rdi
call   1040 <puts@plt>
lea    0xed7(%rip),%rdi
call   1040 <puts@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
mov    (%rbx),%eax
cmp    $0xffffd8f1,%eax
je     1184 <_t_path_parent+0x64>
add    $0x4,%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %eax,(%r14)
add    $0x4,%r14
mov    (%rbx),%eax
add    $0x4,%rbx
cmp    $0xffffd8f1,%eax
jne    1170 <_t_path_parent+0x50>
movl   $0xffffd8f1,-0x4(%r14)
ff
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [31 x i8] c"unable to take parent of root\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
@SIGINT = global i32 0
define void @_t_path_parent(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, -9999
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = call i32 @puts(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%11 = load i32, i32* @SIGINT
%12 = call i32 @raise(i32 %11)
br label %13
13: ; preds = %8, %2
br label %14
14: ; preds = %18, %13
%15 = load i32*, i32** %4
%16 = load i32, i32* %15
%17 = icmp ne i32 %16, -9999
br i1 %17, label %18, label %24
18: ; preds = %14
%19 = load i32*, i32** %4
%20 = getelementptr inbounds i32, i32* %19, i32 1
store i32* %20, i32** %4
%21 = load i32, i32* %19
%22 = load i32*, i32** %3
%23 = getelementptr inbounds i32, i32* %22, i32 1
store i32* %23, i32** %3
store i32 %21, i32* %22
br label %14
24: ; preds = %14
%25 = load i32*, i32** %3
%26 = getelementptr inbounds i32, i32* %25, i32 -1
store i32* %26, i32** %3
store i32 -9999, i32* %26
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"unable to take parent of root\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
@SIGINT = global i32 0
define void @_t_path_parent(i32* nocapture writeonly %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, -9999
br i1 %4, label %5, label %12
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* @SIGINT
%9 = tail call i32 @raise(i32 %8)
%10 = load i32, i32* %1
%11 = icmp eq i32 %10, -9999
br i1 %11, label %22, label %12
12: ; preds = %2, %5
%13 = phi i32 [ %3, %2 ], [ %10, %5 ]
br label %14
14: ; preds = %12, %14
%15 = phi i32 [ %20, %14 ], [ %13, %12 ]
%16 = phi i32* [ %18, %14 ], [ %1, %12 ]
%17 = phi i32* [ %19, %14 ], [ %0, %12 ]
%18 = getelementptr inbounds i32, i32* %16, i64 1
%19 = getelementptr inbounds i32, i32* %17, i64 1
store i32 %15, i32* %17
%20 = load i32, i32* %18
%21 = icmp eq i32 %20, -9999
br i1 %21, label %22, label %14
22: ; preds = %14, %5
%23 = phi i32* [ %0, %5 ], [ %19, %14 ]
%24 = getelementptr inbounds i32, i32* %23, i64 -1
store i32 -9999, i32* %24
ret void
}