#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 OutputStream {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ PrintCh(char, struct OutputStream *);
int /*<<< orphan*/ PrintUnsigned(unsigned long, int, int, int, int,
                                 struct OutputStream *);
void PrintInt(long Num, int FieldWidth, int ZeroPad, int LeftJustify,
              struct OutputStream *Stream) {
  if (Num < 0) {
    PrintCh('-', Stream);
    Num = -Num;
    if (FieldWidth != 0)
      FieldWidth--;
  }
  PrintUnsigned((unsigned long)Num, 10, FieldWidth, ZeroPad, LeftJustify,
                Stream);
}


x86 assembly (clang, -O0):
<PrintInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1174 <PrintInt+0x54>
mov    -0x20(%rbp),%rsi
mov    $0x2d,%edi
call   1030 <PrintCh@plt>
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     116f <PrintInt+0x4f>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1174 <PrintInt+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x20(%rbp),%r9
mov    $0xa,%esi
call   1040 <PrintUnsigned@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintInt>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8,%r12
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %esi,%ebp
mov    %rdi,%rbx
test   %rdi,%rdi
jns    1153 <PrintInt+0x33>
mov    $0x2d,%edi
mov    %r12,%rsi
call   1030 <PrintCh@plt>
neg    %rbx
xor    %eax,%eax
sub    $0x1,%ebp
cmovb  %eax,%ebp
mov    %rbx,%rdi
mov    $0xa,%esi
mov    %ebp,%edx
mov    %r15d,%ecx
mov    %r14d,%r8d
mov    %r12,%r9
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <PrintUnsigned@plt>

LLVM IR (-O0):
%struct.OutputStream = type { i32 }
define void @PrintInt(i64 %0, i32 %1, i32 %2, i32 %3, %struct.OutputStream* %4) {
%6 = alloca i64
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca %struct.OutputStream*
store i64 %0, i64* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store %struct.OutputStream* %4, %struct.OutputStream** %10
%11 = load i64, i64* %6
%12 = icmp slt i64 %11, 0
br i1 %12, label %13, label %24
13: ; preds = %5
%14 = load %struct.OutputStream*, %struct.OutputStream** %10
%15 = call i32 @PrintCh(i8 signext 45, %struct.OutputStream* %14)
%16 = load i64, i64* %6
%17 = sub nsw i64 0, %16
store i64 %17, i64* %6
%18 = load i32, i32* %7
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %23
20: ; preds = %13
%21 = load i32, i32* %7
%22 = add nsw i32 %21, -1
store i32 %22, i32* %7
br label %23
23: ; preds = %20, %13
br label %24
24: ; preds = %23, %5
%25 = load i64, i64* %6
%26 = load i32, i32* %7
%27 = load i32, i32* %8
%28 = load i32, i32* %9
%29 = load %struct.OutputStream*, %struct.OutputStream** %10
%30 = call i32 @PrintUnsigned(i64 %25, i32 10, i32 %26, i32 %27, i32 %28, %struct.OutputStream* %29)
ret void
}

LLVM IR (-O2):
%struct.OutputStream = type { i32 }
define void @PrintInt(i64 %0, i32 %1, i32 %2, i32 %3, %struct.OutputStream* %4) {
%6 = icmp slt i64 %0, 0
br i1 %6, label %7, label %13
7: ; preds = %5
%8 = tail call i32 @PrintCh(i8 signext 45, %struct.OutputStream* %4)
%9 = sub nsw i64 0, %0
%10 = icmp eq i32 %1, 0
%11 = add nsw i32 %1, -1
%12 = select i1 %10, i32 0, i32 %11
br label %13
13: ; preds = %7, %5
%14 = phi i32 [ %1, %5 ], [ %12, %7 ]
%15 = phi i64 [ %0, %5 ], [ %9, %7 ]
%16 = tail call i32 @PrintUnsigned(i64 %15, i32 10, i32 %14, i32 %2, i32 %3, %struct.OutputStream* %4)
ret void
}