#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*/ gtp_printf(char *, ...);
void gtp_printid(int id, int status) {
  if (status == 0)
    gtp_printf("=");
  else
    gtp_printf("?");
  if (id < 0)
    gtp_printf(" ");
  else
    gtp_printf("%d ", id);
}


x86 assembly (clang, -O0):
<gtp_printid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    113b <gtp_printid+0x2b>
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <gtp_printf@plt>
jmp    1149 <gtp_printid+0x39>
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <gtp_printf@plt>
cmpl   $0x0,-0x4(%rbp)
jge    1166 <gtp_printid+0x56>
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <gtp_printf@plt>
jmp    1177 <gtp_printid+0x67>
mov    -0x4(%rbp),%esi
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1030 <gtp_printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gtp_printid>:
push   %rbx
mov    %edi,%ebx
test   %esi,%esi
lea    0xee4(%rip),%rax
lea    0xedf(%rip),%rdi
cmove  %rax,%rdi
xor    %eax,%eax
call   1030 <gtp_printf@plt>
test   %ebx,%ebx
js     1143 <gtp_printid+0x33>
lea    0xecb(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
pop    %rbx
jmp    1030 <gtp_printf@plt>
lea    0xebc(%rip),%rdi
xor    %eax,%eax
pop    %rbx
jmp    1030 <gtp_printf@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"=\00"
@.str.1 = [2 x i8] c"?\00"
@.str.2 = [2 x i8] c" \00"
@.str.3 = [4 x i8] c"%d \00"
define void @gtp_printid(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 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 (i8*, ...) @gtp_printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %11
9: ; preds = %2
%10 = call i32 (i8*, ...) @gtp_printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
%12 = load i32, i32* %3
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = call i32 (i8*, ...) @gtp_printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %19
16: ; preds = %11
%17 = load i32, i32* %3
%18 = call i32 (i8*, ...) @gtp_printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %17)
br label %19
19: ; preds = %16, %14
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"=\00"
@.str.1 = [2 x i8] c"?\00"
@.str.2 = [2 x i8] c" \00"
@.str.3 = [4 x i8] c"%d \00"
define void @gtp_printid(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = select i1 %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
%5 = tail call i32 (i8*, ...) @gtp_printf(i8* %4)
%6 = icmp slt i32 %0, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 (i8*, ...) @gtp_printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %11
9: ; preds = %2
%10 = tail call i32 (i8*, ...) @gtp_printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %0)
br label %11
11: ; preds = %9, %7
ret void
}