#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 */
typedef int uint8_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int, char *);
void pr_TTI(FILE *fp, uint8_t TTI) {
  fprintf(fp, "TTI=%d:Threat type indicator:%s\n", TTI,
          TTI == 0   ? "No identity data in TID"
          : TTI == 1 ? "TID contains Mode S transponder address"
          : TTI == 2 ? "TID contains altitude, range and bearing data"
                     : "Not assigned");
}


x86 assembly (clang, -O0):
<pr_TTI>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1147 <pr_TTI+0x37>
lea    0xee3(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    1185 <pr_TTI+0x75>
cmpl   $0x1,-0xc(%rbp)
jne    1161 <pr_TTI+0x51>
lea    0xee1(%rip),%rax
mov    %rax,-0x28(%rbp)
jmp    117d <pr_TTI+0x6d>
mov    -0xc(%rbp),%edx
lea    0xf24(%rip),%rax
lea    0xeef(%rip),%rcx
cmp    $0x2,%edx
cmove  %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rcx
lea    0xe69(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pr_TTI>:
mov    %esi,%edx
test   %esi,%esi
je     112e <pr_TTI+0x1e>
cmp    $0x1,%edx
jne    1141 <pr_TTI+0x31>
lea    0xf17(%rip),%rcx
lea    0xed7(%rip),%rsi
jmp    1030 <fprintf@plt>
lea    0xeec(%rip),%rcx
lea    0xec4(%rip),%rsi
jmp    1030 <fprintf@plt>
cmp    $0x2,%edx
lea    0xf16(%rip),%rax
lea    0xf3d(%rip),%rcx
cmove  %rax,%rcx
lea    0xea3(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"TTI=%d:Threat type indicator:%s\0A\00"
@.str.1 = [24 x i8] c"No identity data in TID\00"
@.str.2 = [40 x i8] c"TID contains Mode S transponder address\00"
@.str.3 = [46 x i8] c"TID contains altitude, range and bearing data\00"
@.str.4 = [13 x i8] c"Not assigned\00"
define void @pr_TTI(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %2
br label %21
10: ; preds = %2
%11 = load i32, i32* %4
%12 = icmp eq i32 %11, 1
br i1 %12, label %13, label %14
13: ; preds = %10
br label %19
14: ; preds = %10
%15 = load i32, i32* %4
%16 = icmp eq i32 %15, 2
%17 = zext i1 %16 to i64
%18 = select i1 %16, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0)
br label %19
19: ; preds = %14, %13
%20 = phi i8* [ getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), %13 ], [ %18, %14 ]
br label %21
21: ; preds = %19, %9
%22 = phi i8* [ getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), %9 ], [ %20, %19 ]
%23 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %6, i8* %22)
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"TTI=%d:Threat type indicator:%s\0A\00"
@.str.1 = [24 x i8] c"No identity data in TID\00"
@.str.2 = [40 x i8] c"TID contains Mode S transponder address\00"
@.str.3 = [46 x i8] c"TID contains altitude, range and bearing data\00"
@.str.4 = [13 x i8] c"Not assigned\00"
define void @pr_TTI(i32* nocapture %0, i32 %1) {
switch i32 %1, label %3 [
i32 0, label %7
i32 1, label %6
]
3: ; preds = %2
%4 = icmp eq i32 %1, 2
%5 = select i1 %4, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0)
br label %7
6: ; preds = %2
br label %7
7: ; preds = %2, %6, %3
%8 = phi i8* [ getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), %2 ], [ %5, %3 ], [ getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), %6 ]
%9 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %8)
ret void
}