#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*/ printf(char *, ...);
void targ_str(int id) {
  if (id == -1) {
    printf("UNKNOWN");
  } else if (id == -2) {
    printf("OUTPUT");
  } else if (id == -3) {
    printf("INPUT");
  } else {
    printf("<%d>", id);
  }
}


x86 assembly (clang, -O0):
<targ_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    1138 <targ_str+0x28>
lea    0xed4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    118d <targ_str+0x7d>
cmpl   $0xfffffffe,-0x4(%rbp)
jne    1155 <targ_str+0x45>
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1188 <targ_str+0x78>
cmpl   $0xfffffffd,-0x4(%rbp)
jne    1172 <targ_str+0x62>
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1183 <targ_str+0x73>
mov    -0x4(%rbp),%esi
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1188 <targ_str+0x78>
jmp    118d <targ_str+0x7d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<targ_str>:
cmp    $0xfffffffd,%edi
je     112f <targ_str+0x1f>
mov    %edi,%esi
cmp    $0xfffffffe,%edi
je     113d <targ_str+0x2d>
cmp    $0xffffffff,%esi
jne    114b <targ_str+0x3b>
lea    0xed8(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xed9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xec4(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xec3(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"UNKNOWN\00"
@.str.1 = [7 x i8] c"OUTPUT\00"
@.str.2 = [6 x i8] c"INPUT\00"
@.str.3 = [5 x i8] c"<%d>\00"
define void @targ_str(i32 %0) {
switch i32 %0, label %8 [
i32 -1, label %2
i32 -2, label %4
i32 -3, label %6
]
2: ; preds = %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %10
4: ; preds = %1
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %10
6: ; preds = %1
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %10
8: ; preds = %1
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 %0)
br label %10
10: ; preds = %4, %8, %6, %2
ret void
}