#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*/ VAR(int);
int /*<<< orphan*/ printUvar(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void printUlits(int *ptr) {
  while (*ptr != -1) {
    if (*ptr & 1)
      printf(" -");
    else
      printf(" ");
    printUvar(VAR(*ptr));
    ptr = ptr + 1;
  }
}


x86 assembly (clang, -O0):
<printUlits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0xffffffff,(%rax)
je     119b <printUlits+0x6b>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     116c <printUlits+0x3c>
lea    0xe9e(%rip),%rdi
call   1050 <printf@plt>
jmp    1178 <printUlits+0x48>
lea    0xe90(%rip),%rdi
call   1050 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1040 <VAR@plt>
mov    %eax,%edi
call   1030 <printUvar@plt>
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
jmp    113c <printUlits+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printUlits>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%eax
cmp    $0xffffffff,%eax
je     1192 <printUlits+0x52>
mov    %rdi,%rbx
add    $0x4,%rbx
lea    0xea7(%rip),%r14
jmp    1184 <printUlits+0x44>
nopl   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    -0x4(%rbx),%edi
call   1050 <VAR@plt>
mov    %eax,%edi
call   1040 <printUvar@plt>
mov    (%rbx),%eax
add    $0x4,%rbx
cmp    $0xffffffff,%eax
je     1192 <printUlits+0x52>
test   $0x1,%al
je     1160 <printUlits+0x20>
mov    %r14,%rdi
call   1060 <printf@plt>
jmp    116a <printUlits+0x2a>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c" -\00"
@.str.1 = [2 x i8] c" \00"
define void @printUlits(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
br label %3
3: ; preds = %16, %1
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, -1
br i1 %6, label %7, label %23
7: ; preds = %3
%8 = load i32*, i32** %2
%9 = load i32, i32* %8
%10 = and i32 %9, 1
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %7
%13 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %16
14: ; preds = %7
%15 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %16
16: ; preds = %14, %12
%17 = load i32*, i32** %2
%18 = load i32, i32* %17
%19 = call i32 @VAR(i32 %18)
%20 = call i32 @printUvar(i32 %19)
%21 = load i32*, i32** %2
%22 = getelementptr inbounds i32, i32* %21, i64 1
store i32* %22, i32** %2
br label %3
23: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c" -\00"
define void @printUlits(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, -1
br i1 %3, label %20, label %4
4: ; preds = %1, %13
%5 = phi i32 [ %18, %13 ], [ %2, %1 ]
%6 = phi i32* [ %17, %13 ], [ %0, %1 ]
%7 = and i32 %5, 1
%8 = icmp eq i32 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %4
%10 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %13
11: ; preds = %4
%12 = tail call i32 @putchar(i32 32)
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %6
%15 = tail call i32 @VAR(i32 %14)
%16 = tail call i32 @printUvar(i32 %15)
%17 = getelementptr inbounds i32, i32* %6, i64 1
%18 = load i32, i32* %17
%19 = icmp eq i32 %18, -1
br i1 %19, label %20, label %4
20: ; preds = %13, %1
ret void
}